Rebase on FSF binutils v2.28.

- Retire: binutils-2.23.52.0.1-addr2line-dynsymtab.patch
- Retire: binutils-2.27-local-dynsym-count.patch
- Retire: binutils-2.27-monotonic-section-offsets.patch
- Retire: binutils-2.27-arm-aarch64-default-relro.patch
- Retire: binutils-2.28-gold.patch
- Retire: binutils-2.27-objdump-improvements.patch
- Retire: binutils-2.27-dwarf-parse-speedup.patch
- Retire: binutils-2.27-objdump-improvements.2.patch
- Retire: binutils-2.27-arm-binary-objects.patch
- Retire: binutils-2.27-ppc-fp-attributes.patch
- Add patch to sync libiberty with FSF GCC mainline.
Relates: #1428310
This commit is contained in:
Nick Clifton 2017-03-02 13:05:34 +00:00
parent 4e01b3a7e5
commit 49f1ebe3be
14 changed files with 299 additions and 10397 deletions

View File

@ -1,38 +0,0 @@
--- a/bfd/opncls.c 2013-03-14 11:25:30.338306122 +0000
+++ b/bfd/opncls.c 2013-03-14 12:20:21.686397360 +0000
@@ -1297,6 +1297,8 @@
bfd_malloc (strlen (debug_file_directory) + 1
+ (canon_dirlen > dirlen ? canon_dirlen : dirlen)
+ strlen (".debug/")
+#define FEDORA_LIB_DEBUG_DIR "/usr/lib/debug"
+ + strlen (FEDORA_LIB_DEBUG_DIR) + strlen ("usr/")
+ strlen (base)
+ 1);
if (debugfile == NULL)
@@ -1332,6 +1334,26 @@
if (check_func (debugfile, crc32))
goto found;
+ /* Then try in the global debug dir for Fedora libraries. */
+ sprintf (debugfile, "%s%s%s", FEDORA_LIB_DEBUG_DIR, dir, base);
+ if (separate_debug_file_exists (debugfile, crc32))
+ {
+ free (base);
+ free (dir);
+ free (canon_dir);
+ return debugfile;
+ }
+
+ /* Then try in the usr subdirectory of the global debug dir for Fedora libraries. */
+ sprintf (debugfile, "%s/usr%s%s", FEDORA_LIB_DEBUG_DIR, dir, base);
+ if (separate_debug_file_exists (debugfile, crc32))
+ {
+ free (base);
+ free (dir);
+ free (canon_dir);
+ return debugfile;
+ }
+
/* Then try in the global debugfile directory. */
strcpy (debugfile, debug_file_directory);
dirlen = strlen (debug_file_directory) - 1;

View File

@ -76,16 +76,6 @@ diff -rup binutils-2.26.orig/bfd/bfd.c binutils-2.26/bfd/bfd.c
diff -rup binutils-2.26.orig/bfd/bfd-in2.h binutils-2.26/bfd/bfd-in2.h
--- binutils-2.26.orig/bfd/bfd-in2.h 2016-02-19 09:35:36.280000903 +0000
+++ binutils-2.26/bfd/bfd-in2.h 2016-02-19 09:35:54.900106492 +0000
@@ -1089,6 +1089,9 @@ struct bfd_section *bfd_create_gnu_debug
bfd_boolean bfd_fill_in_gnu_debuglink_section
(bfd *abfd, struct bfd_section *sect, const char *filename);
+const char *bfd_extract_object_only_section
+ (bfd *abfd);
+
/* Extracted from libbfd.c. */
/* Byte swapping macros for user section data. */
@@ -1654,6 +1657,9 @@ extern asection _bfd_std_section[4];
#define BFD_COM_SECTION_NAME "*COM*"
#define BFD_IND_SECTION_NAME "*IND*"
@ -233,79 +223,6 @@ diff -rup binutils-2.26.orig/bfd/format.c binutils-2.26/bfd/format.c
/* File position has moved, BTW. */
return TRUE;
}
diff -rup binutils-2.26.orig/bfd/opncls.c binutils-2.26/bfd/opncls.c
--- binutils-2.26.orig/bfd/opncls.c 2016-02-19 09:35:36.281000909 +0000
+++ binutils-2.26/bfd/opncls.c 2016-02-19 09:35:54.905106520 +0000
@@ -1717,3 +1717,69 @@ bfd_fill_in_gnu_debuglink_section (bfd *
return TRUE;
}
+
+/*
+FUNCTION
+ bfd_extract_object_only_section
+
+SYNOPSIS
+ const char *bfd_extract_object_only_section
+ (bfd *abfd);
+
+DESCRIPTION
+
+ Takes a @var{ABFD} and extract the .gnu_object_only section into
+ a temporary file.
+
+RETURNS
+ The name of the temporary file is returned if all is ok.
+ Otherwise <<NULL>> is returned and bfd_error is set.
+*/
+
+const char *
+bfd_extract_object_only_section (bfd *abfd)
+{
+ asection *sec = abfd->object_only_section;
+ const char *name;
+ FILE *file;
+ bfd_byte *memhunk = NULL;
+ size_t off, size;
+ bfd_error_type err;
+
+ /* Get a temporary object-only file. */
+ name = make_temp_file (".obj-only.o");
+
+ /* Open the object-only file. */
+ file = real_fopen (name, FOPEN_WB);
+ if (!bfd_get_full_section_contents (abfd, sec, &memhunk))
+ {
+ err = bfd_get_error ();
+
+loser:
+ free (memhunk);
+ fclose (file);
+ unlink (name);
+ bfd_set_error (err);
+ return NULL;
+ }
+
+ off = 0;
+ size = sec->size;
+ while (off != size)
+ {
+ size_t written, nwrite = size - off;
+
+ written = fwrite (memhunk + off, 1, nwrite, file);
+ if (written < nwrite && ferror (file))
+ {
+ err = bfd_error_system_call;
+ goto loser;
+ }
+
+ off += written;
+ }
+
+ free (memhunk);
+ fclose (file);
+ return name;
+}
diff -rup binutils-2.26.orig/bfd/plugin.c binutils-2.26/bfd/plugin.c
--- binutils-2.26.orig/bfd/plugin.c 2016-02-19 09:35:36.271000852 +0000
+++ binutils-2.26/bfd/plugin.c 2016-02-19 09:35:54.905106520 +0000
@ -651,34 +568,6 @@ diff -rup binutils-2.26.orig/ld/emultempl/alphaelf.em binutils-2.26/ld/emultempl
}
EOF
diff -rup binutils-2.26.orig/ld/emultempl/armelf.em binutils-2.26/ld/emultempl/armelf.em
--- binutils-2.26.orig/ld/emultempl/armelf.em 2016-02-19 09:35:36.698003274 +0000
+++ binutils-2.26/ld/emultempl/armelf.em 2016-02-19 09:35:54.914106571 +0000
@@ -377,7 +377,7 @@ gld${EMULATION_NAME}_after_allocation (v
}
static void
-gld${EMULATION_NAME}_finish (void)
+arm_finish (void)
{
struct bfd_link_hash_entry * h;
@@ -404,7 +404,7 @@ gld${EMULATION_NAME}_finish (void)
}
}
- finish_default ();
+ gld${EMULATION_NAME}_finish ();
if (thumb_entry_symbol)
{
@@ -730,5 +730,5 @@ LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=
LDEMUL_BEFORE_PARSE=gld"${EMULATION_NAME}"_before_parse
LDEMUL_SET_SYMBOLS=gld"${EMULATION_NAME}"_set_symbols
# Call the extra arm-elf function
-LDEMUL_FINISH=gld${EMULATION_NAME}_finish
+LDEMUL_FINISH=arm_finish
diff -rup binutils-2.26.orig/ld/emultempl/avrelf.em binutils-2.26/ld/emultempl/avrelf.em
--- binutils-2.26.orig/ld/emultempl/avrelf.em 2016-02-19 09:35:36.698003274 +0000
+++ binutils-2.26/ld/emultempl/avrelf.em 2016-02-19 09:35:54.915106577 +0000
@ -809,33 +698,6 @@ diff -rup binutils-2.26.orig/ld/emultempl/ppc32elf.em binutils-2.26/ld/emultempl
}
EOF
diff -rup binutils-2.26.orig/ld/emultempl/ppc64elf.em binutils-2.26/ld/emultempl/ppc64elf.em
--- binutils-2.26.orig/ld/emultempl/ppc64elf.em 2016-02-19 09:35:36.699003279 +0000
+++ binutils-2.26/ld/emultempl/ppc64elf.em 2016-02-19 09:35:54.916106583 +0000
@@ -562,7 +562,7 @@ gld${EMULATION_NAME}_after_allocation (v
/* Final emulation specific call. */
static void
-gld${EMULATION_NAME}_finish (void)
+ppc_finish (void)
{
char *msg = NULL;
char *line, *endline;
@@ -594,7 +594,7 @@ gld${EMULATION_NAME}_finish (void)
free (msg);
ppc64_elf_restore_symbols (&link_info);
- finish_default ();
+ gld${EMULATION_NAME}_finish ();
}
@@ -928,4 +928,4 @@ LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=
LDEMUL_AFTER_OPEN=ppc_after_open
LDEMUL_BEFORE_ALLOCATION=ppc_before_allocation
LDEMUL_AFTER_ALLOCATION=gld${EMULATION_NAME}_after_allocation
-LDEMUL_FINISH=gld${EMULATION_NAME}_finish
+LDEMUL_FINISH=ppc_finish
diff -rup binutils-2.26.orig/ld/emultempl/spuelf.em binutils-2.26/ld/emultempl/spuelf.em
--- binutils-2.26.orig/ld/emultempl/spuelf.em 2016-02-19 09:35:36.699003279 +0000
+++ binutils-2.26/ld/emultempl/spuelf.em 2016-02-19 09:35:54.916106583 +0000
@ -2554,3 +2416,155 @@ diff -rup binutils-2.26.orig/ld/testsuite/ld-plugin/lto.exp binutils-2.26/ld/tes
+ printf ("hello\n");
+ return 0;
+}
--- binutils.orig/bfd/bfd-in2.h 2017-03-02 11:14:48.572979573 +0000
+++ binutils-2.28/bfd/bfd-in2.h 2017-03-02 11:21:39.828458555 +0000
@@ -1118,6 +1118,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_se
char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir);
+const char *bfd_extract_object_only_section
+ (bfd *abfd);
+
/* Extracted from libbfd.c. */
/* Byte swapping macros for user section data. */
--- binutils.orig/bfd/opncls.c 2017-03-02 11:14:48.586979385 +0000
+++ binutils-2.28/bfd/opncls.c 2017-03-02 11:23:23.546065945 +0000
@@ -1990,3 +1990,69 @@ bfd_follow_build_id_debuglink (bfd *abfd
get_build_id_name,
check_build_id_file);
}
+
+/*
+FUNCTION
+ bfd_extract_object_only_section
+
+SYNOPSIS
+ const char *bfd_extract_object_only_section
+ (bfd *abfd);
+
+DESCRIPTION
+
+ Takes a @var{ABFD} and extract the .gnu_object_only section into
+ a temporary file.
+
+RETURNS
+ The name of the temporary file is returned if all is ok.
+ Otherwise <<NULL>> is returned and bfd_error is set.
+*/
+
+const char *
+bfd_extract_object_only_section (bfd *abfd)
+{
+ asection *sec = abfd->object_only_section;
+ const char *name;
+ FILE *file;
+ bfd_byte *memhunk = NULL;
+ size_t off, size;
+ bfd_error_type err;
+
+ /* Get a temporary object-only file. */
+ name = make_temp_file (".obj-only.o");
+
+ /* Open the object-only file. */
+ file = real_fopen (name, FOPEN_WB);
+ if (!bfd_get_full_section_contents (abfd, sec, &memhunk))
+ {
+ err = bfd_get_error ();
+
+loser:
+ free (memhunk);
+ fclose (file);
+ unlink (name);
+ bfd_set_error (err);
+ return NULL;
+ }
+
+ off = 0;
+ size = sec->size;
+ while (off != size)
+ {
+ size_t written, nwrite = size - off;
+
+ written = fwrite (memhunk + off, 1, nwrite, file);
+ if (written < nwrite && ferror (file))
+ {
+ err = bfd_error_system_call;
+ goto loser;
+ }
+
+ off += written;
+ }
+
+ free (memhunk);
+ fclose (file);
+ return name;
+}
--- binutils.orig/bfd/plugin.c 2017-03-02 11:37:31.572677260 +0000
+++ binutils-2.28/bfd/plugin.c 2017-03-02 11:40:35.246209573 +0000
@@ -132,10 +132,10 @@ register_claim_file (ld_plugin_claim_fil
}
static asection bfd_plugin_fake_text_section
- = BFD_FAKE_SECTION (bfd_plugin_fake_text_section, 0, 0, ".text", 0);
+= BFD_FAKE_SECTION (bfd_plugin_fake_text_section, 0, ".text", 0, 0);
static asection bfd_plugin_fake_common_section
- = BFD_FAKE_SECTION (bfd_plugin_fake_common_section, SEC_IS_COMMON, 0,
- NULL, 0);
+ = BFD_FAKE_SECTION (bfd_plugin_fake_common_section, 0,
+ NULL, 0, SEC_IS_COMMON);
/* Get symbols from object only section. */
--- binutils.orig/ld/emultempl/armelf.em 2017-03-02 11:58:14.632981042 +0000
+++ binutils-2.28/ld/emultempl/armelf.em 2017-03-02 12:00:55.663819055 +0000
@@ -414,7 +414,7 @@ gld${EMULATION_NAME}_after_allocation (v
}
static void
-gld${EMULATION_NAME}_finish (void)
+arm_finish (void)
{
struct bfd_link_hash_entry * h;
@@ -441,7 +441,7 @@ gld${EMULATION_NAME}_finish (void)
}
}
- finish_default ();
+ gld${EMULATION_NAME}_finish ();
if (params.thumb_entry_symbol)
{
@@ -790,4 +790,4 @@ LDEMUL_BEFORE_PARSE=gld"${EMULATION_NAME
LDEMUL_SET_SYMBOLS=gld"${EMULATION_NAME}"_set_symbols
# Call the extra arm-elf function
-LDEMUL_FINISH=gld${EMULATION_NAME}_finish
+LDEMUL_FINISH=arm_finish
--- binutils.orig/ld/emultempl/ppc64elf.em 2017-03-02 11:58:14.632981042 +0000
+++ binutils-2.28/ld/emultempl/ppc64elf.em 2017-03-02 12:01:40.961210895 +0000
@@ -561,7 +561,7 @@ gld${EMULATION_NAME}_after_allocation (v
/* Final emulation specific call. */
static void
-gld${EMULATION_NAME}_finish (void)
+ppc_finish (void)
{
char *msg = NULL;
char *line, *endline;
@@ -592,7 +592,7 @@ gld${EMULATION_NAME}_finish (void)
if (msg != NULL)
free (msg);
- finish_default ();
+ gld${EMULATION_NAME}_finish ();
}
@@ -926,4 +926,4 @@ LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=
LDEMUL_AFTER_OPEN=ppc_after_open
LDEMUL_BEFORE_ALLOCATION=ppc_before_allocation
LDEMUL_AFTER_ALLOCATION=gld${EMULATION_NAME}_after_allocation
-LDEMUL_FINISH=gld${EMULATION_NAME}_finish
+LDEMUL_FINISH=ppc_finish

View File

@ -1,20 +0,0 @@
--- binutils-2.27.orig/ld/emultempl/aarch64elf.em 2016-08-19 11:53:37.647284625 +0100
+++ binutils-2.27/ld/emultempl/aarch64elf.em 2016-08-19 11:54:41.916673347 +0100
@@ -43,6 +43,7 @@ gld${EMULATION_NAME}_before_parse (void)
input_flags.dynamic = ${DYNAMIC_LINK-TRUE};
config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`;
+ link_info.relro = DEFAULT_LD_Z_RELRO;
}
static void
--- binutils-2.27.orig/ld/emultempl/armelf.em 2016-08-19 11:53:37.647284625 +0100
+++ binutils-2.27/ld/emultempl/armelf.em 2016-08-19 11:54:51.035728502 +0100
@@ -52,6 +52,7 @@ gld${EMULATION_NAME}_before_parse (void)
input_flags.dynamic = ${DYNAMIC_LINK-TRUE};
config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`;
+ link_info.relro = DEFAULT_LD_Z_RELRO;
}
static void

View File

@ -1,12 +0,0 @@
diff -rup binutils-2.27.orig/bfd/elf32-arm.c binutils-2.27/bfd/elf32-arm.c
--- binutils-2.27.orig/bfd/elf32-arm.c 2017-02-15 17:25:01.331124382 +0000
+++ binutils-2.27/bfd/elf32-arm.c 2017-02-15 17:25:32.044613743 +0000
@@ -18172,7 +18172,7 @@ elf32_arm_count_additional_relocs (asect
{
struct _arm_elf_section_data *arm_data;
arm_data = get_arm_elf_section_data (sec);
- return arm_data->additional_reloc_count;
+ return arm_data == NULL ? 0 : arm_data->additional_reloc_count;
}
/* Called to set the sh_flags, sh_link and sh_info fields of OSECTION which

View File

@ -1,380 +0,0 @@
--- binutils-2.27.orig/bfd/dwarf2.c 2016-11-22 17:26:23.634699582 +0000
+++ binutils-2.27/bfd/dwarf2.c 2016-11-22 17:26:49.849841652 +0000
@@ -256,6 +256,12 @@ struct comp_unit
/* A list of the functions found in this comp. unit. */
struct funcinfo *function_table;
+ /* A table of function information references searchable by address. */
+ struct lookup_funcinfo *lookup_funcinfo_table;
+
+ /* Number of functions in the function_table and sorted_function_table. */
+ bfd_size_type number_of_functions;
+
/* A list of the variables found in this comp. unit. */
struct varinfo *variable_table;
@@ -1236,6 +1242,8 @@ struct line_sequence
bfd_vma low_pc;
struct line_sequence* prev_sequence;
struct line_info* last_line; /* Largest VMA. */
+ struct line_info** line_info_lookup;
+ bfd_size_type num_lines;
};
struct line_info_table
@@ -1278,6 +1286,20 @@ struct funcinfo
asection *sec;
};
+struct lookup_funcinfo
+{
+ /* Function information corresponding to this lookup table entry. */
+ struct funcinfo *funcinfo;
+
+ /* The lowest address for this specific function. */
+ bfd_vma low_addr;
+
+ /* The highest address of this function before the lookup table is sorted.
+ The highest address of all prior functions after the lookup table is sorted,
+ which is used for binary search. */
+ bfd_vma high_addr;
+};
+
struct varinfo
{
/* Pointer to previous variable in list of all variables */
@@ -1578,6 +1600,49 @@ compare_sequences (const void* a, const
return 0;
}
+/* Construct the line information table for quick lookup. */
+
+static bfd_boolean
+build_line_info_table (struct line_info_table* table, struct line_sequence *seq)
+{
+ bfd_size_type amt;
+ struct line_info** line_info_lookup;
+ struct line_info* each_line;
+ unsigned int num_lines;
+ unsigned int index;
+
+ if (seq->line_info_lookup != NULL)
+ return TRUE;
+
+ /* Count the number of line information entries. We could do this while
+ scanning the debug information, but some entries may be added via lcl_head
+ without having a sequence handy to increment the number of lines. */
+ num_lines = 0;
+ for (each_line = seq->last_line; each_line; each_line = each_line->prev_line)
+ num_lines++;
+
+ if (num_lines == 0)
+ return TRUE;
+
+ /* Allocate space for the line information lookup table. */
+ amt = sizeof (struct line_info*) * num_lines;
+ line_info_lookup = (struct line_info**) bfd_alloc (table->abfd, amt);
+ if (line_info_lookup == NULL)
+ return FALSE;
+
+ /* Create the line information lookup table. */
+ index = num_lines;
+ for (each_line = seq->last_line; each_line; each_line = each_line->prev_line)
+ line_info_lookup[--index] = each_line;
+
+ BFD_ASSERT (index == 0);
+
+ seq->num_lines = num_lines;
+ seq->line_info_lookup = line_info_lookup;
+
+ return TRUE;
+}
+
/* Sort the line sequences for quick lookup. */
static bfd_boolean
@@ -1609,6 +1674,8 @@ sort_line_sequences (struct line_info_ta
sequences[n].low_pc = seq->low_pc;
sequences[n].prev_sequence = NULL;
sequences[n].last_line = seq->last_line;
+ sequences[n].line_info_lookup = NULL;
+ sequences[n].num_lines = 0;
seq = seq->prev_sequence;
free (last_seq);
}
@@ -2089,7 +2156,7 @@ lookup_address_in_line_info_table (struc
unsigned int *discriminator_ptr)
{
struct line_sequence *seq = NULL;
- struct line_info *each_line;
+ struct line_info *info;
int low, high, mid;
/* Binary search the array of sequences. */
@@ -2107,26 +2174,43 @@ lookup_address_in_line_info_table (struc
break;
}
- if (seq && addr >= seq->low_pc && addr < seq->last_line->address)
+ /* Check for a valid sequence. */
+ if (!seq || addr < seq->low_pc || addr >= seq->last_line->address)
+ goto fail;
+
+ if (!build_line_info_table (table, seq))
+ goto fail;
+
+ /* Binary search the array of line information. */
+ low = 0;
+ high = seq->num_lines;
+ info = NULL;
+ while (low < high)
{
- /* Note: seq->last_line should be a descendingly sorted list. */
- for (each_line = seq->last_line;
- each_line;
- each_line = each_line->prev_line)
- if (addr >= each_line->address)
- break;
+ mid = (low + high) / 2;
+ info = seq->line_info_lookup[mid];
+ if (addr < info->address)
+ high = mid;
+ else if (addr >= seq->line_info_lookup[mid + 1]->address)
+ low = mid + 1;
+ else
+ break;
+ }
- if (each_line
- && !(each_line->end_sequence || each_line == seq->last_line))
- {
- *filename_ptr = each_line->filename;
- *linenumber_ptr = each_line->line;
- if (discriminator_ptr)
- *discriminator_ptr = each_line->discriminator;
- return seq->last_line->address - seq->low_pc;
- }
+ /* Check for a valid line information entry. */
+ if (info
+ && addr >= info->address
+ && addr < seq->line_info_lookup[mid + 1]->address
+ && !(info->end_sequence || info == seq->last_line))
+ {
+ *filename_ptr = info->filename;
+ *linenumber_ptr = info->line;
+ if (discriminator_ptr)
+ *discriminator_ptr = info->discriminator;
+ return seq->last_line->address - seq->low_pc;
}
+fail:
*filename_ptr = NULL;
return 0;
}
@@ -2144,6 +2228,93 @@ read_debug_ranges (struct comp_unit *uni
/* Function table functions. */
+static int
+compare_lookup_funcinfos (const void* a, const void* b)
+{
+ const struct lookup_funcinfo *lookup1 = a;
+ const struct lookup_funcinfo *lookup2 = b;
+ int result;
+
+ if (lookup1->low_addr < lookup2->low_addr)
+ result = -1;
+ else if (lookup1->low_addr > lookup2->low_addr)
+ result = 1;
+ else if (lookup1->high_addr < lookup2->high_addr)
+ result = -1;
+ else if (lookup1->high_addr > lookup1->high_addr)
+ result = 1;
+ else
+ result = 0;
+
+ return result;
+}
+
+static bfd_boolean
+build_lookup_funcinfo_table (struct comp_unit *unit)
+{
+ struct lookup_funcinfo *lookup_funcinfo_table = unit->lookup_funcinfo_table;
+ unsigned int number_of_functions = unit->number_of_functions;
+ struct funcinfo *each;
+ struct lookup_funcinfo *entry;
+ size_t index;
+ struct arange *range;
+ bfd_vma low_addr, high_addr;
+
+ if (lookup_funcinfo_table || number_of_functions == 0)
+ return TRUE;
+
+ /* Create the function info lookup table. */
+ lookup_funcinfo_table = (struct lookup_funcinfo *)
+ bfd_malloc (number_of_functions * sizeof (struct lookup_funcinfo));
+ if (lookup_funcinfo_table == NULL)
+ return FALSE;
+
+ /* Populate the function info lookup table. */
+ index = number_of_functions;
+ for (each = unit->function_table; each; each = each->prev_func)
+ {
+ entry = &lookup_funcinfo_table[--index];
+ entry->funcinfo = each;
+
+ /* Calculate the lowest and highest address for this function entry. */
+ low_addr = entry->funcinfo->arange.low;
+ high_addr = entry->funcinfo->arange.high;
+
+ for (range = entry->funcinfo->arange.next; range; range = range->next)
+ {
+ if (range->low < low_addr)
+ low_addr = range->low;
+ if (range->high > high_addr)
+ high_addr = range->high;
+ }
+
+ entry->low_addr = low_addr;
+ entry->high_addr = high_addr;
+ }
+
+ BFD_ASSERT (index == 0);
+
+ /* Sort the function by address. */
+ qsort (lookup_funcinfo_table,
+ number_of_functions,
+ sizeof (struct lookup_funcinfo),
+ compare_lookup_funcinfos);
+
+ /* Calculate the high watermark for each function in the lookup table. */
+ high_addr = lookup_funcinfo_table[0].high_addr;
+ for (index = 1; index < number_of_functions; index++)
+ {
+ entry = &lookup_funcinfo_table[index];
+ if (entry->high_addr > high_addr)
+ high_addr = entry->high_addr;
+ else
+ entry->high_addr = high_addr;
+ }
+
+ unit->lookup_funcinfo_table = lookup_funcinfo_table;
+ return TRUE;
+}
+
/* If ADDR is within UNIT's function tables, set FUNCTION_PTR, and return
TRUE. Note that we need to find the function that has the smallest range
that contains ADDR, to handle inlined functions without depending upon
@@ -2154,37 +2325,71 @@ lookup_address_in_function_table (struct
bfd_vma addr,
struct funcinfo **function_ptr)
{
- struct funcinfo* each_func;
+ unsigned int number_of_functions = unit->number_of_functions;
+ struct lookup_funcinfo* lookup_funcinfo = NULL;
+ struct funcinfo* funcinfo = NULL;
struct funcinfo* best_fit = NULL;
bfd_vma best_fit_len = 0;
+ bfd_size_type low, high, mid, first;
struct arange *arange;
- for (each_func = unit->function_table;
- each_func;
- each_func = each_func->prev_func)
+ if (!build_lookup_funcinfo_table (unit))
+ return FALSE;
+
+ /* Find the first function in the lookup table which may contain the
+ specified address. */
+ low = 0;
+ high = number_of_functions;
+ first = high;
+ while (low < high)
{
- for (arange = &each_func->arange;
- arange;
- arange = arange->next)
+ mid = (low + high) / 2;
+ lookup_funcinfo = &unit->lookup_funcinfo_table[mid];
+ if (addr < lookup_funcinfo->low_addr)
+ high = mid;
+ else if (addr >= lookup_funcinfo->high_addr)
+ low = mid + 1;
+ else
+ high = first = mid;
+ }
+
+ /* Find the 'best' match for the address. The prior algorithm defined the
+ best match as the function with the smallest address range containing
+ the specified address. This definition should probably be changed to the
+ innermost inline routine containing the address, but right now we want
+ to get the same results we did before. */
+ while (first < number_of_functions)
+ {
+ if (addr < unit->lookup_funcinfo_table[first].low_addr)
+ break;
+ funcinfo = unit->lookup_funcinfo_table[first].funcinfo;
+
+ for (arange = &funcinfo->arange; arange; arange = arange->next)
{
- if (addr >= arange->low && addr < arange->high)
+ if (addr < arange->low || addr >= arange->high)
+ continue;
+
+ if (!best_fit
+ || arange->high - arange->low < best_fit_len
+ /* The following comparison is designed to return the same
+ match as the previous algorithm for routines which have the
+ same best fit length. */
+ || (arange->high - arange->low == best_fit_len
+ && funcinfo > best_fit))
{
- if (!best_fit
- || arange->high - arange->low < best_fit_len)
- {
- best_fit = each_func;
- best_fit_len = arange->high - arange->low;
- }
+ best_fit = funcinfo;
+ best_fit_len = arange->high - arange->low;
}
}
- }
- if (best_fit)
- {
- *function_ptr = best_fit;
- return TRUE;
+ first++;
}
- return FALSE;
+
+ if (!best_fit)
+ return FALSE;
+
+ *function_ptr = best_fit;
+ return TRUE;
}
/* If SYM at ADDR is within function table of UNIT, set FILENAME_PTR
@@ -2513,6 +2718,7 @@ scan_unit_for_symbols (struct comp_unit
func->tag = abbrev->tag;
func->prev_func = unit->function_table;
unit->function_table = func;
+ unit->number_of_functions++;
BFD_ASSERT (!unit->cached);
if (func->tag == DW_TAG_inlined_subroutine)
@@ -4241,6 +4447,12 @@ _bfd_dwarf2_cleanup_debug_info (bfd *abf
function_table = function_table->prev_func;
}
+ if (each->lookup_funcinfo_table)
+ {
+ free (each->lookup_funcinfo_table);
+ each->lookup_funcinfo_table = NULL;
+ }
+
while (variable_table)
{
if (variable_table->file)

View File

@ -1,271 +0,0 @@
diff -rup binutils-2.27.orig/bfd/ChangeLog binutils-2.27/bfd/ChangeLog
--- binutils-2.27.orig/bfd/ChangeLog 2016-08-12 17:14:07.621773233 +0100
+++ binutils-2.27/bfd/ChangeLog 2016-08-12 17:17:32.408119156 +0100
@@ -1,3 +1,9 @@
+2016-08-12 Alan Modra <amodra@gmail.com>
+
+ * elf-bfd.h (struct elf_link_hash_table): Add local_dynsymcount.
+ * elflink.c (_bfd_elf_link_renumber_dynsyms): Set local_dynsymcount.
+ (bfd_elf_final_link): Set .dynsym sh_info from local_dynsymcount.
+
2016-08-03 Tristan Gingold <gingold@adacore.com>
* version.m4: Bump version to 2.27
Only in binutils-2.27/bfd: ChangeLog.orig
Only in binutils-2.27/bfd: ChangeLog.rej
diff -rup binutils-2.27.orig/bfd/elf-bfd.h binutils-2.27/bfd/elf-bfd.h
--- binutils-2.27.orig/bfd/elf-bfd.h 2016-08-12 17:14:07.630773290 +0100
+++ binutils-2.27/bfd/elf-bfd.h 2016-08-12 17:16:08.519549845 +0100
@@ -524,6 +524,7 @@ struct elf_link_hash_table
/* The number of symbols found in the link which is intended for the
mandatory DT_SYMTAB tag (.dynsym section) in .dynamic section. */
bfd_size_type dynsymcount;
+ bfd_size_type local_dynsymcount;
/* The string table of dynamic symbols, which becomes the .dynstr
section. */
diff -rup binutils-2.27.orig/bfd/elflink.c binutils-2.27/bfd/elflink.c
--- binutils-2.27.orig/bfd/elflink.c 2016-08-12 17:14:07.637773334 +0100
+++ binutils-2.27/bfd/elflink.c 2016-08-12 17:16:08.521549858 +0100
@@ -903,6 +903,7 @@ _bfd_elf_link_renumber_dynsyms (bfd *out
for (p = elf_hash_table (info)->dynlocal; p ; p = p->next)
p->dynindx = ++dynsymcount;
}
+ elf_hash_table (info)->local_dynsymcount = dynsymcount;
elf_link_hash_traverse (elf_hash_table (info),
elf_link_renumber_hash_table_dynsyms,
@@ -11678,7 +11679,10 @@ bfd_elf_final_link (bfd *abfd, struct bf
{
Elf_Internal_Sym sym;
bfd_byte *dynsym = elf_hash_table (info)->dynsym->contents;
- long last_local = 0;
+
+ o = elf_hash_table (info)->dynsym->output_section;
+ elf_section_data (o)->this_hdr.sh_info
+ = elf_hash_table (info)->local_dynsymcount + 1;
/* Write out the section symbols for the output sections. */
if (bfd_link_pic (info)
@@ -11708,8 +11712,6 @@ bfd_elf_final_link (bfd *abfd, struct bf
return FALSE;
sym.st_value = s->vma;
dest = dynsym + dynindx * bed->s->sizeof_sym;
- if (last_local < dynindx)
- last_local = dynindx;
bed->s->swap_symbol_out (abfd, &sym, dest, 0);
}
}
@@ -11742,16 +11744,10 @@ bfd_elf_final_link (bfd *abfd, struct bf
+ e->isym.st_value);
}
- if (last_local < e->dynindx)
- last_local = e->dynindx;
-
dest = dynsym + e->dynindx * bed->s->sizeof_sym;
bed->s->swap_symbol_out (abfd, &sym, dest, 0);
}
}
-
- elf_section_data (elf_hash_table (info)->dynsym->output_section)->this_hdr.sh_info =
- last_local + 1;
}
/* We get the global symbols from the hash table. */
Only in binutils-2.27/bfd: elflink.c.orig
diff -rup binutils-2.27.orig/ld/ChangeLog binutils-2.27/ld/ChangeLog
--- binutils-2.27.orig/ld/ChangeLog 2016-08-12 17:14:08.064776041 +0100
+++ binutils-2.27/ld/ChangeLog 2016-08-12 17:17:00.166900351 +0100
@@ -1,3 +1,19 @@
+2016-08-12 Alan Modra <amodra@gmail.com>
+
+ * testsuite/ld-tic6x/shlib-1.rd: Correct expected .dynsym sh_info.
+ * testsuite/ld-tic6x/shlib-1b.rd: Likewise.
+ * testsuite/ld-tic6x/shlib-1r.rd: Likewise.
+ * testsuite/ld-tic6x/shlib-1rb.rd: Likewise.
+ * testsuite/ld-tic6x/shlib-app-1.rd: Likewise.
+ * testsuite/ld-tic6x/shlib-app-1b.rd: Likewise.
+ * testsuite/ld-tic6x/shlib-app-1r.rd: Likewise.
+ * testsuite/ld-tic6x/shlib-app-1rb.rd: Likewise.
+ * testsuite/ld-tic6x/shlib-noindex.rd: Likewise.
+ * testsuite/ld-tic6x/static-app-1.rd: Likewise.
+ * testsuite/ld-tic6x/static-app-1b.rd: Likewise.
+ * testsuite/ld-tic6x/static-app-1r.rd: Likewise.
+ * testsuite/ld-tic6x/static-app-1rb.rd: Likewise.
+
2016-08-03 Tristan Gingold <gingold@adacore.com>
* configure: Regenerate.
Only in binutils-2.27/ld: ChangeLog.orig
Only in binutils-2.27/ld: ChangeLog.rej
diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-1b.rd binutils-2.27/ld/testsuite/ld-tic6x/shlib-1b.rd
--- binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-1b.rd 2016-08-12 17:14:08.200776903 +0100
+++ binutils-2.27/ld/testsuite/ld-tic6x/shlib-1b.rd 2016-08-12 17:16:08.522549865 +0100
@@ -4,7 +4,7 @@ Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
\[ 0\] NULL 00000000 000000 000000 00 0 0 0
\[ 1\] \.hash HASH 00008000 001000 000048 04 A 2 0 4
- \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 6 4
+ \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 7 4
\[ 3\] \.dynstr STRTAB 00008118 001118 000025 00 A 0 0 1
\[ 4\] \.rela\.got RELA 00008140 001140 000024 0c AI 2 10 4
\[ 5\] \.rela\.neardata RELA 00008164 001164 000018 0c AI 2 11 4
diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-1rb.rd binutils-2.27/ld/testsuite/ld-tic6x/shlib-1rb.rd
--- binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-1rb.rd 2016-08-12 17:14:08.200776903 +0100
+++ binutils-2.27/ld/testsuite/ld-tic6x/shlib-1rb.rd 2016-08-12 17:16:08.522549865 +0100
@@ -4,7 +4,7 @@ Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
\[ 0\] NULL 00000000 000000 000000 00 0 0 0
\[ 1\] \.hash HASH 00008000 001000 000048 04 A 2 0 4
- \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 6 4
+ \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 7 4
\[ 3\] \.dynstr STRTAB 00008118 001118 000025 00 A 0 0 1
\[ 4\] \.rela\.got RELA 00008140 001140 000024 0c AI 2 10 4
\[ 5\] \.rela\.neardata RELA 00008164 001164 000018 0c AI 2 11 4
diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-1.rd binutils-2.27/ld/testsuite/ld-tic6x/shlib-1.rd
--- binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-1.rd 2016-08-12 17:14:08.200776903 +0100
+++ binutils-2.27/ld/testsuite/ld-tic6x/shlib-1.rd 2016-08-12 17:16:08.522549865 +0100
@@ -4,7 +4,7 @@ Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
\[ 0\] NULL 00000000 000000 000000 00 0 0 0
\[ 1\] \.hash HASH 00008000 001000 000048 04 A 2 0 4
- \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 6 4
+ \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 7 4
\[ 3\] \.dynstr STRTAB 00008118 001118 000025 00 A 0 0 1
\[ 4\] \.rela\.got RELA 00008140 001140 000024 0c AI 2 10 4
\[ 5\] \.rela\.neardata RELA 00008164 001164 000018 0c AI 2 11 4
diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-1r.rd binutils-2.27/ld/testsuite/ld-tic6x/shlib-1r.rd
--- binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-1r.rd 2016-08-12 17:14:08.200776903 +0100
+++ binutils-2.27/ld/testsuite/ld-tic6x/shlib-1r.rd 2016-08-12 17:16:08.522549865 +0100
@@ -4,7 +4,7 @@ Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
\[ 0\] NULL 00000000 000000 000000 00 0 0 0
\[ 1\] \.hash HASH 00008000 001000 000048 04 A 2 0 4
- \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 6 4
+ \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 7 4
\[ 3\] \.dynstr STRTAB 00008118 001118 000025 00 A 0 0 1
\[ 4\] \.rela\.got RELA 00008140 001140 000024 0c AI 2 10 4
\[ 5\] \.rela\.neardata RELA 00008164 001164 000018 0c AI 2 11 4
diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-app-1b.rd binutils-2.27/ld/testsuite/ld-tic6x/shlib-app-1b.rd
--- binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-app-1b.rd 2016-08-12 17:14:08.200776903 +0100
+++ binutils-2.27/ld/testsuite/ld-tic6x/shlib-app-1b.rd 2016-08-12 17:16:08.522549865 +0100
@@ -4,7 +4,7 @@ Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
\[ 0\] NULL 00000000 000000 000000 00 0 0 0
\[ 1\] \.hash HASH 00008000 001000 000044 04 A 2 0 4
- \[ 2\] \.dynsym DYNSYM 00008044 001044 0000c0 10 A 3 6 4
+ \[ 2\] \.dynsym DYNSYM 00008044 001044 0000c0 10 A 3 7 4
\[ 3\] \.dynstr STRTAB 00008104 001104 000036 00 A 0 0 1
\[ 4\] \.rela\.got RELA 0000813c 00113c 000018 0c AI 2 11 4
\[ 5\] \.rela\.neardata RELA 00008154 001154 000018 0c AI 2 12 4
diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-app-1rb.rd binutils-2.27/ld/testsuite/ld-tic6x/shlib-app-1rb.rd
--- binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-app-1rb.rd 2016-08-12 17:14:08.201776909 +0100
+++ binutils-2.27/ld/testsuite/ld-tic6x/shlib-app-1rb.rd 2016-08-12 17:16:08.522549865 +0100
@@ -4,7 +4,7 @@ Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
\[ 0\] NULL 00000000 000000 000000 00 0 0 0
\[ 1\] \.hash HASH 00008000 001000 00003c 04 A 2 0 4
- \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 6 4
+ \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 7 4
\[ 3\] \.dynstr STRTAB 000080dc 0010dc 000031 00 A 0 0 1
\[ 4\] \.rela\.got RELA 00008110 001110 000018 0c AI 2 10 4
\[ 5\] \.rela\.bss RELA 00008128 001128 00000c 0c AI 2 12 4
diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-app-1.rd binutils-2.27/ld/testsuite/ld-tic6x/shlib-app-1.rd
--- binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-app-1.rd 2016-08-12 17:14:08.200776903 +0100
+++ binutils-2.27/ld/testsuite/ld-tic6x/shlib-app-1.rd 2016-08-12 17:16:08.522549865 +0100
@@ -4,7 +4,7 @@ Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
\[ 0\] NULL 00000000 000000 000000 00 0 0 0
\[ 1\] \.hash HASH 00008000 001000 000044 04 A 2 0 4
- \[ 2\] \.dynsym DYNSYM 00008044 001044 0000c0 10 A 3 6 4
+ \[ 2\] \.dynsym DYNSYM 00008044 001044 0000c0 10 A 3 7 4
\[ 3\] \.dynstr STRTAB 00008104 001104 000035 00 A 0 0 1
\[ 4\] \.rela\.got RELA 0000813c 00113c 000018 0c AI 2 11 4
\[ 5\] \.rela\.neardata RELA 00008154 001154 000018 0c AI 2 12 4
diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-app-1r.rd binutils-2.27/ld/testsuite/ld-tic6x/shlib-app-1r.rd
--- binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-app-1r.rd 2016-08-12 17:14:08.200776903 +0100
+++ binutils-2.27/ld/testsuite/ld-tic6x/shlib-app-1r.rd 2016-08-12 17:16:08.522549865 +0100
@@ -4,7 +4,7 @@ Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
\[ 0\] NULL 00000000 000000 000000 00 0 0 0
\[ 1\] \.hash HASH 00008000 001000 00003c 04 A 2 0 4
- \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 6 4
+ \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 7 4
\[ 3\] \.dynstr STRTAB 000080dc 0010dc 000030 00 A 0 0 1
\[ 4\] \.rela\.got RELA 0000810c 00110c 000018 0c AI 2 10 4
\[ 5\] \.rela\.bss RELA 00008124 001124 00000c 0c AI 2 12 4
diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-noindex.rd binutils-2.27/ld/testsuite/ld-tic6x/shlib-noindex.rd
--- binutils-2.27.orig/ld/testsuite/ld-tic6x/shlib-noindex.rd 2016-08-12 17:14:08.201776909 +0100
+++ binutils-2.27/ld/testsuite/ld-tic6x/shlib-noindex.rd 2016-08-12 17:16:08.522549865 +0100
@@ -4,7 +4,7 @@ Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
\[ 0\] NULL 00000000 000000 000000 00 0 0 0
\[ 1\] \.hash HASH 00008000 001000 000048 04 A 2 0 4
- \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 6 4
+ \[ 2\] \.dynsym DYNSYM 00008048 001048 0000d0 10 A 3 7 4
\[ 3\] \.dynstr STRTAB 00008118 001118 000025 00 A 0 0 1
\[ 4\] \.rela\.text RELA 00008140 001140 00000c 0c AI 2 10 4
\[ 5\] \.rela\.got RELA 0000814c 00114c 000024 0c AI 2 11 4
diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/static-app-1b.rd binutils-2.27/ld/testsuite/ld-tic6x/static-app-1b.rd
--- binutils-2.27.orig/ld/testsuite/ld-tic6x/static-app-1b.rd 2016-08-12 17:14:08.201776909 +0100
+++ binutils-2.27/ld/testsuite/ld-tic6x/static-app-1b.rd 2016-08-12 17:16:08.522549865 +0100
@@ -4,7 +4,7 @@ Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
\[ 0\] NULL 00000000 000000 000000 00 0 0 0
\[ 1\] \.hash HASH 00008000 001000 00003c 04 A 2 0 4
- \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 5 4
+ \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 7 4
\[ 3\] \.dynstr STRTAB 000080dc 0010dc 00001d 00 A 0 0 1
\[ 4\] \.rela\.got RELA 000080fc 0010fc 000024 0c AI 2 8 4
\[ 5\] \.rela\.neardata RELA 00008120 001120 000030 0c AI 2 9 4
diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/static-app-1rb.rd binutils-2.27/ld/testsuite/ld-tic6x/static-app-1rb.rd
--- binutils-2.27.orig/ld/testsuite/ld-tic6x/static-app-1rb.rd 2016-08-12 17:14:08.201776909 +0100
+++ binutils-2.27/ld/testsuite/ld-tic6x/static-app-1rb.rd 2016-08-12 17:16:08.523549872 +0100
@@ -4,7 +4,7 @@ Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
\[ 0\] NULL 00000000 000000 000000 00 0 0 0
\[ 1\] \.hash HASH 00008000 001000 00003c 04 A 2 0 4
- \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 5 4
+ \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 7 4
\[ 3\] \.dynstr STRTAB 000080dc 0010dc 00001d 00 A 0 0 1
\[ 4\] \.rela\.got RELA 000080fc 0010fc 000024 0c AI 2 8 4
\[ 5\] \.rela\.neardata RELA 00008120 001120 000018 0c AI 2 9 4
diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/static-app-1.rd binutils-2.27/ld/testsuite/ld-tic6x/static-app-1.rd
--- binutils-2.27.orig/ld/testsuite/ld-tic6x/static-app-1.rd 2016-08-12 17:14:08.201776909 +0100
+++ binutils-2.27/ld/testsuite/ld-tic6x/static-app-1.rd 2016-08-12 17:16:08.522549865 +0100
@@ -4,7 +4,7 @@ Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
\[ 0\] NULL 00000000 000000 000000 00 0 0 0
\[ 1\] \.hash HASH 00008000 001000 00003c 04 A 2 0 4
- \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 5 4
+ \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 7 4
\[ 3\] \.dynstr STRTAB 000080dc 0010dc 00001d 00 A 0 0 1
\[ 4\] \.rela\.got RELA 000080fc 0010fc 000024 0c AI 2 8 4
\[ 5\] \.rela\.neardata RELA 00008120 001120 000030 0c AI 2 9 4
diff -rup binutils-2.27.orig/ld/testsuite/ld-tic6x/static-app-1r.rd binutils-2.27/ld/testsuite/ld-tic6x/static-app-1r.rd
--- binutils-2.27.orig/ld/testsuite/ld-tic6x/static-app-1r.rd 2016-08-12 17:14:08.201776909 +0100
+++ binutils-2.27/ld/testsuite/ld-tic6x/static-app-1r.rd 2016-08-12 17:16:08.523549872 +0100
@@ -4,7 +4,7 @@ Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
\[ 0\] NULL 00000000 000000 000000 00 0 0 0
\[ 1\] \.hash HASH 00008000 001000 00003c 04 A 2 0 4
- \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 5 4
+ \[ 2\] \.dynsym DYNSYM 0000803c 00103c 0000a0 10 A 3 7 4
\[ 3\] \.dynstr STRTAB 000080dc 0010dc 00001d 00 A 0 0 1
\[ 4\] \.rela\.got RELA 000080fc 0010fc 000024 0c AI 2 8 4
\[ 5\] \.rela\.neardata RELA 00008120 001120 000018 0c AI 2 9 4
--- binutils-2.27.orig/binutils/readelf.c 2016-08-12 17:14:07.717773841 +0100
+++ binutils-2.27/binutils/readelf.c 2016-08-12 17:24:25.007897415 +0100
@@ -11110,6 +11110,11 @@ process_symbol_table (FILE * file)
}
putchar ('\n');
+
+ if (ELF_ST_BIND (psym->st_info) == STB_LOCAL
+ && si >= section->sh_info)
+ warn (_("local symbol %u found at index >= %s's sh_info value of %u\n"),
+ si, printable_section_name (section), section->sh_info);
}
free (symtab);

File diff suppressed because it is too large Load Diff

View File

@ -1,694 +0,0 @@
diff -rup binutils.orig/bfd/dwarf2.c binutils-2.27/bfd/dwarf2.c
--- binutils.orig/bfd/dwarf2.c 2017-01-09 10:55:15.558436986 +0000
+++ binutils-2.27/bfd/dwarf2.c 2017-01-09 13:40:38.642944116 +0000
@@ -1,5 +1,5 @@
/* DWARF 2 support.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-2017 Free Software Foundation, Inc.
Adapted from gdb/dwarf2read.c by Gavin Koch of Cygnus Solutions
(gavin@cygnus.com).
@@ -144,16 +144,16 @@ struct dwarf2_debug
/* Length of the loaded .debug_str section. */
bfd_size_type dwarf_str_size;
- /* Pointer to the .debug_ranges section loaded into memory. */
+ /* Pointer to the .debug_ranges section loaded into memory. */
bfd_byte *dwarf_ranges_buffer;
- /* Length of the loaded .debug_ranges section. */
+ /* Length of the loaded .debug_ranges section. */
bfd_size_type dwarf_ranges_size;
/* If the most recent call to bfd_find_nearest_line was given an
address in an inlined function, preserve a pointer into the
calling chain for subsequent calls to bfd_find_inliner_info to
- use. */
+ use. */
struct funcinfo *inliner_chain;
/* Section VMAs at the time the stash was built. */
@@ -212,9 +212,12 @@ struct comp_unit
/* Keep the bfd convenient (for memory allocation). */
bfd *abfd;
- /* The lowest and highest addresses contained in this compilation
- unit as specified in the compilation unit header. */
+ /* Linked list of the low and high address ranges contained in this
+ compilation unit as specified in the compilation unit header. */
struct arange arange;
+ /* A single arange containing the lowest and highest
+ addresses covered by the compilation unit. */
+ struct arange minmax;
/* The DW_AT_name attribute (for error messages). */
char *name;
@@ -396,7 +399,7 @@ struct info_hash_table
struct bfd_hash_table base;
};
-/* Function to create a new entry in info hash table. */
+/* Function to create a new entry in info hash table. */
static struct bfd_hash_entry *
info_hash_table_newfunc (struct bfd_hash_entry *entry,
@@ -482,7 +485,7 @@ insert_info_hash_table (struct info_hash
}
/* Look up an info entry list from an info hash table. Return NULL
- if there is none. */
+ if there is none. */
static struct info_list_node *
lookup_info_hash_table (struct info_hash_table *hash_table, const char *key)
@@ -523,8 +526,8 @@ read_section (bfd * abfd,
}
if (! msec)
{
- (*_bfd_error_handler) (_("Dwarf Error: Can't find %s section."),
- sec->uncompressed_name);
+ _bfd_error_handler (_("Dwarf Error: Can't find %s section."),
+ sec->uncompressed_name);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
@@ -552,9 +555,10 @@ read_section (bfd * abfd,
that the client wants. Validate it here to avoid trouble later. */
if (offset != 0 && offset >= *section_size)
{
- (*_bfd_error_handler) (_("Dwarf Error: Offset (%lu)"
- " greater than or equal to %s size (%lu)."),
- (long) offset, section_name, *section_size);
+ /* xgettext: c-format */
+ _bfd_error_handler (_("Dwarf Error: Offset (%lu)"
+ " greater than or equal to %s size (%lu)."),
+ (long) offset, section_name, *section_size);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
@@ -1011,7 +1015,7 @@ read_attribute_value (struct attribute *
if (info_ptr >= info_ptr_end && form != DW_FORM_flag_present)
{
- (*_bfd_error_handler) (_("Dwarf Error: Info pointer extends beyond end of attributes"));
+ _bfd_error_handler (_("Dwarf Error: Info pointer extends beyond end of attributes"));
bfd_set_error (bfd_error_bad_value);
return info_ptr;
}
@@ -1163,8 +1167,8 @@ read_attribute_value (struct attribute *
info_ptr = read_attribute_value (attr, form, unit, info_ptr, info_ptr_end);
break;
default:
- (*_bfd_error_handler) (_("Dwarf Error: Invalid or unhandled FORM value: %#x."),
- form);
+ _bfd_error_handler (_("Dwarf Error: Invalid or unhandled FORM value: %#x."),
+ form);
bfd_set_error (bfd_error_bad_value);
return NULL;
}
@@ -1219,22 +1223,22 @@ non_mangled (int lang)
struct line_info
{
- struct line_info* prev_line;
- bfd_vma address;
- char *filename;
- unsigned int line;
- unsigned int column;
- unsigned int discriminator;
- unsigned char op_index;
- unsigned char end_sequence; /* End of (sequential) code sequence. */
+ struct line_info * prev_line;
+ bfd_vma address;
+ char * filename;
+ unsigned int line;
+ unsigned int column;
+ unsigned int discriminator;
+ unsigned char op_index;
+ unsigned char end_sequence; /* End of (sequential) code sequence. */
};
struct fileinfo
{
- char *name;
- unsigned int dir;
- unsigned int time;
- unsigned int size;
+ char * name;
+ unsigned int dir;
+ unsigned int time;
+ unsigned int size;
};
struct line_sequence
@@ -1248,7 +1252,7 @@ struct line_sequence
struct line_info_table
{
- bfd* abfd;
+ bfd * abfd;
unsigned int num_files;
unsigned int num_dirs;
unsigned int num_sequences;
@@ -1267,37 +1271,37 @@ struct line_info_table
struct funcinfo
{
/* Pointer to previous function in list of all functions. */
- struct funcinfo *prev_func;
+ struct funcinfo * prev_func;
/* Pointer to function one scope higher. */
- struct funcinfo *caller_func;
+ struct funcinfo * caller_func;
/* Source location file name where caller_func inlines this func. */
- char *caller_file;
+ char * caller_file;
/* Source location file name. */
- char *file;
+ char * file;
/* Source location line number where caller_func inlines this func. */
- int caller_line;
+ int caller_line;
/* Source location line number. */
- int line;
- int tag;
- bfd_boolean is_linkage;
- const char *name;
- struct arange arange;
+ int line;
+ int tag;
+ bfd_boolean is_linkage;
+ const char * name;
+ struct arange arange;
/* Where the symbol is defined. */
- asection *sec;
+ asection * sec;
};
struct lookup_funcinfo
{
/* Function information corresponding to this lookup table entry. */
- struct funcinfo *funcinfo;
+ struct funcinfo * funcinfo;
/* The lowest address for this specific function. */
- bfd_vma low_addr;
+ bfd_vma low_addr;
/* The highest address of this function before the lookup table is sorted.
- The highest address of all prior functions after the lookup table is sorted,
- which is used for binary search. */
- bfd_vma high_addr;
+ The highest address of all prior functions after the lookup table is
+ sorted, which is used for binary search. */
+ bfd_vma high_addr;
};
struct varinfo
@@ -1468,7 +1472,7 @@ concat_filename (struct line_info_table
{
/* FILE == 0 means unknown. */
if (file)
- (*_bfd_error_handler)
+ _bfd_error_handler
(_("Dwarf Error: mangled line number section (bad file number)."));
return strdup ("<unknown>");
}
@@ -1524,7 +1528,7 @@ concat_filename (struct line_info_table
}
static bfd_boolean
-arange_add (const struct comp_unit *unit, struct arange *first_arange,
+arange_add (struct comp_unit *unit, struct arange *first_arange,
bfd_vma low_pc, bfd_vma high_pc)
{
struct arange *arange;
@@ -1536,11 +1540,16 @@ arange_add (const struct comp_unit *unit
/* If the first arange is empty, use it. */
if (first_arange->high == 0)
{
- first_arange->low = low_pc;
- first_arange->high = high_pc;
+ unit->minmax.low = first_arange->low = low_pc;
+ unit->minmax.high = first_arange->high = high_pc;
return TRUE;
}
+ if (unit->minmax.low > low_pc)
+ unit->minmax.low = low_pc;
+ if (unit->minmax.high < high_pc)
+ unit->minmax.high = high_pc;
+
/* Next see if we can cheaply extend an existing range. */
arange = first_arange;
do
@@ -1560,7 +1569,7 @@ arange_add (const struct comp_unit *unit
while (arange);
/* Need to allocate a new arange and insert it into the arange list.
- Order isn't significant, so just insert after the first arange. */
+ Order isn't significant, so just insert after the first arange. */
arange = (struct arange *) bfd_alloc (unit->abfd, sizeof (*arange));
if (arange == NULL)
return FALSE;
@@ -1603,20 +1612,22 @@ compare_sequences (const void* a, const
/* Construct the line information table for quick lookup. */
static bfd_boolean
-build_line_info_table (struct line_info_table* table, struct line_sequence *seq)
+build_line_info_table (struct line_info_table * table,
+ struct line_sequence * seq)
{
- bfd_size_type amt;
+ bfd_size_type amt;
struct line_info** line_info_lookup;
- struct line_info* each_line;
- unsigned int num_lines;
- unsigned int index;
+ struct line_info* each_line;
+ unsigned int num_lines;
+ unsigned int line_index;
if (seq->line_info_lookup != NULL)
return TRUE;
/* Count the number of line information entries. We could do this while
- scanning the debug information, but some entries may be added via lcl_head
- without having a sequence handy to increment the number of lines. */
+ scanning the debug information, but some entries may be added via
+ lcl_head without having a sequence handy to increment the number of
+ lines. */
num_lines = 0;
for (each_line = seq->last_line; each_line; each_line = each_line->prev_line)
num_lines++;
@@ -1631,11 +1642,11 @@ build_line_info_table (struct line_info_
return FALSE;
/* Create the line information lookup table. */
- index = num_lines;
+ line_index = num_lines;
for (each_line = seq->last_line; each_line; each_line = each_line->prev_line)
- line_info_lookup[--index] = each_line;
+ line_info_lookup[--line_index] = each_line;
- BFD_ASSERT (index == 0);
+ BFD_ASSERT (line_index == 0);
seq->num_lines = num_lines;
seq->line_info_lookup = line_info_lookup;
@@ -1648,12 +1659,12 @@ build_line_info_table (struct line_info_
static bfd_boolean
sort_line_sequences (struct line_info_table* table)
{
- bfd_size_type amt;
- struct line_sequence* sequences;
- struct line_sequence* seq;
- unsigned int n = 0;
- unsigned int num_sequences = table->num_sequences;
- bfd_vma last_high_pc;
+ bfd_size_type amt;
+ struct line_sequence* sequences;
+ struct line_sequence* seq;
+ unsigned int n = 0;
+ unsigned int num_sequences = table->num_sequences;
+ bfd_vma last_high_pc;
if (num_sequences == 0)
return TRUE;
@@ -1754,7 +1765,7 @@ decode_line_info (struct comp_unit *unit
if (stash->dwarf_line_size < 16)
{
- (*_bfd_error_handler)
+ _bfd_error_handler
(_("Dwarf Error: Line info section is too small (%ld)"),
(long) stash->dwarf_line_size);
bfd_set_error (bfd_error_bad_value);
@@ -1783,7 +1794,8 @@ decode_line_info (struct comp_unit *unit
if (lh.total_length > stash->dwarf_line_size)
{
- (*_bfd_error_handler)
+ _bfd_error_handler
+ /* xgettext: c-format */
(_("Dwarf Error: Line info data is bigger (0x%lx) than the section (0x%lx)"),
(long) lh.total_length, (long) stash->dwarf_line_size);
bfd_set_error (bfd_error_bad_value);
@@ -1795,7 +1807,7 @@ decode_line_info (struct comp_unit *unit
lh.version = read_2_bytes (abfd, line_ptr, line_end);
if (lh.version < 2 || lh.version > 4)
{
- (*_bfd_error_handler)
+ _bfd_error_handler
(_("Dwarf Error: Unhandled .debug_line version %d."), lh.version);
bfd_set_error (bfd_error_bad_value);
return NULL;
@@ -1804,7 +1816,7 @@ decode_line_info (struct comp_unit *unit
if (line_ptr + offset_size + (lh.version >=4 ? 6 : 5) >= line_end)
{
- (*_bfd_error_handler)
+ _bfd_error_handler
(_("Dwarf Error: Ran out of room reading prologue"));
bfd_set_error (bfd_error_bad_value);
return NULL;
@@ -1829,7 +1841,7 @@ decode_line_info (struct comp_unit *unit
if (lh.maximum_ops_per_insn == 0)
{
- (*_bfd_error_handler)
+ _bfd_error_handler
(_("Dwarf Error: Invalid maximum operations per instruction."));
bfd_set_error (bfd_error_bad_value);
return NULL;
@@ -1849,7 +1861,7 @@ decode_line_info (struct comp_unit *unit
if (line_ptr + (lh.opcode_base - 1) >= line_end)
{
- (*_bfd_error_handler) (_("Dwarf Error: Ran out of room reading opcodes"));
+ _bfd_error_handler (_("Dwarf Error: Ran out of room reading opcodes"));
bfd_set_error (bfd_error_bad_value);
return NULL;
}
@@ -2036,7 +2048,7 @@ decode_line_info (struct comp_unit *unit
line_ptr += exop_len - 1;
break;
default:
- (*_bfd_error_handler)
+ _bfd_error_handler
(_("Dwarf Error: mangled line number section."));
bfd_set_error (bfd_error_bad_value);
line_fail:
@@ -2218,45 +2230,44 @@ fail:
/* Read in the .debug_ranges section for future reference. */
static bfd_boolean
-read_debug_ranges (struct comp_unit *unit)
+read_debug_ranges (struct comp_unit * unit)
{
- struct dwarf2_debug *stash = unit->stash;
+ struct dwarf2_debug * stash = unit->stash;
+
return read_section (unit->abfd, &stash->debug_sections[debug_ranges],
stash->syms, 0,
- &stash->dwarf_ranges_buffer, &stash->dwarf_ranges_size);
+ &stash->dwarf_ranges_buffer,
+ &stash->dwarf_ranges_size);
}
/* Function table functions. */
static int
-compare_lookup_funcinfos (const void* a, const void* b)
+compare_lookup_funcinfos (const void * a, const void * b)
{
- const struct lookup_funcinfo *lookup1 = a;
- const struct lookup_funcinfo *lookup2 = b;
- int result;
+ const struct lookup_funcinfo * lookup1 = a;
+ const struct lookup_funcinfo * lookup2 = b;
if (lookup1->low_addr < lookup2->low_addr)
- result = -1;
- else if (lookup1->low_addr > lookup2->low_addr)
- result = 1;
- else if (lookup1->high_addr < lookup2->high_addr)
- result = -1;
- else if (lookup1->high_addr > lookup1->high_addr)
- result = 1;
- else
- result = 0;
+ return -1;
+ if (lookup1->low_addr > lookup2->low_addr)
+ return 1;
+ if (lookup1->high_addr < lookup2->high_addr)
+ return -1;
+ if (lookup1->high_addr > lookup2->high_addr)
+ return 1;
- return result;
+ return 0;
}
static bfd_boolean
-build_lookup_funcinfo_table (struct comp_unit *unit)
+build_lookup_funcinfo_table (struct comp_unit * unit)
{
struct lookup_funcinfo *lookup_funcinfo_table = unit->lookup_funcinfo_table;
unsigned int number_of_functions = unit->number_of_functions;
struct funcinfo *each;
struct lookup_funcinfo *entry;
- size_t index;
+ size_t func_index;
struct arange *range;
bfd_vma low_addr, high_addr;
@@ -2270,10 +2281,10 @@ build_lookup_funcinfo_table (struct comp
return FALSE;
/* Populate the function info lookup table. */
- index = number_of_functions;
+ func_index = number_of_functions;
for (each = unit->function_table; each; each = each->prev_func)
{
- entry = &lookup_funcinfo_table[--index];
+ entry = &lookup_funcinfo_table[--func_index];
entry->funcinfo = each;
/* Calculate the lowest and highest address for this function entry. */
@@ -2281,30 +2292,30 @@ build_lookup_funcinfo_table (struct comp
high_addr = entry->funcinfo->arange.high;
for (range = entry->funcinfo->arange.next; range; range = range->next)
- {
- if (range->low < low_addr)
- low_addr = range->low;
- if (range->high > high_addr)
- high_addr = range->high;
- }
+ {
+ if (range->low < low_addr)
+ low_addr = range->low;
+ if (range->high > high_addr)
+ high_addr = range->high;
+ }
entry->low_addr = low_addr;
entry->high_addr = high_addr;
}
- BFD_ASSERT (index == 0);
+ BFD_ASSERT (func_index == 0);
/* Sort the function by address. */
qsort (lookup_funcinfo_table,
- number_of_functions,
- sizeof (struct lookup_funcinfo),
- compare_lookup_funcinfos);
+ number_of_functions,
+ sizeof (struct lookup_funcinfo),
+ compare_lookup_funcinfos);
/* Calculate the high watermark for each function in the lookup table. */
high_addr = lookup_funcinfo_table[0].high_addr;
- for (index = 1; index < number_of_functions; index++)
+ for (func_index = 1; func_index < number_of_functions; func_index++)
{
- entry = &lookup_funcinfo_table[index];
+ entry = &lookup_funcinfo_table[func_index];
if (entry->high_addr > high_addr)
high_addr = entry->high_addr;
else
@@ -2333,9 +2344,15 @@ lookup_address_in_function_table (struct
bfd_size_type low, high, mid, first;
struct arange *arange;
+ if (number_of_functions == 0)
+ return FALSE;
+
if (!build_lookup_funcinfo_table (unit))
return FALSE;
+ if (unit->lookup_funcinfo_table[number_of_functions - 1].high_addr < addr)
+ return FALSE;
+
/* Find the first function in the lookup table which may contain the
specified address. */
low = 0;
@@ -2474,8 +2491,8 @@ lookup_symbol_in_variable_table (struct
*linenumber_ptr = each->line;
return TRUE;
}
- else
- return FALSE;
+
+ return FALSE;
}
static char *
@@ -2531,7 +2548,7 @@ find_abstract_instance_name (struct comp
info_ptr = read_alt_indirect_ref (unit, die_ref);
if (info_ptr == NULL)
{
- (*_bfd_error_handler)
+ _bfd_error_handler
(_("Dwarf Error: Unable to read alt ref %u."), die_ref);
bfd_set_error (bfd_error_bad_value);
return NULL;
@@ -2555,7 +2572,7 @@ find_abstract_instance_name (struct comp
abbrev = lookup_abbrev (abbrev_number, unit->abbrevs);
if (! abbrev)
{
- (*_bfd_error_handler)
+ _bfd_error_handler
(_("Dwarf Error: Could not find abbrev number %u."), abbrev_number);
bfd_set_error (bfd_error_bad_value);
}
@@ -2699,7 +2716,7 @@ scan_unit_for_symbols (struct comp_unit
abbrev = lookup_abbrev (abbrev_number,unit->abbrevs);
if (! abbrev)
{
- (*_bfd_error_handler)
+ _bfd_error_handler
(_("Dwarf Error: Could not find abbrev number %u."),
abbrev_number);
bfd_set_error (bfd_error_bad_value);
@@ -2969,7 +2986,7 @@ parse_comp_unit (struct dwarf2_debug *st
an error, just return a NULL. */
if (version)
{
- (*_bfd_error_handler)
+ _bfd_error_handler
(_("Dwarf Error: found dwarf version '%u', this reader"
" only handles version 2, 3 and 4 information."), version);
bfd_set_error (bfd_error_bad_value);
@@ -2979,7 +2996,8 @@ parse_comp_unit (struct dwarf2_debug *st
if (addr_size > sizeof (bfd_vma))
{
- (*_bfd_error_handler)
+ _bfd_error_handler
+ /* xgettext: c-format */
(_("Dwarf Error: found address size '%u', this reader"
" can not handle sizes greater than '%u'."),
addr_size,
@@ -2990,7 +3008,7 @@ parse_comp_unit (struct dwarf2_debug *st
if (addr_size != 2 && addr_size != 4 && addr_size != 8)
{
- (*_bfd_error_handler)
+ _bfd_error_handler
("Dwarf Error: found address size '%u', this reader"
" can only handle address sizes '2', '4' and '8'.", addr_size);
bfd_set_error (bfd_error_bad_value);
@@ -3016,8 +3034,8 @@ parse_comp_unit (struct dwarf2_debug *st
abbrev = lookup_abbrev (abbrev_number, abbrevs);
if (! abbrev)
{
- (*_bfd_error_handler) (_("Dwarf Error: Could not find abbrev number %u."),
- abbrev_number);
+ _bfd_error_handler (_("Dwarf Error: Could not find abbrev number %u."),
+ abbrev_number);
bfd_set_error (bfd_error_bad_value);
return NULL;
}
@@ -3059,7 +3077,7 @@ parse_comp_unit (struct dwarf2_debug *st
low_pc = attr.u.val;
/* If the compilation unit DIE has a DW_AT_low_pc attribute,
this is the base address to use when reading location
- lists or range lists. */
+ lists or range lists. */
if (abbrev->tag == DW_TAG_compile_unit)
unit->base_address = low_pc;
break;
@@ -3081,7 +3099,7 @@ parse_comp_unit (struct dwarf2_debug *st
/* PR 17512: file: 1fe726be. */
if (! is_str_attr (attr.form))
{
- (*_bfd_error_handler)
+ _bfd_error_handler
(_("Dwarf Error: DW_AT_comp_dir attribute encountered with a non-string form."));
comp_dir = NULL;
}
@@ -3133,6 +3151,11 @@ comp_unit_contains_address (struct comp_
if (unit->error)
return FALSE;
+ if (unit->minmax.high < addr || unit->minmax.low > addr)
+ return FALSE;
+
+ /* We know that the address *might* be contained within this comp
+ unit, but we cannot be sure until we check the specific ranges. */
arange = &unit->arange;
do
{
@@ -3330,7 +3353,7 @@ comp_unit_hash_info (struct dwarf2_debug
each_func && okay;
each_func = each_func->prev_func)
{
- /* Skip nameless functions. */
+ /* Skip nameless functions. */
if (each_func->name)
/* There is no need to copy name string into hash table as
name string is either in the dwarf string buffer or
@@ -3712,7 +3735,7 @@ stash_maybe_update_info_hash_tables (str
return TRUE;
}
-/* Check consistency of info hash tables. This is for debugging only. */
+/* Check consistency of info hash tables. This is for debugging only. */
static void ATTRIBUTE_UNUSED
stash_verify_info_hash_table (struct dwarf2_debug *stash)
@@ -4146,7 +4169,7 @@ _bfd_dwarf2_find_nearest_line (bfd *abfd
stash_maybe_enable_info_hash_tables (abfd, stash);
/* Keep info hash table up to date if they are available. Note that we
- may disable the hash tables if there is any error duing update. */
+ may disable the hash tables if there is any error duing update. */
if (stash->info_hash_status == STASH_INFO_HASH_ON)
stash_maybe_update_info_hash_tables (stash);
diff -rup binutils.orig/binutils/objdump.c binutils-2.27/binutils/objdump.c
--- binutils.orig/binutils/objdump.c 2017-01-09 10:55:15.771433447 +0000
+++ binutils-2.27/binutils/objdump.c 2017-01-09 13:36:45.936970981 +0000
@@ -3603,7 +3603,7 @@ display_any_bfd (bfd *file, int level)
}
static void
-display_file (char *filename, char *target)
+display_file (char *filename, char *target, bfd_boolean last_file)
{
bfd *file;
@@ -3622,7 +3622,14 @@ display_file (char *filename, char *targ
display_any_bfd (file, 0);
- bfd_close (file);
+ /* This is an optimization to improve the speed of objdump, especially when
+ dumping a file with lots of associated debug informatiom. Closing such
+ a file can take a non-trivial amount of time as there are lots of lists
+ to walk and buffers to free. This is only really necessary however if
+ we are about to load another file. Otherwise, if we are about to exit,
+ then we can save (a lot of) time by not bothering to do any tidying up. */
+ if (! last_file)
+ bfd_close (file);
}
int
@@ -3900,10 +3907,13 @@ main (int argc, char **argv)
else
{
if (optind == argc)
- display_file ("a.out", target);
+ display_file ("a.out", target, TRUE);
else
for (; optind < argc;)
- display_file (argv[optind++], target);
+ {
+ display_file (argv[optind], target, optind == argc - 1);
+ optind++;
+ }
}
free_only_list ();

File diff suppressed because it is too large Load Diff

View File

@ -1,627 +0,0 @@
diff -rup binutils.orig/bfd/elf32-ppc.c binutils-2.27/bfd/elf32-ppc.c
--- binutils.orig/bfd/elf32-ppc.c 2017-02-17 12:43:45.252843756 +0000
+++ binutils-2.27/bfd/elf32-ppc.c 2017-02-17 14:06:39.341735795 +0000
@@ -4646,68 +4646,87 @@ ppc_elf_check_relocs (bfd *abfd,
return TRUE;
}
-
-/* Merge object attributes from IBFD into OBFD. Raise an error if
- there are conflicting attributes. */
-static bfd_boolean
-ppc_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd)
+/* Warn for conflicting Tag_GNU_Power_ABI_FP attributes between IBFD
+ and OBFD, and merge non-conflicting ones. */
+void
+_bfd_elf_ppc_merge_fp_attributes (bfd *ibfd, bfd *obfd)
{
obj_attribute *in_attr, *in_attrs;
obj_attribute *out_attr, *out_attrs;
- if (!elf_known_obj_attributes_proc (obfd)[0].i)
- {
- /* This is the first object. Copy the attributes. */
- _bfd_elf_copy_obj_attributes (ibfd, obfd);
-
- /* Use the Tag_null value to indicate the attributes have been
- initialized. */
- elf_known_obj_attributes_proc (obfd)[0].i = 1;
-
- return TRUE;
- }
-
in_attrs = elf_known_obj_attributes (ibfd)[OBJ_ATTR_GNU];
out_attrs = elf_known_obj_attributes (obfd)[OBJ_ATTR_GNU];
- /* Check for conflicting Tag_GNU_Power_ABI_FP attributes and merge
- non-conflicting ones. */
in_attr = &in_attrs[Tag_GNU_Power_ABI_FP];
out_attr = &out_attrs[Tag_GNU_Power_ABI_FP];
+
if (in_attr->i != out_attr->i)
{
- out_attr->type = 1;
- if (out_attr->i == 0)
- out_attr->i = in_attr->i;
- else if (in_attr->i == 0)
+ int in_fp = in_attr->i & 3;
+ int out_fp = out_attr->i & 3;
+
+ if (in_fp == 0)
;
- else if (out_attr->i == 1 && in_attr->i == 2)
+ else if (out_fp == 0)
+ {
+ out_attr->type = 1;
+ out_attr->i ^= in_fp;
+ }
+ else if (out_fp != 2 && in_fp == 2)
_bfd_error_handler
(_("Warning: %B uses hard float, %B uses soft float"), obfd, ibfd);
- else if (out_attr->i == 1 && in_attr->i == 3)
- _bfd_error_handler
- (_("Warning: %B uses double-precision hard float, %B uses single-precision hard float"),
- obfd, ibfd);
- else if (out_attr->i == 3 && in_attr->i == 1)
- _bfd_error_handler
- (_("Warning: %B uses double-precision hard float, %B uses single-precision hard float"),
- ibfd, obfd);
- else if (out_attr->i == 3 && in_attr->i == 2)
- _bfd_error_handler
- (_("Warning: %B uses soft float, %B uses single-precision hard float"),
- ibfd, obfd);
- else if (out_attr->i == 2 && (in_attr->i == 1 || in_attr->i == 3))
+ else if (out_fp == 2 && in_fp != 2)
_bfd_error_handler
(_("Warning: %B uses hard float, %B uses soft float"), ibfd, obfd);
- else if (in_attr->i > 3)
+ else if (out_fp == 1 && in_fp == 3)
_bfd_error_handler
- (_("Warning: %B uses unknown floating point ABI %d"), ibfd,
- in_attr->i);
- else
+ (_("Warning: %B uses double-precision hard float, "
+ "%B uses single-precision hard float"), obfd, ibfd);
+ else if (out_fp == 3 && in_fp == 1)
+ _bfd_error_handler
+ (_("Warning: %B uses double-precision hard float, "
+ "%B uses single-precision hard float"), ibfd, obfd);
+
+ in_fp = in_attr->i & 0xc;
+ out_fp = out_attr->i & 0xc;
+ if (in_fp == 0)
+ ;
+ else if (out_fp == 0)
+ {
+ out_attr->type = 1;
+ out_attr->i ^= in_fp;
+ }
+ else if (out_fp != 2 * 4 && in_fp == 2 * 4)
_bfd_error_handler
- (_("Warning: %B uses unknown floating point ABI %d"), obfd,
- out_attr->i);
+ (_("Warning: %B uses 64-bit long double, "
+ "%B uses 128-bit long double"), ibfd, obfd);
+ else if (in_fp != 2 * 4 && out_fp == 2 * 4)
+ _bfd_error_handler
+ (_("Warning: %B uses 64-bit long double, "
+ "%B uses 128-bit long double"), obfd, ibfd);
+ else if (out_fp == 1 * 4 && in_fp == 3 * 4)
+ _bfd_error_handler
+ (_("Warning: %B uses IBM long double, "
+ "%B uses IEEE long double"), ibfd, obfd);
+ else if (out_fp == 3 * 4 && in_fp == 1 * 4)
+ _bfd_error_handler
+ (_("Warning: %B uses IBM long double, "
+ "%B uses IEEE long double"), obfd, ibfd);
}
+}
+
+/* Merge object attributes from IBFD into OBFD. Warn if
+ there are conflicting attributes. */
+static bfd_boolean
+ppc_elf_merge_obj_attributes (bfd *ibfd, bfd *obfd)
+{
+ obj_attribute *in_attr, *in_attrs;
+ obj_attribute *out_attr, *out_attrs;
+
+ _bfd_elf_ppc_merge_fp_attributes (ibfd, obfd);
+
+ in_attrs = elf_known_obj_attributes (ibfd)[OBJ_ATTR_GNU];
+ out_attrs = elf_known_obj_attributes (obfd)[OBJ_ATTR_GNU];
/* Check for conflicting Tag_GNU_Power_ABI_Vector attributes and
merge non-conflicting ones. */
@@ -4715,48 +4734,36 @@ ppc_elf_merge_obj_attributes (bfd *ibfd,
out_attr = &out_attrs[Tag_GNU_Power_ABI_Vector];
if (in_attr->i != out_attr->i)
{
- const char *in_abi = NULL, *out_abi = NULL;
-
- switch (in_attr->i)
- {
- case 1: in_abi = "generic"; break;
- case 2: in_abi = "AltiVec"; break;
- case 3: in_abi = "SPE"; break;
- }
+ int in_vec = in_attr->i & 3;
+ int out_vec = out_attr->i & 3;
- switch (out_attr->i)
+ if (in_vec == 0)
+ ;
+ else if (out_vec == 0)
{
- case 1: out_abi = "generic"; break;
- case 2: out_abi = "AltiVec"; break;
- case 3: out_abi = "SPE"; break;
+ out_attr->type = 1;
+ out_attr->i = in_vec;
}
-
- out_attr->type = 1;
- if (out_attr->i == 0)
- out_attr->i = in_attr->i;
- else if (in_attr->i == 0)
- ;
/* For now, allow generic to transition to AltiVec or SPE
without a warning. If GCC marked files with their stack
alignment and used don't-care markings for files which are
not affected by the vector ABI, we could warn about this
case too. */
- else if (out_attr->i == 1)
- out_attr->i = in_attr->i;
- else if (in_attr->i == 1)
+ else if (in_vec == 1)
;
- else if (in_abi == NULL)
+ else if (out_vec == 1)
+ {
+ out_attr->type = 1;
+ out_attr->i = in_vec;
+ }
+ else if (out_vec < in_vec)
_bfd_error_handler
- (_("Warning: %B uses unknown vector ABI %d"), ibfd,
- in_attr->i);
- else if (out_abi == NULL)
- _bfd_error_handler
- (_("Warning: %B uses unknown vector ABI %d"), obfd,
- in_attr->i);
- else
+ (_("Warning: %B uses AltiVec vector ABI, %B uses SPE vector ABI"),
+ obfd, ibfd);
+ else if (out_vec > in_vec)
_bfd_error_handler
- (_("Warning: %B uses vector ABI \"%s\", %B uses \"%s\""),
- ibfd, obfd, in_abi, out_abi);
+ (_("Warning: %B uses AltiVec vector ABI, %B uses SPE vector ABI"),
+ ibfd, obfd);
}
/* Check for conflicting Tag_GNU_Power_ABI_Struct_Return attributes
@@ -4765,25 +4772,24 @@ ppc_elf_merge_obj_attributes (bfd *ibfd,
out_attr = &out_attrs[Tag_GNU_Power_ABI_Struct_Return];
if (in_attr->i != out_attr->i)
{
- out_attr->type = 1;
- if (out_attr->i == 0)
- out_attr->i = in_attr->i;
- else if (in_attr->i == 0)
+ int in_struct = in_attr->i & 3;
+ int out_struct = out_attr->i & 3;
+
+ if (in_struct == 0 || in_struct == 3)
;
- else if (out_attr->i == 1 && in_attr->i == 2)
- _bfd_error_handler
- (_("Warning: %B uses r3/r4 for small structure returns, %B uses memory"), obfd, ibfd);
- else if (out_attr->i == 2 && in_attr->i == 1)
- _bfd_error_handler
- (_("Warning: %B uses r3/r4 for small structure returns, %B uses memory"), ibfd, obfd);
- else if (in_attr->i > 2)
- _bfd_error_handler
- (_("Warning: %B uses unknown small structure return convention %d"), ibfd,
- in_attr->i);
- else
- _bfd_error_handler
- (_("Warning: %B uses unknown small structure return convention %d"), obfd,
- out_attr->i);
+ else if (out_struct == 0)
+ {
+ out_attr->type = 1;
+ out_attr->i = in_struct;
+ }
+ else if (out_struct < in_struct)
+ _bfd_error_handler
+ (_("Warning: %B uses r3/r4 for small structure returns, "
+ "%B uses memory"), obfd, ibfd);
+ else if (out_struct > in_struct)
+ _bfd_error_handler
+ (_("Warning: %B uses r3/r4 for small structure returns, "
+ "%B uses memory"), ibfd, obfd);
}
/* Merge Tag_compatibility attributes and any common GNU ones. */
Only in binutils-2.27/bfd: elf32-ppc.c.orig
diff -rup binutils.orig/bfd/elf64-ppc.c binutils-2.27/bfd/elf64-ppc.c
--- binutils.orig/bfd/elf64-ppc.c 2017-02-17 12:43:45.257843692 +0000
+++ binutils-2.27/bfd/elf64-ppc.c 2017-02-17 14:06:45.374655107 +0000
@@ -5988,6 +5988,8 @@ ppc64_elf_merge_private_bfd_data (bfd *i
return FALSE;
}
+ _bfd_elf_ppc_merge_fp_attributes (ibfd, obfd);
+
/* Merge Tag_compatibility attributes and any common GNU ones. */
_bfd_elf_merge_object_attributes (ibfd, obfd);
Only in binutils-2.27/bfd: elf64-ppc.c.orig
diff -rup binutils.orig/bfd/elf-bfd.h binutils-2.27/bfd/elf-bfd.h
--- binutils.orig/bfd/elf-bfd.h 2017-02-17 12:43:45.224844113 +0000
+++ binutils-2.27/bfd/elf-bfd.h 2017-02-17 14:06:49.740596712 +0000
@@ -2377,6 +2377,8 @@ extern unsigned int _bfd_elf_ppc_at_tpre
(unsigned int, unsigned int);
/* PowerPC elf_object_p tweak. */
extern bfd_boolean _bfd_elf_ppc_set_arch (bfd *);
+/* PowerPC .gnu.attributes handling common to both 32-bit and 64-bit. */
+extern void _bfd_elf_ppc_merge_fp_attributes (bfd *, bfd *);
/* Exported interface for writing elf corefile notes. */
extern char *elfcore_write_note
Only in binutils-2.27/bfd: elf-bfd.h.orig
diff -rup binutils.orig/binutils/readelf.c binutils-2.27/binutils/readelf.c
--- binutils.orig/binutils/readelf.c 2017-02-17 12:43:45.289843284 +0000
+++ binutils-2.27/binutils/readelf.c 2017-02-17 14:06:54.752529678 +0000
@@ -13243,47 +13243,77 @@ display_power_gnu_attribute (unsigned ch
const unsigned char * const end)
{
unsigned int len;
- int val;
+ unsigned int val;
if (tag == Tag_GNU_Power_ABI_FP)
{
val = read_uleb128 (p, &len, end);
p += len;
printf (" Tag_GNU_Power_ABI_FP: ");
+ if (len == 0)
+ {
+ printf (_("<corrupt>\n"));
+ return p;
+ }
- switch (val)
+ if (val > 15)
+ printf ("(%#x), ", val);
+
+ switch (val & 3)
{
case 0:
- printf (_("Hard or soft float\n"));
+ printf (_("unspecified hard/soft float, "));
break;
case 1:
- printf (_("Hard float\n"));
+ printf (_("hard float, "));
break;
case 2:
- printf (_("Soft float\n"));
+ printf (_("soft float, "));
break;
case 3:
- printf (_("Single-precision hard float\n"));
+ printf (_("single-precision hard float, "));
+ break;
+ }
+
+ switch (val & 0xC)
+ {
+ case 0:
+ printf (_("unspecified long double\n"));
break;
- default:
- printf ("??? (%d)\n", val);
+ case 4:
+ printf (_("128-bit IBM long double\n"));
+ break;
+ case 8:
+ printf (_("64-bit long double\n"));
+ break;
+ case 12:
+ printf (_("128-bit IEEE long double\n"));
break;
}
return p;
- }
+ }
if (tag == Tag_GNU_Power_ABI_Vector)
{
val = read_uleb128 (p, &len, end);
p += len;
printf (" Tag_GNU_Power_ABI_Vector: ");
- switch (val)
+ if (len == 0)
+ {
+ printf (_("<corrupt>\n"));
+ return p;
+ }
+
+ if (val > 3)
+ printf ("(%#x), ", val);
+
+ switch (val & 3)
{
case 0:
- printf (_("Any\n"));
+ printf (_("unspecified\n"));
break;
case 1:
- printf (_("Generic\n"));
+ printf (_("generic\n"));
break;
case 2:
printf ("AltiVec\n");
@@ -13291,39 +13321,39 @@ display_power_gnu_attribute (unsigned ch
case 3:
printf ("SPE\n");
break;
- default:
- printf ("??? (%d)\n", val);
- break;
}
return p;
- }
+ }
if (tag == Tag_GNU_Power_ABI_Struct_Return)
{
- if (p == end)
+ val = read_uleb128 (p, &len, end);
+ p += len;
+ printf (" Tag_GNU_Power_ABI_Struct_Return: ");
+ if (len == 0)
{
- warn (_("corrupt Tag_GNU_Power_ABI_Struct_Return\n"));
+ printf (_("<corrupt>\n"));
return p;
}
- val = read_uleb128 (p, &len, end);
- p += len;
- printf (" Tag_GNU_Power_ABI_Struct_Return: ");
- switch (val)
- {
- case 0:
- printf (_("Any\n"));
- break;
- case 1:
- printf ("r3/r4\n");
- break;
- case 2:
- printf (_("Memory\n"));
- break;
- default:
- printf ("??? (%d)\n", val);
- break;
- }
+ if (val > 2)
+ printf ("(%#x), ", val);
+
+ switch (val & 3)
+ {
+ case 0:
+ printf (_("unspecified\n"));
+ break;
+ case 1:
+ printf ("r3/r4\n");
+ break;
+ case 2:
+ printf (_("memory\n"));
+ break;
+ case 3:
+ printf ("???\n");
+ break;
+ }
return p;
}
Only in binutils-2.27/binutils: readelf.c.orig
diff -rup binutils.orig/gas/config/tc-ppc.c binutils-2.27/gas/config/tc-ppc.c
--- binutils.orig/gas/config/tc-ppc.c 2017-02-17 12:43:45.411841727 +0000
+++ binutils-2.27/gas/config/tc-ppc.c 2017-02-17 14:07:00.702450099 +0000
@@ -133,6 +133,7 @@ static void ppc_elf_rdata (int);
static void ppc_elf_lcomm (int);
static void ppc_elf_localentry (int);
static void ppc_elf_abiversion (int);
+static void ppc_elf_gnu_attribute (int);
#endif
#ifdef TE_PE
@@ -270,6 +271,7 @@ const pseudo_typeS md_pseudo_table[] =
{ "lcomm", ppc_elf_lcomm, 0 },
{ "localentry", ppc_elf_localentry, 0 },
{ "abiversion", ppc_elf_abiversion, 0 },
+ { "gnu_attribute", ppc_elf_gnu_attribute, 0},
#endif
#ifdef TE_PE
@@ -2314,6 +2316,28 @@ ppc_elf_abiversion (int ignore ATTRIBUTE
demand_empty_rest_of_line ();
}
+/* Parse a .gnu_attribute directive. */
+static void
+ppc_elf_gnu_attribute (int ignored ATTRIBUTE_UNUSED)
+{
+ int tag = obj_elf_vendor_attribute (OBJ_ATTR_GNU);
+
+ /* Check validity of defined powerpc tags. */
+ if (tag == Tag_GNU_Power_ABI_FP
+ || tag == Tag_GNU_Power_ABI_Vector
+ || tag == Tag_GNU_Power_ABI_Struct_Return)
+ {
+ unsigned int val;
+
+ val = bfd_elf_get_obj_attr_int (stdoutput, OBJ_ATTR_GNU, tag);
+
+ if ((tag == Tag_GNU_Power_ABI_FP && val > 15)
+ || (tag == Tag_GNU_Power_ABI_Vector && val > 3)
+ || (tag == Tag_GNU_Power_ABI_Struct_Return && val > 2))
+ as_warn (_("unknown .gnu_attribute value"));
+ }
+}
+
/* Set ABI version in output file. */
void
ppc_elf_end (void)
diff -rup binutils.orig/include/elf/ppc.h binutils-2.27/include/elf/ppc.h
--- binutils.orig/include/elf/ppc.h 2017-02-17 12:43:45.573839660 +0000
+++ binutils-2.27/include/elf/ppc.h 2017-02-17 14:07:05.868381007 +0000
@@ -219,11 +219,18 @@ END_RELOC_NUMBERS (R_PPC_max)
enum
{
/* 0-3 are generic. */
- Tag_GNU_Power_ABI_FP = 4, /* Value 1 for hard-float, 2 for
- soft-float, 3 for single=precision
- hard-float; 0 for not tagged or not
- using any ABIs affected by the
- differences. */
+
+ /* FP ABI, low 2 bits:
+ 1 for double precision hard-float,
+ 2 for soft-float,
+ 3 for single precision hard-float.
+ 0 for not tagged or not using any ABIs affected by the differences.
+ Next 2 bits:
+ 1 for ibm long double
+ 2 for 64-bit long double
+ 3 for IEEE long double.
+ 0 for not tagged or not using any ABIs affected by the differences. */
+ Tag_GNU_Power_ABI_FP = 4,
/* Value 1 for general purpose registers only, 2 for AltiVec
registers, 3 for SPE registers; 0 for not tagged or not using any
diff -rup binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-4-01.d binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-4-01.d
--- binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-4-01.d 2017-02-17 12:43:45.370842251 +0000
+++ binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-4-01.d 2017-02-17 14:07:19.229202307 +0000
@@ -7,4 +7,4 @@
Attribute Section: gnu
File Attributes
- Tag_GNU_Power_ABI_FP: Hard float
+ Tag_GNU_Power_ABI_FP: hard float, unspecified long double
diff -rup binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-4-02.d binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-4-02.d
--- binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-4-02.d 2017-02-17 12:43:45.370842251 +0000
+++ binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-4-02.d 2017-02-17 14:07:30.493051656 +0000
@@ -7,4 +7,4 @@
Attribute Section: gnu
File Attributes
- Tag_GNU_Power_ABI_FP: Soft float
+ Tag_GNU_Power_ABI_FP: soft float, unspecified long double
diff -rup binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-4-03.d binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-4-03.d
--- binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-4-03.d 2017-02-17 12:43:45.370842251 +0000
+++ binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-4-03.d 2017-02-17 14:07:36.925965615 +0000
@@ -7,4 +7,4 @@
Attribute Section: gnu
File Attributes
- Tag_GNU_Power_ABI_FP: Single-precision hard float
+ Tag_GNU_Power_ABI_FP: single-precision hard float, unspecified long double
diff -rup binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-4-10.d binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-4-10.d
--- binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-4-10.d 2017-02-17 12:43:45.370842251 +0000
+++ binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-4-10.d 2017-02-17 14:12:16.129231314 +0000
@@ -7,4 +7,4 @@
Attribute Section: gnu
File Attributes
- Tag_GNU_Power_ABI_FP: Hard float
+ Tag_GNU_Power_ABI_FP: hard float, unspecified long double
diff -rup binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-4-11.d binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-4-11.d
--- binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-4-11.d 2017-02-17 12:43:45.370842251 +0000
+++ binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-4-11.d 2017-02-17 14:07:58.111682262 +0000
@@ -7,4 +7,4 @@
Attribute Section: gnu
File Attributes
- Tag_GNU_Power_ABI_FP: Hard float
+ Tag_GNU_Power_ABI_FP: hard float, unspecified long double
diff -rup binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-4-20.d binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-4-20.d
--- binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-4-20.d 2017-02-17 12:43:45.370842251 +0000
+++ binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-4-20.d 2017-02-17 14:08:08.160547857 +0000
@@ -7,4 +7,4 @@
Attribute Section: gnu
File Attributes
- Tag_GNU_Power_ABI_FP: Soft float
+ Tag_GNU_Power_ABI_FP: soft float, unspecified long double
diff -rup binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-4-22.d binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-4-22.d
--- binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-4-22.d 2017-02-17 12:43:45.370842251 +0000
+++ binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-4-22.d 2017-02-17 14:08:15.552448993 +0000
@@ -7,4 +7,4 @@
Attribute Section: gnu
File Attributes
- Tag_GNU_Power_ABI_FP: Soft float
+ Tag_GNU_Power_ABI_FP: soft float, unspecified long double
diff -rup binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-4-32.d binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-4-32.d
--- binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-4-32.d 2017-02-17 12:43:45.370842251 +0000
+++ binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-4-32.d 2017-02-17 14:08:22.113361240 +0000
@@ -2,5 +2,5 @@
#source: attr-gnu-4-2.s
#as: -a32
#ld: -r -melf32ppc
-#warning: Warning: .* uses soft float, .* uses single-precision hard float
+#warning: Warning: .* uses hard float, .* uses soft float
#target: powerpc*-*-*
diff -rup binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-4-33.d binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-4-33.d
--- binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-4-33.d 2017-02-17 12:43:45.370842251 +0000
+++ binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-4-33.d 2017-02-17 14:08:30.113254244 +0000
@@ -7,4 +7,4 @@
Attribute Section: gnu
File Attributes
- Tag_GNU_Power_ABI_FP: Single-precision hard float
+ Tag_GNU_Power_ABI_FP: single-precision hard float, unspecified long double
diff -rup binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-8-11.d binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-8-11.d
--- binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-8-11.d 2017-02-17 12:43:45.371842238 +0000
+++ binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-8-11.d 2017-02-17 14:08:38.258145308 +0000
@@ -7,4 +7,4 @@
Attribute Section: gnu
File Attributes
- Tag_GNU_Power_ABI_Vector: Generic
+ Tag_GNU_Power_ABI_Vector: generic
diff -rup binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-8-23.d binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-8-23.d
--- binutils.orig/ld/testsuite/ld-powerpc/attr-gnu-8-23.d 2017-02-17 12:43:45.371842238 +0000
+++ binutils-2.27/ld/testsuite/ld-powerpc/attr-gnu-8-23.d 2017-02-17 14:08:46.755031663 +0000
@@ -2,5 +2,5 @@
#source: attr-gnu-8-3.s
#as: -a32
#ld: -r -melf32ppc
-#warning: Warning: .* uses vector ABI "SPE", .* uses "AltiVec"
+#warning: Warning: .* uses AltiVec vector ABI, .* uses SPE vector ABI
#target: powerpc*-*-*
diff -rup binutils.orig/ld/testsuite/ld-powerpc/powerpc.exp binutils-2.27/ld/testsuite/ld-powerpc/powerpc.exp
--- binutils.orig/ld/testsuite/ld-powerpc/powerpc.exp 2017-02-17 12:43:45.371842238 +0000
+++ binutils-2.27/ld/testsuite/ld-powerpc/powerpc.exp 2017-02-17 14:08:54.354930015 +0000
@@ -319,17 +319,13 @@ run_dump_test "attr-gnu-4-10"
run_dump_test "attr-gnu-4-11"
run_dump_test "attr-gnu-4-12"
run_dump_test "attr-gnu-4-13"
-run_dump_test "attr-gnu-4-14"
run_dump_test "attr-gnu-4-20"
run_dump_test "attr-gnu-4-21"
run_dump_test "attr-gnu-4-22"
run_dump_test "attr-gnu-4-23"
-run_dump_test "attr-gnu-4-24"
run_dump_test "attr-gnu-4-31"
run_dump_test "attr-gnu-4-32"
run_dump_test "attr-gnu-4-33"
-run_dump_test "attr-gnu-4-34"
-run_dump_test "attr-gnu-4-41"
run_dump_test "attr-gnu-8-11"
run_dump_test "attr-gnu-8-23"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,104 @@
diff -rup binutils-2.28/libiberty/configure /work/sources/binutils/current/libiberty/configure
--- binutils-2.28/libiberty/configure 2017-03-02 11:41:42.254309307 +0000
+++ /work/sources/binutils/current/libiberty/configure 2017-01-04 16:01:24.944939339 +0000
@@ -5097,7 +5097,7 @@ case "${host}" in
# If we are using a compiler supporting mdynamic-no-pic
# and the option has been tested as safe to add, then cancel
# it here, since the code generated is incompatible with shared
- # libs.
+ # libs.
*-mdynamic-no-pic*) PICFLAG='-fno-common -mno-dynamic-no-pic' ;;
*) PICFLAG=-fno-common ;;
esac
diff -rup binutils-2.28/libiberty/cp-demangle.c /work/sources/binutils/current/libiberty/cp-demangle.c
--- binutils-2.28/libiberty/cp-demangle.c 2017-03-02 08:28:19.000000000 +0000
+++ /work/sources/binutils/current/libiberty/cp-demangle.c 2017-03-01 14:37:20.557586479 +0000
@@ -2595,7 +2594,11 @@ cplus_demangle_type (struct d_info *di)
/* auto */
ret = d_make_name (di, "auto", 4);
break;
-
+ case 'c':
+ /* decltype(auto) */
+ ret = d_make_name (di, "decltype(auto)", 14);
+ break;
+
case 'f':
/* 32-bit decimal floating point */
ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[26]);
diff -rup binutils-2.28/libiberty/Makefile.in /work/sources/binutils/current/libiberty/Makefile.in
--- binutils-2.28/libiberty/Makefile.in 2016-12-23 08:40:18.000000000 +0000
+++ /work/sources/binutils/current/libiberty/Makefile.in 2017-01-04 16:01:24.943939351 +0000
@@ -1,9 +1,7 @@
# Makefile for the libiberty library.
# Originally written by K. Richard Pixley <rich@cygnus.com>.
#
-# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-# 2012, 2014, 2015 Free Software Foundation
+# Copyright (C) 1990-2017 Free Software Foundation, Inc.
#
# This file is part of the libiberty library.
# Libiberty is free software; you can redistribute it and/or
@@ -484,7 +482,8 @@ configure_deps = $(srcdir)/aclocal.m4 \
$(srcdir)/../config/acx.m4 \
$(srcdir)/../config/no-executables.m4 \
$(srcdir)/../config/override.m4 \
- $(srcdir)/../config/warnings.m4 \
+ $(srcdir)/../config/picflag.m4 \
+ $(srcdir)/../config/warnings.m4
$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(configure_deps)
cd $(srcdir) && $(AUTOCONF)
diff -rup binutils-2.28/libiberty/strndup.c /work/sources/binutils/current/libiberty/strndup.c
--- binutils-2.28/libiberty/strndup.c 2013-11-04 15:33:40.000000000 +0000
+++ /work/sources/binutils/current/libiberty/strndup.c 2017-01-04 16:01:24.950939263 +0000
@@ -33,7 +33,7 @@ memory was available. The result is alw
#include "ansidecl.h"
#include <stddef.h>
-extern size_t strlen (const char*);
+extern size_t strnlen (const char *s, size_t maxlen);
extern PTR malloc (size_t);
extern PTR memcpy (PTR, const PTR, size_t);
@@ -41,10 +41,7 @@ char *
strndup (const char *s, size_t n)
{
char *result;
- size_t len = strlen (s);
-
- if (n < len)
- len = n;
+ size_t len = strnlen (s, n);
result = (char *) malloc (len + 1);
if (!result)
diff -rup binutils-2.28/libiberty/testsuite/demangle-expected /work/sources/binutils/current/libiberty/testsuite/demangle-expected
--- binutils-2.28/libiberty/testsuite/demangle-expected 2017-03-02 08:28:19.000000000 +0000
+++ /work/sources/binutils/current/libiberty/testsuite/demangle-expected 2017-03-01 14:37:55.295138174 +0000
@@ -4200,6 +4200,9 @@ decltype (new auto({parm#1})) f<int>(int
_Z1fIiERDaRKT_S1_
auto& f<int>(int const&, int)
--format=gnu-v3
+_Z1gIiEDcRKT_S0_
+decltype(auto) g<int>(int const&, int)
+--format=gnu-v3
_Z1gILi1EEvR1AIXT_EER1BIXscbT_EE
void g<1>(A<1>&, B<static_cast<bool>(1)>&)
--format=gnu-v3
diff -rup binutils-2.28/libiberty/xstrndup.c /work/sources/binutils/current/libiberty/xstrndup.c
--- binutils-2.28/libiberty/xstrndup.c 2013-11-04 15:33:40.000000000 +0000
+++ /work/sources/binutils/current/libiberty/xstrndup.c 2017-01-04 16:01:24.951939251 +0000
@@ -48,10 +48,7 @@ char *
xstrndup (const char *s, size_t n)
{
char *result;
- size_t len = strlen (s);
-
- if (n < len)
- len = n;
+ size_t len = strnlen (s, n);
result = XNEWVEC (char, len + 1);

View File

@ -42,8 +42,8 @@
Summary: A GNU collection of binary utilities
Name: %{?cross}binutils%{?_with_debug:-debug}
Version: 2.27
Release: 19%{?dist}
Version: 2.28
Release: 1%{?dist}
License: GPLv3+
Group: Development/Tools
URL: http://sources.redhat.com/binutils
@ -58,48 +58,29 @@ Source2: binutils-2.19.50.0.1-output-format.sed
Patch01: binutils-2.20.51.0.2-libtool-lib64.patch
Patch02: binutils-2.20.51.0.10-ppc64-pie.patch
# Patch03: binutils-2.20.51.0.2-ia64-lib64.patch
Patch04: binutils-2.25-version.patch
Patch05: binutils-2.25-set-long-long.patch
Patch06: binutils-2.20.51.0.10-sec-merge-emit.patch
Patch03: binutils-2.25-version.patch
Patch04: binutils-2.25-set-long-long.patch
Patch05: binutils-2.20.51.0.10-sec-merge-emit.patch
# Enable -zrelro by default: BZ #621983
Patch07: binutils-2.22.52.0.1-relro-on-by-default.patch
Patch06: binutils-2.22.52.0.1-relro-on-by-default.patch
# Local patch - export demangle.h with the binutils-devel rpm.
Patch08: binutils-2.22.52.0.1-export-demangle.h.patch
Patch07: binutils-2.22.52.0.1-export-demangle.h.patch
# Disable checks that config.h has been included before system headers. BZ #845084
Patch09: binutils-2.22.52.0.4-no-config-h-check.patch
# Fix addr2line to use the dynamic symbol table if it could not find any ordinary symbols.
Patch10: binutils-2.23.52.0.1-addr2line-dynsymtab.patch
Patch08: binutils-2.22.52.0.4-no-config-h-check.patch
# Fix detections little endian PPC shared libraries
Patch11: binutils-2.24-ldforcele.patch
Patch12: binutils-2.25.1-cleansweep.patch
Patch13: binutils-2.26-fix-compile-warnings.patch
Patch09: binutils-2.24-ldforcele.patch
Patch10: binutils-2.25.1-cleansweep.patch
Patch11: binutils-2.26-fix-compile-warnings.patch
# Import H.J.Lu's Kernel LTO patch.
Patch14: binutils-2.26-lto.patch
# Fix computation of sh_info field for .dynsym sections
Patch15: binutils-2.27-local-dynsym-count.patch
# Put sections in a monotonically increasing order of file offset.
Patch16: binutils-2.27-monotonic-section-offsets.patch
# Make ARM and AArch64 ports properly support relro on by default.
Patch17: binutils-2.27-arm-aarch64-default-relro.patch
Patch12: binutils-2.26-lto.patch
# Skip PR14918 linker test for ARM native targets.
Patch18: binutils-2.27-skip-rp14918-test-for-arm.patch
# Fix GOLD for ARM/AARCh64.
Patch19: binutils-2.28-gold.patch
# Improve objdump's disassembly of dynamic executables.
Patch20: binutils-2.27-objdump-improvements.patch
# Improve objdump's speed when mixing disassembly with source code
Patch21: binutils-2.27-dwarf-parse-speedup.patch
# More objdump speed improvements
Patch22: binutils-2.27-objdump-improvements.2.patch
Patch13: binutils-2.27-skip-rp14918-test-for-arm.patch
# Include the filename concerned in readelf error messages.
Patch23: binutils-2.27-filename-in-error-messages.patch
Patch14: binutils-2.27-filename-in-error-messages.patch
# Fix a couple of buffer overflows when printing messages in translated strings.
Patch24: binutils-2.27-ld-buffer-overflow.patch
# Fix running ARM linker on BINARY objects.
Patch25: binutils-2.27-arm-binary-objects.patch
# Add support for PowerPC FP attribute.
Patch26: binutils-2.27-ppc-fp-attributes.patch
Patch15: binutils-2.27-ld-buffer-overflow.patch
# Sync libiberty sources with FSF GCC mainline.
Patch16: binutils-2.28-libiberty-bugfixes.patch
Provides: bundled(libiberty)
@ -219,38 +200,24 @@ using libelf instead of BFD.
%setup -q -n binutils-%{version}
%patch01 -p1 -b .libtool-lib64~
%patch02 -p1 -b .ppc64-pie~
# %ifarch ia64
# %if "%{_lib}" == "lib64"
# %patch03 -p1 -b .ia64-lib64~
# %endif
# %endif
%patch04 -p1 -b .version~
%patch05 -p1 -b .set-long-long~
%patch06 -p1 -b .sec-merge-emit~
%patch03 -p1 -b .version~
%patch04 -p1 -b .set-long-long~
%patch05 -p1 -b .sec-merge-emit~
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
%patch07 -p1 -b .relro~
%patch06 -p1 -b .relro~
%endif
%patch08 -p1 -b .export-demangle-h~
%patch09 -p1 -b .no-config-h-check~
%patch10 -p1 -b .addr2line~
%patch07 -p1 -b .export-demangle-h~
%patch08 -p1 -b .no-config-h-check~
%ifarch ppc64le
%patch11 -p1 -b .ldforcele~
%patch09 -p1 -b .ldforcele~
%endif
%patch12 -p0
%patch10 -p0
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p0
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
# We cannot run autotools as there is an exact requirement of autoconf-2.59.
@ -617,6 +584,21 @@ exit 0
%endif # %{isnative}
%changelog
* Thu Mar 02 2017 Nick Clifton <nickc@redhat.com> 2.28-1
- Rebase on FSF binutils v2.28.
- Retire: binutils-2.23.52.0.1-addr2line-dynsymtab.patch
- Retire: binutils-2.27-local-dynsym-count.patch
- Retire: binutils-2.27-monotonic-section-offsets.patch
- Retire: binutils-2.27-arm-aarch64-default-relro.patch
- Retire: binutils-2.28-gold.patch
- Retire: binutils-2.27-objdump-improvements.patch
- Retire: binutils-2.27-dwarf-parse-speedup.patch
- Retire: binutils-2.27-objdump-improvements.2.patch
- Retire: binutils-2.27-arm-binary-objects.patch
- Retire: binutils-2.27-ppc-fp-attributes.patch
- Add patch to sync libiberty with FSF GCC mainline.
(#1428310)
* Fri Feb 17 2017 Nick Clifton <nickc@redhat.com> 2.27-19
- Add support for PowerPC FP attributes.
(#1422461)

View File

@ -1 +1 @@
2869c9bf3e60ee97c74ac2a6bf4e9d68 binutils-2.27.tar.bz2
SHA512 (binutils-2.28.tar.bz2) = ede2e4e59a800260eea8c14eafbaee94e30abadafd5c419a3370f9f62213cf027d6400a1d4970b6958bd4d220e675dcd483a708107016e7abd5c99d7392ba8fd