diff --git a/contrib/binutils/include/elf/common.h b/contrib/binutils/include/elf/common.h index f2e50221463..eb38192c3c7 100644 --- a/contrib/binutils/include/elf/common.h +++ b/contrib/binutils/include/elf/common.h @@ -437,7 +437,8 @@ /* Values for FreeBSD .note.tag notes. Note name is "FreeBSD". */ -#define NT_FREEBSD_TAG 2 +#define NT_FREEBSD_TAG 1 +#define NT_FREEBSD_NOINIT_TAG 2 /* These three macros disassemble and assemble a symbol table st_info field, which contains the symbol binding and symbol type. The STB_ and STT_ diff --git a/contrib/gdb/gdb/osabi.c b/contrib/gdb/gdb/osabi.c index 4e43df5ab7f..2b31a6e17dd 100644 --- a/contrib/gdb/gdb/osabi.c +++ b/contrib/gdb/gdb/osabi.c @@ -474,6 +474,12 @@ generic_elf_osabi_sniff_abi_tag_sections: unknown OS number %d", *osabi = GDB_OSABI_FREEBSD_ELF; return; } + if (check_note (abfd, sect, note, "FreeBSD", 4, NT_FREEBSD_NOINIT_TAG)) + { + /* There is no need to check the version yet. */ + *osabi = GDB_OSABI_FREEBSD_ELF; + return; + } return; }