Fixes for new dw5 test

On some targets, .string does not add a NUL string terminator.

	* testsuite/binutils-all/dw5.S: Replace .string with .asciz.
	Support hpux .comm variant.
	* testsuite/binutils-all/readelf.exp: Define HPUX when assembling
	dw5 test for hppa64-hpux.
This commit is contained in:
Alan Modra
2017-02-24 23:58:50 +10:30
parent 034fed0bbc
commit 3b83ea38cf
3 changed files with 47 additions and 31 deletions

View File

@ -1,3 +1,10 @@
2017-02-25 Alan Modra <amodra@gmail.com>
* testsuite/binutils-all/dw5.S: Replace .string with .asciz.
Support hpux .comm variant.
* testsuite/binutils-all/readelf.exp: Define HPUX when assembling
dw5 test for hppa64-hpux.
2017-02-24 Nick Clifton <nickc@redhat.com> 2017-02-24 Nick Clifton <nickc@redhat.com>
* readelf.c (show_name, do_dynamic, do_syms, do_dyn_syms, * readelf.c (show_name, do_dynamic, do_syms, do_dyn_syms,

View File

@ -55,8 +55,13 @@ main:
.dc.b 0 .dc.b 0
.LFE1: .LFE1:
.size main, .-main .size main, .-main
.ifdef HPUX
pvar .comm 8
yvar .comm 4
.else
.comm pvar,8,8 .comm pvar,8,8
.comm yvar,4,4 .comm yvar,4,4
.endif
.globl xvar .globl xvar
.data .data
.align 4 .align 4
@ -615,65 +620,65 @@ xvar:
.LELT0: .LELT0:
.section .debug_str,"MS",%progbits,1 .section .debug_str,"MS",%progbits,1
.LASF4: .LASF4:
.string "unsigned int" .asciz "unsigned int"
.LASF15: .LASF15:
.string "optopt" .asciz "optopt"
.LASF22: .LASF22:
.string "main" .asciz "main"
.LASF6: .LASF6:
.string "signed char" .asciz "signed char"
.LASF16: .LASF16:
.string "xvar" .asciz "xvar"
.LASF5: .LASF5:
.string "long unsigned int" .asciz "long unsigned int"
.LASF14: .LASF14:
.string "opterr" .asciz "opterr"
.LASF21: .LASF21:
.string "GNU C11 7.0.1 20170218 (experimental) -mtune=generic -march=x86-64 -gdwarf-5 -O2" .asciz "GNU C11 7.0.1 20170218 (experimental) -mtune=generic -march=x86-64 -gdwarf-5 -O2"
.LASF2: .LASF2:
.string "unsigned char" .asciz "unsigned char"
.LASF10: .LASF10:
.string "char" .asciz "char"
.LASF13: .LASF13:
.string "optind" .asciz "optind"
.LASF8: .LASF8:
.string "long int" .asciz "long int"
.LASF19: .LASF19:
.string "argc" .asciz "argc"
.LASF3: .LASF3:
.string "short unsigned int" .asciz "short unsigned int"
.LASF17: .LASF17:
.string "yvar" .asciz "yvar"
.LASF18: .LASF18:
.string "pvar" .asciz "pvar"
.LASF11: .LASF11:
.string "__environ" .asciz "__environ"
.LASF23: .LASF23:
.string "func" .asciz "func"
.LASF12: .LASF12:
.string "optarg" .asciz "optarg"
.LASF7: .LASF7:
.string "short int" .asciz "short int"
.LASF24: .LASF24:
.string "alarm" .asciz "alarm"
.LASF9: .LASF9:
.string "sizetype" .asciz "sizetype"
.LASF20: .LASF20:
.string "argv" .asciz "argv"
.section .debug_line_str,"MS",%progbits,1 .section .debug_line_str,"MS",%progbits,1
.LASF1: .LASF1:
.string "" .asciz ""
.LASF25: .LASF25:
.string "" .asciz ""
.LASF29: .LASF29:
.string "getopt.h" .asciz "getopt.h"
.LASF28: .LASF28:
.string "unistd.h" .asciz "unistd.h"
.LASF0: .LASF0:
.string "main.c" .asciz "main.c"
.LASF27: .LASF27:
.string "main.c" .asciz "main.c"
.LASF26: .LASF26:
.string "/usr/include" .asciz "/usr/include"
.ident "GCC: (GNU) 7.0.1 20170218 (experimental)" .ident "GCC: (GNU) 7.0.1 20170218 (experimental)"
.section .note.GNU-stack,"",%progbits .section .note.GNU-stack,"",%progbits

View File

@ -399,8 +399,12 @@ if {![binutils_assemble $srcdir/$subdir/z.s tmpdir/z.o]} then {
# support .ULEB128 pseudo-ops with non-constant values. # support .ULEB128 pseudo-ops with non-constant values.
if ![istarget "riscv*-*-*"] then { if ![istarget "riscv*-*-*"] then {
set hpux ""
if [istarget "hppa*64*-*-hpux*"] {
set hpux "--defsym HPUX=1"
}
# Assemble the DWARF-5 test file. # Assemble the DWARF-5 test file.
if {![binutils_assemble $srcdir/$subdir/dw5.S tmpdir/dw5.o]} then { if {![binutils_assemble_flags $srcdir/$subdir/dw5.S tmpdir/dw5.o $hpux]} then {
perror "could not assemble dw5 test file" perror "could not assemble dw5 test file"
unresolved "readelf - failed to assemble dw5" unresolved "readelf - failed to assemble dw5"
return return