[PATCH] D113365: [LLD][COFF] Support GNU style == aliases
Ayke via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 19 05:22:37 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd649faff9c0c: [LLD][COFF] Support GNU style == aliases (authored by aykevl).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113365/new/
https://reviews.llvm.org/D113365
Files:
lld/COFF/Config.h
lld/COFF/Driver.cpp
lld/test/COFF/Inputs/library.def
lld/test/COFF/lib.test
Index: lld/test/COFF/lib.test
===================================================================
--- lld/test/COFF/lib.test
+++ lld/test/COFF/lib.test
@@ -1,6 +1,16 @@
# RUN: lld-link /machine:x64 /def:%S/Inputs/library.def /out:%t.lib
# RUN: llvm-nm %t.lib | FileCheck %s
+CHECK: 00000000 a @comp.id
+CHECK: 00000000 a @feat.00
+CHECK: 00000000 W alias
+CHECK: U function
+
+CHECK: 00000000 a @comp.id
+CHECK: 00000000 a @feat.00
+CHECK: 00000000 W __imp_alias
+CHECK: U __imp_function
+
CHECK: 00000000 R __imp_constant
CHECK: 00000000 R constant
Index: lld/test/COFF/Inputs/library.def
===================================================================
--- lld/test/COFF/Inputs/library.def
+++ lld/test/COFF/Inputs/library.def
@@ -1,5 +1,6 @@
LIBRARY library
EXPORTS
function
+ alias == function
data DATA
constant CONSTANT
Index: lld/COFF/Driver.cpp
===================================================================
--- lld/COFF/Driver.cpp
+++ lld/COFF/Driver.cpp
@@ -810,6 +810,7 @@
e2.Name = std::string(e1.name);
e2.SymbolName = std::string(e1.symbolName);
e2.ExtName = std::string(e1.extName);
+ e2.AliasTarget = std::string(e1.aliasTarget);
e2.Ordinal = e1.ordinal;
e2.Noname = e1.noname;
e2.Data = e1.data;
@@ -908,6 +909,7 @@
}
e2.name = saver.save(e1.Name);
e2.extName = saver.save(e1.ExtName);
+ e2.aliasTarget = saver.save(e1.AliasTarget);
e2.ordinal = e1.Ordinal;
e2.noname = e1.Noname;
e2.data = e1.Data;
Index: lld/COFF/Config.h
===================================================================
--- lld/COFF/Config.h
+++ lld/COFF/Config.h
@@ -43,6 +43,7 @@
struct Export {
StringRef name; // N in /export:N or /export:E=N
StringRef extName; // E in /export:E=N
+ StringRef aliasTarget; // GNU specific: N in "alias == N"
Symbol *sym = nullptr;
uint16_t ordinal = 0;
bool noname = false;
@@ -63,6 +64,7 @@
bool operator==(const Export &e) {
return (name == e.name && extName == e.extName &&
+ aliasTarget == e.aliasTarget &&
ordinal == e.ordinal && noname == e.noname &&
data == e.data && isPrivate == e.isPrivate);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113365.401184.patch
Type: text/x-patch
Size: 2220 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220119/dd06eba1/attachment.bin>
More information about the llvm-commits
mailing list