This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Questions on .dynbss and empty input sections
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Wed, 23 Feb 2005 17:39:51 -0800
- Subject: Questions on .dynbss and empty input sections
Why does _bfd_elf_create_dynamic_sections create .dynbss section for
all outputs, but only .rel.bss/.rela.bss for executables? I thought
.dynbss was for copy relocations. If they aren't needed for DSO, why
.dynbss is created for DSO and relocatable?
Also, linker creates empty .text, .data and .bss output sections:
# echo > x.c
# gcc -c x.c
# ld -shared x.o
# readelf -S a.out
[ 4] .text PROGBITS 0000018c 00018c 000000 00 AX 0 0 4
[ 7] .data PROGBITS 000011f0 0001f0 000000 00 WA 0 0 4
[ 8] .bss NOBITS 000011f0 0001f0 000000 00 WA 0 0 4
Can we not generate an output section if its input sections are
all empty?
H.J.