[PATCH] Segfault in AArch64 backend with -g and -mbig-endian

Eric Christopher echristo at gmail.com
Wed Sep 17 17:12:36 PDT 2014


I'm not sure we should paper over this possible problem.

I haven't had a chance to look into the comment here:

"A fixup having a location that:

was not defined in this unit doesn't make much sense
is the result of removed temporary value, should have been removed when the values got out of context"

and Oliver hasn't replied yet either. I do think it's relevant to this patch.

================
Comment at: lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp:538
@@ -537,3 +537,3 @@
     const MCSection *Sec = Fixup.getValue()->FindAssociatedSection();
-    const MCSectionELF *SecELF = static_cast<const MCSectionELF *>(Sec);
-    if (SecELF->getSectionName() == ".eh_frame")
+    const MCSectionELF *SecELF = dyn_cast_or_null<const MCSectionELF>(Sec);
+    if (SecELF && SecELF->getSectionName() == ".eh_frame")
----------------
olista01 wrote:
> echristo wrote:
> > Fixup to a null section? How's that happen?
> This is the section associated with the value to put into the fixup location, not the section containing the fixup location. This can be null if:
>  * It is a symbol which is not defined by this translation unit
>  * It is the difference between two temporary symbols, for example to find the length of a debug data structure.
Ah right. Thanks.

http://reviews.llvm.org/D4870






More information about the llvm-commits mailing list