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: bug fix for displaying load address in the map file


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


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