Is there an option for lld
that will tell it not to perform relocations. I don't want PIC code, I just want relocations not to be performed. (Yes I know this will result in an executable that doesn't work.)
Asked
Active
Viewed 1,026 times
3

Timmmm
- 88,195
- 71
- 364
- 509
1 Answers
2
Turns out to be an easy and fairly obvious solution - just pass -r
or --relocatable
. Then it won't apply relocations but will store them in the output file instead.
Edit: Unfortunately this does not quite have the effect I want, because you can't use --gc-sections
and --relocatable
at the same time.

Timmmm
- 88,195
- 71
- 364
- 509
-
So I guess you want to, to put it in other words, discard the relocations? – Luís Marques May 15 '19 at 12:38
-
2Yes. Unfortunately I ended up having to patch LLVM locally and add an `--ignore-relocations` flag which does exactly that. – Timmmm May 15 '19 at 16:38