summaryrefslogtreecommitdiff
path: root/include/mcld/LinkerConfig.h
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2013-03-04 19:51:03 -0800
committerStephen Hines <srhines@google.com>2013-03-04 20:01:30 -0800
commit6f75755c9204b1d8817ae5a65a2f7e5af0ec3f70 (patch)
tree35a64dc0a0ad870f64fae2c88f4357d88270def8 /include/mcld/LinkerConfig.h
parent86036a3bd999904d071826b2f0a84023e28aeebc (diff)
downloadmclinker-jb-mr2-release.tar.gz
Change-Id: Ibae073aefc7838fce46875a6bf6ce7b7e18eced8 Date: Mon Mar 4 22:29:06 2013 +0100
Diffstat (limited to 'include/mcld/LinkerConfig.h')
-rw-r--r--include/mcld/LinkerConfig.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/mcld/LinkerConfig.h b/include/mcld/LinkerConfig.h
index 9e70ecf..f0c2c87 100644
--- a/include/mcld/LinkerConfig.h
+++ b/include/mcld/LinkerConfig.h
@@ -44,6 +44,28 @@ public:
Binary
};
+ /** \enum CodePosition
+ * CodePosition indicates the ability of the generated output to be
+ * loaded at different addresses. If the output can be loaded at different
+ * addresses, we say the output is position independent. Shared libraries
+ * and position-independent executable programs (PIE) are in this category.
+ * ::Independent indicates the output is position independent.
+ * If a executable program can not be loaded at arbitrary addresses, but it
+ * can call outside functions, we say the program is dynamic dependent on
+ * the address to be loaded. ::DynamicDependent indicates the output is not
+ * only a executable program, but also dynamic dependent. In general,
+ * executable programs are dynamic dependent.
+ * If a executable program can not be loaded at different addresses, and
+ * only call inner functions, then we say the program is static dependent on
+ * its loaded address. ::StaticDependent is used to indicate this kind of
+ * output.
+ */
+ enum CodePosition {
+ Independent, ///< Position Independent
+ DynamicDependent, ///< Can call outside libraries
+ StaticDependent ///< Can not call outside libraries
+ };
+
public:
LinkerConfig();
@@ -70,6 +92,13 @@ public:
void setCodeGenType(CodeGenType pType) { m_CodeGenType = pType; }
+ CodePosition codePosition() const { return m_CodePosition; }
+ void setCodePosition(CodePosition pPosition) { m_CodePosition = pPosition; }
+
+ bool isCodeIndep() const { return (Independent == m_CodePosition); }
+ bool isCodeDynamic() const { return (DynamicDependent == m_CodePosition); }
+ bool isCodeStatic() const { return (StaticDependent == m_CodePosition); }
+
static const char* version();
private:
@@ -81,6 +110,7 @@ private:
AttributeOption m_Attribute;
CodeGenType m_CodeGenType;
+ CodePosition m_CodePosition;
};
} // namespace of mcld