summaryrefslogtreecommitdiff
path: root/bfd/xcofflink.c
diff options
context:
space:
mode:
authorClément Chigot <clement.chigot@atos.net>2021-10-15 16:12:39 +0200
committerAlan Modra <amodra@gmail.com>2021-11-10 14:43:24 +1030
commite86fc4a5bc3747a6b811d93648a2afa4c1c74217 (patch)
tree00a19a31cfdddd830170cb363782279a0d39c212 /bfd/xcofflink.c
parentf493b71179ab70d5e278234cb763eede55d44e61 (diff)
PR 28447: implement multiple parameters for .file on XCOFF
On XCOFF, ".file" pseudo-op allows 3 extras parameters to provide additional information to AIX linker, or its debugger. These are stored in auxiliary entries of the C_FILE symbol. bfd/ PR 28447 * coffcode.h (combined_entry_type): Add extrap field. (coff_bigobj_swap_aux_in): Adjust names of x_file fields. (coff_bigobj_swap_aux_out): Likewise. * coffgen.c (coff_write_auxent_fname): New function. (coff_fix_symbol_name): Write x_file using coff_write_auxent_fname. (coff_write_symbol): Likewise. (coff_write_symbols): Add C_FILE auxiliary entries to string table if needed. (coff_get_normalized_symtab): Adjust names of x_file fields. Normalize C_FILE auxiliary entries. (coff_print_symbol): Print C_FILE auxiliary entries. * coff-rs6000.c (_bfd_xcoff_swap_aux_in): Adjust names of x_file fields. (_bfd_xcoff_swap_aux_out): Likewise. * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Likewise. (_bfd_xcoff64_swap_aux_out): Likewise. * cofflink.c (_bfd_coff_final_link): Likewise. (_bfd_coff_link_input_bfd): Likewise. * coffswap.h (coff_swap_aux_in): Likewise. * peXXigen.c (_bfd_XXi_swap_aux_in): Likewise. (_bfd_XXi_swap_aux_out): Likewise. * xcofflink.c (xcoff_link_input_bfd): Likewise. * libcoff.h: Regenerate. gas/ * config/tc-ppc.c (ppc_file): New function. * config/tc-ppc.h (OBJ_COFF_MAX_AUXENTRIES): Change to 4. * testsuite/gas/ppc/aix.exp: Add tests. * testsuite/gas/ppc/xcoff-file-32.d: New test. * testsuite/gas/ppc/xcoff-file-64.d: New test. * testsuite/gas/ppc/xcoff-file.s: New test. include/ * coff/internal.h (union internal_auxent): Change x_file to be a struct instead of a union. Add x_ftype field. * coff/rs6000.h (union external_auxent): Add x_resv field. * coff/xcoff.h (XFT_FN): New define. (XFT_CT): Likewise. (XFT_CV): Likewise. (XFT_CD): Likewise.
Diffstat (limited to 'bfd/xcofflink.c')
-rw-r--r--bfd/xcofflink.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c
index 3ca74ce027..e87ed0e683 100644
--- a/bfd/xcofflink.c
+++ b/bfd/xcofflink.c
@@ -4550,13 +4550,13 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *flinfo,
/* This is the file name (or some comment put in by
the compiler). If it is long, we must put it in
the string table. */
- if (aux.x_file.x_n.x_zeroes == 0
- && aux.x_file.x_n.x_offset != 0)
+ if (aux.x_file.x_n.x_n.x_zeroes == 0
+ && aux.x_file.x_n.x_n.x_offset != 0)
{
const char *filename;
bfd_size_type indx;
- BFD_ASSERT (aux.x_file.x_n.x_offset
+ BFD_ASSERT (aux.x_file.x_n.x_n.x_offset
>= STRING_SIZE_SIZE);
if (strings == NULL)
{
@@ -4564,15 +4564,15 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *flinfo,
if (strings == NULL)
return false;
}
- if ((bfd_size_type) aux.x_file.x_n.x_offset >= obj_coff_strings_len (input_bfd))
+ if ((bfd_size_type) aux.x_file.x_n.x_n.x_offset >= obj_coff_strings_len (input_bfd))
filename = _("<corrupt>");
else
- filename = strings + aux.x_file.x_n.x_offset;
+ filename = strings + aux.x_file.x_n.x_n.x_offset;
indx = _bfd_stringtab_add (flinfo->strtab, filename,
hash, copy);
if (indx == (bfd_size_type) -1)
return false;
- aux.x_file.x_n.x_offset = STRING_SIZE_SIZE + indx;
+ aux.x_file.x_n.x_n.x_offset = STRING_SIZE_SIZE + indx;
}
}
else if (CSECT_SYM_P (isymp->n_sclass)