diff options
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils/0038-Copy-from-mainline-to-binutils-2.22-branch.patch')
-rw-r--r-- | meta/recipes-devtools/binutils/binutils/0038-Copy-from-mainline-to-binutils-2.22-branch.patch | 1944 |
1 files changed, 1944 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/0038-Copy-from-mainline-to-binutils-2.22-branch.patch b/meta/recipes-devtools/binutils/binutils/0038-Copy-from-mainline-to-binutils-2.22-branch.patch new file mode 100644 index 0000000000..453ef2211c --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/0038-Copy-from-mainline-to-binutils-2.22-branch.patch @@ -0,0 +1,1944 @@ +Upstream-Status: Backport + +From 624da0376264205e399bc14fe2fa7b6fa659d0ee Mon Sep 17 00:00:00 2001 +From: Ian Lance Taylor <ian@airs.com> +Date: Mon, 19 Dec 2011 21:14:39 +0000 +Subject: [PATCH 038/262] Copy from mainline to binutils 2.22 branch: + + 2011-12-17 Cary Coutant <ccoutant@google.com> + + * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts. + * resolve.cc (Symbol_table::resolve): Likewise. + * i386.cc (Target_i386::do_code_fill): Use char constants for nop + arrays. + * x86_64.cc (Target_x86_64::do_code_fill): Likewise. + + 2011-10-31 Cary Coutant <ccoutant@google.com> + + PR gold/13023 + * expression.cc (Expression::eval_with_dot): Add + is_section_dot_assignment parameter. + (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is + absolute and assigning to dot within a section. + * script-sections.cc + (Output_section_element_assignment::set_section_addresses): Pass + dot_section to set_if_absolute. + (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE + as is_section_dot_assignment flag to eval_with_dot. + (Output_section_element_dot_assignment::set_section_addresses): + Likewise. + * script.cc (Symbol_assignment::set_if_absolute): Add dot_section + parameter. Also set value if relative to dot_section; set the + symbol's output_section. + * script.h (Expression::eval_with_dot): Add is_section_dot_assignment + parameter. Adjust all callers. + (Expression::eval_maybe_dot): Likewise. + (Symbol_assignment::set_if_absolute): Add dot_section parameter. + Adjust all callers. + * testsuite/script_test_2.t: Test assignment of an absolute value + to dot within an output section element. + + 2011-10-31 Cary Coutant <ccoutant@google.com> + + * options.h (class General_options): Add --[no-]gnu-unique options. + * symtab.cc (Symbol_table::sized_write_globals): Convert + STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique. + + 2011-10-31 Cary Coutant <ccoutant@google.com> + + PR gold/13359 + * i386.cc (Target_i386::Relocate::relocate_tls): Remove + unnecessary assertion. + * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise. + + 2011-10-31 Sriraman Tallam <tmsriram@google.com> + + * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to + gc_mark_symbol. + * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to + gc_mark_symbol. + Change to just keep the section associated with symbol. + (Symbol_table::add_from_relobj): Mark symbols as not garbage when + they are externally visible and --export-dynamic is turned on. + (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol. + + 2011-10-19 Ian Lance Taylor <iant@google.com> + + PR gold/13163 + * script-sections.cc + (Output_section_element_dot_assignment::needs_output_section): New + function. + + 2011-10-19 Ian Lance Taylor <iant@google.com> + + PR gold/13204 + * layout.cc (Layout::segment_precedes): Don't assert failure if a + --section-start option was seen. + * options.h (General_options::any_section_start): New function. + + 2011-10-18 Cary Coutant <ccoutant@google.com> + + * output.cc (posix_fallocate): Return 0 on success, errno on failure. + (Output_file::map_no_anonymous): Check for non-zero + return code from posix_fallocate. + + 2011-10-17 Cary Coutant <ccoutant@google.com> + + PR gold/13245 + * plugin.cc (is_visible_from_outside): Check for symbols + referenced from dynamic objects. + * resolve.cc (Symbol_table::resolve): Don't count references + from dynamic objects as references from real ELF files. + * testsuite/plugin_test_2.sh: Adjust expected result. + + 2011-10-17 Cary Coutant <ccoutant@google.com> + + * readsyms.cc (Read_symbols::run): Don't queue an unblocker + task for members of lib groups. + + 2011-10-17 Cary Coutant <ccoutant@google.com> + + PR gold/13288 + * fileread.cc (File_read::find_view): Add assert. + (File_read::make_view): Move bounds check (replace with assert)... + (File_read::find_or_make_view): ... to here. + + 2011-10-12 Cary Coutant <ccoutant@google.com> + + * output.cc (Output_file::open_base_file): Handle case where + ::read returns less than requested size. + + 2011-10-10 Cary Coutant <ccoutant@google.com> + + * incremental.cc (Sized_relobj_incr::Sized_relobj_incr): + Initialize defined_count_. + (Sized_relobj_incr::do_add_symbols): Count defined symbols. + (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite. + (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_. + (Sized_incr_dynobj::do_add_symbols): Count defined symbols. + (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite. + * incremental.h (Sized_relobj_incr::defined_count_): New data + member. + (Sized_incr_dynobj::defined_count_): New data member. + * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts): + Return zeroes instead of internal error. + + 2011-10-10 Cary Coutant <ccoutant@google.com> + + PR gold/13249 + * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag. + (Output_reloc::symbol_value): Return PLT offset if flag is set. + * output.h (class Output_reloc): Add use_plt_offset flag. + (Output_reloc::type_): Adjust size of bit field. + (Output_reloc::use_plt_offset_): New bit field. + (class Output_data_reloc): Adjust all calls to Output_reloc_type. + (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset + flag. Adjust all callers. + * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when + creating RELATIVE relocations. + + 2011-10-03 Diego Novillo <dnovillo@google.com> + + * options.cc (parse_uint): Fix dereference of RETVAL. + + 2011-09-29 Cary Coutant <ccoutant@google.com> + + * incremental.cc (Sized_incremental_binary::do_process_got_plt): + Check for NULL. + * symtab.cc (Symbol_table::add_from_relobj): Ignore version + symbols during incremental update. + (Symbol_table::add_from_dynobj): Likewise. + + 2011-09-26 Cary Coutant <ccoutant@google.com> + + * gold.cc (queue_initial_tasks): Move option checks ... + * options.cc (General_options::finalize): ... to here. Disable + some options; make others fatal. + + 2011-09-23 Simon Baldwin <simonb@google.com> + + * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags + configuration options. + * configure: Regenerate. + * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS. + * Makefile.in: Regenerate. + * testsuite/Makefile.in: Regenerate. +--- + gold/ChangeLog | 163 +++++++++++++++++++++++++++++++++++++++ + gold/dwarf_reader.cc | 8 +- + gold/expression.cc | 45 +++++++---- + gold/fileread.cc | 27 ++++--- + gold/gold.cc | 55 +++++-------- + gold/i386.cc | 87 +++++++++++---------- + gold/incremental.cc | 50 +++++++++--- + gold/incremental.h | 4 + + gold/layout.cc | 5 +- + gold/options.cc | 33 +++++++- + gold/options.h | 9 +++ + gold/output.cc | 78 ++++++++++++------- + gold/output.h | 64 +++++++++------ + gold/plugin.cc | 18 +++-- + gold/powerpc.cc | 4 +- + gold/readsyms.cc | 6 +- + gold/resolve.cc | 6 +- + gold/script-sections.cc | 47 +++++++---- + gold/script.cc | 17 ++-- + gold/script.h | 24 ++++-- + gold/sparc.cc | 4 +- + gold/symtab.cc | 65 +++++++++------- + gold/symtab.h | 5 +- + gold/testsuite/Makefile.in | 2 + + gold/testsuite/plugin_test_2.sh | 2 +- + gold/testsuite/script_test_2.t | 2 +- + gold/x86_64.cc | 99 ++++++++++++------------ + 27 files changed, 636 insertions(+), 293 deletions(-) + +diff --git a/gold/dwarf_reader.cc b/gold/dwarf_reader.cc +index 3dc33e4..2b47a28 100644 +--- a/gold/dwarf_reader.cc ++++ b/gold/dwarf_reader.cc +@@ -1,6 +1,6 @@ + // dwarf_reader.cc -- parse dwarf2/3 debug information + +-// Copyright 2007, 2008, 2009, 2010 Free Software Foundation, Inc. ++// Copyright 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. + // Written by Ian Lance Taylor <iant@google.com>. + + // This file is part of gold. +@@ -491,8 +491,10 @@ Sized_dwarf_line_info<size, big_endian>::read_lines(unsigned const char* lineptr + && (shndx == -1U || lsm.shndx == -1U || shndx == lsm.shndx)) + { + Offset_to_lineno_entry entry +- = { lsm.address, this->current_header_index_, +- lsm.file_num, true, lsm.line_num }; ++ = { static_cast<off_t>(lsm.address), ++ this->current_header_index_, ++ static_cast<unsigned int>(lsm.file_num), ++ true, lsm.line_num }; + std::vector<Offset_to_lineno_entry>& + map(this->line_number_map_[lsm.shndx]); + // If we see two consecutive entries with the same +diff --git a/gold/expression.cc b/gold/expression.cc +index e527b5e..e31c151 100644 +--- a/gold/expression.cc ++++ b/gold/expression.cc +@@ -1,6 +1,6 @@ + // expression.cc -- expressions in linker scripts for gold + +-// Copyright 2006, 2007, 2008 Free Software Foundation, Inc. ++// Copyright 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. + // Written by Ian Lance Taylor <iant@google.com>. + + // This file is part of gold. +@@ -77,7 +77,7 @@ Expression::eval(const Symbol_table* symtab, const Layout* layout, + bool check_assertions) + { + return this->eval_maybe_dot(symtab, layout, check_assertions, +- false, 0, NULL, NULL, NULL); ++ false, 0, NULL, NULL, NULL, false); + } + + // Evaluate an expression which may refer to the dot symbol. +@@ -87,11 +87,13 @@ Expression::eval_with_dot(const Symbol_table* symtab, const Layout* layout, + bool check_assertions, uint64_t dot_value, + Output_section* dot_section, + Output_section** result_section_pointer, +- uint64_t* result_alignment_pointer) ++ uint64_t* result_alignment_pointer, ++ bool is_section_dot_assignment) + { + return this->eval_maybe_dot(symtab, layout, check_assertions, true, + dot_value, dot_section, result_section_pointer, +- result_alignment_pointer); ++ result_alignment_pointer, ++ is_section_dot_assignment); + } + + // Evaluate an expression which may or may not refer to the dot +@@ -102,7 +104,8 @@ Expression::eval_maybe_dot(const Symbol_table* symtab, const Layout* layout, + bool check_assertions, bool is_dot_available, + uint64_t dot_value, Output_section* dot_section, + Output_section** result_section_pointer, +- uint64_t* result_alignment_pointer) ++ uint64_t* result_alignment_pointer, ++ bool is_section_dot_assignment) + { + Expression_eval_info eei; + eei.symtab = symtab; +@@ -113,14 +116,24 @@ Expression::eval_maybe_dot(const Symbol_table* symtab, const Layout* layout, + eei.dot_section = dot_section; + + // We assume the value is absolute, and only set this to a section +- // if we find a section relative reference. ++ // if we find a section-relative reference. + if (result_section_pointer != NULL) + *result_section_pointer = NULL; + eei.result_section_pointer = result_section_pointer; + + eei.result_alignment_pointer = result_alignment_pointer; + +- return this->value(&eei); ++ uint64_t val = this->value(&eei); ++ ++ // If this is an assignment to dot within a section, and the value ++ // is absolute, treat it as a section-relative offset. ++ if (is_section_dot_assignment && *result_section_pointer == NULL) ++ { ++ gold_assert(dot_section != NULL); ++ val += dot_section->address(); ++ *result_section_pointer = dot_section; ++ } ++ return val; + } + + // A number. +@@ -257,7 +270,8 @@ class Unary_expression : public Expression + eei->dot_value, + eei->dot_section, + arg_section_pointer, +- eei->result_alignment_pointer); ++ eei->result_alignment_pointer, ++ false); + } + + void +@@ -336,7 +350,8 @@ class Binary_expression : public Expression + eei->dot_value, + eei->dot_section, + section_pointer, +- alignment_pointer); ++ alignment_pointer, ++ false); + } + + uint64_t +@@ -350,7 +365,8 @@ class Binary_expression : public Expression + eei->dot_value, + eei->dot_section, + section_pointer, +- alignment_pointer); ++ alignment_pointer, ++ false); + } + + void +@@ -500,7 +516,8 @@ class Trinary_expression : public Expression + eei->dot_value, + eei->dot_section, + section_pointer, +- NULL); ++ NULL, ++ false); + } + + uint64_t +@@ -514,7 +531,8 @@ class Trinary_expression : public Expression + eei->dot_value, + eei->dot_section, + section_pointer, +- alignment_pointer); ++ alignment_pointer, ++ false); + } + + uint64_t +@@ -528,7 +546,8 @@ class Trinary_expression : public Expression + eei->dot_value, + eei->dot_section, + section_pointer, +- alignment_pointer); ++ alignment_pointer, ++ false); + } + + void +diff --git a/gold/fileread.cc b/gold/fileread.cc +index 80ddfbc..c5dc320 100644 +--- a/gold/fileread.cc ++++ b/gold/fileread.cc +@@ -329,6 +329,10 @@ inline File_read::View* + File_read::find_view(off_t start, section_size_type size, + unsigned int byteshift, File_read::View** vshifted) const + { ++ gold_assert(start <= this->size_ ++ && (static_cast<unsigned long long>(size) ++ <= static_cast<unsigned long long>(this->size_ - start))); ++ + if (vshifted != NULL) + *vshifted = NULL; + +@@ -456,16 +460,9 @@ File_read::make_view(off_t start, section_size_type size, + unsigned int byteshift, bool cache) + { + gold_assert(size > 0); +- +- // Check that start and end of the view are within the file. +- if (start > this->size_ +- || (static_cast<unsigned long long>(size) +- > static_cast<unsigned long long>(this->size_ - start))) +- gold_fatal(_("%s: attempt to map %lld bytes at offset %lld exceeds " +- "size of file; the file may be corrupt"), +- this->filename().c_str(), +- static_cast<long long>(size), +- static_cast<long long>(start)); ++ gold_assert(start <= this->size_ ++ && (static_cast<unsigned long long>(size) ++ <= static_cast<unsigned long long>(this->size_ - start))); + + off_t poff = File_read::page_offset(start); + +@@ -523,6 +520,16 @@ File_read::View* + File_read::find_or_make_view(off_t offset, off_t start, + section_size_type size, bool aligned, bool cache) + { ++ // Check that start and end of the view are within the file. ++ if (start > this->size_ ++ || (static_cast<unsigned long long>(size) ++ > static_cast<unsigned long long>(this->size_ - start))) ++ gold_fatal(_("%s: attempt to map %lld bytes at offset %lld exceeds " ++ "size of file; the file may be corrupt"), ++ this->filename().c_str(), ++ static_cast<long long>(size), ++ static_cast<long long>(start)); ++ + unsigned int byteshift; + if (offset == 0) + byteshift = 0; +diff --git a/gold/gold.cc b/gold/gold.cc +index 12f25b7..693ff79 100644 +--- a/gold/gold.cc ++++ b/gold/gold.cc +@@ -197,46 +197,29 @@ queue_initial_tasks(const General_options& options, + // For incremental links, the base output file. + Incremental_binary* ibase = NULL; + +- if (parameters->incremental()) +- { +- if (options.relocatable()) +- gold_error(_("incremental linking is incompatible with -r")); +- if (options.emit_relocs()) +- gold_error(_("incremental linking is incompatible with --emit-relocs")); +- if (options.gc_sections()) +- gold_error(_("incremental linking is incompatible with --gc-sections")); +- if (options.icf_enabled()) +- gold_error(_("incremental linking is incompatible with --icf")); +- if (options.has_plugins()) +- gold_error(_("incremental linking is incompatible with --plugin")); +- if (strcmp(options.compress_debug_sections(), "none") != 0) +- gold_error(_("incremental linking is incompatible with " +- "--compress-debug-sections")); +- +- if (parameters->incremental_update()) ++ if (parameters->incremental_update()) ++ { ++ Output_file* of = new Output_file(options.output_file_name()); ++ if (of->open_base_file(options.incremental_base(), true)) + { +- Output_file* of = new Output_file(options.output_file_name()); +- if (of->open_base_file(options.incremental_base(), true)) +- { +- ibase = open_incremental_binary(of); +- if (ibase != NULL +- && ibase->check_inputs(cmdline, layout->incremental_inputs())) +- ibase->init_layout(layout); +- else +- { +- delete ibase; +- ibase = NULL; +- of->close(); +- } +- } +- if (ibase == NULL) ++ ibase = open_incremental_binary(of); ++ if (ibase != NULL ++ && ibase->check_inputs(cmdline, layout->incremental_inputs())) ++ ibase->init_layout(layout); ++ else + { +- if (set_parameters_incremental_full()) +- gold_info(_("linking with --incremental-full")); +- else +- gold_fallback(_("restart link with --incremental-full")); ++ delete ibase; ++ ibase = NULL; ++ of->close(); + } + } ++ if (ibase == NULL) ++ { ++ if (set_parameters_incremental_full()) ++ gold_info(_("linking with --incremental-full")); ++ else ++ gold_fallback(_("restart link with --incremental-full")); ++ } + } + + // Read the input files. We have to add the symbols to the symbol +diff --git a/gold/i386.cc b/gold/i386.cc +index 445bc68..efb6248 100644 +--- a/gold/i386.cc ++++ b/gold/i386.cc +@@ -2709,12 +2709,6 @@ Target_i386::Relocate::relocate_tls(const Relocate_info<32, false>* relinfo, + } + if (optimized_type == tls::TLSOPT_TO_IE) + { +- if (tls_segment == NULL) +- { +- gold_assert(parameters->errors()->error_count() > 0 +- || issue_undefined_symbol_error(gsym)); +- return; +- } + this->tls_gd_to_ie(relinfo, relnum, tls_segment, rel, r_type, + got_offset, view, view_size); + break; +@@ -3480,42 +3474,51 @@ Target_i386::do_code_fill(section_size_type length) const + } + + // Nop sequences of various lengths. +- const char nop1[1] = { 0x90 }; // nop +- const char nop2[2] = { 0x66, 0x90 }; // xchg %ax %ax +- const char nop3[3] = { 0x8d, 0x76, 0x00 }; // leal 0(%esi),%esi +- const char nop4[4] = { 0x8d, 0x74, 0x26, 0x00}; // leal 0(%esi,1),%esi +- const char nop5[5] = { 0x90, 0x8d, 0x74, 0x26, // nop +- 0x00 }; // leal 0(%esi,1),%esi +- const char nop6[6] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi +- 0x00, 0x00 }; +- const char nop7[7] = { 0x8d, 0xb4, 0x26, 0x00, // leal 0L(%esi,1),%esi +- 0x00, 0x00, 0x00 }; +- const char nop8[8] = { 0x90, 0x8d, 0xb4, 0x26, // nop +- 0x00, 0x00, 0x00, 0x00 }; // leal 0L(%esi,1),%esi +- const char nop9[9] = { 0x89, 0xf6, 0x8d, 0xbc, // movl %esi,%esi +- 0x27, 0x00, 0x00, 0x00, // leal 0L(%edi,1),%edi +- 0x00 }; +- const char nop10[10] = { 0x8d, 0x76, 0x00, 0x8d, // leal 0(%esi),%esi +- 0xbc, 0x27, 0x00, 0x00, // leal 0L(%edi,1),%edi +- 0x00, 0x00 }; +- const char nop11[11] = { 0x8d, 0x74, 0x26, 0x00, // leal 0(%esi,1),%esi +- 0x8d, 0xbc, 0x27, 0x00, // leal 0L(%edi,1),%edi +- 0x00, 0x00, 0x00 }; +- const char nop12[12] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi +- 0x00, 0x00, 0x8d, 0xbf, // leal 0L(%edi),%edi +- 0x00, 0x00, 0x00, 0x00 }; +- const char nop13[13] = { 0x8d, 0xb6, 0x00, 0x00, // leal 0L(%esi),%esi +- 0x00, 0x00, 0x8d, 0xbc, // leal 0L(%edi,1),%edi +- 0x27, 0x00, 0x00, 0x00, +- 0x00 }; +- const char nop14[14] = { 0x8d, 0xb4, 0x26, 0x00, // leal 0L(%esi,1),%esi +- 0x00, 0x00, 0x00, 0x8d, // leal 0L(%edi,1),%edi +- 0xbc, 0x27, 0x00, 0x00, +- 0x00, 0x00 }; +- const char nop15[15] = { 0xeb, 0x0d, 0x90, 0x90, // jmp .+15 +- 0x90, 0x90, 0x90, 0x90, // nop,nop,nop,... +- 0x90, 0x90, 0x90, 0x90, +- 0x90, 0x90, 0x90 }; ++ const char nop1[1] = { '\x90' }; // nop ++ const char nop2[2] = { '\x66', '\x90' }; // xchg %ax %ax ++ const char nop3[3] = { '\x8d', '\x76', '\x00' }; // leal 0(%esi),%esi ++ const char nop4[4] = { '\x8d', '\x74', '\x26', // leal 0(%esi,1),%esi ++ '\x00'}; ++ const char nop5[5] = { '\x90', '\x8d', '\x74', // nop ++ '\x26', '\x00' }; // leal 0(%esi,1),%esi ++ const char nop6[6] = { '\x8d', '\xb6', '\x00', // leal 0L(%esi),%esi ++ '\x00', '\x00', '\x00' }; ++ const char nop7[7] = { '\x8d', '\xb4', '\x26', // leal 0L(%esi,1),%esi ++ '\x00', '\x00', '\x00', ++ '\x00' }; ++ const char nop8[8] = { '\x90', '\x8d', '\xb4', // nop ++ '\x26', '\x00', '\x00', // leal 0L(%esi,1),%esi ++ '\x00', '\x00' }; ++ const char nop9[9] = { '\x89', '\xf6', '\x8d', // movl %esi,%esi ++ '\xbc', '\x27', '\x00', // leal 0L(%edi,1),%edi ++ '\x00', '\x00', '\x00' }; ++ const char nop10[10] = { '\x8d', '\x76', '\x00', // leal 0(%esi),%esi ++ '\x8d', '\xbc', '\x27', // leal 0L(%edi,1),%edi ++ '\x00', '\x00', '\x00', ++ '\x00' }; ++ const char nop11[11] = { '\x8d', '\x74', '\x26', // leal 0(%esi,1),%esi ++ '\x00', '\x8d', '\xbc', // leal 0L(%edi,1),%edi ++ '\x27', '\x00', '\x00', ++ '\x00', '\x00' }; ++ const char nop12[12] = { '\x8d', '\xb6', '\x00', // leal 0L(%esi),%esi ++ '\x00', '\x00', '\x00', // leal 0L(%edi),%edi ++ '\x8d', '\xbf', '\x00', ++ '\x00', '\x00', '\x00' }; ++ const char nop13[13] = { '\x8d', '\xb6', '\x00', // leal 0L(%esi),%esi ++ '\x00', '\x00', '\x00', // leal 0L(%edi,1),%edi ++ '\x8d', '\xbc', '\x27', ++ '\x00', '\x00', '\x00', ++ '\x00' }; ++ const char nop14[14] = { '\x8d', '\xb4', '\x26', // leal 0L(%esi,1),%esi ++ '\x00', '\x00', '\x00', // leal 0L(%edi,1),%edi ++ '\x00', '\x8d', '\xbc', ++ '\x27', '\x00', '\x00', ++ '\x00', '\x00' }; ++ const char nop15[15] = { '\xeb', '\x0d', '\x90', // jmp .+15 ++ '\x90', '\x90', '\x90', // nop,nop,nop,... ++ '\x90', '\x90', '\x90', ++ '\x90', '\x90', '\x90', ++ '\x90', '\x90', '\x90' }; + + const char* nops[16] = { + NULL, +diff --git a/gold/incremental.cc b/gold/incremental.cc +index b422827..75e44c5 100644 +--- a/gold/incremental.cc ++++ b/gold/incremental.cc +@@ -685,7 +685,7 @@ Sized_incremental_binary<size, big_endian>::do_process_got_plt( + gold_assert(plt_desc >= first_global && plt_desc < symtab_count); + Symbol* sym = this->global_symbol(plt_desc - first_global); + // Add the PLT entry only if the symbol is still referenced. +- if (sym->in_reg()) ++ if (sym != NULL && sym->in_reg()) + { + gold_debug(DEBUG_INCREMENTAL, + "PLT entry %d: %s", +@@ -1966,8 +1966,9 @@ Sized_relobj_incr<size, big_endian>::Sized_relobj_incr( + input_reader_(ibase->inputs_reader().input_file(input_file_index)), + local_symbol_count_(0), output_local_dynsym_count_(0), + local_symbol_index_(0), local_symbol_offset_(0), local_dynsym_offset_(0), +- symbols_(), incr_reloc_offset_(-1U), incr_reloc_count_(0), +- incr_reloc_output_index_(0), incr_relocs_(NULL), local_symbols_() ++ symbols_(), defined_count_(0), incr_reloc_offset_(-1U), ++ incr_reloc_count_(0), incr_reloc_output_index_(0), incr_relocs_(NULL), ++ local_symbols_() + { + if (this->input_reader_.is_in_system_directory()) + this->set_is_in_system_directory(); +@@ -2120,6 +2121,9 @@ Sized_relobj_incr<size, big_endian>::do_add_symbols( + + Symbol* res = symtab->add_from_incrobj(this, name, NULL, &sym); + ++ if (shndx != elfcpp::SHN_UNDEF) ++ ++this->defined_count_; ++ + // If this is a linker-defined symbol that hasn't yet been defined, + // define it now. + if (input_shndx == -1U && !res->is_defined()) +@@ -2283,9 +2287,21 @@ Sized_relobj_incr<size, big_endian>::do_initialize_xindex() + template<int size, bool big_endian> + void + Sized_relobj_incr<size, big_endian>::do_get_global_symbol_counts( +- const Symbol_table*, size_t*, size_t*) const +-{ +- gold_unreachable(); ++ const Symbol_table*, ++ size_t* defined, ++ size_t* used) const ++{ ++ *defined = this->defined_count_; ++ size_t count = 0; ++ for (typename Symbols::const_iterator p = this->symbols_.begin(); ++ p != this->symbols_.end(); ++ ++p) ++ if (*p != NULL ++ && (*p)->source() == Symbol::FROM_OBJECT ++ && (*p)->object() == this ++ && (*p)->is_defined()) ++ ++count; ++ *used = count; + } + + // Read the relocs. +@@ -2579,7 +2595,7 @@ Sized_incr_dynobj<size, big_endian>::Sized_incr_dynobj( + : Dynobj(name, NULL), ibase_(ibase), + input_file_index_(input_file_index), + input_reader_(ibase->inputs_reader().input_file(input_file_index)), +- symbols_() ++ symbols_(), defined_count_(0) + { + if (this->input_reader_.is_in_system_directory()) + this->set_is_in_system_directory(); +@@ -2677,6 +2693,7 @@ Sized_incr_dynobj<size, big_endian>::do_add_symbols( + // is meaningless, as long as it's not SHN_UNDEF. + shndx = 1; + v = gsym.get_st_value(); ++ ++this->defined_count_; + } + + osym.put_st_name(0); +@@ -2845,9 +2862,22 @@ Sized_incr_dynobj<size, big_endian>::do_initialize_xindex() + template<int size, bool big_endian> + void + Sized_incr_dynobj<size, big_endian>::do_get_global_symbol_counts( +- const Symbol_table*, size_t*, size_t*) const +-{ +- gold_unreachable(); ++ const Symbol_table*, ++ size_t* defined, ++ size_t* used) const ++{ ++ *defined = this->defined_count_; ++ size_t count = 0; ++ for (typename Symbols::const_iterator p = this->symbols_.begin(); ++ p != this->symbols_.end(); ++ ++p) ++ if (*p != NULL ++ && (*p)->source() == Symbol::FROM_OBJECT ++ && (*p)->object() == this ++ && (*p)->is_defined() ++ && (*p)->dynsym_index() != -1U) ++ ++count; ++ *used = count; + } + + // Allocate an incremental object of the appropriate size and endianness. +diff --git a/gold/incremental.h b/gold/incremental.h +index e6732df..56fc52b 100644 +--- a/gold/incremental.h ++++ b/gold/incremental.h +@@ -1996,6 +1996,8 @@ class Sized_relobj_incr : public Sized_relobj<size, big_endian> + unsigned int local_dynsym_offset_; + // The entries in the symbol table for the external symbols. + Symbols symbols_; ++ // Number of symbols defined in object file itself. ++ size_t defined_count_; + // The offset of the first incremental relocation for this object. + unsigned int incr_reloc_offset_; + // The number of incremental relocations for this object. +@@ -2127,6 +2129,8 @@ class Sized_incr_dynobj : public Dynobj + Input_entry_reader input_reader_; + // The entries in the symbol table for the external symbols. + Symbols symbols_; ++ // Number of symbols defined in object file itself. ++ size_t defined_count_; + }; + + // Allocate an incremental object of the appropriate size and endianness. +diff --git a/gold/layout.cc b/gold/layout.cc +index 1c32bcf..9d8a43a 100644 +--- a/gold/layout.cc ++++ b/gold/layout.cc +@@ -2975,8 +2975,9 @@ Layout::segment_precedes(const Output_segment* seg1, + + // We shouldn't get here--we shouldn't create segments which we + // can't distinguish. Unless of course we are using a weird linker +- // script. +- gold_assert(this->script_options_->saw_phdrs_clause()); ++ // script or overlapping --section-start options. ++ gold_assert(this->script_options_->saw_phdrs_clause() ++ || parameters->options().any_section_start()); + return false; + } + +diff --git a/gold/options.cc b/gold/options.cc +index be32645..dcf6ba7 100644 +--- a/gold/options.cc ++++ b/gold/options.cc +@@ -198,7 +198,7 @@ parse_uint(const char* option_name, const char* arg, int* retval) + { + char* endptr; + *retval = strtol(arg, &endptr, 0); +- if (*endptr != '\0' || retval < 0) ++ if (*endptr != '\0' || *retval < 0) + gold_fatal(_("%s: invalid option value (expected an intege
}
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!-- Dummy chapter -->
<appendix id='ref-variables-glos'>
<title>Reference: Variables Glossary</title>
<para>
This section lists common variables used in Poky and gives an overview
of their function and contents.
</para>
<glossary id='ref-variables-glossary'>
<para>
<link linkend='var-glossary-a'>A</link>
<link linkend='var-glossary-b'>B</link>
<link linkend='var-glossary-c'>C</link>
<link linkend='var-glossary-d'>D</link>
<link linkend='var-glossary-e'>E</link>
<link linkend='var-glossary-f'>F</link>
<!-- <link linkend='var-glossary-g'>G</link> -->
<link linkend='var-glossary-h'>H</link>
<link linkend='var-glossary-i'>I</link>
<!-- <link linkend='var-glossary-j'>J</link> -->
<link linkend='var-glossary-k'>K</link>
<link linkend='var-glossary-l'>L</link>
<link linkend='var-glossary-m'>M</link>
<!-- <link linkend='var-glossary-n'>N</link> -->
<!-- <link linkend='var-glossary-o'>O</link> -->
<link linkend='var-glossary-p'>P</link>
<!-- <link linkend='var-glossary-q'>Q</link> -->
<link linkend='var-glossary-r'>R</link>
<link linkend='var-glossary-s'>S</link>
<link linkend='var-glossary-t'>T</link>
<!-- <link linkend='var-glossary-u'>U</link> -->
<!-- <link linkend='var-glossary-v'>V</link> -->
<link linkend='var-glossary-w'>W</link>
<!-- <link linkend='var-glossary-x'>X</link> -->
<!-- <link linkend='var-glossary-y'>Y</link> -->
<!-- <link linkend='var-glossary-z'>Z</link>-->
</para>
<glossdiv id='var-glossary-a'><title>A</title>
<glossentry id='var-AUTHOR'><glossterm>AUTHOR</glossterm>
<glossdef>
<para>E-mail address to contact original author(s) - to
send patches, forward bugs...</para>
</glossdef>
</glossentry>
<glossentry id='var-AUTOREV'><glossterm>AUTOREV</glossterm>
<glossdef>
<para>Use current (newest) source revision - used with
<glossterm><link linkend='var-SRCREV'>SRCREV</link></glossterm>
variable.</para>
</glossdef>
</glossentry>
</glossdiv>
<glossdiv id='var-glossary-b'><title>B</title>
<glossentry id='var-BB_NUMBER_THREADS'><glossterm>BB_NUMBER_THREADS</glossterm>
<glossdef>
<para>Number of BitBake threads</para>
</glossdef>
</glossentry>
<glossentry id='var-BBFILES'><glossterm>BBFILES</glossterm>
<glossdef>
<para>List of recipes used by BitBake to build software</para>
</glossdef>
</glossentry>
<!-- BBPATH is not a usable variable in .bb files and should not be listed here -->
<glossentry id='var-BBINCLUDELOGS'><glossterm>BBINCLUDELOGS</glossterm>
<glossdef>
<para>Variable which controls how BitBake displays logs on build failure.</para>
</glossdef>
</glossentry>
</glossdiv>
<glossdiv id='var-glossary-c'><title>C</title>
<glossentry id='var-CFLAGS'><glossterm>CFLAGS</glossterm>
<glossdef>
<para>
Flags passed to C compiler for the target system. Evaluates to the same
as <link linkend='var-TARGET_CFLAGS'>TARGET_CFLAGS</link>.
</para>
</glossdef>
</glossentry>
<glossentry id='var-COMPATIBLE_MACHINE'><glossterm>COMPATIBLE_MACHINE</glossterm>
<glossdef>
<para>A regular expression which evalutates to match the machines the recipe
works with. It stops recipes being run on machines they're incompatible with
which is partciuarly useful with kernels. It also helps to to increase parsing
speed as if its found the current machine is not compatible, further parsing
of the recipe is skipped.</para>
</glossdef>
</glossentry>
<glossentry id='var-CONFIG_SITE'><glossterm>CONFIG_SITE</glossterm>
<glossdef>
<para>
Contains a list of files which containing autoconf test results relevant
to the current build. This variable is used by the autotools utilities
when running configure.
</para>
</glossdef>
</glossentry>
<glossentry id='var-CVS_TARBALL_STASH'><glossterm>CVS_TARBALL_STASH</glossterm>
<glossdef>
<para>Location to search for
pre-generated tarballs when fetching from remote SCM
repositories (CVS/SVN/GIT)</para>
</glossdef>
</glossentry>
</glossdiv>
<glossdiv id='var-glossary-d'><title>D</title>
<glossentry id='var-D'><glossterm>D</glossterm>
<glossdef>
<para>Destination directory</para>
</glossdef>
</glossentry>
<glossentry id='var-DEBUG_BUILD'><glossterm>DEBUG_BUILD</glossterm>
<glossdef>
<para>
Build packages with debugging information. This influences the value
<link linkend='var-SELECTED_OPTIMIZATION'>SELECTED_OPTIMIZATION</link>
takes.
</para>
</glossdef>
</glossentry>
<glossentry id='var-DEBUG_OPTIMIZATION'><glossterm>DEBUG_OPTIMIZATION</glossterm>
<glossdef>
<para>
The options to pass in <link linkend='var-TARGET_CFLAGS'>TARGET_CFLAGS</link>
and <link linkend='var-CFLAGS'>CFLAGS</link> when compiling a system for debugging.
This defaults to "-O -fno-omit-frame-pointer -g".
</para>
</glossdef>
</glossentry>
<glossentry id='var-DEFAULT_PREFERENCE'><glossterm>DEFAULT_PREFERENCE</glossterm>
<glossdef>
<para>Priority of recipe</para>
</glossdef>
</glossentry>
<glossentry id='var-DEPENDS'><glossterm>DEPENDS</glossterm>
<glossdef>
<para>
A list of build time dependencies for a given recipe. These indicate
recipes that must have staged before this recipe can configure.
</para>
</glossdef>
</glossentry>
<glossentry id='var-DESCRIPTION'><glossterm>DESCRIPTION</glossterm>
<glossdef>
<para>Package description used by package
managers</para>
</glossdef>
</glossentry>
<glossentry id='var-DESTDIR'><glossterm>DESTDIR</glossterm>
<glossdef>
<para>Destination directory</para>
</glossdef>
</glossentry>
<glossentry id='var-DISTRO'><glossterm>DISTRO</glossterm>
<glossdef>
<para>Short name of distribution</para>
</glossdef>
</glossentry>
<glossentry id='var-DISTRO_EXTRA_RDEPENDS'><glossterm>DISTRO_EXTRA_RDEPENDS</glossterm>
<glossdef>
<para>List of packages required by distribution.</para>
</glossdef>
</glossentry>
<glossentry id='var-DISTRO_EXTRA_RRECOMMENDS'><glossterm>DISTRO_EXTRA_RRECOMMENDS</glossterm>
<glossdef>
<para>List of packages which extend usability of
image. Those packages will be automatically
installed but can be removed by user.</para>
</glossdef>
</glossentry>
<glossentry id='var-DISTRO_FEATURES'><glossterm>DISTRO_FEATURES</glossterm>
<glossdef>
<para>Features of the distribution.</para>
</glossdef>
</glossentry>
<glossentry id='var-DISTRO_NAME'><glossterm>DISTRO_NAME</glossterm>
<glossdef>
<para>Long name of distribution</para>
</glossdef>
</glossentry>
<glossentry id='var-DISTRO_VERSION'><glossterm>DISTRO_VERSION</glossterm>
<glossdef>
<para>Version of distribution</para>
</glossdef>
</glossentry>
<glossentry id='var-DL_DIR'><glossterm>DL_DIR</glossterm>
<glossdef>
<para>Directory where all fetched sources will be stored</para>
</glossdef>
</glossentry>
</glossdiv>
<glossdiv id='var-glossary-e'><title>E</title>
<glossentry id='var-ENABLE_BINARY_LOCALE_GENERATION'><glossterm>ENABLE_BINARY_LOCALE_GENERATION</glossterm>
<glossdef>
<para>Variable which control which locales for glibc are
to be generated during build (useful if target device
has 64M RAM or less)</para>
</glossdef>
</glossentry>
<glossentry id='var-EXTRA_OECONF'><glossterm>EXTRA_OECONF</glossterm>
<glossdef>
<para>Additional 'configure' script options</para>
</glossdef>
</glossentry>
<glossentry id='var-EXTRA_OEMAKE'><glossterm>EXTRA_OEMAKE</glossterm>
<glossdef>
<para>Additional GNU make options</para>
</glossdef>
</glossentry>
</glossdiv>
<glossdiv id='var-glossary-f'><title>F</title>
<glossentry id='var-FILES'><glossterm>FILES</glossterm>
<glossdef>
<para>list of directories/files which will be placed
in packages</para>
</glossdef>
</glossentry>
<glossentry id='var-FULL_OPTIMIZATION'><glossterm>FULL_OPTIMIZATION</glossterm>
<glossdef>
<para>
The options to pass in <link linkend='var-TARGET_CFLAGS'>TARGET_CFLAGS</link>
and <link linkend='var-CFLAGS'>CFLAGS</link> when compiling an optimised system.
This defaults to "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2".
</para>
</glossdef>
</glossentry>
</glossdiv>
<!-- <glossdiv id='var-glossary-g'><title>G</title>-->
<!-- </glossdiv>-->
<glossdiv id='var-glossary-h'><title>H</title>
<glossentry id='var-HOMEPAGE'><glossterm>HOMEPAGE</glossterm>
<glossdef>
<para>Website where more info about package can be found</para>
</glossdef>
</glossentry>
</glossdiv>
<glossdiv id='var-glossary-i'><title>I</title>
<glossentry id='var-IMAGE_FEATURES'><glossterm>IMAGE_FEATURES</glossterm>
<glossdef>
<para><link linkend="ref-features-image">List of
features</link> present in resulting images</para>
</glossdef>
</glossentry>
<glossentry id='var-IMAGE_FSTYPES'><glossterm>IMAGE_FSTYPES</glossterm>
<glossdef>
<para>Formats of rootfs images which we want to have
created</para>
</glossdef>
</glossentry>
<glossentry id='var-IMAGE_INSTALL'><glossterm>IMAGE_INSTALL</glossterm>
<glossdef>
<para>List of packages used to build image</para>
</glossdef>
</glossentry>
<glossentry id='var-INHIBIT_PACKAGE_STRIP'><glossterm>INHIBIT_PACKAGE_STRIP</glossterm>
<glossdef>
<para>
This variable causes the build to not strip binaries in
resulting packages.
</para>
</glossdef>
</glossentry>
<glossentry id='var-INHERIT'><glossterm>INHERIT</glossterm>
<glossdef>
<para>
This variable causes the named class to be inherited at
this point during parsing. Its only valid in configuration
files.
</para>
</glossdef>
</glossentry>
<glossentry id='var-INITSCRIPT_PACKAGES'><glossterm>INITSCRIPT_PACKAGES</glossterm>
<glossdef>
<para>
Scope: Used in recipes when using update-rc.d.bbclass. Optional, defaults to PN.
</para>
<para>
A list of the packages which contain initscripts. If multiple
packages are specified you need to append the package name
to the other INITSCRIPT_* as an override.
</para>
</glossdef>
</glossentry>
<glossentry id='var-INITSCRIPT_NAME'><glossterm>INITSCRIPT_NAME</glossterm>
<glossdef>
<para>
Scope: Used in recipes when using update-rc.d.bbclass. Mandatory.
</para>
<para>
The filename of the initscript (as installed to ${etcdir}/init.d).
</para>
</glossdef>
</glossentry>
<glossentry id='var-INITSCRIPT_PARAMS'><glossterm>INITSCRIPT_PARAMS</glossterm>
<glossdef>
<para>
Scope: Used in recipes when using update-rc.d.bbclass. Mandatory.
</para>
<para>
Specifies the options to pass to update-rc.d. An example is
"start 99 5 2 . stop 20 0 1 6 ." which gives the script a
runlevel of 99, starts the script in initlevels 2 and 5 and
stops it in levels 0, 1 and 6.
</para>
</glossdef>
</glossentry>
</glossdiv>
<!-- <glossdiv id='var-glossary-j'><title>J</title>-->
<!-- </glossdiv>-->
<glossdiv id='var-glossary-k'><title>K</title>
<glossentry id='var-KERNEL_IMAGETYPE'><glossterm>KERNEL_IMAGETYPE</glossterm>
<glossdef>
<para>The type of kernel to build for a device, usually set by the
machine configuration files and defaults to "zImage". This is used
when building the kernel and is passed to "make" as the target to
build.</para>
</glossdef>
</glossentry>
</glossdiv>
<glossdiv id='var-glossary-l'><title>L</title>
<glossentry id='var-LICENSE'><glossterm>LICENSE</glossterm>
<glossdef>
<para>List of package source licenses.</para>
</glossdef>
</glossentry>
</glossdiv>
<glossdiv id='var-glossary-m'><title>M</title>
<glossentry id='var-MACHINE'><glossterm>MACHINE</glossterm>
<glossdef>
<para>Target device</para>
</glossdef>
</glossentry>
<glossentry id='var-MACHINE_ESSENTIAL_RDEPENDS'><glossterm>MACHINE_ESSENTIAL_RDEPENDS</glossterm>
<glossdef>
<para>List of packages required to boot device</para>
</glossdef>
</glossentry>
<glossentry id='var-MACHINE_ESSENTIAL_RRECOMMENDS'><glossterm>MACHINE_ESSENTIAL_RRECOOMENDS</glossterm>
<glossdef>
<para>List of packages required to boot device (usually
additional kernel modules)</para>
</glossdef>
</glossentry>
<glossentry id='var-MACHINE_EXTRA_RDEPENDS'><glossterm>MACHINE_EXTRA_RDEPENDS</glossterm>
<glossdef>
<para>List of packages required to use device</para>
</glossdef>
</glossentry>
<glossentry id='var-MACHINE_EXTRA_RRECOMMENDS'><glossterm>MACHINE_EXTRA_RRECOMMNEDS</glossterm>
<glossdef>
<para>List of packages useful to use device (for example
additional kernel modules)</para>
</glossdef>
</glossentry>
<glossentry id='var-MACHINE_FEATURES'><glossterm>MACHINE_FEATURES</glossterm>
<glossdef>
<para>List of device features - defined in <link
linkend='ref-features-machine'>machine
features section</link></para>
</glossdef>
</glossentry>
<glossentry id='var-MAINTAINER'><glossterm>MAINTAINER</glossterm>
<glossdef>
<para>E-mail of distribution maintainer</para>
</glossdef>
</glossentry>
</glossdiv>
<!-- <glossdiv id='var-glossary-n'><title>N</title>-->
<!-- </glossdiv>-->
<!-- <glossdiv id='var-glossary-o'><title>O</title>-->
<!-- </glossdiv>-->
<glossdiv id='var-glossary-p'><title>P</title>
<glossentry id='var-PACKAGE_ARCH'><glossterm>PACKAGE_ARCH</glossterm>
<glossdef>
<para>Architecture of resulting package</para>
</glossdef>
</glossentry>
<glossentry id='var-PACKAGE_CLASSES'><glossterm>PACKAGE_CLASSES</glossterm>
<glossdef>
<para>List of resulting packages formats</para>
</glossdef>
</glossentry>
<glossentry id='var-PACKAGE_EXTRA_ARCHS'><glossterm>PACKAGE_EXTRA_ARCHS</glossterm>
<glossdef>
<para>List of architectures compatible with device
CPU. Usable when build is done for few different
devices with misc processors (like XScale and
ARM926-EJS)</para>
</glossdef>
</glossentry>
<glossentry id='var-PACKAGES'><glossterm>PACKAGES</glossterm>
<glossdef>
<para>List of packages to be created from recipe.
The default value is "${PN}-dbg ${PN} ${PN}-doc ${PN}-dev"</para>
</glossdef>
</glossentry>
<glossentry id='var-PN'><glossterm>PN</glossterm>
<glossdef>
<para>Name of package.
</para>
</glossdef>
</glossentry>
<glossentry id='var-PR'><glossterm>PR</glossterm>
<glossdef>
<para>Revision of package.
</para>
</glossdef>
</glossentry>
<glossentry id='var-PV'><glossterm>PV</glossterm>
<glossdef>
<para>Version of package.
The default value is "1.0"</para>
</glossdef>
</glossentry>
<glossentry id='var-PE'><glossterm>PE</glossterm>
<glossdef>
<para>
Epoch of the package. The default value is "1". The field is used
to make upgrades possible when the versioning scheme changes in
some backwards incompatible way.
</para>
</glossdef>
</glossentry>
<glossentry id='var-PREFERRED_PROVIDER'><glossterm>PREFERRED_PROVIDER</glossterm>
<glossdef>
<para>If multiple recipes provide an item, this variable
determines which one should be given preference. It
should be set to the "$PN" of the recipe to be preferred.</para>
</glossdef>
</glossentry>
<glossentry id='var-PREFERRED_VERSION'><glossterm>PREFERRED_VERSION</glossterm>
<glossdef>
<para>
If there are multiple versions of recipe available, this
variable determines which one should be given preference. It
should be set to the "$PV" of the recipe to be preferred.
</para>
</glossdef>
</glossentry>
<glossentry id='var-POKYLIBC'><glossterm>POKYLIBC</glossterm> |