redballoonsecurity / ofrak

OFRAK: unpack, modify, and repack binaries.
https://ofrak.com
Other
1.82k stars 128 forks source link

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

Closed rbs-afflitto closed 4 months ago

rbs-afflitto commented 4 months ago

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

Link to Related Issue(s)

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