This is an archive of the discontinued LLVM Phabricator instance.

[llvm-mc] - Properly set the the address align field of the compressed sections.
ClosedPublic

Authored by grimar on Apr 22 2019, 6:35 AM.

Details

Summary

About the compressed sections spec says:
(https://docs.oracle.com/cd/E37838_01/html/E36783/section_compression.html)
sh_addralign fields of the section header for a compressed section
reflect the requirements of the compressed section.

Currently, llvm-mc always puts uncompressed section alignment to sh_addralign.
It is not correct. zlib styled section contains an Elfxx_Chdr header,
so we should either use 4 or 8 values depending on the target
(Uncompressed section alignment is stored in ch_addralign field of the compression header).

GNU assembler version 2.31.1 also has this issue,
but in 2.32.51 it was already fixed. This is how it was found
during debugging of the https://bugs.llvm.org/show_bug.cgi?id=40482
actually.

Diff Detail

Event Timeline

grimar created this revision.Apr 22 2019, 6:35 AM
dblaikie accepted this revision.Apr 22 2019, 12:00 PM

Soundsn good to me - thanks!

This revision is now accepted and ready to land.Apr 22 2019, 12:00 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 23 2019, 2:15 AM