aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-mips.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2007-04-12 19:26:09 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2007-04-12 19:26:09 +0000
commit9e3313aecd599cca275c602250d928cc6755177b (patch)
tree3e6cb207cff0dbdb1c2669cef335c3894d41bdb9 /bfd/elfxx-mips.c
parent1aa9ef630cd7777c24e5d1592c54fbeffad22fd8 (diff)
downloadgdb-9e3313aecd599cca275c602250d928cc6755177b.zip
gdb-9e3313aecd599cca275c602250d928cc6755177b.tar.gz
gdb-9e3313aecd599cca275c602250d928cc6755177b.tar.bz2
bfd/
* elfxx-mips.c (mips_elf_calculate_relocation): Set DT_TEXTREL when creating a __GOTT_BASE__ or __GOTT_INDEX__ relocation in a read-only section. (_bfd_mips_elf_check_relocs): Likewise. ld/testsuite/ * ld-mips-elf/vxworks1-lib.td: New test. * ld-mips-elf/mips-elf.exp: Run it.
Diffstat (limited to 'bfd/elfxx-mips.c')
-rw-r--r--bfd/elfxx-mips.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index ec65141..5c782de 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -4275,6 +4275,13 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
outrel.r_info = ELF32_R_INFO (h->root.dynindx, r_type);
outrel.r_addend = addend;
bfd_elf32_swap_reloca_out (abfd, &outrel, loc);
+
+ /* If we've written this relocation for a readonly section,
+ we need to set DF_TEXTREL again, so that we do not delete the
+ DT_TEXTREL tag. */
+ if (MIPS_ELF_READONLY_SECTION (input_section))
+ info->flags |= DF_TEXTREL;
+
*valuep = 0;
return bfd_reloc_ok;
}
@@ -6493,6 +6500,10 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
return FALSE;
}
mips_elf_allocate_dynamic_relocations (dynobj, info, 1);
+ if (MIPS_ELF_READONLY_SECTION (sec))
+ /* We tell the dynamic linker that there are
+ relocations against the text segment. */
+ info->flags |= DF_TEXTREL;
}
}
else if (r_type == R_MIPS_CALL_LO16