powerpc: Get 32-bit AIM building with secure-PLT

The last few changes needed before 32-bit AIM builds with secure-PLT with
base GCC.  Because ofwcall32.S and swtch32.S were branching to the GOT it
could not use secure PLT.
This commit is contained in:
jhibbits 2019-08-05 01:37:18 +00:00
parent a67e053e2b
commit b8553eed10
2 changed files with 16 additions and 4 deletions

View File

@ -67,8 +67,11 @@ ASENTRY(ofwcall)
mfmsr %r6
/* GOT pointer in r7 */
bl _GLOBAL_OFFSET_TABLE_@local-4
bl 1f
1:
mflr %r7
addis %r7,%r7,(_GLOBAL_OFFSET_TABLE_-1b)@ha
addi %r7,%r7,(_GLOBAL_OFFSET_TABLE_-1b)@l
/* read client interface handler */
lwz %r4,openfirmware_entry@got(%r7)
@ -129,8 +132,11 @@ ASENTRY(rtascall)
stw %r0,4(%r1)
/* GOT pointer in r7 */
bl _GLOBAL_OFFSET_TABLE_@local-4
bl 1f
1:
mflr %r7
addis %r7,%r7,(_GLOBAL_OFFSET_TABLE_-1b)@ha
addi %r7,%r7,(_GLOBAL_OFFSET_TABLE_-1b)@l
/* Record the old MSR to real-mode-accessible area */
mfmsr %r0
@ -152,8 +158,11 @@ ASENTRY(rtascall)
bctrl
/* GOT pointer in r7 */
bl _GLOBAL_OFFSET_TABLE_@local-4
bl 1f
1:
mflr %r7
addis %r7,%r7,(_GLOBAL_OFFSET_TABLE_-1b)@ha
addi %r7,%r7,(_GLOBAL_OFFSET_TABLE_-1b)@l
/* Now set the MSR back */
lwz %r6,rtas_regsave@got(%r7)

View File

@ -124,8 +124,11 @@ ENTRY(cpu_switch)
cpu_switchin:
#if defined(SMP) && defined(SCHED_ULE)
/* Wait for the new thread to become unblocked */
bl _GLOBAL_OFFSET_TABLE_@local-4
bl 1f
1:
mflr %r6
addis %r6,%r6,(_GLOBAL_OFFSET_TABLE_-1b)@ha
addi %r6,%r6,(_GLOBAL_OFFSET_TABLE_-1b)@l
lwz %r6,blocked_lock@got(%r6)
blocked_loop:
lwz %r7,TD_LOCK(%r2)