I am currently trying to embed an ELF into a larger ELF that will manage this ELF (boostrap it and execute it).
Extra information is inserted when trying to embed an ELF into a larger ELF. This extra info makes the "start" and "end" labels useless if code in the larger ELF would like to jump to the beginning of the code section in the embedded ELF. For instance: > xdd -i small_elf.o small_elf.c Results in... unsigned char executable_elf[] = { 2 0x7f, 0x45, 0x4c, 0x46, 0x01, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 3 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xba, 0xab, 0x00, 0x00, 0x00, 0x01, 4 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x47, 0xac, 5 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0x20, 0x00, 0x07, 0x00, 0x28, Whereas the first instruction in this ELF is : 00000000 <_start>: 7 0: b8080050 brai 80 // 50 <_TEXT_START_ADDR> 8 Disassembly of section .vectors.sw_exception: Which is located on line 25 of the .c file generated by xdd (or 25*3 words deep from the start label of the .o file generated by objcopy). Is this extra information the binary encoded symbol table of the ELF? Is there a method to find out how much data will be inserted, so that the correct offset into the program can be found? Any help/suggestions would be greatly appreciated. Thanks, -- View this message in context: http://www.nabble.com/Embedding-ELFs%2C-Using-objcopy-and-or-xdd-tp20567343p20567343.html Sent from the Gnu - Binutils - Bugs mailing list archive at Nabble.com. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils