Skip to content

Commit

Permalink
ia32: support PIE in asm
Browse files Browse the repository at this point in the history
In PIE on ia32 function calls should be made using GOT.

JIRA: RTOS-664
  • Loading branch information
badochov committed Dec 10, 2023
1 parent 36e8273 commit 216481a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions arch/ia32/signal.S
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,25 @@
.type _signal_trampoline, %function
_signal_trampoline:
/* Signal number on stack */
#if __pic__ == 0
call _signal_handler
#else
call .l1
.l1:
pop %ebx
add $_GLOBAL_OFFSET_TABLE_+(.-.l1), %ebx

call _signal_handler@got(%ebx)
#endif

addl $4, %esp
/* Put old mask on stack */
push %eax
/* cpu context *, eip, esp on stack */
#if __pic__ == 0
call sigreturn
#else
call sigreturn@got(%ebx)
#endif
.size _signal_trampoline, .-_signal_trampoline

0 comments on commit 216481a

Please sign in to comment.