Skip to content

Commit bac7a6b

Browse files
[PS5][Driver] Pass -z rodynamic to the linker (#115009)
Until now, suppression of `DT_DEBUG` has been hardcoded as a downstream patch in lld. This can instead be achieved by passing `-z rodynamic`. Have the driver do this so that the private patch can be removed. If the scope of lld's `-z rodynamic` is broadened (within reason) to do more in future, that's likely to be fine as `PT_DYNAMIC` isn't writable on PlayStation. PS5 only. On PS4, the equivalent hardcoded configuration will remain in the proprietary linker. SIE tracker: TOOLCHAIN-16704
1 parent 7780cf0 commit bac7a6b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

clang/lib/Driver/ToolChains/PS4CPU.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@ void tools::PS5cpu::Linker::ConstructJob(Compilation &C, const JobAction &JA,
277277
CmdArgs.push_back("-z");
278278
CmdArgs.push_back("start-stop-visibility=hidden");
279279

280+
// DT_DEBUG is not supported on PlayStation.
281+
CmdArgs.push_back("-z");
282+
CmdArgs.push_back("rodynamic");
283+
280284
CmdArgs.push_back("-z");
281285
CmdArgs.push_back("common-page-size=0x4000");
282286

clang/test/Driver/ps5-linker.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
// CHECK-EXE-SAME: "--unresolved-symbols=report-all"
5454
// CHECK-EXE-SAME: "-z" "now"
5555
// CHECK-EXE-SAME: "-z" "start-stop-visibility=hidden"
56+
// CHECK-EXE-SAME: "-z" "rodynamic"
5657
// CHECK-EXE-SAME: "-z" "common-page-size=0x4000"
5758
// CHECK-EXE-SAME: "-z" "max-page-size=0x4000"
5859
// CHECK-EXE-SAME: "-z" "dead-reloc-in-nonalloc=.debug_*=0xffffffffffffffff"

0 commit comments

Comments
 (0)