]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Re: aarch64: Add some DT_RELR ld tests
authorAlan Modra <amodra@gmail.com>
Mon, 3 Jun 2024 23:30:57 +0000 (09:00 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 6 Jun 2024 01:07:02 +0000 (10:37 +0930)
aarch64-elf fails these tests due to .rela.dyn being at a different
address to that expected, and due to the symbol table being different.
Unexpected symbol numbering results in a mismatch of reloc r_info
field, but these are shown decoded so the raw field doesn't really add
anything to the test.

* testsuite/ld-aarch64/relr-align.d: Accept any address for
.relr.dyn section.  Don't match raw r_info field.
* testsuite/ld-aarch64/relr-data-shared.d: Likewise.
* testsuite/ld-aarch64/relr-got-shared.d: Likewise.
* testsuite/ld-aarch64/relr-text-shared.d: Likewise.

ld/testsuite/ld-aarch64/relr-align.d
ld/testsuite/ld-aarch64/relr-data-shared.d
ld/testsuite/ld-aarch64/relr-got-shared.d
ld/testsuite/ld-aarch64/relr-text-shared.d

index ac2fa6eff0873fc868acf0822731a3b2536e187b..5ad00784b3b03a4f66a3b7ccc59dee8f2944607c 100644 (file)
@@ -2,13 +2,13 @@
 #ld: -shared -z pack-relative-relocs -T relocs.ld
 #readelf: -rW
 
-Relocation section '\.rela\.dyn' at offset 0x10090 contains 3 entries:
+Relocation section '\.rela\.dyn' .* contains 3 entries:
     Offset             Info             Type               Symbol's Value  Symbol's Name \+ Addend
-0000000012340011  0000000000000403 R_AARCH64_RELATIVE                        10000
-0000000012340019  0000000000000403 R_AARCH64_RELATIVE                        10000
-0000000012340041  0000000000000403 R_AARCH64_RELATIVE                        10000
+0000000012340011 .* R_AARCH64_RELATIVE                        10000
+0000000012340019 .* R_AARCH64_RELATIVE                        10000
+0000000012340041 .* R_AARCH64_RELATIVE                        10000
 
-Relocation section '\.relr\.dyn' at offset 0x100d8 contains 9 entries which relocate 10 locations:
+Relocation section '\.relr\.dyn' .* contains 9 entries which relocate 10 locations:
 Index: Entry            Address           Symbolic Address
 0000:  0000000012340000 0000000012340000  double_0
 0001:  0000000000000003 0000000012340008  double_0 \+ 0x8
index d94b335fac2a58bd1cd43f206e70aa43b1fe186e..4e9dbaf12e3bcfd3592b155f31d560304f424bc0 100644 (file)
@@ -2,16 +2,16 @@
 #ld: -shared -z pack-relative-relocs -T relocs.ld
 #readelf: -rW
 
-Relocation section '\.rela\.dyn' at offset 0x10150 contains 6 entries:
+Relocation section '\.rela\.dyn' .* contains 6 entries:
     Offset             Info             Type               Symbol's Value  Symbol's Name \+ Addend
-0000000012340000  0000000000000403 R_AARCH64_RELATIVE                        10004
-0000000012340008  0000000000000403 R_AARCH64_RELATIVE                        10008
-0000000012340018  0000000000000403 R_AARCH64_RELATIVE                        12340050
-0000000012340010  0000000400000101 R_AARCH64_ABS64        000000000001000c sym_global \+ 0
-0000000012340030  0000000400000101 R_AARCH64_ABS64        000000000001000c sym_global \+ 0
-0000000012340040  0000000300000101 R_AARCH64_ABS64        0000000000000000 sym_weak_undef \+ 0
+0000000012340000 .* R_AARCH64_RELATIVE                        10004
+0000000012340008 .* R_AARCH64_RELATIVE                        10008
+0000000012340018 .* R_AARCH64_RELATIVE                        12340050
+0000000012340010 .* R_AARCH64_ABS64        000000000001000c sym_global \+ 0
+0000000012340030 .* R_AARCH64_ABS64        000000000001000c sym_global \+ 0
+0000000012340040 .* R_AARCH64_ABS64        0000000000000000 sym_weak_undef \+ 0
 
-Relocation section '\.relr\.dyn' at offset 0x101e0 contains 2 entries which relocate 3 locations:
+Relocation section '\.relr\.dyn' .* contains 2 entries which relocate 3 locations:
 Index: Entry            Address           Symbolic Address
 0000:  0000000012340020 0000000012340020  aligned_local
 0001:  0000000000000023 0000000012340028  aligned_hidden
index 59526947a9a5cc2cc1c282037d1d5d10eecddca0..5713d25a8ed046a9853bc8e94d79c71ad8834d6b 100644 (file)
@@ -2,13 +2,13 @@
 #ld: -shared -z pack-relative-relocs -T relocs.ld
 #readelf: -rW
 
-Relocation section '\.rela\.dyn' at offset 0x10168 contains 3 entries:
+Relocation section '\.rela\.dyn' .* contains 3 entries:
     Offset             Info             Type               Symbol's Value  Symbol's Name \+ Addend
-0000000000020020  0000000300000401 R_AARCH64_GLOB_DAT     0000000000010038 sym_global \+ 0
-0000000000020028  0000000500000401 R_AARCH64_GLOB_DAT     000000000000002a sym_global_abs \+ 0
-0000000000020030  0000000200000401 R_AARCH64_GLOB_DAT     0000000000000000 sym_weak_undef \+ 0
+0000000000020020 .* R_AARCH64_GLOB_DAT     0000000000010038 sym_global \+ 0
+0000000000020028 .* R_AARCH64_GLOB_DAT     000000000000002a sym_global_abs \+ 0
+0000000000020030 .* R_AARCH64_GLOB_DAT     0000000000000000 sym_weak_undef \+ 0
 
-Relocation section '\.relr\.dyn' at offset 0x101b0 contains 2 entries which relocate 3 locations:
+Relocation section '\.relr\.dyn' .* contains 2 entries which relocate 3 locations:
 Index: Entry            Address           Symbolic Address
 0000:  0000000000020008 0000000000020008  _GLOBAL_OFFSET_TABLE_ \+ 0x8
 0001:  0000000000000007 0000000000020010  _GLOBAL_OFFSET_TABLE_ \+ 0x10
index 06895d488b7b7c34ce3f37dfe9b35826c4215d25..bd64b665261e6f1f2cb20f1f07a22c2f5e030914 100644 (file)
@@ -5,10 +5,10 @@
 #...
  0x0000000000000016 \(TEXTREL\)            0x0
 #...
- 0x0000000000000024 \(RELR\)               0x10098
+ 0x0000000000000024 \(RELR\)               .*
  0x0000000000000023 \(RELRSZ\)             8 \(bytes\)
  0x0000000000000025 \(RELRENT\)            8 \(bytes\)
 #...
-Relocation section '.relr.dyn' at offset 0x10098 contains 1 entry which relocates 1 location:
+Relocation section '.relr.dyn' .* contains 1 entry which relocates 1 location:
 Index: Entry            Address           Symbolic Address
 0000:  0000000000010000 0000000000010000  _start