Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Dec 2014 21:04:26 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r275378 - head/sys/arm/include
Message-ID:  <201412012104.sB1L4QYF057472@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Mon Dec  1 21:04:26 2014
New Revision: 275378
URL: https://svnweb.freebsd.org/changeset/base/275378

Log:
  Pull in the NetBSD global offset table handling code. Clang 3.5 creates
  relocations the linker complains about.
  
  Obtained from:	NetBSD
  MFC after:	1 Week

Modified:
  head/sys/arm/include/asm.h

Modified: head/sys/arm/include/asm.h
==============================================================================
--- head/sys/arm/include/asm.h	Mon Dec  1 20:51:01 2014	(r275377)
+++ head/sys/arm/include/asm.h	Mon Dec  1 21:04:26 2014	(r275378)
@@ -112,10 +112,16 @@
 	ldr	x, [x, got]
 #define	GOT_INIT(got,gotsym,pclabel) \
 	ldr	got, gotsym;	\
-	add	got, got, pc;	\
-	pclabel:
+	pclabel: add	got, got, pc
+#ifdef __thumb__
 #define	GOT_INITSYM(gotsym,pclabel) \
-	gotsym: .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) + (. - (pclabel+4))
+	.align 0;		\
+	gotsym: .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) - (pclabel+4)
+#else
+#define	GOT_INITSYM(gotsym,pclabel) \
+	.align 0;		\
+	gotsym: .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) - (pclabel+8)
+#endif
 
 #ifdef __STDC__
 #define	PIC_SYM(x,y)	x ## ( ## y ## )



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