aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-08-19 23:42:47 +0000
committerAlan Modra <amodra@gmail.com>2001-08-19 23:42:47 +0000
commitba3ef70e78fc3fc766338ec9743c7fd595e922d8 (patch)
treeeb9a432b7099f2c65f7a55c32382343a29481659 /bfd
parentfe766f112c8557ba0cc8c33a236b9078cca07d90 (diff)
downloadgdb-ba3ef70e78fc3fc766338ec9743c7fd595e922d8.zip
gdb-ba3ef70e78fc3fc766338ec9743c7fd595e922d8.tar.gz
gdb-ba3ef70e78fc3fc766338ec9743c7fd595e922d8.tar.bz2
* archive.c (offsetof): Remove define.
* elf.c: Likewise. * oasys.c: Likewise * sysdep.h (offsetof): Define.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/archive.c6
-rw-r--r--bfd/elf.c6
-rw-r--r--bfd/oasys.c8
-rw-r--r--bfd/sysdep.h6
5 files changed, 13 insertions, 20 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f80b01b..752433e 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2001-08-20 Alan Modra <amodra@bigpond.net.au>
+
+ * archive.c (offsetof): Remove define.
+ * elf.c: Likewise.
+ * oasys.c: Likewise
+ * sysdep.h (offsetof): Define.
+
2001-08-17 Alan Modra <amodra@bigpond.net.au>
* bfd.c (bfd_get_gp_size): Return an unsigned int.
diff --git a/bfd/archive.c b/bfd/archive.c
index 5f673e1..daa135e 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -142,12 +142,6 @@ extern int errno;
#define BFD_GNU960_ARMAG(abfd) (BFD_COFF_FILE_P((abfd)) ? ARMAG : ARMAGB)
#endif
-/* Define offsetof for those systems which lack it */
-
-#ifndef offsetof
-#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
-#endif
-
/* We keep a cache of archive filepointers to archive elements to
speed up searching the archive by filepos. We only add an entry to
the cache when we actually read one. We also don't sort the cache;
diff --git a/bfd/elf.c b/bfd/elf.c
index 56b7926..8ff3ec8 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -5343,12 +5343,6 @@ _bfd_elf_rel_vtable_reloc_fn (abfd, re, symbol, data, is, obfd, errmsg)
# include <sys/procfs.h>
#endif
-/* Define offsetof for those systems which lack it. */
-
-#ifndef offsetof
-# define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
-#endif
-
/* FIXME: this is kinda wrong, but it's what gdb wants. */
static int
diff --git a/bfd/oasys.c b/bfd/oasys.c
index 47e30cb..0b2f88d 100644
--- a/bfd/oasys.c
+++ b/bfd/oasys.c
@@ -27,14 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "oasys.h"
#include "liboasys.h"
-/* XXX - FIXME. offsetof belongs in the system-specific files in
- ../include/sys. */
-/* Define offsetof for those systems which lack it */
-
-#ifndef offsetof
-#define offsetof(type, identifier) (size_t) &(((type *) 0)->identifier)
-#endif
-
static boolean oasys_read_record PARAMS ((bfd *,
oasys_record_union_type *));
static boolean oasys_write_sections PARAMS ((bfd *));
diff --git a/bfd/sysdep.h b/bfd/sysdep.h
index bab1c51..1338d6b 100644
--- a/bfd/sysdep.h
+++ b/bfd/sysdep.h
@@ -125,6 +125,12 @@ extern void free ();
extern char *getenv ();
#endif
+/* Define offsetof for those systems which lack it */
+
+#ifndef offsetof
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
#ifdef ENABLE_NLS
#include <libintl.h>
/* Note the use of dgetext() and PACKAGE here, rather than gettext().