mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-12-19 01:19:41 +08:00
ld: Add tests for PR ld/32690
Without
commit 230a788eb2
Author: Alan Modra <amodra@gmail.com>
Date: Tue Feb 18 08:54:06 2025 +1030
PR32690, assertion failure in lang_size_relro_segment
this test triggers the linker error:
.../ld: internal error .../ld/ldlang.c 6618
collect2: error: ld returned 1 exit status
with GCC 10 or above on x86-64.
PR ld/32690
* testsuite/ld-elf/elf.exp: Run PR ld/32690 tests.
* testsuite/ld-elf/pr32690.h: New file.
* testsuite/ld-elf/pr32690a.c: Likewise.
* testsuite/ld-elf/pr32690b.c: Likewise.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
This commit is contained in:
@@ -497,6 +497,17 @@ if { [istarget *-*-linux*]
|
||||
]
|
||||
}
|
||||
|
||||
run_cc_link_tests [list \
|
||||
[list \
|
||||
"Build pr32690.so" \
|
||||
"-shared" \
|
||||
"-O2 -fPIC" \
|
||||
{ pr32690b.c } \
|
||||
{} \
|
||||
"pr32690.so" \
|
||||
] \
|
||||
]
|
||||
|
||||
run_ld_link_exec_tests [list \
|
||||
[list \
|
||||
"Run mbind2a" \
|
||||
@@ -516,6 +527,18 @@ if { [istarget *-*-linux*]
|
||||
"pass.out" \
|
||||
"-O2 -I../bfd" \
|
||||
] \
|
||||
[list \
|
||||
"Run pr32690" \
|
||||
"-pie -Wl,-z,now" \
|
||||
"" \
|
||||
{ pr32690a.c } \
|
||||
"pr32690" \
|
||||
"pass.out" \
|
||||
"-O2 -fPIE" \
|
||||
"C" \
|
||||
{} \
|
||||
"-Wl,-R,tmpdir tmpdir/pr32690.so" \
|
||||
] \
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
17
ld/testsuite/ld-elf/pr32690.h
Normal file
17
ld/testsuite/ld-elf/pr32690.h
Normal file
@@ -0,0 +1,17 @@
|
||||
struct data1
|
||||
{
|
||||
char c[0x1000];
|
||||
} __attribute__ ((aligned (128)));
|
||||
|
||||
struct data2
|
||||
{
|
||||
char c[872];
|
||||
};
|
||||
|
||||
extern const struct data1 d1[];
|
||||
extern const struct data2 d2;
|
||||
extern const char c1[];
|
||||
|
||||
extern const int var0;
|
||||
extern const int var1;
|
||||
extern const int var2;
|
||||
1297
ld/testsuite/ld-elf/pr32690a.c
Normal file
1297
ld/testsuite/ld-elf/pr32690a.c
Normal file
File diff suppressed because it is too large
Load Diff
2119
ld/testsuite/ld-elf/pr32690b.c
Normal file
2119
ld/testsuite/ld-elf/pr32690b.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user