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

Fix a bug in the cpm65 linker script causing certain addresses not to be relocated. #112

Merged
merged 1 commit into from
Apr 16, 2023

Conversation

davidgiven
Copy link
Contributor

This is fallout from #106; turns out that LOADADDR() addresses are absolute. This meant that any address sourced from LOADADDR() doesn't get relocated, even when they should be. Specifically, this was causing the source for the initialised zero page to be read from the wrong location.

The solution is to use a pointer difference of LOADADDRs from the start of the binary to get the offset, and then add on the ADDR of the binary start, turning the symbol into a .text address.

…e address

for the initialised zero page isn't absolute --- LOADADDR() returns absolute
addresses.
@mysterymath mysterymath merged commit dcd6a2a into llvm-mos:main Apr 16, 2023
asiekierka pushed a commit to asiekierka/llvm-mos-sdk that referenced this pull request Jun 29, 2023
…e address (llvm-mos#112)

for the initialised zero page isn't absolute --- LOADADDR() returns absolute
addresses.

Co-authored-by: dg <dg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants