forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed a crash in llvm-mc for Mach-O when a symbol difference expressi…
…on uses a symbol from an assignment. In this case the symbol did not have a fragment so MCObjectWriter::IsSymbolRefDifferenceFullyResolved() should not have been calling IsSymbolRefDifferenceFullyResolvedImpl() with a NULL fragment and should just have returned false in that case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149442 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
2 changed files
with
29 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,27 @@ | ||
// RUN: llvm-mc -triple x86_64-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s | ||
|
||
// Test case for rdar://10743265 | ||
|
||
// This tests that this expression does not cause a crash and produces two | ||
// relocation entries: | ||
// Relocation information (__TEXT,__text) 2 entries | ||
// address pcrel length extern type scattered symbolnum/value | ||
// 00000000 False long True SUB False _base | ||
// 00000000 False long True UNSIGND False _start_ap_2 | ||
|
||
_base = . | ||
|
||
.long (0x2000) + _start_ap_2 - _base | ||
.word 0 | ||
|
||
_start_ap_2: | ||
cli | ||
|
||
// CHECK: ('_relocations', [ | ||
// CHECK: # Relocation 0 | ||
// CHECK: (('word-0', 0x0), | ||
// CHECK: ('word-1', 0x5c000000)), | ||
// CHECK: # Relocation 1 | ||
// CHECK: (('word-0', 0x0), | ||
// CHECK: ('word-1', 0xc000001)), | ||
// CHECK: ]) |