Skip to content

Commit e8da08f

Browse files
committed
Merge branch 'for-next/vdso' into for-next/core
* for-next/vdso: arm64: vdso32: Add DWARF_DEBUG arm64: vdso32: Shuffle .ARM.exidx section above ELF_DETAILS arm64: compat: Move sigreturn32.S to .rodata section arm64: vdso*: place got/plt sections in .rodata arm64: vdso32: add ARM.exidx* sections arm64: compat: Move kuser32.S to .rodata section arm64: vdso32: enable orphan handling for VDSO arm64: vdso32: put ELF related sections in the linker script arm64: vdso: enable orphan handling for VDSO arm64: vdso: put ELF related sections in the linker script
2 parents 618ff55 + 9e07352 commit e8da08f

File tree

6 files changed

+48
-6
lines changed

6 files changed

+48
-6
lines changed

arch/arm64/kernel/kuser32.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include <asm/unistd.h>
1717

18+
.section .rodata
1819
.align 5
1920
.globl __kuser_helper_start
2021
__kuser_helper_start:

arch/arm64/kernel/sigreturn32.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include <asm/unistd.h>
1717

18+
.section .rodata
1819
.globl __aarch32_sigret_code_start
1920
__aarch32_sigret_code_start:
2021

arch/arm64/kernel/vdso/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ btildflags-$(CONFIG_ARM64_BTI_KERNEL) += -z force-bti
2424
# routines, as x86 does (see 6f121e548f83 ("x86, vdso: Reimplement vdso.so
2525
# preparation in build-time C")).
2626
ldflags-y := -shared -soname=linux-vdso.so.1 --hash-style=sysv \
27-
-Bsymbolic --build-id=sha1 -n $(btildflags-y) -T
27+
-Bsymbolic --build-id=sha1 -n $(btildflags-y)
28+
29+
ifdef CONFIG_LD_ORPHAN_WARN
30+
ldflags-y += --orphan-handling=warn
31+
endif
32+
33+
ldflags-y += -T
2834

2935
ccflags-y := -fno-common -fno-builtin -fno-stack-protector -ffixed-x18
3036
ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO

arch/arm64/kernel/vdso/vdso.lds.S

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/const.h>
1212
#include <asm/page.h>
1313
#include <asm/vdso.h>
14+
#include <asm-generic/vmlinux.lds.h>
1415

1516
OUTPUT_FORMAT("elf64-littleaarch64", "elf64-bigaarch64", "elf64-littleaarch64")
1617
OUTPUT_ARCH(aarch64)
@@ -49,11 +50,24 @@ SECTIONS
4950

5051
.dynamic : { *(.dynamic) } :text :dynamic
5152

52-
.rodata : { *(.rodata*) } :text
53+
.rela.dyn : ALIGN(8) { *(.rela .rela*) }
54+
55+
.rodata : {
56+
*(.rodata*)
57+
*(.got)
58+
*(.got.plt)
59+
*(.plt)
60+
*(.plt.*)
61+
*(.iplt)
62+
*(.igot .igot.plt)
63+
} :text
5364

5465
_end = .;
5566
PROVIDE(end = .);
5667

68+
DWARF_DEBUG
69+
ELF_DETAILS
70+
5771
/DISCARD/ : {
5872
*(.data .data.* .gnu.linkonce.d.* .sdata*)
5973
*(.bss .sbss .dynbss .dynsbss)

arch/arm64/kernel/vdso32/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ VDSO_AFLAGS += -D__ASSEMBLY__
104104
VDSO_LDFLAGS += -Bsymbolic --no-undefined -soname=linux-vdso.so.1
105105
VDSO_LDFLAGS += -z max-page-size=4096 -z common-page-size=4096
106106
VDSO_LDFLAGS += -shared --hash-style=sysv --build-id=sha1
107+
VDSO_LDFLAGS += --orphan-handling=warn
107108

108109

109110
# Borrow vdsomunge.c from the arm vDSO

arch/arm64/kernel/vdso32/vdso.lds.S

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/const.h>
1212
#include <asm/page.h>
1313
#include <asm/vdso.h>
14+
#include <asm-generic/vmlinux.lds.h>
1415

1516
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
1617
OUTPUT_ARCH(arm)
@@ -35,12 +36,30 @@ SECTIONS
3536

3637
.dynamic : { *(.dynamic) } :text :dynamic
3738

38-
.rodata : { *(.rodata*) } :text
39+
.rodata : {
40+
*(.rodata*)
41+
*(.got)
42+
*(.got.plt)
43+
*(.plt)
44+
*(.rel.iplt)
45+
*(.iplt)
46+
*(.igot.plt)
47+
} :text
3948

40-
.text : { *(.text*) } :text =0xe7f001f2
49+
.text : {
50+
*(.text*)
51+
*(.glue_7)
52+
*(.glue_7t)
53+
*(.vfp11_veneer)
54+
*(.v4_bx)
55+
} :text =0xe7f001f2
4156

42-
.got : { *(.got) }
43-
.rel.plt : { *(.rel.plt) }
57+
.rel.dyn : { *(.rel*) }
58+
59+
.ARM.exidx : { *(.ARM.exidx*) }
60+
DWARF_DEBUG
61+
ELF_DETAILS
62+
.ARM.attributes 0 : { *(.ARM.attributes) }
4463

4564
/DISCARD/ : {
4665
*(.note.GNU-stack)

0 commit comments

Comments
 (0)