summaryrefslogtreecommitdiffstats
path: root/lib/csu
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2012-03-13 18:59:19 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2012-03-13 18:59:19 +0000
commit7be39623f5d2ffb96d5e6ab8f5113a03b9c4200f (patch)
tree1a3d1194dcbc3ba395c923671ef33aeb152f396c /lib/csu
parent98f4b9082084ebf31fe132ff1120d552ee5917f7 (diff)
downloadFreeBSD-src-7be39623f5d2ffb96d5e6ab8f5113a03b9c4200f.zip
FreeBSD-src-7be39623f5d2ffb96d5e6ab8f5113a03b9c4200f.tar.gz
Work around a binutils bug on powerpc64 where the TOC would not be
properly reloaded when calling _fini() in large binaries with multiple TOC sections (e.g. GCC), leading to a segmentation fault. Adding -mlongcall to crt1 flags causes the compiler to emit explicit TOC load instructions for all function calls, including _fini(). Reviewed by: kib Pointy hat to: kib
Diffstat (limited to 'lib/csu')
-rw-r--r--lib/csu/powerpc64/Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/csu/powerpc64/Makefile b/lib/csu/powerpc64/Makefile
index 1e1d1fa..a3e0cab 100644
--- a/lib/csu/powerpc64/Makefile
+++ b/lib/csu/powerpc64/Makefile
@@ -6,7 +6,8 @@ SRCS= crt1.c crti.S crtn.S
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
OBJS+= Scrt1.o gcrt1.o
CFLAGS+= -I${.CURDIR}/../common \
- -I${.CURDIR}/../../libc/include
+ -I${.CURDIR}/../../libc/include \
+ -mlongcall
all: ${OBJS}
OpenPOWER on IntegriCloud