Query Regarding BSS in ELF.

Arvind Tiwari arvind@cdotd.ernet.in
Thu Jun 21 15:03:00 GMT 2001


Hi All,

    I am trying to make a cross compiler on HPUX B 10.20 Operating
System for target  M68k-MOTOROLA-ELF. The cross compiler
builds without any problem. The problem comes when i try to build an
executable using this cross-compiler. The executable actually is
reserving quite a huge amount of space allocated for .bss section (the
global uninitialized data) which is consuming all my memory
requirements.
    Earlier i was working with m68k-motorola-coff format cross
compiler on the same host platform and it was not allocating any space
for .bss section.
    Is there any way besides changing the code of  bfd / ld by which i
can
reduce this .bss section contents to zero which means the actual size of

.bss section is allocated only at the run time by the linker ?
    I have tried doing it via changing the default ld scripts for linker

(which is elf.sc in my case) but it is not solving my problem.
    Is there any option of ld using which will prevent allocation of
space
to .bss section ?
    Actually, i know that i can specifically remove ".bss" section using

objcopy but in my case i wish to have .bss section which should be
allocated its space only at the runtime.
    In case i need to change the code of bfd / ld can anyone suggest
some
pointers from where to start ....

thanxs in advance.
Arvind

p.s. I am currently using binutils-2.9.1 and gcc-2.95.2 packages
to build the cross compiler.


More information about the crossgcc mailing list