[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:52:13 PDT 2010


On Thu, Oct 21, 2010 at 11:42 AM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
>> 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)
>
> I really don't follow. Please just convert the current patch to use
> the existing APIs. If in the next one you really need a missing
> feature it will be a lot easier to explain what it is.

Hi Rafael.

That is exactly what I need - I need a nice MC way to output a at
least two different 4 byte size fields after all of the blobs in the
.ARM.attributes
are sent out. I am currently doing this manually by messing with the
MCDataFragment directly - (I cribbed from the ELFObjectwriter code)
The size field kind of acts like an ELF section header size field, but
trying to replicate the MCAssembler/MCLayout mechanics seemed a bit
much, and from the existing sources,
I could not find a relevant use of MCExpr/MCFixup that does this. I
even considered outputing a fake symbol, but that didn't work well
either. The code I have now was the simplest I could make it under the
constraints I found myself in. If there is a "better way" in MC to do
something like this, I'll be more than happy to do it, if just for my
own education.

Err... help?? :-)

Thanks!!

-jason

>
>> Thanks!
>>
>> -jason
>
> Cheers,
> Rafael
>




More information about the llvm-commits mailing list