nasm/output/outas86.c

642 lines
17 KiB
C
Raw Normal View History

2002-04-30 20:51:32 +00:00
/* outas86.c output routines for the Netwide Assembler to produce
* Linux as86 (bin86-0.3) object files
*
* The Netwide Assembler is copyright (C) 1996 Simon Tatham and
* Julian Hall. All rights reserved. The software is
* redistributable under the license given in the file "LICENSE"
2002-04-30 20:51:32 +00:00
* distributed in the NASM archive.
*/
#include "compiler.h"
2002-04-30 20:51:32 +00:00
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <inttypes.h>
2002-04-30 20:51:32 +00:00
#include "nasm.h"
#include "nasmlib.h"
#include "saa.h"
#include "raa.h"
2002-04-30 20:51:32 +00:00
#include "outform.h"
#ifdef OF_AS86
struct Piece {
struct Piece *next;
2005-01-15 22:15:51 +00:00
int type; /* 0 = absolute, 1 = seg, 2 = sym */
int32_t offset; /* relative offset */
int number; /* symbol/segment number (4=bss) */
int32_t bytes; /* size of reloc or of absolute data */
bool relative; /* relative address? */
2002-04-30 20:51:32 +00:00
};
struct Symbol {
int32_t strpos; /* string table position of name */
2005-01-15 22:15:51 +00:00
int flags; /* symbol flags */
int segment; /* 4=bss at this point */
int32_t value; /* address, or COMMON variable size */
2002-04-30 20:51:32 +00:00
};
/*
* Section IDs - used in Piece.number and Symbol.segment.
*/
2005-01-15 22:15:51 +00:00
#define SECT_TEXT 0 /* text section */
#define SECT_DATA 3 /* data section */
#define SECT_BSS 4 /* bss section */
2002-04-30 20:51:32 +00:00
/*
* Flags used in Symbol.flags.
*/
#define SYM_ENTRY (1<<8)
#define SYM_EXPORT (1<<7)
#define SYM_IMPORT (1<<6)
#define SYM_ABSOLUTE (1<<4)
struct Section {
struct SAA *data;
uint32_t datalen, size, len;
int32_t index;
2002-04-30 20:51:32 +00:00
struct Piece *head, *last, **tail;
};
static char as86_module[FILENAME_MAX];
2002-04-30 20:51:32 +00:00
static struct Section stext, sdata;
static uint32_t bsslen;
static int32_t bssindex;
2002-04-30 20:51:32 +00:00
static struct SAA *syms;
static uint32_t nsyms;
2002-04-30 20:51:32 +00:00
static struct RAA *bsym;
static struct SAA *strs;
static uint32_t strslen;
2002-04-30 20:51:32 +00:00
static int as86_reloc_size;
static FILE *as86fp;
static efunc error;
static void as86_write(void);
2005-01-15 22:15:51 +00:00
static void as86_write_section(struct Section *, int);
static int as86_add_string(char *name);
static void as86_sect_write(struct Section *, const uint8_t *,
uint32_t);
2002-04-30 20:51:32 +00:00
2005-01-15 22:15:51 +00:00
static void as86_init(FILE * fp, efunc errfunc, ldfunc ldef, evalfunc eval)
2002-04-30 20:53:55 +00:00
{
2002-04-30 20:51:32 +00:00
as86fp = fp;
error = errfunc;
2005-01-15 22:15:51 +00:00
(void)ldef; /* placate optimisers */
2007-04-14 00:46:25 +00:00
(void)eval;
2005-01-15 22:15:51 +00:00
stext.data = saa_init(1L);
stext.datalen = 0L;
2002-04-30 20:51:32 +00:00
stext.head = stext.last = NULL;
stext.tail = &stext.head;
2005-01-15 22:15:51 +00:00
sdata.data = saa_init(1L);
sdata.datalen = 0L;
2002-04-30 20:51:32 +00:00
sdata.head = sdata.last = NULL;
sdata.tail = &sdata.head;
bsslen =
2005-01-15 22:15:51 +00:00
stext.len = stext.datalen = stext.size =
sdata.len = sdata.datalen = sdata.size = 0;
2002-04-30 20:51:32 +00:00
stext.index = seg_alloc();
sdata.index = seg_alloc();
bssindex = seg_alloc();
syms = saa_init((int32_t)sizeof(struct Symbol));
2002-04-30 20:51:32 +00:00
nsyms = 0;
bsym = raa_init();
strs = saa_init(1L);
strslen = 0;
2005-01-15 22:15:51 +00:00
as86_add_string(as86_module);
2002-04-30 20:51:32 +00:00
}
2005-01-15 22:15:51 +00:00
static void as86_cleanup(int debuginfo)
2002-04-30 20:53:55 +00:00
{
2002-04-30 20:51:32 +00:00
struct Piece *p;
2005-01-15 22:15:51 +00:00
(void)debuginfo;
2002-04-30 20:53:55 +00:00
2002-04-30 20:51:32 +00:00
as86_write();
2005-01-15 22:15:51 +00:00
fclose(as86fp);
saa_free(stext.data);
2002-04-30 20:51:32 +00:00
while (stext.head) {
2005-01-15 22:15:51 +00:00
p = stext.head;
stext.head = stext.head->next;
nasm_free(p);
2002-04-30 20:51:32 +00:00
}
2005-01-15 22:15:51 +00:00
saa_free(sdata.data);
2002-04-30 20:51:32 +00:00
while (sdata.head) {
2005-01-15 22:15:51 +00:00
p = sdata.head;
sdata.head = sdata.head->next;
nasm_free(p);
2002-04-30 20:51:32 +00:00
}
2005-01-15 22:15:51 +00:00
saa_free(syms);
raa_free(bsym);
saa_free(strs);
2002-04-30 20:51:32 +00:00
}
static int32_t as86_section_names(char *name, int pass, int *bits)
2002-04-30 20:53:55 +00:00
{
2007-04-14 00:46:25 +00:00
(void)pass;
2002-04-30 20:51:32 +00:00
/*
* Default is 16 bits.
*/
if (!name)
2005-01-15 22:15:51 +00:00
*bits = 16;
2002-04-30 20:51:32 +00:00
if (!name)
2005-01-15 22:15:51 +00:00
return stext.index;
2002-04-30 20:51:32 +00:00
if (!strcmp(name, ".text"))
2005-01-15 22:15:51 +00:00
return stext.index;
2002-04-30 20:51:32 +00:00
else if (!strcmp(name, ".data"))
2005-01-15 22:15:51 +00:00
return sdata.index;
2002-04-30 20:51:32 +00:00
else if (!strcmp(name, ".bss"))
2005-01-15 22:15:51 +00:00
return bssindex;
2002-04-30 20:51:32 +00:00
else
2005-01-15 22:15:51 +00:00
return NO_SEG;
2002-04-30 20:51:32 +00:00
}
static int as86_add_string(char *name)
2002-04-30 20:53:55 +00:00
{
2002-04-30 20:51:32 +00:00
int pos = strslen;
int length = strlen(name);
saa_wbytes(strs, name, (int32_t)(length + 1));
2005-01-15 22:15:51 +00:00
strslen += 1 + length;
2002-04-30 20:51:32 +00:00
return pos;
}
2007-11-06 01:19:32 +00:00
static void as86_deflabel(char *name, int32_t segment, int64_t offset,
int is_global, char *special)
2002-04-30 20:53:55 +00:00
{
2002-04-30 20:51:32 +00:00
struct Symbol *sym;
2002-04-30 20:52:49 +00:00
if (special)
2005-01-15 22:15:51 +00:00
error(ERR_NONFATAL, "as86 format does not support any"
" special symbol types");
2002-04-30 20:52:49 +00:00
2002-04-30 20:52:26 +00:00
if (name[0] == '.' && name[1] == '.' && name[2] != '@') {
2005-01-15 22:15:51 +00:00
error(ERR_NONFATAL, "unrecognised special symbol `%s'", name);
return;
2002-04-30 20:51:32 +00:00
}
2005-01-15 22:15:51 +00:00
sym = saa_wstruct(syms);
2002-04-30 20:51:32 +00:00
2005-01-15 22:15:51 +00:00
sym->strpos = as86_add_string(name);
2002-04-30 20:51:32 +00:00
sym->flags = 0;
if (segment == NO_SEG)
2005-01-15 22:15:51 +00:00
sym->flags |= SYM_ABSOLUTE, sym->segment = 0;
2002-04-30 20:51:32 +00:00
else if (segment == stext.index)
2005-01-15 22:15:51 +00:00
sym->segment = SECT_TEXT;
2002-04-30 20:51:32 +00:00
else if (segment == sdata.index)
2005-01-15 22:15:51 +00:00
sym->segment = SECT_DATA;
2002-04-30 20:51:32 +00:00
else if (segment == bssindex)
2005-01-15 22:15:51 +00:00
sym->segment = SECT_BSS;
2002-04-30 20:51:32 +00:00
else {
2005-01-15 22:15:51 +00:00
sym->flags |= SYM_IMPORT;
sym->segment = 15;
2002-04-30 20:51:32 +00:00
}
if (is_global == 2)
2005-01-15 22:15:51 +00:00
sym->segment = 3; /* already have IMPORT */
2002-04-30 20:51:32 +00:00
if (is_global && !(sym->flags & SYM_IMPORT))
2005-01-15 22:15:51 +00:00
sym->flags |= SYM_EXPORT;
2002-04-30 20:51:32 +00:00
sym->value = offset;
/*
* define the references from external-symbol segment numbers
* to these symbol records.
*/
if (segment != NO_SEG && segment != stext.index &&
2005-01-15 22:15:51 +00:00
segment != sdata.index && segment != bssindex)
bsym = raa_write(bsym, segment, nsyms);
2002-04-30 20:51:32 +00:00
nsyms++;
}
static void as86_add_piece(struct Section *sect, int type, int32_t offset,
int32_t segment, int32_t bytes, int relative)
2002-04-30 20:53:55 +00:00
{
2002-04-30 20:51:32 +00:00
struct Piece *p;
sect->len += bytes;
if (type == 0 && sect->last && sect->last->type == 0) {
2005-01-15 22:15:51 +00:00
sect->last->bytes += bytes;
return;
2002-04-30 20:51:32 +00:00
}
p = sect->last = *sect->tail = nasm_malloc(sizeof(struct Piece));
sect->tail = &p->next;
p->next = NULL;
p->type = type;
p->offset = offset;
p->bytes = bytes;
p->relative = relative;
if (type == 1 && segment == stext.index)
2005-01-15 22:15:51 +00:00
p->number = SECT_TEXT;
2002-04-30 20:51:32 +00:00
else if (type == 1 && segment == sdata.index)
2005-01-15 22:15:51 +00:00
p->number = SECT_DATA;
2002-04-30 20:51:32 +00:00
else if (type == 1 && segment == bssindex)
2005-01-15 22:15:51 +00:00
p->number = SECT_BSS;
2002-04-30 20:51:32 +00:00
else if (type == 1)
2005-01-15 22:15:51 +00:00
p->number = raa_read(bsym, segment), p->type = 2;
2002-04-30 20:51:32 +00:00
}
static void as86_out(int32_t segto, const void *data,
enum out_type type, uint64_t size,
int32_t segment, int32_t wrt)
2002-04-30 20:53:55 +00:00
{
2002-04-30 20:51:32 +00:00
struct Section *s;
int32_t offset;
uint8_t mydata[4], *p;
2002-04-30 20:51:32 +00:00
if (wrt != NO_SEG) {
2005-01-15 22:15:51 +00:00
wrt = NO_SEG; /* continue to do _something_ */
error(ERR_NONFATAL, "WRT not supported by as86 output format");
2002-04-30 20:51:32 +00:00
}
/*
* handle absolute-assembly (structure definitions)
*/
if (segto == NO_SEG) {
2005-01-15 22:15:51 +00:00
if (type != OUT_RESERVE)
error(ERR_NONFATAL, "attempt to assemble code in [ABSOLUTE]"
" space");
return;
2002-04-30 20:51:32 +00:00
}
if (segto == stext.index)
2005-01-15 22:15:51 +00:00
s = &stext;
2002-04-30 20:51:32 +00:00
else if (segto == sdata.index)
2005-01-15 22:15:51 +00:00
s = &sdata;
2002-04-30 20:51:32 +00:00
else if (segto == bssindex)
2005-01-15 22:15:51 +00:00
s = NULL;
2002-04-30 20:51:32 +00:00
else {
2005-01-15 22:15:51 +00:00
error(ERR_WARNING, "attempt to assemble code in"
" segment %d: defaulting to `.text'", segto);
s = &stext;
2002-04-30 20:51:32 +00:00
}
if (!s && type != OUT_RESERVE) {
error(ERR_WARNING, "attempt to initialize memory in the"
2005-01-15 22:15:51 +00:00
" BSS section: ignored");
if (type == OUT_REL2ADR)
size = 2;
2005-01-15 22:15:51 +00:00
else if (type == OUT_REL4ADR)
size = 4;
bsslen += size;
2005-01-15 22:15:51 +00:00
return;
2002-04-30 20:51:32 +00:00
}
if (type == OUT_RESERVE) {
2005-01-15 22:15:51 +00:00
if (s) {
error(ERR_WARNING, "uninitialized space declared in"
2005-01-15 22:15:51 +00:00
" %s section: zeroing",
(segto == stext.index ? "code" : "data"));
as86_sect_write(s, NULL, size);
as86_add_piece(s, 0, 0L, 0L, size, 0);
2005-01-15 22:15:51 +00:00
} else
bsslen += size;
2002-04-30 20:51:32 +00:00
} else if (type == OUT_RAWDATA) {
2005-01-15 22:15:51 +00:00
if (segment != NO_SEG)
error(ERR_PANIC, "OUT_RAWDATA with other than NO_SEG");
as86_sect_write(s, data, size);
as86_add_piece(s, 0, 0L, 0L, size, 0);
2002-04-30 20:51:32 +00:00
} else if (type == OUT_ADDRESS) {
2005-01-15 22:15:51 +00:00
if (segment != NO_SEG) {
if (segment % 2) {
error(ERR_NONFATAL, "as86 format does not support"
" segment base references");
} else {
offset = *(int64_t *)data;
as86_add_piece(s, 1, offset, segment, size, 0);
2005-01-15 22:15:51 +00:00
}
} else {
p = mydata;
WRITELONG(p, *(int64_t *)data);
as86_sect_write(s, data, size);
as86_add_piece(s, 0, 0L, 0L, size, 0);
2005-01-15 22:15:51 +00:00
}
2002-04-30 20:51:32 +00:00
} else if (type == OUT_REL2ADR) {
2005-01-15 22:15:51 +00:00
if (segment == segto)
error(ERR_PANIC, "intra-segment OUT_REL2ADR");
if (segment != NO_SEG) {
if (segment % 2) {
error(ERR_NONFATAL, "as86 format does not support"
" segment base references");
} else {
offset = *(int64_t *)data;
as86_add_piece(s, 1, offset - size + 2, segment, 2L,
2005-01-15 22:15:51 +00:00
1);
}
}
2002-04-30 20:51:32 +00:00
} else if (type == OUT_REL4ADR) {
2005-01-15 22:15:51 +00:00
if (segment == segto)
error(ERR_PANIC, "intra-segment OUT_REL4ADR");
if (segment != NO_SEG) {
if (segment % 2) {
error(ERR_NONFATAL, "as86 format does not support"
" segment base references");
} else {
offset = *(int64_t *)data;
as86_add_piece(s, 1, offset - size + 4, segment, 4L,
2005-01-15 22:15:51 +00:00
1);
}
}
2002-04-30 20:51:32 +00:00
}
}
2005-01-15 22:15:51 +00:00
static void as86_write(void)
2002-04-30 20:53:55 +00:00
{
uint32_t i;
int32_t symlen, seglen, segsize;
2002-04-30 20:51:32 +00:00
/*
* First, go through the symbol records working out how big
* each will be. Also fix up BSS references at this time, and
* set the flags words up completely.
*/
symlen = 0;
2005-01-15 22:15:51 +00:00
saa_rewind(syms);
2002-04-30 20:51:32 +00:00
for (i = 0; i < nsyms; i++) {
2005-01-15 22:15:51 +00:00
struct Symbol *sym = saa_rstruct(syms);
if (sym->segment == SECT_BSS)
sym->segment = SECT_DATA, sym->value += sdata.len;
sym->flags |= sym->segment;
if (sym->value == 0)
sym->flags |= 0 << 14, symlen += 4;
else if (sym->value >= 0 && sym->value <= 255)
sym->flags |= 1 << 14, symlen += 5;
else if (sym->value >= 0 && sym->value <= 65535L)
sym->flags |= 2 << 14, symlen += 6;
else
sym->flags |= 3 << 14, symlen += 8;
2002-04-30 20:51:32 +00:00
}
/*
* Now do the same for the segments, and get the segment size
* descriptor word at the same time.
*/
seglen = segsize = 0;
if ((uint32_t)stext.len > 65535L)
2005-01-15 22:15:51 +00:00
segsize |= 0x03000000L, seglen += 4;
2002-04-30 20:51:32 +00:00
else
2005-01-15 22:15:51 +00:00
segsize |= 0x02000000L, seglen += 2;
if ((uint32_t)sdata.len > 65535L)
2005-01-15 22:15:51 +00:00
segsize |= 0xC0000000L, seglen += 4;
2002-04-30 20:51:32 +00:00
else
2005-01-15 22:15:51 +00:00
segsize |= 0x80000000L, seglen += 2;
2002-04-30 20:51:32 +00:00
/*
* Emit the as86 header.
*/
fwriteint32_t(0x000186A3L, as86fp);
2005-01-15 22:15:51 +00:00
fputc(0x2A, as86fp);
fwriteint32_t(27 + symlen + seglen + strslen, as86fp); /* header length */
fwriteint32_t(stext.len + sdata.len + bsslen, as86fp);
fwriteint16_t(strslen, as86fp);
fwriteint16_t(0, as86fp); /* class = revision = 0 */
fwriteint32_t(0x55555555L, as86fp); /* segment max sizes: always this */
fwriteint32_t(segsize, as86fp); /* segment size descriptors */
2002-04-30 20:52:08 +00:00
if (segsize & 0x01000000L)
fwriteint32_t(stext.len, as86fp);
2002-04-30 20:51:32 +00:00
else
fwriteint16_t(stext.len, as86fp);
2002-04-30 20:52:08 +00:00
if (segsize & 0x40000000L)
fwriteint32_t(sdata.len + bsslen, as86fp);
2002-04-30 20:51:32 +00:00
else
fwriteint16_t(sdata.len + bsslen, as86fp);
fwriteint16_t(nsyms, as86fp);
2002-04-30 20:51:32 +00:00
/*
* Write the symbol table.
*/
2005-01-15 22:15:51 +00:00
saa_rewind(syms);
2002-04-30 20:51:32 +00:00
for (i = 0; i < nsyms; i++) {
2005-01-15 22:15:51 +00:00
struct Symbol *sym = saa_rstruct(syms);
fwriteint16_t(sym->strpos, as86fp);
fwriteint16_t(sym->flags, as86fp);
2005-01-15 22:15:51 +00:00
switch (sym->flags & (3 << 14)) {
case 0 << 14:
break;
case 1 << 14:
fputc(sym->value, as86fp);
break;
case 2 << 14:
fwriteint16_t(sym->value, as86fp);
2005-01-15 22:15:51 +00:00
break;
case 3 << 14:
fwriteint32_t(sym->value, as86fp);
2005-01-15 22:15:51 +00:00
break;
}
2002-04-30 20:51:32 +00:00
}
/*
* Write out the string table.
*/
2005-01-15 22:15:51 +00:00
saa_fpwrite(strs, as86fp);
2002-04-30 20:51:32 +00:00
/*
* Write the program text.
*/
as86_reloc_size = -1;
2005-01-15 22:15:51 +00:00
as86_write_section(&stext, SECT_TEXT);
as86_write_section(&sdata, SECT_DATA);
/*
* Append the BSS section to the .data section
*/
if (bsslen > 65535L) {
2005-01-15 22:15:51 +00:00
fputc(0x13, as86fp);
fwriteint32_t(bsslen, as86fp);
2005-01-15 22:15:51 +00:00
} else if (bsslen > 255) {
fputc(0x12, as86fp);
fwriteint16_t(bsslen, as86fp);
2005-01-15 22:15:51 +00:00
} else if (bsslen) {
fputc(0x11, as86fp);
fputc(bsslen, as86fp);
}
2005-01-15 22:15:51 +00:00
fputc(0, as86fp); /* termination */
2002-04-30 20:51:32 +00:00
}
2005-01-15 22:15:51 +00:00
static void as86_set_rsize(int size)
2002-04-30 20:53:55 +00:00
{
2002-04-30 20:51:32 +00:00
if (as86_reloc_size != size) {
2005-01-15 22:15:51 +00:00
switch (as86_reloc_size = size) {
case 1:
fputc(0x01, as86fp);
break;
case 2:
fputc(0x02, as86fp);
break;
case 4:
fputc(0x03, as86fp);
break;
default:
error(ERR_PANIC, "bizarre relocation size %d", size);
}
2002-04-30 20:51:32 +00:00
}
}
2005-01-15 22:15:51 +00:00
static void as86_write_section(struct Section *sect, int index)
2002-04-30 20:53:55 +00:00
{
2002-04-30 20:51:32 +00:00
struct Piece *p;
uint32_t s;
int32_t length;
2002-04-30 20:51:32 +00:00
2005-01-15 22:15:51 +00:00
fputc(0x20 + index, as86fp); /* select the right section */
2002-04-30 20:51:32 +00:00
2005-01-15 22:15:51 +00:00
saa_rewind(sect->data);
2002-04-30 20:51:32 +00:00
for (p = sect->head; p; p = p->next)
2005-01-15 22:15:51 +00:00
switch (p->type) {
case 0:
/*
* Absolute data. Emit it in chunks of at most 64
* bytes.
*/
length = p->bytes;
do {
char buf[64];
int32_t tmplen = (length > 64 ? 64 : length);
2005-01-15 22:15:51 +00:00
fputc(0x40 | (tmplen & 0x3F), as86fp);
saa_rnbytes(sect->data, buf, tmplen);
fwrite(buf, 1, tmplen, as86fp);
length -= tmplen;
} while (length > 0);
break;
case 1:
/*
* A segment-type relocation. First fix up the BSS.
*/
if (p->number == SECT_BSS)
p->number = SECT_DATA, p->offset += sdata.len;
as86_set_rsize(p->bytes);
fputc(0x80 | (p->relative ? 0x20 : 0) | p->number, as86fp);
if (as86_reloc_size == 2)
fwriteint16_t(p->offset, as86fp);
2005-01-15 22:15:51 +00:00
else
fwriteint32_t(p->offset, as86fp);
2005-01-15 22:15:51 +00:00
break;
case 2:
/*
* A symbol-type relocation.
*/
as86_set_rsize(p->bytes);
s = p->offset;
if (s > 65535L)
s = 3;
else if (s > 255)
s = 2;
else if (s > 0)
s = 1;
else
s = 0;
fputc(0xC0 |
(p->relative ? 0x20 : 0) |
(p->number > 255 ? 0x04 : 0) | s, as86fp);
if (p->number > 255)
fwriteint16_t(p->number, as86fp);
2005-01-15 22:15:51 +00:00
else
fputc(p->number, as86fp);
switch ((int)s) {
case 0:
break;
case 1:
fputc(p->offset, as86fp);
break;
case 2:
fwriteint16_t(p->offset, as86fp);
2005-01-15 22:15:51 +00:00
break;
case 3:
fwriteint32_t(p->offset, as86fp);
2005-01-15 22:15:51 +00:00
break;
}
break;
}
2002-04-30 20:51:32 +00:00
}
2005-01-15 22:15:51 +00:00
static void as86_sect_write(struct Section *sect,
const uint8_t *data, uint32_t len)
2002-04-30 20:53:55 +00:00
{
2005-01-15 22:15:51 +00:00
saa_wbytes(sect->data, data, len);
2002-04-30 20:51:32 +00:00
sect->datalen += len;
}
static int32_t as86_segbase(int32_t segment)
2002-04-30 20:53:55 +00:00
{
2002-04-30 20:51:32 +00:00
return segment;
}
static int as86_directive(char *directive, char *value, int pass)
2002-04-30 20:53:55 +00:00
{
2007-04-14 00:46:25 +00:00
(void)directive;
(void)value;
(void)pass;
2002-04-30 20:51:32 +00:00
return 0;
}
static void as86_filename(char *inname, char *outname, efunc error)
2002-04-30 20:53:55 +00:00
{
char *p;
2002-04-30 20:51:32 +00:00
2005-01-15 22:15:51 +00:00
if ((p = strrchr(inname, '.')) != NULL) {
strncpy(as86_module, inname, p - inname);
as86_module[p - inname] = '\0';
2002-04-30 20:51:32 +00:00
} else
2005-01-15 22:15:51 +00:00
strcpy(as86_module, inname);
2002-04-30 20:51:32 +00:00
2005-01-15 22:15:51 +00:00
standard_extension(inname, outname, ".o", error);
2002-04-30 20:51:32 +00:00
}
extern macros_t as86_stdmac[];
2002-04-30 20:52:49 +00:00
static int as86_set_info(enum geninfo type, char **val)
2002-04-30 20:53:55 +00:00
{
2007-04-14 00:46:25 +00:00
(void)type;
(void)val;
2002-04-30 20:53:55 +00:00
return 0;
}
void as86_linenumber(char *name, int32_t segment, int32_t offset, int is_main,
2005-01-15 22:15:51 +00:00
int lineno)
2002-04-30 20:53:55 +00:00
{
2007-04-14 00:46:25 +00:00
(void)name;
(void)segment;
(void)offset;
(void)is_main;
(void)lineno;
2002-04-30 20:53:55 +00:00
}
2002-04-30 20:51:32 +00:00
struct ofmt of_as86 = {
"Linux as86 (bin86 version 0.3) object files",
"as86",
2002-04-30 20:53:55 +00:00
NULL,
null_debug_arr,
&null_debug_form,
2002-04-30 20:52:49 +00:00
as86_stdmac,
2002-04-30 20:51:32 +00:00
as86_init,
2002-04-30 20:53:55 +00:00
as86_set_info,
2002-04-30 20:51:32 +00:00
as86_out,
2005-01-15 22:15:51 +00:00
as86_deflabel,
2002-04-30 20:51:32 +00:00
as86_section_names,
as86_segbase,
as86_directive,
as86_filename,
as86_cleanup
};
2005-01-15 22:15:51 +00:00
#endif /* OF_AS86 */