[LLVMdev] R_ARM_ABS32 disassembly with integrated-as

Greg Fitzgerald garious at gmail.com
Tue Oct 16 10:13:09 PDT 2012


Jim, can you help me out with the implementation details here?  How do
I set the Value of the MCSymbolData to the address of the data region?

Per Tim's comments, here's what I have so far:

void MCELFStreamer::EmitMappingSymbol(StringRef Name) {
  MCSymbol *Symbol = getContext().GetOrCreateSymbol(Name);
  MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol);
  MCELF::SetType(SD, ELF::STT_NOTYPE);
  MCELF::SetBinding(SD, ELF::STB_LOCAL);
  SD.setExternal(false);
  Symbol->setSection(*getCurrentSection());
}

...
EmitMappingSymbol("$d");

Thanks,
Greg


On Tue, Oct 16, 2012 at 1:36 AM, Tim Northover <t.p.northover at gmail.com> wrote:
>
> 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 to put in the alignment field?  I see GCC outputting 1, 3, 4, but I don't see a
> > description of that field in the doc.
>
> I don't think individual symbols have an alignment in ELF (except
> COMMON ones, which repurpose the st_value field -- not the case here).
> If the 1, 3, 4 are coming from the last column of the dumps you
> produced below, they're referring to the section the symbol is
> relative to (st_shndx in the documentation).
>
> Cheers.
>
> Tim.



More information about the llvm-dev mailing list