This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: x3 multiplier of address of section specified by symbol in section
- From: Alan Modra <amodra at gmail dot com>
- To: Marco Sirabella <marco at sirabella dot org>
- Cc: binutils at sourceware dot org
- Date: Tue, 26 Mar 2019 12:01:22 +1030
- Subject: Re: x3 multiplier of address of section specified by symbol in section
- References: <20190323021957.e6ngqyov76luydix@Ridl3y>
On Fri, Mar 22, 2019 at 10:19:57PM -0400, Marco Sirabella wrote:
> Any idea what's going on? I suspect ORG is being evaluated multiple(3) times,
> each time being offset more because .text is being offset more.
Correct. You have defined ORG as a symbol in the .text section, not
an absolute symbol. (Related to this, .org does not set an absolute
address as you may be used to in some other assemblers.)
> .text
> .org 5
> .global ORG
> ORG:
>
> SECTIONS
> {
> . = ORG;
> .text : { *(.text) }
> }
>
--
Alan Modra
Australia Development Lab, IBM