public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Mitchell <mark@codesourcery.com>
To: hjl@lucon.org
Cc: ian@zembu.com, binutils@sourceware.cygnus.com
Subject: Re: A 32bit BFD patch
Date: Sun, 11 Jul 1999 09:30:00 -0000	[thread overview]
Message-ID: <19990711093401Q.mitchell@codesourcery.com> (raw)
In-Reply-To: <19990711072608.BB14157B9@ocean.lucon.org>

> If you can tell me where the problems lie, I bet I conditionalize the
> right sections.

Here's a patch, which I checked in, which should fix the issues
reported so far with the MIPS changes.  BTW, we could consider
compiling with `-W -Wall' by default, as in EGCS.  Don't know how much
noise this would generate at present.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

1999-07-11  Mark Mitchell  <mark@codesourcery.com>

	* libbfd.c (bfd_put_8): Make it of type `void'.
	* bfd-in2.h: Regenerated.
	* elf32-mips.c (MIPS_ELF_ADD_DYNAMIC_ENTRY): Conditionalize
	for 32-bit hosts.
	(_bfd_mips_elf_final_link): Likewise.

Index: libbfd.c
===================================================================
RCS file: /cvs/binutils/binutils/bfd/libbfd.c,v
retrieving revision 1.3
diff -u -p -r1.3 libbfd.c
--- libbfd.c	1999/07/07 17:50:51	1.3
+++ libbfd.c	1999/07/11 16:23:51
@@ -792,7 +792,7 @@ DESCRIPTION
 .{* Byte swapping macros for user section data.  *}
 .
 .#define bfd_put_8(abfd, val, ptr) \
-.                (*((unsigned char *)(ptr)) = (unsigned char)(val))
+.                ((void) (*((unsigned char *)(ptr)) = (unsigned char)(val)))
 .#define bfd_put_signed_8 \
 .		bfd_put_8
 .#define bfd_get_8(abfd, ptr) \
Index: bfd-in2.h
===================================================================
RCS file: /cvs/binutils/binutils/bfd/bfd-in2.h,v
retrieving revision 1.10
diff -u -p -r1.10 bfd-in2.h
--- bfd-in2.h	1999/07/07 17:50:52	1.10
+++ bfd-in2.h	1999/07/11 16:23:44
@@ -768,7 +768,7 @@ bfd_make_readable PARAMS ((bfd *abfd));
  /* Byte swapping macros for user section data.  */
 
 #define bfd_put_8(abfd, val, ptr) \
-                (*((unsigned char *)(ptr)) = (unsigned char)(val))
+                ((void) (*((unsigned char *)(ptr)) = (unsigned char)(val)))
 #define bfd_put_signed_8 \
                bfd_put_8
 #define bfd_get_8(abfd, ptr) \
Index: elf32-mips.c
===================================================================
RCS file: /cvs/binutils/binutils/bfd/elf32-mips.c,v
retrieving revision 1.14
diff -u -p -r1.14 elf32-mips.c
--- elf32-mips.c	1999/07/07 19:23:19	1.14
+++ elf32-mips.c	1999/07/11 16:23:50
@@ -269,10 +269,17 @@ typedef enum {
    : bfd_put_32 (abfd, val, ptr))
 
 /* Add a dynamic symbol table-entry.  */
+#ifdef BFD64
 #define MIPS_ELF_ADD_DYNAMIC_ENTRY(info, tag, val) \
   (ABI_64_P (elf_hash_table (info)->dynobj)	   \
    ? bfd_elf64_add_dynamic_entry (info, tag, val)  \
    : bfd_elf32_add_dynamic_entry (info, tag, val))
+#else
+#define MIPS_ELF_ADD_DYNAMIC_ENTRY(info, tag, val) \
+  (ABI_64_P (elf_hash_table (info)->dynobj)	   \
+   ? bfd_elf64_add_dynamic_entry (info, tag, val)  \
+   : (abort (), false))
+#endif
 
 /* The number of local .got entries we reserve.  */
 #define MIPS_RESERVED_GOTNO (2)
@@ -4891,10 +4898,18 @@ _bfd_mips_elf_final_link (abfd, info)
     }
 
   /* Invoke the regular ELF backend linker to do all the work.  */
-  if (!(ABI_64_P (abfd) 
-	? bfd_elf64_bfd_final_link (abfd, info)
-	: bfd_elf32_bfd_final_link (abfd, info)))
+  if (ABI_64_P (abfd))
+    {
+#ifdef BFD64
+      if (!bfd_elf64_bfd_final_link (abfd, info))
+	return false;
+#else
+      abort ();
       return false;
+#endif /* BFD64 */
+    }
+  else if (!bfd_elf32_bfd_final_link (abfd, info))
+    return false;
 
   /* Now write out the computed sections.  */
 

  reply	other threads:[~1999-07-11  9:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-10 10:47 H.J. Lu
1999-07-10 17:53 ` Ian Lance Taylor
1999-07-10 23:47   ` Mark Mitchell
1999-07-11  0:26     ` H.J. Lu
1999-07-11  9:30       ` Mark Mitchell [this message]
1999-07-11  9:37         ` H.J. Lu
1999-07-11  9:46           ` Mark Mitchell
1999-07-11 19:48         ` Ian Lance Taylor

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=19990711093401Q.mitchell@codesourcery.com \
    --to=mark@codesourcery.com \
    --cc=binutils@sourceware.cygnus.com \
    --cc=hjl@lucon.org \
    --cc=ian@zembu.com \
    /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).