* Wean gdb and sim off private libbfd.h header
@ 2016-07-25 8:23 Alan Modra
2016-07-26 14:39 ` Pedro Alves
2016-08-01 14:23 ` Mike Frysinger
0 siblings, 2 replies; 3+ messages in thread
From: Alan Modra @ 2016-07-25 8:23 UTC (permalink / raw)
To: gdb-patches
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 <string.h>
#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 <http://www.gnu.org/licenses/>. */
#include <string.h>
#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;
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Wean gdb and sim off private libbfd.h header
2016-07-25 8:23 Wean gdb and sim off private libbfd.h header Alan Modra
@ 2016-07-26 14:39 ` Pedro Alves
2016-08-01 14:23 ` Mike Frysinger
1 sibling, 0 replies; 3+ messages in thread
From: Pedro Alves @ 2016-07-26 14:39 UTC (permalink / raw)
To: Alan Modra, gdb-patches
On 07/25/2016 09:22 AM, Alan Modra wrote:
> 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?
OK for the gdb parts.
sim bits look obvious to me too, fwiw.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Wean gdb and sim off private libbfd.h header
2016-07-25 8:23 Wean gdb and sim off private libbfd.h header Alan Modra
2016-07-26 14:39 ` Pedro Alves
@ 2016-08-01 14:23 ` Mike Frysinger
1 sibling, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2016-08-01 14:23 UTC (permalink / raw)
To: Alan Modra; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 434 bytes --]
On 25 Jul 2016 17:52, Alan Modra wrote:
> 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?
sim looks great, thanks !
-mike
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-08-01 14:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-25 8:23 Wean gdb and sim off private libbfd.h header Alan Modra
2016-07-26 14:39 ` Pedro Alves
2016-08-01 14:23 ` Mike Frysinger
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).