public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Questions on .dynbss and empty input sections
@ 2005-02-24 13:33 H. J. Lu
  0 siblings, 0 replies; only message in thread
From: H. J. Lu @ 2005-02-24 13:33 UTC (permalink / raw)
  To: binutils

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-02-24  1:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-24 13:33 Questions on .dynbss and empty input sections H. J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).