search for: setsection

Displaying 20 results from an estimated 22 matches for "setsection".

Did you mean: getsection
2011 Nov 13
0
[LLVMdev] setSection not working?
I created a GlobalVariable from a ConstantArray. I then used to the setSection() method on my GlobalVariable. Looking at the ELF file it does not look like it is where I specified. I gave "new StringRef("my_map")" to the method. Is there more that needs to be done? In case it matters this is ToT on Linux. Thank you
2019 Feb 22
2
Create the GlobalVariable which have extern in one header file
...I am trying to create this array with the same name and with initializer. So, I have following: GlobalVariable *gvar_data = new GlobalVariable( M, blockItems->getType(), true, GlobalValue::CommonLinkage, blockItems, "DATA_TABLE"); gvar_data->setAlignment(16); gvar_data->setSection("data_section"); gvar_data->addAttribute(llvm::Attribute::OptimizeNone); I am not sure if I am using the correct Linkage or not. The pass has failed to complete it. Here is the runtime fault. Any guess what I am doing incorrect? 'common' global must have a zero initializer! [...
2012 Oct 17
0
[LLVMdev] R_ARM_ABS32 disassembly with integrated-as
...,11 @@ private: std::vector<LocalCommon> LocalCommons; SmallPtrSet<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 SetS...
2019 Feb 22
1
Create the GlobalVariable which have extern in one header file
...x = getelementptr inbounds [0 x i8*], [0 x i8*]* @DATA_TABLE, i64 0, i64 %3 Why it is creating another global variable instead of linking? Is that because of array size mismatch? Here is my code: GlobalVariable *old = M.getGlobalVariable("DATA_TABLE"); old->setAlignment(16); old->setSection("data_section"); old->addAttribute(llvm::Attribute::OptimizeNone); old->setDSOLocal(false); GlobalVariable *gNew = new GlobalVariable( M, blockItems->getType(), false, GlobalValue::ExternalLinkage, blockItems, "DATA_TABLE"); gNew->setAlignment(16); gNew->setSecti...
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
2010 Oct 01
0
[LLVMdev] ARM/MC/ELF questions on .ARM.attributes section
> 1. What is the preferred method in MC to jump back to a prior section > already defined? (Or is this not supported?) SetSection in the MCStreamer if you really want to change the current section, but maybe all that you need is to setSection in the Symbol? Similar to what is done in MCELFStreamer::EmitCommonSymbol if the binding is local. > 2. It looks like the "correct" way to write out these blobs in ELF  is...
2011 Nov 24
1
[LLVMdev] differences in IR and ELF?
...m_type, 3); Constant *array = ConstantArray::get(type, a_elements); /* Make new GlobalVariable from array */ GlobalVariable *global = new GlobalVariable(M, type, true, my_linkage, array, "my array"); global->setSection(*my_section); } The IR looks like this: @"my array" = constant [3 x i32*] [i32* bitcast (i32 (i32)** @"Shadow Variable for ptr1" to i32*), i32* bitcast (i32 (i32)* @f2 to i32*), i32* bitcast (i32 (i32)* @f1 to i32*)], section "my_section" @"my array2" = cons...
2010 Sep 30
3
[LLVMdev] ARM/MC/ELF questions on .ARM.attributes section
Hi everyone, while looking at the ARMAsmPrinter::EmitStartofAsm function, I realized that what looks like singular assembler directives (.eabi_attribute) are in fact shorthand that needs to go in to the .ARM.attributes section in the ELF file. 1. What is the preferred method in MC to jump back to a prior section already defined? (Or is this not supported?) 2. It looks like the
2011 Nov 15
0
[LLVMdev] constructing global array of pointers?
...ke new GlobalVariable from array */ GlobalVariable *global = new GlobalVariable(M, type, true, my_linkage, array, "my array"); global->setSection(*my_section); }
2012 Oct 16
0
[LLVMdev] R_ARM_ABS32 disassembly with integrated-as
Hi Greg, I'm afraid I've not looked into the infrastructure Jim put into place, so I've not really been able to answer the "how should I do it" questions, but hopefully I can comment on the ABI. > And probably questions for Tim, are these "section-relative" mapping > symbols, as defined in 4.6.5.1 of the ELF for ARM document? Yes, they are. > And what
2011 Nov 24
0
[LLVMdev] differences in IR and ELF?
...ant *array = ConstantArray::get(type, a_elements); > > /* Make new GlobalVariable from array */ > GlobalVariable *global = new GlobalVariable(M, type, true, > > my_linkage, array, > > "my array"); > global->setSection(*my_section); > } > > The IR looks like this: > @"my array" = constant [3 x i32*] [i32* bitcast (i32 (i32)** @"Shadow > Variable for ptr1" to i32*), i32* bitcast (i32 (i32)* @f2 to i32*), > i32* bitcast (i32 (i32)* @f1 to i32*)], section "my_section"...
2010 Jul 17
1
[LLVMdev] Win32 COFF Support - Patch 3
On Fri, Jul 16, 2010 at 11:25 AM, Daniel Dunbar <daniel at zuster.org> wrote: > Hi Michael, > > Overall patch looks good. I do have a few comments below. My main > comment is please try to make the style match that used in the > MCMachOStreamer more closely. I intend to refactor more functionality > into the base MCObjectStreamer class, and having them use consistent >
2017 Apr 04
3
RFC: Adding a string table to the bitcode format
On Tue, Apr 4, 2017 at 12:36 PM, Duncan P. N. Exon Smith < dexonsmith at apple.com> wrote: > > On 2017-Apr-04, at 12:12, Peter Collingbourne <peter at pcc.me.uk> wrote: > > On Mon, Apr 3, 2017 at 8:13 PM, Mehdi Amini <mehdi.amini at apple.com> wrote: > >> >> On Apr 3, 2017, at 7:08 PM, Peter Collingbourne <peter at pcc.me.uk> wrote: >>
2012 Oct 16
5
[LLVMdev] R_ARM_ABS32 disassembly with integrated-as
Getting closer... When emitting symbols, how do I set the symbol's value to the address of the current instruction? Do I need to emit a label in the current section and another that uses the former to point to the latter? If possible, a code sample would be very helpful. And probably questions for Tim, are these "section-relative" mapping symbols, as defined in 4.6.5.1 of the
2010 Jul 16
0
[LLVMdev] Win32 COFF Support - Patch 3
...e the Selection variable. > + > + MCSectionData *SectionData = getSectionData(Section); > + > + if (SectionData->getAlignment() < ByteAlignment) > + SectionData->setAlignment(ByteAlignment); > + > + SymbolData->setExternal(External); > + > + Symbol->setSection(*Section); > + > + if (ByteAlignment != 1) > + AddFragment( > + // FIXME: Who owns this memory? > + new MCAlignFragment(ByteAlignment, 0, 0, ByteAlignment, SectionData) > + ); This code is actually adding the fragment twice. The fragment implicitly adds itself to...
2010 Jul 14
2
[LLVMdev] Win32 COFF Support - Patch 3
On Sun, Jul 11, 2010 at 6:10 PM, Chris Lattner <clattner at apple.com> wrote: > This probably needs to be slightly tweaked to work with mainline.  I don't see anything objectionable, but I think Daniel needs to review this one. Updated patch to work with mainline. http://github.com/Bigcheese/llvm-mirror/commit/d19a4c82c18afc4830c09b70f02d162292231c94 - Michael Spencer
2018 May 01
2
ThinLTO + CFI
Jump table sections already have this prefix: ".text..L.cfi.jumptable.”, without forcing the name with setSection(). Is that good enough? > On May 1, 2018, at 1:16 PM, Peter Collingbourne <peter at pcc.me.uk> wrote: > > I think we just need to change the section name for non-MachO object formats because "__TEXT,__text,regular,pure_instructions" is the default text section name in Ma...
2018 May 01
0
ThinLTO + CFI
...flag named "Cross-DSO CFI" present) and we can figure out a better way to do this later. Peter On Tue, May 1, 2018 at 2:04 PM, <dmitry.mikulin at sony.com> wrote: > Jump table sections already have this prefix: ".text..L.cfi.jumptable.”, > without forcing the name with setSection(). Is that good enough? > > > > On May 1, 2018, at 1:16 PM, Peter Collingbourne <peter at pcc.me.uk> wrote: > > > > I think we just need to change the section name for non-MachO object > formats because "__TEXT,__text,regular,pure_instructions" is the defa...
2018 May 02
1
ThinLTO + CFI
...t;Cross-DSO CFI" present) and we can figure out a better way to do this later. > > Peter > > On Tue, May 1, 2018 at 2:04 PM, <dmitry.mikulin at sony.com> wrote: > Jump table sections already have this prefix: ".text..L.cfi.jumptable.”, without forcing the name with setSection(). Is that good enough? > > > > On May 1, 2018, at 1:16 PM, Peter Collingbourne <peter at pcc.me.uk> wrote: > > > > I think we just need to change the section name for non-MachO object formats because "__TEXT,__text,regular,pure_instructions" is the defaul...
2018 May 01
0
ThinLTO + CFI
...on names that doesn't involve setting a custom section name (which would invoke the "everything goes in the same section" behaviour), and that's to use the confusingly-named "section prefix" feature. If you replace that line with: if (ObjectFormat != Triple::MachO) F->setSectionPrefix(".cfi"); that should make all jump table section names begin with ".text.cfi", which I think should be enough to cause the behaviour needed for cross-DSO CFI here (eugenis can probably confirm). Peter On Tue, May 1, 2018 at 12:59 PM, <dmitry.mikulin at sony.com> wr...