[Clam-devel] Embedding files into binaries

David García Garzón dgarcia at iua.upf.edu
Wed Jul 9 13:02:35 PDT 2008


On Wednesday 09 July 2008 21:13:58 Pau Arumí Albó wrote:
> El dc 09 de 07 de 2008 a les 20:39 +0200, en/na David García Garzón va
>
> escriure:
> > Just for my reference and whoever who is interested, a proof of concept
> > on how to embed files into an executable using binutils. I hope to write
> > a blog entry soon on this.
> >
> > SConstruct seems too complex. This is to fix the symbol name that the
> > tool generates. It contains the relative path to the file and made the
> > symbol name dependant on where do you place it. All that code removes the
> > path but i hope i can simplify that.
> >
> > Being so feasible, this brings also the ladspa-on-click (and the
> > Jack-on-click) nearer.
>
> I'm missing something. Where is "_binary_holaMundo_txt_start" extern
> var defined??


The command launched by the builder EmbededFile directly compiles binary data 
without the C step. It creates a data section with such a symbol. Notice that 
when you run it you obtain a .o file with the same name than the data file. 
It is just like having a data compiler. :-)

Not an standard C feature but we are tied to gnu tools, aren't we?

David.





More information about the clam-devel mailing list