aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-05-29 15:49:10 -0600
committerTom Tromey <tom@tromey.com>2019-06-11 07:41:00 -0600
commit08f10e02be1bb218d6edcde87b9f59dd11b40a78 (patch)
tree543019f39f95edb714d800496003cee9d82c173d /gdb/gdbserver
parent1c7fe9515dc1e8aa6378075ef56a646c1efdf7f5 (diff)
downloadgdb-08f10e02be1bb218d6edcde87b9f59dd11b40a78.zip
gdb-08f10e02be1bb218d6edcde87b9f59dd11b40a78.tar.gz
gdb-08f10e02be1bb218d6edcde87b9f59dd11b40a78.tar.bz2
Move gdb's xmalloc and friends to new file
When "common" becomes a library, linking will cause a symbol clash, because "xmalloc" and some related symbols are defined in that library, libiberty, and readline. To work around this problem, this patch moves the clashing symbols to a new file, which is then compiled separately for both gdb and gdbserver. gdb/ChangeLog 2019-06-11 Tom Tromey <tom@tromey.com> * common/common-utils.c (xmalloc, xrealloc, xcalloc) (xmalloc_failed): Move to alloc.c. * alloc.c: New file. * Makefile.in (COMMON_SFILES): Add alloc.c. gdb/gdbserver/ChangeLog 2019-06-11 Tom Tromey <tom@tromey.com> * Makefile.in (SFILES): Add alloc.c. (OBS): Add alloc.o. (IPA_OBJS): Add alloc-ipa.o. (alloc-ipa.o): New target. (%.o: ../%.c): New pattern rule.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog8
-rw-r--r--gdb/gdbserver/Makefile.in11
2 files changed, 19 insertions, 0 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 7a78956..460daab 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,11 @@
+2019-06-11 Tom Tromey <tom@tromey.com>
+
+ * Makefile.in (SFILES): Add alloc.c.
+ (OBS): Add alloc.o.
+ (IPA_OBJS): Add alloc-ipa.o.
+ (alloc-ipa.o): New target.
+ (%.o: ../%.c): New pattern rule.
+
2019-06-10 Tom Tromey <tromey@adacore.com>
* remote-utils.c (look_up_one_symbol, relocate_instruction): Don't
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 7186550..792325b 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -197,6 +197,7 @@ SFILES = \
$(srcdir)/arch/arm-get-next-pcs.c \
$(srcdir)/arch/arm-linux.c \
$(srcdir)/arch/ppc-linux-common.c \
+ $(srcdir)/../alloc.c \
$(srcdir)/common/btrace-common.c \
$(srcdir)/common/buffer.c \
$(srcdir)/common/cleanups.c \
@@ -238,6 +239,7 @@ SOURCES = $(SFILES)
TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
OBS = \
+ alloc.o \
ax.o \
common/agent.o \
common/btrace-common.o \
@@ -414,6 +416,7 @@ gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY)
$(LIBIBERTY)
IPA_OBJS = \
+ alloc-ipa.o \
ax-ipa.o \
common/common-utils-ipa.o \
common/errors-ipa.o \
@@ -569,6 +572,10 @@ ax.o: ax.c
$(COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
$(POSTCOMPILE)
+alloc-ipa.o: ../alloc.c
+ $(IPAGENT_COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
+ $(POSTCOMPILE)
+
# Rules for objects that go in the in-process agent.
arch/%-ipa.o: ../arch/%.c
@@ -624,6 +631,10 @@ common/%.o: ../common/%.c
$(COMPILE) $<
$(POSTCOMPILE)
+%.o: ../%.c
+ $(COMPILE) $<
+ $(POSTCOMPILE)
+
# Rules for register format descriptions. Suffix destination files with
# -generated to identify and clean them easily.