aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorThomas Preud'homme <thomas.preudhomme@arm.com>2016-05-10 15:45:01 +0100
committerThomas Preud'homme <thomas.preudhomme@arm.com>2016-05-10 15:45:01 +0100
commit6bde4c52fb2d49572d365612f222a42b4d316f09 (patch)
tree8613279278011e93d1bbb01fd96651afdae35a45 /bfd/elf32-arm.c
parentb715f643ef3810bd77d50cc97fe4f7a3116b1556 (diff)
downloadgdb-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 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 9adc43e..e1ee673 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -3163,7 +3163,8 @@ struct elf32_arm_link_hash_table
bfd *stub_bfd;
/* Linker call-backs. */
- asection * (*add_stub_section) (const char *, asection *, unsigned int);
+ asection * (*add_stub_section) (const char *, asection *, asection *,
+ unsigned int);
void (*layout_sections_again) (void);
/* Array to keep track of which stub sections have been created, and
@@ -4144,6 +4145,7 @@ elf32_arm_create_or_find_stub_sec (asection **link_sec_p, asection *section,
{
asection *link_sec;
asection *stub_sec;
+ asection *out_sec;
link_sec = htab->stub_group[section->id].link_sec;
BFD_ASSERT (link_sec != NULL);
@@ -4166,7 +4168,8 @@ elf32_arm_create_or_find_stub_sec (asection **link_sec_p, asection *section,
memcpy (s_name, link_sec->name, namelen);
memcpy (s_name + namelen, STUB_SUFFIX, sizeof (STUB_SUFFIX));
- stub_sec = (*htab->add_stub_section) (s_name, link_sec,
+ out_sec = link_sec->output_section;
+ stub_sec = (*htab->add_stub_section) (s_name, out_sec, link_sec,
htab->nacl_p ? 4 : 3);
if (stub_sec == NULL)
return NULL;
@@ -4202,6 +4205,8 @@ elf32_arm_add_stub (const char *stub_name,
TRUE, FALSE);
if (stub_entry == NULL)
{
+ if (section == NULL)
+ section = stub_sec;
(*_bfd_error_handler) (_("%s: cannot create stub entry %s"),
section->owner,
stub_name);
@@ -5216,6 +5221,7 @@ elf32_arm_size_stubs (bfd *output_bfd,
struct bfd_link_info *info,
bfd_signed_vma group_size,
asection * (*add_stub_section) (const char *, asection *,
+ asection *,
unsigned int),
void (*layout_sections_again) (void))
{