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] Set dynobj to a normal input file if possible


On Thu, Apr 21, 2016 at 8:39 PM, Hans-Peter Nilsson
<hans-peter.nilsson@axis.com> wrote:
>> Date: Wed, 20 Apr 2016 20:31:50 -0700
>> From: "H.J. Lu" <hongjiu.lu@intel.com>
>
>>       * elflink.c (_bfd_elf_link_create_dynstrtab): Set dynobj to a
>>       normal input file if possible.
>
> Looks like this caused, for a cross -m32 build to arm-unknown-eabi:
>
> Running /tmp/hpautotest-binutils/bsrc/src/ld/testsuite/ld-arm/arm-elf.exp ...
> FAIL: Indirect cross-library function reference
> FAIL: TLS dynamic application
> FAIL: GOT relocations in executables
> FAIL: Thumb and -gc-sections
> FAIL: Simple dynamic application
> FAIL: Simple dynamic application without .rel.plt in linker script
> FAIL: Non-pcrel function reference
> FAIL: Mixed ARM/Thumb dynamic application
> FAIL: Mixed ARM/Thumb arch5 dynamic application
> FAIL: Using Thumb lib by another lib
> FAIL: MOVW/MOVT against shared libraries
> FAIL: Mixed ARM/Thumb dynamic application with farcalls
> FAIL: Mixed ARM/Thumb arch5 dynamic application with farcalls
> FAIL: TLS long plt
> FAIL: IFUNC test 7
> FAIL: IFUNC test 8
> FAIL: IFUNC test 9
> FAIL: IFUNC test 10
> FAIL: IFUNC test 13
> FAIL: IFUNC test 14
> FAIL: IFUNC test 15
> FAIL: IFUNC test 16
> FAIL: Preempt Thumb symbol
> FAIL: ld-arm/unresolved-1-dyn
>
> brgds, H-P

I checked in this fix.  Sorry that.

-- 
H.J.
From 6645479e9dc9470d22393d5bc4ef2ef2d391e848 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Thu, 21 Apr 2016 21:45:57 -0700
Subject: [PATCH] Exclude linker created file from dynobj

Some ELF targets create a "linker stubs" fake bfd.  Don't use it to
set dynobj.

	* elflink.c (_bfd_elf_link_create_dynstrtab): Exclude linker
	created file from dynobj.
---
 bfd/ChangeLog | 5 +++++
 bfd/elflink.c | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index d668652..a8a29bd 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
 2016-04-21  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* elflink.c (_bfd_elf_link_create_dynstrtab): Exclude linker
+	created file from dynobj.
+
+2016-04-21  H.J. Lu  <hongjiu.lu@intel.com>
+
 	* elflink.c (_bfd_elf_link_create_dynstrtab): Set dynobj to a
 	normal input file if possible.
 
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 13233cb..6f67266 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -213,7 +213,8 @@ _bfd_elf_link_create_dynstrtab (bfd *abfd, struct bfd_link_info *info)
 	{
 	  bfd *ibfd;
 	  for (ibfd = info->input_bfds; ibfd; ibfd = ibfd->link.next)
-	    if ((ibfd->flags & (DYNAMIC | BFD_PLUGIN)) == 0)
+	    if ((ibfd->flags
+		 & (DYNAMIC | BFD_LINKER_CREATED | BFD_PLUGIN)) == 0)
 	      {
 		abfd = ibfd;
 		break;
-- 
2.5.5


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