Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
produce positional independent executables
Browse files Browse the repository at this point in the history
  • Loading branch information
john-tornblom committed Jun 3, 2023
1 parent 62c5724 commit 1cb5003
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions elf_x86_64.x
Expand Up @@ -3,16 +3,16 @@ OUTPUT_ARCH(i386:x86-64)
ENTRY(_start)

PHDRS {
ph_text PT_LOAD FLAGS (0x1 | 0x4);
ph_data PT_LOAD FLAGS (0x2 | 0x4);
ph_text PT_LOAD FLAGS (0x1 | 0x4);
ph_rodata PT_LOAD FLAGS (0x4);
ph_data PT_LOAD FLAGS (0x2 | 0x4);
}

SECTIONS {
. = 0x920100000;
.text : { *(.text .text.*) } : ph_text
.rodata : { *(.rodata .rodata.*) }
. = ALIGN(0x4000);
. = 0x926100000;
.rodata : { *(.rodata .rodata.*) } : ph_rodata
. = ALIGN(0x4000);
.data : { *(.data .data.*) } : ph_data
.bss : {
PROVIDE_HIDDEN(__bss_start = .);
Expand Down
2 changes: 1 addition & 1 deletion host/x86_64-ps5-payload-cc
Expand Up @@ -26,5 +26,5 @@ fi
$PS5_PAYLOAD_CC \
--sysroot "${PS5_PAYLOAD_SDK}" \
-D__FreeBSD__ -D__PROSPERO__ \
-fPIC -fno-plt -mcmodel=large \
-fPIC -fno-plt \
$*
2 changes: 1 addition & 1 deletion host/x86_64-ps5-payload-ld
Expand Up @@ -24,7 +24,7 @@ if [[ -z "$PS5_PAYLOAD_LD" ]]; then
fi

$PS5_PAYLOAD_LD \
-static \
-pie \
-T "${PS5_PAYLOAD_SDK}/ldscripts/elf_x86_64.x" \
-L "${PS5_PAYLOAD_SDK}/usr/lib" \
$* \
Expand Down

0 comments on commit 1cb5003

Please sign in to comment.