3

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.)

Timmmm
  • 88,195
  • 71
  • 364
  • 509

1 Answers1

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