objcopy --add-section allows you to add an arbitrary file as a section in an ELF executable. (objcopy man page). However this is only half a solution, as I have not yet found a way to access this data from inside a C Program other than by loading and parsing the ELF Binary using an ELF Library.
Edit Additional Information:
If you have a compiled program called MyProgram and a resource file MyResource.dat which you want embedded into MyProgram, you can use the objcopy command like this:
objcopy MyProgram --add-section MyResource=MyResource.dat
Now if you look at your program using the command
objdump -x MyProgram
You will see a section called MyResource which contains the contents of MyResource.dat. The file is now embedded inside of your executable.
The trick now, is how do you access the data from inside your program. My instinct tells me that the loader should place the file into memory somewhere and you should be able to get a pointer to it, however I'm not sure how to do that simply. Ideally I'd want to be able to dlopen my exeutable and dlsym the section, but that doesn't work because its a section and not a symbol.
The only alternative I know of to access the section from inside the program is to use the libelf library or something similar which is a little like using a sledgehammer to tap in a nail. You can use it in your application to load itself as an ELF Resource and retrieve the sections. Documentation is sparse, but here's an example
http://em386.blogspot.com/2007/03/quick-libelf-guide.html
I'd love if someone could chime in with an easier way to access the data from --add-section.
Edit 2 In My research I encoutered this question: Embedding binary blobs using gcc mingw
Which should work for gcc as well as mingw and shows a way to use ld instead of objcopy to add the data and be able to access it as a symbol. Looks promising