This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: bug fix for displaying load address in the map file
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Ina Pandit <InaP at KPITCummins dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 11 Dec 2006 11:06:38 +1030
- Subject: Re: bug fix for displaying load address in the map file
- References: <4A1BE23A7B777442B60F4B4916AE0F130EF0DFE8@sohm.kpit.com>
On Fri, Dec 08, 2006 at 05:49:58PM +0530, Ina Pandit wrote:
> The "load address" of a section is not displayed in the map file when it is
> assigned using 'AT > lma_region' expression in the linker script i.e.
> .data {*(.data) } >ram AT>rom
>
> However, if the load address is assigned using AT(lma) expression
> in the linker script, i.e.
> .data : AT(lma) {*(.data)} >ram
> it is displayed in the map file.
>
> The function "print_output_section_statement" (in ldlang.c), prints
> the load address in the map file if "load_base" is not NULL. To solve
> this problem, I modified the function "lang_size_sections_1" (in ldlang.c).
>
> However, after this modification, the linker function LOADADDR(section),
> computed incorrect value of LMA of a section. The value computed was
> the sum of LMA and VMA.
This should have told you that your patch was wrong. I think that
instead of trying to set load_base that it would be better to modify
print_output_section_statement to print the section lma if it is
different from the vma.
--
Alan Modra
IBM OzLabs - Linux Technology Centre