aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite/binutils-all
diff options
context:
space:
mode:
authormengqinggang <mengqinggang@loongson.cn>2022-12-01 16:06:42 +0800
committerliuzhensong <liuzhensong@loongson.cn>2023-05-30 19:56:45 +0800
commit762444623565211ab2b6ea1fd1a19f8dd7f98888 (patch)
tree2f44798943a8f7a1eba1d6301596eae1d12703a9 /binutils/testsuite/binutils-all
parent7ad9de1188609dee11a5c196869fca62da8154a3 (diff)
downloadbinutils-762444623565211ab2b6ea1fd1a19f8dd7f98888.zip
binutils-762444623565211ab2b6ea1fd1a19f8dd7f98888.tar.gz
binutils-762444623565211ab2b6ea1fd1a19f8dd7f98888.tar.bz2
LoongArch: binutils: Add support for linker relaxation.
Add support for relocs related to relax to readelf. binutils/ChangeLog: * readelf.c (target_specific_reloc_handling): Handle ULEB128 reloc. (is_32bit_inplace_add_reloc): Handle new reloc. (is_32bit_inplace_sub_reloc): Likewise. (is_64bit_inplace_add_reloc): Likewise. (is_64bit_inplace_sub_reloc): Likewise. (is_16bit_inplace_add_reloc): Likewise. (is_16bit_inplace_sub_reloc): Likewise. (is_8bit_inplace_add_reloc): Likewise. (is_8bit_inplace_sub_reloc): Likewise. (is_6bit_inplace_sub_reloc): Likewise. (is_6bit_inplace_add_reloc): New function. (apply_relocations): Handle new reloc. * testsuite/binutils-all/readelf.exp: Add -mno-relax option for LoongArch.
Diffstat (limited to 'binutils/testsuite/binutils-all')
-rw-r--r--binutils/testsuite/binutils-all/readelf.exp13
1 files changed, 9 insertions, 4 deletions
diff --git a/binutils/testsuite/binutils-all/readelf.exp b/binutils/testsuite/binutils-all/readelf.exp
index 2a785c6..f963c6b 100644
--- a/binutils/testsuite/binutils-all/readelf.exp
+++ b/binutils/testsuite/binutils-all/readelf.exp
@@ -489,18 +489,23 @@ if {![binutils_assemble $srcdir/$subdir/z.s tmpdir/z.o]} then {
readelf_test {--decompress --hex-dump .debug_loc} $tempfile readelf.z
}
-set hpux ""
+set flags ""
# Skip the next test for the RISCV architectures because they
# do not support .ULEB128 pseudo-ops with non-constant values.
if ![istarget "riscv*-*-*"] then {
if [istarget "hppa*64*-*-hpux*"] {
- set hpux "--defsym HPUX=1"
+ set flags "--defsym HPUX=1"
}
+ # LoongArch relax align add nops, so label subtractions will increase
+ if [istarget "loongarch*-*-*"] {
+ set flags "-mno-relax"
+ }
+
# Assemble the DWARF-5 test file.
- if {![binutils_assemble_flags $srcdir/$subdir/dw5.S tmpdir/dw5.o $hpux]} then {
+ if {![binutils_assemble_flags $srcdir/$subdir/dw5.S tmpdir/dw5.o $flags]} then {
unsupported "readelf -wiaoRlL dw5 (failed to assemble)"
} else {
@@ -612,7 +617,7 @@ if ![is_remote host] {
}
# Check dwarf-5 support for DW_OP_addrx.
-if {![binutils_assemble_flags $srcdir/$subdir/dw5-op.S tmpdir/dw5-op.o $hpux]} then {
+if {![binutils_assemble_flags $srcdir/$subdir/dw5-op.S tmpdir/dw5-op.o $flags]} then {
unsupported "readelf -wi dw5-op (failed to assemble)"
} else {