aboutsummaryrefslogtreecommitdiff
path: root/bfd/xcofflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-01-13 15:42:13 +1030
committerAlan Modra <amodra@gmail.com>2022-01-13 16:50:15 +1030
commit1ffce3f87dc6e62d49b5aaa0bc29c6d4cfbc6db6 (patch)
tree3884c44d0a8eb321b7ed2b580b7d23799966d9fd /bfd/xcofflink.c
parentc39828d4c90815053009043468cb981b3125a76b (diff)
downloadgdb-1ffce3f87dc6e62d49b5aaa0bc29c6d4cfbc6db6.zip
gdb-1ffce3f87dc6e62d49b5aaa0bc29c6d4cfbc6db6.tar.gz
gdb-1ffce3f87dc6e62d49b5aaa0bc29c6d4cfbc6db6.tar.bz2
Re: gas: add visibility support using GNU syntax on XCOFF
tc-ppc.c: In function 'ppc_comm': tc-ppc.c:4560:40: error: 'visibility' may be used uninitialized in this function [-Werror=maybe-uninitialized] With that fixed we hit lots of segfaults in the ld testsuite. PR 22085 bfd/ * xcofflink.c (xcoff_link_input_bfd): Don't segfault on NULL sym_hash. gas/ * config/tc-ppc.c (ppc_comm): Init visibility.
Diffstat (limited to 'bfd/xcofflink.c')
-rw-r--r--bfd/xcofflink.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c
index 6e99472..70d371e 100644
--- a/bfd/xcofflink.c
+++ b/bfd/xcofflink.c
@@ -4615,8 +4615,11 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *flinfo,
}
/* Update visibility. */
- isym.n_type &= ~SYM_V_MASK;
- isym.n_type |= (*sym_hash)->visibility;
+ if (*sym_hash)
+ {
+ isym.n_type &= ~SYM_V_MASK;
+ isym.n_type |= (*sym_hash)->visibility;
+ }
/* Output the symbol. */
bfd_coff_swap_sym_out (output_bfd, (void *) &isym, (void *) outsym);