• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

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

Commit MetaInfo

修订版0fcfaee3e1e4575570ccecae087f920d29ff936c (tree)
时间2019-10-06 01:13:23
作者Stafford Horne <shorne@gmai...>
CommiterWaldemar Brodkorb

Log Message

or1k: Fix compiling with PIC and latest binutils use PLT for syscall_error

This symbol was causing a build failure with the new toolchain. It
looks like it has always been wrong.

The main issue was checking for PIC rather than PIC.

Remove all PSEUDO_* macros and ther SYSCALL_ERROR_NAME macro as they are
not needed by uclibc-ng, they are used in glibc for building up syscalls
there, but not here.

Fixes error:

/opt/shorne/software/or1k-linux/bin/../lib/gcc/or1k-linux/9.0.1/../../../../or1k-linux/bin/ld: libc/libc_so.a(or1k_clone.os): pc-relative relocation against dynamic symbol syscall_error
/opt/shorne/software/or1k-linux/bin/../lib/gcc/or1k-linux/9.0.1/../../../../or1k-linux/bin/ld: final link failed: bad value

Signed-off-by: Stafford Horne <shorne@gmail.com>

更改概述

差异

--- a/libc/sysdeps/linux/or1k/or1k_clone.S
+++ b/libc/sysdeps/linux/or1k/or1k_clone.S
@@ -71,7 +71,11 @@ L(oldpid):
7171 l.ori r3, r11, 0
7272
7373 L(error):
74- l.j SYSCALL_ERROR_NAME
74+#ifdef __PIC__
75+ l.j plt(__syscall_error)
76+#else
77+ l.j __syscall_error
78+#endif
7579 l.ori r3,r11,0
7680
77-PSEUDO_END (__or1k_clone)
81+END (__or1k_clone)
--- a/libc/sysdeps/linux/or1k/sysdep.h
+++ b/libc/sysdeps/linux/or1k/sysdep.h
@@ -43,38 +43,6 @@ License along with the GNU C Library; if not, see
4343 l.sys 1; \
4444 l.nop
4545
46-#define PSEUDO(name, syscall_name, args) \
47- ENTRY (name); \
48- DO_CALL(syscall_name); \
49- /* if -4096 < ret < 0 holds, it's an error */ \
50- l.sfgeui r11, 0xf001; \
51- l.bf L(pseudo_end); \
52- l.nop
53-
54-#define PSEUDO_NOERRNO(name, syscall_name, args) \
55- ENTRY (name); \
56- DO_CALL(syscall_name)
57-
58-#define PSEUDO_END(name) \
59-L(pseudo_end): \
60- l.j SYSCALL_ERROR_NAME; \
61- l.ori r3,r11,0; \
62- END (name)
63-
64-#define PSEUDO_END_NOERRNO(name) \
65- END (name)
66-
67-#ifndef PIC
68-/* For static code, on error jump to __syscall_error directly. */
69-# define SYSCALL_ERROR_NAME __syscall_error
70-#elif NOT_IN_libc
71-/* Use the internal name for libc/libpthread shared objects. */
72-# define SYSCALL_ERROR_NAME __GI___syscall_error
73-#else
74-/* Otherwise, on error do a full PLT jump. */
75-# define SYSCALL_ERROR_NAME plt(__syscall_error)
76-#endif
77-
7846 /* Make use of .size directive. */
7947 #define ASM_SIZE_DIRECTIVE(name) .size name,.-name;
8048