Browse Source
A C_BSTAT debug symbol specifies the beginning of a static block. Its n_value is the index of the csect containing static symbols. A C_STSYM debug symbol represents the stabstring of a statically allocated symbol. Its n_value is the offset in the csect pointed by the containing C_BSTAT. These two special n_value were not correctly handled both when generating object files with gas or when reading them with objdump. This patch tries to improve that and, above all, to allow gas-generated object files with such symbols to be accepted by AIX ld. bfd/ * coff-bfd.c (bfd_coff_get_syment): Adjust n_value of symbols having fix_value = 1 in order to be an index and not a memory offset. * coffgen.c (coff_get_symbol_info): Likewize. (coff_print_symbol): Likewize. gas/ * config/tc-ppc.c (ppc_frob_label): Don't change within if already set. (ppc_stabx): Remove workaround changing exp.X_add_symbol's within. * config/tc-ppc.h (struct ppc_tc_sy): Update comments. * symbols.c (resolve_symbol_value): Remove symbol update when final_val is 0 and it's an AIX debug symbol. * testsuite/gas/ppc/aix.exp: Add new tests. * testsuite/gas/ppc/xcoff-stsym-32.d: New test. * testsuite/gas/ppc/xcoff-stsym-64.d: New test. * testsuite/gas/ppc/xcoff-stsym.s: New test.users/ARM/efi-aarch64-support-binutils
9 changed files with 90 additions and 8 deletions
@ -0,0 +1,22 @@ |
|||
#as: -a32 |
|||
#source: xcoff-stsym.s |
|||
#objdump: -t |
|||
#name: XCOFF C_STSYM test (32-bit) |
|||
|
|||
.* |
|||
|
|||
SYMBOL TABLE: |
|||
.* |
|||
.* |
|||
.* |
|||
.* |
|||
\[ 4\]\(sec 1\).*\(scl 143\) \(nx 0\) 0x0000000a .bs |
|||
\[ 5\]\(sec -2\).*\(scl 133\) \(nx 0\) 0x00000000 x:V6 |
|||
\[ 6\]\(sec 1\).*\(scl 144\) \(nx 0\) 0x00000000 .es |
|||
\[ 7\]\(sec 1\).*\(scl 143\) \(nx 0\) 0x0000000a .bs |
|||
\[ 8\]\(sec -2\).*\(scl 133\) \(nx 0\) 0x00000004 y:V6 |
|||
\[ 9\]\(sec 1\).*\(scl 144\) \(nx 0\) 0x00000000 .es |
|||
\[ 10\].* _main\.rw_ |
|||
.* |
|||
|
|||
|
|||
@ -0,0 +1,22 @@ |
|||
#as: -a64 |
|||
#source: xcoff-stsym.s |
|||
#objdump: -t |
|||
#name: XCOFF C_STSYM test (64-bit) |
|||
|
|||
.* |
|||
|
|||
SYMBOL TABLE: |
|||
.* |
|||
.* |
|||
.* |
|||
.* |
|||
\[ 4\]\(sec 1\).*\(scl 143\) \(nx 0\) 0x000000000000000a .bs |
|||
\[ 5\]\(sec -2\).*\(scl 133\) \(nx 0\) 0x0000000000000000 x:V6 |
|||
\[ 6\]\(sec 1\).*\(scl 144\) \(nx 0\) 0x0000000000000000 .es |
|||
\[ 7\]\(sec 1\).*\(scl 143\) \(nx 0\) 0x000000000000000a .bs |
|||
\[ 8\]\(sec -2\).*\(scl 133\) \(nx 0\) 0x0000000000000004 y:V6 |
|||
\[ 9\]\(sec 1\).*\(scl 144\) \(nx 0\) 0x0000000000000000 .es |
|||
\[ 10\].* _main\.rw_ |
|||
.* |
|||
|
|||
|
|||
@ -0,0 +1,16 @@ |
|||
.file "main.c" |
|||
.csect _main.rw_[RW],4 |
|||
|
|||
.csect .text[PR] |
|||
.bs _main.rw_[RW] |
|||
.stabx "x:V6",x.2,133,0 |
|||
.es |
|||
.bs _main.rw_[RW] |
|||
.stabx "y:V6",y.1,133,0 |
|||
.es |
|||
|
|||
.csect _main.rw_[RW],4 |
|||
x.2: |
|||
.long 100 |
|||
y.1: |
|||
.long 110 |
|||
Loading…
Reference in new issue