Bläddra i källkod

[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>
tags/v1.20.1
Michael Brown 8 år sedan
förälder
incheckning
02a88b7489
1 ändrade filer med 20 tillägg och 20 borttagningar
  1. 20
    20
      src/arch/x86/prefix/libprefix.S

+ 20
- 20
src/arch/x86/prefix/libprefix.S Visa fil

@@ -69,7 +69,7 @@ progress_\@:
69 69
  *   %ds:di : next character in output buffer (if applicable)
70 70
  *****************************************************************************
71 71
  */
72
-	.section ".prefix.lib", "awx", @progbits
72
+	.section ".prefix.print_character", "awx", @progbits
73 73
 	.code16
74 74
 	.globl	print_character
75 75
 print_character:
@@ -107,7 +107,7 @@ print_character:
107 107
  *   %ds:di : next character in output buffer (if applicable)
108 108
  *****************************************************************************
109 109
  */
110
-	.section ".prefix.lib", "awx", @progbits
110
+	.section ".prefix.print_space", "awx", @progbits
111 111
 	.code16
112 112
 	.globl	print_space
113 113
 print_space:
@@ -132,7 +132,7 @@ print_space:
132 132
  *   %ds:di : next character in output buffer (if applicable)
133 133
  *****************************************************************************
134 134
  */
135
-	.section ".prefix.lib", "awx", @progbits
135
+	.section ".prefix.print_message", "awx", @progbits
136 136
 	.code16
137 137
 	.globl	print_message
138 138
 print_message:
@@ -162,7 +162,7 @@ print_message:
162 162
  *   %ds:di : next character in output buffer (if applicable)
163 163
  *****************************************************************************
164 164
  */
165
-	.section ".prefix.lib", "awx", @progbits
165
+	.section ".prefix.print_hex", "awx", @progbits
166 166
 	.code16
167 167
 	.globl	print_hex_dword
168 168
 print_hex_dword:
@@ -210,7 +210,7 @@ print_hex_nibble:
210 210
  *   %ds:di : next character in output buffer (if applicable)
211 211
  *****************************************************************************
212 212
  */
213
-	.section ".prefix.lib", "awx", @progbits
213
+	.section ".prefix.print_pci_busdevfn", "awx", @progbits
214 214
 	.code16
215 215
 	.globl	print_pci_busdevfn
216 216
 print_pci_busdevfn:
@@ -247,7 +247,7 @@ print_pci_busdevfn:
247 247
  *   %ds:di : next character in output buffer (if applicable)
248 248
  *****************************************************************************
249 249
  */
250
-	.section ".prefix.lib", "awx", @progbits
250
+	.section ".prefix.print_kill_line", "awx", @progbits
251 251
 	.code16
252 252
 	.globl	print_kill_line
253 253
 print_kill_line:
@@ -285,7 +285,7 @@ print_kill_line:
285 285
  *   None
286 286
  ****************************************************************************
287 287
  */
288
-	.section ".prefix.lib", "awx", @progbits
288
+	.section ".prefix.copy_bytes", "awx", @progbits
289 289
 	.code16
290 290
 copy_bytes:
291 291
 	pushl	%ecx
@@ -308,7 +308,7 @@ copy_bytes:
308 308
  *   None
309 309
  ****************************************************************************
310 310
  */
311
-	.section ".prefix.lib", "awx", @progbits
311
+	.section ".prefix.zero_bytes", "awx", @progbits
312 312
 	.code16
313 313
 zero_bytes:
314 314
 	pushl	%ecx
@@ -343,7 +343,7 @@ zero_bytes:
343 343
  *   None
344 344
  ****************************************************************************
345 345
  */
346
-	.section ".prefix.lib", "awx", @progbits
346
+	.section ".prefix.process_bytes", "awx", @progbits
347 347
 	.code16
348 348
 process_bytes:
349 349
 
@@ -495,7 +495,7 @@ process_bytes:
495 495
  *   none
496 496
  ****************************************************************************
497 497
  */
498
-	.section ".prefix.lib", "awx", @progbits
498
+	.section ".prefix.install_block", "awx", @progbits
499 499
 	.code16
500 500
 install_block:
501 501
 	/* Preserve registers */
@@ -544,7 +544,7 @@ install_block:
544 544
  *   none
545 545
  ****************************************************************************
546 546
  */
547
-	.section ".prefix.lib", "awx", @progbits
547
+	.section ".prefix.alloc_basemem", "awx", @progbits
548 548
 	.code16
549 549
 	.globl	alloc_basemem
550 550
 alloc_basemem:
@@ -591,7 +591,7 @@ alloc_basemem:
591 591
  *   none
592 592
  ****************************************************************************
593 593
  */
594
-	.section ".text16", "ax", @progbits
594
+	.section ".text16.free_basemem", "ax", @progbits
595 595
 	.code16
596 596
 	.globl	free_basemem
597 597
 free_basemem:
@@ -625,7 +625,7 @@ free_basemem:
625 625
 	ret
626 626
 	.size free_basemem, . - free_basemem
627 627
 
628
-	.section ".text16.data", "aw", @progbits
628
+	.section ".text16.data.hooked_bios_interrupts", "aw", @progbits
629 629
 	.globl	hooked_bios_interrupts
630 630
 hooked_bios_interrupts:
631 631
 	.word	0
@@ -645,7 +645,7 @@ hooked_bios_interrupts:
645 645
  *   none
646 646
  ****************************************************************************
647 647
  */
648
-	.section ".prefix.lib", "awx", @progbits
648
+	.section ".prefix.install", "awx", @progbits
649 649
 	.code16
650 650
 	.globl install
651 651
 install:
@@ -688,7 +688,7 @@ install:
688 688
  *   none
689 689
  ****************************************************************************
690 690
  */
691
-	.section ".prefix.lib", "awx", @progbits
691
+	.section ".prefix.install_prealloc", "awx", @progbits
692 692
 	.code16
693 693
 	.globl install_prealloc
694 694
 install_prealloc:
@@ -751,7 +751,7 @@ install_prealloc:
751 751
 	xorw	%di, %di
752 752
 	call	print_message
753 753
 2:	jmp	2b
754
-	.section ".prefix.data", "aw", @progbits
754
+	.section ".prefix.data.a20_death_message", "aw", @progbits
755 755
 a20_death_message:
756 756
 	.asciz	"\nHigh memory inaccessible - cannot continue\n"
757 757
 	.size	a20_death_message, . - a20_death_message
@@ -780,7 +780,7 @@ a20_death_message:
780 780
 	cli
781 781
 	hlt
782 782
 	jmp	2b
783
-	.section ".prefix.data", "aw", @progbits
783
+	.section ".prefix.data.payload_death_message", "aw", @progbits
784 784
 payload_death_message:
785 785
 	.asciz	"\nPayload inaccessible - cannot continue\n"
786 786
 	.size	payload_death_message, . - payload_death_message
@@ -918,7 +918,7 @@ payload_death_message:
918 918
 	/* Vectors for far calls to .text16 functions.  Must be in
919 919
 	 * .data16, since .prefix may not be writable.
920 920
 	 */
921
-	.section ".data16", "aw", @progbits
921
+	.section ".data16.install_prealloc", "aw", @progbits
922 922
 #ifdef KEEP_IT_REAL
923 923
 init_libkir_vector:
924 924
 	.word init_libkir
@@ -940,7 +940,7 @@ close_payload_vector:
940 940
 	.size close_payload_vector, . - close_payload_vector
941 941
 
942 942
 	/* Dummy routines to open and close payload */
943
-	.section ".text16.early.data", "aw", @progbits
943
+	.section ".text16.early.data.open_payload", "aw", @progbits
944 944
 	.weak	open_payload
945 945
 	.weak	close_payload
946 946
 open_payload:
@@ -963,7 +963,7 @@ close_payload:
963 963
  *   none
964 964
  ****************************************************************************
965 965
  */
966
-	.section ".text16", "ax", @progbits
966
+	.section ".text16.uninstall", "ax", @progbits
967 967
 	.code16
968 968
 	.globl uninstall
969 969
 uninstall:

Laddar…
Avbryt
Spara