Is there any difference between the following two section definitions?
.section .text
And:
.text
.section .text.startup,"ax",@progbits
I've come across the second in some gcc
compiler output, but it seems like just doing .section .text
or .text
initializes the .text
section just the same:
$ readelf file2 -S -W
[Nr] Name Type Address Off Size ES Flg Lk Inf Al
# using .text
[ 1] .text PROGBITS 00000000004000b0 0000b0 000016 00 AX 0 0 1
# using .section .text
[ 1] .text PROGBITS 00000000004000b0 0000b0 000016 00 AX 0 0 1
# using .text; .text.startup,"ax",@progbits
[ 1] .text PROGBITS 00000000004000b0 0000b0 000016 00 AX 0 0 1
Is the compiler output just a more verbose way of saying .text
? As another example, would the .rodata
and .data
section be 'verbosely written' as:
.section .rodata,"a",@progbits
.string "Not-writable"
.section .data,"wa",@progbits
.string "Writable"
Also seems to be related to: X86 assembly: What is the difference between .text.startup section and .text section.