mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-18 13:23:10 +08:00
bfd/
* config.bfd: Include 64-bit support for i[3-7]86-*-solaris2*. * elf64-x86-64.c (elf64_x86_64_section_from_shdr): New function. (elf_backend_section_from_shdr): Define. binutils/ * readelf.c (get_x86_64_section_type_name): New function. (get_section_type_name): Use it. gas/ * config/tc-i386.c: Include "elf/x86-64.h". (i386_elf_section_type): New function. * config/tc-i386.h (md_elf_section_type): Define. (i386_elf_section_type): New prototype. gas/testsuite/ * gas/i386/i386.exp: Don't run divide test for targets where '/' is a comment. Run x86-64-unwind for 64-bit ELF targets. * gas/i386/x86-64-unwind.d, gas/i386/x86-64-unwind.s: New. include/ * elf/common.h (PT_SUNW_EH_FRAME): Define. * elf/x86-64.h (SHT_X86_64_UNWIND): Define. ld/ * configure.tgt: Include elf_x86_64 for i[3-7]86-*-solaris2*.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2004-10-08 Daniel Jacobowitz <dan@debian.org>
|
||||||
|
|
||||||
|
* config.bfd: Include 64-bit support for i[3-7]86-*-solaris2*.
|
||||||
|
* elf64-x86-64.c (elf64_x86_64_section_from_shdr): New function.
|
||||||
|
(elf_backend_section_from_shdr): Define.
|
||||||
|
|
||||||
2004-10-08 Alan Modra <amodra@bigpond.net.au>
|
2004-10-08 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
* syms.c (bfd_is_local_label): Return false for file symbols.
|
* syms.c (bfd_is_local_label): Return false for file symbols.
|
||||||
|
@ -424,12 +424,18 @@ case "${targ}" in
|
|||||||
targ_defvec=i386coff_vec
|
targ_defvec=i386coff_vec
|
||||||
targ_selvecs=bfd_elf32_i386_vec
|
targ_selvecs=bfd_elf32_i386_vec
|
||||||
;;
|
;;
|
||||||
i[3-7]86-*-sysv4* | i[3-7]86-*-unixware* | i[3-7]86-*-solaris2* | \
|
i[3-7]86-*-sysv4* | i[3-7]86-*-unixware* | \
|
||||||
i[3-7]86-*-elf | i[3-7]86-*-sco3.2v5* | \
|
i[3-7]86-*-elf | i[3-7]86-*-sco3.2v5* | \
|
||||||
i[3-7]86-*-dgux* | i[3-7]86-*-sysv5*)
|
i[3-7]86-*-dgux* | i[3-7]86-*-sysv5*)
|
||||||
targ_defvec=bfd_elf32_i386_vec
|
targ_defvec=bfd_elf32_i386_vec
|
||||||
targ_selvecs=i386coff_vec
|
targ_selvecs=i386coff_vec
|
||||||
;;
|
;;
|
||||||
|
i[3-7]86-*-solaris2*)
|
||||||
|
targ_defvec=bfd_elf32_i386_vec
|
||||||
|
targ_selvecs=i386coff_vec
|
||||||
|
targ64_selvecs=bfd_elf64_x86_64_vec
|
||||||
|
want64=true
|
||||||
|
;;
|
||||||
i[3-7]86-*-kaos*)
|
i[3-7]86-*-kaos*)
|
||||||
targ_defvec=bfd_elf32_i386_vec
|
targ_defvec=bfd_elf32_i386_vec
|
||||||
targ_selvecs=bfd_elf32_i386_vec
|
targ_selvecs=bfd_elf32_i386_vec
|
||||||
|
@ -2782,6 +2782,21 @@ elf64_x86_64_plt_sym_val (bfd_vma i, const asection *plt,
|
|||||||
return plt->vma + (i + 1) * PLT_ENTRY_SIZE;
|
return plt->vma + (i + 1) * PLT_ENTRY_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Handle an x86-64 specific section when reading an object file. This
|
||||||
|
is called when elfcode.h finds a section with an unknown type. */
|
||||||
|
|
||||||
|
static bfd_boolean
|
||||||
|
elf64_x86_64_section_from_shdr (bfd *abfd, Elf_Internal_Shdr *hdr, const char *name)
|
||||||
|
{
|
||||||
|
if (hdr->sh_type != SHT_X86_64_UNWIND)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
#define TARGET_LITTLE_SYM bfd_elf64_x86_64_vec
|
#define TARGET_LITTLE_SYM bfd_elf64_x86_64_vec
|
||||||
#define TARGET_LITTLE_NAME "elf64-x86-64"
|
#define TARGET_LITTLE_NAME "elf64-x86-64"
|
||||||
#define ELF_ARCH bfd_arch_i386
|
#define ELF_ARCH bfd_arch_i386
|
||||||
@ -2819,4 +2834,7 @@ elf64_x86_64_plt_sym_val (bfd_vma i, const asection *plt,
|
|||||||
#define elf_backend_object_p elf64_x86_64_elf_object_p
|
#define elf_backend_object_p elf64_x86_64_elf_object_p
|
||||||
#define bfd_elf64_mkobject elf64_x86_64_mkobject
|
#define bfd_elf64_mkobject elf64_x86_64_mkobject
|
||||||
|
|
||||||
|
#define elf_backend_section_from_shdr \
|
||||||
|
elf64_x86_64_section_from_shdr
|
||||||
|
|
||||||
#include "elf64-target.h"
|
#include "elf64-target.h"
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2004-10-08 Daniel Jacobowitz <dan@debian.org>
|
||||||
|
|
||||||
|
* readelf.c (get_x86_64_section_type_name): New function.
|
||||||
|
(get_section_type_name): Use it.
|
||||||
|
|
||||||
2004-10-08 Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com>
|
2004-10-08 Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com>
|
||||||
|
|
||||||
* dlltool.c (make_one_lib_file): Revert 2004-09-02 and 2004-09-04
|
* dlltool.c (make_one_lib_file): Revert 2004-09-02 and 2004-09-04
|
||||||
|
@ -2404,6 +2404,18 @@ get_ia64_section_type_name (unsigned int sh_type)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char *
|
||||||
|
get_x86_64_section_type_name (unsigned int sh_type)
|
||||||
|
{
|
||||||
|
switch (sh_type)
|
||||||
|
{
|
||||||
|
case SHT_X86_64_UNWIND: return "X86_64_UNWIND";
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
get_arm_section_type_name (unsigned int sh_type)
|
get_arm_section_type_name (unsigned int sh_type)
|
||||||
{
|
{
|
||||||
@ -2467,6 +2479,9 @@ get_section_type_name (unsigned int sh_type)
|
|||||||
case EM_IA_64:
|
case EM_IA_64:
|
||||||
result = get_ia64_section_type_name (sh_type);
|
result = get_ia64_section_type_name (sh_type);
|
||||||
break;
|
break;
|
||||||
|
case EM_X86_64:
|
||||||
|
result = get_x86_64_section_type_name (sh_type);
|
||||||
|
break;
|
||||||
case EM_ARM:
|
case EM_ARM:
|
||||||
result = get_arm_section_type_name (sh_type);
|
result = get_arm_section_type_name (sh_type);
|
||||||
break;
|
break;
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2004-10-08 Daniel Jacobowitz <dan@debian.org>
|
||||||
|
|
||||||
|
* config/tc-i386.c: Include "elf/x86-64.h".
|
||||||
|
(i386_elf_section_type): New function.
|
||||||
|
* config/tc-i386.h (md_elf_section_type): Define.
|
||||||
|
(i386_elf_section_type): New prototype.
|
||||||
|
|
||||||
2004-10-08 Linus Nielsen Feltzing <linus@haxx.se>
|
2004-10-08 Linus Nielsen Feltzing <linus@haxx.se>
|
||||||
|
|
||||||
* config/m68k-parse.h (enum m68k_register): New control register,
|
* config/m68k-parse.h (enum m68k_register): New control register,
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "dwarf2dbg.h"
|
#include "dwarf2dbg.h"
|
||||||
#include "dw2gencfi.h"
|
#include "dw2gencfi.h"
|
||||||
#include "opcode/i386.h"
|
#include "opcode/i386.h"
|
||||||
|
#include "elf/x86-64.h"
|
||||||
|
|
||||||
#ifndef REGISTER_WARNINGS
|
#ifndef REGISTER_WARNINGS
|
||||||
#define REGISTER_WARNINGS 1
|
#define REGISTER_WARNINGS 1
|
||||||
@ -6348,3 +6349,14 @@ tc_x86_frame_initial_instructions (void)
|
|||||||
cfi_add_CFA_def_cfa (sp_regno, -x86_cie_data_alignment);
|
cfi_add_CFA_def_cfa (sp_regno, -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
|
||||||
|
i386_elf_section_type (const char *str, size_t len)
|
||||||
|
{
|
||||||
|
if (flag_code == CODE_64BIT
|
||||||
|
&& len == sizeof ("unwind") - 1
|
||||||
|
&& strncmp (str, "unwind", 6) == 0)
|
||||||
|
return SHT_X86_64_UNWIND;
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
@ -502,4 +502,7 @@ extern int tc_x86_regname_to_dw2regnum PARAMS ((const char *regname));
|
|||||||
#define tc_cfi_frame_initial_instructions tc_x86_frame_initial_instructions
|
#define tc_cfi_frame_initial_instructions tc_x86_frame_initial_instructions
|
||||||
extern void tc_x86_frame_initial_instructions PARAMS ((void));
|
extern void tc_x86_frame_initial_instructions PARAMS ((void));
|
||||||
|
|
||||||
|
#define md_elf_section_type(str,len) i386_elf_section_type (str, len)
|
||||||
|
extern int i386_elf_section_type PARAMS ((const char *, size_t len));
|
||||||
|
|
||||||
#endif /* TC_I386 */
|
#endif /* TC_I386 */
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2004-10-08 Daniel Jacobowitz <dan@debian.org>
|
||||||
|
|
||||||
|
* gas/i386/i386.exp: Don't run divide test for targets where '/'
|
||||||
|
is a comment. Run x86-64-unwind for 64-bit ELF targets.
|
||||||
|
* gas/i386/x86-64-unwind.d, gas/i386/x86-64-unwind.s: New.
|
||||||
|
|
||||||
2004-10-08 Alan Modra <amodra@bigpond.net.au>
|
2004-10-08 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
* gas/cfi/cfi-common-4.d: Correct for 64 bit targets.
|
* gas/cfi/cfi-common-4.d: Correct for 64 bit targets.
|
||||||
|
@ -55,7 +55,17 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]]
|
|||||||
run_dump_test "sse2"
|
run_dump_test "sse2"
|
||||||
run_dump_test "sub"
|
run_dump_test "sub"
|
||||||
run_dump_test "prescott"
|
run_dump_test "prescott"
|
||||||
run_dump_test "divide"
|
|
||||||
|
if {![istarget "*-*-aix*"]
|
||||||
|
&& (![is_elf_format] || [istarget "*-*-linux*"]
|
||||||
|
|| [istarget "*-*-netbsd*"]
|
||||||
|
|| [istarget "*-*-freebsd*"]
|
||||||
|
|| [istarget "*-*-netware*"])} {
|
||||||
|
# Don't run this test on targets where '/' starts comments.
|
||||||
|
run_dump_test "divide"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
run_dump_test "padlock"
|
run_dump_test "padlock"
|
||||||
|
|
||||||
# These tests require support for 8 and 16 bit relocs,
|
# These tests require support for 8 and 16 bit relocs,
|
||||||
@ -107,5 +117,13 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t
|
|||||||
run_dump_test "x86-64-rip"
|
run_dump_test "x86-64-rip"
|
||||||
run_list_test "x86-64-inval" "-al"
|
run_list_test "x86-64-inval" "-al"
|
||||||
|
|
||||||
|
# For ELF targets verify that @unwind works.
|
||||||
|
if { ([istarget "*-*-elf*"] || [istarget "*-*-linux*"]
|
||||||
|
|| [istarget "*-*-solaris2.*"])
|
||||||
|
&& ![istarget *-*-linux*aout*]
|
||||||
|
&& ![istarget *-*-linux*oldld*] } then {
|
||||||
|
run_dump_test "x86-64-unwind"
|
||||||
|
}
|
||||||
|
|
||||||
set ASFLAGS "$old_ASFLAGS"
|
set ASFLAGS "$old_ASFLAGS"
|
||||||
}
|
}
|
||||||
|
28
gas/testsuite/gas/i386/x86-64-unwind.d
Normal file
28
gas/testsuite/gas/i386/x86-64-unwind.d
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#readelf: -S
|
||||||
|
#name: x86-64 unwind
|
||||||
|
|
||||||
|
There are 8 section headers, starting at offset 0x80:
|
||||||
|
|
||||||
|
Section Headers:
|
||||||
|
\[Nr\] Name Type Address Offset
|
||||||
|
Size EntSize Flags Link Info Align
|
||||||
|
\[ 0\] NULL 0000000000000000 00000000
|
||||||
|
0000000000000000 0000000000000000 0 0 0
|
||||||
|
\[ 1\] \.text PROGBITS 0000000000000000 00000040
|
||||||
|
0000000000000000 0000000000000000 AX 0 0 4
|
||||||
|
\[ 2\] \.data PROGBITS 0000000000000000 00000040
|
||||||
|
0000000000000000 0000000000000000 WA 0 0 4
|
||||||
|
\[ 3\] \.bss NOBITS 0000000000000000 00000040
|
||||||
|
0000000000000000 0000000000000000 WA 0 0 4
|
||||||
|
\[ 4\] \.eh_frame X86_64_UNWIND 0000000000000000 00000040
|
||||||
|
0000000000000008 0000000000000000 A 0 0 1
|
||||||
|
\[ 5\] \.shstrtab STRTAB 0000000000000000 00000048
|
||||||
|
0000000000000036 0000000000000000 0 0 1
|
||||||
|
\[ 6\] \.symtab SYMTAB 0000000000000000 00000280
|
||||||
|
0000000000000078 0000000000000018 7 5 8
|
||||||
|
\[ 7\] \.strtab STRTAB 0000000000000000 000002f8
|
||||||
|
0000000000000001 0000000000000000 0 0 1
|
||||||
|
Key to Flags:
|
||||||
|
W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\)
|
||||||
|
I \(info\), L \(link order\), G \(group\), x \(unknown\)
|
||||||
|
O \(extra OS processing required\) o \(OS specific\), p \(processor specific\)
|
8
gas/testsuite/gas/i386/x86-64-unwind.s
Normal file
8
gas/testsuite/gas/i386/x86-64-unwind.s
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# First create .eh_frame with the right type.
|
||||||
|
.section .eh_frame,"a",@unwind
|
||||||
|
.long 0
|
||||||
|
|
||||||
|
# Verify that switching back into .eh_frame does not change
|
||||||
|
# its type.
|
||||||
|
.section .eh_frame
|
||||||
|
.long 1
|
@ -1,3 +1,8 @@
|
|||||||
|
2004-10-08 Daniel Jacobowitz <dan@debian.org>
|
||||||
|
|
||||||
|
* elf/common.h (PT_SUNW_EH_FRAME): Define.
|
||||||
|
* elf/x86-64.h (SHT_X86_64_UNWIND): Define.
|
||||||
|
|
||||||
2004-10-07 Bob Wilson <bob.wilson@acm.org>
|
2004-10-07 Bob Wilson <bob.wilson@acm.org>
|
||||||
|
|
||||||
* xtensa-config.h (XSHAL_USE_ABSOLUTE_LITERALS,
|
* xtensa-config.h (XSHAL_USE_ABSOLUTE_LITERALS,
|
||||||
|
@ -290,6 +290,7 @@
|
|||||||
#define PT_HIPROC 0x7FFFFFFF /* Processor-specific */
|
#define PT_HIPROC 0x7FFFFFFF /* Processor-specific */
|
||||||
|
|
||||||
#define PT_GNU_EH_FRAME (PT_LOOS + 0x474e550) /* Frame unwind information */
|
#define PT_GNU_EH_FRAME (PT_LOOS + 0x474e550) /* Frame unwind information */
|
||||||
|
#define PT_SUNW_EH_FRAME PT_GNU_EH_FRAME /* Solaris uses the same value */
|
||||||
#define PT_GNU_STACK (PT_LOOS + 0x474e551) /* Stack flags */
|
#define PT_GNU_STACK (PT_LOOS + 0x474e551) /* Stack flags */
|
||||||
#define PT_GNU_RELRO (PT_LOOS + 0x474e552) /* Read-only after relocation */
|
#define PT_GNU_RELRO (PT_LOOS + 0x474e552) /* Read-only after relocation */
|
||||||
|
|
||||||
|
@ -53,4 +53,8 @@ START_RELOC_NUMBERS (elf_x86_64_reloc_type)
|
|||||||
RELOC_NUMBER (R_X86_64_GNU_VTENTRY, 251) /* GNU C++ hack */
|
RELOC_NUMBER (R_X86_64_GNU_VTENTRY, 251) /* GNU C++ hack */
|
||||||
END_RELOC_NUMBERS (R_X86_64_max)
|
END_RELOC_NUMBERS (R_X86_64_max)
|
||||||
|
|
||||||
|
/* Processor specific section types. */
|
||||||
|
|
||||||
|
#define SHT_X86_64_UNWIND 0x70000001 /* unwind information */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2004-10-08 Daniel Jacobowitz <dan@debian.org>
|
||||||
|
|
||||||
|
* configure.tgt: Include elf_x86_64 for i[3-7]86-*-solaris2*.
|
||||||
|
|
||||||
2004-10-07 Bob Wilson <bob.wilson@acm.org>
|
2004-10-07 Bob Wilson <bob.wilson@acm.org>
|
||||||
|
|
||||||
* ld.texinfo (Xtensa): Describe new linker relaxation to optimize
|
* ld.texinfo (Xtensa): Describe new linker relaxation to optimize
|
||||||
|
@ -169,7 +169,7 @@ x86_64-*-linux-gnu*) targ_emul=elf_x86_64
|
|||||||
;;
|
;;
|
||||||
i[3-7]86-*-sysv[45]*) targ_emul=elf_i386 ;;
|
i[3-7]86-*-sysv[45]*) targ_emul=elf_i386 ;;
|
||||||
i[3-7]86-*-solaris2*) targ_emul=elf_i386_ldso
|
i[3-7]86-*-solaris2*) targ_emul=elf_i386_ldso
|
||||||
targ_extra_emuls="elf_i386"
|
targ_extra_emuls="elf_i386 elf_x86_64"
|
||||||
;;
|
;;
|
||||||
i[3-7]86-*-unixware) targ_emul=elf_i386 ;;
|
i[3-7]86-*-unixware) targ_emul=elf_i386 ;;
|
||||||
i[3-7]86-*-solaris*) targ_emul=elf_i386_ldso
|
i[3-7]86-*-solaris*) targ_emul=elf_i386_ldso
|
||||||
|
Reference in New Issue
Block a user