PATCH: Replace Elf64_XXX with ElfW(XXX) in dl-irel.h
H.J. Lu
hjl.tools@gmail.com
Thu Mar 22 15:44:00 GMT 2012
On Wed, Mar 21, 2012 at 2:54 PM, Roland McGrath <roland@hack.frob.com> wrote:
>> 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.
>
>
Here is the patch to implement it. Tested on Linux/x86-64 and Linux/x32.
OK to install?
Thanks.
--
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libc-dl-irel.patch
Type: text/x-patch
Size: 1632 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120322/8a2b50bd/attachment.bin>
More information about the Libc-alpha
mailing list