cxx: localize operator new(unsigned long) in supc++.o

Otherwise, base code in ld.lib.so may accidentally use 'new' without
passing an allocator.
This commit is contained in:
Christian Helmuth 2021-01-29 15:22:57 +01:00 committed by Norman Feske
parent a9c4ebc9e9
commit 91a7fb1da7

View File

@ -15,6 +15,11 @@ LIBC_SYMBOLS += malloc free calloc realloc \
memcmp strncmp strcmp sprintf \
__stderrp
#
# Symbols for supc++.o local use only
#
LOCAL_CXX_SYMBOLS += _Znam _Znwm
#
# Symbols we wrap (see unwind.cc)
#
@ -47,7 +52,7 @@ SRC_O = supc++.o
SRC_C = unwind.c
CXX_SRC = $(sort $(CXX_SRC_CC))
CXX_OBJECTS = $(addsuffix .o,$(basename $(CXX_SRC)))
LOCAL_SYMBOLS = $(patsubst %,--localize-symbol=%,$(LIBC_SYMBOLS))
LOCAL_SYMBOLS = $(patsubst %,--localize-symbol=%,$(LIBC_SYMBOLS) $(LOCAL_CXX_SYMBOLS))
REDEF_SYMBOLS = $(foreach S, $(EH_SYMBOLS), --redefine-sym $(S)=_cxx_$(S))
#