This is the mail archive of the 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: Can't Resolve External Symbol When Subtracting

Anthony DeRosa wrote:
Is this the wrong mailing list for the question I posted yesterday,
repeated below?

It is the correct list.


"Anthony DeRosa" <> 10/26/2006 10:32 am

After recently upgrading from binutils 2.15.90 to binutils 2.17, I get
the following error with the following code:
#-------------- code snippet ---------------------------------
.extern external_symbol
.half 0x1234
.half 0x5678
# this *does* work
.word external_symbol
# this *does* work
.word local_symbol_0 - local_symbol_1
# this does *not* work
.word external_symbol - local_symbol_0

#-------------- reported error ---------------------------------
$ mips-elf-as test.S test.S: Assembler messages:
test.S:8: Error: can't resolve `external_symbol' {*UND* section} -
``local_symbol_0' {.text section}
This error did not occur with the previous version of binutils. Why
does this no longer work? What is the workaround?

I believe the answer is: That Binutils was 'Improved' so that you can no longer take the difference between symbols that may be in different sections.

As far as I know there are only the obvious workarounds:

1) Change your code.

2) Use a version of Binutils that works with your code.

3) Modify Binutils so that you can once again do what your program does.

David Daney.

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