aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2024-12-14 10:16:07 +1030
committerAlan Modra <amodra@gmail.com>2024-12-14 10:18:17 +1030
commitecb790c0bb80a2d93a75cf3c9463ffe24ad445d9 (patch)
tree06eb98ff7e8cfa2b10be4b2d7816d84a1f0dfdab
parent2e792a78e495be6df4b8c0a3e41332c2f6dcd911 (diff)
downloadbinutils-ecb790c0bb80a2d93a75cf3c9463ffe24ad445d9.zip
binutils-ecb790c0bb80a2d93a75cf3c9463ffe24ad445d9.tar.gz
binutils-ecb790c0bb80a2d93a75cf3c9463ffe24ad445d9.tar.bz2
xcoff ldrel and tls sections
* xcofflink.c (_bfd_xcoff_canonicalize_dynamic_reloc): Use .tdata and .tbss section symbols. (xcoff_create_ldrel): Abort on h and hsec both NULL.
-rw-r--r--bfd/xcofflink.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c
index b75fb42..6eb4529 100644
--- a/bfd/xcofflink.c
+++ b/bfd/xcofflink.c
@@ -439,12 +439,11 @@ _bfd_xcoff_canonicalize_dynamic_reloc (bfd *abfd,
bfd_xcoff_swap_ldrel_in (abfd, elrel, &ldrel);
- if (ldrel.l_symndx == -1u)
- relbuf->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
- else if (ldrel.l_symndx < 3)
+ if (ldrel.l_symndx + 2 < 5)
{
- static const char stdsec[3][8] = { ".text", ".data", ".bss" };
- const char *name = stdsec[ldrel.l_symndx];
+ static const char stdsec[5][8]
+ = { ".tbss", ".tdata", ".text", ".data", ".bss" };
+ const char *name = stdsec[ldrel.l_symndx + 2];
asection *sec = bfd_get_section_by_name (abfd, name);
if (sec == NULL)
{
@@ -5090,7 +5089,7 @@ xcoff_create_ldrel (bfd *output_bfd, struct xcoff_final_link_info *flinfo,
ldrel.l_symndx = h->ldindx;
}
else
- ldrel.l_symndx = -1;
+ abort ();
ldrel.l_rtype = (irel->r_size << 8) | irel->r_type;
ldrel.l_rsecnm = output_section->target_index;