diff options
author | Clément Chigot <clement.chigot@atos.net> | 2021-10-15 16:12:39 +0200 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-11-10 14:43:24 +1030 |
commit | e86fc4a5bc3747a6b811d93648a2afa4c1c74217 (patch) | |
tree | 00a19a31cfdddd830170cb363782279a0d39c212 /include | |
parent | f493b71179ab70d5e278234cb763eede55d44e61 (diff) | |
download | gdb-e86fc4a5bc3747a6b811d93648a2afa4c1c74217.zip gdb-e86fc4a5bc3747a6b811d93648a2afa4c1c74217.tar.gz gdb-e86fc4a5bc3747a6b811d93648a2afa4c1c74217.tar.bz2 |
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 'include')
-rw-r--r-- | include/coff/internal.h | 25 | ||||
-rw-r--r-- | include/coff/rs6000.h | 1 | ||||
-rw-r--r-- | include/coff/xcoff.h | 6 |
3 files changed, 21 insertions, 11 deletions
diff --git a/include/coff/internal.h b/include/coff/internal.h index 8d757ac..d01af73 100644 --- a/include/coff/internal.h +++ b/include/coff/internal.h @@ -578,18 +578,21 @@ union internal_auxent unsigned short x_tvndx; /* tv index */ } x_sym; - union + struct { - /* PR 17754: We use to FILNMLEN for the size of the x_fname - array, but that causes problems as PE targets use a larger - value. We cannot use their definition of E_FILNMLEN as this - header can be used without including any PE headers. */ - char x_fname[20]; - struct - { - long x_zeroes; - long x_offset; - } x_n; + union { + /* PR 17754: We use to FILNMLEN for the size of the x_fname + array, but that causes problems as PE targets use a larger + value. We cannot use their definition of E_FILNMLEN as this + header can be used without including any PE headers. */ + char x_fname[20]; + struct + { + long x_zeroes; + long x_offset; + } x_n; + } x_n; + unsigned char x_ftype; } x_file; struct diff --git a/include/coff/rs6000.h b/include/coff/rs6000.h index e60efff..fd3f01d 100644 --- a/include/coff/rs6000.h +++ b/include/coff/rs6000.h @@ -176,6 +176,7 @@ union external_auxent { } x_n; } x_n; char x_ftype[1]; + char x_resv[3]; } x_file; struct { diff --git a/include/coff/xcoff.h b/include/coff/xcoff.h index 2b61545..1cff7dc 100644 --- a/include/coff/xcoff.h +++ b/include/coff/xcoff.h @@ -190,6 +190,12 @@ #define XMC_UL 21 /* Read-write uninitialized TLS data */ #define XMC_TE 22 /* Same as XMC_TC but mapped after it */ +/* x_ftype values: */ +#define XFT_FN 0 /* Specifies the source-file name */ +#define XFT_CT 1 /* Specifies the compiler time stamp */ +#define XFT_CV 2 /* Specifies the compiler version number */ +#define XFT_CD 128 /*Specifies compiler-defined information */ + /* The ldhdr structure. This appears at the start of the .loader section. */ |