Related articles |
---|
icc linker question frnksml@gmail.com (2009-03-05) |
Re: icc linker question llib-xoc@sbcglobal.net (Bill Cox) (2009-03-18) |
From: | frnksml@gmail.com |
Newsgroups: | comp.compilers |
Date: | Thu, 5 Mar 2009 10:25:04 -0800 (PST) |
Organization: | Compilers Central |
Keywords: | linker, question |
Posted-Date: | 06 Mar 2009 06:39:09 EST |
Hi,
I'm well experienced with MIPS and PPC stuff for embedded systems.
This is my first time with icc and Intel processors.
We need to have _start at 0x00000000.
For some reason, _start always keeps coming at an offset.
Here's my linker script file.
/* Default linker script, for normal executables */
OUTPUT_FORMAT("elf32-i386", "elf32-i386",
"elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(_start)
SEARCH_DIR("/sw/contrib/packages/binutils/2.17/i686-pc-linux/lib");
SEARCH_DIR("/sw/contrib
/packages/binutils/2.17/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR
("/lib"); SEARCH_DIR
("/usr/lib");
SECTIONS
{
/* Read-only sections, merged into text segment: */
/* . = 0x00 + SIZEOF_HEADERS; */
. = 0x0000;
PROVIDE (_text = .);
PROVIDE (xen_start = .);
.xen_start : { *(.xen_start) }
. = 0x1000;
.xen_shared_info : { *(.xen_shared_info) }
. = 0x2000;
.xen_hypercall_page : { *(.xen_hypercall_page) }
. = 0x3000;
.xen_trap_tables : { *(.xen_trap_tables) }
.text : { *(.text) }
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
.gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r : { *(.gnu.version_r) }
.rel.init : { *(.rel.init) }
.rela.init : { *(.rela.init) }
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
.rela.text : { *
(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
After compilation and linking, my symbols file is as follows
00000000 N .debug_info_seg
00000000 N .debug_info_seg0
00000000 N .debug_info_seg0
00000000 N .debug_info_seg0
00000000 N .debug_info_seg0
00000000 N .debug_info_seg0
00000000 N .debug_info_seg0
00000000 N .debug_info_seg0
00000000 N .debug_info_seg0
00000000 N .debug_info_seg0
00000000 N .debug_info_seg0
00000000 N .debug_info_seg0
00000000 N .debug_info_seg0
00000000 N .debug_info_seg0
00000000 N .debug_info_seg0
00000020 a ES
00000024 a ORIG_EAX
00000028 a EIP
0000002c a CS
0000005b N .debug_line_seg8
0000005c N .debug_frame_seg
00000061 N .debug_line_seg9
00000065 N .debug_line_seg3
00000065 N .debug_line_seg8
00000067 N .debug_line_seg7
0000006a N .debug_line_seg1
0000006b N .debug_line_seg1
00000071 N .debug_line_seg5
00000074 N divide_error
00000075 N .debug_line_seg0
00000075 N .debug_line_seg10
00000075 N .debug_line_seg11
00000075 N .debug_line_seg7
00000075 N .debug_line_seg9
00000076 N .debug_line_seg15
00000078 N .debug_line_seg7
00000079 N .debug_line_seg8
0000007b N .debug_line_seg4
0000007b N .debug_line_seg6
0000007b n do_exception
00000aa n ret_from_exception
000000ae N .debug_line_seg0
000000b5 N .debug_line_seg0
000000b7 N .debug_line_seg8
000000be N .debug_line_seg0
000000be N hypervisor_callback
000000bf N .debug_line_seg1
000000c1 N .debug_line_seg5
000000c3 N .debug_line_seg2
000000cb N .debug_line_seg1
000000cd N .debug_line_seg5
000000d9 N .debug_line_seg0
000000d9 N .debug_line_seg1
000000da N .debug_line_seg
000000e1 N .debug_line_seg3
000000e4 N .debug_line_seg0
000000e9 N .debug_line_seg0
000000ec N .debug_line_seg7
000000ef N .debug_line_seg5
000000f7 N .debug_line_seg13
000000f8 N .debug_line_seg3
000000f9 N .debug_line_seg12
000000fb N .debug_line_seg7
000000fd T _start
We need _start to be at 0x00000000.
Any ideas on what I might be missing?
Thanks,
Frank.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.