[PATCH] D115844: [ubsan] Using metadata instead of prologue data for function sanitizer

Yuanfang Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 3 10:20:45 PDT 2022


ychen added inline comments.
Herald added subscribers: jsji, Enna1.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:1843
+
+  auto *FTRTTIProxy = new llvm::GlobalVariable(
+      TheModule, Addr->getType(),
----------------
pcc wrote:
> ychen wrote:
> > pcc wrote:
> > > Are these proxy variables necessary? I think that now that we have custom code generation for this you should be able to use a GOTPCREL relocation to refer to the global.
> > I attempted the GOTPCREL approach in a local branch. It didn't work for a reason that I couldn't remember off the top of my head. I'll find out.
> > 
> > > I think that now that we have custom code generation for this 
> > 
> > Sorry, I don't quite follow which `custom code generation` you are referring to. Do you mean the changes in `AsmPrinter.cpp`?
> > Sorry, I don't quite follow which custom code generation you are referring to. Do you mean the changes in AsmPrinter.cpp?
> 
> Yes, that's what I meant.
@pcc, I looked into my local branch that uses PCREL approach. It is not simpler/cleaner than the current approach due to the X86/X86-64, macho/ELF difference. These need their specific relocation types.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115844



More information about the llvm-commits mailing list