flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > 16-bit relocations in ELF

Author
Thread Post new topic Reply to topic
alexfru



Joined: 23 Mar 2014
Posts: 76
alexfru
Code:
format elf

section '.text'

use32
public foo
foo:
    mov al, [var]
    mov al, [ebx+var]
    ret

use16
public foo16
foo16:
    mov al, [var] ; uses address prefix and 32-bit displacement
;    mov al, [bx+var] ; error: address sizes do not agree.
    ret

section '.data'
var db 0
    


FASM seems to only support 32-bit relocations in the ELF format:
#define R_386_32 1
#define R_386_PC32 2

NASM and GNU as support 16-bit ones as well:
#define R_386_16 20
#define R_386_PC16 21

Could FASM support 16-bit relocations in ELF too?
Post 08 Jun 2015, 00:49
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.