Skip to content

Commit

Permalink
Use getsectiondata instead of getsectbynamefromheader since OS X 10.7
Browse files Browse the repository at this point in the history
(fix of commit 0a6e4c3)

Issue #514 (bdwgc).

* dyn_load.c [DARWIN && !USE_GETSECTBYNAME]: Do not check
USE_GETSECTIONDATA; change MAC_OS_X_VERSION_MAX_ALLOWED<=120000 to
MAC_OS_X_VERSION_MIN_REQUIRED<1070; update comment.

Co-authored-by: Ivan Maidanski <[email protected]>
  • Loading branch information
catap and ivmai committed Dec 13, 2023
1 parent b9e90fa commit b934d41
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions dyn_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -1314,12 +1314,10 @@ STATIC const char *GC_dyld_name_for_hdr(const struct GC_MACH_HEADER *hdr)
}

/* getsectbynamefromheader is deprecated (first time in macOS 13.0), */
/* getsectiondata (introduced in macOS 10.7) is used instead to avoid */
/* a warning about the deprecated symbol, at least. */
/* Define USE_GETSECTBYNAME or USE_GETSECTIONDATA to control which */
/* symbol to use manually, if needed. */
#if !defined(USE_GETSECTBYNAME) && !defined(USE_GETSECTIONDATA) \
&& (MAC_OS_X_VERSION_MAX_ALLOWED <= 120000 /*MAC_OS_X_VERSION_12_0*/)
/* getsectiondata (introduced in macOS 10.7) is used instead if exists. */
/* Define USE_GETSECTBYNAME to use the deprecated symbol, if needed. */
#if !defined(USE_GETSECTBYNAME) \
&& (MAC_OS_X_VERSION_MIN_REQUIRED < 1070 /*MAC_OS_X_VERSION_10_7*/)
# define USE_GETSECTBYNAME
#endif

Expand Down

0 comments on commit b934d41

Please sign in to comment.