mirror of
https://github.com/ipxe/ipxe
synced 2025-12-20 12:00:19 +03:00
Not fully understood, but it seems that the LMA of bss sections matters for some newer binutils builds. Force all bss sections to have an LMA at the end of the file, so that they don't interfere with other sections. The symptom was that objcopy -O binary -j .zinfo would extract the .zinfo section from bin/xxx.tmp as a blob of the correct length, but with zero contents. This would then cause the [ZBIN] stage of the build to fail. Also explicitly state that .zinfo(.*) sections have @progbits, in case some future assembler or linker variant decides to omit them.
77 lines
1.7 KiB
ArmAsm
77 lines
1.7 KiB
ArmAsm
.text
|
|
.arch i386
|
|
.section ".prefix", "ax", @progbits
|
|
.section ".prefix.data", "aw", @progbits
|
|
.code16
|
|
.section ".prefix"
|
|
.org 0
|
|
|
|
nbi_header:
|
|
|
|
/*****************************************************************************
|
|
* NBI file header
|
|
*****************************************************************************
|
|
*/
|
|
file_header:
|
|
.long 0x1b031336 /* Signature */
|
|
.byte 0x04 /* 16 bytes header, no vendor info */
|
|
.byte 0
|
|
.byte 0
|
|
.byte 0 /* No flags */
|
|
.word 0x0000, 0x07c0 /* Load header to 0x07c0:0x0000 */
|
|
.word entry, 0x07c0 /* Start execution at 0x07c0:entry */
|
|
.size file_header, . - file_header
|
|
|
|
/*****************************************************************************
|
|
* NBI segment header
|
|
*****************************************************************************
|
|
*/
|
|
segment_header:
|
|
.byte 0x04 /* 16 bytes header, no vendor info */
|
|
.byte 0
|
|
.byte 0
|
|
.byte 0x04 /* Last segment */
|
|
.long 0x00007e00
|
|
imglen: .long _filesz - 512
|
|
memlen: .long _filesz - 512
|
|
.size segment_header, . - segment_header
|
|
|
|
.section ".zinfo.fixup", "a", @progbits /* Compressor fixups */
|
|
.ascii "SUBL"
|
|
.long imglen
|
|
.long 1
|
|
.long 0
|
|
.ascii "SUBL"
|
|
.long memlen
|
|
.long 1
|
|
.long 0
|
|
.previous
|
|
|
|
/*****************************************************************************
|
|
* NBI entry point
|
|
*****************************************************************************
|
|
*/
|
|
entry:
|
|
/* Install low and high memory regions */
|
|
call install
|
|
|
|
/* Jump to .text16 segment */
|
|
pushw %ax
|
|
pushw $1f
|
|
lret
|
|
.section ".text16", "awx", @progbits
|
|
1:
|
|
pushl $main
|
|
pushw %cs
|
|
call prot_call
|
|
popl %eax /* discard */
|
|
|
|
/* Reboot system */
|
|
int $0x19
|
|
|
|
.previous
|
|
.size entry, . - entry
|
|
|
|
nbi_header_end:
|
|
.org 512
|