mirror of
https://github.com/ipxe/ipxe
synced 2025-12-22 13:00:39 +03:00
[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:
@@ -18,9 +18,6 @@
|
||||
|
||||
.text
|
||||
.arch i386
|
||||
.section ".text16", "ax", @progbits
|
||||
.section ".data16", "aw", @progbits
|
||||
.section ".text16.data", "aw", @progbits
|
||||
.code16
|
||||
|
||||
#define SMAP 0x534d4150
|
||||
@@ -62,7 +59,7 @@
|
||||
*
|
||||
****************************************************************************
|
||||
*/
|
||||
.section ".data16"
|
||||
.section ".data16", "aw", @progbits
|
||||
.align 16
|
||||
.globl hidemem_base
|
||||
.globl hidemem_umalloc
|
||||
@@ -94,7 +91,7 @@ memory_windows_end:
|
||||
* %ecx:%ebx Length of windowed region
|
||||
****************************************************************************
|
||||
*/
|
||||
.section ".text16"
|
||||
.section ".text16", "ax", @progbits
|
||||
window_region:
|
||||
/* Convert (start,len) to (start, end) */
|
||||
addl %eax, %ebx
|
||||
@@ -132,7 +129,7 @@ window_region:
|
||||
* %ax Modified memory above 1M in 1kB blocks
|
||||
****************************************************************************
|
||||
*/
|
||||
.section ".text16"
|
||||
.section ".text16", "ax", @progbits
|
||||
patch_1m:
|
||||
pushal
|
||||
/* Convert to (start,len) format and call truncate */
|
||||
@@ -162,7 +159,7 @@ patch_1m:
|
||||
* %bx Modified memory above 16M in 64kB blocks
|
||||
****************************************************************************
|
||||
*/
|
||||
.section ".text16"
|
||||
.section ".text16", "ax", @progbits
|
||||
patch_16m:
|
||||
pushal
|
||||
/* Convert to (start,len) format and call truncate */
|
||||
@@ -193,7 +190,7 @@ patch_16m:
|
||||
* %bx Modified memory above 16MB, in 64kB blocks
|
||||
****************************************************************************
|
||||
*/
|
||||
.section ".text16"
|
||||
.section ".text16", "ax", @progbits
|
||||
patch_1m_16m:
|
||||
call patch_1m
|
||||
call patch_16m
|
||||
@@ -219,7 +216,7 @@ patch_1m_16m:
|
||||
*
|
||||
****************************************************************************
|
||||
*/
|
||||
.section ".text16"
|
||||
.section ".text16", "ax", @progbits
|
||||
get_underlying_e820:
|
||||
|
||||
/* If the requested region is in the cache, return it */
|
||||
@@ -308,22 +305,22 @@ get_underlying_e820:
|
||||
jmp get_underlying_e820
|
||||
.size get_underlying_e820, . - get_underlying_e820
|
||||
|
||||
.section ".data16"
|
||||
.section ".data16", "aw", @progbits
|
||||
underlying_e820_index:
|
||||
.word 0xffff /* Initialise to an invalid value */
|
||||
.size underlying_e820_index, . - underlying_e820_index
|
||||
|
||||
.section ".bss16"
|
||||
.section ".bss16", "aw", @nobits
|
||||
underlying_e820_ebx:
|
||||
.long 0
|
||||
.size underlying_e820_ebx, . - underlying_e820_ebx
|
||||
|
||||
.section ".bss16"
|
||||
.section ".bss16", "aw", @nobits
|
||||
underlying_e820_cache:
|
||||
.space E820MAXSIZE
|
||||
.size underlying_e820_cache, . - underlying_e820_cache
|
||||
|
||||
.section ".bss16"
|
||||
.section ".bss16", "aw", @nobits
|
||||
underlying_e820_cache_size:
|
||||
.long 0
|
||||
.size underlying_e820_cache_size, . - underlying_e820_cache_size
|
||||
@@ -342,7 +339,7 @@ underlying_e820_cache_size:
|
||||
*
|
||||
****************************************************************************
|
||||
*/
|
||||
.section ".text16"
|
||||
.section ".text16", "ax", @progbits
|
||||
get_windowed_e820:
|
||||
|
||||
/* Preserve registers */
|
||||
@@ -417,7 +414,7 @@ get_windowed_e820:
|
||||
*
|
||||
****************************************************************************
|
||||
*/
|
||||
.section ".text16"
|
||||
.section ".text16", "ax", @progbits
|
||||
get_nonempty_e820:
|
||||
|
||||
/* Record entry parameters */
|
||||
@@ -462,7 +459,7 @@ get_nonempty_e820:
|
||||
*
|
||||
****************************************************************************
|
||||
*/
|
||||
.section ".text16"
|
||||
.section ".text16", "ax", @progbits
|
||||
get_mangled_e820:
|
||||
|
||||
/* Get a nonempty region */
|
||||
@@ -496,7 +493,7 @@ get_mangled_e820:
|
||||
* INT 15,e820 handler
|
||||
****************************************************************************
|
||||
*/
|
||||
.section ".text16"
|
||||
.section ".text16", "ax", @progbits
|
||||
int15_e820:
|
||||
pushw %ds
|
||||
pushw %cs:rm_ds
|
||||
@@ -510,7 +507,7 @@ int15_e820:
|
||||
* INT 15,e801 handler
|
||||
****************************************************************************
|
||||
*/
|
||||
.section ".text16"
|
||||
.section ".text16", "ax", @progbits
|
||||
int15_e801:
|
||||
/* Call previous handler */
|
||||
pushfw
|
||||
@@ -536,7 +533,7 @@ int15_e801:
|
||||
* INT 15,88 handler
|
||||
****************************************************************************
|
||||
*/
|
||||
.section ".text16"
|
||||
.section ".text16", "ax", @progbits
|
||||
int15_88:
|
||||
/* Call previous handler */
|
||||
pushfw
|
||||
@@ -557,7 +554,7 @@ int15_88:
|
||||
* INT 15 handler
|
||||
****************************************************************************
|
||||
*/
|
||||
.section ".text16"
|
||||
.section ".text16", "ax", @progbits
|
||||
.globl int15
|
||||
int15:
|
||||
/* See if we want to intercept this call */
|
||||
@@ -580,7 +577,7 @@ int15:
|
||||
ljmp *%cs:int15_vector
|
||||
.size int15, . - int15
|
||||
|
||||
.section ".text16.data"
|
||||
.section ".text16.data", "aw", @progbits
|
||||
.globl int15_vector
|
||||
int15_vector:
|
||||
.long 0
|
||||
|
||||
Reference in New Issue
Block a user