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.
}
/* 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);
symbolS *lcomm_sym = NULL;
symbolS *sym;
char *pfrag;
- unsigned short visibility;
+ unsigned short visibility = 0;
struct ppc_xcoff_section *section;
endc = get_symbol_name (&name);