技术标签: ios
This document describes the LLVM bitstream file format and the encoding of the LLVM IR into it.
What is commonly known as the LLVM bitcode file format (also, sometimes anachronistically known as bytecode) is actually two things: a bitstream container format and an encoding of LLVM IR into the container format.
The bitstream format is an abstract encoding of structured data, very similar to XML in some ways. Like XML, bitstream files contain tags, and nested structures, and you can parse the file without having to understand the tags. Unlike XML, the bitstream format is a binary encoding, and unlike XML it provides a mechanism for the file to self-describe “abbreviations”, which are effectively size optimizations for the content.
LLVM IR files may be optionally embedded into a wrapper structure, or in a native object file. Both of these mechanisms make it easy to embed extra data along with LLVM IR files.
This document first describes the LLVM bitstream format, describes the wrapper format, then describes the record structure used by LLVM IR files.
The bitstream format is literally a stream of bits, with a very simple structure. This structure consists of the following concepts:
Note that the llvm-bcanalyzer tool can be used to dump and inspect arbitrary bitstreams, which is very useful for understanding the encoding.
The first four bytes of a bitstream are used as an application-specific magic number. Generic bitcode tools may look at the first four bytes to determine whether the stream is a known stream type. However, these tools should notdetermine whether a bitstream is valid based on its magic number alone. New application-specific bitstream formats are being developed all the time; tools should not reject them just because they have a hitherto unseen magic number.
A bitstream literally consists of a stream of bits, which are read in order starting with the least significant bit of each byte. The stream is made up of a number of primitive values that encode a stream of unsigned integer values. These integers are encoded in two ways: either as Fixed Width Integers or as Variable Width Integers.
Fixed-width integer values have their low bits emitted directly to the file. For example, a 3-bit integer value encodes 1 as 001. Fixed width integers are used when there are a well-known number of options for a field. For example, boolean values are usually encoded with a 1-bit wide integer.
Variable-width integer (VBR) values encode values of arbitrary size, optimizing for the case where the values are small. Given a 4-bit VBR field, any 3-bit value (0 through 7) is encoded directly, with the high bit set to zero. Values larger than N-1 bits emit their bits in a series of N-1 bit chunks, where all but the last set the high bit.
For example, the value 27 (0x1B) is encoded as 1011 0011 when emitted as a vbr4 value. The first set of four bits indicates the value 3 (011) with a continuation piece (indicated by a high bit of 1). The next word indicates a value of 24 (011 << 3) with no continuation. The sum (3+24) yields the value 27.
6-bit characters encode common characters into a fixed 6-bit field. They represent the following characters with the following 6-bit values:
'a' .. 'z' --- 0 .. 25 'A' .. 'Z' --- 26 .. 51 '0' .. '9' --- 52 .. 61 '.' --- 62 '_' --- 63
This encoding is only suitable for encoding characters and strings that consist only of the above characters. It is completely incapable of encoding characters not in the set.
Occasionally, it is useful to emit zero bits until the bitstream is a multiple of 32 bits. This ensures that the bit position in the stream can be represented as a multiple of 32-bit words.
A bitstream is a sequential series of Blocks and Data Records. Both of these start with an abbreviation ID encoded as a fixed-bitwidth field. The width is specified by the current block, as described below. The value of the abbreviation ID specifies either a builtin ID (which have special meanings, defined below) or one of the abbreviation IDs defined for the current block by the stream itself.
The set of builtin abbrev IDs is:
Abbreviation IDs 4 and above are defined by the stream itself, and specify an abbreviated record encoding.
Blocks in a bitstream denote nested regions of the stream, and are identified by a content-specific id number (for example, LLVM IR uses an ID of 12 to represent function bodies). Block IDs 0-7 are reserved for standard blockswhose meaning is defined by Bitcode; block IDs 8 and greater are application specific. Nested blocks capture the hierarchical structure of the data encoded in it, and various properties are associated with blocks as the file is parsed. Block definitions allow the reader to efficiently skip blocks in constant time if the reader wants a summary of blocks, or if it wants to efficiently skip data it does not understand. The LLVM IR reader uses this mechanism to skip function bodies, lazily reading them on demand.
When reading and encoding the stream, several properties are maintained for the block. In particular, each block maintains:
BLOCKINFO
block is describing.As sub blocks are entered, these properties are saved and the new sub-block has its own set of abbreviations, and its own abbrev id width. When a sub-block is popped, the saved values are restored.
[ENTER_SUBBLOCK, blockidvbr8, newabbrevlenvbr4, <align32bits>, blocklen_32]
The ENTER_SUBBLOCK
abbreviation ID specifies the start of a new block record. The blockid
value is encoded as an 8-bit VBR identifier, and indicates the type of block being entered, which can be a standard block or an application-specific block. The newabbrevlen
value is a 4-bit VBR, which specifies the abbrev id width for the sub-block. The blocklen
value is a 32-bit aligned value that specifies the size of the subblock in 32-bit words. This value allows the reader to skip over the entire block in one jump.
[END_BLOCK, <align32bits>]
The END_BLOCK
abbreviation ID specifies the end of the current block record. Its end is aligned to 32-bits to ensure that the size of the block is an even multiple of 32-bits.
Data records consist of a record code and a number of (up to) 64-bit integer values. The interpretation of the code and values is application specific and may vary between different block types. Records can be encoded either using an unabbrev record, or with an abbreviation. In the LLVM IR format, for example, there is a record which encodes the target triple of a module. The code is MODULE_CODE_TRIPLE
, and the values of the record are the ASCII codes for the characters in the string.
[UNABBREV_RECORD, codevbr6, numopsvbr6, op0vbr6, op1vbr6, …]
An UNABBREV_RECORD
provides a default fallback encoding, which is both completely general and extremely inefficient. It can describe an arbitrary record by emitting the code and operands as VBRs.
For example, emitting an LLVM IR target triple as an unabbreviated record requires emitting the UNABBREV_RECORD
abbrevid, a vbr6 for the MODULE_CODE_TRIPLE
code, a vbr6 for the length of the string, which is equal to the number of operands, and a vbr6 for each character. Because there are no letters with values less than 32, each letter would need to be emitted as at least a two-part VBR, which means that each letter would require at least 12 bits. This is not an efficient encoding, but it is fully general.
[<abbrevid>, fields...]
An abbreviated record is a abbreviation id followed by a set of fields that are encoded according to the abbreviation definition. This allows records to be encoded significantly more densely than records encoded with theUNABBREV_RECORD type, and allows the abbreviation types to be specified in the stream itself, which allows the files to be completely self describing. The actual encoding of abbreviations is defined below.
The record code, which is the first field of an abbreviated record, may be encoded in the abbreviation definition (as a literal operand) or supplied in the abbreviated record (as a Fixed or VBR operand value).
Abbreviations are an important form of compression for bitstreams. The idea is to specify a dense encoding for a class of records once, then use that encoding to emit many records. It takes space to emit the encoding into the file, but the space is recouped (hopefully plus some) when the records that use it are emitted.
Abbreviations can be determined dynamically per client, per file. Because the abbreviations are stored in the bitstream itself, different streams of the same format can contain different sets of abbreviations according to the needs of the specific stream. As a concrete example, LLVM IR files usually emit an abbreviation for binary operators. If a specific LLVM module contained no or few binary operators, the abbreviation does not need to be emitted.
[DEFINE_ABBREV, numabbrevopsvbr5, abbrevop0, abbrevop1, …]
A DEFINE_ABBREV
record adds an abbreviation to the list of currently defined abbreviations in the scope of this block. This definition only exists inside this immediate block — it is not visible in subblocks or enclosing blocks. Abbreviations are implicitly assigned IDs sequentially starting from 4 (the first application-defined abbreviation ID). Any abbreviations defined in a BLOCKINFO
record for the particular block type receive IDs first, in order, followed by any abbreviations defined within the block itself. Abbreviated data records reference this ID to indicate what abbreviation they are invoking.
An abbreviation definition consists of the DEFINE_ABBREV
abbrevid followed by a VBR that specifies the number of abbrev operands, then the abbrev operands themselves. Abbreviation operands come in three forms. They all start with a single bit that indicates whether the abbrev operand is a literal operand (when the bit is 1) or an encoding operand (when the bit is 0).
The possible operand encodings are:
For example, target triples in LLVM modules are encoded as a record of the form [TRIPLE, 'a', 'b', 'c', 'd']
. Consider if the bitstream emitted the following abbrev entry:
[0, Fixed, 4] [0, Array] [0, Char6]
When emitting a record with this abbreviation, the above entry would be emitted as:
[4abbrevwidth, 24, 4vbr6, 06, 16, 26, 36]
These values are:
TRIPLE
records within LLVM IR file MODULE_BLOCK
blocks."abcd"
.With this abbreviation, the triple is emitted with only 37 bits (assuming a abbrev id width of 3). Without the abbreviation, significantly more space would be required to emit the target triple. Also, because the TRIPLE
value is not emitted as a literal in the abbreviation, the abbreviation can also be used for any other string value.
In addition to the basic block structure and record encodings, the bitstream also defines specific built-in block types. These block types specify how the stream is to be decoded or other metadata. In the future, new standard blocks may be added. Block IDs 0-7 are reserved for standard blocks.
The BLOCKINFO
block allows the description of metadata for other blocks. The currently specified records are:
[SETBID (#1), blockid] [DEFINE_ABBREV, ...] [BLOCKNAME, ...name...] [SETRECORDNAME, RecordID, ...name...]
The SETBID
record (code 1) indicates which block ID is being described. SETBID
records can occur multiple times throughout the block to change which block ID is being described. There must be a SETBID
record prior to any other records.
Standard DEFINE_ABBREV
records can occur inside BLOCKINFO
blocks, but unlike their occurrence in normal blocks, the abbreviation is defined for blocks matching the block ID we are describing, not the BLOCKINFO
block itself. The abbreviations defined in BLOCKINFO
blocks receive abbreviation IDs as described in DEFINE_ABBREV.
The BLOCKNAME
record (code 2) can optionally occur in this block. The elements of the record are the bytes of the string name of the block. llvm-bcanalyzer can use this to dump out bitcode files symbolically.
The SETRECORDNAME
record (code 3) can also optionally occur in this block. The first operand value is a record ID number, and the rest of the elements of the record are the bytes for the string name of the record. llvm-bcanalyzer can use this to dump out bitcode files symbolically.
Note that although the data in BLOCKINFO
blocks is described as “metadata,” the abbreviations they contain are essential for parsing records from the corresponding blocks. It is not safe to skip them.
Bitcode files for LLVM IR may optionally be wrapped in a simple wrapper structure. This structure contains a simple header that indicates the offset and size of the embedded BC file. This allows additional information to be stored alongside the BC file. The structure of this file header is:
[Magic32, Version32, Offset32, Size32, CPUType32]
Each of the fields are 32-bit fields stored in little endian form (as with the rest of the bitcode file fields). The Magic number is always 0x0B17C0DE
and the version is currently always 0
. The Offset field is the offset in bytes to the start of the bitcode stream in the file, and the Size field is the size in bytes of the stream. CPUType is a target-specific value that can be used to encode the CPU of the target.
Bitcode files for LLVM IR may also be wrapped in a native object file (i.e. ELF, COFF, Mach-O). The bitcode must be stored in a section of the object file named __LLVM,__bitcode
for MachO and .llvmbc
for the other object formats. This wrapper format is useful for accommodating LTO in compilation pipelines where intermediate objects must be native object files which contain metadata in other sections.
Not all tools support this format.
LLVM IR is encoded into a bitstream by defining blocks and records. It uses blocks for things like constant pools, functions, symbol tables, etc. It uses records for things like instructions, global variable descriptors, type descriptions, etc. This document does not describe the set of abbreviations that the writer uses, as these are fully self-described in the file, and the reader is not allowed to build in any knowledge of this.
The magic number for LLVM IR files is:
[‘B’8, ‘C’8, 0x04, 0xC4, 0xE4, 0xD4]
Variable Width Integer encoding is an efficient way to encode arbitrary sized unsigned values, but is an extremely inefficient for encoding signed values, as signed values are otherwise treated as maximally large unsigned values.
As such, signed VBR values of a specific width are emitted as follows:
With this encoding, small positive and small negative values can both be emitted efficiently. Signed VBR encoding is used in CST_CODE_INTEGER
and CST_CODE_WIDE_INTEGER
records within CONSTANTS_BLOCK
blocks. It is also used for phi instruction operands in MODULE_CODE_VERSION 1.
LLVM IR is defined with the following blocks:
The MODULE_BLOCK
block (id 8) is the top-level block for LLVM bitcode files, and each bitcode file must contain exactly one. In addition to records (described below) containing information about the module, a MODULE_BLOCK
block may contain the following sub-blocks:
[VERSION, version#]
The VERSION
record (code 1) contains a single value indicating the format version. Versions 0, 1 and 2 are supported at this time. The difference between version 0 and 1 is in the encoding of instruction operands in each FUNCTION_BLOCK.
In version 0, each value defined by an instruction is assigned an ID unique to the function. Function-level value IDs are assigned starting from NumModuleValues
since they share the same namespace as module-level values. The value enumerator resets after each function. When a value is an operand of an instruction, the value ID is used to represent the operand. For large functions or large modules, these operand values can be large.
The encoding in version 1 attempts to avoid large operand values in common cases. Instead of using the value ID directly, operands are encoded as relative to the current instruction. Thus, if an operand is the value defined by the previous instruction, the operand will be encoded as 1.
For example, instead of
#n = load #n-1 #n+1 = icmp eq #n, #const0 br #n+1, label #(bb1), label #(bb2)
version 1 will encode the instructions as
#n = load #1 #n+1 = icmp eq #1, (#n+1)-#const0 br #1, label #(bb1), label #(bb2)
Note in the example that operands which are constants also use the relative encoding, while operands like basic block labels do not use the relative encoding.
Forward references will result in a negative value. This can be inefficient, as operands are normally encoded as unsigned VBRs. However, forward references are rare, except in the case of phi instructions. For phi instructions, operands are encoded as Signed VBRs to deal with forward references.
In version 2, the meaning of module records FUNCTION
, GLOBALVAR
, ALIAS
, IFUNC
and COMDAT
change such that the first two operands specify an offset and size of a string in a string table (see STRTAB_BLOCK Contents), the function name is removed from the FNENTRY
record in the value symbol table, and the top-level VALUE_SYMTAB_BLOCK
may only containFNENTRY
records.
[TRIPLE, ...string...]
The TRIPLE
record (code 2) contains a variable number of values representing the bytes of the target triple
specification string.
[DATALAYOUT, ...string...]
The DATALAYOUT
record (code 3) contains a variable number of values representing the bytes of the target datalayout
specification string.
[ASM, ...string...]
The ASM
record (code 4) contains a variable number of values representing the bytes of module asm
strings, with individual assembly blocks separated by newline (ASCII 10) characters.
MODULE_CODE_SECTIONNAME Record
[SECTIONNAME, ...string...]
The SECTIONNAME
record (code 5) contains a variable number of values representing the bytes of a single section name string. There should be one SECTIONNAME
record for each section name referenced (e.g., in global variable or function section
attributes) within the module. These records can be referenced by the 1-based index in the section fields of GLOBALVAR
or FUNCTION
records.
[DEPLIB, ...string...]
The DEPLIB
record (code 6) contains a variable number of values representing the bytes of a single dependent library name string, one of the libraries mentioned in a deplibs
declaration. There should be one DEPLIB
record for each library name referenced.
[GLOBALVAR, strtab offset, strtab size, pointer type, isconst, initid, linkage, alignment, section,visibility, threadlocal, unnamed_addr, externally_initialized, dllstorageclass, comdat, attributes,preemptionspecifier]
The GLOBALVAR
record (code 7) marks the declaration or definition of a global variable. The operand fields are:
external
: code 0weak
: code 1appending
: code 2internal
: code 3linkonce
: code 4dllimport
: code 5dllexport
: code 6extern_weak
: code 7common
: code 8private
: code 9weak_odr
: code 10linkonce_odr
: code 11available_externally
: code 12default
: code 0hidden
: code 1protected
: code 2not thread local
: code 0thread local; default TLS model
: code 1localdynamic
: code 2initialexec
: code 3localexec
: code 4unnamed_addr
attribute of this variable:
unnamed_addr
: code 0unnamed_addr
: code 1local_unnamed_addr
: code 2default
: code 0dllimport
: code 1dllexport
: code 2dso_preemptable
: code 0dso_local
: code 1[FUNCTION, strtab offset, strtab size, type, callingconv, isproto, linkage, paramattr, alignment, section,visibility, gc, prologuedata, dllstorageclass, comdat, prefixdata, personalityfn, preemptionspecifier]
The FUNCTION
record (code 8) marks the declaration or definition of a function. The operand fields are:
ccc
: code 0 * fastcc
: code 8 * coldcc
: code 9 * webkit_jscc
: code 12 * anyregcc
: code 13 * preserve_mostcc
: code 14 * preserve_allcc
: code 15 * swiftcc
: code 16 * cxx_fast_tlscc
: code 17 * x86_stdcallcc
: code 64 * x86_fastcallcc
: code 65 * arm_apcscc
: code 66 * arm_aapcscc
: code 67 * arm_aapcs_vfpcc
: code 68[ALIAS, strtab offset, strtab size, alias type, aliasee val#, linkage, visibility, dllstorageclass,threadlocal, unnamed_addr, preemptionspecifier]
The ALIAS
record (code 9) marks the definition of an alias. The operand fields are
[GCNAME, ...string...]
The GCNAME
record (code 11) contains a variable number of values representing the bytes of a single garbage collector name string. There should be one GCNAME
record for each garbage collector name referenced in function gc
attributes within the module. These records can be referenced by 1-based index in the gc fields of FUNCTION
records.
The PARAMATTR_BLOCK
block (id 9) contains a table of entries describing the attributes of function parameters. These entries are referenced by 1-based index in the paramattr field of module block FUNCTION records, or within the attrfield of function block INST_INVOKE
and INST_CALL
records.
Entries within PARAMATTR_BLOCK
are constructed to ensure that each is unique (i.e., no two indices represent equivalent attribute lists).
[ENTRY, attrgrp0, attrgrp1, ...]
The ENTRY
record (code 2) contains a variable number of values describing a unique set of function parameter attributes. Each attrgrp value is used as a key with which to look up an entry in the attribute group table described in the PARAMATTR_GROUP_BLOCK
block.
PARAMATTR_CODE_ENTRY_OLD Record
Note
This is a legacy encoding for attributes, produced by LLVM versions 3.2 and earlier. It is guaranteed to be understood by the current LLVM version, as specified in the IR Backwards Compatibility policy.
[ENTRY, paramidx0, attr0, paramidx1, attr1...]
The ENTRY
record (code 1) contains an even number of values describing a unique set of function parameter attributes. Each paramidx value indicates which set of attributes is represented, with 0 representing the return value attributes, 0xFFFFFFFF representing function attributes, and other values representing 1-based function parameters. Each attr value is a bitmap with the following interpretation:
zeroext
signext
noreturn
inreg
sret
nounwind
noalias
byval
nest
readnone
readonly
noinline
alwaysinline
optsize
ssp
sspreq
align n
nocapture
noredzone
noimplicitfloat
naked
inlinehint
alignstack n
, represented as the logarithm base 2 of the requested alignment, plus 1The PARAMATTR_GROUP_BLOCK
block (id 10) contains a table of entries describing the attribute groups present in the module. These entries can be referenced within PARAMATTR_CODE_ENTRY
entries.
PARAMATTR_GRP_CODE_ENTRY Record
[ENTRY, grpid, paramidx, attr0, attr1, ...]
The ENTRY
record (code 3) contains grpid and paramidx values, followed by a variable number of values describing a unique group of attributes. The grpid value is a unique key for the attribute group, which can be referenced within PARAMATTR_CODE_ENTRY
entries. The paramidx value indicates which set of attributes is represented, with 0 representing the return value attributes, 0xFFFFFFFF representing function attributes, and other values representing 1-based function parameters.
Each attr is itself represented as a variable number of values:
kind, key [, ...], [value [, ...]]
Each attribute is either a well-known LLVM attribute (possibly with an integer value associated with it), or an arbitrary string (possibly with an arbitrary string value associated with it). The kind value is an integer code distinguishing between these possibilities:
For well-known attributes (code 0 or 1), the key value is an integer code identifying the attribute. For attributes with an integer argument (code 1), the value value indicates the argument.
For string attributes (code 3 or 4), the key value is actually a variable number of values representing the bytes of a null-terminated string. For attributes with a string argument (code 4), the value value is similarly a variable number of values representing the bytes of a null-terminated string.
The integer codes are mapped to well-known attributes as follows.
align(<n>)
alwaysinline
byval
inlinehint
inreg
minsize
naked
nest
noalias
nobuiltin
nocapture
noduplicates
noimplicitfloat
noinline
nonlazybind
noredzone
noreturn
nounwind
optsize
readnone
readonly
returned
returns_twice
signext
alignstack(<n>)
ssp
sspreq
sspstrong
sret
sanitize_address
sanitize_thread
sanitize_memory
uwtable
zeroext
builtin
cold
optnone
inalloca
nonnull
jumptable
dereferenceable(<n>)
dereferenceable_or_null(<n>)
convergent
safestack
argmemonly
swiftself
swifterror
norecurse
inaccessiblememonly
inaccessiblememonly_or_argmemonly
allocsize(<EltSizeParam>[, <NumEltsParam>])
writeonly
speculatable
strictfp
sanitize_hwaddress
nocf_check
optforfuzzing
shadowcallstack
Note
The allocsize
attribute has a special encoding for its arguments. Its two arguments, which are 32-bit integers, are packed into one 64-bit integer value (i.e. (EltSizeParam << 32) | NumEltsParam
), with NumEltsParam
taking on the sentinel value -1 if it is not specified.
The TYPE_BLOCK
block (id 17) contains records which constitute a table of type operator entries used to represent types referenced within an LLVM module. Each record (with the exception of NUMENTRY) generates a single type table entry, which may be referenced by 0-based index from instructions, constants, metadata, type symbol table entries, or other type operator records.
Entries within TYPE_BLOCK
are constructed to ensure that each entry is unique (i.e., no two indices represent structurally equivalent types).
[NUMENTRY, numentries]
The NUMENTRY
record (code 1) contains a single value which indicates the total number of type code entries in the type table of the module. If present, NUMENTRY
should be the first record in the block.
[VOID]
The VOID
record (code 2) adds a void
type to the type table.
[HALF]
The HALF
record (code 10) adds a half
(16-bit floating point) type to the type table.
[FLOAT]
The FLOAT
record (code 3) adds a float
(32-bit floating point) type to the type table.
[DOUBLE]
The DOUBLE
record (code 4) adds a double
(64-bit floating point) type to the type table.
[LABEL]
The LABEL
record (code 5) adds a label
type to the type table.
[OPAQUE]
The OPAQUE
record (code 6) adds an opaque
type to the type table, with a name defined by a previously encountered STRUCT_NAME
record. Note that distinct opaque
types are not unified.
[INTEGER, width]
The INTEGER
record (code 7) adds an integer type to the type table. The single width field indicates the width of the integer type.
[POINTER, pointee type, address space]
The POINTER
record (code 8) adds a pointer type to the type table. The operand fields are
Note
This is a legacy encoding for functions, produced by LLVM versions 3.0 and earlier. It is guaranteed to be understood by the current LLVM version, as specified in the IR Backwards Compatibility policy.
[FUNCTION_OLD, vararg, ignored, retty, ...paramty... ]
The FUNCTION_OLD
record (code 9) adds a function type to the type table. The operand fields are
[ARRAY, numelts, eltty]
The ARRAY
record (code 11) adds an array type to the type table. The operand fields are
[VECTOR, numelts, eltty]
The VECTOR
record (code 12) adds a vector type to the type table. The operand fields are
[X86_FP80]
The X86_FP80
record (code 13) adds an x86_fp80
(80-bit floating point) type to the type table.
[FP128]
The FP128
record (code 14) adds an fp128
(128-bit floating point) type to the type table.
[PPC_FP128]
The PPC_FP128
record (code 15) adds a ppc_fp128
(128-bit floating point) type to the type table.
[METADATA]
The METADATA
record (code 16) adds a metadata
type to the type table.
[X86_MMX]
The X86_MMX
record (code 17) adds an x86_mmx
type to the type table.
[STRUCT_ANON, ispacked, ...eltty...]
The STRUCT_ANON
record (code 18) adds a literal struct type to the type table. The operand fields are
[STRUCT_NAME, ...string...]
The STRUCT_NAME
record (code 19) contains a variable number of values representing the bytes of a struct name. The next OPAQUE
or STRUCT_NAMED
record will use this name.
[STRUCT_NAMED, ispacked, ...eltty...]
The STRUCT_NAMED
record (code 20) adds an identified struct type to the type table, with a name defined by a previously encountered STRUCT_NAME
record. The operand fields are
[FUNCTION, vararg, retty, ...paramty... ]
The FUNCTION
record (code 21) adds a function type to the type table. The operand fields are
The CONSTANTS_BLOCK
block (id 11) …
The FUNCTION_BLOCK
block (id 12) …
In addition to the record types described below, a FUNCTION_BLOCK
block may contain the following sub-blocks:
The VALUE_SYMTAB_BLOCK
block (id 14) …
The METADATA_BLOCK
block (id 15) …
The METADATA_ATTACHMENT
block (id 16) …
The STRTAB
block (id 23) contains a single record (STRTAB_BLOB
, id 1) with a single blob operand containing the bitcode file’s string table.
Strings in the string table are not null terminated. A record’s strtab offset and strtab size operands specify the byte offset and size of a string within the string table.
The string table is used by all preceding blocks in the bitcode file that are not succeeded by another intervening STRTAB
block. Normally a bitcode file will have a single string table, but it may have more than one if it was created by binary concatenation of multiple bitcode files.
文章浏览阅读645次。这个肯定是末尾的IDAT了,因为IDAT必须要满了才会开始一下个IDAT,这个明显就是末尾的IDAT了。,对应下面的create_head()代码。,对应下面的create_tail()代码。不要考虑爆破,我已经试了一下,太多情况了。题目来源:UNCTF。_攻防世界困难模式攻略图文
文章浏览阅读2.9k次,点赞3次,收藏10次。偶尔会用到,记录、分享。1. 数据库导出1.1 切换到dmdba用户su - dmdba1.2 进入达梦数据库安装路径的bin目录,执行导库操作 导出语句:./dexp cwy_init/[email protected]:5236 file=cwy_init.dmp log=cwy_init_exp.log 注释: cwy_init/init_123..._达梦数据库导入导出
文章浏览阅读1.9k次。1. 在官网上下载KindEditor文件,可以删掉不需要要到的jsp,asp,asp.net和php文件夹。接着把文件夹放到项目文件目录下。2. 修改html文件,在页面引入js文件:<script type="text/javascript" src="./kindeditor/kindeditor-all.js"></script><script type="text/javascript" src="./kindeditor/lang/zh-CN.js"_kindeditor.js
文章浏览阅读2.3k次,点赞6次,收藏14次。SPI的详情简介不必赘述。假设我们通过SPI发送0xAA,我们的数据线就会变为10101010,通过修改不同的内容,即可修改SPI中0和1的持续时间。比如0xF0即为前半周期为高电平,后半周期为低电平的状态。在SPI的通信模式中,CPHA配置会影响该实验,下图展示了不同采样位置的SPI时序图[1]。CPOL = 0,CPHA = 1:CLK空闲状态 = 低电平,数据在下降沿采样,并在上升沿移出CPOL = 0,CPHA = 0:CLK空闲状态 = 低电平,数据在上升沿采样,并在下降沿移出。_stm32g431cbu6
文章浏览阅读1.2k次,点赞2次,收藏8次。数据链路层习题自测问题1.数据链路(即逻辑链路)与链路(即物理链路)有何区别?“电路接通了”与”数据链路接通了”的区别何在?2.数据链路层中的链路控制包括哪些功能?试讨论数据链路层做成可靠的链路层有哪些优点和缺点。3.网络适配器的作用是什么?网络适配器工作在哪一层?4.数据链路层的三个基本问题(帧定界、透明传输和差错检测)为什么都必须加以解决?5.如果在数据链路层不进行帧定界,会发生什么问题?6.PPP协议的主要特点是什么?为什么PPP不使用帧的编号?PPP适用于什么情况?为什么PPP协议不_接收方收到链路层数据后,使用crc检验后,余数为0,说明链路层的传输时可靠传输
文章浏览阅读587次。软件测试工程师移民加拿大 无证移民,未受过软件工程师的教育(第1部分) (Undocumented Immigrant With No Education to Software Engineer(Part 1))Before I start, I want you to please bear with me on the way I write, I have very little gen...
文章浏览阅读304次。Thinkpad X250笔记本电脑,装的是FreeBSD,进入BIOS修改虚拟化配置(其后可能是误设置了安全开机),保存退出后系统无法启动,显示:secure boot failed ,把自己惊出一身冷汗,因为这台笔记本刚好还没开始做备份.....根据错误提示,到bios里面去找相关配置,在Security里面找到了Secure Boot选项,发现果然被设置为Enabled,将其修改为Disabled ,再开机,终于正常启动了。_安装完系统提示secureboot failure
文章浏览阅读10w+次,点赞93次,收藏352次。1、用strtok函数进行字符串分割原型: char *strtok(char *str, const char *delim);功能:分解字符串为一组字符串。参数说明:str为要分解的字符串,delim为分隔符字符串。返回值:从str开头开始的一个个被分割的串。当没有被分割的串时则返回NULL。其它:strtok函数线程不安全,可以使用strtok_r替代。示例://借助strtok实现split#include <string.h>#include <stdio.h&_c++ 字符串分割
文章浏览阅读2.3k次。1 .高斯日记 大数学家高斯有个好习惯:无论如何都要记日记。他的日记有个与众不同的地方,他从不注明年月日,而是用一个整数代替,比如:4210后来人们知道,那个整数就是日期,它表示那一天是高斯出生后的第几天。这或许也是个好习惯,它时时刻刻提醒着主人:日子又过去一天,还有多少时光可以用于浪费呢?高斯出生于:1777年4月30日。在高斯发现的一个重要定理的日记_2013年第四届c a组蓝桥杯省赛真题解答
文章浏览阅读851次,点赞17次,收藏22次。摘要:本文利用供需算法对核极限学习机(KELM)进行优化,并用于分类。
文章浏览阅读1.1k次。一、系统弱密码登录1、在kali上执行命令行telnet 192.168.26.1292、Login和password都输入msfadmin3、登录成功,进入系统4、测试如下:二、MySQL弱密码登录:1、在kali上执行mysql –h 192.168.26.129 –u root2、登录成功,进入MySQL系统3、测试效果:三、PostgreSQL弱密码登录1、在Kali上执行psql -h 192.168.26.129 –U post..._metasploitable2怎么进入
文章浏览阅读257次。本文将为初学者提供Python学习的详细指南,从Python的历史、基础语法和数据类型到面向对象编程、模块和库的使用。通过本文,您将能够掌握Python编程的核心概念,为今后的编程学习和实践打下坚实基础。_python人工智能开发从入门到精通pdf