This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Linker relaxation and the size of the output section
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Hans-Peter Nilsson <hp at bitrange dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 08 Oct 2003 12:27:30 +0930
- Subject: Re: Linker relaxation and the size of the output section
- References: <Pine.BSF.4.44.0309281612450.21971-100000@dair.pair.com>
I'd like to see _cooked_size replaced by a delta_size field, initially
set to zero. Instead of using
sec->_cooked_size != 0 ? sec->_cooked_size : sec->_raw_size
the linker would always calculate section size using
sec->_raw_size + sec->delta_size
Faster, simpler, and allows output size to shrink to zero. Do you feel
like doing a little editing? :-)
Hmm, the following uses of _cooked_size outsize of bfd/ and ld/ are a
little dubious (or at least unnecessary). I'm fairly certain that
nothing beside the linker needs to look at _cooked_size.
./gprof/corefile.c: + core_syms[i]->section->_cooked_size - 1, max_vma);
./gdb/hppa-tdep.c: && sec->vma + sec->_cooked_size < pc)
./sim/mcore/interp.c: (unsigned long) s_bss->vma , (unsigned long) s_bss->_cooked_size);
./sim/mcore/interp.c: heap_ptr = (unsigned long) s_bss->vma + (unsigned long) s_bss->_cooked_size;
--
Alan Modra
IBM OzLabs - Linux Technology Centre