diff options
author | Jim Wilson <wilson@tuliptree.org> | 2002-10-25 18:55:22 +0000 |
---|---|---|
committer | Jim Wilson <wilson@tuliptree.org> | 2002-10-25 18:55:22 +0000 |
commit | a0087177c36f698e2687727057e2efbb8973051d (patch) | |
tree | bb1bae2357be25406f8233ed608a25ec61bb3b9c /bfd | |
parent | 1f2baacc1fef86105e495a1f6f090f606eddf0b4 (diff) | |
download | gdb-a0087177c36f698e2687727057e2efbb8973051d.zip gdb-a0087177c36f698e2687727057e2efbb8973051d.tar.gz gdb-a0087177c36f698e2687727057e2efbb8973051d.tar.bz2 |
Add some string section merging support.
* elf64-sh64.c (sh_elf64_relocate_section): Call
_bfd_elf_rela_local_sym. Handle relocs against STT_SECTION symbol
of SHF_MERGE section.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf64-sh64.c | 29 |
2 files changed, 35 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 27230ff..7e6a412 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2002-10-25 Jim Wilson <wilson@redhat.com> + + * elf64-sh64.c (sh_elf64_relocate_section): Call + _bfd_elf_rela_local_sym. Handle relocs against STT_SECTION symbol + of SHF_MERGE section. + 2002-10-25 Hans-Peter Nilsson <hp@axis.com> * simple.c: Correct placement of ATTRIBUTE_UNUSED. diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c index dfd7d37..da02505 100644 --- a/bfd/elf64-sh64.c +++ b/bfd/elf64-sh64.c @@ -1588,6 +1588,35 @@ sh_elf64_relocate_section (output_bfd, info, input_bfd, input_section, continue; } + else if (! howto->partial_inplace) + { + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); + relocation |= ((sym->st_other & STO_SH5_ISA32) != 0); + } + else if ((sec->flags & SEC_MERGE) + && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + asection *msec; + + if (howto->rightshift || howto->src_mask != 0xffffffff) + { + (*_bfd_error_handler) + (_("%s(%s+0x%lx): %s relocation against SEC_MERGE section"), + bfd_archive_filename (input_bfd), + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, howto->name); + return false; + } + + addend = bfd_get_32 (input_bfd, contents + rel->r_offset); + msec = sec; + addend = + _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend) + - relocation; + addend += msec->output_section->vma + msec->output_offset; + bfd_put_32 (input_bfd, addend, contents + rel->r_offset); + addend = 0; + } } else { |