aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfnn-aarch64.c
diff options
context:
space:
mode:
authorWill Newton <will.newton@linaro.org>2014-03-14 11:45:32 +0000
committerWill Newton <will.newton@linaro.org>2014-03-25 09:01:50 +0000
commitc955de363b91edba8a92877f97b1be68357d9582 (patch)
treeec54faa2f116cfd2a1f1c65720fc92e86ab52403 /bfd/elfnn-aarch64.c
parent3e60bf4df86f323dde4281886a355589488149aa (diff)
downloadgdb-c955de363b91edba8a92877f97b1be68357d9582.zip
gdb-c955de363b91edba8a92877f97b1be68357d9582.tar.gz
gdb-c955de363b91edba8a92877f97b1be68357d9582.tar.bz2
bfd/elfnn-aarch64.c: Fix calculation of DT_RELASZ
The current code subtracts the size of the output section containing relplt from RELASZ. In some cases this will be the same output section as the dynamic relocs causing a value of zero to be output. Calculating the size from input sections seems to make more sense. bfd/ChangeLog: 2014-03-25 Will Newton <will.newton@linaro.org> * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_sections): Set value of DT_PLTRELSZ and DT_RELASZ based on the size of input sections rather than output sections. ld/testsuite/ChangeLog: 2014-03-25 Will Newton <will.newton@linaro.org> * ld-aarch64/aarch64-elf.exp: Add relasz dump test. * ld-aarch64/relasz.d: New file. * ld-aarch64/relasz.s: Likewise.
Diffstat (limited to 'bfd/elfnn-aarch64.c')
-rw-r--r--bfd/elfnn-aarch64.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index c2adcc9..638938d 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -6993,7 +6993,7 @@ elfNN_aarch64_finish_dynamic_sections (bfd *output_bfd,
break;
case DT_PLTRELSZ:
- s = htab->root.srelplt->output_section;
+ s = htab->root.srelplt;
dyn.d_un.d_val = s->size;
break;
@@ -7007,7 +7007,7 @@ elfNN_aarch64_finish_dynamic_sections (bfd *output_bfd,
about changing the DT_RELA entry. */
if (htab->root.srelplt != NULL)
{
- s = htab->root.srelplt->output_section;
+ s = htab->root.srelplt;
dyn.d_un.d_val -= s->size;
}
break;