This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
What is the content of a linked file?
- From: ali hagigat <hagigatali at gmail dot com>
- To: binutils at sourceware dot org
- Date: Sun, 6 Feb 2011 09:19:53 +0330
- Subject: 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?