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]

Re: Linker relaxation and the size of the output section


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


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