search for: currentfnsym

Displaying 7 results from an estimated 7 matches for "currentfnsym".

2018 Jul 16
2
Collect all possible return address and write in a new section
Hi I try to implement a coarse-grained CFI in LLVM (CFI = Contorl Flow Integrity) I want to collect all address after call instructions address after a call equals to a valid return site in coarse-grained CFI I want to add a new section and write all the possible return address in the new section (and then, add the integrity check) I have some quetions: (1) Which part of LLVM code should
2016 Aug 05
2
XRay: Demo on x86_64/Linux almost done; some questions.
...X86MCInstLower.cpp : void X86AsmPrinter::EmitXRayTable() { if (Sleds.empty()) return; if (Subtarget->isTargetELF()) { auto *Section = OutContext.getELFSection( "xray_instr_map", ELF::SHT_PROGBITS, ELF::SHF_ALLOC | ELF::SHF_GROUP | ELF::SHF_MERGE, 0, CurrentFnSym->getName()); auto PrevSection = OutStreamer->getCurrentSectionOnly(); OutStreamer->SwitchSection(Section); for (const auto &Sled : Sleds) { OutStreamer->EmitSymbolValue(Sled.Sled, 8); OutStreamer->EmitSymbolValue(CurrentFnSym, 8); auto Kind = static_...
2012 Mar 13
3
[LLVMdev] Your commit 103140
...ter.cpp (revision 103140) > @@ -408,7 +408,13 @@ > /// EmitFunctionEntryLabel - Emit the label that is the entrypoint for the > /// function. This can be overridden by targets as required to do custom stuff. > void AsmPrinter::EmitFunctionEntryLabel() { > - OutStreamer.EmitLabel(CurrentFnSym); > + // The function label could have already been emitted if two symbols end up > + // conflicting due to asm renaming. Detect this and emit an error. > + if (CurrentFnSym->isUndefined()) > + return OutStreamer.EmitLabel(CurrentFnSym); > + > + report_fatal_error(&quot...
2011 Sep 17
0
[LLVMdev] Problem with Linux PPC64 assembly output.
...n the function label and the temp label. MCSymbol *FnEndLabel = OutContext.CreateTempSymbol(); OutStreamer.EmitLabel(FnEndLabel); const MCExpr *SizeExp = MCBinaryExpr::CreateSub(MCSymbolRefExpr::Create(FnEndLabel, OutContext), MCSymbolRefExpr::Create(CurrentFnSym, OutContext), OutContext); OutStreamer.EmitELFSize(CurrentFnSym, SizeExp); } I've filed a bug for this: http://llvm.org/bugs/show_bug.cgi?id=10951 This looks a little tricky to fix since there is no easy hook that I can find to override how the .size dire...
2016 Aug 04
2
XRay: Demo on x86_64/Linux almost done; some questions.
> On 4 Aug 2016, at 06:27, Serge Rogatch <serge.rogatch at gmail.com> wrote: > > Hi Dean, > > I have a question about the following piece of code in compiler-rt/trunk/lib/xray/xray_trampoline_x86.S : > movq _ZN6__xray19XRayPatchedFunctionE(%rip), %rax > testq %rax, %rax > je .Ltmp0 > > // assume that %r10d has the function id. > movl %r10d,
2016 Aug 08
2
XRay: Demo on x86_64/Linux almost done; some questions.
...if (Sleds.empty()) > > return; > > if (Subtarget->isTargetELF()) { > > auto *Section = OutContext.getELFSection( > > "xray_instr_map", ELF::SHT_PROGBITS, > > ELF::SHF_ALLOC | ELF::SHF_GROUP | ELF::SHF_MERGE, 0, > > CurrentFnSym->getName()); > > auto PrevSection = OutStreamer->getCurrentSectionOnly(); > > OutStreamer->SwitchSection(Section); > > for (const auto &Sled : Sleds) { > > OutStreamer->EmitSymbolValue(Sled.Sled, 8); > > OutStreamer->EmitSymbo...
2017 Mar 07
4
[BUG Report] -dead_strip, strips prefix data unconditionally on macOS
Firstly, do you need "main.dsp" defined as an external symbol, or can all external references go via "main"? If the answer is the latter, that will make the solution simpler. If only the latter, you will need to make a change to LLVM here: http://llvm-cs.pcc.me.uk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp#650 Basically you would need to add a hook to the TargetLoweringObjectFile