Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional compilation of .importobj doesn't raise an undefined label error when it should #144

Open
Zeturic opened this issue Jul 22, 2018 · 1 comment
Labels

Comments

@Zeturic
Copy link
Contributor

Zeturic commented Jul 22, 2018

This is the smallest example I could come up with to show the problem. Imagine this is the contents of test.asm:

.gba
.thumb
.create "test.gba", 0x0

bl foo

.ifdef NOT_DEFINED
.importobj "foo.o"
.endif

.close

foo.o exists and exports the symbol foo.

This should report an error about Undefined label "foo", but it doesn't. It is accepted without complaints.

It does correctly report the error if the .importobj line is commented out or replaced with foo: or a .definelabel for foo. Additionally, if foo.o doesn't actually export foo, it also correctly reports the error (though that's hardly surprising).

@sp1187 sp1187 added the bug label May 12, 2019
@Zeturic
Copy link
Contributor Author

Zeturic commented Feb 6, 2020

The bug also manifests like this:

.gba
.thumb
.create "test.gba", 0x08000000

.ifdef NOT_DEFINED
.importobj "nonexistant.o"
.endif

.close

If nonexistent.o doesn't exist, ARMIPS will nonsensically complain about error: Could not load library.

Since both are caused by ARMIPS reading object files when it shouldn't (or attempting to, in this case), it's probably the same bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants