[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: XCOFF relocation data gets mangled by ld.
From: |
Alan Modra |
Subject: |
Re: XCOFF relocation data gets mangled by ld. |
Date: |
Tue, 6 Aug 2002 12:47:17 +0930 |
User-agent: |
Mutt/1.2.5i |
My brain slipped a cog with that last change. Too long working on ELF rela
targets, where the source mask ought to be zero. We really do want
src_mask == dst_mask in most cases.
bfd/ChangeLog
* coff-rs6000.c (xcoff_howto_table): Revert some of last change to
mask entries. Use complain_overflow_dont for R_REF.
(xcoff_reloc_type_ba): Revert last change.
(xcoff_reloc_type_br): Likewise.
(xcoff_reloc_type_crel): Likewise.
(xcoff_ppc_relocate_section): Likewise.
* coff64-rs6000.c (xcoff64_reloc_type_br): Likewise.
(xcoff64_ppc_relocate_section): Likewise.
(xcoff64_howto_table): Revert some of last change to mask entries.
Use complain_overflow_dont for R_REF.
The following diff shows the net change in the last two patches.
Index: coff-rs6000.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-rs6000.c,v
retrieving revision 1.46
diff -u -p -r1.46 coff-rs6000.c
--- coff-rs6000.c 30 Jul 2002 05:49:24 -0000 1.46
+++ coff-rs6000.c 6 Aug 2002 03:03:10 -0000
@@ -655,7 +655,7 @@ reloc_howto_type xcoff_howto_table[] =
/* External TOC relative symbol. */
HOWTO (R_GL, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -670,7 +670,7 @@ reloc_howto_type xcoff_howto_table[] =
/* Local TOC relative symbol. */
HOWTO (R_TCL, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -695,8 +695,8 @@ reloc_howto_type xcoff_howto_table[] =
0, /* special_function */
"R_BA_26", /* name */
true, /* partial_inplace */
- 0x3fffffc, /* src_mask */
- 0x3fffffc, /* dst_mask */
+ 0x03fffffc, /* src_mask */
+ 0x03fffffc, /* dst_mask */
false), /* pcrel_offset */
EMPTY_HOWTO (9),
@@ -721,7 +721,7 @@ reloc_howto_type xcoff_howto_table[] =
/* Indirect load. */
HOWTO (R_RL, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -736,7 +736,7 @@ reloc_howto_type xcoff_howto_table[] =
/* Load address. */
HOWTO (R_RLA, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -757,7 +757,7 @@ reloc_howto_type xcoff_howto_table[] =
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
0, /* special_function */
"R_REF", /* name */
false, /* partial_inplace */
@@ -771,7 +771,7 @@ reloc_howto_type xcoff_howto_table[] =
/* TOC relative indirect load. */
HOWTO (R_TRL, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -786,7 +786,7 @@ reloc_howto_type xcoff_howto_table[] =
/* TOC relative load address. */
HOWTO (R_TRLA, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -831,7 +831,7 @@ reloc_howto_type xcoff_howto_table[] =
/* Modifiable call absolute indirect. */
HOWTO (R_CAI, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -846,7 +846,7 @@ reloc_howto_type xcoff_howto_table[] =
/* Modifiable call relative. */
HOWTO (R_CREL, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -869,8 +869,8 @@ reloc_howto_type xcoff_howto_table[] =
0, /* special_function */
"R_RBA", /* name */
true, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
+ 0x03fffffc, /* src_mask */
+ 0x03fffffc, /* dst_mask */
false), /* pcrel_offset */
/* Modifiable branch absolute. */
@@ -884,8 +884,8 @@ reloc_howto_type xcoff_howto_table[] =
0, /* special_function */
"R_RBAC", /* name */
true, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* Modifiable branch relative. */
@@ -899,14 +899,14 @@ reloc_howto_type xcoff_howto_table[] =
0, /* special_function */
"R_RBR_26", /* name */
true, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
+ 0x03fffffc, /* src_mask */
+ 0x03fffffc, /* dst_mask */
false), /* pcrel_offset */
/* Modifiable branch absolute. */
HOWTO (R_RBRC, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
Index: coff64-rs6000.c
===================================================================
RCS file: /cvs/src/src/bfd/coff64-rs6000.c,v
retrieving revision 1.34
diff -u -p -r1.34 coff64-rs6000.c
--- coff64-rs6000.c 30 Jul 2002 05:49:24 -0000 1.34
+++ coff64-rs6000.c 6 Aug 2002 03:13:47 -0000
@@ -1424,7 +1424,7 @@ reloc_howto_type xcoff64_howto_table[] =
/* External TOC relative symbol. */
HOWTO (R_GL, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -1439,7 +1439,7 @@ reloc_howto_type xcoff64_howto_table[] =
/* Local TOC relative symbol. */
HOWTO (R_TCL, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -1490,7 +1490,7 @@ reloc_howto_type xcoff64_howto_table[] =
/* Indirect load. */
HOWTO (R_RL, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -1505,7 +1505,7 @@ reloc_howto_type xcoff64_howto_table[] =
/* Load address. */
HOWTO (R_RLA, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -1526,7 +1526,7 @@ reloc_howto_type xcoff64_howto_table[] =
32, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
+ complain_overflow_dont, /* complain_on_overflow */
0, /* special_function */
"R_REF", /* name */
false, /* partial_inplace */
@@ -1540,7 +1540,7 @@ reloc_howto_type xcoff64_howto_table[] =
/* TOC relative indirect load. */
HOWTO (R_TRL, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -1555,7 +1555,7 @@ reloc_howto_type xcoff64_howto_table[] =
/* TOC relative load address. */
HOWTO (R_TRLA, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -1600,7 +1600,7 @@ reloc_howto_type xcoff64_howto_table[] =
/* Modifiable call absolute indirect. */
HOWTO (R_CAI, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -1615,7 +1615,7 @@ reloc_howto_type xcoff64_howto_table[] =
/* Modifiable call relative. */
HOWTO (R_CREL, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
@@ -1638,8 +1638,8 @@ reloc_howto_type xcoff64_howto_table[] =
0, /* special_function */
"R_RBA", /* name */
true, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
+ 0x03fffffc, /* src_mask */
+ 0x03fffffc, /* dst_mask */
false), /* pcrel_offset */
/* Modifiable branch absolute. */
@@ -1653,8 +1653,8 @@ reloc_howto_type xcoff64_howto_table[] =
0, /* special_function */
"R_RBAC", /* name */
true, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
false), /* pcrel_offset */
/* Modifiable branch relative. */
@@ -1668,14 +1668,14 @@ reloc_howto_type xcoff64_howto_table[] =
0, /* special_function */
"R_RBR_26", /* name */
true, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
+ 0x03fffffc, /* src_mask */
+ 0x03fffffc, /* dst_mask */
false), /* pcrel_offset */
/* Modifiable branch absolute. */
HOWTO (R_RBRC, /* type */
0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
false, /* pc_relative */
0, /* bitpos */
--
Alan Modra
IBM OzLabs - Linux Technology Centre