Determining size of embedded blobs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Gcc-help,

I want to embed an image into an executable.  I managed
to do it by running "ld -r -b binary -o blob.o blob.png"
on the blob.png file, thus creating a blob.o that I can
link into my main program.  I have access to the binary
blob by declaring an extern variable:

extern char _binary_blob_png_start [];

Normally I know the size of the blob I just linked in.
But suppose I didn't.  Is there a way I can determine
it from within the C program?  I know that by running
"objdump -x blob.o" I can see the symbol table on the
obj file, and that the symbols _binary_blob_png_end and
_binary_blob_png_size are also defined:

SYMBOL TABLE:
0000000000000000 l    d  .data  0000000000000000 .data
0000000000000400 g       .data  0000000000000000 _binary_blob_png_end
0000000000000000 g       .data  0000000000000000 _binary_blob_png_start
0000000000000400 g       *ABS*  0000000000000000 _binary_blob_png_size

I assumed that _binary_blob_png_end was a pointer to the
end of the blob, but it doesn't seem so.  Also, I always
get a segfault if I assume that _binary_blob_png_size is
an integer value.

Thank you!!
Jean


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux