This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] MIPS bfd: abi 64 ld -r
- From: Stan Cox <scox at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: 29 Aug 2002 21:43:52 -0400
- Subject: [PATCH] MIPS bfd: abi 64 ld -r
- Newsgroups: gmane.comp.gnu.binutils
- Organization: Red Hat, RDU, NC
This patch handles some issues with the 64 bit abi with respect to ld
-r. The mips style type2 and type3 relocations were being "lost".
The partial inplace hunk is courtesy of Alexandre Oliva; the Irix
linker will use the offsets if they are available, so we should too.
One of the fields in the .MIPS.options section is for the GP value, so
we need this to be emitted.
* elf64-mips.c (mips_elf64_be_swap_reloca_out): Handle type2 and type3.
* elfn32-mips.c (elf_mips_howto_table_rela): Allow partial_inplace.
* elfxx-mips.c (_bfd_mips_elf_final_link): Always create
.MIPS.options/.options section.
* config.bfd (mips-irix6): Use bfd_elf32_nbigmips_vec.
? cscope.out
? binutils.cscope
Index: config.bfd
===================================================================
RCS file: /cvs/uberbaum/./bfd/config.bfd,v
retrieving revision 1.113
diff -u -2 -p -r1.113 config.bfd
--- config.bfd 14 Aug 2002 15:18:54 -0000 1.113
+++ config.bfd 29 Aug 2002 22:32:54 -0000
@@ -695,6 +695,6 @@ case "${targ}" in
#ifdef BFD64
mips*-*-irix6*)
- targ_defvec=bfd_elf32_bigmips_vec
- targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
+ targ_defvec=bfd_elf32_nbigmips_vec
+ targ_selvecs="bfd_elf32_nlittlemips_vec bfd_elf32_bigmips_vec bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
;;
#endif
Index: elf64-mips.c
===================================================================
RCS file: /cvs/uberbaum/./bfd/elf64-mips.c,v
retrieving revision 1.35
diff -u -2 -p -r1.35 elf64-mips.c
--- elf64-mips.c 25 Jul 2002 15:35:14 -0000 1.35
+++ elf64-mips.c 29 Aug 2002 22:32:54 -0000
@@ -1370,7 +1372,7 @@ mips_elf64_be_swap_reloca_out (abfd, src
BFD_ASSERT(src[2].r_addend == 0);
- mirela.r_type2 = ELF64_MIPS_R_TYPE2 (src[1].r_info);
+ mirela.r_type2 = ELF64_MIPS_R_TYPE (src[1].r_info);
mirela.r_ssym = ELF64_MIPS_R_SSYM (src[1].r_info);
- mirela.r_type3 = ELF64_MIPS_R_TYPE3 (src[2].r_info);
+ mirela.r_type3 = ELF64_MIPS_R_TYPE (src[2].r_info);
mips_elf64_swap_reloca_out (abfd, &mirela,
Index: elfn32-mips.c
===================================================================
RCS file: /cvs/uberbaum/./bfd/elfn32-mips.c,v
retrieving revision 1.1
diff -u -2 -p -r1.1 elfn32-mips.c
--- elfn32-mips.c 31 Jul 2002 00:32:10 -0000 1.1
+++ elfn32-mips.c 29 Aug 2002 22:32:54 -0000
@@ -625,5 +625,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_NONE", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
@@ -640,5 +640,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_16", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x0000, /* dst_mask */
@@ -655,5 +655,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_32", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0xffffffff, /* dst_mask */
@@ -670,5 +670,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_REL32", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0xffffffff, /* dst_mask */
@@ -688,5 +688,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_26", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x03ffffff, /* dst_mask */
@@ -703,5 +703,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_HI16", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x0000ffff, /* dst_mask */
@@ -718,5 +718,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_LO16", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x0000ffff, /* dst_mask */
@@ -733,5 +733,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_gprel16_reloc, /* special_function */
"R_MIPS_GPREL16", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x0000ffff, /* dst_mask */
@@ -748,5 +748,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_literal_reloc, /* special_function */
"R_MIPS_LITERAL", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x0000ffff, /* dst_mask */
@@ -763,5 +763,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_got16_reloc, /* special_function */
"R_MIPS_GOT16", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x0000ffff, /* dst_mask */
@@ -778,5 +778,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_PC16", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x0000ffff, /* dst_mask */
@@ -793,5 +793,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_CALL16", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x0000ffff, /* dst_mask */
@@ -808,5 +808,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_gprel32_reloc, /* special_function */
"R_MIPS_GPREL32", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0xffffffff, /* dst_mask */
@@ -827,5 +827,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_SHIFT5", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x000007c0, /* dst_mask */
@@ -842,5 +842,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_shift6_reloc, /* special_function */
"R_MIPS_SHIFT6", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x000007c4, /* dst_mask */
@@ -857,5 +857,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_64", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
MINUS_ONE, /* dst_mask */
@@ -872,5 +872,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_GOT_DISP", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x0000ffff, /* dst_mask */
@@ -887,5 +887,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_GOT_PAGE", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x0000ffff, /* dst_mask */
@@ -902,5 +902,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_GOT_OFST", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x0000ffff, /* dst_mask */
@@ -917,5 +917,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_GOT_HI16", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x0000ffff, /* dst_mask */
@@ -932,5 +932,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_GOT_LO16", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x0000ffff, /* dst_mask */
@@ -947,5 +947,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_SUB", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
MINUS_ONE, /* dst_mask */
@@ -963,5 +963,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_INSERT_A", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0xffffffff, /* dst_mask */
@@ -980,5 +980,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_INSERT_B", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0xffffffff, /* dst_mask */
@@ -996,5 +996,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_DELETE", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0xffffffff, /* dst_mask */
@@ -1011,5 +1011,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_HIGHER", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x0000ffff, /* dst_mask */
@@ -1026,5 +1026,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_HIGHEST", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x0000ffff, /* dst_mask */
@@ -1041,5 +1041,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_CALL_HI16", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x0000ffff, /* dst_mask */
@@ -1056,5 +1056,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_CALL_LO16", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0x0000ffff, /* dst_mask */
@@ -1071,5 +1071,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_SCN_DISP", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0xffffffff, /* dst_mask */
@@ -1086,5 +1086,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_REL16", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0xffff, /* dst_mask */
@@ -1106,5 +1106,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_RELGOT", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0xffffffff, /* dst_mask */
@@ -1122,5 +1122,5 @@ static reloc_howto_type elf_mips_howto_t
mips_elf_generic_reloc, /* special_function */
"R_MIPS_JALR", /* name */
- false, /* partial_inplace */
+ true, /* partial_inplace */
0, /* src_mask */
0xffffffff, /* dst_mask */
Index: elfxx-mips.c
===================================================================
RCS file: /cvs/uberbaum/./bfd/elfxx-mips.c,v
retrieving revision 1.21
diff -u -2 -p -r1.21 elfxx-mips.c
--- elfxx-mips.c 22 Aug 2002 01:27:20 -0000 1.21
+++ elfxx-mips.c 29 Aug 2002 22:32:57 -0000
@@ -6985,4 +7200,6 @@ _bfd_mips_elf_final_link (abfd, info)
}
+#if 0
+ /* We want to set the GP value for ld -r. */
/* On IRIX5, we omit the .options section. On IRIX6, however, we
include it, even though we don't process it quite right. (Some
@@ -7022,4 +7239,5 @@ _bfd_mips_elf_final_link (abfd, info)
}
}
+#endif
/* Get a value for the GP register. */