]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[build] Fix building with newer binutils
authorMichael Brown <mcb30@ipxe.org>
Sun, 14 Jan 2024 12:12:18 +0000 (12:12 +0000)
committerMichael Brown <mcb30@ipxe.org>
Sun, 14 Jan 2024 12:16:02 +0000 (12:16 +0000)
Newer versions of the GNU assembler (observed with binutils 2.41) will
complain about the ".arch i386" in files assembled with "as --64",
with the message "Error: 64bit mode not supported on 'i386'".

In files such as stack.S that contain no instructions to be assembled,
the ".arch i386" is redundant and may be removed entirely.

In the remaining files, fix by moving ".arch i386" below the relevant
".code16" or ".code32" directive, so that the assembler is no longer
expecting 64-bit instructions to be used by the time that the ".arch
i386" directive is encountered.

Reported-by: Ali Mustakim <alim@forwardcomputers.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
24 files changed:
src/arch/i386/core/setjmp.S
src/arch/i386/tests/gdbstub_test.S
src/arch/x86/core/patch_cf.S
src/arch/x86/core/stack.S
src/arch/x86/core/stack16.S
src/arch/x86/drivers/net/undiisr.S
src/arch/x86/interface/pcbios/e820mangler.S
src/arch/x86/interface/pxe/pxe_entry.S
src/arch/x86/prefix/bootpart.S
src/arch/x86/prefix/dskprefix.S
src/arch/x86/prefix/exeprefix.S
src/arch/x86/prefix/hdprefix.S
src/arch/x86/prefix/libprefix.S
src/arch/x86/prefix/lkrnprefix.S
src/arch/x86/prefix/mbr.S
src/arch/x86/prefix/mromprefix.S
src/arch/x86/prefix/nbiprefix.S
src/arch/x86/prefix/nullprefix.S
src/arch/x86/prefix/pxeprefix.S
src/arch/x86/prefix/rawprefix.S
src/arch/x86/prefix/unlzma.S
src/arch/x86/prefix/usbdisk.S
src/arch/x86/transitions/liba20.S
src/arch/x86/transitions/libkir.S

index e0bbb7ef8518dc6de32b1460481642f3741aac82..cbb5e7138eeefe91aa5a14728f3b5de140dd342b 100644 (file)
@@ -2,8 +2,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 
        .section ".note.GNU-stack", "", @progbits
        .text
-       .arch i386
        .code32
+       .arch i386
 
        /* Must match jmp_buf structure layout */
        .struct 0
index e0c9e6c9a513a9978dde6ac69e8551e474125981..e44c13c2da01b168f8f85c903380c0426d3f8eab 100644 (file)
@@ -1,4 +1,5 @@
        .section ".note.GNU-stack", "", @progbits
+       .code32
        .arch i386
 
        .section ".data", "aw", @progbits
index ebf62876902c7b2abc5e96f967fa3dbe21970fff..62f19e45fe9535b7842d02db8f81488c938f478d 100644 (file)
@@ -23,8 +23,8 @@
 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 
        .section ".note.GNU-stack", "", @progbits
-       .arch i386
        .code16
+       .arch i386
 
 /****************************************************************************
  * Set/clear CF on the stack as appropriate, assumes stack is as it should
index 493453473c01f57ce9ec222690bbcf1c0c0ec29f..1bcaf18f849245b9ee05a7b8d0314d0e7279b1f1 100644 (file)
@@ -1,7 +1,6 @@
 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 
        .section ".note.GNU-stack", "", @progbits
-       .arch i386
 
 #ifdef __x86_64__
 #define STACK_SIZE 8192
index d3949a55797c6f86ee90a838533652a4a7ca641b..622887eab02cdcb7f8ffafb92ec7b57569c709ff 100644 (file)
@@ -1,7 +1,6 @@
 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 
        .section ".note.GNU-stack", "", @progbits
-       .arch i386
 
 /****************************************************************************
  * Internal stack
index aa8991d77bc492a5aced68e0af1a5d00934ef5c1..8ba5c53549bece8f1f0c793739630b4b7e0db3e7 100644 (file)
@@ -11,8 +11,8 @@ FILE_LICENCE ( GPL2_OR_LATER )
 #define PIC2_ICR 0xa0
        
        .section ".note.GNU-stack", "", @progbits
-       .arch i386
        .code16
+       .arch i386
 
        .section ".text16", "ax", @progbits
        .globl undiisr
index 40f84c70236c5c98c7cd6e2eb7e2200c55c1590b..ef5dc2754efe0fcecd6d7191a064ba091fc212a3 100644 (file)
@@ -24,8 +24,8 @@
 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 
        .section ".note.GNU-stack", "", @progbits
-       .arch i386
        .code16
+       .arch i386
 
 #define SMAP 0x534d4150
 
index 354dd1b35420e2b6f357ecedb89f8bbe1ddb5765..3899e1bcca56707d665629d4d5985cf921688225 100644 (file)
@@ -27,6 +27,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 #include <librm.h>
 
        .section ".note.GNU-stack", "", @progbits
+       .code16
        .arch i386
 
 /****************************************************************************
index cf75ff79359cd6ee8f0b03abe49b02685f4f31ad..7b9920fdbe9bbcb35bdc99b2c3f4fa089b2e7f0a 100644 (file)
@@ -6,9 +6,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 #define STACK_SIZE     0x2000
        
        .section ".note.GNU-stack", "", @progbits
+       .code16
        .arch i386
        .section ".prefix", "awx", @progbits
-       .code16
 
 /*
  * Find active partition
index f9d301956ae2d6abb664a2adc9f896a40d093dd6..e8e55ef1dc876a92642026ce923d88d2e7ace7bb 100644 (file)
@@ -26,9 +26,9 @@ FILE_LICENCE ( GPL2_ONLY )
 
        .section ".note.GNU-stack", "", @progbits
        .org    0
+       .code16
        .arch i386
        .section ".prefix", "ax", @progbits
-       .code16
        .globl  _dsk_start
 _dsk_start:
 
index 86333489a903c70d382f4b81ed9fe047fb2be74c..98ed6c5fbe9fc11c0bdbaf1588317a06d976cd55 100644 (file)
@@ -37,9 +37,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 #define PSP_CMDLINE_START 0x81
 
        .section ".note.GNU-stack", "", @progbits
+       .code16
        .arch i386
        .org 0
-       .code16
        .section ".prefix", "awx", @progbits
 
 signature:
index 1bbf72dd283c4926feb21154f2344105aebe4b3c..3133dec6c6d6e92c16043041cd2cf14f266d5c4f 100644 (file)
@@ -3,9 +3,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 #include <librm.h>
 
        .section ".note.GNU-stack", "", @progbits
+       .code16
        .arch i386
        .section ".prefix", "awx", @progbits
-       .code16
        .org 0
        .globl  _hd_start
 _hd_start:
index 380e471dddeb601f4d86913ef44a7d47b7edb02e..b08a5782fc179fcb9f64f3e39864dce1f3914aaf 100644 (file)
@@ -27,6 +27,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 #include <librm.h>
 
        .section ".note.GNU-stack", "", @progbits
+       .code16
        .arch i386
 
 /* Image compression enabled */
index 9f1a2f09bf147834160297a46f8750e863bfd158..c8a04c9d78eb73b7778d9b0e98a141328814a5de 100644 (file)
@@ -5,8 +5,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 #define BZI_LOAD_HIGH_ADDR 0x100000
 
        .section ".note.GNU-stack", "", @progbits
-       .arch i386
        .code16
+       .arch i386
        .section ".prefix", "ax", @progbits
        .globl  _lkrn_start
 _lkrn_start:
index b37eed714bfb38d8f0408c9218da9cfaba5ab346..5e0ed5ddb5c2ceca594f1f0bcbcb9ea683c42fcb 100644 (file)
@@ -1,9 +1,9 @@
 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 
        .section ".note.GNU-stack", "", @progbits
+       .code16
        .arch i386
        .section ".prefix", "awx", @progbits
-       .code16
        .org 0
 
        .globl mbr
index 543fd006ab706ffd21507ffdfad85b6320ade4d7..d05278e64cd27ec435208f894c8d778e2c0c5d8f 100644 (file)
@@ -42,8 +42,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 #include "pciromprefix.S"
 
        .section ".note.GNU-stack", "", @progbits
-       .arch i386
        .code16
+       .arch i386
 
 /* Obtain access to payload by exposing the expansion ROM BAR at the
  * address currently used by a suitably large memory BAR on the same
index 0a74ca718e2a8a546558cfb96d5d8e75d8a8acd0..bbacd4b7b86c86a2f2c390d094eee007c7111efb 100644 (file)
@@ -3,8 +3,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 #include <librm.h>
 
        .section ".note.GNU-stack", "", @progbits
-       .arch i386
        .code16
+       .arch i386
        .section ".prefix", "ax", @progbits
        .org 0
 
index bbc697fd292f0427fb4d8bd7e93b4b810529e6a1..426f1f2ce4e4d88c600b3dab3b5425894fc87c0d 100644 (file)
@@ -2,10 +2,10 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 
        .section ".note.GNU-stack", "", @progbits
        .org    0
+       .code16
        .arch i386
 
        .section ".prefix", "ax", @progbits
-       .code16
 _prefix:
 
        .section ".text16", "ax", @progbits
index c62a5011755ce6b4f8a790474ae043feb0307a18..5181ef6184516cc6773da0dc21c9e9d00c9c6d22 100644 (file)
@@ -12,9 +12,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 #define PXE_HACK_EB54                  0x0001
 
        .section ".note.GNU-stack", "", @progbits
+       .code16
        .arch i386
        .org 0
-       .code16
 
 #include <librm.h>
 #include <undi.h>
index d97b3b512bc743506a05a470ec64fd8295938a21..962c97187806db65b86ea0e5ec91137a8398d8bf 100644 (file)
@@ -9,9 +9,9 @@
 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 
        .section ".note.GNU-stack", "", @progbits
+       .code16
        .arch i386
        .org 0
-       .code16
 
 #include <librm.h>
 
index 4059090b96b6dfea21192d3b4ee1babb357b4fb4..e4d1e190d0350c76a2132c5172901e0630239896 100644 (file)
@@ -44,6 +44,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  */
 
        .section ".note.GNU-stack", "", @progbits
+       .code32
        .arch i486
        .section ".prefix.lib", "ax", @progbits
 
index b8fc5e950c8297973c2a18457de5e74de6078a21..11ab6a46a69e6185c417343bed77cecbfc9e0119 100644 (file)
@@ -3,9 +3,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 #include <config/console.h>
 
        .section ".note.GNU-stack", "", @progbits
+       .code16
        .arch i386
        .section ".prefix", "awx", @progbits
-       .code16
        .org 0
 
 #include "mbr.S"
index 6c1bac672e10ca81ef16cec3cd8fb26fc1e60ea0..971cff226a6c5c9a74975563a21728ed71011cca 100644 (file)
@@ -25,6 +25,7 @@
 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 
        .section ".note.GNU-stack", "", @progbits
+       .code16
        .arch i386
 
 /****************************************************************************
index 5909654c2fa07c0ff20fafe00b6a2b008ad9d504..2c4dc948b477462c553735a2a7ad13250160ee5f 100644 (file)
@@ -32,9 +32,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
 #define BOCHSBP xchgw %bx, %bx
 
        .section ".note.GNU-stack", "", @progbits
+       .code16
        .arch i386
        .section ".text16", "awx", @progbits
-       .code16
        
 /****************************************************************************
  * init_libkir (real-mode or 16:xx protected-mode far call)