[llvm-dev] LLVM Fragment Type

Fangrui Song via llvm-dev llvm-dev at lists.llvm.org
Wed May 13 23:25:45 PDT 2020


On 2020-05-14, zhangning at eswin.com via llvm-dev wrote:
>Hi there,
>I am studying LLVM and RISCV ,  and currently I am reading the source code.
>Now I have a question on the Fragment and Fragment Type (I put a code slice below),  I guess that can be related to generate assemble or elf file.  But it is hard for me to map the source code to real assembler file or elf file.
>could you please tell me the meaning of Fragment and Fragment type?  What is the relationship between fragment and sections? How are they used to generate obj file? Thanks in advance.
>Best Regards,
>David.
>public:
>enum FragmentType : uint8_t {
>FT_Align,

Represents an .align directive

>FT_Data,

Represents data or non-relaxable instructions

>FT_CompactEncodedInst,

Used by NaCl's aligned instruction bunble for some instructions without
fixups.

>FT_Fill,

A .fill directive https://sourceware.org/binutils/docs/as/Fill.html#Fill

>FT_Relaxable,

A fragment containing a relaxable MCInst. An example is x86's JCC_1, jz
foo can be encoded in either 2 bytes or 6 bytes (or 3 bytes in 16-bit
mode), depending on the offset.

>FT_Org,

.org directive https://sourceware.org/binutils/docs/as/Org.html#Org

>FT_Dwarf,

A DWARF line table entry .loc

>FT_DwarfFrame,

Related to .cfi_*

>FT_LEB,

Used in some DWARF encodings for ULEB128.

>FT_Padding,

Deleted by https://reviews.llvm.org/D71106
Intended as a framework to pad code with NOP instruction to
improve/stabalize performance.

>FT_SymbolId,

Windows Safe SEH related stuff.

>FT_CVInlineLines,
>FT_CVDefRange,

CodeView .cv_* related stuff.

>FT_Dummy
>};

>_______________________________________________
>LLVM Developers mailing list
>llvm-dev at lists.llvm.org
>https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list