Skip to content

Commit 0a7a0ef

Browse files
Fix vita elf vaddr and size (#78)
* Create 0003-fix-elf-vaddr.patch * Fixed temporary elf size for vita. Related to this issue : vitasdk/vita-toolchain#150 * Add 0003-fix-elf-vaddr.patch for binutils * Remove comment
1 parent 9bdfd12 commit 0a7a0ef

3 files changed

Lines changed: 27 additions & 7 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ function(toolchain_deps toolchain_deps_dir toolchain_install_dir toolchain_suffi
303303
PATCH_COMMAND
304304
patch -d <SOURCE_DIR> -p3 -t -N < ${PROJECT_SOURCE_DIR}/patches/binutils/0001-vita.patch
305305
&& patch -d <SOURCE_DIR> -p1 -t -N < ${PROJECT_SOURCE_DIR}/patches/binutils/0002-fix-broken-reloc.patch
306+
&& patch -d <SOURCE_DIR> -p3 -t -N < ${PROJECT_SOURCE_DIR}/patches/binutils/0003-fix-elf-vaddr.patch
306307
CONFIGURE_COMMAND ${compiler_flags} ${wrapper_command} <SOURCE_DIR>/configure
307308
--build=${build_native}
308309
--host=${toolchain_host}

patches/binutils/0001-vita.patch

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
diff -Nru a/src/binutils/ld/scripttempl/elf.sc b/src/binutils/ld/scripttempl/elf.sc
2-
--- a/src/binutils/ld/scripttempl/elf.sc 2018-07-11 17:43:55.000000000 +0200
3-
+++ b/src/binutils/ld/scripttempl/elf.sc 2018-12-29 19:53:29.747662203 +0100
4-
@@ -580,6 +580,8 @@
5-
${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
6-
${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
7-
2+
--- a/src/binutils/ld/scripttempl/elf.sc
3+
+++ b/src/binutils/ld/scripttempl/elf.sc
4+
@@ -579,7 +579,25 @@
5+
${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}}
6+
${CREATE_SHLIB+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}
7+
${CREATE_PIE+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}
8+
-
9+
+ /* SCE self module info size */
10+
+ . = . + 0x5C;
11+
+ /* SCE self module_proc_param size */
12+
+ . = . + 0x34;
13+
+ /* SCE self info rsvd size(import table, etc...) */
14+
+ . = . + 0x7000;
815
+ /* Hacky hackity hack. Need this because otherwise data segment is not aligned enough. */
9-
+ . = ALIGN(0x10000);
16+
+ . = ALIGN(0x8000);
1017
/* Exception handling */
1118
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) ${RELOCATING+*(.eh_frame.*)} }
1219
.gnu_extab ${RELOCATING-0} : ONLY_IF_RW { *(.gnu_extab) }
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff -Nru a/src/binutils/ld/emulparams/armelf.sh b/src/binutils/ld/emulparams/armelf.sh
2+
--- a/src/binutils/ld/emulparams/armelf.sh
3+
+++ b/src/binutils/ld/emulparams/armelf.sh
4+
@@ -3,7 +3,7 @@
5+
OUTPUT_FORMAT="elf32-littlearm"
6+
BIG_OUTPUT_FORMAT="elf32-bigarm"
7+
LITTLE_OUTPUT_FORMAT="elf32-littlearm"
8+
-TEXT_START_ADDR=0x8000
9+
+TEXT_START_ADDR=0x81000000
10+
TEMPLATE_NAME=elf
11+
EXTRA_EM_FILE=armelf
12+
OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)'

0 commit comments

Comments
 (0)