]> Git Repo - linux.git/commitdiff
arm64: vmlinux.lds: make __rela_offset and __dynsym_offset ABSOLUTE
authorArd Biesheuvel <[email protected]>
Thu, 28 Jul 2016 14:15:14 +0000 (16:15 +0200)
committerWill Deacon <[email protected]>
Fri, 29 Jul 2016 09:44:53 +0000 (10:44 +0100)
Due to the untyped KIMAGE_VADDR constant, the linker may not notice
that the __rela_offset and __dynsym_offset expressions are absolute
values (i.e., are not subject to relocation). This does not matter for
KASLR, but it does confuse kallsyms in relative mode, since it uses
the lowest non-absolute symbol address as the anchor point, and expects
all other symbol addresses to be within 4 GB of it.

Fix this by qualifying these expressions as ABSOLUTE() explicitly.

Fixes: 0cd3defe0af4 ("arm64: kernel: perform relocation processing from ID map")
Cc: <[email protected]>
Signed-off-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
arch/arm64/kernel/vmlinux.lds.S

index 89d6e177ecbd4ade288f9c139df57a937820adfe..d494921799670076d97c13479a5e7f7dc9ca431e 100644 (file)
@@ -184,9 +184,9 @@ SECTIONS
                *(.hash)
        }
 
-       __rela_offset   = ADDR(.rela) - KIMAGE_VADDR;
+       __rela_offset   = ABSOLUTE(ADDR(.rela) - KIMAGE_VADDR);
        __rela_size     = SIZEOF(.rela);
-       __dynsym_offset = ADDR(.dynsym) - KIMAGE_VADDR;
+       __dynsym_offset = ABSOLUTE(ADDR(.dynsym) - KIMAGE_VADDR);
 
        . = ALIGN(SEGMENT_ALIGN);
        __init_end = .;
This page took 0.060513 seconds and 4 git commands to generate.