mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 14:39:09 +08:00
Fix generation of relocs for 32-bit Sparc Solaris targets.
PR gas/20427 * config/tc-sparc.c (cons_fix_new_sparc): Prevent the generation of 64-bit relocation types when assembling for a 32-bit Solaris target.
This commit is contained in:

committed by
Nick Clifton

parent
6f67973b42
commit
024425668d
@ -1,3 +1,10 @@
|
|||||||
|
2016-08-04 Stefan Trleman <stefan.teleman@oracle.com>
|
||||||
|
|
||||||
|
PR gas/20427
|
||||||
|
* config/tc-sparc.c (cons_fix_new_sparc): Prevent the generation
|
||||||
|
of 64-bit relocation types when assembling for a 32-bit Solaris
|
||||||
|
target.
|
||||||
|
|
||||||
2016-07-27 Jose E. Marchesi <jose.marchesi@oracle.com>
|
2016-07-27 Jose E. Marchesi <jose.marchesi@oracle.com>
|
||||||
|
|
||||||
* testsuite/gas/sparc/sparc.exp: Use is_elf_format to discriminate
|
* testsuite/gas/sparc/sparc.exp: Use is_elf_format to discriminate
|
||||||
|
@ -4890,6 +4890,15 @@ cons_fix_new_sparc (fragS *frag,
|
|||||||
&& now_seg->flags & SEC_ALLOC)
|
&& now_seg->flags & SEC_ALLOC)
|
||||||
r = BFD_RELOC_SPARC_REV32;
|
r = BFD_RELOC_SPARC_REV32;
|
||||||
|
|
||||||
|
#ifdef TE_SOLARIS
|
||||||
|
/* The Solaris linker does not allow R_SPARC_UA64
|
||||||
|
relocations for 32-bit executables. */
|
||||||
|
if (!target_little_endian_data
|
||||||
|
&& sparc_arch_size != 64
|
||||||
|
&& r == BFD_RELOC_64)
|
||||||
|
r = BFD_RELOC_32;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (sparc_cons_special_reloc)
|
if (sparc_cons_special_reloc)
|
||||||
{
|
{
|
||||||
if (*sparc_cons_special_reloc == 'd')
|
if (*sparc_cons_special_reloc == 'd')
|
||||||
@ -4920,7 +4929,14 @@ cons_fix_new_sparc (fragS *frag,
|
|||||||
{
|
{
|
||||||
case 2: r = BFD_RELOC_SPARC_UA16; break;
|
case 2: r = BFD_RELOC_SPARC_UA16; break;
|
||||||
case 4: r = BFD_RELOC_SPARC_UA32; break;
|
case 4: r = BFD_RELOC_SPARC_UA32; break;
|
||||||
|
#ifdef TE_SOLARIS
|
||||||
|
/* The Solaris linker does not allow R_SPARC_UA64
|
||||||
|
relocations for 32-bit executables. */
|
||||||
|
case 8: r = sparc_arch_size == 64 ?
|
||||||
|
BFD_RELOC_SPARC_UA64 : BFD_RELOC_SPARC_UA32; break;
|
||||||
|
#else
|
||||||
case 8: r = BFD_RELOC_SPARC_UA64; break;
|
case 8: r = BFD_RELOC_SPARC_UA64; break;
|
||||||
|
#endif
|
||||||
default: abort ();
|
default: abort ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user