This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]