mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-10-27 00:29:39 -04:00
remove textrels with -fPIC/-fPIE (for android/ios)
This commit is contained in:
parent
4f992bf541
commit
9760505eaf
10 changed files with 298 additions and 261 deletions
|
|
@ -49,4 +49,36 @@
|
|||
|
||||
#endif
|
||||
|
||||
// indexed branch (XB) via branch table (BT)
|
||||
#ifdef __PIC__
|
||||
#define PIC_XB(c,r,s) add##c pc, r, s
|
||||
#define PIC_BT(a) b a
|
||||
#else
|
||||
#define PIC_XB(c,r,s) ldr##c pc, [pc, r, s]
|
||||
#define PIC_BT(a) .word a
|
||||
#endif
|
||||
|
||||
// load data address (LDR) either via literal pool or via GOT
|
||||
#ifdef __PIC__
|
||||
// can't use pool loads since ldr= only allows symbol or constants, not expr :-(
|
||||
#define PIC_LDR_INIT() \
|
||||
.ifndef PIC_LDR_DEF; PIC_LDR_DEF=1; \
|
||||
.macro pic_ldr r t a; \
|
||||
ldr \r, [pc, $.LD\@-.-8]; \
|
||||
ldr \t, [pc, $.LD\@-.-4]; \
|
||||
.LP\@:add \r, pc; \
|
||||
ldr \r, [\r, \t]; \
|
||||
add pc, $4; \
|
||||
.LD\@:.word _GLOBAL_OFFSET_TABLE_-.LP\@-8; \
|
||||
.word \a(GOT); \
|
||||
.endm; \
|
||||
.endif;
|
||||
#define PIC_LDR(r,t,a) \
|
||||
pic_ldr r, t, a
|
||||
#else
|
||||
#define PIC_LDR_INIT()
|
||||
#define PIC_LDR(r,t,a) \
|
||||
ldr r, =a
|
||||
#endif
|
||||
|
||||
#endif /* __ARM_FEATURES_H__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue