Re: Using C on x86-64, why emit .text for global data?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 27, 2019 at 10:44 AM Bob Plantz <rgplantz@xxxxxxxxxxx> wrote:
> Why does gcc emit an extra .text before the global data?
>
> .file "globalData.c"
> .text
> .globl x
> .data

Compile an empty file, and you will see that it starts with the same
two lines.  This probably just simplifies logic somewhere else in the
compiler to force the assembler into a known state at the beginning,
regardless of what is actually in the C file.  There is no harm in
emitting an extra unnecessary .text directive to the assembler.

Jim



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux