Revert "build: Workaround to more explicitly specify output section types"
This reverts commit b87ac911d90974cde675613dfe00f059d3eeec9e.
diff --git a/common/common.mk b/common/common.mk
index 2e8bd0e5..788a3acc 100644
--- a/common/common.mk
+++ b/common/common.mk
@@ -229,61 +229,61 @@ endif
ifeq ($(TARGET),bios)
override C_FILES := $(shell cd .. && find common flanterm/src libfdt/src -type f -name '*.c' | LC_ALL=C sort)
- override S_FILES := $(shell cd .. && find common -type f -name '*.S' ! -name 'section_type_markers.*' | LC_ALL=C sort)
+ override S_FILES := $(shell cd .. && find common -type f -name '*.S' | LC_ALL=C sort)
override ASMX86_FILES := $(shell cd .. && find common -type f -name '*.asm_x86' | LC_ALL=C sort)
override ASM32_FILES := $(shell cd .. && find common -type f -name '*.asm_ia32' | LC_ALL=C sort)
override ASMB_FILES := $(shell cd .. && find common -type f -name '*.asm_bios_ia32' | LC_ALL=C sort)
- override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, common/section_type_markers.s2.o common/section_type_markers.o $(C_FILES:.c=.o) $(S_FILES:.S=.o) $(ASM32_FILES:.asm_ia32=.o) $(ASMB_FILES:.asm_bios_ia32=.o) $(ASMX86_FILES:.asm_x86=.o))
+ override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.o) $(S_FILES:.S=.o) $(ASM32_FILES:.asm_ia32=.o) $(ASMB_FILES:.asm_bios_ia32=.o) $(ASMX86_FILES:.asm_x86=.o))
override OBJ_S2 := $(filter %.s2.o,$(OBJ))
endif
ifeq ($(TARGET),uefi-x86-64)
override C_FILES := $(shell cd .. && find common nyu-efi/x86_64 flanterm/src libfdt/src -type f -name '*.c' | LC_ALL=C sort)
- override S_FILES := $(shell cd .. && find common nyu-efi/x86_64 -type f -name '*.S' ! -name 'section_type_markers.*' | LC_ALL=C sort)
+ override S_FILES := $(shell cd .. && find common nyu-efi/x86_64 -type f -name '*.S' | LC_ALL=C sort)
override ASMX86_FILES := $(shell cd .. && find common -type f -name '*.asm_x86' | LC_ALL=C sort)
override ASM64_FILES := $(shell cd .. && find common -type f -name '*.asm_x86_64' | LC_ALL=C sort)
override ASM64U_FILES := $(shell cd .. && find common -type f -name '*.asm_uefi_x86_64' | LC_ALL=C sort)
- override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, common/section_type_markers.o $(C_FILES:.c=.o) $(S_FILES:.S=.o) $(ASM64_FILES:.asm_x86_64=.o) $(ASM64U_FILES:.asm_uefi_x86_64=.o) $(ASMX86_FILES:.asm_x86=.o))
+ override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.o) $(S_FILES:.S=.o) $(ASM64_FILES:.asm_x86_64=.o) $(ASM64U_FILES:.asm_uefi_x86_64=.o) $(ASMX86_FILES:.asm_x86=.o))
endif
ifeq ($(TARGET),uefi-ia32)
override C_FILES := $(shell cd .. && find common nyu-efi/ia32 flanterm/src libfdt/src -type f -name '*.c' | LC_ALL=C sort)
- override S_FILES := $(shell cd .. && find common nyu-efi/ia32 -type f -name '*.S' ! -name 'section_type_markers.*' | LC_ALL=C sort)
+ override S_FILES := $(shell cd .. && find common nyu-efi/ia32 -type f -name '*.S' | LC_ALL=C sort)
override ASMX86_FILES := $(shell cd .. && find common -type f -name '*.asm_x86' | LC_ALL=C sort)
override ASM32_FILES := $(shell cd .. && find common -type f -name '*.asm_ia32' | LC_ALL=C sort)
override ASM32U_FILES := $(shell cd .. && find common -type f -name '*.asm_uefi_ia32' | LC_ALL=C sort)
- override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, common/section_type_markers.o $(C_FILES:.c=.o) $(S_FILES:.S=.o) $(ASM32_FILES:.asm_ia32=.o) $(ASM32U_FILES:.asm_uefi_ia32=.o) $(ASMX86_FILES:.asm_x86=.o))
+ override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.o) $(S_FILES:.S=.o) $(ASM32_FILES:.asm_ia32=.o) $(ASM32U_FILES:.asm_uefi_ia32=.o) $(ASMX86_FILES:.asm_x86=.o))
endif
ifeq ($(TARGET),uefi-aarch64)
override C_FILES := $(shell cd .. && find common nyu-efi/aarch64 flanterm/src libfdt/src -type f -name '*.c' | LC_ALL=C sort)
- override S_FILES := $(shell cd .. && find common nyu-efi/aarch64 -type f -name '*.S' ! -name 'section_type_markers.*' | LC_ALL=C sort)
+ override S_FILES := $(shell cd .. && find common nyu-efi/aarch64 -type f -name '*.S' | LC_ALL=C sort)
override ASM64_FILES := $(shell cd .. && find common -type f -name '*.asm_aarch64' | LC_ALL=C sort)
override ASM64U_FILES := $(shell cd .. && find common -type f -name '*.asm_uefi_aarch64' | LC_ALL=C sort)
- override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, common/section_type_markers.o $(C_FILES:.c=.o) $(S_FILES:.S=.o) $(ASM64_FILES:.asm_aarch64=.o) $(ASM64U_FILES:.asm_uefi_aarch64=.o))
+ override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.o) $(S_FILES:.S=.o) $(ASM64_FILES:.asm_aarch64=.o) $(ASM64U_FILES:.asm_uefi_aarch64=.o))
endif
ifeq ($(TARGET),uefi-riscv64)
override C_FILES := $(shell cd .. && find common nyu-efi/riscv64 flanterm/src libfdt/src -type f -name '*.c' | LC_ALL=C sort)
- override S_FILES := $(shell cd .. && find common nyu-efi/riscv64 -type f -name '*.S' ! -name 'section_type_markers.*' | LC_ALL=C sort)
+ override S_FILES := $(shell cd .. && find common nyu-efi/riscv64 -type f -name '*.S' | LC_ALL=C sort)
override ASM64_FILES := $(shell cd .. && find common -type f -name '*.asm_riscv64' | LC_ALL=C sort)
override ASM64U_FILES := $(shell cd .. && find common -type f -name '*.asm_uefi_riscv64' | LC_ALL=C sort)
- override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, common/section_type_markers.o $(C_FILES:.c=.o) $(S_FILES:.S=.o) $(ASM64_FILES:.asm_riscv64=.o) $(ASM64U_FILES:.asm_uefi_riscv64=.o))
+ override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.o) $(S_FILES:.S=.o) $(ASM64_FILES:.asm_riscv64=.o) $(ASM64U_FILES:.asm_uefi_riscv64=.o))
endif
ifeq ($(TARGET),uefi-loongarch64)
override C_FILES := $(shell cd .. && find common nyu-efi/loongarch64 flanterm/src libfdt/src -type f -name '*.c' | LC_ALL=C sort)
- override S_FILES := $(shell cd .. && find common nyu-efi/loongarch64 -type f -name '*.S' ! -name 'section_type_markers.*' | LC_ALL=C sort)
+ override S_FILES := $(shell cd .. && find common nyu-efi/loongarch64 -type f -name '*.S' | LC_ALL=C sort)
override ASM64_FILES := $(shell cd .. && find common -type f -name '*.asm_loongarch64' | LC_ALL=C sort)
override ASM64U_FILES := $(shell cd .. && find common -type f -name '*.asm_uefi_loongarch64' | LC_ALL=C sort)
- override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, common/section_type_markers.o $(C_FILES:.c=.o) $(S_FILES:.S=.o) $(ASM64_FILES:.asm_loongarch64=.o) $(ASM64U_FILES:.asm_uefi_loongarch64=.o))
+ override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.o) $(S_FILES:.S=.o) $(ASM64_FILES:.asm_loongarch64=.o) $(ASM64U_FILES:.asm_uefi_loongarch64=.o))
endif
override HEADER_DEPS := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.d) $(C_FILES:.S=.d))
diff --git a/common/linker_bios.ld.in b/common/linker_bios.ld.in
index 9c0141dd..4c90b986 100644
--- a/common/linker_bios.ld.in
+++ b/common/linker_bios.ld.in
@@ -16,16 +16,12 @@ SECTIONS
. = 0xf000;
.text.stage2 : {
- KEEP(*(.text_type_marker_s2))
-
*(.entry)
*(.realmode)
*.s2.o(.text .text.*)
} :text_s2
.rodata.stage2 : {
- KEEP(*(.rodata_type_marker_s2))
-
*.s2.o(.rodata .rodata.*)
build_id_s2 = .;
@@ -59,8 +55,6 @@ SECTIONS
} :rodata_s2
.data.stage2 : {
- KEEP(*(.data_type_marker_s2))
-
s2_data_begin = .;
*.s2.o(.data .data.*)
s2_data_end = .;
@@ -70,15 +64,11 @@ SECTIONS
#ifndef LINKER_STAGE2ONLY
.text.stage3 : {
- KEEP(*(.text_type_marker))
-
stage3_addr = .;
*(.text .text.*)
} :text_s3
.rodata.stage3 : {
- KEEP(*(.rodata_type_marker))
-
*(.rodata .rodata.*)
build_id_s3 = .;
@@ -92,8 +82,6 @@ SECTIONS
} :rodata_s3
.data.stage3 : {
- KEEP(*(.data_type_marker))
-
data_begin = .;
*(.data .data.*)
data_end = .;
diff --git a/common/linker_uefi_aarch64.ld.in b/common/linker_uefi_aarch64.ld.in
index 5ad15312..e6bcb2ab 100644
--- a/common/linker_uefi_aarch64.ld.in
+++ b/common/linker_uefi_aarch64.ld.in
@@ -17,8 +17,6 @@ SECTIONS
__image_size = ABSOLUTE(__image_end - __image_base);
.text : {
- KEEP(*(.text_type_marker))
-
KEEP(*(.pe_header))
. = ALIGN(0x1000);
@@ -32,8 +30,6 @@ SECTIONS
__text_size = ABSOLUTE(__text_end - __text_start);
.rodata : {
- KEEP(*(.rodata_type_marker))
-
__reloc_start = ABSOLUTE(.);
*(.dummy_reloc)
@@ -52,8 +48,6 @@ SECTIONS
} :rodata
.data : {
- KEEP(*(.data_type_marker))
-
data_begin = .;
*(.data .data.*)
*(.bss .bss.*)
diff --git a/common/linker_uefi_ia32.ld.in b/common/linker_uefi_ia32.ld.in
index 057426fc..a1133359 100644
--- a/common/linker_uefi_ia32.ld.in
+++ b/common/linker_uefi_ia32.ld.in
@@ -17,8 +17,6 @@ SECTIONS
__image_size = ABSOLUTE(__image_end - __image_base);
.text : {
- KEEP(*(.text_type_marker))
-
KEEP(*(.pe_header))
. = ALIGN(0x1000);
@@ -32,8 +30,6 @@ SECTIONS
__text_size = ABSOLUTE(__text_end - __text_start);
.rodata : {
- KEEP(*(.rodata_type_marker))
-
__reloc_start = ABSOLUTE(.);
*(.dummy_reloc)
@@ -52,8 +48,6 @@ SECTIONS
} :rodata
.data : {
- KEEP(*(.data_type_marker))
-
data_begin = .;
*(.data .data.*)
*(.bss .bss.*)
diff --git a/common/linker_uefi_loongarch64.ld.in b/common/linker_uefi_loongarch64.ld.in
index 02d02add..fbc9ba56 100644
--- a/common/linker_uefi_loongarch64.ld.in
+++ b/common/linker_uefi_loongarch64.ld.in
@@ -17,8 +17,6 @@ SECTIONS
__image_size = ABSOLUTE(__image_end - __image_base);
.text : {
- KEEP(*(.text_type_marker))
-
KEEP(*(.pe_header))
. = ALIGN(0x1000);
@@ -32,8 +30,6 @@ SECTIONS
__text_size = ABSOLUTE(__text_end - __text_start);
.rodata : {
- KEEP(*(.rodata_type_marker))
-
__reloc_start = ABSOLUTE(.);
*(.dummy_reloc)
@@ -52,8 +48,6 @@ SECTIONS
} :rodata
.data : {
- KEEP(*(.data_type_marker))
-
data_begin = .;
*(.data .data.*)
*(.bss .bss.*)
diff --git a/common/linker_uefi_riscv64.ld.in b/common/linker_uefi_riscv64.ld.in
index c36a6870..55f2a9c6 100644
--- a/common/linker_uefi_riscv64.ld.in
+++ b/common/linker_uefi_riscv64.ld.in
@@ -17,8 +17,6 @@ SECTIONS
__image_size = ABSOLUTE(__image_end - __image_base);
.text : {
- KEEP(*(.text_type_marker))
-
KEEP(*(.pe_header))
. = ALIGN(0x1000);
@@ -32,8 +30,6 @@ SECTIONS
__text_size = ABSOLUTE(__text_end - __text_start);
.rodata : {
- KEEP(*(.rodata_type_marker))
-
__reloc_start = ABSOLUTE(.);
*(.dummy_reloc)
@@ -52,8 +48,6 @@ SECTIONS
} :rodata
.data : {
- KEEP(*(.data_type_marker))
-
data_begin = .;
*(.data .data.*)
*(.sdata .sdata.*)
diff --git a/common/linker_uefi_x86_64.ld.in b/common/linker_uefi_x86_64.ld.in
index e77c6a79..0176a510 100644
--- a/common/linker_uefi_x86_64.ld.in
+++ b/common/linker_uefi_x86_64.ld.in
@@ -17,8 +17,6 @@ SECTIONS
__image_size = ABSOLUTE(__image_end - __image_base);
.text : {
- KEEP(*(.text_type_marker))
-
KEEP(*(.pe_header))
. = ALIGN(0x1000);
@@ -32,8 +30,6 @@ SECTIONS
__text_size = ABSOLUTE(__text_end - __text_start);
.rodata : {
- KEEP(*(.rodata_type_marker))
-
__reloc_start = ABSOLUTE(.);
*(.dummy_reloc)
@@ -52,8 +48,6 @@ SECTIONS
} :rodata
.data : {
- KEEP(*(.data_type_marker))
-
data_begin = .;
*(.data .data.*)
*(.bss .bss.*)
diff --git a/common/section_type_markers.S b/common/section_type_markers.S
deleted file mode 100644
index b51566ff..00000000
--- a/common/section_type_markers.S
+++ /dev/null
@@ -1,7 +0,0 @@
-// These are hard to explain, but they are basically used to set the output section
-// type, as there is no standard, reliable, or even existing way to do so within the
-// linker script. This is mostly for ld.gold.
-
-.section .text_type_marker,"ax",%progbits
-.section .rodata_type_marker,"a",%progbits
-.section .data_type_marker,"wa",%progbits
diff --git a/common/section_type_markers.s2.S b/common/section_type_markers.s2.S
deleted file mode 100644
index 540b5699..00000000
--- a/common/section_type_markers.s2.S
+++ /dev/null
@@ -1,5 +0,0 @@
-// Same as section_type_markers.S, but for BIOS stage2.
-
-.section .text_type_marker_s2,"ax",%progbits
-.section .rodata_type_marker_s2,"a",%progbits
-.section .data_type_marker_s2,"wa",%progbits
