summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-02-22 06:13:35 +0000
committermidipix <writeonce@midipix.org>2024-02-22 06:17:19 +0000
commit279932401cb1e799f2e8bdae7eae47b788c3001d (patch)
tree19b4beceec3e7a96f1235dd06a3772f5f84d74e3
parentb7eee903624f0208c70bc1ea928dce965db8deba (diff)
downloadslibtool-279932401cb1e799f2e8bdae7eae47b788c3001d.tar.bz2
slibtool-279932401cb1e799f2e8bdae7eae47b788c3001d.tar.xz
internals: slbt_is_strong_coff_symbol(): from _static_ to a _hidden_ function.
-rw-r--r--project/common.mk1
-rw-r--r--project/headers.mk1
-rw-r--r--src/arbits/output/slbt_au_output_symbols.c8
-rw-r--r--src/arbits/slbt_archive_mapfile.c8
-rw-r--r--src/internal/slibtool_pecoff_impl.c16
-rw-r--r--src/internal/slibtool_pecoff_impl.h6
-rw-r--r--src/util/slbt_create_mapfile.c8
7 files changed, 27 insertions, 21 deletions
diff --git a/project/common.mk b/project/common.mk
index b54df21..e588ce7 100644
--- a/project/common.mk
+++ b/project/common.mk
@@ -65,6 +65,7 @@ INTERNAL_SRCS = \
src/internal/$(PACKAGE)_mapfile_impl.c \
src/internal/$(PACKAGE)_objlist_impl.c \
src/internal/$(PACKAGE)_objmeta_impl.c \
+ src/internal/$(PACKAGE)_pecoff_impl.c \
src/internal/$(PACKAGE)_realpath_impl.c \
src/internal/$(PACKAGE)_snprintf_impl.c \
src/internal/$(PACKAGE)_symlink_impl.c \
diff --git a/project/headers.mk b/project/headers.mk
index 75a59b8..aad65cc 100644
--- a/project/headers.mk
+++ b/project/headers.mk
@@ -17,6 +17,7 @@ INTERNAL_HEADERS = \
$(PROJECT_DIR)/src/internal/$(PACKAGE)_metafile_impl.h \
$(PROJECT_DIR)/src/internal/$(PACKAGE)_mkdir_impl.h \
$(PROJECT_DIR)/src/internal/$(PACKAGE)_objlist_impl.h \
+ $(PROJECT_DIR)/src/internal/$(PACKAGE)_pecoff_impl.h \
$(PROJECT_DIR)/src/internal/$(PACKAGE)_readlink_impl.h \
$(PROJECT_DIR)/src/internal/$(PACKAGE)_realpath_impl.h \
$(PROJECT_DIR)/src/internal/$(PACKAGE)_snprintf_impl.h \
diff --git a/src/arbits/output/slbt_au_output_symbols.c b/src/arbits/output/slbt_au_output_symbols.c
index 178fcdb..dca3fb9 100644
--- a/src/arbits/output/slbt_au_output_symbols.c
+++ b/src/arbits/output/slbt_au_output_symbols.c
@@ -13,19 +13,13 @@
#include "slibtool_driver_impl.h"
#include "slibtool_dprintf_impl.h"
#include "slibtool_errinfo_impl.h"
+#include "slibtool_pecoff_impl.h"
#include "slibtool_ar_impl.h"
#define SLBT_PRETTY_FLAGS (SLBT_PRETTY_YAML \
| SLBT_PRETTY_POSIX \
| SLBT_PRETTY_HEXDATA)
-static int slbt_is_strong_coff_symbol(const char * sym)
-{
- return strncmp(sym,"__imp_",6)
- && strncmp(sym,".weak.",6)
- && strncmp(sym,".refptr.",8);
-}
-
static int slbt_au_output_symbols_posix(
const struct slbt_driver_ctx * dctx,
struct slbt_archive_meta_impl * mctx,
diff --git a/src/arbits/slbt_archive_mapfile.c b/src/arbits/slbt_archive_mapfile.c
index a684a52..379e278 100644
--- a/src/arbits/slbt_archive_mapfile.c
+++ b/src/arbits/slbt_archive_mapfile.c
@@ -13,6 +13,7 @@
#include "slibtool_driver_impl.h"
#include "slibtool_dprintf_impl.h"
#include "slibtool_errinfo_impl.h"
+#include "slibtool_pecoff_impl.h"
#include "slibtool_ar_impl.h"
/********************************************************/
@@ -24,13 +25,6 @@
/* an underscore (where relevant) is not necessary. */
/********************************************************/
-static int slbt_is_strong_coff_symbol(const char * sym)
-{
- return strncmp(sym,"__imp_",6)
- && strncmp(sym,".weak.",6)
- && strncmp(sym,".refptr.",8);
-}
-
static int slbt_ar_output_mapfile_impl(
const struct slbt_driver_ctx * dctx,
struct slbt_archive_meta_impl * mctx,
diff --git a/src/internal/slibtool_pecoff_impl.c b/src/internal/slibtool_pecoff_impl.c
new file mode 100644
index 0000000..3ce2d0e
--- /dev/null
+++ b/src/internal/slibtool_pecoff_impl.c
@@ -0,0 +1,16 @@
+/*******************************************************************/
+/* slibtool: a skinny libtool implementation, written in C */
+/* Copyright (C) 2016--2024 SysDeer Technologies, LLC */
+/* Released under the Standard MIT License; see COPYING.SLIBTOOL. */
+/*******************************************************************/
+
+#include <string.h>
+
+#include "slibtool_visibility_impl.h"
+
+slbt_hidden int slbt_is_strong_coff_symbol(const char * sym)
+{
+ return strncmp(sym,"__imp_",6)
+ && strncmp(sym,".weak.",6)
+ && strncmp(sym,".refptr.",8);
+}
diff --git a/src/internal/slibtool_pecoff_impl.h b/src/internal/slibtool_pecoff_impl.h
new file mode 100644
index 0000000..e18b5af
--- /dev/null
+++ b/src/internal/slibtool_pecoff_impl.h
@@ -0,0 +1,6 @@
+#ifndef SLIBTOOL_PECOFF_IMPL_H
+#define SLIBTOOL_PECOFF_IMPL_H
+
+int slbt_is_strong_coff_symbol(const char *);
+
+#endif
diff --git a/src/util/slbt_create_mapfile.c b/src/util/slbt_create_mapfile.c
index e8a5c90..a7d7c0a 100644
--- a/src/util/slbt_create_mapfile.c
+++ b/src/util/slbt_create_mapfile.c
@@ -13,6 +13,7 @@
#include "slibtool_driver_impl.h"
#include "slibtool_dprintf_impl.h"
#include "slibtool_errinfo_impl.h"
+#include "slibtool_pecoff_impl.h"
#include "slibtool_ar_impl.h"
/****************************************************/
@@ -24,13 +25,6 @@
/* necessary. */
/****************************************************/
-static int slbt_is_strong_coff_symbol(const char * sym)
-{
- return strncmp(sym,"__imp_",6)
- && strncmp(sym,".weak.",6)
- && strncmp(sym,".refptr.",8);
-}
-
static int slbt_util_output_mapfile_impl(
const struct slbt_driver_ctx * dctx,
const struct slbt_symlist_ctx * sctx,