This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Re: -Ttext and phdr_in_segment
- From: Senthil Kumar Selvaraj <senthil_kumar dot selvaraj at atmel dot com>
- To: Joerg Wunsch <joerg dot wunsch at atmel dot com>
- Cc: <binutils at sourceware dot org>, <eric dot weddington at atmel dot com>
- Date: Tue, 5 Feb 2013 10:54:46 +0530
- Subject: Re: [PATCH] Re: -Ttext and phdr_in_segment
- References: <20130121135301.GB26283@atmel.com> <20130123051755.GP3244@bubble.grove.modra.org> <20130125062225.GA3369@atmel.com> <20130125101710.GD3244@bubble.grove.modra.org> <20130129064402.GD1480@atmel.com> <m21ud36cz1.fsf@igel.home> <20130130062511.GA25686@atmel.com> <20130131062255.GQ3244@bubble.grove.modra.org> <20130131083917.GN9929@atmel.com>
Ping
On Thu, Jan 31, 2013 at 09:39:17AM +0100, Joerg Wunsch wrote:
> As Alan Modra wrote:
>
> > The implementation looks OK, but I believe this patch should be
> > reviewed by the AVR maintainers. There may be some unforseen effect.
>
> I reviewed it, and Eric Weddington had a chance to review it, too, but
> did not object.
>
> Most AVR users extract the binary contents from the ELF file anyway
> (using objcopy), so they won't care. There are only two direct
> consumers of the ELF file known by now. One of them (Atmel Studio)
> discovered the problem since they could not properly handle the
> additional header that is placed there when moving the text section
> away from its default address 0, and the other one (Opensource
> AVRDUDE) has been verified to handle both cases well, without as well
> as with the change applied.
> --
> Joerg Wunsch * Development engineer, Dresden, Germany
>
> Atmel Automotive GmbH, Theresienstrasse 2, D-74027 Heilbronn
> Geschaeftsfuehrung: Steven A. Laub, Stephen Cumming
> Amtsgericht Stuttgart, Registration HRB 106594
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
+ meaningful 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