diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2011-01-17 16:36:15 +0000 |
---|---|---|
committer | Richard Sandiford <rdsandiford@googlemail.com> | 2011-01-17 16:36:15 +0000 |
commit | 1e81e12b2c81710f5b098e18d5146d6704100913 (patch) | |
tree | 64e377b08c7566936b5738a81b5ad8d8d21dfa12 /bfd | |
parent | f55af66d6ed6e6ad47757c5fff7ab5df1284ce33 (diff) | |
download | gdb-1e81e12b2c81710f5b098e18d5146d6704100913.zip gdb-1e81e12b2c81710f5b098e18d5146d6704100913.tar.gz gdb-1e81e12b2c81710f5b098e18d5146d6704100913.tar.bz2 |
bfd/
* elf32-arm.c (elf32_arm_gc_sweep_hook): Remove all registered
dynamic relocs for the removed section.
ld/testsuite/
* ld-arm/gc-thumb-lib.s, ld-arm/gc-thumb.s,
ld-arm/gc-thumb.d: New test.
* ld-arm/arm-elf.exp: Run it.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf32-arm.c | 22 |
2 files changed, 12 insertions, 15 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 00ff8ff..93291ef 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2011-01-17 Richard Sandiford <richard.sandiford@linaro.org> + + * elf32-arm.c (elf32_arm_gc_sweep_hook): Remove all registered + dynamic relocs for the removed section. + 2011-01-15 H.J. Lu <hongjiu.lu@intel.com> * elf64-x86-64.c (elf_x86_64_check_relocs): Check invalid x32 diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 6fdd500..8e9e30f 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -11277,21 +11277,13 @@ elf32_arm_gc_sweep_hook (bfd * abfd, eh->plt_thumb_refcount--; } - if (r_type == R_ARM_ABS32 - || r_type == R_ARM_REL32 - || r_type == R_ARM_ABS32_NOI - || r_type == R_ARM_REL32_NOI) - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) - { - p->count -= 1; - if (ELF32_R_TYPE (rel->r_info) == R_ARM_REL32 - || ELF32_R_TYPE (rel->r_info) == R_ARM_REL32_NOI) - p->pc_count -= 1; - if (p->count == 0) - *pp = p->next; - break; - } + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + /* Everything must go for SEC. */ + *pp = p->next; + break; + } } break; |