Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Correctly translating an R_68K_PC32 relocation requires emitting a HUNK_RELRELOC32 relocation, not a HUNK_RELOC32 one as the code does currently. Since we don't emit any HUNK_RELRELOC32 hunks, we should report errors for these relocations. The exception to this is relocations that refer to symbols in the same section as the relocation, since these won't actually require any relocation at load time (everything in the same hunk will be moved together, preserving relative offsets within the hunk). So, we can handle these correctly by simply not emitting a hunk relocation at all.
This is required for targeting 68060 with modern gcc, which will emit instructions that require this (eg. bra.l) with sufficient optimizations enabled.
Side note: It looks like proper handling for these relocs was added in the original AROS tool after this version was forked, so it may be wise to incorporate those changes as well at some point. However, these turn out to be somewhat limited so it's still worthwhile to try and avoid emitting them when possible. Luckily, these are relatively rare; I have yet to encounter a case that isn't covered by this PR, for example.