COMMON symbols get overridden by PROVIDE commands?

Alan Modra amodra@gmail.com
Fri Dec 19 11:26:00 GMT 2014


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



More information about the Binutils mailing list