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: Assembler messages [PATCH]


Ah! Sorry. I understand your original post to me now. Is it at all 
possible to generate the following form?

[a.s]
.text
a:
.word 0

[b.s]
.text
b:
	ldr r0, a

To me, just because the symbol and the referencer are in different 
files shouldn't end the world. That's why we have a linker. If you 
merge the two files it works just fine.

[ab.s]
.text
a:
.word 0
b:
	ldr r0, a

I noticed that if the symbol and the referencer are in different 
sections we also see this same error:

[c.s]
.data
a:
.word 0
.text
b:
	ldr r0, a

And finally, my initial conclusion was entirely incorrect.

[d.s]
.text
a:
.word 0
.space 4096, 0
b:
        ldr r0, a

$ arm-elf-as d.s
d.s: Assembler messages:
d.s:6: Error: bad immediate value for offset (4108)

So, that error message works just fine.

Can we change the error message then to...
	"`%s' must be defined in this file"
and a check for the second case is needed:
	"`%s' must be defined in the same section"

Cheers,
Shaun


> No, that isn't right.
>
> Consider this case:
>
> .text
> l:
>         ldr     r0, x
>
> X isn't defined at all, so it's not correct to say it's out of
> range.
>
> R.


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