aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-i370.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-i370.c')
-rw-r--r--bfd/elf32-i370.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c
index 3c7c372..4930581 100644
--- a/bfd/elf32-i370.c
+++ b/bfd/elf32-i370.c
@@ -1290,9 +1290,21 @@ i370_elf_relocate_section (bfd *output_bfd,
{
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);
+ if (indx == 0)
+ {
+ struct elf_link_hash_table *htab;
+ htab = elf_hash_table (info);
+ osec = htab->text_index_section;
+ indx = elf_section_data (osec)->dynindx;
+ }
+ BFD_ASSERT (indx != 0);
#ifdef DEBUG
if (indx <= 0)
{
@@ -1427,6 +1439,7 @@ i370_elf_post_process_headers (bfd * abfd,
link glibc's ld.so without errors. */
#define elf_backend_create_dynamic_sections i370_elf_create_dynamic_sections
#define elf_backend_size_dynamic_sections i370_elf_size_dynamic_sections
+#define elf_backend_init_index_section _bfd_elf_init_1_index_section
#define elf_backend_finish_dynamic_sections i370_elf_finish_dynamic_sections
#define elf_backend_fake_sections i370_elf_fake_sections
#define elf_backend_section_from_shdr i370_elf_section_from_shdr