This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PATCH: Replace Elf64_XXX with ElfW(XXX) in dl-irel.h
- From: Roland McGrath <roland at hack dot frob dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 21 Mar 2012 14:54:06 -0700 (PDT)
- Subject: Re: PATCH: Replace Elf64_XXX with ElfW(XXX) in dl-irel.h
- References: <20120320003356.GA29917@intel.com>
> 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