mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-18 16:25:05 +08:00
backend: add support for x32 ELF
Add an x32 ELF (32-bit code with the CPU in 64-bit mode) backend.
This commit is contained in:
parent
a56b70436e
commit
04633d07b6
@ -74,6 +74,7 @@ NASM = nasm.$(O) nasmlib.$(O) ver.$(O) \
|
||||
output/nullout.$(O) \
|
||||
output/outbin.$(O) output/outaout.$(O) output/outcoff.$(O) \
|
||||
output/outelf.$(O) output/outelf32.$(O) output/outelf64.$(O) \
|
||||
output/outelfx32.$(O) \
|
||||
output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \
|
||||
output/outdbg.$(O) output/outieee.$(O) output/outmac32.$(O) \
|
||||
output/outmac64.$(O) preproc.$(O) quote.$(O) pptok.$(O) \
|
||||
@ -349,6 +350,10 @@ output/outelf64.$(O): output/outelf64.c compiler.h config.h directiv.h \
|
||||
eval.h insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
|
||||
output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
|
||||
preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
|
||||
output/outelfx32.$(O): output/outelfx32.c compiler.h config.h directiv.h \
|
||||
eval.h insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
|
||||
output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
|
||||
preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
|
||||
output/outform.$(O): output/outform.c compiler.h config.h directiv.h \
|
||||
insnsi.h nasm.h nasmlib.h opflags.h output/outform.h pptok.h preproc.h \
|
||||
regs.h
|
||||
|
@ -43,6 +43,7 @@ NASM = nasm.$(O) nasmlib.$(O) ver.$(O) \
|
||||
output/nullout.$(O) \
|
||||
output/outbin.$(O) output/outaout.$(O) output/outcoff.$(O) \
|
||||
output/outelf.$(O) output/outelf32.$(O) output/outelf64.$(O) \
|
||||
output/outelfx32.$(O) \
|
||||
output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \
|
||||
output/outdbg.$(O) output/outieee.$(O) output/outmac32.$(O) \
|
||||
output/outmac64.$(O) preproc.$(O) quote.$(O) pptok.$(O) \
|
||||
@ -258,6 +259,10 @@ output/outelf64.$(O): output/outelf64.c compiler.h directiv.h eval.h \
|
||||
insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
|
||||
output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
|
||||
preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
|
||||
output/outelfx32.$(O): output/outelfx32.c compiler.h directiv.h eval.h \
|
||||
insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
|
||||
output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
|
||||
preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
|
||||
output/outform.$(O): output/outform.c compiler.h directiv.h insnsi.h nasm.h \
|
||||
nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h
|
||||
output/outieee.$(O): output/outieee.c compiler.h directiv.h insnsi.h nasm.h \
|
||||
|
@ -39,6 +39,7 @@ NASM = nasm.o nasmlib.o ver.o \
|
||||
nullout.o \
|
||||
outbin.o outaout.o outcoff.o \
|
||||
outelf.o outelf32.o outelf64.o \
|
||||
outelfx32.o \
|
||||
outobj.o outas86.o outrdf2.o \
|
||||
outdbg.o outieee.o outmac32.o \
|
||||
outmac64.o preproc.o quote.o pptok.o \
|
||||
@ -193,6 +194,9 @@ outelf32.o: outelf32.c compiler.h config.h directiv.h eval.h insnsi.h nasm.h \
|
||||
outelf64.o: outelf64.c compiler.h config.h directiv.h eval.h insnsi.h nasm.h \
|
||||
nasmlib.h opflags.h dwarf.h elf.h outelf.h outform.h outlib.h stabs.h \
|
||||
pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
|
||||
outelfx32.o: outelfx32.c compiler.h config.h directiv.h eval.h insnsi.h \
|
||||
nasm.h nasmlib.h opflags.h dwarf.h elf.h outelf.h outform.h outlib.h \
|
||||
stabs.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
|
||||
outform.o: outform.c compiler.h config.h directiv.h insnsi.h nasm.h \
|
||||
nasmlib.h opflags.h outform.h pptok.h preproc.h regs.h
|
||||
outieee.o: outieee.c compiler.h config.h directiv.h insnsi.h nasm.h \
|
||||
|
@ -55,6 +55,7 @@ NASM = nasm.$(O) nasmlib.$(O) ver.$(O) &
|
||||
output/nullout.$(O) &
|
||||
output/outbin.$(O) output/outaout.$(O) output/outcoff.$(O) &
|
||||
output/outelf.$(O) output/outelf32.$(O) output/outelf64.$(O) &
|
||||
output/outelfx32.$(O) &
|
||||
output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) &
|
||||
output/outdbg.$(O) output/outieee.$(O) output/outmac32.$(O) &
|
||||
output/outmac64.$(O) preproc.$(O) quote.$(O) pptok.$(O) &
|
||||
@ -332,6 +333,10 @@ output/outelf64.$(O): output/outelf64.c compiler.h config.h directiv.h &
|
||||
eval.h insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h &
|
||||
output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h &
|
||||
preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
|
||||
output/outelfx32.$(O): output/outelfx32.c compiler.h config.h directiv.h &
|
||||
eval.h insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h &
|
||||
output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h &
|
||||
preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
|
||||
output/outform.$(O): output/outform.c compiler.h config.h directiv.h &
|
||||
insnsi.h nasm.h nasmlib.h opflags.h output/outform.h pptok.h preproc.h &
|
||||
regs.h
|
||||
|
@ -66,6 +66,7 @@ NASM = nasm.$(O) nasmlib.$(O) ver.$(O) \
|
||||
output/nullout.$(O) \
|
||||
output/outbin.$(O) output/outaout.$(O) output/outcoff.$(O) \
|
||||
output/outelf.$(O) output/outelf32.$(O) output/outelf64.$(O) \
|
||||
output/outelfx32.$(O) \
|
||||
output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \
|
||||
output/outdbg.$(O) output/outieee.$(O) output/outmac32.$(O) \
|
||||
output/outmac64.$(O) preproc.$(O) quote.$(O) pptok.$(O) \
|
||||
@ -297,6 +298,10 @@ output/outelf64.$(O): output/outelf64.c compiler.h directiv.h eval.h \
|
||||
insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
|
||||
output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
|
||||
preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
|
||||
output/outelfx32.$(O): output/outelfx32.c compiler.h directiv.h eval.h \
|
||||
insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \
|
||||
output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \
|
||||
preproc.h raa.h rbtree.h regs.h saa.h stdscan.h
|
||||
output/outform.$(O): output/outform.c compiler.h directiv.h insnsi.h nasm.h \
|
||||
nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h
|
||||
output/outieee.$(O): output/outieee.c compiler.h directiv.h insnsi.h nasm.h \
|
||||
|
@ -48,7 +48,7 @@
|
||||
#include "output/elf.h"
|
||||
#include "output/outelf.h"
|
||||
|
||||
#if defined(OF_ELF32) || defined(OF_ELF64)
|
||||
#if defined(OF_ELF32) || defined(OF_ELF64) || defined(OF_ELFX32)
|
||||
|
||||
const struct elf_known_section elf_known_sections[] = {
|
||||
{ ".text", SHT_PROGBITS, SHF_ALLOC|SHF_EXECINSTR, 16 },
|
||||
@ -120,4 +120,4 @@ void section_attrib(char *name, char *attr, int pass,
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* defined(OF_ELF32) || defined(OF_ELF64) */
|
||||
#endif /* defined(OF_ELF32) || defined(OF_ELF64) || defined(OF_ELFX32) */
|
||||
|
2194
output/outelfx32.c
Normal file
2194
output/outelfx32.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -106,6 +106,9 @@
|
||||
#ifndef OF_ELF32
|
||||
#define OF_ELF32
|
||||
#endif
|
||||
#ifndef OF_ELFX32
|
||||
#define OF_ELFX32
|
||||
#endif
|
||||
#ifndef OF_ELF64
|
||||
#define OF_ELF64
|
||||
#endif
|
||||
@ -179,6 +182,9 @@
|
||||
#ifndef OF_ELF64
|
||||
#define OF_ELF64
|
||||
#endif
|
||||
#ifndef OF_ELFX32
|
||||
#define OF_ELFX32
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef OF_OTHERS
|
||||
@ -215,6 +221,9 @@
|
||||
#ifdef OF_NO_ELF64
|
||||
#undef OF_ELF64
|
||||
#endif
|
||||
#ifdef OF_NO_ELFX32
|
||||
#undef OF_ELFX32
|
||||
#endif
|
||||
#ifdef OF_NO_AOUT
|
||||
#undef OF_AOUT
|
||||
#endif
|
||||
@ -260,6 +269,7 @@ extern struct ofmt of_aout;
|
||||
extern struct ofmt of_aoutb;
|
||||
extern struct ofmt of_coff;
|
||||
extern struct ofmt of_elf32;
|
||||
extern struct ofmt of_elfx32;
|
||||
extern struct ofmt of_elf64;
|
||||
extern struct ofmt of_as86;
|
||||
extern struct ofmt of_obj;
|
||||
@ -299,6 +309,9 @@ static struct ofmt *drivers[] = {
|
||||
#ifdef OF_ELF64
|
||||
&of_elf64,
|
||||
#endif
|
||||
#ifdef OF_ELFX32
|
||||
&of_elfx32,
|
||||
#endif
|
||||
#ifdef OF_AS86
|
||||
&of_as86,
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user