https://llvm.org/bugs/show_bug.cgi?id=30848

            Bug ID: 30848
           Summary: Removal of AArch64II::MO_CONSTPOOL breaks booting the
                    FreeBSD kernel
           Product: libraries
           Version: 3.9
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: AArch64
          Assignee: unassignedb...@nondot.org
          Reporter: and...@fubar.geek.nz
                CC: dimi...@andric.com, ema...@freebsd.org,
                    llvm-bugs@lists.llvm.org, rafael.espind...@gmail.com
    Classification: Unclassified

In r271311 AArch64II::MO_CONSTPOOL was removed as it produces the same
instruction sequence as with accessing via the got. There is a difference
between the two however within the FreeBSD kernel. This is built as a dynamic
ELF binary, but doesn't have a run time linker.

FreeBSD makes extensive use of linker set, where it may iterate over all
objects within a named section. For this it has an weak extern pointer to the
__start and __stop variables the linker generates. Moving from llvm 3.8 to 3.9
there is a change in behaviour with weak extern pointers where they now always
pass through the got, however there is no dynamic linker to perform the needed
relocation so these become a NULL pointer dereference.

I can work around this by returning AArch64II::MO_NO_FLAG from
AArch64Subtarget::ClassifyGlobalReference, however I don't know if this is a
correct fix.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to