[PATCH] D55505: [LLD][ELF] Implement option to force PIC compatible Thunks

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 10 04:24:26 PST 2018


grimar added a comment.

You need to add the new option(s) to lld\docs\ld.lld.1 I think.



================
Comment at: ELF/Driver.cpp:822
   Config->OutputFile = Args.getLastArgValue(OPT_o);
+  Config->PicThunk = Args.hasArg(OPT_pic_thunk);
   Config->Pie = Args.hasFlag(OPT_pie, OPT_no_pie, false);
----------------
Should it have `Config->Pic` argument as a default (and a OPT_no_pic_thunk)?

```
Config->PicThunk = Args.hasArg(OPT_pic_thunk, OPT_no_pic_thunk, Config->Pic);
```


================
Comment at: ELF/Thunks.cpp:653
 
+static bool usePicThunk() {
+  return Config->Pic || Config->PicThunk;
----------------
Then you could remove this helper.


================
Comment at: test/ELF/arm-force-pi-thunk.s:12
+// RUN: llvm-objdump -d -triple=thumbv7a-none-linux-gnueabi %t2v | FileCheck %s
+// Test that we can force generation of position independent thunks even when
+// inputs are not pic. Also test command line alias --pic-veneer.
----------------
I would add empty lines before/after this comment.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55505/new/

https://reviews.llvm.org/D55505





More information about the llvm-commits mailing list