Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/neutrinolabs/librfxcodec.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormirabilos <thorsten.glaser@teckids.org>2017-03-25 23:34:48 +0300
committermirabilos <thorsten.glaser@teckids.org>2017-03-25 23:34:48 +0300
commit7cd86adb8233eb9e90f8ca10b2dcbfc87bb4ea7d (patch)
tree7d6f6cc24d30d33219d7c07f9bb27b4458e475e9
parentd743ec08df009b1a129740c32d5904d4f4a59c9c (diff)
move the i386 ELF PIC init code into PREPARE_RODATA
-rw-r--r--src/common.asm20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/common.asm b/src/common.asm
index 3d1576f..489cb27 100644
--- a/src/common.asm
+++ b/src/common.asm
@@ -52,19 +52,27 @@ section .note.GNU-stack noalloc noexec nowrite progbits
%endmacro
; Macros for relative access to local data
-%undef use_elf_pic
%undef lsym
%ifdef ASM_ARCH_AMD64
; amd64; don't define or call RETRIEVE_RODATA
%define lsym(name) rel name
+; default case for PREPARE_RODATA
%endif
%ifdef ASM_ARCH_I386
%ifdef is_elf
%ifdef PIC
; i386 ELF PIC
-%define use_elf_pic 1
+%macro PREPARE_RODATA 0
+section .text
+extern _GLOBAL_OFFSET_TABLE_
+..@get_GOT:
+ mov ebx, [esp]
+ ret
+section .data
+align 16
+%endmacro
%macro RETRIEVE_RODATA 0
call ..@get_GOT
%%getgot:
@@ -97,11 +105,3 @@ align 16
%endif
section .text
-
-; Prerequisite code for relative access to local data
-%ifdef use_elf_pic
-extern _GLOBAL_OFFSET_TABLE_
-..@get_GOT:
- mov ebx, [esp]
- ret
-%endif