]> Shamusworld >> Repos - rmac/blob - object.h
Version bump for last commit; now at v2.0.23.
[rmac] / object.h
1 //
2 // RMAC - Reboot's Macro Assembler for all Atari computers
3 // OBJECT.H - Writing Object Files
4 // Copyright (C) 199x Landon Dyer, 2011-2020 Reboot and Friends
5 // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
6 // Source utilised with the kind permission of Landon Dyer
7 //
8
9 #ifndef __OBJECT_H__
10 #define __OBJECT_H__
11
12 #include "rmac.h"
13
14 #define BSDHDRSIZE  0x20        // Size of BSD header
15 #define HDRSIZE     0x1C        // Size of Alcyon header
16
17 //
18 // Alcyon symbol flags
19 //
20 #define AL_DEFINED      0x8000
21 #define AL_EQUATED      0x4000
22 #define AL_GLOBAL       0x2000
23 #define AL_EQUREG       0x1000
24 #define AL_EXTERN       0x0800
25 #define AL_DATA         0x0400
26 #define AL_TEXT         0x0200
27 #define AL_BSS          0x0100
28 #define AL_FILE         0x0080
29
30 enum ELFSectionNames
31 {
32         ES_NULL, ES_TEXT, ES_DATA, ES_BSS, ES_RELATEXT, ES_RELADATA, ES_SHSTRTAB,
33         ES_SYMTAB, ES_STRTAB
34 };
35
36 //
37 // ELF special section indices (field st_shndx)
38 // Lifted from glibc (https://sourceware.org/git/?p=glibc.git;a=blob;f=elf/elf.h)
39 //
40 #define SHN_UNDEF       0               /* Undefined section */
41 #define SHN_ABS         0xFFF1          /* Associated symbol is absolute */
42 #define SHN_COMMON      0xFFF2          /* Associated symbol is common */
43
44 // Exported variables.
45 extern uint8_t * objImage;
46 extern int elfHdrNum[];
47 extern uint32_t extraSyms;
48
49 // Exported functions
50 int WriteObject(int);
51
52 #endif // __OBJECT_H__
53