Subject: CVS commit: gnusrc/gnu/dist/toolchain/ld
To: None <source-changes@netbsd.org>
From: Jason R Thorpe <thorpej@netbsd.org>
List: source-changes
Date: 11/20/2002 08:51:10
Module Name:	gnusrc
Committed By:	thorpej
Date:		Wed Nov 20 06:51:10 UTC 2002

Modified Files:
	gnusrc/gnu/dist/toolchain/ld: ldexp.c ldgram.y ldlang.c ldlang.h
	gnusrc/gnu/dist/toolchain/ld/emultempl: elf32.em

Log Message:
Fix a problem with placing orphaned sections (like the ones with
C-referenceable names, i.e. "link sets") that happens with explicit
LMAs in the linker script:

	* As orphans are sorted after sections, the effective
	  size of the section is changed.  Record a size ajustment
	  for each orphan that is sorted after the section.

...and for sections which have an explicit load address expression:

	* The first time an orphan is sorted after a section,
	  copy the load_base expression to the orphan, adding
	  the _unadjusted_ size of the parent section.  We need
	  to use the unadjusted size because by the time the
	  expression can be folded, all of the orphan size
	  adjustments will have accumulated, resulting in misplacing
	  the orphan.

	* For each subsequent orphan sorted after a section,
	  set the load_base of the orphan to the load address
	  of the previous orphan plus the size of the previous
	  orphan (actually, the unadjusted size, but for orphans,
	  size and unadjusted size are always equal).


To generate a diff of this commit:
cvs rdiff -r1.1.1.3 -r1.2 gnusrc/gnu/dist/toolchain/ld/ldexp.c
cvs rdiff -r1.4 -r1.5 gnusrc/gnu/dist/toolchain/ld/ldgram.y
cvs rdiff -r1.1.1.4 -r1.2 gnusrc/gnu/dist/toolchain/ld/ldlang.c \
    gnusrc/gnu/dist/toolchain/ld/ldlang.h
cvs rdiff -r1.3 -r1.4 gnusrc/gnu/dist/toolchain/ld/emultempl/elf32.em

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.