aboutsummaryrefslogtreecommitdiff
path: root/bfd/som.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1994-09-14 03:03:15 +0000
committerJeff Law <law@redhat.com>1994-09-14 03:03:15 +0000
commitae880afc1beee25a37e48088ebe1bf13710d390b (patch)
tree16646355a194eeb3eac6c7790eb278844eb5f878 /bfd/som.c
parente10639db4445c3b933b358aae61ff53b84b80667 (diff)
downloadbinutils-ae880afc1beee25a37e48088ebe1bf13710d390b.zip
binutils-ae880afc1beee25a37e48088ebe1bf13710d390b.tar.gz
binutils-ae880afc1beee25a37e48088ebe1bf13710d390b.tar.bz2
* som.c (som_fixup_formats): Case R_ENTRY (0xb3), set both
'T' and 'U' to grab all the unwind information. (som_set_reloc_info): Make 'U' unwind bits persist across multiple SOM relocations. Set the addend field of an R_ENTRY relocation to the value in 'T'; set the addend field on an R_EXIT relocation to the value in 'U'.
Diffstat (limited to 'bfd/som.c')
-rw-r--r--bfd/som.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/bfd/som.c b/bfd/som.c
index 871595b..0c63652 100644
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -329,7 +329,8 @@ static const struct section_to_type stt[] = {
O = stack operation
R = parameter relocation bits
S = symbol index
- U = 64 bits of stack unwind and frame size info (we only keep 32 bits)
+ T = first 32 bits of stack unwind information
+ U = second 32 bits of stack unwind information
V = a literal constant (usually used in the next relocation)
P = a previous relocation
@@ -570,7 +571,7 @@ static const struct fixup_format som_fixup_formats[256] =
/* R_BREAKPOINT */
0, "L4=", /* 0xb2 */
/* R_ENTRY */
- 0, "Ui=", /* 0xb3 */
+ 0, "Te=Ue=", /* 0xb3 */
1, "Uf=", /* 0xb4 */
/* R_ALT_ENTRY */
0, "", /* 0xb5 */
@@ -3993,7 +3994,7 @@ som_set_reloc_info (fixup, end, internal_relocs, section, symbols, just_count)
const struct fixup_format *fp;
char *cp;
unsigned char *save_fixup;
- int variables[26], stack[20], c, v, count, prev_fixup, *sp;
+ int variables[26], stack[20], c, v, count, prev_fixup, *sp, saved_unwind_bits;
const int *subop;
arelent *rptr= internal_relocs;
unsigned int offset = 0;
@@ -4008,6 +4009,7 @@ som_set_reloc_info (fixup, end, internal_relocs, section, symbols, just_count)
memset (stack, 0, sizeof (stack));
count = 0;
prev_fixup = 0;
+ saved_unwind_bits = 0;
sp = stack;
while (fixup < end_fixups)
@@ -4051,6 +4053,7 @@ som_set_reloc_info (fixup, end, internal_relocs, section, symbols, just_count)
into D. */
var ('L') = 0;
var ('D') = fp->D;
+ var ('U') = saved_unwind_bits;
/* Get the opcode format. */
cp = fp->format;
@@ -4160,6 +4163,11 @@ som_set_reloc_info (fixup, end, internal_relocs, section, symbols, just_count)
++subop;
--subop;
break;
+ /* The lower 32unwind bits must be persistent. */
+ case 'U':
+ saved_unwind_bits = var ('U');
+ break;
+
default:
break;
}
@@ -4183,7 +4191,12 @@ som_set_reloc_info (fixup, end, internal_relocs, section, symbols, just_count)
/* Done with a single reloction. Loop back to the top. */
if (! just_count)
{
- rptr->addend = var ('V');
+ if (som_hppa_howto_table[op].type == R_ENTRY)
+ rptr->addend = var ('T');
+ else if (som_hppa_howto_table[op].type == R_EXIT)
+ rptr->addend = var ('U');
+ else
+ rptr->addend = var ('V');
rptr++;
}
count++;