Skip to content

Revert using SUBALIGN(0) for .bss sections#431

Merged
whyitfor merged 2 commits into
redballoonsecurity:masterfrom
rbs-afflitto:bugfix/bss_subalign
Feb 28, 2024
Merged

Revert using SUBALIGN(0) for .bss sections#431
whyitfor merged 2 commits into
redballoonsecurity:masterfrom
rbs-afflitto:bugfix/bss_subalign

Conversation

@rbs-afflitto
Copy link
Copy Markdown
Collaborator

One sentence summary of this PR (This should go in the CHANGELOG!)

  • Removed SUBALIGN(0) for .bss sections

Link to Related Issue(s)

  • N/A

Please describe the changes in your request.

The SUBALIGN(0) option was leading to the following linker errors when building AARCH64 patches:

relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against `.bss'
warning: one possible cause of this error is that the symbol is being referenced in the indicated code as if it
had a larger alignment than was declared where it was defined.

SUBALIGN(0) strips any alignment which is specified. It is not clear what issue was fixed by adding this originally. Future alignment issues should be fixed by setting the alignment of bss variables with the __attribute__ ((aligned())) attribute.

Anyone you think should look at this, specifically?

@whyitfor

@whyitfor whyitfor self-requested a review February 28, 2024 23:42
Copy link
Copy Markdown
Contributor

@whyitfor whyitfor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@whyitfor whyitfor merged commit 043eef7 into redballoonsecurity:master Feb 28, 2024
ANogin pushed a commit to ANogin/ofrak that referenced this pull request May 30, 2024
* Remove SUBALIGN(0) from bss linker script

* Update changelog
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.

2 participants