* emultempl/armelf.em (merge_exidx_entries): New variable.
(OPTION_NO_MERGE_EXIDX_ENTRIES): New definition.
("no-merge-exidx-entries"): New option.
* ld.texinfo (merge-exidx-entries): Document this option.
2010-04-15 Andrew Haley <aph@redhat.com>
* bfd-in.h (elf32_arm_fix_exidx_coverage): Add new flag:
merge_exidx_entries.
* bfd-in2.h: Likewise.
* elf32-arm.c (elf32_arm_fix_exidx_coverage): Likewise. Use it to
control merging of exidx entries.
2010-04-15 Andrew Haley <aph@redhat.com>
* options.h (merge_exidx_entries): New option.
* arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
(class Arm_exidx_fixup::merge_exidx_entries_): New member.
(Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
(Target_arm::merge_exidx_entries): New function.
(process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
(Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
to Arm_exidx_fixup constructor.
Add new arg, merge_exidx_entries.
(Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
Arm_output_section::fix_exidx_coverage.
+2010-04-15 Andrew Haley <aph@redhat.com>
+
+ * bfd-in.h (elf32_arm_fix_exidx_coverage): Add new flag:
+ merge_exidx_entries.
+ * bfd-in2.h: Likewise.
+ * elf32-arm.c (elf32_arm_fix_exidx_coverage): Likewise. Use it to
+ control merging of exidx entries.
+
2010-04-20 Joseph Myers <joseph@codesourcery.com>
* elf32-tic6x.h: New.
/* ARM unwind section editing support. */
extern bfd_boolean elf32_arm_fix_exidx_coverage
- (struct bfd_section **, unsigned int, struct bfd_link_info *);
+(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
/* PowerPC @tls opcode transform/validate. */
extern unsigned int _bfd_elf_ppc_at_tls_transform
/* ARM unwind section editing support. */
extern bfd_boolean elf32_arm_fix_exidx_coverage
- (struct bfd_section **, unsigned int, struct bfd_link_info *);
+ (struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
/* PowerPC @tls opcode transform/validate. */
extern unsigned int _bfd_elf_ppc_at_tls_transform
2. Duplicate entries are merged together (EXIDX_CANTUNWIND, or unwind
codes which have been inlined into the index).
+ If MERGE_EXIDX_ENTRIES is false, duplicate entries are not merged.
+
The edits are applied when the tables are written
(in elf32_arm_write_section).
*/
bfd_boolean
elf32_arm_fix_exidx_coverage (asection **text_section_order,
unsigned int num_text_sections,
- struct bfd_link_info *info)
+ struct bfd_link_info *info,
+ bfd_boolean merge_exidx_entries)
{
bfd *inp;
unsigned int last_second_word = 0, i;
/* Inlined unwinding data. Merge if equal to previous. */
else if ((second_word & 0x80000000) != 0)
{
- if (last_second_word == second_word && last_unwind_type == 1)
+ if (merge_exidx_entries
+ && last_second_word == second_word && last_unwind_type == 1)
elide = 1;
unwind_type = 1;
last_second_word = second_word;
+2010-04-15 Andrew Haley <aph@redhat.com>
+
+ * options.h (merge_exidx_entries): New option.
+ * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
+ (class Arm_exidx_fixup::merge_exidx_entries_): New member.
+ (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
+ (Target_arm::merge_exidx_entries): New function.
+ (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
+ (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
+ to Arm_exidx_fixup constructor.
+ Add new arg, merge_exidx_entries.
+ (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
+ Arm_output_section::fix_exidx_coverage.
+
2010-04-18 Sriraman Tallam <tmsriram@google.com>
* icf.cc (get_section_contents): Check for preemptible functions.
class Arm_exidx_fixup
{
public:
- Arm_exidx_fixup(Output_section* exidx_output_section)
+ Arm_exidx_fixup(Output_section* exidx_output_section,
+ bool merge_exidx_entries = true)
: exidx_output_section_(exidx_output_section), last_unwind_type_(UT_NONE),
last_inlined_entry_(0), last_input_section_(NULL),
- section_offset_map_(NULL), first_output_text_section_(NULL)
+ section_offset_map_(NULL), first_output_text_section_(NULL),
+ merge_exidx_entries_(merge_exidx_entries)
{ }
~Arm_exidx_fixup()
// Output section for the text section which is linked to the first exidx
// input in output.
Output_section* first_output_text_section_;
+
+ bool merge_exidx_entries_;
};
// Arm output section class. This is defined mainly to add a number of
void
fix_exidx_coverage(Layout* layout,
const Text_section_list& sorted_text_section,
- Symbol_table* symtab);
+ Symbol_table* symtab,
+ bool merge_exidx_entries);
private:
// For convenience.
fix_cortex_a8() const
{ return this->fix_cortex_a8_; }
+ // Whether we merge exidx entries in debuginfo.
+ bool
+ merge_exidx_entries() const
+ { return parameters->options().merge_exidx_entries(); }
+
// Whether we fix R_ARM_V4BX relocation.
// 0 - do not fix
// 1 - replace with MOV instruction (armv4 target)
else if ((second_word & 0x80000000) != 0)
{
// Inlined unwinding data. Merge if equal to previous.
- delete_entry = (this->last_unwind_type_ == UT_INLINED_ENTRY
+ delete_entry = (merge_exidx_entries_
+ && this->last_unwind_type_ == UT_INLINED_ENTRY
&& this->last_inlined_entry_ == second_word);
this->last_unwind_type_ = UT_INLINED_ENTRY;
this->last_inlined_entry_ = second_word;
Arm_output_section<big_endian>::fix_exidx_coverage(
Layout* layout,
const Text_section_list& sorted_text_sections,
- Symbol_table* symtab)
+ Symbol_table* symtab,
+ bool merge_exidx_entries)
{
// We should only do this for the EXIDX output section.
gold_assert(this->type() == elfcpp::SHT_ARM_EXIDX);
known_input_sections.insert(Section_id(p->relobj(), p->shndx()));
}
- Arm_exidx_fixup exidx_fixup(this);
+ Arm_exidx_fixup exidx_fixup(this, merge_exidx_entries);
// Go over the sorted text sections.
Section_id_set processed_input_sections;
arm_output_section->append_text_sections_to_list(&sorted_text_sections);
}
- exidx_section->fix_exidx_coverage(layout, sorted_text_sections, symtab);
+ exidx_section->fix_exidx_coverage(layout, sorted_text_sections, symtab,
+ merge_exidx_entries());
}
Target_selector_arm<false> target_selector_arm;
N_("(ARM only) Fix binaries for Cortex-A8 erratum."),
N_("(ARM only) Do not fix binaries for Cortex-A8 erratum."));
+ DEFINE_bool(merge_exidx_entries, options::TWO_DASHES, '\0', true,
+ N_("(ARM only) Merge exidx entries in debuginfo."),
+ N_("(ARM only) Do not merge exidx entries in debuginfo."));
+
DEFINE_special(fix_v4bx, options::TWO_DASHES, '\0',
N_("(ARM only) Rewrite BX rn as MOV pc, rn for ARMv4"),
NULL);
+2010-04-15 Andrew Haley <aph@redhat.com>
+
+ * emultempl/armelf.em (merge_exidx_entries): New variable.
+ (OPTION_NO_MERGE_EXIDX_ENTRIES): New definition.
+ ("no-merge-exidx-entries"): New option.
+ * ld.texinfo (merge-exidx-entries): Document this option.
+
2010-04-14 Tristan Gingold <gingold@adacore.com>
* emulparams/alphavms.sh: New file.
static int no_enum_size_warning = 0;
static int no_wchar_size_warning = 0;
static int pic_veneer = 0;
+static int merge_exidx_entries = -1;
static void
gld${EMULATION_NAME}_before_parse (void)
qsort (sec_list, sec_count, sizeof (asection *), &compare_output_sec_vma);
- if (elf32_arm_fix_exidx_coverage (sec_list, sec_count, &link_info))
+ if (elf32_arm_fix_exidx_coverage (sec_list, sec_count, &link_info,
+ merge_exidx_entries))
need_laying_out = 1;
free (sec_list);
#define OPTION_NO_WCHAR_SIZE_WARNING 313
#define OPTION_FIX_CORTEX_A8 314
#define OPTION_NO_FIX_CORTEX_A8 315
+#define OPTION_NO_MERGE_EXIDX_ENTRIES 316
'
PARSE_AND_LIST_SHORTOPTS=p
{ "no-wchar-size-warning", no_argument, NULL, OPTION_NO_WCHAR_SIZE_WARNING},
{ "fix-cortex-a8", no_argument, NULL, OPTION_FIX_CORTEX_A8 },
{ "no-fix-cortex-a8", no_argument, NULL, OPTION_NO_FIX_CORTEX_A8 },
+ { "no-merge-exidx-entries", no_argument, NULL, OPTION_NO_MERGE_EXIDX_ENTRIES },
'
PARSE_AND_LIST_OPTIONS='
the linker should choose suitable defaults.\n"
));
fprintf (file, _(" --[no-]fix-cortex-a8 Disable/enable Cortex-A8 Thumb-2 branch erratum fix\n"));
+ fprintf (file, _(" --no-merge-exidx-entries Disable merging exidx entries\n"));
+
'
PARSE_AND_LIST_ARGS_CASES='
case OPTION_NO_FIX_CORTEX_A8:
fix_cortex_a8 = 0;
break;
+
+ case OPTION_NO_MERGE_EXIDX_ENTRIES:
+ merge_exidx_entries = 0;
+
'
# We have our own before_allocation etc. functions, but they call
The erratum only affects Thumb-2 code. Please contact ARM for further details.
+@kindex --merge-exidx-entries
+@kindex --no-merge-exidx-entries
+The @samp{--no-merge-exidx-entries} switch disables the merging of adjacent exidx entries in debuginfo.
+
@ifclear GENERIC
@lowersections
@end ifclear