[PATCH] D22506: [ELF] - Cleanup of LinkerScript<ELFT>::assignAddresses()
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 21 09:15:13 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL276300: [ELF] - Cleanup of LinkerScript<ELFT>::assignAddresses() (authored by grimar).
Changed prior to commit:
https://reviews.llvm.org/D22506?vs=64908&id=64911#toc
Repository:
rL LLVM
https://reviews.llvm.org/D22506
Files:
lld/trunk/ELF/LinkerScript.cpp
lld/trunk/ELF/LinkerScript.h
Index: lld/trunk/ELF/LinkerScript.cpp
===================================================================
--- lld/trunk/ELF/LinkerScript.cpp
+++ lld/trunk/ELF/LinkerScript.cpp
@@ -277,6 +277,17 @@
}
template <class ELFT>
+void LinkerScript<ELFT>::dispatchAssignment(SymbolAssignment *Cmd) {
+ uint64_t Val = evalExpr(Cmd->Expr, Dot);
+ if (Cmd->Name == ".") {
+ Dot = Val;
+ } else {
+ auto *D = cast<DefinedRegular<ELFT>>(Symtab<ELFT>::X->find(Cmd->Name));
+ D->Value = Val;
+ }
+}
+
+template <class ELFT>
void LinkerScript<ELFT>::assignAddresses(
ArrayRef<OutputSectionBase<ELFT> *> Sections) {
// Orphan sections are sections present in the input files which
@@ -297,14 +308,7 @@
for (const std::unique_ptr<BaseCommand> &Base : Opt.Commands) {
if (auto *Cmd = dyn_cast<SymbolAssignment>(Base.get())) {
- uint64_t Val = evalExpr(Cmd->Expr, Dot);
- if (Cmd->Name == ".") {
-
- Dot = Val;
- } else {
- auto *D = cast<DefinedRegular<ELFT>>(Symtab<ELFT>::X->find(Cmd->Name));
- D->Value = Val;
- }
+ dispatchAssignment(Cmd);
continue;
}
Index: lld/trunk/ELF/LinkerScript.h
===================================================================
--- lld/trunk/ELF/LinkerScript.h
+++ lld/trunk/ELF/LinkerScript.h
@@ -121,6 +121,7 @@
int getSectionIndex(StringRef Name);
std::vector<size_t> getPhdrIndicesForSection(StringRef Name);
+ void dispatchAssignment(SymbolAssignment *Cmd);
uintX_t Dot;
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22506.64911.patch
Type: text/x-patch
Size: 1502 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160721/c9c7282a/attachment.bin>
More information about the llvm-commits
mailing list