[PATCH v3 2/2] ld testsuite: Update "__patchable_function_entries section [2-6]" test cases

Jan Dubiec <[email protected]>
Newsgroups gmane.comp.gnu.binutils
Message-ID <[email protected]>
Changing the default H8 architecture from H8/300 to H8/300H caused these
test cases to fail, as shown below. H8/300H uses 32-bit addresses in its
default advanced mode, whereas H8/300 uses 16-bit addresses. The following
patch updates the affected test cases accordingly.

[...]
/mnt/Works/xcomp/build-binutils-h8300-linux/ld/../gas/as-new   -I/mnt/Works/binutils/ld/testsuite/ld-elf   --defsym ALIGN=2 --defsym UNDERSCORE=1 -o tmpdir/pr25490-2.o  /mnt/Works/binutils/ld/testsuite/ld-elf/pr25490-2.s
Executing on host: sh -c {/mnt/Works/xcomp/build-binutils-h8300-linux/ld/../gas/as-new   -I/mnt/Works/binutils/ld/testsuite/ld-elf   --defsym ALIGN=2 --defsym UNDERSCORE=1 -o tmpdir/pr25490-2.o  /mnt/Works/binutils/ld/testsuite/ld-elf/pr25490-2.s 2>&1}  /dev/null ld.tmp (timeout = 300)
spawn [open ...]
./ld-new    -o tmpdir/pr25490-2.exe  -L/mnt/Works/binutils/ld/testsuite/ld-elf --gc-sections -e _start tmpdir/pr25490-2.o 
Executing on host: sh -c {./ld-new    -o tmpdir/pr25490-2.exe  -L/mnt/Works/binutils/ld/testsuite/ld-elf --gc-sections -e _start tmpdir/pr25490-2.o  2>&1}  /dev/null ld.tmp (timeout = 300)
spawn [open ...]
Executing on host: sh -c {/mnt/Works/xcomp/build-binutils-h8300-linux/ld/../binutils/readelf -SW tmpdir/pr25490-2.exe >dump.out 2>ld.stderr}  /dev/null  (timeout = 300)
spawn [open ...]
/mnt/Works/xcomp/build-binutils-h8300-linux/ld/../binutils/readelf -SW tmpdir/pr25490-2.exe
extra regexps in /mnt/Works/binutils/ld/testsuite/ld-elf/pr25490-2-16.rd starting with "^ +\[ *[0-9]+\] __patchable_function_entries +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+2 +00 +WAL +[0-9] +0 +[1248]$"
EOF from dump.out
output is There are 6 section headers, starting at offset 0x1d8:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .text             PROGBITS        00000100 000074 000001 00  AX  0   0  1
  [ 2] __patchable_function_entries PROGBITS        00000103 000075 000004 00 WAL  1   0  1
  [ 3] .symtab           SYMTAB          00000000 00007c 0000d0 10      4   7  4
  [ 4] .strtab           STRTAB          00000000 00014c 00004e 00      0   0  1
  [ 5] .shstrtab         STRTAB          00000000 00019a 00003e 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
  L (link order), O (extra OS processing required), G (group), T (TLS),
  C (compressed), x (unknown), o (OS specific), E (exclude),
  D (mbind), p (processor specific)

FAIL: __patchable_function_entries section 2
[...]

ld/ChangeLog:

	* testsuite/ld-elf/elf.exp: Set H8/300H as the default architecture for
	the H8 family. Also update "__patchable_function_entries section [2-6]"
	test cases because H8/300H uses 32-bit addresses/pointers instead of
	the 16-bit addresses/pointers used by H8/300.

Signed-off-by: Jan Dubiec <[email protected]>
---
 ld/testsuite/ld-elf/elf.exp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index 337206318ab..2500d90e8f2 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -103,7 +103,6 @@ if [is_elf64 tmpdir/symbol3w.a] {
     set ASFLAGS "$ASFLAGS --defsym ALIGN=2"
     set pr23900_1_exp "pr23900-1-32.rd"
     if {    [istarget avr-*-*]
-	 || [istarget h8300-*-*]
 	 || [istarget ip2k-*-*]
 	 || [istarget m68hc11-*]
 	 || [istarget "z80-*-*"] } {
-- 
2.54.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.