Skip to content

Commit

Permalink
Avoid using separate section for infrequently used functions on apple…
Browse files Browse the repository at this point in the history
… arm64 builds

This fixes a linker error where the __cstrings section puts the two code sections too far apart
  • Loading branch information
glguy committed Aug 20, 2024
1 parent d454c81 commit 01bcadb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lmdb/cbits/mdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,12 @@ typedef SSIZE_T ssize_t;
#ifdef __GNUC__
/** Put infrequently used env functions in separate section */
# ifdef __APPLE__
# define ESECT __attribute__ ((section("__TEXT,text_env")))
# if defined(__x86_64)
# define ESECT __attribute__ ((section("__TEXT,text_env")))
# else
/* This causes a linker error B/BL out of range on arm64 */
# define ESECT
# endif
# else
# define ESECT __attribute__ ((section("text_env")))
# endif
Expand Down

0 comments on commit 01bcadb

Please sign in to comment.