This is the mail archive of the binutils@sourceware.org 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: -Ttext and phdr_in_segment


On Fri, Jan 25, 2013 at 08:47:10PM +1030, Alan Modra wrote:
> On Fri, Jan 25, 2013 at 11:52:28AM +0530, Senthil Kumar Selvaraj wrote:
> > What's the best way to turn it off? Some targets (cr16 for example) turn
> > it off in the linker emulation template, by setting magic_demand_paged
> > to FALSE in the after_parse hook.
> 
> I'd do it in the before_parse hook.
> 

The patch below turns off demand paging for AVR in the before_parse hook. If 
the patch is ok, could someone commit it to trunk please?

Regards
Senthil

2013-01-25  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

	* ld/emultempl/avrelf.em: Add avr_elf_before_parse and disable
	demand paging


diff --git ld/emultempl/avrelf.em ld/emultempl/avrelf.em
index e0d6357..7f7dcf0 100644
--- ld/emultempl/avrelf.em
+++ ld/emultempl/avrelf.em
@@ -166,6 +166,15 @@ avr_elf_after_allocation (void)
     }
 }
 
+static void
+avr_elf_before_parse (void)
+{
+  /* Don't create a demand-paged executable, since this feature isn't
+     meaninful in AVR. */
+  config.magic_demand_paged = FALSE;
+
+  gld${EMULATION_NAME}_before_parse ();
+}
 
 EOF
 
@@ -262,6 +271,7 @@ PARSE_AND_LIST_ARGS_CASES='
 #
 # Put these extra avr-elf routines in ld_${EMULATION_NAME}_emulation
 #
+LDEMUL_BEFORE_PARSE=avr_elf_before_parse
 LDEMUL_BEFORE_ALLOCATION=avr_elf_${EMULATION_NAME}_before_allocation
 LDEMUL_AFTER_ALLOCATION=avr_elf_after_allocation
 LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=avr_elf_create_output_section_statements


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