This is the mail archive of the binutils@sourceware.org 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: x3 multiplier of address of section specified by symbol in section


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


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