Question

I'm examining the GNU GRUB source code and in /grub-core/boot/i386/pc/*.S files, there are a lot of .= markers. Here is one from /grub-core/boot/i386/pc/boot.S file (line 409-414):

    /*
     *  Windows NT breaks compatibility by embedding a magic
     *  number here.
     */

    . = _start + GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC

What I want to know is what the .= means.

Was it helpful?

Solution

In GAS, and perhaps in other assemblers as well, the special symbol . refers to the current address that the assembler will assemble into. A statement such as the one above controls where the bytes for the following code will get assembled.

The documentation for the . operator is here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top