aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorTerry Guo <terry.guo@arm.com>2014-11-20 13:54:27 +0800
committerTerry Guo <terry.guo@arm.com>2014-11-20 13:54:27 +0800
commit9274e9de160a98d737bb2bd068c22d37ec66d98d (patch)
tree0282392448b637559a928cc7569755dd0d2f7964 /bfd
parent430ce64f28318ef6f8e24b38af6c79741560b4f5 (diff)
downloadgdb-9274e9de160a98d737bb2bd068c22d37ec66d98d.zip
gdb-9274e9de160a98d737bb2bd068c22d37ec66d98d.tar.gz
gdb-9274e9de160a98d737bb2bd068c22d37ec66d98d.tar.bz2
Enable to link ARM object file that hasn't attribute section.
bfd/ChangeLog 2014-11-20 Terry Guo <terry.guo@arm.com> * elf32-arm.c (elf32_arm_merge_eabi_attributes): Skip if input bfd hasn't attribute section. ld/testsuite/ChangeLog: 2014-11-20 Terry Guo <terry.guo@arm.com> * ld-arm/attr-merge-nosection-1.d: New file. * ld-arm/attr-merge-nosection-1a.s: Likewise. * ld-arm/attr-merge-nosection-1b.s: Likewise. * ld-arm/arm-elf.exp: Include the new test.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-arm.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 2657306..eaf7a99 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-20 Terry Guo <terry.guo@arm.com>
+
+ * elf32-arm.c (elf32_arm_merge_eabi_attributes): Skip if input bfd
+ hasn't attribute section.
+
2014-11-20 Alan Modra <amodra@gmail.com>
* elf64-ppc.c (ppc64_elf_size_stubs): Add __go_go to thread_starters.
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 49d0f65..95f59d5 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -11700,6 +11700,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
static const int order_021[3] = {0, 2, 1};
int i;
bfd_boolean result = TRUE;
+ const char *sec_name = get_elf_backend_data (ibfd)->obj_attrs_section;
/* Skip the linker stubs file. This preserves previous behavior
of accepting unknown attributes in the first input file - but
@@ -11707,6 +11708,12 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
if (ibfd->flags & BFD_LINKER_CREATED)
return TRUE;
+ /* Skip any input that hasn't attribute section.
+ This enables to link object files without attribute section with
+ any others. */
+ if (bfd_get_section_by_name (ibfd, sec_name) == NULL)
+ return TRUE;
+
if (!elf_known_obj_attributes_proc (obfd)[0].i)
{
/* This is the first object. Copy the attributes. */