Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[build] Ensure an entry point symbol exists in all builds
Commit 623469d ("[build] Eliminate unused sections at link-time")
introduced a regression in several build formats, in which the prefix
would end up being garbage-collected out of existence.  Fix by
ensuring that an entry symbol exists in each possible prefix, and is
required by the linker script.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Feb 23, 2011
1 parent 7ef3145 commit 295c2fd
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/arch/i386/prefix/dskprefix.S
Expand Up @@ -27,6 +27,8 @@ FILE_LICENCE ( GPL2_ONLY )
.text
.section ".prefix", "ax", @progbits
.code16
.globl start
start:

jmp $BOOTSEG, $go /* reload cs:ip to match relocation addr */
go:
Expand Down
2 changes: 2 additions & 0 deletions src/arch/i386/prefix/hdprefix.S
Expand Up @@ -5,6 +5,8 @@ FILE_LICENCE ( GPL2_OR_LATER )
.section ".prefix", "awx", @progbits
.code16
.org 0
.globl start
start:

movw $load_image, %bp
jmp find_active_partition
Expand Down
2 changes: 2 additions & 0 deletions src/arch/i386/prefix/lkrnprefix.S
Expand Up @@ -49,6 +49,8 @@ FILE_LICENCE ( GPL_ANY )
.arch i386
.org 0
.section ".prefix", "ax", @progbits
.globl start
start:
/*
This is a minimal boot sector. If anyone tries to execute it (e.g., if
a .lilo file is dd'ed to a floppy), print an error message.
Expand Down
7 changes: 4 additions & 3 deletions src/arch/i386/prefix/nbiprefix.S
Expand Up @@ -17,7 +17,7 @@ file_header:
.byte 0
.byte 0 /* No flags */
.word 0x0000, 0x07c0 /* Load header to 0x07c0:0x0000 */
.word entry, 0x07c0 /* Start execution at 0x07c0:entry */
.word start, 0x07c0 /* Start execution at 0x07c0:entry */
.size file_header, . - file_header

/*****************************************************************************
Expand Down Expand Up @@ -49,7 +49,8 @@ memlen: .long -512
* NBI entry point
*****************************************************************************
*/
entry:
.globl start
start:
/* Install iPXE */
call install

Expand All @@ -71,7 +72,7 @@ entry:
int $0x19

.previous
.size entry, . - entry
.size start, . - start

nbi_header_end:
.org 512
2 changes: 2 additions & 0 deletions src/arch/i386/prefix/pxeprefix.S
Expand Up @@ -24,6 +24,8 @@ FILE_LICENCE ( GPL2_OR_LATER )
*****************************************************************************
*/
.section ".prefix", "ax", @progbits
.globl start
start:
jmp $0x7c0, $1f
1:
/* Preserve registers for possible return to PXE */
Expand Down
2 changes: 2 additions & 0 deletions src/arch/i386/prefix/romprefix.S
Expand Up @@ -45,6 +45,8 @@ FILE_LICENCE ( GPL2_OR_LATER )
.code16
.arch i386
.section ".prefix", "ax", @progbits
.globl start
start:

.org 0x00
romheader:
Expand Down
2 changes: 2 additions & 0 deletions src/arch/i386/scripts/i386.lds
Expand Up @@ -5,6 +5,8 @@
*
*/

ENTRY ( start )

SECTIONS {

/* Each section starts at a virtual address of zero.
Expand Down

0 comments on commit 295c2fd

Please sign in to comment.