• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

コミットメタ情報

リビジョン9e854172e249a383d858fef70368af63a04a28a8 (tree)
日時2022-10-14 16:47:14
作者linted <linted@user...>
コミッターWaldemar Brodkorb

ログメッセージ

Static pie support for ppc

Modified config files and crt1.S to support static pie elf generation.

Signed-off-by: linted <linted@users.noreply.github.com>

変更サマリ

差分

--- a/extra/Configs/Config.in
+++ b/extra/Configs/Config.in
@@ -326,7 +326,7 @@ config STATIC_PIE
326326 default n
327327 depends on DOPIC && !UCLIBC_FORMAT_FDPIC_ELF && \
328328 (TARGET_arm || TARGET_i386 || TARGET_x86_64 || TARGET_aarch64 || \
329- TARGET_mips || TARGET_xtensa)
329+ TARGET_mips || TARGET_xtensa || TARGET_powerpc)
330330
331331 config ARCH_HAS_NO_SHARED
332332 bool
--- a/libc/sysdeps/linux/powerpc/crt1.S
+++ b/libc/sysdeps/linux/powerpc/crt1.S
@@ -41,6 +41,9 @@
4141 .weak _init
4242 .weak _fini
4343 #endif
44+#ifdef L_rcrt1
45+ .type reloc_static_pie,%function
46+#endif
4447 .type main,%function
4548 .type __uClibc_main,%function
4649
@@ -61,6 +64,22 @@ _start:
6164 # ifdef PPC_HAS_SECUREPLT
6265 mr 30,31
6366 # endif
67+#ifdef L_rcrt1
68+ stwu r3, -4(r1) /* Save r3 */
69+ stwu r9, -16(r1) /* Save r9 */
70+ bcl 20,31,2f /* Jump to label 2 */
71+2: mflr r3 /* Load lr into r3 */
72+ addis r3, r3, _DYNAMIC-2b@ha /* Add high half of _DYNAMIC to r3 */
73+ addi r3,r3,_DYNAMIC-2b@l /* Add low half of _DYNAMIC */
74+ lwz r4, 0(r31) /* load _DYNAMIC from the GOT */
75+ subf r3, r4, r3 /* sub _DYNAMIC@got and it's actual address */
76+ bl reloc_static_pie /* Call reloc_static_pie */
77+ lwzu r9, 0(r1) /* restore r9 */
78+ addi r1, r1, 16 /* update stack pointer */
79+ lwzu r3, 0(r1) /* restore r3 */
80+ addi r1, r1, 4 /* update stack pointer */
81+ li r5, 0 /* zero r5 */
82+#endif
6483 #endif
6584 /* Set up the small data pointer in r13. */
6685 #ifdef __PIC__