Re: [git pull] x86 updates

From: H. Peter Anvin
Date: Tue Feb 05 2008 - 16:24:34 EST


Sam Ravnborg wrote:

Technically we should also specify @progbits or @nobits on sections, however, I think @progbits is the default.

I have on my todo list to do so. But I wanted to investigate a bit
more since I do not yet fully understand the difference.

And we have to use %progbits and %nobits as ARM uses '"' to indicate
comments.


The difference is quite simple:

a - this section occupies address space
w - this section is writable
x - this section is executable
progbits - this section has data in the file

In contrast, a nobits section is implicitly zero-filled.

By default:

.bss is (aw,nobits).
.data is (aw,progbits).
.rodata is (a,progbits).
.text is (ax,progbits).

Since .bss is nobits, it doesn't occupy any space in the executable, and is zero-filled by the loader.

-hpa


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/