This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: COMMON symbols get overridden by PROVIDE commands?
- From: Alan Modra <amodra at gmail dot com>
- To: Tony Beta Lambda <tonybetalambda at gmail dot com>
- Cc: binutils at sourceware dot org, Ian Lance Taylor <iant at google dot com>
- Date: Fri, 19 Dec 2014 21:56:37 +1030
- Subject: Re: COMMON symbols get overridden by PROVIDE commands?
- Authentication-results: sourceware.org; auth=none
- References: <CADG+S6LgFg7cAFJ8kux1zoQ1m0AhQGrerfwaxKxtGTDTKNXL1Q at mail dot gmail dot com>
On Thu, Dec 18, 2014 at 04:31:27PM +0800, Tony Beta Lambda wrote:
> Hi,
>
> The default linker script PROVIDEs the symbol end, but this replaces
> the symbol defined in COMMON section and causes error. (ld version
> 2.24 on Linux 3.16.0 x86_64)
>
> Example C code:
>
> int end[100000];
> int main(void) { end[99999] = 0; return 0; }
PROVIDE has overridden common symbols right from the initial support
added 20 years ago, commit 31ddb156. Ian, is there a good reason for
this ld behaviour?
--
Alan Modra
Australia Development Lab, IBM