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
This commit is contained in:
Will Deacon 2022-07-25 10:57:44 +01:00
commit e8da08fc3d
6 changed files with 48 additions and 6 deletions

View File

@ -15,6 +15,7 @@
#include <asm/unistd.h>
.section .rodata
.align 5
.globl __kuser_helper_start
__kuser_helper_start:

View File

@ -15,6 +15,7 @@
#include <asm/unistd.h>
.section .rodata
.globl __aarch32_sigret_code_start
__aarch32_sigret_code_start:

View File

@ -24,7 +24,13 @@ btildflags-$(CONFIG_ARM64_BTI_KERNEL) += -z force-bti
# routines, as x86 does (see 6f121e548f83 ("x86, vdso: Reimplement vdso.so
# preparation in build-time C")).
ldflags-y := -shared -soname=linux-vdso.so.1 --hash-style=sysv \
-Bsymbolic --build-id=sha1 -n $(btildflags-y) -T
-Bsymbolic --build-id=sha1 -n $(btildflags-y)
ifdef CONFIG_LD_ORPHAN_WARN
ldflags-y += --orphan-handling=warn
endif
ldflags-y += -T
ccflags-y := -fno-common -fno-builtin -fno-stack-protector -ffixed-x18
ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO

View File

@ -11,6 +11,7 @@
#include <linux/const.h>
#include <asm/page.h>
#include <asm/vdso.h>
#include <asm-generic/vmlinux.lds.h>
OUTPUT_FORMAT("elf64-littleaarch64", "elf64-bigaarch64", "elf64-littleaarch64")
OUTPUT_ARCH(aarch64)
@ -49,11 +50,24 @@ SECTIONS
.dynamic : { *(.dynamic) } :text :dynamic
.rodata : { *(.rodata*) } :text
.rela.dyn : ALIGN(8) { *(.rela .rela*) }
.rodata : {
*(.rodata*)
*(.got)
*(.got.plt)
*(.plt)
*(.plt.*)
*(.iplt)
*(.igot .igot.plt)
} :text
_end = .;
PROVIDE(end = .);
DWARF_DEBUG
ELF_DETAILS
/DISCARD/ : {
*(.data .data.* .gnu.linkonce.d.* .sdata*)
*(.bss .sbss .dynbss .dynsbss)

View File

@ -104,6 +104,7 @@ VDSO_AFLAGS += -D__ASSEMBLY__
VDSO_LDFLAGS += -Bsymbolic --no-undefined -soname=linux-vdso.so.1
VDSO_LDFLAGS += -z max-page-size=4096 -z common-page-size=4096
VDSO_LDFLAGS += -shared --hash-style=sysv --build-id=sha1
VDSO_LDFLAGS += --orphan-handling=warn
# Borrow vdsomunge.c from the arm vDSO

View File

@ -11,6 +11,7 @@
#include <linux/const.h>
#include <asm/page.h>
#include <asm/vdso.h>
#include <asm-generic/vmlinux.lds.h>
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
OUTPUT_ARCH(arm)
@ -35,12 +36,30 @@ SECTIONS
.dynamic : { *(.dynamic) } :text :dynamic
.rodata : { *(.rodata*) } :text
.rodata : {
*(.rodata*)
*(.got)
*(.got.plt)
*(.plt)
*(.rel.iplt)
*(.iplt)
*(.igot.plt)
} :text
.text : { *(.text*) } :text =0xe7f001f2
.text : {
*(.text*)
*(.glue_7)
*(.glue_7t)
*(.vfp11_veneer)
*(.v4_bx)
} :text =0xe7f001f2
.got : { *(.got) }
.rel.plt : { *(.rel.plt) }
.rel.dyn : { *(.rel*) }
.ARM.exidx : { *(.ARM.exidx*) }
DWARF_DEBUG
ELF_DETAILS
.ARM.attributes 0 : { *(.ARM.attributes) }
/DISCARD/ : {
*(.note.GNU-stack)