dmd.backend.mscoffobj

Compiler implementation of the D programming language.

Members

Aliases

_compare_fp_t
alias _compare_fp_t = int function(const void*, const void*)
Undocumented in source but is binding to C++. You might be able to learn more by searching the web for its name.

Enums

RELaddr
anonymousenum RELaddr

Because the mscoff relocations cannot be computed until after all the segments are written out, and we need more information than the mscoff relocations provide, make our own relocation type. Later, translate to mscoff relocation structure.

Functions

MsCoffObj_addScnhdr
IDXSEC MsCoffObj_addScnhdr(const(char)* scnhdr_name, uint flags)

Add new scnhdr.

MsCoffObj_addrel
void MsCoffObj_addrel(segidx_t seg, targ_size_t offset, Symbol* targsym, uint targseg, int rtype, int val)

Add a relocation entry for seg/offset.

MsCoffObj_addstr
IDXSTR MsCoffObj_addstr(Outbuffer* strtab, const(char)* str)

Output a string into a string table Input: strtab = string table for entry str = string to add

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

Output an alias definition record.

MsCoffObj_allowZeroSize
bool MsCoffObj_allowZeroSize()

Do we allow zero sized objects?

MsCoffObj_byte
void MsCoffObj_byte(segidx_t seg, targ_size_t offset, uint byte_)

Output byte_ to object file.

MsCoffObj_bytes
uint MsCoffObj_bytes(segidx_t seg, targ_size_t offset, uint nbytes, void* p)

Output bytes to object file.

MsCoffObj_codeseg
int MsCoffObj_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 Offset(cseg) starting offset in cseg

MsCoffObj_comdat
int MsCoffObj_comdat(Symbol* s)
Undocumented in source. Be warned that the author may not have intended to support it.
MsCoffObj_comdatsize
int MsCoffObj_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 Offset(cseg) starting offset in cseg

MsCoffObj_common_block
int MsCoffObj_common_block(Symbol* s, targ_size_t size, targ_size_t count)

Output a common block definition.

MsCoffObj_common_block
int MsCoffObj_common_block(Symbol* s, int flag, targ_size_t size, targ_size_t count)
Undocumented in source. Be warned that the author may not have intended to support it.
MsCoffObj_compiler
void MsCoffObj_compiler()

Embed compiler version in .obj file.

MsCoffObj_data_readonly
int MsCoffObj_data_readonly(char* p, int len, segidx_t* pseg)

Ouput read only data for data

MsCoffObj_data_readonly
int MsCoffObj_data_readonly(char* p, int len)
Undocumented in source. Be warned that the author may not have intended to support it.
MsCoffObj_data_start
segidx_t MsCoffObj_data_start(Symbol* sdata, targ_size_t datasize, segidx_t seg)

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

MsCoffObj_ehsections
void MsCoffObj_ehsections()
Undocumented in source. Be warned that the author may not have intended to support it.
MsCoffObj_ehtables
void MsCoffObj_ehtables(Symbol* sfunc, uint size, Symbol* ehsym)

Stuff the following data (instance of struct FuncTable) in a separate segment: pointer to function pointer to ehsym length of function

MsCoffObj_exestr
void MsCoffObj_exestr(const(char)* p)

Embed string in executable.

MsCoffObj_export_symbol
void MsCoffObj_export_symbol(Symbol* s, uint argsize)

Export a function name.

MsCoffObj_external
int MsCoffObj_external(Symbol* s)

Output an external for existing symbol. Input: s Symbol to do EXTDEF on (Name is to be mangled)

MsCoffObj_external_def
int MsCoffObj_external_def(const(char)* name)

Output an external symbol for name. Input: name Name to do EXTDEF on (Not to be mangled)

MsCoffObj_far16thunk
void MsCoffObj_far16thunk(Symbol* s)

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

MsCoffObj_fltused
void MsCoffObj_fltused()

Mark object file as using floating point.

MsCoffObj_func_start
void MsCoffObj_func_start(Symbol* sfunc)

Update function info before codgen

MsCoffObj_func_term
void MsCoffObj_func_term(Symbol* sfunc)

Update function info after codgen

MsCoffObj_getsegment
segidx_t MsCoffObj_getsegment(const(char)* sectname, uint flags)

Get segment, which may already exist. Input: flags2 put out some data for this, so the linker will keep things in order

MsCoffObj_getsegment2
segidx_t MsCoffObj_getsegment2(IDXSEC shtidx)

Create a new segment corresponding to an existing scnhdr index shtidx

MsCoffObj_includelib
bool MsCoffObj_includelib(const(char)* name)

Output library name.

MsCoffObj_init
Obj MsCoffObj_init(Outbuffer* objbuf, const(char)* filename, const(char)* csegname)

Start a .obj file. Called before any other obj_xxx routines. One source file can generate multiple .obj files.

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

Start a module within a .obj file. There can be multiple modules within a single .obj file.

MsCoffObj_jmpTableSegment
int MsCoffObj_jmpTableSegment(Symbol* s)
MsCoffObj_lidata
void MsCoffObj_lidata(segidx_t seg, targ_size_t offset, targ_size_t count)

Output an iterated data block of 0s.

MsCoffObj_linkerdirective
bool MsCoffObj_linkerdirective(const(char)* directive)

Output linker directive name.

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

Record file and line number at segment and offset.

MsCoffObj_moduleinfo
void MsCoffObj_moduleinfo(Symbol* scc)

Stuff pointer to ModuleInfo in its own segment. Input: scc symbol for ModuleInfo

MsCoffObj_pubdef
void MsCoffObj_pubdef(segidx_t seg, Symbol* s, targ_size_t offset)

Output a public definition.

MsCoffObj_pubdefsize
void MsCoffObj_pubdefsize(int seg, Symbol* s, targ_size_t offset, targ_size_t symsize)
Undocumented in source. Be warned that the author may not have intended to support it.
MsCoffObj_readonly_comdat
int MsCoffObj_readonly_comdat(Symbol* s)
Undocumented in source. Be warned that the author may not have intended to support it.
MsCoffObj_reftocodeseg
void MsCoffObj_reftocodeseg(segidx_t seg, targ_size_t offset, targ_size_t val)

Refer to address that is in the current function code (funcsym_p). 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

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

Refer to address that is in the data segment. Input: seg:offset = the address being fixed up val = displacement from start of target segment targetdatum = target segment number (DATA, CDATA or UDATA, etc.) flags = CFoff, CFseg

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

Refer to an identifier.

MsCoffObj_seg_debugS
segidx_t MsCoffObj_seg_debugS()
Undocumented in source. Be warned that the author may not have intended to support it.
MsCoffObj_seg_debugS_comdat
segidx_t MsCoffObj_seg_debugS_comdat(Symbol* sfunc)
Undocumented in source. Be warned that the author may not have intended to support it.
MsCoffObj_seg_debugT
segidx_t MsCoffObj_seg_debugT()
Undocumented in source. Be warned that the author may not have intended to support it.
MsCoffObj_seg_drectve
segidx_t MsCoffObj_seg_drectve()
Undocumented in source. Be warned that the author may not have intended to support it.
MsCoffObj_seg_pdata
segidx_t MsCoffObj_seg_pdata()

Return segment indices for .pdata and .xdata sections

MsCoffObj_seg_pdata_comdat
segidx_t MsCoffObj_seg_pdata_comdat(Symbol* sfunc)
Undocumented in source. Be warned that the author may not have intended to support it.
MsCoffObj_seg_xdata
segidx_t MsCoffObj_seg_xdata()
Undocumented in source. Be warned that the author may not have intended to support it.
MsCoffObj_seg_xdata_comdat
segidx_t MsCoffObj_seg_xdata_comdat(Symbol* sfunc)
Undocumented in source. Be warned that the author may not have intended to support it.
MsCoffObj_setModuleCtorDtor
void MsCoffObj_setModuleCtorDtor(Symbol* sfunc, bool isCtor)

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

MsCoffObj_setcodeseg
void MsCoffObj_setcodeseg(int seg)

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

MsCoffObj_startaddress
void MsCoffObj_startaddress(Symbol* s)

Set start address

MsCoffObj_staticctor
void MsCoffObj_staticctor(Symbol* s, int dtor, int none)

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 !=0 if leave space for static destructor seg 1: user 2: lib 3: compiler

MsCoffObj_staticdtor
void MsCoffObj_staticdtor(Symbol* s)

Symbol is the function that calls the static destructors. Put a pointer to it into a special segment that the exit code looks at. Input: s static destructor function

MsCoffObj_string_literal_segment
int MsCoffObj_string_literal_segment(uint sz)

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

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

Output read only data and generate a symbol for it.

MsCoffObj_term
void MsCoffObj_term(const(char)* objfilename)

Terminate package.

MsCoffObj_termfile
void MsCoffObj_termfile()

Fixup and terminate object file.

MsCoffObj_tlsseg
seg_data* MsCoffObj_tlsseg()

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

MsCoffObj_tlsseg_bss
seg_data* MsCoffObj_tlsseg_bss()

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

MsCoffObj_tlsseg_data
seg_data* MsCoffObj_tlsseg_data()
Undocumented in source. Be warned that the author may not have intended to support it.
MsCoffObj_tlv_bootstrap
Symbol* MsCoffObj_tlv_bootstrap()
Undocumented in source. Be warned that the author may not have intended to support it.
MsCoffObj_user
void MsCoffObj_user(const(char)* p)

Embed string in obj.

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

Output a weak extern record.

MsCoffObj_write_byte
void MsCoffObj_write_byte(seg_data* pseg, uint byte_)

Append byte to segment.

MsCoffObj_write_bytes
void MsCoffObj_write_bytes(seg_data* pseg, uint nbytes, void* p)

Append bytes to segment.

MsCoffObj_write_pointerRef
void MsCoffObj_write_pointerRef(Symbol* s, uint soff)

write a reference to a mutable pointer into the object file

MsCoffObj_write_zeros
void MsCoffObj_write_zeros(seg_data* pseg, targ_size_t count)

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

build_syment_table
void build_syment_table(bool bigobj)
Undocumented in source. Be warned that the author may not have intended to support it.
elf_align
int elf_align(int size, int foffset)
Undocumented in source but is binding to C++. You might be able to learn more by searching the web for its name.
elf_align
int elf_align(int size, int foffset)
Undocumented in source. Be warned that the author may not have intended to support it.
mach_relsort
void mach_relsort(Outbuffer* buf)
Undocumented in source. Be warned that the author may not have intended to support it.
obj_filename
void obj_filename(const(char)* modname)

Output file name record.

obj_mangle2
char* obj_mangle2(Symbol* s, char* dest)
Undocumented in source but is binding to C++. You might be able to learn more by searching the web for its name.
obj_mangle2
char* obj_mangle2(Symbol* s, char* dest)

Mangle a name.

patch
void patch(seg_data* pseg, targ_size_t offset, int seg, targ_size_t value)
Undocumented in source. Be warned that the author may not have intended to support it.
patchAddr
int32_t* patchAddr(int seg, targ_size_t offset)

Patch pseg/offset by adding in the vmaddr difference from pseg/offset to start of seg.

patchAddr64
int32_t* patchAddr64(int seg, targ_size_t offset)
Undocumented in source. Be warned that the author may not have intended to support it.
qsort
void qsort(void* base, size_t nmemb, size_t size, _compare_fp_t compar)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
strupr
char* strupr(char* )
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
unsstr
char* unsstr(uint value)
Undocumented in source. Be warned that the author may not have intended to support it.
write_sym
void write_sym(SymbolTable32* sym, bool bigobj)
Undocumented in source. Be warned that the author may not have intended to support it.

Manifest constants

DEST_LEN
enum DEST_LEN;
Undocumented in source but is binding to C++. You might be able to learn more by searching the web for its name.

Static variables

ScnhdrBuf
Outbuffer* ScnhdrBuf;
Undocumented in source but is binding to C++. You might be able to learn more by searching the web for its name.
SegData
Rarray!(seg_data*) SegData;
Undocumented in source but is binding to C++. You might be able to learn more by searching the web for its name.
seg_tlsseg
segidx_t seg_tlsseg;
Undocumented in source but is binding to C++. You might be able to learn more by searching the web for its name.
seg_tlsseg_bss
segidx_t seg_tlsseg_bss;
Undocumented in source but is binding to C++. You might be able to learn more by searching the web for its name.

Structs

Relocation
struct Relocation
Undocumented in source but is binding to C++. You might be able to learn more by searching the web for its name.

Meta