From 6645479e9dc9470d22393d5bc4ef2ef2d391e848 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" 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 d668652e4b8..a8a29bd298f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2016-04-21 H.J. Lu + + * elflink.c (_bfd_elf_link_create_dynstrtab): Exclude linker + created file from dynobj. + 2016-04-21 H.J. Lu * elflink.c (_bfd_elf_link_create_dynstrtab): Set dynobj to a diff --git a/bfd/elflink.c b/bfd/elflink.c index 13233cb50be..6f6726648fd 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.30.2