Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
minrt: add ELF pheaders to link script
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarLambda committed Feb 8, 2023
1 parent 540f43f commit df172df
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ make_dist() {
[ ! -d "$DIST" ] && mkdir "$DIST" || rm "$DIST"/*

(PROJECT=libseven VERSION=0.17.0 make_dist)
(PROJECT=minrt VERSION=0.7.0 make_dist)
(PROJECT=minrt VERSION=0.7.1 make_dist)
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project('sdk-seven', 'c',
version: '0.19.0',
version: '0.19.1',
license: 'Zlib',
meson_version: '>=0.59.0',
default_options: ['warning_level=2', 'c_std=c99'])
Expand Down
29 changes: 19 additions & 10 deletions minrt/lib/ldscripts/gba.x
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ OUTPUT_ARCH(arm)
ENTRY(_start)
EXTERN(_header)

PHDRS
{
LOAD PT_LOAD;
IWRAM PT_LOAD;
EWRAM PT_LOAD;
DATA PT_LOAD;
PERSISTENT PT_LOAD;
}

SECTIONS
{
/* GBA ROM header */
Expand All @@ -19,7 +28,7 @@ SECTIONS
__boot_type = 0xC4;
__boot_client = 0xC5;
KEEP(*(.header_pad .header_pad.*))
} >LOAD_REGION
} >LOAD_REGION :LOAD

/* Standard code */

Expand All @@ -44,7 +53,7 @@ SECTIONS
{
*(SORT(.iwram.sorted.*))
*(.iwram .iwram.*)
} >IWRAM AT>LOAD_REGION
} >IWRAM AT>LOAD_REGION :IWRAM

OVERLAY : NOCROSSREFS
{
Expand Down Expand Up @@ -72,7 +81,7 @@ SECTIONS
{
*(SORT(.ewram.sorted.*))
*(.ewram .ewram.*)
} >EWRAM AT>LOAD_REGION
} >EWRAM AT>LOAD_REGION :EWRAM

OVERLAY : NOCROSSREFS
{
Expand All @@ -99,21 +108,21 @@ SECTIONS
.data :
{
*(.data .data.* .gnu.linkonce.d.*)
} >DATA_REGION AT>LOAD_REGION
} >DATA_REGION AT>LOAD_REGION :DATA

/* Persistent data */

.persistent :
{
*(.persistent .persistent.* .gnu.linkonce.p.*)
} >PERSISTENT_REGION AT>LOAD_REGION
} >PERSISTENT_REGION AT>LOAD_REGION :PERSISTENT

/* IWRAM zero-initialized data */

.iwram_bss (NOLOAD) :
{
*(.iwram_bss .iwram_bss.*)
} >IWRAM
} >IWRAM :NONE

/* EWRAM zero-initialized data */

Expand All @@ -122,29 +131,29 @@ SECTIONS
*(.ewram_bss .ewram_bss.*)
/* devkitARM compatibility */
*(.sbss .sbss.*)
} >EWRAM
} >EWRAM :NONE

/* Standard zero-initialized data */

.bss (NOLOAD) :
{
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
} >BSS_REGION
} >BSS_REGION :NONE

/* Persistent zero-initialized data */

.noinit (NOLOAD) :
{
*(.noinit .noinit.* .gnu.linkonce.n.*)
} >NOINIT_REGION
} >NOINIT_REGION :NONE

/* Exception handling and unwinding */

.ARM.extab :
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
} >LOAD_REGION
} >LOAD_REGION :LOAD

.ARM.exidx :
{
Expand Down
2 changes: 1 addition & 1 deletion minrt/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = '0.7.0'
version = '0.7.1'

sources = [
'src/gba/crt0.s',
Expand Down
2 changes: 1 addition & 1 deletion minrt/src/gba/crt0.s
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ _exit:
init: .byte 0

.section .pad,"aR",%progbits
.string "minrt 0.5.1"
.string "minrt 0.7.1"

.equiv REG_IME, 0x04000208

Expand Down

0 comments on commit df172df

Please sign in to comment.