search for: sectionkind

Displaying 20 results from an estimated 30 matches for "sectionkind".

2016 Nov 08
3
[MC] Target-Independent Small Data Section Handling
...ling from the MIPS target, but perform the same basic classification tasks: 1. Pass GlobalObject to target-declared IsGlobalInSmallSection. If it's a declaration, skip to step 4. 2. Pass GlobalObject to target-independent TargetLoweringObjectFile::getKindForGlobal. 3. Ensure the returned SectionKind is Data, BSS or Common. 4. Pass GlobalObject to target-specific IsGlobalInSmallSectionImpl, which scrutinizes the object's type for the specific architecture. I believe this redundant implementation between targets can be reduced by giving SectionKind an 'isSmallKind' bit (OR'd...
2016 Nov 17
3
[MC] Target-Independent Small Data Section Handling
...erform the same basic classification tasks: > > 1. Pass GlobalObject to target-declared IsGlobalInSmallSection. > If it's a declaration, skip to step 4. > 2. Pass GlobalObject to target-independent > TargetLoweringObjectFile::getKindForGlobal. > 3. Ensure the returned SectionKind is Data, BSS or Common. > 4. Pass GlobalObject to target-specific IsGlobalInSmallSectionImpl, > which scrutinizes the object's type for the specific architecture. > > I believe this redundant implementation between targets can be reduced by giving SectionKind an 'isSmallKin...
2016 Nov 18
0
[MC] Target-Independent Small Data Section Handling
...fication tasks: > > > > 1. Pass GlobalObject to target-declared IsGlobalInSmallSection. > > If it's a declaration, skip to step 4. > > 2. Pass GlobalObject to target-independent > > TargetLoweringObjectFile::getKindForGlobal. > > 3. Ensure the returned SectionKind is Data, BSS or Common. > > 4. Pass GlobalObject to target-specific IsGlobalInSmallSectionImpl, > > which scrutinizes the object's type for the specific > > architecture. > > > > I believe this redundant implementation between targets can be > > reduce...
2011 Mar 18
2
[LLVMdev] Text or Data symbol
...ge to use: GlobalAddressSDNode *GSDN = cast<GlobalAddressSDNode>(Op); const GlobalValue *GV = GSDN->getGlobal(); GV->hasSection() and GV->getSection() But the section is not set at this stage (hasSection = false) And at the AsmPrinter stage: const GlobalValue *GV = MO.getGlobal(); SectionKind sectionKind = Mang->getSymbol(GV)->getSection().getKind(); But again the section does not seem to be set (sectionKind.isInSection() = false) Do you know a way to tell if a global address corresponds to data or code ? I have to process differently text and data address... Thank you ! Da...
2011 Mar 21
0
[LLVMdev] Text or Data symbol
...DN = cast<GlobalAddressSDNode>(Op); > const GlobalValue *GV = GSDN->getGlobal(); > GV->hasSection() and GV->getSection() > But the section is not set at this stage (hasSection = false) > > And at the AsmPrinter stage: > const GlobalValue *GV = MO.getGlobal(); > SectionKind sectionKind = Mang->getSymbol(GV)->getSection().getKind(); > But again the section does not seem to be set (sectionKind.isInSection() = > false) > > Do you know a way to tell if a global address corresponds to data or code ? > I have to process differently text and data address...
2011 Mar 21
1
[LLVMdev] Text or Data symbol
...ssSDNode>(Op); > const GlobalValue *GV = GSDN->getGlobal(); > GV->hasSection() and GV->getSection() > But the section is not set at this stage (hasSection = false) > > And at the AsmPrinter stage: > const GlobalValue *GV = MO.getGlobal(); > SectionKind sectionKind = Mang->getSymbol(GV)->getSection().getKind(); > But again the section does not seem to be set > (sectionKind.isInSection() = false) > > Do you know a way to tell if a global address corresponds to data > or code ? I have to process differently text...
2017 Nov 23
2
question about xray tls data initialization
...to review, > preferably through the LLVM Phabricator instance? You can have me or Reid > (who knows more about COFF and the Windows stuff) as reviewers. > > in AsmPrinter, copy/paster xray for coff target > > InstMap = OutContext.getCOFFSection("xray_instr_map", 0, > SectionKind::getReadOnlyWithRel()); > FnSledIndex = OutContext.getCOFFSection("xray_fn_idx", > 0,SectionKind::getReadOnlyWithRel()); > > in XRayArgs , allow windows platform to use xray args. with this, > generated code seems have sled and xray parts. > > > Nice, I suspect we...
2012 Oct 17
0
[LLVMdev] R_ARM_ABS32 disassembly with integrated-as
...lt;MCSymbol *, 16> BindingExplicitlySet; + + // FIXME: This information is in ARMAsmBackend, but we currently + // have no way to reach it. + bool IsThumb; + int64_t MappingSymbolCounter; /// @} void SetSection(StringRef Section, unsigned Type, unsigned Flags, SectionKind Kind) { @@ -130,18 +139,21 @@ private: ELF::SHF_WRITE |ELF::SHF_ALLOC, SectionKind::getDataRel()); EmitCodeAlignment(4, 0); + EmitMappingSymbol(/*IsData*/true); } void SetSectionText() { SetSection(".text", ELF::SHT_PROGBITS,...
2012 Oct 16
2
[LLVMdev] R_ARM_ABS32 disassembly with integrated-as
Attached is an example of how to reproduce the issue. It uses a C file that happens to has a bunch of switch statements which are encoded as jump tables, giving us data-in-code. Usage: To build object files with clang via the -integrated-as versus via GCC: $ export NDK_DIR=<my_ndk_dir> $ export LLVM_DIR=<my_llvm_bin_dir> $ make To test that the generated objects contain the same
2017 Nov 21
2
question about xray tls data initialization
...enough knowledge about linker and the runtime, and finally built executable didn't run. I'd like to share my changes here , hopes somebody help me to make it run on windows. in AsmPrinter, copy/paster xray for coff target InstMap = OutContext.getCOFFSection("xray_instr_map", 0, SectionKind::getReadOnlyWithRel()); FnSledIndex = OutContext.getCOFFSection("xray_fn_idx", 0,SectionKind::getReadOnlyWithRel()); in XRayArgs , allow windows platform to use xray args. with this, generated code seems have sled and xray parts. in xray runtime, bool atomic_compare_exchange_strong(vol...
2010 Jun 21
2
[LLVMdev] MC: Object file specific parsing
...XME: Target hook & command line option for initial section. if (!NoInitialTextSection) - Out.SwitchSection(Ctx.getMachOSection("__TEXT", "__text", - MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS, - 0, SectionKind::getText())); + Out.SwitchSection(getInitialTextSection()); // Prime the lexer. Lex(); @@ -530,158 +528,7 @@ bool AsmParser::ParseStatement() { // Otherwise, we have a normal instruction or directive. if (IDVal[0] == '.') { - // FIXME: This should be driven based o...
2014 Aug 25
2
[LLVMdev] How to tell whether a GlobalValue is user-defined
...jectFileImpl.cpp > b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp > index 55e1756..bf78ce1 100644 > --- a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp > +++ b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp > @@ -667,12 +667,6 @@ > TargetLoweringObjectFileMachO::getSectionForConstant(SectionKind Kind, > if (Kind.isDataRel() || Kind.isReadOnlyWithRel()) > return ConstDataSection; > > - if (Kind.isMergeableConst4()) > - return FourByteConstantSection; > - if (Kind.isMergeableConst8()) > - return EightByteConstantSection; > - if (Kind.isMergeableConst1...
2012 Sep 10
3
[LLVMdev] Question about ctors, dtors and sections on Windows
Hello all! I extended the LDC2 with a pragma to register a funcion in the llvm.global_ctors or llvm.global_dtors list. On Linux, references to these functions are placed in .ctors and .dtors sections and everything runs fine. On Windows, functions from llvm.global_ctors are placed in section .CRT$XCU, which is automatically called by the MS C Runtime. However, functions from
2011 May 06
0
[LLVMdev] Question about linking llvm-mc when porting a new backend
...leCOFFin libLLVMCodeGen.a(TargetLoweringObjectFileImpl.cpp.o) "llvm::GuaranteedTailCallOpt", referenced from: __ZN4llvm21GuaranteedTailCallOptE$non_lazy_ptr in libLLVMCodeGen.a(Analysis.cpp.o) "llvm::TargetLoweringObjectFile::SectionForGlobal(llvm::GlobalValue const*, llvm::SectionKind, llvm::Mangler*, llvm::TargetMachine const&) const", referenced from: llvm::AsmPrinter::EmitGlobalVariable(llvm::GlobalVariable const*)in libLLVMAsmPrinter.a(AsmPrinter.cpp.o) llvm::AsmPrinter::EmitGlobalVariable(llvm::GlobalVariable const*)in libLLVMAsmPrinter.a(AsmPrinter.cpp...
2013 Oct 10
0
[LLVMdev] [PATCH] R600/SI: Embed disassembly in ELF object
...nfig", > + MCContext &Context = getObjFileLowering().getContext(); > + const MCSectionELF *ConfigSection = Context.getELFSection(".AMDGPU.config", > ELF::SHT_PROGBITS, 0, > SectionKind::getReadOnly()); > OutStreamer.SwitchSection(ConfigSection); > + const AMDGPUSubtarget &STM = TM.getSubtarget<AMDGPUSubtarget>(); > if (STM.getGeneration() > AMDGPUSubtarget::NORTHERN_ISLANDS) { > EmitProgramInfoSI(MF); > } else { > EmitProgramInfo...
2013 Oct 10
2
[LLVMdev] [PATCH] R600/SI: Embed disassembly in ELF object
Hi, This patch adds R600/SI disassembly text to compiled object files, when a code dump is requested, to assist debugging in Mesa clients. Here's an example of the output in a Mesa client with a corresponding patch and RADEON_DUMP_SHADERS set: Shader Disassembly: S_WQM_B64 EXEC, EXEC ; BEFE0A7E S_MOV_B32 M0, SGPR6 ; BEFC0306
2017 Nov 16
2
question about xray tls data initialization
I'm learning the xray library and try if it can be built on windows, in xray_fdr_logging_impl.h line 152 , comment written as // Using pthread_once(...) to initialize the thread-local data structures but at line 175, 183, code written as thread_local pthread_key_t key; // Ensure that we only actually ever do the pthread initialization once. thread_local bool UNUSED Unused = [] {
2012 Dec 15
0
[LLVMdev] Setting ELF section alignment at the Target level
...atterning after existing code for .sbss In MipsTargetObjectFile.cpp: ReginfoSection = getContext().getELFSection(".MIPS.options", ELF::SHT_MIPS_OPTIONS, ELF::SHF_ALLOC |ELF::SHF_MIPS_NOSTRIP, SectionKind::getMetadata()); ReginfoSection is defined as a MCSection *. Dumping information to the out streamer is simple: OutStreamer.SwitchSection(ReginfoSection); It should be simple. I hope I just missed the obvious. I'd also would like the ability to change the section fields of generic ELF se...
2013 Jun 25
0
[LLVMdev] Contants generation - proposal
Hi Elena, > (2) Proposal > Define one more Code Model, let's say "LargeNearConst", which will allow to put constants in .text. Isn't that a little heavy-handed? The large model only requires the less efficient access for symbols we can't control, and in fact x86 still uses pc-relative conditional branches within a function so it can't pretend to support a single
2013 Jun 26
2
[LLVMdev] Contants generation - proposal
...unds better then LargeNearConst?) For X86 target JITDefault will be translated CodeModel::LargeJIT for x64 and CodeModel::Small for 32-bit. And the TargetLoweringObjectFile already has CodeModel inside. So the code will look like : const MCSection * TargetLoweringObjectFile::getSectionForConstant(SectionKind Kind) const { if (getCodeModel() == CodeModel::LargeJIT) return TextSection; if (Kind.isReadOnly() && ReadOnlySection != 0) return ReadOnlySection; return DataSection; } - Elena -----Original Message----- From: Tim Northover [mailto:t.p.northover at gmail.com] Sent: Tues...