Line 180... |
Line 180... |
#ifndef I386COFF
|
#ifndef I386COFF
|
static void s_bss (int);
|
static void s_bss (int);
|
#endif
|
#endif
|
#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
|
#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
|
static void handle_large_common (int small ATTRIBUTE_UNUSED);
|
static void handle_large_common (int small ATTRIBUTE_UNUSED);
|
static void handle_quad (int);
|
|
#endif
|
#endif
|
|
|
static const char *default_arch = DEFAULT_ARCH;
|
static const char *default_arch = DEFAULT_ARCH;
|
|
|
/* VEX prefix. */
|
/* VEX prefix. */
|
Line 631... |
Line 630... |
CPU_CORE2_FLAGS, 0, 0 },
|
CPU_CORE2_FLAGS, 0, 0 },
|
{ STRING_COMMA_LEN ("corei7"), PROCESSOR_COREI7,
|
{ STRING_COMMA_LEN ("corei7"), PROCESSOR_COREI7,
|
CPU_COREI7_FLAGS, 0, 0 },
|
CPU_COREI7_FLAGS, 0, 0 },
|
{ STRING_COMMA_LEN ("l1om"), PROCESSOR_L1OM,
|
{ STRING_COMMA_LEN ("l1om"), PROCESSOR_L1OM,
|
CPU_L1OM_FLAGS, 0, 0 },
|
CPU_L1OM_FLAGS, 0, 0 },
|
|
{ STRING_COMMA_LEN ("k1om"), PROCESSOR_K1OM,
|
|
CPU_K1OM_FLAGS, 0, 0 },
|
{ STRING_COMMA_LEN ("k6"), PROCESSOR_K6,
|
{ STRING_COMMA_LEN ("k6"), PROCESSOR_K6,
|
CPU_K6_FLAGS, 0, 0 },
|
CPU_K6_FLAGS, 0, 0 },
|
{ STRING_COMMA_LEN ("k6_2"), PROCESSOR_K6,
|
{ STRING_COMMA_LEN ("k6_2"), PROCESSOR_K6,
|
CPU_K6_2_FLAGS, 0, 0 },
|
CPU_K6_2_FLAGS, 0, 0 },
|
{ STRING_COMMA_LEN ("athlon"), PROCESSOR_ATHLON,
|
{ STRING_COMMA_LEN ("athlon"), PROCESSOR_ATHLON,
|
Line 824... |
Line 825... |
{"allow_index_reg", set_allow_index_reg, 1},
|
{"allow_index_reg", set_allow_index_reg, 1},
|
{"disallow_index_reg", set_allow_index_reg, 0},
|
{"disallow_index_reg", set_allow_index_reg, 0},
|
{"sse_check", set_sse_check, 0},
|
{"sse_check", set_sse_check, 0},
|
#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
|
#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
|
{"largecomm", handle_large_common, 0},
|
{"largecomm", handle_large_common, 0},
|
{"quad", handle_quad, 8},
|
|
#else
|
#else
|
{"file", (void (*) (int)) dwarf2_directive_file, 0},
|
{"file", (void (*) (int)) dwarf2_directive_file, 0},
|
{"loc", dwarf2_directive_loc, 0},
|
{"loc", dwarf2_directive_loc, 0},
|
{"loc_mark_labels", dwarf2_directive_loc_mark_labels, 0},
|
{"loc_mark_labels", dwarf2_directive_loc_mark_labels, 0},
|
#endif
|
#endif
|
Line 1079... |
Line 1079... |
case PROCESSOR_NOCONA:
|
case PROCESSOR_NOCONA:
|
case PROCESSOR_CORE:
|
case PROCESSOR_CORE:
|
case PROCESSOR_CORE2:
|
case PROCESSOR_CORE2:
|
case PROCESSOR_COREI7:
|
case PROCESSOR_COREI7:
|
case PROCESSOR_L1OM:
|
case PROCESSOR_L1OM:
|
|
case PROCESSOR_K1OM:
|
case PROCESSOR_GENERIC64:
|
case PROCESSOR_GENERIC64:
|
patt = alt_long_patt;
|
patt = alt_long_patt;
|
break;
|
break;
|
case PROCESSOR_K6:
|
case PROCESSOR_K6:
|
case PROCESSOR_ATHLON:
|
case PROCESSOR_ATHLON:
|
Line 1131... |
Line 1132... |
case PROCESSOR_NOCONA:
|
case PROCESSOR_NOCONA:
|
case PROCESSOR_CORE:
|
case PROCESSOR_CORE:
|
case PROCESSOR_CORE2:
|
case PROCESSOR_CORE2:
|
case PROCESSOR_COREI7:
|
case PROCESSOR_COREI7:
|
case PROCESSOR_L1OM:
|
case PROCESSOR_L1OM:
|
|
case PROCESSOR_K1OM:
|
if (fragP->tc_frag_data.isa_flags.bitfield.cpunop)
|
if (fragP->tc_frag_data.isa_flags.bitfield.cpunop)
|
patt = alt_long_patt;
|
patt = alt_long_patt;
|
else
|
else
|
patt = f32_patt;
|
patt = f32_patt;
|
break;
|
break;
|
Line 2123... |
Line 2125... |
/* If we are targeting Intel L1OM, we must enable it. */
|
/* If we are targeting Intel L1OM, we must enable it. */
|
if (get_elf_backend_data (stdoutput)->elf_machine_code != EM_L1OM
|
if (get_elf_backend_data (stdoutput)->elf_machine_code != EM_L1OM
|
|| new_flag.bitfield.cpul1om)
|
|| new_flag.bitfield.cpul1om)
|
return;
|
return;
|
|
|
|
/* If we are targeting Intel K1OM, we must enable it. */
|
|
if (get_elf_backend_data (stdoutput)->elf_machine_code != EM_K1OM
|
|
|| new_flag.bitfield.cpuk1om)
|
|
return;
|
|
|
as_bad (_("`%s' is not supported on `%s'"), name, arch);
|
as_bad (_("`%s' is not supported on `%s'"), name, arch);
|
#endif
|
#endif
|
}
|
}
|
|
|
static void
|
static void
|
Line 2234... |
Line 2241... |
if (OUTPUT_FLAVOR != bfd_target_elf_flavour
|
if (OUTPUT_FLAVOR != bfd_target_elf_flavour
|
|| flag_code != CODE_64BIT)
|
|| flag_code != CODE_64BIT)
|
as_fatal (_("Intel L1OM is 64bit ELF only"));
|
as_fatal (_("Intel L1OM is 64bit ELF only"));
|
return bfd_arch_l1om;
|
return bfd_arch_l1om;
|
}
|
}
|
|
else if (cpu_arch_isa == PROCESSOR_K1OM)
|
|
{
|
|
if (OUTPUT_FLAVOR != bfd_target_elf_flavour
|
|
|| flag_code != CODE_64BIT)
|
|
as_fatal (_("Intel K1OM is 64bit ELF only"));
|
|
return bfd_arch_k1om;
|
|
}
|
else
|
else
|
return bfd_arch_i386;
|
return bfd_arch_i386;
|
}
|
}
|
|
|
unsigned long
|
unsigned long
|
i386_mach ()
|
i386_mach (void)
|
{
|
{
|
if (!strncmp (default_arch, "x86_64", 6))
|
if (!strncmp (default_arch, "x86_64", 6))
|
{
|
{
|
if (cpu_arch_isa == PROCESSOR_L1OM)
|
if (cpu_arch_isa == PROCESSOR_L1OM)
|
{
|
{
|
if (OUTPUT_FLAVOR != bfd_target_elf_flavour
|
if (OUTPUT_FLAVOR != bfd_target_elf_flavour
|
|| default_arch[6] != '\0')
|
|| default_arch[6] != '\0')
|
as_fatal (_("Intel L1OM is 64bit ELF only"));
|
as_fatal (_("Intel L1OM is 64bit ELF only"));
|
return bfd_mach_l1om;
|
return bfd_mach_l1om;
|
}
|
}
|
|
else if (cpu_arch_isa == PROCESSOR_K1OM)
|
|
{
|
|
if (OUTPUT_FLAVOR != bfd_target_elf_flavour
|
|
|| default_arch[6] != '\0')
|
|
as_fatal (_("Intel K1OM is 64bit ELF only"));
|
|
return bfd_mach_k1om;
|
|
}
|
else if (default_arch[6] == '\0')
|
else if (default_arch[6] == '\0')
|
return bfd_mach_x86_64;
|
return bfd_mach_x86_64;
|
else
|
else
|
return bfd_mach_x64_32;
|
return bfd_mach_x64_32;
|
}
|
}
|
Line 2262... |
Line 2283... |
else
|
else
|
as_fatal (_("unknown architecture"));
|
as_fatal (_("unknown architecture"));
|
}
|
}
|
|
|
void
|
void
|
md_begin ()
|
md_begin (void)
|
{
|
{
|
const char *hash_err;
|
const char *hash_err;
|
|
|
/* Initialize op_hash hash table. */
|
/* Initialize op_hash hash table. */
|
op_hash = hash_new ();
|
op_hash = hash_new ();
|
Line 6718... |
Line 6739... |
cons_sign = -1;
|
cons_sign = -1;
|
}
|
}
|
|
|
#ifdef TE_PE
|
#ifdef TE_PE
|
static void
|
static void
|
pe_directive_secrel (dummy)
|
pe_directive_secrel (int dummy ATTRIBUTE_UNUSED)
|
int dummy ATTRIBUTE_UNUSED;
|
|
{
|
{
|
expressionS exp;
|
expressionS exp;
|
|
|
do
|
do
|
{
|
{
|
Line 7611... |
Line 7631... |
The guess is actually the growth beyond the fixed part. Whatever
|
The guess is actually the growth beyond the fixed part. Whatever
|
we do to grow the fixed or variable part contributes to our
|
we do to grow the fixed or variable part contributes to our
|
returned value. */
|
returned value. */
|
|
|
int
|
int
|
md_estimate_size_before_relax (fragP, segment)
|
md_estimate_size_before_relax (fragS *fragP, segT segment)
|
fragS *fragP;
|
|
segT segment;
|
|
{
|
{
|
/* We've already got fragP->fr_subtype right; all we have to do is
|
/* We've already got fragP->fr_subtype right; all we have to do is
|
check for un-relaxable symbols. On an ELF system, we can't relax
|
check for un-relaxable symbols. On an ELF system, we can't relax
|
an externally visible symbol, because it may be overridden by a
|
an externally visible symbol, because it may be overridden by a
|
shared library. */
|
shared library. */
|
Line 7736... |
Line 7754... |
|
|
Out: Any fixSs and constants are set up.
|
Out: Any fixSs and constants are set up.
|
Caller will turn frag into a ".space 0". */
|
Caller will turn frag into a ".space 0". */
|
|
|
void
|
void
|
md_convert_frag (abfd, sec, fragP)
|
md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED,
|
bfd *abfd ATTRIBUTE_UNUSED;
|
fragS *fragP)
|
segT sec ATTRIBUTE_UNUSED;
|
|
fragS *fragP;
|
|
{
|
{
|
unsigned char *opcode;
|
unsigned char *opcode;
|
unsigned char *where_to_put_displacement = NULL;
|
unsigned char *where_to_put_displacement = NULL;
|
offsetT target_address;
|
offsetT target_address;
|
offsetT opcode_address;
|
offsetT opcode_address;
|
Line 7836... |
Line 7852... |
(valueT) (displacement_from_opcode_start - extension),
|
(valueT) (displacement_from_opcode_start - extension),
|
DISP_SIZE_FROM_RELAX_STATE (fragP->fr_subtype));
|
DISP_SIZE_FROM_RELAX_STATE (fragP->fr_subtype));
|
fragP->fr_fix += extension;
|
fragP->fr_fix += extension;
|
}
|
}
|
|
|
/* Apply a fixup (fixS) to segment data, once it has been determined
|
/* Apply a fixup (fixP) to segment data, once it has been determined
|
by our caller that we have all the info we need to fix it up.
|
by our caller that we have all the info we need to fix it up.
|
|
|
|
Parameter valP is the pointer to the value of the bits.
|
|
|
On the 386, immediates, displacements, and data pointers are all in
|
On the 386, immediates, displacements, and data pointers are all in
|
the same (little-endian) format, so we don't need to care about which
|
the same (little-endian) format, so we don't need to care about which
|
we are handling. */
|
we are handling. */
|
|
|
void
|
void
|
md_apply_fix (fixP, valP, seg)
|
md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
|
/* The fix we're to put in. */
|
|
fixS *fixP;
|
|
/* Pointer to the value of the bits. */
|
|
valueT *valP;
|
|
/* Segment fix is from. */
|
|
segT seg ATTRIBUTE_UNUSED;
|
|
{
|
{
|
char *p = fixP->fx_where + fixP->fx_frag->fr_literal;
|
char *p = fixP->fx_where + fixP->fx_frag->fr_literal;
|
valueT value = *valP;
|
valueT value = *valP;
|
|
|
#if !defined (TE_Mach)
|
#if !defined (TE_Mach)
|
Line 8747... |
Line 8759... |
{
|
{
|
if (x86_elf_abi != X86_64_ABI)
|
if (x86_elf_abi != X86_64_ABI)
|
as_fatal (_("Intel L1OM is 64bit only"));
|
as_fatal (_("Intel L1OM is 64bit only"));
|
return ELF_TARGET_L1OM_FORMAT;
|
return ELF_TARGET_L1OM_FORMAT;
|
}
|
}
|
|
if (cpu_arch_isa == PROCESSOR_K1OM)
|
|
{
|
|
if (x86_elf_abi != X86_64_ABI)
|
|
as_fatal (_("Intel K1OM is 64bit only"));
|
|
return ELF_TARGET_K1OM_FORMAT;
|
|
}
|
else
|
else
|
return format;
|
return format;
|
}
|
}
|
#endif
|
#endif
|
#if defined (OBJ_MACH_O)
|
#if defined (OBJ_MACH_O)
|
Line 8806... |
Line 8824... |
}
|
}
|
}
|
}
|
#endif
|
#endif
|
|
|
symbolS *
|
symbolS *
|
md_undefined_symbol (name)
|
md_undefined_symbol (char *name)
|
char *name;
|
|
{
|
{
|
if (name[0] == GLOBAL_OFFSET_TABLE_NAME[0]
|
if (name[0] == GLOBAL_OFFSET_TABLE_NAME[0]
|
&& name[1] == GLOBAL_OFFSET_TABLE_NAME[1]
|
&& name[1] == GLOBAL_OFFSET_TABLE_NAME[1]
|
&& name[2] == GLOBAL_OFFSET_TABLE_NAME[2]
|
&& name[2] == GLOBAL_OFFSET_TABLE_NAME[2]
|
&& strcmp (name, GLOBAL_OFFSET_TABLE_NAME) == 0)
|
&& strcmp (name, GLOBAL_OFFSET_TABLE_NAME) == 0)
|
Line 8829... |
Line 8846... |
}
|
}
|
|
|
/* Round up a section size to the appropriate boundary. */
|
/* Round up a section size to the appropriate boundary. */
|
|
|
valueT
|
valueT
|
md_section_align (segment, size)
|
md_section_align (segT segment ATTRIBUTE_UNUSED, valueT size)
|
segT segment ATTRIBUTE_UNUSED;
|
|
valueT size;
|
|
{
|
{
|
#if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT))
|
#if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT))
|
if (OUTPUT_FLAVOR == bfd_target_aout_flavour)
|
if (OUTPUT_FLAVOR == bfd_target_aout_flavour)
|
{
|
{
|
/* For a.out, force the section size to be aligned. If we don't do
|
/* For a.out, force the section size to be aligned. If we don't do
|
Line 8902... |
Line 8917... |
fixp->fx_subsy = 0;
|
fixp->fx_subsy = 0;
|
}
|
}
|
}
|
}
|
|
|
arelent *
|
arelent *
|
tc_gen_reloc (section, fixp)
|
tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp)
|
asection *section ATTRIBUTE_UNUSED;
|
|
fixS *fixp;
|
|
{
|
{
|
arelent *rel;
|
arelent *rel;
|
bfd_reloc_code_real_type code;
|
bfd_reloc_code_real_type code;
|
|
|
switch (fixp->fx_r_type)
|
switch (fixp->fx_r_type)
|
Line 9042... |
Line 9055... |
else
|
else
|
{
|
{
|
if (disallow_64bit_reloc)
|
if (disallow_64bit_reloc)
|
switch (code)
|
switch (code)
|
{
|
{
|
case BFD_RELOC_64:
|
|
case BFD_RELOC_X86_64_DTPOFF64:
|
case BFD_RELOC_X86_64_DTPOFF64:
|
case BFD_RELOC_X86_64_TPOFF64:
|
case BFD_RELOC_X86_64_TPOFF64:
|
case BFD_RELOC_64_PCREL:
|
case BFD_RELOC_64_PCREL:
|
case BFD_RELOC_X86_64_GOTOFF64:
|
case BFD_RELOC_X86_64_GOTOFF64:
|
case BFD_RELOC_X86_64_GOT64:
|
case BFD_RELOC_X86_64_GOT64:
|
Line 9152... |
Line 9164... |
cfi_add_CFA_def_cfa (sp_regno[flag_code >> 1], -x86_cie_data_alignment);
|
cfi_add_CFA_def_cfa (sp_regno[flag_code >> 1], -x86_cie_data_alignment);
|
cfi_add_CFA_offset (x86_dwarf2_return_column, x86_cie_data_alignment);
|
cfi_add_CFA_offset (x86_dwarf2_return_column, x86_cie_data_alignment);
|
}
|
}
|
|
|
int
|
int
|
|
x86_dwarf2_addr_size (void)
|
|
{
|
|
#if defined (OBJ_MAYBE_ELF) || defined (OBJ_ELF)
|
|
if (x86_elf_abi == X86_64_X32_ABI)
|
|
return 4;
|
|
#endif
|
|
return bfd_arch_bits_per_address (stdoutput) / 8;
|
|
}
|
|
|
|
int
|
i386_elf_section_type (const char *str, size_t len)
|
i386_elf_section_type (const char *str, size_t len)
|
{
|
{
|
if (flag_code == CODE_64BIT
|
if (flag_code == CODE_64BIT
|
&& len == sizeof ("unwind") - 1
|
&& len == sizeof ("unwind") - 1
|
&& strncmp (str, "unwind", 6) == 0)
|
&& strncmp (str, "unwind", 6) == 0)
|
Line 9250... |
Line 9272... |
|
|
elf_com_section_ptr = saved_com_section_ptr;
|
elf_com_section_ptr = saved_com_section_ptr;
|
bss_section = saved_bss_section;
|
bss_section = saved_bss_section;
|
}
|
}
|
}
|
}
|
|
|
static void
|
|
handle_quad (int nbytes)
|
|
{
|
|
expressionS exp;
|
|
|
|
if (x86_elf_abi != X86_64_X32_ABI)
|
|
{
|
|
cons (nbytes);
|
|
return;
|
|
}
|
|
|
|
if (is_it_end_of_statement ())
|
|
{
|
|
demand_empty_rest_of_line ();
|
|
return;
|
|
}
|
|
|
|
do
|
|
{
|
|
if (*input_line_pointer == '"')
|
|
{
|
|
as_bad (_("unexpected `\"' in expression"));
|
|
ignore_rest_of_line ();
|
|
return;
|
|
}
|
|
x86_cons (&exp, nbytes);
|
|
/* Output 4 bytes if not constant. */
|
|
if (exp.X_op != O_constant)
|
|
nbytes = 4;
|
|
emit_expr (&exp, (unsigned int) nbytes);
|
|
/* Zero-extends to 8 bytes if not constant. */
|
|
if (nbytes == 4)
|
|
{
|
|
memset (&exp, '\0', sizeof (exp));
|
|
exp.X_op = O_constant;
|
|
emit_expr (&exp, nbytes);
|
|
}
|
|
nbytes = 8;
|
|
}
|
|
while (*input_line_pointer++ == ',');
|
|
|
|
input_line_pointer--; /* Put terminator back into stream. */
|
|
|
|
demand_empty_rest_of_line ();
|
|
}
|
|
#endif /* OBJ_ELF || OBJ_MAYBE_ELF */
|
#endif /* OBJ_ELF || OBJ_MAYBE_ELF */
|
|
|
No newline at end of file
|
No newline at end of file
|