aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-x86-64/pr28743-1.s
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2022-01-14 13:48:36 -0800
committerH.J. Lu <hjl.tools@gmail.com>2022-01-26 05:27:56 -0800
commitc804c6f98d342c3d46f73d7a7ec6229d5ab1c9f3 (patch)
treed3070e014b3a5057b8c9305121f18ce56a4c9558 /ld/testsuite/ld-x86-64/pr28743-1.s
parent8357282156771d782be3e3c3d44cc5ad7e1f89d7 (diff)
downloadgdb-c804c6f98d342c3d46f73d7a7ec6229d5ab1c9f3.zip
gdb-c804c6f98d342c3d46f73d7a7ec6229d5ab1c9f3.tar.gz
gdb-c804c6f98d342c3d46f73d7a7ec6229d5ab1c9f3.tar.bz2
ld: Rewrite lang_size_relro_segment_1
1. Compute the desired PT_GNU_RELRO segment base and find the maximum section alignment of sections starting from the PT_GNU_RELRO segment. 2. Find the first preceding load section. 3. Don't add the 1-page gap between the first preceding load section and the relro segment if the maximum page size >= the maximum section alignment. Align the PT_GNU_RELRO segment first. Subtract the maximum page size if therer is still a 1-page gap. PR ld/28743 PR ld/28819 * ldlang.c (lang_size_relro_segment_1): Rewrite. * testsuite/ld-x86-64/pr28743-1.d: New file. * testsuite/ld-x86-64/pr28743-1.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run pr28743-1.
Diffstat (limited to 'ld/testsuite/ld-x86-64/pr28743-1.s')
-rw-r--r--ld/testsuite/ld-x86-64/pr28743-1.s16
1 files changed, 16 insertions, 0 deletions
diff --git a/ld/testsuite/ld-x86-64/pr28743-1.s b/ld/testsuite/ld-x86-64/pr28743-1.s
new file mode 100644
index 0000000..2e9a150
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr28743-1.s
@@ -0,0 +1,16 @@
+ .text
+ .globl foo
+ .type foo, @function
+foo:
+ .cfi_startproc
+ call func@plt
+ movq func@GOTPCREL(%rip), %rax
+ .cfi_endproc
+ .section .init_array,"aw",@init_array
+ .p2align 3
+ .zero 0x4
+ .section .fini_array,"aw",@fini_array
+ .p2align 20
+ .zero 0x100
+ .data
+ .zero 0x100