Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MC] When using bundle aligment, align sections to bundle size
Summary: Bundle aligment requires that the functions always start at an aligned address. Usually this is ensured by the compiler, but assembly code does not always begin with a .align directive. This change ensures that sections get the correct alignment if they contain any instructions and bundling is enabled. (It also makes LLVM match the behavior of GNU as). Differential Revision: http://reviews.llvm.org/D9131 llvm-svn: 235365
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - \ | ||
# RUN: | llvm-readobj -sections | FileCheck %s | ||
|
||
# Test that bundle-aligned sections with instructions are aligned | ||
|
||
.bundle_align_mode 5 | ||
# CHECK: Sections | ||
# Check that the empty .text section has the default alignment | ||
# CHECK-LABEL: Name: .text | ||
# CHECK-NOT: Name | ||
# CHECK: AddressAlignment: 4 | ||
|
||
.section text1, "x" | ||
imull $17, %ebx, %ebp | ||
# CHECK-LABEL: Name: text1 | ||
# CHECK: AddressAlignment: 32 | ||
|
||
.section text2, "x" | ||
imull $17, %ebx, %ebp | ||
# CHECK-LABEL: Name: text2 | ||
# CHECK: AddressAlignment: 32 |