Hi Vineet,
Vineet Gupta wrote,
Currently crt1 takes address of functions
(main,_init,_fini) directly
which doesn't generate truely position independent code, but zero based
values instead. e.g.
| __start:
| ...
| add_s r2,sp,0x4
| mov_s r0, main
generates to
| 000156ec <__start>:
| ...
| 156f4: add_s r2,sp,0x4
| 156f6: mov_s r0,0x15f7c
| ...
| 00015f7c <main>:
| 15f7c: push_s blink
This works just fine for the normal (non PIE) dynamic executables since
they are loaded at address 0. However this is not true for PIE
executables. So for Scrt1 we use a true position independent way when
taking function addresses.
Cc: uclibc(a)uclibc.org <uclibc(a)uclibc.org>
Cc: devel(a)uclibc-ng.org <devel(a)uclibc-ng.org>
Cc: Cupertino Miranda <cmiranda(a)synopsys.com>
Signed-off-by: Vineet Gupta <vgupta(a)synopsys.com>
---
libc/sysdeps/linux/arc/crt1.S | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
Applied and pushed,
thx
Waldemar