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]

[PATCH/RFA] Fix C-referenceable sections with explicit LMAs


On Wed, Nov 20, 2002 at 07:49:16AM -0500, Hans-Peter Nilsson wrote:

 > On Tue, 19 Nov 2002, Jason R Thorpe wrote:
 > > On Tue, Nov 19, 2002 at 09:44:21AM -0800, Jason R Thorpe wrote:
 > > Ok, this patch (again, against 2.11.2) actually works.
 > 
 > > Anyway, I'd appreciate any comments people might have on this.
 > 
 > Perhaps a little something for the test-suite?

Yes indeed.  Here is the patch for current Binutils, as well as a
test case.  Test case fails without the patch, passes with, and no
new regressions (tested on arm-netbsdelf).

OK for mainline?  OK for 2.13 branch?

	* ldexp.c (fold_name): Handle SIZEOF_UNADJ.  When handling
	SIZEOF, apply any size adjustment that has been recorded
	for the section.
	* ldgram.y (SIZEOF_UNADJ): New token.
	* ldlang.c (lang_output_section_statement_lookup): Initialize
	size_adj and last_orphan members.
	* ldlang.h (lang_output_section_statement_type): Add size_adj
	and last_orphan members.
	* emultempl/elf32.em (place_orphan): If no .rodata output section
	is present, allow read-only data to be placed with .text.  If
	the output section has an explicit LMA, compute an explicit LMA
	for the orphan based on the LMA of the output section or the
	previous orphan.  Record a size adjustment of the output section
	for each orphan placed with it.

	* ld-scripts/refsec-lma.exp: New test.
	* ld-scripts/refsec-lma.s: New test.
	* ld-scripts/refsec-lma.t: New test.

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>

Attachment: ld-orphan-patch
Description: Text document


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