summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-05-15 22:53:21 +0930
committerAlan Modra <amodra@gmail.com>2023-05-17 11:21:43 +0930
commit3318d80021140659fab083bc03cf6b0cc54a139d (patch)
tree999d535b9b13472bca6658f75e16b49276185c41 /bfd
parentf5b7a67f8d0ffcb76a6185a531d87a2f010b1bbc (diff)
downloadbinutils-gdb-3318d80021140659fab083bc03cf6b0cc54a139d.tar.gz
gcc-4.5 build fixes
Trying to build binutils with an older gcc currently fails. Working around these gcc bugs is not onerous so let's fix them. bfd/ * elf32-csky.c (csky_elf_size_dynamic_sections): Don't type-pun pointer. * elf32-rl78.c (rl78_compute_complex_reloc): Rename "stat" variable to "status". gas/ * compress-debug.c (compress_finish): Supply all fields in ZSTD_inBuffer initialisation. include/ * xtensa-dynconfig.h (xtensa_isa_internal): Delete unnecessary forward declaration. opcodes/ * loongarch-opc.c: Supply all fields of zero struct initialisation in various opcode tables.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/elf32-csky.c3
-rw-r--r--bfd/elf32-rl78.c98
2 files changed, 50 insertions, 51 deletions
diff --git a/bfd/elf32-csky.c b/bfd/elf32-csky.c
index 76567c722bb..40d776169f2 100644
--- a/bfd/elf32-csky.c
+++ b/bfd/elf32-csky.c
@@ -1942,8 +1942,7 @@ csky_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
{
struct elf_dyn_relocs *p;
- for (p = *((struct elf_dyn_relocs **)
- &elf_section_data (s)->local_dynrel);
+ for (p = elf_section_data (s)->local_dynrel;
p != NULL;
p = p->next)
{
diff --git a/bfd/elf32-rl78.c b/bfd/elf32-rl78.c
index c7a94f2a280..c8b767ea166 100644
--- a/bfd/elf32-rl78.c
+++ b/bfd/elf32-rl78.c
@@ -396,18 +396,18 @@ rl78_compute_complex_reloc (unsigned long r_type,
{
int32_t tmp1, tmp2;
bfd_vma relocation = 0;
- bfd_reloc_status_type stat = bfd_reloc_ok;
+ bfd_reloc_status_type status = bfd_reloc_ok;
switch (r_type)
{
default:
- stat = bfd_reloc_notsupported;
+ status = bfd_reloc_notsupported;
break;
case R_RL78_ABS24S_PCREL:
case R_RL78_ABS16S_PCREL:
case R_RL78_ABS8S_PCREL:
- relocation = rl78_stack_pop (&stat);
+ relocation = rl78_stack_pop (&status);
relocation -= input_section->output_section->vma + input_section->output_offset;
break;
@@ -420,141 +420,141 @@ rl78_compute_complex_reloc (unsigned long r_type,
case R_RL78_ABS8:
case R_RL78_ABS8U:
case R_RL78_ABS8S:
- relocation = rl78_stack_pop (&stat);
+ relocation = rl78_stack_pop (&status);
break;
case R_RL78_ABS16UL:
case R_RL78_ABS8UL:
- relocation = rl78_stack_pop (&stat) >> 2;
+ relocation = rl78_stack_pop (&status) >> 2;
break;;
case R_RL78_ABS16UW:
case R_RL78_ABS8UW:
- relocation = rl78_stack_pop (&stat) >> 1;
+ relocation = rl78_stack_pop (&status) >> 1;
break;
/* The rest of the relocs compute values and then push them onto the stack. */
case R_RL78_OPramtop:
case R_RL78_OPromtop:
case R_RL78_SYM:
- rl78_stack_push (symval, &stat);
+ rl78_stack_push (symval, &status);
break;
case R_RL78_OPneg:
- tmp1 = rl78_stack_pop (&stat);
+ tmp1 = rl78_stack_pop (&status);
tmp1 = - tmp1;
- rl78_stack_push (tmp1, &stat);
+ rl78_stack_push (tmp1, &status);
break;
case R_RL78_OPadd:
- tmp2 = rl78_stack_pop (&stat);
- tmp1 = rl78_stack_pop (&stat);
+ tmp2 = rl78_stack_pop (&status);
+ tmp1 = rl78_stack_pop (&status);
tmp1 += tmp2;
- rl78_stack_push (tmp1, &stat);
+ rl78_stack_push (tmp1, &status);
break;
case R_RL78_OPsub:
/* For the expression "A - B", the assembler pushes A,
then B, then OPSUB. So the first op we pop is B, not A. */
- tmp2 = rl78_stack_pop (&stat); /* B */
- tmp1 = rl78_stack_pop (&stat); /* A */
+ tmp2 = rl78_stack_pop (&status); /* B */
+ tmp1 = rl78_stack_pop (&status); /* A */
tmp1 -= tmp2; /* A - B */
- rl78_stack_push (tmp1, &stat);
+ rl78_stack_push (tmp1, &status);
break;
case R_RL78_OPmul:
- tmp2 = rl78_stack_pop (&stat);
- tmp1 = rl78_stack_pop (&stat);
+ tmp2 = rl78_stack_pop (&status);
+ tmp1 = rl78_stack_pop (&status);
tmp1 *= tmp2;
- rl78_stack_push (tmp1, &stat);
+ rl78_stack_push (tmp1, &status);
break;
case R_RL78_OPdiv:
- tmp2 = rl78_stack_pop (&stat);
- tmp1 = rl78_stack_pop (&stat);
+ tmp2 = rl78_stack_pop (&status);
+ tmp1 = rl78_stack_pop (&status);
if (tmp2 != 0)
tmp1 /= tmp2;
else
{
tmp1 = 0;
- stat = bfd_reloc_overflow;
+ status = bfd_reloc_overflow;
}
- rl78_stack_push (tmp1, &stat);
+ rl78_stack_push (tmp1, &status);
break;
case R_RL78_OPshla:
- tmp2 = rl78_stack_pop (&stat);
- tmp1 = rl78_stack_pop (&stat);
+ tmp2 = rl78_stack_pop (&status);
+ tmp1 = rl78_stack_pop (&status);
tmp1 <<= tmp2;
- rl78_stack_push (tmp1, &stat);
+ rl78_stack_push (tmp1, &status);
break;
case R_RL78_OPshra:
- tmp2 = rl78_stack_pop (&stat);
- tmp1 = rl78_stack_pop (&stat);
+ tmp2 = rl78_stack_pop (&status);
+ tmp1 = rl78_stack_pop (&status);
tmp1 >>= tmp2;
- rl78_stack_push (tmp1, &stat);
+ rl78_stack_push (tmp1, &status);
break;
case R_RL78_OPsctsize:
- rl78_stack_push (input_section->size, &stat);
+ rl78_stack_push (input_section->size, &status);
break;
case R_RL78_OPscttop:
- rl78_stack_push (input_section->output_section->vma, &stat);
+ rl78_stack_push (input_section->output_section->vma, &status);
break;
case R_RL78_OPand:
- tmp2 = rl78_stack_pop (&stat);
- tmp1 = rl78_stack_pop (&stat);
+ tmp2 = rl78_stack_pop (&status);
+ tmp1 = rl78_stack_pop (&status);
tmp1 &= tmp2;
- rl78_stack_push (tmp1, &stat);
+ rl78_stack_push (tmp1, &status);
break;
case R_RL78_OPor:
- tmp2 = rl78_stack_pop (&stat);
- tmp1 = rl78_stack_pop (&stat);
+ tmp2 = rl78_stack_pop (&status);
+ tmp1 = rl78_stack_pop (&status);
tmp1 |= tmp2;
- rl78_stack_push (tmp1, &stat);
+ rl78_stack_push (tmp1, &status);
break;
case R_RL78_OPxor:
- tmp2 = rl78_stack_pop (&stat);
- tmp1 = rl78_stack_pop (&stat);
+ tmp2 = rl78_stack_pop (&status);
+ tmp1 = rl78_stack_pop (&status);
tmp1 ^= tmp2;
- rl78_stack_push (tmp1, &stat);
+ rl78_stack_push (tmp1, &status);
break;
case R_RL78_OPnot:
- tmp1 = rl78_stack_pop (&stat);
+ tmp1 = rl78_stack_pop (&status);
tmp1 = ~ tmp1;
- rl78_stack_push (tmp1, &stat);
+ rl78_stack_push (tmp1, &status);
break;
case R_RL78_OPmod:
- tmp2 = rl78_stack_pop (&stat);
- tmp1 = rl78_stack_pop (&stat);
+ tmp2 = rl78_stack_pop (&status);
+ tmp1 = rl78_stack_pop (&status);
if (tmp2 != 0)
tmp1 %= tmp2;
else
{
tmp1 = 0;
- stat = bfd_reloc_overflow;
+ status = bfd_reloc_overflow;
}
- rl78_stack_push (tmp1, &stat);
+ rl78_stack_push (tmp1, &status);
break;
}
if (r)
{
- if (stat == bfd_reloc_dangerous)
+ if (status == bfd_reloc_dangerous)
*error_message = (_("RL78 reloc stack overflow/underflow"));
- else if (stat == bfd_reloc_overflow)
+ else if (status == bfd_reloc_overflow)
{
- stat = bfd_reloc_dangerous;
+ status = bfd_reloc_dangerous;
*error_message = (_("RL78 reloc divide by zero"));
}
- *r = stat;
+ *r = status;
}
return relocation;
}