Search code examples
linuxassemblyarmkernel

Is "_symbol" equal to "symbol" in asm?


I got that normally stext is the entrance of Linux image, but I can only find _stext and the stext only appears in the Entry(stext) which maybe only specifies the entrance but does not show where the symbol is.

So does stext equal _stext?


Solution

  • Is _symbol equal to symbol in asm?

    No. You can see this in the Linux entry point code for Sparc CPUs:

    _stext:
    stext:
    

    In this lines, the two symbols _stext and stext are defined. It would not make sense to define them separately if they were automatically equal.

    only appears in the Entry(stext)

    Did you check how Entry() is defined?

    This macro may add an underscore to the name so Entry(stext) will expand to:

    .global _stext
    _stext: