diff options
author | mirabilos <thorsten.glaser@teckids.org> | 2017-03-25 23:39:29 +0300 |
---|---|---|
committer | mirabilos <thorsten.glaser@teckids.org> | 2017-03-25 23:39:29 +0300 |
commit | 3ce63c3374a915ae82c5c145f1f692c8d8f0cade (patch) | |
tree | 55ba1ac8f0169596d5ee511ae114ff4aea80cee8 | |
parent | 7cd86adb8233eb9e90f8ca10b2dcbfc87bb4ea7d (diff) |
use label-relative, not GOT, access for local data in i386 ELF PIC
-rw-r--r-- | src/common.asm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common.asm b/src/common.asm index 489cb27..1eb9c64 100644 --- a/src/common.asm +++ b/src/common.asm @@ -66,19 +66,19 @@ section .note.GNU-stack noalloc noexec nowrite progbits ; i386 ELF PIC %macro PREPARE_RODATA 0 section .text -extern _GLOBAL_OFFSET_TABLE_ -..@get_GOT: +..@get_caller_address: mov ebx, [esp] ret section .data align 16 +..@rodata_begin: %endmacro %macro RETRIEVE_RODATA 0 - call ..@get_GOT -%%getgot: - add ebx, _GLOBAL_OFFSET_TABLE_ + $$ - %%getgot wrt ..gotpc + call ..@get_caller_address +%%the_caller_address: + sub ebx, %%the_caller_address - ..@rodata_begin %endmacro -%define lsym(name) ebx + name wrt ..gotoff +%define lsym(name) ebx + name - ..@rodata_begin %else ; i386 ELF, not PIC, default case (see below) %endif |