This is the mail archive of the binutils@sources.redhat.com 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: What's wrong with this linker script?


"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


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