[PATCH] D140123: [TLS] Clamp the alignment of TLS global variables if required by the target

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 15 17:35:38 PST 2022


arsenm added a comment.

In D140123#4000077 <https://reviews.llvm.org/D140123#4000077>, @wolfgangp wrote:

> In D140123#4000068 <https://reviews.llvm.org/D140123#4000068>, @arsenm wrote:
>
>> What is the consequence of having excess alignment?
>
> In our case the ELF section with the variable was also aligned to 64 bytes and the OS refused to load the executable.

Isn't that case covered by  GlobalObject::canIncreaseAlignment?

  // It also has to either not have a section defined, or, not have
  // alignment specified. (If it is assigned a section, the global
  // could be densely packed with other objects in the section, and
  // increasing the alignment could cause padding issues.)
  if (hasSection() && getAlign())
    return false;
  
  // On ELF platforms, we'


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140123/new/

https://reviews.llvm.org/D140123



More information about the llvm-commits mailing list