This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Re: PATCH: PR ld/10270: IFUNC local symbol


On Mon, Jun 15, 2009 at 10:52 AM, H.J. Lu<hjl.tools@gmail.com> wrote:
> On Mon, Jun 15, 2009 at 7:24 AM, H.J. Lu<hjl.tools@gmail.com> wrote:
>> On Mon, Jun 15, 2009 at 6:08 AM, H.J. Lu<hjl.tools@gmail.com> wrote:
>>> On Mon, Jun 15, 2009 at 12:20 AM, Jakub Jelinek<jakub@redhat.com> wrote:
>>>> On Sun, Jun 14, 2009 at 03:10:18PM -0700, H.J. Lu wrote:
>>>>> + ? ? ? info->callbacks->einfo
>>>>> + ? ? ? ? (_("%F%P: dynamic STT_GNU_IFUNC symbool `%s' with pointer "
>>>>
>>>> s/symbool/symbol/g (occurs many times in the patch)?
>>>
>>> I will fix them.
>>>
>>>> I don't like this solution much (and doesn't just compiling with -fpie or -fpic
>>>> suffice?), but can live with it.
>>>>
>>>
>>> You need PIE for it. Otherwise, you have to use the PLT entry in executable.
>>>
>>>
>>
>> It may work. I will take ?a look.
>>
>
> Using -fPIE without -pie is very complicated. I will leave it alone.
>
>

I am checking in this patch to clarify the comments.


-- 
H.J.
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/bfd/ChangeLog,v
retrieving revision 1.4637
diff -u -p -r1.4637 ChangeLog
--- ChangeLog	15 Jun 2009 17:23:43 -0000	1.4637
+++ ChangeLog	15 Jun 2009 18:24:05 -0000
@@ -1,5 +1,10 @@
 2009-06-15  H.J. Lu  <hongjiu.lu@intel.com>

+	* elf32-i386.c (elf_i386_allocate_dynrelocs): Update comments.
+	* elf64-x86-64.c (elf64_x86_64_allocate_dynrelocs): Likewise.
+
+2009-06-15  H.J. Lu  <hongjiu.lu@intel.com>
+
 	* elf32-i386.c (elf_i386_check_relocs): Reformat.
 	* elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.

Index: elf32-i386.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-i386.c,v
retrieving revision 1.209
diff -u -p -r1.209 elf32-i386.c
--- elf32-i386.c	15 Jun 2009 17:23:43 -0000	1.209
+++ elf32-i386.c	15 Jun 2009 18:24:05 -0000
@@ -2141,11 +2141,11 @@ elf_i386_allocate_dynrelocs (struct elf_
       asection *plt, *gotplt, *relplt;

       /* When a shared library references a STT_GNU_IFUNC symbol
-	 defined in executable. the .got.plt slot in the shared library
-	 will contain address of the .plt slot in the binary and only
-	 its .got.plt will contain the resolved function that should be
-	 called.  Pointer equality won't work correctly.  PIE should
-	 be used if pointer equality is required here.  */
+	 defined in executable, the address of the resolved function
+	 may be used.  But in non-shared executable, the address of
+	 its .plt slot may be used.  Pointer equality may not work
+	 correctly.  PIE should be used if pointer equality is
+	 required here.  */
       if (!info->shared
 	  && (h->dynindx != -1
 	      || info->export_dynamic)
Index: elf64-x86-64.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-x86-64.c,v
retrieving revision 1.167
diff -u -p -r1.167 elf64-x86-64.c
--- elf64-x86-64.c	15 Jun 2009 17:23:43 -0000	1.167
+++ elf64-x86-64.c	15 Jun 2009 18:24:05 -0000
@@ -1983,11 +1983,11 @@ elf64_x86_64_allocate_dynrelocs (struct
       asection *plt, *gotplt, *relplt;

       /* When a shared library references a STT_GNU_IFUNC symbol
-	 defined in executable. the .got.plt slot in the shared library
-	 will contain address of the .plt slot in the binary and only
-	 its .got.plt will contain the resolved function that should be
-	 called.  Pointer equality won't work correctly.  PIE should
-	 be used if pointer equality is required here.  */
+	 defined in executable, the address of the resolved function
+	 may be used.  But in non-shared executable, the address of
+	 its .plt slot may be used.  Pointer equality may not work
+	 correctly.  PIE should be used if pointer equality is
+	 required here.  */
       if (!info->shared
 	  && (h->dynindx != -1
 	      || info->export_dynamic)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]