[PATCH] D28857: [ELF] - Allow relative relocations to a absolute value defined in linker script.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 18 07:07:22 PST 2017


George Rimar <grimar at accesssoftek.com> writes:
> This script (https://github.com/torvalds/linux/blob/d33d5a6c88fcd53fec329a1521010f1bc55fa191/arch/x86/entry/vdso/vdso-layout.lds.S)
> starts from:
>
> SECTIONS
> {
>   vvar_start = . - 2 * (1 << 12);
>   vvar_page = vvar_start;
>   vvar_vsyscall_gtod_data = vvar_page + 128;
>
> I think vvar_start is always constant, do not know why they wrote ". - 2 * (1 << 12)" when it looks
> could be just "- 2 * (1 << 12)".

The difference is that the '.' makes it a position in the file, and
therefore not absolute.

Cheers,
Rafael


More information about the llvm-commits mailing list