Skip to content

Conversation

@quic-akaryaki
Copy link
Contributor

A symbol may be defined in a script referencing a section address. Such symbols get their values after section layout is complete. At the relaxation time such symbols do not have the correct value. The current logic uses a value of zero as an indicator that the symbol value is unknown and prevents some relaxations with them. However, this logic produces both false positives and false negatives because 1) incomplete symbol values may be used in expressions that produce a nonzero value and 2) some symbols having a zero value are valid and can be relaxed.

In this change, symbols that reference unknows section addresses are detected and the corresponding relaxations are not performed.

A symbol may be defined in a script referencing a section address. Such
symbols get their values after section layout is complete. At the
relaxation time such symbols do not have the correct value. The current
logic uses a value of zero as an indicator that the symbol value is
unknown and prevents some relaxations with them. However, this logic
produces both false positives and false negatives because 1) incomplete
symbol values may be used in expressions that produce a nonzero value
and 2) some symbols having a zero value are valid and can be relaxed.

In this change, symbols that reference unknows section addresses are
detected and the corresponding relaxations are not performed.
@quic-akaryaki
Copy link
Contributor Author

Relaxation tests have not been updated.

@lenary
Copy link
Member

lenary commented Jul 28, 2025

Thanks! This looks about right, but testing will prove that.

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.

3 participants