This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Linkerscript: properly mark minus expression with non-absolute flag
ClosedPublic

Authored by grimar on Jan 31 2017, 8:29 AM.

Details

Summary

This is alternative to D28857 which was incorrect.

One of linux scripts contains:

vvar_start = . - 2 * (1 << 12);
vvar_page = vvar_start;
vvar_vsyscall_gtod_data = vvar_page + 128;

Previously we did not mark first expression as non-absolute,
though it contains location counter.

And LLD failed with error:
relocation R_X86_64_PC32 cannot refer to absolute symbol

This patch should fix the issue, and opens road for doing the same for other operators
(though not clear if that is needed).

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu accepted this revision.Jan 31 2017, 12:01 PM

LGTM

This revision is now accepted and ready to land.Jan 31 2017, 12:01 PM
This revision was automatically updated to reflect the committed changes.