[prefix] Use garbage-collectable section names

Allow unused sections of libprefix.o to be removed via --gc-sections.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2016-02-18 16:02:55 +00:00
parent f0ea1f4d77
commit 02a88b7489

View File

@@ -69,7 +69,7 @@ progress_\@:
* %ds:di : next character in output buffer (if applicable) * %ds:di : next character in output buffer (if applicable)
***************************************************************************** *****************************************************************************
*/ */
.section ".prefix.lib", "awx", @progbits .section ".prefix.print_character", "awx", @progbits
.code16 .code16
.globl print_character .globl print_character
print_character: print_character:
@@ -107,7 +107,7 @@ print_character:
* %ds:di : next character in output buffer (if applicable) * %ds:di : next character in output buffer (if applicable)
***************************************************************************** *****************************************************************************
*/ */
.section ".prefix.lib", "awx", @progbits .section ".prefix.print_space", "awx", @progbits
.code16 .code16
.globl print_space .globl print_space
print_space: print_space:
@@ -132,7 +132,7 @@ print_space:
* %ds:di : next character in output buffer (if applicable) * %ds:di : next character in output buffer (if applicable)
***************************************************************************** *****************************************************************************
*/ */
.section ".prefix.lib", "awx", @progbits .section ".prefix.print_message", "awx", @progbits
.code16 .code16
.globl print_message .globl print_message
print_message: print_message:
@@ -162,7 +162,7 @@ print_message:
* %ds:di : next character in output buffer (if applicable) * %ds:di : next character in output buffer (if applicable)
***************************************************************************** *****************************************************************************
*/ */
.section ".prefix.lib", "awx", @progbits .section ".prefix.print_hex", "awx", @progbits
.code16 .code16
.globl print_hex_dword .globl print_hex_dword
print_hex_dword: print_hex_dword:
@@ -210,7 +210,7 @@ print_hex_nibble:
* %ds:di : next character in output buffer (if applicable) * %ds:di : next character in output buffer (if applicable)
***************************************************************************** *****************************************************************************
*/ */
.section ".prefix.lib", "awx", @progbits .section ".prefix.print_pci_busdevfn", "awx", @progbits
.code16 .code16
.globl print_pci_busdevfn .globl print_pci_busdevfn
print_pci_busdevfn: print_pci_busdevfn:
@@ -247,7 +247,7 @@ print_pci_busdevfn:
* %ds:di : next character in output buffer (if applicable) * %ds:di : next character in output buffer (if applicable)
***************************************************************************** *****************************************************************************
*/ */
.section ".prefix.lib", "awx", @progbits .section ".prefix.print_kill_line", "awx", @progbits
.code16 .code16
.globl print_kill_line .globl print_kill_line
print_kill_line: print_kill_line:
@@ -285,7 +285,7 @@ print_kill_line:
* None * None
**************************************************************************** ****************************************************************************
*/ */
.section ".prefix.lib", "awx", @progbits .section ".prefix.copy_bytes", "awx", @progbits
.code16 .code16
copy_bytes: copy_bytes:
pushl %ecx pushl %ecx
@@ -308,7 +308,7 @@ copy_bytes:
* None * None
**************************************************************************** ****************************************************************************
*/ */
.section ".prefix.lib", "awx", @progbits .section ".prefix.zero_bytes", "awx", @progbits
.code16 .code16
zero_bytes: zero_bytes:
pushl %ecx pushl %ecx
@@ -343,7 +343,7 @@ zero_bytes:
* None * None
**************************************************************************** ****************************************************************************
*/ */
.section ".prefix.lib", "awx", @progbits .section ".prefix.process_bytes", "awx", @progbits
.code16 .code16
process_bytes: process_bytes:
@@ -495,7 +495,7 @@ process_bytes:
* none * none
**************************************************************************** ****************************************************************************
*/ */
.section ".prefix.lib", "awx", @progbits .section ".prefix.install_block", "awx", @progbits
.code16 .code16
install_block: install_block:
/* Preserve registers */ /* Preserve registers */
@@ -544,7 +544,7 @@ install_block:
* none * none
**************************************************************************** ****************************************************************************
*/ */
.section ".prefix.lib", "awx", @progbits .section ".prefix.alloc_basemem", "awx", @progbits
.code16 .code16
.globl alloc_basemem .globl alloc_basemem
alloc_basemem: alloc_basemem:
@@ -591,7 +591,7 @@ alloc_basemem:
* none * none
**************************************************************************** ****************************************************************************
*/ */
.section ".text16", "ax", @progbits .section ".text16.free_basemem", "ax", @progbits
.code16 .code16
.globl free_basemem .globl free_basemem
free_basemem: free_basemem:
@@ -625,7 +625,7 @@ free_basemem:
ret ret
.size free_basemem, . - free_basemem .size free_basemem, . - free_basemem
.section ".text16.data", "aw", @progbits .section ".text16.data.hooked_bios_interrupts", "aw", @progbits
.globl hooked_bios_interrupts .globl hooked_bios_interrupts
hooked_bios_interrupts: hooked_bios_interrupts:
.word 0 .word 0
@@ -645,7 +645,7 @@ hooked_bios_interrupts:
* none * none
**************************************************************************** ****************************************************************************
*/ */
.section ".prefix.lib", "awx", @progbits .section ".prefix.install", "awx", @progbits
.code16 .code16
.globl install .globl install
install: install:
@@ -688,7 +688,7 @@ install:
* none * none
**************************************************************************** ****************************************************************************
*/ */
.section ".prefix.lib", "awx", @progbits .section ".prefix.install_prealloc", "awx", @progbits
.code16 .code16
.globl install_prealloc .globl install_prealloc
install_prealloc: install_prealloc:
@@ -751,7 +751,7 @@ install_prealloc:
xorw %di, %di xorw %di, %di
call print_message call print_message
2: jmp 2b 2: jmp 2b
.section ".prefix.data", "aw", @progbits .section ".prefix.data.a20_death_message", "aw", @progbits
a20_death_message: a20_death_message:
.asciz "\nHigh memory inaccessible - cannot continue\n" .asciz "\nHigh memory inaccessible - cannot continue\n"
.size a20_death_message, . - a20_death_message .size a20_death_message, . - a20_death_message
@@ -780,7 +780,7 @@ a20_death_message:
cli cli
hlt hlt
jmp 2b jmp 2b
.section ".prefix.data", "aw", @progbits .section ".prefix.data.payload_death_message", "aw", @progbits
payload_death_message: payload_death_message:
.asciz "\nPayload inaccessible - cannot continue\n" .asciz "\nPayload inaccessible - cannot continue\n"
.size payload_death_message, . - payload_death_message .size payload_death_message, . - payload_death_message
@@ -918,7 +918,7 @@ payload_death_message:
/* Vectors for far calls to .text16 functions. Must be in /* Vectors for far calls to .text16 functions. Must be in
* .data16, since .prefix may not be writable. * .data16, since .prefix may not be writable.
*/ */
.section ".data16", "aw", @progbits .section ".data16.install_prealloc", "aw", @progbits
#ifdef KEEP_IT_REAL #ifdef KEEP_IT_REAL
init_libkir_vector: init_libkir_vector:
.word init_libkir .word init_libkir
@@ -940,7 +940,7 @@ close_payload_vector:
.size close_payload_vector, . - close_payload_vector .size close_payload_vector, . - close_payload_vector
/* Dummy routines to open and close payload */ /* Dummy routines to open and close payload */
.section ".text16.early.data", "aw", @progbits .section ".text16.early.data.open_payload", "aw", @progbits
.weak open_payload .weak open_payload
.weak close_payload .weak close_payload
open_payload: open_payload:
@@ -963,7 +963,7 @@ close_payload:
* none * none
**************************************************************************** ****************************************************************************
*/ */
.section ".text16", "ax", @progbits .section ".text16.uninstall", "ax", @progbits
.code16 .code16
.globl uninstall .globl uninstall
uninstall: uninstall: