diff options
author | Thomas Preud'homme <thomas.preudhomme@arm.com> | 2016-05-10 15:45:01 +0100 |
---|---|---|
committer | Thomas Preud'homme <thomas.preudhomme@arm.com> | 2016-05-10 15:45:01 +0100 |
commit | 6bde4c52fb2d49572d365612f222a42b4d316f09 (patch) | |
tree | 8613279278011e93d1bbb01fd96651afdae35a45 /ld | |
parent | b715f643ef3810bd77d50cc97fe4f7a3116b1556 (diff) | |
download | gdb-6bde4c52fb2d49572d365612f222a42b4d316f09.zip gdb-6bde4c52fb2d49572d365612f222a42b4d316f09.tar.gz gdb-6bde4c52fb2d49572d365612f222a42b4d316f09.tar.bz2 |
Allow stubs without associated input section in ARM backend
2016-05-10 Thomas Preud'homme <thomas.preudhomme@arm.com>
bfd/
* bfd-in.h (elf32_arm_size_stubs): Add an output section parameter.
* bfd-in2.h: Regenerated.
* elf32-arm.c (struct elf32_arm_link_hash_table): Add an output section
parameter to add_stub_section callback.
(elf32_arm_create_or_find_stub_sec): Get output section from link_sec
and pass it down to add_stub_section.
(elf32_arm_add_stub): Set section to stub_sec if NULL before using it
for error message.
(elf32_arm_size_stubs): Add output section parameter to
add_stub_section function pointer parameter.
ld/
* emultempl/armelf.em (elf32_arm_add_stub_section): Add output_section
parameter and rename input_section parameter to after_input_section.
Append input stub section to the output section if after_input_section
is NULL.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 7 | ||||
-rw-r--r-- | ld/emultempl/armelf.em | 28 |
2 files changed, 29 insertions, 6 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 752f766..e7a4316 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,12 @@ 2016-05-10 Thomas Preud'homme <thomas.preudhomme@arm.com> + * emultempl/armelf.em (elf32_arm_add_stub_section): Add output_section + parameter and rename input_section parameter to after_input_section. + Append input stub section to the output section if after_input_section + is NULL. + +2016-05-10 Thomas Preud'homme <thomas.preudhomme@arm.com> + * testsuite/ld-arm/arm-elf.exp (EABI attribute merging 10 (DSP)): New test. * testsuite/ld-arm/attr-merge-10b-dsp.s: New file. diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em index 2e43172..bfb7ee4 100644 --- a/ld/emultempl/armelf.em +++ b/ld/emultempl/armelf.em @@ -203,12 +203,12 @@ hook_in_stub (struct hook_stub_info *info, lang_statement_union_type **lp) static asection * elf32_arm_add_stub_section (const char * stub_sec_name, - asection * input_section, + asection * output_section, + asection * after_input_section, unsigned int alignment_power) { asection *stub_sec; flagword flags; - asection *output_section; lang_output_section_statement_type *os; struct hook_stub_info info; @@ -221,18 +221,34 @@ elf32_arm_add_stub_section (const char * stub_sec_name, bfd_set_section_alignment (stub_file->the_bfd, stub_sec, alignment_power); - output_section = input_section->output_section; os = lang_output_section_get (output_section); - info.input_section = input_section; + info.input_section = after_input_section; lang_list_init (&info.add); lang_add_section (&info.add, stub_sec, NULL, os); if (info.add.head == NULL) goto err_ret; - if (hook_in_stub (&info, &os->children.head)) - return stub_sec; + if (after_input_section == NULL) + { + lang_statement_union_type **lp = &os->children.head; + lang_statement_union_type *l, *lprev = NULL; + + for (; (l = *lp) != NULL; lp = &l->header.next, lprev = l); + + if (lprev) + lprev->header.next = info.add.head; + else + os->children.head = info.add.head; + + return stub_sec; + } + else + { + if (hook_in_stub (&info, &os->children.head)) + return stub_sec; + } err_ret: einfo ("%X%P: can not make stub section: %E\n"); |