public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: elfutils-devel@lists.fedorahosted.org
Subject: [PATCH 2/6] Drop mtrace calls.
Date: Mon, 04 May 2015 02:25:40 +0300	[thread overview]
Message-ID: <1430695544-7336-3-git-send-email-jcmvbkbc@gmail.com> (raw)
In-Reply-To: 1430695544-7336-1-git-send-email-jcmvbkbc@gmail.com

[-- Attachment #1: Type: text/plain, Size: 6742 bytes --]

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


             reply	other threads:[~2015-05-03 23:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-03 23:25 Max Filippov [this message]
2015-05-04 14:06 Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1430695544-7336-3-git-send-email-jcmvbkbc@gmail.com \
    --to=jcmvbkbc@gmail.com \
    --cc=elfutils-devel@lists.fedorahosted.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).