Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: src/IceELFSection.cpp

Issue 1017373002: Subzero: Assemble calls to constant addresses. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: move test back Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceELFSection.h ('k') | src/IceFixups.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceELFSection.cpp
diff --git a/src/IceELFSection.cpp b/src/IceELFSection.cpp
index f2e129d3e6e7a8c8dcc7ea24d90fcd067e082cc8..4ca2de470950c095065fd4cf677d47c71da6b3e0 100644
--- a/src/IceELFSection.cpp
+++ b/src/IceELFSection.cpp
@@ -80,6 +80,15 @@ size_t ELFRelocationSection::getSectionDataSize() const {
// Symbol tables.
+void ELFSymbolTableSection::createNullSymbol(ELFSection *NullSection) {
+ // The first entry in the symbol table should be a NULL entry,
+ // so make sure the map is still empty.
+ assert(LocalSymbols.empty());
+ const IceString NullSymName("");
+ createDefinedSym(NullSymName, STT_NOTYPE, STB_LOCAL, NullSection, 0, 0);
+ NullSymbol = findSymbol(NullSymName);
+}
+
void ELFSymbolTableSection::createDefinedSym(const IceString &Name,
uint8_t Type, uint8_t Binding,
ELFSection *Section,
@@ -105,7 +114,9 @@ void ELFSymbolTableSection::noteUndefinedSym(const IceString &Name,
NewSymbol.Sym.setBindingAndType(STB_GLOBAL, STT_NOTYPE);
NewSymbol.Section = NullSection;
NewSymbol.Number = ELFSym::UnknownNumber;
- GlobalSymbols.insert(std::make_pair(Name, NewSymbol));
+ bool Unique = GlobalSymbols.insert(std::make_pair(Name, NewSymbol)).second;
+ assert(Unique);
+ (void)Unique;
}
const ELFSym *ELFSymbolTableSection::findSymbol(const IceString &Name) const {
« no previous file with comments | « src/IceELFSection.h ('k') | src/IceFixups.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698