[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'`
This commit is contained in:
Michael Brown
2009-02-15 10:59:53 +00:00
parent ce2aa66d39
commit c9e5b12473
10 changed files with 85 additions and 102 deletions
+17 -19
View File
@@ -18,8 +18,6 @@
*/
.arch i386
.section ".prefix.lib", "awx", @progbits
.section ".data16", "aw", @progbits
/**
* High memory temporary load address
@@ -53,7 +51,7 @@
* %ds:di : next character in output buffer (if applicable)
*****************************************************************************
*/
.section ".prefix.lib"
.section ".prefix.lib", "awx", @progbits
.code16
.globl print_character
print_character:
@@ -93,7 +91,7 @@ print_character:
* %ds:di : next character in output buffer (if applicable)
*****************************************************************************
*/
.section ".prefix.lib"
.section ".prefix.lib", "awx", @progbits
.code16
.globl print_message
print_message:
@@ -123,7 +121,7 @@ print_message:
* %ds:di : next character in output buffer (if applicable)
*****************************************************************************
*/
.section ".prefix.lib"
.section ".prefix.lib", "awx", @progbits
.code16
.globl print_hex_dword
print_hex_dword:
@@ -171,7 +169,7 @@ print_hex_nibble:
* %ds:di : next character in output buffer (if applicable)
*****************************************************************************
*/
.section ".prefix.lib"
.section ".prefix.lib", "awx", @progbits
.code16
.globl print_pci_busdevfn
print_pci_busdevfn:
@@ -208,7 +206,7 @@ print_pci_busdevfn:
* %ds:di : next character in output buffer (if applicable)
*****************************************************************************
*/
.section ".prefix.lib"
.section ".prefix.lib", "awx", @progbits
.code16
.globl print_kill_line
print_kill_line:
@@ -256,7 +254,7 @@ print_kill_line:
#ifndef KEEP_IT_REAL
/* GDT for protected-mode calls */
.section ".prefix.lib"
.section ".prefix.lib", "awx", @progbits
.align 16
pm_call_vars:
gdt:
@@ -279,7 +277,7 @@ gdt_end:
.equ gdt_length, . - gdt
.size gdt, . - gdt
.section ".prefix.lib"
.section ".prefix.lib", "awx", @progbits
.align 16
pm_saved_gdt:
.long 0, 0
@@ -288,7 +286,7 @@ pm_saved_gdt:
.equ pm_call_vars_size, . - pm_call_vars
#define PM_CALL_VAR(x) ( -pm_call_vars_size + ( (x) - pm_call_vars ) )
.section ".prefix.lib"
.section ".prefix.lib", "awx", @progbits
.code16
pm_call:
/* Preserve registers, flags, and RM return point */
@@ -411,7 +409,7 @@ set_seg_base:
* None
****************************************************************************
*/
.section ".prefix.lib"
.section ".prefix.lib", "awx", @progbits
.code16
copy_bytes:
pushl %ecx
@@ -436,7 +434,7 @@ copy_bytes:
* none
****************************************************************************
*/
.section ".prefix.lib"
.section ".prefix.lib", "awx", @progbits
.code16
install_block:
@@ -533,7 +531,7 @@ install_block:
* none
****************************************************************************
*/
.section ".prefix.lib"
.section ".prefix.lib", "awx", @progbits
.code16
.globl alloc_basemem
alloc_basemem:
@@ -581,7 +579,7 @@ alloc_basemem:
* none
****************************************************************************
*/
.section ".text16"
.section ".text16", "ax", @progbits
.code16
.globl free_basemem
free_basemem:
@@ -613,7 +611,7 @@ free_basemem:
ret
.size free_basemem, . - free_basemem
.section ".text16.data"
.section ".text16.data", "aw", @progbits
.globl hooked_bios_interrupts
hooked_bios_interrupts:
.word 0
@@ -633,7 +631,7 @@ hooked_bios_interrupts:
* none
****************************************************************************
*/
.section ".prefix.lib"
.section ".prefix.lib", "awx", @progbits
.code16
.globl install
install:
@@ -668,7 +666,7 @@ install:
* none
****************************************************************************
*/
.section ".prefix.lib"
.section ".prefix.lib", "awx", @progbits
.code16
.globl install_prealloc
install_prealloc:
@@ -750,7 +748,7 @@ install_prealloc:
.size install_prealloc, . - install_prealloc
/* Vectors for far calls to .text16 functions */
.section ".data16"
.section ".data16", "aw", @progbits
#ifdef KEEP_IT_REAL
init_libkir_vector:
.word init_libkir
@@ -781,7 +779,7 @@ prot_call_vector:
* none
****************************************************************************
*/
.section ".text16"
.section ".text16", "ax", @progbits
.code16
.globl uninstall
uninstall:
+1 -3
View File
@@ -1,9 +1,7 @@
.text
.arch i386
.section ".prefix", "ax", @progbits
.section ".prefix.data", "aw", @progbits
.code16
.section ".prefix"
.section ".prefix", "ax", @progbits
.org 0
nbi_header:
+13 -15
View File
@@ -6,8 +6,6 @@
.text
.arch i386
.org 0
.section ".prefix", "ax", @progbits
.section ".prefix.data", "aw", @progbits
.code16
#include <undi.h>
@@ -16,7 +14,7 @@
* Entry point: set operating context, print welcome message
*****************************************************************************
*/
.section ".prefix"
.section ".prefix", "ax", @progbits
/* Set up our non-stack segment registers */
jmp $0x7c0, $1f
1: movw %cs, %ax
@@ -39,7 +37,7 @@
movw $10f, %si
xorw %di, %di
call print_message
.section ".prefix.data"
.section ".prefix.data", "aw", @progbits
10: .asciz "PXE->EB:"
.previous
@@ -70,7 +68,7 @@ detect_pxenv:
movb $',', %al
call print_character
jmp 99f
.section ".prefix.data"
.section ".prefix.data", "aw", @progbits
10: .asciz " PXENV+ at "
.previous
@@ -108,7 +106,7 @@ detect_ppxe:
movb $',', %al
call print_character
jmp 99f
.section ".prefix.data"
.section ".prefix.data", "aw", @progbits
10: .asciz " !PXE at "
.previous
@@ -131,7 +129,7 @@ check_have_stack:
movw $10f, %si
call print_message
jmp finished
.section ".prefix.data"
.section ".prefix.data", "aw", @progbits
10: .asciz " No PXE stack found!\n"
.previous
99:
@@ -169,7 +167,7 @@ print_structure_information:
call print_message
les entry_segoff, %bx
call print_segoff
.section ".prefix.data"
.section ".prefix.data", "aw", @progbits
10: .asciz " entry point at "
.previous
/* Print UNDI code segment */
@@ -177,7 +175,7 @@ print_structure_information:
call print_message
les undi_code_segoff, %bx
call print_segoff
.section ".prefix.data"
.section ".prefix.data", "aw", @progbits
10: .asciz "\n UNDI code segment "
.previous
/* Print UNDI data segment */
@@ -185,7 +183,7 @@ print_structure_information:
call print_message
les undi_data_segoff, %bx
call print_segoff
.section ".prefix.data"
.section ".prefix.data", "aw", @progbits
10: .asciz ", data segment "
.previous
/* Print UNDI memory usage */
@@ -199,7 +197,7 @@ print_structure_information:
call print_word
movw $20f, %si
call print_message
.section ".prefix.data"
.section ".prefix.data", "aw", @progbits
10: .asciz " ("
20: .asciz "kB)\n"
.previous
@@ -233,7 +231,7 @@ pci_physical_device:
movb $0x0a, %al
call print_character
jmp 99f
.section ".prefix.data"
.section ".prefix.data", "aw", @progbits
10: .asciz " UNDI device is PCI "
.previous
@@ -241,7 +239,7 @@ no_physical_device:
/* No device found, or device type not understood */
movw $10f, %si
call print_message
.section ".prefix.data"
.section ".prefix.data", "aw", @progbits
10: .asciz " Unable to determine UNDI physical device\n"
.previous
@@ -308,7 +306,7 @@ print_free_basemem:
call print_word
movw $20f, %si
call print_message
.section ".prefix.data"
.section ".prefix.data", "aw", @progbits
10: .asciz " "
20: .asciz "kB free base memory after PXE unload\n"
.previous
@@ -503,7 +501,7 @@ print_pxe_error:
call print_message
popw %si
ret
.section ".prefix.data"
.section ".prefix.data", "aw", @progbits
10: .asciz " UNDI API call "
20: .asciz " failed: status code "
30: .asciz "\n"