[PATCH] D78923: [LLD] [COFF] Add an option for disabling runtime pseudo relocs

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 6 14:09:18 PDT 2020


mstorsjo marked an inline comment as done.
mstorsjo added a comment.

In D78923#2021685 <https://reviews.llvm.org/D78923#2021685>, @rnk wrote:

> lgtm


Thanks for the review - but I realized I'll want to revise this a bit before landing - ld.bfd actually has two different sets of options, `--disable-auto-import` and `--disable-runtime-pseudo-relocs` - and it might be good to keep the distinction. I.e. `--disable-auto-import` opts out of the whole process, requiring strict use of dllimports, while `--disable-runtime-pseudo-relocs` just makes it error out if pseudo relocs really are needed. Because thanks to `.refptr$<sym>` stubs, we actually don't need to create any pseudo relocs at all in most cases, as we alias the refptr stub on the IAT entry in those cases.

Also, did you specifically look at the part of the patch about allowing this lld private option in `.drectve` sections? I'm not entirely convinced about whether that's a good thing to do and would appreciate your opinion.



================
Comment at: lld/COFF/Options.td:187
 // LLD extensions
+defm runtime_pseudo_reloc : B<"runtime-pseudo-reloc", "", "">;
 def end_lib : F<"end-lib">,
----------------
rnk wrote:
> mstorsjo wrote:
> > It would be nice to be able to omit the HelpText for the two options here (to hide the option from the help listing), when using `B<>` style options for private options, but the current form of `multiclass B<...` doesn't allow omitting those strings and unconditionally adds HelpText, which includes it in the listing. I'm not nearly familiar enough with tablegen to know what's possible to do, though.
> I suppose the best option I can think of is two `def Flag` variants.
I realized the best might be to just make another multiclass, `B_priv` or something like that, without the help texts.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78923





More information about the llvm-commits mailing list