Put entry point at start of binary on x86 platforms

Related to #881.
This commit is contained in:
Christian Helmuth 2014-12-16 16:26:55 +01:00
parent d704563453
commit 727ac4bc0c
3 changed files with 7 additions and 4 deletions

View File

@ -21,8 +21,8 @@ ENTRY(_start)
PHDRS PHDRS
{ {
ro PT_LOAD; ro PT_LOAD;
rw PT_LOAD; rw PT_LOAD;
} }
SECTIONS SECTIONS
@ -31,6 +31,9 @@ SECTIONS
/* begin of program image (link address) */ /* begin of program image (link address) */
_prog_img_beg = .; _prog_img_beg = .;
/* put entry code at the start of the text segment / raw binary */
*(.text.crt0)
*(.init) *(.init)
*(.text .text.* .gnu.linkonce.t.*) *(.text .text.* .gnu.linkonce.t.*)
*(.fini) *(.fini)

View File

@ -17,7 +17,7 @@
** .text (program code) ** ** .text (program code) **
**************************/ **************************/
.text .section ".text.crt0"
/* program entry-point */ /* program entry-point */
.global _start .global _start

View File

@ -17,7 +17,7 @@
** .text (program code) ** ** .text (program code) **
**************************/ **************************/
.text .section ".text.crt0"
/* program entry-point */ /* program entry-point */
.global _start .global _start