This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Add two new tests showing broken .tbss alignment if first in PT_TLS
ClosedPublic

Authored by jrtc27 on Jul 28 2021, 12:37 PM.

Details

Summary

This is a similar problem to D66658, where we are too aggressive in not
aligning NOBITS sections, and the tests are based on the ones added for
that fix. If a .tbss section is first in a PT_TLS segment (i.e. there is
no .tdata section) then, although it doesn't need to be aligned such
that address and offset are congruent modulo the page size, they do need
to be congruent modulo the segment alignment, otherwise the whole PT_TLS
will be unaligned.

Diff Detail