3 # Check for binutils bug #16177 present in some versions of the bfd ld
4 # implementation affecting ARM relocations.
5 # https://sourceware.org/bugzilla/show_bug.cgi?id=16177
9 AC_DEFUN([CHECK_LD_COPY_BUG],[
12 AC_CHECK_TARGET_TOOL([READELF], [readelf])
13 AC_CHECK_TARGET_TOOL([AS], [as])
14 AC_MSG_CHECKING([for ld bug 16177])
25 .size object_reference, 4
31 .type data_object, %object
37 $AS -o aclib.o aclib.s
38 $LD -shared -o aclib.so aclib.o
40 $AS -o actest.o actest.s
41 $LD -o actest actest.o aclib.so
43 if $READELF -r actest | grep R_ARM_COPY > /dev/null; then
44 AC_MSG_RESULT([affected])
46 [Your linker is affected by binutils #16177, which
47 critically breaks linkage of GHC objects. Please either upgrade
48 binutils or supply a different linker with the LD environment
51 AC_MSG_RESULT([unaffected])
54 rm -f aclib.s aclib.o aclib.so actest.s actest.o actest