summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.h
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-05-24 18:08:04 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-05-24 18:08:04 +0000
commit55b169bf5dd84246f9d71ed6cd2b05d65e10d1fc (patch)
treee5b0d0aae42938c104df5125da83e01617450cdd /lld/ELF/LinkerScript.h
parentc98741c79e83ee64592fb82b9577119958793d80 (diff)
downloadbcm5719-llvm-55b169bf5dd84246f9d71ed6cd2b05d65e10d1fc.tar.gz
bcm5719-llvm-55b169bf5dd84246f9d71ed6cd2b05d65e10d1fc.zip
Move writeTo to OutputSectionCommand.
This reduces how many times we have to map from OutputSection to OutputSectionCommand. It is a required step to moving clearOutputSections earlier. In order to always use writeTo in OutputSectionCommand we have to call fabricateDefaultCommands for -r links and move section compression after it. llvm-svn: 303784
Diffstat (limited to 'lld/ELF/LinkerScript.h')
-rw-r--r--lld/ELF/LinkerScript.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h
index e85a279ca7a..e56e569d4e7 100644
--- a/lld/ELF/LinkerScript.h
+++ b/lld/ELF/LinkerScript.h
@@ -130,6 +130,9 @@ struct OutputSectionCommand : BaseCommand {
ConstraintKind Constraint = ConstraintKind::NoConstraint;
std::string Location;
std::string MemoryRegionName;
+
+ template <class ELFT> void writeTo(uint8_t *Buf);
+ uint32_t getFiller();
};
// This struct represents one section match pattern in SECTIONS() command.
@@ -213,7 +216,6 @@ struct ScriptConfiguration {
class LinkerScript final {
llvm::DenseMap<OutputSection *, OutputSectionCommand *> SecToCommand;
- OutputSectionCommand *getCmd(OutputSection *Sec) const;
void assignSymbol(SymbolAssignment *Cmd, bool InSec);
void setDot(Expr E, const Twine &Loc, bool InSec);
@@ -244,6 +246,7 @@ class LinkerScript final {
MemoryRegion *CurMemRegion = nullptr;
public:
+ OutputSectionCommand *getCmd(OutputSection *Sec) const;
bool hasPhdrsCommands() { return !Opt.PhdrsCommands.empty(); }
uint64_t getDot() { return Dot; }
OutputSection *getOutputSection(const Twine &Loc, StringRef S);
@@ -263,7 +266,6 @@ public:
std::vector<PhdrEntry> createPhdrs();
bool ignoreInterpSection();
- llvm::Optional<uint32_t> getFiller(OutputSection *Sec);
bool hasLMA(OutputSection *Sec);
bool shouldKeep(InputSectionBase *S);
void assignOffsets(OutputSectionCommand *Cmd);
@@ -272,7 +274,6 @@ public:
void synchronize();
void assignAddresses(std::vector<PhdrEntry> &Phdrs);
- void writeDataBytes(OutputSection *Sec, uint8_t *Buf);
void addSymbol(SymbolAssignment *Cmd);
void processCommands(OutputSectionFactory &Factory);
OpenPOWER on IntegriCloud