From patchwork Mon Jul 25 08:22:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 13972 Received: (qmail 11868 invoked by alias); 25 Jul 2016 08:23:05 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 11849 invoked by uid 89); 25 Jul 2016 08:23:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=bread X-HELO: mail-pa0-f66.google.com Received: from mail-pa0-f66.google.com (HELO mail-pa0-f66.google.com) (209.85.220.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 25 Jul 2016 08:22:53 +0000 Received: by mail-pa0-f66.google.com with SMTP id cf3so11011234pad.2 for ; Mon, 25 Jul 2016 01:22:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=Oy41+mZBiHNuY7yJsd0wh6V51vAk6HE4GbVz5y4iGeQ=; b=Pz3CSfUZH8hLV1Sbkr5Rrlzff3DPZZ8ac0WBXODnYDEOj++DGDCzKtknt42vRaWFwZ u8/J2OhB61IRdRfPTTVQlbXCTZ8xL55l8VD4HRinEelgpvRQ4nhhNxKqGy0ZsD18fITb bbJIAt7aMUIMtvhjCwKG6bU4tiXwE0aTpBeWxF6qk0ceMpzm7F8t3JYU3LS9wJ8dPPeU 0VCZqWqdlElaVaNU9FX41I5rezbYkIlOYoNFeGc0l7ixsmXfr+lqxjb0CY7UXMmLjWcg XeJuupnRAXyle/9dIuYjdRbs0JQlJlx4a53OIr7n7ecS8GVq8EZdnUsAeZEo1i9G5ikM lyHA== X-Gm-Message-State: AEkoouvBfzkyu3K7y3K2XA4lFJaWsazj3KojKpwtcJpYmagVKh/tLT/5Bf1GtMtrJSWjWQ== X-Received: by 10.66.161.225 with SMTP id xv1mr27502227pab.20.1469434971231; Mon, 25 Jul 2016 01:22:51 -0700 (PDT) Received: from bubble.grove.modra.org (CPE-58-160-146-233.sa.bigpond.net.au. [58.160.146.233]) by smtp.gmail.com with ESMTPSA id c8sm20666623pfe.39.2016.07.25.01.22.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jul 2016 01:22:50 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 23E8DC1815; Mon, 25 Jul 2016 17:52:46 +0930 (ACST) Date: Mon, 25 Jul 2016 17:52:46 +0930 From: Alan Modra To: gdb-patches@sourceware.org Subject: Wean gdb and sim off private libbfd.h header Message-ID: <20160725082246.GC18978@bubble.grove.modra.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) bfd_default_set_arch_mach has moved to bfd.h, so there is now no need to include a header which is supposed to be private to BFD. Tested by cross-compiling from x86_64-linux, and in the rs6000-tdep.c case by native powerpc64le-linux gdb build and regression test. I also ran the sim testsuite, which doesn't do much for rl78 and rx.. OK to apply? gdb/ * amd64-darwin-tdep.c: Don't include libbfd.h. * i386-darwin-tdep.c: Likewise. * rs6000-nat.c: Likewise. * rs6000-tdep.c: Likewise. sim/aarch64/ * memory.c: Don't include libbfd.h. sim/rl78/ * load.c: Don't include libbfd.h. (rl78_load): Don't use private iovec seek or read. sim/rx/ * load.c: Don't include libbfd.h. (rx_load): Don't use private iovec seek or read. diff --git a/gdb/amd64-darwin-tdep.c b/gdb/amd64-darwin-tdep.c index d6ed84f..b99a30b 100644 --- a/gdb/amd64-darwin-tdep.c +++ b/gdb/amd64-darwin-tdep.c @@ -26,7 +26,6 @@ #include "floatformat.h" #include "symtab.h" #include "regcache.h" -#include "libbfd.h" #include "objfiles.h" #include "i387-tdep.h" diff --git a/gdb/i386-darwin-tdep.c b/gdb/i386-darwin-tdep.c index 6661fb1..e0090ef 100644 --- a/gdb/i386-darwin-tdep.c +++ b/gdb/i386-darwin-tdep.c @@ -26,7 +26,6 @@ #include "floatformat.h" #include "symtab.h" #include "regcache.h" -#include "libbfd.h" #include "objfiles.h" #include "i387-tdep.h" diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c index 1ae3cc3..f998460 100644 --- a/gdb/rs6000-nat.c +++ b/gdb/rs6000-nat.c @@ -23,7 +23,6 @@ #include "gdbcore.h" #include "symfile.h" #include "objfiles.h" -#include "libbfd.h" /* For bfd_default_set_arch_mach (FIXME) */ #include "bfd.h" #include "gdb-stabs.h" #include "regcache.h" diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 1ed1354..a616cbe 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -43,7 +43,6 @@ #include "record-full.h" #include "auxv.h" -#include "libbfd.h" /* for bfd_default_set_arch_mach */ #include "coff/internal.h" /* for libcoff.h */ #include "libcoff.h" /* for xcoff_data */ #include "coff/xcoff.h" diff --git a/sim/aarch64/memory.c b/sim/aarch64/memory.c index 50f4837..94c549f 100644 --- a/sim/aarch64/memory.c +++ b/sim/aarch64/memory.c @@ -26,7 +26,6 @@ #include #include "bfd.h" -#include "libbfd.h" #include "libiberty.h" #include "elf/internal.h" #include "elf/common.h" diff --git a/sim/rl78/load.c b/sim/rl78/load.c index 36dee73..d3e0379 100644 --- a/sim/rl78/load.c +++ b/sim/rl78/load.c @@ -29,7 +29,6 @@ #include "bfd.h" #include "elf-bfd.h" #include "elf/rl78.h" -#include "libbfd.h" #include "cpu.h" #include "mem.h" #include "load.h" @@ -140,13 +139,13 @@ rl78_load (bfd *prog, host_callback *callbacks, const char * const simname) buf = xmalloc (size); offset = p->p_offset; - if (prog->iovec->bseek (prog, offset, SEEK_SET) != 0) + if (bfd_seek (prog, offset, SEEK_SET) != 0) { fprintf (stderr, "%s, Failed to seek to offset %lx\n", simname, (long) offset); continue; } - if (prog->iovec->bread (prog, buf, size) != size) + if (bfd_bread (buf, size, prog) != size) { fprintf (stderr, "%s: Failed to read %lx bytes\n", simname, size); continue; diff --git a/sim/rx/load.c b/sim/rx/load.c index f88feb6..c4cbb43 100644 --- a/sim/rx/load.c +++ b/sim/rx/load.c @@ -25,7 +25,6 @@ along with this program. If not, see . */ #include #include "bfd.h" -#include "libbfd.h" #include "cpu.h" #include "mem.h" #include "load.h" @@ -146,12 +145,12 @@ rx_load (bfd *prog, host_callback *callback) } offset = p->p_offset; - if (prog->iovec->bseek (prog, offset, SEEK_SET) != 0) + if (bfd_seek (prog, offset, SEEK_SET) != 0) { fprintf (stderr, "Failed to seek to offset %lx\n", (long) offset); continue; } - if (prog->iovec->bread (prog, buf, size) != size) + if (bfd_bread (buf, size, prog) != size) { fprintf (stderr, "Failed to read %lx bytes\n", size); continue;