ld maps sections without consider memory region?

Nick Clifton nickc@redhat.com
Fri Feb 16 14:42:00 GMT 2007


Hi Masaki,

> (Still I don't agree why PHDR is needed)
> 
> I have expected result on the test case I sent and some variations.
> But the another ldscript used for my product generates
> huge (over 3GB) elf executable with no warnings...
> It was 500KB without PHDRS. There seems to have the another issue.

Please could you give the attached patch a try ?  I think that it will 
solve the problem without requiring that you specify the program headers 
in your linker file.

Cheers
   Nick

PS.  I am still running tests of my own on this patch, so if it throws 
up any problems I will let you know.

include/ChangeLog
2007-02-16  Nick Clifton  <nickc@redhat.com>

	* bfdlink.h (struct bfd_link_callbacks): Add
	override_segment_assignment field.

bfd/ChangeLog
2007-02-16  Nick Clifton  <nickc@redhat.com>

	* elf.c (_bfd_elf_map_sections_to_segments): If the
	override_segment_assignment callback is defined then call it.

ld/ChangeLog
2007-02-16  Nick Clifton  <nickc@redhat.com>

	* ldlang.c (ldlang_override_segment_assignment): New function.
	* ldlang.h (ldlang_override_segment_assignment): Prototype.
	* ldmain.c (link_callbacks): Add
	ldlang_override_segment_assignment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MEMORY_and_segments.patch.bz2
Type: application/x-bzip2
Size: 1693 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20070216/5029c088/attachment.bz2>


More information about the Binutils mailing list