This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

What is the content of a linked file?


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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]