diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2016-04-18 17:09:43 +0200 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2016-04-26 12:21:54 +0100 |
commit | 0cd3defe0af4153ffc5fe39bcfa4abfc301984e9 (patch) | |
tree | 13471ceb09b0a000472a200807df7566dd7feee7 /arch/arm64/kernel/vmlinux.lds.S | |
parent | e5ebeec879b726c755af0c1c15f3699b53268cd5 (diff) | |
download | lwn-0cd3defe0af4153ffc5fe39bcfa4abfc301984e9.tar.gz lwn-0cd3defe0af4153ffc5fe39bcfa4abfc301984e9.zip |
arm64: kernel: perform relocation processing from ID map
Refactor the relocation processing so that the code executes from the
ID map while accessing the relocation tables via the virtual mapping.
This way, we can use literals containing virtual addresses as before,
instead of having to use convoluted absolute expressions.
For symmetry with the secondary code path, the relocation code and the
subsequent jump to the virtual entry point are implemented in a function
called __primary_switch(), and __mmap_switched() is renamed to
__primary_switched(). Also, the call sequence in stext() is aligned with
the one in secondary_startup(), by replacing the awkward 'adr_l lr' and
'b cpu_setup' sequence with a simple branch and link.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/kernel/vmlinux.lds.S')
-rw-r--r-- | arch/arm64/kernel/vmlinux.lds.S | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index 77d86c976abd..8918b303cc61 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -158,12 +158,9 @@ SECTIONS *(.altinstr_replacement) } .rela : ALIGN(8) { - __reloc_start = .; *(.rela .rela*) - __reloc_end = .; } .dynsym : ALIGN(8) { - __dynsym_start = .; *(.dynsym) } .dynstr : { @@ -173,6 +170,10 @@ SECTIONS *(.hash) } + __rela_offset = ADDR(.rela) - KIMAGE_VADDR; + __rela_size = SIZEOF(.rela); + __dynsym_offset = ADDR(.dynsym) - KIMAGE_VADDR; + . = ALIGN(SEGMENT_ALIGN); __init_end = .; |