diff options
author | Alan Modra <amodra@gmail.com> | 2024-02-09 12:13:13 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2024-02-09 12:17:20 +1030 |
commit | 74f03a0ed2fed504f037711aee75dd1a00d15b17 (patch) | |
tree | 8a147b62331b98f0f292da96cfc2c4628b577bc0 /bfd/xcofflink.c | |
parent | ae60db705c6644611e3701f30c3fabc9e10ea455 (diff) | |
download | gdb-74f03a0ed2fed504f037711aee75dd1a00d15b17.zip gdb-74f03a0ed2fed504f037711aee75dd1a00d15b17.tar.gz gdb-74f03a0ed2fed504f037711aee75dd1a00d15b17.tar.bz2 |
PR 14962 testcase xcoff failure
Like https://sourceware.org/pipermail/binutils/2002-August/021279.html
but for symbols defined in an xcoff object but then made absolute by a
linker script.
* xcofflink.c (xcoff_link_input_bfd): Set n_scnum correctly
for symbols made absolute by a linker script.
Diffstat (limited to 'bfd/xcofflink.c')
-rw-r--r-- | bfd/xcofflink.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c index 6ef9abc..49ac8ef 100644 --- a/bfd/xcofflink.c +++ b/bfd/xcofflink.c @@ -5482,7 +5482,13 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *flinfo, && isym.n_sclass != C_DECL && isym.n_scnum > 0) { - isym.n_scnum = (*csectpp)->output_section->target_index; + if (*sym_hash != NULL + && ((*sym_hash)->root.type == bfd_link_hash_defined + || (*sym_hash)->root.type == bfd_link_hash_defweak) + && (*sym_hash)->root.u.def.section == bfd_abs_section_ptr) + isym.n_scnum = N_ABS; + else + isym.n_scnum = (*csectpp)->output_section->target_index; isym.n_value += ((*csectpp)->output_section->vma + (*csectpp)->output_offset - (*csectpp)->vma); |