[PATCH] D84788: [ELF] for symver directives, preserve the given symbol's size
Anthony Eden via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 28 18:14:33 PDT 2020
aeden updated this revision to Diff 281440.
aeden added a comment.
Herald added a subscriber: emaste.
Herald added a reviewer: espindola.
Updated to include llvm/test/MC/ELF/symver.s modifications
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D84788/new/
https://reviews.llvm.org/D84788
Files:
llvm/lib/MC/ELFObjectWriter.cpp
llvm/test/MC/ELF/symver.s
Index: llvm/test/MC/ELF/symver.s
===================================================================
--- llvm/test/MC/ELF/symver.s
+++ llvm/test/MC/ELF/symver.s
@@ -21,6 +21,18 @@
.symver global1, g1@@zed
global1:
+ .global global2
+ .type global2, @object
+ .size global2, 4
+ .symver global2, tom@@petty
+
+global2:
+ .byte 0
+ .byte 0
+ .byte 0
+ .byte 0
+
+
// CHECK: Relocations [
// CHECK-NEXT: Section {{.*}} .rela.text {
// CHECK-NEXT: 0x0 R_X86_64_32 .text 0x0
@@ -121,4 +133,22 @@
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: .text
// CHECK-NEXT: }
+// CHECK-NEXT: Symbol {
+// CHECK-NEXT: Name: global2 (94)
+// CHECK-NEXT: Value: 0x14
+// CHECK-NEXT: Size: 4
+// CHECK-NEXT: Binding: Global (0x1)
+// CHECK-NEXT: Type: Object (0x1)
+// CHECK-NEXT: Other: 0
+// CHECK-NEXT: Section: .text (0x2)
+// CHECK-NEXT: }
+// CHECK-NEXT: Symbol {
+// CHECK-NEXT: Name: tom@@petty (1)
+// CHECK-NEXT: Value: 0x14
+// CHECK-NEXT: Size: 4
+// CHECK-NEXT: Binding: Global (0x1)
+// CHECK-NEXT: Type: Object (0x1)
+// CHECK-NEXT: Other: 0
+// CHECK-NEXT: Section: .text (0x2)
+// CHECK-NEXT: }
// CHECK-NEXT: ]
Index: llvm/lib/MC/ELFObjectWriter.cpp
===================================================================
--- llvm/lib/MC/ELFObjectWriter.cpp
+++ llvm/lib/MC/ELFObjectWriter.cpp
@@ -1277,6 +1277,7 @@
Alias->setExternal(Symbol.isExternal());
Alias->setBinding(Symbol.getBinding());
Alias->setOther(Symbol.getOther());
+ Alias->setSize(Symbol.getSize());
if (!Symbol.isUndefined() && !Rest.startswith("@@@"))
continue;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84788.281440.patch
Type: text/x-patch
Size: 1725 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200729/74a88289/attachment.bin>
More information about the llvm-commits
mailing list