This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: "AT > region" interpreted as "> region" in linker script
- From: "Galit Heller" <Galit dot Heller at nsc dot com>
- To: "Nick Clifton" <nickc at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Sun, 04 Jan 2004 15:42:53 +0200
- Subject: Re: "AT > region" interpreted as "> region" in linker script
- References: <3FF2A293.82092115@nsc.com> <m3znd688ss.fsf@redhat.com>
Hi Nick,
> Do you agree with this patch ?
>
> Cheers
> Nick
>
> ld/ChangeLog
> 2004-01-02 Nick Clifton <nickc@redhat.com>
>
> * ldlang.c (lang_get_regions): Add extra parameter 'have_vma'
> which if true will prevent the LMA region being used as a
> replacement for a default VMA region.
> (lang_leave_output_section_statement): Pass extra parameter.
> (lang_leave_overlay): Likewise.
> * ld.texinfo (Output Section LMA): Document that the LMA
> region can be set to the VMA region if no VMA has been set.
Yes, this fixes the issue. I acknowledge that if a virtual address isn't set
explicitly, then using the load region is a more logical choice than the
current location counter value.
While trying the patch, I noticed a similar problem (not caused by the patch).
The problem is similar in the sense that a virtual address setting is
"not taken into account" with relation to a memory region setting:
The following scenario results in the error message:
ld-new: section .data [00000010 -> 0000001b] overlaps section .text [00000010 ->
000003a7]
MEMORY {
ram : ORIGIN = 0x10, LENGTH = 0x1000
}
SECTIONS { .text 0x10 : { *(.text) }
.data : { *(.data) } > ram
}
I.e. the second output section statement allocates the ram region from the
beginning, without taking into account that this area had already been
allocated to another output section.
Thanks,
Galit.