diff options
author | H. Peter Anvin <hpa@zytor.com> | 2018-12-24 12:20:05 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2018-12-24 12:20:05 -0800 |
commit | 4e40379d2b325c8b4c75535159272edf554f033d (patch) | |
tree | b0ae15084de2fb8ba76a1455f7e9903e71227831 /test/sections.asm | |
parent | e7c75e55212c8e88b5574ff746a375146bc02373 (diff) | |
download | nasm-4e40379d2b325c8b4c75535159272edf554f033d.tar.gz |
elf16: WIP: support for 16-bit segmented relocations in ELF32elf16
Add very preliminary support for 16-bit segmented relocations. This
does not handle segmented programming in any kind of
programmer-friendly way, but it is the beginning to something
testable.
(Prototype) binutils:
URL: https://github.com/hjl-tools/binutils-gdb
Branch: users/hjl/16bit
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'test/sections.asm')
-rw-r--r-- | test/sections.asm | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/test/sections.asm b/test/sections.asm new file mode 100644 index 00000000..505a2ff5 --- /dev/null +++ b/test/sections.asm @@ -0,0 +1,48 @@ + bits 16 + + section s_start exec +s_start equ seg $$ + global _start +_start: + nop + nop + nop + nop + ret + + section s_foo exec +s_foo equ seg $$ + hlt + hlt + hlt +wibble: + hlt + hlt + hlt + hlt + + global g_bar, g_anear, g_afar + extern e_meep, e_note, e_note~b +g_bar: add eax,edx + add eax,[g_bar] + add eax,[g_bar wrt s_start] + add eax,[g_bar wrt s_foo] + mov ax,seg e_note~b + mov es,ax + add eax,[es:e_note] + add eax,[es:e_note wrt seg e_note~b] + + jmp s_foo:g_bar + jmp s_start:_start + jmp e_meep + jmp far e_meep + + sub eax,[e_note wrt 0] + +g_anear equ 3333h +g_afar equ 4444h:5555h +g_meh equ g_bar + + dw e_meep, seg e_meep + dw e_note, seg e_note + dw g_afar, seg g_afar |