aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2022-08-01 16:02:39 -0700
committerAlan Modra <amodra@gmail.com>2022-09-22 09:38:23 +0930
commita98316d5cf970cbc99689797d84c2ea832bcdcbb (patch)
tree2091748b873b705e080927ff9b3edc6a08e2d199 /ld
parent08e401e41cade78591393e865304f664bb206810 (diff)
downloadgdb-a98316d5cf970cbc99689797d84c2ea832bcdcbb.zip
gdb-a98316d5cf970cbc99689797d84c2ea832bcdcbb.tar.gz
gdb-a98316d5cf970cbc99689797d84c2ea832bcdcbb.tar.bz2
elf: Reset alignment for each PT_LOAD segment
Reset alignment for each PT_LOAD segment to avoid using alignment from the previous PT_LOAD segment. bfd/ PR ld/29435 * elf.c (assign_file_positions_for_load_sections): Reset alignment for each PT_LOAD segment. ld/ PR ld/29435 * testsuite/ld-elf/pr29435.d: New file. * testsuite/ld-elf/pr29435.s: Likewise. (cherry picked from commit 59f214544c50ec7ebbca285ff2b4949f48671690)
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ld-elf/pr29435.d11
-rw-r--r--ld/testsuite/ld-elf/pr29435.s6
2 files changed, 17 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/pr29435.d b/ld/testsuite/ld-elf/pr29435.d
new file mode 100644
index 0000000..4ca4fd0
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr29435.d
@@ -0,0 +1,11 @@
+#ld: -shared -z separate-code -z relro
+#xfail: ![check_shared_lib_support]
+#xfail: ![check_relro_support]
+#readelf: -Wl
+
+#failif
+#...
+ +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ .* 0x8000
+#...
+ +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ .* 0x8000
+#...
diff --git a/ld/testsuite/ld-elf/pr29435.s b/ld/testsuite/ld-elf/pr29435.s
new file mode 100644
index 0000000..d2d8f26
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr29435.s
@@ -0,0 +1,6 @@
+ .text
+ .balign 0x8000
+ .globl foo
+ .type foo, %function
+foo:
+ .byte 0