* config/tc-alpha.c (alpha_validate_fix): Move code ...

(alpha_fix_adjustable): ... here.
        * config/tc-alpha.h (TC_VALIDATE_FIX): Remove.
This commit is contained in:
Richard Henderson 2002-11-07 00:42:19 +00:00
parent 0067822234
commit 66ba4c770b
6 changed files with 1468 additions and 48 deletions

View File

@ -1,3 +1,9 @@
2002-11-06 Richard Henderson <rth@redhat.com>
* config/tc-alpha.c (alpha_validate_fix): Move code ...
(alpha_fix_adjustable): ... here.
* config/tc-alpha.h (TC_VALIDATE_FIX): Remove.
2002-11-07 Eric Kohl <ekohl@rz-online.de>
* config/te-pe.h (LEX_AT): Accept at-sign (@) as first character

View File

@ -1419,49 +1419,6 @@ alpha_define_label (sym)
alpha_insn_label = sym;
}
/* If we have a BRSGP reloc to a local symbol, adjust it to BRADDR and
let it get resolved at assembly time. */
#ifdef OBJ_ELF
void
alpha_validate_fix (f)
fixS *f;
{
int offset = 0;
const char *name;
if (f->fx_r_type != BFD_RELOC_ALPHA_BRSGP)
return;
if (! S_IS_DEFINED (f->fx_addsy))
return;
switch (S_GET_OTHER (f->fx_addsy) & STO_ALPHA_STD_GPLOAD)
{
case STO_ALPHA_NOPV:
break;
case STO_ALPHA_STD_GPLOAD:
offset = 8;
break;
default:
if (S_IS_LOCAL (f->fx_addsy))
name = "<local>";
else
name = S_GET_NAME (f->fx_addsy);
as_bad_where (f->fx_file, f->fx_line,
_("!samegp reloc against symbol without .prologue: %s"),
name);
break;
}
if (! (S_IS_EXTERN (f->fx_addsy) || S_IS_WEAK (f->fx_addsy)))
{
f->fx_r_type = BFD_RELOC_23_PCREL_S2;
f->fx_offset += offset;
}
}
#endif
/* Return true if we must always emit a reloc for a type and false if
there is some hope of resolving it at assembly time. */
@ -1521,7 +1478,6 @@ alpha_fix_adjustable (f)
case BFD_RELOC_ALPHA_GPDISP_HI16:
case BFD_RELOC_ALPHA_GPDISP_LO16:
case BFD_RELOC_ALPHA_GPDISP:
case BFD_RELOC_ALPHA_BRSGP:
return 0;
case BFD_RELOC_ALPHA_LITERAL:
@ -1559,6 +1515,39 @@ alpha_fix_adjustable (f)
we're preventing this in the other assemblers. Follow for now. */
return 0;
case BFD_RELOC_ALPHA_BRSGP:
/* If we have a BRSGP reloc to a local symbol, adjust it to BRADDR and
let it get resolved at assembly time. */
{
symbolS *sym = f->fx_addsy;
const char *name;
int offset = 0;
if (! S_IS_DEFINED (sym) || S_FORCE_RELOC (sym))
return 0;
switch (S_GET_OTHER (sym) & STO_ALPHA_STD_GPLOAD)
{
case STO_ALPHA_NOPV:
break;
case STO_ALPHA_STD_GPLOAD:
offset = 8;
break;
default:
if (S_IS_LOCAL (sym))
name = "<local>";
else
name = S_GET_NAME (sym);
as_bad_where (f->fx_file, f->fx_line,
_("!samegp reloc against symbol without .prologue: %s"),
name);
break;
}
f->fx_r_type = BFD_RELOC_23_PCREL_S2;
f->fx_offset += offset;
return 1;
}
default:
return 1;
}

View File

@ -49,16 +49,12 @@
struct fix;
struct alpha_reloc_tag;
extern void alpha_validate_fix PARAMS ((struct fix *));
extern int alpha_force_relocation PARAMS ((struct fix *));
extern int alpha_fix_adjustable PARAMS ((struct fix *));
extern unsigned long alpha_gprmask, alpha_fprmask;
extern valueT alpha_gp_value;
#ifdef OBJ_ELF
#define TC_VALIDATE_FIX(FIX,SEGTYPE,SKIP) alpha_validate_fix (FIX)
#endif
#define TC_FORCE_RELOCATION(FIX) alpha_force_relocation (FIX)
#define tc_fix_adjustable(FIX) alpha_fix_adjustable (FIX)
#define RELOC_REQUIRES_SYMBOL

View File

@ -30,6 +30,7 @@ if { [istarget alpha*-*-*] } then {
run_dump_test "elf-reloc-5"
run_list_test "elf-reloc-6" ""
run_dump_test "elf-reloc-7"
run_dump_test "elf-reloc-8"
run_dump_test "elf-tls-1"
run_list_test "elf-tls-2" ""
run_list_test "elf-tls-3" ""

View File

@ -0,0 +1,309 @@
#objdump: -r
#name: alpha elf-reloc-8
.*: file format elf64-alpha
RELOCATION RECORDS FOR \[\.text\]:
OFFSET *TYPE *VALUE
0*0000000 GPDISP \.text\+0x0*0000004
0*0000014 GPRELHIGH \.bss\+0x0*0000040
0*0000018 ELF_LITERAL ROOT_DEV
0*0000024 GPRELLOW \.bss\+0x0*0000040
0*0000040 GPRELHIGH \.rodata\.str1\.1\+0x0*00000eb
0*0000048 GPRELLOW \.rodata\.str1\.1\+0x0*00000eb
0*000004c BRADDR \.init\.text\+0x0*0000998
0*0000050 GPRELHIGH \.init\.data
0*0000054 GPRELLOW \.init\.data
0*000005c BRADDR \.init\.text\+0x0*0000aa8
0*0000070 BRADDR \.init\.text\+0x0*0000a48
0*0000074 ELF_LITERAL sys_umount
0*0000084 LITUSE \.text\+0x0*0000003
0*0000078 GPRELHIGH \.rodata\.str1\.1\+0x0*0000101
0*0000080 GPRELLOW \.rodata\.str1\.1\+0x0*0000101
0*0000084 HINT sys_umount
0*0000088 GPDISP \.text\+0x0*0000004
0*000009c GPRELHIGH \.rodata\.str1\.1\+0x0*0000106
0*00000a0 ELF_LITERAL sys_mount
0*00000b4 LITUSE \.text\+0x0*0000003
0*00000a4 GPRELHIGH \.rodata\.str1\.1\+0x0*0000108
0*00000a8 GPRELLOW \.rodata\.str1\.1\+0x0*0000106
0*00000ac GPRELLOW \.rodata\.str1\.1\+0x0*0000108
0*00000b4 HINT sys_mount
0*00000b8 GPDISP \.text\+0x0*0000004
0*00000c4 ELF_LITERAL sys_chroot
0*00000c8 LITUSE \.text\+0x0*0000003
0*00000c8 HINT sys_chroot
0*00000cc GPDISP \.text\+0x0*0000004
0*00000d4 ELF_LITERAL security_ops
0*00000e4 GPDISP \.text\+0x0*000000c
0*0000104 BRADDR \.init\.text\+0x0*0000a90
0*0000114 GPRELHIGH rd_doload
0*0000118 GPRELLOW rd_doload
0*0000124 BRADDR \.init\.text\+0x0*0000a28
0*0000140 GPRELLOW \.bss\+0x0*0000040
0*0000148 BRSGP name_to_dev_t
0*0000150 ELF_LITERAL memcmp
0*0000164 LITUSE \.text\+0x0*0000003
0*0000154 GPRELHIGH \.rodata\.str1\.1\+0x0*0000031
0*0000160 GPRELLOW \.rodata\.str1\.1\+0x0*0000031
0*0000164 HINT memcmp
0*0000168 GPDISP \.text\+0x0*0000004
0*0000178 ELF_LITERAL strcpy
0*0000188 LITUSE \.text\+0x0*0000003
0*000017c GPRELHIGH \.bss
0*0000180 GPRELLOW \.bss
0*0000188 HINT strcpy
0*000018c GPDISP \.text\+0x0*0000004
RELOCATION RECORDS FOR \[\.init\.text\]:
OFFSET *TYPE *VALUE
0*0000000 GPDISP \.init\.text\+0x0*0000004
0*0000008 ELF_LITERAL simple_strtol
0*000001c LITUSE \.init\.text\+0x0*0000003
0*000001c HINT simple_strtol
0*0000020 GPDISP \.init\.text\+0x0*0000004
0*0000030 GPRELHIGH rd_doload
0*0000034 GPRELLOW rd_doload
0*0000050 GPDISP \.init\.text\+0x0*0000004
0*0000064 GPREL16 root_mountflags
0*0000070 GPREL16 root_mountflags
0*0000080 GPDISP \.init\.text\+0x0*0000004
0*0000094 GPREL16 root_mountflags
0*00000a0 GPREL16 root_mountflags
0*00000b0 GPDISP \.init\.text\+0x0*0000004
0*00000bc ELF_LITERAL sprintf
0*00000f0 LITUSE \.init\.text\+0x0*0000003
0*00000d0 GPRELHIGH \.rodata\.str1\.1
0*00000ec GPRELLOW \.rodata\.str1\.1
0*00000f0 HINT sprintf
0*00000f4 GPDISP \.init\.text\+0x0*0000004
0*0000108 ELF_LITERAL sys_open
0*000010c LITUSE \.init\.text\+0x0*0000003
0*000010c HINT sys_open
0*0000110 GPDISP \.init\.text\+0x0*0000008
0*0000120 ELF_LITERAL sys_read
0*0000134 LITUSE \.init\.text\+0x0*0000003
0*0000134 HINT sys_read
0*0000138 GPDISP \.init\.text\+0x0*0000004
0*0000148 ELF_LITERAL sys_close
0*000014c LITUSE \.init\.text\+0x0*0000003
0*000014c HINT sys_close
0*0000150 GPDISP \.init\.text\+0x0*000000c
0*00001a0 ELF_LITERAL simple_strtoul
0*00001b4 LITUSE \.init\.text\+0x0*0000003
0*00001b4 HINT simple_strtoul
0*00001b8 GPDISP \.init\.text\+0x0*0000008
0*00001d8 ELF_LITERAL sprintf
0*00001ec LITUSE \.init\.text\+0x0*0000003
0*00001dc GPRELHIGH \.rodata\.str1\.1\+0x0*0000012
0*00001e8 GPRELLOW \.rodata\.str1\.1\+0x0*0000012
0*00001ec HINT sprintf
0*00001f0 GPDISP \.init\.text\+0x0*0000004
0*0000204 ELF_LITERAL sys_open
0*0000208 LITUSE \.init\.text\+0x0*0000003
0*0000208 HINT sys_open
0*000020c GPDISP \.init\.text\+0x0*0000008
0*000021c ELF_LITERAL sys_read
0*000022c LITUSE \.init\.text\+0x0*0000003
0*000022c HINT sys_read
0*0000230 GPDISP \.init\.text\+0x0*0000004
0*0000240 ELF_LITERAL sys_close
0*0000244 LITUSE \.init\.text\+0x0*0000003
0*0000244 HINT sys_close
0*0000248 GPDISP \.init\.text\+0x0*000000c
0*0000274 ELF_LITERAL simple_strtoul
0*0000288 LITUSE \.init\.text\+0x0*0000003
0*0000288 HINT simple_strtoul
0*000028c GPDISP \.init\.text\+0x0*0000008
0*00002c0 GPDISP \.init\.text\+0x0*0000004
0*00002cc ELF_LITERAL sys_mkdir
0*00002fc LITUSE \.init\.text\+0x0*0000003
0*00002dc GPRELHIGH \.rodata\.str1\.1\+0x0*0000026
0*00002e0 GPRELLOW \.rodata\.str1\.1\+0x0*0000026
0*00002fc HINT sys_mkdir
0*0000300 GPDISP \.init\.text\+0x0*0000004
0*0000314 GPRELHIGH \.rodata\.str1\.1\+0x0*000002b
0*0000318 ELF_LITERAL sys_mount
0*0000324 LITUSE \.init\.text\+0x0*0000003
0*000031c GPRELLOW \.rodata\.str1\.1\+0x0*000002b
0*0000324 HINT sys_mount
0*0000328 GPDISP \.init\.text\+0x0*0000004
0*0000334 ELF_LITERAL memcmp
0*0000348 LITUSE \.init\.text\+0x0*0000003
0*0000338 GPRELHIGH \.rodata\.str1\.1\+0x0*0000031
0*0000344 GPRELLOW \.rodata\.str1\.1\+0x0*0000031
0*0000348 HINT memcmp
0*000034c GPDISP \.init\.text\+0x0*0000004
0*0000358 ELF_LITERAL memcmp
0*0000374 LITUSE \.init\.text\+0x0*0000003
0*0000360 GPRELHIGH \.rodata\.str1\.1\+0x0*0000037
0*0000370 GPRELLOW \.rodata\.str1\.1\+0x0*0000037
0*0000374 HINT memcmp
0*0000378 GPDISP \.init\.text\+0x0*0000004
0*0000384 ELF_LITERAL strlen
0*000038c LITUSE \.init\.text\+0x0*0000003
0*000038c HINT strlen
0*0000390 GPDISP \.init\.text\+0x0*0000008
0*00003a0 ELF_LITERAL strcpy
0*00003ac LITUSE \.init\.text\+0x0*0000003
0*00003ac HINT strcpy
0*00003b0 GPDISP \.init\.text\+0x0*000000c
0*0000418 ELF_LITERAL _ctype
0*0000480 ELF_LITERAL simple_strtoul
0*000048c LITUSE \.init\.text\+0x0*0000003
0*000048c HINT simple_strtoul
0*0000490 GPDISP \.init\.text\+0x0*000000c
0*00004cc ELF_LITERAL _ctype
0*00004f4 ELF_LITERAL sys_umount
0*0000500 LITUSE \.init\.text\+0x0*0000003
0*00004f8 GPRELLOW \.rodata\.str1\.1\+0x0*0000026
0*0000500 HINT sys_umount
0*0000504 GPDISP \.init\.text\+0x0*0000004
0*000050c ELF_LITERAL sys_rmdir
0*0000514 LITUSE \.init\.text\+0x0*0000003
0*0000510 GPRELLOW \.rodata\.str1\.1\+0x0*0000026
0*0000514 HINT sys_rmdir
0*0000518 GPDISP \.init\.text\+0x0*0000010
0*0000570 ELF_LITERAL simple_strtoul
0*0000580 LITUSE \.init\.text\+0x0*0000003
0*0000580 HINT simple_strtoul
0*0000584 GPDISP \.init\.text\+0x0*0000008
0*00005a0 GPDISP \.init\.text\+0x0*0000004
0*00005ac ELF_LITERAL strncpy
0*00005cc LITUSE \.init\.text\+0x0*0000003
0*00005c0 GPRELHIGH \.bss\+0x0*0000040
0*00005c4 GPRELLOW \.bss\+0x0*0000040
0*00005cc HINT strncpy
0*00005d0 GPDISP \.init\.text\+0x0*000000c
0*00005f0 GPDISP \.init\.text\+0x0*0000004
0*00005f8 GPRELHIGH \.init\.data\+0x0*0000040
0*0000600 GPRELLOW \.init\.data\+0x0*0000040
0*0000610 GPDISP \.init\.text\+0x0*0000004
0*0000618 GPRELHIGH \.init\.data\+0x0*0000048
0*0000620 GPRELLOW \.init\.data\+0x0*0000048
0*0000630 GPDISP \.init\.text\+0x0*0000004
0*0000638 GPRELHIGH \.init\.data\+0x0*0000048
0*0000640 GPRELLOW \.init\.data\+0x0*0000048
0*0000658 ELF_LITERAL strcpy
0*000065c LITUSE \.init\.text\+0x0*0000003
0*000065c HINT strcpy
0*0000660 GPDISP \.init\.text\+0x0*0000008
0*00006c8 ELF_LITERAL get_filesystem_list
0*00006cc LITUSE \.init\.text\+0x0*0000003
0*00006cc HINT get_filesystem_list
0*00006d0 GPDISP \.init\.text\+0x0*000000c
0*00006f0 ELF_LITERAL strchr
0*0000700 LITUSE \.init\.text\+0x0*0000003
0*0000700 HINT strchr
0*0000704 GPDISP \.init\.text\+0x0*0000008
0*0000750 GPDISP \.init\.text\+0x0*0000004
0*0000758 ELF_LITERAL names_cachep
0*0000760 ELF_LITERAL kmem_cache_alloc
0*0000794 LITUSE \.init\.text\+0x0*0000003
0*0000794 HINT kmem_cache_alloc
0*0000798 GPDISP \.init\.text\+0x0*0000004
0*00007b8 GPRELHIGH \.rodata\.str1\.1\+0x0*000003b
0*00007bc GPRELHIGH \.init\.data\+0x0*0000040
0*00007c0 ELF_LITERAL ROOT_DEV
0*00007c4 GPRELLOW \.rodata\.str1\.1\+0x0*000003b
0*00007c8 GPRELLOW \.init\.data\+0x0*0000040
0*00007cc ELF_LITERAL sys_mount
0*00007e0 LITUSE \.init\.text\+0x0*0000003
0*00007e0 HINT sys_mount
0*00007e4 GPDISP \.init\.text\+0x0*0000008
0*000080c ELF_LITERAL kdevname
0*0000814 LITUSE \.init\.text\+0x0*0000003
0*0000814 HINT kdevname
0*0000818 GPDISP \.init\.text\+0x0*0000004
0*0000824 ELF_LITERAL printk
0*0000838 LITUSE \.init\.text\+0x0*0000003
0*0000828 GPRELHIGH \.bss
0*000082c GPRELHIGH \.rodata\.str1\.1\+0x0*0000041
0*0000830 GPRELLOW \.bss
0*0000834 GPRELLOW \.rodata\.str1\.1\+0x0*0000041
0*0000838 HINT printk
0*000083c GPDISP \.init\.text\+0x0*0000004
0*0000844 ELF_LITERAL printk
0*0000850 LITUSE \.init\.text\+0x0*0000003
0*0000848 GPRELHIGH \.rodata\.str1\.1\+0x0*000006a
0*000084c GPRELLOW \.rodata\.str1\.1\+0x0*000006a
0*0000850 HINT printk
0*0000854 GPDISP \.init\.text\+0x0*0000004
0*0000860 ELF_LITERAL kdevname
0*0000868 LITUSE \.init\.text\+0x0*0000003
0*0000868 HINT kdevname
0*000086c GPDISP \.init\.text\+0x0*0000004
0*0000878 GPRELHIGH \.rodata\.str1\.1\+0x0*0000097
0*000087c GPRELLOW \.rodata\.str1\.1\+0x0*0000097
0*0000880 ELF_LITERAL panic
0*0000884 LITUSE \.init\.text\+0x0*0000003
0*0000884 HINT panic
0*0000890 ELF_LITERAL strlen
0*0000894 LITUSE \.init\.text\+0x0*0000003
0*0000894 HINT strlen
0*0000898 GPDISP \.init\.text\+0x0*0000008
0*00008b0 ELF_LITERAL ROOT_DEV
0*00008b4 ELF_LITERAL kdevname
0*00008c0 LITUSE \.init\.text\+0x0*0000003
0*00008c0 HINT kdevname
0*00008c4 GPDISP \.init\.text\+0x0*0000004
0*00008d4 ELF_LITERAL names_cachep
0*00008d8 ELF_LITERAL kmem_cache_free
0*00008e4 LITUSE \.init\.text\+0x0*0000003
0*00008e4 HINT kmem_cache_free
0*00008e8 GPDISP \.init\.text\+0x0*0000004
0*00008f4 ELF_LITERAL sys_chdir
0*00008f8 LITUSE \.init\.text\+0x0*0000003
0*00008f8 HINT sys_chdir
0*00008fc GPDISP \.init\.text\+0x0*0000008
0*0000908 GPRELHIGH \.rodata\.str1\.1\+0x0*00000ba
0*000090c GPRELLOW \.rodata\.str1\.1\+0x0*00000ba
0*0000918 ELF_LITERAL ROOT_DEV
0*0000938 GPRELHIGH \.rodata\.str1\.1\+0x0*00000c4
0*000093c GPRELLOW \.rodata\.str1\.1\+0x0*00000c4
0*0000940 ELF_LITERAL printk
0*000094c LITUSE \.init\.text\+0x0*0000003
0*0000944 GPRELHIGH \.rodata\.str1\.1\+0x0*00000c5
0*0000948 GPRELLOW \.rodata\.str1\.1\+0x0*00000c5
0*000094c HINT printk
0*0000950 GPDISP \.init\.text\+0x0*000000c
0*0000990 GPDISP \.init\.text\+0x0*0000004
0*0000998 ELF_LITERAL sys_unlink
0*00009b4 LITUSE \.init\.text\+0x0*0000003
0*00009b4 HINT sys_unlink
0*00009b8 GPDISP \.init\.text\+0x0*0000004
0*00009cc GPREL16 \.sbss
0*00009f0 ELF_LITERAL sys_mknod
0*00009f4 LITUSE \.init\.text\+0x0*0000003
0*00009f4 HINT sys_mknod
0*00009f8 GPDISP \.init\.text\+0x0*0000004
0*0000a20 GPDISP \.init\.text\+0x0*0000004
0*0000a28 GPRELHIGH \.rodata\.str1\.1\+0x0*00000eb
0*0000a2c GPRELLOW \.rodata\.str1\.1\+0x0*00000eb
0*0000a40 GPDISP \.init\.text\+0x0*0000004
0*0000a48 ELF_LITERAL ROOT_DEV
0*0000a50 GPRELHIGH \.bss
0*0000a58 GPRELLOW \.bss
0*0000a60 GPRELHIGH \.rodata\.str1\.1\+0x0*00000eb
0*0000a64 GPRELLOW \.rodata\.str1\.1\+0x0*00000eb
0*0000a7c GPREL16 root_mountflags
0*0000aa0 GPDISP \.init\.text\+0x0*0000004
0*0000aa8 GPRELHIGH \.rodata\.str1\.1\+0x0*00000f5
0*0000aac GPRELLOW \.rodata\.str1\.1\+0x0*00000f5
RELOCATION RECORDS FOR \[\.init\.setup\]:
OFFSET *TYPE *VALUE
0*0000000 REFQUAD \.init\.data\+0x0*0000004
0*0000008 REFQUAD \.init\.text
0*0000010 REFQUAD \.init\.data\+0x0*0000012
0*0000018 REFQUAD \.init\.text\+0x0*0000050
0*0000020 REFQUAD \.init\.data\+0x0*0000015
0*0000028 REFQUAD \.init\.text\+0x0*0000080
0*0000030 REFQUAD \.init\.data\+0x0*0000018
0*0000038 REFQUAD \.init\.text\+0x0*00005a0
0*0000040 REFQUAD \.init\.data\+0x0*000001e
0*0000048 REFQUAD \.init\.text\+0x0*00005f0
0*0000050 REFQUAD \.init\.data\+0x0*0000029
0*0000058 REFQUAD \.init\.text\+0x0*0000610

File diff suppressed because it is too large Load Diff