[MC] Ensure that pending labels are flushed when -mc-relax-all flag is used
authorPetr Hosek <phosek@chromium.org>
Sat, 27 Jun 2015 01:54:17 +0000 (01:54 +0000)
committerPetr Hosek <phosek@chromium.org>
Sat, 27 Jun 2015 01:54:17 +0000 (01:54 +0000)
commitbc245c01bff943b39162504fc8e9b7480ddb965c
tree9880dfbfd2fa85bf00260f852e6ad05628ff6fa5
parent0aaf3287e31c19efba5a1ab592db0446950e3c0a
[MC] Ensure that pending labels are flushed when -mc-relax-all flag is used

Summary:
The current implementation doesn't always flush all pending labels
beforeemitting data which can result in an incorrectly placed labels in
case when when instruction bundling is enabled and -mc-relax-all flag is
being used. To address this issue, we always flush pending labels before
emitting data.

The change was tested by running PNaCl toolchain trybots with
-mc-relax-all flag set.

Fixes https://code.google.com/p/nativeclient/issues/detail?id=4063

Test Plan: Regression test attached

Reviewers: mseaborn

Subscribers: jfb, llvm-commits

Differential Revision: http://reviews.llvm.org/D10325

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240870 91177308-0d34-0410-b5e6-96231b3b80d8
lib/MC/MCObjectStreamer.cpp
test/MC/X86/AlignedBundling/rodata-section.s [new file with mode: 0644]