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

Unified Diff: src/IceELFObjectWriter.h

Issue 828873002: Subzero: Start writing out some relocation sections (text) (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: review fixes Created 5 years, 11 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/IceDefs.h ('k') | src/IceELFObjectWriter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceELFObjectWriter.h
diff --git a/src/IceELFObjectWriter.h b/src/IceELFObjectWriter.h
index 039db625fdc06bd6f76d939c55074e4c2f199b4b..9f468cb05ed5efaec6defbccced13d84cd35e67e 100644
--- a/src/IceELFObjectWriter.h
+++ b/src/IceELFObjectWriter.h
@@ -47,10 +47,9 @@ public:
// Copy data of a function's text section to file and note the offset of the
// symbol's definition in the symbol table.
- // TODO(jvoung): This also needs the relocations to adjust the
- // section-relative offsets and hook them up to the symbol table references.
+ // Copy the text fixups for use after all functions are written.
void writeFunctionCode(const IceString &FuncName, bool IsInternal,
- const llvm::StringRef Data);
+ const Assembler *Asm);
// Copy initializer data for a global to file and note the offset and
// size of the global's definition in the symbol table.
@@ -75,7 +74,7 @@ private:
typedef std::vector<ELFSection *> SectionList;
typedef std::vector<ELFTextSection *> TextSectionList;
typedef std::vector<ELFDataSection *> DataSectionList;
- typedef std::vector<ELFRelocationSectionBase *> RelSectionList;
+ typedef std::vector<ELFRelocationSection *> RelSectionList;
TextSectionList TextSections;
RelSectionList RelTextSections;
DataSectionList DataSections;
@@ -117,6 +116,12 @@ private:
// Link the relocation sections to the symbol table.
void assignRelLinkNum(SizeT SymTabNumber, RelSectionList &RelSections);
+ // Write the final relocation sections given the final symbol table.
+ // May also be able to seek around the file and resolve function calls
+ // that are for functions within the same section.
+ void writeAllRelocationSections(bool IsELF64);
+ void writeRelocationSections(bool IsELF64, RelSectionList &RelSections);
+
// Write the ELF file header with the given information about sections.
template <bool IsELF64>
void writeELFHeaderInternal(Elf64_Off SectionHeaderOffset,
« no previous file with comments | « src/IceDefs.h ('k') | src/IceELFObjectWriter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698