Search code examples
assemblygnu-assemblerpowerpc

.4byte assembly directive usage


When I compile a C file I got below line in temporary S file :

.4byte  .Letext0-.Ltext0 

what does it mean? I understand that ".4byte" directive will reserve 4 consecutive bytes in memory, but what does ".Letext0-.Ltext0" mean? I am so confused and not able to find something help online. Thank you so much!


Solution

  • Subtracting two labels gives a number, the distance in bytes between them.

    etext is a symbol used by the linker to indicate the end of the text section text indicates the start of the text section.

    The text section tends to be the actual binary program code itself. Although it may also include static data.

    This instruction is storing the size of the text section (or the program code) in a 32-bit integer.