mirror of
https://github.com/DarkStore-3DS/buildtools.git
synced 2026-07-02 16:59:06 +00:00
Add Switch build support, clean up and document variables.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
[default]
|
||||
name=Default
|
||||
runtime=host
|
||||
config-opts=
|
||||
run-opts=
|
||||
prefix=/home/steven/.cache/gnome-builder/install/buildtools/host
|
||||
app-id=
|
||||
postbuild=
|
||||
prebuild=
|
||||
default=true
|
||||
@@ -1,10 +1,99 @@
|
||||
# Make Variables
|
||||
#
|
||||
# TARGET: Optional; Platform to build for.
|
||||
# - Supported values: NATIVE, NATIVE32, NATIVE64, WIN32, WIN64, MAC32, MAC64, LINUX32, LINUX64, 3DS, WIIU, SWITCH
|
||||
# - Default value: NATIVE
|
||||
# LIBRARY: Optional; Whether to output a library.
|
||||
# - Supported values: 0, 1
|
||||
# - Default value: 0
|
||||
#
|
||||
# All:
|
||||
# - NAME: Project name.
|
||||
# - INCLUDE_DIRS: Directories containing include headers.
|
||||
# - SOURCE_DIRS: Directories containing source files to compile.
|
||||
# - BUILD_DIR: Directory to store build files in.
|
||||
# - OUTPUT_DIR: Directory to output the final results to.
|
||||
# - LIBRARY_DIRS: Optional; Directories containing libraries to compile against.
|
||||
# - LIBRARIES: Optional; Libraries to compile against.
|
||||
# - EXTRA_OUTPUT_FILES: Optional; Extra files to copy to the output directory.
|
||||
# - BUILD_FLAGS: Optional; Shared build flags.
|
||||
# - BUILD_FLAGS_CC: Optional; C build flags.
|
||||
# - BUILD_FLAGS_CXX: Optional; C++ build flags.
|
||||
# - RUN_FLAGS: Optional; Flags to pass when running output executables.
|
||||
# - VERSION_MAJOR: Optional; Major version number.
|
||||
# - Default value: 0
|
||||
# - VERSION_MINOR: Optional; Minor version number.
|
||||
# - Default value: 0
|
||||
# - VERSION_MICRO: Optional; Micro version number.
|
||||
# - Default value: 0
|
||||
#
|
||||
# 3DS/Wii U/Switch:
|
||||
# - TITLE: Optional; Formal application title, used in metadata.
|
||||
# - Default value: NAME stripped of spaces.
|
||||
# - AUTHOR: Optional; Application author.
|
||||
# - Default value: "Unknown"
|
||||
# - REMOTE_IP: Optional; IP to send executable to when running on hardware. Intended to be set in command line.
|
||||
# - Default value: 127.0.0.1
|
||||
#
|
||||
# 3DS/Wii U:
|
||||
# - DESCRIPTION: Optional; Application description.
|
||||
# - Default value: "No description."
|
||||
#
|
||||
# 3DS:
|
||||
# - PRODUCT_CODE: CIA/3DS product code.
|
||||
# - UNIQUE_ID: CIA/3DS unique ID.
|
||||
# - BANNER_AUDIO: Audio file to use in the CIA/3DS banner.
|
||||
# - Supported file types: WAV, CWAV
|
||||
# - BANNER_IMAGE: Graphics to use in the CIA/3DS banner.
|
||||
# - Supported file types: 256x128 PNG, CGFX
|
||||
# - ICON: Application icon.
|
||||
# - Supported file types: 48x48 PNG
|
||||
# - Category: Optional; CIA/3DS category.
|
||||
# - Supported values: Application, SystemApplication, Applet, Firmware, Base, DlpChild, Demo, Contents, SystemContents, SharedContents, AddOnContents, Patch, AutoUpdateContents
|
||||
# - Default value: Application
|
||||
# - USE_ON_SD: Optional; Whether the CIA/3DS should be installed to the SD card.
|
||||
# - Supported values: true, false
|
||||
# - Default value: true
|
||||
# - MEMORY_TYPE: Optional; CIA/3DS application memory layout.
|
||||
# - Supported values: Application, System, Base
|
||||
# - Default value: Application
|
||||
# - SYSTEM_MODE: Optional; CIA/3DS legacy system mode.
|
||||
# - Supported values: 32MB, 64MB, 72MB, 80MB, 96MB
|
||||
# - Default value: 64MB
|
||||
# - SYSTEM_MODE_EXT: Optional; CIA/3DS extended system mode.
|
||||
# - Supported values: Legacy, 124MB, 178MB
|
||||
# - Default value: Legacy
|
||||
# - CPU_MODE: Optional; CIA/3DS CPU frequency. 804MHz is N3DS-only.
|
||||
# - Supported values: 268MHz, 804MHz
|
||||
# - Default value: 268MHz
|
||||
# - ENABLE_L2_CACHE: Optional; Whether the CIA/3DS should use the N3DS L2 cache.
|
||||
# - Supported values: true, false
|
||||
# - Default value: false
|
||||
# - ICON_FLAGS: Optional; Flags to pass to bannertool when making an SMDH icon.
|
||||
# - ROMFS_DIR: Optional; Directory containing RomFS files.
|
||||
# - LOGO: Optional; Logo animation to use when launching the CIA/3DS.
|
||||
# - Supported file types: BCMA.LZ
|
||||
#
|
||||
# Wii U:
|
||||
# - ICON: Application icon.
|
||||
# - Supported file types: 256x96 PNG
|
||||
# - LONG_DESCRIPTION: Optional; Long version of the description field.
|
||||
# - Default value: Value of DESCRIPTION.
|
||||
#
|
||||
# Switch:
|
||||
# - TITLE_ID: Optional; Application title ID.
|
||||
# - ICON: Optional; Application icon.
|
||||
# - Supported file types: 256x256 JPEG
|
||||
|
||||
# PROLOGUE #
|
||||
|
||||
TARGET ?= NATIVE
|
||||
LIBRARY ?= 0
|
||||
|
||||
ALL_PC_TARGETS := WIN32 WIN64 MAC32 MAC64 LINUX32 LINUX64
|
||||
ALL_SPECIFIC_TARGETS := $(ALL_PC_TARGETS) 3DS WIIU
|
||||
ALL_SPECIFIC_TARGETS := $(ALL_PC_TARGETS) 3DS WIIU SWITCH
|
||||
ALL_TARGETS := NATIVE NATIVE32 NATIVE64 $(ALL_SPECIFIC_TARGETS)
|
||||
|
||||
TARGET ?= NATIVE
|
||||
TARGETS :=
|
||||
|
||||
ifneq (1,$(words $(TARGET)))
|
||||
@@ -27,21 +116,27 @@ ifneq ($(MAKECMDGOALS),clean)
|
||||
$(info Building for $(TARGET)...)
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET),$(filter $(TARGET),3DS WIIU))
|
||||
ifeq ($(TARGET),$(filter $(TARGET),3DS WIIU SWITCH))
|
||||
ifeq ($(strip $(DEVKITPRO)),)
|
||||
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPro")
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET),3DS)
|
||||
ifeq ($(strip $(DEVKITARM)),)
|
||||
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
||||
ifeq ("$(wildcard $(DEVKITARM))","")
|
||||
$(error "Please set a valid DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET),WIIU)
|
||||
ifeq ($(strip $(DEVKITPPC)),)
|
||||
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
|
||||
ifeq ("$(wildcard $(DEVKITPPC))","")
|
||||
$(error "Please set a valid DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET),SWITCH)
|
||||
ifeq ("$(wildcard $(DEVKITA64))","")
|
||||
$(error "Please set a valid DEVKITA64 in your environment. export DEVKITA64=<path to>devkitA64")
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -128,6 +223,9 @@ else ifeq ($(TARGET),3DS)
|
||||
else ifeq ($(TARGET),WIIU)
|
||||
TARGET_OS := wiiu
|
||||
TARGET_ARCH := ppc
|
||||
else ifeq ($(TARGET),SWITCH)
|
||||
TARGET_OS := switch
|
||||
TARGET_ARCH := aarch64
|
||||
else
|
||||
$(error "Unknown target. Supported targets: $(ALL_TARGETS)")
|
||||
endif
|
||||
@@ -165,6 +263,7 @@ endif
|
||||
|
||||
LD_FLAGS := $(patsubst %,-L%/lib,$(LIBRARY_DIRS)) $(patsubst %,-l%,$(LIBRARIES))
|
||||
COMMON_CC_FLAGS := $(sort $(foreach dir,$(SOURCE_DIRS),$(patsubst %,-I$(TARGET_BUILD_DIR)/%,$(dir $(call rwildcard,$(dir),*))))) $(patsubst %,-I%,$(INCLUDE_DIRS)) $(patsubst %,-I%/include,$(LIBRARY_DIRS)) -g -Wall -DVERSION_MAJOR=$(VERSION_MAJOR) -DVERSION_MINOR=$(VERSION_MINOR) -DVERSION_MICRO=$(VERSION_MICRO) $(BUILD_FLAGS)
|
||||
COMMON_CXX_FLAGS :=
|
||||
|
||||
ifeq ($(findstring -O,$(BUILD_FLAGS)),)
|
||||
COMMON_CC_FLAGS += -O2
|
||||
@@ -179,6 +278,13 @@ endif
|
||||
|
||||
# TARGET SETUP #
|
||||
|
||||
REMOTE_IP ?= 127.0.0.1 # User-defined
|
||||
|
||||
TITLE ?= $(NAME)
|
||||
AUTHOR ?= "Unknown"
|
||||
DESCRIPTION ?= "No description."
|
||||
LONG_DESCRIPTION ?= $(DESCRIPTION)
|
||||
|
||||
ifeq ($(TARGET_OS),windows)
|
||||
ifeq ($(HOST_OS),windows)
|
||||
AR := ar
|
||||
@@ -282,23 +388,11 @@ else ifeq ($(TARGET_OS),3ds)
|
||||
|
||||
OBJECT_FILES := $(filter-out $(BUILT_FILTER),$(OBJECT_FILES))
|
||||
|
||||
REMOTE_IP ?= 127.0.0.1 # User-defined
|
||||
|
||||
TITLE ?= $(NAME)
|
||||
|
||||
CATEGORY ?= Application
|
||||
USE_ON_SD ?= true
|
||||
MEMORY_TYPE ?= Application
|
||||
CPU_SPEED ?= 268MHz
|
||||
ENABLE_L2_CACHE ?= true
|
||||
|
||||
AR := $(DEVKITARM)/bin/arm-none-eabi-ar
|
||||
AS := $(DEVKITARM)/bin/arm-none-eabi-as
|
||||
CC := $(DEVKITARM)/bin/arm-none-eabi-gcc
|
||||
CXX := $(DEVKITARM)/bin/arm-none-eabi-g++
|
||||
|
||||
SERVEFILES := python $(BUILDTOOLS_DIR)/3ds/servefiles.py
|
||||
|
||||
ifeq ($(LIBRARY),1)
|
||||
OUTPUT_FILES := $(TARGET_OUTPUT_DIR)/lib/$(STRIPPED_NAME).a
|
||||
else
|
||||
@@ -308,6 +402,16 @@ else ifeq ($(TARGET_OS),3ds)
|
||||
LD_FLAGS += -specs=3dsx.specs
|
||||
COMMON_CC_FLAGS += -mword-relocations -ffast-math -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -DARM11 -D_3DS
|
||||
|
||||
SERVEFILES := python $(BUILDTOOLS_DIR)/3ds/servefiles.py
|
||||
|
||||
CATEGORY ?= Application
|
||||
USE_ON_SD ?= true
|
||||
MEMORY_TYPE ?= Application
|
||||
SYSTEM_MODE ?= 64MB
|
||||
SYSTEM_MODE_EXT ?= Legacy
|
||||
CPU_SPEED ?= 268MHz
|
||||
ENABLE_L2_CACHE ?= false
|
||||
|
||||
_3DSXTOOL_FLAGS :=
|
||||
COMMON_MAKEROM_FLAGS := -rsf $(BUILDTOOLS_DIR)/3ds/template.rsf -target t -exefslogo -icon $(TARGET_BUILD_DIR)/icon.icn -banner $(TARGET_BUILD_DIR)/banner.bnr -major $(VERSION_MAJOR) -minor $(VERSION_MINOR) -micro $(VERSION_MICRO) -DAPP_TITLE="$(TITLE)" -DAPP_PRODUCT_CODE="$(PRODUCT_CODE)" -DAPP_UNIQUE_ID="$(UNIQUE_ID)" -DAPP_SYSTEM_MODE="$(SYSTEM_MODE)" -DAPP_SYSTEM_MODE_EXT="$(SYSTEM_MODE_EXT)" -DAPP_CATEGORY="$(CATEGORY)" -DAPP_USE_ON_SD="$(USE_ON_SD)" -DAPP_MEMORY_TYPE="$(MEMORY_TYPE)" -DAPP_CPU_SPEED="$(CPU_SPEED)" -DAPP_ENABLE_L2_CACHE="$(ENABLE_L2_CACHE)" -DAPP_VERSION_MAJOR="$(VERSION_MAJOR)"
|
||||
|
||||
@@ -334,15 +438,11 @@ else ifeq ($(TARGET_OS),3ds)
|
||||
BANNER_AUDIO_ARG := -a
|
||||
endif
|
||||
else ifeq ($(TARGET_OS),wiiu)
|
||||
REMOTE_IP ?= 127.0.0.1 # User-defined
|
||||
|
||||
AR := $(DEVKITPPC)/bin/powerpc-eabi-ar
|
||||
AS := $(DEVKITPPC)/bin/powerpc-eabi-as
|
||||
CC := $(DEVKITPPC)/bin/powerpc-eabi-gcc
|
||||
CXX := $(DEVKITPPC)/bin/powerpc-eabi-g++
|
||||
|
||||
WIILOAD_BIN := $(DEVKITPPC)/bin/wiiload
|
||||
|
||||
ifeq ($(LIBRARY),1)
|
||||
OUTPUT_FILES := $(TARGET_OUTPUT_DIR)/lib/$(STRIPPED_NAME).a
|
||||
else
|
||||
@@ -351,6 +451,33 @@ else ifeq ($(TARGET_OS),wiiu)
|
||||
|
||||
LD_FLAGS += -Wl,-d,--gc-sections
|
||||
COMMON_CC_FLAGS += -mwup -mcpu=750 -meabi -mhard-float -ffast-math -DESPRESSO -DWIIU
|
||||
else ifeq ($(TARGET_OS),switch)
|
||||
AR := $(DEVKITA64)/bin/aarch64-none-elf-ar
|
||||
AS := $(DEVKITA64)/bin/aarch64-none-elf-as
|
||||
CC := $(DEVKITA64)/bin/aarch64-none-elf-gcc
|
||||
CXX := $(DEVKITA64)/bin/aarch64-none-elf-g++
|
||||
|
||||
ifeq ($(LIBRARY),1)
|
||||
OUTPUT_FILES := $(TARGET_OUTPUT_DIR)/lib/$(STRIPPED_NAME).a
|
||||
else
|
||||
OUTPUT_FILES := $(TARGET_OUTPUT_DIR)/$(STRIPPED_NAME).elf $(TARGET_OUTPUT_DIR)/switch/$(STRIPPED_NAME).nro
|
||||
endif
|
||||
|
||||
LD_FLAGS += -specs=$(DEVKITPRO)/libnx/switch.specs
|
||||
COMMON_CC_FLAGS += -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -D__SWITCH__
|
||||
COMMON_CXX_FLAGS += -fno-rtti -fno-exceptions
|
||||
|
||||
NRO_FLAGS :=
|
||||
|
||||
ifneq ("$(wildcard $(ICON))","")
|
||||
NRO_FLAGS += --icon=$(ICON)
|
||||
endif
|
||||
|
||||
NACP_FLAGS :=
|
||||
|
||||
ifneq ($(TITLE_ID),)
|
||||
NACP_FLAGS += --titleid=$(TITLE_ID)
|
||||
endif
|
||||
endif
|
||||
|
||||
# FINAL COMMON SETUP #
|
||||
@@ -368,10 +495,10 @@ ifeq ($(CLANG_CXX_EXISTS),0)
|
||||
endif
|
||||
|
||||
CC_FLAGS := $(COMMON_CC_FLAGS) $(BUILD_FLAGS_CC)
|
||||
CXX_FLAGS := $(COMMON_CC_FLAGS) $(BUILD_FLAGS_CXX)
|
||||
CXX_FLAGS := $(COMMON_CC_FLAGS) $(COMMON_CXX_FLAGS) $(BUILD_FLAGS_CXX)
|
||||
|
||||
ifeq ($(findstring -std,$(BUILD_FLAGS_CC)),)
|
||||
CC_FLAGS += -std=gnu99
|
||||
CC_FLAGS += -std=gnu11
|
||||
endif
|
||||
|
||||
ifeq ($(findstring -std,$(BUILD_FLAGS_CXX)),)
|
||||
@@ -478,7 +605,7 @@ else
|
||||
|
||||
runhw: $(OUTPUT_ZIP_FILE)
|
||||
@echo "Running..."
|
||||
@WIILOAD=tcp:$(REMOTE_IP) $(WIILOAD_BIN) $(TARGET_OUTPUT_DIR)/wiiu/apps/$(STRIPPED_NAME)/$(STRIPPED_NAME).elf $(RUN_FLAGS)
|
||||
@WIILOAD=tcp:$(REMOTE_IP) wiiload $(TARGET_OUTPUT_DIR)/wiiu/apps/$(STRIPPED_NAME)/$(STRIPPED_NAME).elf $(RUN_FLAGS)
|
||||
|
||||
endif
|
||||
|
||||
@@ -496,6 +623,35 @@ $(TARGET_OUTPUT_DIR)/wiiu/apps/$(STRIPPED_NAME)/icon.png:
|
||||
@echo $@
|
||||
@cp $(ICON) $(TARGET_OUTPUT_DIR)/wiiu/apps/$(STRIPPED_NAME)/icon.png
|
||||
|
||||
else ifeq ($(TARGET_OS),switch)
|
||||
|
||||
ifeq ($(LIBRARY),1)
|
||||
|
||||
install: $(OUTPUT_ZIP_FILE)
|
||||
@mkdir -p $(DEVKITPRO)/$(STRIPPED_NAME)
|
||||
@cp -r $(TARGET_OUTPUT_DIR)/* $(DEVKITPRO)/$(STRIPPED_NAME)
|
||||
@echo "Installed."
|
||||
|
||||
else
|
||||
|
||||
run: $(OUTPUT_ZIP_FILE)
|
||||
@echo "Running..."
|
||||
@yuzu-cmd $(RUN_FLAGS) $(TARGET_OUTPUT_DIR)/switch/$(STRIPPED_NAME).nro
|
||||
|
||||
runhw: $(OUTPUT_ZIP_FILE)
|
||||
@echo "Running..."
|
||||
@nxlink --address $(REMOTE_IP) $(TARGET_OUTPUT_DIR)/switch/$(STRIPPED_NAME).nro
|
||||
|
||||
endif
|
||||
|
||||
%.nacp:
|
||||
@echo $@
|
||||
@nacptool --create "$(TITLE)" "$(AUTHOR)" "$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_MICRO)" $@ $(NACP_FLAGS)
|
||||
|
||||
$(TARGET_OUTPUT_DIR)/switch/%.nro: $(TARGET_OUTPUT_DIR)/%.elf $(TARGET_BUILD_DIR)/meta.nacp
|
||||
@echo $@
|
||||
@elf2nro $< $@ --nacp=$(word 2,$^) $(NRO_FLAGS)
|
||||
|
||||
else ifeq ($(TARGET_OS),windows)
|
||||
ifeq ($(HOST_OS),$(filter $(HOST_OS),linux mac))
|
||||
ifneq ($(LIBRARY),1)
|
||||
|
||||
-257
@@ -1,257 +0,0 @@
|
||||
/*
|
||||
* Linkscript for Wii U
|
||||
*/
|
||||
|
||||
OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc");
|
||||
OUTPUT_ARCH(powerpc:common);
|
||||
EXTERN(_start);
|
||||
ENTRY(_start);
|
||||
|
||||
PHDRS
|
||||
{
|
||||
text PT_LOAD FLAGS(5);
|
||||
data PT_LOAD FLAGS(6);
|
||||
bss1 PT_LOAD;
|
||||
bss2 PT_LOAD;
|
||||
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
/* default base address (Homebrew Launcher) */
|
||||
/* use -Wl,--section-start,.init=0xADDRESS to change */
|
||||
. = 0x00802000;
|
||||
|
||||
/* Program */
|
||||
.init :
|
||||
{
|
||||
KEEP (*crt0.o(*.init))
|
||||
KEEP (*(.init))
|
||||
} :text = 0
|
||||
.plt : { *(.plt) }
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
.gnu.version : { *(.gnu.version) }
|
||||
.gnu.version_d : { *(.gnu.version_d) }
|
||||
.gnu.version_r : { *(.gnu.version_r) }
|
||||
.rel.init : { *(.rel.init) }
|
||||
.rela.init : { *(.rela.init) }
|
||||
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
|
||||
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
|
||||
.rel.fini : { *(.rel.fini) }
|
||||
.rela.fini : { *(.rela.fini) }
|
||||
.rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
|
||||
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
|
||||
.rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
|
||||
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
|
||||
.rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
|
||||
.rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
|
||||
.rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
|
||||
.rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
|
||||
.rel.ctors : { *(.rel.ctors) }
|
||||
.rela.ctors : { *(.rela.ctors) }
|
||||
.rel.dtors : { *(.rel.dtors) }
|
||||
.rela.dtors : { *(.rela.dtors) }
|
||||
.rel.got : { *(.rel.got) }
|
||||
.rela.got : { *(.rela.got) }
|
||||
.rela.got1 : { *(.rela.got1) }
|
||||
.rela.got2 : { *(.rela.got2) }
|
||||
.rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
|
||||
.rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
|
||||
.rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
|
||||
.rela.sbss : { *(.rela.sbss .rela.sbss.* .rel.gnu.linkonce.sb.*) }
|
||||
.rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
|
||||
.rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
|
||||
.rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
|
||||
.rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
|
||||
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
|
||||
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
|
||||
.rel.plt : { *(.rel.plt) }
|
||||
.rela.plt : { *(.rela.plt) }
|
||||
|
||||
.text :
|
||||
{
|
||||
*(.text)
|
||||
*(.text.*)
|
||||
/* .gnu.warning sections are handled specially by elf32.em. */
|
||||
*(.gnu.warning)
|
||||
*(.gnu.linkonce.t.*)
|
||||
. = ALIGN(32); /* REQUIRED. LD is flaky without it. */
|
||||
} = 0
|
||||
|
||||
.fini :
|
||||
{
|
||||
KEEP (*(.fini))
|
||||
. = ALIGN(32); /* REQUIRED. LD is flaky without it. */
|
||||
} = 0
|
||||
|
||||
PROVIDE (__etext = .);
|
||||
PROVIDE (_etext = .);
|
||||
PROVIDE (etext = .);
|
||||
|
||||
.rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } :data
|
||||
.rodata1 : { *(.rodata1) }
|
||||
.sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) }
|
||||
.sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) }
|
||||
/* Adjust the address for the data segment. We want to adjust up to
|
||||
the same address within the page on the next page up. */
|
||||
/* Ensure the __preinit_array_start label is properly aligned. We
|
||||
could instead move the label definition inside the section, but
|
||||
the linker would then create the section even if it turns out to
|
||||
be empty, which isn't pretty. */
|
||||
. = ALIGN(32 / 8);
|
||||
PROVIDE (__preinit_array_start = .);
|
||||
.preinit_array : { *(.preinit_array) }
|
||||
PROVIDE (__preinit_array_end = .);
|
||||
PROVIDE (__init_array_start = .);
|
||||
.init_array : { *(.init_array) }
|
||||
PROVIDE (__init_array_end = .);
|
||||
PROVIDE (__fini_array_start = .);
|
||||
.fini_array : { *(.fini_array) }
|
||||
PROVIDE (__fini_array_end = .);
|
||||
.data :
|
||||
{
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
*(.gnu.linkonce.d.*)
|
||||
SORT(CONSTRUCTORS)
|
||||
. = ALIGN(32); /* REQUIRED. LD is flaky without it. */
|
||||
}
|
||||
|
||||
.data1 : { *(.data1) }
|
||||
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
|
||||
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
|
||||
.eh_frame : { KEEP (*(.eh_frame)) }
|
||||
.gcc_except_table : { *(.gcc_except_table) }
|
||||
.fixup : { *(.fixup) }
|
||||
.got1 : { *(.got1) }
|
||||
.got2 : { *(.got2) }
|
||||
.dynamic : { *(.dynamic) }
|
||||
|
||||
.ctors :
|
||||
{
|
||||
/* gcc uses crtbegin.o to find the start of
|
||||
the constructors, so we make sure it is
|
||||
first. Because this is a wildcard, it
|
||||
doesn't matter if the user does not
|
||||
actually link against crtbegin.o; the
|
||||
linker won't look for a file to match a
|
||||
wildcard. The wildcard also means that it
|
||||
doesn't matter which directory crtbegin.o
|
||||
is in. */
|
||||
|
||||
KEEP (*crtbegin.o(.ctors))
|
||||
|
||||
/* We don't want to include the .ctor section from
|
||||
from the crtend.o file until after the sorted ctors.
|
||||
The .ctor section from the crtend file contains the
|
||||
end of ctors marker and it must be last */
|
||||
|
||||
KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*(.ctors))
|
||||
. = ALIGN(32); /* REQUIRED. LD is flaky without it. */
|
||||
}
|
||||
|
||||
.dtors :
|
||||
{
|
||||
KEEP (*crtbegin.o(.dtors))
|
||||
KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*(.dtors))
|
||||
. = ALIGN(32); /* REQUIRED. LD is flaky without it. */
|
||||
}
|
||||
|
||||
.jcr : { KEEP (*(.jcr)) }
|
||||
.got : { *(.got.plt) *(.got) }
|
||||
|
||||
|
||||
/* We want the small data sections together, so single-instruction offsets
|
||||
can access them all, and initialized data all before uninitialized, so
|
||||
we can shorten the on-disk segment size. */
|
||||
|
||||
.sdata :
|
||||
{
|
||||
*(.sdata)
|
||||
*(.sdata.*)
|
||||
*(.gnu.linkonce.s.*)
|
||||
. = ALIGN(32); /* REQUIRED. LD is flaky without it. */
|
||||
}
|
||||
|
||||
_edata = .;
|
||||
PROVIDE (edata = .);
|
||||
|
||||
.sbss :
|
||||
{
|
||||
__sbss_start = .;
|
||||
PROVIDE (__sbss_start = .);
|
||||
PROVIDE (___sbss_start = .);
|
||||
*(.dynsbss)
|
||||
*(.sbss)
|
||||
*(.sbss.*)
|
||||
*(.gnu.linkonce.sb.*)
|
||||
*(.scommon)
|
||||
PROVIDE (__sbss_end = .);
|
||||
PROVIDE (___sbss_end = .);
|
||||
. = ALIGN(32); /* REQUIRED. LD is flaky without it. */
|
||||
__sbss_end = .;
|
||||
} :bss1
|
||||
|
||||
.bss :
|
||||
{
|
||||
__bss_start = .;
|
||||
PROVIDE (__bss_start = .);
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(.gnu.linkonce.b.*)
|
||||
*(COMMON)
|
||||
/* Align here to ensure that the .bss section occupies space up to
|
||||
_end. Align after .bss to ensure correct alignment even if the
|
||||
.bss section disappears because there are no input sections. */
|
||||
|
||||
. = ALIGN(32);
|
||||
|
||||
PROVIDE (__bss_end = .);
|
||||
__bss_end = .;
|
||||
} :bss2
|
||||
|
||||
_end = .;
|
||||
PROVIDE(end = .);
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
/* DWARF debug sections.
|
||||
Symbols in the DWARF debugging sections are relative to the beginning
|
||||
of the section so we begin them at 0. */
|
||||
/* DWARF 1 */
|
||||
.debug 0 : { *(.debug) }
|
||||
.line 0 : { *(.line) }
|
||||
/* GNU DWARF 1 extensions */
|
||||
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
||||
.debug_sfnames 0 : { *(.debug_sfnames) }
|
||||
/* DWARF 1.1 and DWARF 2 */
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
/* DWARF 2 */
|
||||
.debug_info 0 : { *(.debug_info) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_line 0 : { *(.debug_line) }
|
||||
.debug_frame 0 : { *(.debug_frame) }
|
||||
.debug_str 0 : { *(.debug_str) }
|
||||
.debug_loc 0 : { *(.debug_loc) }
|
||||
.debug_macinfo 0 : { *(.debug_macinfo) }
|
||||
/* SGI/MIPS DWARF 2 extensions */
|
||||
.debug_weaknames 0 : { *(.debug_weaknames) }
|
||||
.debug_funcnames 0 : { *(.debug_funcnames) }
|
||||
.debug_typenames 0 : { *(.debug_typenames) }
|
||||
.debug_varnames 0 : { *(.debug_varnames) }
|
||||
/* These must appear regardless of . */
|
||||
}
|
||||
Reference in New Issue
Block a user