2001-01-01 Kazu Hirata <kazu@hxi.com>
* reloc.c: Fix formatting. * riscix.c: Likewise. * rs6000-core.c: Likewise. * xcoff-target.h: Likewise.
This commit is contained in:
parent
7dc542b23c
commit
3d85563291
5 changed files with 76 additions and 99 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2001-01-01 Kazu Hirata <kazu@hxi.com>
|
||||||
|
|
||||||
|
* reloc.c: Fix formatting.
|
||||||
|
* riscix.c: Likewise.
|
||||||
|
* rs6000-core.c: Likewise.
|
||||||
|
* xcoff-target.h: Likewise.
|
||||||
|
|
||||||
2000-12-29 Hans-Peter Nilsson <hp@bitrange.com>
|
2000-12-29 Hans-Peter Nilsson <hp@bitrange.com>
|
||||||
|
|
||||||
* elfcode.h (elf_object_p): Also restore the bfd mach field on
|
* elfcode.h (elf_object_p): Also restore the bfd mach field on
|
||||||
|
|
20
bfd/reloc.c
20
bfd/reloc.c
|
@ -146,7 +146,6 @@ DESCRIPTION
|
||||||
to the relocation offset. Its interpretation is dependent upon
|
to the relocation offset. Its interpretation is dependent upon
|
||||||
the howto. For example, on the 68k the code:
|
the howto. For example, on the 68k the code:
|
||||||
|
|
||||||
|
|
||||||
| char foo[];
|
| char foo[];
|
||||||
| main()
|
| main()
|
||||||
| {
|
| {
|
||||||
|
@ -161,11 +160,9 @@ DESCRIPTION
|
||||||
| unlk fp
|
| unlk fp
|
||||||
| rts
|
| rts
|
||||||
|
|
||||||
|
|
||||||
This could create a reloc pointing to <<foo>>, but leave the
|
This could create a reloc pointing to <<foo>>, but leave the
|
||||||
offset in the data, something like:
|
offset in the data, something like:
|
||||||
|
|
||||||
|
|
||||||
|RELOCATION RECORDS FOR [.text]:
|
|RELOCATION RECORDS FOR [.text]:
|
||||||
|offset type value
|
|offset type value
|
||||||
|00000006 32 _foo
|
|00000006 32 _foo
|
||||||
|
@ -176,21 +173,17 @@ DESCRIPTION
|
||||||
|0000000c 4e5e ; unlk fp
|
|0000000c 4e5e ; unlk fp
|
||||||
|0000000e 4e75 ; rts
|
|0000000e 4e75 ; rts
|
||||||
|
|
||||||
|
|
||||||
Using coff and an 88k, some instructions don't have enough
|
Using coff and an 88k, some instructions don't have enough
|
||||||
space in them to represent the full address range, and
|
space in them to represent the full address range, and
|
||||||
pointers have to be loaded in two parts. So you'd get something like:
|
pointers have to be loaded in two parts. So you'd get something like:
|
||||||
|
|
||||||
|
|
||||||
| or.u r13,r0,hi16(_foo+0x12345678)
|
| or.u r13,r0,hi16(_foo+0x12345678)
|
||||||
| ld.b r2,r13,lo16(_foo+0x12345678)
|
| ld.b r2,r13,lo16(_foo+0x12345678)
|
||||||
| jmp r1
|
| jmp r1
|
||||||
|
|
||||||
|
|
||||||
This should create two relocs, both pointing to <<_foo>>, and with
|
This should create two relocs, both pointing to <<_foo>>, and with
|
||||||
0x12340000 in their addend field. The data would consist of:
|
0x12340000 in their addend field. The data would consist of:
|
||||||
|
|
||||||
|
|
||||||
|RELOCATION RECORDS FOR [.text]:
|
|RELOCATION RECORDS FOR [.text]:
|
||||||
|offset type value
|
|offset type value
|
||||||
|00000002 HVRT16 _foo+0x12340000
|
|00000002 HVRT16 _foo+0x12340000
|
||||||
|
@ -200,7 +193,6 @@ DESCRIPTION
|
||||||
|00000004 1c4d5678 ; ld.b r2,r13,0x5678
|
|00000004 1c4d5678 ; ld.b r2,r13,0x5678
|
||||||
|00000008 f400c001 ; jmp r1
|
|00000008 f400c001 ; jmp r1
|
||||||
|
|
||||||
|
|
||||||
The relocation routine digs out the value from the data, adds
|
The relocation routine digs out the value from the data, adds
|
||||||
it to the addend to get the original offset, and then adds the
|
it to the addend to get the original offset, and then adds the
|
||||||
value of <<_foo>>. Note that all 32 bits have to be kept around
|
value of <<_foo>>. Note that all 32 bits have to be kept around
|
||||||
|
@ -223,7 +215,6 @@ DESCRIPTION
|
||||||
Both relocs contain a pointer to <<foo>>, and the offsets
|
Both relocs contain a pointer to <<foo>>, and the offsets
|
||||||
contain junk.
|
contain junk.
|
||||||
|
|
||||||
|
|
||||||
|RELOCATION RECORDS FOR [.text]:
|
|RELOCATION RECORDS FOR [.text]:
|
||||||
|offset type value
|
|offset type value
|
||||||
|00000004 HI22 _foo+0x12345678
|
|00000004 HI22 _foo+0x12345678
|
||||||
|
@ -235,7 +226,6 @@ DESCRIPTION
|
||||||
|0000000c 81c7e008 ; ret
|
|0000000c 81c7e008 ; ret
|
||||||
|00000010 81e80000 ; restore
|
|00000010 81e80000 ; restore
|
||||||
|
|
||||||
|
|
||||||
o <<howto>>
|
o <<howto>>
|
||||||
|
|
||||||
The <<howto>> field can be imagined as a
|
The <<howto>> field can be imagined as a
|
||||||
|
@ -391,7 +381,6 @@ FUNCTION
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
The HOWTO define is horrible and will go away.
|
The HOWTO define is horrible and will go away.
|
||||||
|
|
||||||
|
|
||||||
.#define HOWTO(C, R,S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
|
.#define HOWTO(C, R,S,B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
|
||||||
. {(unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC}
|
. {(unsigned)C,R,S,B, P, BI, O,SF,NAME,INPLACE,MASKSRC,MASKDST,PC}
|
||||||
|
|
||||||
|
@ -399,7 +388,6 @@ DESCRIPTION
|
||||||
And will be replaced with the totally magic way. But for the
|
And will be replaced with the totally magic way. But for the
|
||||||
moment, we are compatible, so do it this way.
|
moment, we are compatible, so do it this way.
|
||||||
|
|
||||||
|
|
||||||
.#define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN)
|
.#define NEWHOWTO( FUNCTION, NAME,SIZE,REL,IN) HOWTO(0,0,SIZE,0,REL,0,complain_overflow_dont,FUNCTION, NAME,false,0,0,IN)
|
||||||
.
|
.
|
||||||
|
|
||||||
|
@ -589,7 +577,6 @@ DESCRIPTION
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
bfd_reloc_status_type
|
bfd_reloc_status_type
|
||||||
bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd,
|
bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd,
|
||||||
error_message)
|
error_message)
|
||||||
|
@ -651,7 +638,6 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd,
|
||||||
else
|
else
|
||||||
relocation = symbol->value;
|
relocation = symbol->value;
|
||||||
|
|
||||||
|
|
||||||
reloc_target_output_section = symbol->section->output_section;
|
reloc_target_output_section = symbol->section->output_section;
|
||||||
|
|
||||||
/* Convert input-section-relative symbol value to absolute. */
|
/* Convert input-section-relative symbol value to absolute. */
|
||||||
|
@ -990,7 +976,6 @@ DESCRIPTION
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
bfd_reloc_status_type
|
bfd_reloc_status_type
|
||||||
bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset,
|
bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset,
|
||||||
input_section, error_message)
|
input_section, error_message)
|
||||||
|
@ -1780,7 +1765,6 @@ displacements off that register. These relocation types are
|
||||||
handled specially, because the value the register will have is
|
handled specially, because the value the register will have is
|
||||||
decided relatively late.
|
decided relatively late.
|
||||||
|
|
||||||
|
|
||||||
ENUM
|
ENUM
|
||||||
BFD_RELOC_I960_CALLJ
|
BFD_RELOC_I960_CALLJ
|
||||||
ENUMDOC
|
ENUMDOC
|
||||||
|
@ -3009,7 +2993,6 @@ CODE_FRAGMENT
|
||||||
.typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
|
.typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
FUNCTION
|
FUNCTION
|
||||||
bfd_reloc_type_lookup
|
bfd_reloc_type_lookup
|
||||||
|
@ -3025,7 +3008,6 @@ DESCRIPTION
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
reloc_howto_type *
|
reloc_howto_type *
|
||||||
bfd_reloc_type_lookup (abfd, code)
|
bfd_reloc_type_lookup (abfd, code)
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
|
@ -3037,7 +3019,6 @@ bfd_reloc_type_lookup (abfd, code)
|
||||||
static reloc_howto_type bfd_howto_32 =
|
static reloc_howto_type bfd_howto_32 =
|
||||||
HOWTO (0, 00, 2, 32, false, 0, complain_overflow_bitfield, 0, "VRT32", false, 0xffffffff, 0xffffffff, true);
|
HOWTO (0, 00, 2, 32, false, 0, complain_overflow_bitfield, 0, "VRT32", false, 0xffffffff, 0xffffffff, true);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
INTERNAL_FUNCTION
|
INTERNAL_FUNCTION
|
||||||
bfd_default_reloc_type_lookup
|
bfd_default_reloc_type_lookup
|
||||||
|
@ -3049,7 +3030,6 @@ SYNOPSIS
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
Provides a default relocation lookup routine for any architecture.
|
Provides a default relocation lookup routine for any architecture.
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
reloc_howto_type *
|
reloc_howto_type *
|
||||||
|
|
|
@ -19,7 +19,6 @@ You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
|
||||||
/* RISC iX overloads the MAGIC field to indicate more than just the usual
|
/* RISC iX overloads the MAGIC field to indicate more than just the usual
|
||||||
[ZNO]MAGIC values. Also included are squeezing information and
|
[ZNO]MAGIC values. Also included are squeezing information and
|
||||||
shared library usage. */
|
shared library usage. */
|
||||||
|
@ -163,7 +162,6 @@ static reloc_howto_type riscix_std_reloc_howto[] = {
|
||||||
#define RISCIX_TABLE_SIZE \
|
#define RISCIX_TABLE_SIZE \
|
||||||
(sizeof (riscix_std_reloc_howto) / sizeof (reloc_howto_type))
|
(sizeof (riscix_std_reloc_howto) / sizeof (reloc_howto_type))
|
||||||
|
|
||||||
|
|
||||||
static bfd_reloc_status_type
|
static bfd_reloc_status_type
|
||||||
riscix_fix_pcrel_26_done (abfd, reloc_entry, symbol, data, input_section,
|
riscix_fix_pcrel_26_done (abfd, reloc_entry, symbol, data, input_section,
|
||||||
output_bfd, error_message)
|
output_bfd, error_message)
|
||||||
|
@ -308,7 +306,6 @@ riscix_swap_std_reloc_out (abfd, g, natptr)
|
||||||
if (r_length == 3)
|
if (r_length == 3)
|
||||||
r_pcrel = r_pcrel ? 0 : 1;
|
r_pcrel = r_pcrel ? 0 : 1;
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* For a standard reloc, the addend is in the object file. */
|
/* For a standard reloc, the addend is in the object file. */
|
||||||
r_addend = g->addend + (*(g->sym_ptr_ptr))->section->output_section->vma;
|
r_addend = g->addend + (*(g->sym_ptr_ptr))->section->output_section->vma;
|
||||||
|
@ -412,7 +409,6 @@ riscix_squirt_out_relocs (abfd, section)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is just like the standard aoutx.h version but we need to do our
|
* This is just like the standard aoutx.h version but we need to do our
|
||||||
* own mapping of external reloc type values to howto entries.
|
* own mapping of external reloc type values to howto entries.
|
||||||
|
@ -506,7 +502,6 @@ riscix_some_aout_object_p (abfd, execp, callback_to_real_object_p)
|
||||||
if (N_DYNAMIC(*execp))
|
if (N_DYNAMIC(*execp))
|
||||||
abfd->flags |= DYNAMIC;
|
abfd->flags |= DYNAMIC;
|
||||||
|
|
||||||
|
|
||||||
if ((execp->a_info & MF_SQUEEZED) != 0) /* Squeezed files aren't supported
|
if ((execp->a_info & MF_SQUEEZED) != 0) /* Squeezed files aren't supported
|
||||||
(yet)! */
|
(yet)! */
|
||||||
{
|
{
|
||||||
|
@ -611,7 +606,6 @@ riscix_some_aout_object_p (abfd, execp, callback_to_real_object_p)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static const bfd_target *
|
static const bfd_target *
|
||||||
MY(object_p) (abfd)
|
MY(object_p) (abfd)
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
|
@ -641,5 +635,4 @@ MY(object_p) (abfd)
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#include "aout-target.h"
|
#include "aout-target.h"
|
||||||
|
|
|
@ -60,7 +60,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#undef SCNHDR
|
#undef SCNHDR
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------ */
|
||||||
/* Support for core file stuff.. */
|
/* Support for core file stuff.. */
|
||||||
/* ------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------ */
|
||||||
|
@ -621,8 +620,6 @@ rs6000coff_core_p (abfd)
|
||||||
return abfd->xvec; /* this is garbage for now. */
|
return abfd->xvec; /* this is garbage for now. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* return `true' if given core is from the given executable.. */
|
/* return `true' if given core is from the given executable.. */
|
||||||
boolean
|
boolean
|
||||||
rs6000coff_core_file_matches_executable_p (core_bfd, exec_bfd)
|
rs6000coff_core_file_matches_executable_p (core_bfd, exec_bfd)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue