Package: gdb Version: 7.2-1+rhurd.1 Severity: normal Tags: patch Hallo!
Please add the attached patch (already checked in to GDB HEAD) in order to keep GDB functional on GNU/Hurd after the recent binutils changes (PR binutils/12913). -- System Information: Debian Release: wheezy/sid APT prefers unstable APT policy: (500, 'unstable') Architecture: hurd-i386 (i686-AT386) Kernel: GNU-Mach 1.3.99/Hurd-0.3 Locale: LANG=C, LC_CTYPE=de_DE.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages gdb depends on: ii hurd 20110519-3 The GNU Hurd ii libc0.3 2.13-9~0 Embedded GNU C Library: Shared lib ii libexpat1 2.0.1-7 XML parsing C library - runtime li ii libncurses5 5.9-1 shared libraries for terminal hand ii libpython2.6 2.6.7-1 Shared Python runtime library (ver ii libreadline6 6.2-2 GNU readline and history libraries ii zlib1g 1:1.2.3.4.dfsg-3 compression library - runtime gdb recommends no packages. Versions of packages gdb suggests: ii gdb-doc 7.2-1 The GNU Debugger Documentation -- no debconf information Grüße, Thomas
commit 79c785058bf69f28c01aac1223d3237a79097949 commit 4414aa41e261d12221ea262a28f08d2a61bbf8d7 commit 2029146eabc0f4f79b503f10d5b7a386ea58680d commit 7191cf3b58ac38bfa65a66c67b401d36a66ffaef 2011-07-03 Samuel Thibault <[email protected]> Thomas Schwinge <[email protected]> PR binutils/12913 bfd/ * elf.c (_bfd_elf_set_osabi): Use ELFOSABI_GNU name instead of ELFOSABI_LINUX alias. * elf32-hppa.c: Likewise. * elf32-i370.c: Likewise. * elf64-hppa.c: Likewise. include/elf/ * common.h (ELFOSABI_GNU): Define, replaces... (ELFOSABI_LINUX): ... this, kept as an alias. (ELFOSABI_HURD): Remove. diff --git a/bfd/elf.c b/bfd/elf.c index 0c1eb7d..aa40c33 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -9610,11 +9610,11 @@ _bfd_elf_set_osabi (bfd * abfd, i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi; /* To make things simpler for the loader on Linux systems we set the - osabi field to ELFOSABI_LINUX if the binary contains symbols of + osabi field to ELFOSABI_GNU if the binary contains symbols of the STT_GNU_IFUNC type or STB_GNU_UNIQUE binding. */ if (i_ehdrp->e_ident[EI_OSABI] == ELFOSABI_NONE && elf_tdata (abfd)->has_gnu_symbols) - i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_LINUX; + i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_GNU; } diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 0e33f47..7f0f2cb 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -950,9 +950,9 @@ elf32_hppa_object_p (bfd *abfd) i_ehdrp = elf_elfheader (abfd); if (strcmp (bfd_get_target (abfd), "elf32-hppa-linux") == 0) { - /* GCC on hppa-linux produces binaries with OSABI=Linux, + /* GCC on hppa-linux produces binaries with OSABI=GNU, but the kernel produces corefiles with OSABI=SysV. */ - if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_LINUX && + if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_GNU && i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_NONE) /* aka SYSV */ return FALSE; } @@ -4678,7 +4678,7 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type) #undef TARGET_BIG_NAME #define TARGET_BIG_NAME "elf32-hppa-linux" #undef ELF_OSABI -#define ELF_OSABI ELFOSABI_LINUX +#define ELF_OSABI ELFOSABI_GNU #undef elf32_bed #define elf32_bed elf32_hppa_linux_bed diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c index c9f4333..8082927 100644 --- a/bfd/elf32-i370.c +++ b/bfd/elf32-i370.c @@ -1368,7 +1368,7 @@ i370_elf_relocate_section (bfd *output_bfd, #define ELF_MACHINE_ALT1 EM_I370_OLD #endif #define ELF_MAXPAGESIZE 0x1000 -#define ELF_OSABI ELFOSABI_LINUX +#define ELF_OSABI ELFOSABI_GNU #define elf_info_to_howto i370_elf_info_to_howto diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index d78225b..92adf78 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -329,9 +329,9 @@ elf64_hppa_object_p (bfd *abfd) i_ehdrp = elf_elfheader (abfd); if (strcmp (bfd_get_target (abfd), "elf64-hppa-linux") == 0) { - /* GCC on hppa-linux produces binaries with OSABI=Linux, + /* GCC on hppa-linux produces binaries with OSABI=GNU, but the kernel produces corefiles with OSABI=SysV. */ - if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_LINUX + if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_GNU && i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_NONE) /* aka SYSV */ return FALSE; } @@ -4097,7 +4097,7 @@ const struct elf_size_info hppa64_elf_size_info = #undef TARGET_BIG_NAME #define TARGET_BIG_NAME "elf64-hppa-linux" #undef ELF_OSABI -#define ELF_OSABI ELFOSABI_LINUX +#define ELF_OSABI ELFOSABI_GNU #undef elf_backend_post_process_headers #define elf_backend_post_process_headers _bfd_elf_set_osabi #undef elf64_bed diff --git a/include/elf/common.h b/include/elf/common.h index 70088a0..1d704b1 100644 --- a/include/elf/common.h +++ b/include/elf/common.h @@ -62,8 +62,8 @@ #define ELFOSABI_NONE 0 /* UNIX System V ABI */ #define ELFOSABI_HPUX 1 /* HP-UX operating system */ #define ELFOSABI_NETBSD 2 /* NetBSD */ -#define ELFOSABI_LINUX 3 /* GNU/Linux */ -#define ELFOSABI_HURD 4 /* GNU/Hurd */ +#define ELFOSABI_GNU 3 /* GNU */ +#define ELFOSABI_LINUX 3 /* Alias for ELFOSABI_GNU */ #define ELFOSABI_SOLARIS 6 /* Solaris */ #define ELFOSABI_AIX 7 /* AIX */ #define ELFOSABI_IRIX 8 /* IRIX */ 2011-07-04 Thomas Schwinge <[email protected]> gdb/ * osabi.c (generic_elf_osabi_sniffer) <ELFOSABI_GNU>: Handle in the same way as ELFOSABI_NONE. <ELFOSABI_LINUX, ELFOSABI_HURD>: Remove cases. diff --git a/gdb/osabi.c b/gdb/osabi.c index a264924..e161b58 100644 --- a/gdb/osabi.c +++ b/gdb/osabi.c @@ -514,11 +514,14 @@ generic_elf_osabi_sniffer (bfd *abfd) switch (elfosabi) { case ELFOSABI_NONE: + case ELFOSABI_GNU: /* When the EI_OSABI field in the ELF header is ELFOSABI_NONE (0), then the ELF structures in the file are conforming to the base specification for that machine (there are no OS-specific extensions). In order to determine the real OS - in use we must look for OS-specific notes. */ + in use we must look for OS-specific notes. The same applies + for ELFOSABI_GNU: this can mean GNU/Hurd, GNU/Linux, and + possibly more. */ bfd_map_over_sections (abfd, generic_elf_osabi_sniff_abi_tag_sections, &osabi); @@ -532,14 +535,6 @@ generic_elf_osabi_sniffer (bfd *abfd) osabi = GDB_OSABI_NETBSD_ELF; break; - case ELFOSABI_LINUX: - osabi = GDB_OSABI_LINUX; - break; - - case ELFOSABI_HURD: - osabi = GDB_OSABI_HURD; - break; - case ELFOSABI_SOLARIS: osabi = GDB_OSABI_SOLARIS; break; 2011-07-04 Joel Brobecker <[email protected]> gdb/ * osabi.c (generic_elf_osabi_sniffer): Minor comment reformatting. diff --git a/gdb/osabi.c b/gdb/osabi.c index e161b58..22130f0 100644 --- a/gdb/osabi.c +++ b/gdb/osabi.c @@ -519,9 +519,10 @@ generic_elf_osabi_sniffer (bfd *abfd) (0), then the ELF structures in the file are conforming to the base specification for that machine (there are no OS-specific extensions). In order to determine the real OS - in use we must look for OS-specific notes. The same applies - for ELFOSABI_GNU: this can mean GNU/Hurd, GNU/Linux, and - possibly more. */ + in use, we must look for OS-specific notes. + + The same applies for ELFOSABI_GNU: this can mean GNU/Hurd, + GNU/Linux, and possibly more. */ bfd_map_over_sections (abfd, generic_elf_osabi_sniff_abi_tag_sections, &osabi);

