diff options
author | Cl?ment Chigot <clement.chigot@atos.net> | 2021-05-07 15:29:49 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2021-05-07 15:29:49 +0100 |
commit | 97834047e13bb9f30430331c27b11412a5ed6950 (patch) | |
tree | 99f794403e03440f9ed501fed952517bf98a4e9e /gas/testsuite | |
parent | 3ecc00ec9cbb7a35d6e58bf86fddaa33126a479a (diff) | |
download | gdb-97834047e13bb9f30430331c27b11412a5ed6950.zip gdb-97834047e13bb9f30430331c27b11412a5ed6950.tar.gz gdb-97834047e13bb9f30430331c27b11412a5ed6950.tar.bz2 |
Fix .dwsect generation for XCOFF. Handle .function generated with DWARF on XCOFF.
gas * config/tc-ppc.c (ppc_function): Update comment for
fifth argument.
(ppc_frob_symbol): Remove ppc_last_function check.
Make sure coff_last_function is reset.
Correctly set fsize when not provided in .function.
* testsuite/gas/ppc/aix.exp: New tests.
* testsuite/gas/ppc/xcoff-function-1-32.d: New test.
* testsuite/gas/ppc/xcoff-function-1-64.d: New test.
* testsuite/gas/ppc/xcoff-function-1.s: New test.
bfd * coff-rs6000.c (xcoff_dwsect_names): Add new DWARF
sections.
* coffgen.c (coff_pointerize_aux): Handle C_DWARF.
(coff_print_symbol): Likewise.
* libxcoff.h (XCOFF_DWSECT_NBR_NAMES): Update.
gas * config/obj-coff.c (coff_frob_symbol): Don't skip C_DWARF.
(coff_adjust_section_syms): Use corrext auxent for C_DWARF.
(coff_frob_section): Likewise.
* config/obj-coff.h (SA_GET_SECT_SCNLEN,
SA_GET_SECT_NRELOC, SA_SET_SECT_SCNLEN,
SA_SET_SECT_NRELOC) New defines.
(SET_SECTION_RELOCS): Adjust for C_DWARF.
* config/tc-ppc.c (ppc_frob_symbol): Don't skip C_DWARF.
(ppc_adjust_symtab): Reorder C_DWARF symbols.
* testsuite/gas/ppc/aix.exp: New tests.
* testsuite/gas/ppc/xcoff-dwsect-2-32.d: New test.
* testsuite/gas/ppc/xcoff-dwsect-2-64.d: New test.
* testsuite/gas/ppc/xcoff-dwsect-2.s: New test.
include * coff/internal.h (C_DWARF): New define.
* coff/xcoff.h (SSUBTYP_DWLOC, SSUBTYP_DWFRAME,
SSUBTYP_DWMAC): New defines.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/gas/ppc/aix.exp | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/ppc/xcoff-dwsect-2-32.d | 18 | ||||
-rw-r--r-- | gas/testsuite/gas/ppc/xcoff-dwsect-2-64.d | 18 | ||||
-rw-r--r-- | gas/testsuite/gas/ppc/xcoff-dwsect-2.s | 12 | ||||
-rw-r--r-- | gas/testsuite/gas/ppc/xcoff-function-1-32.d | 20 | ||||
-rw-r--r-- | gas/testsuite/gas/ppc/xcoff-function-1-64.d | 20 | ||||
-rw-r--r-- | gas/testsuite/gas/ppc/xcoff-function-1.s | 16 |
7 files changed, 109 insertions, 0 deletions
diff --git a/gas/testsuite/gas/ppc/aix.exp b/gas/testsuite/gas/ppc/aix.exp index 8e7ac67..efe27e4 100644 --- a/gas/testsuite/gas/ppc/aix.exp +++ b/gas/testsuite/gas/ppc/aix.exp @@ -73,4 +73,9 @@ if { [istarget "powerpc*-*-aix*"] || [istarget "rs6000-*-aix*"] } then { run_dump_test "xcoff-dwsect-1-32" run_dump_test "xcoff-dwsect-1-64" + run_dump_test "xcoff-dwsect-2-32" + run_dump_test "xcoff-dwsect-2-64" + + run_dump_test "xcoff-function-1-32" + run_dump_test "xcoff-function-1-64" } diff --git a/gas/testsuite/gas/ppc/xcoff-dwsect-2-32.d b/gas/testsuite/gas/ppc/xcoff-dwsect-2-32.d new file mode 100644 index 0000000..cebc6d3 --- /dev/null +++ b/gas/testsuite/gas/ppc/xcoff-dwsect-2-32.d @@ -0,0 +1,18 @@ +#as: -a32 +#source: xcoff-dwsect-2.s +#objdump: -t +#name: XCOFF dwsect test 2 (32-bit) + +.* + +SYMBOL TABLE: +.*\(scl 103\).* +File .* +.*\(scl 112\).* .dwinfo +AUX .* +.*\(scl 112\).* .dwloc +AUX .* +.*\(scl 112\).* .dwarnge +AUX .* +.*\(scl 107\).* .text +.* diff --git a/gas/testsuite/gas/ppc/xcoff-dwsect-2-64.d b/gas/testsuite/gas/ppc/xcoff-dwsect-2-64.d new file mode 100644 index 0000000..445e707 --- /dev/null +++ b/gas/testsuite/gas/ppc/xcoff-dwsect-2-64.d @@ -0,0 +1,18 @@ +#as: -a64 +#source: xcoff-dwsect-2.s +#objdump: -t +#name: XCOFF dwsect test 2 (64-bit) + +.* + +SYMBOL TABLE: +.*\(scl 103\).* +File .* +.*\(scl 112\).* .dwinfo +AUX .* +.*\(scl 112\).* .dwloc +AUX .* +.*\(scl 112\).* .dwarnge +AUX .* +.*\(scl 107\).* .text +.* diff --git a/gas/testsuite/gas/ppc/xcoff-dwsect-2.s b/gas/testsuite/gas/ppc/xcoff-dwsect-2.s new file mode 100644 index 0000000..52a624f --- /dev/null +++ b/gas/testsuite/gas/ppc/xcoff-dwsect-2.s @@ -0,0 +1,12 @@ + + .csect .text[PR] + + .dwsect 0x10000,Ldwinfo_0 + .short 2 + .dwsect 0x90000 +Ldebug_loc: + .short 3 + .dwsect 0x50000 + .short 1 + .short 4 + diff --git a/gas/testsuite/gas/ppc/xcoff-function-1-32.d b/gas/testsuite/gas/ppc/xcoff-function-1-32.d new file mode 100644 index 0000000..805a248 --- /dev/null +++ b/gas/testsuite/gas/ppc/xcoff-function-1-32.d @@ -0,0 +1,20 @@ +#as: -a32 +#source: xcoff-function-1.s +#objdump: -t +#name: XCOFF function test 1 (32-bit) + +.* + +SYMBOL TABLE: +.* +.* +\[ 2\].* .text +AUX val 8 .* +\[ 4\].* .foo +AUX .* ttlsiz 0x8 .* +AUX .* typ 2 .* clss 0 .* +\[ 7\].* .bar +AUX .* ttlsiz 0x4 .* +AUX .* typ 2 .* clss 0 .* + + diff --git a/gas/testsuite/gas/ppc/xcoff-function-1-64.d b/gas/testsuite/gas/ppc/xcoff-function-1-64.d new file mode 100644 index 0000000..431c61c --- /dev/null +++ b/gas/testsuite/gas/ppc/xcoff-function-1-64.d @@ -0,0 +1,20 @@ +#as: -a64 +#source: xcoff-function-1.s +#objdump: -t +#name: XCOFF function test 1 (64-bit) + +.* + +SYMBOL TABLE: +.* +.* +\[ 2\].* .text +AUX val 8 .* +\[ 4\].* .foo +AUX .* ttlsiz 0x8 .* +AUX .* typ 2 .* clss 0 .* +\[ 7\].* .bar +AUX .* ttlsiz 0x4 .* +AUX .* typ 2 .* clss 0 .* + + diff --git a/gas/testsuite/gas/ppc/xcoff-function-1.s b/gas/testsuite/gas/ppc/xcoff-function-1.s new file mode 100644 index 0000000..8a63fe7 --- /dev/null +++ b/gas/testsuite/gas/ppc/xcoff-function-1.s @@ -0,0 +1,16 @@ + .csect .text[PR] + + # .function without 5th argument means + # that the size is the size of the csect. + .globl .foo +.foo: + .function .foo,.foo,2,0 + blr + + # .function without 5th argument means + # that the size is the size given. + .globl .bar +.bar: + .function .bar,.bar,2,0, E..bar-.bar + blr +E..bar: |