Bladeren bron

[i386] Add explicit flags and type on all .section declarations

Try to avoid future problems caused by implicit section flags and/or
type information by instituting a policy that all .section
declarations must explicitly state the flags and type.

Most of this change was achieved using

    perl -pi \
      -e 's/".text"$/".text", "ax", \@progbits/ ; ' \
      -e 's/".text16"$/".text16", "ax", \@progbits/ ; ' \
      -e 's/".text16.null"$/".text16.null", "ax", \@progbits/ ; ' \
      -e 's/".text16.data"$/".text16.data", "aw", \@progbits/ ; ' \
      -e 's/".data"$/".data", "aw", \@progbits/ ; ' \
      -e 's/".data16"$/".data16", "aw", \@progbits/ ; ' \
      -e 's/".bss"$/".bss", "aw", \@nobits/ ; ' \
      -e 's/".bss16"$/".bss16", "aw", \@nobits/ ; ' \
      -e 's/".prefix"$/".prefix", "ax", \@progbits/ ; ' \
      -e 's/".prefix.lib"$/".prefix.lib", "awx", \@progbits/ ; ' \
      -e 's/".prefix.data"$/".prefix.data", "aw", \@progbits/ ; ' \
      -e 's/".weak"$/".weak", "a", \@nobits/ ; ' \
      `git grep -l '\.section'`
tags/v0.9.7
Michael Brown 16 jaren geleden
bovenliggende
commit
c9e5b12473

+ 3
- 3
src/arch/i386/core/gdbidt.S Bestand weergeven

@@ -11,7 +11,7 @@
11 11
  * Interrupt Descriptor Table
12 12
  ****************************************************************************
13 13
  */
14
-	.section ".data16"
14
+	.section ".data16", "aw", @progbits
15 15
 	.globl idtr
16 16
 idtr:
17 17
 idt_limit:
@@ -68,7 +68,7 @@ idt_fixed:
68 68
  * Destroys %ax, %bx, and %di.
69 69
  ****************************************************************************
70 70
  */
71
-	.section ".text16"
71
+	.section ".text16", "ax", @progbits
72 72
 	.code16
73 73
 	.globl idt_init
74 74
 idt_init:
@@ -100,7 +100,7 @@ idt_init:
100 100
  * Interrupt handlers
101 101
  ****************************************************************************
102 102
  */
103
-	.section ".text"
103
+	.section ".text", "ax", @progbits
104 104
 	.code32
105 105
 
106 106
 /* POSIX signal numbers for reporting traps to GDB */

+ 2
- 4
src/arch/i386/drivers/net/undiisr.S Bestand weergeven

@@ -10,11 +10,9 @@
10 10
 	
11 11
 	.text
12 12
 	.arch i386
13
-	.section ".text16", "ax", @progbits
14
-	.section ".data16", "aw", @progbits
15 13
 	.code16
16 14
 
17
-	.section ".text16"
15
+	.section ".text16", "ax", @progbits
18 16
 	.globl undiisr
19 17
 undiisr:
20 18
 	
@@ -75,7 +73,7 @@ exit:	/* Restore registers and return */
75 73
 	popw	%ds
76 74
 	iret
77 75
 
78
-	.section ".data16"
76
+	.section ".data16", "aw", @progbits
79 77
 undinet_params:
80 78
 status:			.word	0
81 79
 funcflag:		.word	0

+ 18
- 21
src/arch/i386/firmware/pcbios/e820mangler.S Bestand weergeven

@@ -18,9 +18,6 @@
18 18
 	
19 19
 	.text
20 20
 	.arch i386
21
-	.section ".text16", "ax", @progbits
22
-	.section ".data16", "aw", @progbits
23
-	.section ".text16.data", "aw", @progbits
24 21
 	.code16
25 22
 
26 23
 #define SMAP 0x534d4150
@@ -62,7 +59,7 @@
62 59
  *
63 60
  ****************************************************************************
64 61
  */
65
-	.section ".data16"
62
+	.section ".data16", "aw", @progbits
66 63
 	.align 16
67 64
 	.globl hidemem_base
68 65
 	.globl hidemem_umalloc
@@ -94,7 +91,7 @@ memory_windows_end:
94 91
  *  %ecx:%ebx	Length of windowed region
95 92
  ****************************************************************************
96 93
  */
97
-	.section ".text16"
94
+	.section ".text16", "ax", @progbits
98 95
 window_region:
99 96
 	/* Convert (start,len) to (start, end) */
100 97
 	addl	%eax, %ebx
@@ -132,7 +129,7 @@ window_region:
132 129
  *  %ax		Modified memory above 1M in 1kB blocks
133 130
  ****************************************************************************
134 131
  */
135
-	.section ".text16"
132
+	.section ".text16", "ax", @progbits
136 133
 patch_1m:
137 134
 	pushal
138 135
 	/* Convert to (start,len) format and call truncate */
@@ -162,7 +159,7 @@ patch_1m:
162 159
  *  %bx		Modified memory above 16M in 64kB blocks
163 160
  ****************************************************************************
164 161
  */
165
-	.section ".text16"
162
+	.section ".text16", "ax", @progbits
166 163
 patch_16m:
167 164
 	pushal
168 165
 	/* Convert to (start,len) format and call truncate */
@@ -193,7 +190,7 @@ patch_16m:
193 190
  *  %bx		Modified memory above 16MB, in 64kB blocks
194 191
  ****************************************************************************
195 192
  */
196
-	.section ".text16"
193
+	.section ".text16", "ax", @progbits
197 194
 patch_1m_16m:
198 195
 	call	patch_1m
199 196
 	call	patch_16m
@@ -219,7 +216,7 @@ patch_1m_16m:
219 216
  *
220 217
  ****************************************************************************
221 218
  */
222
-	.section ".text16"
219
+	.section ".text16", "ax", @progbits
223 220
 get_underlying_e820:
224 221
 
225 222
 	/* If the requested region is in the cache, return it */
@@ -308,22 +305,22 @@ get_underlying_e820:
308 305
 	jmp	get_underlying_e820
309 306
 	.size	get_underlying_e820, . - get_underlying_e820
310 307
 
311
-	.section ".data16"
308
+	.section ".data16", "aw", @progbits
312 309
 underlying_e820_index:
313 310
 	.word	0xffff /* Initialise to an invalid value */
314 311
 	.size underlying_e820_index, . - underlying_e820_index
315 312
 
316
-	.section ".bss16"
313
+	.section ".bss16", "aw", @nobits
317 314
 underlying_e820_ebx:
318 315
 	.long	0
319 316
 	.size underlying_e820_ebx, . - underlying_e820_ebx
320 317
 
321
-	.section ".bss16"
318
+	.section ".bss16", "aw", @nobits
322 319
 underlying_e820_cache:
323 320
 	.space	E820MAXSIZE
324 321
 	.size underlying_e820_cache, . - underlying_e820_cache
325 322
 
326
-	.section ".bss16"
323
+	.section ".bss16", "aw", @nobits
327 324
 underlying_e820_cache_size:
328 325
 	.long	0
329 326
 	.size	underlying_e820_cache_size, . - underlying_e820_cache_size
@@ -342,7 +339,7 @@ underlying_e820_cache_size:
342 339
  *
343 340
  ****************************************************************************
344 341
  */
345
-	.section ".text16"
342
+	.section ".text16", "ax", @progbits
346 343
 get_windowed_e820:
347 344
 
348 345
 	/* Preserve registers */
@@ -417,7 +414,7 @@ get_windowed_e820:
417 414
  *
418 415
  ****************************************************************************
419 416
  */
420
-	.section ".text16"
417
+	.section ".text16", "ax", @progbits
421 418
 get_nonempty_e820:
422 419
 
423 420
 	/* Record entry parameters */
@@ -462,7 +459,7 @@ get_nonempty_e820:
462 459
  *
463 460
  ****************************************************************************
464 461
  */
465
-	.section ".text16"
462
+	.section ".text16", "ax", @progbits
466 463
 get_mangled_e820:
467 464
 
468 465
 	/* Get a nonempty region */
@@ -496,7 +493,7 @@ get_mangled_e820:
496 493
  * INT 15,e820 handler
497 494
  ****************************************************************************
498 495
  */
499
-	.section ".text16"
496
+	.section ".text16", "ax", @progbits
500 497
 int15_e820:
501 498
 	pushw	%ds
502 499
 	pushw	%cs:rm_ds
@@ -510,7 +507,7 @@ int15_e820:
510 507
  * INT 15,e801 handler
511 508
  ****************************************************************************
512 509
  */
513
-	.section ".text16"
510
+	.section ".text16", "ax", @progbits
514 511
 int15_e801:
515 512
 	/* Call previous handler */
516 513
 	pushfw
@@ -536,7 +533,7 @@ int15_e801:
536 533
  * INT 15,88 handler
537 534
  ****************************************************************************
538 535
  */
539
-	.section ".text16"
536
+	.section ".text16", "ax", @progbits
540 537
 int15_88:
541 538
 	/* Call previous handler */
542 539
 	pushfw
@@ -557,7 +554,7 @@ int15_88:
557 554
  * INT 15 handler
558 555
  ****************************************************************************
559 556
  */
560
-	.section ".text16"
557
+	.section ".text16", "ax", @progbits
561 558
 	.globl int15
562 559
 int15:
563 560
 	/* See if we want to intercept this call */
@@ -580,7 +577,7 @@ int15:
580 577
 	ljmp	*%cs:int15_vector
581 578
 	.size int15, . - int15
582 579
 	
583
-	.section ".text16.data"
580
+	.section ".text16.data", "aw", @progbits
584 581
 	.globl int15_vector
585 582
 int15_vector:
586 583
 	.long 0

+ 8
- 11
src/arch/i386/interface/pxe/pxe_entry.S Bestand weergeven

@@ -18,15 +18,12 @@
18 18
  */
19 19
 
20 20
 	.arch i386
21
-	.section ".text16", "awx", @progbits
22
-	.section ".text16.data", "aw", @progbits
23
-	.section ".data16", "aw", @progbits
24 21
 
25 22
 /****************************************************************************
26 23
  * !PXE structure
27 24
  ****************************************************************************
28 25
  */
29
-	.section ".text16.data"
26
+	.section ".text16.data", "aw", @progbits
30 27
 	.globl ppxe
31 28
 	.align 16
32 29
 ppxe:
@@ -56,7 +53,7 @@ pxe_segments:
56 53
 	.size	ppxe, . - ppxe
57 54
 
58 55
 	/* Define undiheader=0 as a weak symbol for non-ROM builds */
59
-	.section ".weak"
56
+	.section ".weak", "a", @nobits
60 57
 	.weak	undiheader
61 58
 undiheader:
62 59
 
@@ -64,7 +61,7 @@ undiheader:
64 61
  * PXENV+ structure
65 62
  ****************************************************************************
66 63
  */
67
-	.section ".text16.data"
64
+	.section ".text16.data", "aw", @progbits
68 65
 	.globl pxenv
69 66
 	.align 16
70 67
 pxenv:
@@ -108,12 +105,12 @@ pxenv:
108 105
 	 * somebody at Wyse has difficulty distinguishing between the
109 106
 	 * words "may" and "must"...
110 107
 	 */
111
-	.section ".text16.null"
108
+	.section ".text16.null", "ax", @progbits
112 109
 	.code16
113 110
 pxenv_null_entry:
114 111
 	jmp	pxenv_entry
115 112
 
116
-	.section ".text16"
113
+	.section ".text16", "ax", @progbits
117 114
 	.code16
118 115
 pxenv_entry:
119 116
 	pushl	$pxe_api_call
@@ -137,7 +134,7 @@ pxenv_entry:
137 134
  *   none
138 135
  ****************************************************************************
139 136
  */
140
-	.section ".text16"
137
+	.section ".text16", "ax", @progbits
141 138
 	.code16
142 139
 pxe_entry:
143 140
 pxe_entry_sp:
@@ -186,7 +183,7 @@ pxe_entry_common:
186 183
  *   none
187 184
  ****************************************************************************
188 185
  */
189
-	.section ".text16"
186
+	.section ".text16", "ax", @progbits
190 187
 	.code16
191 188
 	.globl	pxe_int_1a
192 189
 pxe_int_1a:
@@ -205,6 +202,6 @@ pxe_int_1a:
205 202
 	popfw
206 203
 	ljmp	*%cs:pxe_int_1a_vector
207 204
 
208
-	.section ".text16.data"
205
+	.section ".text16.data", "aw", @progbits
209 206
 	.globl	pxe_int_1a_vector
210 207
 pxe_int_1a_vector:	.long 0

+ 17
- 19
src/arch/i386/prefix/libprefix.S Bestand weergeven

@@ -18,8 +18,6 @@
18 18
  */
19 19
 
20 20
 	.arch i386
21
-	.section ".prefix.lib", "awx", @progbits
22
-	.section ".data16", "aw", @progbits
23 21
 
24 22
 /**
25 23
  * High memory temporary load address
@@ -53,7 +51,7 @@
53 51
  *   %ds:di : next character in output buffer (if applicable)
54 52
  *****************************************************************************
55 53
  */
56
-	.section ".prefix.lib"
54
+	.section ".prefix.lib", "awx", @progbits
57 55
 	.code16
58 56
 	.globl	print_character
59 57
 print_character:
@@ -93,7 +91,7 @@ print_character:
93 91
  *   %ds:di : next character in output buffer (if applicable)
94 92
  *****************************************************************************
95 93
  */
96
-	.section ".prefix.lib"
94
+	.section ".prefix.lib", "awx", @progbits
97 95
 	.code16
98 96
 	.globl	print_message
99 97
 print_message:
@@ -123,7 +121,7 @@ print_message:
123 121
  *   %ds:di : next character in output buffer (if applicable)
124 122
  *****************************************************************************
125 123
  */
126
-	.section ".prefix.lib"
124
+	.section ".prefix.lib", "awx", @progbits
127 125
 	.code16
128 126
 	.globl	print_hex_dword
129 127
 print_hex_dword:
@@ -171,7 +169,7 @@ print_hex_nibble:
171 169
  *   %ds:di : next character in output buffer (if applicable)
172 170
  *****************************************************************************
173 171
  */
174
-	.section ".prefix.lib"
172
+	.section ".prefix.lib", "awx", @progbits
175 173
 	.code16
176 174
 	.globl	print_pci_busdevfn
177 175
 print_pci_busdevfn:
@@ -208,7 +206,7 @@ print_pci_busdevfn:
208 206
  *   %ds:di : next character in output buffer (if applicable)
209 207
  *****************************************************************************
210 208
  */
211
-	.section ".prefix.lib"
209
+	.section ".prefix.lib", "awx", @progbits
212 210
 	.code16
213 211
 	.globl	print_kill_line
214 212
 print_kill_line:
@@ -256,7 +254,7 @@ print_kill_line:
256 254
 #ifndef KEEP_IT_REAL
257 255
 
258 256
 	/* GDT for protected-mode calls */
259
-	.section ".prefix.lib"
257
+	.section ".prefix.lib", "awx", @progbits
260 258
 	.align 16
261 259
 pm_call_vars:
262 260
 gdt:
@@ -279,7 +277,7 @@ gdt_end:
279 277
 	.equ	gdt_length, . - gdt
280 278
 	.size	gdt, . - gdt
281 279
 
282
-	.section ".prefix.lib"
280
+	.section ".prefix.lib", "awx", @progbits
283 281
 	.align 16
284 282
 pm_saved_gdt:	
285 283
 	.long	0, 0
@@ -288,7 +286,7 @@ pm_saved_gdt:
288 286
 	.equ	pm_call_vars_size, . - pm_call_vars
289 287
 #define PM_CALL_VAR(x) ( -pm_call_vars_size + ( (x) - pm_call_vars ) )
290 288
 
291
-	.section ".prefix.lib"
289
+	.section ".prefix.lib", "awx", @progbits
292 290
 	.code16
293 291
 pm_call:
294 292
 	/* Preserve registers, flags, and RM return point */
@@ -411,7 +409,7 @@ set_seg_base:
411 409
  *   None
412 410
  ****************************************************************************
413 411
  */
414
-	.section ".prefix.lib"
412
+	.section ".prefix.lib", "awx", @progbits
415 413
 	.code16
416 414
 copy_bytes:
417 415
 	pushl %ecx
@@ -436,7 +434,7 @@ copy_bytes:
436 434
  *   none
437 435
  ****************************************************************************
438 436
  */
439
-	.section ".prefix.lib"
437
+	.section ".prefix.lib", "awx", @progbits
440 438
 	.code16
441 439
 install_block:
442 440
 	
@@ -533,7 +531,7 @@ install_block:
533 531
  *   none
534 532
  ****************************************************************************
535 533
  */
536
-	.section ".prefix.lib"
534
+	.section ".prefix.lib", "awx", @progbits
537 535
 	.code16
538 536
 	.globl	alloc_basemem
539 537
 alloc_basemem:
@@ -581,7 +579,7 @@ alloc_basemem:
581 579
  *   none
582 580
  ****************************************************************************
583 581
  */
584
-	.section ".text16"
582
+	.section ".text16", "ax", @progbits
585 583
 	.code16
586 584
 	.globl	free_basemem
587 585
 free_basemem:
@@ -613,7 +611,7 @@ free_basemem:
613 611
 	ret
614 612
 	.size free_basemem, . - free_basemem
615 613
 
616
-	.section ".text16.data"
614
+	.section ".text16.data", "aw", @progbits
617 615
 	.globl	hooked_bios_interrupts
618 616
 hooked_bios_interrupts:
619 617
 	.word	0
@@ -633,7 +631,7 @@ hooked_bios_interrupts:
633 631
  *   none
634 632
  ****************************************************************************
635 633
  */
636
-	.section ".prefix.lib"
634
+	.section ".prefix.lib", "awx", @progbits
637 635
 	.code16
638 636
 	.globl install
639 637
 install:
@@ -668,7 +666,7 @@ install:
668 666
  *   none
669 667
  ****************************************************************************
670 668
  */
671
-	.section ".prefix.lib"
669
+	.section ".prefix.lib", "awx", @progbits
672 670
 	.code16
673 671
 	.globl install_prealloc
674 672
 install_prealloc:
@@ -750,7 +748,7 @@ install_prealloc:
750 748
 	.size install_prealloc, . - install_prealloc
751 749
 
752 750
 	/* Vectors for far calls to .text16 functions */
753
-	.section ".data16"
751
+	.section ".data16", "aw", @progbits
754 752
 #ifdef KEEP_IT_REAL
755 753
 init_libkir_vector:
756 754
 	.word init_libkir
@@ -781,7 +779,7 @@ prot_call_vector:
781 779
  *   none
782 780
  ****************************************************************************
783 781
  */
784
-	.section ".text16"
782
+	.section ".text16", "ax", @progbits
785 783
 	.code16
786 784
 	.globl uninstall
787 785
 uninstall:

+ 1
- 3
src/arch/i386/prefix/nbiprefix.S Bestand weergeven

@@ -1,9 +1,7 @@
1 1
 	.text
2 2
 	.arch i386
3
-	.section ".prefix", "ax", @progbits
4
-	.section ".prefix.data", "aw", @progbits
5 3
 	.code16
6
-	.section ".prefix"
4
+	.section ".prefix", "ax", @progbits
7 5
 	.org 0
8 6
 
9 7
 nbi_header:

+ 13
- 15
src/arch/i386/prefix/pxeprefix.S Bestand weergeven

@@ -6,8 +6,6 @@
6 6
 	.text
7 7
 	.arch i386
8 8
 	.org 0
9
-	.section ".prefix", "ax", @progbits
10
-	.section ".prefix.data", "aw", @progbits
11 9
 	.code16
12 10
 
13 11
 #include <undi.h>
@@ -16,7 +14,7 @@
16 14
  * Entry point:	set operating context, print welcome message
17 15
  *****************************************************************************
18 16
  */
19
-	.section ".prefix"
17
+	.section ".prefix", "ax", @progbits
20 18
 	/* Set up our non-stack segment registers */
21 19
 	jmp	$0x7c0, $1f
22 20
 1:	movw	%cs, %ax
@@ -39,7 +37,7 @@
39 37
 	movw	$10f, %si
40 38
 	xorw	%di, %di
41 39
 	call	print_message
42
-	.section ".prefix.data"
40
+	.section ".prefix.data", "aw", @progbits
43 41
 10:	.asciz	"PXE->EB:"
44 42
 	.previous
45 43
 
@@ -70,7 +68,7 @@ detect_pxenv:
70 68
 	movb	$',', %al
71 69
 	call	print_character
72 70
 	jmp	99f
73
-	.section ".prefix.data"
71
+	.section ".prefix.data", "aw", @progbits
74 72
 10:	.asciz	" PXENV+ at "
75 73
 	.previous
76 74
 
@@ -108,7 +106,7 @@ detect_ppxe:
108 106
 	movb	$',', %al
109 107
 	call	print_character
110 108
 	jmp	99f
111
-	.section ".prefix.data"
109
+	.section ".prefix.data", "aw", @progbits
112 110
 10:	.asciz	" !PXE at "
113 111
 	.previous
114 112
 
@@ -131,7 +129,7 @@ check_have_stack:
131 129
 	movw	$10f, %si
132 130
 	call	print_message
133 131
 	jmp	finished
134
-	.section ".prefix.data"
132
+	.section ".prefix.data", "aw", @progbits
135 133
 10:	.asciz	" No PXE stack found!\n"
136 134
 	.previous
137 135
 99:	
@@ -169,7 +167,7 @@ print_structure_information:
169 167
 	call	print_message
170 168
 	les	entry_segoff, %bx
171 169
 	call	print_segoff
172
-	.section ".prefix.data"
170
+	.section ".prefix.data", "aw", @progbits
173 171
 10:	.asciz	" entry point at "
174 172
 	.previous
175 173
 	/* Print UNDI code segment */
@@ -177,7 +175,7 @@ print_structure_information:
177 175
 	call	print_message
178 176
 	les	undi_code_segoff, %bx
179 177
 	call	print_segoff
180
-	.section ".prefix.data"
178
+	.section ".prefix.data", "aw", @progbits
181 179
 10:	.asciz	"\n         UNDI code segment "
182 180
 	.previous
183 181
 	/* Print UNDI data segment */
@@ -185,7 +183,7 @@ print_structure_information:
185 183
 	call	print_message
186 184
 	les	undi_data_segoff, %bx
187 185
 	call	print_segoff
188
-	.section ".prefix.data"
186
+	.section ".prefix.data", "aw", @progbits
189 187
 10:	.asciz	", data segment "
190 188
 	.previous
191 189
 	/* Print UNDI memory usage */
@@ -199,7 +197,7 @@ print_structure_information:
199 197
 	call	print_word
200 198
 	movw	$20f, %si
201 199
 	call	print_message
202
-	.section ".prefix.data"
200
+	.section ".prefix.data", "aw", @progbits
203 201
 10:	.asciz	" ("
204 202
 20:	.asciz	"kB)\n"
205 203
 	.previous
@@ -233,7 +231,7 @@ pci_physical_device:
233 231
 	movb	$0x0a, %al
234 232
 	call	print_character
235 233
 	jmp	99f
236
-	.section ".prefix.data"
234
+	.section ".prefix.data", "aw", @progbits
237 235
 10:	.asciz	"         UNDI device is PCI "
238 236
 	.previous
239 237
 
@@ -241,7 +239,7 @@ no_physical_device:
241 239
 	/* No device found, or device type not understood */
242 240
 	movw	$10f, %si
243 241
 	call	print_message
244
-	.section ".prefix.data"
242
+	.section ".prefix.data", "aw", @progbits
245 243
 10:	.asciz	"         Unable to determine UNDI physical device\n"
246 244
 	.previous
247 245
 
@@ -308,7 +306,7 @@ print_free_basemem:
308 306
 	call	print_word
309 307
 	movw	$20f, %si
310 308
 	call	print_message
311
-	.section ".prefix.data"
309
+	.section ".prefix.data", "aw", @progbits
312 310
 10:	.asciz	"         "
313 311
 20:	.asciz	"kB free base memory after PXE unload\n"
314 312
 	.previous
@@ -503,7 +501,7 @@ print_pxe_error:
503 501
 	call	print_message
504 502
 	popw	%si
505 503
 	ret
506
-	.section ".prefix.data"
504
+	.section ".prefix.data", "aw", @progbits
507 505
 10:	.asciz	"         UNDI API call "
508 506
 20:	.asciz	" failed: status code "
509 507
 30:	.asciz	"\n"

+ 20
- 23
src/arch/i386/transitions/librm.S Bestand weergeven

@@ -19,9 +19,6 @@
19 19
 #define SIZEOF_I386_ALL_REGS	( SIZEOF_REAL_MODE_REGS + SIZEOF_I386_FLAGS )
20 20
 	
21 21
 	.arch i386
22
-	.section ".text16", "ax", @progbits
23
-	.section ".text16.data", "aw", @progbits
24
-	.section ".data16", "aw", @progbits
25 22
 
26 23
 /****************************************************************************
27 24
  * Global descriptor table
@@ -47,7 +44,7 @@
47 44
 #else
48 45
 #define RM_LIMIT_16_19__AVL__SIZE__GRANULARITY 0x00
49 46
 #endif
50
-	.section ".data16"
47
+	.section ".data16", "aw", @progbits
51 48
 	.align 16
52 49
 gdt:
53 50
 gdtr:		/* The first GDT entry is unused, the GDTR can fit here. */
@@ -99,7 +96,7 @@ gdt_end:
99 96
  *   %edi : Physical base of protected-mode code (virt_offset)
100 97
  ****************************************************************************
101 98
  */
102
-	.section ".text16"
99
+	.section ".text16", "ax", @progbits
103 100
 	.code16
104 101
 	.globl init_librm
105 102
 init_librm:
@@ -149,7 +146,7 @@ init_librm:
149 146
 	popl	%eax
150 147
 	lret
151 148
 
152
-	.section ".text16"
149
+	.section ".text16", "ax", @progbits
153 150
 	.code16
154 151
 	.weak idt_init
155 152
 set_seg_base:
@@ -177,7 +174,7 @@ idt_init: /* Reuse the return opcode here */
177 174
  *
178 175
  ****************************************************************************
179 176
  */
180
-	.section ".text16"
177
+	.section ".text16", "ax", @progbits
181 178
 	.code16
182 179
 real_to_prot:
183 180
 	/* Make sure we have our data segment available */
@@ -209,7 +206,7 @@ real_to_prot:
209 206
 	orb	$CR0_PE, %al
210 207
 	movl	%eax, %cr0
211 208
 	data32 ljmp	$VIRTUAL_CS, $1f
212
-	.section ".text"
209
+	.section ".text", "ax", @progbits
213 210
 	.code32
214 211
 1:
215 212
 	/* Set up protected-mode data segments and stack pointer */
@@ -240,7 +237,7 @@ real_to_prot:
240 237
 	ret
241 238
 
242 239
 	/* Default IDTR with no interrupts */
243
-	.section ".data16"
240
+	.section ".data16", "aw", @progbits
244 241
 	.weak idtr
245 242
 idtr:
246 243
 rm_idtr:
@@ -266,7 +263,7 @@ rm_idtr:
266 263
  *
267 264
  ****************************************************************************
268 265
  */
269
-	.section ".text"
266
+	.section ".text", "ax", @progbits
270 267
 	.code32
271 268
 prot_to_real:
272 269
 	/* Add return address to data to be moved to RM stack */
@@ -296,7 +293,7 @@ prot_to_real:
296 293
 	movw	%ax, %gs
297 294
 	movw	%ax, %ss
298 295
 	ljmp	$REAL_CS, $1f
299
-	.section ".text16"
296
+	.section ".text16", "ax", @progbits
300 297
 	.code16
301 298
 1:
302 299
 	/* Switch to real mode */
@@ -328,13 +325,13 @@ p2r_jump_target:
328 325
 	 * rather than .data16 because code needs to be able to locate
329 326
 	 * the data segment.
330 327
 	 */
331
-	.section ".data16"
328
+	.section ".data16", "aw", @progbits
332 329
 p2r_jump_vector:
333 330
 	.word	p2r_jump_target
334 331
 	.globl rm_cs
335 332
 rm_cs:	.word 0
336 333
 	.globl rm_ds
337
-	.section ".text16.data"
334
+	.section ".text16.data", "aw", @progbits
338 335
 rm_ds:	.word 0
339 336
 
340 337
 /****************************************************************************
@@ -378,7 +375,7 @@ rm_ds:	.word 0
378 375
 #define PC_OFFSET_FUNCTION ( PC_OFFSET_RETADDR + 4 )
379 376
 #define PC_OFFSET_END ( PC_OFFSET_FUNCTION + 4 )
380 377
 
381
-	.section ".text16"
378
+	.section ".text16", "ax", @progbits
382 379
 	.code16
383 380
 	.globl prot_call
384 381
 prot_call:
@@ -403,7 +400,7 @@ prot_call:
403 400
 	movl	$PC_OFFSET_END, %ecx
404 401
 	pushl	$1f
405 402
 	jmp	real_to_prot
406
-	.section ".text"
403
+	.section ".text", "ax", @progbits
407 404
 	.code32
408 405
 1:
409 406
 	/* Set up environment expected by C code */
@@ -419,7 +416,7 @@ prot_call:
419 416
 	movl	$PC_OFFSET_END, %ecx
420 417
 	pushl	$1f
421 418
 	jmp	prot_to_real
422
-	.section ".text16"
419
+	.section ".text16", "ax", @progbits
423 420
 	.code16
424 421
 1:	
425 422
 	/* Reload GDT and IDT, restore registers and flags and return */
@@ -475,7 +472,7 @@ prot_call:
475 472
 #define RC_OFFSET_FUNCTION ( RC_OFFSET_RETADDR + 4 )
476 473
 #define RC_OFFSET_END ( RC_OFFSET_FUNCTION + 4 )
477 474
 
478
-	.section ".text"
475
+	.section ".text", "ax", @progbits
479 476
 	.code32
480 477
 	.globl real_call
481 478
 real_call:
@@ -487,7 +484,7 @@ real_call:
487 484
 	movl	$( RC_OFFSET_RETADDR + 4 /* function pointer copy */ ), %ecx
488 485
 	pushl	$1f
489 486
 	jmp	prot_to_real
490
-	.section ".text16"
487
+	.section ".text16", "ax", @progbits
491 488
 	.code16
492 489
 1:
493 490
 	/* Call real-mode function */
@@ -503,7 +500,7 @@ real_call:
503 500
 	movl	$RC_OFFSET_RETADDR, %ecx
504 501
 	pushl	$1f
505 502
 	jmp	real_to_prot
506
-	.section ".text"
503
+	.section ".text", "ax", @progbits
507 504
 	.code32
508 505
 1:
509 506
 	/* Restore registers and return */
@@ -514,7 +511,7 @@ real_call:
514 511
 	/* Function vector, used because "call xx(%sp)" is not a valid
515 512
 	 * 16-bit expression.
516 513
 	 */
517
-	.section ".data16"
514
+	.section ".data16", "aw", @progbits
518 515
 rc_function:	.word 0, 0
519 516
 
520 517
 /****************************************************************************
@@ -551,7 +548,7 @@ rc_function:	.word 0, 0
551 548
  * to us.
552 549
  ****************************************************************************
553 550
  */
554
-	.section ".data"
551
+	.section ".data", "aw", @progbits
555 552
 	.globl rm_sp
556 553
 rm_sp:	.word 0
557 554
 	.globl rm_ss
@@ -567,13 +564,13 @@ pm_esp:	.long _estack
567 564
  ****************************************************************************
568 565
  */
569 566
 	/* Internal copies, created by init_librm (which runs in real mode) */
570
-	.section ".data16"
567
+	.section ".data16", "aw", @progbits
571 568
 _virt_offset:	.long 0
572 569
 _text16:	.long 0
573 570
 _data16:	.long 0
574 571
 
575 572
 	/* Externally-visible copies, created by real_to_prot */
576
-	.section ".data"
573
+	.section ".data", "aw", @progbits
577 574
 	.globl virt_offset
578 575
 virt_offset:	.long 0	
579 576
 	.globl text16

+ 1
- 1
src/image/embed.S Bestand weergeven

@@ -1,4 +1,4 @@
1
-	.section ".data", "aw"
1
+	.section ".data", "aw", @progbits
2 2
 	.balign 4
3 3
 	.globl _embedded_image_start
4 4
 _embedded_image_start:

+ 2
- 2
src/tests/gdbstub_test.S Bestand weergeven

@@ -1,10 +1,10 @@
1 1
 	.arch i386
2 2
 
3
-	.section ".data"
3
+	.section ".data", "aw", @progbits
4 4
 watch_me:
5 5
 	.long 0xfeedbeef
6 6
 
7
-	.section ".text"
7
+	.section ".text", "ax", @progbits
8 8
 	.code32
9 9
 gdbstub_test:
10 10
 	/* 1. Read registers test */

Laden…
Annuleren
Opslaan