diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-03-14 20:09:04 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-03-14 20:09:04 +0000 |
commit | 54e582179f328717d9e1fc6b7ded5c8083b926a6 (patch) | |
tree | fab1ea7ed8802b314cb55484dcc712878185a555 /include | |
parent | 419e5ffe4ade7ddd95e4c25c7fb98ba607678554 (diff) | |
download | llvm-54e582179f328717d9e1fc6b7ded5c8083b926a6.tar.gz llvm-54e582179f328717d9e1fc6b7ded5c8083b926a6.tar.bz2 llvm-54e582179f328717d9e1fc6b7ded5c8083b926a6.tar.xz |
Correctly handle an ELF symbol defined with "a = b + expr".
We were marking the symbol as absolute instead of computing b's offset + the
expression value.
This fixes pr19126.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203962 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/MC/MCSymbol.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/MC/MCSymbol.h b/include/llvm/MC/MCSymbol.h index ea14da1e15..866d9a9a68 100644 --- a/include/llvm/MC/MCSymbol.h +++ b/include/llvm/MC/MCSymbol.h @@ -18,6 +18,7 @@ #include "llvm/Support/Compiler.h" namespace llvm { + class MCAsmLayout; class MCExpr; class MCSection; class MCContext; @@ -145,6 +146,11 @@ namespace llvm { // itself. const MCSymbol &AliasedSymbol() const; + // If this symbol is not a variable, return itself. If it is a variable, + // evaluate it and check if it is of the form Base + ConstantOffset. If so, + // return Base, if not, return nullptr. + const MCSymbol *getBaseSymbol(const MCAsmLayout &Layout) const; + void setVariableValue(const MCExpr *Value); /// @} |