[LLVMdev] [llvm-commits] Fwd: Proof of concept patch for unifying the .s/ELF emission of .ARM.attributes

Jason Kim jasonwkim at google.com
Thu Oct 21 11:07:04 PDT 2010


On Thu, Oct 21, 2010 at 7:50 AM, Rafael Espíndola
<rafael.espindola at gmail.com> wrote:
>> Hmm, I wish we had this discussion way earlier..
>>
>> How would I emit things in different subsections? I can do a high
>> level switch to .ARM.attributes, and if I were emitting one blob from
>> begin to end, using the higher level interface would be preferable,
>> but it contains additional subsections - which are naturally
>> represented by MCDataFragments - Is there an MC equivalent of a
>> SubSection (which is-a Section so I can switch back and forth?)
>> Currently we only have stuff that go into the File subsection only,
>> but.. for futureproofing?
>
> We cross that bridge when we get there. It might be that the best
> thing to do is organize the code so that  we output the subsections in
> order. It might be to add some missing feature. For now using the
> regular streamer API will make this code a lot easier to read.

Of the roughly 111 or so calls to EmitIntValue(), rouighly half are in
the Dwarf code, which is cross-architecture.
(And they have their own MCSection types to deal with back and forth
type issues)

Of the 45 remaining, there are 4 interesting uses in MCAsmStreamer.cpp
- (I suppose for emitting data constants in a cross platform manner)
The other remaining uses are in AsmPrinter, again to do cross platform things.
It seems a bit strange to use a high level hammer to do ballpeen
work..... But when in Rome.... :-)

Also what is the preferred method for MC way of setting out subsection
sizes after the fact? I am guessing I need to use an MCFixup?
How do I get an MCExpr to evaluate a method for the subsection size?
Is there an equivalent use in the places using MCFixup?
Do I need to add a new subclass to MCExpr for doing this?

JimG, can you please comment on the MachO specific parts in the
ARMAsmPrinter.cpp? Is there an example of a "subsection size" that is
"Fixed up" after all the blobs that go into that subsection are
emitted? The closest examples I could find weren't that close :-(
(Matter of fact, for ELF, it looks like the section sizes are actually
calculated after everything has been processed by MCAssembler, and the
headers sizes are not "fixed up" but completely rewritten from the
beginning)

Thanks!

-jason
>
>>
>> -jason
>
> Cheers,
> Rafael
>




More information about the llvm-dev mailing list