]> granicus.if.org Git - gc/commitdiff
Fix GC_caller_func_offset and GC_DBG_RA names
authorIvan Maidanski <ivmai@mail.ru>
Sun, 21 Jul 2013 14:27:07 +0000 (18:27 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 25 Aug 2013 18:36:47 +0000 (22:36 +0400)
(Apply commit 28e6e4f from 'release-7_2' branch.)

* dbg_mlc.c (GC_caller_func_offset): Test FREEBSD macro instead of
__FreeBSD__ (since the former is always defined in gcconfig.h included
from this file indirectly).
* dyn_load.c (ElfW): Likewise.
* dbg_mlc.c (GC_caller_func): Fix name to GC_caller_func_offset.
* dbg_mlc.c (GC_debug_realloc): Invoke GC_caller_func_offset if
GC_ADD_CALLER (same as in GC_debug_malloc and commit 2cdf7ec).
* include/private/gc_priv.h (RA): Fix name to GC_DBG_RA.
* include/private/gcconfig.h (X86_64): Test __x86_64__ in addition to
__amd64__ for FreeBSD (proposed in commit b54833a).

Conflicts:

    include/private/gcconfig.h

dbg_mlc.c
dyn_load.c
include/private/gc_priv.h
include/private/gcconfig.h

index bc47aa31eb1337ce58d6a5215f2eacc9a619af74..d7962642a8f3a772e7fea6d44e04870775e23e2b 100644 (file)
--- a/dbg_mlc.c
+++ b/dbg_mlc.c
@@ -485,7 +485,7 @@ GC_API void GC_CALL GC_debug_register_displacement(size_t offset)
   UNLOCK();
 }
 
-#if defined(__FreeBSD__)
+#ifdef FREEBSD
 #include <dlfcn.h>
 static void GC_caller_func_offset(ad, symp, offp)
 const GC_word ad;
@@ -499,7 +499,7 @@ int *offp;
     }
 }
 #else
-#define GC_caller_func(ad, symp, offp)
+#   define GC_caller_func_offset(ad, symp, offp) (void)0
 #endif
 
 GC_API void * GC_CALL GC_debug_malloc(size_t lb, GC_EXTRA_PARAMS)
index e26a6bbcf0c4ef49421f07c4f87ed246455cab4d..215967e955f1c99d30097693c6c801dfc0b7738f 100644 (file)
@@ -118,7 +118,7 @@ STATIC GC_has_static_roots_func GC_has_static_roots = 0;
 /* Newer versions of GNU/Linux define this macro.  We
  * define it similarly for any ELF systems that don't.  */
 #  ifndef ElfW
-#    if defined(FREEBSD) || defined(__FreeBSD__)
+#    if defined(FREEBSD)
 #      if __ELF_WORD_SIZE == 32
 #        define ElfW(type) Elf32_##type
 #      else
@@ -130,12 +130,6 @@ STATIC GC_has_static_roots_func GC_has_static_roots = 0;
 #      else
 #        define ElfW(type) Elf64_##type
 #      endif
-#    elif defined(__FreeBSD__)
-#      if __ELF_WORD_SIZE == 32
-#        define ElfW(type) Elf32_##type
-#      else
-#        define ElfW(type) Elf64_##type
-#      endif
 #    else
 #      if !defined(ELF_CLASS) || ELF_CLASS == ELFCLASS32
 #        define ElfW(type) Elf32_##type
index d207ab05d56e7549fb7d45cf679b65aaf9a7a9f1..fd80e71e22fccedf5b449e1bbb748669d37fd30c 100644 (file)
@@ -1807,11 +1807,10 @@ GC_INNER ptr_t GC_allocobj(size_t sz, int kind);
                                 /* head.  Sz is in granules.            */
 
 #ifdef GC_ADD_CALLER
-# define GC_DBG_RA GC_RETURN_ADDR,
 # ifdef GC_RETURN_ADDR_PARENT
-#  define RA GC_RETURN_ADDR_PARENT,
+#  define GC_DBG_RA GC_RETURN_ADDR_PARENT,
 # else
-#  define RA GC_RETURN_ADDR,
+#  define GC_DBG_RA GC_RETURN_ADDR,
 # endif
 #else
 # define GC_DBG_RA /* empty */
index fe90da3929805be7f67ee8e15a92e8d0af1abaac..ed72dbc650507cc87b1e24021514e34dfe848ae5 100644 (file)
 #   define I386
 #   define mach_type_known
 # endif
-# if defined(FREEBSD) && defined(__amd64__)
-#    define X86_64
-#    define mach_type_known
+# if defined(FREEBSD) && (defined(__amd64__) || defined(__x86_64__))
+#   define X86_64
+#   define mach_type_known
 # endif
 # if defined(FREEBSD) && defined(__ia64__)
-#    define IA64
-#    define mach_type_known
+#   define IA64
+#   define mach_type_known
 # endif
 # if defined(FREEBSD) && defined(__sparc__)
-#    define SPARC
-#    define mach_type_known
+#   define SPARC
+#   define mach_type_known
 # endif
 # if defined(FREEBSD) && (defined(powerpc) || defined(__powerpc__))
-#    define POWERPC
-#    define mach_type_known
+#   define POWERPC
+#   define mach_type_known
 # endif
 # if defined(FREEBSD) && defined(__arm__)
-#    define ARM32
-#    define mach_type_known
+#   define ARM32
+#   define mach_type_known
 # endif
 # if defined(bsdi) && (defined(i386) || defined(__i386__))
 #    define I386
 #     define OS_TYPE "MSWINCE"
 #     define DATAEND /* not needed */
 #   endif
-/* To the future maintainer of this diff: this is the "ifdef ARM32" section */
 #   ifdef FREEBSD
+    /* FreeBSD/arm */
 #   define ALIGNMENT 4
 #       define OS_TYPE "FREEBSD"
 #       ifdef __ELF__