diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-02-02 17:07:53 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-02-02 17:07:53 +0000 |
commit | 6d18171c1901a4db5d3e757a5ba4737fe8789dec (patch) | |
tree | 6adfbc90504e1005368a826374523b46773e1599 /lib/Target/Mips/MipsTargetObjectFile.cpp | |
parent | 4a6a1ccbecd7e34f40b05b4ba0a05d0031dd1eff (diff) |
Diffstat (limited to 'lib/Target/Mips/MipsTargetObjectFile.cpp')
-rw-r--r-- | lib/Target/Mips/MipsTargetObjectFile.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Target/Mips/MipsTargetObjectFile.cpp b/lib/Target/Mips/MipsTargetObjectFile.cpp index 9db6b7b1bcd6a..f767c83219883 100644 --- a/lib/Target/Mips/MipsTargetObjectFile.cpp +++ b/lib/Target/Mips/MipsTargetObjectFile.cpp @@ -136,6 +136,13 @@ IsGlobalInSmallSectionImpl(const GlobalObject *GO, return false; Type *Ty = GVA->getValueType(); + + // It is possible that the type of the global is unsized, i.e. a declaration + // of a extern struct. In this case don't presume it is in the small data + // section. This happens e.g. when building the FreeBSD kernel. + if (!Ty->isSized()) + return false; + return IsInSmallSection( GVA->getParent()->getDataLayout().getTypeAllocSize(Ty)); } |