[llvm] r210317 - Revert r210298 'Correctly set the comdat symbol on COFF' as it asserts on Windows
Timur Iskhodzhanov
timurrrr at google.com
Fri Jun 6 01:18:18 PDT 2014
Author: timurrrr
Date: Fri Jun 6 03:18:18 2014
New Revision: 210317
URL: http://llvm.org/viewvc/llvm-project?rev=210317&view=rev
Log:
Revert r210298 'Correctly set the comdat symbol on COFF' as it asserts on Windows
Removed:
llvm/trunk/test/MC/COFF/section-comdat-conflict.s
Modified:
llvm/trunk/include/llvm/MC/MCSectionCOFF.h
llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
llvm/trunk/test/MC/COFF/section-comdat.s
Modified: llvm/trunk/include/llvm/MC/MCSectionCOFF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSectionCOFF.h?rev=210317&r1=210316&r2=210317&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCSectionCOFF.h (original)
+++ llvm/trunk/include/llvm/MC/MCSectionCOFF.h Fri Jun 6 03:18:18 2014
@@ -76,7 +76,6 @@ class MCSymbol;
return SectionName.str() + "_end";
}
unsigned getCharacteristics() const { return Characteristics; }
- const MCSymbol *getCOMDATSymbol() const { return COMDATSymbol; }
int getSelection() const { return Selection; }
const MCSectionCOFF *getAssocSection() const { return Assoc; }
Modified: llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp?rev=210317&r1=210316&r2=210317&view=diff
==============================================================================
--- llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/WinCOFFObjectWriter.cpp Fri Jun 6 03:18:18 2014
@@ -347,11 +347,6 @@ void WinCOFFObjectWriter::DefineSection(
COFFSection *coff_section = createSection(Sec.getSectionName());
COFFSymbol *coff_symbol = createSymbol(Sec.getSectionName());
- if (const MCSymbol *S = Sec.getCOMDATSymbol()) {
- COFFSymbol *COMDATSymbol = GetOrCreateCOFFSymbol(S);
- assert(!COMDATSymbol->Section);
- COMDATSymbol->Section = coff_section;
- }
coff_section->Symbol = coff_symbol;
coff_symbol->Section = coff_section;
@@ -463,15 +458,9 @@ void WinCOFFObjectWriter::DefineSymbol(M
coff_symbol->Data.SectionNumber = COFF::IMAGE_SYM_ABSOLUTE;
} else {
const MCSymbolData &BaseData = Assembler.getSymbolData(*Base);
- if (BaseData.Fragment) {
- COFFSection *Sec =
+ if (BaseData.Fragment)
+ coff_symbol->Section =
SectionMap[&BaseData.Fragment->getParent()->getSection()];
-
- if (coff_symbol->Section && coff_symbol->Section != Sec)
- report_fatal_error("conflicting sections for symbol");
-
- coff_symbol->Section = Sec;
- }
}
coff_symbol->MCData = &ResSymData;
Removed: llvm/trunk/test/MC/COFF/section-comdat-conflict.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/section-comdat-conflict.s?rev=210316&view=auto
==============================================================================
--- llvm/trunk/test/MC/COFF/section-comdat-conflict.s (original)
+++ llvm/trunk/test/MC/COFF/section-comdat-conflict.s (removed)
@@ -1,13 +0,0 @@
-// RUN: not llvm-mc -triple i386-pc-win32 -filetype=obj < %s 2>&1 | FileCheck %s
-
-// CHECK: conflicting sections for symbol
-
- .section .xyz
- .global bar
-bar:
- .long 42
-
- .section .abcd,"xr",discard,bar
- .global foo
-foo:
- .long 42
Modified: llvm/trunk/test/MC/COFF/section-comdat.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/section-comdat.s?rev=210317&r1=210316&r2=210317&view=diff
==============================================================================
--- llvm/trunk/test/MC/COFF/section-comdat.s (original)
+++ llvm/trunk/test/MC/COFF/section-comdat.s Fri Jun 6 03:18:18 2014
@@ -40,11 +40,6 @@ Symbol6:
Symbol7:
.long 1
-.section SecName, "dr", newest, "Symbol8"
-.globl AnotherSymbol
-AnotherSymbol:
-.long 1
-
// CHECK: Sections [
// CHECK: Section {
// CHECK: Number: 1
@@ -119,10 +114,6 @@ AnotherSymbol:
// CHECK: }
// CHECK: }
// CHECK: Symbol {
-// CHECK: Name: Symbol1
-// CHECK: Section: secName (2)
-// CHECK: }
-// CHECK: Symbol {
// CHECK: Name: secName
// CHECK: Section: secName (3)
// CHECK: AuxSectionDef {
@@ -130,10 +121,6 @@ AnotherSymbol:
// CHECK: }
// CHECK: }
// CHECK: Symbol {
-// CHECK: Name: Symbol2
-// CHECK: Section: secName (3)
-// CHECK: }
-// CHECK: Symbol {
// CHECK: Name: SecName
// CHECK: Section: SecName (4)
// CHECK: AuxSectionDef {
@@ -141,10 +128,6 @@ AnotherSymbol:
// CHECK: }
// CHECK: }
// CHECK: Symbol {
-// CHECK: Name: Symbol3
-// CHECK: Section: SecName (4)
-// CHECK: }
-// CHECK: Symbol {
// CHECK: Name: SecName
// CHECK: Section: SecName (5)
// CHECK: AuxSymbolCount: 1
@@ -153,10 +136,6 @@ AnotherSymbol:
// CHECK: }
// CHECK: }
// CHECK: Symbol {
-// CHECK: Name: Symbol4
-// CHECK: Section: SecName (5)
-// CHECK: }
-// CHECK: Symbol {
// CHECK: Name: SecName
// CHECK: Section: SecName (6)
// CHECK: AuxSectionDef {
@@ -165,10 +144,6 @@ AnotherSymbol:
// CHECK: }
// CHECK: }
// CHECK: Symbol {
-// CHECK: Name: Symbol5
-// CHECK: Section: SecName (6)
-// CHECK: }
-// CHECK: Symbol {
// CHECK: Name: SecName
// CHECK: Section: SecName (7)
// CHECK: AuxSectionDef {
@@ -176,10 +151,6 @@ AnotherSymbol:
// CHECK: }
// CHECK: }
// CHECK: Symbol {
-// CHECK: Name: Symbol6
-// CHECK: Section: SecName (7)
-// CHECK: }
-// CHECK: Symbol {
// CHECK: Name: SecName
// CHECK: Section: SecName (8)
// CHECK: AuxSectionDef {
@@ -187,22 +158,31 @@ AnotherSymbol:
// CHECK: }
// CHECK: }
// CHECK: Symbol {
-// CHECK: Name: Symbol7
-// CHECK: Section: SecName (8)
+// CHECK: Name: Symbol1
+// CHECK: Section: secName (2)
// CHECK: }
// CHECK: Symbol {
-// CHECK: Name: SecName
-// CHECK: Section: SecName (9)
-// CHECK: AuxSectionDef {
-// CHECK: Selection: Newest (0x7)
-// CHECK: }
+// CHECK: Name: Symbol2
+// CHECK: Section: secName (3)
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: Symbol3
+// CHECK: Section: SecName (4)
// CHECK: }
// CHECK: Symbol {
-// CHECK: Name: Symbol8
-// CHECK: Section: SecName (9)
+// CHECK: Name: Symbol4
+// CHECK: Section: SecName (5)
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: Symbol5
+// CHECK: Section: SecName (6)
// CHECK: }
// CHECK: Symbol {
-// CHECK: Name: AnotherSymbol
-// CHECK: Section: SecName (9)
+// CHECK: Name: Symbol6
+// CHECK: Section: SecName (7)
+// CHECK: }
+// CHECK: Symbol {
+// CHECK: Name: Symbol7
+// CHECK: Section: SecName (8)
// CHECK: }
// CHECK: ]
More information about the llvm-commits
mailing list