This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: What's wrong with this linker script?
- From: Ian Lance Taylor <ian at airs dot com>
- To: "Steve Snyder" <steves at formation dot com>
- Cc: <binutils at sources dot redhat dot com>
- Date: 13 Mar 2002 09:26:04 -0800
- Subject: Re: What's wrong with this linker script?
- References: <KMEBIOGPEGOACPDOHPEEMEEFCAAA.steves@formation.com>
"Steve Snyder" <steves@formation.com> writes:
> Hmm, you make a good point. Suppose I replace segment FLASHCODE with the
> section ".burn_flash_code" like this:
>
> __DATA_ROM = ADDR(.text) + SIZEOF(.text);
> __DATA_RAM = ADDR(.burn_flash_code);
> __DATA_END = ADDR(.burn_flash_code) + SIZEOF(.burn_flash_code);
>
> Doing this gives me a different linker error:
>
> ldppc -X -N -M -Map egu_diag.map -o egu_diag -Tegu_diag.cmd obj1.o obj2.o
> ldppc: ADDR forward reference of section .burn_flash_code
>
> Given that section .burn_flash_code is located in segment FLASHCODE, that
> should satisfy the linker, yet it doesn't.
It's because the address of .burn_flash_code is being set based on a
computation involving ADDR and SIZEOF. Actually, it looks like you
are setting the address of .burn_flash_code in two ways; I'm not sure
why. Perhaps if you removed that computation, and just put
.burn_flash_code in the memory segment without setting the address, it
would work. I'm not sure.
Ian