summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib/MC/MCSymbolELF.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/lib/MC/MCSymbolELF.cpp')
-rw-r--r--contrib/llvm/lib/MC/MCSymbolELF.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/llvm/lib/MC/MCSymbolELF.cpp b/contrib/llvm/lib/MC/MCSymbolELF.cpp
index ec7ef44..67449eb 100644
--- a/contrib/llvm/lib/MC/MCSymbolELF.cpp
+++ b/contrib/llvm/lib/MC/MCSymbolELF.cpp
@@ -7,10 +7,10 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCSymbolELF.h"
+#include "llvm/BinaryFormat/ELF.h"
+#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCFixupKindInfo.h"
-#include "llvm/Support/ELF.h"
namespace llvm {
@@ -42,6 +42,8 @@ enum {
void MCSymbolELF::setBinding(unsigned Binding) const {
setIsBindingSet();
+ if (getType() == ELF::STT_SECTION && Binding != ELF::STB_LOCAL)
+ setType(ELF::STT_NOTYPE);
unsigned Val;
switch (Binding) {
default:
@@ -93,6 +95,8 @@ unsigned MCSymbolELF::getBinding() const {
void MCSymbolELF::setType(unsigned Type) const {
unsigned Val;
+ if (Type == ELF::STT_SECTION && getBinding() != ELF::STB_LOCAL)
+ return;
switch (Type) {
default:
llvm_unreachable("Unsupported Binding");
OpenPOWER on IntegriCloud