diff options
author | Alan Modra <amodra@gmail.com> | 2002-12-18 13:16:35 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-12-18 13:16:35 +0000 |
commit | 47388f4cc37dfa524f722c5a9bbe606058619afc (patch) | |
tree | 22ecf581f9dd5524caa55f0750a4dcbb8e61eb00 /bfd | |
parent | 43d92c63df8a04f09c926b561a6190640ed070e0 (diff) | |
download | gdb-47388f4cc37dfa524f722c5a9bbe606058619afc.zip gdb-47388f4cc37dfa524f722c5a9bbe606058619afc.tar.gz gdb-47388f4cc37dfa524f722c5a9bbe606058619afc.tar.bz2 |
* elf32-ppc.c (ppc_elf_relocate_section): Reorganize dynamic reloc
code a little. Comment on dynamic relocs against section symbols.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf32-ppc.c | 16 |
2 files changed, 15 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index a71f60a..73fe10c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2002-12-18 Alan Modra <amodra@bigpond.net.au> + + * elf32-ppc.c (ppc_elf_relocate_section): Reorganize dynamic reloc + code a little. Comment on dynamic relocs against section symbols. + 2002-12-17 Roger Sayle <roger@eyesopen.com> * configure.host (ia64-*-hpux*): Support 64 bit targets using diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 7910601..2406c67 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -3221,11 +3221,10 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, } else { + outrel.r_addend = relocation + rel->r_addend; + if (r_type == R_PPC_ADDR32) - { - outrel.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE); - outrel.r_addend = relocation + rel->r_addend; - } + outrel.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE); else { long indx; @@ -3239,7 +3238,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, == bfd_link_hash_defweak)); sec = h->root.u.def.section; } - if (sec != NULL && bfd_is_abs_section (sec)) + + if (bfd_is_abs_section (sec)) indx = 0; else if (sec == NULL || sec->owner == NULL) { @@ -3250,6 +3250,11 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, { asection *osec; + /* We are turning this relocation into one + against a section symbol. It would be + proper to subtract the symbol's value, + osec->vma, from the emitted reloc addend, + but ld.so expects buggy relocs. */ osec = sec->output_section; indx = elf_section_data (osec)->dynindx; BFD_ASSERT (indx > 0); @@ -3264,7 +3269,6 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, } outrel.r_info = ELF32_R_INFO (indx, r_type); - outrel.r_addend = relocation + rel->r_addend; } } |