Skip to content

Commit

Permalink
arm64: vmlinux.lds: make __rela_offset and __dynsym_offset ABSOLUTE
Browse files Browse the repository at this point in the history
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: 0cd3def ("arm64: kernel: perform relocation processing from ID map")
Cc: <stable@vger.kernel.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
  • Loading branch information
Ard Biesheuvel authored and Will Deacon committed Jul 29, 2016
1 parent fd6380b commit d6732fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arm64/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -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 = .;
Expand Down

0 comments on commit d6732fc

Please sign in to comment.