diff options
author | Alan Modra <amodra@gmail.com> | 2002-12-12 10:17:14 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-12-12 10:17:14 +0000 |
commit | 6348e046b7477703914eafb99866a269c186c496 (patch) | |
tree | 0414d23ef48cb9b188097ffe6e0c23615c3bfe17 /bfd/elf32-hppa.c | |
parent | 7dda0df6a35b01389ed6f7880982293aa62ee788 (diff) | |
download | gdb-6348e046b7477703914eafb99866a269c186c496.zip gdb-6348e046b7477703914eafb99866a269c186c496.tar.gz gdb-6348e046b7477703914eafb99866a269c186c496.tar.bz2 |
* elf32-i386.c (elf_i386_finish_dynamic_sections): Add output_offset
to DT_JMPREL. Use srelplt input section size for DT_PLTRELSZ and
DT_RELSZ adjustment, not output section. Avoid writing tags when
unchanged. Don't assume linker script is sane, adjust DT_REL too.
* elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Just use raw
size of srelplt for DT_PLTRELSZ. Use srelplt input section size for
DT_RELASZ adjustment, not output section. Avoid writing tags when
unchanged. Adjust DT_RELA.
* elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Tweaks for better
formatting. Avoid writing tags when unchanged. Adjust DT_RELA.
Diffstat (limited to 'bfd/elf32-hppa.c')
-rw-r--r-- | bfd/elf32-hppa.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 80c39ce..f8c88b1 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -4314,23 +4314,28 @@ elf32_hppa_finish_dynamic_sections (output_bfd, info) case DT_PLTRELSZ: s = htab->srelplt; - if (s->_cooked_size != 0) - dyn.d_un.d_val = s->_cooked_size; - else - dyn.d_un.d_val = s->_raw_size; + dyn.d_un.d_val = s->_raw_size; break; case DT_RELASZ: /* Don't count procedure linkage table relocs in the overall reloc count. */ - if (htab->srelplt != NULL) - { - s = htab->srelplt->output_section; - if (s->_cooked_size != 0) - dyn.d_un.d_val -= s->_cooked_size; - else - dyn.d_un.d_val -= s->_raw_size; - } + s = htab->srelplt; + if (s == NULL) + continue; + dyn.d_un.d_val -= s->_raw_size; + break; + + case DT_RELA: + /* We may not be using the standard ELF linker script. + If .rela.plt is the first .rela section, we adjust + DT_RELA to not include it. */ + s = htab->srelplt; + if (s == NULL) + continue; + if (dyn.d_un.d_ptr != s->output_section->vma + s->output_offset) + continue; + dyn.d_un.d_ptr += s->_raw_size; break; } |