mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Learn that __DATA,__objc_classrefs is not atomized via symbols.
This should hopefully fix objc on AArch64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228976 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
122ea21abf
commit
ef1d2264bc
@ -33,6 +33,10 @@ bool MCAsmInfoDarwin::isSectionAtomizableBySymbols(
|
||||
if (SMO.getSegmentName() == "__DATA" && SMO.getSectionName() == "__cfstring")
|
||||
return false;
|
||||
|
||||
if (SMO.getSegmentName() == "__DATA" &&
|
||||
SMO.getSectionName() == "__objc_classrefs")
|
||||
return false;
|
||||
|
||||
switch (SMO.getType()) {
|
||||
default:
|
||||
return true;
|
||||
|
@ -134,6 +134,10 @@ static bool canUseLocalRelocation(const MCSectionMachO &Section,
|
||||
RefSec.getSectionName() == "__cfstring")
|
||||
return false;
|
||||
|
||||
if (RefSec.getSegmentName() == "__DATA" &&
|
||||
RefSec.getSectionName() == "__objc_classrefs")
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
25
test/MC/MachO/AArch64/classrefs.s
Normal file
25
test/MC/MachO/AArch64/classrefs.s
Normal file
@ -0,0 +1,25 @@
|
||||
; RUN: llvm-mc -triple arm64-apple-darwin10 %s -filetype=obj -o - | llvm-readobj -r --expand-relocs | FileCheck %s
|
||||
|
||||
; Test that we produce an external relocation with Lbar. We could also produce
|
||||
; an internal relocation. We just have to be careful to not use another symbol.
|
||||
|
||||
// CHECK: Relocations [
|
||||
// CHECK-NEXT: Section __data {
|
||||
// CHECK-NEXT: Relocation {
|
||||
// CHECK-NEXT: Offset: 0x0
|
||||
// CHECK-NEXT: PCRel: 0
|
||||
// CHECK-NEXT: Length: 3
|
||||
// CHECK-NEXT: Extern: 1
|
||||
// CHECK-NEXT: Type: ARM64_RELOC_UNSIGNED (0)
|
||||
// CHECK-NEXT: Symbol: Lbar
|
||||
// CHECK-NEXT: Scattered: 0
|
||||
// CHECK-NEXT: }
|
||||
// CHECK-NEXT: }
|
||||
// CHECK-NEXT: ]
|
||||
|
||||
.section __DATA,__objc_classrefs,regular,no_dead_strip
|
||||
Lbar:
|
||||
|
||||
.section __DATA,__data
|
||||
.quad Lbar
|
||||
|
Loading…
Reference in New Issue
Block a user