2018-12-14 07:49:32 +00:00
|
|
|
--- a/tc/Makefile
|
|
|
|
+++ b/tc/Makefile
|
2023-02-22 14:56:25 +00:00
|
|
|
@@ -113,7 +113,7 @@ LDLIBS += -L. -lm
|
2018-12-14 07:49:32 +00:00
|
|
|
|
|
|
|
ifeq ($(SHARED_LIBS),y)
|
|
|
|
LDLIBS += -ldl
|
|
|
|
-LDFLAGS += -Wl,-export-dynamic
|
|
|
|
+LDFLAGS += -Wl,--dynamic-list=dynsyms.list
|
|
|
|
endif
|
|
|
|
|
|
|
|
TCLIB := tc_core.o
|
2023-02-22 14:56:25 +00:00
|
|
|
@@ -143,7 +143,7 @@ MODDESTDIR := $(DESTDIR)$(LIBDIR)/tc
|
2018-12-14 07:49:32 +00:00
|
|
|
all: tc $(TCSO)
|
|
|
|
|
|
|
|
tc: $(TCOBJ) $(LIBNETLINK) libtc.a
|
|
|
|
- $(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
|
|
|
|
+ $(QUIET_LINK)$(CC) $(filter-out dynsyms.list, $^) $(LDFLAGS) $(LDLIBS) -o $@
|
|
|
|
|
|
|
|
libtc.a: $(TCLIB)
|
|
|
|
$(QUIET_AR)$(AR) rcs $@ $^
|
2023-02-22 14:56:25 +00:00
|
|
|
@@ -165,6 +165,7 @@ install: all
|
2018-12-14 07:49:32 +00:00
|
|
|
clean:
|
2020-02-12 12:23:01 +00:00
|
|
|
rm -f $(TCOBJ) $(TCLIB) libtc.a tc *.so emp_ematch.tab.h; \
|
|
|
|
rm -f emp_ematch.tab.*
|
2018-12-14 07:49:32 +00:00
|
|
|
+ rm -f dynsyms.list
|
|
|
|
|
|
|
|
q_atm.so: q_atm.c
|
|
|
|
$(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fpic -o q_atm.so q_atm.c -latm
|
2023-02-22 14:56:25 +00:00
|
|
|
@@ -204,4 +205,16 @@ static-syms.h: $(wildcard *.c)
|
2018-12-14 07:49:32 +00:00
|
|
|
sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \
|
|
|
|
done > $@
|
|
|
|
|
|
|
|
+else
|
|
|
|
+
|
|
|
|
+tc: dynsyms.list
|
2021-09-03 14:31:11 +00:00
|
|
|
+m_xt.so: dynsyms.list
|
2018-12-14 07:49:32 +00:00
|
|
|
+dynsyms.list: $(wildcard *.c)
|
|
|
|
+ files="$(filter-out $(patsubst %.so,%.c,$(TCSO)), $^)" ; \
|
|
|
|
+ echo "{" > $@ ; \
|
|
|
|
+ for s in `grep -B 3 '\<dlsym' $$files | sed -n '/snprintf/{s:.*"\([^"]*\)".*:\1:;s:%s::;p}'` ; do \
|
|
|
|
+ sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:\1;:;p}' $$files ; \
|
|
|
|
+ done >> $@ ; \
|
2020-06-30 05:04:54 +00:00
|
|
|
+ echo "show_stats; print_nl; print_tm; parse_rtattr; parse_rtattr_flags; get_u32; matches; addattr_l; addattr_nest; addattr_nest_end; };" >> $@
|
2018-12-14 07:49:32 +00:00
|
|
|
+
|
|
|
|
endif
|