[llvm] r199577 - ARM ELF: ensure that the tag types are corrected
Saleem Abdulrasool
compnerd at compnerd.org
Sun Jan 19 00:25:41 PST 2014
Author: compnerd
Date: Sun Jan 19 02:25:41 2014
New Revision: 199577
URL: http://llvm.org/viewvc/llvm-project?rev=199577&view=rev
Log:
ARM ELF: ensure that the tag types are corrected
Ensure that the tag types are reflected on a replacement. This is particularly
important for the compatibility tag which has multiple representations where the
last definition wins.
Added:
llvm/trunk/test/MC/ARM/directive-eabi_attribute-overwrite.s
Modified:
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp?rev=199577&r1=199576&r2=199577&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp Sun Jan 19 02:25:41 2014
@@ -290,6 +290,7 @@ private:
if (AttributeItem *Item = getAttributeItem(Attribute)) {
if (!OverwriteExisting)
return;
+ Item->Type = AttributeItem::NumericAttribute;
Item->IntValue = Value;
return;
}
@@ -310,6 +311,7 @@ private:
if (AttributeItem *Item = getAttributeItem(Attribute)) {
if (!OverwriteExisting)
return;
+ Item->Type = AttributeItem::TextAttribute;
Item->StringValue = Value;
return;
}
@@ -330,6 +332,7 @@ private:
if (AttributeItem *Item = getAttributeItem(Attribute)) {
if (!OverwriteExisting)
return;
+ Item->Type = AttributeItem::NumericAndTextAttributes;
Item->IntValue = IntValue;
Item->StringValue = StringValue;
return;
Added: llvm/trunk/test/MC/ARM/directive-eabi_attribute-overwrite.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/directive-eabi_attribute-overwrite.s?rev=199577&view=auto
==============================================================================
--- llvm/trunk/test/MC/ARM/directive-eabi_attribute-overwrite.s (added)
+++ llvm/trunk/test/MC/ARM/directive-eabi_attribute-overwrite.s Sun Jan 19 02:25:41 2014
@@ -0,0 +1,18 @@
+@ RUN: llvm-mc -triple armv7-eabi -filetype obj -o - %s | llvm-readobj -s -sd \
+@ RUN: | FileCheck %s
+
+ .syntax unified
+ .thumb
+
+ .eabi_attribute Tag_compatibility, 1
+ .eabi_attribute Tag_compatibility, 1, "aeabi"
+
+@ CHECK: Section {
+@ CHECK: Name: .ARM.attributes
+@ CHECK: Type: SHT_ARM_ATTRIBUTES
+@ CHECK: SectionData (
+@ CHECK: 0000: 41170000 00616561 62690001 0D000000
+@ CHECK: 0010: 20014145 41424900
+@ CHECK: )
+@ CHECK: }
+
More information about the llvm-commits
mailing list