PATCH: Replace Elf64_XXX with ElfW(XXX) in dl-irel.h

Roland McGrath roland@hack.frob.com
Wed Mar 21 21:54:00 GMT 2012


> This patch replaces Elf64_XXX with ElfW(XXX) in dl-irel.h.  It also
> uses ELF32_R_TYPE:
> 
> #define ELF32_R_TYPE(val)		((val) & 0xff)
> 
> instead ELF64_R_TYPE:
> 
> #define ELF64_R_TYPE(i)			((i) & 0xffffffff)
> 
> gets the currect relocation type for both ELF32 and ELF64 for x86-64 since
> x86-64 relocation type is less than 256.  OK to install?

That is a kludgey and dangerous assumption.  It would be better to have an
ELFW macro like ElfW, so you can use "ELFW(R_TYPE) (reloc->r_info)".  It's
probably not a good idea to add a name like ELFW to the public header, even
though ElfW is already there.  So the new macro would go in include/link.h.


Thanks,
Roland



More information about the Libc-alpha mailing list