What is the content of a linked file?

ali hagigat hagigatali@gmail.com
Sun Feb 6 07:31:00 GMT 2011


Suppose we have the following ld script and i use it to link my program with it:
SECTIONS
{
.text: { *(.text) }
.rodata: { *(.rodata) }
.data: { *(.data) }
BYTE(0x00)
BYTE(0xff)
BYTE(0xcd)
}
Then i link my program by gcc and with the above linker script and say
our final output file to be prog1 which is an executable file.
If I see prog1 file content, will it have, those 3
bytes(0x00,0xff,0xcd) I specified? I mean those bytes are in the
header of prog1 ELF file? or they are written in the body of the
object file?



More information about the Binutils mailing list