using ld to include arbitrary files

Groman groman@tfz.net
Thu Sep 30 23:56:00 GMT 1999


can't you just append it manually if dd?
Greg Law <gel@soi.city.ac.uk> wrote in message
news: 37EFC41A.F7187B70@soi.city.ac.uk ...
> Thomas Kjoernes wrote:
> >
> > Greg Law wrote in message < 37EF8520.1B491D17@soi.city.ac.uk >...
> > >Hi,
> > >
> > >I want to include arbitrary files while linking my OS with gnu ld.
> > >
> > >I know how to include files in a recognised object format via the
linker
> > >script, but if they're binary files ld complains with
> > >
> > >../gte/gte_boot.cmp: file not recognized: File format not recognized
> > >
> > >
> > >So, is there an easy way to tell ld not to process the files, but
> > >include them blindly at the end of my data section?
> >
> > There is a utility called BINOBJ that converts a binary chunk of data
into
> > and OMF LEDATA object and also supports a PUBLIC label in front of
> > it. Borland used to incldued in their Turbo Pascal package.
> >
> > You might want to use a utility like EXELIB like I use. Or just copy the
> > files at the end of the .EXE and align it on some boundary and then
> > search for it... there are ways.
> >
> > BINOBJ might be the easisest way out.
>
> The only thing is, all these run under DOS, and I can't find any linux
> ports.  I've tried a simple
>
> bash$ objdump -I binary -O elf32-i386 source dest.o
>
> but I get
>
> Warning: Output file cannot represent architecture UNKNOWN!
>
> It does produce dest.o, but
>
> $objdump -h dest.o
>
> gives
>
> objdump: dest.o: File format not recognized
>
>
> I can't simply append the data on the end, as they don't get loaded
> then.  I could write a tool to convert arbitrary files to elf, but
> obviously I'd like to avoid it if poss.
>
>
> Thanks,
>
> Greg.
>
> --
> Greg Law, email: gel@soi.city.ac.uk
> Dept. Of Computing, web: http://www.soi.city.ac.uk/~gel
> City University, phone: +44 171 477 8341
> London, UK.  EC1V 0HB. fax: +44 171 477 8587




More information about the Gcc-help mailing list