Skip to content
Snippets Groups Projects
Commit d38cd7c8 authored by Vivek Das Mohapatra's avatar Vivek Das Mohapatra
Browse files

ElfW(Rel) is not 32/64 bit symmetric

The r_addend member is ElfW(Sxword) in 64 bit ELF but ElfW(Sword)
in 32 bit mode. This mostly doesn't matter but if we want to quash
a pointer/integer size-mismatch warning we need to have a different
protoype for the address offset calculator helper in each model.
parent 86d8bf11
No related branches found
No related tags found
1 merge request!311Build capsule-capture-libs from a bundled copy of libcapsule
......@@ -31,7 +31,13 @@
#include "mmap-info.h"
static void *
#if __ELF_NATIVE_CLASS == 32
addr (ElfW(Addr) base, ElfW(Addr) ptr, ElfW(Sword) addend)
#elif __ELF_NATIVE_CLASS == 64
addr (ElfW(Addr) base, ElfW(Addr) ptr, ElfW(Sxword) addend)
#else
#error "Unsupported __ELF_NATIVE_CLASS size (not 32 or 64)"
#endif
{
if( (ptr + addend) > base )
return (void *)(ptr + addend);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment