Requirements
Currently, the resource tools are very specific in how they can operate. First, both tools operate only on ELF format files. Further, they only work with 32-bit ELF files (as opposed to 64 bit), and the i386 architecture. Finally, they have only been tested with ELF files generated by the GNU C compiler and linker (gcc and ld).The resource editor re has additional requirements above these. First, the executable it is modifying must have the symbol table present (it must not be stripped). Second, in some cases it requires the ELF executable it is modifying to contain the relocation sections which were used when linking to resolve symbol references in the original object files. This is only required if the new resource is larger than the old resource being replaced. The reason is that since the new resource is larger, any symbols or sections after the symbol in the ELF executable will have changed address/offset, and so their references in the code (.text, .init, .plt) must be updated. If the new resource is smaller or equal size, however, the relocations section is not needed; the old resource is overwritten, and padded with 0's if smaller, so that the resource takes up the same size as before in the file. Of course, the resource length symbol is updated to the correct size so the executable runs as expected.
To include these relocation sections, link the executable you will have resources in using the --emit-relocs option to ld. These relocations sections make the executable larger than an executable without them. How much of a difference does this make? Compiling gpg version 1.0.2b without relocations is 1972922 bytes, while compiling with relocations is 2719317 bytes. Thus, gpg with relocations is 1.34 times the size of gpg without.