diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2011-03-14 15:53:58 +0000 |
---|---|---|
committer | Richard Sandiford <rdsandiford@googlemail.com> | 2011-03-14 15:53:58 +0000 |
commit | cbc704f39759a08018b92ff51dc00144ed718eb7 (patch) | |
tree | 56b70a4f314dba8fadbf6f558896e632896d5786 /bfd | |
parent | f6e32f6db5fd9c527d978a27dbeef9f2f36f212a (diff) | |
download | gdb-cbc704f39759a08018b92ff51dc00144ed718eb7.zip gdb-cbc704f39759a08018b92ff51dc00144ed718eb7.tar.gz gdb-cbc704f39759a08018b92ff51dc00144ed718eb7.tar.bz2 |
bfd/
* elf32-arm.c (elf32_arm_check_relocs): Always assign a dynobj.
(elf32_arm_finish_dynamic_sections): Move sgot != NULL assertion
into the PLT block.
ld/
* emultempl/armelf.em (arm_elf_before_allocation): Check dynobj
instead of dynamic_sections_created.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf32-arm.c | 18 |
2 files changed, 15 insertions, 9 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 198ed38..4811453 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,11 @@ 2011-03-14 Richard Sandiford <richard.sandiford@linaro.org> + * elf32-arm.c (elf32_arm_check_relocs): Always assign a dynobj. + (elf32_arm_finish_dynamic_sections): Move sgot != NULL assertion + into the PLT block. + +2011-03-14 Richard Sandiford <richard.sandiford@linaro.org> + * elf32-arm.c (elf32_arm_check_relocs): Use call_reloc_p, may_need_local_target_p and may_become_dynamic_p to classify the relocation type. Don't check info->symbolic or h->def_regular diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 76c0127..2636052 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -11398,7 +11398,11 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, return FALSE; } - dynobj = elf_hash_table (info)->dynobj; + if (htab->root.dynobj == NULL) + htab->root.dynobj = abfd; + + dynobj = htab->root.dynobj; + symtab_hdr = & elf_symtab_hdr (abfd); sym_hashes = elf_sym_hashes (abfd); nsyms = NUM_SHDR_ENTRIES (symtab_hdr); @@ -11544,13 +11548,9 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, case R_ARM_GOTOFF32: case R_ARM_GOTPC: - if (htab->root.sgot == NULL) - { - if (htab->root.dynobj == NULL) - htab->root.dynobj = abfd; - if (!create_got_section (htab->root.dynobj, info)) - return FALSE; - } + if (htab->root.sgot == NULL + && !create_got_section (htab->root.dynobj, info)) + return FALSE; break; case R_ARM_PC24: @@ -13132,7 +13132,6 @@ elf32_arm_finish_dynamic_sections (bfd * output_bfd, struct bfd_link_info * info dynobj = elf_hash_table (info)->dynobj; sgot = htab->root.sgotplt; - BFD_ASSERT (htab->symbian_p || sgot != NULL); sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); if (elf_hash_table (info)->dynamic_sections_created) @@ -13142,6 +13141,7 @@ elf32_arm_finish_dynamic_sections (bfd * output_bfd, struct bfd_link_info * info splt = htab->root.splt; BFD_ASSERT (splt != NULL && sdyn != NULL); + BFD_ASSERT (htab->symbian_p || sgot != NULL); dyncon = (Elf32_External_Dyn *) sdyn->contents; dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size); |