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

Jason Kim jasonwkim at google.com
Thu Oct 21 13:02:37 PDT 2010


On Thu, Oct 21, 2010 at 12:05 PM, Renato Golin <rengolin at systemcall.org> wrote:
> 2010/10/21 Jason Kim <jasonwkim at google.com>:
>> 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.
>
> Hi Jason,
>
> If I got it right, you need to write to the attributes section after
> you have moved out to print the rest of the file.
>

Hi Renato, I don't think that;s it. This is solely within the
.ARM.attributes section.  It requires an overall section size declared
within it, as well as individual sub section sizes.

> I can't think of an example right now that would require that (as you
> have most important information from the IR), but I believe GAS does
> that when guessing the build attributes.
>
> What are these two word you need to write? Why can't you write them
> when building the attributes section?

I guess I wasn't being clear.  I am doing this when building the
.ARM.attributes section. Its the File, Symbol and Section chunks
within that section that need the size fields - which is byte offset
wise earlier than the blobs in those chunks.
The issue is that I need to "fix up" the subsection size after the
blobs in the various subsections are streamed out.
Doing that is easy if I directly access the stream (this is what I am
doing currently on this patch under review), and it works correctly.

What Rafael is asking me to do instead is to write the .ARM.attributes
section using only the "forward stream iterator" semantics found in
the MC.
Issue here is that there currently does NOT seem to be a nice way of
doing this kind of size field fixup purely in MC.

Hope this clears things up!

-jason
>
> cheers,
> --renato
>



More information about the llvm-commits mailing list