* A 32bit BFD patch
@ 1999-07-10 10:47 H.J. Lu
1999-07-10 17:53 ` Ian Lance Taylor
0 siblings, 1 reply; 8+ messages in thread
From: H.J. Lu @ 1999-07-10 10:47 UTC (permalink / raw)
To: mark; +Cc: Ian Lance Taylor, binutils
Since the latest ELF/MIPS change, elf32/mips is now 64bit. As the
result,
# ...../configure --enable-targets=all
no longer works on 32bit hosts. Here is a patch to move elf32/mips
to 64bit.
Thanks.
--
H.J. Lu (hjl@gnu.org)
--
Sat Jul 10 09:38:38 1998 H.J. Lu (hjl@gnu.org)
* Makefile.am (BFD32_BACKENDS): Remove elf32-mips.lo.
(BFD32_BACKENDS_CFILES): Remove elf32-mips.c.
(BFD64_BACKENDS): Add elf32-mips.lo.
(BFD64_BACKENDS_CFILES): Add elf32-mips.c.
* Makefile.in: Regnerated.
* targets.c (bfd_target_vector): Move bfd_elf32_bigmips_vec
and bfd_elf32_littlemips_vec to 64bit.
* config.bfd: Move elf32/mips to 64bit.
Index: Makefile.am
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/Makefile.am,v
retrieving revision 1.1.1.5
retrieving revision 1.4
diff -u -p -r1.1.1.5 -r1.4
--- Makefile.am 1999/06/11 13:41:37 1.1.1.5
+++ Makefile.am 1999/07/10 16:39:21 1.4
@@ -47,6 +47,7 @@ ALL_MACHINES = \
cpu-h8300.lo \
cpu-h8500.lo \
cpu-hppa.lo \
+ cpu-i370.lo \
cpu-i386.lo \
cpu-i860.lo \
cpu-i960.lo \
@@ -81,6 +82,7 @@ ALL_MACHINES_CFILES = \
cpu-h8300.c \
cpu-h8500.c \
cpu-hppa.c \
+ cpu-i370.c \
cpu-i386.c \
cpu-i860.c \
cpu-i960.c \
@@ -157,6 +159,7 @@ BFD32_BACKENDS = \
elf32-fr30.lo \
elf32-gen.lo \
elf32-hppa.lo \
+ elf32-i370.lo \
elf32-i386.lo \
elf32-i860.lo \
elf32-i960.lo \
@@ -166,7 +169,6 @@ BFD32_BACKENDS = \
elf-m10200.lo \
elf-m10300.lo \
elf32-mcore.lo \
- elf32-mips.lo \
elf32-ppc.lo \
elf32-sh.lo \
elf32-sparc.lo \
@@ -279,6 +281,7 @@ BFD32_BACKENDS_CFILES = \
elf32-fr30.c \
elf32-gen.c \
elf32-hppa.c \
+ elf32-i370.c \
elf32-i386.c \
elf32-i860.c \
elf32-i960.c \
@@ -288,7 +291,6 @@ BFD32_BACKENDS_CFILES = \
elf-m10200.c \
elf-m10300.c \
elf32-mcore.c \
- elf32-mips.c \
elf32-ppc.c \
elf32-sh.c \
elf32-sparc.c \
@@ -362,6 +364,7 @@ BFD64_BACKENDS = \
elf64-mips.lo \
elf64-sparc.lo \
elf64.lo \
+ elf32-mips.lo \
nlm32-alpha.lo \
nlm64.lo
@@ -374,6 +377,7 @@ BFD64_BACKENDS_CFILES = \
elf64-mips.c \
elf64-sparc.c \
elf64.c \
+ elf32-mips.c \
nlm32-alpha.c \
nlm64.c
Index: targets.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/targets.c,v
retrieving revision 1.1.1.3
retrieving revision 1.3
diff -u -p -r1.1.1.3 -r1.3
--- targets.c 1999/06/11 13:41:48 1.1.1.3
+++ targets.c 1999/07/10 16:44:30 1.3
@@ -672,13 +672,13 @@ const bfd_target * const bfd_target_vect
&bfd_elf32_bigarc_vec,
&bfd_elf32_bigarm_vec,
&bfd_elf32_bigarm_oabi_vec,
- &bfd_elf32_bigmips_vec,
#ifdef BFD64
+ &bfd_elf32_bigmips_vec,
&bfd_elf64_bigmips_vec,
#endif
&bfd_elf32_d10v_vec,
&bfd_elf32_d30v_vec,
&bfd_elf32_hppa_vec,
&bfd_elf32_i386_vec,
&bfd_elf32_i860_vec,
&bfd_elf32_i960_vec,
@@ -686,8 +688,8 @@ const bfd_target * const bfd_target_vect
&bfd_elf32_littlearc_vec,
&bfd_elf32_littlearm_vec,
&bfd_elf32_littlearm_oabi_vec,
- &bfd_elf32_littlemips_vec,
#ifdef BFD64
+ &bfd_elf32_littlemips_vec,
&bfd_elf64_littlemips_vec,
#endif
&bfd_elf32_m32r_vec,
Index: config.bfd
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/config.bfd,v
retrieving revision 1.1.1.5
diff -u -p -r1.1.1.5 config.bfd
--- config.bfd 1999/07/09 15:20:45 1.1.1.5
+++ config.bfd 1999/07/10 16:59:31
@@ -77,6 +78,47 @@ case "${targ}" in
alpha*-*-*)
targ_defvec=ecoffalpha_little_vec
;;
+
+ mips-dec-netbsd* | mips*el*-*-netbsd*)
+ targ_defvec=bfd_elf32_littlemips_vec
+ targ_selvecs="bfd_elf32_bigmips_vec ecoff_little_vec ecoff_big_vec"
+ ;;
+ mips*-*-netbsd*)
+ targ_defvec=bfd_elf32_bigmips_vec
+ targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec"
+ ;;
+ mips*-*-irix6*)
+ targ_defvec=bfd_elf32_bigmips_vec
+ targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+ ;;
+ mips*-*-irix5*)
+ targ_defvec=bfd_elf32_bigmips_vec
+ targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec"
+ ;;
+ mips*-*-sysv4*)
+ targ_defvec=bfd_elf32_bigmips_vec
+ targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec"
+ ;;
+ mips*el-*-elf* | mips*el-*-rtems* | mips*el-*-vxworks*)
+ targ_defvec=bfd_elf32_littlemips_vec
+ targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+ ;;
+ mips*-*-elf* | mips*-*-rtems* | mips*-*-vxworks*)
+ targ_defvec=bfd_elf32_bigmips_vec
+ targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+ ;;
+ mips*-*-none)
+ targ_defvec=bfd_elf32_bigmips_vec
+ targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+ ;;
+ mips*el*-*-linux-gnu* | mips*el*-*-openbsd*)
+ targ_defvec=bfd_elf32_littlemips_vec
+ targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec"
+ ;;
+ mips*-*-linux-gnu* | mips*-*-openbsd*)
+ targ_defvec=bfd_elf32_bigmips_vec
+ targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec"
+ ;;
#endif /* BFD64 */
arc-*-elf*)
@@ -460,14 +510,6 @@ case "${targ}" in
targ_defvec=ecoff_big_vec
targ_selvecs=ecoff_little_vec
;;
- mips-dec-netbsd* | mips*el*-*-netbsd*)
- targ_defvec=bfd_elf32_littlemips_vec
- targ_selvecs="bfd_elf32_bigmips_vec ecoff_little_vec ecoff_big_vec"
- ;;
- mips*-*-netbsd*)
- targ_defvec=bfd_elf32_bigmips_vec
- targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec"
- ;;
mips*-dec-bsd*)
targ_defvec=aout_mips_little_vec
targ_underscore=yes
@@ -484,14 +526,6 @@ case "${targ}" in
targ_defvec=ecoff_big_vec
targ_selvecs=ecoff_little_vec
;;
- mips*-*-irix6*)
- targ_defvec=bfd_elf32_bigmips_vec
- targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
- ;;
- mips*-*-irix5*)
- targ_defvec=bfd_elf32_bigmips_vec
- targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec"
- ;;
mips*-sgi-* | mips*-*-bsd*)
targ_defvec=ecoff_big_vec
targ_selvecs=ecoff_little_vec
@@ -504,33 +538,9 @@ case "${targ}" in
targ_defvec=aout_mips_little_vec
targ_cflags=-DSTAT_FOR_EXEC
;;
- mips*-*-sysv4*)
- targ_defvec=bfd_elf32_bigmips_vec
- targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec"
- ;;
mips*-*-sysv* | mips*-*-riscos*)
targ_defvec=ecoff_big_vec
targ_selvecs=ecoff_little_vec
- ;;
- mips*el-*-elf* | mips*el-*-rtems* | mips*el-*-vxworks*)
- targ_defvec=bfd_elf32_littlemips_vec
- targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
- ;;
- mips*-*-elf* | mips*-*-rtems* | mips*-*-vxworks*)
- targ_defvec=bfd_elf32_bigmips_vec
- targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
- ;;
- mips*-*-none)
- targ_defvec=bfd_elf32_bigmips_vec
- targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
- ;;
- mips*el*-*-linux-gnu* | mips*el*-*-openbsd*)
- targ_defvec=bfd_elf32_littlemips_vec
- targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec"
- ;;
- mips*-*-linux-gnu* | mips*-*-openbsd*)
- targ_defvec=bfd_elf32_bigmips_vec
- targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec"
;;
mn10200-*-*)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: A 32bit BFD patch
1999-07-10 10:47 A 32bit BFD patch H.J. Lu
@ 1999-07-10 17:53 ` Ian Lance Taylor
1999-07-10 23:47 ` Mark Mitchell
0 siblings, 1 reply; 8+ messages in thread
From: Ian Lance Taylor @ 1999-07-10 17:53 UTC (permalink / raw)
To: hjl; +Cc: mark, binutils
Date: Sat, 10 Jul 1999 10:47:26 -0700 (PDT)
From: hjl@varesearch.com (H.J. Lu)
Since the latest ELF/MIPS change, elf32/mips is now 64bit. As the
result,
# ...../configure --enable-targets=all
no longer works on 32bit hosts. Here is a patch to move elf32/mips
to 64bit.
Mark, would it be feasible to instead modify your code so that 32bit
MIPS ELF support does not require a 64 bit bfd_vma? On many machines,
using a 64 bit bfd_vma is a significant cost in efficiency, and I
would prefer to not force people to pay it unnecessarily.
Ian
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: A 32bit BFD patch
1999-07-10 17:53 ` Ian Lance Taylor
@ 1999-07-10 23:47 ` Mark Mitchell
1999-07-11 0:26 ` H.J. Lu
0 siblings, 1 reply; 8+ messages in thread
From: Mark Mitchell @ 1999-07-10 23:47 UTC (permalink / raw)
To: ian; +Cc: hjl, binutils
H.J., what exactly are the places that fail on a 32-bit host? I made
an effort to conditionalize the places that required 64-bit support
with `#ifdef BFD_64' (or BFD64, I forget which one is the right
spelling).
If you can tell me where the problems lie, I bet I conditionalize the
right sections.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: A 32bit BFD patch
1999-07-10 23:47 ` Mark Mitchell
@ 1999-07-11 0:26 ` H.J. Lu
1999-07-11 9:30 ` Mark Mitchell
0 siblings, 1 reply; 8+ messages in thread
From: H.J. Lu @ 1999-07-11 0:26 UTC (permalink / raw)
To: Mark Mitchell; +Cc: Ian Lance Taylor, binutils
>
>
> H.J., what exactly are the places that fail on a 32-bit host? I made
> an effort to conditionalize the places that required 64-bit support
> with `#ifdef BFD_64' (or BFD64, I forget which one is the right
> spelling).
>
> If you can tell me where the problems lie, I bet I conditionalize the
> right sections.
>
# cd bfd
# elf64 elf32-mips.c
? bfd_elf64_add_dynamic_entry (info, tag, val) \
bfd_mips_elf64_swap_reginfo_in (abfd, ex, in)
bfd_mips_elf64_swap_reginfo_out (abfd, in, ex)
bfd_mips_elf64_swap_reginfo_in
? bfd_elf64_bfd_final_link (abfd, info)
bfd_elf64_add_dynamic_entry and bfd_elf64_bfd_final_link are only
available for 64bit bfd.
You can verify it by doing
# ..../configure --enable-targets=all --enable-shared
on Linux/x86.
--
H.J. Lu (hjl@gnu.org)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: A 32bit BFD patch
1999-07-11 0:26 ` H.J. Lu
@ 1999-07-11 9:30 ` Mark Mitchell
1999-07-11 9:37 ` H.J. Lu
1999-07-11 19:48 ` Ian Lance Taylor
0 siblings, 2 replies; 8+ messages in thread
From: Mark Mitchell @ 1999-07-11 9:30 UTC (permalink / raw)
To: hjl; +Cc: ian, binutils
> 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. */
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: A 32bit BFD patch
1999-07-11 9:30 ` Mark Mitchell
@ 1999-07-11 9:37 ` H.J. Lu
1999-07-11 9:46 ` Mark Mitchell
1999-07-11 19:48 ` Ian Lance Taylor
1 sibling, 1 reply; 8+ messages in thread
From: H.J. Lu @ 1999-07-11 9:37 UTC (permalink / raw)
To: Mark Mitchell; +Cc: ian, binutils
> 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
>
This one doesn't look right. Did you mean
#define MIPS_ELF_ADD_DYNAMIC_ENTRY(info, tag, val) \
(ABI_64_P (elf_hash_table (info)->dynobj) \
? (abort (), false) \
: bfd_elf32_add_dynamic_entry (info, tag, val))
H.J.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: A 32bit BFD patch
1999-07-11 9:37 ` H.J. Lu
@ 1999-07-11 9:46 ` Mark Mitchell
0 siblings, 0 replies; 8+ messages in thread
From: Mark Mitchell @ 1999-07-11 9:46 UTC (permalink / raw)
To: hjl; +Cc: ian, binutils
>>>>> "H" == H J Lu <hjl@lucon.org> writes:
H> This one doesn't look right.
Duh. Yes, that's what I meant. Fixed.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: A 32bit BFD patch
1999-07-11 9:30 ` Mark Mitchell
1999-07-11 9:37 ` H.J. Lu
@ 1999-07-11 19:48 ` Ian Lance Taylor
1 sibling, 0 replies; 8+ messages in thread
From: Ian Lance Taylor @ 1999-07-11 19:48 UTC (permalink / raw)
To: mark; +Cc: binutils
From: Mark Mitchell <mark@codesourcery.com>
Date: Sun, 11 Jul 1999 09:34:01 -0700
BTW, we could consider
compiling with `-W -Wall' by default, as in EGCS. Don't know how much
noise this would generate at present.
Good idea. I made this change.
Everyone, let me know if you notice any problems (besides new
warnings, that is).
Ian
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~1999-07-11 19:48 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-10 10:47 A 32bit BFD patch 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
1999-07-11 9:37 ` H.J. Lu
1999-07-11 9:46 ` Mark Mitchell
1999-07-11 19:48 ` Ian Lance Taylor
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).