This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Fri, Jun 12, 2009 at 11:01 PM, Ulrich Drepper<drepper@redhat.com> wrote: > >> The other issue can be seen with: >> gcc -O2 -fpic -shared -o ifunc3lib1.{so,c} >> gcc -O2 -o ifunc3 ./ifunc3lib1.so >> ./ifunc3lib1 >> Here, &lib1t3 in the binary resolves to a .plt slot in the binary, while >> &lib1t3 in the shared library resolves to the actual address the ifunc >> returned. >> Not sure what exactly we want to do here, but the function pointers should >> be the same. > > It's tricky alright. ?There really isn't a good answer for this. ?The > existing behavior is the only sensible solution. ?One could try to make > things more complicated by changing the linker to associate the symbol > with the PLT slot and somehow allow ld.so to recognize such symbols, but > I think it's not worth it. > > This all comes about only because IFUNCs are used in situations where > they really were not meant to be used. ?IFUNC are supposed to be > definitions in DSOs which can be used in place of FUNC symbols. ?This > will work without changes to any semantics. > > In your test case you're creating and IFUNC symbol in the executable. > While I have no problem with supporting it this does mean the program > author take responsibility for doing this. ?I think we can in this case > very well live with the difference in function addresses. > > Therefore I suggest to leave this case and just document it. > Hi, I am checking in this patch to disallow dynamic IFUNC pointer in non-shared object. -- H.J. --- bfd/ 2009-06-14 H.J. Lu <hongjiu.lu@intel.com> PR ld/10270 * elf32-i386.c (elf_i386_allocate_dynrelocs): Disallow dynamic IFUNC pointer in non-shared object. Use .got.plt for IFUNC definition in PIE. (elf_i386_allocate_dynrelocs): Resolve IFUNC definition in PIE locally. * elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Disallow dynamic IFUNC pointer in non-shared object. Use .got.plt for IFUNC definition in PIE. (elf64_x86_64_relocate_section): Resolve IFUNC definition in PIE locally. ld/testsuite/ 2009-06-14 H.J. Lu <hongjiu.lu@intel.com> PR ld/10270 * ld-ifunc/ifunc-9-x86.d: New. * ld-ifunc/ifunc-9-x86.s: Likewise.
Attachment:
ld-pr10270-2.patch
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |