Skip to content

Commit 9390005

Browse files
committed
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. llvm-svn: 199577
1 parent 196c321 commit 9390005

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ class ARMTargetELFStreamer : public ARMTargetStreamer {
290290
if (AttributeItem *Item = getAttributeItem(Attribute)) {
291291
if (!OverwriteExisting)
292292
return;
293+
Item->Type = AttributeItem::NumericAttribute;
293294
Item->IntValue = Value;
294295
return;
295296
}
@@ -310,6 +311,7 @@ class ARMTargetELFStreamer : public ARMTargetStreamer {
310311
if (AttributeItem *Item = getAttributeItem(Attribute)) {
311312
if (!OverwriteExisting)
312313
return;
314+
Item->Type = AttributeItem::TextAttribute;
313315
Item->StringValue = Value;
314316
return;
315317
}
@@ -330,6 +332,7 @@ class ARMTargetELFStreamer : public ARMTargetStreamer {
330332
if (AttributeItem *Item = getAttributeItem(Attribute)) {
331333
if (!OverwriteExisting)
332334
return;
335+
Item->Type = AttributeItem::NumericAndTextAttributes;
333336
Item->IntValue = IntValue;
334337
Item->StringValue = StringValue;
335338
return;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@ RUN: llvm-mc -triple armv7-eabi -filetype obj -o - %s | llvm-readobj -s -sd \
2+
@ RUN: | FileCheck %s
3+
4+
.syntax unified
5+
.thumb
6+
7+
.eabi_attribute Tag_compatibility, 1
8+
.eabi_attribute Tag_compatibility, 1, "aeabi"
9+
10+
@ CHECK: Section {
11+
@ CHECK: Name: .ARM.attributes
12+
@ CHECK: Type: SHT_ARM_ATTRIBUTES
13+
@ CHECK: SectionData (
14+
@ CHECK: 0000: 41170000 00616561 62690001 0D000000
15+
@ CHECK: 0010: 20014145 41424900
16+
@ CHECK: )
17+
@ CHECK: }
18+

0 commit comments

Comments
 (0)