dmd.backend.cgobj

Compiler implementation of the D programming language.

Members

Enums

RHEADR
anonymousenum RHEADR

Record types:

Functions

OmfObj_alias
void OmfObj_alias(const(char)* n1, const(char)* n2)

Output an alias definition record.

OmfObj_allowZeroSize
bool OmfObj_allowZeroSize()

Do we allow zero sized objects?

OmfObj_byte
void OmfObj_byte(int seg, targ_size_t offset, uint _byte)

Output byte to object file.

OmfObj_bytes
size_t OmfObj_bytes(int seg, targ_size_t offset, size_t nbytes, const(void)* p)

Output bytes to object file.

OmfObj_codeseg
int OmfObj_codeseg(char* name, int suffix)

Define a new code segment. Input: name name of segment, if null then revert to default suffix 0 use name as is 1 append "_TEXT" to name Output: cseg segment index of new current code segment Coffset starting offset in cseg

OmfObj_comdatsize
int OmfObj_comdatsize(Symbol* s, targ_size_t symsize)

Setup for Symbol s to go into a COMDAT segment. Output (if s is a function): cseg segment index of new current code segment Coffset starting offset in cseg

OmfObj_compiler
void OmfObj_compiler(const(char)* p)

Embed compiler version in .obj file.

OmfObj_data_readonly
int OmfObj_data_readonly(char* p, int len, int* pseg)

Ouput read only data for data. Output: *pseg segment of that data

OmfObj_data_start
int OmfObj_data_start(Symbol* sdata, targ_size_t datasize, int seg)

Update data information about symbol align for output and assign segment if not already specified.

OmfObj_dosseg
void OmfObj_dosseg()

Output DOSSEG coment record.

OmfObj_ehtables
void OmfObj_ehtables(Symbol* sfunc, uint size, Symbol* ehsym)

Stuff pointer to function in its own segment. Used for static ctor and dtor lists.

OmfObj_exestr
void OmfObj_exestr(const(char)* p)

Embed string in executable.

OmfObj_export_symbol
void OmfObj_export_symbol(Symbol* s, uint argsize)

Export a function name.

OmfObj_external
int OmfObj_external(Symbol* s)

Output an external definition. Input: s Symbol to do EXTDEF on

OmfObj_far16thunk
void OmfObj_far16thunk(Symbol* s)

Generate far16 thunk. Input: s Symbol to generate a thunk for

OmfObj_fardata
int OmfObj_fardata(char* name, targ_size_t size, targ_size_t* poffset)

Define a far data segment. Input: name Name of module size Size of the segment to be created

OmfObj_fltused
void OmfObj_fltused()

Mark object file as using floating point.

OmfObj_func_term
void OmfObj_func_term(Symbol* sfunc)

Update function info after codgen

OmfObj_import
void OmfObj_import(elem* e)

Convert reference to imported name.

OmfObj_includelib
bool OmfObj_includelib(char[] name)

Output library name. Output: name is modified

OmfObj_init
Obj OmfObj_init(OutBuffer* objbuf, const(char)* filename, const(char)* csegname)

Perform initialization that applies to all .obj output files. Input: filename source file name csegname code segment name (can be null)

OmfObj_initfile
void OmfObj_initfile(const(char)* filename, const(char)* csegname, const(char)* modname)

Initialize the start of object output for this particular .obj file.

OmfObj_jmpTableSegment
int OmfObj_jmpTableSegment(Symbol* s)
OmfObj_ledata
void OmfObj_ledata(int seg, targ_size_t offset, targ_size_t data, uint lcfd, uint idx1, uint idx2)

Output word of data. (Two words if segment:offset pair.) Input: seg CODE, DATA, CDATA, UDATA offset offset of start of data data word of data lcfd LCxxxx | FDxxxx if (FD_F2 | FD_T6) idx1 = external Symbol # else idx1 = frame datum idx2 = target datum

OmfObj_lidata
void OmfObj_lidata(int seg, targ_size_t offset, targ_size_t count)

Output an iterated data block of 0s. (uninitialized data only)

OmfObj_linkerdirective
bool OmfObj_linkerdirective(const(char)* name)

Output linker directive. Output: directive is modified

OmfObj_linnum
void OmfObj_linnum(Srcpos srcpos, int seg, targ_size_t offset)

Record line number linnum at offset.

OmfObj_lzext
void OmfObj_lzext(Symbol* s1, Symbol* s2)

Output a lazy extern record. s1 is the lazy extern, s2 is its default resolution.

OmfObj_mangle
size_t OmfObj_mangle(Symbol* s, char* dest)

Mangle a name.

OmfObj_moduleinfo
void OmfObj_moduleinfo(Symbol* scc)

Append pointer to ModuleInfo to "FM" segment. The FM segment is bracketed by the empty FMB and FME segments.

OmfObj_reftocodeseg
void OmfObj_reftocodeseg(int seg, targ_size_t offset, targ_size_t val)

Refer to address that is in the code segment. Only offsets are output, regardless of the memory model. Used to put values in switch address tables. Input: seg = where the address is going (CODE or DATA) offset = offset within seg val = displacement from start of this module

OmfObj_reftodatseg
void OmfObj_reftodatseg(int seg, targ_size_t offset, targ_size_t val, uint targetdatum, int flags)

Refer to address that is in the data segment. Input: seg = where the address is going offset = offset within seg val = displacement from address targetdatum = DATA, CDATA or UDATA, depending where the address is flags = CFoff, CFseg

OmfObj_reftofarseg
void OmfObj_reftofarseg(int seg, targ_size_t offset, targ_size_t val, int farseg, int flags)

Refer to address that is in a far segment. Input: seg = where the address is going offset = offset within seg val = displacement from address farseg = far segment index flags = CFoff, CFseg

OmfObj_reftoident
int OmfObj_reftoident(int seg, targ_size_t offset, Symbol* s, targ_size_t val, int flags)

Refer to an identifier. Input: seg = where the address is going (CODE or DATA) offset = offset within seg s . Symbol table entry for identifier val = displacement from identifier flags = CFselfrel: self-relative CFseg: get segment CFoff: get offset

OmfObj_segment_group
void OmfObj_segment_group(targ_size_t codesize, targ_size_t datasize, targ_size_t cdatasize, targ_size_t udatasize)

Output segment and group definitions. Input: codesize size of code segment datasize size of initialized data segment cdatasize size of initialized const data segment udatasize size of uninitialized data segment

OmfObj_setModuleCtorDtor
void OmfObj_setModuleCtorDtor(Symbol* s, bool isCtor)

Set up function to be called as static constructor on program startup or static destructor on program shutdown.

OmfObj_setcodeseg
void OmfObj_setcodeseg(int seg)

Reset code seg to existing seg. Used after a COMDAT for a function is done.

OmfObj_startaddress
void OmfObj_startaddress(Symbol* s)

Set start address

OmfObj_staticctor
void OmfObj_staticctor(Symbol* s, int dtor, int seg)

Symbol is the function that calls the static constructors. Put a pointer to it into a special segment that the startup code looks at. Input: s static constructor function dtor number of static destructors seg 1: user 2: lib 3: compiler

OmfObj_string_literal_segment
int OmfObj_string_literal_segment(uint sz)

Get segment for readonly string literals. The linker will pool strings in this section.

OmfObj_sym_cdata
Symbol* OmfObj_sym_cdata(tym_t ty, char* p, int len)

Output read only data and generate a symbol for it.

OmfObj_term
void OmfObj_term(const(char)* objfilename)

Terminate package.

OmfObj_termfile
void OmfObj_termfile()

Fixup and terminate object file.

OmfObj_theadr
void OmfObj_theadr(const(char)* modname)

Output module name record.

OmfObj_tlsseg_bss
seg_data* OmfObj_tlsseg_bss()

Define segment for Thread Local Storage. Output: tlsseg set to segment number for TLS segment.

OmfObj_user
void OmfObj_user(const(char)* p)

Embed string in obj.

OmfObj_wkext
void OmfObj_wkext(Symbol* s1, Symbol* s2)

Output a weak extern record. s1 is the weak extern, s2 is its default resolution.

OmfObj_write_byte
void OmfObj_write_byte(seg_data* pseg, uint _byte)

Append byte to segment.

OmfObj_write_bytes
void OmfObj_write_bytes(seg_data* pseg, const(void[]) a)

Append bytes to segment.

OmfObj_write_long
void OmfObj_write_long(int seg, targ_size_t offset, uint data, uint lcfd, uint idx1, uint idx2)

Output long word of data. Input: seg CODE, DATA, CDATA, UDATA offset offset of start of data data long word of data Present only if size == 2: lcfd LCxxxx | FDxxxx if (FD_F2 | FD_T6) idx1 = external Symbol # else idx1 = frame datum idx2 = target datum

OmfObj_write_pointerRef
void OmfObj_write_pointerRef(Symbol* s, uint soff)

write a reference to a mutable pointer into the object file

OmfObj_write_zeros
void OmfObj_write_zeros(seg_data* pseg, targ_size_t count)

Append an iterated data block of 0s. (uninitialized data only)

SEG_ATTR
uint SEG_ATTR(uint A, uint C, uint B, uint P)

For defining segments.

getindex
int getindex(ubyte* p)

Read index.

getsegment
seg_data* getsegment()

Allocate a new segment. Return index for the new segment.

instypidx
int instypidx(char* p, uint index)

Insert a type index number. Input: p . where to put the 1 or 2 byte index index = the 15 bit index

objrecord
void objrecord(uint rectyp, const(char)[] record)

Output an object file data record.

Manifest constants

CODECLASS
enum CODECLASS;

Output header stuff for object files. Input: csegname Name to use for code segment (null if use default)

LEDATAMAX
enum LEDATAMAX;

Ledata records

Static functions

storelength
uint storelength(uint length, uint i)

Output a common block definition. Input: p . external identifier flag TRUE: in default data segment FALSE: not in default data segment size size in bytes of each elem count number of elems

Structs

FIXUP
struct FIXUP

Fixup list.

Linnum
struct Linnum

Line number support.

Objstate
struct Objstate

State of object file.

PtrRef
struct PtrRef

Meta