[llvm-commits] Extract MachObjectWriter class to own header and code files

Aaron Gray aaronngray.lists at googlemail.com
Fri Mar 19 18:23:23 PDT 2010


On 19 March 2010 10:55, Daniel Dunbar <daniel at zuster.org> wrote:

> On Tue, Mar 16, 2010 at 8:37 AM, Aaron Gray
> <aaronngray.lists at googlemail.com> wrote:
> > On 16 March 2010 15:20, Daniel Dunbar <daniel at zuster.org> wrote:
> >>
> >> On Mon, Mar 15, 2010 at 6:01 PM, Aaron Gray
> >> <aaronngray.lists at googlemail.com> wrote:
> >> > On 16 March 2010 00:31, Daniel Dunbar <daniel at zuster.org> wrote:
> >> >>
> >> >> Hi Aaron,
> >> >>
> >> >> This has been on my list, but for the time being I find it convenient
> >> >> to have all the code in the same place. I also want to factor out a
> >> >> few more minor things before splitting in the target independent
> >> >> assembler and the object file writer.
> >> >>
> >> >> Is this blocking work you are hoping to do?
> >> >
> >> > Hi Daniel,
> >> > It would be good to get to the stage where I can work on the
> COFFWriter
> >> > and
> >> > COFFStreamer.
> >>
> >> Ok. Do you mind waiting ~a week?
> >>
> >> > Basically I can wait but I thought a few file and class wise
> >> > normalizations
> >> > would not go a miss :)
> >> > Also I wanted to introduce a common ObjectWriter abstract class for
> >> > MachObjectWriter, ELFObjectWriter, and COFFWriter, with Write and
> >> > virtual
> >> > WriteObject methods.
> >>
> >> Right. I have this stuff planned out in my head, along similar lines.
> >> I'll try to get it in the next week but right now I wanted to get
> >> x86_64 Mach-O support up, which gives two concrete implementations to
> >> factor for. Work for you?
> >
> > Okay, thats great :)
>
> As of r98955, MCAssembler is now Mach-O independent.
>
> We still need to either change MCMachOStreamer to be MCObjectStreamer,
> or implement MC{ELF,COFF}Streamer classes, before immediate work on
> ELF/COFF MCObjectWriters can begin.
>

Nice, thanks Daniel that was quick ! The only thing I am not sure about is
the genericity of the Layout code when its applied to COFF and ELF. The
section headers/table is very simple on COFF.

Anyway I will implement COFF file generation and see what happens. I have my
own COFF file reading and dumping code which may come in hand as it will
work across platforms with out needing binutils'es objdump across platforms.
With a COFFWriter., ArchiveReader, and PEWriter too I am looking to
implement a COFF Linker for LLVM.

I have to modify MCSectionCOFF, TLOF and AsmPrinter to get rid of legacy
implementation.

But before that I will be semi preocupied as llvm-gcc 2.7 prerelease-1 and
main line SVN llvm-gcc-2.7 are broken on Cygwin with a weird syntax error
that, causes error propogation from stddef.h threw the Windows.h headers.
Its weird as MinGW compiles properly. Anyway got to get to the bottom of
this first. Hopefully this should only take a few days.

Many thanks,

Aaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100320/32fbbbe8/attachment.html>


More information about the llvm-commits mailing list