Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 Jan 2016 22:02:42 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-arm@FreeBSD.org
Subject:   [Bug 205904] 11.0-CURRENT -r293129 arm -mcpu=cortex-a7: unresolvable R_ARM_MOVW_ABS_NC relocation against symbol `malloc@@FBSD_1.0'
Message-ID:  <bug-205904-7@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D205904

            Bug ID: 205904
           Summary: 11.0-CURRENT -r293129 arm -mcpu=3Dcortex-a7:
                    unresolvable R_ARM_MOVW_ABS_NC relocation against
                    symbol `malloc@@FBSD_1.0'
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: arm
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: arm
          Assignee: freebsd-arm@FreeBSD.org
          Reporter: markmi@dsl-only.net

I updated to (via a cross build from amd64 that was based on -march=3Darmv7=
-a
-mcpu=3Dcortex-a7):

# freebsd-version -ku; uname -aKU
11.0-CURRENT
11.0-CURRENT
FreeBSD rpi2 11.0-CURRENT FreeBSD 11.0-CURRENT #8 r293129M: Sun Jan  3 20:3=
7:26
PST 2016     root@FreeBSDx64:/usr/obj/clang/arm.armv6/usr/src/sys/RPI2-NODB=
G=20
arm 1100093 1100093

on an rpi2b in order to pick up and try out:

BEGIN -r292964 description
Author: ian
Date: Wed Dec 30 23:04:08 2015
New Revision: 292964
URL: https://svnweb.freebsd.org/changeset/base/292964

Log:
  Add the MOVT/MOVW types to the list of relocs which do not generate .plt
  entries.  This fixes the segfaults in arm userland code compiled with
  -march=3D or -mcpu=3D values that allow the compiler to generate movw/movt
  sequences to load 32-bit constants.

Modified:
  head/contrib/binutils/bfd/elf32-arm.c
END -r292964 description

instead of using /usr/local/arm-gnueabi-freebsd/bin/* binutils as I have be=
en
experimenting with.

I tried something simple and C-based on the rpi2:

portmaster -DK textproc/expat2

based on:

# more /etc/make.conf=20
DEFAULT_VERSIONS+=3Dperl5=3D5.22
WRKDIRPREFIX=3D/usr/obj/portswork
WITH_DEBUG=3D
WITH_DEBUG_FILES=3D
MALLOC_PRODUCTION=3D
TO_TYPE=3Darmv6
TOOLS_TO_TYPE=3Darm-gnueabi
VERSION_CONTEXT=3D11.0
.if ${.MAKE.LEVEL} =3D=3D 0
CC=3D/usr/bin/clang -v -target ${TO_TYPE}--freebsd${VERSION_CONTEXT}-gnueabi
-march=3Darmv7-a -mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp -mno-unaligned-acce=
ss
CXX=3D/usr/bin/clang++ -v -target ${TO_TYPE}--freebsd${VERSION_CONTEXT}-gnu=
eabi
-march=3Darmv7-a -mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp -mno-unaligned-acce=
ss
CPP=3D/usr/bin/clang-cpp -v -target ${TO_TYPE}--freebsd${VERSION_CONTEXT}-g=
nueabi
-march=3Darmv7-a -mcpu=3Dcortex-a7 -mfloat-abi=3Dsoftfp -mno-unaligned-acce=
ss
.export CC
.export CXX
.export CPP
.endif

(Note the -v's that show extra context during the command executions.)

The failing result involving movw was "unresolvable R_ARM_MOVW_ABS_NC
relocation against symbol `malloc@@FBSD_1.0'":

/bin/sh ./libtool --silent --mode=3Dlink /usr/bin/clang -v -target
armv6--freebsd11.0-gnueabi -march=3Darmv7-a -mcpu=3Dcortex-a7 -mfloat-abi=
=3Dsoftfp
-mno-unaligned-access -I./lib -I. -pipe -mfloat-abi=3Dsoftfp  -g
-fno-strict-aliasing -Wall -Wmissing-prototypes -Wstrict-prototypes
-fexceptions  -DHAVE_EXPAT_CONFIG_H -no-undefined -version-info 7:0:6 -rpath
/usr/local/lib  -o libexpat.la lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo
FreeBSD clang version 3.7.1 (tags/RELEASE_371/final 255217) 20151225
Target: armv6--freebsd11.0-gnueabi
Thread model: posix
 "/usr/bin/ld" --eh-frame-hdr -Bshareable --hash-style=3Dboth --enable-new-=
dtags
-o .libs/libexpat.so.1.6.0 /usr/lib/crti.o /usr/lib/crtbeginS.o -L/usr/lib
lib/.libs/xmlparse.o lib/.libs/xmltok.o lib/.libs/xmlrole.o -soname
libexpat.so.1 -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed
-lgcc_s --no-as-needed /usr/lib/crtendS.o /usr/lib/crtn.o
/usr/bin/ld: lib/.libs/xmlparse.o(.text+0x198): unresolvable R_ARM_MOVW_ABS=
_NC
relocation against symbol `malloc@@FBSD_1.0'
/usr/bin/ld: final link failed: Nonrepresentable section on output
clang: error: linker command failed with exit code 1 (use -v to see invocat=
ion)
*** Error code 1

Stop.
make[1]: stopped in
/usr/obj/portswork/usr/ports/textproc/expat2/work/expat-2.1.0
*** Error code 1



For reference: here is one of the prior C compiles (xmlparse.c -> xmlparse.=
o as
referenced in the failure):

/bin/sh ./libtool --silent --mode=3Dcompile /usr/bin/clang -v -target
armv6--freebsd11.0-gnueabi -march=3Darmv7-a -mcpu=3Dcortex-a7 -mfloat-abi=
=3Dsoftfp
-mno-unaligned-access -I./lib -I. -pipe -mfloat-abi=3Dsoftfp  -g
-fno-strict-aliasing -Wall -Wmissing-prototypes -Wstrict-prototypes
-fexceptions  -DHAVE_EXPAT_CONFIG_H -o lib/xmlparse.lo -c lib/xmlparse.c
FreeBSD clang version 3.7.1 (tags/RELEASE_371/final 255217) 20151225
Target: armv6--freebsd11.0-gnueabi
Thread model: posix
 "/usr/bin/clang" -cc1 -triple armv7--freebsd11.0-gnueabi -emit-obj -mrelax=
-all
-disable-free -main-file-name xmlparse.c -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -relaxed-aliasing -masm-verbose
-mconstructor-aliases -target-cpu cortex-a7 -target-feature +soft-float-abi
-target-abi aapcs-linux -mfloat-abi soft -backend-option -arm-strict-align =
-v
-gdwarf-2 -dwarf-column-info -coverage-file
/usr/obj/portswork/usr/ports/textproc/expat2/work/expat-2.1.0/xmlparse.c
-resource-dir /usr/bin/../lib/clang/3.7.1 -D HAVE_EXPAT_CONFIG_H -I ./lib -=
I .
-Wall -Wmissing-prototypes -Wstrict-prototypes -fdebug-compilation-dir
/usr/obj/portswork/usr/ports/textproc/expat2/work/expat-2.1.0 -ferror-limit=
 19
-fmessage-length 200 -mstackrealign -fno-signed-char -fobjc-runtime=3Dgnust=
ep
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o xmlparse.o -x=
 c
lib/xmlparse.c
clang -cc1 version 3.7.1 based upon LLVM 3.7.1 default target
armv6--freebsd11.0-gnueabi
#include "..." search starts here:
#include <...> search starts here:
 ./lib
 .
 /usr/bin/../lib/clang/3.7.1/include
 /usr/include
End of search list.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-205904-7>