This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2/6] Drop mtrace calls.


mtrace is a GNU extension not supported by uClibc and it's believed to
not be really used. Drop mtrace() calls and #include <mcheck.h>.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 src/ChangeLog   | 12 ++++++++++++
 src/addr2line.c |  4 ----
 src/ar.c        |  4 ----
 src/ld.c        |  6 ------
 src/nm.c        |  4 ----
 src/objdump.c   |  4 ----
 src/ranlib.c    |  4 ----
 src/size.c      |  4 ----
 src/strip.c     |  4 ----
 src/unstrip.c   |  4 ----
 10 files changed, 12 insertions(+), 38 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 0aa85ee..957eeb3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,15 @@
+2015-05-04  Max Filippov  <jcmvbkbc@gmail.com>
+
+	* addr2line.c (main): Drop mtrace() call and #include <mcheck.h>.
+	* ar.c: Likewise.
+	* ld.c: Likewise.
+	* nm.c: Likewise.
+	* objdump.c: Likewise.
+	* ranlib.c: Likewise.
+	* size.c: Likewise.
+	* strip.c: Likewise.
+	* unstrip.c: Likewise.
+
 2015-05-04  Anthony G. Basile  <blueness@gentoo.org>
 
 	* Makefile.am (readelf_LDADD, nm_LDADD, size_LDADD, strip_LDADD)
diff --git a/src/addr2line.c b/src/addr2line.c
index de80294..281a91e 100644
--- a/src/addr2line.c
+++ b/src/addr2line.c
@@ -30,7 +30,6 @@
 #include <dwarf.h>
 #include <libintl.h>
 #include <locale.h>
-#include <mcheck.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdio_ext.h>
@@ -131,9 +130,6 @@ main (int argc, char *argv[])
   int remaining;
   int result = 0;
 
-  /* Make memory leak detection possible.  */
-  mtrace ();
-
   /* We use no threads here which can interfere with handling a stream.  */
   (void) __fsetlocking (stdout, FSETLOCKING_BYCALLER);
 
diff --git a/src/ar.c b/src/ar.c
index f51f0ef..caed7f3 100644
--- a/src/ar.c
+++ b/src/ar.c
@@ -28,7 +28,6 @@
 #include <libintl.h>
 #include <limits.h>
 #include <locale.h>
-#include <mcheck.h>
 #include <search.h>
 #include <stdbool.h>
 #include <stdlib.h>
@@ -141,9 +140,6 @@ static enum { ipos_none, ipos_before, ipos_after } ipos;
 int
 main (int argc, char *argv[])
 {
-  /* Make memory leak detection possible.  */
-  mtrace ();
-
   /* We use no threads here which can interfere with handling a stream.  */
   (void) __fsetlocking (stdin, FSETLOCKING_BYCALLER);
   (void) __fsetlocking (stdout, FSETLOCKING_BYCALLER);
diff --git a/src/ld.c b/src/ld.c
index 73e4f04..6e96ae2 100644
--- a/src/ld.c
+++ b/src/ld.c
@@ -26,7 +26,6 @@
 #include <libelf.h>
 #include <libintl.h>
 #include <locale.h>
-#include <mcheck.h>
 #include <stdio.h>
 #include <stdio_ext.h>
 #include <stdlib.h>
@@ -277,11 +276,6 @@ main (int argc, char *argv[])
   int remaining;
   int err;
 
-#ifndef NDEBUG
-  /* Enable memory debugging.  */
-  mtrace ();
-#endif
-
   /* Sanity check.  We always want to use the LFS functionality.  */
   if (sizeof (off_t) != sizeof (off64_t))
     abort ();
diff --git a/src/nm.c b/src/nm.c
index 67fb4c2..b6a1e6e 100644
--- a/src/nm.c
+++ b/src/nm.c
@@ -33,7 +33,6 @@
 #include <libdw.h>
 #include <libintl.h>
 #include <locale.h>
-#include <mcheck.h>
 #include <obstack.h>
 #include <search.h>
 #include <stdbool.h>
@@ -217,9 +216,6 @@ main (int argc, char *argv[])
   int remaining;
   int result = 0;
 
-  /* Make memory leak detection possible.  */
-  mtrace ();
-
   /* We use no threads here which can interfere with handling a stream.  */
   (void) __fsetlocking (stdin, FSETLOCKING_BYCALLER);
   (void) __fsetlocking (stdout, FSETLOCKING_BYCALLER);
diff --git a/src/objdump.c b/src/objdump.c
index b689024..0aa41e8 100644
--- a/src/objdump.c
+++ b/src/objdump.c
@@ -26,7 +26,6 @@
 #include <inttypes.h>
 #include <libintl.h>
 #include <locale.h>
-#include <mcheck.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdio_ext.h>
@@ -131,9 +130,6 @@ static bool print_disasm;
 int
 main (int argc, char *argv[])
 {
-  /* Make memory leak detection possible.  */
-  mtrace ();
-
   /* We use no threads here which can interfere with handling a stream.  */
   (void) __fsetlocking (stdin, FSETLOCKING_BYCALLER);
   (void) __fsetlocking (stdout, FSETLOCKING_BYCALLER);
diff --git a/src/ranlib.c b/src/ranlib.c
index 8435fc1..c93c5ac 100644
--- a/src/ranlib.c
+++ b/src/ranlib.c
@@ -29,7 +29,6 @@
 #include <gelf.h>
 #include <libintl.h>
 #include <locale.h>
-#include <mcheck.h>
 #include <obstack.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -78,9 +77,6 @@ static const struct argp argp =
 int
 main (int argc, char *argv[])
 {
-  /* Make memory leak detection possible.  */
-  mtrace ();
-
   /* We use no threads here which can interfere with handling a stream.  */
   (void) __fsetlocking (stdin, FSETLOCKING_BYCALLER);
   (void) __fsetlocking (stdout, FSETLOCKING_BYCALLER);
diff --git a/src/size.c b/src/size.c
index 0ec1139..7c03cce 100644
--- a/src/size.c
+++ b/src/size.c
@@ -28,7 +28,6 @@
 #include <libelf.h>
 #include <libintl.h>
 #include <locale.h>
-#include <mcheck.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdio_ext.h>
@@ -160,9 +159,6 @@ main (int argc, char *argv[])
   int remaining;
   int result = 0;
 
-  /* Make memory leak detection possible.  */
-  mtrace ();
-
   /* We use no threads here which can interfere with handling a stream.  */
   __fsetlocking (stdin, FSETLOCKING_BYCALLER);
   __fsetlocking (stdout, FSETLOCKING_BYCALLER);
diff --git a/src/strip.c b/src/strip.c
index c003647..e81001e 100644
--- a/src/strip.c
+++ b/src/strip.c
@@ -30,7 +30,6 @@
 #include <libelf.h>
 #include <libintl.h>
 #include <locale.h>
-#include <mcheck.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdio_ext.h>
@@ -155,9 +154,6 @@ main (int argc, char *argv[])
   int remaining;
   int result = 0;
 
-  /* Make memory leak detection possible.  */
-  mtrace ();
-
   /* We use no threads here which can interfere with handling a stream.  */
   __fsetlocking (stdin, FSETLOCKING_BYCALLER);
   __fsetlocking (stdout, FSETLOCKING_BYCALLER);
diff --git a/src/unstrip.c b/src/unstrip.c
index 989ac5f..4a8e5fa 100644
--- a/src/unstrip.c
+++ b/src/unstrip.c
@@ -36,7 +36,6 @@
 #include <fnmatch.h>
 #include <libintl.h>
 #include <locale.h>
-#include <mcheck.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdio_ext.h>
@@ -2252,9 +2251,6 @@ handle_implicit_modules (const struct arg_info *info)
 int
 main (int argc, char **argv)
 {
-  /* Make memory leak detection possible.  */
-  mtrace ();
-
   /* We use no threads here which can interfere with handling a stream.  */
   __fsetlocking (stdin, FSETLOCKING_BYCALLER);
   __fsetlocking (stdout, FSETLOCKING_BYCALLER);
-- 
1.8.1.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]