Stop uppercasing build attribute data.
authorCharlie Turner <charlie.turner@arm.com>
Thu, 27 Nov 2014 12:13:56 +0000 (12:13 +0000)
committerCharlie Turner <charlie.turner@arm.com>
Thu, 27 Nov 2014 12:13:56 +0000 (12:13 +0000)
The string data for string-valued build attributes were being unconditionally
uppercased. There is no mention in the ARM ABI addenda about case conventions,
so it's technically implementation defined as to whether the data are
capitialised in some way or not. However, there are good reasons not to
captialise the data.

  * It's less work.
  * Some vendors may legitimately have case-sensitive checks for these
    attributes which would fail on LLVM generated object files.
  * There could be locale issues with uppercasing.

The original reasons for uppercasing appear to have stemmed from an
old codesourcery toolchain behaviour, see

http://comments.gmane.org/gmane.comp.compilers.llvm.cvs/87133

This patch makes the object file emitted no longer captialise string
data, it encodes as seen in the assembly source.

Change-Id: Ibe20dd6e60d2773d57ff72a78470839033aa5538

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222882 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
test/CodeGen/ARM/build-attributes-encoding.s
test/MC/ARM/directive-arch-iwmmxt.s
test/MC/ARM/directive-arch-iwmmxt2.s
test/MC/ARM/directive-cpu.s
test/MC/ARM/directive-eabi_attribute-overwrite.s
test/MC/ARM/directive-eabi_attribute.s
test/tools/llvm-readobj/ARM/attributes.s

index 24ee537116b9866f8ba909f265d53674b8c8a81a..e92a43c5b79b50488065a0153a116945858226a5 100644 (file)
@@ -979,12 +979,12 @@ void ARMTargetELFStreamer::finishAttributeSection() {
       Streamer.EmitULEB128IntValue(item.IntValue);
       break;
     case AttributeItem::TextAttribute:
-      Streamer.EmitBytes(item.StringValue.upper());
+      Streamer.EmitBytes(item.StringValue);
       Streamer.EmitIntValue(0, 1); // '\0'
       break;
     case AttributeItem::NumericAndTextAttributes:
       Streamer.EmitULEB128IntValue(item.IntValue);
-      Streamer.EmitBytes(item.StringValue.upper());
+      Streamer.EmitBytes(item.StringValue);
       Streamer.EmitIntValue(0, 1); // '\0'
       break;
     }
index 34a1ad38fb179a4c10fe0ba5947d598dd91efdba..29f13f09d319f00ca895653ec4d33ac8eb3b92ae 100644 (file)
@@ -78,7 +78,7 @@
 // CHECK-NEXT:     EntrySize: 0
 // CHECK-NEXT:     SectionData (
 // CHECK-NEXT:       0000: 41460000 00616561 62690001 3C000000
-// CHECK-NEXT:       0010: 05434F52 5445582D 41380006 0A074108
+// CHECK-NEXT:       0010: 05636F72 7465782D 61380006 0A074108
 // CHECK-NEXT:       0020: 0109020A 030C0214 01150117 01180119
 // CHECK-NEXT:       0030: 011B001C 0124012A 012C0244 036EA001
 // CHECK-NEXT:       0040: 81013100 FA0101
index db25ec683fe53185873b7a7eb0bb24435e2445d7..c54846dbcc20043fdd8b81b6f0321f15dfa6486d 100644 (file)
@@ -16,7 +16,7 @@
 @ CHECK-ATTR: FileAttributes {
 @ CHECK-ATTR:   Attribute {
 @ CHECK-ATTR:     TagName: CPU_name
-@ CHECK-ATTR:     Value: IWMMXT
+@ CHECK-ATTR:     Value: iwmmxt
 @ CHECK-ATTR:   }
 @ CHECK-ATTR:   Attribute {
 @ CHECK-ATTR:     TagName: CPU_arch
index de94f97b449efcbb2c9e8a3ceb6633638544beff..a4e59b5ba2775a62e3ae4542c578a6186a5edfab 100644 (file)
@@ -16,7 +16,7 @@
 @ CHECK-ATTR: FileAttributes {
 @ CHECK-ATTR:   Attribute {
 @ CHECK-ATTR:     TagName: CPU_name
-@ CHECK-ATTR:     Value: IWMMXT2
+@ CHECK-ATTR:     Value: iwmmxt2
 @ CHECK-ATTR:   }
 @ CHECK-ATTR:   Attribute {
 @ CHECK-ATTR:     TagName: CPU_arch
index 952dd93f370c2347df4315e1fb9f154e61279a14..d81a03e5e2993fb5e9fd38f06dc9eb3c61a32896 100644 (file)
@@ -20,7 +20,6 @@
 @ CHECK: 10000000
 
        .cpu    cortex-a8
-@ CHECK: 05
-@ CHECK: 434F52 5445582D 413800
+@ CHECK: 05636F72 7465782D 613800
 
 @ CHECK: )
index 6fdded3d83129be109d6a616254fda80b700683b..69342b2cd81f053b02edecf8ccd8cb3872e85630 100644 (file)
@@ -3,13 +3,13 @@
 
        .syntax unified
        .thumb
-
+@ FIXME: The next directive is not correct, Tag_compatibility isn't getting parsed correctly.
        .eabi_attribute Tag_compatibility, 1
        .eabi_attribute Tag_compatibility, 1, "aeabi"
 
 @ CHECK-ATTR: FileAttributes {
 @ CHECK-ATTR:   Attribute {
-@ CHECK-ATTR:     Value: 1, AEABI
+@ CHECK-ATTR:     Value: 1, aeabi
 @ CHECK-ATTR:     TagName: compatibility
 @ CHECK-ATTR:     Description: AEABI Conformant
 @ CHECK-ATTR:   }
index e2f1f9b01af2809b5dcaadd6de9982f67b1581ad..135afa74f2f5a1478c5d826f831b299c42256052 100644 (file)
@@ -9,12 +9,12 @@
 @ CHECK: .eabi_attribute 4, "Cortex-A9"
 @ CHECK-OBJ:        Tag: 4
 @ CHECK-OBJ-NEXT:   TagName: CPU_raw_name
-@ CHECK-OBJ-NEXT:   Value: CORTEX-A9
+@ CHECK-OBJ-NEXT:   Value: Cortex-A9
        .eabi_attribute Tag_CPU_name, "cortex-a9"
 @ CHECK: .cpu cortex-a9
 @ CHECK-OBJ:        Tag: 5
 @ CHECK-OBJ-NEXT:   TagName: CPU_name
-@ CHECK-OBJ-NEXT:   Value: CORTEX-A9
+@ CHECK-OBJ-NEXT:   Value: cortex-a9
        .eabi_attribute Tag_CPU_arch, 10
 @ CHECK: .eabi_attribute 6, 10
 @ CHECK-OBJ:        Tag: 6
        .eabi_attribute Tag_compatibility, 1, "aeabi"
 @ CHECK: .eabi_attribute 32, 1, "aeabi"
 @ CHECK-OBJ:        Tag: 32
-@ CHECK-OBJ-NEXT:   Value: 1, AEABI
+@ CHECK-OBJ-NEXT:   Value: 1, aeabi
 @ CHECK-OBJ-NEXT:   TagName: compatibility
 @ CHECK-OBJ-NEXT:   Description: AEABI Conformant
        .eabi_attribute Tag_CPU_unaligned_access, 0
 @ CHECK: .eabi_attribute 65, "gnu"
 @ CHECK-OBJ:        Tag: 65
 @ CHECK-OBJ-NEXT:   TagName: also_compatible_with
-@ CHECK-OBJ-NEXT:   Value: GNU
+@ CHECK-OBJ-NEXT:   Value: gnu
        .eabi_attribute Tag_T2EE_use, 0
 @ CHECK: .eabi_attribute 66, 0
 @ CHECK-OBJ:        Tag: 66
index 594bab85a09eaf93a1cb19d849e0812a3552806d..59cefad0fc882c62f1d3b01114582f3e52a5542d 100644 (file)
 @ CHECK:       Attribute {
 @ CHECK:         Tag: 4
 @ CHECK:         TagName: CPU_raw_name
-@ CHECK:         Value: CORTEX-A9
+@ CHECK:         Value: Cortex-A9
 @ CHECK:       }
 @ CHECK:       Attribute {
 @ CHECK:         Tag: 5
 @ CHECK:         TagName: CPU_name
-@ CHECK:         Value: CORTEX-A9
+@ CHECK:         Value: cortex-a9
 @ CHECK:       }
 @ CHECK:       Attribute {
 @ CHECK:         Tag: 6
 @ CHECK:       }
 @ CHECK:       Attribute {
 @ CHECK:         Tag: 32
-@ CHECK:         Value: 1, AEABI
+@ CHECK:         Value: 1, aeabi
 @ CHECK:         TagName: compatibility
 @ CHECK:         Description: AEABI Conformant
 @ CHECK:       }
 @ CHECK:       Attribute {
 @ CHECK:         Tag: 65
 @ CHECK:         TagName: also_compatible_with
-@ CHECK:         Value: GNU
+@ CHECK:         Value: gnu
 @ CHECK:       }
 @ CHECK:       Attribute {
 @ CHECK:         Tag: 66