1 2016-01-15 Han Shen <shenhan (a] google.com> 2 3 PR gold/19472 - need pc-relative stubs. 4 5 * aarch64.cc (Reloc_stub::stub_type_for_reloc): Return PC-relative 6 stub type for DSOs and pie executables. 7 8 2015-11-05 Cary Coutant <ccoutant (a] gmail.com> 9 10 PR gold/19163 11 * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply 12 certain relocations if --no-apply-dynamic-relocs is set. 13 * options.h (--apply-dynamic-relocs): New aarch64-specific option. 14 15 2015-10-27 Han Shen <shenhan (a] google.com> 16 17 PR gold/19042 - unsupported reloc 311/312. 18 19 * aarch64.cc (Target_aarch64::Scan::local): Add support for 20 reloc 311/312. 21 22 2015-01-02 Alan Modra <amodra (a] gmail.com> 23 24 * version.cc (print_version): Just print current year. 25 * dwp.cc (print_version): Likewise. 26 27 2015-02-21 H.J. Lu <hongjiu.lu (a] intel.com> 28 29 * configure.ac (default_size): Set to 32 for x32. 30 * configure: Regenerated. 31 32 2015-02-18 Alan Modra <amodra (a] gmail.com> 33 34 PR 17954 35 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default 36 visibility. 37 38 2015-02-17 Rafael vila de Espndola <rafael.espindola (a] gmail.com> 39 40 * gc.h (Garbage_collection::add_reference): Don't use find. 41 42 2015-02-17 Rafael vila de Espndola <rafael.espindola (a] gmail.com> 43 44 * object.cc (write_local_symbols): avoid std::vector copy. 45 46 2015-02-17 Rafael vila de Espndola <rafael.espindola (a] gmail.com> 47 48 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound. 49 50 2015-02-09 Mark Wielaard <mjw (a] redhat.com> 51 52 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize 53 DW_LANG_Fortran03 and DW_LANG_Fortran08. 54 55 2015-02-16 Cary Coutant <ccoutant (a] google.com> 56 57 PR gold/17971 58 * incremental.cc: Remove redundant include of "output.h". 59 60 2015-02-11 Will Newton <will.newton (a] linaro.org> 61 62 PR gold/13321 63 * arm.cc (Target_arm::make_plt_section): Create an ARM 64 state mapping symbol at the start of the PLT. 65 66 2015-02-09 H.J. Lu <hongjiu.lu (a] intel.com> 67 68 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES): 69 Replace two_file_shared_2.so with two_file_shared_1.so. 70 * testsuite/Makefile.in: Regenerated. 71 72 2015-02-09 Alan Modra <amodra (a] gmail.com> 73 74 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a, 75 plugin_test_thin.a and defsym_test. 76 * testsuite/Makefile.in: Regenerate. 77 78 2015-02-04 Rafael vila de Espndola <rafael.espindola (a] gmail.com> 79 80 * merge.cc (do_add_input_section): Combine loop epilogue into main loop 81 body. 82 83 2015-02-02 Cary Coutant <ccoutant (a] google.com> 84 85 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for 86 executable output file. 87 88 2015-01-28 Cary Coutant <ccoutant (a] google.com> 89 90 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization 91 for undef TLS symbols. 92 (Target_x86_64::Relocate::relocate_tls): Likewise. 93 (Target_x86_64::Relocate::tls_ie_to_le): Likewise. 94 95 2015-01-25 Cary Coutant <ccoutant (a] google.com> 96 97 * output.cc (Output_segment::set_section_addresses): Fix calculation 98 of size of relro segment. 99 100 2015-01-14 Sasa Stankovic <Sasa.Stankovic (a] imgtec.com> 101 102 * mips.cc (reloc_high): Add r_sym. 103 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to 104 reloc_high constructor. 105 (Mips_relocate_functions::relgot16_local): Likewise. 106 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and 107 r_type to decide whether LO16 matches HI16. 108 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16, 109 rello16 and relgot16_local. 110 111 2015-01-09 Cary Coutant <ccoutant (a] google.com> 112 113 * layout.cc (Layout::set_segment_offsets): Don't align start of segment 114 unless alignment is larger than page size. 115 116 2015-01-06 H.J. Lu <hongjiu.lu (a] intel.com> 117 Cary Coutant <ccoutant (a] google.com> 118 119 PR gold/17729 120 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32. 121 (DEFAULT_TARGET_X32): Set for x32. 122 * x86_64.cc (cmp_insn_32): New. 123 (lea_r10_insn_32): Likewise. 124 (lea_r11_insn_32): Likewise. 125 (cmp_insn_64): Likewise. 126 (lea_r10_insn_64): Likewise. 127 (lea_r11_insn_64): Likewise. 128 (Target_x86_64<size>::do_calls_non_split): Handle x32. 129 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh. 130 (check_DATA): Add split_x32 files. 131 (split_x32_[1234n].o): New targets. 132 (split_x32_[124]): New targets. 133 (split_x32_[1234r].stdout): New targets. 134 * testsuite/split_x32.sh: New file. 135 * testsuite/split_x32_1.s: Likewise. 136 * testsuite/split_x32_2.s: Likewise. 137 * testsuite/split_x32_3.s: Likewise. 138 * testsuite/split_x32_4.s: Likewise. 139 * testsuite/split_x32_n.s: Likewise. 140 * configure: Regenerated. 141 * testsuite/Makefile.in: Likewise. 142 143 2015-01-06 H.J. Lu <hongjiu.lu (a] intel.com> 144 145 PR gold/17809 146 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle 147 x32. 148 149 2014-12-25 Alan Modra <amodra (a] gmail.com> 150 151 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on 152 new enums. 153 (Target_arm::merge_object_attributes, ): Likewise. 154 155 2014-12-25 Thomas Preud'homme <thomas.preudhomme (a] arm.com> 156 157 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header 158 as hard float only when Tag_ABI_VFP_args is 1, using new enum value 159 AEABI_VFP_args_vfp to check that. 160 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args 161 value and replace hardcoded values by enum values. 162 163 2014-12-20 H.J. Lu <hongjiu.lu (a] intel.com> 164 165 PR gold/14608 166 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed 167 to "return i * i * 3;". 168 169 2014-12-16 Cary Coutant <ccoutant (a] google.com> 170 171 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes. 172 (Mapfile::print_output_data): Use current_data_size() to avoid 173 assert for sections requiring postprocessing; if address is not valid, 174 print 0. 175 (Mapfile::print_output_section): Use current_data_size(); print note 176 that addresses and sizes are before compression. 177 178 2014-12-03 H.J. Lu <hongjiu.lu (a] intel.com> 179 180 PR gold/17675 181 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New. 182 * testsuite/Makefile.in: Regenerated. 183 184 2014-12-01 Dimitry Ivanov <dimitry (a] google.com> 185 186 * layout.cc (Layout::finish_dynamic_section): When '-z global' 187 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags. 188 * options.h (General_options): New -z option (global). 189 190 2014-12-01 Cary Coutant <ccoutant (a] google.com> 191 192 PR gold/17578 193 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack 194 is given. 195 (Layout::create_executable_stack_info): Warn when -z noexecstack is 196 given but some inputs require executable stack. 197 198 2014-11-26 Cary Coutant <ccoutant (a] google.com> 199 200 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and 201 .debug_str_offsets; strip .debug_gnu_pubnames and 202 .debug_gnu_pubtypes. 203 (lines_only_debug_sections): Strip all four new sections. 204 205 2014-11-25 Cary Coutant <ccoutant (a] google.com> 206 207 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol. 208 (Binary_to_elf::write_symbol): Add st_size parameter. 209 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter. 210 211 2014-11-25 Cary Coutant <ccoutant (a] google.com> 212 213 PR gold/17639 214 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_. 215 (Sized_relobj_file::do_layout): Handle deferred sections properly 216 during GC pass 1. Don't add reloc sections to deferred list twice. 217 * object.h (Sized_relobj_file::is_deferred_layout): New function. 218 (Sized_relobj_file::is_deferred_layout_): New data member. 219 220 2014-11-21 H.J. Lu <hongjiu.lu (a] intel.com> 221 222 PR gold/17619 223 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry): 224 Check PC-relative offset overflow in PLT entry. 225 226 2015-06-16 Yiran Wang <yiran (a] google.com> 227 228 * resolve.cc disable the warning of a hidden symbol matches a 229 reference to be resolved 230 231 2015-07-23 Ian Coolidge <icoolidge (a] google.com> 232 233 Plumb --pic-veneer option for gold. 234 235 This fixes ARM Linux gold link after 236 02e541d: ARM: 8323/1: force linker to use PIC veneers 237 238 gold/ 239 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub 240 generation. 241 * options.h (General_options): Add --pic-veneer option. 242 243 2015-06-11 Cary Coutant <ccoutant (a] gmail.com> 244 245 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization 246 outside class body. 247 (Reloc_stub::STUB_ADDR_ALIGN): Likewise. 248 249 2015-07-20 Han Shen <shenhan (a] google.com> 250 251 Optimize erratum 843419 fix. 252 253 * aarch64.cc (AArch64_insn_utilities::is_adr): New method. 254 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method. 255 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method. 256 (E843419_stub): New sub-class of Erratum_stub. 257 (AArch64_relobj::try_fix_erratum_843419_optimized): New method. 258 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix. 259 (AArch64_relobj::create_erratum_stub): Add 1 argument. 260 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset. 261 262 2015-07-20 Han Shen <shenhan (a] google.com> 263 264 Fix arm elf header flags wrt hardfp bit. 265 266 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view. 267 268 2015-07-09 Han Shen <shenhan (a] google.com> 269 270 Drop missing symbol warning for arm/aarch64. 271 272 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning. 273 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing 274 symbol warning. 275 276 2015-07-09 Han Shen <shenhan (a] google.com> 277 278 Use "gold_info" instead of "gold_warning" for erratum fix. 279 280 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use 281 'gold_info'. 282 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'. 283 284 2015-07-07 Han Shen <shenhan (a] google.com> 285 286 Make gold aarch64 accept long form of mapping symbols. 287 288 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal 289 of mapping symbols. 290 291 2015-06-29 Han Shen <shenhan (a] google.com> 292 293 Patch for erratum 843419 internal error. 294 295 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef. 296 (Erratum_stub::update_erratum_insn): New method. 297 (Stub_table::relocate_stubs): Modified to place relocated insn. 298 (AArch64_relobj::fix_errata): Modified gold_assert. 299 300 2015-06-12 Han Shen <shenhan (a] google.com> 301 302 Fix erratum 835769. 303 304 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move 305 defintion outside class definition. 306 (AArch64_insn_utilities::AARCH64_ZR): New static constant. 307 (AArch64_insn_utilities::aarch64_op31): New member. 308 (AArch64_insn_utilities::aarch64_ra): New member. 309 (AArch64_insn_utilities::aarch64_mac): New member. 310 (AArch64_insn_utilities::aarch64_mlxl): New member. 311 (ST_E_835769): New global enum member. 312 (Stub_table::relocate_stubs): Add 835769 handler. 313 (Stub_template_repertoire::Stub_template_repertoire): Install new 314 stub type. 315 (AArch64_relobj::scan_errata): This func is renamed from 316 scan_erratum_843419. 317 (AArch64_relobj::do_count_local_symbols): Add 835769 handler. 318 (AArch64_relobj::do_relocate_sections): Add 835769 handler. 319 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler. 320 (Target_aarch64::scan_erratum_835769_span): New method. 321 (Target_aarch64::create_erratum_stub): New method. 322 (Target_aarch64::is_erratum_835769_sequence): New method. 323 (Target_aarch64::scan_erratum_843419_sequence): Move part of the 324 code into create_erratum_stub. 325 * options.h (fix_cortex_a53_835769): New option. 326 327 2015-06-10 Han Shen <shenhan (a] google.com> 328 Patch for erratum-843419 (2 of 2 - fix erratum occurrences). 329 330 Now fixing for 843419 is fully functional. 331 332 The first part of the erratum fix CL is here - 333 https://sourceware.org/ml/binutils/2015-04/msg00229.html 334 335 * aarch64.cc(global enum): New constants representing stub types. 336 (Stub_template): New POD struct. 337 (Stub_template_repertoire): New class. 338 (Stub_base): New class. 339 (Erratum_stub): New class. 340 (Reloc_stub): Refactored to be a subclass of Stub_base. 341 (Reloc_stub::Stub_type): Removed. 342 (Reloc_stub::offset): Moved to Stub_base. 343 (Reloc_stub::set_offset): Moved to Stub_base. 344 (Reloc_stub::destination_address): Moved to Stub_base. 345 (Reloc_stub::set_destination_address): Moved to Stub_base. 346 (Reloc_stub::reset_destination_address): Moved to Stub_base. 347 (Reloc_stub::stub_type): Renamed and moved to Stub_base. 348 (Reloc_stub::stub_size): Renamed and moved to Stub_base. 349 (Reloc_stub::stub_insns): Renamed and moved to Stub_base. 350 (Reloc_stub::write): Moved to Stub_base. 351 (Reloc_stub::invalid_offset): Moved to Stub_base. 352 (Reloc_stub::invalid_address): Moved to Stub_base. 353 (Reloc_stub::stub_type_): Renamed and moved to Stub_base. 354 (Reloc_stub::stub_insns_): Moved to Stub_base. 355 (Reloc_stub::offset_): Moved to Stub_base. 356 (Reloc_stub::destination_address_): Moved to Stub_base. 357 (Stub_table::The_aarch64_relobj): New typedef. 358 (Stub_table::The_erratum_stub): New typedef. 359 (Stub_table::The_erratum_stub_less): New typedef. 360 (Stub_table::The_erratum_stub_set): New typedef. 361 (Stub_table::The_erratum_stub_set_iter): New typedef. 362 (Stub_table::empty): Added emptiness testing for erratum stubs. 363 (Stub_table::add_erratum_stub): New method to add an erratum stub. 364 (Stub_table::find_erratum_stub): New method. 365 (Stub_table::find_erratum_stubs_for_input_section): New method. 366 (Stub_table::erratum_stub_address): New method. 367 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs. 368 (Stub_table::do_addralign): Modified to handle erratum stubs. 369 (Stub_table::erratum_stubs_): New member. 370 (Stub_table::erratum_stub_size_): New member. 371 (Stub_table::relocate_stubs): Modified to handle erratum stubs. 372 (Stub_table::do_write): Modified to handle erratum stubs. 373 (AArch64_relobj::The_erratum_stub): New typedef. 374 (AArch64_relobj::Erratum_stub_set_iter): New typedef. 375 (AArch64_relobj::fix_errata): New method. 376 (Target_aarch64::The_reloc_stub_type): Removed. 377 (Target_aarch64::The_erratum_stub): New typede. 378 (AArch64_relocate_functions::construct_b): New method. 379 380 2015-04-27 Han Shen <shenhan (a] google.com> 381 382 * options.h (--fix-cortex-a53-843419): Rename option. 383 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed 384 option. 385 (AArch64_relobj::scan_sections_for_stubs): Use renamed option. 386 387 2015-04-16 Han Shen <shenhan (a] google.com> 388 389 * aarch64.cc (AArch64_insn_utilities): New utility class. 390 (AArch64_relobj::Mapping_symbol_position): New struct. 391 (AArch64_relobj::Mapping_symbol_info): New typedef. 392 (AArch64_relobj::do_count_local_symbols): New function overriding 393 parent's implementation. 394 (AArch64_relobj::mapping_symbol_info_): New member 395 (AArch64_relobj::scan_erratum_843419): New method. 396 (Target_aarch64::scan_erratum_843419_span): New method. 397 (Target_aarch64::is_erratum_843419_sequence): New method. 398 * options.h (fix_cortex_a53): New option. 399 400 2015-02-02 Khem Raj <raj.khem (a] gmail.com> 401 402 * attributes.h (class Output_attributes_section_data ): Add 403 do_print_to_mapfile function. 404 405 2015-04-07 HC Yen <hc.yen (a] mediatek.com> 406 407 Add AArch32 support for gold linker. 408 gold/ 409 * arm.cc: Add V8 arch combine table. 410 411 2015-03-21 Cary Coutant <cary (a] google.com> 412 413 PR gold/18048 414 * script-c.h (script_include_directive): Add first_token parameter. 415 * script.cc (script_include_directive): Add first_token parameter, and 416 pass it to read_script_file. 417 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS) 418 (PARSING_MEMORY_DEF): New tokens. 419 (top): Add new productions for INCLUDE files. 420 (file_cmd): Replace file_or_sections_cmd with copy of its productions. 421 Pass PARSING_LINKER_SCRIPT to script_include_directive. 422 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK. 423 (section_cmd): Pass PARSING_SECTION_CMDS. 424 (file_or_sections_cmd): Remove. 425 (memory_def): Pass PARSING_MEMORY_DEF. 426 * testsuite/Makefile.am (memory_test_2): New test. 427 * testsuite/Makefile.in: Regenerate. 428 * testsuite/memory_test_inc.t: New script file. 429 * testsuite/memory_test_inc_1.t.src: New script file. 430 * testsuite/memory_test_inc_2.t.src: New script file. 431 * testsuite/memory_test_inc_3.t.src: New script file. 432 433 2015-03-21 Cary Coutant <cary (a] google.com> 434 435 PR gold/18010 436 * stringpool.cc (Stringpool_template): Don't optimize if section 437 alignment is greater than sizeof(char). 438 439 2014-11-13 H.J. Lu <hongjiu.lu (a] intel.com> 440 441 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT 442 entry for R_X86_64_GOTPLT64. 443 (Target_x86_64<size>::Relocate::relocate): Update comments for 444 R_X86_64_GOTPLT64. 445 446 2014-11-06 Evgeniy Dushistov <dushistov (a] mail.ru> 447 448 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file 449 * plugin.h: add lock definition 450 451 2014-10-29 Han Shen <shenhan (a] google.com> 452 Jing Yu <jingyu (a] google.com> 453 454 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21, 455 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1, 456 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to 457 Symbol::TLS_REF. 458 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New 459 method. 460 (Target_aarch64::reloc_needs_plt_for_ifunc): New method. 461 (Target_aarch64::tls_ld_to_le): New method. 462 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections 463 for 64bit targets. 464 (Output_data_plt_aarch64::irelative_rel_): New data member. 465 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt. 466 (Output_data_plt_aarch64::add_local_ifunc_entry): New method. 467 (Output_data_plt_aarch64::add_relocation): New method. 468 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative 469 offset. Add got_irelative size to got size. 470 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long 471 type string with the new typename. 472 (AArch64_relocate_functions::update_adr): Replace parameter x with 473 immed. 474 (AArch64_relocate_functions::update_movnz): Correct wrong val mask. 475 (AArch64_relocate_functions::reloc_common): New method. 476 (AArch64_relocate_funcsions::rela_general): Extract common part out 477 into reloc_common method. 478 (AArch64_relocate_functions::rela_general): Likewise. 479 (AArch64_relocate_functions::pcrela_general): Likewise. 480 (AArch64_relocate_functions::adr): New method. 481 (AArch64_relocate_functions::adrp): Calculate immed before calling 482 update_adr. 483 (AArch64_relocate_functions::adrp): Likewise. 484 (AArch64_relocate_functions::movnz): Cast x to SignedW type when 485 comparing x to 0. Calculate immed from ~x when x < 0. 486 (Target_aarch64::optimize_tls_reloc): Add new cases for 487 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1, 488 TLSLD_MOVW_DTPREL_G0_NC. 489 (Target_aarch64::possible_function_pointer_reloc): Implement this 490 method. 491 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update 492 comment. 493 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC 494 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, 495 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC. 496 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC 497 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, 498 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC. 499 (Target_aarch64::make_plt_entry): Call add_entry with two more 500 parameters. 501 (Target_aarch64::make_local_ifunc_plt_entry): New method. 502 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19, 503 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, 504 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC. 505 (Target_aarch64::Relocate::relocate_tls): Add cases for 506 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1, 507 TLSLD_MOVW_DTPREL_G0_NC. 508 * testsuite/icf_safe_so_test.cc: Correct test comment. 509 * testsuite/icf_safe_test.sh: Add AArch64 arch. 510 511 2014-10-22 Alan Modra <amodra (a] gmail.com> 512 513 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to 514 thread_starter. 515 516 2014-10-18 Andreas Schwab <schwab (a] linux-m68k.org> 517 518 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define. 519 520 2014-10-17 Cary Coutant <ccoutant (a] google.com> 521 522 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub): 523 Add "typename" keyword. 524 525 2014-09-22 Han Shen <shenhan (a] google.com> 526 Jing Yu <jingyu (a] google.com> 527 528 Patch for gold aarch64 backend to support relaxation. 529 * aarch64-reloc.def: Change format. 530 * aarch64.cc (class Reloc_stub): New class. 531 (class Stub_table): New class. 532 (class AArch64_relobj): New class. 533 (class AArch64_input_section): New class. 534 (class AArch64_output_section): New class. 535 (Target_aarch64::new_stub_table): New method. 536 (Target_aarch64::new_aarch64_input_section): New method. 537 (Target_aarch64::find_aarch64_input_section): New method. 538 (Target_aarch64::scan_section_for_stubs): New method. 539 (Target_aarch64::scan_reloc_section_for_stubs): New method. 540 (Target_aarch64::relocate_stub): New method. 541 (Target_aarch64::current_target): New method. 542 (Target_aarch64::do_make_elf_object): New method. 543 (Target_aarch64::do_may_relax): New method. 544 (Target_aarch64::do_relax): New method. 545 (Target_aarch64::group_sections): New method. 546 (Target_aarch64::scan_reloc_for_stub): New method. 547 (Target_aarch64::do_make_output_section): New method. 548 (Target_aarch64::stub_tables_): New data member. 549 (Target_aarch64::aarch64_input_section_map_): New data member. 550 (AArch64_relocate_functions::maybe_apply_stub): New method. 551 552 2014-09-30 Cary Coutant <ccoutant (a] google.com> 553 554 PR gold/17432 555 * resolve.cc (Symbol_table::resolve): Fix local shadowing error. 556 557 2014-09-30 Kito Cheng <kito (a] 0xlab.org> 558 559 PR gold/13597 560 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style 561 hash table before sysv-style hash table. 562 563 2014-09-29 Sriraman Tallam <tmsriram (a] google.com> 564 565 * options.h (--pic-executable): Add negative to alias to -no-pie. 566 567 2014-09-26 Cary Coutant <ccoutant (a] google.com> 568 569 PR gold/16773 570 * object.cc (Sized_relobj_file): Compute value of section symbols 571 for TLS sections the same as TLS symbols. 572 573 2014-09-25 Cary Coutant <ccoutant (a] google.com> 574 575 PR gold/17432 576 * resolve.cc (Symbol_table::resolve): Override common placeholder 577 symbols, but adjust sizes. 578 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder 579 symbols to common lists. 580 581 2014-09-24 Alan Modra <amodra (a] gmail.com> 582 583 * po/POTFILES.in: Regenerate. 584 585 2014-09-23 Taiju Tsuiki <tzik (a] google.com> 586 Cary Coutant <ccoutant (a] google.com> 587 588 PR gold/14860 589 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker 590 on input_sections_blocker. 591 * layout.cc (Write_sections_task::locks): Unblock 592 input_sections_blocker_. 593 * layout.h (Write_sections_task::Write_sections_task): Add 594 input_sections_blocker. 595 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld 596 to DEPENDENCIES. 597 * testsuite/Makefile.in: Regenerate. 598 599 2014-09-18 Rafael vila de Espndola <rafael.espindola (a] gmail.com> 600 601 * testsuite/Makefile.am (plugin_test_10): New test. 602 * testsuite/Makefile.in: Regenerate 603 * testsuite/plugin_common_test_2.c (c1): Align to 8. 604 * testsuite/plugin_test_10.sh: New file. 605 606 2014-09-17 Rafael vila de Espndola <rafael.espindola (a] gmail.com> 607 608 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size. 609 * resolve.cc (Symbol_table::resolve): Don't override common symbols 610 during the replacement phase. 611 612 2014-09-17 Han Shen <shenhan (a] google.com> 613 Jing Yu <jingyu (a] google.com> 614 615 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC, 616 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL. 617 * aarch64.cc (Target_aarch64): Add data members 618 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_, 619 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in 620 constructor. 621 (Target_aarch64::do_reloc_symbol_index): New method. 622 (Target_aarch64::do_reloc_addend): New method. 623 (Target_aarch64::add_tlsdesc_info): New method. 624 (Target_aarch64::do_dynsym_value): New method. 625 (Target_aarch64::do_make_data_plt): Add new parameters: got, 626 got_irelative. Pass them to Output_data_plt_aarch64_standard. 627 (Target_aarch64::make_data_plt): Add new parameters: got, 628 got_irelative. Pass them to do_make_data_plt. 629 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable. 630 (Target_aarch64::Relocate:tls_gd_to_le): New method. 631 (Target_aarch64::Relocate:tls_ie_to_le): New method. 632 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method. 633 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method. 634 (Target_aarch64::got_tlsdesc_section): New method. 635 (Target_aarch64::make_local_ifunc_plt_entry): New method. 636 (Target_aarch64::define_tls_base_symbol): New method. 637 (Target_aarch64::reserve_tlsdesc_entries): New method. 638 (Target_aarch64::got_mod_index_entry): New method. 639 (Target_aarch64::rela_tlsdesc_section): New method. 640 (Target_aarch64::rela_irelative_section): New method. 641 (Target_aarch64::Tlsdesc_info): New struct. 642 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE 643 relocations and tlsdesc relocations. 644 (Target_aarch64::optimize_tls_reloc): Implement method. 645 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_, 646 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them 647 in constructor. 648 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method. 649 (Output_data_plt_aarch64::has_tlsdesc_entry): New method. 650 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method. 651 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method. 652 (Output_data_plt_aarch64::rela_tlsdesc): New method. 653 (Output_data_plt_aarch64::rela_irelative): New method. 654 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations. 655 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute. 656 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method. 657 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method. 658 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method. 659 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method. 660 (Output_data_plt_aarch64_standard): New member variables: 661 plt_tlsdesc_entry_size, tlsdesc_plt_entry. 662 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard): 663 New parameter: got, got_irelative. 664 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method. 665 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method. 666 (Output_data_plt_aarch64::do_write): Replace got_address with 667 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry. 668 (AArch64_relocate_functions::update_movnz): New method. 669 (AArch64_relocate_functions): Correct format. 670 (AArch64_relocate_functions::movnz): New method. 671 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to 672 before the switch. Add new cases to switch. 673 Check ie_to_le relaxation on tlsie relocations. Add code handling 674 tlsgd tlsdesc cases. 675 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when 676 needed. Add new cases to switch. Insert dynamic RELATIVE relocation 677 when needed. Add code handling tlsgd, tlsie, tlsdesc cases. 678 Call reloc_name_in_error_message to print unsupported reloc. 679 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to 680 make_data_plt. 681 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY 682 relocs. Fill in some more dynamic tags. 683 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs. 684 Skip call tls_get_addr when tlsgd is relaxed. 685 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code 686 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le, 687 tlsdesc->ie relaxation. 688 689 2014-09-03 Sasa Stankovic <Sasa.Stankovic (a] imgtec.com> 690 691 * mips.cc (Target_mips_nacl): New class. 692 (Target_selector_mips_nacl): New class. 693 (target_selector_mips32): Rename from target_selector_mips32be and use 694 Target_selector_mips_nacl instead of Target_selector_mips. 695 (target_selector_mips32el): Rename from target_selector_mips32 and use 696 Target_selector_mips_nacl instead of Target_selector_mips. 697 (target_selector_mips64): Rename from target_selector_mips64be and use 698 Target_selector_mips_nacl instead of Target_selector_mips. 699 (target_selector_mips64el): Rename from target_selector_mips64 and use 700 Target_selector_mips_nacl instead of Target_selector_mips. 701 (Target_mips::mips_info): Add const attribute. 702 703 2014-09-02 Cary Coutant <ccoutant (a] google.com> 704 705 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute. 706 * dynobj.h (Sized_dynobj::do_section_name): Likewise. 707 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise. 708 (Sized_incr_dynobj::do_section_name): Likewise. 709 * incremental.h (Sized_relobj_incr::do_section_name): Likewise. 710 (Sized_incr_dynobj::do_section_name): Likewise. 711 * object.h (Object::section_name): Likewise. 712 (Object::do_section_name): Likewise. 713 (Sized_relobj_file::do_section_name): Likewise. 714 * plugin.cc (Sized_pluginobj::do_section_name): Likewise. 715 * plugin.h (Sized_pluginobj::do_section_name): Likewise. 716 717 2014-09-02 Cary Coutant <ccoutant (a] google.com> 718 719 PR gold/17005 720 * ehframe.cc (Fde::write): Add output_offset parameter. 721 (Cie::write): Likewise. 722 (Eh_frame::set_final_data_size): Account for offset within output 723 section. 724 (Eh_frame::do_sized_write): Likewise. 725 * ehframe.h (Fde::write): Add output_offset parameter. 726 (Cie::write): Likewise. 727 * output.cc (Output_section::Input_section_sort_entry): Remove 728 section_has_name_; add output_section_name parameter. Use 729 output section name for non-input sections. 730 (Output_section::Input_section_sort_entry::section_has_name): Remove. 731 (Output_section::Input_section_sort_entry::section_has_name_): Remove. 732 (Output_section::Input_section_sort_compare): Remove logic for 733 sections without names. 734 (Output_section::Input_section_sort_init_fini_compare): Likewise. 735 (Output_section::Input_section_sort_section_prefix_special_ordering_compare): 736 Likewise. 737 (Output_section::Input_section_sort_section_name_compare): Likewise. 738 739 2014-08-29 Han Shen <shenhan (a] google.com> 740 Jing Yu <jingyu (a] google.com> 741 742 * aarch64-reloc-property.cc 743 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in 744 reference reloc property in the table. 745 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in 746 3 other entries. 747 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc): 748 2 new overloaded methods. 749 (Output_data_got_aarch64::do_write): Add code to write out 750 static relocs. 751 (class Output_data_got_aarch64::Static_reloc): New class to wrap 752 static relocs. 753 (Output_data_got_aarch64::static_relocs): New vector to 754 hold static relocs. 755 (Target_aarch64::TCB_SIZE): New const static memeber. 756 (Target_aarch64::tcb_size): New method. 757 (Target_aarch64::Relocate::relocate): Add code handling new reloc types. 758 (Target_aarch64::Relocate::relocate_tls): New method. 759 (Target_aarch64::Scan::local): Add code handling new reloc types. 760 (Target_aarch64::Scan::global): Add code handling new reloc types. 761 762 2014-08-13 Sriraman Tallam <tmsriram (a] google.com> 763 764 * options.h (-no-pie): Add option. 765 766 2014-08-08 Jing Yu <jingyu (a] google.com> 767 Han Shen <shenhan (a] google.com> 768 769 * Makefile.am (HFILES): Add aarch64-reloc-property.h. 770 (DEFFILES): add aarch64-reloc.def. 771 (TARGETSOURCES): Add aarch64-reloc-property.cc. 772 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT). 773 * Makefile.in: Regenerate. 774 * aarch64-reloc-property.cc: New file. 775 * aarch64-reloc-property.h: New file. 776 * aarch64-reloc.def: New file. 777 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces 778 with tab to make the format consistent. 779 (Output_data_got_aarch64::symbol_table_): New method. 780 (Target_aarch64::do_plt_address_for_global): New method. 781 (Target_aarch64::do_plt_address_for_local): New method. 782 (Target_aarch64::do_select_as_default_target): New method. 783 (Target_aarch64::do_make_data_plt): New method. 784 (Target_aarch64::make_data_plt): New method. 785 (Output_data_plt_aarch64::has_irelative_section): New method. 786 (Output_data_plt_aarch64::address_for_global): New method. 787 (Output_data_plt_aarch64::address_for_local): New method. 788 (Output_data_plt_aarch64::irelative_rel_): New parameter. 789 (Output_data_plt_aarch64::add_entry): Implement contents. 790 (Output_data_plt_aarch64::set_final_data_size): Fix typo. 791 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set 792 the got_pov entry to plt0. 793 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry): 794 Implement contents. 795 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement. 796 (AArch64_howto): New struct. 797 (aarch64_howto[]): New static const array. 798 (AArch64_relocate_functions): New class. 799 (Target_aarch64::Scan::get_reference_flags): Remove method. 800 (Target_aarch64::Scan::local): Implement to support a few relocations. 801 (Target_aarch64::Scan::global): Implement to support a few relocations. 802 (Target_aarch64::make_plt_section): Implement contents. 803 (Target_aarch64::make_plt_entry): Implement contents. 804 (Target_aarch64::do_finalize_sections): Implement contents. 805 (Target_aarch64::Relocate::relocate): Implement a few relocations. 806 (Target_aarch64::relocate_section): Implement contents. 807 808 2014-08-06 Alan Modra <amodra (a] gmail.com> 809 810 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation. 811 812 2014-08-06 Alan Modra <amodra (a] gmail.com> 813 814 PR 13227 815 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim. 816 817 2014-07-21 Sriraman Tallam <tmsriram (a] google.com> 818 819 * object.cc (Relobj::is_section_name_included): Add 820 ".rodata.nptl_version" to not garbage collect this section. 821 822 2014-07-08 Cary Coutant <ccoutant (a] google.com> 823 824 * expression.cc (struct Expression::Expression_eval_info): Add 825 new fields type_pointer, vis_pointer, and nonvis_pointer. 826 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and 827 nonvis_pointer parameters. Adjust all calls. 828 (Symbol_expression::value): Update type, visibility, and nonvis bits 829 in caller. 830 * script.cc (Symbol_assignment::sized_finalize): Update type, 831 visibility, and remaining st_other bits for new symbol. 832 * script.h: (Expression::eval_maybe_dot): Add type_pointer, 833 vis_pointer, and nonvis_pointer parameters. 834 * symtab.h (Symbol::set_type): New method. 835 836 * testsuite/Makefile.am (defsym_test): New test. 837 * testsuite/Makefile.in: Regenerate. 838 * testsuite/defsym_test.c: New file. 839 * testsuite/defsym_test.sh: New file. 840 841 2014-07-08 Cary Coutant <ccoutant (a] google.com> 842 843 PR gold/15639 844 * dynobj.h (Sized_dynobj::base_read_symbols): New method. 845 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to... 846 (Sized_dynobj::base_read_symbols): ...new method. 847 * object.h (Sized_relobj_file::base_read_symbols): New method. 848 * object.cc (Sized_relobj_file::do_read_symbols): Move body to... 849 (Sized_relobj_file::base_read_symbols): ...new method. 850 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols. 851 * mips.cc: (Mips_relobj::do_read_symbols): Likewise. 852 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise. 853 854 2014-07-04 Alan Modra <amodra (a] gmail.com> 855 856 * po/POTFILES.in: Regenerate. 857 858 2014-07-02 Jing Yu <jingyu (a] google.com> 859 860 * aarch64.cc: New file 861 * Makefile.am (TARGETSOURCES): Add aarch64.cc 862 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT) 863 * Makefile.in: Regenerate. 864 * configure.tgt: Add entries for aarch64*. 865 * configure.ac: Likewise. 866 * configure: Likewise. 867 868 2014-06-27 Alan Modra <amodra (a] gmail.com> 869 870 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline. 871 872 2014-06-24 Cary Coutant <ccoutant (a] google.com> 873 874 * dwp.cc (Dwo_file::read): Allow files with no .debug_types 875 sections. 876 (Dwo_file::sized_read_unit_index): Likewise. 877 878 2014-06-23 Sasa Stankovic <Sasa.Stankovic (a] imgtec.com> 879 880 * mips.cc: New file. 881 * Makefile.am (TARGETSOURCES): Add mips.cc 882 (ALL_TARGETOBJS): Add mips.$(OBJEXT) 883 * configure.tgt: Add entries for mips*. 884 * configure.ac: Likewise. 885 * Makefile.in: Regenerate. 886 * configure: Likewise. 887 888 2014-06-09 Cary Coutant <ccoutant (a] google.com> 889 890 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that 891 unit_length is within section bounds. 892 893 2014-06-09 Cary Coutant <ccoutant (a] google.com> 894 895 PR gold/16980 896 * layout.cc (Layout::print_to_mapfile): Print unattached sections in 897 map. 898 899 2014-06-07 Alan Modra <amodra (a] gmail.com> 900 901 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield. 902 903 2014-06-06 Cary Coutant <ccoutant (a] google.com> 904 905 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_. 906 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise. 907 (Dwarf_pubnames_table::read_header): Likewise. 908 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and 909 .debug_gnu_pubtypes. 910 911 2014-06-05 Joel Brobecker <brobecker (a] adacore.com> 912 913 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New. 914 * Makefile.in, configure: Regenerate. 915 916 2014-06-03 Alan Modra <amodra (a] gmail.com> 917 918 * powerpc.cc (addis_12_2): Define. 919 (Stub_table::do_write): Support fusion on ELFv2 stubs. 920 921 2014-06-03 Alan Modra <amodra (a] gmail.com> 922 923 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility 924 st_other output. 925 926 2014-06-02 Alan Modra <amodra (a] gmail.com> 927 928 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer): 929 Only ignore relocs on ELFv1. 930 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise. 931 932 2014-05-30 Cary Coutant <ccoutant (a] google.com> 933 934 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option. 935 * testsuite/Makefile.in: Regenerate. 936 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w". 937 938 2014-05-27 H.J. Lu <hongjiu.lu (a] intel.com> 939 940 PR gold/16945 941 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int 942 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64. 943 944 2014-05-15 Alan Modra <amodra (a] gmail.com> 945 946 * powerpc.cc (do_plt_fde_location): Handle zero length .glink. 947 Compare FDE contents with DW_CFA_nop rather than 0. 948 949 2014-05-13 Sriraman Tallam <tmsriram (a] google.com> 950 951 * symtab.h (may_need_copy_reloc): Remove check for position independent 952 code. 953 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no 954 position independence before pc absolute may_need_copy_reloc call. 955 Add check for executable output befor pc relative may_need_copy_reloc 956 call. 957 * i386.cc: Ditto. 958 * arm.cc: Ditto. 959 * sparc.cc: Ditto. 960 * tilegx.cc: Ditto. 961 * powerpc.cc: Add check for no position independence before 962 may_need_copy_reloc calls. 963 * testsuite/pie_copyrelocs_test.cc: New file. 964 * testsuite/pie_copyrelocs_shared_test.cc: New file. 965 * Makefile.am (pie_copyrelocs_test): New test. 966 * Makefile.in: Regenerate. 967 968 2014-05-08 Martin Lika <mliska (a] suse.cz> 969 970 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message. 971 972 2014-05-06 Cary Coutant <ccoutant (a] google.com> 973 974 PR gold/16900 975 * i386.cc (Output_data_got_plt_i386): New class. 976 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt 977 parameter. Change all callers. 978 (Output_data_plt_i386::layout_): Remove. 979 (Output_data_plt_i386::got_plt_): Change type. 980 (Target_i386::got_plt_): Change type. Change all references. 981 (Target_i386::got_section): Create instance of new class. 982 (Output_data_got_plt_i386::do_write): New function. 983 * x86_64.cc (Output_data_got_plt_x86_64): New class. 984 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt 985 parameter. Change all callers. 986 (Output_data_plt_x86_64::layout_): Remove. 987 (Output_data_plt_x86_64::got_plt_): Change type. 988 (Target_x86_64::got_plt_): Change type. Change all references. 989 (Target_x86_64::got_section): Create instance of new class. 990 (Output_data_got_plt_x86_64::do_write): New function. 991 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT. 992 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new 993 class. 994 995 2014-05-05 Cary Coutant <ccoutant (a] google.com> 996 997 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language 998 if we have pubnames/pubtypes. 999 1000 2014-05-02 Cary Coutant <ccoutant (a] google.com> 1001 1002 * defstd.cc (in_segment): Define __ehdr_start here... 1003 * layout.cc (Layout::finalize): ...Instead of here. Set the 1004 output segment when known. 1005 * resolve.cc (Symbol::override_base_with_special): Remember 1006 the original binding. 1007 * symtab.cc (Symbol::set_output_segment): New function. 1008 (Symbol::set_undefined): New function. 1009 * symtab.h (Symbol::is_weak_undefined): Check original undef 1010 binding. 1011 (Symbol::is_strong_undefined): New function. 1012 (Symbol::set_output_segment): New function. 1013 (Symbol::set_undefined): New function. 1014 * target-reloc.h (is_strong_undefined): Remove. 1015 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined. 1016 Check for hidden undefs. 1017 (relocate_section): Call Symbol::is_strong_undefined. 1018 1019 * testsuite/Makefile.am (ehdr_start_test_1) 1020 (ehdr_start_test_2, ehdr_start_test_3) 1021 (ehdr_start_test_4, ehdr_start_test_5): New test cases. 1022 * testsuite/Makefile.in: Regenerate. 1023 * testsuite/ehdr_start_def.cc: New source file. 1024 * testsuite/ehdr_start_test.cc: New source file. 1025 * testsuite/ehdr_start_test.t: New linker script. 1026 * testsuite/ehdr_start_test_4.sh: New shell script. 1027 1028 2014-04-23 Cary Coutant <ccoutant (a] google.com> 1029 1030 PR gold/16870 1031 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break. 1032 1033 2014-04-15 Sasa Stankovic <Sasa.Stankovic (a] imgtec.com> 1034 1035 * layout.cc (Layout::include_section): Allow a target to decide 1036 whether to include a section. 1037 * target.h (Target::should_include_section): New function. 1038 (Target::do_should_include_section): New function. 1039 1040 2014-04-15 Sasa Stankovic <Sasa.Stankovic (a] imgtec.com> 1041 1042 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and 1043 inline into ... 1044 (Copy_relocs::emit): ... here. 1045 * copy-relocs.h (Copy_reloc_entry): Change from class to struct. 1046 (Copy_reloc_entry::make_copy_reloc): Change from private to protected. 1047 (Copy_reloc_entry::entries_): Change from private to protected. 1048 1049 2014-04-02 Sriraman Tallam <tmsriram (a] google.com> 1050 1051 * icf.cc (get_section_contents): Replace copies of reloc 1052 vectors with const references. 1053 1054 2014-04-02 Cary Coutant <ccoutant (a] google.com> 1055 1056 * configure.ac (HAVE_PUBNAMES): Use C instead of C++. 1057 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin. 1058 * configure: Regenerate. 1059 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for 1060 -fno-use-linker-plugin. 1061 (LINK1, CXXLINK1): Add it to the link command. 1062 * testsuite/Makefile.in: Regenerate. 1063 1064 2014-03-12 Alan Modra <amodra (a] gmail.com> 1065 1066 * Makefile.in: Regenerate. 1067 1068 2014-03-10 Sasa Stankovic <Sasa.Stankovic (a] imgtec.com> 1069 1070 * symtab.h (Symbol::set_nonvis): New function. 1071 1072 2014-03-10 Sasa Stankovic <Sasa.Stankovic (a] imgtec.com> 1073 1074 * symtab.cc (Sized_symbol<32>::init_output_data): 1075 Instantiate the template. 1076 (Sized_symbol<64>::init_output_data): Likewise. 1077 1078 2014-03-10 Sasa Stankovic <Sasa.Stankovic (a] imgtec.com> 1079 1080 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to 1081 adjust dynamic symbol value. 1082 * target.h (Target::adjust_dyn_symbol): New function. 1083 (Target::do_adjust_dyn_symbol): New function. 1084 1085 2014-03-10 Sasa Stankovic <Sasa.Stankovic (a] imgtec.com> 1086 1087 * output.cc (Output_data_dynamic::Dynamic_entry::write): 1088 Get the value of DYNAMIC_CUSTOM dynamic entry. 1089 * output.h (Output_data_dynamic::add_custom): New function. 1090 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM 1091 dynamic entry. 1092 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM. 1093 * target.h (Target::dynamic_tag_custom_value): New function. 1094 (Target::do_dynamic_tag_custom_value): New function. 1095 1096 2014-03-10 Sasa Stankovic <Sasa.Stankovic (a] imgtec.com> 1097 1098 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set 1099 dynsym indexes. 1100 * target.h (Target::has_custom_set_dynsym_indexes): New function. 1101 (Target::do_has_custom_set_dynsym_indexes): New function. 1102 (Target::set_dynsym_indexes): New function. 1103 (Target::do_set_dynsym_indexes): New function. 1104 1105 2014-03-07 Alan Modra <amodra (a] gmail.com> 1106 1107 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add 1108 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN. 1109 (Powerpc_relocate_functions::has_overflow_unsigned): New function. 1110 (Powerpc_relocate_functions::has_overflow_bitfield, 1111 overflowed): Use the above. 1112 (Target_powerpc::Relocate::relocate): Correct overflow checking 1113 for a number of relocations. Modify overflow test for 16-bit 1114 fields in instructions to signed/unsigned according to whether 1115 the field takes a signed or unsigned value. 1116 1117 2014-03-05 Alan Modra <amodra (a] gmail.com> 1118 1119 Update copyright years. 1120 1121 2014-03-05 Alan Modra <amodra (a] gmail.com> 1122 1123 * powerpc.cc (Target_powerpc::Scan::local, global): Support 1124 R_PPC64_ADDR64_LOCAL. 1125 (Target_powerpc::Relocate::relocate): Likewise. 1126 1127 2014-03-03 Alan Modra <amodra (a] gmail.com> 1128 1129 * dwp.cc (print_version): Update copyright year to current. 1130 1131 2014-02-10 Alan Modra <amodra (a] gmail.com> 1132 1133 * po/gold.pot: Regenerate. 1134 1135 2014-02-06 Cary Coutant <ccoutant (a] google.com> 1136 1137 Fix problem where -u is ignored when a weak undef is seen. 1138 1139 * archive.cc (Library_base::should_include_member): Reorder 1140 code to check for -u option if a weak undef has already been seen. 1141 * testsuite/Makefile.am (weak_undef_test_2): New test case. 1142 * testsuite/Makefile.in: Regenerate. 1143 * testsuite/weak_undef_file3.cc: New file. 1144 * testsuite/weak_undef_file4.cc: New file. 1145 * testsuite/weak_undef_test_2.cc: New file. 1146 1147 2014-02-05 Cary Coutant <ccoutant (a] google.com> 1148 1149 Fix issues with gold undefined symbol diagnostics. 1150 1151 PR binutils/15435 1152 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol 1153 check to here. 1154 * target-reloc.h (is_strong_undefined): New function. 1155 (relocate_section): Move undef vtable symbol check from here. 1156 Check for is_strong_undefined. 1157 1158 2014-02-05 Cary Coutant <ccoutant (a] google.com> 1159 1160 Fix problems with the --dynamic-list option. 1161 1162 PR gold/13577 1163 * options.cc (General_options::parse_dynamic_list): 1164 Set have_dynamic_list_. 1165 (General_options::General_options): Initialize have_dynamic_list_. 1166 (General_options::finalize): Turn off -Bsymbolic and 1167 -Bsymbolic-functions if --dynamic-list provided. 1168 * options.h (General_options::have_dynamic_list): New function. 1169 (General_options::have_dynamic_list_): New data member. 1170 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list 1171 correctly. 1172 1173 PR gold/16530 1174 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named 1175 in --dynamic-list, mark it. 1176 1177 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case. 1178 (dynamic_list_2): New test case. 1179 * testsuite/Makefile.in: Regenerate. 1180 * testsuite/dynamic_list_2.cc: New file. 1181 * testsuite/dynamic_list_2.t: New file. 1182 * testsuite/dynamic_list_lib1.cc: New file. 1183 * testsuite/dynamic_list_lib2.cc: New file. 1184 * testsuite/gc_dynamic_list_test.c: New file. 1185 * testsuite/gc_dynamic_list_test.sh: New file. 1186 * testsuite/gc_dynamic_list_test.t: New file. 1187 1188 2014-01-28 Cary Coutant <ccoutant (a] google.com> 1189 1190 Add .gdb_index version 7 support. 1191 1192 * gold/dwarf_reader.cc: include <utility> (for make_pair). 1193 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed 1194 debug sections. 1195 (Dwarf_ranges_table::read_ranges_table): Likewise. 1196 (Dwarf_pubnames_table::read_section): Check for GNU-style 1197 sections, and for compressed debug sections. 1198 (Dwarf_pubnames_table::read_header): Compute end address of table. 1199 (Dwarf_pubnames_table::next_name): Return flag_byte. Check 1200 for end of list by offset, not by offset == 0. 1201 (Dwarf_info_reader::do_read_string_table): Check for compressed 1202 debug sections. 1203 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table): 1204 Initialize new data members. 1205 (Dwarf_pubnames_table::next_name): return flag_byte. 1206 (Dwarf_pubnames_table::end_of_table_): New data member. 1207 (Dwarf_pubnames_table::is_gnu_style_): New data member. 1208 * gold/gdb-index.cc (gdb_index_version): Update to version 7. 1209 (Gdb_index_info_reader::read_pubtable): Read flag_byte. 1210 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't 1211 read skeleton type unit DIEs. 1212 (Gdb_index::add_symbol): Add flag_byte; adjust all callers. 1213 (Gdb_index::do_write): Write flag_byte. 1214 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter. 1215 (Gdb_index::Cu_vector): Store flags along with cu indexes. 1216 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7. 1217 * gold/testsuite/gdb_index_test_comm.sh: Likewise. 1218 1219 2014-01-08 H.J. Lu <hongjiu.lu (a] intel.com> 1220 1221 * version.cc (print_version): Update copyright year to 2014. 1222 1223 2013-12-19 Dimitry Andric <dimitry (a] andric.com> 1224 1225 * stringpool.cc (Stringpool_template::reserve): Add 1226 HAVE_UNORDERED_MAP case. 1227 * stringpool.cc (Stringpool_template::print_stats): Likewise. 1228 1229 2013-12-18 Cary Coutant <ccoutant (a] google.com> 1230 1231 * configure.ac: Check for <unordered_set> and <unordered_map>. 1232 * config.in: Regenerate. 1233 * configure: Regenerate. 1234 * system.h: Use <unordered_set> and <unordered_map> if available. 1235 1236 2013-12-10 Roland McGrath <mcgrathr (a] google.com> 1237 1238 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses 1239 with $(INSTALL_PROGRAM_ENV). 1240 * Makefile.in: Regenerate. 1241 1242 2013-11-22 Cary Coutant <ccoutant (a] google.com> 1243 1244 * configure.ac: Add check for which library is needed for 1245 dlopen. 1246 * configure: Regenerate. 1247 1248 2013-11-22 Cary Coutant <ccoutant (a] google.com> 1249 1250 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree 1251 assembler. 1252 * testsuite/Makefile.in: Regenerate. 1253 1254 2013-11-17 H.J. Lu <hongjiu.lu (a] intel.com> 1255 1256 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags): 1257 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like 1258 R_X86_64_PC32 and R_X86_64_PLT32, respectively. 1259 (Target_x86_64<size>::Scan::local): Likewise. 1260 (Target_x86_64<size>::Scan::global): Likewise. 1261 (Target_x86_64<size>::Relocate::relocate): Likewise. 1262 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc): 1263 Likewise. 1264 (Target_x86_64<size>::Scan::check_non_pic(): Handle 1265 R_X86_64_PC32_BND. 1266 1267 * testsuite/Makefile.am (check_PROGRAMS): Add 1268 exception_x86_64_bnd_test. 1269 (exception_x86_64_bnd_test_SOURCES): New macro. 1270 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise. 1271 (exception_x86_64_bnd_test_LDFLAGS): Likewise. 1272 (exception_x86_64_bnd_test_LDADD): Likewise. 1273 (exception_x86_64_bnd_1.o): New rule. 1274 (exception_x86_64_bnd_2.o): Likewise. 1275 * testsuite/Makefile.in: Regenerated. 1276 1277 2013-11-15 Alan Modra <amodra (a] gmail.com> 1278 1279 * powerpc.cc (Target_powerpc::glink_section): Provide non-const 1280 accessor. 1281 (Target_powerpc::Branch_info::make_stub): Make global entry stubs. 1282 Only call ppc64_local_entry_offset for 64-bit. Restrict 1283 symval_for_branch lookup to ELFv1. 1284 (Stub_table::add_plt_call_entry): Use unsigned int off. 1285 (Output_data_glink::Address, invalid_address): New. 1286 (Output_data_glink::add_eh_frame): Move out of line. Add 1287 support for ELFv2. 1288 (Output_data_glink::add_global_entry, find_global_entry, 1289 global_entry_address): New functions. 1290 (Output_data_glink::global_entry_stubs_, end_branch_table_, 1291 ge_size): New variables. 1292 (Output_data_glink::set_final_data_size): Add global entry 1293 stub sizing. 1294 (Output_data_glink::do_write): Write global entry stubs. 1295 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target 1296 parameter. Return true for ELFv2. Adjust callers. 1297 (Target_powerpc::Scan::local, global): Restrict opd lookup to 1298 ELFv1. Similarly for ifunc and dynamic relocation processing 1299 specific to ELFv1. Recognize that symbols are defined on 1300 their plt entries for ELFv2. 1301 (Target_powerpc::symval_for_branch): Assert if called for 1302 ELFv2 or ppc32. 1303 (Target_powerpc::Relocate::relocate): Use global entry plt 1304 stub for symbol value if such exists on ELFv2. 1305 (Target_powerpc::Relocate::relocate): Don't call 1306 symval_for_branch when ELFv2. Do adjust for local entry 1307 offset when ELFv2. 1308 (Target_powerpc::do_dynsym_value): Set symbols to global entry 1309 plt stub for ELFv2. 1310 (Target_powerpc::do_plt_address_for_global): Similarly. 1311 1312 2013-11-14 Cary Coutant <ccoutant (a] google.com> 1313 1314 Revert patch -- this did not fix the problem, and there is 1315 no race there. 1316 1317 2013-11-14 Cary Coutant <ccoutant (a] google.com> 1318 1319 PR gold/14860 1320 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_. 1321 (Ehframe_hdr::set_final_data_size): Allocate a Lock. 1322 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while 1323 updating fde_offsets_. 1324 (Eh_frame_hdr::lock_): New data member. 1325 1326 2013-11-14 Cary Coutant <ccoutant (a] google.com> 1327 1328 * dwp.cc (Dwo_file_entry): New type. 1329 (File_list): Use Dwo_file_entry. 1330 (Dwo_file::verify): New function. 1331 (Dwo_file::verify_dwo_list): New function. 1332 (Dwo_file::sized_verify_dwo_list): New function. 1333 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file 1334 list. 1335 (Dwp_options): New enum type. 1336 (dwp_options): Add --verify-only. 1337 (usage): Likewise. 1338 (main): Likewise. 1339 * dwp.h (gold_info): Add declaration. 1340 1341 2013-11-14 Cary Coutant <ccoutant (a] google.com> 1342 1343 PR gold/14860 1344 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_. 1345 (Ehframe_hdr::set_final_data_size): Allocate a Lock. 1346 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while 1347 updating fde_offsets_. 1348 (Eh_frame_hdr::lock_): New data member. 1349 1350 2013-11-06 Cary Coutant <ccoutant (a] google.com> 1351 1352 PR gold/15758 1353 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections 1354 before reloc sections. 1355 1356 2013-11-04 Alan Modra <amodra (a] gmail.com> 1357 1358 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI. 1359 (Symbol::needs_dynamic_reloc): Test new flag. 1360 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete. 1361 (Target_powerpc::Scan::get_reference_flags): Add target param. 1362 Return FUNC_DESC_ABI for 64-bit ELFv1. 1363 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags 1364 call. 1365 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc. 1366 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset. 1367 1368 2013-10-31 Cary Coutant <ccoutant (a] google.com> 1369 1370 Restore support for dwp v2 DWARF package file format. 1371 1372 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add 1373 tu_length parameter. Adjust all callers. 1374 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise. 1375 * dwp.cc: Include dwarf.h. 1376 (Section_bounds): New struct type. 1377 (Unit_set): New struct type. 1378 (Dwo_file::Dwo_file): Initialize new data member. 1379 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index): 1380 Combine and rename to... 1381 (Dwo_file::read_unit_index): ...this. 1382 (Dwo_file::sized_read_compunit_index) 1383 (Dwo_file::sized_read_typeunit_index): Combine and rename to... 1384 (Dwo_file::sized_read_unit_index): ...this. 1385 (Dwo_file::copy_section): Remove section_name, is_str_offsets 1386 parameters; add section_id parameter. 1387 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to... 1388 (Dwo_file::add_unit_set): ...this. 1389 (Dwo_file::shndx_map_): Remove. 1390 (Dwo_file::sect_offsets_): New data member. 1391 (Dwp_output_file::Dwp_output_file): Initialize new data members. 1392 (Dwp_output_file::add_section): Rename to... 1393 (Dwp_output_file::add_contribution): ...this. 1394 (Dwp_output_file::add_cu_set): Combine parameters into a struct. 1395 (Dwp_output_file::add_tu_set): Likewise. 1396 (Dwp_output_file::Contribution): New type. 1397 (Dwp_output_file::Section::contributions): New data member. 1398 (Dwp_output_file::Cu_or_tu_set): Remove. 1399 (Dwp_output_file::Section::Section): New ctor. 1400 (Dwp_output_file::Dwp_index::Shndx_pool): Remove. 1401 (Dwp_output_file::Dwp_index::Section_table): New type. 1402 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members. 1403 (Dwp_output_file::Dwp_index::enter_set): Change type of "set" 1404 parameter. 1405 (Dwp_output_file::Dwp_index::shndx_pool): Remove. 1406 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove. 1407 (Dwp_output_file::Dwp_index::section_table): New member function. 1408 (Dwp_output_file::Dwp_index::section_table_end): New member function. 1409 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove. 1410 (Dwp_output_file::Dwp_index::section_table_rows): New member function. 1411 (Dwp_output_file::Dwp_index::section_table_cols): New member function. 1412 (Dwp_output_file::Dwp_index::shndx_pool_): Remove. 1413 (Dwp_output_file::Dwp_index::section_table_): New data member. 1414 (Dwp_output_file::Dwp_index::section_mask_): New data member. 1415 (Dwp_output_file::add_output_section): New member function. 1416 (Dwp_output_file::write_new_section): New member function. 1417 (Dwp_output_file::write_contributions): New member function. 1418 (Dwp_output_file::section_id_map_): New data member. 1419 (class Dwo_id_info_reader): Remove. 1420 (class Unit_reader): New class. 1421 (get_dwarf_section_name): New function. 1422 (Dwo_file::read_executable): Adjust initializations of class data. 1423 (Dwo_file::read): Add support for v2 package file format. 1424 (Dwo_file::read_unit_index): Likewise. 1425 (Dwo_file::sized_read_unit_index): Likewise. 1426 (Dwo_file::copy_section): Likewise. 1427 (Dwo_file::add_unit_set): Likewise. 1428 (Dwp_output_file::add_output_section): Likewise. 1429 (Dwp_output_file::add_contribution): Likewise. 1430 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check 1431 for empty slot. 1432 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package 1433 file format. 1434 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty 1435 slot. 1436 (Dwp_output_file::initialize): Remove unused function. 1437 (Dwp_output_file::finalize): Add support for v2 package file format. 1438 (Dwp_output_file::write_index): Likewise. 1439 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust 1440 function prototype. 1441 1442 2013-10-31 Cary Coutant <ccoutant (a] google.com> 1443 1444 * configure.ac: Fix check for -fmerge-constants. 1445 * configure.ac: Regenerate. 1446 1447 2013-10-30 Roland McGrath <mcgrathr (a] google.com> 1448 1449 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry): 1450 Correct 9-byte nop sequence to match what the assembler generates. 1451 1452 2013-10-30 Alan Modra <amodra (a] gmail.com> 1453 1454 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion, 1455 ppc64_local_entry_offset, ppc64_local_entry_offset, 1456 do_read_symbols): New functions. 1457 (Powerpc_relobj::e_flags_, st_other_): New vars. 1458 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion. 1459 (Powerpc_dynobj::abiversion, set_abiversion): New functions. 1460 (Powerpc_relobj::e_flags_): New var. 1461 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline 1462 and adjust for ELFv2. 1463 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions. 1464 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2. 1465 (Powerpc_dynobj::do_find_special_sections): Likewise. 1466 (Target_powerpc::do_define_standard_symbols): Define ".TOC.". 1467 (Target_powerpc::Branch_info::make_stub): Adjust stub destination 1468 to ELFv2 local entry. 1469 (Target_powerpc::do_relax): No thread safe barriers needed for 1470 ELFv2. 1471 (Output_data_plt_powerpc::initial_plt_entry_size_, 1472 plt_entry_size): Delete. Replace all uses with 1473 first_plt_entry_offset() and plt_entry_size(). 1474 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove 1475 reserved_size parm. Update callers. 1476 (Output_data_plt_powerpc::entry_count): Update. 1477 (Output_data_plt_powerpc::first_plt_entry_offset): Make private 1478 and use Target_powerpc::first_plt_entry_offset(). 1479 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and 1480 rename to plt_entry_size. 1481 (Output_data_plt_powerpc::add_ifunc_entry, 1482 add_local_ifunc_entry): Adjust reloc for ELFv2. 1483 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1. 1484 (glink_eh_frame_fde_64v2): New. 1485 (Stub_table::plt_call_size): Support ELFv2 sizing. 1486 (Output_data_glink::add_eh_frame): Use the new FDE. 1487 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink. 1488 (Stub_table::do_write): Write ELFv2 stubs and glink. 1489 (Target_powerpc::Relocate::relocate): Replaces nop after call 1490 with ld 2,24(1) and adjust local offset destination for ELFv2. 1491 1492 2013-10-30 Alan Modra <amodra (a] gmail.com> 1493 1494 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs. 1495 (Target_powerpc::Scan::global, local): Likewise. 1496 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow 1497 on all ppc64 @h and @ha relocs. 1498 1499 2013-10-14 Alan Modra <amodra (a] gmail.com> 1500 1501 * output.h (Output_data_got::add_constant): Tidy. 1502 (Output_data_got::add_constant_pair): New function. 1503 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got 1504 methods used so as to first call reserve_ent(). 1505 1506 2013-10-11 Roland McGrath <mcgrathr (a] google.com> 1507 1508 * powerpc.cc (Output_data_got_powerpc): Remove unused methods 1509 add_got_entry and add_got_entry_pair. 1510 1511 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test. 1512 (HAVE_PUBNAMES): Likewise. 1513 * configure: Regenerate. 1514 1515 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout. 1516 * testsuite/Makefile.in: Regenerate. 1517 1518 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header): 1519 Remove const from declaration. 1520 * target.cc (Sized_target::do_adjust_elf_header): Update definition. 1521 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise. 1522 * output.h (Output_file_header): Remove const from member target_ 1523 and corresponding constructor argument. 1524 * output.cc (Output_file_header::Output_file_header): Update prototype. 1525 (Output_file_header::do_sized_write): Use this->target_ in place 1526 of parameters()->target(). 1527 1528 * testsuite/undef_symbol.cc (Foo::get_a): New method. 1529 1530 * configure.ac (MERGE_CONSTANTS_FLAG): New check. 1531 * configure: Regenerate. 1532 * Makefile.in: Regenerate. 1533 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix. 1534 * testsuite/merge_string_literals_2.c: Likewise. 1535 * testsuite/Makefile.am 1536 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps. 1537 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of 1538 literal -fmerge-constants. 1539 * testsuite/Makefile.in: Regenerate. 1540 1541 * i386.cc (Target_i386): Remove unused member dynbss_. 1542 * arm.cc (Target_arm): Likewise. 1543 * powerpc.cc (Target_powerpc): Likewise. 1544 * sparc.cc (Target_sparc): Likewise. 1545 * tilegx.cc (Target_tilegx): Likewise. 1546 * x86_64.cc (Target_x86_64): Likewise. 1547 * dwarf_reader.h (Dwarf_info_reader): Remove unused members 1548 type_signature_, type_offset_. 1549 * plugin.h (Plugin_hook): Remove unused member layout_. 1550 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_, 1551 mapfile_. 1552 (Read_member): Remove unused members input_objects_, symtab_, 1553 mapfile_, layout_. 1554 (Check_library): Remove unused member symtab_. 1555 * archive.h (Lib_group): Remove unused member lib_. 1556 * archive.cc (Lib_group::Lib_group): Update initializer. 1557 * incremental.h (Incremental_binary): Remove unused member target_. 1558 (Incremental_script_entry): Removed unused member script_. 1559 * layout.h (Write_symbols_task): Remove unused member input_objects_. 1560 * icf.h (Icf): Remove unused member num_tracked_relocs. 1561 1562 * gold-threads.h (Once): Conditionalize member was_run_lock_ on 1563 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching 1564 its only use. 1565 * gold-threads.cc (Once::Once): Likewise conditionalize initializer. 1566 1567 * archive.h: Use struct rather than class for forward declaration 1568 of Read_symbols_data. 1569 1570 2013-10-07 Cary Coutant <ccoutant (a] google.com> 1571 1572 PR gold/16010 1573 * testsuite/Makefile.am (icf_test): Fix dependencies. 1574 (icf_safe_test): Likewise. 1575 (icf_safe_so_test): Likewise. 1576 (large_symbol_alignment): Add empty _LDADD rule. 1577 * testsuite/Makefile.in: Regenerate. 1578 1579 2013-09-03 Pavel Chupin <pavel.v.chupin (a] intel.com> 1580 1581 PR gold/15927 1582 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative 1583 relocation for R_X86_64_32 on x32. 1584 1585 2013-08-27 Roland McGrath <mcgrathr (a] google.com> 1586 1587 * output.cc (Output_segment::set_section_addresses): Take new 1588 Target* argument. If target->isolate_execinstr() and the segment 1589 is executable and starts at a target->abi_pagesize() boundary, 1590 pad its end out to a target->abi_pagesize() boundary with code fill. 1591 * output.h (Output_segment::set_section_addresses): Update decl. 1592 * layout.h (Layout::check_output_data_for_reset_values): Take new 1593 argument RELAX_OUTPUTS. 1594 (Layout): New member relax_output_list_. 1595 (Layout::add_relax_output): New method. 1596 * layout.cc (Layout::Layout): Update constructor. 1597 (Layout::reset_relax_output): New method. 1598 (Layout::clean_up_after_relaxation): Call it. 1599 (Layout::prepare_for_relaxation): Update caller. 1600 (Layout::set_segment_offsets): Update callers of set_section_addresses. 1601 Call reset_relax_output before re-processing segments for 1602 isolate_execinstr case. 1603 (Layout::write_data): Handle relax_output_list_. 1604 (Layout::Relaxation_debug_check::check_output_data_for_reset_values): 1605 Take new argument RELAX_OUTPUTS. Assert it's an empty collection. 1606 1607 2013-08-23 Yuri Chornoivan <yurchor (a] ukr.net> 1608 1609 PR binutils/15834 1610 * object.h: Fix typos. 1611 1612 2013-08-16 Roland McGrath <mcgrathr (a] google.com> 1613 1614 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function. 1615 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function. 1616 1617 2013-08-07 Cary Coutant <ccoutant (a] google.com> 1618 1619 Revert support for v2 DWP files: 1620 1621 2013-03-01 Cary Coutant <ccoutant (a] google.com> 1622 1623 Add dwp support for v2 DWARF package file format. 1624 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add 1625 tu_length parameter. Adjust all callers. 1626 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise. 1627 * dwp.cc: Include dwarf.h. 1628 (Section_bounds): New struct type. 1629 (Unit_set): New struct type. 1630 (Dwo_file::Dwo_file): Initialize new data member. 1631 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index): 1632 Combine and rename to... 1633 (Dwo_file::read_unit_index): ...this. 1634 (Dwo_file::sized_read_compunit_index) 1635 (Dwo_file::sized_read_typeunit_index): Combine and rename to... 1636 (Dwo_file::sized_read_unit_index): ...this. 1637 (Dwo_file::copy_section): Remove section_name, is_str_offsets 1638 parameters; add section_id parameter. 1639 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to... 1640 (Dwo_file::add_unit_set): ...this. 1641 (Dwo_file::shndx_map_): Remove. 1642 (Dwo_file::sect_offsets_): New data member. 1643 (Dwp_output_file::Dwp_output_file): Initialize new data members. 1644 (Dwp_output_file::add_section): Rename to... 1645 (Dwp_output_file::add_contribution): ...this. 1646 (Dwp_output_file::add_cu_set): Combine parameters into a struct. 1647 (Dwp_output_file::add_tu_set): Likewise. 1648 (Dwp_output_file::Contribution): New type. 1649 (Dwp_output_file::Section::contributions): New data member. 1650 (Dwp_output_file::Cu_or_tu_set): Remove. 1651 (Dwp_output_file::Section::Section): New ctor. 1652 (Dwp_output_file::Dwp_index::Shndx_pool): Remove. 1653 (Dwp_output_file::Dwp_index::Section_table): New type. 1654 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members. 1655 (Dwp_output_file::Dwp_index::enter_set): Change type of "set" 1656 parameter. 1657 (Dwp_output_file::Dwp_index::shndx_pool): Remove. 1658 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove. 1659 (Dwp_output_file::Dwp_index::section_table): New member function. 1660 (Dwp_output_file::Dwp_index::section_table_end): New member function. 1661 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove. 1662 (Dwp_output_file::Dwp_index::section_table_rows): New member function. 1663 (Dwp_output_file::Dwp_index::section_table_cols): New member function. 1664 (Dwp_output_file::Dwp_index::shndx_pool_): Remove. 1665 (Dwp_output_file::Dwp_index::section_table_): New data member. 1666 (Dwp_output_file::Dwp_index::section_mask_): New data member. 1667 (Dwp_output_file::add_output_section): New member function. 1668 (Dwp_output_file::write_new_section): New member function. 1669 (Dwp_output_file::write_contributions): New member function. 1670 (Dwp_output_file::section_id_map_): New data member. 1671 (class Dwo_id_info_reader): Remove. 1672 (class Unit_reader): New class. 1673 (get_dwarf_section_name): New function. 1674 (Dwo_file::read_executable): Adjust initializations of class data. 1675 (Dwo_file::read): Add support for v2 package file format. 1676 (Dwo_file::read_unit_index): Likewise. 1677 (Dwo_file::sized_read_unit_index): Likewise. 1678 (Dwo_file::copy_section): Likewise. 1679 (Dwo_file::add_unit_set): Likewise. 1680 (Dwp_output_file::add_output_section): Likewise. 1681 (Dwp_output_file::add_contribution): Likewise. 1682 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check 1683 for empty slot. 1684 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package 1685 file format. 1686 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty 1687 slot. 1688 (Dwp_output_file::initialize): Remove unused function. 1689 (Dwp_output_file::finalize): Add support for v2 package file format. 1690 (Dwp_output_file::write_index): Likewise. 1691 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust 1692 function prototype. 1693 1694 2013-07-31 Cary Coutant <ccoutant (a] google.com> 1695 1696 * object.cc (Sized_relobj::do_output_section_address): New function. 1697 (Sized_relobj): Instantiate explicitly. 1698 * object.h (Object::output_section_address): New function. 1699 (Object::do_output_section_address): New function. 1700 (Sized_relobj::do_output_section_address): New function. 1701 * powerpc.cc (Target_powerpc::symval_for_branch): Use it. 1702 1703 2013-07-30 Cary Coutant <ccoutant (a] google.com> 1704 Sasa Stankovic <Sasa.Stankovic (a] imgtec.com> 1705 1706 * parameters.cc (Parameters::entry): Return target-specific entry 1707 symbol name. 1708 * target.h (Target::entry_symbol_name): New function. 1709 (Target_info::entry_symbol_name): New data member. 1710 1711 * arm.cc (Target_arm::arm_info): Add entry_symbol_name. 1712 * i386.cc (Target_i386::i386_info): Likewise. 1713 (Target_i386_nacl::i386_nacl_info): Likewise. 1714 * sparc.cc (Target_sparc::sparc_info): Likewise. 1715 * tilegx.cc (Target_tilegx::tilegx_info): Likewise. 1716 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise. 1717 (Target_x86_64_nacl::x86_64_nacl_info) Likewise. 1718 * testsuite/testfile.cc (Target_test::test_target_info): Likewise. 1719 1720 2013-07-22 Sterling Augustine <saugustine (a] google.com> 1721 1722 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): 1723 Convert parameter shndx to local variable. Add parameters symtab 1724 and symtab_size. Scan over section names. Find relocation 1725 section corresponding to current section. Create and initialize 1726 reloc_mapper_ and reloc_type_. 1727 (Dwarf_pubnames_table::read_header): Add assertion. Change 1728 unit_length to off_t. Initialize member unit_length_. Fill in field 1729 cu_offset_. 1730 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table): 1731 Initialize new fields unit_length_ and cu_offset_. 1732 (Dwarf_pubnames_table::read_section): Update prototype. 1733 (Dwarf_pubnames_table::cu_offset): New member function. 1734 (Dwarf_pubnames_table::subsection_size): Likewise. 1735 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length): 1736 New fields. 1737 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make 1738 member functions public. 1739 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes): 1740 Update comment. Rework logic. Move repeated parts to... 1741 (Gdb_index_info_reader::read_pubtable): ...here. New function. 1742 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_, 1743 pubtypes_table_, and stmt_list_offset. 1744 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset, 1745 Gdb_index::find_pubtype_offset, 1746 Gdb_index::map_pubnames_and_types_to_dies): Define new functions. 1747 (Gdb_index::pubnames_read): Update prototype and rework logic. 1748 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table): 1749 Forward declare. 1750 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset, 1751 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table) 1752 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies, 1753 Gdb_index::map_pubtable_to_dies): 1754 Declare functions. 1755 (Gdb_index::pubnames_read): Update declaration. 1756 (Gdb_index::Pubname_offset_map): New type. 1757 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_, 1758 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_, 1759 Gdb_index::stmt_list_offset): Declare. 1760 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_, 1761 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_) 1762 Gdb_index::pubtypes_offset_): Remove. 1763 1764 2013-07-19 Roland McGrath <mcgrathr (a] google.com> 1765 1766 * options.h (General_options): Add -Trodata-segment option. 1767 * parameters.cc (Parameters::check_rodata_segment): New function. 1768 (Parameters::set_target_once): Call it. 1769 * parameters.h (Parameters): Declare it (private member function). 1770 * layout.cc (load_seg_unusable_for_headers): New function, broken 1771 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr() 1772 then validate rodata segment rather than text segment. 1773 (relaxation_loop_body): Call that. 1774 (is_text_segment): New function. Don't admit a non-executable 1775 segment if TARGET->isolate_execinstr(). 1776 (set_segment_offsets): Call it. Honor -Trodata-segment option. 1777 1778 2013-07-15 Shawn Landden <shawnlandden (a] gmail.com> 1779 1780 PR gold/15070 1781 * fileread.h (File_read::get_view): Clarify comment about ALIGNED. 1782 * nacl.h (Sniff_file::View::View): Request aligned view. 1783 1784 2013-07-11 Cary Coutant <ccoutant (a] google.com> 1785 1786 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use 1787 correct BRLT entry size. 1788 1789 2013-07-03 Alan Modra <amodra (a] gmail.com> 1790 1791 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call 1792 comment. 1793 1794 2013-07-01 Cary Coutant <ccoutant (a] google.com> 1795 1796 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save 1797 reloc_type_. 1798 (Dwarf_ranges_table::read_range_list): Call lookup_reloc. 1799 (Dwarf_ranges_table::lookup_reloc): New function. 1800 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize 1801 reloc_type_. 1802 (Dwarf_ranges_table::lookup_reloc): New function. 1803 (Dwarf_ranges_table::reloc_type_): New data member. 1804 1805 2013-06-27 Jing Yu <jingyu (a] google.com> 1806 1807 PR gold/15662 1808 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New 1809 function. 1810 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function. 1811 (Target_powerpc::do_relax): Call the above. 1812 1813 2013-06-27 Cary Coutant <ccoutant (a] google.com> 1814 1815 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert 1816 on garbage collected .opd section. 1817 1818 2013-06-27 Alan Modra <amodra (a] gmail.com> 1819 1820 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx 1821 is non-zero. 1822 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx(). 1823 (Target_powerpc::do_function_location): Likewise for loc->shndx. 1824 1825 2013-06-14 Cary Coutant <ccoutant (a] google.com> 1826 1827 * resolve.cc (Symbol::override_base): Don't override st_type 1828 from plugin placeholder symbols. 1829 (Symbol_table::resolve): Likewise. 1830 (Symbol_table::should_override): Don't complain about TLS mismatch 1831 if the TO symbol is a plugin placeholder. 1832 * testsuite/Makefile.am (plugin_test_tls): New test. 1833 * testsuite/Makefile.in: Regenerate. 1834 * testsuite/plugin_test_tls.sh: New test script. 1835 * testsuite/two_file_test_2_tls.cc: New test source. 1836 * testsuite/two_file_test_tls.cc: New test source. 1837 1838 2013-06-05 Alexander Ivchenko <alexander.ivchenko (a] intel.com> 1839 1840 * layout.cc (Layout::set_segment_offsets): Taking care of the case when 1841 the maximum segment alignment is larger than the page size. 1842 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold 1843 correctly aligns the symbols with large alignemnt. 1844 * testsuite/Makefile.in: Regenerate. 1845 * testsuite/large_symbol_alignment.cc: New file. 1846 1847 2013-05-30 Alexander Ivchenko <alexander.ivchenko (a] intel.com> 1848 Sriraman Tallam <tmsriram (a] google.com> 1849 1850 * options.h (sort_section): New option. 1851 * output.h (Input_section_sort_section_prefix_special_ordering_compare): 1852 Rename from Input_section_sort_section_name_special_ordering_compare. 1853 (Input_section_sort_section_name_compare): New struct. 1854 * output.cc (Output_section::Input_section_sort_section_name_compare:: 1855 operator()): New function. 1856 (Output_section::sort_attached_input_sections): Use new sort function 1857 for .text if --sort-section=name is specified. 1858 * layout.cc (Layout::make_output_section): 1859 Add sorting by name when --sort-section=name is specified. 1860 * testsuite/Makefile.am (text_section_grouping): Test option 1861 --sort-section=name. 1862 * testsuite/Makefile.in: Regenerate. 1863 * testsuite/section_sorting_name.cc: New file. 1864 * testsuite/section_sorting_name.sh: New file. 1865 1866 2013-05-21 Cary Coutant <ccoutant (a] google.com> 1867 1868 * symtab.h (Symbol::is_cxx_vtable): New function. 1869 * target-reloc.h (relocate_section): Check for vtable symbol. 1870 * testsuite/Makefile.am (missing_key_func.sh): New test case. 1871 * testsuite/Makefile.in: Regenerate. 1872 * testsuite/missing_key_func.cc: New test source. 1873 * testsuite/missing_key_func.sh: New test script. 1874 1875 2013-05-21 Cary Coutant <ccoutant (a] google.com> 1876 1877 * object.cc (Sized_relobj_file::get_symbol_location_info): Set 1878 type of enclosing symbol. 1879 (Relocate_info::location): Check symbol type when describing symbol. 1880 * object.h (Symbol_location_info): Remove unused line_number; 1881 add enclosing_symbol_type. 1882 * testsuite/debug_msg.sh: Adjust expected output. 1883 1884 2013-05-13 Cary Coutant <ccoutant (a] google.com> 1885 1886 * configure.ac: Export DEFAULT_TARGET. 1887 * configure: Regenerate. 1888 * Makefile.in: Regenerate. 1889 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES. 1890 * testsuite/Makefile.in: Regenerate. 1891 * testsuite/debug_msg.sh: Delete duplicate tests. 1892 Don't check undef_int error message match for powerpc where the 1893 source file and line number aren't available. 1894 1895 2013-05-10 Roland McGrath <mcgrathr (a] google.com> 1896 1897 * options.h (General_options): Add --rosegment-gap option. 1898 * options.cc (finalize): --rosegment-gap implies --rosegment. 1899 * layout.cc (set_segment_offsets): Let user option override 1900 target->rosegment_gap(). 1901 1902 2013-05-10 Roland McGrath <mcgrathr (a] google.com> 1903 1904 * options.h (General_options): Remove leading space from help 1905 messages for -nostdlib and --rosegment. 1906 1907 2013-05-03 Maciej W. Rozycki <macro (a] codesourcery.com> 1908 1909 PR ld/15365 1910 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN. 1911 1912 2013-05-03 Alan Modra <amodra (a] gmail.com> 1913 1914 * merge.cc (Output_merge_string::do_add_input_section): Correct 1915 scan for number of strings. Rename vars to avoid shadowing. 1916 Include missing terminator in input_size_. 1917 1918 2013-05-01 H.J. Lu <hongjiu.lu (a] intel.com> 1919 1920 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): 1921 Restore empty string handling. 1922 1923 2013-05-01 Cary Coutant <ccoutant (a] google.com> 1924 1925 * stringpool.cc (Stringpool_template::new_key_offset): Fix 1926 uninitialized warning. 1927 1928 2013-04-29 Alexander Ivchenko <alexander.ivchenko (a] intel.com> 1929 1930 * output.cc (Output_section::add_merge_input_section): Allow 1931 to merge sections if the alignment is more than character size. 1932 * merge.h (Output_merge_string::Output_merge_string): Remove 1933 assert. 1934 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count 1935 only not-null strings. Check the alignment of strings. 1936 * stringpool.h 1937 (Stringpool_template<Stringpool_char>::Stringpool_template): Add 1938 alignment as the argument. 1939 (Stringpool_template<Stringpool_char>::addralign_): New class member. 1940 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset): 1941 Align non-zero length strings according to the addralign_. 1942 (Stringpool_template<Stringpool_char>::set_string_offsets): 1943 Updating offsets according to the given alignment. 1944 * testsuite/Makefile.am (text_section_grouping): Test if string 1945 literals are getting merged. 1946 * testsuite/Makefile.in: Regenerate. 1947 * testsuite/merge_string_literals_1.c: New file. 1948 * testsuite/merge_string_literals_2.c: Ditto. 1949 * testsuite/merge_string_literals.sh: Ditto. 1950 1951 2013-04-26 Ian Lance Taylor <iant (a] google.com> 1952 1953 * target-reloc.h (relocate_section): If the reloc offset is out of 1954 range, pass VIEW as NULL to relocate.relocate. 1955 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view. 1956 * i386.cc (Target_i386::Relocate::relocate): Likewise. 1957 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise. 1958 * sparc.cc (Target_sparc::Relocate::relocate): Likewise. 1959 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise. 1960 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise. 1961 1962 2013-04-26 Geoff Pike <gpike (a] chromium.org> 1963 1964 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks(). 1965 * layout.cc (Hash_task): New class. 1966 (Layout::queue_build_id_tasks): New function. 1967 (Layout::write_build_id): Handle single-thread portion of build ID 1968 computation. (In some cases, all of it is single-threaded.) Replace 1969 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same 1970 functionality in fewer lines of code. 1971 * layout.h (Layout::queue_build_id_tasks): New function declaration. 1972 * options.h (General_options): make "--build-id" default to tree 1973 rather than sha1. Add two new options related to --build-id=tree: 1974 --build-id-chunk-size-for-treehash and 1975 --build-id-min-file-size-for-treehash. 1976 * Makefile.am: add testing of --build-id=tree and related new options 1977 (these tests will be invoked by "make check"). 1978 * Makefile.in: Regenerate. 1979 1980 2013-04-25 Alan Modra <amodra (a] gmail.com> 1981 1982 * configure.tgt: Add powerpcle and powerpc64le. 1983 1984 2013-04-22 Alan Modra <amodra (a] gmail.com> 1985 1986 PR gold/15355 1987 * layout.cc (Layout::segment_precedes): Allow more than one 1988 segment with the same type and flags. 1989 1990 2013-04-15 Cary Coutant <ccoutant (a] google.com> 1991 1992 * layout.cc (Layout::set_relocatable_section_offsets): Don't 1993 allocate space in file for BSS sections. 1994 1995 2013-04-15 Cary Coutant <ccoutant (a] google.com> 1996 1997 * script-sections.cc (Orphan_output_section): Reset address 1998 to zero after each orphaned section for relocatable links. 1999 2000 2013-04-15 Cary Coutant <ccoutant (a] google.com> 2001 2002 * symtab.cc (Symbol_table::sized_write_globals): Subtract 2003 section starting address for relocatable link. 2004 * testsuite/Makefile.am (script_test_11): New test. 2005 * testsuite/Makefile.in: Regenerate. 2006 * testsuite/script_test_11.c: New source file. 2007 * testsuite/script_test_11.t: New linker script. 2008 2009 2013-04-13 Alan Modra <amodra (a] gmail.com> 2010 2011 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set 2012 owner when sections are not adjacent and exceed group size. 2013 (Target_powerpc::group_sections): Handle corner case. 2014 (Target_powerpc::Branch_info::make_stub): Handle case where 2015 stub table doesn't exist due to branches in non-exec sections. 2016 (Target_powerpc::Relocate::relocate): Likewise. 2017 2018 2013-04-11 Alan Modra <amodra (a] gmail.com> 2019 2020 PR gold/15354 2021 * powerpc.cc (Target_powerpc::make_brlt_section): Name section 2022 .branch_lt to match bfd ld. Adjust comments throughout file. 2023 2024 2013-04-04 Ian Lance Taylor <iant (a] google.com> 2025 2026 GCC PR c++/56840 2027 * object.cc (do_layout_deferred_sections): Handle .eh_frame 2028 sections before checking whether they are included in the link. 2029 2030 2013-03-29 Sriraman Tallam <tmsriram (a] google.com> 2031 2032 * archive.cc (Archive::get_elf_object_for_member): Create the elf 2033 object before calling the plugin claim_file handler. Pass the elf 2034 object of the archive to the plugin. Delete the elf object if the 2035 plugin claims the file. 2036 2037 2013-03-21 Alan Modra <amodra (a] gmail.com> 2038 2039 * layout.cc (Layout::set_segment_offsets): Accept writable .text 2040 segment when omagic. 2041 2042 2013-03-21 Alan Modra <amodra (a] gmail.com> 2043 2044 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned 2045 comparison warning. 2046 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used 2047 uninitialized" warning. 2048 2049 2013-03-20 Alan Modra <amodra (a] gmail.com> 2050 2051 * symtab.h (Symbol::clear_version): New function. 2052 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object 2053 is_needed by weak references. Clear version for symbols defined 2054 in as-needed objects that are not needed. 2055 2056 2013-03-15 Alan Modra <amodra (a] gmail.com> 2057 2058 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make 2059 static and public. Add report_err param. Return false for data refs. 2060 (Target_powerpc::rela_dyn_section): New overloaded function. 2061 (Target_powerpc::plt_, iplt_): Elucidate. 2062 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0. 2063 (Output_data_plt_powerpc::do_write): Don't write .iplt. 2064 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries. 2065 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc 2066 calls. Put ifunc dynamic relocs in irela_dyn_section. Only 2067 push_branch and make_plt_entry for ifunc syms when 2068 reloc_needs_plt_for_ifunc. 2069 (Target_powerpc::Relocate::relocate): Don't use plt entry value 2070 for ifunc unless reloc_needs_plt_for_ifunc. 2071 2072 2013-03-15 Alan Modra <amodra (a] gmail.com> 2073 2074 * gc.h (gc_process_relocs): Don't look through function descriptors. 2075 * icf.cc (get_section_contents): Do so here instead. 2076 2077 2013-03-13 Alan Modra <amodra (a] gmail.com> 2078 2079 * powerpc.cc (is_branch_reloc): Forward declare. 2080 (Target_powerpc::do_can_check_for_function_pointers): New predicate. 2081 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return 2082 false for 64-bit, true for 32-bit non-branch relocs. 2083 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise. 2084 * testsuite/Makefile.am (icf_test): Use linker map file instead of 2085 nm output. 2086 (icf_safe_test): Generate linker map file as well as nm output. 2087 (icf_safe_so_test): Likewise. 2088 * testsuite/Makefile.in: Regenerate. 2089 * testsuite/icf_test.sh: Parse linker map file to determine 2090 section folding. 2091 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC. 2092 * testsuite/icf_safe_so_test.sh: Likewise. 2093 (X86_32_or_ARM_specific_safe_fold): Merge into.. 2094 (arch_specific_safe_fold): ..this. 2095 (X86_64_specific_safe_fold): Delete unused function. 2096 2097 2013-03-12 Alan Modra <amodra (a] gmail.com> 2098 2099 * gc.h (gc_process_relocs): Look through function descriptors 2100 to determine shndx, symvalue and addend used by ICF. Tidy 2101 variable duplication. 2102 2103 2013-03-11 Alan Modra <amodra (a] gmail.com> 2104 2105 * gold.cc (queue_middle_tasks): Move detect_odr_violations.. 2106 * layout.cc (Layout_task_runner::run): ..to here. 2107 * symtab.h (struct Symbol_location): Extract from.. 2108 (class Symbol_table): ..here. 2109 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location. 2110 * target.h (class Target): Add function_location and 2111 do_function_location functions. 2112 (class Sized_target): Add do_function_location. 2113 * object.h (class Sized_relobj_file): Move find_shdr.. 2114 (class Object): ..to here. 2115 * object.cc: Likewise. Update to suit. Instantiate. 2116 (Sized_relobj_file::find_eh_frame): Update find_shdr call. 2117 * powerpc.cc (class Powerpc_dynobj): New. 2118 (Target_powerpc::do_function_location): New function. 2119 (Powerpc_relobj::do_find_special_sections): Update find_shdr call. 2120 (Powerpc_dynobj::do_read_symbols): New function. 2121 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj. 2122 2123 2013-03-08 Ian Lance Taylor <iant (a] google.com> 2124 2125 * options.cc (General_options::string_to_object_format): Accept 2126 "default". 2127 2128 2013-03-08 Alan Modra <amodra (a] gmail.com> 2129 2130 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than 2131 pointer to Post_fde. 2132 (struct Post_fde): Move definition to here.. 2133 * ehframe.cc (struct Post_fde): ..from here. 2134 (Cie::write): Don't alloc Post_fde. 2135 (Eh_frame::do_sized_write): Update. Don't free Post_fde. 2136 2137 2013-03-07 Alan Modra <amodra (a] gmail.com> 2138 2139 * testsuite/discard_locals_relocatable_test.c: Add a powerpc 2140 relocation referencing .LC0. 2141 * testsuite/discard_locals_test.sh: Remove FIXMEs. 2142 2143 2013-03-07 Alan Modra <amodra (a] gmail.com> 2144 2145 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark 2146 always_inline. Add assembly for powerpc to avoid GOT. 2147 2148 2013-03-07 Alan Modra <amodra (a] gmail.com> 2149 2150 * testsuite/script_test_10.sh: Don't test .bss section 2151 header number. 2152 2153 2013-03-06 Alan Modra <amodra (a] gmail.com> 2154 2155 * powerpc.cc (class Powerpc_relobj): Move some member functions. 2156 (Target_powerpc::symval_for_branch): Add symtab param. Update 2157 all callers. Handle folded sections. 2158 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object 2159 to Powerpc_relobj. 2160 (Global_symbol_visitor_opd::operator()): Likewise. 2161 2162 2013-03-04 Alan Modra <amodra (a] gmail.com> 2163 2164 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss. 2165 * testsuite/Makefile.in: Regenerate. 2166 2167 2013-03-01 Cary Coutant <ccoutant (a] google.com> 2168 2169 Add dwp support for v2 DWARF package file format. 2170 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add 2171 tu_length parameter. Adjust all callers. 2172 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise. 2173 * dwp.cc: Include dwarf.h. 2174 (Section_bounds): New struct type. 2175 (Unit_set): New struct type. 2176 (Dwo_file::Dwo_file): Initialize new data member. 2177 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index): 2178 Combine and rename to... 2179 (Dwo_file::read_unit_index): ...this. 2180 (Dwo_file::sized_read_compunit_index) 2181 (Dwo_file::sized_read_typeunit_index): Combine and rename to... 2182 (Dwo_file::sized_read_unit_index): ...this. 2183 (Dwo_file::copy_section): Remove section_name, is_str_offsets 2184 parameters; add section_id parameter. 2185 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to... 2186 (Dwo_file::add_unit_set): ...this. 2187 (Dwo_file::shndx_map_): Remove. 2188 (Dwo_file::sect_offsets_): New data member. 2189 (Dwp_output_file::Dwp_output_file): Initialize new data members. 2190 (Dwp_output_file::add_section): Rename to... 2191 (Dwp_output_file::add_contribution): ...this. 2192 (Dwp_output_file::add_cu_set): Combine parameters into a struct. 2193 (Dwp_output_file::add_tu_set): Likewise. 2194 (Dwp_output_file::Contribution): New type. 2195 (Dwp_output_file::Section::contributions): New data member. 2196 (Dwp_output_file::Cu_or_tu_set): Remove. 2197 (Dwp_output_file::Section::Section): New ctor. 2198 (Dwp_output_file::Dwp_index::Shndx_pool): Remove. 2199 (Dwp_output_file::Dwp_index::Section_table): New type. 2200 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members. 2201 (Dwp_output_file::Dwp_index::enter_set): Change type of "set" 2202 parameter. 2203 (Dwp_output_file::Dwp_index::shndx_pool): Remove. 2204 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove. 2205 (Dwp_output_file::Dwp_index::section_table): New member function. 2206 (Dwp_output_file::Dwp_index::section_table_end): New member function. 2207 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove. 2208 (Dwp_output_file::Dwp_index::section_table_rows): New member function. 2209 (Dwp_output_file::Dwp_index::section_table_cols): New member function. 2210 (Dwp_output_file::Dwp_index::shndx_pool_): Remove. 2211 (Dwp_output_file::Dwp_index::section_table_): New data member. 2212 (Dwp_output_file::Dwp_index::section_mask_): New data member. 2213 (Dwp_output_file::add_output_section): New member function. 2214 (Dwp_output_file::write_new_section): New member function. 2215 (Dwp_output_file::write_contributions): New member function. 2216 (Dwp_output_file::section_id_map_): New data member. 2217 (class Dwo_id_info_reader): Remove. 2218 (class Unit_reader): New class. 2219 (get_dwarf_section_name): New function. 2220 (Dwo_file::read_executable): Adjust initializations of class data. 2221 (Dwo_file::read): Add support for v2 package file format. 2222 (Dwo_file::read_unit_index): Likewise. 2223 (Dwo_file::sized_read_unit_index): Likewise. 2224 (Dwo_file::copy_section): Likewise. 2225 (Dwo_file::add_unit_set): Likewise. 2226 (Dwp_output_file::add_output_section): Likewise. 2227 (Dwp_output_file::add_contribution): Likewise. 2228 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check 2229 for empty slot. 2230 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package 2231 file format. 2232 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty 2233 slot. 2234 (Dwp_output_file::initialize): Remove unused function. 2235 (Dwp_output_file::finalize): Add support for v2 package file format. 2236 (Dwp_output_file::write_index): Likewise. 2237 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust 2238 function prototype. 2239 2240 2013-03-01 Cary Coutant <ccoutant (a] google.com> 2241 2242 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move 2243 function into class definition in header file. 2244 (Dwarf_info_reader::warn_corrupt_debug_section): New function. 2245 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section): 2246 New function. 2247 (Dwarf_info_reader::check_buffer): Move here from .cc file. 2248 2249 2013-02-28 Alan Modra <amodra (a] gmail.com> 2250 2251 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare. 2252 * target.cc (Target::do_plt_fde_location): New function. 2253 * ehframe.h (class FDE): Add post_map field to u_.from_linker, 2254 accessor function, and constructor param. 2255 (struct Post_fde, Post_fdes): Declare. 2256 (Cie::write): Add post_fdes param. 2257 * ehframe.cc (Fde::write): Use plt_fde_location. 2258 (struct Post_fde): Define. 2259 (Cie::write): Stash FDEs added post merge mapping. 2260 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping. 2261 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs. 2262 (Eh_frame::do_sized_write): Arrange to write post map FDES after 2263 other FDEs. 2264 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function. 2265 (Target_powerpc::has_glink): New function. 2266 (Target_powerpc::do_relax): Add eh_frame info for stubs. 2267 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64, 2268 glink_eh_frame_fde_32, default_fde): New data. 2269 (Stub_table::eh_frame_added_): New var. 2270 (Stub_table::find_long_branch_entry, stub_address, stub_offset): 2271 Make const. 2272 (Stub_table::add_eh_frame): New function. 2273 (Output_data_glink::add_eh_frame): New function. 2274 (Target_powerpc::make_glink_section): Call add_eh_frame. 2275 2276 2013-02-15 Ian Lance Taylor <iant (a] google.com> 2277 2278 * options.h (DEFINE_uint64_alias): Define. 2279 (class General_options): Add -Ttext-segment as an alias for 2280 -Ttext. 2281 2282 2013-02-15 Alan Modra <amodra (a] gmail.com> 2283 2284 * powerpc.cc (Stub_table::plt_off): New function, extracted from.. 2285 (Stub_table::do_write): ..here, two places. 2286 (Stub_table::plt_call_size): Use it here too. 2287 2288 2013-02-11 Ian Lance Taylor <iant (a] google.com> 2289 2290 * descriptors.cc (Descriptors::close_all): New function. 2291 * descriptors.h (class Descriptors): Declare close_all. 2292 (close_all_descriptors): New inline function. 2293 * plugin.cc: Include "descriptors.h". 2294 (Plugin_manager::cleanup): Call close_all_descriptors. 2295 2296 2013-02-06 Alan Modra <amodra (a] gmail.com> 2297 2298 * README: Update coding style link. 2299 2300 2013-01-28 Cary Coutant <ccoutant (a] google.com> 2301 2302 * dwp.cc (File_list): New typedef. 2303 (Dwo_name_info_reader): New class. 2304 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters. 2305 (Dwo_id_info_reader::visit_top_die): Remove unused member function. 2306 (Dwo_file::~Dwo_file): Delete input_file_ after obj_. 2307 (Dwo_file::read_executable): New function. 2308 (Dwo_file::read): Move common setup code to ... 2309 (Dwo_file::make_object): ... here. 2310 (dwp_options): Add --exec/-e. 2311 (usage): Likewise. 2312 (main): Likewise. 2313 2314 2013-01-24 Sriraman Tallam <tmsriram (a] google.com> 2315 2316 * layout.cc (Layout::layout): Check for option text_reorder. 2317 (Layout::make_output_section): Ditto. 2318 * options.h (text_reorder): New option. 2319 * output.cc (Input_section_sort_compare): Remove special ordering 2320 of section names. 2321 (Output_section:: 2322 Input_section_sort_section_name_special_ordering_compare:: 2323 operator()): New function. 2324 (Output_section::sort_attached_input_sections): Use new sort function 2325 for .text. 2326 * output.h (Input_section_sort_section_name_special_ordering_compare): 2327 New struct. 2328 * testsuite/Makefile.am (text_section_grouping): Test option 2329 --no-text-reorder 2330 * testsuite/Makefile.in: Regenerate. 2331 * testsuite/text_section_grouping.sh: Check order of functions without 2332 default text reordering. 2333 2334 2013-01-18 Mike Frysinger <vapier (a] gentoo.org> 2335 2336 * options.h (General_options): Change default to true for new_dtags. 2337 2338 2013-01-18 Mike Frysinger <vapier (a] gentoo.org> 2339 2340 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH 2341 when enable_new_dtags is false. Only add DT_RUNPATH when 2342 enable_new_dtags is true. 2343 2344 2013-01-17 Serge Pavlov <serge.v.pavlov (a] gmail.com> 2345 2346 * powerpc.cc (Stub_table::find_plt_call_entry): Make types 2347 used in declaration and definition consistent. 2348 (Target_powerpc::symval_for_branch): Ditto. 2349 2350 2013-01-16 Sriraman Tallam <tmsriram (a] google.com> 2351 2352 * testsuite/plugin_final_layout.cc: Fix comment. 2353 2354 2013-01-16 Sriraman Tallam <tmsriram (a] google.com> 2355 2356 * layout.cc (Layout::layout): Do not do default sorting for 2357 text sections when section ordering is specified. 2358 (make_output_section): Ditto. 2359 * testsuite/plugin_final_layout.cc: Name the function sections 2360 to catch reordering issues. 2361 2362 2013-01-15 Alan Modra <amodra (a] gmail.com> 2363 2364 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to 2365 plt-thread-safe. 2366 2367 2013-01-15 Alan Modra <amodra (a] gmail.com> 2368 2369 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section. 2370 * testsuite/Makefile.in: Regenerate. 2371 2372 2013-01-14 Alan Modra <amodra (a] gmail.com> 2373 2374 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files. 2375 * testsuite/Makefile.in: Regenerate. 2376 2377 2013-01-11 Pavel Chupin <pavel.v.chupin (a] intel.com> 2378 2379 PR bfd/14430 2380 Fix mingw gold build with plugins enabled 2381 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@. 2382 * configure.ac: Export DLOPEN_LIBS and add headers check. 2383 * plugin.cc: Handle non-dlfcn case. 2384 * Makefile.in: Regenerate. 2385 * config.in: Regenerate. 2386 * configure: Regenerate. 2387 * testsuite/Makefile.in: Regenerate. 2388 2389 2013-01-09 Sriraman Tallam <tmsriram (a] google.com> 2390 2391 * output.h (sort_attached_input_sections): Change to be public. 2392 * script-sections.cc 2393 (Output_section_definition::set_section_addresses): Sort 2394 attached input sections according to section order before linker 2395 script assigns section addresses. 2396 (Orphan_output_section::set_section_addresses): Sort 2397 attached input sections according to section order before linker 2398 script assigns section addresses. 2399 * Makefile.am (final_layout.sh): Use a simple linker script to 2400 check if section ordering still works. 2401 * Makefile.in: Regenerate. 2402 2403 2013-01-09 Ben Cheng <bccheng (a] google.com> 2404 2405 * arm.cc (Target_arm::attributes_accept_div): New function. 2406 (Target_arm::attributes_forbid_div): New function. 2407 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use 2408 attribute using the same new functions as what bfd/elf32_arm.c 2409 does. 2410 2411 2013-01-07 Cary Coutant <ccoutant (a] google.com> 2412 2413 PR gold/14993 2414 * output.cc (Output_section::add_input_section): For incremental 2415 updates, don't track input sections that are allocated from patch 2416 space. 2417 2418 2013-01-07 H.J. Lu <hongjiu.lu (a] intel.com> 2419 Ian Lance Taylor <iant (a] google.com> 2420 2421 PR gold/14897 2422 * configure.ac (--enable-ld): Removed. 2423 (install_as_default): Set to yes only for --enable-gold=default 2424 or --disable-ld. 2425 * configure: Regenerated. 2426 2427 2013-01-07 H.J. Lu <hongjiu.lu (a] intel.com> 2428 2429 * options.h (General_options): Add -fuse-ld= for GCC linker 2430 option compatibility. 2431 2432 2013-01-04 Cary Coutant <ccoutant (a] google.com> 2433 2434 * configure.ac: Fix typo restoring CXXFLAGS. 2435 * configure: Regenerate. 2436 2437 2013-01-04 Cary Coutant <ccoutant (a] google.com> 2438 2439 * testsuite/Makefile.am (CXXLINK_S): New macro. 2440 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S. 2441 * testsuite/Makefile.in: Regenerate. 2442 2443 2013-01-02 H.J. Lu <hongjiu.lu (a] intel.com> 2444 2445 * version.cc (print_version): Update copyright year to 2013. 2446 2447 2012-12-20 Ian Lance Taylor <iant (a] google.com> 2448 2449 * layout.cc (Layout::special_ordering_of_input_section): New 2450 function. 2451 (Layout::layout): If input section requires special ordering, must 2452 sort input sections. 2453 (Layout::make_output_section): May sort .text input sections. 2454 (Layout::is_section_name_prefix_grouped): Remove. 2455 * layout.h (class Layout): Declare 2456 special_ordering_of_input_section. Don't declare 2457 is_section_name_prefix_grouped. 2458 * output.cc (Output_section::add_input_section): Revert last 2459 change. 2460 (Output_section::Input_section_sort::match_file_name): Don't crash 2461 if called on output section data. 2462 (Output_section::Input_section_sort_compare): Sort based on 2463 special ordering. 2464 (Output_section::Input_section_sort_section_order_index_compare): 2465 Revert last patch. 2466 (Output_section::sort_attached_input_sections): Likewise. 2467 2468 2012-12-18 Sriraman Tallam <tmsriram (a] google.com> 2469 2470 * layout.cc (Layout::is_section_name_prefix_grouped): New function. 2471 * layout.h (Layout::is_section_name_prefix_grouped): New function. 2472 * output.cc (Output_section::add_input_section): Check if section 2473 name contains special prefix. Keep input sections to sort such 2474 sections. 2475 (Output_section::Input_section_sort_section_order_index_compare 2476 ::operator()): Group sections according to prefixes. 2477 (Output_section::sort_attached_input_sections): Add condition to 2478 Input_section_entry constructor call. 2479 * testsuite/Makefile.am (text_section_grouping): New test. 2480 * testsuite/Makefile.in: Regenerate. 2481 * testsuite/text_section_grouping.cc: New file. 2482 * testsuite/text_section_grouping.sh: New file. 2483 2484 2012-12-17 Nick Clifton <nickc (a] redhat.com> 2485 2486 * Makefile.am: Add copyright notice. 2487 * NEWS: Likewise. 2488 * README: Likewise. 2489 * configure.ac: Likewise. 2490 * ftruncate.c: Likewise. 2491 * Makefile.in: Regenerate. 2492 2493 2012-12-14 Cary Coutant <ccoutant (a] google.com> 2494 2495 * testsuite/Makefile.am (exception_separate_shared_12_test): Add 2496 --no-as-needed flag. 2497 (exception_separate_shared_12_test): Likewise. 2498 (incremental_copy_test): Likewise. 2499 * testsuite/Makefile.in: Regenerate. 2500 2501 2012-12-14 Cary Coutant <ccoutant (a] google.com> 2502 2503 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs. 2504 (Dwp_output_file::Dwp_index::enter_set): Add assert. 2505 2506 2012-12-12 Alan Modra <amodra (a] gmail.com> 2507 2508 * powerpc.cc (class Track_tls): New. 2509 (class Relocate, class Scan): Inherit Track_tls. 2510 (Target_powerpc::Scan::local, global): Track tls optimization 2511 and avoid creating plt entry for __tls_get_addr if all uses 2512 are optimized away. 2513 (Target_powerpc::Relocate::relocate): Update to use Track_tls. 2514 2515 2012-12-12 Alan Modra <amodra (a] gmail.com> 2516 2517 * options.h (General_options): Add --toc-sort/--no-toc-sort. 2518 Replace no_toc_optimize with toc_optimize. 2519 * output.h (Output_section::input_sections): Provide non-const variant. 2520 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_, 2521 set_has_small_toc_reloc, has_small_toc_reloc): New variable and 2522 accessors. 2523 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc. 2524 (class Sort_toc_sections): New. 2525 (Target_powerpc::do_finalize_sections): Sort toc sections. 2526 (Target_powerpc::Relocate::relocate): Update toc_optimize test. 2527 2528 2012-12-10 Roland McGrath <mcgrathr (a] google.com> 2529 2530 * testsuite/binary_unittest.cc (read_all): New function. 2531 (Sized_binary_test): Use it instead of ::read. 2532 * fileread.cc (do_read): Don't assume pread always reads the whole 2533 amount in a single call. 2534 2535 2012-12-10 Alan Modra <amodra (a] gmail.com> 2536 2537 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc): 2538 Set EM_PPC64 or EM_PPC here. 2539 (Target_selector_powerpc::do_recognize): Delete. 2540 2541 2012-12-10 Alan Modra <amodra (a] gmail.com> 2542 2543 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and 2544 stub_table_. 2545 (Target_powerpc::Branch_info::make_stub): Don't omit addend. 2546 2547 2012-12-07 Roland McGrath <mcgrathr (a] google.com> 2548 2549 * testsuite/binary_unittest.cc (Sized_binary_test): 2550 Use open_descriptor rather than ::open. 2551 2552 2012-12-07 Alan Modra <amodra (a] gmail.com> 2553 2554 * powerpc.cc (Stub_table::do_write): Delete redundant Address 2555 typedef and invalid_address constant. 2556 (Output_data_glink, Stub_table, Target_powerpc): Explicitly 2557 instantiate constants. 2558 2559 2012-12-06 Roland McGrath <mcgrathr (a] google.com> 2560 2561 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS. 2562 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL. 2563 * aclocal.m4: Regenerate. 2564 * configure: Regenerate. 2565 * Makefile.in: Regenerate. 2566 * testsuite/Makefile.in: Regenerate. 2567 2568 2012-12-07 Alan Modra <amodra (a] gmail.com> 2569 2570 * options.h (General_options): Add no_toc_optimize. 2571 * powerpc.cc (ok_lo_toc_insn): New function. 2572 (Target_powerpc::Relocate::relocate): Optimize toc access sequences. 2573 2574 2012-12-06 Alan Modra <amodra (a] gmail.com> 2575 2576 * options.h (General_options): Add plt_align, plt_static_chain, 2577 plt_thread_safe. Update stub_group_size help text. 2578 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function 2579 for new plt_thread_safe_ var. 2580 (use_plt_offset): Correct comments. 2581 (Target_powerpc::do_relax): Look for thread creation symbols to 2582 determine default plt_thread_safe value. Clear plt call stubs 2583 as well as branch stubs each iteration. 2584 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New 2585 insn constants. 2586 (l, hi, ha, write_insn): Move earlier. 2587 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size. 2588 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear 2589 plt stubs too. 2590 (Stub_table::update_size): Adjust. 2591 (Stub_table::prev_size, set_prev_size): Delete. 2592 (Stub_table::stub_align): Let --plt-align affect result. 2593 (Stub_table::plt_call_size): Calculate sizes for various stubs. 2594 (Stub_table::branch_stub_size): Use last_plt_size in address calc. 2595 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size. 2596 (Stub_table::do_write): Support more stub variants. 2597 2598 2012-12-04 Alan Modra <amodra (a] gmail.com> 2599 2600 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete. 2601 (Target_powerpc::do_define_standard_symbols): New function. 2602 2603 2012-12-03 Alan Modra <amodra (a] gmail.com> 2604 2605 * output.h: Formatting, whitespace. 2606 2607 2012-12-03 Alan Modra <amodra (a] gmail.com> 2608 2609 * layout.h (Layout::get_executable_sections): Declare. 2610 * layout.cc (Layout::get_executable_sections): New function. 2611 * arm.cc (Target_arm::group_sections): Use it. 2612 (Arm_output_section::group_sections): Delete now redundant test. 2613 * output.cc (Output_reloc::Output_reloc): Add is_relative. 2614 param to handle relative relocs. 2615 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise. 2616 (Output_data_reloc::add_absolute): Adjust. 2617 (Output_data_reloc::add_relative): New function. 2618 (Output_data::reset_data_size): New function. 2619 (Output_relaxed_input_section::set_relobj, set_shndx): New functions. 2620 (Output_section::set_addralign): New function. 2621 (Output_section::checkpoint_set_addralign): New function. 2622 (Output_section::clear_section_offsets_need_adjustment): New function. 2623 (Output_section::input_sections): Make public. 2624 * powerpc.cc (class Output_data_brlt_powerpc): New. 2625 (class Stub_table, class Stub_control): New. 2626 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch, 2627 stub_table_, set_stub_table, stub_table): New vectors and accessor 2628 functions. 2629 (Target_powerpc::do_may_relax, do_relax, push_branch, 2630 new_stub_table, stub_tables, brlt_section, group_sections, 2631 add_branch_lookup_table, find_branch_lookup_table, 2632 write_branch_lookup_table, make_brlt_section): New functions. 2633 (Target_powerpc::struct Sort_sections, class Branch_info): New. 2634 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_, 2635 branch_info_): New vars. 2636 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't 2637 make call stubs here. 2638 (Output_data_glink): Remove all call stub handling from this class. 2639 (Target_powerpc::Scan::local, global): Save interesting branch 2640 relocs and relocs for ifunc. Adjust calls to plt entry functions. 2641 (Target_powerpc::do_finalize_sections): Only make reg save/restore 2642 functions on final link. 2643 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs. 2644 Handle long branch destinations too. 2645 (Target_powerpc::do_dynsym_value, do_plt_address_for_global, 2646 do_plt_address_for_local): Adjust lookup of plt call stubs. 2647 2648 2012-11-30 Alan Modra <amodra (a] gmail.com> 2649 2650 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative 2651 relocs against protected symbols when building 32-bit shared libs. 2652 2653 2012-11-30 Alan Modra <amodra (a] gmail.com> 2654 2655 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab 2656 param. Call got_section() to make .got. Update all callers 2657 and their callers and so on. 2658 2659 2012-11-30 Alan Modra <amodra (a] gmail.com> 2660 2661 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL 2662 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK. 2663 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_ 2664 value if it already exists. 2665 2666 2012-11-19 H.J. Lu <hongjiu.lu (a] intel.com> 2667 2668 PR gold/14858 2669 * x86_64.cc (Relocate::tls_ld_to_le): Support x32. 2670 2671 2012-11-14 Roland McGrath <mcgrathr (a] google.com> 2672 2673 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather 2674 than bfc instruction for data sandboxing. 2675 2676 2012-11-08 Alan Modra <amodra (a] gmail.com> 2677 2678 * po/POTFILES.in: Regenerate. 2679 2680 2012-11-05 Alan Modra <amodra (a] gmail.com> 2681 2682 * configure.ac: Apply 2012-09-10 change to config.in here. 2683 * configure: Regenerate. 2684 2685 2012-11-05 Alan Modra <amodra (a] gmail.com> 2686 2687 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef. 2688 (struct Opd_ent): Use "Address" rather than "Offset". 2689 (Output_data_got_powerpc::got_base_offset): Return Valtype. 2690 (Target_powerpc::got_section): Make public. 2691 (Target_powerpc::scan_relocs): Move code setting symbols.. 2692 (Powerpc_relobj::do_scan_relocs): ..to here, new function. 2693 Create _SDA_BASE_ only when referenced. 2694 2695 2012-11-02 Roland McGrath <mcgrathr (a] google.com> 2696 2697 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename 2698 from last change. 2699 2700 2012-11-01 Roland McGrath <mcgrathr (a] google.com> 2701 2702 * target.h (Sized_target::relocate_relocs): Use Elf_Off 2703 for offset_in_output_section parameter. 2704 (Sized_target::relocate_special_relocatable): Likewise. 2705 * arm.cc (Target_arm::relocate_relocs): Likewise. 2706 (Target_arm::relocate_special_relocatable): Likewise. 2707 * i386.cc (Target_i386::relocate_relocs): Likewise. 2708 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise. 2709 * sparc.cc (Target_sparc::relocate_relocs): Likewise. 2710 * target-reloc.h (relocate_relocs): Likewise. 2711 * testsuite/testfile.cc (Target_test): Likewise. 2712 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise. 2713 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise. 2714 2715 * system.h: Move inclusion of <clocale> to after <libintl.h> in 2716 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section. 2717 2718 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the 2719 parameter, which is unused in the [!F_SETFD] case. 2720 2721 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast 2722 SYMNDX to off_t before comparing it to this->data_size(). 2723 * output.cc (Output_symtab_xindex::endian_do_write): Likewise. 2724 * incremental.cc (Output_section_incremental_inputs::do_write): 2725 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE. 2726 2727 * nacl.cc: Include "libiberty.h" for vasprintf declaration. 2728 2729 2012-10-30 Steve McIntyre <steve.mcintyre (a] linaro.org> 2730 2731 * gold.cc (Target_arm::do_adjust_elf_header): Add the 2732 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC 2733 in EABI_VER5. 2734 2735 2012-10-29 Cary Coutant <ccoutant (a] google.com> 2736 2737 * dwp.cc (usage): Add file and exit status parameters; 2738 add --help and --version options. 2739 (print_version): New function. 2740 (main): Add --help and --version options. 2741 2742 2012-10-25 H.J. Lu <hongjiu.lu (a] intel.com> 2743 2744 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add 2745 final_layout_sequence.txt. 2746 * testsuite/Makefile.in: Regenerated. 2747 2748 2012-10-25 H.J. Lu <hongjiu.lu (a] intel.com> 2749 2750 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from 2751 COMPILE generated by automake. 2752 (LINK1): Likewise. 2753 (CXXCOMPILE1): Likewise. 2754 (CXXLINK1): Likewise. 2755 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1. 2756 (LINK): Likewise. 2757 (CXXCOMPILE): Likewise. 2758 (CXXLINK): Likewise. 2759 * testsuite/Makefile.in: Regenerated. 2760 2761 2012-10-25 H.J. Lu <hongjiu.lu (a] intel.com> 2762 2763 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error 2764 on bad fwrite return. 2765 2766 2012-10-25 H.J. Lu <hongjiu.lu (a] intel.com> 2767 2768 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type 2769 on val. 2770 2771 2012-10-23 Cary Coutant <ccoutant (a] google.com> 2772 2773 * testsuite/Makefile.am (TEST_OBJCOPY): New macro. 2774 * testsuite/Makefile.in: Regenerate. 2775 * testsuite/dwp_test.h: New source file. 2776 * testsuite/dwp_test_1.cc: New source file. 2777 * testsuite/dwp_test_1.s: New source file. 2778 * testsuite/dwp_test_1.sh: New source file. 2779 * testsuite/dwp_test_1b.cc: New source file. 2780 * testsuite/dwp_test_1b.s: New source file. 2781 * testsuite/dwp_test_2.cc: New source file. 2782 * testsuite/dwp_test_2.s: New source file. 2783 * testsuite/dwp_test_2.sh: New source file. 2784 * testsuite/dwp_test_main.cc: New source file. 2785 * testsuite/dwp_test_main.s: New source file. 2786 2787 2012-10-23 Cary Coutant <ccoutant (a] google.com> 2788 2789 * dwp.h: New header file. 2790 * dwp.cc: New source file. 2791 * gold.h: Move shared declarations to system.h. 2792 * system.h: New header file. 2793 * Makefile.am: Add dwp. 2794 * Makefile.in: Regenerate. 2795 2796 2012-10-23 Cary Coutant <ccoutant (a] google.com> 2797 2798 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call 2799 Dwarf_info_reader::read_from_pointer. 2800 (Dwarf_pubnames_table::read_header): Likewise. 2801 (Dwarf_pubnames_table::next_name): Likewise. 2802 (Dwarf_die::read_attributes): Likewise. 2803 (Dwarf_die::skip_attributes): Likewise. 2804 (Dwarf_info_reader::read_from_pointer): New function template. 2805 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_. 2806 (Dwarf_pubnames_table): Likewise. 2807 (Dwarf_info_reader::read_from_pointer): New function template. 2808 * gdb-index.cc (Gdb_index_info_reader): Adjust call to 2809 Dwarf_pubnames_table ctor. 2810 2811 2012-10-23 Cary Coutant <ccoutant (a] google.com> 2812 2813 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored 2814 abbrev_shndx. 2815 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize 2816 abbrev_shndx_. 2817 (Dwarf_info_reader::set_abbrev_shndx): New method. 2818 (Dwarf_info_reader::abbrev_shndx_): New data member. 2819 2820 2012-10-23 Cary Coutant <ccoutant (a] google.com> 2821 2822 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness 2823 from object, not parameters. 2824 (Dwarf_info_reader::parse): Likewise. 2825 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods. 2826 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods. 2827 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New 2828 methods. 2829 2830 2012-10-23 Cary Coutant <ccoutant (a] google.com> 2831 2832 * fileread.cc (Input_file::Input_file): New constructor. 2833 * fileread.h (class Input_file): Add new constructor. 2834 2835 2012-10-18 Alan Modra <amodra (a] gmail.com> 2836 2837 PR gold/14727 2838 * object.cc (Relobj::is_section_name_included): Also match 2839 .sdata personality section. 2840 2841 2012-10-18 Alan Modra <amodra (a] gmail.com> 2842 2843 * target-reloc.h (class Default_comdat_behavior): New, package up.. 2844 (get_comdat_behaviour): ..this. 2845 (relocate_section): Add Relocate_comdat_behavior template arg, 2846 adjust code to suit. 2847 * arm.cc (Target_arm::relocate_section): Adjust to suit. 2848 (Target_arm::scan_reloc_section): Likewise. 2849 * i386.cc (Target_i386::relocate_section): Likewise. 2850 * sparc.cc (Target_sparc::relocate_section): Likewise. 2851 * tilegx.cc (Target_tilegx::relocate_section): Likewise. 2852 * x86_64.cc (Target_x86_64::relocate_section): Likewise. 2853 * powerpc.cc (class Relocate_comdat_behavior): New. 2854 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply 2855 gold::relocate_section with new template arg. 2856 2857 2012-10-18 Alan Modra <amodra (a] gmail.com> 2858 2859 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit 2860 dynamic relocs for GOT_TPREL got entries, without symbol if 2861 resolving locally. 2862 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects. 2863 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early. 2864 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned. 2865 2866 2012-10-17 Alan Modra <amodra (a] gmail.com> 2867 2868 PR gold/14726 2869 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini. 2870 2871 2012-10-16 Sriraman Tallam <tmsriram (a] google.com> 2872 2873 * layout.cc (Layout::include_section): Keep sections marked 2874 SHF_EXCLUDE when doing relocatable links. 2875 2876 2012-10-16 Alan Modra <amodra (a] gmail.com> 2877 2878 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func. 2879 (Target_powerpc::do_finalize_sections): Call it. 2880 (Output_data_save_res): New class and supporting functions. 2881 (Target_powerpc::symval_for_branch): Only look up .opd entry for 2882 normal symbols defined in object files. 2883 2884 2012-10-12 Alan Modra <amodra (a] gmail.com> 2885 2886 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New. 2887 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark". 2888 (Target_powerpc::do_gc_mark_symbol): Delay marking function code 2889 section if scan_opd_relocs not yet called. 2890 (Target_powerpc::gc_process_relocs): Call process_gc_mark. 2891 2892 2012-10-12 Alan Modra <amodra (a] gmail.com> 2893 2894 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry, 2895 add_local_ifunc_entry): Revert last change. 2896 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise. 2897 2898 2012-10-05 Alan Modra <amodra (a] gmail.com> 2899 2900 * powerpc.cc (Target_powerpc::do_plt_address_for_local, 2901 do_plt_address_for_global): New functions. 2902 (Output_data_got_powerpc::do_write): Don't segfault when linking 2903 statically. 2904 (Output_data_plt_powerpc::add_entry, add_ifunc_entry, 2905 add_local_ifunc_entry): Return true on adding entry.. 2906 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary 2907 glink->add_entry call. Remove unused symtab param. Adjust calls. 2908 (Target_powerpc::make_local_ifunc_plt_entry): Likewise. 2909 (Target_powerpc::make_iplt_section): Remove symtab param. Don't 2910 set up symbols here. 2911 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt 2912 syms here. Do so even when no .iplt. Don't segfault when linking 2913 statically. 2914 (Output_data_glink::add_entry, find_entry): Rearrange params. Add 2915 new variants without reloc param. 2916 (Glink_sym_ent::Glink_sym_ent): Likewise. 2917 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any 2918 reloc when refs will resolve to plt call stub. 2919 (Target_powerpc::Scan::local): Correct ifunc handling. Allow 2920 R_PPC_PLTREL24 to resolve locally. 2921 (Target_powerpc::Scan::global): Correct ifunc handling. 2922 (Target_powerpc::Relocate::relocate): Correct local sym glink 2923 lookup. Don't destroy "value" when we have a plt call stub, 2924 and when checking plt call validity. 2925 (Target_powerpc::do_dynsym_value): Simplify. 2926 2927 2012-10-05 Alan Modra <amodra (a] gmail.com> 2928 2929 * i386.cc (Output_data_plt_i386::address_for_global, 2930 address_for_local): Add plt offset to returned value. Adjust uses. 2931 * sparc.cc (Output_data_plt_sparc::address_for_global, 2932 address_for_local): Likewise. 2933 * tilegx.cc (Output_data_plt_tilegx::address_for_global, 2934 address_for_local): Likewise. 2935 * x86_64.cc (Output_data_plt_x86_64::address_for_global, 2936 address_for_local): Likewise. 2937 * target.h (Target::plt_address_for_global, plt_address_for_local): 2938 Update comment. 2939 * output.cc (Output_reloc::symbol_value): Don't add plt offset here. 2940 (Output_data_got::Got_entry::write): Nor here. 2941 * output.h: Comment fix. 2942 2943 2012-10-02 Jiong Wang <jiwang (a] tilera.com> 2944 2945 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust 2946 global_offset_table_ value for larget got. 2947 (Target_tilegx::Relocate::relocate): Handle adjusted got value. 2948 2949 2012-09-29 Alan Modra <amodra (a] gmail.com> 2950 2951 * powerpc.cc (Target_powerpc::iplt_): New output section. 2952 (Target_powerpc::iplt_section, make_iplt_section, 2953 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions. 2954 (Target_powerpc::make_plt_entry): Handle ifunc syms. 2955 Target_powerpc::plt_entry_count): Count iplt entries too. 2956 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create 2957 reloc section in constructor. New params. 2958 (Target_powerpc::make_plt_section): Create reloc section here instead. 2959 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New 2960 functions. 2961 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars. 2962 (Output_data_glink::add_entry, find_entry): New functions to 2963 deal with local syms. 2964 (Glink_sym_ent): Add support for local syms. 2965 (Output_data_glink::do_write): Handle ifunc plt entries. 2966 (Target_powerpc::Scan::get_reference_flags): Handle more relocs. 2967 (Target_powerpc::Scan::local, global): Handle ifunc syms. 2968 (Target_powerpc::Relocate::relocate): Likewise. 2969 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry. 2970 2971 2012-09-25 Alan Modra <amodra (a] gmail.com> 2972 2973 * object.h (Sized_relobj_file::adjust_local_symbol, 2974 do_adjust_local_symbol): New functions. 2975 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above. 2976 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function. 2977 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs 2978 and irregular opd entry spacing. 2979 (Powerpc_relobj::do_read_relocs): Add opd size checks. 2980 (Global_symbol_visitor_opd): New functor. 2981 (Target_powerpc::do_finalize_sections): Omit global symbols defined 2982 on deleted opd entries. 2983 2984 2012-09-15 Jiong Wang <jiwang (a] tilera.com> 2985 2986 * tilegx.cc: New file. 2987 * Makefile.am (TARGETSOURCES): Add tilegx.cc 2988 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT) 2989 * configure.tgt: Add entries for tilegx*. 2990 * configure.ac: Likewise. 2991 * Makefile.in: Rebuild. 2992 * configure: Likewise. 2993 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle 2994 tilegx. 2995 2996 2012-09-13 Alan Modra <amodra (a] gmail.com> 2997 2998 * target-reloc.h (scan_relocs): Call scan.local for relocs 2999 against symbols in discarded sections. Pass is_discarded 3000 param. 3001 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local): 3002 Add is_discarded param. 3003 * powerpc (Target_powerpc::Scan::local): Likewise. Use 3004 is_discarded to flag opd entry as discarded. Don't emit dyn 3005 relocs on such entries. 3006 (Target_powerpc::Scan::global): Similarly detect and handle 3007 such opd entries. 3008 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with 3009 opd_ent_. Update all uses. 3010 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions. 3011 (Target_powerpc::relocate_section): Zero out discarded opd 3012 entry relocs. 3013 3014 2012-09-12 Ian Lance Taylor <iant (a] google.com> 3015 3016 PR gold/14570 3017 * output.cc: Rename Output_data_got template parameter from size 3018 to got_size for all functions. Compile all variants of 3019 Output_data_got. 3020 (Output_data_got::Got_entry::write): Correct use of size for 3021 symbol value. Use local_is_tls rather than casting to 3022 Sized_relobj_file. 3023 * object.h (class Object): Add local_is_tls and do_local_is_tls. 3024 (class Sized_relobj_file): Add do_local_is_tls. 3025 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls. 3026 3027 2012-09-11 Alan Modra <amodra (a] gmail.com> 3028 3029 PR gold/14566 3030 * layout.cc (Layout::set_segment_offsets): When using 3031 common-page-size alignment, ensure we are on a new max-page-size 3032 page. 3033 * output.cc (Output_segment::set_section_addresses): Use 3034 abi_pagesize, not common_pagesize for relro boundary. 3035 (Output_segment::set_offset): Likewise. 3036 3037 2012-09-11 Alan Modra <amodra (a] gmail.com> 3038 3039 * output.h (Output_data_got::add_global_tls, add_local_tls, 3040 add_local_tls_pair): New functions. 3041 (Output_data_got::add_local_pair_with_rel): Remove second 3042 reloc param. Expand comment. 3043 (Output_data_got::Got_entry): Rename use_plt_offset_ to 3044 use_plt_or_tls_offset_, similarly for constructor param. 3045 (Output_data_got::Got_entry::write): Add got_index param. 3046 * output.cc (Output_data_got::add_global_tls, add_local_tls, 3047 add_local_tls_pair): New functions. 3048 (Output_data_got::Got_entry::write): Handle tls symbols 3049 with use_plt_or_tls_offset_ set specially. 3050 (Output_data_got::add_local_pair_with_rel): Only one reloc. 3051 (Output_data_got::do_write): Replace iterator with index, pass 3052 index to entry write function. 3053 * target.h (Target::tls_offset_for_local, tls_offset_for_global, 3054 do_tls_offset_for_local, do_tls_offset_for_global): New functions. 3055 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel 3056 call. 3057 * i386.cc (Target_i386::Scan::local): Likewise. 3058 * sparc.cc (Target_sparc::Scan::local): Likewise. 3059 * x86_64.cc (Target_x86_64::Scan::local): Likewise. 3060 * powerpc.cc (Target_powerpc::do_tls_offset_for_local, 3061 do_tls_offset_for_global): New functions. 3062 (Target_powerpc::Scan::local): Correct TLS relocations and got 3063 entry values. 3064 (Target_powerpc::Scan::global): Don't emit unnecessary 3065 dynamic relocations on TLS GOT entries. 3066 3067 2012-09-10 Matthias Klose <doko (a] ubuntu.com> 3068 3069 * config.in: Disable sanity check for kfreebsd. 3070 3071 2012-09-10 Sterling Augustine <saugustine (a] google.com> 3072 3073 * gdb-index.cc (Gdb_index::pubnames_read): New parameter. 3074 (Gdb_index::pubtypes_read): New parameter. 3075 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters 3076 to calls. 3077 * gdb-index.h (Gdb_index): New fields pubnames_object_ and 3078 pubtypes_object_. 3079 3080 2012-09-09 Alan Modra <amodra (a] gmail.com> 3081 3082 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions. 3083 (Sized_target::gc_add_reference, do_gc_add_reference): New functions. 3084 * gc.h (gc_process_relocs): Call target gc_add_reference. 3085 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym. 3086 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol. 3087 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove 3088 unnecessary cast. 3089 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters 3090 to cater for when we don't need code offset. Update use. 3091 (Powerpc_relobj::access_from_map_, opd_valid_): New vars. 3092 (Powerpc_relobj::access_from_map, add_reference, opd_valid, 3093 set_opd_valid): New functions. 3094 (Target_powerpc::do_gc_add_reference): New function. 3095 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on 3096 stashed refs. 3097 (Target_powerpc::do_gc_mark_symbol): New function. 3098 3099 2012-09-06 Cary Coutant <ccoutant (a] google.com> 3100 3101 * dwarf_reader.cc (Dwarf_die::read_attributes): Add 3102 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index. 3103 (Dwarf_die::skip_attributes): Likewise. 3104 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment. 3105 * testsuite/gdb_index_test.cc (inline_func_1): New function. 3106 (main): Call it. 3107 * testsuite/gdb_index_test_comm.sh: Check index for inline function. 3108 3109 2012-09-05 H.J. Lu <hongjiu.lu (a] intel.com> 3110 3111 * testsuite/script_test_3.t: Add .got.plt output section 3112 statement. 3113 * testsuite/script_test_4.t: Likewise. 3114 3115 2012-09-05 Alan Modra <amodra (a] gmail.com> 3116 3117 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values, 3118 update all uses and lose "enum" when using type. 3119 3120 2012-09-05 Alan Modra <amodra (a] gmail.com> 3121 3122 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc. 3123 * configure: Regenerate. 3124 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm. 3125 (plugin_final_layout.stdout): Likewise. 3126 (memory_test): Set page sizes to 0x1000. 3127 * testsuite/Makefile.in: Regenerate. 3128 * testsuite/discard_locals_test.sh: Add FIXME comment. 3129 * testsuite/justsyms_exec.c: Disable function test for powerpc64. 3130 * testsuite/pr14265.t: Add .got output section statement. 3131 * testsuite/script_test_2.t: Likewise. 3132 * testsuite/script_test_3.t: Likewise. 3133 * testsuite/script_test_4.t: Likewise. 3134 * testsuite/script_test_5.t: Likewise. 3135 * testsuite/script_test_6.t: Likewise. 3136 * testsuite/script_test_7.t: Likewise. 3137 * testsuite/script_test_9.t: Likewise. 3138 3139 2012-09-05 Alan Modra <amodra (a] gmail.com> 3140 3141 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const. 3142 (Powerpc_relocate_functions::Status): New typedef. 3143 (Target_powerpc::Scan::get_reference_flags): Handle more relocs. 3144 (Target_powerpc::Scan::local): Handle REL64. 3145 (Target_powerpc::Scan::global): Likewise, and dynamic relocs 3146 for REL32 and REL64. 3147 (Target_powerpc::symval_for_branch): New function, extracted from.. 3148 (Target_powerpc::Relocate::relocate): ..here. Correct plt call 3149 checks. Report overflow errors. 3150 3151 2012-09-05 Alan Modra <amodra (a] gmail.com> 3152 3153 * object.h (Sized_relobj_file::emit_relocs): Delete. 3154 (Sized_relobj_file::emit_relocs_reltype): Delete. 3155 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target 3156 relocate_relocs for --emit-relocs. 3157 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete. 3158 * output.h: Update comment. 3159 (Output_segment::first_section): New function. 3160 (Output_segment::first_section_load_address): Use first_section. 3161 * output.cc (Output_segment::first_section): New function extracted.. 3162 (Output_segment::first_section_load_address): ..from here. Delete. 3163 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs. 3164 * target.h (Sized_target::relocate_for_relocatable): Likewise. 3165 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and 3166 adjust call to target.h function. 3167 * i386.cc (Target_i386): Likewise. 3168 * sparc.cc (Target_sparc): Likewise. 3169 * x86_64.cc (Target_x86_64): Likewise. 3170 * powerpc.cc (Target_powerpc): Likewise. 3171 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure 3172 first tls section has section symbol for optimised local dynamic 3173 output relocs. 3174 (Target_powerpc::Relocate::relocate): Correct local dynamic value. 3175 (Target_powerpc::relocate_relocs): Adjust relocs emitted for 3176 optimised tls code. 3177 * testsuite/testfile.cc (Target_test::relocate_for_relocatable): 3178 Rename to relocate_relocs. Update error message. 3179 3180 2012-09-04 Andreas Schwab <schwab (a] linux-m68k.org> 3181 3182 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with 3183 --just-symbols. 3184 3185 2012-08-31 Alan Modra <amodra (a] gmail.com> 3186 3187 * powerpc.cc (Powerpc_relobj): Add and use Address typedef. 3188 (Powerpc_relobj::toc_base_offset): New stub function. 3189 (Target_powerpc): Add tp_offset, dtp_offset. Rename 3190 got_mod_index_offset to tlsld_got_offset. Update all refs. 3191 (Target_powerpc::Relocate::enum skip_tls): New. 3192 (Target_powerpc::call_tls_get_addr_): New var. 3193 (Target_powerpc::is_branch_reloc): Move to file scope. 3194 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete. 3195 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie): 3196 New functions. 3197 (Target_powerpc::enum Got_type): Delete old values, add new ones. 3198 (powerpc_info): Correct common_pagesize for ppc64. 3199 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions. 3200 (Powerpc_relocate_functions): Add overflow check enums and functions. 3201 Add non-shift version of rela, rela_ua. Delete all rel public 3202 functions. Delete addr16_lo. Add addr64, addr64_u, addr32, 3203 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3, 3204 addr16_ha3, addr14 functions. 3205 (Output_data_got_powerpc::add_constant_pair): New function. 3206 (Output_data_got_powerpc::got_base_offset): Likewise. 3207 (Output_data_got_powerpc::do_write): Correct 64-bit got header. 3208 (instruction constants): Sort, add some more. 3209 (Output_data_glink::do_write): Add and use Address typedef. Use 3210 object->toc_base_offset() stub for 64-bit. 3211 (Target_powerpc::tlsld_got_offset): Use add_constant_pair. 3212 (Target_powerpc::Scan::get_reference_flags): Handle more relocs. 3213 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc 3214 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS. 3215 Always treat .opd relocs as against locally defined symbol. 3216 Correct condition for RELATIVE relocs. 3217 (Target_powerpc::do_finalize_sections): Test for NULL sections. 3218 (Target_powerpc::Relocate::relocate): Use plt call stub as value 3219 for 32-bit syms with a plt entry. Correct ppc64 toc base 3220 calculations. Handle TLS relocs, and more. Add overflow 3221 checking and adjust for Powerpc_relocate_functions changes. 3222 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym. 3223 Reinstate --emit-relocs code with FIXME. 3224 3225 2012-08-30 Alan Modra <amodra (a] gmail.com> 3226 3227 * layout.cc (Layout::set_segment_offsets): Set p_align to 3228 abi_pagesize, not common_pagesize. 3229 (Layout::relaxation_loop_body): Similarly use abi_pagesize 3230 to determine whether file header can go in segment. 3231 3232 2012-08-30 Alan Modra <amodra (a] gmail.com> 3233 3234 * output.h (Output_reloc::Output_reloc <output section>): Add 3235 is_relative param. Adjust calls. 3236 (Output_reloc::add_output_section_relative): New functions. 3237 * output.cc (Output_reloc::Output_reloc <output section>): Handle 3238 is_relative. 3239 (Output_reloc::symbol_value): Handle SECTION_CODE. 3240 3241 2012-08-24 Sriraman Tallam <tmsriram (a] google.com> 3242 3243 * gold.cc (queue_middle_tasks): Call layout again when unique 3244 segments for sections is desired. 3245 * layout.cc (Layout::Layout): Initialize new members. 3246 (Layout::get_output_section_flags): New function. 3247 (Layout::choose_output_section): Call get_output_section_flags. 3248 (Layout::layout): Make output section for mapping to a unique segment. 3249 (Layout::insert_section_segment_map): New function. 3250 (Layout::attach_allocated_section_to_segment): Make unique segment for 3251 output sections marked so. 3252 (Layout::segment_precedes): Check for unique segments when sorting. 3253 * layout.h (Layout::Unique_segment_info): New struct. 3254 (Layout::Section_segment_map): New typedef. 3255 (Layout::insert_section_segment_map): New function. 3256 (Layout::get_output_section_flags): New function. 3257 (Layout::is_unique_segment_for_sections_specified): New function. 3258 (Layout::set_unique_segment_for_sections_specified): New function. 3259 (Layout::unique_segment_for_sections_specified_): New member. 3260 (Layout::section_segment_map_): New member. 3261 * object.cc (Sized_relobj_file<size, big_endian>::do_layout): 3262 Rename is_gc_pass_one to is_pass_one. 3263 Rename is_gc_pass_two to is_pass_two. 3264 Rename is_gc_or_icf to is_two_pass. 3265 Check for which pass based on whether symbols data is present. 3266 Make it two pass when unique segments for sections is desired. 3267 * output.cc (Output_section::Output_section): Initialize new 3268 members. 3269 * output.h (Output_section::is_unique_segment): New function. 3270 (Output_section::set_is_unique_segment): New function. 3271 (Output_section::is_unique_segment_): New member. 3272 (Output_section::extra_segment_flags): New function. 3273 (Output_section::set_extra_segment_flags): New function. 3274 (Output_section::extra_segment_flags_): New member. 3275 (Output_section::segment_alignment): New function. 3276 (Output_section::set_segment_alignment): New function. 3277 (Output_section::segment_alignment_): New member. 3278 (Output_segment::Output_segment): Initialize is_unique_segment_. 3279 (Output_segment::is_unique_segment): New function. 3280 (Output_segment::set_is_unique_segment): New function. 3281 (Output_segment::is_unique_segment_): New member. 3282 * plugin.cc (allow_unique_segment_for_sections): New function. 3283 (unique_segment_for_sections): New function. 3284 (Plugin::load): Add new functions to transfer vector. 3285 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output. 3286 * Makefile.in: Regenerate. 3287 * testsuite/plugin_final_layout.sh: Check if unique segment 3288 functionality works. 3289 * testsuite/plugin_section_order.c (onload): Check if new interfaces 3290 are available. 3291 (allow_unique_segment_for_sections): New global. 3292 (unique_segment_for_sections): New global. 3293 (claim_file_hook): Call allow_unique_segment_for_sections. 3294 (all_symbols_read_hook): Call unique_segment_for_sections. 3295 3296 2012-08-22 Cary Coutant <ccoutant (a] google.com> 3297 3298 * layout.cc (Layout::include_section): Don't assert on GROUP 3299 sections with --emit-relocs. 3300 3301 2012-08-21 Cary Coutant <ccoutant (a] google.com> 3302 3303 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert 3304 if --export-dynamic-symbol names an undef symbol. 3305 3306 2012-08-18 Alan Modra <amodra (a] gmail.com> 3307 3308 * powerpc.cc: Formatting and white space. 3309 (Powerpc_relobj): Rename got2_section_ to special_. 3310 Add opd_ent_shndx_ and opd_ent_off_ vectors. 3311 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent, 3312 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions. 3313 (Target_powerpc): Add Address typedef and invalid_address. Use 3314 throughout. 3315 (Target_powerpc::is_branch_reloc): New function. 3316 (Powerpc_relocate_functions): Add Address typedef, use throughout. 3317 (Powerpc_relocate_functions:rela, rela_ua): Correct type used 3318 for dst_mask, value and addend. 3319 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit. 3320 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants. 3321 (Output_data_glink::do_write): Correct toc base. Don't try to use 3322 uint16_t for 24-bit offset. Use get_output_section_offset and 3323 check return. 3324 (Target_powerpc::Scan::local): Handle more relocs. 3325 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK. 3326 (Target_powerpc::Relocate::relocate): Correct toc base calculation. 3327 Plug in toc restoring insn after plt calls. Translate branches 3328 to function descriptor symbols to corresponding entry point. 3329 (Target_powerpc::relocate_for_relocatable): Check return from 3330 get_output_section_offset. 3331 * symtab.h: Comment typo. 3332 3333 2012-08-14 Ian Lance Taylor <iant (a] google.com> 3334 3335 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to 3336 unsupported_relocal_local to call unsupported_reloc_global. 3337 3338 2012-08-14 Nick Clifton <nickc (a] redhat.com> 3339 3340 PR ld/14265 3341 * script-sections.cc (Sections_element::output_section_name): Add 3342 keep return parameter. 3343 (Output_section_element::match_name): Add keep return parameter. 3344 Return the value of the keep_ member. 3345 * script-sections.h (class Output_section): Update 3346 output_section_name prototype. 3347 * layout.cc (Layout::keep_input_section): New public member 3348 function. 3349 (Layout::choose_output_section): Pass keep parameter to 3350 output_section_name. 3351 * layout.h (class Layout): Add keep_input_section. 3352 * object.cc (Sized_relobj_file::do_layout): Check for kept input 3353 sections. 3354 * testsuite/Makefile.am: Add a test. 3355 * testsuite/Makefile.in: Regenerate. 3356 * testsuite/pr14265.c: Source file for the test. 3357 * testsuite/pr14265.t: Linker script for the test. 3358 * testsuite/pr14265.sh: Shell script for the test. 3359 3360 2012-08-14 Alan Modra <amodra (a] gmail.com> 3361 3362 * target.h (Target::output_section_name): New function. 3363 (Target::do_output_section_name): New function. 3364 * layout.cc (Layout::choose_output_section): Call the above. 3365 * powerpc.cc (Target_powerpc::do_output_section_name): New function. 3366 3367 2012-08-14 Alan Modra <amodra (a] gmail.com> 3368 3369 * powerpc.cc: Update for renamed R_PPC_REL16 relocs. 3370 (Output_data_got_powerpc::do_write): Don't rely on base class lookup 3371 for replace_constant call. 3372 (Output_data_plt_powerpc::do_print_to_mapfile): New function. 3373 (Output_data_glink::do_print_to_mapfile): New function. 3374 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE. 3375 (Target_powerpc::Relocate::relocate): Likewise. 3376 3377 2012-08-14 Alan Modra <amodra (a] gmail.com> 3378 3379 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete. 3380 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx. 3381 (Output_data_glink::add_entry,find_entry): Remove shndx param. 3382 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove 3383 all references to shndx_. Handle special case for R_PPC_PLTREL24 3384 here. 3385 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash. 3386 (Output_data_glink::do_write): Retrieve got2_shdnx from object. 3387 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24 3388 here. 3389 (Target_powerpc::Scan::global): Nor on make_plt_entry call. 3390 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call. 3391 3392 2012-08-12 Alan Modra <amodra (a] gmail.com> 3393 3394 * powerpc.cc: Whitespace fixes. Wrap overly long lines. 3395 (glink insn constants): Use uint32_t. 3396 (Output_data_glink::add_entry): Use insert, not [] operator. 3397 3398 2012-08-11 Alan Modra <amodra (a] gmail.com> 3399 3400 * object.h (Sized_relobj_file::find_shdr): New function. 3401 (Sized_relobj_file::find_special_sections): New function. 3402 * object.cc (Sized_relobj_file::find_shdr): New function. 3403 (Sized_relobj_file::find_eh_frame): Use find_shdr. 3404 (Sized_relobj_file::find_special_sections): New function, split out.. 3405 (Sized_relobj_file::do_read_symbols): ..from here. 3406 * output.h (Output_data_got::replace_constant): New function. 3407 (Output_data_got::num_entries): New function. 3408 (Output_data_got::last_got_offset,set_got_size): Use num_entries. 3409 (Output_data_got::got_offset): Protected rather than private. 3410 (Output_data_got::replace_got_entry): New function. 3411 * output.cc (Output_data_got::replace_got_entry): New function. 3412 * powerpc.cc (class Powerpc_relobj): New. 3413 (class Powerpc_relocate_functions): Delete all psymval variants or 3414 convert to value,addend type. Delete pcrela, pcrela_unaligned. 3415 Implement _ha functions using corresponding _hi function. 3416 (Powerpc_relobj::find_special_sections): New function. 3417 (Target_powerpc::do_make_elf_object): New function. 3418 (class Output_data_got_powerpc): New. 3419 (class Output_data_glink): New. 3420 (class Powerpc_scan_relocatable_reloc): New. 3421 Many more changes througout file. 3422 3423 2012-08-09 Nick Clifton <nickc (a] redhat.com> 3424 3425 * po/vi.po: Updated Vietnamese translation. 3426 3427 2012-08-07 Ian Lance Taylor <iant (a] google.com> 3428 3429 * layout.cc (Layout::add_target_dynamic_tags): If 3430 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for 3431 plt_rel. 3432 3433 2012-07-30 Nick Clifton <nickc (a] redhat.com> 3434 3435 * po/gold.pot: Updated template. 3436 * po/es.po: Updated Spanish translation. 3437 3438 2012-07-18 Cary Coutant <ccoutant (a] google.com> 3439 3440 PR gold/14344 3441 * configure.ac: Add check for -gpubnames support. 3442 * configure: Regenerate. 3443 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames 3444 support; force -gno-pubnames. 3445 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames 3446 support. 3447 (gdb_index_test_4): New test. 3448 * testsuite/Makefile.in: Regenerate. 3449 * testsuite/gdb_index_test_1.sh: Refactor code into common file. 3450 * testsuite/gdb_index_test_2.sh: Likewise. 3451 * testsuite/gdb_index_test_3.sh: Don't look for space after colon. 3452 * testsuite/gdb_index_test_4.sh: New script. 3453 * testsuite/gdb_index_test_comm.sh: New script with common code; 3454 don't look for space after colon. 3455 3456 2012-07-16 Sriraman Tallam <tmsriram (a] google.com> 3457 3458 * gold.cc (queue_middle_tasks): Update function order only after 3459 deferred objects due to plugins are processed. 3460 3461 2012-07-11 Ian Lance Taylor <iant (a] google.com> 3462 3463 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef. 3464 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise. 3465 (Target_arm::scan_reloc_for_stub): Likewise. 3466 * common.cc (Symbol_table::do_allocate_commons_list): Likewise. 3467 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise. 3468 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise. 3469 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise. 3470 * powerpc.cc (Target_powerpc::relocate_tls): Likewise. 3471 3472 2012-07-10 Dodji Seketeli <dodji (a] redhat.com> 3473 Ian Lance Taylor <iant (a] google.com> 3474 3475 PR gold/14309 3476 * configure.ac: Test whether std::tr1::hash<off_t> works. 3477 * gold.h: Add a specialization for std::tr1::hash<off_t> if 3478 needed. 3479 * output.h (class Output_fill): Add virtual destructor. 3480 * configure, config.in: Rebuild. 3481 3482 2012-06-22 Roland McGrath <mcgrathr (a] google.com> 3483 3484 * layout.cc (finalize): Define __ehdr_start symbol if applicable. 3485 3486 2012-06-12 Rafael vila de Espndola <respindola (a] mozilla.com> 3487 3488 * plugin.cc (Plugin::load): Handle position independent executables. 3489 3490 2012-06-06 Cary Coutant <ccoutant (a] google.com> 3491 3492 * layout.cc (gdb_sections): Remove ".debug_" prefixes, 3493 add .debug_macro. 3494 (lines_only_debug_sections): Likewise. 3495 (gdb_fast_lookup_sections): New static array. 3496 (is_gdb_debug_section): Rename formal parameter. 3497 (is_lines_only_debug_section): Likewise. 3498 (is_gdb_fast_lookup_section): New function. 3499 (Layout::include_section): Check for ".zdebug_" prefix; pass 3500 section name suffix to is_gdb_debug_section, et al.; check for 3501 fast-lookup sections when building .gdb_index. 3502 * options.h (--strip-debug-gdb): Update GDB version number. 3503 3504 2012-06-06 Cary Coutant <ccoutant (a] google.com> 3505 3506 * configure.ac: Add check for fallocate. 3507 * configure: Regenerate. 3508 * config.in: Regenerate. 3509 3510 * options.h (class General_options): Add --mmap-output-file and 3511 --posix-fallocate options. 3512 * output.cc: (posix_fallocate): Remove; replace with... 3513 (gold_fallocate): New function. 3514 (Output_file::map_no_anonymous): Call gold_fallocate. 3515 (Output_file::map): Check --mmap-output-file option. 3516 3517 2012-06-05 Jing Yu <jingyu (a] google.com> 3518 3519 * gold.h (textdomain): Add do {} to empty while(0). 3520 (bindtextdomain): Likewise. 3521 3522 2012-06-04 Cary Coutant <ccoutant (a] google.com> 3523 3524 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call 3525 has_dynsym_index. 3526 3527 2012-05-25 Sriraman Tallam <tmsriram (a] google.com> 3528 3529 * symtab.cc (Symbol_table::define_special_symbol): 3530 Initialize *poldsym to prevent uninitialized variable errors. 3531 3532 2012-05-23 Cary Coutant <ccoutant (a] google.com> 3533 3534 * layout.cc (Layout::section_name_mapping): Add rules to handle 3535 exact match on .data.rel.ro.local or .data.rel.ro. 3536 (Layout::output_section_name): Check for exact matches. 3537 3538 2012-05-23 Cary Coutant <ccoutant (a] google.com> 3539 3540 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.* 3541 more carefully. 3542 3543 2012-05-22 Cary Coutant <ccoutant (a] google.com> 3544 3545 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable 3546 object before exporting symbol. 3547 3548 2012-05-21 H.J. Lu <hongjiu.lu (a] intel.com> 3549 3550 * testsuite/tls_test.cc: Include "config.h" first. 3551 * testsuite/tls_test_c.c: Likewise. 3552 3553 2012-05-17 Daniel Richard G. <skunk (a] iskunk.org> 3554 Nick Clifton <nickc (a] redhat.com> 3555 3556 PR 14072 3557 * configure.in: Add check that sysdep.h has been included before 3558 any system header files. 3559 * configure: Regenerate. 3560 * config.in: Regenerate. 3561 3562 2012-05-14 Cary Coutant <ccoutant (a] google.com> 3563 3564 * layout.cc (Layout::make_output_section): Mark .tdata section 3565 as RELRO. 3566 * testsuite/relro_test.cc: Add a TLS variable. 3567 3568 2012-05-10 H.J. Lu <hongjiu.lu (a] intel.com> 3569 3570 PR gold/14091 3571 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate 3572 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of 3573 R_X86_64_64. 3574 3575 2012-05-08 Cary Coutant <ccoutant (a] google.com> 3576 3577 * layout.cc (gdb_sections): Update GDB version, add .debug_addr. 3578 (lines_only_debug_sections): Likewise. 3579 3580 2012-05-02 Roland McGrath <mcgrathr (a] google.com> 3581 3582 * nacl.cc: New file. 3583 * nacl.h: New file. 3584 * Makefile.am (CCFILES, HFILES): Add them. 3585 * Makefile.in: Regenerate. 3586 * i386.cc (Output_data_plt_i386_nacl): New class. 3587 (Output_data_plt_i386_nacl_exec): New class. 3588 (Output_data_plt_i386_nacl_dyn): New class. 3589 (Target_i386_nacl): New class. 3590 (Target_selector_i386_nacl): New class. 3591 (target_selector_i386): Use it instead of Target_selector_i386. 3592 * x86_64.cc (Output_data_plt_x86_64_nacl): New class. 3593 (Target_x86_64_nacl): New class. 3594 (Target_selector_x86_64_nacl): New class. 3595 (target_selector_x86_64, target_selector_x32): Use it instead of 3596 Target_selector_x86_64. 3597 * arm.cc (Output_data_plt_arm_nacl): New class. 3598 (Target_arm_nacl): New class. 3599 (Target_selector_arm_nacl): New class. 3600 (target_selector_arm, target_selector_armbe): Use it instead of 3601 Target_selector_arm. 3602 3603 * target-select.cc (select_target): Take new Input_file* and off_t 3604 arguments, pass them on to recognize method of selector. 3605 * object.cc (make_elf_sized_object): Update caller. 3606 * parameters.cc (parameters_force_valid_target): Likewise. 3607 * incremental.cc (make_sized_incremental_binary): Likewise. 3608 * target-select.h: Update decl. 3609 (Target_selector::recognize): Take new Input_file* argument, 3610 pass it on to do_recognize. 3611 (Target_selector::do_recognize): Take new Input_file* argument. 3612 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise. 3613 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise. 3614 * sparc.cc (Target_selector_sparc::do_recognize): Likewise. 3615 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise. 3616 3617 * target.h (Target::Target_info): New members isolate_execinstr 3618 and rosegment_gap. 3619 (Target::isolate_execinstr, Target::rosegment_gap): New methods. 3620 * arm.cc (Target_arm::arm_info): Update initializer. 3621 * i386.cc (Target_i386::i386_info): Likewise. 3622 * powerpc.cc (Target_powerpc::powerpc_info): Likewise. 3623 * sparc.cc (Target_sparc::sparc_info): Likewise. 3624 * x86_64.cc (Target_x86_64::x86_64_info): Likewise. 3625 * testsuite/testfile.cc (Target_test::test_target_info): Likewise. 3626 * layout.cc (Layout::attach_allocated_section_to_segment): 3627 Take new const Target* argument. If target->isolate_execinstr(), act 3628 like --rosegment. 3629 (Layout::find_first_load_seg): Take new const Target* argument; 3630 if target->isolate_execinstr(), reject PF_X segments. 3631 (Layout::relaxation_loop_body): Update caller. 3632 (Layout::set_segment_offsets): If target->isolate_execinstr(), 3633 reset file offset to zero when we hit LOAD_SEG, and then do a second 3634 loop over the segments before LOAD_SEG to reassign offsets after 3635 addresses have been determined. Handle target->rosegment_gap(). 3636 (Layout::attach_section_to_segment): Take new const Target* argument; 3637 pass it to attach_allocated_section_to_segment. 3638 (Layout::make_output_section): Update caller. 3639 (Layout::attach_sections_to_segments): Take new const Target* argument; 3640 pass it to attach_section_to_segment. 3641 * gold.cc (queue_middle_tasks): Update caller. 3642 * layout.h (Layout): Update method decls with new arguments. 3643 3644 * arm.cc (Target_arm::Target_arm): Take optional argument for the 3645 Target_info pointer to use. 3646 (Target_arm::do_make_data_plt): New virtual method. 3647 (Target_arm::make_data_plt): New method that calls it. 3648 (Target_arm::make_plt_entry): Use it. 3649 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument 3650 for the section alignment. 3651 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual 3652 method. 3653 (Output_data_plt_arm::first_plt_entry_offset): Call it. 3654 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual 3655 method. 3656 (Output_data_plt_arm::get_plt_entry_size): Call it. 3657 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method. 3658 (Output_data_plt_arm::fill_plt_entry): New method that calls it. 3659 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual 3660 method. 3661 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it. 3662 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size 3663 method instead of sizeof(plt_entry). 3664 (Output_data_plt_arm::add_entry): Likewise. 3665 Use first_plt_entry_offset method instead of sizeof(first_plt_entry). 3666 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather 3667 than static method. 3668 (Target_arm::plt_entry_size): Likewise. 3669 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry): 3670 Move to ... 3671 (Output_data_plt_arm_standard): ... here, new class. 3672 (Output_data_plt_arm::do_write): Move guts of PLT filling to... 3673 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ... 3674 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here. 3675 3676 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64): 3677 Take additional argument for the PLT entry size. 3678 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): 3679 Use get_plt_entry_size method rather than plt_entry_size variable. 3680 (Output_data_plt_x86_64::reserve_slot): Likewise. 3681 (Output_data_plt_x86_64::do_adjust_output_section): Likewise. 3682 (Output_data_plt_x86_64::add_entry): Likewise. 3683 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise. 3684 (Output_data_plt_x86_64::address_for_global): Likewise. 3685 (Output_data_plt_x86_64::address_for_local): Likewise. 3686 (Output_data_plt_x86_64::set_final_data_size): Likewise. 3687 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise. 3688 Make method non-static. 3689 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual 3690 method. 3691 (Output_data_plt_x86_64::get_plt_entry_size): Just call that. 3692 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method. 3693 (Output_data_plt_x86_64::add_eh_frame): New method to call it. 3694 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract 3695 virtual method. 3696 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it. 3697 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract 3698 virtual method. 3699 (Output_data_plt_x86_64::fill_plt_entry): New method to call it. 3700 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract 3701 virtual method. 3702 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it. 3703 (Output_data_plt_x86_64::plt_entry_size) 3704 (Output_data_plt_x86_64::first_plt_entry) 3705 (Output_data_plt_x86_64::plt_entry) 3706 (Output_data_plt_x86_64::tlsdesc_plt_entry) 3707 (Output_data_plt_x86_64::plt_eh_frame_fde_size) 3708 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ... 3709 (Output_data_plt_x86_64_standard): ... here, new class. 3710 (Target_x86_64::Target_x86_64): Take optional argument for the 3711 Target_info pointer to use. 3712 (Target_x86_64::do_make_data_plt): New virtual method. 3713 (Target_x86_64::make_data_plt): New method to call it. 3714 (Target_x86_64::init_got_plt_for_update): Use that. 3715 Call this->plt_->add_eh_frame method here. 3716 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here. 3717 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_ 3718 rather than static method. 3719 (Target_x86_64::plt_entry_size): Likewise. 3720 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method 3721 rather than plt_entry_size variable. Move guts of PLT filling to... 3722 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ... 3723 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ... 3724 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here. 3725 3726 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take 3727 additional argument for the section alignment. 3728 Don't do add_eh_frame_for_plt here. 3729 (Output_data_plt_i386::first_plt_entry_offset): Make the method 3730 non-static. Use get_plt_entry_size method rather than plt_entry_size 3731 variable. 3732 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual 3733 method. 3734 (Output_data_plt_i386::get_plt_entry_size): Call it. 3735 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method. 3736 (Output_data_plt_i386::add_eh_frame): New method to call it. 3737 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual 3738 method. 3739 (Output_data_plt_i386::fill_first_plt_entry): New method to call it. 3740 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual 3741 method. 3742 (Output_data_plt_i386::fill_plt_entry): New method to call it. 3743 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size 3744 method instead of plt_entry_size. 3745 (Output_data_plt_i386::plt_entry_size) 3746 (Output_data_plt_i386::plt_eh_frame_fde_size) 3747 (Output_data_plt_i386::plt_eh_frame_fde): Move to ... 3748 (Output_data_plt_i386_standard): ... here, new class. 3749 (Output_data_plt_i386_exec): New class. 3750 (Output_data_plt_i386::exec_first_plt_entry): Move to ... 3751 (Output_data_plt_i386_exec::first_plt_entry): ... here. 3752 (Output_data_plt_i386::exec_plt_entry): Move to ... 3753 (Output_data_plt_i386_exec::plt_entry): ... here. 3754 (Output_data_plt_i386_dyn): New class. 3755 (Output_data_plt_i386::first_plt_entry): Move to ... 3756 (Output_data_plt_i386_dyn::first_plt_entry): ... here. 3757 (Output_data_plt_i386::dyn_plt_entry): Move to ... 3758 (Output_data_plt_i386_dyn::plt_entry): ... here. 3759 (Target_i386::Target_i386): Take optional argument for the Target_info 3760 pointer to use. 3761 (Target_i386::do_make_data_plt): New virtual method. 3762 (Target_i386::make_data_plt): New method to call it. 3763 (Target_i386::make_plt_section): Use that. 3764 Call this->plt_->add_eh_frame method here. 3765 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method 3766 rather than plt_entry_size variable. 3767 (Output_data_plt_i386::add_local_ifunc_entry): Likewise. 3768 (Output_data_plt_i386::address_for_local): Likewise. 3769 (Output_data_plt_i386::do_write): Likewise. 3770 Move guts of PLT filling to... 3771 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ... 3772 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ... 3773 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ... 3774 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here. 3775 3776 2012-05-01 Cary Coutant <ccoutant (a] google.com> 3777 3778 * dwarf_reader.cc (Dwarf_die::read_attributes) 3779 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute) 3780 (Dwarf_die::uint_attribute): Remove DW_FORM_null. 3781 * reduced_debug_output.cc 3782 (Output_reduced_debug_info_section::get_die_end): Remove 3783 DW_FORM_GNU_ref_index. Add default case. 3784 3785 2012-04-26 Mark Wielaard <mjw (a] redhat.com> 3786 3787 * dwarf_reader.cc (Dwarf_die::address_attribute): New function. 3788 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise. 3789 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle 3790 DW_AT_high_pc as offset from DW_AT_low_pc. 3791 3792 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case. 3793 * testsuite/Makefile.in: Regenerate. 3794 * testsuite/gdb_index_test_3.c: New test source file. 3795 * testsuite/gdb_index_test_3.sh: New test source file. 3796 3797 2012-04-25 Ian Lance Taylor <iant (a] google.com> 3798 3799 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const 3800 pointer. 3801 (Stub_addend_reader::operator()): Declare Arm_relocate_functions 3802 as a class, not a struct. 3803 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise. 3804 (Target_arm::apply_cortex_a8_workaround): Likewise. 3805 * gc.h: Declare Reloc_types as a struct, not a class. 3806 * object.h: Declare Symbols_data as a struct. 3807 * reloc.h: Declare Read_relocs_data as a struct. 3808 * target.h: Declare Relocate_info as a struct. 3809 3810 2012-04-24 David S. Miller <davem (a] davemloft.net> 3811 3812 * sparc.cc (Target_sparc::Relocate::relax_call): New function. 3813 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30 3814 and R_SPARC_WPLT30. 3815 3816 2012-04-24 Cary Coutant <ccoutant (a] google.com> 3817 3818 * incremental-dump.cc (find_input_containing_global): Replace 3819 magic number with symbolic constant. 3820 (dump_incremental_inputs): Update version number. 3821 * incremental.cc (Output_section_incremental_inputs): Update version 3822 number; import symbolic constants from Incremental_inputs_reader. 3823 (Incremental_inputs::create_data_sections): Align relocations 3824 section correctly for 64-bit targets. 3825 (Output_section_incremental_inputs::set_final_data_size): Use symbolic 3826 constants; add padding. 3827 (Output_section_incremental_inputs::write_header): Add assert for 3828 header_size. 3829 (Output_section_incremental_inputs::write_input_files): Add assert 3830 for input_entry_size. 3831 (Output_section_incremental_inputs::write_info_blocks): Add padding; 3832 add assert for object_info_size, input_section_entry_size, 3833 global_sym_entry_size. 3834 * incremental.h (Incremental_inputs_reader): Add symbolic constants 3835 for data structure sizes; use them. 3836 (Incremental_input_entry_reader): Import symbolic constants from 3837 Incremental_inputs_reader; use them. 3838 3839 2012-04-23 David S. Miller <davem (a] davemloft.net> 3840 3841 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_, 3842 and elf_flags_set_. 3843 (Target_sparc::Target_sparc): Initialize new fields. 3844 (Target_sparc::do_make_elf_object): New function. 3845 (Target_sparc::do_adjust_elf_header): New function. 3846 3847 2012-04-23 Cary Coutant <ccoutant (a] google.com> 3848 3849 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing 3850 CU range table of gdb index. 3851 3852 2012-04-20 David S. Miller <davem (a] davemloft.net> 3853 3854 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian 3855 instead of false. 3856 3857 2012-04-16 David S. Miller <davem (a] davemloft.net> 3858 3859 * sparc.cc (Target_sparc::got_address): New function. 3860 (Sparc_relocate_functions::gdop_hix22): New function. 3861 (Sparc_relocate_functions::gdop_lox10): New function. 3862 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA 3863 relocs. 3864 (Target_sparc::Scan::local): Likewise if the global symbol is not 3865 preemptible and is not IFUNC. 3866 (Target_sparc::Relocate::relocate): Perform GOTDATA code 3867 transformations for local and non-preemptible non-IFUNC global 3868 symbols. 3869 3870 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when 3871 writing out 64-bit part of ranges. 3872 3873 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of 3874 -fpic and -fpie respectively. 3875 * Makefile.in: Regenerate. 3876 3877 * sparc.cc (class Target_sparc): Add rela_ifunc_. 3878 (Target_sparc::Target_sparc): Initialize new field. 3879 (Target_sparc::do_plt_section_for_global): New function. 3880 (Target_sparc::do_plt_section_for_local): New function. 3881 (Target_sparc::reloc_needs_plt_for_ifunc): New function. 3882 (Target_sparc::make_plt_section): New function, broken out of 3883 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt". 3884 (Target_sparc::make_plt_entry): Call make_plt_section. 3885 (Target_sparc::make_local_ifunc_plt_entry): New function. 3886 (Target_sparc::rela_ifunc_section): New function. 3887 (Target_sparc::plt_section): Remove const. 3888 (Output_data_plt_sparc): Update declarations. Define Global_ifunc 3889 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_, 3890 and ifunc_count_ fields. 3891 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields. 3892 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols. 3893 (Output_data_plt_sparc::add_local_ifunc_entry): New function. 3894 (Output_data_plt_sparc::rela_ifunc): New function. 3895 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function. 3896 (Output_data_plt_sparc::has_ifunc_section): New function. 3897 (Output_data_plt_sparc::entry_count): Include ifunc_count_. 3898 (Output_data_plt_sparc::address_for_global): New function. 3899 (Output_data_plt_sparc::address_for_local): New function. 3900 (Output_data_plt_sparc::plt_index_to_offset): New function. 3901 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset 3902 and entry_count. 3903 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and 3904 entry_count. 3905 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and 3906 R_SPARC_JMP_IREL to switch. 3907 (Target_sparc::Scan::check_non_pic): Likewise. 3908 (Target_sparc::Scan::local): Handle IFUNC symbols. 3909 (Target_sparc::Scan::local): Likewise. 3910 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global 3911 and plt_address_for_local. 3912 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs. 3913 Define __rel_iplt_start and __rel_iplt_end if doing a static link. 3914 3915 * output.h (Output_reloc): Allow use_plt_offset for global relocs too. 3916 (class Output_data_reloc): Adjust calls to Output_reloc_type. 3917 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset. 3918 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for 3919 global relocs too. 3920 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols. 3921 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative 3922 calls. 3923 * sparc.cc (Target_sparc::Scan::global): Likewise. 3924 * x86_64.cc (Target_x86_64::Scan::global): Likewise. 3925 3926 2012-04-16 Cary Coutant <ccoutant (a] google.com> 3927 3928 * archive.cc (Library_base::should_include_member): Check for 3929 --export-dynamic-symbol. 3930 * options.h (class General_options): Add --export-dynamic-symbol. 3931 * symtab.cc (Symbol::should_add_dynsym_entry): Check for 3932 --export-dynamic-symbol. 3933 (Symbol_table::gc_mark_undef_symbols): Likewise. 3934 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise. 3935 3936 2012-04-12 David S. Miller <davem (a] davemloft.net> 3937 3938 * sparc.cc (Reloc::wdisp10): New relocation method. 3939 (Reloc::h34): Likewise. 3940 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34. 3941 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and 3942 R_SPARC_WDISP10. 3943 (Target_sparc::Scan::local): Likewise. 3944 (Target_sparc::Scan::global): Likewise. 3945 (Target_sparc::Relocate::relocate): Likewise. 3946 3947 2012-04-09 Cary Coutant <ccoutant (a] google.com> 3948 3949 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow 3950 low_pc == 0. 3951 3952 2012-04-06 Ian Lance Taylor <iant (a] google.com> 3953 3954 * timer.cc: #include <unistd.h>. 3955 3956 2012-04-06 Roland McGrath <mcgrathr (a] google.com> 3957 3958 * configure.in (AC_CHECK_HEADERS): Add locale.h. 3959 * config.in: Regenerate. 3960 * configure: Regenerate. 3961 3962 2012-04-05 Nick Clifton <nickc (a] redhat.com> 3963 3964 * configure.ac (AC_CHECK_FUNCS): Add setlocale. 3965 (AM_LC_MESSAGES): Add. 3966 * aclocal.m4: Regenerate. 3967 * config.in: Regenerate. 3968 * configure: Regenerate. 3969 3970 2012-03-21 Cary Coutant <ccoutant (a] google.com> 3971 3972 * Makefile.am: Add gdb-index.cc, gdb-index.h. 3973 * Makefile.in: Regenerate. 3974 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function. 3975 (Sized_elf_reloc_mapper::symbol_section): New function. 3976 (Sized_elf_reloc_mapper::do_get_reloc_target): New function. 3977 (make_elf_reloc_mapper): New function. 3978 (Dwarf_abbrev_table::clear_abbrev_codes): New function. 3979 (Dwarf_abbrev_table::do_read_abbrevs): New function. 3980 (Dwarf_abbrev_table::do_get_abbrev): New function. 3981 (Dwarf_ranges_table::read_ranges_table): New function. 3982 (Dwarf_ranges_table::read_range_list): New function. 3983 (Dwarf_pubnames_table::read_section): New function. 3984 (Dwarf_pubnames_table::read_header): New function. 3985 (Dwarf_pubnames_table::next_name): New function. 3986 (Dwarf_die::Dwarf_die): New function. 3987 (Dwarf_die::read_attributes): New function. 3988 (Dwarf_die::skip_attributes): New function. 3989 (Dwarf_die::set_name): New function. 3990 (Dwarf_die::set_linkage_name): New function. 3991 (Dwarf_die::attribute): New function. 3992 (Dwarf_die::string_attribute): New function. 3993 (Dwarf_die::int_attribute): New function. 3994 (Dwarf_die::uint_attribute): New function. 3995 (Dwarf_die::ref_attribute): New function. 3996 (Dwarf_die::child_offset): New function. 3997 (Dwarf_die::sibling_offset): New function. 3998 (Dwarf_info_reader::check_buffer): New function. 3999 (Dwarf_info_reader::parse): New function. 4000 (Dwarf_info_reader::do_parse): New function. 4001 (Dwarf_info_reader::do_read_string_table): New function. 4002 (Dwarf_info_reader::lookup_reloc): New function. 4003 (Dwarf_info_reader::get_string): New function. 4004 (Dwarf_info_reader::visit_compilation_unit): New function. 4005 (Dwarf_info_reader::visit_type_unit): New function. 4006 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use 4007 Sized_elf_reloc_mapper. 4008 (Sized_dwarf_line_info::symbol_section): Remove function. 4009 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper. 4010 (Sized_dwarf_line_info::read_line_mappings): Remove object 4011 parameter, adjust callers. 4012 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast. 4013 * dwarf_reader.h: Include <sys/types.h>. 4014 (class Track_relocs): Remove forward declaration. 4015 (class Elf_reloc_mapper): New class. 4016 (class Sized_elf_reloc_mapper): New class. 4017 (class Dwarf_abbrev_table): New class. 4018 (class Dwarf_range_list): New class. 4019 (class Dwarf_ranges_table): New class. 4020 (class Dwarf_pubnames_table): New class. 4021 (class Dwarf_die): New class. 4022 (class Dwarf_info_reader): New class. 4023 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter. 4024 (Sized_dwarf_line_info::symbol_section): Remove member function. 4025 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from 4026 base class. 4027 * gdb-index.cc: New source file. 4028 * gdb-index.h: New source file. 4029 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info 4030 and .debug_types sections, call Layout::add_to_gdb_index. 4031 (Sized_relobj_incr::do_section_name): Implement. 4032 (Sized_relobj_incr::do_section_contents): Adjust parameter list and 4033 return type; Implement. 4034 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and 4035 return type. 4036 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust 4037 parameter list and return type. 4038 (Sized_incr_dynobj::do_section_contents): Likewise. 4039 * layout.cc: Include gdb-index.h. 4040 (Layout::Layout): Initialize gdb_index_data_. 4041 (Layout::init_fixed_output_section): Check for .gdb_index section. 4042 (Layout::add_to_gdb_index): New function. Instantiate. 4043 * layout.h: Add forward declaration for class Gdb_index. 4044 (Layout::add_to_gdb_index): New member function. 4045 (Layout::gdb_index_data_): New data member. 4046 * main.cc: Include gdb-index.h. 4047 (main): Print statistics for gdb index. 4048 * object.cc (Object::section_contents): Move code into 4049 do_section_contents. 4050 (need_decompressed_section): Check for sections needed when building 4051 gdb index. 4052 (build_compressed_section_map): Likewise. 4053 (Sized_relobj_file::do_read_symbols): Need local symbols when building 4054 gdb index. 4055 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types 4056 sections; call Layout::add_to_gdb_index. 4057 (Sized_relobj_file::do_decompressed_section_contents): Call 4058 do_section_contents directly. 4059 * object.h (Object::do_section_contents): Adjust parameter list and 4060 return type. 4061 (Object::do_decompressed_section_contents): Call do_section_contents 4062 directly. 4063 (Sized_relobj_file::do_section_contents): Adjust parameter list and 4064 return type. 4065 * options.h (class General_options): Add --gdb-index option. 4066 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter 4067 list and return type. 4068 * plugin.h (Sized_pluginobj::do_section_contents): Likewise. 4069 * reloc.h (Track_relocs::checkpoint): New function. 4070 (Track_relocs::reset): New function. 4071 4072 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh): 4073 New test cases. 4074 * testsuite/Makefile.in: Regenerate. 4075 * testsuite/gdb_index_test.cc: New test source file. 4076 * testsuite/gdb_index_test_1.sh: New test source file. 4077 * testsuite/gdb_index_test_2.sh: New test source file. 4078 4079 2012-03-19 Doug Kwan <dougkwan (a] google.com> 4080 4081 * arm.cc (Target_arm::do_define_standard_symbols): New method. 4082 (Target_arm::do_finalize_sections): Remove code which defines 4083 __exidx_start and __exidx_end. Make symbol table parameter 4084 anonymous as it is not used. 4085 * gold.cc (queue_middle_tasks): Call target hook to define any 4086 target-specific symbols. 4087 * target.h (Target::define_standard_symbols): New method. 4088 (Target::do_define_standard_symbols): Same. 4089 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also. 4090 * testsuite/Makefile.in: Regenerate. 4091 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start 4092 and __exidx_end. 4093 * testsuite/arm_exidx_test.sh: Check that no unused dynamic 4094 relocations are generated for __exidx_start and __exidx_end. 4095 4096 2012-03-16 Doug Kwan <dougkwan (a] google.com> 4097 4098 * testsuite/Makefile.am: Disable test initpri3b. 4099 * testsuite/Makefile.in: Regenerate. 4100 4101 2012-03-15 Doug Kwan <dougkwan (a] google.com> 4102 4103 * arm.cc (Target_arm::got_section): Make .got section read-only 4104 if -z now is given. 4105 4106 2012-03-15 Ian Lance Taylor <iant (a] google.com> 4107 4108 PR gold/13850 4109 * layout.cc (Layout::make_output_section): Correctly mark 4110 SHT_INIT_ARRAY, et. al., as relro. 4111 4112 2012-03-14 Doug Kwan <dougkwan (a] google.com> 4113 4114 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT 4115 dynamic relocations for protected symbols in shared objects. 4116 4117 2012-03-13 Ian Lance Taylor <iant (a] google.com> 4118 4119 * resolve.cc (Symbol_table::resolve): When merging common symbols, 4120 keep the larger alignment. 4121 4122 2012-03-12 Cary Coutant <ccoutant (a] google.com> 4123 4124 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix 4125 handling of DW_LNE_define_file. 4126 4127 2012-03-12 Cary Coutant <ccoutant (a] google.com> 4128 4129 * reduced_debug_output.cc 4130 (Output_reduced_debug_info_section::get_die_end): Add new FORM 4131 codes to switch. 4132 4133 2012-02-29 Cary Coutant <ccoutant (a] google.com> 4134 4135 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS. 4136 4137 2012-02-29 Cary Coutant <ccoutant (a] google.com> 4138 4139 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info): 4140 Call Object::decompressed_section_contents. 4141 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info): 4142 New dtor. 4143 (Sized_dwarf_line_info::buffer_start_): New data member. 4144 * merge.cc (Output_merge_data::do_add_input_section): Call 4145 Object::decompressed_section_contents. 4146 (Output_merge_string::do_add_input_section): Likewise. 4147 * object.cc (need_decompressed_section): New function. 4148 (build_compressed_section_map): Decompress sections needed later. 4149 (Sized_relobj_file::do_decompressed_section_contents): New function. 4150 (Sized_relobj_file::do_discard_decompressed_sections): New function. 4151 * object.h (Object::decompressed_section_contents): New function. 4152 (Object::discard_decompressed_sections): New function. 4153 (Object::do_decompressed_section_contents): New function. 4154 (Object::do_discard_decompressed_sections): New function. 4155 (Compressed_section_info): New type. 4156 (Compressed_section_map): Include decompressed section contents. 4157 (Sized_relobj_file::do_decompressed_section_contents): New function. 4158 (Sized_relobj_file::do_discard_decompressed_sections): New function. 4159 4160 2012-02-16 Cary Coutant <ccoutant (a] google.com> 4161 4162 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option. 4163 * testsuite/Makefile.in: Regenerate. 4164 4165 2012-02-14 Cary Coutant <ccoutant (a] google.com> 4166 4167 * options.cc (General_options::finalize): Disallow -pie and -static. 4168 4169 2012-02-03 Doug Kwan <dougkwan (a] google.com> 4170 4171 * arm.cc (Arm_relocate_functions::abs8, 4172 Arm_relocate_functions::abs16): Use 4173 Bits::has_signed_unsigned_overflow32. 4174 (Arm_relocate_functions::thm_abs8): Correct range of 4175 overflow check. 4176 * reloc.h (Bits class): Change minimum number of bits from 0 to 1 4177 in assertions. 4178 4179 2012-02-02 Doug Kwan <dougkwan (a] google.com> 4180 4181 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all 4182 position independent outputs, not just shared objects. 4183 4184 2012-01-30 H.J. Lu <hongjiu.lu (a] intel.com> 4185 4186 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works. 4187 * configure: Regenerated. 4188 4189 2012-01-27 Ian Lance Taylor <iant (a] google.com> 4190 4191 * reloc.h (Bits): New class with static functions, copied from 4192 namespace utils in arm.cc. 4193 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits 4194 instead. 4195 4196 2012-01-27 H.J. Lu <hongjiu.lu (a] intel.com> 4197 4198 * incremental.cc (write_info_blocks): Correct relocation offset. 4199 4200 2012-01-27 H.J. Lu <hongjiu.lu (a] intel.com> 4201 4202 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32. 4203 (Relocate::tls_gd_to_le): Likewise. 4204 4205 2012-01-27 H.J. Lu <hongjiu.lu (a] intel.com> 4206 4207 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer. 4208 4209 2012-01-27 H.J. Lu <hongjiu.lu (a] intel.com> 4210 4211 * configure.ac: Check if -mcmodel=medium works. 4212 * configure: Regenerated. 4213 4214 2012-01-24 Cary Coutant <ccoutant (a] google.com> 4215 4216 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline 4217 definition and ... 4218 (read_unsigned_LEB_128_x): ... this new function. 4219 (read_signed_LEB_128): Replaced with inline definition and ... 4220 (read_signed_LEB_128_x): ... this new function. 4221 * int_encoding.h (read_unsigned_LEB_128_x): New function. 4222 (read_unsigned_LEB_128): Add inline definition. 4223 (read_signed_LEB_128_x): New function. 4224 (read_signed_LEB_128): Add inline definition. 4225 * testsuite/Makefile.am (leb128_unittest): New unit test. 4226 * testsuite/Makefile.in: Regenerate. 4227 * testsuite/leb128_unittest.cc: New unit test. 4228 4229 2012-01-23 Ian Lance Taylor <iant (a] google.com> 4230 4231 PR gold/13617 4232 * i386.cc (Target_i386::do_code_fill): When using a jmp 4233 instruction, pad with nop instructions. 4234 * x86_64.cc (Target_x86_64::do_code_fill): Likewise. 4235 4236 2012-01-22 H.J. Lu <hongjiu.lu (a] intel.com> 4237 4238 * x86_64.cc (gc_process_relocs): Add typename on types used in 4239 template. 4240 (scan_relocs): Likewise. 4241 (relocate_section): Likewise. 4242 (apply_relocation): Likewise. 4243 4244 2012-01-10 H.J. Lu <hongjiu.lu (a] intel.com> 4245 4246 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32. 4247 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32 4248 under x32. 4249 4250 2012-01-09 H.J. Lu <hongjiu.lu (a] intel.com> 4251 4252 * x86_64.cc: Initial support for x32. 4253 4254 2012-01-03 Cary Coutant <ccoutant (a] google.com> 4255 4256 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt): 4257 Use abstract base class for GOT. 4258 * gold/output.h (class Output_data_got_base): New abstract base class. 4259 (class Output_data_got): Derive from new base class, adjust ctors. 4260 (Output_data_got::reserve_slot): Make virtual; rename to 4261 do_reserve_slot; Adjust callers. 4262 * gold/target.h (Sized_target::init_got_plt_for_update): Return 4263 pointer to abstract base class. 4264 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise. 4265 4266 2011-12-18 Ian Lance Taylor <iant (a] google.com> 4267 4268 * object.h (Relobj::local_symbol_value): New function. 4269 (Relobj::local_plt_offset): New function. 4270 (Relobj::local_has_got_offset): New function. 4271 (Relobj::local_got_offset): New function. 4272 (Relobj::set_local_got_offset): New function. 4273 (Relobj::do_local_symbol_value): New pure virtual function. 4274 (Relobj::do_local_plt_offset): Likewise. 4275 (Relobj::do_local_has_got_offset): Likewise. 4276 (Relobj::do_local_got_offset): Likewise. 4277 (Relobj::do_set_local_got_offset): Likewise. 4278 (Sized_relobj::do_local_has_got_offset): Rename from 4279 local_has_got_offset. 4280 (Sized_relobj::do_local_got_offset): Rename from local_got_offset. 4281 (Sized_relobj::do_set_local_got_offset): Rename from 4282 set_local_got_offset. 4283 (Sized_relobj_file::do_local_plt_offset): Rename from 4284 local_plt_offset. 4285 (Sized_relobj_file::do_local_symbol_value): New function. 4286 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from 4287 local_plt_offset. 4288 * output.cc (Output_data_got::Got_entry::write): Change object to 4289 Relobj. Use local_symbol_value. 4290 (Output_data_got::add_global_with_rel): Change rel_dyn to 4291 Output_data_reloc_generic*. Use add_global_generic. 4292 (Output_data_got::add_global_with_rela): Remove. Change all 4293 callers to use add_global_with_rel. 4294 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to 4295 Output_data_reloc_generic*. Use add_global_generic. 4296 (Output_data_got::add_global_pair_with_rela): Remove. Change all 4297 callers to use add_global_pair_with_rel. 4298 (Output_data_got::add_local): Change object to Relobj*. 4299 (Output_data_got::add_local_plt): Likewise. 4300 (Output_data_got::add_local_with_rel): Change object to Relobj*, 4301 change rel_dyn to Output_data_reloc_generic*. Use 4302 add_local_generic. 4303 (Output_data_got::add_local_with_rela): Remove. Change all 4304 callers to use all_local_with_rel. 4305 (Output_data_got::add_local_pair_with_rel): Change object to 4306 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use 4307 add_output_section_generic. 4308 (Output_data_got::add_local_pair_with_rela): Remove. Change all 4309 callers to use add_local_pair_with_rel. 4310 (Output_data_got::reserve_local): Change object to Relobj*. 4311 * output.h: (class Output_data_reloc_generic): Add pure virtual 4312 declarations for add_global_generic, add_local_generic, 4313 add_output_section_generic. 4314 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new 4315 functions for Output_data_reloc_generic. Update declarations for 4316 changes listed in output.cc. 4317 (class Output_data_got): Change template parameter to got_size. 4318 Don't define Rel_dyn or Rela_dyn. Update declarations per above. 4319 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New 4320 function. 4321 (Sized_relobj_incr::do_local_plt_offset): New function. 4322 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call 4323 add_global_generic. 4324 4325 2011-12-17 Cary Coutant <ccoutant (a] google.com> 4326 4327 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts. 4328 * resolve.cc (Symbol_table::resolve): Likewise. 4329 * i386.cc (Target_i386::do_code_fill): Use char constants for nop 4330 arrays. 4331 * x86_64.cc (Target_x86_64::do_code_fill): Likewise. 4332 4333 2011-12-16 Ian Lance Taylor <iant (a] google.com> 4334 4335 * output.h (Output_data_reloc_generic::add): Only call 4336 add_dynamic_reloc if this is a dynamic reloc section. 4337 4338 2011-12-15 H.J. Lu <hongjiu.lu (a] intel.com> 4339 4340 PR gold/13505 4341 * target-reloc.h (apply_relocation): Replace <64, false> with 4342 <size, big_endian>. 4343 4344 2011-11-25 Nick Clifton <nickc (a] redhat.com> 4345 4346 * po/it.po: New Italian translation. 4347 4348 2011-11-17 Sterling Augustine <saugustine (a] google.com> 4349 4350 * script.cc (script_include_directive): Implement. 4351 (read_script_file): New local variables name and search_path. Update 4352 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list. 4353 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method. 4354 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it. 4355 4356 2011-11-11 Sterling Augustine <saugustine (a] google.com> 4357 4358 * yyscript.y (section_cmd): Add support for INCLUDE directive. 4359 (file_or_sections_cmd): Likewise. 4360 4361 2011-11-11 Doug Kwan <dougkwan (a] google.com> 4362 4363 * arm.cc (Target_arm::do_make_elf_object): Allow executable also 4364 if --just-symbols is given. 4365 4366 2011-11-10 Doug Kwan <dougkwan (a] google.com> 4367 4368 PR gold/13362 4369 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses 4370 when processing data relocs. 4371 * reloc.h (Relocate_functions::rel_unaligned): New method. 4372 (Relocate_functions::pcrel_unaligned): Ditto. 4373 (Relocate_functions::rel32_unaligned): Ditto. 4374 (Relocate_functions::pcrel32_unaligned): Ditto. 4375 4376 2011-11-09 Doug Kwan <dougkwan (a] google.com> 4377 4378 PR gold/13362 4379 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs): 4380 Use unaligned 4-byte relocs for static 32-bit data as required by EABI. 4381 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum 4382 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED. 4383 (Relocate_functions::rel_unaligned): New. 4384 (Relocate_functions::rel32_unaligned): New. 4385 * target-reloc.h (relocate_for_relocatable): Add code to handle 4386 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED. 4387 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout, 4388 arm_unaligned_reloc_r): New targets. 4389 * testsuite/Makefile.in: Regenerate. 4390 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable 4391 linking. 4392 4393 2011-11-02 Ian Lance Taylor <iant (a] google.com> 4394 4395 * configure.ac: Add --with-lib-path option. Define LIB_PATH and 4396 NATIVE_LINKER. 4397 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR. 4398 * options.cc (General_options::finalize): Use library search path 4399 from configure script if specified. If not native and no sysroot, 4400 only search TOOLLIBDIR. 4401 * options.h (Search_directory::Search_directory): Change name to 4402 const std::string&. 4403 (General_options::add_to_library_path_with_sysroot): Change arg to 4404 const std::string&. 4405 * configure, Makefile.in, config.in: Rebuild. 4406 4407 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann (a] arm.com> 4408 4409 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether 4410 we are working around the ARM1176 Erratum. 4411 * options.h (General_options::fix_arm1176): Add option. 4412 * testsuite/Makefile.am: Add testcases, and keep current ones 4413 working. 4414 * testsuite/Makefile.in: Regenerate. 4415 * testsuite/arm_fix_1176.s: New file. 4416 * testsuite/arm_fix_1176.sh: Likewise. 4417 4418 2011-11-02 Matthew Gretton-Dann <matthew.gretton-dann (a] arm.com> 4419 4420 * arm.cc (Target_arm::Target_arm): Remove initialisation of 4421 may_use_blx_. 4422 (Target_arm::may_use_blx): Remove method. 4423 (Target_arm::set_may_use_blx): Likewise. 4424 (Target_arm::may_use_v4t_interworking): New method. 4425 (Target_arm::may_use_v5t_interworking): Likewise. 4426 (Target_arm::may_use_blx_): Remove member variable. 4427 (Arm_relocate_functions::arm_branch_common): Check for v5T 4428 interworking. 4429 (Arm_relocate_functions::thumb_branch_common): Likewise. 4430 (Reloc_stub::stub_type_for_reloc): Likewise. 4431 (Target_arm::do_finalize_sections): Correct interworking checks. 4432 * testsuite/Makefile.am: Add new tests. 4433 * testsuite/Makefile.in: Regenerate. 4434 * testsuite/arm_farcall_arm_arm.s: New test. 4435 * testsuite/arm_farcall_arm_arm.sh: Likewise. 4436 * testsuite/arm_farcall_arm_thumb.s: Likewise. 4437 * testsuite/arm_farcall_arm_thumb.sh: Likewise. 4438 * testsuite/arm_farcall_thumb_arm.s: Likewise. 4439 * testsuite/arm_farcall_thumb_arm.sh: Likewise. 4440 * testsuite/arm_farcall_thumb_thumb.s: Likewise. 4441 * testsuite/arm_farcall_thumb_thumb.sh: Likewise. 4442 4443 2011-10-31 Cary Coutant <ccoutant (a] google.com> 4444 4445 PR gold/13023 4446 * expression.cc (Expression::eval_with_dot): Add 4447 is_section_dot_assignment parameter. 4448 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is 4449 absolute and assigning to dot within a section. 4450 * script-sections.cc 4451 (Output_section_element_assignment::set_section_addresses): Pass 4452 dot_section to set_if_absolute. 4453 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE 4454 as is_section_dot_assignment flag to eval_with_dot. 4455 (Output_section_element_dot_assignment::set_section_addresses): 4456 Likewise. 4457 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section 4458 parameter. Also set value if relative to dot_section; set the 4459 symbol's output_section. 4460 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment 4461 parameter. Adjust all callers. 4462 (Expression::eval_maybe_dot): Likewise. 4463 (Symbol_assignment::set_if_absolute): Add dot_section parameter. 4464 Adjust all callers. 4465 * testsuite/script_test_2.t: Test assignment of an absolute value 4466 to dot within an output section element. 4467 4468 2011-10-31 Cary Coutant <ccoutant (a] google.com> 4469 4470 * options.h (class General_options): Add --[no-]gnu-unique options. 4471 * symtab.cc (Symbol_table::sized_write_globals): Convert 4472 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique. 4473 4474 2011-10-31 Cary Coutant <ccoutant (a] google.com> 4475 4476 PR gold/13359 4477 * i386.cc (Target_i386::Relocate::relocate_tls): Remove 4478 unnecessary assertion. 4479 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise. 4480 4481 2011-10-31 Sriraman Tallam <tmsriram (a] google.com> 4482 4483 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to 4484 gc_mark_symbol. 4485 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to 4486 gc_mark_symbol. 4487 Change to just keep the section associated with symbol. 4488 (Symbol_table::add_from_relobj): Mark symbols as not garbage when 4489 they are externally visible and --export-dynamic is turned on. 4490 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol. 4491 4492 2011-10-19 Ian Lance Taylor <iant (a] google.com> 4493 4494 PR gold/13163 4495 * script-sections.cc 4496 (Output_section_element_dot_assignment::needs_output_section): New 4497 function. 4498 4499 2011-10-19 Ian Lance Taylor <iant (a] google.com> 4500 4501 PR gold/13204 4502 * layout.cc (Layout::segment_precedes): Don't assert failure if a 4503 --section-start option was seen. 4504 * options.h (General_options::any_section_start): New function. 4505 4506 2011-10-18 David S. Miller <davem (a] davemloft.net> 4507 4508 PR binutils/13301 4509 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New 4510 member to track relocation locations that have moved during TLS 4511 reloc optimizations. 4512 (Target_sparc::Relocate::Relocate): Initialize to NULL. 4513 (Target_sparc::Relocate::relocate): Adjust view down by 4 4514 bytes if it matches reloc_adjust_addr_. 4515 (Target_sparc::Relocate::relocate_tls): Always move the 4516 __tls_get_addr call delay slot instruction forward 4 bytes when 4517 performing relaxation. 4518 4519 2011-10-18 Cary Coutant <ccoutant (a] google.com> 4520 4521 * output.cc (posix_fallocate): Return 0 on success, errno on failure. 4522 (Output_file::map_no_anonymous): Check for non-zero 4523 return code from posix_fallocate. 4524 4525 2011-10-17 Cary Coutant <ccoutant (a] google.com> 4526 4527 PR gold/13245 4528 * plugin.cc (is_visible_from_outside): Check for symbols 4529 referenced from dynamic objects. 4530 * resolve.cc (Symbol_table::resolve): Don't count references 4531 from dynamic objects as references from real ELF files. 4532 * testsuite/plugin_test_2.sh: Adjust expected result. 4533 4534 2011-10-17 Cary Coutant <ccoutant (a] google.com> 4535 4536 * gold.cc: Include timer.h. 4537 (queue_middle_tasks): Stamp time. 4538 (queue_final_tasks): Likewise. 4539 * main.cc (main): Store timer in parameters. Print timers 4540 for each pass. 4541 * parameters.cc (Parameters::Parameters): Initialize timer_. 4542 (Parameters::set_timer): New function. 4543 (set_parameters_timer): New function. 4544 * parameters.h (Parameters::set_timer): New function. 4545 (Parameters::timer): New function. 4546 (Parameters::timer_): New data member. 4547 (set_parameters_timer): New function. 4548 * timer.cc (Timer::stamp): New function. 4549 (Timer::get_pass_time): New function. 4550 * timer.h (Timer::stamp): New function. 4551 (Timer::get_pass_time): New function. 4552 (Timer::pass_times_): New data member. 4553 4554 2011-10-17 Cary Coutant <ccoutant (a] google.com> 4555 4556 * readsyms.cc (Read_symbols::run): Don't queue an unblocker 4557 task for members of lib groups. 4558 4559 2011-10-17 Cary Coutant <ccoutant (a] google.com> 4560 4561 PR gold/13288 4562 * fileread.cc (File_read::find_view): Add assert. 4563 (File_read::make_view): Move bounds check (replace with assert)... 4564 (File_read::find_or_make_view): ... to here. 4565 4566 2011-10-12 Cary Coutant <ccoutant (a] google.com> 4567 4568 * output.cc (Output_file::open_base_file): Handle case where 4569 ::read returns less than requested size. 4570 4571 2011-10-10 Cary Coutant <ccoutant (a] google.com> 4572 4573 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr): 4574 Initialize defined_count_. 4575 (Sized_relobj_incr::do_add_symbols): Count defined symbols. 4576 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite. 4577 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_. 4578 (Sized_incr_dynobj::do_add_symbols): Count defined symbols. 4579 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite. 4580 * incremental.h (Sized_relobj_incr::defined_count_): New data 4581 member. 4582 (Sized_incr_dynobj::defined_count_): New data member. 4583 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts): 4584 Return zeroes instead of internal error. 4585 4586 2011-10-10 Cary Coutant <ccoutant (a] google.com> 4587 4588 PR gold/13249 4589 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag. 4590 (Output_reloc::symbol_value): Return PLT offset if flag is set. 4591 * output.h (class Output_reloc): Add use_plt_offset flag. 4592 (Output_reloc::type_): Adjust size of bit field. 4593 (Output_reloc::use_plt_offset_): New bit field. 4594 (class Output_data_reloc): Adjust all calls to Output_reloc_type. 4595 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset 4596 flag. Adjust all callers. 4597 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when 4598 creating RELATIVE relocations. 4599 4600 2011-10-10 Nick Clifton <nickc (a] redhat.com> 4601 4602 * po/es.po: Updated Spanish translation. 4603 * po/fi.po: Updated Finnish translation. 4604 4605 2011-10-03 Diego Novillo <dnovillo (a] google.com> 4606 4607 * options.cc (parse_uint): Fix dereference of RETVAL. 4608 4609 2011-09-29 Sriraman Tallam <tmsriram (a] google.com> 4610 4611 * layout.h (section_order_map_): New member. 4612 (get_section_order_map): New member function. 4613 * output.cc (Output_section::add_input_section): Check for patterns 4614 only when --section-ordering-file is specified. 4615 * gold.cc (queue_middle_tasks): Delay updating order of sections till 4616 output_sections have been formed. 4617 * layout.cc (Layout_Layout): Initialize section_order_map_. 4618 * plugin.cc (update_section_order): Store order in order_map. Do not 4619 update the order. 4620 * testsuite/Makefile.am: Add test case for plugin_final_layout. 4621 * testsuite/Makefile.in: Regenerate. 4622 * testsuite/plugin_section_order.c: New file. 4623 * testsuite/plugin_final_layout.cc: New file. 4624 * testsuite/plugin_final_layout.sh: New file. 4625 4626 2011-09-29 Cary Coutant <ccoutant (a] google.com> 4627 4628 * incremental.cc (Sized_incremental_binary::do_process_got_plt): 4629 Check for NULL. 4630 * symtab.cc (Symbol_table::add_from_relobj): Ignore version 4631 symbols during incremental update. 4632 (Symbol_table::add_from_dynobj): Likewise. 4633 4634 2011-09-27 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 4635 Ian Lance Taylor <iant (a] google.com> 4636 4637 * symtab.cc (Symbol_table::define_special_symbol): Always 4638 canonicalize version string. 4639 4640 2011-09-26 Cary Coutant <ccoutant (a] google.com> 4641 4642 * gold.cc (queue_initial_tasks): Move option checks ... 4643 * options.cc (General_options::finalize): ... to here. Disable 4644 some options; make others fatal. 4645 4646 2011-09-26 Cary Coutant <ccoutant (a] google.com> 4647 4648 gcc PR lto/47247 4649 * plugin.cc (get_symbols_v2): New function. 4650 (Plugin::load): Add LDPT_GET_SYMBOLS_V2. 4651 (is_referenced_from_outside): New function. 4652 (Pluginobj::get_symbol_resolution_info): Add version parameter, return 4653 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version. 4654 (get_symbols): Pass version parameter. 4655 (get_symbols_v2): New function. 4656 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version 4657 parameter. 4658 * testsuite/plugin_test.c (get_symbols_v2): New static variable. 4659 (onload): Add LDPT_GET_SYMBOLS_V2. 4660 (all_symbols_read_hook): Use get_symbols_v2; check for 4661 LDPR_PREVAILING_DEF_IRONLY_EXP. 4662 * testsuite/plugin_test_3.sh: Update expected results. 4663 4664 2011-09-23 Simon Baldwin <simonb (a] google.com> 4665 4666 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags 4667 configuration options. 4668 * configure: Regenerate. 4669 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS. 4670 * Makefile.in: Regenerate. 4671 * testsuite/Makefile.in: Regenerate. 4672 4673 2011-09-19 Sriraman Tallam <tmsriram (a] google.com> 4674 4675 * plugin.h (should_defer_layout): Modify to check for any_claimed_. 4676 4677 2011-09-19 Cary Coutant <ccoutant (a] google.com> 4678 4679 * incremental.cc (can_incremental_update): Fix typo in comment. 4680 * incremental.h (can_incremental_update): Likewise. 4681 4682 2011-09-18 Cary Coutant <ccoutant (a] google.com> 4683 4684 * incremental.cc (can_incremental_update): New function. 4685 * incremental.h (can_incremental_update): New function. 4686 * layout.cc (Layout::init_fixed_output_section): Call it. 4687 (Layout::make_output_section): Don't allow patch space in .eh_frame. 4688 * object.cc (Sized_relobj_file::do_layout): Call 4689 can_incremental_update. 4690 4691 2011-09-13 Cary Coutant <ccoutant (a] google.com> 4692 4693 * configure.ac: Check for glibc support for gnu_indirect_function 4694 support with static linking, setting automake conditional 4695 IFUNC_STATIC. 4696 * Makefile.in: Regenerate. 4697 * configure: Regenerate. 4698 4699 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static) 4700 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check 4701 for IFUNC_STATIC. 4702 * testsuite/Makefile.in: Regenerate. 4703 4704 2011-09-13 Cary Coutant <ccoutant (a] google.com> 4705 4706 * incremental.cc (Sized_relobj_incr::do_layout): Call 4707 report_comdat_group for kept comdat sections. 4708 * testsuite/Makefile.am (incremental_comdat_test_1): New test. 4709 * testsuite/Makefile.in: Regenerate. 4710 * testsuite/incr_comdat_test_1.cc: New source file. 4711 * testsuite/incr_comdat_test_2_v1.cc: New source file. 4712 * testsuite/incr_comdat_test_2_v2.cc: New source file. 4713 * testsuite/incr_comdat_test_2_v3.cc: New source file. 4714 4715 2011-09-13 Ian Lance Taylor <iant (a] google.com> 4716 4717 * object.cc (Sized_relobj_file::do_layout): Remove unused local 4718 variable external_symbols_offset. 4719 4720 2011-09-12 Ian Lance Taylor <iant (a] google.com> 4721 4722 * object.cc (Sized_relobj_file::do_layout): Remove assertion which 4723 triggered if object has no symbols. 4724 4725 2011-09-09 David S. Miller <davem (a] davemloft.net> 4726 4727 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned. 4728 (Output_fill_debug_line::do_write): Likewise. 4729 4730 2011-08-29 Cary Coutant <ccoutant (a] google.com> 4731 4732 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add 4733 casts to match formatting specs. 4734 (Output_fill_debug_line::do_minimum_hole_size): Likewise. 4735 4736 2011-08-26 Cary Coutant <ccoutant (a] google.com> 4737 4738 * layout.cc (Free_list::allocate): Provide guarantee of minimum 4739 remaining hole size when allocating. 4740 (Layout::make_output_section): Set fill methods for debug sections. 4741 * layout.h (Free_list::Free_list_node): Move from private to 4742 public. 4743 (Free_list::set_min_hole_size): New function. 4744 (Free_list::begin, Free_list::end): New functions. 4745 (Free_list::min_hole_): New data member. 4746 * output.cc: Include dwarf.h. 4747 (Output_fill_debug_info::do_minimum_hole_size): New function. 4748 (Output_fill_debug_info::do_write): New function. 4749 (Output_fill_debug_line::do_minimum_hole_size): New function. 4750 (Output_fill_debug_line::do_write): New function. 4751 (Output_section::Output_section): Initialize new data member. 4752 (Output_section::set_final_data_size): Ensure patch space is larger 4753 than minimum hole size. 4754 (Output_section::do_write): Fill holes in debug sections. 4755 * output.h (Output_fill): New class. 4756 (Output_fill_debug_info): New class. 4757 (Output_fill_debug_line): New class. 4758 (Output_section::set_free_space_fill): New function. 4759 (Output_section::free_space_fill_): New data member. 4760 * testsuite/Makefile.am (incremental_test_3): Add 4761 --incremental-patch option. 4762 (incremental_test_4): Likewise. 4763 (incremental_test_5): Likewise. 4764 (incremental_test_6): Likewise. 4765 (incremental_copy_test): Likewise. 4766 (incremental_common_test_1): Likewise. 4767 * testsuite/Makefile.in: Regenerate. 4768 4769 2011-08-26 Nick Clifton <nickc (a] redhat.com> 4770 4771 * po/es.po: Updated Spanish translation. 4772 4773 2011-08-01 Cary Coutant <ccoutant (a] google.com> 4774 4775 * gold/testsuite/Makefile.am (justsyms_exec): New testcase. 4776 * gold/testsuite/Makefile.in: Regenerate. 4777 * gold/testsuite/justsyms_exec.c: New source file. 4778 * gold/testsuite/justsyms_lib.c: New source file. 4779 4780 2011-08-01 Cary Coutant <ccoutant (a] google.com> 4781 4782 * layout.cc (Layout::set_segment_offsets): Don't realign text 4783 segment if -Ttext was specified. 4784 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF 4785 file type. 4786 * object.h (Sized_relobj_file::e_type): New function. 4787 (Sized_relobj_file::e_type_): New data member. 4788 * symtab.cc (Symbol_table::add_from_relobj): Don't add section 4789 base address for ET_EXEC files. 4790 * target.cc (Target::do_make_elf_object_implementation): Allow 4791 ET_EXEC files with --just-symbols option. 4792 4793 2011-07-28 Cary Coutant <ccoutant (a] google.com> 4794 4795 * workqueue-internal.h (Workqueue_threader::should_cancel_thread): 4796 Add thread_number parameter. 4797 (Workqueue_threader_threadpool::should_cancel_thread): Likewise. 4798 * workqueue-threads.cc 4799 (Workqueue_threader_threadpool::should_cancel_thread): Cancel 4800 current thread if its thread number is greater than desired thread 4801 count. 4802 * workqueue.cc (Workqueue_threader_single::should_cancel_thread): 4803 Add thread_number parameter. 4804 (Workqueue::should_cancel_thread): Likewise. 4805 (Workqueue::find_runnable_or_wait): Pass thread_number to 4806 should_cancel_thread. 4807 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number 4808 parameter. 4809 4810 2011-07-22 Sriraman Tallam <tmsriram (a] google.com> 4811 4812 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced 4813 only after checking if it cannot be forced local. 4814 * symtab.h (is_externally_visible): Check if the symbol is not forced 4815 local. 4816 4817 2011-07-15 Ian Lance Taylor <iant (a] google.com> 4818 4819 * options.h (class General_options): Add --print-output-format. 4820 Move -EL next to -EB, for better --help output. 4821 * target-select.cc: Include <cstdio>, "options.h", and 4822 "parameters.h". 4823 (Target_selector::do_target_bfd_name): New function. 4824 (print_output_format): New function. 4825 * target-select.h (class Target_selector): Update declarations. 4826 (Target_selector::target_bfd_name): New function. 4827 (print_output_format): Declare. 4828 * main.cc: Include "target-select.h". 4829 (main): Handle --print-output-format. 4830 * gold.cc: Include "target-select.h". 4831 (queue_initial_tasks): Handle --print-output-format when there are 4832 no input files. 4833 * parameters.cc (parameters_force_valid_target): Give a better 4834 error message if -EB/-EL does not match target. 4835 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New 4836 function. 4837 4838 2011-07-15 Ian Lance Taylor <iant (a] google.com> 4839 4840 * i386.cc (class Output_data_plt_i386): Add layout_ field. 4841 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_. 4842 (Output_data_plt_i386::do_write): Write address of .dynamic 4843 section to first entry in .got.plt section. 4844 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field. 4845 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]: 4846 Initialize layout_. 4847 (Output_data_plt_x86_64::do_write): Write address of .dynamic 4848 section to first entry in .got.plt section. 4849 * layout.h (Layout::dynamic_section): New function. 4850 4851 2011-07-13 Sriraman Tallam <tmsriram (a] google.com> 4852 4853 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter 4854 to claim_file call. 4855 * layout.cc (Layout::Layout): Initialize section_ordering_specified_, 4856 input_section_position_, and input_section_glob_. 4857 (read_layout_from_file): Call function section_ordering_specified. 4858 * layout.h (is_section_ordering_specified): New function. 4859 (section_ordering_specified): New function. 4860 (section_ordering_specified_): New boolean member. 4861 * main.cc(main): Call load_plugins after layout object is defined. 4862 * output.cc (Output_section::add_input_section): Use 4863 function section_ordering_specified to check if section ordering is 4864 needed. 4865 * output.cc (Output_section::add_relaxed_input_section): Use 4866 function section_ordering_specified to check if section ordering is 4867 needed. 4868 (Output_section::update_section_layout): New function. 4869 (Output_section::sort_attached_input_sections): Check if input section 4870 must be reordered. 4871 * output.h (Output_section::update_section_layout): New function. 4872 * plugin.cc (get_section_count): New function. 4873 (get_section_type): New function. 4874 (get_section_name): New function. 4875 (get_section_contents): New function. 4876 (update_section_order): New function. 4877 (allow_section_ordering): New function. 4878 (Plugin::load): Add the new interfaces to the transfer vector. 4879 (Plugin_manager::load_plugins): New parameter. 4880 (Plugin_manager::all_symbols_read): New parameter. 4881 (Plugin_manager::claim_file): New parameter. Save the elf object for 4882 unclaimed objects. 4883 (Plugin_manager::get_elf_object): New function. 4884 (Plugin_manager::get_view): Change to directly use the bool to check 4885 if get_view is called from claim_file_hook. 4886 * plugin.h (input_objects): New function 4887 (Plugin__manager::load_plugins): New parameter. 4888 (Plugin_manager::claim_file): New parameter. 4889 (Plugin_manager::get_elf_object): New function. 4890 (Plugin_manager::in_claim_file_handler): New function. 4891 (Plugin_manager::in_claim_file_handler_): New member. 4892 (layout): New function. 4893 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file 4894 handler with an extra parameter. Make the elf object before calling 4895 claim_file handler. 4896 * testsuite/plugin_test.c (get_section_count): New function pointer. 4897 (get_section_type): New function pointer. 4898 (get_section_name): New function pointer. 4899 (get_section_contents): New function pointer. 4900 (update_section_order): New function pointer. 4901 (allow_section_ordering): New function pointer. 4902 (onload): Check if the new interfaces exist. 4903 4904 2011-07-13 Ian Lance Taylor <iant (a] google.com> 4905 4906 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a 4907 relro section. 4908 * x86_64.cc (Target_x86_64::got_section): Likewise. 4909 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test. 4910 (relro_now_test_SOURCES): New variable. 4911 (relro_now_test_DEPENDENCIES): New variable. 4912 (relro_now_test_LDFLAGS): New variable. 4913 (relro_now_test_LDADD): New variable. 4914 (relro_now_test.so): New target. 4915 * testsuite/Makefile.in: Rebuild. 4916 4917 2011-07-12 Ian Lance Taylor <iant (a] google.com> 4918 4919 PR gold/12980 4920 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a 4921 GLOB_DAT relocation rather than a RELATIVE relocation for a 4922 protected symbol when creating a shared library. 4923 * x86_64.cc (Target_x86_64::Scan::global): Likewise. 4924 * testsuite/protected_1.cc (f2, get_f2_addr): New functions. 4925 * testsuite/protected_main_1.cc (main): Test that protected 4926 function has same address. 4927 4928 2011-07-11 Ian Lance Taylor <iant (a] google.com> 4929 4930 PR gold/12979 4931 * options.h (class General_options): Add -Bgroup. 4932 * options.cc (General_options::finalize): If -Bgroup is set, 4933 default to --unresolved-symbols=report-all. 4934 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup. 4935 * target-reloc.h (issue_undefined_symbol_error): Handle 4936 --unresolved-symbols=report-all. 4937 4938 2011-07-08 Ian Lance Taylor <iant (a] google.com> 4939 4940 PR gold/11985 4941 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash 4942 if linker script discards key sections. 4943 (Layout::create_dynamic_symtab): Likewise. 4944 (Layout::assign_local_dynsym_offsets): Likewise. 4945 (Layout::sized_create_version_sections): Likewise. 4946 (Layout::create_interp): Likewise. 4947 (Layout::finish_dynamic_section): Likewise. 4948 (Layout::set_dynamic_symbol_size): Likewise. 4949 4950 2011-07-08 Ian Lance Taylor <iant (a] google.com> 4951 4952 PR gold/12386 4953 * options.h (class General_options): Add --unresolved-symbols. 4954 * target-reloc.h (issue_undefined_symbol_error): Check 4955 --unresolved-symbols. Add comments. 4956 4957 2011-07-08 Ian Lance Taylor <iant (a] google.com> 4958 4959 * testsuite/odr_violation2.cc (Ordering::operator()): Make 4960 expression more complex. 4961 4962 2011-07-08 Ian Lance Taylor <iant (a] google.com> 4963 4964 PR gold/11317 4965 * target-reloc.h (issue_undefined_symbol_error): New inline 4966 function, broken out of relocate_section. 4967 (relocate_section): Call issue_undefined_symbol_error. 4968 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if 4969 there is no TLS segment if we are about to issue an undefined 4970 symbol error. 4971 * x86_64.cc (Target_x86_64::relocate_tls): Likewise. 4972 4973 2011-07-08 Ian Lance Taylor <iant (a] google.com> 4974 4975 PR gold/12279 4976 * resolve.cc (Symbol_table::should_override): Add fromtype 4977 parameter. Change all callers. Give error when linking together 4978 TLS and non-TLS symbol. 4979 (Symbol_table::should_override_with_special): Add fromtype 4980 parameter. Change all callers. 4981 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if 4982 there is no TLS segment if we have reported some errors. 4983 * x86_64.cc (Target_x86_64::relocate_tls): Likewise. 4984 4985 2011-07-08 Ian Lance Taylor <iant (a] google.com> 4986 4987 PR gold/12372 4988 * target.h (Target::plt_address_for_global): New function. 4989 (Target::plt_address_for_local): New function. 4990 (Target::plt_section_for_global): Remove. 4991 (Target::plt_section_for_local): Remove. 4992 (Target::do_plt_address_for_global): New virtual function. 4993 (Target::do_plt_address_for_local): New virtual function. 4994 (Target::do_plt_section_for_global): Remove. 4995 (Target::do_plt_section_for_local): Remove. 4996 (Target::register_global_plt_entry): Add Symbol_table and Layout 4997 parameters. 4998 * output.cc (Output_data_got::Got_entry::write): Use 4999 plt_address_for_global and plt_address_for_local. 5000 * layout.cc (Layout::add_target_dynamic_tags): Use size and 5001 address of output section. 5002 * i386.cc (class Output_data_plt_i386): Add irelative_rel_, 5003 got_irelative_, and irelative_count_ fields. Update 5004 declarations. 5005 (Output_data_plt_i386::has_irelative_section): New function. 5006 (Output_data_plt_i386::entry_count): Add irelative_count_. 5007 (Output_data_plt_i386::set_final_data_size): Likewise. 5008 (class Target_i386): Add got_irelative_ and rel_irelative_ 5009 fields. Update declarations. 5010 (Target_i386::Target_i386): Initialize new fields. 5011 (Target_i386::do_plt_address_for_global): New function replacing 5012 do_plt_section_for_global. 5013 (Target_i386::do_plt_address_for_local): New function replacing 5014 do_plt_section_for_local. 5015 (Target_i386::got_section): Create got_irelative_. 5016 (Target_i386::rel_irelative_section): New function. 5017 (Output_data_plt_i386::Output_data_plt_i386): Initialize new 5018 fields. Don't define __rel_iplt_{start,end}. 5019 (Output_data_plt_i386::add_entry): Add symtab and layout 5020 parameters. Change all callers. Use different PLT and GOT for 5021 IFUNC symbols. 5022 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and 5023 layout parameters. Change all callers. Use different PLT and 5024 GOT. 5025 (Output_data_plt_i386::rel_tls_desc): Fix formatting. 5026 (Output_data_plt_i386::rel_irelative): New function. 5027 (Output_data_plt_i386::address_for_global): New function. 5028 (Output_data_plt_i386::address_for_local): New function. 5029 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use 5030 IRELATIVE GOT when changing IFUNC GOT entries. 5031 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE 5032 reloc. 5033 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols 5034 if we didn't create an IRELATIVE GOT. 5035 (Target_i386::Relocate::relocate): Use plt_address_for_global and 5036 plt_address_for_local. 5037 (Target_i386::do_dynsym_value): Use plt_address_for_global. 5038 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_, 5039 got_irelative_, and irelative_count_ fields. Update 5040 declarations. 5041 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]: 5042 Initialize new fields. Remove symtab parameter. Change all 5043 callers. 5044 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add 5045 irelative_count_. 5046 (Output_data_plt_x86_64::has_irelative_section): New function. 5047 (Output_data_plt_x86_64::entry_count): Add irelative_count_. 5048 (class Target_x86_64): Add got_irelative_ and rel_irelative_ 5049 fields. Update declarations. 5050 (Target_x86_64::Target_x86_64): Initialize new fields. 5051 (Target_x86_64::do_plt_address_for_global): New function replacing 5052 do_plt_section_for_global. 5053 (Target_x86_64::do_plt_address_for_local): New function replacing 5054 do_plt_section_for_local. 5055 (Target_x86_64::got_section): Create got_irelative_. 5056 (Target_x86_64::rela_irelative_section): New function. 5057 (Output_data_plt_x86_64::init): Remove symtab parameter. Change 5058 all callers. Don't create __rel_iplt_{start,end}. 5059 (Output_data_plt_x86_64::add_entry): Add symtab and layout 5060 parameters. Change all callers. Use different PLT and GOT for 5061 IFUNC symbols. 5062 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and 5063 layout parameters. Change all callers. Use different PLT and 5064 GOT. 5065 (Output_data_plt_x86_64::add_relocation): Add symtab and layout 5066 parameters. Change all callers. Use different PLT and GOT for 5067 IFUNC symbols. 5068 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting. 5069 (Output_data_plt_x86_64::rela_irelative): New function. 5070 (Output_data_plt_x86_64::address_for_global): New function. 5071 (Output_data_plt_x86_64::address_for_local): New function. 5072 (Output_data_plt_x86_64::set_final_data_size): Likewise. 5073 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area. 5074 (Target_x86_64::init_got_plt_for_update): Create got_irelative_. 5075 (Target_x86_64::register_global_plt_entry): Add symtab and layout 5076 parameters. 5077 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE 5078 reloc. 5079 (Target_x86_64::do_finalize_sections): Create the __rela_iplt 5080 symbols if we didn't create an IRELATIVE GOT. 5081 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and 5082 plt_address_for_local. 5083 (Target_x86_64::do_dynsym_value): Use plt_address_for_global. 5084 * testsuite/ifuncvar1.c: New test file. 5085 * testsuite/ifuncvar2.c: New test file. 5086 * testsuite/ifuncvar3.c: New test file. 5087 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar. 5088 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets. 5089 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables. 5090 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables. 5091 * testsuite/Makefile.in: Rebuild. 5092 5093 2011-07-07 Cary Coutant <ccoutant (a] google.com> 5094 5095 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target. 5096 (two_file_test_1_ndebug.o): Likewise. 5097 (two_file_test_1b_ndebug.o): Likewise. 5098 (two_file_test_2_ndebug.o): Likewise. 5099 (two_file_test_main_ndebug.o): Likewise. 5100 (incremental_test_2): Link with no-debug versions. 5101 5102 2011-07-06 Cary Coutant <ccoutant (a] google.com> 5103 5104 * gold/incremental.cc 5105 (Output_section_incremental_inputs::write_info_blocks): Check for 5106 hidden and internal symbols. 5107 5108 2011-07-06 Cary Coutant <ccoutant (a] google.com> 5109 5110 * incremental.cc (Sized_incremental_binary::do_file_has_changed): 5111 Check disposition for startup file. 5112 (Incremental_inputs::report_command_line): Ignore 5113 --incremental-startup-unchanged option. 5114 * options.cc (General_options::parse_incremental_startup_unchanged): 5115 New function. 5116 (General_options::General_options): Initialize new data member. 5117 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP. 5118 (General_options): Add --incremental-startup-unchanged option. 5119 (General_options::incremental_startup_disposition): New function. 5120 (General_options::incremental_startup_disposition_): New data member. 5121 5122 2011-07-06 Cary Coutant <ccoutant (a] google.com> 5123 5124 * incremental.cc (Sized_incremental_binary::setup_readers): Pass 5125 input file index to Script_info ctor. 5126 (Sized_incremental_binary::do_file_has_changed): Find the 5127 command-line argument for files named in scripts. 5128 * incremental.h (Script_info::Script_info): New ctor 5129 with input file index. 5130 (Script_info::input_file_index): New function. 5131 (Script_info::input_file_index_): New data member. 5132 (Incremental_binary::get_library): Add const. 5133 (Incremental_binary::get_script_info): Add const. 5134 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_. 5135 * testsuite/Makefile.am (incremental_test_5): New test case. 5136 (incremental_test_6): New test case. 5137 * testsuite/Makefile.in: Regenerate. 5138 5139 2011-07-06 Cary Coutant <ccoutant (a] google.com> 5140 5141 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add 5142 debug output when command lines differ. 5143 5144 2011-07-06 Cary Coutant <ccoutant (a] google.com> 5145 5146 * incremental.cc (Incremental_inputs::report_command_line): Ignore 5147 --incremental-patch option. 5148 * layout.cc (Free_list::allocate): Extend allocation beyond original 5149 end if enabled. 5150 (Layout::make_output_section): Mark sections that should get 5151 patch space. 5152 * options.cc (parse_percent): New function. 5153 * options.h (parse_percent): New function. 5154 (DEFINE_percent): New macro. 5155 (General_options): Add --incremental-patch option. 5156 * output.cc (Output_section::Output_section): Initialize new data 5157 members. 5158 (Output_section::add_input_section): Print section name when out 5159 of patch space. 5160 (Output_section::add_output_section_data): Likewise. 5161 (Output_section::set_final_data_size): Add patch space when 5162 doing --incremental-full. 5163 (Output_section::do_reset_address_and_file_offset): Remove patch 5164 space. 5165 (Output_segment::set_section_list_addresses): Print debug output 5166 only if --incremental-update. 5167 * output.h (Output_section::set_is_patch_space_allowed): New function. 5168 (Output_section::is_patch_space_allowed_): New data member. 5169 (Output_section::patch_space_): New data member. 5170 * parameters.cc (Parameters::incremental_full): New function. 5171 * parameters.h (Parameters::incremental_full): New function 5172 * testsuite/Makefile.am (incremental_test_2): Add test for 5173 --incremental-patch option. 5174 * testsuite/Makefile.in: Regenerate. 5175 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments. 5176 (t18): Remove function body. 5177 5178 2011-07-05 Doug Kwan <dougkwan (a] google.com> 5179 5180 PR gold/12771 5181 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and 5182 Arm_Address type for relocation result. 5183 (Arm_relocate_functions::abs16): Use unaligned access. Also fix 5184 overflow check. 5185 (Arm_relocate_functions::abs32): Use unaligned access. 5186 (Arm_relocate_functions::rel32): Ditto. 5187 (Arm_relocate_functions::prel31): Ditto. 5188 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto. 5189 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned 5190 static data relocations. 5191 * testsuite/Makefile.in: Regnerate. 5192 * testsuite/arm_unaligned_reloc.{s,sh}: New files. 5193 5194 2011-07-05 Ian Lance Taylor <iant (a] google.com> 5195 5196 PR gold/12392 5197 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt 5198 symbols if necessary. 5199 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise. 5200 5201 2011-07-05 Ian Lance Taylor <iant (a] google.com> 5202 5203 PR gold/12952 5204 * resolve.cc (Symbol::override_base_with_special): Simply override 5205 version with special symbol version, ignoring previous version. 5206 5207 2011-07-05 Ian Lance Taylor <iant (a] google.com> 5208 5209 * object.cc (Sized_relobj_file::include_section_group): Add 5210 information to comment about signature location. 5211 5212 2011-07-02 Ian Lance Taylor <iant (a] google.com> 5213 5214 PR gold/12957 5215 * options.h (class General_options): Add -f and -F. 5216 * options.cc (General_options::finalize): Fatal error if -f/-F 5217 are used without -shared. 5218 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F. 5219 5220 2011-07-02 Ian Lance Taylor <iant (a] google.com> 5221 5222 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors. 5223 5224 2011-07-01 Ian Lance Taylor <iant (a] google.com> 5225 5226 PR gold/12525 5227 PR gold/12952 5228 * resolve.cc (Symbol::override_base_with_special): Don't override 5229 the version if the overriding symbol has a different name. 5230 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change 5231 all callers. If we give an error about an undefined version, 5232 define the base version if necessary. 5233 * dynobj.h (class Versions): Update declaration. 5234 * testsuite/weak_alias_test_5.cc: New file. 5235 * testsuite/weak_alias_test.script: New file. 5236 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol 5237 and versioned_alias have the right value, and call t2. 5238 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add 5239 weak_alias_test_5.so. 5240 (weak_alias_test_LDADD): Likewise. 5241 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets. 5242 * testsuite/Makefile.in: Rebuild. 5243 5244 2011-07-01 Ian Lance Taylor <iant (a] google.com> 5245 5246 PR gold/12525 5247 * options.h (class General_options): Support -z notext. 5248 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use 5249 -Wl,-z,notext. 5250 (two_file_shared_nonpic.so): Likewise. 5251 (two_file_shared_mixed.so): Likewise. 5252 (two_file_shared_mixed_1.so): Likewise. 5253 (weak_undef_lib_nonpic.so): Likewise. 5254 (alt/weak_undef_lib_nonpic.so): Likewise. 5255 (tls_test_shared_nonpic.so): Likewise. 5256 * testsuite/Makefile.in: Rebuild. 5257 5258 2011-07-01 Ian Lance Taylor <iant (a] google.com> 5259 5260 PR gold/12525 5261 * configure.ac: Test whether static linking works, setting 5262 the automake conditional HAVE_STATIC. 5263 * testsuite/Makefile.am: Disable tests using -static if 5264 HAVE_STATIC is not true. 5265 * configure, testsuite/Makefile.in: Rebuild. 5266 5267 2011-07-01 Ian Lance Taylor <iant (a] google.com> 5268 5269 PR gold/12525 5270 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel. 5271 Assert if we see DW_EH_PE_indirect. 5272 * target.h (Target::ehframe_datarel_base): New function. 5273 (Target::do_ehframe_datarel_base): New target function. 5274 * i386.cc (Target_i386::do_ehframe_datarel_base): New function. 5275 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New 5276 function. 5277 5278 2011-07-01 Ian Lance Taylor <iant (a] google.com> 5279 5280 PR gold/12571 5281 * options.h (class General_options): Add 5282 --ld-generated-unwind-info. 5283 * ehframe.cc (Fde::write): Add address parameter. Change all 5284 callers. If associated with PLT, fill in address and size. 5285 (Cie::set_output_offset): Only add merge mapping if there is an 5286 object. 5287 (Cie::write): Add address parameter. Change all callers. 5288 (Eh_frame::add_ehframe_for_plt): New function. 5289 * ehframe.h (class Fde): Update declarations. Move shndx_ and 5290 input_offset_ fields into union u_, with new plt field. 5291 (Fde::Fde): Adjust for new union field. 5292 (Fde::Fde) [Output_data version]: New constructor. 5293 (Fde::add_mapping): Only add merge mapping if there is an object. 5294 (class Cie): Update declarations. 5295 (class Eh_frame): Declare add_ehframe_for_plt. 5296 * layout.cc (Layout::layout_eh_frame): Break out code into 5297 make_eh_frame_section, and call it. 5298 (Layout::make_eh_frame_section): New function. 5299 (Layout::add_eh_frame_for_plt): New function. 5300 * layout.h (class Layout): Update declarations. 5301 * merge.cc (Merge_map::add_mapping): Add assertion. 5302 * i386.cc: Include "dwarf.h". 5303 (class Output_data_plt_i386): Make first_plt_entry, 5304 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add 5305 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie, 5306 and plt_eh_frame_fde. 5307 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte 5308 boundary. Call add_eh_frame_for_plt if appropriate. 5309 * x86_64.cc: Include "dwarf.h". 5310 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make 5311 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add 5312 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie, 5313 and plt_eh_frame_fde. 5314 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if 5315 appropriate. 5316 5317 2011-06-29 Ian Lance Taylor <iant (a] google.com> 5318 5319 PR gold/12629 5320 * object.cc (Sized_relobj_file::layout_section): Change shdr 5321 parameter to be const. 5322 (Sized_relobj_file::layout_eh_frame_section): New function, broken 5323 out of do_layout. 5324 (Sized_relobj_file::do_layout): Defer .eh_frame sections if 5325 appropriate. Call layout_eh_frame_section. 5326 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame 5327 sections. 5328 * object.h (class Sized_relobj_file): Update declarations. 5329 5330 2011-06-29 Ian Lance Taylor <iant (a] google.com> 5331 5332 PR gold/12652 5333 * script.cc (Token::integer_value): Accept trailing M/m/K/k 5334 modifier. 5335 (Lex::gather_token): Accept trailing M/m/K/k for integers. 5336 5337 2011-06-29 Ian Lance Taylor <iant (a] google.com> 5338 5339 PR gold/12675 5340 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for 5341 SHT_X86_64_UNWIND. 5342 * layout.cc (Layout::layout_eh_frame): Likewise. 5343 5344 2011-06-29 Ian Lance Taylor <iant (a] google.com> 5345 5346 PR gold/12695 5347 * layout.cc (Layout::symtab_section_shndx): New function. 5348 * layout.h (class Layout): Declare symtab_section_shndx. 5349 * output.cc (Output_section::write_header): Call it. 5350 5351 2011-06-29 Ian Lance Taylor <iant (a] google.com> 5352 5353 PR gold/12818 5354 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined 5355 symbols which are not used in a relocation. 5356 5357 2011-06-28 Ian Lance Taylor <iant (a] google.com> 5358 5359 PR gold/12898 5360 * layout.cc (Layout::segment_precedes): Don't crash if a linker 5361 script create indistinguishable segments. 5362 (Layout::set_segment_offsets): Use stable_sort when sorting 5363 segments. Pass this to Compare_segments constructor. 5364 * layout.h (class Layout): Make segment_precedes non-static. 5365 (class Compare_segments): Change from struct to class. Add 5366 layout_ field. Add constructor. 5367 * script-sections.cc 5368 (Script_sections::attach_sections_using_phdrs_clause): Rename 5369 local orphan to is_orphan. Don't report failure to put empty 5370 section in segment. On attachment failure, report name of 5371 section, and attach to first PT_LOAD segment. 5372 5373 2011-06-28 Ian Lance Taylor <iant (a] google.com> 5374 5375 PR gold/12934 5376 * target-select.cc (Target_selector::Target_selector): Add 5377 emulation parameter. Change all callers. 5378 (select_target_by_bfd_name): Rename from select_target_by_name. 5379 Change all callers. 5380 (select_target_by_emulation): New function. 5381 (supported_emulation_names): New function. 5382 * target-select.h (class Target_selector): Add emulation_ field. 5383 Update declarations. 5384 (Target_selector::recognize_by_bfd_name): Rename from 5385 recognize_by_name. Change all callers. 5386 (Target_selector::supported_bfd_names): Rename from 5387 supported_names. Change all callers. 5388 (Target_selector::recognize_by_emulation): New function. 5389 (Target_selector::supported_emulations): New function. 5390 (Target_selector::emulation): New function. 5391 (Target_selector::do_recognize_by_bfd_name): Rename from 5392 do_recognize_by_name. Change all callers. 5393 (Target_selector::do_supported_bfd_names): Rename from 5394 do_supported_names. Change all callers. 5395 (Target_selector::do_recognize_by_emulation): New function. 5396 (Target_selector::do_supported_emulations): New function. 5397 (select_target_by_bfd_name): Change name in declaration. 5398 (select_target_by_emulation): Declare. 5399 (supported_emulation_names): Declare. 5400 * parameters.cc (parameters_force_valid_target): Try to find 5401 target based on emulation from -m option. 5402 * options.h (class General_options): Change doc string for -m. 5403 * options.cc (help): Print emulations. 5404 (General_options::parse_V): Likewise. 5405 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd): 5406 Add emulation parameter. Change all callers. 5407 5408 2011-06-28 Ian Lance Taylor <iant (a] google.com> 5409 5410 * target.h (class Target): Add osabi_ field. 5411 (Target::osabi): New function. 5412 (Target::set_osabi): New function. 5413 (Target::Target): Initialize osabi_. 5414 (Target::do_adjust_elf_header): Make pure virtual. 5415 (Sized_target::do_adjust_elf_header): Declare. 5416 * target.cc (Sized_target::do_adjust_elf_header): New function. 5417 (class Sized_target): Instantiate all versions. 5418 * freebsd.h (class Target_freebsd): Remove. 5419 (Target_selector_freebsd::do_recognize): Call set_osabi on 5420 Target. 5421 (Target_selector_freebsd::do_recognize_by_name): Likewise. 5422 (Target_selector_freebsd::set_osabi): Remove. 5423 * i386.cc (class Target_i386): Inherit from Sized_target rather 5424 than Target_freebsd. 5425 * x86_64.cc (class Target_x86_64): Likewise. 5426 5427 2011-06-28 Ian Lance Taylor <iant (a] google.com> 5428 5429 * target.h (Target::can_check_for_function_pointers): Rewrite. 5430 Make non-virtual. 5431 (Target::can_icf_inline_merge_sections): Likewise. 5432 (Target::section_may_have_icf_unsafe_poineters): Likewise. 5433 (Target::Target_info): Add can_icf_inline_merge_sections field. 5434 (Target::do_can_check_for_function_pointers): New virtual 5435 function. 5436 (Target::do_section_may_have_icf_unsafe_pointers): Likewise. 5437 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename 5438 from can_check_for_function_pointers, move in file. 5439 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from 5440 section_may_have_icf_unsafe_poineters, move in file. 5441 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections. 5442 * i386.cc (Target_i386::do_can_check_for_function_pointers): 5443 Rename from can_check_for_function_pointers, move in file. 5444 (Target_i386::can_icf_inline_merge_sections): Remove. 5445 (Target_i386::i386_info): Initialize 5446 can_icf_inline_merge_sections. 5447 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]: 5448 Initialize can_icf_inline_merge_sections. 5449 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise. 5450 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers): 5451 Rename from can_check_for_function_pointers, move in file. 5452 (Target_x86_64::can_icf_inline_merge_sections): Remove. 5453 (Target_x86_64::x86_64_info): Initialize 5454 can_icf_inline_merge_sections. 5455 * testsuite/testfile.cc (Target_test::test_target_info): 5456 Likewise. 5457 * icf.cc (get_section_contents): Correct formatting. 5458 5459 2011-06-27 Ian Lance Taylor <iant (a] google.com> 5460 5461 * symtab.cc (Symbol::versioned_name): New function. 5462 (Symbol_table::add_to_final_symtab): Use versioned_name when 5463 appropriate. 5464 (Symbol_table::sized_write_symbol): Likewise. 5465 * symtab.h (class Symbol): Declare versioned_name. 5466 * stringpool.h (class Stringpool_template): Add variant of add 5467 which takes a std::basic_string. 5468 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12. 5469 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables. 5470 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables. 5471 (ver_test_12.o): New target. 5472 * testsuite/Makefile.in: Rebuild. 5473 5474 2011-06-27 Doug Kwan <dougkwan (a] google.com> 5475 5476 * arm.cc (Arm_relocate_functions::thm_jump8, 5477 Arm_relocate_functions::thm_jump11): Use a wider signed 5478 type to compute offset. 5479 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and 5480 arm_thm_jump8. 5481 * testsuite/Makefile.in: Regenerate. 5482 * testsuite/arm_branch_in_range.sh: Check test results of 5483 arm_thm_jump11 and arm_thm_jump8. 5484 * testsuite/arm_thm_jump11.s: New test source file. 5485 * testsuite/arm_thm_jump11.t: New linker script. 5486 * testsuite/arm_thm_jump8.s: New test source file. 5487 * testsuite/arm_thm_jump8.t: New linker script. 5488 5489 2011-06-24 Ian Lance Taylor <iant (a] google.com> 5490 5491 * layout.cc: Include "object.h". 5492 (ctors_sections_in_init_array): New static variable. 5493 (Layout::is_ctors_in_init_array): New function. 5494 (Layout::layout): Add entry to ctors_sections_in_init_array if 5495 appropriate. 5496 * layout.h (class Layout): Declare is_ctors_in_init_array. 5497 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if 5498 is_ctors_reverse_view is set. 5499 (Sized_relobj_file::write_sections): Add layout parameter. Change 5500 all callers. Set is_ctors_reverse_view field of View_size. 5501 (Sized_relobj_file::reverse_words): New function. 5502 * object.h (Sized_relobj_file::View_size): Add 5503 is_ctors_reverse_view field. 5504 (class Sized_relobj_file): Update declarations. 5505 * testsuite/initpri3.c: New test. 5506 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and 5507 initpri3b. 5508 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables. 5509 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables. 5510 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables. 5511 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables. 5512 * testsuite/Makefile.in: Rebuild. 5513 5514 2011-06-24 Cary Coutant <ccoutant (a] google.com> 5515 5516 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir. 5517 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o) 5518 (debug_msg_cdebug.err): New targets. 5519 * testsuite/Makefile.in: Regenerate. 5520 * testsuite/debug_msg.sh: Check output of link with compressed debug. 5521 Fix checks for link with shared library. 5522 5523 2011-06-24 Doug Kwan <dougkwan (a] google.com> 5524 5525 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not 5526 skip empty text sections. 5527 * testsuite/arm_exidx_test.s: Test handling of an empty text section. 5528 5529 2011-06-22 Ian Lance Taylor <iant (a] google.com> 5530 5531 PR gold/12910 5532 * options.h (class General_options): Add --ctors-in-init-array. 5533 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and 5534 friends as SHT_PROGBITS for merging sections. 5535 (Layout::layout): Remove special handling of .init_array and 5536 friends. Don't sort if doing relocatable link. Sort for .ctors 5537 and .dtors if ctors_in_init_array. 5538 (Layout::make_output_section): Force correct section types for 5539 .init_array and friends. Don't sort if doing relocatable link, 5540 Don't sort .ctors and .dtors if ctors_in_init_array. 5541 (Layout::section_name_mapping): Remove .ctors. and .dtorso. 5542 (Layout::output_section_name): Add relobj parameter. Change all 5543 callers. Handle .ctors. and .dtors. in code rather than table. 5544 Handle .ctors and .dtors if ctors_in_init_array. 5545 (Layout::match_file_name): New function, moved from output.cc. 5546 * layout.h (class Layout): Update declarations. 5547 * output.cc: Include "layout.h". 5548 (Input_section_sort_entry::get_priority): New function. 5549 (Input_section_sort_entry::match_file_name): Just call 5550 Layout::match_file_name. 5551 (Output_section::Input_section_sort_init_fini_compare::operator()): 5552 Handle .ctors and .dtors. Sort by explicit priority rather than 5553 by name. 5554 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional. 5555 * testsuite/initpri2.c: New test. 5556 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY. 5557 (check_PROGRAMS): Add initpri2. 5558 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables. 5559 (initpri2_LDFLAGS, initpri2_LDADD): New variables. 5560 * configure, testsuite/Makefile.in: Rebuild. 5561 5562 2011-06-19 Ian Lance Taylor <iant (a] google.com> 5563 5564 PR gold/12880 5565 * layout.cc (Layout::attach_allocated_section_to_segment): Add a 5566 .interp section to a PT_INTERP segment even if we have seen a 5567 --dynamic-linker option. Don't do it if we have seen a PHDRS 5568 clause in a linker script. 5569 (Layout::finalize): Don't create a .interp section if we've 5570 already create a PT_INTERP segment. 5571 (Layout::create_interp): Always call choose_output_section (revert 5572 patch of 2011-06-17). Don't create PT_INTERP segment. 5573 * script-sections.cc 5574 (Script_sections::create_note_and_tls_segments): Add a .interp 5575 section to a PT_INTERP segment even if we have seen a 5576 --dynamic-linker option. 5577 5578 2011-06-18 Ian Lance Taylor <iant (a] google.com> 5579 5580 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL 5581 merely because a non-PT_LOAD segment has a dynamic reloc. 5582 5583 2011-06-18 Ian Lance Taylor <iant (a] google.com> 5584 5585 * layout.cc (Layout::finish_dynamic_section): Don't create 5586 DT_FLAGS entry if not needed. 5587 5588 2011-06-18 Ian Lance Taylor <iant (a] google.com> 5589 5590 PR gold/12745 5591 * layout.cc (Layout::layout_eh_frame): Correct handling of 5592 writable .eh_frame section. 5593 5594 2011-06-17 Ian Lance Taylor <iant (a] google.com> 5595 5596 PR gold/12893 5597 * resolve.cc (Symbol_table::resolve): Don't give an error if a 5598 symbol is redefined with the exact same object and value. 5599 5600 2011-06-17 Ian Lance Taylor <iant (a] google.com> 5601 5602 PR gold/12880 5603 * layout.h (class Layout): Add interp_segment_ field. 5604 * layout.cc (Layout::Layout): Initialize interp_segment_ field. 5605 (Layout::attach_allocated_section_to_segment): If making shared 5606 library, put .interp section in PT_INTERP segment. 5607 (Layout::finalize): Also call create_interp if -dynamic-linker 5608 option was used. 5609 (Layout::create_interp): Assert that there is no PT_INTERP 5610 segment. If not using a SECTIONS clause, use make_output_section. 5611 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP. 5612 * script-sections.cc 5613 (Script_sections::create_note_and_tls_segments): If making shared 5614 library, put .interp section in PT_INTERP segment. 5615 5616 2011-06-17 Ian Lance Taylor <iant (a] google.com> 5617 5618 * object.cc (Sized_relobj_file::do_layout): Keep warning sections 5619 when making a shared library. 5620 5621 2011-06-17 Ian Lance Taylor <iant (a] google.com> 5622 5623 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym 5624 parameter. Change all callers. Don't issue warning about PC32 5625 against locally defined symbol. 5626 5627 2011-06-16 Ian Lance Taylor <iant (a] google.com> 5628 5629 * symtab.cc (Warnings::issue_warning): Don't warn if relocation 5630 occurs in same object. 5631 5632 2011-06-14 Alan Modra <amodra (a] gmail.com> 5633 5634 * po/POTFILES.in: Regenerate. 5635 5636 2011-06-09 Ian Lance Taylor <iant (a] google.com> 5637 5638 * script-sections.cc 5639 (Orphan_output_section::set_section_addresses): For a relocatable 5640 link set address to 0. 5641 5642 2011-06-09 Cary Coutant <ccoutant (a] google.com> 5643 5644 PR gold/12804 5645 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is 5646 used with --compress-debug-sections. 5647 * gold/object.cc (Sized_relobj_file::do_layout): Report 5648 uncompressed size of compressed input sections. 5649 5650 2011-06-08 Cary Coutant <ccoutant (a] google.com> 5651 5652 PR gold/12804 5653 * testsuite/two_file_test_2_v1.cc: Change initialization of 5654 v2 to keep it in .data. 5655 5656 2011-06-07 Cary Coutant <ccoutant (a] google.com> 5657 5658 * common.cc (Symbol_table::do_allocate_commons_list): Call 5659 gold_fallback. 5660 * errors.cc (Errors::fatal): Adjust call to gold_exit. 5661 (Errors::fallback): New function. 5662 (gold_fallback): New function. 5663 * errors.h (Errors::fallback): New function. 5664 * gold.cc (gold_exit): Change status parameter to enum; adjust 5665 all callers. 5666 (queue_initial_tasks): Call gold_fallback. 5667 * gold.h: Include cstdlib. 5668 (Exit_status): New enum type. 5669 (gold_exit): Change status parameter to enum. 5670 (gold_fallback): New function. 5671 * layout.cc (Layout::set_section_offsets): Call gold_fallback. 5672 (Layout::create_symtab_sections): Likewise. 5673 (Layout::create_shdrs): Likewise. 5674 * main.cc (main): Adjust call to gold_exit. 5675 * output.cc (Output_data_got::add_got_entry): Call gold_fallback. 5676 (Output_data_got::add_got_entry_pair): Likewise. 5677 (Output_section::add_input_section): Likewise. 5678 (Output_section::add_output_section_data): Likewise. 5679 (Output_segment::set_section_list_addresses): Likewise. 5680 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise. 5681 5682 2011-06-07 Cary Coutant <ccoutant (a] google.com> 5683 5684 * layout.cc (Layout::set_segment_offsets): Don't adjust layout 5685 for incremental links. 5686 * output.cc (Output_segment::set_section_list_addresses): Remove 5687 FIXME and test for TLS or BSS. 5688 5689 2011-06-07 Cary Coutant <ccoutant (a] google.com> 5690 5691 * testsuite/Makefile.am: Add incremental_copy_test, 5692 incremental_common_test_1. 5693 * testsuite/Makefile.in: Regenerate. 5694 * testsuite/common_test_1_v1.c: New source file. 5695 * testsuite/common_test_1_v2.c: New source file. 5696 * testsuite/copy_test_v1.cc: New source file. 5697 5698 2011-06-07 Cary Coutant <ccoutant (a] google.com> 5699 5700 * common.cc (Symbol_table::do_allocate_commons_list): For incremental 5701 update, allocate common from bss section's free list. 5702 * incremental-dump.cc (dump_incremental_inputs): Print flag for 5703 linker-defined symbols. 5704 * incremental.cc (Sized_incremental_binary::do_process_got_plt): 5705 Skip GOT and PLT entries that are no longer referenced. 5706 (Output_section_incremental_inputs::write_info_blocks): Mark 5707 linker-defined symbols. 5708 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols. 5709 * output.cc (Output_section::allocate): New function. 5710 * output.h (Output_section::allocate): New function. 5711 * resolve.cc (Symbol_table::report_resolve_problem): Add case for 5712 linker-defined symbols. 5713 (Symbol::override_base_with_special): Copy is_predefined_ flag. 5714 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag. 5715 (Symbol::init_base_output_data): Likewise. 5716 (Symbol::init_base_output_segment): Likewise. 5717 (Symbol::init_base_constant): Likewise. 5718 (Sized_symbol::init_output_data): Likewise. 5719 (Sized_symbol::init_output_segment): Likewise. 5720 (Sized_symbol::init_constant): Likewise. 5721 (Symbol_table::do_define_in_output_data): Likewise. 5722 (Symbol_table::do_define_in_output_segment): Likewise. 5723 (Symbol_table::do_define_as_constant): Likewise. 5724 * symtab.h (Symbol::is_predefined): New function. 5725 (Symbol::init_base_output_data): Add is_predefined parameter. 5726 (Symbol::init_base_output_segment): Likewise. 5727 (Symbol::init_base_constant): Likewise. 5728 (Symbol::is_predefined_): New data member. 5729 (Sized_symbol::init_output_data): Add is_predefined parameter. 5730 (Sized_symbol::init_output_segment): Likewise. 5731 (Sized_symbol::init_constant): Likewise. 5732 (enum Symbol_table::Defined): Add INCREMENTAL_BASE. 5733 5734 2011-06-07 Cary Coutant <ccoutant (a] google.com> 5735 5736 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc 5737 instead of emit_copy_reloc. 5738 (Copy_relocs::emit_copy_reloc): Refactor. 5739 (Copy_relocs::make_copy_reloc): New function. 5740 (Copy_relocs::add_copy_reloc): Remove. 5741 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public 5742 section. 5743 (Copy_relocs::make_copy_reloc): New function. 5744 (Copy_relocs::add_copy_reloc): Remove. 5745 * gold.cc (queue_middle_tasks): Emit old COPY relocations from 5746 unchanged input files. 5747 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag. 5748 * incremental.cc (Sized_incremental_binary::do_reserve_layout): 5749 Reserve BSS space for COPY relocations. 5750 (Sized_incremental_binary::do_emit_copy_relocs): New function. 5751 (Output_section_incremental_inputs::write_info_blocks): Record 5752 whether a symbol is copied from a shared object. 5753 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations. 5754 * incremental.h (enum Incremental_shlib_symbol_flags): New type. 5755 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant. 5756 (Incremental_input_entry_reader::get_output_symbol_index): Add 5757 is_copy parameter. 5758 (Incremental_binary::emit_copy_relocs): New function. 5759 (Incremental_binary::do_emit_copy_relocs): New function. 5760 (Sized_incremental_binary::Sized_incremental_binary): Initialize 5761 new data member. 5762 (Sized_incremental_binary::add_copy_reloc): New function. 5763 (Sized_incremental_binary::do_emit_copy_relocs): New function. 5764 (Sized_incremental_binary::Copy_reloc): New struct. 5765 (Sized_incremental_binary::Copy_relocs): New typedef. 5766 (Sized_incremental_binary::copy_relocs_): New data member. 5767 * symtab.cc (Symbol_table::add_from_incrobj): Change return type. 5768 * symtab.h (Symbol_table::add_from_incrobj): Change return type. 5769 * target.h (Sized_target::emit_copy_reloc): New function. 5770 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function. 5771 5772 2011-06-02 Cary Coutant <ccoutant (a] google.com> 5773 5774 PR gold/12163 5775 * gold/archive.cc (Archive::Archive): Initialize new data member. 5776 (Archive::include_all_members): Return if archive has already been 5777 included. 5778 * gold/archive.h (Archive::include_all_members_): New data member. 5779 5780 2011-06-02 Nick Clifton <nickc (a] redhat.com> 5781 5782 * dynobj.h: Fix spelling mistake in comment. 5783 * output.cc: Likewise. 5784 5785 2011-05-31 Doug Kwan <dougkwan (a] google.com> 5786 Asier Llano 5787 5788 PR gold/12826 5789 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of 5790 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH. 5791 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove 5792 redundant arm_exidx_test.so. 5793 * testsuite/Makefile.in: Regenerate. 5794 (check_SCRIPTS): Add pr12826.sh 5795 (check_DATA): Add pr12826.stdout 5796 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules. 5797 * testsuite/pr12826.sh: New file. 5798 * testsuite/pr12826_1.s: Ditto. 5799 * testsuite/pr12826_1.s: Ditto. 5800 5801 2011-05-30 Ian Lance Taylor <iant (a] google.com> 5802 5803 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc 5804 sections. 5805 5806 2011-05-29 Ian Lance Taylor <iant (a] google.com> 5807 5808 PR gold/12804 5809 * testsuite/Makefile.am: Use different file name for two_file_test 5810 temporary file for each incremental test. 5811 * testsuite/Makefile.in: Rebuild. 5812 5813 2011-05-29 Ian Lance Taylor <iant (a] google.com> 5814 5815 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the 5816 binary input file is empty. 5817 5818 2011-05-27 Ian Lance Taylor <iant (a] google.com> 5819 5820 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,. 5821 (ver_test_9.so): Likewise. 5822 * testsuite/Makefile.in: Rebuild. 5823 5824 2011-05-26 Cary Coutant <ccoutant (a] google.com> 5825 5826 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups. 5827 * incremental.cc (Incremental_inputs::report_input_section): Fix 5828 comment, indentation. 5829 (Incremental_inputs::report_comdat_group): New function. 5830 (Output_section_incremental_inputs::set_final_data_size): Adjust size 5831 of data for incremental input file entry. 5832 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT 5833 group count, COMDAT group signatures. 5834 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from 5835 an unchanged input file. 5836 * incremental.h (Incremental_object_entry::Incremental_object_entry): 5837 Initialize new data member. 5838 (Incremental_object_entry::add_comdat_group): New function. 5839 (Incremental_object_entry::get_comdat_group_count): New function. 5840 (Incremental_object_entry::get_comdat_signature_key): New function. 5841 (Incremental_object_entry::groups_): New data member. 5842 (Incremental_inputs::report_comdat_group): New function. 5843 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of 5844 data for incremental input file entry. 5845 (Incremental_input_entry_reader::get_comdat_group_count): New function. 5846 (Incremental_input_entry_reader::get_input_section): Adjust size of 5847 data for incremental input file entry. 5848 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise. 5849 (Incremental_input_entry_reader::get_comdat_group_signature): New 5850 function. 5851 * object.cc (Sized_relobj::include_section_group): Report kept 5852 COMDAT groups for incremental links. 5853 5854 2011-05-24 David Meyer <pdox (a] google.com> 5855 5856 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters 5857 with name parameter. Add found_name parameter. 5858 * fileread.cc (Input_file::find_file): Adjust code accordingly. 5859 * dirsearch.h (class Dirsearch): Update declaration. 5860 5861 2011-05-24 Ian Lance Taylor <iant (a] google.com> 5862 5863 * archive.cc (Library_base::should_include_member): Pull in object 5864 from archive if it defines the entry symbol. 5865 * parameters.cc (Parameters::entry): New function. 5866 * parameters.h (class Parameters): Declare entry. 5867 * output.h (class Output_file_header): Remove entry_ field. 5868 * output.cc (Output_file_header::Output_file_header): Remove entry 5869 parameter. Change all callers. 5870 (Output_file_header::entry): Use parameters->entry. 5871 * gold.cc (queue_middle_tasks): Likewise. 5872 * plugin.cc (Plugin_hook::run): Likewise. 5873 5874 2011-05-24 Cary Coutant <ccoutant (a] google.com> 5875 5876 * gold.cc (queue_initial_tasks): Pass incremental base filename 5877 to Output_file::open_base_file; don't print error message. 5878 * incremental-dump.cc (main): Adjust call to 5879 Output_file::open_for_modification. 5880 * incremental-dump.cc (main): Likewise. 5881 * incremental.cc (Incremental_inputs::report_command_line): 5882 Ignore --incremental-base option when comparing command lines. 5883 Ignore parameter when given as separate argument. 5884 * options.h (class General_options): Add --incremental-base. 5885 * output.cc (Output_file::Output_file): 5886 (Output_file::open_base_file): Add base_name and writable parameters; 5887 read base file into new file; print error message here. 5888 (Output_file::map_no_anonymous): Add writable parameter; adjust all 5889 callers. 5890 * output.h (Output_file::open_for_modification): Rename to... 5891 (Output_file::open_base_file): ...this; add base_name and 5892 writable parameters; adjust all callers. 5893 (Output_file::map_no_anonymous): Add writable parameter; adjust all 5894 callers. 5895 * testsuite/Makefile.am (incremental_test_4): Test 5896 --incremental-base. 5897 * testsuite/Makefile.in: Regenerate. 5898 5899 2011-05-24 Cary Coutant <ccoutant (a] google.com> 5900 5901 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3, 5902 incremental_test_4. 5903 * testsuite/Makefile.in: Regenerate. 5904 * testsuite/two_file_test_1_v1.cc: New test source file. 5905 * testsuite/two_file_test_1b_v1.cc: New test source file. 5906 * testsuite/two_file_test_2_v1.cc: New test source file. 5907 5908 2011-05-24 Cary Coutant <ccoutant (a] google.com> 5909 5910 * dynobj.h (Dynobj::do_dynobj): New function. 5911 * incremental-dump.cc (dump_incremental_inputs): Print as_needed 5912 flag and soname for shared objects. 5913 * incremental.cc (Incremental_inputs::report_object): Make 5914 either Incremental_object_entry or Incremental_dynobj_entry; add 5915 soname to string table. 5916 (Incremental_inputs::report_input_section): Add assertion. 5917 (Output_section_incremental_inputs::set_final_data_size): Adjust 5918 type of input file entry for shared libraries; adjust size of 5919 shared library info entry. 5920 (Output_section_incremental_inputs::write_input_files): Write 5921 as_needed flag for shared libraries. 5922 (Output_section_incremental_inputs::write_info_blocks): Adjust type 5923 of input file entry for shared libraries; write soname. 5924 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and 5925 soname from incremental info. 5926 * incremental.h (enum Incremental_input_flags): Add 5927 INCREMENTAL_INPUT_AS_NEEDED. 5928 (Incremental_input_entry::Incremental_input_entry): Initialize new 5929 data member. 5930 (Incremental_input_entry::set_as_needed): New function. 5931 (Incremental_input_entry::as_needed): New function. 5932 (Incremental_input_entry::do_dynobj_entry): New function. 5933 (Incremental_input_entry::as_needed_): New data member. 5934 (Incremental_object_entry::Incremental_object_entry): Don't check 5935 for shared library. 5936 (Incremental_object_entry::do_type): Likewise. 5937 (class Incremental_dynobj_entry): New class. 5938 (Incremental_input_entry_reader::as_needed): New function. 5939 (Incremental_input_entry_reader::get_soname): New function. 5940 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite. 5941 (Incremental_input_entry_reader::get_output_symbol_index): Adjust 5942 size of shared library info entry. 5943 * layout.cc (Layout::finish_dynamic_section): Don't test for 5944 incremental link when adding DT_NEEDED entries. 5945 * object.h (Object::Object): Initialize new data member. 5946 (Object::dynobj): New function. 5947 (Object::set_as_needed): New function. 5948 (Object::as_needed): New function. 5949 (Object::do_dynobj): New function. 5950 (Object::as_needed_): New data member. 5951 5952 2011-05-24 Cary Coutant <ccoutant (a] google.com> 5953 5954 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc 5955 info; adjust display of GOT entries. 5956 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate 5957 vector of input objects; remove file_status_. 5958 (Sized_incremental_binary::do_reserve_layout): Remove file_status_. 5959 (Sized_incremental_binary::do_process_got_plt): Adjust calls to 5960 got_plt reader; call target hooks to reserve GOT entries. 5961 (Output_section_incremental_inputs::set_final_data_size): Adjust size 5962 of input file info header and GOT info entry. 5963 (Output_section_incremental_inputs::write_info_blocks): Write dynamic 5964 relocation info. 5965 (Got_plt_view_info::got_descriptor): Remove. 5966 (Got_plt_view_info::sym_index): New data member. 5967 (Got_plt_view_info::input_index): New data member. 5968 (Local_got_offset_visitor::visit): Write input file index. 5969 (Global_got_offset_visitor::visit): Write 0 for input file index. 5970 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor 5971 with sym_index and input_index. 5972 (Output_section_incremental_inputs::write_got_plt): Adjust size of 5973 incremental info GOT entry; replace got_descriptor with input_index. 5974 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record 5975 map from input file index to object. 5976 (Sized_relobj_incr::do_layout): Replace direct data member reference 5977 with accessor function. 5978 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class. 5979 * incremental.h (Incremental_input_entry_reader::get_symbol_offset): 5980 Adjust size of input file info header. 5981 (Incremental_input_entry_reader::get_first_dyn_reloc): New function. 5982 (Incremental_input_entry_reader::get_dyn_reloc_count): New function. 5983 (Incremental_input_entry_reader::get_input_section): Adjust size of 5984 input file info header. 5985 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size 5986 of incremental info GOT entry. 5987 (Incremental_got_plt_reader::get_got_desc): Remove. 5988 (Incremental_got_plt_reader::get_got_symndx): New function. 5989 (Incremental_got_plt_reader::get_got_input_index): New function. 5990 (Sized_incremental_binary::Sized_incremental_binary): Remove 5991 file_status_; add input_objects_. 5992 (Sized_incremental_binary::~Sized_incremental_binary): Remove. 5993 (Sized_incremental_binary::set_file_is_unchanged): Remove. 5994 (Sized_incremental_binary::file_is_unchanged): Remove. 5995 (Sized_incremental_binary::set_input_object): New function. 5996 (Sized_incremental_binary::input_object): New function. 5997 (Sized_incremental_binary::file_status_): Remove. 5998 (Sized_incremental_binary::input_objects_): New data member. 5999 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all 6000 references. 6001 (Sized_relobj_incr::invalid_address): Move to base class. 6002 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base 6003 class. 6004 (Sized_relobj_incr::do_output_section_offset): Likewise. 6005 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise. 6006 (Sized_relobj_incr::section_offsets_): Likewise. 6007 * object.cc (Sized_relobj::do_for_all_local_got_entries): New 6008 function. 6009 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_. 6010 (Sized_relobj_file::layout_section): Replace refs to section_offsets_ 6011 with accessor function. 6012 (Sized_relobj_file::do_layout): Likewise. 6013 (Sized_relobj_file::do_layout_deferred_sections): Likewise. 6014 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class. 6015 (Sized_relobj_file::compute_final_local_value): Replace refs to 6016 section_offsets_ with accessor function. 6017 (Sized_relobj_file::do_finalize_local_symbols): Likewise. 6018 * object.h (Relobj::Relobj): Initialize new data members. 6019 (Relobj::add_dyn_reloc): New function. 6020 (Relobj::first_dyn_reloc): New function. 6021 (Relobj::dyn_reloc_count): New function. 6022 (Relobj::first_dyn_reloc_): New data member. 6023 (Relobj::dyn_reloc_count_): New data member. 6024 (Sized_relobj): Rename Sized_relobj_base to this; adjust all 6025 references. 6026 (Sized_relobj::Address): New typedef. 6027 (Sized_relobj::invalid_address): Move here from child class. 6028 (Sized_relobj::Sized_relobj): Initialize new data members. 6029 (Sized_relobj::sized_relobj): New function. 6030 (Sized_relobj::is_output_section_offset_invalid): Move here from 6031 child class. 6032 (Sized_relobj::get_output_section_offset): Likewise. 6033 (Sized_relobj::local_has_got_offset): Likewise. 6034 (Sized_relobj::local_got_offset): Likewise. 6035 (Sized_relobj::set_local_got_offset): Likewise. 6036 (Sized_relobj::do_for_all_local_got_entries): Likewise. 6037 (Sized_relobj::clear_got_offsets): New function. 6038 (Sized_relobj::section_offsets): Move here from child class. 6039 (Sized_relobj::do_output_section_offset): Likewise. 6040 (Sized_relobj::do_set_section_offset): Likewise. 6041 (Sized_relobj::Local_got_offsets): Likewise. 6042 (Sized_relobj::local_got_offsets_): Likewise. 6043 (Sized_relobj::section_offsets_): Likewise. 6044 (Sized_relobj_file): Rename Sized_relobj to this; adjust all 6045 references. 6046 (Sized_relobj_file::is_output_section_offset_invalid): Move to base 6047 class. 6048 (Sized_relobj_file::sized_relobj): New function 6049 (Sized_relobj_file::local_has_got_offset): Move to base class. 6050 (Sized_relobj_file::local_got_offset): Likewise. 6051 (Sized_relobj_file::set_local_got_offset): Likewise. 6052 (Sized_relobj_file::get_output_section_offset): Likewise. 6053 (Sized_relobj_file::do_for_all_local_got_entries): Likewise. 6054 (Sized_relobj_file::do_output_section_offset): Likewise. 6055 (Sized_relobj_file::do_set_section_offset): Likewise. 6056 (Sized_relobj_file::Local_got_offsets): Likewise. 6057 (Sized_relobj_file::local_got_offsets_): Likewise. 6058 (Sized_relobj_file::section_offsets_): Likewise. 6059 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj 6060 (all constructors). 6061 (set_needs_dynsym_index): Convert relobj to derived class pointer. 6062 (Output_reloc::get_symbol_index): Likewise. 6063 (Output_reloc::local_section_offset): Likewise. 6064 (Output_reloc::get_address): Likewise. 6065 (Output_reloc::symbol_value): Likewise. 6066 (Output_data_got::reserve_slot): Move to class definition. 6067 (Output_data_got::reserve_local): New function. 6068 (Output_data_got::reserve_slot_for_global): Remove. 6069 (Output_data_got::reserve_global): New function. 6070 * output.h (Output_reloc::Output_reloc): Adjust type of relobj 6071 (all constructors, two instantiations). 6072 (Output_reloc::get_relobj): New function (two instantiations). 6073 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type. 6074 (Output_data_reloc_base::add): Convert relobj to derived class pointer. 6075 (Output_data_reloc::add_global): Adjust type of relobj. 6076 (Output_data_reloc::add_global_relative): Likewise. 6077 (Output_data_reloc::add_symbolless_global_addend): Likewise. 6078 (Output_data_reloc::add_local): Likewise. 6079 (Output_data_reloc::add_local_relative): Likewise. 6080 (Output_data_reloc::add_symbolless_local_addend): Likewise. 6081 (Output_data_reloc::add_local_section): Likewise. 6082 (Output_data_reloc::add_output_section): Likewise. 6083 (Output_data_reloc::add_absolute): Likewise. 6084 (Output_data_reloc::add_target_specific): Likewise. 6085 (Output_data_got::reserve_slot): Move definition here. 6086 (Output_data_got::reserve_local): New function. 6087 (Output_data_got::reserve_global): New function. 6088 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to 6089 section_offsets_ with accessor function. 6090 (Sized_relobj_file::write_sections): Likewise. 6091 (Sized_relobj_file::do_relocate_sections): Likewise. 6092 * target.h (Sized_target::reserve_local_got_entry): New function. 6093 (Sized_target::reserve_global_got_entry): New function. 6094 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function. 6095 (Target_x86_64::reserve_global_got_entry): New function. 6096 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section. 6097 6098 2011-05-23 Cary Coutant <ccoutant (a] google.com> 6099 6100 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries. 6101 * incremental-dump.cc (dump_incremental_inputs): Mask high-order 6102 bit when checking got_type. 6103 * incremental.cc (Sized_incremental_binary::setup_readers): 6104 Store symbol table and string table locations; initialize bit vector 6105 of file status flags. 6106 (Sized_incremental_binary::do_reserve_layout): Set bit flag for 6107 unchanged files. 6108 (Sized_incremental_binary::do_process_got_plt): New function. 6109 (Sized_incremental_binary::get_symtab_view): Use stored locations. 6110 (Output_section_incremental_inputs::set_final_data_size): Record 6111 file index for each input file. 6112 (Output_section_incremental_inputs::write_got_plt): Store file index 6113 instead of input entry offset for each GOT entry. 6114 * incremental.h 6115 (Incremental_input_entry::Incremental_input_entry): Initialize new 6116 data member. 6117 (Incremental_input_entry::set_offset): Store file index. 6118 (Incremental_input_entry::get_file_index): New function. 6119 (Incremental_input_entry::file_index_): New data member. 6120 (Incremental_binary::process_got_plt): New function. 6121 (Incremental_binary::do_process_got_plt): New function. 6122 (Sized_incremental_binary::Sized_incremental_binary): Initialize new 6123 data members. 6124 (Sized_incremental_binary::~Sized_incremental_binary): New destructor. 6125 (Sized_incremental_binary::set_file_is_unchanged): New function. 6126 (Sized_incremental_binary::file_is_unchanged): New function. 6127 (Sized_incremental_binary::do_process_got_plt): New function. 6128 (Sized_incremental_binary::file_status_): New data member. 6129 (Sized_incremental_binary::main_symtab_loc_): New data member. 6130 (Sized_incremental_binary::main_strtab_loc_): New data member. 6131 * output.cc (Output_data_got::Got_entry::write): Add case 6132 RESERVED_CODE. 6133 (Output_data_got::add_global): Call add_got_entry. 6134 (Output_data_got::add_global_plt): Likewise. 6135 (Output_data_got::add_global_with_rel): Likewise. 6136 (Output_data_got::add_global_with_rela): Likewise. 6137 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair. 6138 (Output_data_got::add_global_pair_with_rela): Likewise. 6139 (Output_data_got::add_local): Call add_got_entry. 6140 (Output_data_got::add_local_plt): Likewise. 6141 (Output_data_got::add_local_with_rel): Likewise. 6142 (Output_data_got::add_local_with_rela): Likewise. 6143 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair. 6144 (Output_data_got::add_local_pair_with_rela): Likewise. 6145 (Output_data_got::reserve_slot): New function. 6146 (Output_data_got::reserve_slot_for_global): New function. 6147 (Output_data_got::add_got_entry): New function. 6148 (Output_data_got::add_got_entry_pair): New function. 6149 (Output_section::add_output_section_data): Edit FIXME. 6150 * output.h 6151 (Output_section_data_build::Output_section_data_build): New 6152 constructor with size parameter. 6153 (Output_data_space::Output_data_space): Likewise. 6154 (Output_data_got::Output_data_got): Initialize new data member; new 6155 constructor with size parameter. 6156 (Output_data_got::add_constant): Call add_got_entry. 6157 (Output_data_got::reserve_slot): New function. 6158 (Output_data_got::reserve_slot_for_global): New function. 6159 (class Output_data_got::Got_entry): Add RESERVED_CODE. 6160 (Output_data_got::add_got_entry): New function. 6161 (Output_data_got::add_got_entry_pair): New function. 6162 (Output_data_got::free_list_): New data member. 6163 * target.h (Sized_target::init_got_plt_for_update): New function. 6164 (Sized_target::register_global_plt_entry): New function. 6165 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64): 6166 Initialize new data member; call init; add constructor with PLT count. 6167 (Output_data_plt_x86_64::init): New function. 6168 (Output_data_plt_x86_64::add_relocation): New function. 6169 (Output_data_plt_x86_64::reserve_slot): New function. 6170 (Output_data_plt_x86_64::free_list_): New data member. 6171 (Target_x86_64::init_got_plt_for_update): New function. 6172 (Target_x86_64::register_global_plt_entry): New function. 6173 (Output_data_plt_x86_64::add_entry): Allocate from free list for 6174 incremental updates. 6175 (Output_data_plt_x86_64::add_relocation): New function. 6176 * testsuite/object_unittest.cc (Object_test): Set default options. 6177 6178 2011-05-16 Ian Lance Taylor <iant (a] google.com> 6179 6180 * options.h (class General_options): Make -i a synonym for -r. 6181 6182 2011-05-16 Ian Lance Taylor <iant (a] google.com> 6183 6184 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes. 6185 6186 2011-05-10 Cary Coutant <ccoutant (a] google.com> 6187 6188 * object.cc (Sized_relobj::do_count_local_symbols): Check for 6189 strip_all (-s). 6190 6191 2011-05-06 Ian Lance Taylor <iant (a] google.com> 6192 6193 * layout.cc (Layout::layout): If the output section flags change, 6194 update the ordering. 6195 6196 2011-04-25 Cary Coutant <ccoutant (a] google.com> 6197 6198 * incremental-dump.cc (dump_incremental_inputs): Print local 6199 symbol info for each input file. 6200 * incremental.cc 6201 (Output_section_incremental_inputs::set_final_data_size): Add local 6202 symbol info to input file entries in incremental info. 6203 (Output_section_incremental_inputs::write_info_blocks): Likewise. 6204 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members. 6205 (Sized_incr_relobj::do_add_symbols): Cosmetic change. 6206 (Sized_incr_relobj::do_count_local_symbols): Replace stub with 6207 implementation. 6208 (Sized_incr_relobj::do_finalize_local_symbols): Likewise. 6209 (Sized_incr_relobj::do_relocate): Write the local symbols. 6210 (Sized_incr_dynobj::do_add_symbols): Cosmetic change. 6211 * incremental.h (Incremental_inputs_reader::get_symbol_offset): 6212 Adjust size of input file header. 6213 (Incremental_inputs_reader::get_local_symbol_offset): New function. 6214 (Incremental_inputs_reader::get_local_symbol_count): New function. 6215 (Incremental_inputs_reader::get_input_section): Adjust size of input 6216 file header. 6217 (Incremental_inputs_reader::get_global_symbol_reader): Likewise. 6218 (Sized_incr_relobj::This): New typedef. 6219 (Sized_incr_relobj::sym_size): New const data member. 6220 (Sized_incr_relobj::Local_symbol): New struct. 6221 (Sized_incr_relobj::do_output_local_symbol_count): New function. 6222 (Sized_incr_relobj::do_local_symbol_offset): New function. 6223 (Sized_incr_relobj::local_symbol_count_): New data member. 6224 (Sized_incr_relobj::output_local_dynsym_count_): New data member. 6225 (Sized_incr_relobj::local_symbol_index_): New data member. 6226 (Sized_incr_relobj::local_symbol_offset_): New data member. 6227 (Sized_incr_relobj::local_dynsym_offset_): New data member. 6228 (Sized_incr_relobj::local_symbols_): New data member. 6229 * object.h (Relobj::output_local_symbol_count): New function. 6230 (Relobj::local_symbol_offset): New function. 6231 (Relobj::do_output_local_symbol_count): New function. 6232 (Relobj::do_local_symbol_offset): New function. 6233 (Sized_relobj::do_output_local_symbol_count): New function. 6234 (Sized_relobj::do_local_symbol_offset): New function. 6235 6236 2011-04-22 Vladimir Simonov <sv (a] sw.ru> 6237 6238 * descriptors.cc (set_close_on_exec): New function. 6239 (Descriptors::open): Use set_close_on_exec. 6240 * output.cc (S_ISLNK): Define if not defined. 6241 6242 2011-04-22 Cary Coutant <ccoutant (a] google.com> 6243 6244 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate 6245 global symbol map. 6246 (Sized_incremental_binary::do_apply_incremental_relocs): New function. 6247 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map. 6248 (Sized_incr_relobj::do_relocate): Remap section indices in incremental 6249 relocations. 6250 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map. 6251 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME. 6252 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise. 6253 * incremental.h 6254 (Incremental_inputs_reader::global_symbol_reader_at_offset): New 6255 function. 6256 (Incremental_binary::apply_incremental_relocs): New function. 6257 (Incremental_binary::do_apply_incremental_relocs): New function. 6258 (Sized_incremental_binary::Sized_incremental_binary): Initialize new 6259 data member. 6260 (Sized_incremental_binary::add_global_symbol): New function. 6261 (Sized_incremental_binary::global_symbol): New function. 6262 (Sized_incremental_binary::do_apply_incremental_relocs): New function. 6263 (Sized_incremental_binary::symbol_map_): New data member. 6264 * layout.cc (Layout_task_runner::run): Apply incremental relocations. 6265 * target.h (Sized_target::apply_relocation): New function. 6266 * target-reloc.h (apply_relocation): New function. 6267 * x86_64.cc (Target_x86_64::apply_relocation): New function. 6268 6269 2011-04-22 Doug Kwan <dougkwan (a] google.com> 6270 6271 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER 6272 flag of a SHT_ARM_EXIDX section. 6273 * testsuite/Makefile.am (arm_exidx_test): New test rules. 6274 * testsuite/Makefile.in: Regenerate. 6275 * testsuite/arm_exidx_test.s: New file. 6276 * testsuite/arm_exidx_test.sh: Same. 6277 6278 2011-04-20 Cary Coutant <ccoutant (a] google.com> 6279 6280 PR gold/12689 6281 * archive.h (Incremental_archive_entry::Archive_member): 6282 Initialize arg_serial_ (second constructor). 6283 6284 2011-04-17 Ian Lance Taylor <iant (a] google.com> 6285 6286 * object.cc (Relocate_info::location): Simplify location string. 6287 * errors.cc (Errors::error_at_location): Don't print program 6288 name. 6289 (Errors::warning_at_location): Likewise. 6290 (Errors::undefined_symbol): Likewise. 6291 * testsuite/debug_msg.sh: Update accordingly. 6292 6293 2011-04-14 Cary Coutant <ccoutant (a] google.com> 6294 6295 * gold/layout.cc (Layout::symtab_section_offset): New function. 6296 * gold/layout.h (Layout::symtab_section_offset): New function. 6297 * gold/reloc.cc (Sized_relobj::do_relocate): Call it. 6298 6299 2011-04-12 Ian Lance Taylor <iant (a] google.com> 6300 6301 * configure.ac: Check for sys/mman.h and mmap. Check for mremap 6302 with MREMAP_MAYMOVE. 6303 * output.h (class Output_file): Add map_is_allocated_ field. 6304 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is 6305 not available, provide stubs. If mremap is not available, #define 6306 it to gold_mremap. 6307 (MREMAP_MAYMOVE): Define if not defined. 6308 (Output_file::Output_file): Initialize map_is_allocated_. 6309 (Output_file::resize): Check map_is_allocated_. 6310 (Output_file::map_anonymous): If mmap fails, use malloc. 6311 (Output_file::unmap): Don't do anything for an anonymous map. 6312 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap 6313 is not available, provide stubs. 6314 (File_read::View::~View): Use free rather than delete[]. 6315 (File_read::make_view): Use malloc rather than new[]. If mmap 6316 fails, use malloc. 6317 (File_read::find_or_make_view): Use malloc rather than new[]. 6318 * gold.h: Remove HAVE_REMAP code. 6319 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it 6320 exists. Rename mremap to gold_mremap. If mmap is not available 6321 don't do anything. 6322 * configure, config.in: Rebuild. 6323 6324 2011-04-11 Ian Lance Taylor <iant (a] google.com> 6325 6326 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always 6327 initialize local variable v. 6328 6329 2011-04-11 Cary Coutant <ccoutant (a] google.com> 6330 6331 * archive.cc (Archive::include_member): Adjust call to 6332 report_object. 6333 (Add_archive_symbols::run): Track argument serial numbers. 6334 (Lib_group::include_member): Likewise. 6335 (Add_lib_group_symbols::run): Adjust call to report_archive_begin. 6336 * archive.h (Incremental_archive_entry::Archive_member): 6337 Initialize arg_serial_. 6338 (Archive_member::arg_serial_): New data member. 6339 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL. 6340 (Sized_dynobj::do_add_symbols): Track symbols when doing an 6341 incremental link. 6342 (Sized_dynobj::do_for_all_local_got_entries): New function. 6343 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New 6344 function. 6345 * fileread.cc (get_mtime): New function. 6346 * fileread.h (get_mtime): New function. 6347 * gold.cc (queue_initial_tasks): Check for incremental update. 6348 (process_incremental_input): New function. 6349 (queue_middle_tasks): Don't force valid target for incremental 6350 update. 6351 * incremental-dump.cc (find_input_containing_global): Adjust 6352 size of symbol info entry. 6353 (dump_incremental_inputs): Dump argument serial number and 6354 in_system_directory flag; bias shndx by 1; print symbol names 6355 when dumping per-file symbol lists; use new symbol info readers. 6356 * incremental.cc 6357 (Output_section_incremental_inputs:update_data_size): New function. 6358 (Sized_incremental_binary::setup_readers): Setup input readers 6359 for each input file; build maps for files added from libraries 6360 and scripts. 6361 (Sized_incremental_binary::check_input_args): New function. 6362 (Sized_incremental_binary::do_check_inputs): Build map of argument 6363 serial numbers to input arguments. 6364 (Sized_incremental_binary::do_file_has_changed): Rename 6365 do_file_is_unchanged to this; compare file modification times. 6366 (Sized_incremental_binary::do_init_layout): New function. 6367 (Sized_incremental_binary::do_reserve_layout): New function. 6368 (Sized_incremental_binary::do_get_input_reader): Remove. 6369 (Sized_incremental_binary::get_symtab_view): New function. 6370 (Incremental_checker::can_incrementally_link_output_file): Remove. 6371 (Incremental_inputs::report_command_line): Exclude --debug options. 6372 (Incremental_inputs::report_archive_begin): Add parameter; track 6373 argument serial numbers; don't put input file entry for archive 6374 before archive members. 6375 (Incremental_inputs::report_archive_end): Put input file entry 6376 for archive after archive members. 6377 (Incremental_inputs::report_object): Add parameter; track argument 6378 serial numbers and in_system_directory flag. 6379 (Incremental_inputs::report_script): Add parameter; track argument 6380 serial numbers. 6381 (Output_section_incremental_inputs::set_final_data_size): Adjust 6382 size of symbol info entry; check for forwarding symbols. 6383 (Output_section_incremental_inputs::write_input_files): Write 6384 in_system_directory flag and argument serial number. 6385 (Output_section_incremental_inputs::write_info_blocks): Map section 6386 indices between incremental info and original input file; store 6387 input section index for each symbol. 6388 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor; 6389 change operator() to visit(). 6390 (class Global_got_offset_visitor): Likewise. 6391 (class Global_symbol_visitor_got_plt): 6392 (Output_section_incremental_inputs::write_got_plt): Use new visitor 6393 classes. 6394 (Sized_incr_relobj::Sized_incr_relobj): New constructor. 6395 (Sized_incr_relobj::do_read_symbols): New function. 6396 (Sized_incr_relobj::do_layout): New function. 6397 (Sized_incr_relobj::do_layout_deferred_sections): New function. 6398 (Sized_incr_relobj::do_add_symbols): New function. 6399 (Sized_incr_relobj::do_should_include_member): New function. 6400 (Sized_incr_relobj::do_for_all_global_symbols): New function. 6401 (Sized_incr_relobj::do_for_all_local_got_entries): New function. 6402 (Sized_incr_relobj::do_section_size): New function. 6403 (Sized_incr_relobj::do_section_name): New function. 6404 (Sized_incr_relobj::do_section_contents): New function. 6405 (Sized_incr_relobj::do_section_flags): New function. 6406 (Sized_incr_relobj::do_section_entsize): New function. 6407 (Sized_incr_relobj::do_section_address): New function. 6408 (Sized_incr_relobj::do_section_type): New function. 6409 (Sized_incr_relobj::do_section_link): New function. 6410 (Sized_incr_relobj::do_section_info): New function. 6411 (Sized_incr_relobj::do_section_addralign): New function. 6412 (Sized_incr_relobj::do_initialize_xindex): New function. 6413 (Sized_incr_relobj::do_get_global_symbol_counts): New function. 6414 (Sized_incr_relobj::do_read_relocs): New function. 6415 (Sized_incr_relobj::do_gc_process_relocs): New function. 6416 (Sized_incr_relobj::do_scan_relocs): New function. 6417 (Sized_incr_relobj::do_count_local_symbols): New function. 6418 (Sized_incr_relobj::do_finalize_local_symbols): New function. 6419 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function. 6420 (Sized_incr_relobj::do_set_local_dynsym_offset): New function. 6421 (Sized_incr_relobj::do_relocate): New function. 6422 (Sized_incr_relobj::do_set_section_offset): New function. 6423 (Sized_incr_dynobj::Sized_incr_dynobj): New function. 6424 (Sized_incr_dynobj::do_read_symbols): New function. 6425 (Sized_incr_dynobj::do_layout): New function. 6426 (Sized_incr_dynobj::do_add_symbols): New function. 6427 (Sized_incr_dynobj::do_should_include_member): New function. 6428 (Sized_incr_dynobj::do_for_all_global_symbols): New function. 6429 (Sized_incr_dynobj::do_for_all_local_got_entries): New function. 6430 (Sized_incr_dynobj::do_section_size): New function. 6431 (Sized_incr_dynobj::do_section_name): New function. 6432 (Sized_incr_dynobj::do_section_contents): New function. 6433 (Sized_incr_dynobj::do_section_flags): New function. 6434 (Sized_incr_dynobj::do_section_entsize): New function. 6435 (Sized_incr_dynobj::do_section_address): New function. 6436 (Sized_incr_dynobj::do_section_type): New function. 6437 (Sized_incr_dynobj::do_section_link): New function. 6438 (Sized_incr_dynobj::do_section_info): New function. 6439 (Sized_incr_dynobj::do_section_addralign): New function. 6440 (Sized_incr_dynobj::do_initialize_xindex): New function. 6441 (Sized_incr_dynobj::do_get_global_symbol_counts): New function. 6442 (make_sized_incremental_object): New function. 6443 (Incremental_library::copy_unused_symbols): New function. 6444 (Incremental_library::do_for_all_unused_symbols): New function. 6445 * incremental.h (enum Incremental_input_flags): New type. 6446 (class Incremental_checker): Remove. 6447 (Incremental_input_entry::Incremental_input_entry): Add argument 6448 serial number. 6449 (Incremental_input_entry::arg_serial): New function. 6450 (Incremental_input_entry::set_is_in_system_directory): New function. 6451 (Incremental_input_entry::is_in_system_directory): New function. 6452 (Incremental_input_entry::arg_serial_): New data member. 6453 (Incremental_input_entry::is_in_system_directory_): New data member. 6454 (class Script_info): Move here from script.h. 6455 (Script_info::Script_info): Add filename parameter. 6456 (Script_info::filename): New function. 6457 (Script_info::filename_): New data member. 6458 (Incremental_script_entry::Incremental_script_entry): Add argument 6459 serial number. 6460 (Incremental_object_entry::Incremental_object_entry): Likewise. 6461 (Incremental_object_entry::add_input_section): Build list of input 6462 sections with map to original shndx. 6463 (Incremental_object_entry::get_input_section_index): New function. 6464 (Incremental_object_entry::shndx_): New data member. 6465 (Incremental_object_entry::name_key_): Rename; adjust all refs. 6466 (Incremental_object_entry::sh_size_): Rename; adjust all refs. 6467 (Incremental_archive_entry::Incremental_archive_entry): Add argument 6468 serial number. 6469 (Incremental_inputs::report_archive_begin): Likewise. 6470 (Incremental_inputs::report_object): Likewise. 6471 (Incremental_inputs::report_script): Likewise. 6472 (class Incremental_global_symbol_reader): New class. 6473 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read 6474 and store flags and input file type. 6475 (Incremental_input_entry_reader::arg_serial): New function. 6476 (Incremental_input_entry_reader::type): Extract type from flags. 6477 (Incremental_input_entry_reader::is_in_system_directory): New function. 6478 (Incremental_input_entry_reader::get_input_section_count): Call 6479 accessor function for type. 6480 (Incremental_input_entry_reader::get_symbol_offset): Call accessor 6481 function for type; adjust size of global symbol entry. 6482 (Incremental_input_entry_reader::get_global_symbol_count): Call 6483 accessor function for type. 6484 (Incremental_input_entry_reader::get_object_count): Likewise. 6485 (Incremental_input_entry_reader::get_object_offset): Likewise. 6486 (Incremental_input_entry_reader::get_member_count): Likewise. 6487 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise. 6488 (Incremental_input_entry_reader::get_member_offset): Likewise. 6489 (Incremental_input_entry_reader::get_unused_symbol): Likewise. 6490 (Incremental_input_entry_reader::Global_symbol_info): Remove. 6491 (Incremental_input_entry_reader::get_global_symbol_info): Remove. 6492 (Incremental_input_entry_reader::get_global_symbol_reader): New 6493 function. 6494 (Incremental_input_entry_reader::get_output_symbol_index): New 6495 function. 6496 (Incremental_input_entry_reader::type_): Remove. 6497 (Incremental_input_entry_reader::flags_): New data member. 6498 (Incremental_inputs_reader::input_file_offset): New function. 6499 (Incremental_inputs_reader::input_file_index): New function. 6500 (Incremental_inputs_reader::input_file): Call input_file_offset. 6501 (Incremental_inputs_reader::input_file_at_offset): New function. 6502 (Incremental_relocs_reader::get_r_type): Reformat. 6503 (Incremental_relocs_reader::get_r_shndx): Reformat. 6504 (Incremental_relocs_reader::get_r_offset): Reformat. 6505 (Incremental_relocs_reader::data): New function. 6506 (Incremental_binary::Incremental_binary): Initialize new data members. 6507 (Incremental_binary::check_inputs): Add cmdline parameter. 6508 (Incremental_binary::file_is_unchanged): Remove. 6509 (Input_reader::arg_serial): New function. 6510 (Input_reader::get_unused_symbol_count): New function. 6511 (Input_reader::get_unused_symbol): New function. 6512 (Input_reader::do_arg_serial): New function. 6513 (Input_reader::do_get_unused_symbol_count): New function. 6514 (Input_reader::do_get_unused_symbol): New function. 6515 (Incremental_binary::input_file_count): New function. 6516 (Incremental_binary::get_input_reader): Change signature to use 6517 index instead of filename. 6518 (Incremental_binary::file_has_changed): New function. 6519 (Incremental_binary::get_input_argument): New function. 6520 (Incremental_binary::get_library): New function. 6521 (Incremental_binary::get_script_info): New function. 6522 (Incremental_binary::init_layout): New function. 6523 (Incremental_binary::reserve_layout): New function. 6524 (Incremental_binary::output_file): New function. 6525 (Incremental_binary::do_check_inputs): New function. 6526 (Incremental_binary::do_file_is_unchanged): Remove. 6527 (Incremental_binary::do_file_has_changed): New function. 6528 (Incremental_binary::do_init_layout): New function. 6529 (Incremental_binary::do_reserve_layout): New function. 6530 (Incremental_binary::do_input_file_count): New function. 6531 (Incremental_binary::do_get_input_reader): Change signature. 6532 (Incremental_binary::input_args_map_): New data member. 6533 (Incremental_binary::library_map_): New data member. 6534 (Incremental_binary::script_map_): New data member. 6535 (Sized_incremental_binary::Sized_incremental_binary): Initialize 6536 new data members. 6537 (Sized_incremental_binary::output_section): New function. 6538 (Sized_incremental_binary::inputs_reader): Add const. 6539 (Sized_incremental_binary::symtab_reader): Add const. 6540 (Sized_incremental_binary::relocs_reader): Add const. 6541 (Sized_incremental_binary::got_plt_reader): Add const. 6542 (Sized_incremental_binary::get_symtab_view): New function. 6543 (Sized_incremental_binary::Inputs_reader): New typedef. 6544 (Sized_incremental_binary::Input_entry_reader): New typedef. 6545 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter. 6546 (Sized_incremental_binary::do_file_is_unchanged): Remove. 6547 (Sized_incremental_binary::do_file_has_changed): New function. 6548 (Sized_incremental_binary::do_init_layout): New function. 6549 (Sized_incremental_binary::do_reserve_layout): New function. 6550 (Sized_input_reader::Inputs_reader): Remove. 6551 (Sized_input_reader::Input_entry_reader): Remove. 6552 (Sized_input_reader::do_arg_serial): New function. 6553 (Sized_input_reader::do_get_unused_symbol_count): New function. 6554 (Sized_input_reader::do_get_unused_symbol): New function. 6555 (Sized_incremental_binary::do_input_file_count): New function. 6556 (Sized_incremental_binary::do_get_input_reader): Change signature; 6557 use index instead of filename. 6558 (Sized_incremental_binary::section_map_): New data member. 6559 (Sized_incremental_binary::input_entry_readers_): New data member. 6560 (class Sized_incr_relobj): New class. 6561 (class Sized_incr_dynobj): New class. 6562 (make_sized_incremental_object): New function. 6563 (class Incremental_library): New class. 6564 * layout.cc (Free_list::num_lists): New static data member. 6565 (Free_list::num_nodes): New static data member. 6566 (Free_list::num_removes): New static data member. 6567 (Free_list::num_remove_visits): New static data member. 6568 (Free_list::num_allocates): New static data member. 6569 (Free_list::num_allocate_visits): New static data member. 6570 (Free_list::init): New function. 6571 (Free_list::remove): New function. 6572 (Free_list::allocate): New function. 6573 (Free_list::dump): New function. 6574 (Free_list::print_stats): New function. 6575 (Layout_task_runner::run): Resize output file for incremental updates. 6576 (Layout::Layout): Initialize new data members. 6577 (Layout::set_incremental_base): New function. 6578 (Layout::init_fixed_output_section): New function. 6579 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for 6580 incremental updates. 6581 (Layout::create_gold_note): Do not create gold note section for 6582 incremental updates. 6583 (Layout::set_segment_offsets): Do not recalculate RELRO alignment 6584 for incremental updates. 6585 (Layout::set_section_offsets): For incremental updates, allocate space 6586 from free list. 6587 (Layout::create_symtab_sections): Layout with offsets relative to 6588 start of section; for incremental updates, allocate space from free 6589 list. 6590 (Layout::create_shdrs): For incremental updates, allocate space from 6591 free list. 6592 (Layout::finish_dynamic_section): For incremental updates, do not 6593 check --as-needed (fixed in subsequent patch). 6594 * layout.h (class Free_list): New class. 6595 (Layout::set_incremental_base): New function. 6596 (Layout::incremental_base): New function. 6597 (Layout::init_fixed_output_section): New function. 6598 (Layout::allocate): New function. 6599 (Layout::incremental_base_): New data member. 6600 (Layout::free_list_): New data member. 6601 * main.cc (main): Print Free_list statistics. 6602 * object.cc (Relobj::finalize_incremental_relocs): Add 6603 clear_counts parameter; clear counts only when clear_counts is set. 6604 (Sized_relobj::Sized_relobj): Initialize new base class. 6605 (Sized_relobj::do_layout): Don't report special sections. 6606 (Sized_relobj::do_for_all_local_got_entries): New function. 6607 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add 6608 symtab_off to all symbol table offsets. 6609 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword. 6610 * object.h (class Got_offset_list): Move to top of file. 6611 (Object::Object): Allow case where input_file == NULL. 6612 (Object::~Object): Likewise. 6613 (Object::input_file): Assert that input_file != NULL. 6614 (Object::lock): Allow case where input_file == NULL. 6615 (Object::unlock): Likewise. 6616 (Object::is_locked): Likewise. 6617 (Object::token): Likewise. 6618 (Object::release): Likewise. 6619 (Object::is_incremental): New function. 6620 (Object::get_mtime): New function. 6621 (Object::for_all_local_got_entries): New function. 6622 (Object::clear_view_cache_marks): Allow case where input_file == NULL. 6623 (Object::set_is_in_system_directory): New function. 6624 (Object::is_in_system_directory): New function. 6625 (Object::do_is_incremental): New function. 6626 (Object::do_get_mtime): New function. 6627 (Object::do_for_all_local_got_entries): New function. 6628 (Object::is_in_system_directory_): New data member. 6629 (Relobj::finalize_incremental_relocs): Add clear_counts parameter. 6630 (class Sized_relobj_base): New class. 6631 (class Sized_relobj): Derive from Sized_relobj_base. 6632 (class Sized_relobj::Symbols): Redeclare from base class. 6633 (class Sized_relobj::local_got_offset_list): Remove. 6634 (class Sized_relobj::Output_sections): Redeclare from base class. 6635 (class Sized_relobj::do_for_all_local_got_entries): New function. 6636 (class Sized_relobj::write_local_symbols): Add offset parameter. 6637 (class Sized_relobj::local_symbol_offset_): Update comment. 6638 (class Sized_relobj::local_dynsym_offset_): Update comment. 6639 * options.cc (Input_arguments::add_file): Remove const. 6640 * options.h (Input_file_argument::Input_file_argument): 6641 Initialize arg_serial_ (all constructors). 6642 (Input_file_argument::set_arg_serial): New function. 6643 (Input_file_argument::arg_serial): New function. 6644 (Input_file_argument::arg_serial_): New data member. 6645 (Input_arguments::Input_arguments): Initialize file_count_. 6646 (Input_arguments::add_file): Remove const. 6647 (Input_arguments::number_of_input_files): New function. 6648 (Input_arguments::file_count_): New data member. 6649 (Command_line::number_of_input_files): Call 6650 Input_arguments::number_of_input_files. 6651 * output.cc (Output_segment_headers::Output_segment_headers): 6652 Set current size. 6653 (Output_section::Input_section::current_data_size): New function. 6654 (Output_section::Output_section): Initialize new data members. 6655 (Output_section::add_input_section): Don't do merge sections for 6656 an incremental link; allocate space from free list for an 6657 incremental update. 6658 (Output_section::add_output_section_data): Allocate space from 6659 free list for an incremental update. 6660 (Output_section::update_data_size): New function. 6661 (Output_section::set_fixed_layout): New function. 6662 (Output_section::reserve): New function. 6663 (Output_segment::set_section_addresses): Remove const. 6664 (Output_segment::set_section_list_addresses): Remove const; allocate 6665 space from free list for an incremental update. 6666 (Output_segment::set_offset): Adjust size of RELRO segment for an 6667 incremental update. 6668 * output.h (Output_data::current_data_size): Move here from 6669 child classes. 6670 (Output_data::pre_finalize_data_size): New function. 6671 (Output_data::update_data_size): New function. 6672 (Output_section_headers::update_data_size): new function. 6673 (Output_section_data_build::current_data_size): Move to Output_data. 6674 (Output_data_strtab::update_data_size): New function. 6675 (Output_section::current_data_size): Move to Output_data. 6676 (Output_section::set_fixed_layout): New function. 6677 (Output_section::has_fixed_layout): New function. 6678 (Output_section::reserve): New function. 6679 (Output_section::update_data_size): New function. 6680 (Output_section::has_fixed_layout_): New data member. 6681 (Output_section::free_list_): New data member. 6682 (Output_segment::set_section_addresses): Remove const. 6683 (Output_segment::set_section_list_addresses): Remove const. 6684 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries): 6685 New function. 6686 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries): 6687 New function. 6688 * readsyms.cc (Read_symbols::do_read_symbols): Add library 6689 parameter when calling Add_symbols constructor; store argument 6690 serial number for members of a lib group. 6691 (Add_symbols::locks): Allow case where token == NULL. 6692 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib. 6693 (Read_member::~Read_member): New function. 6694 (Read_member::is_runnable): New function. 6695 (Read_member::locks): New function. 6696 (Read_member::run): New function. 6697 (Check_script::~Check_script): New function. 6698 (Check_script::is_runnable): New function. 6699 (Check_script::locks): New function. 6700 (Check_script::run): New function. 6701 (Check_library::~Check_library): New function. 6702 (Check_library::is_runnable): New function. 6703 (Check_library::locks): New function. 6704 (Check_library::run): New function. 6705 * readsyms.h (Add_symbols::Add_symbols): Add library parameter. 6706 (Add_symbols::library_): New data member. 6707 (class Read_member): New class. 6708 (class Check_script): New class. 6709 (class Check_library): New class. 6710 * reloc.cc (Read_relocs::is_runnable): Allow case where 6711 token == NULL. 6712 (Read_relocs::locks): Likewise. 6713 (Scan_relocs::locks): Likewise. 6714 (Relocate_task::locks): Likewise. 6715 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs 6716 to clear counters. 6717 (Sized_relobj::incremental_relocs_scan): Fix comment. 6718 (Sized_relobj::do_relocate): Pass output file offset to 6719 write_local_symbols. 6720 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size 6721 from class declaration. 6722 * script.cc (read_input_script): Allocate Script_info; pass 6723 argument serial number to report_script. 6724 * script.h (class Script_info): Move to incremental.h. 6725 * symtab.cc (Symbol_table::add_from_incrobj): New function. 6726 * symtab.h (Symbol_table::add_from_incrobj): New function. 6727 (Symbol_table::set_file_offset): New function. 6728 6729 2011-04-05 Cary Coutant <ccoutant (a] google.com> 6730 6731 * incremental-dump.cc (dump_incremental_inputs): Change signature 6732 to take a Sized_incremental_binary; change caller. Use readers 6733 in Sized_incremental_binary. 6734 * incremental.cc 6735 (Sized_incremental_binary::find_incremental_inputs_sections): 6736 Rename do_find_incremental_inputs_sections to this. 6737 (Sized_incremental_binary::setup_readers): New function. 6738 (Sized_incremental_binary::do_check_inputs): Check 6739 has_incremental_info_ flag; move setup code to setup_readers; 6740 use input readers. 6741 (Sized_incremental_binary::do_file_is_unchanged): New function. 6742 (Sized_incremental_binary::do_get_input_reader): New function. 6743 * incremental.h (class Incremental_binary): Move to end of file. 6744 (Incremental_binary::file_is_unchanged): New function. 6745 (Incremental_binary::do_file_is_unchanged): New function. 6746 (Incremental_binary::Input_reader): New class. 6747 (Incremental_binary::get_input_reader): New function. 6748 (class Sized_incremental_binary): Move to end of file. 6749 (Sized_incremental_binary::Sized_incremental_binary): Setup the 6750 input section reader classes. 6751 (Sized_incremental_binary::has_incremental_info): New function. 6752 (Sized_incremental_binary::inputs_reader): New function. 6753 (Sized_incremental_binary::symtab_reader): New function. 6754 (Sized_incremental_binary::relocs_reader): New function. 6755 (Sized_incremental_binary::got_plt_reader): New function. 6756 (Sized_incremental_binary::do_file_is_unchanged): New function. 6757 (Sized_incremental_binary::Sized_input_reader): New class. 6758 (Sized_incremental_binary::get_input_reader): New function. 6759 (Sized_incremental_binary::find_incremental_inputs_sections): 6760 Rename do_find_incremental_inputs_sections to this. 6761 (Sized_incremental_binary::setup_readers): New function. 6762 (Sized_incremental_binary::has_incremental_info_): New data member. 6763 (Sized_incremental_binary::inputs_reader_): New data member. 6764 (Sized_incremental_binary::symtab_reader_): New data member. 6765 (Sized_incremental_binary::relocs_reader_): New data member. 6766 (Sized_incremental_binary::got_plt_reader_): New data member. 6767 (Sized_incremental_binary::current_input_file_): New data member. 6768 6769 2011-04-05 Paul Pluzhnikov <ppluzhnikov (a] google.com> 6770 6771 PR gold/12640 6772 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds 6773 violation. 6774 6775 2011-03-30 Cary Coutant <ccoutant (a] google.com> 6776 6777 * archive.cc (Archive::include_member): Adjust call to report_object. 6778 (Add_archive_symbols::run): Add script_info to call to 6779 report_archive_begin. 6780 (Lib_group::include_member): Adjust call to report_object. 6781 (Add_lib_group_symbols::run): Adjust call to report_object. 6782 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary 6783 blocks. Add object count for script input files. 6784 * incremental.cc (Incremental_inputs::report_archive_begin): Add 6785 script_info parameter; change all callers. 6786 (Incremental_inputs::report_object): Add script_info parameter; 6787 change all callers. 6788 (Incremental_inputs::report_script): Store backpointer to 6789 incremental info entry. 6790 (Output_section_incremental_inputs::set_final_data_size): Record 6791 additional information for scripts. 6792 (Output_section_incremental_inputs::write_info_blocks): Likewise. 6793 * incremental.h (Incremental_script_entry::add_object): New function. 6794 (Incremental_script_entry::get_object_count): New function. 6795 (Incremental_script_entry::get_object): New function. 6796 (Incremental_script_entry::objects_): New data member; adjust 6797 constructor. 6798 (Incremental_inputs::report_archive_begin): Add script_info parameter. 6799 (Incremental_inputs::report_object): Add script_info parameter. 6800 (Incremental_inputs_reader::get_object_count): New function. 6801 (Incremental_inputs_reader::get_object_offset): New function. 6802 * options.cc (Input_arguments::add_file): Return reference to 6803 new input argument. 6804 * options.h (Input_argument::set_script_info): New function. 6805 (Input_argument::script_info): New function. 6806 (Input_argument::script_info_): New data member; adjust all 6807 constructors. 6808 (Input_file_group::add_file): Return reference to new input argument. 6809 (Input_file_lib::add_file): Likewise. 6810 (Input_arguments::add_file): Likewise. 6811 * readsyms.cc (Add_symbols::run): Adjust call to report_object. 6812 * script.cc (Parser_closure::Parser_closure): Add script_info 6813 parameter; adjust all callers. 6814 (Parser_closure::script_info): New function. 6815 (Parser_closure::script_info_): New data member. 6816 (read_input_script): Report scripts earlier to incremental info. 6817 (script_add_file): Set script_info in Input_argument. 6818 (script_add_library): Likewise. 6819 * script.h (Script_options::Script_info): Rewrite class. 6820 6821 2011-03-29 Cary Coutant <ccoutant (a] google.com> 6822 6823 * archive.cc (Library_base::should_include_member): Move 6824 method here from class Archive. 6825 (Archive::Archive): Initialize base class. 6826 (Archive::should_include_member): Move to base class. 6827 (Archive::do_for_all_unused_symbols): New function. 6828 (Add_archive_symbols::run): Remove redundant access to 6829 incremental_inputs. 6830 (Lib_group::Lib_group): Initialize base class. 6831 (Lib_group::do_filename): New function. 6832 (Lib_group::include_member): Pass pointer to Lib_group to 6833 report_object. 6834 (Lib_group::do_for_all_unused_symbols): New function. 6835 (Add_lib_group_symbols::run): Report archive information for 6836 incremental links. 6837 * archive.h (class Library_base): New base class. 6838 (class Archive): Derive from Library_base. 6839 (Archive::filename): Move to base class. 6840 (Archive::set_incremental_info): Likewise. 6841 (Archive::incremental_info): Likewise. 6842 (Archive::Should_include): Likewise. 6843 (Archive::should_include_member): Likewise. 6844 (Archive::Armap_entry): Remove. 6845 (Archive::Unused_symbol_iterator): Remove. 6846 (Archive::unused_symbols_begin): Remove. 6847 (Archive::unused_symbols_end): Remove. 6848 (Archive::do_filename): New function. 6849 (Archive::do_get_mtime): New function. 6850 (Archive::do_for_all_unused_symbols): New function. 6851 (Archive::task_): Move to base class. 6852 (Archive::incremental_info_): Likewise. 6853 (class Lib_group): Derive from Library_base. 6854 (Lib_group::do_filename): New function. 6855 (Lib_group::do_get_mtime): New function. 6856 (Lib_group::do_for_all_unused_symbols): New function. 6857 (Lib_group::task_): Move to base class. 6858 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New 6859 function. 6860 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New 6861 function. 6862 * incremental.cc (Incremental_inputs::report_archive_begin): 6863 Use Library_base; call library's get_mtime; add incremental inputs 6864 entry before members. 6865 (class Unused_symbol_visitor): New class. 6866 (Incremental_inputs::report_archive_end): Use Library_base; use 6867 visitor class to record unused symbols; don't add incremental inputs 6868 entry after members. 6869 (Incremental_inputs::report_object): Use Library_base. 6870 * incremental.h 6871 (Incremental_archive_entry::Incremental_archive_entry): Remove 6872 unused Archive parameter. 6873 (Incremental_inputs::report_archive_begin): Use Library_base. 6874 (Incremental_inputs::report_archive_end): Likewise. 6875 (Incremental_inputs::report_object): Likewise. 6876 * object.cc (Sized_relobj::do_for_all_global_symbols): New 6877 function. 6878 * object.h (Object::for_all_global_symbols): New function. 6879 (Object::do_for_all_global_symbols): New function. 6880 (Sized_relobj::do_for_all_global_symbols): New function. 6881 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New 6882 function. 6883 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New 6884 function. 6885 6886 2011-03-27 Ian Lance Taylor <iant (a] google.com> 6887 6888 * archive.cc (Archive::interpret_header): Return -1 if something 6889 goes wrong. Change callers accordingly. 6890 6891 2011-03-25 Cary Coutant <ccoutant (a] google.com> 6892 6893 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm. 6894 * testsuite/Makefile.in: Regenerate. 6895 6896 2011-03-23 Rafael vila de Espndola <respindola (a] mozilla.com> 6897 6898 * plugin.cc (get_view): New. 6899 (Plugin::load): Pass get_view to the plugin. 6900 (Plugin_manager::get_view): New. 6901 6902 2011-03-21 Ian Lance Taylor <iant (a] google.com> 6903 6904 * testsuite/final_layout.sh: Rewrite to not use dc. 6905 * testsuite/relro_test.sh: Fail if dc is not present. 6906 6907 2011-03-21 Sriraman Tallam <tmsriram (a] google.com> 6908 6909 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start. 6910 Change == to -eq. 6911 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start. 6912 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start. 6913 Change == to -eq. 6914 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start. 6915 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start. 6916 6917 2011-03-14 Ian Lance Taylor <iant (a] google.com> 6918 6919 * script-sections.cc (Sort_output_sections::script_compare): 6920 Rename from is_before, change return type. 6921 (Sort_output_sections::operator()): Adjust accordingly. 6922 6923 2011-03-11 Jeffrey Yasskin <jyasskin (a] google.com> 6924 6925 PR gold/12572 6926 * testsuite/odr_violation2.cc: Add comment to make all error line 6927 numbers double digits. 6928 * testsuite/debug_msg.sh: Adjust expected errors. 6929 6930 2011-03-09 Jeffrey Yasskin <jyasskin (a] google.com> 6931 6932 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines, 6933 but mark earlier ones as non-canonical 6934 (offset_to_iterator): Update search target and example 6935 (do_addr2line): Return extra lines in a vector* 6936 (format_file_lineno): Extract from do_addr2line 6937 (one_addr2line): Add vector* out-param 6938 * dwarf_reader.h (Offset_to_lineno_entry): New field recording 6939 when a lineno entry appeared last for its instruction 6940 (Dwarf_line_info): Add vector* out-param 6941 * object.cc (Relocate_info): Pass NULL for the vector* out-param 6942 * symtab.cc (Odr_violation_compare): Include the lineno in the 6943 comparison again. 6944 (linenos_from_loc): New. Combine the canonical line for an 6945 address with its other lines. 6946 (True_if_intersect): New. Helper functor to make 6947 std::set_intersection a query. 6948 (detect_odr_violations): Compare sets of lines instead of just 6949 one line for each function. This became less deterministic, but 6950 has fewer false positives. 6951 * symtab.h: Declarations. 6952 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to 6953 mix an optimized and non-optimized object in the same binary 6954 (odr_violation2.so): Same. 6955 * testsuite/Makefile.in: Regenerate from Makefile.am. 6956 * testsuite/debug_msg.cc (main): Make OdrDerived classes. 6957 * testsuite/debug_msg.sh: Update line numbers and add 6958 assertions. 6959 * testsuite/odr_violation1.cc: Use OdrDerived, in a 6960 non-optimized context. 6961 * testsuite/odr_violation2.cc: Make sure Ordering::operator() 6962 isn't inlined, and use OdrDerived in an optimized context. 6963 * testsuite/odr_header1.h: Defines OdrDerived, where 6964 optimization will change the 6965 first-instruction-in-the-destructor's file and line number. 6966 * testsuite/odr_header2.h: Defines OdrBase. 6967 6968 2011-03-09 Ian Lance Taylor <iant (a] google.com> 6969 6970 * fileread.cc (File_read::clear_views): Don't delete the whole 6971 file view. 6972 6973 2011-03-08 Ian Lance Taylor <iant (a] google.com> 6974 6975 PR gold/12525 6976 * fileread.cc: #include <climits>. 6977 (GOLD_IOV_MAX): Define. 6978 (File_read::read_multiple): Limit number of entries by iov_max. 6979 * fileread.h (class File_read): Always set max_readv_entries to 6980 128. 6981 6982 2011-03-07 Ian Lance Taylor <iant (a] google.com> 6983 6984 PR gold/12525 6985 * options.h (class General_options): Add -dy and -dn. 6986 6987 2011-03-02 Cary Coutant <ccoutant (a] google.com> 6988 6989 * testsuite/script_test_9.t: Add TLS segment. 6990 6991 2011-03-02 Simon Baldwin <simonb (a] google.com> 6992 6993 * configure.ac: Add check for gnu_indirect_function support in 6994 the toolchain building binutils. 6995 * configure: Rebuild. 6996 6997 2011-02-18 Rafael vila de Espndola <respindola (a] mozilla.com> 6998 6999 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for 7000 plugin only symbols. 7001 (Symbol_table::sized_finalize_symbol) Mark symbol only present 7002 in plugin files as not needed in the symbol table. 7003 7004 2011-02-11 Sriraman Tallam <tmsriram (a] google.com> 7005 7006 * output.cc (Output_section::add_input_section): Delay fill 7007 generation for section ordering. 7008 7009 2011-02-09 Ian Lance Taylor <iant (a] google.com> 7010 7011 PR gold/12316 7012 * object.h (class Sized_relobj): Remove clear_local_symbols. 7013 * reloc.cc (Sized_relobj::do_relocate): Don't call 7014 clear_local_symbols. 7015 7016 2011-02-08 Rafael vila de Espndola <respindola (a] mozilla.com> 7017 7018 * plugin.cc (is_visible_from_outside): Return true for symbols 7019 in the -u option. 7020 7021 2011-02-04 Jeffrey Yasskin <jyasskin (a] google.com> 7022 7023 * symtab.cc (Odr_violation_compare::operator()): Sort by just the 7024 filename. 7025 7026 2011-02-02 Sriraman Tallam <tmsriram (a] google.com> 7027 7028 * icf.h (is_section_foldable_candidate): Change type of parameter 7029 to std::string. 7030 * icf.cc (Icf::find_identical_sections): Change type of local variable 7031 section_name to be std::string. 7032 (is_function_ctor_or_dtor): Change type of parameter to std::string. 7033 7034 2011-01-25 Ian Lance Taylor <iant (a] google.com> 7035 7036 * script.cc (script_add_extern): Rewrite to use 7037 add_symbol_reference. 7038 7039 2011-01-25 Doug Kwan <dougkwan (a] google.com> 7040 7041 * icf.cc (get_section_contents): Always lock section's object. 7042 7043 2011-01-24 Ian Lance Taylor <iant (a] google.com> 7044 7045 * options.h (class General_options): Accept 7046 --no-detect-odr-violations. 7047 7048 2011-01-24 Ian Lance Taylor <iant (a] google.com> 7049 7050 * version.cc (version_string): Bump to 1.11. 7051 7052 2011-01-24 Ian Lance Taylor <iant (a] google.com> 7053 7054 * plugin.cc (class Plugin_rescan): Define new class. 7055 (Plugin_manager::claim_file): Set any_claimed_. 7056 (Plugin_manager::save_archive): New function. 7057 (Plugin_manager::save_input_group): New function. 7058 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if 7059 necessary. 7060 (Plugin_manager::new_undefined_symbol): New function. 7061 (Plugin_manager::rescan): New function. 7062 (Plugin_manager::rescannable_defines): New function. 7063 (Plugin_manager::add_input_file): Set any_added_. 7064 * plugin.h (class Plugin_manager): define new fields rescannable_, 7065 undefined_symbols_, any_claimed_, and any_added_. Declare 7066 Plugin_rescan as friend. Declare new functions. 7067 (Plugin_manager::Rescannable): Define type. 7068 (Plugin_manager::Rescannable_list): Define type. 7069 (Plugin_manager::Undefined_symbol_list): Define type. 7070 (Plugin_manager::Plugin_manager): Initialize new fields. 7071 * archive.cc (Archive::defines_symbol): New function. 7072 (Add_archive_symbols::run): Pass archive to plugins if any. 7073 * archive.h (class Archive): Declare defines_symbol. 7074 * readsyms.cc (Input_group::~Input_group): New function. 7075 (Finish_group::run): Pass input_group to plugins if any. 7076 * readsyms.h (class Input_group): Declare destructor. 7077 * symtab.cc (add_from_object): Pass undefined symbol to plugins if 7078 any. 7079 7080 2011-01-10 Ian Lance Taylor <iant (a] google.com> 7081 7082 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame 7083 section as relro. 7084 (Layout::set_segment_offsets): Reset increase_relro before calling 7085 set_section_addresses a second time. 7086 7087 2011-01-04 Cary Coutant <ccoutant (a] google.com> 7088 7089 * script-sections.cc (Sort_output_sections::operator()): Sort TLS 7090 sections before NOBITS sections. 7091 7092 2011-01-01 H.J. Lu <hongjiu.lu (a] intel.com> 7093 7094 * version.cc (print_version): Update copyright to 2011. 7095 7096 2010-12-23 Cary Coutant <ccoutant (a] google.com> 7097 7098 * output.h (Output_data_reloc::add_output_section): Pass OD instead 7099 of OS to this->add. Add OD parameter to second form of the function. 7100 7101 2010-12-20 Ian Lance Taylor <iant (a] google.com> 7102 7103 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep 7104 second of two consecutive entries with same offset. 7105 7106 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues (a] gmx.de> 7107 7108 * testsuite/Makefile.am (ifuncmain2static_LDADD) 7109 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD) 7110 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables, 7111 to avoid unneeded links against $(LDADD). 7112 * testsuite/Makefile.in: Regenerate. 7113 7114 2010-12-15 Ian Lance Taylor <iant (a] google.com> 7115 7116 PR gold/12324 7117 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error 7118 for R_X86_64_32 and R_X86_64_PC32. 7119 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use 7120 ver_matching_def_pic.o. 7121 (ver_matching_def_pic.o): New target. 7122 7123 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues (a] gmx.de> 7124 7125 * fileread.cc (file_counts_lock, file_counts_initialize_lock) 7126 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes): 7127 Move definition before File_read::View member definitions. 7128 (File_read::View::~View): Initialize and hold lock before 7129 updating current_mapped_bytes. 7130 7131 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues (a] gmx.de> 7132 7133 * dwarf_reader.cc: Remove outdated comment. 7134 * gold-threads.cc: Fix typo in error message. 7135 * archive.cc: Fix typos in comments. 7136 * archive.h: Likewise. 7137 * arm-reloc-property.cc: Likewise. 7138 * arm-reloc-property.h: Likewise. 7139 * arm-reloc.def: Likewise. 7140 * arm.cc: Likewise. 7141 * attributes.h: Likewise. 7142 * cref.cc: Likewise. 7143 * ehframe.cc: Likewise. 7144 * fileread.h: Likewise. 7145 * gold.h: Likewise. 7146 * i386.cc: Likewise. 7147 * icf.cc: Likewise. 7148 * incremental.h: Likewise. 7149 * int_encoding.cc: Likewise. 7150 * layout.h: Likewise. 7151 * main.cc: Likewise. 7152 * merge.h: Likewise. 7153 * object.cc: Likewise. 7154 * object.h: Likewise. 7155 * options.cc: Likewise. 7156 * readsyms.cc: Likewise. 7157 * reduced_debug_output.cc: Likewise. 7158 * reloc.cc: Likewise. 7159 * script-sections.cc: Likewise. 7160 * sparc.cc: Likewise. 7161 * symtab.h: Likewise. 7162 * target-reloc.h: Likewise. 7163 * target.cc: Likewise. 7164 * target.h: Likewise. 7165 * timer.cc: Likewise. 7166 * timer.h: Likewise. 7167 * x86_64.cc: Likewise. 7168 7169 2010-12-09 Cary Coutant <ccoutant (a] google.com> 7170 7171 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable 7172 stack. 7173 * layout.h (Layout::layout_gnu_stack): Add pointer to Object 7174 parameter; change all callers. 7175 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack. 7176 * options.h (warn_execstack): New option. 7177 7178 2010-12-07 Doug Kwan <dougkwan (a] google.com> 7179 7180 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31 7181 like function call relocations. 7182 7183 2010-12-07 Ian Lance Taylor <iant (a] google.com> 7184 7185 * archive.cc (Archive::get_elf_object_for_member): Permit 7186 punconfigured to be NULL. 7187 (Archive::read_symbols): Pass NULL to get_elf_object_for_member. 7188 (Archive::include_member): Pass NULL to get_elf_object_for_member 7189 if we searched for the archive and this is the first included 7190 object. 7191 7192 2010-12-01 Ian Lance Taylor <iant (a] google.com> 7193 7194 * dwarf_reader.h (class Sized_dwarf_line_info): Add 7195 track_relocs_type_ field. 7196 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info): 7197 Set track_relocs_type_. 7198 (Sized_dwarf_line_info::process_one_opcode): Ignore the section 7199 contents when using RELA relocs. 7200 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to 7201 reloc_map_. 7202 * reloc.cc (Track_relocs::next_addend): New function. 7203 * reloc.h (class Track_relocs): Declare next_addend. 7204 7205 2010-12-01 Ian Lance Taylor <iant (a] google.com> 7206 7207 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add 7208 virtual destructor. 7209 7210 2010-12-01 Ian Lance Taylor <iant (a] google.com> 7211 7212 * README: Update compilers known to work and fail. 7213 7214 2010-11-23 Matthias Klose <doko (a] ubuntu.com> 7215 7216 * configure.in: For --enable-gold, handle value `default' instead of 7217 `both*'. Always install ld as ld.bfd, install as ld if gold is 7218 not the default. 7219 * configure: Regenerate. 7220 7221 2010-11-18 Doug Kwan <dougkwan (a] google.com> 7222 7223 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment 7224 and right_alignment to be zero. Store result alignment only if it is 7225 greater than existing alignment. 7226 7227 2010-11-16 Cary Coutant <ccoutant (a] google.com> 7228 7229 PR gold/12220 7230 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info): 7231 Check for ".zdebug_line". 7232 7233 2010-11-16 Doug Kwan <dougkwan (a] google.com> 7234 Cary Coutant <ccoutant (a] google.com> 7235 7236 * output.h (Output_segment::set_section_addresses): Pass increase_relro 7237 by reference; adjust all callers. 7238 * output.cc (Output_segment::set_section_addresses): Adjust references 7239 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST 7240 list is empty. 7241 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not 7242 end at page boundary. 7243 7244 2010-11-16 Cary Coutant <ccoutant (a] google.com> 7245 7246 PR gold/12220 7247 * layout.cc (Layout::choose_output_section): Transform names of 7248 compressed sections even when using a script with a SECTIONS clause. 7249 (Layout::output_section_name): Remove code to transform 7250 compressed debug section names. 7251 * output.cc (Output_section::add_input_section): Use uncompressed 7252 section size when tracking input sections. 7253 7254 2010-11-11 Richard Sandiford <richard.sandiford (a] linaro.org> 7255 7256 * symtab.h (Symbol::NON_PIC_REF): Remove. 7257 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags. 7258 (Symbol::FUNCTION_CALL): Renumber. Reword comment. 7259 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF. 7260 (Symbol::use_plt_offset): Take a flags argument and pass it 7261 directly to needs_dynamic_reloc. Restrict check for undefined 7262 weak symbols to function calls. 7263 * arm.cc (Target_arm::Scan::get_reference_flags): New function. 7264 (Target_arm::Scan::global): Use it. 7265 (Target_arm::Scan::scan_reloc_for_stub): Likewise. 7266 (Target_arm::Relocate::relocate): Likewise. 7267 (Target_arm::Relocate::should_apply_static_reloc): Replace flags 7268 parameter with an r_type parameter. Use get_reference_flags 7269 to get the flags. 7270 (Target_arm::Relocate::relocate): Update accordingly. 7271 * i386.cc (Target_i386::Scan::get_reference_flags): New function. 7272 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it. 7273 (Target_i386::Scan::global): Likewise. 7274 (Target_i386::Relocate::relocate): Likewise. 7275 (Target_i386::Relocate::should_apply_static_reloc): Replace flags 7276 parameter with an r_type parameter. Use get_reference_flags 7277 to get the flags. 7278 (Target_i386::Relocate::relocate): Update accordingly. 7279 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function. 7280 (Target_powerpc::Scan::global): Use it. 7281 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise. 7282 (Target_powerpc::Relocate::relocate): Likewise. 7283 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function. 7284 (Target_sparc::Scan::global): Use it. 7285 (Target_sparc::Scan::scan_reloc_for_stub): Likewise. 7286 (Target_sparc::Relocate::relocate): Likewise. 7287 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function. 7288 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it. 7289 (Target_x86_64::Scan::global): Likewise. 7290 (Target_x86_64::Relocate::relocate): Likewise. 7291 7292 2010-11-08 Doug Kwan <dougkwan (a] google.com> 7293 Cary Coutant <ccoutant (a] google.com> 7294 7295 * arm.cc (Arm_exidx_merge_section::build_contents): New method. 7296 (Arm_exidx_merge_section::section_contents_): New data member. 7297 (Arm_input_section::Arm_input_section): Initialize original_contents_. 7298 (Arm_input_section::~Arm_input_section): De-allocate memory. 7299 (Arm_input_section::original_contents_): New data member. 7300 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents 7301 in parameters instead of calling Object::section_contents without 7302 locking. 7303 (Arm_output_section::group_section): New parameter TASK. Pass it 7304 to callees that need locking objects. 7305 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it 7306 to lock EXIDX input sections. Fix a formatting issue. Call 7307 Arm_exidx_merged_section::build_contents to create merged section 7308 contents. 7309 (Arm_output_section::create_stub_group): New parameter TASK. Use it 7310 to lock object of stub table owner. 7311 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter 7312 TEXT_SIZE to initialize data member TEXT_SIZE_. 7313 (Arm_exidx_input_section::addralign): Fix typo in comment. 7314 (Arm_exidx_input_section::text_size): New method. 7315 (Target_arm::do_relax): New parameter TASK. Pass it to callees 7316 that require locking objects. Lock objects before scanning for stubs 7317 and updating local symbols. 7318 (Arm_input_section<big_endian>::init): Copy contents of original 7319 input section. 7320 (Arm_input_section<big_endian>::do_write): Use saved contents of 7321 original input section instead of calling Object::section_contents 7322 without locking. 7323 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section 7324 size without calling Object::section_size(). 7325 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check 7326 for size. Allocate a buffer for merged EXIDX entries. 7327 (Arm_exidx_merged_section::build_contents): New method. 7328 (Arm_exidx_merged_section::do_write): Move merge section contents 7329 building code to Arm_exidx_merged_section::build_contetns. Write 7330 out contetns in buffer instead of building it on the fly. 7331 (Arm_relobj::make_exidx_input_section): Also pass text section size 7332 to Arm_exidx_input_section constructor. 7333 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue. 7334 (Arm_dynobj::do_read_symbols): Fix memory leak. 7335 * layout.cc (Layout::finalize): Pass TASK to Target::relax(). 7336 * target.h: (class Task): Add forward declaration. 7337 (Target::relax): Add new parameter TASK and pass it to 7338 Target::do_relax(). 7339 (Target::do_relax):: New parameter TASK. Fix a formatting issue. 7340 7341 2010-11-05 Cary Coutant <ccoutant (a] google.com> 7342 7343 PR gold/10708 7344 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the 7345 object when reading from the file. 7346 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing 7347 second layout pass. 7348 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object 7349 when reading section contents. 7350 (get_section_contents): Likewise. 7351 (icf::find_identical_sections): Likewise. 7352 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the 7353 object when reading from the file. 7354 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on 7355 the object when doing deferred section layout. 7356 7357 2010-11-03 Nick Clifton <nickc (a] redhat.com> 7358 7359 PR gold/12001 7360 * script.h (class Symbol_assignment: name): New member. Returns 7361 the name of the symbol. 7362 * scrfipt.cc (Script_options::is_pending_assignment): New member. 7363 Returns true if the given symbol name is on the list of 7364 assignments wating to be processed. 7365 * archive.cc (should_incldue_member): If the symbol is undefined, 7366 check to see if it is on the list of symbols pending assignment. 7367 7368 2010-11-03 Ryan Mansfield <rmansfield (a] qnx.com> 7369 7370 * script-sections.cc (Script_sections::find_memory_region): Check 7371 for a NULL output section pointer. 7372 7373 2010-10-29 Doug Kwan <dougkwan (a] google.com> 7374 7375 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to 7376 Output_section::add_relaxed_input_section. 7377 * output.cc (Output_section::add_relaxed_input_section): Add new 7378 arguments LAYOUT and NAME. Set section order index. 7379 (Output_section::convert_input_sections_in_list_to_relaxed_sections): 7380 Copy section order index. 7381 * output.h (Output_section::add_relaxed_input_section): Add new 7382 arguments LAYOUT and NAME. 7383 7384 2010-10-29 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 7385 7386 * testsuite/Makefile.am: Move gcctestdir/ld rule to 7387 NATIVE_OR_CROSS_LINKER. 7388 * testsuite/Makefile.in: Regenerate. 7389 7390 2010-10-20 Doug Kwan <dougkwan (a] google.com> 7391 7392 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections 7393 without SHF_LINK_ORDER flags. 7394 * layout.cc (Layout::choose_output_section): Do not filter 7395 SHF_LINK_ORDER flag in a relocatable link. 7396 7397 2010-10-17 Cary Coutant <ccoutant (a] google.com> 7398 7399 * output.h (Output_segment::set_section_addresses): Change function 7400 signature. Update all callers. 7401 * output.cc (Output_segment::is_first_section_relro): Ignore TLS 7402 sections. 7403 (Output_segment::set_section_addresses): Align after last TLS 7404 section. Add padding before last relro section instead of after. 7405 7406 2010-10-17 Doug Kwan <dougkwan (a] google.com> 7407 7408 * gold/arm.cc (Target_arm::got_section): Use correct order and set 7409 GOT output section to be writable. 7410 7411 2010-10-14 Cary Coutant <ccoutant (a] google.com> 7412 7413 * debug.h (DEBUG_INCREMENTAL): New flag. 7414 (debug_string_to_enum): Add DEBUG_INCREMENTAL). 7415 * gold.cc (queue_initial_tasks): Check parameters for incremental link 7416 mode. 7417 * incremental.cc (report_command_line): Ignore all forms of 7418 --incremental. 7419 * layout.cc (Layout::Layout): Check parameters for incremental link 7420 mode. 7421 * options.cc (General_options::parse_incremental): New function. 7422 (General_options::parse_no_incremental): New function. 7423 (General_options::parse_incremental_full): New function. 7424 (General_options::parse_incremental_update): New function. 7425 (General_options::incremental_mode_): New data member. 7426 (General_options::finalize): Check incremental_mode_. 7427 * options.h (General_options): Update help text for --incremental. 7428 Add --no-incremental, --incremental-full, --incremental-update. 7429 (General_options::Incremental_mode): New enum type. 7430 (General_options::incremental_mode): New function. 7431 (General_options::incremental_mode_): New data member. 7432 * parameters.cc (Parameters::incremental_mode_): New data member. 7433 (Parameters::set_options): Set incremental_mode_. 7434 (Parameters::set_incremental_full): New function. 7435 (Parameters::incremental): New function. 7436 (Parameters::incremental_update): New function. 7437 (set_parameters_incremental_full): New function. 7438 * parameters.h (Parameters::set_incremental_full): New function. 7439 (Parameters::incremental): New function. 7440 (Parameters::incremental_update): New function. 7441 (Parameters::incremental_mode_): New data member. 7442 (set_parameters_incremental_full): New function. 7443 * plugin.cc (Plugin_manager::add_input_file): Check parameters for 7444 incremental link mode. 7445 * reloc.cc (Sized_relobj::do_read_relocs): Likewise. 7446 (Sized_relobj::do_relocate_sections): Likewise. 7447 * testsuite/Makefile.am (incremental_test): Use --incremental-full 7448 option. 7449 * testsuite/Makefile.in: Regenerate. 7450 * testsuite/incremental_test.sh: Filter all forms of --incremental. 7451 7452 2010-10-12 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 7453 7454 * script-sections.h (class Script_sections): Make 7455 Sections_elements typedef public. 7456 * script-sections.cc (class Sort_output_sections): Add elements_ 7457 field. Add constructor which sets it; change all callers. 7458 (Sort_output_sections::is_before): New function. 7459 (Sort_output_sections::operator()): Call is_before. 7460 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake 7461 conditional. 7462 * testsuite/script_test_10.sh: New test. Test script section 7463 order. 7464 * testsuite/script_test_10.t: Likewise. 7465 * testsuite/script_test_10.s: Likewise. 7466 * testsuite/Makefile.am: Wrap the cross linker tests and the 7467 common tests into NATIVE_OR_CROSS_LINKER. 7468 (check_SCRIPTS): Add script_test_10.sh. 7469 (check_DATA): Add script_test_10.stdout. 7470 (script_test_10.o, script_test_10): New targets. 7471 (script_test_10.stdout): New target. 7472 * configure, testsuite/Makefile.in: Regenerate. 7473 7474 2010-10-12 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 7475 7476 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc 7477 error for the deprecated relocations. 7478 (Target_arm::Scan::global): Likewise. 7479 (Target_arm::Relocate::relocate): Likewise. 7480 7481 2010-10-12 Richard Sandiford <richard.sandiford (a] linaro.org> 7482 7483 * fileread.cc (Input_file::find_file): Initialize *found_name 7484 and *namep when using the fallback search for case 4. 7485 7486 2010-10-11 Cary Coutant <ccoutant (a] google.com> 7487 7488 * options.h (class General_options): Redefine -z lazy as an alias for 7489 the negation of -z now. 7490 7491 2010-10-11 Ian Lance Taylor <iant (a] google.com> 7492 7493 * resolve.cc (symbol_to_bits): Report the value of the unsupported 7494 binding. 7495 7496 2010-10-06 Nick Clifton <nickc (a] redhat.com> 7497 7498 * script-sections.cc(class Memory_region): Remove 7499 current_lma_offset_ field. Rename current_vma_offset_ to 7500 current_offset_. Add last_section_ field. 7501 (Memory_region::get_current_vma_address): Rename to 7502 get_current_address. 7503 (Memory_region::get_current_lma_address): Delete. 7504 (Memory_region::increment_vma_offset): Rename to 7505 increment_offset. 7506 (Memory_region::increment_lma_offset): Delete. 7507 (Memory_region::attributes_compatible): New method. Returns 7508 true if the provided section is compatible with the region. 7509 (Memory_region::get_last_section): New method. Returns the last 7510 section to use the region. 7511 (Memory_region::set_last_section): New method. Stores the last 7512 section to use the region. 7513 (Script_sections::block_in_region): New method. Returns true if 7514 a block of memory is contained within a region. 7515 (Script_sections::find_memory_region): New method. Locates a 7516 memory region to be used to set a VMA or LMA address. 7517 (Output_section_definition::set_section_addresses): Add code to 7518 check for addresses set by memory regions. 7519 (Output_segment::set_section_addresses): Remove memory region 7520 walking code. 7521 (Script_sections::create_segment): Add a warning if a header 7522 segment is created outside of any region. 7523 * script-sections.h (class Script_sections): Add prototypes for 7524 find_memory_region and block_in_region methods. 7525 * testsuite/memory_test.s: Use .long instead of .word. 7526 * testsuite/memory_test.t: Add some more output sections. 7527 * testsuite/memory_test.sh: Update expected output. 7528 7529 2010-10-02 Doug Kwan <dougkwan (a] google.com> 7530 7531 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move 7532 defintion to symtab.h 7533 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change 7534 declaration to defintion. 7535 7536 2010-10-01 Nick Clifton <nickc (a] redhat.com> 7537 7538 * expression.cc (eval): Replace dummy argument with NULL. 7539 (eval_maybe_dot): Check for a NULL result section pointer. 7540 (Symbol_expression::value): Likewise. 7541 (Dot_expression::value): Likewise. 7542 (BINARY_EXPRESSION): Likewise. 7543 (Max_expression::value): Likewise. 7544 (Min_expression::value): Likewise. 7545 (Absolute_expression::value): Likewise. 7546 (Addr_expression::value_from_output_section): Likewise. 7547 (Loaddddr_expression::value_from_output_section): Likewise. 7548 (Segment_start_expression::value): Likewise. 7549 * script-sections.cc 7550 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy 7551 argument with NULL. 7552 (Sections_elememt_dot_assignment::set_section_addresses): 7553 Likewise. 7554 (Output_data_expression::do_write_to_buffer): Likewise. 7555 (Output_section_definition::finalize_symbols): Likewise. 7556 (Output_section_definition::set_section_addresses): Likewise. 7557 7558 2010-09-30 Doug Kwan <dougkwan (a] google.com> 7559 7560 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests. 7561 7562 2010-09-28 Sriraman Tallam <tmsriram (a] google.com> 7563 7564 * target.h (Target::can_icf_inline_merge_sections): New virtual 7565 function. 7566 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New 7567 virtual function. 7568 * i386.cc (Target_i386::can_icf_inline_merge_sections): New 7569 virtual function. 7570 * icf.cc (get_section_contents): Inline merge sections only when 7571 target allows it. 7572 7573 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues (a] gmx.de> 7574 7575 * configure: Regenerate. 7576 7577 2010-09-17 Ian Lance Taylor <iant (a] google.com> 7578 7579 * testsuite/memory_test.sh: Adjust for change of 2010-09-10. 7580 * testsuite/Makefile.am (memory_test.o): New target. 7581 (memory_test): Depend on memory_test.o, gcctestdir/ld, and 7582 memory_test.t. 7583 * testsuite/Makefile.in: Rebuild. 7584 7585 2010-09-17 Doug Kwan <dougkwan (a] google.com> 7586 7587 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and 7588 defintion if relocation uses GOT entries of the symbol. 7589 * testsuite/icf_safe_test.sh: Fix test. 7590 * testsuite/icf_safe_so_test.sh: Fix test. 7591 7592 2010-09-16 Cary Coutant <ccoutant (a] google.com> 7593 7594 * script_sections.cc (class Memory_region): Remove "NULL" from 7595 vector initializations. 7596 7597 2010-09-15 Cary Coutant <ccoutant (a] google.com> 7598 7599 * incremental.cc (Output_section_incremental_inputs::write_info_blocks): 7600 Resolve forwarding symbols. 7601 7602 2010-09-15 Doug Kwan <dougkwan (a] google.com> 7603 7604 * gold/testsuite/script_test_3.t: Add ARM special sections. 7605 * gold/testsuite/script_test_4.t: Same. 7606 * gold/testsuite/script_test_5.t: Same. 7607 * gold/testsuite/script_test_6.t: Same. 7608 * gold/testsuite/script_test_7.t: Same. 7609 * gold/testsuite/script_test_7.t: Same. 7610 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment. 7611 7612 2010-09-14 Cary Coutant <ccoutant (a] google.com> 7613 7614 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member. 7615 (Target_x86_64::Relocate::relocate_tls): Replace check for 7616 saw_tls_block_reloc_ with test for executable section. 7617 7618 2010-09-12 Cary Coutant <ccoutant (a] google.com> 7619 7620 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from 7621 position-independent executables to shared libraries need dynamic 7622 relocations. 7623 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in 7624 position-independent executables. 7625 * testsuite/Makefile.am (two_file_mixed_pie_test): New test. 7626 * testsuite/Makefile.in: Regenerate. 7627 7628 2010-09-10 Nick Clifton <nickc (a] redhat.com> 7629 7630 PR gold/11997 7631 * testsuite/memory_test.t: Discard any sections that are not 7632 needed. 7633 7634 2010-09-09 H.J. Lu <hongjiu.lu (a] intel.com> 7635 7636 PR gold/11996 7637 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove 7638 "This::" to work around a bug in gcc 4.2. 7639 7640 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)). 7641 7642 2010-09-09 Rafael Espindola <espindola (a] google.com> 7643 7644 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put 7645 sections with different PF_X flags in the same segment. 7646 (Layout::find_first_load_seg): Search all segments to find the first 7647 one. 7648 * options.h (rosegment): New. 7649 7650 2010-09-08 Rafael Espindola <espindola (a] google.com> 7651 7652 * layout.cc (Layout::set_segment_offsets): Always advance to a new page. 7653 7654 2010-09-08 Doug Kwan <dougkwan (a] google.com> 7655 7656 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method. 7657 (Arm_relobj::do_relocate_sections): Add new parameter for output 7658 file to match the parent. 7659 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values 7660 of local symbols instead of input values. Update code to track 7661 changes in gold::relocate_section. 7662 * object.cc (Sized_relobj::compute_final_local_value): New methods. 7663 (Sized_relobj::compute_final_local_value_internal): New methods. 7664 (Sized_relobj::do_finalize_local_symbols): Move code from loop 7665 body into private version of Sized_relobj::compute_final_local_value. 7666 Call the inline method. 7667 * object.h (Symbol_value::Symbol_value): Define destructor. Free 7668 merged symbol value if there is one. 7669 (Symbol_value::has_output_value): New method defintiion. 7670 (Sized_relobj::Compute_final_local_value_status): New enum type. 7671 (Sized_relobj::compute_final_local_value): New methods. 7672 (Sized_relobj::compute_final_local_value_internal): New methods. 7673 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh 7674 and arm_cortex_a8.sh. 7675 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl, 7676 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc): 7677 New tests. 7678 * Makefile.in: Regenerate. 7679 * testsuite/arm_bl_out_of_range.s: Update test. 7680 * testsuite/thumb_bl_out_of_range.s: Ditto. 7681 * testsuite/thumb_blx_out_of_range.s: Ditto. 7682 * testsuite/arm_branch_out_of_range.sh: New file. 7683 * testsuite/arm_cortex_a8.sh: Ditto. 7684 * testsuite/arm_cortex_a8_b.s: Ditto. 7685 * testsuite/arm_cortex_a8_b_cond.s: Ditto. 7686 * testsuite/arm_cortex_a8_b_local.s: Ditto. 7687 * testsuite/arm_cortex_a8_bl.s: Ditto. 7688 * testsuite/arm_cortex_a8_blx.s: Ditto. 7689 * testsuite/arm_cortex_a8_local.s: Ditto. 7690 * testsuite/arm_cortex_a8_local_reloc.s: Ditto. 7691 * testsuite/thumb_bl_out_of_range_local.s: Ditto. 7692 7693 2010-09-08 Rafael Espindola <espindola (a] google.com> 7694 7695 * Makefile.am (memory_test.stdout): Run readelf with -W. 7696 * Makefile.in: Regenerate. 7697 * testsuite/memory_test.sh: Make the regexps accept both 32 and 7698 64 bit output. 7699 7700 2010-09-08 Rafael Espindola <espindola (a] google.com> 7701 7702 * script-sections.cc (Script_sections::add_memory_region): Convert 7703 field precision to int. 7704 * script.cc (script_set_section_region, script_set_section_region): 7705 Convert field precision to int. 7706 7707 2010-09-08 Rafael Espindola <espindola (a] google.com> 7708 7709 * arm.cc (do_finalize_sections): Create the __exidx_start and 7710 __exdix_end symbols even when the section is missing. 7711 7712 2010-09-08 Nick Clifton <nickc (a] redhat.com> 7713 7714 * README: Remove claim that MEMORY is not supported. 7715 * expression.cc (script_exp_function_origin) 7716 (script_exp_function_length): Move from here to ... 7717 * script.cc: ... here. 7718 (script_set_section_region, script_add_memory) 7719 (script_parse_memory_attr, script_include_directive): New 7720 functions. 7721 * script-sections.cc 7722 (class Memory_region): New class. 7723 (class Output_section_definition): Add set_memory_region, 7724 set_section_vma, set_section_lma and get_section_name methods. 7725 (class Script_Sections): Add add_memory_region, 7726 find_memory_region, find_memory_region_origin, 7727 find_memory_region_length and set_memory_region methods. 7728 Have set_section_addresses method walk the list of set memory 7729 regions. 7730 Extend the print methos to display memory regions. 7731 * script-sections.h: Add prototypes for new methods. 7732 Add enum for MEMORY region attributes. 7733 * yyscript.y: Add support for parsing MEMORY regions. 7734 * script-c.h: Add prototypes for new functions. 7735 * testsuite/Makefile.am: Add test of MEMORY region functionality. 7736 * testsuite/Makefile.in: Regenerate. 7737 * testsuite/memory_test.sh: New script. 7738 * testsuite/memory_test.s: New assembler source file. 7739 * testsuite/memory_test.t: New linker script. 7740 7741 2010-08-27 Doug Kwan <dougkwan (a] google.com> 7742 7743 * gold/resolve.cc (Symbol_table::should_override): Let a weak 7744 reference override an existing dynamic weak reference. 7745 * testsuite/Makefile.am: Add new test dyn_weak_ref. 7746 * testsuite/Makefile.in: Regenerate. 7747 * testsuite/dyn_weak_ref.sh: New file. 7748 * testsuite/dyn_weak_ref_1.c: Ditto. 7749 * testsuite/dyn_weak_ref_2.c: Ditto. 7750 7751 2010-08-27 Ian Lance Taylor <iant (a] google.com> 7752 7753 * incremental.h (class Incremental_input_entry): Add virtual 7754 destructor. 7755 7756 2010-08-27 Ian Lance Taylor <iant (a] google.com> 7757 7758 * testsuite/start_lib_test_3.c: Mark t3 as used. 7759 7760 2010-08-27 Nick Clifton <nickc (a] redhat.com> 7761 7762 * options.cc (version_script): Fix small typo in previous 7763 whitespace tidyup. 7764 7765 2010-08-25 Nick Clifton <nickc (a] redhat.com> 7766 7767 * archive.cc: Formatting fixes: Remove whitespace between 7768 typename and following asterisk. Remove whitespace between 7769 function name and opening parenthesis. 7770 * archive.h: Likewise. 7771 * arm.cc: Likewise. 7772 * attributes.cc: Likewise. 7773 * attributes.h: Likewise. 7774 * common.cc: Likewise. 7775 * copy-relocs.cc: Likewise. 7776 * dirsearch.h: Likewise. 7777 * dynobj.cc: Likewise. 7778 * ehframe.cc: Likewise. 7779 * ehframe.h: Likewise. 7780 * expression.cc: Likewise. 7781 * fileread.cc: Likewise. 7782 * fileread.h: Likewise. 7783 * gc.h: Likewise. 7784 * gold-threads.cc: Likewise. 7785 * gold.cc: Likewise. 7786 * i386.cc: Likewise. 7787 * icf.h: Likewise. 7788 * incremental-dump.cc: Likewise. 7789 * incremental.cc: Likewise. 7790 * layout.cc: Likewise. 7791 * layout.h: Likewise. 7792 * main.cc: Likewise. 7793 * merge.cc: Likewise. 7794 * merge.h: Likewise. 7795 * object.cc: Likewise. 7796 * object.h: Likewise. 7797 * options.cc: Likewise. 7798 * options.h: Likewise. 7799 * output.cc: Likewise. 7800 * output.h: Likewise. 7801 * plugin.cc: Likewise. 7802 * plugin.h: Likewise. 7803 * powerpc.cc: Likewise. 7804 * reloc.cc: Likewise. 7805 * script-c.h: Likewise. 7806 * script-sections.cc: Likewise. 7807 * script.cc: Likewise. 7808 * stringpool.cc: Likewise. 7809 * symtab.cc: Likewise. 7810 * symtab.h: Likewise. 7811 * target.cc: Likewise. 7812 * timer.cc: Likewise. 7813 * timer.h: Likewise. 7814 * version.cc: Likewise. 7815 * x86_64.cc: Likewise. 7816 7817 2010-08-24 Nick Clifton <nickc (a] redhat.com> 7818 7819 PR 11899 7820 * layout.cc (segment_precedes): Sort segments by their physical 7821 addresses, if they have been set. 7822 7823 2010-08-23 Cary Coutant <ccoutant (a] google.com> 7824 7825 * archive.cc (Lib_group::add_symbols): Lock object before deleting its 7826 symbols data. 7827 (Lib_group::include_member): Unlock object after deleting its 7828 symbols data. 7829 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger 7830 the bug fixed here. 7831 7832 2010-08-19 Neil Vachharajani <nvachhar (a] google.com> 7833 Cary Coutant <ccoutant (a] google.com> 7834 7835 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust 7836 constructor, and set_blocker. 7837 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check 7838 readsyms_blocker_. 7839 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass 7840 this->this_blocker_ to Add_lib_group_symbols::set_blocker. 7841 * testsuite/Makefile.am (start_lib_test): New test case. 7842 * testsuite/Makefile.in: Regenerate. 7843 * testsuite/start_lib_test_main.c: New file. 7844 * testsuite/start_lib_test_1.c: New file. 7845 * testsuite/start_lib_test_2.c: New file. 7846 * testsuite/start_lib_test_3.c: New file. 7847 7848 2010-08-19 Ian Lance Taylor <iant (a] google.com> 7849 7850 * Makefile.in: Rebuild with automake 1.11.1. 7851 * aclocal.m4: Likewise. 7852 * testsuite/Makefile.in: Likewise. 7853 7854 2010-08-19 Ian Lance Taylor <iant (a] google.com> 7855 7856 PR 10893 7857 * i386.cc (class Output_data_plt_i386): Update declarations. 7858 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and 7859 local_ifuncs_ fields. 7860 (Target_i386::do_plt_section_for_global): New function. 7861 (Target_i386::do_plt_section_for_local): New function. 7862 (Output_data_plt_i386::Output_data_plt_i386): Add symtab 7863 parameter; change all callers. Initialize global_ifuncs_ and 7864 local_ifuncs_. If doing a static link define __rel_iplt_start and 7865 __rel_iplt_end. 7866 (Output_data_plt_i386::add_entry): Handle IFUNC symbols. 7867 (Output_data_plt_i386::add_local_ifunc_entry): New function. 7868 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC 7869 symbols. 7870 (Target_i386::make_plt_section): New function, broken out of 7871 make_plt_entry. Set sh_info field of .rel.plt to point to .plt. 7872 (Target_i386::make_plt_entry): Call make_plt_section. 7873 (Target_i386::make_local_ifunc_plt_entry): New function. 7874 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function. 7875 (Target_i386::Scan::local): Handle IFUNC symbols. Add 7876 R_386_IRELATIVE to switch. 7877 (Target_i386::Scan::global): Likewise. 7878 (Target_i386::Relocate::relocate): Likewise. 7879 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to 7880 switch. 7881 * x86_64.cc (class Output_data_plt_x86_64): Update declarations. 7882 (Target_x86_64::do_plt_section_for_global): New function. 7883 (Target_x86_64::do_plt_section_for_local): New function. 7884 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab 7885 parameter; change all callers. If doing a static link define 7886 __rela_iplt_start and __rela_iplt_end. 7887 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols. 7888 (Output_data_plt_x86_64::add_local_ifunc_entry): New function. 7889 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt 7890 to point to .plt. 7891 (Target_x86_64::make_local_ifunc_plt_entry): New function. 7892 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to 7893 switch. 7894 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function. 7895 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add 7896 R_X86_64_IRELATIVE to switch. 7897 (Target_x86_64::Scan::global): Likewise. 7898 (Target_x86_64::Relocate::relocate): Likewise. 7899 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to 7900 switch. 7901 * target.h (class Target): Add plt_section_for_global and 7902 plt_section_for_local functions. Add do_plt_section_for_global 7903 and do_plt_section_for_local virtual functions. 7904 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add 7905 clarifying comments. 7906 (Symbol::use_plt_offset): Handle IFUNC symbol. 7907 * object.cc (Sized_relobj::Sized_relobj): Initialize 7908 local_plt_offsets_. 7909 (Sized_relobj::local_has_plt_offset): New function. 7910 (Sized_relobj::local_plt_offset): New function. 7911 (Sized_relobj::set_local_plt_offset): New function. 7912 (Sized_relobj::do_count): Handle IFUNC symbol. 7913 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take 7914 a bit away from input_shndx_ field. Add set_is_func_symbol and 7915 is_ifunc_symbol functions. 7916 (class Sized_relobj): Update declarations. Remove Tls_got_entry 7917 and Local_tls_got_offsets. Define Local_plt_offsets. Add 7918 local_plt_offsets_ field. 7919 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_. 7920 * output.h (class Output_section_data): Add non-const 7921 output_section function. 7922 (class Output_data_got): Update declarations. 7923 (class Output_data_got::Got_entry): Add use_plt_offset_ field. 7924 Add use_plt_offset parameter to global and local constructors. 7925 Change all callers. Change local_sym_index_ field to 31 bits. 7926 Change GSYM_CODE and CONSTANT_CODE accordingly. 7927 * output.cc (Output_data_reloc_base::do_adjust_output_section): If 7928 doing a static link don't set sh_link field. 7929 (Output_data_got::Got_entry::write): Use PLT offset if 7930 appropriate. 7931 (Output_data_got::add_global_plt): New function. 7932 (Output_data_got::add_local_plt): New function. 7933 * target-reloc.h (relocate_section): Handle IFUNC symbol. 7934 * defstd.cc (in_section): Remove entries for __rel_iplt_start, 7935 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end. 7936 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11. 7937 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within 7938 IFUNC conditional. 7939 * testsuite/ifunc-sel.h: New file. 7940 * testsuite/ifuncmain1.c: New file. 7941 * testsuite/ifuncmain1vis.c: New file. 7942 * testsuite/ifuncmod1.c: New file. 7943 * testsuite/ifuncdep2.c: New file. 7944 * testsuite/ifuncmain2.c: New file. 7945 * testsuite/ifuncmain3.c: New file. 7946 * testsuite/ifuncmod3.c: New file. 7947 * testsuite/ifuncmain4.c: New file. 7948 * testsuite/ifuncmain5.c: New file. 7949 * testsuite/ifuncmod5.c: New file. 7950 * testsuite/ifuncmain6pie.c: New file. 7951 * testsuite/ifuncmod6.c: New file. 7952 * testsuite/ifuncmain7.c: New file. 7953 * configure, testsuite/Makefile.in: Rebuild. 7954 7955 2010-08-18 Ian Lance Taylor <iant (a] google.com> 7956 7957 * incremental.cc 7958 (Output_section_incremental_inputs::write_input_files): Add cast 7959 to avoid signed/unsigned comparison warning. 7960 (Output_section_incremental_inputs::write_info_blocks): Likewise. 7961 7962 2010-08-12 Cary Coutant <ccoutant (a] google.com> 7963 7964 * common.cc (Sort_commons::operator()): Remove unnecessary code. 7965 7966 2010-08-13 Ian Lance Taylor <iant (a] google.com> 7967 7968 * testsuite/incremental_test_1.c: Add prototype to avoid warning. 7969 7970 2010-08-12 Cary Coutant <ccoutant (a] google.com> 7971 Doug Kwan <dougkwan (a] google.com> 7972 7973 * resolve.cc (Symbol_table::should_override): When a weak dynamic 7974 defintion overrides non-weak undef, remember that the original undef 7975 is not weak. 7976 * symtab.cc (Symbol_table::sized_write_global): For undef without 7977 an original weak binding, set binding to global in output. 7978 * testsuite/Makefile.am: Add new test strong_ref_weak_def. 7979 * testsuite/Makefile.in: Regenerate. 7980 * testsuite/strong_ref_weak_def.sh: New file. 7981 * testsuite/strong_ref_weak_def_1.c: Ditto. 7982 * testsuite/strong_ref_weak_def_2.c: Ditto. 7983 7984 2010-08-12 Cary Coutant <ccoutant (a] google.com> 7985 7986 * testsuite/incremental_test.sh: Rewrite. 7987 * testsuite/incremental_test_1.c: Rewrite. 7988 * testsuite/incremental_test_2.c: Rewrite. 7989 7990 2010-08-12 Cary Coutant <ccoutant (a] google.com> 7991 7992 * arm.cc (Target_arm::got_size): Add const. 7993 (Target_arm::got_entry_count): New function. 7994 (Target_arm::plt_entry_count): New function. 7995 (Target_arm::first_plt_entry_offset): New function. 7996 (Target_arm::plt_entry_size): New function. 7997 (Output_data_plt_arm::entry_count): New function. 7998 (Output_data_plt_arm::first_plt_entry_offset): New function. 7999 (Output_data_plt_arm::get_plt_entry_size): New function. 8000 * i386.cc (Target_i386::got_size): Add const. 8001 (Target_i386::got_entry_count): New function. 8002 (Target_i386::plt_entry_count): New function. 8003 (Target_i386::first_plt_entry_offset): New function. 8004 (Target_i386::plt_entry_size): New function. 8005 (Output_data_plt_i386::entry_count): New function. 8006 (Output_data_plt_i386::first_plt_entry_offset): New function. 8007 (Output_data_plt_i386::get_plt_entry_size): New function. 8008 * incremental-dump.cc (dump_incremental_inputs): Adjust call to 8009 find_incremental_inputs_sections. Dump incremental_got_plt section. 8010 * incremental.cc: Include target.h. 8011 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add 8012 parameter. Adjust all callers. Find incremental_got_plt section. 8013 (Incremental_inputs::create_data_sections): Create incremental_got_plt 8014 section. 8015 (Output_section_incremental_inputs::set_final_data_size): Calculate 8016 size of incremental_got_plt section. 8017 (Output_section_incremental_inputs::do_write): Write the 8018 incremental_got_plt section. 8019 (Got_plt_view_info): New struct. 8020 (Local_got_offset_visitor): New class. 8021 (Global_got_offset_visitor): New class. 8022 (Global_symbol_visitor_got_plt): New class. 8023 (Output_section_incremental_inputs::write_got_plt): New function. 8024 * incremental.h (Incremental_binary::find_incremental_inputs_sections): 8025 Add parameter. Adjust all callers. 8026 (Incremental_binary::do_find_incremental_inputs_sections): Likewise. 8027 (Incremental_inputs::got_plt_section): New function. 8028 (Incremental_inputs::got_plt_section_): New data member. 8029 (Incremental_got_plt_reader): New class. 8030 * layout.cc (Layout::create_incremental_info_sections): Add the 8031 incremental_got_plt section. 8032 * object.h (Got_offset_list::get_list): New function. 8033 (Got offset_list::for_all_got_offsets): New function. 8034 (Sized_relobj::local_got_offset_list): New function. 8035 * powerpc.cc (Target_powerpc::got_size): Add const. 8036 (Target_powerpc::got_entry_count): New function. 8037 (Target_powerpc::plt_entry_count): New function. 8038 (Target_powerpc::first_plt_entry_offset): New function. 8039 (Target_powerpc::plt_entry_size): New function. 8040 (Output_data_plt_powerpc::entry_count): New function. 8041 (Output_data_plt_powerpc::first_plt_entry_offset): New function. 8042 (Output_data_plt_powerpc::get_plt_entry_size): New function. 8043 * sparc.cc (Target_sparc::got_size): Add const. 8044 (Target_sparc::got_entry_count): New function. 8045 (Target_sparc::plt_entry_count): New function. 8046 (Target_sparc::first_plt_entry_offset): New function. 8047 (Target_sparc::plt_entry_size): New function. 8048 (Output_data_plt_sparc::entry_count): New function. 8049 (Output_data_plt_sparc::first_plt_entry_offset): New function. 8050 (Output_data_plt_sparc::get_plt_entry_size): New function. 8051 * symtab.h (Symbol::got_offset_list): New function. 8052 (Symbol_table::for_all_symbols): New function. 8053 * target.h (Sized_target::got_entry_count): New function. 8054 (Sized_target::plt_entry_count): New function. 8055 (Sized_target::plt_entry_size): New function. 8056 * x86_64.cc (Target_x86_64::got_size): Add const. 8057 (Target_x86_64::got_entry_count): New function. 8058 (Target_x86_64::plt_entry_count): New function. 8059 (Target_x86_64::first_plt_entry_offset): New function. 8060 (Target_x86_64::plt_entry_size): New function. 8061 (Output_data_plt_x86_64::entry_count): New function. 8062 (Output_data_plt_x86_64::first_plt_entry_offset): New function. 8063 (Output_data_plt_x86_64::get_plt_entry_size): New function. 8064 8065 2010-08-12 Cary Coutant <ccoutant (a] google.com> 8066 8067 * archive.cc: Include incremental.h. 8068 (Archive::Archive): Initialize incremental_info_. 8069 (Archive::include_member): Record archive members in incremental info. 8070 (Add_archive_symbols::run): Record begin and end of an archive in 8071 incremental info. 8072 (Lib_group::include_member): Record objects in incremental info. 8073 * archive.h (Incremental_archive_entry): Forward declaration. 8074 (Archive::set_incremental_info): New member function. 8075 (Archive::incremental_info): New member function. 8076 (Archive::Unused_symbol_iterator): New class. 8077 (Archive::unused_symbols_begin): New member function. 8078 (Archive::unused_symbols_end): New member function. 8079 (Archive::incremental_info_): New data member. 8080 * incremental-dump.cc (find_input_containing_global): New function. 8081 (dump_incremental_inputs): Dump new incremental info sections. 8082 * incremental.cc: Include symtab.h. 8083 (Output_section_incremental_inputs): New class. 8084 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support 8085 new incremental info sections. 8086 (Sized_incremental_binary::do_check_inputs): Likewise. 8087 (Incremental_inputs::report_archive): Remove. 8088 (Incremental_inputs::report_archive_begin): New function. 8089 (Incremental_inputs::report_archive_end): New function. 8090 (Incremental_inputs::report_object): New function. 8091 (Incremental_inputs::finalize_inputs): Remove. 8092 (Incremental_inputs::report_input_section): New function. 8093 (Incremental_inputs::report_script): Rewrite. 8094 (Incremental_inputs::finalize): Do nothing but finalize string table. 8095 (Incremental_inputs::create_incremental_inputs_section_data): Remove. 8096 (Incremental_inputs::sized_create_inputs_section_data): Remove. 8097 (Incremental_inputs::create_data_sections): New function. 8098 (Incremental_inputs::relocs_entsize): New function. 8099 (Output_section_incremental_inputs::set_final_data_size): New function. 8100 (Output_section_incremental_inputs::do_write): New function. 8101 (Output_section_incremental_inputs::write_header): New function. 8102 (Output_section_incremental_inputs::write_input_files): New function. 8103 (Output_section_incremental_inputs::write_info_blocks): New function. 8104 (Output_section_incremental_inputs::write_symtab): New function. 8105 * incremental.h (Incremental_script_entry): Forward declaration. 8106 (Incremental_object_entry): Forward declaration. 8107 (Incremental_archive_entry): Forward declaration. 8108 (Incremental_inputs): Forward declaration. 8109 (Incremental_inputs_header_data): Remove. 8110 (Incremental_inputs_header): Remove. 8111 (Incremental_inputs_header_write): Remove. 8112 (Incremental_inputs_entry_data): Remove. 8113 (Incremental_inputs_entry): Remove. 8114 (Incremental_inputs_entry_write): Remove. 8115 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER. 8116 (Incremental_binary::find_incremental_inputs_sections): Add parameters. 8117 (Incremental_binary::do_find_incremental_inputs_sections): Likewise. 8118 (Sized_ncremental_binary::do_find_incremental_inputs_sections): 8119 Likewise. 8120 (Incremental_input_entry): New class. 8121 (Incremental_script_entry): New class. 8122 (Incremental_object_entry): New class. 8123 (Incremental_archive_entry): New class. 8124 (Incremental_inputs::Incremental_inputs): Initialize new data members. 8125 (Incremental_inputs::report_inputs): Remove. 8126 (Incremental_inputs::report_archive): Remove. 8127 (Incremental_inputs::report_archive_begin): New function. 8128 (Incremental_inputs::report_archive_end): New function. 8129 (Incremental_inputs::report_object): Change prototype. 8130 (Incremental_inputs::report_input_section): New function. 8131 (Incremental_inputs::report_script): Change prototype. 8132 (Incremental_inputs::get_reloc_count): New function. 8133 (Incremental_inputs::set_reloc_count): New function. 8134 (Incremental_inputs::create_data_sections): New function. 8135 (Incremental_inputs::create_incremental_inputs_section_data): Remove. 8136 (Incremental_inputs::inputs_section): New function. 8137 (Incremental_inputs::symtab_section): New function. 8138 (Incremental_inputs::relocs_section): New function. 8139 (Incremental_inputs::get_stringpool): Add const. 8140 (Incremental_inputs::command_line): Add const. 8141 (Incremental_inputs::inputs): Remove. 8142 (Incremental_inputs::command_line_key): New function. 8143 (Incremental_inputs::input_file_count): New function. 8144 (Incremental_inputs::input_files): New function. 8145 (Incremental_inputs::relocs_entsize): New function. 8146 (Incremental_inputs::sized_create_inputs_section_data): Remove. 8147 (Incremental_inputs::finalize_inputs): Remove. 8148 (Incremental_inputs::Input_info): Remove. 8149 (Incremental_inputs::lock_): Remove. 8150 (Incremental_inputs::inputs_): Change type. 8151 (Incremental_inputs::inputs_map_): Remove. 8152 (Incremental_inputs::current_object_entry_): New data member. 8153 (Incremental_inputs::inputs_section_): New data member. 8154 (Incremental_inputs::symtab_section_): New data member. 8155 (Incremental_inputs::relocs_section_): New data member. 8156 (Incremental_inputs::reloc_count_): New data member. 8157 (Incremental_inputs_reader): New class. 8158 (Incremental_symtab_reader): New class. 8159 (Incremental_relocs_reader): New class. 8160 * layout.cc (Layout::finalize): Move finalization of incremental info 8161 and creation of incremental info sections to follow finalization of 8162 symbol table. Set offsets for postprocessing sections. 8163 (Layout::create_incremental_info_sections): Call 8164 Incremental_inputs::create_data_sections. Add incremental symtab 8165 and relocs sections. Set sh_entsize and sh_link fields. Arrange for 8166 sections to layout after input sections. 8167 * layout.h (struct Timespec): Forward declaration. 8168 (Layout::incremental_inputs): Add const. 8169 (Layout::create_incremental_info_sections): Add parameter. 8170 * main.cc (main): Remove call to Incremental_inputs::report_inputs. 8171 * object.cc: Include incremental.h. 8172 (Relobj::finalize_incremental_relocs): New function. 8173 (Sized_relobj::do_layout): Record input sections in incremental info. 8174 * object.h (Object::output_section): New function. 8175 (Object::output_section_offset): Moved from Relobj. 8176 (Object::get_incremental_reloc_base): New function. 8177 (Object::get_incremental_reloc_count): New function. 8178 (Object::do_output_section): New function. 8179 (Object::do_output_section_offset): Moved from Relobj. 8180 (Object::do_get_incremental_reloc_base): New function. 8181 (Object::do_get_incremental_reloc_count): New function. 8182 (Object::Object): Initialize new data members. 8183 (Relobj::output_section): Renamed do_output_section and moved to 8184 protected. 8185 (Relobj::output_section_offset): Moved to Object. 8186 (Relobj::do_get_incremental_reloc_base): New function. 8187 (Relobj::do_get_incremental_reloc_count): New function. 8188 (Relobj::allocate_incremental_reloc_counts): New function. 8189 (Relobj::count_incremental_reloc): New function. 8190 (Relobj::finalize_incremental_relocs): New function. 8191 (Relobj::next_incremental_reloc_index): New function. 8192 (Relobj::reloc_counts_): New data member. 8193 (Relobj::reloc_bases_): New data member. 8194 (Sized_relobj::do_relocate_sections): Add parameter. Change caller. 8195 (Sized_relobj::relocate_sections): Add parameter. Change all callers. 8196 (Sized_relobj::incremental_relocs_scan): New function. 8197 (Sized_relobj::incremental_relocs_scan_reltype): New function. 8198 (Sized_relobj::incremental_relocs_write): New function. 8199 (Sized_relobj::incremental_relocs_write_reltype): New function. 8200 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for 8201 incremental link. 8202 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of 8203 archives and object files elsewhere. 8204 (Add_symbols::run): Report object files here. 8205 (Finish_group::run): Report end of archive at end of group. 8206 * reloc.cc: Include layout.h, incremental.h. 8207 (Sized_relobj::do_read_relocs): Need relocations for incremental link. 8208 (Sized_relobj::do_scan_relocs): Record relocations for incremental link. 8209 (Sized_relobj::incremental_relocs_scan): New function. 8210 (Sized_relobj::incremental_relocs_scan_reltype): New function. 8211 (Sized_relobj::do_relocate_sections): Write incremental relocations. 8212 (Sized_relobj::incremental_relocs_write): New function. 8213 (Sized_relobj::incremental_relocs_write_reltype): New function. 8214 * script.cc (read_input_script): Rewrite test for incremental link. 8215 Change call to Incremental_inputs::report_script. 8216 * symtab.h (Symbol_table::first_global_index): New function. 8217 (Symbol_table::output_count): New function. 8218 8219 2010-08-12 Doug Kwan <dougkwan (a] google.com> 8220 8221 * arm.cc (Target_arm::merge_object_attributes): Check command line 8222 options --no-wchar-size-warning and --no-enum-size-warning. 8223 * options.h (General_options): Add ld-compatible options 8224 --no-enum-size-warning and --no-wchar-size-warning. 8225 8226 2010-08-04 Ian Lance Taylor <iant (a] google.com> 8227 8228 * x86_64.cc (Target_x86_64::Scan::local): Use 8229 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and 8230 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY. 8231 (Target_x86_64::Scan::global): Likewise. 8232 (Target_x86_64::Relocate::relocate): Likewise. 8233 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc): 8234 Likewise. 8235 8236 2010-08-03 Cary Coutant <ccoutant (a] google.com> 8237 8238 * merge.cc (Output_merge_string::do_add_input_section): Count strings 8239 to reserve space in merged_strings vector. Keep total input size 8240 for stats. 8241 (Output_merge_string::do_print_merge_stats): Print total input size. 8242 * merge.h (Output_merge_string): Add input_size_ field. 8243 * stringpool.cc (Stringpool_template::string_length): Move 8244 implementations out of Stringpool_template class and place in 8245 stringpool.h. 8246 * stringpool.h (string_length): Move out of Stringpool_template. 8247 8248 2010-08-03 Ian Lance Taylor <iant (a] google.com> 8249 8250 PR 11712 8251 * layout.cc (relaxation_loop_body): If address of load segment is 8252 set, adjust address to include headers if possible. 8253 8254 2010-08-03 Ian Lance Taylor <iant (a] google.com> 8255 8256 * version.cc (version_string): Bump to 1.10. 8257 8258 2010-08-03 Ian Lance Taylor <iant (a] google.com> 8259 8260 PR 11805 8261 * layout.h (enum Output_section_order): Define. 8262 (class Layout): Update declarations. 8263 * layout.cc (Layout::get_output_section): Add order parameter. 8264 Remove is_interp, is_dynamic_linker_section, is_last_relro, and 8265 is_first_non_relro parameters. Change all callers. 8266 (Layout::choose_output_section): Likewise. 8267 (Layout::add_output_section_data): Likewise. 8268 (Layout::make_output_section): Likewise. Set order. 8269 (Layout::default_section_order): New function. 8270 (Layout::layout_eh_frame): Call add_output_section_to_nonload. 8271 * output.cc (Output_section::Output_section): Initialize order_. 8272 Don't initialize deleted fields. 8273 (Output_segment::Output_segment): Don't initialize deleted 8274 fields. 8275 (Output_segment::add_output_section_to_load): New function 8276 replacing add_output_section. Change all callers to call this or 8277 add_output_section_to_nonload. 8278 (Output_segment::add_output_section_to_nonload): New function. 8279 (Output_segment::remove_output_section): Rewrite. 8280 (Output_segment::add_initial_output_data): Likewise. 8281 (Output_segment::has_any_data_sections): Likewise. 8282 (Output_segment::is_first_section_relro): Likewise. 8283 (Output_segment::maximum_alignment): Likewise. 8284 (Output_segment::has_dynamic_reloc): New function replacing 8285 dynamic_reloc_count. Change all callers. 8286 (Output_segment::has_dynamic_reloc_list): New function replacing 8287 dynamic_reloc_count_list. Change all callers. 8288 (Output_segment::set_section_addresses): Rewrite. 8289 (Output_segment::set_offset): Rewrite. 8290 (Output_segment::find_first_and_last_list): Remove. 8291 (Output_segment::set_tls_offsets): Rewrite. 8292 (Output_segment::first_section_load_address): Likewise. 8293 (Output_segment::output_section_count): Likewise. 8294 (Output_segment::section_with_lowest_load_address): Likewise. 8295 (Output_segment::write_section_headers): Likewise. 8296 (Output_segment::print_sections_to_map): Likewise. 8297 * output.h (class Output_data): Remove dynamic_reloc_count_ 8298 field. Add has_dynamic_reloc_ field. Make bools into bitfields. 8299 (Output_data::add_dynamic_reloc): Rewrite. 8300 (Output_data::has_dynamic_reloc): New function. 8301 (Output_data::dynamic_reloc_count): Remove. 8302 (class Output_section): Add order_ field. Remvoe is_relro_local_, 8303 is_last_relro_, is_first_non_relro_, is_interp_, 8304 is_dynamic_linker_section_ fields. Add order and set_order 8305 functions. Remove is_relro_local, set_is_relro_local, 8306 is_last_relro, set_is_last_relro, is_first_non_relro, 8307 set_is_first_non_relro functions, is_interp, set_is_interp, 8308 is_dynamic_linker_section, and set_is_dynamic_linker_section 8309 functions. 8310 (class Output_segment): Change Output_data_list from std::list to 8311 std:;vector. Add output_lists_ field. Remove output_data_ and 8312 output_bss_ fields. Update declarations. 8313 8314 2010-08-02 Ian Lance Taylor <iant (a] google.com> 8315 8316 * arm.cc (Target_arm::gc_process_relocs): Use typename. 8317 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise. 8318 * sparc.cc (Target_sparc::gc_process_relocs): Likewise. 8319 8320 2010-08-02 Ian Lance Taylor <iant (a] google.com> 8321 8322 PR 11855 8323 * script.cc (Script_options::Script_options): Initialize 8324 symbol_definitions_ and symbol_references_. 8325 (Script_options::add_symbol_assignment): Update 8326 symbol_definitions_ and symbol_references_. 8327 (Script_options::add_symbol_reference): New function. 8328 (script_symbol): New function. 8329 * script.h (class Script_options): Add symbol_definitions_ and 8330 symbol_references_ fields. 8331 (Script_options::referenced_const_iterator): New type. 8332 (Script_options::referenced_begin): New function. 8333 (Script_options::referenced_end): New function. 8334 (Script_options::is_referenced): New function. 8335 (Script_options::any_unreferenced): New function. 8336 * script-c.h (script_symbol): Declare. 8337 * yyscript.y (exp): Call script_symbol. 8338 * symtab.cc: Include "script.h". 8339 (Symbol_table::gc_mark_undef_symbols): Add layout parameter. 8340 Change all callers. Check symbols referenced by scripts. 8341 (Symbol_table::add_undefined_symbols_from_command_line): Add 8342 layout parameter. Change all callers. 8343 (Symbol_table::do_add_undefined_symbols_from_command_line): 8344 Likewise. Break out loop body. Check symbols referenced by 8345 scripts. 8346 (Symbol_table::add_undefined_symbol_from_command_line): New 8347 function broken out of 8348 do_add_undefined_symbols_from_command_line. 8349 * symtab.h (class Symbol_table): Update declarations. 8350 * archive.cc: Include "layout.h". 8351 (Archive::should_include_member): Add layout parameter. Change 8352 all callers. Check for symbol mentioned in expression. 8353 * archive.h (class Archive): Update declaration. 8354 * object.cc (Sized_relobj::do_should_include_member): Add layout 8355 parameter. 8356 * object.h (Object::should_include_member): Add layout parameter. 8357 Change all callers. 8358 (Object::do_should_include_member): Add layout parameter. 8359 (class Sized_relobj): Update declaration. 8360 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout 8361 parameter. 8362 * dynobj.h (class Sized_dynobj): Update declaration. 8363 * plugin.cc (Sized_pluginobj::do_should_include_member): Add 8364 layout parameter. 8365 * plugin.h (class Sized_pluginobj): Update declaration. 8366 8367 2010-08-02 Ian Lance Taylor <iant (a] google.com> 8368 8369 PR 11866 8370 * output.cc (Output_segment::set_offset): Search for the first and 8371 last sections rather than assuming that the list is in order. 8372 (Output_segment::find_first_and_last_list): New function. 8373 * output.h (class Output_segment): Update declarations. 8374 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test. 8375 (relro_strip_test_SOURCES): New variable. 8376 (relro_strip_test_DEPENDENCIES): New variable. 8377 (relro_strip_test_LDFLAGS): New variable. 8378 (relro_strip_test_LDADD): New variable. 8379 (relro_strip_test.so): New target. 8380 8381 2010-08-02 Ian Lance Taylor <iant (a] google.com> 8382 8383 * i386.cc (class Target_i386): Add got_tlsdesc_ field. 8384 (Target_i386::Target_i386):: Initialize got_tlsdesc_. 8385 (Target_i386::got_tlsdesc_section): New function. 8386 (Target_i386::got_section): Create space for GOT entries for 8387 TLSDESC relocations. 8388 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized 8389 R_386_TLS_GOTDESC. 8390 (Target_i386::Scan::global): Likewise. 8391 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when 8392 using TLSDESC GOT. 8393 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field. 8394 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_. 8395 (Target_x86_64::got_tlsdesc_section): New function. 8396 (Target_x86_64::got_section): Create space for GOT entries for 8397 TLSDESC relocations. 8398 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized 8399 R_386_TLS_GOTDESC. 8400 (Target_x86_64::Scan::global): Likewise. 8401 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when 8402 using TLSDESC GOT. 8403 8404 2010-08-02 Ian Lance Taylor <iant (a] google.com> 8405 8406 * testsuite/final_layout.sh: Use dc to convert from hex to 8407 decimal. 8408 8409 2010-07-29 Sriraman Tallam <tmsriram (a] google.com> 8410 8411 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template 8412 paramter to the call to gold::gc_process_relocs. 8413 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template 8414 paramter to the call to gold::gc_process_relocs. 8415 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template 8416 parameter to the call to gold::gc_process_relocs. 8417 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add 8418 template parameter to the call to gold::gc_process_relocs. 8419 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template 8420 paramter to the call to gold::gc_process_relocs. 8421 * gc.h (get_embedded_addend_size): New function. 8422 (gc_process_relocs): Save the size of the reloc for use by ICF. 8423 * icf.cc (get_section_contents): Get the addend from the text section 8424 for SHT_REL relocation sections. 8425 * icf.h (Icf::Reloc_addend_size_info): New typedef. 8426 (Icf::Reloc_info): Add new member reloc_addend_size_info. 8427 * int_encoding.h (read_from_pointer): New overloaded function. 8428 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test. 8429 * testsuite/icf_sht_rel_addend_test.sh: New file. 8430 * testsuite/icf_sht_rel_addend_test_1.cc: New file. 8431 * testsuite/icf_sht_rel_addend_test_2.cc: New file. 8432 8433 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues (a] gmx.de> 8434 8435 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option. 8436 * Makefile.in: Regenerate. 8437 * testsuite/Makefile.in: Regenerate. 8438 8439 2010-07-27 Jeffrey Yasskin <jyasskin (a] google.com> 8440 8441 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior. 8442 * gold/testsuite/debug_msg.cc: Likewise. 8443 * gold/testsuite/odr_violation1.cc 8444 * gold/testsuite/odr_violation2.cc 8445 8446 2010-07-21 Cary Coutant <ccoutant (a] google.com> 8447 8448 * merge.h (Output_merge_string::Merged_string): Remove object, shndx, 8449 string, and length fields. 8450 (Output_merge_string::Merged_strings_list): New type. 8451 (Output_merge_string::Merged_strings_lists): New typedef. 8452 (Output_merge_string): Replace merged_strings_ with 8453 merged_strings_lists_. 8454 * merge.cc (Output_merge_string::do_add_input_section): Allocate new 8455 Merged_strings_list per input object and section. Don't store pointer 8456 to the string. Don't store length with each merged string entry. 8457 (Output_merge_string::finalize_merged_data): Loop over list of merged 8458 strings lists. Recompute length of each merged string. 8459 8460 2010-07-15 Cary Coutant <ccoutant (a] google.com> 8461 8462 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from 8463 here. 8464 8465 2010-07-14 Ian Lance Taylor <iant (a] google.com> 8466 8467 * descriptors.cc (Descriptors::open): Report correct name in error 8468 message. 8469 8470 2010-07-13 Doug Kwan <dougkwan (a] google.com> 8471 8472 * arm.cc (Arm_input_section::Arm_input_section): For a 8473 SHT_ARM_EXIDX section, always keeps the input sections. 8474 (Arm_input_section::set_exidx_section_link): New method. 8475 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize 8476 has_errors_ to false. 8477 (Arm_exidx_input_section::has_errors, 8478 Arm_exidx_input_section::set_has_errors): New methods. 8479 (Arm_exidx_input_section::has_errors_): New data member. 8480 (Arm_relobj::get_exidx_shndx_list): New method. 8481 (Arm_output_section::append_text_sections_to_list): Do not skip 8482 section without SHF_EXECINSTR. 8483 (Arm_output_section::fix_exidx_coverage): Skip input sections with 8484 errors. 8485 (Arm_relobj::make_exidx_input_section): Add new parameter for text 8486 section header. Make error messages more verbose. Check for 8487 a non-executable section linked to an EXIDX section. 8488 (Arm_relobj::do_read_symbols): Remove error checking, which has been 8489 moved to Arm_relobj::make_exidx_input_section. Add an assertion to 8490 check that there is no deferred EXIDX section if we exit early. 8491 Instead of not making an EXIDX section in case of an error, make one 8492 and set the has_errors flag of it. 8493 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections 8494 in a relocatable link. 8495 (Target_arm::do_relax): Look for the EXIDX output section instead of 8496 assuming that it is called .ARM.exidx. 8497 (Target_arm::fix_exidx_coverage): Add a new parameter for input 8498 section list. Do not check for SHF_EXECINSTR section flags but 8499 skip any input section with errors. 8500 * output.cc (Output_section::Output_section): Initialize 8501 always_keeps_input_sections_ to false. 8502 (Output_section::add_input_section): Check for 8503 always_keeps_input_sections_. 8504 * output.h (Output_section::always_keeps_input_sections, 8505 Output_section::set_always_keeps_input_sections): New methods. 8506 (Output_section::always_keeps_input_sections): New data member. 8507 8508 2010-07-13 Rafael Espindola <espindola (a] google.com> 8509 8510 * fileread.cc (try_extra_search_path, find_file): Move to Input_file. 8511 * fileread.h (Input_file): Add try_extra_search_path and find_file. 8512 8513 2010-07-13 Philip Herron <herron.philip (a] googlemail.com> 8514 Ian Lance Taylor <iant (a] google.com> 8515 8516 * output.h (Output_section_lookup_maps::add_merge_section): 8517 Correct check of whether value was inserted. 8518 (Output_section_lookup_maps::add_merge_input_section): Likewise. 8519 (Output_section_lookup_maps::add_relaxed_input_section): 8520 Likewise. 8521 * arm.cc (Target_arm::got_section): Remove used local os. 8522 * i386.cc (Target_i386::got_section): Likewise. 8523 * x86_64.cc (Target_x86_64::got_section): Likewise. 8524 * sparc.cc (Target_sparc::got_section): Likewise. 8525 (Target_sparc::relocate): Remove unused local have_got_offset. 8526 * powerpc.cc (Target_powerpc::relocate): Likewise. 8527 8528 2010-07-13 Ian Lance Taylor <iant (a] google.com> 8529 8530 * compressed_output.cc (zlib_decompress): Fix signature in 8531 !HAVE_ZLIB_H case. 8532 8533 * archive.cc (Archive::include_member): Unlock an external member 8534 of a thin archive. Don't bother to delete an object we know is 8535 NULL. 8536 8537 2010-07-12 Cary Coutant <ccoutant (a] google.com> 8538 8539 * compressed_output.cc (zlib_decompress): New function. 8540 (get_uncompressed_size): New function. 8541 (decompress_input_section): New function. 8542 * compressed_output.h (get_uncompressed_size): New function. 8543 (decompress_input_section): New function. 8544 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info) 8545 Handle compressed debug sections. 8546 * layout.cc (is_compressed_debug_section): New function. 8547 (Layout::output_section_name): Map compressed section names to 8548 canonical names. 8549 * layout.h (is_compressed_debug_section): New function. 8550 (is_debug_info_section): Recognize compressed debug sections. 8551 * merge.cc: Include compressed_output.h. 8552 (Output_merge_data::do_add_input_section): Handle compressed 8553 debug sections. 8554 (Output_merge_string::do_add_input_section): Handle compressed 8555 debug sections. 8556 * object.cc: Include compressed_output.h. 8557 (Sized_relobj::Sized_relobj): Initialize new data members. 8558 (build_compressed_section_map): New function. 8559 (Sized_relobj::do_read_symbols): Handle compressed debug sections. 8560 * object.h (Object::section_is_compressed): New method. 8561 (Object::do_section_is_compressed): New method. 8562 (Sized_relobj::Compressed_section_map): New type. 8563 (Sized_relobj::do_section_is_compressed): New method. 8564 (Sized_relobj::compressed_sections_): New data member. 8565 * output.cc (Output_section::add_input_section): Handle compressed 8566 debug sections. 8567 * reloc.cc: Include compressed_output.h. 8568 (Sized_relobj::write_sections): Handle compressed debug sections. 8569 8570 2010-07-08 Cary Coutant <ccoutant (a] google.com> 8571 8572 * resolve.cc (Symbol_table::resolve): Remember whether undef was 8573 weak when resolving to a dynamic def. 8574 (Symbol_table::should_override): Add adjust_dyndef flag; set it 8575 for weak undef/dynamic def cases. Adjust callers. 8576 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and 8577 undef_binding_weak_. 8578 (Symbol_table::sized_write_globals): Adjust symbol binding. 8579 (Symbol_table::sized_write_symbol): Add binding parameter. 8580 * symtab.h (Symbol::set_undef_binding): New method. 8581 (Symbol::is_undef_binding_weak): New method. 8582 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members. 8583 (Symbol_table::should_override): Add new parameter. 8584 (Symbol_table::sized_write_symbol): Add new parameter. 8585 8586 * testsuite/weak_undef_file1.cc: Add new test case. 8587 * testsuite/weak_undef_file2.cc: Fix header comment. 8588 * testsuite/weak_undef_test.cc: Add new test case. 8589 8590 2010-06-29 Doug Kwan <dougkwan (a] google.com> 8591 8592 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property): 8593 Initialize USE_SYMBOL_. 8594 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method 8595 definition. 8596 (Arm_reloc_property::uses_symbol_): New data member declaration. 8597 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation 8598 uses symbol value and symbol is undefined but not weakly undefined. 8599 8600 2010-06-28 Rafael Espindola <espindola (a] google.com> 8601 8602 * plugin.cc (Plugin::load): Use dlerror. 8603 8604 2010-06-26 Jeffrey Yaskin <jyasskin (a] google.com> 8605 8606 * symtab.cc (detect_odr_violations): When reporting an ODR 8607 violation, report an object where the symbol is defined. 8608 8609 2010-06-25 Doug Kwan <dougkwan (a] google.com> 8610 8611 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true. 8612 (Target_arm::section_may_have_icf_unsafe_pointers): New method 8613 definition. 8614 (Target_arm::Scan::local_reloc_may_be_function_pointer, 8615 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement 8616 target hook to detect function points. 8617 (Target_arm::Scan::possible_function_pointer_reloc): New method. 8618 * icf.h (Icf::check_section_for_function_pointers): Change type of 8619 parameter SECTION_NAME to const reference to std::string. Use 8620 target hook to determine if section may have unsafe pointers. 8621 * target.h (Target::section_may_have_icf_unsafe_pointers): New 8622 method definition. 8623 8624 2010-06-21 Rafael Espindola <espindola (a] google.com> 8625 8626 * fileread.cc (Input_file::find_fie): New 8627 (Input_file::open): Use Input_file::find_fie. 8628 * fileread.h (Input_file::find_fie): New 8629 * plugin.cc (set_extra_library_path): New. 8630 (Plugin::load): Add set_extra_library_path to the transfer vector. 8631 (Plugin_manager::set_extra_library_path): New. 8632 (Plugin_manager::add_input_file): Use the extra search path if set. 8633 (set_extra_library_path(): New. 8634 * plugin.h (Plugin_manager): Add set_extra_library_path and 8635 extra_search_path_. 8636 8637 2010-06-19 Cary Coutant <ccoutant (a] google.com> 8638 8639 * layout.cc (gdb_sections): Add .debug_types. 8640 (lines_only_debug_sections): Likewise. 8641 8642 2010-06-18 Rafael Espindola <espindola (a] google.com> 8643 8644 * plugin.cc (add_input_file,add_input_library) 8645 (Plugin_manager::add_input_file): Make filename arguments const. 8646 * plugin.h (Plugin_manager::add_input_file): Make filename arguments 8647 const. 8648 8649 2010-06-16 Doug Kwan <dougkwan (a] google.com> 8650 8651 * arm.cc (Target_arm::do_finalize_sections): Do not emit an 8652 .ARM.attributes section if we have not merged any input 8653 attributes sections. 8654 8655 2010-06-15 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 8656 8657 * arm.cc: Allow combining objects with no EABI version 8658 information. 8659 8660 2010-06-15 Rafael Espindola <espindola (a] google.com> 8661 8662 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol. 8663 8664 2010-06-15 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 8665 8666 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV. 8667 (struct iovec): Correct !HAVE_READV definition. 8668 8669 2010-06-10 Cary Coutant <ccoutant (a] google.com> 8670 8671 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections. 8672 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred 8673 reloc sections. 8674 * object.h (Sized_relobj::deferred_layout_relocs_): New data member. 8675 8676 PR 11683 8677 * symtab.h (Symbol::is_placeholder): New member function. 8678 * target-reloc.h (relocate_section): Check for placeholder symbols. 8679 8680 * testsuite/Makefile.am (plugin_test_8): New test. 8681 (plugin_test_9): New test. 8682 * testsuite/Makefile.in: Regenerate. 8683 8684 2010-06-09 Nick Clifton <nickc (a] redhat.com> 8685 8686 * yyscript.y (input_list_element): Allow strings prefixed with 8687 the '-' character. Treat these as libraries. 8688 * script.cc (script_add_library): New function. Adds a library 8689 specified by "-l<name>" found in an input script. 8690 * script-c.h: Add prototype for script_add_library. 8691 8692 2010-06-07 Doug Kwan <dougkwan (a] google.com> 8693 8694 * arm.cc (Target_arm::do_relax): Reserve more space for stubs. 8695 Restrict stub-group size to be within long conditional branch 8696 range when working around cortex-A8 erratum. 8697 8698 2010-06-07 Damien Diederen <dd (a] crosstwine.com> 8699 8700 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct 8701 #ifdef typo. 8702 8703 2010-06-03 Sriraman Tallam <tmsriram (a] google.com> 8704 8705 PR gold/11658 8706 * output.cc 8707 (Output_section::Input_section_sort_entry::compare_section_ordering): 8708 Change to return non-zero correctly. 8709 (Output_section::Input_section_sort_section_order_index_compare 8710 ::operator()): Change to fix ambiguity in comparisons. 8711 8712 2010-06-01 Sriraman Tallam <tmsriram (a] google.com> 8713 8714 * gold.h (is_wildcard_string): New function. 8715 * layout.cc (Layout::layout): Pass this pointer to add_input_section. 8716 (Layout::layout_eh_frame): Ditto. 8717 (Layout::find_section_order_index): New method. 8718 (Layout::read_layout_from_file): New method. 8719 * layout.h (Layout::find_section_order_index): New method. 8720 (Layout::read_layout_from_file): New method. 8721 (Layout::input_section_position_): New private member. 8722 (Layout::input_section_glob_): New private member. 8723 * main.cc (main): Call read_layout_from_file here. 8724 * options.h (--section-ordering-file): New option. 8725 * output.cc (Output_section::input_section_order_specified_): New 8726 member. 8727 (Output_section::Output_section): Initialize new member. 8728 (Output_section::add_input_section): Add new parameter. 8729 Keep input sections when --section-ordering-file is used. 8730 (Output_section::set_final_data_size): Sort input sections when 8731 section ordering file is specified. 8732 (Output_section::Input_section_sort_entry): Add new parameter. 8733 Check sorting type. 8734 (Output_section::Input_section_sort_entry::compare_section_ordering): 8735 New method. 8736 (Output_section::Input_section_sort_compare::operator()): Change to 8737 consider section_order_index. 8738 (Output_section::Input_section_sort_init_fini_compare::operator()): 8739 Change to consider section_order_index. 8740 (Output_section::Input_section_sort_section_order_index_compare 8741 ::operator()): New method. 8742 (Output_section::sort_attached_input_sections): Change to sort 8743 according to section order when specified. 8744 (Output_section::add_input_section<32, true>): Add new parameter. 8745 (Output_section::add_input_section<64, true>): Add new parameter. 8746 (Output_section::add_input_section<32, false>): Add new parameter. 8747 (Output_section::add_input_section<64, false>): Add new parameter. 8748 * output.h (Output_section::add_input_section): Add new parameter. 8749 (Output_section::input_section_order_specified): New 8750 method. 8751 (Output_section::set_input_section_order_specified): New method. 8752 (Input_section::Input_section): Initialize section_order_index_. 8753 (Input_section::section_order_index): New method. 8754 (Input_section::set_section_order_index): New method. 8755 (Input_section::section_order_index_): New member. 8756 (Input_section::Input_section_sort_section_order_index_compare): New 8757 struct. 8758 (Output_section::input_section_order_specified_): New member. 8759 * script-sections.cc (is_wildcard_string): Delete and move modified 8760 method to gold.h. 8761 (Output_section_element_input::Output_section_element_input): Modify 8762 call to is_wildcard_string. 8763 (Output_section_element_input::Input_section_pattern 8764 ::Input_section_pattern): Ditto. 8765 (Output_section_element_input::Output_section_element_input): Ditto. 8766 * testsuite/Makefile.am (final_layout): New test case. 8767 * testsuite/Makefile.in: Regenerate. 8768 * testsuite/final_layout.cc: New file. 8769 * testsuite/final_layout.sh: New file. 8770 8771 2010-06-01 Rafael Espindola <espindola (a] google.com> 8772 8773 * plugin.cc (Plugin::load): Pass the output name to the plugin. 8774 8775 2010-06-01 Rafael Espindola <espindola (a] google.com> 8776 8777 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the 8778 visibility of symbols. 8779 8780 2010-05-27 Doug Kwan <dougkwan (a] google.com> 8781 8782 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset 8783 from start of output section instead of address for a local symbol 8784 in a merged or relaxed section when doing a relocatable link. 8785 8786 2010-05-26 Rafael Espindola <espindola (a] google.com> 8787 8788 PR 11604 8789 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid 8790 adding sections the garbage collector removed. 8791 * gold/testsuite/Makefile.am: Add test. 8792 * gold/testsuite/Makefile.in: Regenerate. 8793 * gold/testsuite/plugin_test_7.sh: New. 8794 * gold/testsuite/plugin_test_7_1.c: New. 8795 * gold/testsuite/plugin_test_7_2.c: New. 8796 8797 2010-05-26 Rafael Espindola <espindola (a] google.com> 8798 8799 * script-sections.cc (Output_section_definition::set_section_addresses): 8800 Check for --section-start. 8801 8802 2010-05-26 Doug Kwan <dougkwan (a] google.com> 8803 8804 * arm.cc (Arm_scan_relocatable_relocs): New class. 8805 (Target_arm::relocate_special_relocatable): New method. 8806 (Arm_relocate_functions::arm_branch_common): Handle relocatable link. 8807 (Arm_relocate_functions::thumb_branch_common): Same. 8808 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs 8809 instead of Default_scan_relocatable_relocs. 8810 * target-reloc.h (relocate_for_relocatable): Let target handle 8811 relocation strategy Relocatable_relocs::RELOC_SPECIAL. 8812 * target.h (Sized_target::relocate_special_relocatable): New method. 8813 8814 2010-05-25 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 8815 8816 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined. 8817 8818 2010-05-23 Doug Kwan <dougkwan (a] google.com> 8819 8820 * arm.cc (Arm_input_section::do_output_offset): Use convert_types 8821 instead of a cast. 8822 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch 8823 with a direct branch, not a conditional branch, to a stub. 8824 * merge.cc (Output_merge_base::record_input_section): New method 8825 defintion. 8826 (Output_merge_data::do_add_input_section): Record input section if 8827 keeps-input-sections flag is set. 8828 (Output_merge_string::do_add_input_section): Ditto. 8829 * merge.h (Output_merge_base::Output_merge_base): Initialize new data 8830 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and 8831 INPUT_SECTIONS_. 8832 (Output_merge_base::keeps_input_sections, 8833 Output_merge_base::set_keeps_input_sections, 8834 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New 8835 method definitions. 8836 (Output_merge_base::Input_sections): New type declaration. 8837 (Output_merge_base::input_sections_begin, 8838 Output_merge_base::input_sections_end, 8839 Output_merge_base::do_set_keeps_input_sections): New method definitions. 8840 (Output_merge_base::bool keeps_input_sections_, 8841 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_, 8842 Output_merge_base::input_sections_): New data members. 8843 (Output_merge_data::do_set_keeps_input_sections): New method 8844 defintion. 8845 (Output_merge_string::do_set_keeps_input_sections): Ditto. 8846 * output.cc (Output_section::Input_section::relobj): Move method 8847 defintion from class declaration to here and handle merge sections. 8848 (Output_section::Input_section::shndx): Ditto. 8849 (Output_section::Output_section): Remove initializations of removed 8850 data members and initialize new data member LOOKUP_MAPS_. 8851 (Output_section::add_input_section): Set keeps-input-sections flag 8852 for a newly created merge output section as appropriate. Adjust code 8853 to use Output_section_lookup_maps class. 8854 (Output_section::add_relaxed_input_section): Adjst code for lookup 8855 maps code refactoring. 8856 (Output_section::add_merge_input_section): Add a new parameter 8857 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps 8858 class. If adding input section to a newly created merge output 8859 section fails, remove the new merge section. 8860 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections): 8861 Adjust code for use of the Output_section_lookup_maps class. 8862 (Output_section::find_merge_section): Ditto. 8863 (Output_section::build_lookup_maps): New method defintion. 8864 (Output_section::find_relaxed_input_section): Adjust code to use 8865 Output_section_lookup_maps class. 8866 (Output_section::get_input_sections): Export merge sections. Adjust 8867 code to use Output_section_lookup_maps class. 8868 (Output_section:::add_script_input_section): Adjust code to use 8869 Output_section_lookup_maps class. Update lookup maps for merge 8870 sections also. 8871 (Output_section::discard_states): Use Output_section_lookup_maps. 8872 (Output_section::restore_states): Same. 8873 * output.h (Merge_section_properties): Move class defintion out of 8874 Output_section. 8875 (Output_section_lookup_maps): New class. 8876 (Output_section::Input_section::is_merge_section): New method 8877 defintion. 8878 (Output_section::Input_section::relobj): Move defintion out of class 8879 defintion. Declare method only. 8880 (Output_section::Input_section::shndx): Ditto. 8881 (Output_section::Input_section::output_merge_base): New method defintion. 8882 (Output_section::Input_section::u2_.pomb): New union field. 8883 (Output_section::Merge_section_by_properties_map, 8884 Output_section::Output_section_data_by_input_section_map, 8885 Output_section::Ouptut_relaxed_input_section_by_input_section_map): 8886 Remove types. 8887 (Output_section::add_merge_input_section): Add new parameter 8888 KEEPS_INPUT_SECTIONS. 8889 (Output_section::build_lookup_maps): New method declaration. 8890 (Output_section::merge_section_map_, 8891 Output_section::merge_section_by_properties_map_, 8892 Output_section::relaxed_input_section_map_, 8893 Output_section::is_relaxed_input_section_map_valid_): Remove data 8894 members. 8895 (Output_section::lookup_maps_): New data member. 8896 8897 2010-05-21 Doug Kwan <dougkwan (a] google.com> 8898 8899 PR gold/11619 8900 * arm.cc (Arm_input_section::do_output_offset): Add a cast to 8901 avoid a compilation error. 8902 8903 2010-05-19 Rafael Espindola <espindola (a] google.com> 8904 8905 * script-sections.cc (Output_section_definition::allocate_to_segment): 8906 Update the phdrs_list even when the output section is NULL. 8907 * testsuite/Makefile.am: Add test. 8908 * testsuite/Makefile.in: Regenerate. 8909 * testsuite/script_test_9.cc: New. 8910 * testsuite/script_test_9.sh: New. 8911 * testsuite/script_test_9.t: New. 8912 8913 2010-05-19 Doug Kwan <dougkwan (a] google.com> 8914 8915 * arm.cc (Arm_input_section::original_size): New method. 8916 (Arm_input_section::do_addralign): Add a cast. 8917 (Arm_input_section::do_output_offset): Remove static cast. 8918 (Arm_input_section::original_addralign, 8919 Arm_input_section::original_size_): Change type to uint32_t. 8920 (Arm_input_section::init): Add safe casts for section alignment 8921 and size. 8922 (Arm_input_section::set_final_data_size): Do not set address and 8923 offset of stub table. 8924 (Arm_output_section::fix_exidx_coverage): Change use of of 8925 Output_section::Simple_input_section to that of 8926 Output_section::Input_section. 8927 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables 8928 except for the first pass. 8929 * output.cc (Output_section::get_input_sections): Change type of 8930 input_sections to std::list<Input_section>. 8931 (Output_section::add_script_input_section): Rename from 8932 Output_section::add_simple_input_section. Change type of SIS 8933 parameter from Simple_input_section to Input_section. 8934 * output.h (Output_section::Simple_input_section): Remove class. 8935 (Output_section::Input_section): Change class visibility to public. 8936 (Output_section::Input_section::addralign): Use stored alignments 8937 for special input sections if set. 8938 (Output_section::Input_section::set_addralign): New method. 8939 (Output_section::get_input_sections): Change parameter type from 8940 list of Simple_input_section to list of Input_section. 8941 (Output_section::add_script_input_section): Rename from 8942 Output_section::add_simple_input_section. Change first parameter's 8943 type from Simple_input_section to Input_section and remove the 8944 second and third parameters. 8945 * script-sections.cc (Input_section::Input_section_list): Change 8946 type to list of Output_section::Input_section/ 8947 (Input_section_info::Input_section_info): Change parameter type of 8948 INPUT_SECTION to Output_section::Input_section. 8949 (Input_section_info::input_section): Change return type. 8950 (Input_section_info::input_section_): Change type to 8951 Output_section::Input_section. 8952 (Output_section_element_input::set_section_addresses): Adjust code 8953 to use Output_section::Input_section instead of 8954 Output_section::Simple_input_section. Adjust code for renaming 8955 of Output_section::add_simple_input_section. 8956 (Orphan_output_section::set_section_addresses): Ditto. 8957 8958 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues (a] gmx.de> 8959 8960 * gold.h (Unordered_multimap, Unordered_map): Fix defines for 8961 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set. 8962 8963 2010-05-18 Rafael Espindola <espindola (a] google.com> 8964 8965 * options.cc (General_options::finalize): Handle -nostdlib. 8966 * options.h (nostdlib): New option. 8967 * script.cc (script_add_search_dir): Handle -nostdlib. 8968 8969 2010-05-12 Doug Kwan <dougkwan (a] google.com> 8970 8971 * arm.cc (Target_arm::do_finalize_sections): Create an empty 8972 attributes section only if there no attributes section after merging. 8973 (Target_arm::merge_object_attributes): Move value of 8974 Tag_MPextension_use_legacy to that of Tag_MPextension_use. 8975 Handle Tag_DIV_use and Tag_MPextension_use_legacy. 8976 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh 8977 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout 8978 and arm_attr_merge_7.stdout. 8979 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o 8980 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r, 8981 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o, 8982 arm_attr_merge_7b.o): New rules. 8983 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and 8984 arm_attr_merge_7 8985 * testsuite/Makefile.in: Regenerate. 8986 * testsuite/arm_attr_merge.sh: New file. 8987 * testsuite/arm_attr_merge_[67][ab].s: Same. 8988 8989 2010-05-05 Nick Clifton <nickc (a] redhat.com> 8990 8991 * po/es.po: Updated Spanish translation. 8992 8993 2010-04-27 H.J. Lu <hongjiu.lu (a] intel.com> 8994 8995 * Makefile.am (install-exec-local): Properly install gold as 8996 default cross linker. 8997 * Makefile.in: Regenerated. 8998 8999 2010-04-27 H.J. Lu <hongjiu.lu (a] intel.com> 9000 Nick Clifton <nickc (a] redhat.com> 9001 9002 * configure.ac (install_as_default): Define and set to false 9003 unless --enable-gold or --enable-gold=both/gold has been 9004 specified. 9005 * configure: Regenerate. 9006 9007 * Makefile.am (install-exec-local): Install the executable as 9008 'ld.gold'. If install_as_default is true then also install it as 9009 'ld'. 9010 * Makefile.in: Regenerated. 9011 9012 2010-04-24 Ian Lance Taylor <iant (a] google.com> 9013 9014 * layout.cc (Layout::layout_reloc): In relocatable link don't 9015 combine reloc sections for grouped sections. 9016 9017 2010-04-23 Sriraman Tallam <tmsriram (a] google.com> 9018 9019 * gc.h (gc_process_relocs): Pass information on relocs pointing to 9020 sections that are not ordinary to icf. 9021 * icf.cc (get_section_contents): Handle relocation pointing to section 9022 with no object or shndx information. 9023 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh 9024 * testsuite/Makefile.in: Regenerate. 9025 * testsuite/icf_virtual_function_folding_test.cc: Remove printf. 9026 * testsuite/icf_virtual_function_folding_test.sh: Delete file. 9027 9028 2010-04-22 Ian Lance Taylor <iant (a] google.com> 9029 9030 * expression.cc (Expression::Expression_eval_info): Add 9031 result_alignment_pointer field. 9032 (Expression::eval_with_dot): Add result_alignment_pointer 9033 parameter. Change all callers. 9034 (Expression::eval_maybe_dot): Likewise. 9035 (class Binary_expression): Add alignment_pointer parameter to 9036 left_value and right_value. Change all callers. 9037 (BINARY_EXPRESSION): Set result alignment. 9038 (class Trinary_expression): Add alignment_pointer parameter to 9039 arg2_value and arg3_value. Change all callers. 9040 (Trinary_cond::value): Set result alignment. 9041 (Max_expression::value, Min_expression::value): Likewise. 9042 (Align_expression::value): Likewise. 9043 * script-sections.cc (class Sections_element): Add dot_alignment 9044 parameter to set_section_addresses virtual function. Update 9045 instantiations. 9046 (class Output_section_element): Likewise. 9047 (Script_sections::create_segments): Add dot_alignment parameter. 9048 Change all callers. 9049 (Script_sections::create_segments_from_phdrs_clause): Likewise. 9050 (Script_sections::set_phdrs_clause_addresses): Likewise. 9051 * script-sections.h: Update declarations. 9052 * script.h: Update declarations. 9053 * output.h (Output_segment::set_minimum_p_align): Don't decrease 9054 min_p_align. 9055 * testsuite/script_test_3.t: Set large alignment. 9056 * testsuite/script_test_3.sh: Make sure that at least one LOAD 9057 segment has expected alignment. 9058 9059 2010-04-22 Nick Clifton <nickc (a] redhat.com> 9060 9061 * po/gold.pot: Updated by the Translation project. 9062 * po/vi.po: Updated Vietnamese translation. 9063 9064 2010-04-22 H.J. Lu <hongjiu.lu (a] intel.com> 9065 9066 * testsuite/Makefile.am (check_PROGRAMS): Add 9067 icf_virtual_function_folding_test. 9068 * testsuite/Makefile.in: Regenerated. 9069 9070 2010-04-15 Andrew Haley <aph (a] redhat.com> 9071 9072 * options.h (merge_exidx_entries): New option. 9073 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries. 9074 (class Arm_exidx_fixup::merge_exidx_entries_): New member. 9075 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries. 9076 (Target_arm::merge_exidx_entries): New function. 9077 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false. 9078 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries 9079 to Arm_exidx_fixup constructor. 9080 Add new arg, merge_exidx_entries. 9081 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to 9082 Arm_output_section::fix_exidx_coverage. 9083 9084 2010-04-18 Sriraman Tallam <tmsriram (a] google.com> 9085 9086 * icf.cc (get_section_contents): Check for preemptible functions. 9087 Ignore addend when appropriate. 9088 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for 9089 section folded. 9090 (add_from_relobj): Check for section folded. 9091 (set_dynsym_indexes): Fix call to should_add_dynsym_entry. 9092 * symtab.h (should_add_dynsym_entry): Add new parameter. 9093 * target-reloc.h (scan_relocs): Check for section folded. 9094 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc): 9095 Check reloc types for function pointers in shared objects. 9096 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test 9097 case. 9098 (icf_preemptible_functions_test): New test case. 9099 (icf_string_merge_test): New test case. 9100 * testsuite.Makefile.in: Regenerate. 9101 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and 9102 bar_glob. Refactor code. 9103 * testsuite/icf_preemptible_functions_test.cc: New file. 9104 * testsuite/icf_preemptible_functions_test.sh: New file. 9105 * testsuite/icf_string_merge_test.cc: New file. 9106 * testsuite/icf_string_merge_test.sh: New file. 9107 * testsuite/icf_virtual_function_folding_test.cc: New file. 9108 * testsuite/icf_virtual_function_folding_test.sh: New file. 9109 9110 2010-04-14 Doug Kwan <dougkwan (a] google.com> 9111 9112 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object 9113 for local symbol recounting if we remove a section due to ICF. 9114 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if 9115 there are no regular objects in input. 9116 9117 2010-04-13 Doug Kwan <dougkwan (a] google.com> 9118 9119 * arm.cc (Arm_input_section::set_final_data_size): Compute 9120 accurate final data size instead of using current data size. 9121 9122 2010-04-09 Doug Kwan <dougkwan (a] google.com> 9123 9124 * layout.cc (Layout::choose_output_section): Handle script section 9125 types. 9126 (Layout::make_output_section_for_script): Add section type parameter. 9127 Handle script section types. 9128 * layout.h (Layout::make_output_section_for_script): Add section 9129 type parameter. 9130 * output.cc (Output_section::Output_section): Initialize data member 9131 is_noload_. 9132 (Output_section::do_reset_address_and_file_offset): Do not set address 9133 to 0 if section is a NOLOAD section. 9134 * output.h (Output_section::is_noload): New method. 9135 (Output_section::set_is_noload): Ditto. 9136 (Output_section::is_noload_): New data member. 9137 * script-c.h (Script_section_type): New enum type. 9138 (struct Parser_output_section_header): Add new file section_type. 9139 * script-sections.cc (Sections_element::output_section_name): Add 9140 parameter for returning script section type. 9141 (Output_section_definition::output_section_name): Ditto. 9142 (Output_section_definition::section_type)P; New method. 9143 (Output_section_definiton::script_section_type_name): Ditto. 9144 (Output_section_definition::script_section_type_): New data member. 9145 (Output_section_definition::Output_section_definition): Initialize 9146 data member Output_section_definition::script_section_type_. 9147 (Output_section_definition::create_sections): Pass script section type 9148 to Layout::make_output_section_for_script. 9149 (Output_section_definition::output_section_name): Return script 9150 section type to caller. 9151 (Output_section_definition::set_section_address): Do not advance 9152 dot value and load address if section type is NOLOAD. Set address 9153 of NOLOAD sections regardless of section flags. 9154 (Output_section_definition::print): Print section type if it is 9155 not SCRIPT_SECTION_TYPE_NONE. 9156 (Output_section_definition::section_type): New method. 9157 (Output_section_definition::script_section_type_name): Ditto. 9158 (Script_sections::output_section_name): Add new parameter 9159 PSECTION_TYPE for returning script section type. Pass it to 9160 section elements. Handle discard sections. 9161 (Sort_output_sections::operator()): Handle NOLOAD sections. 9162 * script-sections.h (Script_sections::Section_type): New enum type. 9163 (Script_sections::output_section_name): Add a new parameter for 9164 returning script section type. 9165 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT, 9166 INFO and NOLOAD. 9167 * yyscript.y (union): Add new field SECTION_TYPE. 9168 (COPY, DSECT, INFO, NOLOAD): New tokens. 9169 (opt_address_and_section_type): Change type to output_section_header. 9170 (section_type): New non-terminal 9171 (section_header): Handle section type. 9172 (opt_address_and_section_type): Return section type value. 9173 9174 2010-04-09 H.J. Lu <hongjiu.lu (a] intel.com> 9175 9176 * testsuite/plugin_common_test_1.c (foo): Add prototype. 9177 * testsuite/plugin_common_test_2.c (foo): Likewise. 9178 9179 2010-04-08 Doug Kwan <dougkwan (a] google.com> 9180 9181 * merge.cc (Output_merge_data::set_final_data_size): Handle empty 9182 Output_merge_data. 9183 * output.cc (Output_section::add_merge_input_section): Simplify 9184 code and return status of Output_merge_base::add_input_section. 9185 Update merge section map only if Output_merge_base::add_input_section 9186 returns true. 9187 9188 2010-04-07 Doug Kwan <dougkwan (a] google.com> 9189 9190 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn 9191 if section is marked as containing instructions but has no mapping 9192 symbols. 9193 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get 9194 correct section index. 9195 (Arm_relobj::find_linked_text_section): Ditto. 9196 9197 2010-04-07 Cary Coutant <ccoutant (a] google.com> 9198 9199 * archive.cc (include_member): Destroy Read_symbols_data object before 9200 releasing file. 9201 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor. 9202 * object.h (Read_symbols_data::Read_symbols_data) New constructor. 9203 (Read_symbols_data::~Read_symbols_data) New destructor. 9204 (Section_relocs::Section_relocs) New constructor. 9205 (Section_relocs::~Section_relocs) New destructor. 9206 (Read_relocs_data::Read_relocs_data) New constructor. 9207 (Read_relocs_data::~Read_relocs_data) New destructor. 9208 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member 9209 pointers to NULL after deleting. 9210 9211 2010-04-07 Doug Kwan <dougkwan (a] google.com> 9212 9213 * arm.cc: Replace "endianity" with "endianness" in comments. 9214 (Arm_exidx_cantunwind): Ditto. 9215 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures. 9216 (Arm_relobj::merge_flags_and_attributes): New method. 9217 (Arm_relobj::merge_flags_and_attributes_): New data member. 9218 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting. 9219 (Arm_relobj::scan_sections_for_stubs): Ditto. 9220 (Arm_relobj::do_read_symbols): Check to see if we really want to 9221 merge processor-specific flags and attributes. Exit early if 9222 an object is empty except for section names and the undefined symbol. 9223 (Target_arm::do_finalize_sections): Move check for ELF format to 9224 Arm_relobj::do_read_symbols. Merge processor specific flags and 9225 attributes from a regular object only when we have determined that 9226 it is aapropriate. Do not create an .ARM.attributes section in 9227 output if there is no regular input object. 9228 (Target_arm::merge_processor_specific_flags): Check 9229 --warn-mismatch before printing any error. 9230 (Target_arm::merge_object_attributes): Ditto. 9231 * gold.cc (queue_middle_tasks): Handle the case in which there is 9232 no regular object in input. 9233 * options.cc (General_options::parse_EB): New method. 9234 (General_options::parse_EL): Same. 9235 (General_options::General_options): Initialize endianness_. 9236 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch): 9237 New options. 9238 (General_options::Endianness): New enum. 9239 (General_options::endianness): New method. 9240 (General_options::endianness_): New data member. 9241 * parameters.cc (Parameters::set_options): Check target endianness. 9242 (Parameters::set_target_once): Ditto. 9243 (Parameters::check_target_endianness): New method. 9244 (parameters_force_valid_target): If either -EL or -EB is specified, 9245 use it to define endianness of default target. 9246 * parameters.h (Parameters::check_target_endianness): New method 9247 declaration. 9248 * target.h (class Target): Change "endianity" to "endianness" 9249 in comments. 9250 9251 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues (a] gmx.de> 9252 9253 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist. 9254 * configure: Regenerate. 9255 * Makefile.in: Regenerate. 9256 * testsuite/Makefile.in: Regenerate. 9257 9258 2010-04-06 Cary Coutant <ccoutant (a] google.com> 9259 9260 gcc PR lto/42757 9261 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for 9262 prevailing definitions of common symbols. 9263 * testsuite/plugin_test_6.sh: New test case. 9264 * testsuite/plugin_common_test_1.c: New test case. 9265 * testsuite/plugin_common_test_2.c: New test case. 9266 * testsuite/Makefile.am (plugin_test_6): New test case. 9267 * testsuite/Makefile.in: Regenerate. 9268 9269 2010-04-06 Nick Clifton <nickc (a] redhat.com> 9270 9271 * po/vi.po: New Vietnamese translation. 9272 9273 2010-03-30 Doug Kwan <dougkwan (a] google.com> 9274 9275 * arm.cc (Target_arm::using_thumb_only): Handle v6-M 9276 9277 2010-03-25 Doug Kwan <dougkwan (a] google.com> 9278 9279 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code 9280 to avoid a conversion warning on a 32-bit host. 9281 9282 2010-03-24 Ian Lance Taylor <iant (a] google.com> 9283 9284 * testsuite/script_test_3.t: Add a TLS segment. 9285 * testsuite/Makefile.am (check_PROGRAMS): Add 9286 tls_phdrs_script_test. 9287 (tls_phdrs_script_test_SOURCES): Define. 9288 (tls_phdrs_script_test_DEPENDENCIES): Define. 9289 (tls_phdrs_script_test_LDFLAGS): Define. 9290 (tls_phdrs_script_test_LDADD): Define. 9291 * testsuite/Makefile.in: Rebuild. 9292 9293 2010-03-23 Cary Coutant <ccoutant (a] google.com> 9294 9295 * fileread.cc (find_or_make_view): Fix comment. 9296 9297 2010-03-23 Ian Lance Taylor <iant (a] google.com> 9298 9299 * script-sections.cc (class Orphan_section_placement): Define 9300 PLACE_TLS and PLACE_TLS_BSS. 9301 (Orphan_section_placement::Orphan_section_placement): Initialize 9302 new places. 9303 (Orphan_section_placement::find_place): Handle SHF_TLS sections. 9304 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test. 9305 (tls_script_test_SOURCES): Define. 9306 (tls_script_test_DEPENDENCIES): Define. 9307 (tls_script_test_LDFLAGS): Define. 9308 (tls_script_test_LDADD): Define. 9309 * testsuite/Makefile.in: Rebuild. 9310 9311 2010-03-22 Doug Kwan <dougkwan (a] google.com> 9312 9313 * arm.cc (Arm_relocate_functions::abs8, 9314 Arm_relocate_functions::abs16): Use correct check for overflow 9315 specified in the ARM ELF specs. 9316 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch 9317 target of a BLX instruction specially. 9318 (Reloc_stub::stub_type_for_reloc): Ditto. 9319 (Relocate::relocate): Use symbolic names instead of numeric relocation 9320 codes to report error. 9321 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8 9322 workaround. 9323 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout, 9324 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and 9325 thumb2_blx_out_of_range.stdout 9326 (thumb_bl_out_of_range, thumb_bl_out_of_range.o, 9327 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices. 9328 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o, 9329 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range, 9330 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout, 9331 thumb2_blx_in_range, thumb2_blx_in_range.o, 9332 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range, 9333 thumb2_blx_out_of_range.o): New rules. 9334 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range, 9335 thumb2_blx_in_range and thumb2_blx_out_of_range. 9336 * testsuite/Makefile.in: Regenerate. 9337 * arm_branch_in_range.sh: Add tests for THUMB BLX. 9338 * testsuite/thumb_blx_in_range.s: New file. 9339 * testsuite/thumb_blx_out_of_range.s: New file. 9340 9341 2010-03-22 Rafael Espindola <espindola (a] google.com> 9342 9343 * archive.cc (Should_include): Move to archive.h. 9344 (should_include_member): Make it a member of Archive. 9345 (Lib_group): New. 9346 (Add_lib_group_symbols): New. 9347 * archive.h: Include options.h. 9348 (Archive_member): Moved from Archive. 9349 (Should_include): Moved from archive.cc. 9350 (Lib_group): New. 9351 (Add_lib_group_symbols): New. 9352 * dynobj.cc (do_should_include_member): New. 9353 * dynobj.h (do_should_include_member): New. 9354 * gold.cc (queue_initial_tasks): Update call to queue. 9355 * main.cc (main): Print lib group stats. 9356 * object.cc (do_should_include_member): New. 9357 * object.h: Include archive.h. 9358 (Object::should_include_member): New. 9359 (Object::do_should_include_member): New. 9360 (Sized_relobj::do_should_include_member): New. 9361 * options.cc (General_options::parse_start_lib): New. 9362 (General_options::parse_end_lib): New. 9363 (Input_arguments::add_file): Handle lib groups. 9364 (Input_arguments::start_group): Check we are not in a lib. 9365 (Input_arguments::start_lib): New. 9366 (Input_arguments::end_lib): New. 9367 * options.h (General_options): Add start_lib and end_lib. 9368 (Input_argument::lib_): New. 9369 (Input_argument::lib): New. 9370 (Input_argument::is_lib): New. 9371 (Input_file_lib): New. 9372 (Input_arguments::in_lib_): New. 9373 (Input_arguments::in_lib): New. 9374 (Input_arguments::start_lib): New. 9375 (Input_arguments::end_lib_): New. 9376 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols 9377 in unused members as preempted. 9378 (Sized_pluginobj::do_should_include_member): New. 9379 * plugin.h (Sized_pluginobj::do_should_include_member): New. 9380 * readsyms.cc (Read_symbols::locks): If we are just reading a member, 9381 return the blocker. 9382 (Read_symbols::do_whole_lib_group): New. 9383 (Read_symbols::do_lib_group): New. 9384 (Read_symbols::do_read_symbols): Handle lib groups. 9385 (Read_symbols::get_name): Handle lib groups. 9386 * readsyms.h (Read_symbols): Add an archive member pointer. 9387 (Read_symbols::do_whole_lib_group): New. 9388 (Read_symbols::do_lib_group): New. 9389 (Read_symbols::member_): New. 9390 * script.cc (read_input_script): Update call to queue_soon. 9391 9392 2010-03-19 Doug Kwan <dougkwan (a] google.com> 9393 9394 * arm.cc (Stub_table::Stub_table): Initialize new data members 9395 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_. 9396 (Stub_table::add_reloc_stub): Assign stub offset and update 9397 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_. 9398 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_): 9399 New data members. 9400 (Stub_table::update_data_size_and_addralign): Use 9401 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_ 9402 instead of going over all reloc stubs. 9403 (Stub_table::finalize_stubs): Do not assign reloc stub offsets. 9404 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize 9405 Stringpool_template::offset_ to size of Stringpool_char. 9406 (Stringpool_template::new_key_offset): Remove code to initialize 9407 Stringpool_template::offset_. 9408 * stringpool.h (Stringpool_template::set_no_zero_null): Set 9409 Stringpool_template::offset_ to zero. 9410 9411 2010-03-15 Doug Kwan <dougkwan (a] google.com> 9412 9413 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize 9414 offset_. 9415 (Stringpool_template::new_key_offset): New method. 9416 (Stringpool_template::add_string): Assign offsets when adding new 9417 strings. 9418 (Stringpool_template::set_string_offsets): Do not set string offsets 9419 when not optimizing. 9420 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data 9421 member size_. 9422 (Chunked_vector::clear): Clear size_. 9423 (Chunked_vector::reserve): Call reserve method of all Element_vectors. 9424 (Chunked_vector::size): Return size_. 9425 (Chunked_vector::push_back): Use size_ to find insert position. 9426 (Chunked_vector::size_): New data member. 9427 (Stringpool_template::set_no_zero_null): Assert string set is empty. 9428 (Stringpool_template::new_key_offset): New method declaration. 9429 (Stringpool_template::offset_): New data member. 9430 9431 2010-03-15 Rafael Espindola <espindola (a] google.com> 9432 9433 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to 9434 Add_symbols' constructor. 9435 * readsyms.h (Add_symbols): Remove the input_group member. 9436 9437 2010-03-10 Ian Lance Taylor <iant (a] google.com> 9438 9439 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the 9440 target to ask whether a reference to a symbol requires a stack 9441 split. 9442 * target.h (Target::is_call_to_non_split): New function. 9443 (Target::do_is_call_to_non_split): Declare virtual function. 9444 * target.cc: Include "symtab.h". 9445 (Target::do_is_call_to_non_split): New function. 9446 * i386.cc (Target_i386::do_is_call_to_non_split): New function. 9447 9448 2010-03-10 Cary Coutant <ccoutant (a] google.com> 9449 9450 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_. 9451 (File_read::open[1]): Remove initial mapping of whole_file_view_. 9452 (File_read::open[2]): Add whole_file_view_ to list of views. 9453 (File_read::make_view): Remove test of whole_file_view_. 9454 (File_read::find_or_make_view): Create whole_file_view_ if 9455 necessary. 9456 (File_read::clear_views): Replace bool parameter with enum; 9457 adjust all callers. Don't delete views with permanent data; 9458 do delete cached views and views from archives if 9459 --no-keep-files-mapped is set. Set whole_file_view_ to NULL 9460 if clearing the corresponding view. 9461 * fileread.h (File_read::Clear_views_mode): New enum. 9462 (File_read::View::is_permanent_view): New method. 9463 (File_read::clear_views): Replace bool parameter 9464 with enum; adjust all callers. 9465 * options.h (General_options): Change keep_files_mapped option; 9466 add map_whole_files. 9467 * readsyms.cc (Add_symbols::run): Delete sd_ object before 9468 releasing the file. 9469 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing 9470 the file. 9471 9472 2010-03-10 David S. Miller <davem (a] davemloft.net> 9473 9474 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30. 9475 9476 2010-03-09 Sriraman Tallam <tmsriram (a] google.com> 9477 9478 * icf.cc (get_section_contents): Add '@' marker after processing the 9479 merge reloc. 9480 9481 2010-03-08 Doug Kwan <dougkwan (a] google.com> 9482 9483 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage 9484 due to a conversion warning. 9485 (Arm_relobj::update_output_local_symbol_count): Check for local 9486 symbol with unset output index. 9487 9488 2010-03-05 Ian Lance Taylor <iant (a] google.com> 9489 9490 * options.h (class General_options): Add --spare-dynamic-tags. 9491 * output.cc (Output_data_dynamic::set_final_data_size): Implement 9492 --spare-dynamic-tags. 9493 9494 2010-03-05 Ian Lance Taylor <iant (a] google.com> 9495 9496 * incremental.cc: Include "libiberty.h". 9497 9498 2010-03-05 Rainer Orth <ro (a] CeBiTec.Uni-Bielefeld.DE> 9499 9500 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member 9501 function, is_info_ member. 9502 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_. 9503 (Versions::Versions): Update caller. 9504 (Versions::define_base_version): Likewise. 9505 (Versions::add_def): Likewise. 9506 9507 2010-03-03 Sriraman Tallam <tmsriram (a] google.com> 9508 9509 * i386.cc (Target_i386::can_check_for_function_pointers): New function. 9510 (Scan::possible_function_pointer_reloc): New function. 9511 (Scan::local_reloc_may_be_function_pointer): Change to call 9512 possible_function_pointer_reloc. 9513 (Scan::global_reloc_may_be_function_pointer): Ditto. 9514 * icf.h (Icf::check_section_for_function_pointers): Change to reject 9515 relocations in ".data.rel.ro._ZTV" section. 9516 * testsuite/icf_safe_so_test.sh: Change to pass i386. 9517 * testsuite/icf_safe_so_test.cc: Ditto. 9518 * testsuite/icf_safe_test.cc: Ditto. 9519 * testsuite/icf_safe_test.sh: Ditto. 9520 9521 2010-03-03 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 9522 Ian Lance Taylor <iant (a] google.com> 9523 9524 * target-reloc.h (relocate_section): Check the symbol table index 9525 for -1U before setting the local symbol index. 9526 (scan_relocatable_relocs): If copying the relocation, record that 9527 the local symbol is required. 9528 * object.h (Symbol_value::is_output_symtab_index_set): New 9529 function. 9530 (Symbol_value::may_be_discarded_from_output_symtab): New 9531 function. 9532 (Symbol_value::has_output_symtab_entry): New function. 9533 (Symbol_value::needs_output_symtab_entry): Remove. 9534 (Symbol_value::output_symtab_index): Make sure the symbol index is 9535 set. 9536 (Symbol_value::set_output_symtab_index): Make sure the symbol 9537 index is not set. Make sure the new index is valid. 9538 (Symbol_value::set_must_have_output_symtab_entry): New function. 9539 (Symbol_value::has_output_dynsym_entry): New function. 9540 (Symbol_value::set_output_dynsym_index): Make sure the new index 9541 is valid. 9542 (Sized_relobj::set_must_have_output_symtab_entry): New function. 9543 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a 9544 local symbol if permitted. 9545 (Sized_relobj::do_finalize_local_symbols): Call 9546 is_output_symtab_index_set rather than needs_output_symtab_entry. 9547 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry 9548 rather than needs_output_symtab_entry. Call 9549 has_output_dynsym_entry rather than needs_output_dynsym_entry. 9550 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call 9551 is_output_symtab_index_set rather than needs_output_symtab_entry. 9552 * testsuite/discard_locals_relocatable_test.c: New file. 9553 * testsuite/discard_locals_test.sh: Test -r. 9554 * testsuite/Makefile.am (check_DATA): Add 9555 discard_locals_relocatable_test1.syms, 9556 discard_local_relocatable_test2.syms. 9557 (MOSTLYCLEANFILES): Likewise. Also add 9558 discard_locals_relocatable_test1.lout and 9559 discard_locals_relocatable_test2.out. 9560 (discard_locals_relocatable_test1.syms): New target. 9561 (discard_locals_relocatable_test.o): New target. 9562 (discard_locals_relocatable_test1.out): New target. 9563 (discard_locals_relocatable_test2.syms): New target. 9564 (discard_locals_relocatable_test2.out): New target. 9565 (various): Add missing ../ld-new dependencies. 9566 * testsuite/Makefile.in: Rebuild. 9567 9568 2010-03-03 Nick Clifton <nickc (a] redhat.com> 9569 9570 * po/fi.po: New Finnish translation. 9571 9572 2010-03-01 Doug Kwan <dougkwan (a] google.com> 9573 9574 * layout.cc (Layout::Layout): Force section types of .init_array*, 9575 .preinit_array* and .fini_array* sections. 9576 * output.cc (Output_section::Input_section_sort_entry::has_priority): 9577 Fix check of return value of std::string::find.(). 9578 (Output_section::Input_section_sort_compare::operator()): Remove 9579 comment about .init_array. 9580 (Output_section::Input_section_sort_init_fini_compare::operator()): 9581 New method. 9582 (Output_section::sort_attached_input_sections): Handle .init_array 9583 and .fini_array specially. 9584 * output.h (Output_section::Inut_section_sort_compare): Update 9585 comment. 9586 (Output_section::Input_section_sort_init_fini_compare): New struct. 9587 9588 2010-02-26 Doug Kwan <dougkwan (a] google.com> 9589 9590 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat 9591 R_ARM_PREL31 and R_ARM_SBREL31 as position independent. 9592 * testsuite/debug_msg.sh: Avoid matching source line number for 9593 use of global variable undef_int. 9594 9595 2010-02-26 Doug Kwan <dougkwan (a] google.com> 9596 9597 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling 9598 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs. 9599 (Target_arm::scan_reloc_section_for_stubs): Instead of calling 9600 scan_reloc_for_stub, do all processing of R_ARM_V4BX here. 9601 * options.cc (General_options::General_options): Initialize member 9602 fix_v4bx_. 9603 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh 9604 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout 9605 and rm_no_fix_v4bx.stdout 9606 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o, 9607 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking, 9608 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules. 9609 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking 9610 and arm_no_fix_v4bx. 9611 * Makefile.in: Regenerate. 9612 * testsuite/arm_fix_v4bx.s: New file. 9613 * testsuite/arm_fix_v4bx.sh: Ditto. 9614 9615 2010-02-24 Doug Kwan <dougkwan (a] google.com> 9616 9617 * arm.cc (Target_arm::got_section): Make the .got section the first 9618 non RELRO section in the data segment. 9619 * testsuite/script_test_5.sh: Fix match patterns to avoid matching 9620 suffixes of section names. 9621 9622 2010-02-24 Doug Kwan <dougkwan (a] google.com> 9623 9624 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific 9625 flags and attributes merging if an input file is a binary file. 9626 * fileread.cc (Input_file::open): Record format of original file. 9627 * fileread.h (Input_file::Format): New enum type. 9628 (Input_file::Input_file): Initialize data member format_. 9629 (Input_file::format): New method definition. 9630 (Input_file::format_):: New data member. 9631 9632 2010-02-24 Doug Kwan <dougkwan (a] google.com> 9633 9634 * arm.cc (Arm_output_data_got): New class. 9635 (ARM_TCB_SIZE): New constant 9636 (Target_arm): Use Arm_output_data_got instead of Output_data_got. 9637 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout. 9638 If user uses a script with a SECTIONS clause, issue only a warning 9639 for a misplaced EXIDX input section. Otherwise, issue an error. 9640 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing 9641 garbage collection. 9642 (Target_arm::got_mode_index_entry): Handle static linking. 9643 (Target_arm::Scan::local): Ditto. 9644 (Target_arm::Scan::global): Ditto. 9645 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix 9646 all incorrectly implemented relocations. 9647 (Target_arm::fix_exidx_coverage): Pass layout to 9648 Arm_output_section::fix_exidx_coverage. 9649 * layout.cc (Layout::section_name_mapping): Remove trailing dots 9650 from ".ARM.exidx." and ".ARM.extab.". 9651 9652 2010-02-23 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 9653 9654 * arm.cc (Target_arm::do_finalize_sections): Create attribute 9655 section if it does not already exist. 9656 * attributes.cc (Attributes_section_data::Attributes_section_data): 9657 Don't crash if size is zero. 9658 9659 2010-02-23 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 9660 Ian Lance Taylor <iant (a] google.com> 9661 9662 * gold.cc (queue_middle_tasks): If no input files were opened, 9663 exit. 9664 * workqueue.h (Task_function::Task_function): Assert that there is 9665 a blocker. 9666 9667 2010-02-22 Doug Kwan <dougkwan (a] google.com> 9668 9669 * gold-threads.h (Once::~Once): Explicitly define virtual destructor. 9670 * icf.cc (get_section_contents): Cast snprintf arguments to long long 9671 types to avoid warnings due to different uint64_t implementations 9672 on different hosts. 9673 9674 2010-02-21 Doug Kwan <dougkwan (a] google.com> 9675 9676 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in 9677 handling of the maximum backward branch offset. 9678 (Arm_relocate_functions::thumb_branch_common): Ditto. 9679 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh. 9680 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout 9681 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout, 9682 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout. 9683 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o, 9684 arm_bl_out_of_range.stdout, arm_bl_out_of_range, 9685 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range, 9686 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout, 9687 thumb_bl_out_of_range thumb_bl_out_of_range.o, 9688 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o 9689 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range, 9690 thumb2_bl_out_of_range.o): New rules. 9691 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range, 9692 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and 9693 thumb2_bl_out_of_range 9694 * testsuite/Makefile.in: Regenerate. 9695 * testsuite/arm_bl_in_range.s: New file. 9696 * testsuite/arm_bl_out_of_range.s: Ditto. 9697 * testsuite/arm_branch_in_range.sh: Ditto. 9698 * testsuite/arm_branch_range.t: Ditto. 9699 * testsuite/thumb2_branch_range.t: Ditto. 9700 * testsuite/thumb_bl_in_range.s: Ditto. 9701 * testsuite/thumb_bl_out_of_range.s: Ditto. 9702 * testsuite/thumb_branch_range.t: Ditto. 9703 9704 2010-02-20 Sriraman Tallam <tmsriram (a] google.com> 9705 9706 * gc.h (gc_process_relocs): Change vectors to point to the new list. 9707 Add reloc offset information. 9708 * icf.cc (get_section_contents): Change iterators to point to the new 9709 vectors. Add reloc offset information to the contents. 9710 * icf.h (Icf::Sections_reachable_info): New typedef. 9711 (Icf::Sections_reachable_list): New typedef. 9712 (Icf::Offset_info): New typedef. 9713 (Icf::Reloc_info): New struct typedef. 9714 (Icf::Reloc_info_list): New typedef. 9715 (Icf::symbol_reloc_list): Delete method. 9716 (Icf::addend_reloc_list): Delete method. 9717 (Icf::section_reloc_list): Delete method. 9718 (Icf::reloc_info_list): New method. 9719 (Icf::reloc_info_list_): New member. 9720 9721 2010-02-19 Doug Kwan <dougkwan (a] google.com> 9722 9723 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32, 9724 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented. 9725 * arm.cc (Arm_relocation_functions): New forward declaration. 9726 (Target_arm::Target_arm): Initialize new data members 9727 got_mod_index_offset_ and tls_base_symbol_defined_. 9728 (Target_arm::Relocate::relocate_tls): New method. 9729 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol, 9730 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section): 9731 New methods. 9732 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET, 9733 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC. 9734 (Target_arm::got_mod_index_offset_, 9735 Target_arm::tls_base_symbol_defined_): New data members. 9736 (Target_arm::Scan::local, Target::Scan::global, 9737 Target_arm::Relocate::relocate): Handle 32-bit initial TLS 9738 relocations. 9739 9740 2010-02-18 Doug Kwan <dougkwan (a] google.com> 9741 9742 * arm.cc (Arm_relobj::find_linked_text_section): New method. 9743 (Arm_relobj::make_exidx_input_section): Pass section index of linked 9744 text section as a parameter becuase some broken tools may not set 9745 the link in section header. 9746 (Target_arm::has_got_section): New method. 9747 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section 9748 without any mapping symbol as data only. Remove warning. 9749 (Arm_relobj::do_read_synbols): If an EXIDX input section has no 9750 link in its section header, try to discover the link by inspecting the 9751 REL31 relocation at the beginning of the section. 9752 (Target_arm::Scan::check_non_pic): Report name of offending relocation 9753 in error message. 9754 (Target_arm::Scan::global): Treat any reference to the symbol 9755 _GLOBAL_OFFSET_TABLE_ as a GOT access. 9756 9757 2010-02-12 Sriraman Tallam <tmsriram (a] google.com> 9758 9759 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function. 9760 (Scan::global_reloc_may_be_function_pointer): New function. 9761 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function. 9762 (Scan::global_reloc_may_be_function_pointer): New function. 9763 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function. 9764 (Scan::global_reloc_may_be_function_pointer): New function. 9765 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function. 9766 (Scan::global_reloc_may_be_function_pointer): New function. 9767 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function. 9768 (Scan::global_reloc_may_be_function_pointer): New function. 9769 (Scan::possible_function_pointer_reloc): New function. 9770 (Target_x86_64::can_check_for_function_pointers): New function. 9771 * gc.h (gc_process_relocs): Scan relocation types to determine if 9772 function pointers were taken for targets that support it. 9773 * icf.cc (Icf::find_identical_sections): Include functions for 9774 folding in safe ICF whose pointer is not taken. 9775 * icf.h (Secn_fptr_taken_set): New typedef. 9776 (fptr_section_id_): New member. 9777 (section_has_function_pointers): New function. 9778 (set_section_has_function_pointers): New function. 9779 (check_section_for_function_pointers): New function. 9780 * options.h: Fix comment for safe ICF option. 9781 * target.h (can_check_for_function_pointers): New function. 9782 * testsuite/Makefile.am: Add icf_safe_so_test test case. 9783 Modify icf_safe_test for X86-64. 9784 * testsuite/Makefile.in: Regenerate. 9785 * testsuite/icf_safe_so_test.cc: New file. 9786 * testsuite/icf_safe_so_test.sh: New file. 9787 * testsuite/icf_safe_test.cc (kept_func_3): New function. 9788 (main): Change to take pointer to function kept_func_3. 9789 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe 9790 folding is done correctly for X86-64. 9791 9792 2010-02-12 David S. Miller <davem (a] davemloft.net> 9793 9794 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add 9795 is_symbolless parameter. 9796 (Output_reloc<SHT_REL>::is_symbolless): New. 9797 (Output_reloc<SHT_REL>::is_symbolless_): New. 9798 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits. 9799 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter. 9800 (Output_reloc<SHT_RELA>::is_symbolless): New. 9801 (Output_data_reloc::add_global): Handle is_symbolless. 9802 (Output_data_reloc::add_global_relative): Likewise. 9803 (Output_data_reloc::add_local): Likewise. 9804 (Output_data_reloc::add_local_relative): Likewise. 9805 (Output_data_reloc::add_symbolless_global_addend): New. 9806 (Output_data_reloc::add_symbolless_local_addend): New. 9807 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle 9808 is_symbolless. 9809 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_ 9810 instead of ->is_relative_ 9811 (Output_reloc::write): Likewise. 9812 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_ 9813 (Output_reloc::write_rel): Simplify. 9814 9815 * sparc.cc (Target_sparc::Scan::local): Use 9816 ->add_symbolless_local_addend as needed. 9817 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as 9818 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc 9819 based upon relocation offset. 9820 9821 2010-02-11 Doug Kwan <dougkwan (a] google.com> 9822 9823 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling. 9824 (Target_arm::Scan::global): Ditto. Also remove a comment before the 9825 beginning of function. 9826 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS 9827 and MOVT_ABS relocations. Those are non issued in scanning. Fix 9828 parameter is_32bit in calls to should_apply_static_reloc. 9829 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh. 9830 (check_DATA): Add arm_abs_global.stdout. 9831 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global, 9832 arm_abs_global.stdout): New rules. 9833 (MOSTLLYCLEANFILES): Add arm_abs_global 9834 * Makefile.in: Regenerate. 9835 * testsuite/arm_abs_global.s: New file. 9836 * testsuite/arm_abs_global.sh: Ditto. 9837 * testsuite/arm_abs_lib.s: Ditto. 9838 9839 2010-02-11 Ian Lance Taylor <iant (a] google.com> 9840 9841 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each 9842 Read_relocs task. 9843 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run 9844 Allocate_commons_task first. 9845 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next 9846 task, rather than symtab_lock_. 9847 (Gc_process_relocs::~Gc_process_relocs): New function. 9848 (Gc_process_relocs::is_runnable): Check this_blocker_. 9849 (Gc_process_relocs::locks): Use next_blocker_ rather than 9850 blocker_. 9851 (Scan_relocs::~Scan_relocs): New function. 9852 (Scan_relocs::is_runnable): Check this_blocker_ rather than 9853 symtab_lock_. 9854 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add 9855 next_blocker_. 9856 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_ 9857 fields. Add this_blocker_ and next_blocker_ fields. Adjust 9858 constructor accordingly. 9859 (class Gc_process_relocs): Likewise. 9860 (class Scan_relocs): Likewise. 9861 * common.h (class Allocate_commons_task): Remove symtab_lock_ 9862 field, and corresponding constructor parameter. 9863 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of 9864 symtab_lock_. 9865 (Allocate_commons_task::locks): Likewise. 9866 9867 2010-02-11 Ian Lance Taylor <iant (a] google.com> 9868 9869 * gold-threads.h (class Once): Define. 9870 (class Initialize_lock): Rewrite as child of Once. 9871 * gold-threads.cc (class Once_initialize): Define. 9872 (once_pointer_control): New static variable. 9873 (once_pointer, once_arg): New static variables. 9874 (c_run_once): New static function. 9875 (Once::Once, Once::run_once, Once::internal_run): New functions. 9876 (class Initialize_lock_once): Remove. 9877 (initialize_lock_control): Remove. 9878 (initialize_lock_pointer): Remove. 9879 (initialize_lock_once): Remove. 9880 (Initialize_lock::Initialize_lock): Move to gold-threads.h. 9881 (Initialize_lock::initialize): Rewrite. 9882 (Initialize_lock::do_run_once): New function. 9883 * archive.cc (Archive::interpret_header): Only clear name if it is 9884 not already empty. 9885 * fileread.cc: Include "gold-threads.h" 9886 (file_counts_lock): New static variable. 9887 (file_counts_initialize_lock): Likewise. 9888 (File_read::release): Only increment counts when using --stats. 9889 Use a lock around the increment. 9890 * parameters.cc (class Set_parameters_target_once): Define. 9891 (set_parameters_target_once): New static variable. 9892 (Parameters::Parameters): Move here from parameters.h. 9893 (Parameters::set_target): Rewrite. 9894 (Parameters::set_target_once): New function. 9895 (Parameters::clear_target): Move here and rewrite. 9896 * parameters.h (class Parameters): Update declarations. Add 9897 set_parameters_target_once_ field. 9898 (Parameters::Parameters): Move to parameters.cc. 9899 (Parameters::clear_target): Likewise. 9900 * readsyms.cc (Read_symbols::do_group): Create a Start_group 9901 task. 9902 (Start_group::~Start_group): New function. 9903 (Start_group::is_runnable): New function. 9904 (Start_group::locks, Start_group::run): New functions. 9905 (Finish_group::run): Change saw_undefined to size_t. 9906 * readsyms.h (class Start_group): Define. 9907 (class Finish_group): Change saw_undefined_ field to size_t. 9908 (Finish_group::Finish_group): Remove saw_undefined and 9909 this_blocker parameters. Change all callers. 9910 (Finish_group::set_saw_undefined): New function. 9911 (Finish_group::set_blocker): New function. 9912 * symtab.h (class Symbol_table): Change saw_undefined to return 9913 size_t. Change saw_undefined_ field to size_t. 9914 * target-select.cc (Set_target_once::do_run_once): New function. 9915 (Target_selector::Target_selector): Initialize set_target_once_ 9916 field. Don't initialize lock_ and initialize_lock_ fields. 9917 (Target_selector::instantiate_target): Rewrite. 9918 (Target_selector::set_target): New function. 9919 * target-select.h (class Set_target_once): Define. 9920 (class Target_selector): Update declarations. Make 9921 Set_target_once a friend. Remove lock_ and initialize_lock_ 9922 fields. Add set_target_once_ field. 9923 9924 2010-02-10 Ian Lance Taylor <iant (a] google.com> 9925 9926 * dirsearch.cc (Dirsearch::initialize): Add all blockers before 9927 queueing any tasks. 9928 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker. 9929 (queue_middle_tasks): Add all blockers before queueing any tasks. 9930 (queue_final_tasks): Likewise. 9931 * token.h (Task_token::add_blockers): New function. 9932 * object.h (Input_objects::number_of_relobjs): New function. 9933 9934 2010-02-10 Ian Lance Taylor <iant (a] google.com> 9935 9936 * i386.cc (Relocate::relocate_tls): A local symbol is final if not 9937 shared, not if not position independent. 9938 * x86_64.cc (Relocate::relocate_tls): Likewise. 9939 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test. 9940 (tls_pie_pic_test): New target. 9941 * testsuite/Makefile.in: Rebuild. 9942 9943 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test. 9944 (tls_test_main_pie.o, tls_test_pie.o): New targets. 9945 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise. 9946 * testsuite/Makefile.in: Rebuild. 9947 9948 2010-02-09 David S. Miller <davem (a] davemloft.net> 9949 9950 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than 9951 R_SPARC_RELATIVE using ->add_local_relative(). 9952 (Target_sparc::Scan::global): Likewise for ->add_global_relative(). 9953 9954 * output.h (Output_data_dynamic::add_section_size): New method 9955 that takes two Output_data objects. 9956 (Output_data_dynamic::Dynamic_entry): Create storage for secondary 9957 entry param. Handle it in initializers. 9958 * output.cc (Output_data_dynamic::Dynamic_entry::write): For 9959 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL. 9960 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt 9961 arg. 9962 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt, 9963 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt 9964 * arm.cc (Target_arm::do_finalize_sections): Update to pass false 9965 for dynrel_includes_plt. 9966 * i386.cc (Target_i386::do_finalize_sections): Likewise. 9967 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise. 9968 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output 9969 before .rela.plt 9970 (Target_sparc::do_finalize_sections): Update to pass true for 9971 dynrel_includes_plt. 9972 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be 9973 output before .rela.plt 9974 (Target_powerpc::do_finalize_sections): Update to pass true for 9975 dynrel_includes_plt when 32-bit. 9976 9977 2010-02-08 Doug Kwan <dougkwan (a] google.com> 9978 9979 * arm.cc (Arm_relobj::simple_input_section_output_address): New 9980 method. 9981 (Arm_relobj::section_needs_cortex_a8_stub_scanning, 9982 Arm_relobj::scan_section_for_cortex_a8_stubs, 9983 Arm_relobj::do_relocation_section): Instead of calling 9984 Output_section::output_address, use faster 9985 Arm_relobj::simple_input_section_output_address. 9986 9987 2010-02-08 David S. Miller <davem (a] davemloft.net> 9988 9989 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is 9990 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned 9991 relocation helper function. 9992 9993 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP* 9994 just like R_SPARC_GOT{10,13,22}. 9995 (Target_sparc::Scan::local): Likewise. 9996 (Target_sparc::Relocate:relocate): Likewise. 9997 9998 2010-02-06 Ian Lance Taylor <iant (a] google.com> 9999 10000 * configure.ac: Rewrite targetobjs duplicate removal code to use 10001 only shell constructs. 10002 * configure: Rebuild. 10003 10004 2010-02-05 Doug Kwan <dougkwan (a] google.com> 10005 10006 PR 11247 10007 * arm.cc (Arm_relobj::section_is_scannable): New method. 10008 (Arm_relobj::section_needs_reloc_stub_scanning): Use it. 10009 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same. 10010 10011 2010-02-04 Doug Kwan <dougkwan (a] google.com> 10012 10013 PR 11247 10014 * arm-reloc-property.cc (cstdio): Include. 10015 * configure.ac (targetobjs): Remove duplicates. 10016 * configure: Regenerate. 10017 * resolve.cc (Symbol_table::resolve): Explicit instantiate both 10018 big and little endian version for a given address size. 10019 10020 2010-02-03 Doug Kwan <dougkwan (a] google.com> 10021 10022 * arm-reloc-property.cc 10023 (Arm_reloc_property_table::reloc_name_in_error_message): New method 10024 definition. 10025 * arm-reloc-property.h 10026 (Arm_reloc_property_table::get_implemented_static_reloc_property): 10027 New method definition. 10028 (Arm_reloc_property_table::reloc_name_in_error_message): New method 10029 declaration. 10030 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change 10031 overflow to N. 10032 (GOT_PREL): Change implemented to Y. 10033 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method. 10034 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method. 10035 (Arm_relocate_functions::movw_abs_nc): Remove method. 10036 (Arm_relocate_functions::movt_abs): Ditto. 10037 (Arm_relocate_functions::thm_movw_abs_nc): Ditto. 10038 (Arm_relocate_functions::thm_movt_abs): Ditto. 10039 (Arm_relocate_functions::movw_rel_nc): Ditto. 10040 (Arm_relocate_functions::movw_rel): Ditto. 10041 (Arm_relocate_functions::movt_rel): Ditto. 10042 (Arm_relocate_functions:thm_movw_rel_nc): Ditto. 10043 (Arm_relocate_functions:thm_movw_rel): Ditto. 10044 (Arm_relocate_functions:thm_movt_rel): Ditto. 10045 (Arm_relocate_functions::movw, Arm_relocate_functions::movt, 10046 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt): 10047 New method definitions. 10048 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index. 10049 (Arm_relocation_functions::arm_grp_ldr): Ditto. 10050 (Arm_relocation_functions::arm_grp_ldrs): Ditto. 10051 (Arm_relocation_functions::arm_grp_ldc): Ditto. 10052 (Target_arm::Relocate::relocate): Check for non-static or 10053 unimplemented relocation code and exit early. Change calls to 10054 Target_arm::reloc_uses_thumb_bit and 10055 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property 10056 instead. Refactor code to handle similar relocations to increase 10057 code sharing. Remove check for unsupported relocation code in switch 10058 statement. 10059 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use 10060 relocation property table to find out size. Change error message to 10061 print out the name of a relocation code instead of the numeric value. 10062 (Target_arm::scan_reloc_for_stub): Use relocation property table 10063 instead of calling Target_arm::reloc_uses_thumb_bit(). 10064 10065 2010-02-02 Doug Kwan <dougkwan (a] google.com> 10066 10067 * arm.cc (Target_arm::relocate_section): Do view adjustment for all 10068 types of relaxed input section. 10069 10070 2010-02-02 Doug Kwan <dougkwan (a] google.com> 10071 10072 * Makefile.am (HFILES): Add arm-reloc-property.h. 10073 (DEFFILES): New. 10074 (TARGETSOURCES): Add arm-reloc-property.cc 10075 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT) 10076 (libgold_a_SOURCES): $(DEFFILES) 10077 * Makefile.in: Regenerate. 10078 * arm-reloc-property.cc: New file. 10079 * arm-reloc-property.h: New file. 10080 * arm-reloc.def: New file. 10081 * arm.cc: Update comments. 10082 (arm-reloc-property.h): New included header. 10083 (arm_reloc_property_table): New global variable. 10084 (Target_arm::do_select_as_default_target): New method definition. 10085 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add 10086 arm-reloc-property to targ_extra_obj. 10087 * parameters.cc (set_parameters_target): Call 10088 Target::select_as_default_target(). 10089 * target.h (Target::select_as_default_target): New method definition. 10090 (Target::do_select_as_default_target): Same. 10091 10092 2010-02-01 Doug Kwan <dougkwan (a] google.com> 10093 10094 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize 10095 first_output_text_section_. 10096 (Arm_exidx_fixup::first_output_text_section): New method definition. 10097 (Arm_exidx_fixup::first_output_text_section_): New data member. 10098 (Arm_exidx_fixup::process_exidx_section): Record the first text 10099 output section seen. 10100 (Arm_output_section::fix_exidx_coverage): Set correct linked section 10101 and entsize in output section header. 10102 10103 2010-01-29 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 10104 10105 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8, 10106 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0. 10107 (Arm_relocate_functions::thm_alu11): New Method. 10108 (Arm_relocate_functions::thm_pc8): New Method. 10109 (Arm_relocate_functions::thm_pc12): New Method. 10110 (Target_arm::Scan::local): Handle the relocations. 10111 (Target_arm::Scan::global): Likewise. 10112 (Target_arm::Relocate::relocate): Likewise. 10113 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise. 10114 10115 2010-01-29 Doug Kwan <dougkwan (a] google.com> 10116 10117 * arm.cc (Target_arm::Scan::global): General PLTs for the same set 10118 of relocation types as ld. 10119 10120 2010-01-29 Doug Kwan <dougkwan (a] google.com> 10121 10122 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility 10123 to public. 10124 (Arm_relocate_functions::thumb_branch_common): Ditto. 10125 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24, 10126 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32, 10127 Arm_relocate_functions::xpc25, Arm_relocate_functions::call, 10128 Arm_relocate_functions::jump24): Remove. 10129 (Target_arm::Relocate::relocate): Adjust code to call 10130 Arm_relocation_functions::arm_branch_common and 10131 Arm_relocation_functions::thumb_branch_common instead of their removed 10132 wrappers. Merge switch-cases together to reduce source code size. 10133 10134 2010-01-29 Doug Kwan <dougkwan (a] google.com> 10135 10136 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member 10137 output_local_symbol_count_needs_update_. 10138 (Arm_relobj::output_local_symbol_count_needs_update, 10139 Arm_relobj::set_output_local_symbol_count_needs_update, 10140 Arm_relobj::update_output_local_symbol_count): New methods. 10141 (Arm_relobj::output_local_symbol_count_needs_update_): New data 10142 member. 10143 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address 10144 of pointed function as in a R_ARM_PREL31 relocation. 10145 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects 10146 for output local symbol count updating. 10147 (Target_arm::do_relax): Update output local symbol counts in objects 10148 if necessary. 10149 * object.h (Sized_relobj::set_output_local_symbol_count): New method. 10150 10151 2010-01-29 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 10152 10153 * arm.cc: Added support for the ARM relocations: 10154 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL, 10155 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL. 10156 (Arm_relocate_functions::movw_rel_nc): Renamed (was 10157 movw_prel_nc). 10158 (Arm_relocate_functions::movw_rel): New method. 10159 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel). 10160 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was 10161 thm_movw_prel_nc). 10162 (Arm_relocate_functions::thm_movw_rel): New method. 10163 (Arm_relocate_functions::thm_movt_rel): Renamed (was 10164 thm_movt_prel). 10165 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL 10166 relocations. 10167 (Target_arm::Scan::global): Likewise. 10168 (Target_arm::Relocate::relocate): Likewise. 10169 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): 10170 Likewise. 10171 10172 2010-01-27 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 10173 10174 * arm.cc: Added support for ARM group relocations. 10175 (Target_arm::reloc_needs_sym_origin): New method. 10176 (Arm_relocate_functions::calc_grp_kn): New method. 10177 (Arm_relocate_functions::calc_grp_residual): New method. 10178 (Arm_relocate_functions::calc_grp_gn): New method. 10179 (Arm_relocate_functions::arm_grp_alu): New Method. 10180 (Arm_relocate_functions::arm_grp_ldr): New Method. 10181 (Arm_relocate_functions::arm_grp_ldrs): New Method. 10182 (Arm_relocate_functions::arm_grp_ldc): New Method. 10183 (Target_arm::Scan::local): Handle the ARM group relocations. 10184 (Target_arm::Scan::global): Likewise. 10185 (Target_arm::Relocate::relocate): Likewise. 10186 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): 10187 Likewise. 10188 10189 2010-01-26 Doug Kwan <dougkwan (a] google.com> 10190 10191 * arm.cc (set): Include. 10192 (class Arm_exidx_fixup): Change type of last_input_section_ to const 10193 pointer type. 10194 (Arm_output_section::Text_section_list): New type. 10195 (Arm_output_section::append_text_sections_to_list): New method. 10196 (Arm_output_section::fix_exidx_coverage): Ditto. 10197 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_. 10198 (Arm_relobj::convert_input_section_to_relaxed_section): Use 10199 Relobj::set_section_offset() instead of 10200 Sized_relobj::invalidate_section_offset(). 10201 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra 10202 parameter for section headers. Ignore relocation sections for 10203 unallocated sections and EXIDX sections. 10204 (Target_arm::fix_exidx_coverage): New method. 10205 (Target_arm::output_section_address_less_than): New type. 10206 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the 10207 linked text section instead of the EXIDX section. 10208 (Arm_output_section::create_stub_group): Add an assertion to check 10209 that this is not an EXIDX output section. 10210 (Arm_output_section::append_text_sections_to_list): New method. 10211 (Arm_output_section::fix_exidx_coverage): Ditto. 10212 (Arm_relobj::scan_sections_for_stubs): Adjust call to 10213 Arm_relobj::section_needs_reloc_stub_scanning. 10214 (Target_arm::do_relax): Fix EXIDX output section coverage in the 10215 first pass. 10216 (Target_arm::fix_exidx_coverage): New method. 10217 * object.h (Relobj::set_output_section): New method. 10218 (Sized_relobj::invalidate_section_offset): Remove method. 10219 (Sized_relobj::do_invalidate_section_offset): Remove method. 10220 (Sized_relobj::do_set_section_offset): Handle offset value -1. 10221 10222 2010-01-25 Doug Kwan <dougkwan (a] google.com> 10223 10224 * arm.cc (Arm_exidx_merged_section::do_output_offset): 10225 Fix warning due to signed and unsigned comparison on a 32-bit host. 10226 10227 2010-01-22 Doug Kwan <dougkwan (a] google.com> 10228 10229 * arm.cc (Target_arm::do_relax): Record an output section for section 10230 offset adjustment it contains any stub table that has changed. 10231 * layout.cc (Layout::clean_up_after_relaxation): Adjust section 10232 offsets in an output section if necessary. 10233 * output.cc (Output_section::Output_section): Initialize 10234 section_offsets_need_adjustments_. 10235 (Output_section::add_input_section_for_script): Renamed to 10236 Output_section::add_simple_input_section. 10237 (Output_section::save_states): Add a comment. 10238 (Output_section::discard_states): New method defintion. 10239 (Output_section::adjust_section_offsets): Same. 10240 * output.h (Output_section::add_input_section_for_script): Renamed to 10241 Output_section::add_simple_input_section. 10242 (Output_section::discard_states): New method declaration. 10243 (Output_section::adjust_section_offsets): Same. 10244 (Output_section::section_offsets_need_adjustment, 10245 Output_section::set_section_offsets_need_adjustment): New method 10246 definitions. 10247 (Output_section::section_offsets_need_adjustment_): New data member. 10248 * script-sections.cc 10249 (Output_section_element_input::set_section_address): Adjust code for 10250 renaming of Output_section::add_input_section_for_script. 10251 (Orphan_output_section::set_section_address): Same. 10252 10253 2010-01-22 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 10254 10255 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of 10256 Fix_v4bx enum values . 10257 * gold/options.h (General_options): New option definitions. 10258 (General_options::fix_v4bx): New method. 10259 (General_options::Fix_v4bx): New enum. 10260 * gold/options.cc (General_options::parse_fix_v4bx): New method. 10261 (General_options::parse_fix_v4bx_interworking): New method. 10262 10263 2010-01-22 Doug Kwan <dougkwan (a] google.com> 10264 10265 * arm.cc (Arm_exidx_fixup): New class. 10266 10267 2010-01-21 Doug Kwan <dougkwan (a] google.com> 10268 10269 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New 10270 classes. 10271 (Arm_exidx_section_offset_map): New type. 10272 10273 2010-01-21 Doug Kwan <dougkwan (a] google.com> 10274 10275 * arm.cc (Arm_exidx_input_section): New class. 10276 (Arm_relobj::exidx_input_section_by_link, 10277 Arm_relobj::exidx_input_section_by_shndx, 10278 Arm_relobj::make_exidx_input_section): New methods. 10279 (read_arm_attributes_section): Remove. 10280 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record 10281 information about them. 10282 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section 10283 to here. 10284 10285 2010-01-20 Doug Kwan <dougkwan (a] google.com> 10286 10287 * arm.cc (Target_arm::Arm_input_section_map): Change key type from 10288 Input_section_specifier to Section_id. 10289 (Target_arm::new_arm_input_section: Adjust code for change of key 10290 type. 10291 (Target_arm::find_arm_input_section): Ditto. 10292 * gc.h (object.h): Include for Section_id nand Section_id_hash. 10293 (Section_id): Remove. 10294 (Garbage_collection::Section_id_hash): Remove. 10295 * icf.h (object.h): Include for Section_id nand Section_id_hash. 10296 (Section_id): Remove. 10297 (Icf::Section_id_hash): Remove. 10298 * object.h (Section_id, Const_section_id, Section_id_hash, 10299 Const_section_id_hash): New type definitions. 10300 * output.cc (Output_section::add_relaxed_input_section): Change to 10301 use Const_section_id instead of Input_section_specifier as key type. 10302 (Output_section::add_merge_input_section): Ditto. 10303 (Output_section::build_relaxation_map): Change to use Section_id 10304 instead of Input_section_specifier as key type. 10305 (Output_section::convert_input_sections_in_list_to_relaxed_sections): 10306 Ditto. 10307 (Output_section::convert_input_sections_to_relaxed_sections): Change 10308 to use Const_section_id instead of Input_section_specifier as key type. 10309 (Output_section::find_merge_section): Ditto. 10310 (Output_section::find_relaxed_input_section): Ditto. 10311 * output.h (Input_section_specifier): Remove class. 10312 (Output_section::Output_section_data_by_input_section_map): Change 10313 key type to Const_section_id. 10314 (Output_section::Output_relaxed_input_section_by_input_section_map): 10315 Ditto. 10316 (Output_section::Relaxation_map): Change key type to Section_id. 10317 10318 2010-01-20 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 10319 10320 * gold/arm.cc: Added support for R_ARM_V4BX relocation 10321 (class Arm_v4bx_stub): New class. 10322 (DEF_STUBS): Updated definition to support v4_veneer_bx. 10323 (Stub_factory::make_arm_v4bx_stub): New method. 10324 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template. 10325 (Stub_table::empty): Handle v4bx stubs. 10326 (Stub_table::add_arm_v4bx_stub): New method. 10327 (Stub_table::find_arm_v4bx_stub): New method. 10328 (Arm_relocate_functions::v4bx): New method. 10329 (Target_arm::fix_v4bx): New method. 10330 (Target_arm::Target_arm): Handle R_ARM_V4BX. 10331 (Stub_table::relocate_stubs): Likewise. 10332 (Stub_table::do_write): Likewise. 10333 (Stub_table::update_data_size_and_addralign): Likewise. 10334 (Stub_table::finalize_stubs): Likewise. 10335 (Target_arm::Scan::local): Likewise. 10336 (Target_arm::Scan::global): Likewise. 10337 (Target_arm::do_finalize_sections): Likewise. 10338 (Target_arm::Relocate::relocate): Likewise. 10339 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): 10340 Likewise. 10341 (Target_arm::scan_reloc_for_stub): Likewise. 10342 (Target_arm::scan_reloc_section_for_stubs): Likewise. 10343 10344 2010-01-19 Ian Lance Taylor <iant (a] google.com> 10345 10346 * output.cc (Output_section_headers::do_sized_write): Write large 10347 segment count to sh_info field. 10348 (Output_file_header::do_sized_write): For large segment count, 10349 write PN_XNUM to e_phnum field. 10350 10351 2010-01-15 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 10352 10353 * arm.cc (Arm_relocate_functions::thm_jump6): New function. 10354 (Arm_relocate_functions::thm_jump8): New function. 10355 (Arm_relocate_functions::thm_jump11): New function. 10356 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8, 10357 R_ARM_THM_JUMP11. 10358 (Target_arm::Scan::global): Likewise. 10359 (Target_arm::Relocate::relocate): Likewise. 10360 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): 10361 Likewise. 10362 10363 2010-01-14 Doug Kwan <dougkwan (a] google.com> 10364 10365 * arm.cc (map, utility): Include headers. 10366 (Target_arm::apply_cortex_a8_workaround): New method. 10367 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround. 10368 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19. 10369 (Target_arm::Scan::global): R_ARM_THM_JUMP19. 10370 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to 10371 the --[no-]fix-cortex-a8 command line options. 10372 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19. 10373 (Target_arm::relocate_stub): Use addend in instruction template. 10374 * options.h (DEFINE_bool): Set the user-set flag. 10375 (General_options): Add --[no-]-fix-cortex options. 10376 * output.cc (Output_section::convert_input_sections_to_relaxed_sections) 10377 : Update fast look-up map after conversion. 10378 10379 2010-01-14 Sriraman Tallam <tmsriram (a] google.com> 10380 10381 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack 10382 in the first pass of do_layout. 10383 10384 2010-01-13 Doug Kwan <dougkwan (a] google.com> 10385 10386 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning, 10387 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an 10388 apparent compiler problem of not folding static constant integral 10389 data members of elfcpp::Elf_sizes<32>. 10390 10391 2010-01-13 Doug Kwan <dougkwan (a] google.com> 10392 10393 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning, 10394 Arm_relobj::section_needs_cortex_a8_stub_scanning, 10395 Arm_relobj::scan_section_for_cortex_a8_erratum, 10396 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods. 10397 (Arm_relobj::scan_sections_for_stubs): Move code deciding what 10398 sections to scan for relocation stubs into a new method 10399 Arm_relobj::section_needs_reloc_stub_scanning. Handle both 10400 relocation and Cortex-A8 stub scanning. 10401 (Target_arm::do_relax): Force stubs to be after stubbed sections 10402 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at 10403 the beginning of a new relaxation pass. Update a comment. 10404 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition. 10405 10406 2010-01-12 Ian Lance Taylor <iant (a] google.com> 10407 10408 * target-reloc.h (visibility_error): New inline function. 10409 (relocate_section): Call visibility_error. 10410 * testsuite/Makefile.am (check_DATA): Add protected_3.err. 10411 (MOSTLYCLEANFILES): Likewise. 10412 (protected_4_pic.o, protected_3.err): New targets. 10413 * testsuite/protected_4.cc: New file. 10414 10415 2010-01-12 Doug Kwan <dougkwan (a] google.com> 10416 10417 * arm.cc (Cortex_a8_reloc): New class. 10418 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_ 10419 and cortex_a8_relocs_info_. 10420 (Target_arm::fix_cortex_a8): New method definition. 10421 (Target_arm::Cortex_a8_relocs_info): New type. 10422 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_): 10423 New data member declarations. 10424 (Target_arm::scan_reloc_for_stub): Record information about 10425 relocations for THUMB branches that might be exempted from the 10426 Cortex-A8 workaround. 10427 (Target_arm::do_relax): Clear all Cortex-A8 relocation information 10428 at the beginning of a relaxation pass. 10429 10430 2010-01-12 Doug Kwan <dougkwan (a] google.com> 10431 10432 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member. 10433 (Arm_relobj::Mapping_symbol_position, 10434 Arm_reloj::Mapping_symbol_position_less, 10435 Arm_relobj::Mapping_symbols_info): New types. 10436 (Target_arm::is_mapping_symbol_name): New method definition. 10437 (Arm_relobj::do_count_local_symbols): Save information about mapping 10438 symbols. 10439 10440 2010-01-11 Doug Kwan <dougkwan (a] google.com> 10441 10442 * arm.cc (Arm_relocate_functions::thumb32_branch_offset, 10443 Arm_relocate_functions::thumb32_branch_upper, 10444 Arm_relocate_functions::thumb32_branch_lower, 10445 Arm_relocate_functions::thumb32_cond_branch_offset, 10446 Arm_relocate_functions::thumb32_cond_branch_upper, 10447 Arm_relocate_functions::thumb32_cond_branch_lower, 10448 Arm_relocate_functions::thm_jump19): New methods to handle THUMB 10449 branch offset encoding. 10450 (Arm_relocate_functions::thumb_branch_common): Use new branch 10451 offset encoding methods to avoid code duplication. 10452 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE. 10453 (Stub_addend_reader::operator()): Use new branch encoding method 10454 to avoid code duplication. 10455 10456 2010-01-11 Doug Kwan <dougkwan (a] google.com> 10457 10458 * arm.cc (Arm_relobj::do_gc_process_relocs): New method. 10459 (Target_arm::do_finalize_sections): Define special EXIDX section 10460 symbols only if referenced. 10461 * gc.h (Garbage_collection::add_reference): New method. 10462 (gc_process_relocs): Use Garbage_collection::add_reference to avoid 10463 code duplication. 10464 10465 2010-01-11 Ian Lance Taylor <iant (a] google.com> 10466 10467 * script.cc (Version_script_info::build_expression_list_lookup): 10468 Change complaing about duplicate wildcard match from error to 10469 warning. 10470 10471 * script.cc (class Lazy_demangler): Recreate--revert part of patch 10472 of 2009-12-30. 10473 (Version_script_info::Version_script_info): Initialize globs_, 10474 default_version_, default_is_global_, and exact_. Don't 10475 initialize globals_ or locals_. 10476 (Version_script_info::build_lookup_tables): Build local symbols 10477 first. 10478 (Version_script_info::unquote): New function. 10479 (Version_script_info::add_exact_match): New function. 10480 (Version_script_info::build_expression_list_lookup): Remove lookup 10481 parameter. Add is_global parameter. Change all callers. Handle 10482 wildcard pattern specially. Unquote pattern. Call 10483 add_exact_match. 10484 (Version_script_info::get_name_to_match): New function. 10485 (Version_script_info::get_symbol_version): New function. 10486 (Version_script_info::get_symbol_version_helper): Remove. 10487 (Version_script_info::check_unmatched_names): Call unquote. 10488 * script.h (class Version_script_info): Change get_symbol_version 10489 to be non-inline and add is_global parameter; change all callers. 10490 Rewrite symbol_is_local. Update declarations. Define struct 10491 Version_tree_match, Exact, Globs. Don't define struct Lookup. 10492 Remove globals_ and locals_ members. Add exact_, globs_, 10493 default_version_, is_global_. 10494 (Version_script_info::Glob): Remove pattern, add expression and 10495 is_global. Update constructor. Change all callers. 10496 * dynobj.cc (Versions::finalize): Mark the version symbol as the 10497 default version. 10498 (Versions::symbol_section_contents): If a symbol is undefined, or 10499 defined in a dynamic object, set the version index to 10500 VER_NDX_LOCAL. 10501 * symtab.cc (Symbol_table::add_from_relobj): Don't call 10502 symbol_is_local. 10503 (Symbol_table::add_from_pluginobj): Likewise. 10504 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2. 10505 10506 2010-01-11 Doug Kwan <dougkwan (a] google.com> 10507 10508 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency. 10509 (incremental_dump_LDADD): Add linking option for libintl. 10510 * Makefile.in: Regenerate. 10511 10512 2010-01-11 H.J. Lu <hongjiu.lu (a] intel.com> 10513 10514 PR gold/11144 10515 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms 10516 instead of -Ds. 10517 * testsuite/Makefile.in: Regenerated. 10518 10519 2010-01-10 Doug Kwan <dougkwan (a] google.com> 10520 10521 * options.h (DEFINE_var): Use parentheses around argument varname__ 10522 in macro body to avoid any unintended subsequent substitutions. 10523 10524 2010-01-10 Ian Lance Taylor <iant (a] google.com> 10525 10526 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR 10527 candidates before doing symbol resolution. 10528 10529 * resolve.cc (Symbol_table::resolve): Add symbols to the list of 10530 ODR candidates if only one is weak. 10531 10532 2010-01-08 Ian Lance Taylor <iant (a] google.com> 10533 10534 * script.cc (Version_script_info::build_expression_list_lookup): 10535 Don't warn about ambiguous version, just record the ambiguity. 10536 (Version_script_info::get_symbol_version_helper): Give error if 10537 version is ambiguous. 10538 10539 2010-01-08 Doug Kwan <dougkwan (a] google.com> 10540 10541 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_, 10542 prev_data_size_ and prev_addralign_. Remove initializer for 10543 deleted data member has_been_changed_. 10544 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_ 10545 to determine if the table is empty. 10546 (Stub_table::has_been_changed, Stub_table_set_has_been_changed): 10547 Remove. 10548 (Stub_table::add_reloc_stub): Define method in class definition 10549 instead of just declaring it there. 10550 (Stub_table::add_cortex_a8_stub): New method definition. 10551 (Stub_table::update_data_size_and_addralign): Ditto. 10552 (Stub_table::finalize_stubs): Ditto. 10553 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto. 10554 (Stub_table::do_addralign_): Return address alignment in the 10555 (Stub_table::do_reset_address_and_file_offset): Define method in 10556 class definition instead of declaring it there. Set current data 10557 size to be the data size of the previous pass. 10558 (Stub_table::set_final_data_size): Use current data size as the 10559 final data size. 10560 (Stub_table::relocate_stub): Change parameter type of stub from 10561 Reloc_stub pointer to Stub pointer. 10562 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove. 10563 (Stub_table::Cortex_a8_stub_list): New typedef. 10564 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_, 10565 Stub_table::prev_addralign_): New data member. 10566 (Arm_relobj::Arm_relobj): Initialize data member 10567 section_has_cortex_a8_workaround_. 10568 (Arm_relobj::section_has_cortex_a8_workaround, 10569 Arm_relobj::mark_section_for_cortex_a8_workaround): New method 10570 definitions. 10571 (Arm_relobj::section_has_cortex_a8_workaround_): New data member 10572 declarations. 10573 (Target_arm::relocate_stub): Change parameter type of stub from 10574 Reloc_stub pointer to Stub pointer. 10575 (Insn_template::size, Insn_template::alignment): Handle 10576 THUMB16_SPECIAL_TYPE. 10577 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs, 10578 Stub_table::update_data_size_and_addralign, 10579 Stub_table::apply_cortex_a8_workaround_to_address_range): New method 10580 definitions. 10581 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs. 10582 (Stub_table::do_write): Ditto. 10583 (Target_arm::do_relax): Adjust code for changes in Stub_table. 10584 10585 2010-01-08 Ian Lance Taylor <iant (a] google.com> 10586 10587 PR 11108 10588 * symtab.h (class Symbol): Remove fields is_target_special_ and 10589 has_plt_offset_. Add field is_defined_in_discarded_section_. 10590 (Symbol::is_defined_in_discarded_section): New function. 10591 (Symbol::set_is_defined_in_discarded_section): New function. 10592 (Symbol::has_plt_offset): Rewrite. 10593 (Symbol::set_plt_offset): Verify that new offset is not -1U. 10594 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U. 10595 Don't initialize is_target_special_ or has_plt_offset_. 10596 Initialize is_defined_in_discarded_section_. 10597 (Symbol_table::add_from_relobj): If appropriate, set 10598 is_defined_in_discarded_section. 10599 * resolve.cc (Symbol::override_base_with_special): Don't test 10600 is_target_special_. Change has_plt_offset_ to has_plt_offset(). 10601 * target-reloc.h (relocate_section): Do special handling for 10602 symbols defined in discarded sections for global symbols as well 10603 as local symbols. 10604 10605 2010-01-08 Ian Lance Taylor <iant (a] google.com> 10606 10607 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in 10608 the SHT_SYMTAB case. 10609 10610 2010-01-08 Ian Lance Taylor <iant (a] google.com> 10611 10612 * object.cc (Sized_relobj::do_layout): Don't get confused if 10613 layout_eh_frame returns NULL. 10614 10615 2010-01-08 Ian Lance Taylor <iant (a] google.com> 10616 10617 PR 11084 10618 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no 10619 dynamic symbol table, use the normal symbol table. 10620 (Sized_dynobj::do_read_symbols): Remove assertion about type of 10621 symbol table. 10622 10623 2010-01-08 Ian Lance Taylor <iant (a] google.com> 10624 10625 PR 11072 10626 * layout.cc (Layout::include_section): Remove .gnu_debuglink 10627 sections. 10628 10629 2010-01-08 H.J. Lu <hongjiu.lu (a] intel.com> 10630 10631 * version.cc (print_version): Change to "Copyright 2010". 10632 10633 2010-01-08 Ian Lance Taylor <iant (a] google.com> 10634 10635 PR 10287 10636 PR 11063 10637 * i386.cc (class Target_i386): Change return type of plt_section 10638 to be non-const. 10639 (class Output_data_plt_i386): Add tls_desc_rel_ field. 10640 (Output_data_plt_i386::Output_data_plt_i386): Initialize 10641 tls_desc_rel_ field. 10642 (Output_data_plt_i386::rel_tls_desc): New function. 10643 (Target_i386::rel_tls_desc_section): New function. 10644 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling. 10645 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put 10646 R_386_TLS_DESC reloc in rel_tls_desc_section. 10647 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field. 10648 Define struct Tlsdesc_info. 10649 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_. 10650 (Target_x86_64::do_reloc_symbol_index): New function. 10651 (Target_x86_64::add_tlsdesc_info): New function. 10652 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field. 10653 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize 10654 tlsdesc_rel_ field. 10655 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change 10656 all callers. 10657 (Output_data_plt_x86_64::rela_tlsdesc): New function. 10658 (Target_x86_64::rela_tlsdesc_section): New function. 10659 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC 10660 handling. 10661 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put 10662 (Target_x86_64::do_reloc_addend): New function. 10663 R_X86_64_TLSDESC reloc in rela_tlsdesc_section. 10664 * output.h (class Output_reloc) [SHT_REL]: Add new constructor 10665 declarations. Define TARGET_CODE. Add arg field to u1_ union. 10666 (Output_reloc::type): New function. 10667 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE. 10668 (Output_reloc::is_target_specific): New function. 10669 (Output_reloc::target_arg): New function. 10670 (class Output_reloc) [SHT_RELA]: Add four new constructors for 10671 absolute relocs and target specific relocs. 10672 (class Output_data_reloc) [SHT_REL]: Add add_absolute and 10673 add_target_specific. 10674 (class Output_data_reloc) [SHT_RELA]: Likewise. 10675 * output.cc (Output_reloc::Output_reloc): Add four new versions 10676 for absolute relocs and target specific relocs. 10677 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case. 10678 (Output_reloc::get_symbol_index): Likewise. 10679 (Output_reloc::local_section_offset): Check that local_sym_index_ 10680 is not TARGET_CODE or 0. 10681 (Output_reloc::symbol_value): Likewise. 10682 (Output_reloc::write) [SHT_RELA]: Call target for target specific 10683 reloc. 10684 * target.h (class Target): Add reloc_symbol_index and reloc_addend 10685 functions. Add do_reloc_symbol_index and do_reloc_addend virtual 10686 functions. 10687 * layout.cc (add_target_dynamic_tags): Use output section for 10688 DT_PLTRELSZ and DT_JMPREL. 10689 10690 2010-01-07 Ian Lance Taylor <iant (a] google.com> 10691 10692 PR 11061 10693 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative 10694 function. 10695 (class Output_data_reloc_generic): Define. 10696 (class Output_data_reloc_base): Change base class to 10697 Output_data_reloc_generic. Change add() method to call 10698 bump_relative_reloc_count for a relative reloc. Remove 10699 sort_relocs_ field. 10700 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_ 10701 to sort_relocs(). 10702 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to 10703 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if 10704 appropriate. 10705 * layout.h (class Layout): Update declaration. 10706 10707 2010-01-07 Ian Lance Taylor <iant (a] google.com> 10708 10709 * output.h (class Output_data): Add const version of 10710 output_section and do_output_section. 10711 (class Output_section_data): Add const version of 10712 do_output_section. 10713 (class Output_section): Likewise. 10714 * layout.cc (Layout::add_target_dynamic_tags): New function. 10715 * layout.h (class Layout): Update declarations. 10716 * arm.cc (Target_arm::do_finalize_sections): Use 10717 add_target_dynamic_tags. 10718 * i386.cc (Target_i386::do_finalize_sections): Likewise. 10719 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise. 10720 * sparc.cc (Target_sparc::do_finalize_sections): Likewise. 10721 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise. 10722 10723 2010-01-07 Ian Lance Taylor <iant (a] google.com> 10724 10725 PR 11042 10726 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic 10727 object as needed. 10728 10729 2010-01-07 Dmitry Gorbachev <d.g.gorbachev (a] gmail.com> 10730 Ian Lance Taylor <iant (a] google.com> 10731 10732 PR 11019 10733 * object.cc: Instantiate Xindex::initialize_symtab_xindex and 10734 Xindex::read_symtab_xindex. 10735 10736 2010-01-07 Doug Kwan <dougkwan (a] google.com> 10737 10738 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE. 10739 (Insn_template::thumb16_bcond_insn): New method declaration. 10740 (Insn_template): Fix spelling. 10741 (Stub::thumb16_special): New method declaration. 10742 (Stub::do_write): Define virtual method which was previously pure 10743 virtual. 10744 (Stub::do_thumb16_special): New method declaration. 10745 (Stub::do_fixed_endian_write): New template member. 10746 (Reloc_stub::do_write): Remove. 10747 (Reloc_stub::do_fixed_endian_write): Remove. 10748 (Cortex_a8_stub): New class definition. 10749 (Stub_factory::make_cortex_a8_stub): New method definition. 10750 (Stub_factory::Stub_factory): Add missing static storage class 10751 qualifier for elf32_arm_stub_a8_veneer_blx. 10752 10753 2010-01-07 Ian Lance Taylor <iant (a] google.com> 10754 10755 PR 10980 10756 * options.h (class General_options): Add --warn-unresolved-symbols 10757 and --error-unresolved-symbols. 10758 * errors.cc (Errors::undefined_symbol): Implement 10759 --warn-unresolved-symbols. 10760 10761 * options.h (class General_options): Add -z text and -z textoff. 10762 * layout.cc (Layout::finish_dynamic_section): Implement -z text. 10763 10764 2010-01-06 Sriraman Tallam <tmsriram (a] google.com> 10765 10766 * gc.h (Garbage_collection::Cident_section_map): New typedef. 10767 (Garbage_collection::cident_sections): New function. 10768 (Garbage_collection::add_cident_section): New function. 10769 (Garbage_collection::cident_sections_): New member. 10770 (gc_process_relocs): Add references to sections whose names are C 10771 identifiers. 10772 * gold.h (cident_section_start_prefix): New constant. 10773 (cident_section_stop_prefix): New constant. 10774 (is_cident): New function. 10775 * layout.cc (Layout::define_section_symbols): Replace string constants 10776 with the newly defined constants. 10777 * object.cc (Sized_relobj::do_layout): Track sections whose names are 10778 C identifiers. 10779 * testsuite/Makefile.am: Add gc_orphan_section_test. 10780 * testsuite/Makefile.in: Regenerate. 10781 * testsuite/gc_orphan_section_test.cc: New file. 10782 * testsuite/gc_orphan_section_test.sh: New file. 10783 10784 2010-01-06 Ian Lance Taylor <iant (a] google.com> 10785 10786 PR 10980 10787 * options.h (class General_options): Add --warn-shared-textrel. 10788 * layout.cc (Layout::finish_dynamic_section): Implement 10789 --warn-shared-textrel. 10790 10791 PR 10980 10792 * options.h (class General_options): Add --warn-multiple-gp. 10793 10794 2010-01-06 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 10795 10796 * Makefile.am (incremental_dump_DEPENDENCIES): Remove 10797 $(THREADSLIB) and $(LIBDL). 10798 * Makefile.in: Rebuild. 10799 10800 2010-01-06 Ian Lance Taylor <iant (a] google.com> 10801 10802 PR 10980 10803 * options.cc (General_options::parse_section_start): New function. 10804 (General_options::section_start): New function. 10805 (General_options::General_options): Initialize all members. 10806 * options.h: Include <map> 10807 (class General_options): Add --section-start. Add section_starts_ 10808 member. 10809 * layout.cc (Layout::attach_allocated_section_to_segment): If 10810 --section-start was used, set the address of the segment. Remove 10811 local sort_sections. 10812 (Layout::relaxation_loop_body): If the address of the load segment 10813 has been set by --section-start, don't use it. 10814 * output.h (Output_segment::update_flags_for_output_section): New 10815 function. 10816 * output.cc (Output_segment::add_output_section): Call 10817 update_flags_for_output_section. 10818 10819 2010-01-05 Ian Lance Taylor <iant (a] google.com> 10820 10821 PR 10980 10822 * options.h (class General_options): Add --undefined-version. 10823 * script.cc (struct Version_expression): Add was_matched_by_symbol 10824 field. 10825 (Version_script_info::matched_symbol): New function. 10826 (Version_script_info::get_symbol_version_helper): Call 10827 matched_symbol. 10828 (Version_script_info::check_unmatched_names): New function. 10829 * script.h (class Version_script_info): Update declarations. 10830 * gold.cc (queue_middle_tasks): Handle --no-undefined-version. 10831 10832 * options.h (class General_options): Use DEFINE_bool_alias for 10833 allow_multiple_definition. 10834 * resolve.cc (Symbol_table::should_override): Don't test 10835 allow_multiple_definition. 10836 10837 PR 10980 10838 * options.h (class General_options): Add --cref. 10839 * main.cc (main): Print cref table if --cref. Don't close mapfile 10840 until after printing cref table. 10841 * cref.cc: Include "symtab.h". 10842 (class Cref_inputs): Define Cref_table_compare and Cref_table. 10843 (Cref_table_compare::operator()): New function. 10844 (Cref_inputs::gather_cref): New function. 10845 (filecol): New static const. 10846 (Cref_inputs::print_cref): New function. 10847 (Cref::print_cref): New function. 10848 * cref.h: Include <cstdio>. 10849 (class Cref): Update declarations. 10850 * mapfile.h (Mapfile::file): New function. 10851 * object.h (class Object): Define Symbols. Declare virtual 10852 do_get_global_symbols. 10853 (Object::get_global_symbols): New function. 10854 * object.cc (Input_objects::add_object): Pass object to cref_ if 10855 --cref. 10856 (Input_objects::archive_start): Likewise. 10857 (Input_objects::archive_stop): Likewise. 10858 (Input_objects::print_cref): New function. 10859 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function. 10860 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if 10861 --cref. 10862 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New 10863 function. 10864 * plugin.h (class Sized_pluginobj): Update declarations. 10865 10866 2010-01-05 Ian Lance Taylor <iant (a] google.com> 10867 10868 * symtab.cc (Symbol_table::add_from_object): Rename def parameter 10869 to is_default_version. Rename insdef to insdefault. 10870 (Symbol_table::add_from_relobj): Rename def to is_default_version 10871 and local to is_forced_local. 10872 (Symbol_table::add_from_pluginobj): Likewise. 10873 (Symbol_table::add_from_dynobj): Likewise. 10874 (Symbol_table::define_special_symbol): Rename insdef to 10875 insdefault. 10876 10877 2010-01-04 Ian Lance Taylor <iant (a] google.com> 10878 10879 PR 10980 10880 * options.h (class General_options): Add 10881 --allow-multiple-definition and -z muldefs. 10882 * resolve.cc (Symbol_table::should_override): Don't warn about a 10883 multiple symbol definition if --allow-multiple-definition or -z 10884 muldefs. 10885 10886 PR 10980 10887 * options.h (class General_options): Add --add-needed and 10888 --copy-dt-needed-entries. Tweak --as-needed help entry. 10889 * object.cc (Input_objects::check_dynamic_dependencies): Give an 10890 error if --copy-dt-needed-entries aka --add-needed is used and 10891 would cause a change in behaviour. 10892 10893 PR 10980 10894 * options.h (class General_options): Add -G as a short version of 10895 --shared. Add no-op options -assert, -g, and -i. 10896 10897 2010-01-04 Sriraman Tallam <tmsriram (a] google.com> 10898 10899 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to 10900 check for .text or .gnu.linkonce.t sections. 10901 * icf.cc (Icf::find_identical_sections): Ditto. 10902 Change the detection for mangled function name within the section 10903 name. 10904 * icf.h (is_section_foldable_candidate): New function. 10905 10906 2009-12-30 Ian Lance Taylor <iant (a] google.com> 10907 10908 PR 10980 10909 * options.h (class General_options): Permit two dashes with 10910 --retain-symbols-file. 10911 10912 2009-12-30 Ian Lance Taylor <iant (a] google.com> 10913 10914 PR 10979 10915 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used, 10916 don't put the file header and segment headers in the text 10917 segment. 10918 10919 PR 10979 10920 * common.cc (Sort_commons::operator()): Stabilize sort when both 10921 entries are NULL. 10922 (Symbol_table::do_allocate_commons_list): When allocating common 10923 symbols, skip a symbol which is no longer common. 10924 * symtab.h (Symbol::is_common): Test whether the symbol comes from 10925 an object before checking its type. 10926 * testsuite/common_test_2.c: New file. 10927 * testsuite/common_test_3.c: New file. 10928 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2. 10929 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define. 10930 (common_test_2_LDFLAGS, common_test_2_LDADD): Define. 10931 (common_test_2_pic.o, common_test_2.so): New targets. 10932 (common_test_3_pic.o, common_test_3.so): New targets. 10933 * testsuite/Makefile.in: Rebuild. 10934 10935 PR 10979 10936 * script.cc (read_input_script): If we see a new SECTIONS clause, 10937 and we have added an input section, give an error. 10938 * layout.h (class Layout): Add have_added_input_section function. 10939 Add have_added_input_section_ field. 10940 * layout.cc (Layout::Layout): Initialize 10941 have_added_input_section_. 10942 (Layout::layout): Set have_added_input_section_. 10943 (Layout::layout_eh_frame): Likewise. 10944 10945 2009-12-30 Ian Lance Taylor <iant (a] google.com> 10946 10947 PR 10931 10948 * options.h (class General_options): Add --sort-common option. 10949 * symtab.h (class Symbol_table): Define Sort_commons_order enum. 10950 * common.cc (Sort_common): Add sort_order parameter to 10951 constructor. Add sort_order_ field. 10952 (Sort_commons::operator): Check sort_order_. 10953 (Symbol_table::allocate_commons): Determine the sort order. 10954 (Symbol_table::do_allocate_commons): Add sort_order parameter. 10955 Change all callers. 10956 (Symbol_table::do_allocate_commons_list): Likewise. 10957 10958 2009-12-30 Ian Lance Taylor <iant (a] google.com> 10959 10960 PR 10916 10961 * symtab.cc (Symbol_table::add_from_relobj): When not exporting 10962 symbols from this object, don't change the visibility of an 10963 undefined symbol. 10964 * testsuite/exclude_libs_test_1.c (lib1_ref): New function. 10965 10966 2009-12-30 Ian Lance Taylor <iant (a] google.com> 10967 10968 PR 10861 10969 * script.h (class Version_script_info): Define Language enum. 10970 Update declarations. Define Glob, Exact, and Lookup types. Add 10971 new fields globals_, locals_, and is_finalized_. 10972 * script.cc: Various formatting fixes. 10973 (class Parser_closure): Change language_stack_ from a vector of 10974 std::string to one of Version_script_info::Language. Adjust all 10975 uses accordingly. 10976 (class Lazy_demangler): Remove. 10977 (struct Version_expression): Change language from std::string to 10978 Version_script_info::Language. 10979 (Version_script_info::Version_script_info): New function. 10980 (Version_script_info::~Version_script_info): Don't call clear. 10981 (Version_script_info::finalize): New function. 10982 (Version_script_info::build_lookup_tables): New function. 10983 (Version_script_info::build_expression_list_lookup): New 10984 function. 10985 (Version_script_info::get_symbol_version_helper): Rewrite to use 10986 lookup tables. 10987 (Version_script_info::print_expression_list): Adjust to use 10988 Version_script_info::Language. 10989 (script_push_lex_into_version_mode): Check that the version script 10990 has not been finalized. 10991 (version_script_push_lang): Change language string to 10992 Version_script_info::Language. 10993 * options.cc (Command_line::version_script): New function. 10994 * options.h (class General_options): Add finalize_dynamic_list 10995 function. Change version_script from declaration to definition. 10996 * testsuite/ver_test_4.script: Remove duplicate def of t2_2. 10997 * testsuite/version_script.map: Remove duplicate def of foo. 10998 * testsuite/Makefile.am (ver_matching_def.so): Depend upon 10999 version_script.map. 11000 * testsuite/Makefile.in: Rebuild. 11001 11002 2009-12-30 Ian Lance Taylor <iant (a] google.com> 11003 11004 PR 10843 11005 * target-reloc.h (relocate_for_relocatable): When copying a reloc, 11006 if the input symbol index is 0, make the output symbol index 0. 11007 11008 2009-12-30 Ian Lance Taylor <iant (a] google.com> 11009 11010 PR 10670 11011 * options.h (class General_options): Add -x/--discard-all. 11012 * object.cc (Sized_relobj::do_count_local_symbols): Handle 11013 --discard-all. If the local symbol needs a dynamic entry, check 11014 that before handling --discard-locals. 11015 11016 2009-12-30 Ian Lance Taylor <iant (a] google.com> 11017 11018 PR 10450 11019 * output.cc (Output_segment::Output_segment): If PT_TLS, set the 11020 flags to PF_R. 11021 (Output_segment::add_output_section): Don't change the flags if 11022 the type is PT_TLS. 11023 11024 PR 10450 11025 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the 11026 GNU hash table if they need a dynamic value. Otherwise, don't add 11027 them if they are defined in a dynamic object or are forced local. 11028 11029 2009-12-29 Ian Lance Taylor <iant (a] google.com> 11030 11031 PR 10450 11032 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of 11033 .gnu.hash table for a 32-bit target. 11034 11035 PR 10450 11036 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a 11037 regular and a dynamic object only needs a dynamic symbol table 11038 entry if it is externally visible. 11039 11040 PR 10450 11041 * i386.cc (class Target_i386): Initialize global_offset_table_ in 11042 constructor. Add global_offset_table_ field. 11043 (Target_i386::got_section): Set global_offset_table_. 11044 (Target_i386::do_finalize_sections): Set global_offset_table_ 11045 size. 11046 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_ 11047 in constructor. Add global_offset_table_ field. 11048 (Target_x86_64::got_section): Set global_offset_table_. 11049 (Target_x86_64::do_finalize_sections): Set global_offset_table_ 11050 size. 11051 11052 * layout.cc (Layout::Layout): Initialize increase_relro_. 11053 (Layout::get_output_section): Add is_relro, is_last_relro, and 11054 is_first_non_relro parameters. Change all callers. 11055 (Layout::choose_output_section): Likewise. 11056 (Layout::add_output_section_data): Likewise. 11057 (Layout::make_output_section): Likewise. 11058 (Layout::set_segment_offsets): Clear increase_relro when using a 11059 linker script. 11060 * layout.h (class Layout): Add increase_relro method. Add 11061 increase_relro_ field. Update declarations. 11062 * output.cc (Output_section::Output_section): Initialize 11063 is_last_relro_ and is_first_non_relro_. 11064 (Output_segment::add_output_section): Group relro sections is 11065 do_sort is true. Handle is_last_relro and is_first_non_relro. 11066 (Output_segment::maximum_alignment): Remove relro handling. 11067 (Output_segment::set_section_addresses): Add increase_relro 11068 parameter. Change all callers. Add initial alignment to align 11069 relro sections on separate page. Remove old relro handling. 11070 (Output_segment::set_section_list_addresses): Remove in_relro 11071 parameter. Change all callers. 11072 (Output_segment::set_offset): Add increase parameter. Change all 11073 callers. Remove old relro handling. 11074 * output.h (class Output_section): Add new methods: is_last_relro, 11075 set_is_last_relro, is_first_non_relro, set_is_first_non_relro. 11076 Add is_last_relro_ and is_first_non_relro_ fields. 11077 * i386.cc (Target_i386::got_section): Don't call set_is_relro. 11078 Create separate .got.plt section. Call increase_relro. 11079 * x86_64.cc (Target_x86_64::got_section): Likewise. 11080 * testsuite/relro_script_test.t: Add .got.plt. 11081 11082 PR 10450 11083 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field. 11084 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_. 11085 (Layout::finalize): Call set_dynamic_symbol_size. 11086 (Layout::set_dynamic_symbol_size): New function. 11087 * layout.h (class Layout): Add dynamic_symbol_ field. Declare 11088 set_dynamic_symbol_size. 11089 11090 PR 10450 11091 * output.h (class Output_section): Add is_entsize_zero_ field. 11092 * output.cc (Output_section::Output_section): Initialize 11093 is_entsize_zero_. 11094 (Output_section::set_entsize): If two different entsizes are 11095 requested, force it to zero. 11096 (Output_section::add_input_section): Set flags for .debug_str 11097 before updating section flags. Set entsize. 11098 (Output_section::update_flags_for_input_section): Set SHF_MERGE 11099 and SHF_STRING if all input sections have those flags. 11100 11101 2009-12-29 Rafael Espindola <espindola (a] google.com> 11102 11103 * main.cc (main): Fix the sys time reporting. 11104 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time 11105 reporting. 11106 11107 2009-12-29 Sriraman Tallam <tmsriram (a] google.com> 11108 11109 * options.cc (General_options::parse_version): Allow -v to exit 11110 without an error if there is nothing to link. 11111 11112 2009-12-29 Ian Lance Taylor <iant (a] google.com> 11113 11114 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if 11115 using a version of gcc before 4.1. 11116 * configure: Rebuild. 11117 11118 2009-12-28 Chris Demetriou <cgd (a] google.com> 11119 11120 * attributes.cc (Output_attributes_section_data::do_write): Use 11121 std::vector::front rather than std::vector::data. 11122 11123 2009-12-28 Ian Lance Taylor <iant (a] google.com> 11124 11125 * symtab.h (class Symbol_table): Add enum Defined. 11126 * resolve.cc (Symbol_table::should_override): Add defined 11127 parameter. Change all callers. Test whether object is NULL 11128 before calling a method on it. 11129 (Symbol_table::report_resolve_problem): Add defined parameter. 11130 Change all callers. 11131 (Symbol_table::should_override_with_special): Likewise. 11132 * symtab.cc (Symbol_table::define_in_output_data): Add defined 11133 parameter. Change all callers. 11134 (Symbol_table::do_define_in_output_data): Likewise. 11135 (Symbol_table::define_in_output_segment): Likewise. 11136 (Symbol_table::do_define_in_output_segment): Likewise. 11137 (Symbol_table::define_as_constant): Likewise. 11138 (Symbol_table::do_define_as_constant): Likewise. 11139 * script.h (class Symbol_assignment): Add is_defsym parameter to 11140 constructor; change all callers. 11141 * script.cc (Script_options::add_symbol_assignment): Add is_defsym 11142 parameter. Change all callers. Add is_defsym_ field. 11143 (class Parser_closure): Add parsing_defsym parameter to 11144 constructor; change all callers. Add parsing_defsym accessor 11145 function. Add parsing_defsym_ field. 11146 11147 2009-12-28 Ian Lance Taylor <iant (a] google.com> 11148 11149 * gold.cc (queue_middle_tasks): Fix formatting. 11150 * object.cc (Relobj::is_section_name_included): Likewise. 11151 11152 2009-12-23 Ian Lance Taylor <iant (a] google.com> 11153 11154 * i386.cc (Target_i386::do_calls_non_split): Recognize 11155 -fsplit-stack prologue for a function with a static chain. 11156 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize 11157 -fsplit-stack prologue when using %r11. 11158 11159 2009-12-21 Sriraman Tallam <tmsriram (a] google.com> 11160 11161 * options.cc (General_options::parse_version): Make -v continue and do 11162 the link like GNU ld does. 11163 11164 2009-12-17 Rafael Avila de Espindola <espindola (a] google.com> 11165 11166 * Makefile.am (CCFILES): Add timer.cc. 11167 (HFILES): Add timer.h. 11168 * configure.ac: Check for sysconf and times. 11169 * main.cc: include timer.h. 11170 (main): Use Timer instead of get_run_time. 11171 * timer.cc: New. 11172 * timer.h: New. 11173 * workqueue.cc: include timer.h. 11174 (Workqueue::find_and_run_task): 11175 Report user, sys and wall time. 11176 * Makefile.in: Regenerate. 11177 * config.in: Regenerate. 11178 * configure: Regenerate. 11179 11180 2009-12-16 Doug Kwan <dougkwan (a] google.com> 11181 11182 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated 11183 sections. 11184 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle 11185 relaxed input sections. 11186 * output.cc (Output_section::find_relaxed_input_section): Change 11187 return type to Output_relaxed_input_section pointer. Adjust code 11188 for new type of relaxed_input_section_map_. 11189 * output.h (Output_section::find_relaxed_input_section): Change 11190 return type to Output_relaxed_input_section pointer. 11191 (Output_section::Output_relaxed_input_section_by_input_section_map): 11192 New type. 11193 (Output_section::relaxed_input_section_map_): Change type to 11194 Output_section::Output_relaxed_input_section_by_input_section_map. 11195 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed 11196 input section. 11197 11198 2009-12-15 Ian Lance Taylor <iant (a] google.com> 11199 11200 * layout.cc (Layout::create_shstrtab): Only write out after input 11201 sections if we are compressing debug sections. 11202 11203 2009-12-15 Ian Lance Taylor <iant (a] google.com> 11204 11205 * archive.cc (Archive::add_symbols): Only look up a symbol without 11206 a version if there is, in fact, a version. 11207 11208 2009-12-14 Ian Lance Taylor <iant (a] google.com> 11209 11210 Revert -Wshadow changes, all changes from: 11211 2009-12-11 Doug Kwan <dougkwan (a] google.com> 11212 2009-12-11 Nick Clifton <nickc (a] redhat.com> 11213 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS. 11214 11215 2009-12-11 Doug Kwan <dougkwan (a] google.com> 11216 11217 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage 11218 due to -Wshadow. 11219 * attributes.cc (Object_attribute::size): Ditto. 11220 (Attributes_section_data::size): Ditto. 11221 (Attributes_section_data::Attributes_section_data): Ditto. 11222 (Output_attributes_section_data::do_write): Ditto. 11223 * attributes.h (Object_attribute::set_type): Ditto. 11224 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto. 11225 11226 2009-12-11 Nick Clifton <nickc (a] redhat.com> 11227 11228 * archive.cc: Fix shadowed variable warnings. 11229 * arm.cc: Likewise. 11230 * compressed_output.cc: Likewise. 11231 * compressed_output.h: Likewise. 11232 * configure: Likewise. 11233 * dwarf_reader.cc: Likewise. 11234 * dynobj.cc: Likewise. 11235 * dynobj.h: Likewise. 11236 * ehframe.cc: Likewise. 11237 * ehframe.h: Likewise. 11238 * errors.cc: Likewise. 11239 * expression.cc: Likewise. 11240 * fileread.cc: Likewise. 11241 * fileread.h: Likewise. 11242 * freebsd.h: Likewise. 11243 * i386.cc: Likewise. 11244 * icf.cc: Likewise. 11245 * incremental.h: Likewise. 11246 * layout.cc: Likewise. 11247 * layout.h: Likewise. 11248 * mapfile.cc: Likewise. 11249 * merge.cc: Likewise. 11250 * merge.h: Likewise. 11251 * object.cc: Likewise. 11252 * object.h: Likewise. 11253 * options.h: Likewise. 11254 * output.cc: Likewise. 11255 * output.h: Likewise. 11256 * parameters.cc: Likewise. 11257 * plugin.cc: Likewise. 11258 * powerpc.cc: Likewise. 11259 * reduced_debug_output.cc: Likewise. 11260 * reduced_debug_output.h: Likewise. 11261 * reloc.cc: Likewise. 11262 * reloc.h: Likewise. 11263 * resolve.cc: Likewise. 11264 * script-sections.cc: Likewise. 11265 * script.cc: Likewise. 11266 * script.h: Likewise. 11267 * sparc.cc: Likewise. 11268 * symtab.cc: Likewise. 11269 * symtab.h: Likewise. 11270 * target-select.cc: Likewise. 11271 * target-select.h: Likewise. 11272 * token.h: Likewise. 11273 * workqueue.cc: Likewise. 11274 * workqueue.h: Likewise. 11275 * x86_64.cc: Likewise. 11276 11277 2009-12-10 Doug Kwan <dougkwan (a] google.com> 11278 11279 * arm.cc (attributes.h): New include. 11280 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_. 11281 (Arm_relobj::~Arm_relobj): Delete object pointed by 11282 attributes_section_data_. 11283 (Arm_relobj::attributes_section_data): New method definition. 11284 (Arm_relobj::attributes_section_data_): New data member declaration. 11285 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_. 11286 (Arm_dynobj::~Arm_dynobj): Delete object pointed by 11287 attributes_section_data_. 11288 (Arm_dynobj::attributes_section_data): New method definition. 11289 (Arm_dynobj::attributes_section_data_): New data member declaration. 11290 (Target_arm::Target_arm): Initialize attributes_section_data_. Change 11291 initialization value of may_use_blx_ to false. 11292 (Target_arm::using_thumb2, Target_arm::using_thumb_only, 11293 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use 11294 object attributes to compute results instead of hard-coding. 11295 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order, 11296 Target_arm::get_secondary_compatible_arch, 11297 Target_arm::set_secondary_compatible_arch 11298 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name, 11299 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes): 11300 New method declarations. 11301 (Target_arm::get_aeabi_object_attribute): New method definition. 11302 (Target_arm::attributes_section_data_): New data member declaration. 11303 (read_arm_attributes_section): New template definition. 11304 (Arm_relobj::do_read_symbols): Read attributes section if it exists. 11305 (Arm_dynobj::do_read_symbols): Ditto. 11306 (Target_arm::do_finalize_sections): Merge attributes sections from 11307 input. Check for BLX use after attributes section merging. 11308 Fix __exidx_start and __exidx_end visibility. Create an 11309 .ARM.attributes section if necessary. 11310 (Target_arm::get_secondary_compatible_arch, 11311 Target_arm::set_secondary_compatible_arch, 11312 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name, 11313 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes, 11314 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order): 11315 New method definitions. 11316 11317 2009-12-09 Ian Lance Taylor <iant (a] google.com> 11318 11319 * plugin.cc (Plugin::load): Don't cast from void* to a function 11320 pointer. 11321 11322 2009-12-09 Ian Lance Taylor <iant (a] google.com> 11323 11324 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version 11325 information fields. 11326 11327 2009-12-09 H.J. Lu <hongjiu.lu (a] intel.com> 11328 11329 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES): 11330 Replace two_file_shared_1.so with two_file_shared_2.so. 11331 * testsuite/Makefile.in: Regenerated. 11332 11333 2009-12-08 Doug Kwan <dougkwan (a] google.com> 11334 11335 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc. 11336 (HFILES): Add attributes.h and int_encoding.h. 11337 * Makefile.in: Regenerate. 11338 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move 11339 function definitions to int_encoding.cc 11340 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move 11341 prototypes to int_encoding.h 11342 * reduced_debug_output.cc (int_encoding.h): New include. 11343 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move 11344 function definitions to int_encoding.cc 11345 (insert_into_vector, read_from_pointer): Move template definitions to 11346 int_encoding.h 11347 * attributes.cc: New file. 11348 * attributes.h: New file. 11349 * int_encoding.cc: New file. 11350 * int_encoding.h: New file. 11351 11352 2009-12-07 Rafael Avila de Espindola <espindola (a] google.com> 11353 11354 PR gold/11055 11355 * incremental-dump.cc (dump_incremental_inputs): New. 11356 (main): Use dump_incremental_inputs. 11357 11358 2009-12-07 H.J. Lu <hongjiu.lu (a] intel.com> 11359 11360 PR gold/10893 11361 * i386.cc (Target_i386::Scan::globa): Use is_func instead of 11362 checking elfcpp::STT_FUNC. 11363 (Target_i386::Relocate::relocate): Likewise. 11364 * x86_64.cc (Target_x86_64::Scan::global): Likewise. 11365 11366 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC 11367 symbols from shared libraries into normal FUNC symbols. 11368 11369 * symtab.h (Symbol): Add is_func and use it. 11370 11371 2009-12-05 Doug Kwan <dougkwan (a] google.com> 11372 11373 * arm.cc (Target_arm::arm_info): Initialize new fields 11374 attributes_section and attributes_vendor. 11375 * i386.cc (Target_i386::i386_info): Same. 11376 * object.cc (Sized_relobj::do_layout): Skip attribute section. 11377 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new 11378 fields attributes_section and attributes_vendor. 11379 * sparc.cc (Target_sparc::sparc_info): Same. 11380 * target.h (Target::attributes_section, Target::attributes_vendor, 11381 Target::is_attributes_section, Target::attribute_arg_type, 11382 Target::attributes_order): New method definitions. 11383 (Target::Target_info::attributes_section, 11384 Target::Target_info::attributes_vendor): New fields. 11385 (Target::do_attribute_arg_type, Target::do_attributes_order): New 11386 virtual method definitions. 11387 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields 11388 attributes_section and attributes_vendor. 11389 * testsuite/testfile.cc (Target_test::test_target_info): Same. 11390 11391 2009-12-05 Doug Kwan <dougkwan (a] google.com> 11392 11393 * arm.cc: Update comments about interworking and stub generation. 11394 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations 11395 considered as non-PIC. 11396 (Arm_relocate_functions::base_abs): Fix formatting. 11397 (Arm_relocate_functions::got_prel): Fix comment. Change interface 11398 of function to use GOT entry address instead of offset. 11399 (Target_arm::Scan::global): Issue an error if a symbol would need a 11400 PLT does not get one because it is untyped. Remove code to create 11401 dynamic symbols for relative branches. 11402 (Target_arm::Relocate::relocate: Use 0 instead of false since function 11403 takes unsigned integer instead of boolean. 11404 11405 2009-12-05 H.J. Lu <hongjiu.lu (a] intel.com> 11406 11407 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty. 11408 (two_file_test_LDADD): Likewise. 11409 (common_test_1_LDADD): Likewise. 11410 (exception_test_LDADD) Likewise. 11411 (weak_test_LDADD): Likewise. 11412 (many_sections_test_LDADD): Likewise. 11413 (initpri1_LDADD): Likewise. 11414 (script_test_1_LDADD): Likewise. 11415 (script_test_2_LDADD): Likewise. 11416 (justsyms_LDADD): Likewise. 11417 (binary_test_LDADD): Likewise. 11418 (large_LDADD): Likewise. 11419 * testsuite/Makefile.in: Regenerated. 11420 11421 2009-12-04 H.J. Lu <hongjiu.lu (a] intel.com> 11422 11423 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL. 11424 (Symbol_table::override_with_special): Likewise. 11425 (Symbol_table::add_from_object): Likewise. 11426 11427 2009-12-04 Rafael Avila de Espindola <espindola (a] google.com> 11428 11429 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data): 11430 Don't set the data_offset twice. 11431 11432 2009-12-04 Rafael Avila de Espindola <espindola (a] google.com> 11433 11434 * testsuite/Makefile.in: Regenerate. 11435 11436 2009-12-03 Doug Kwan <dougkwan (a] google.com> 11437 11438 * arm.cc: Remove comment about missing .ARM.exidx section symbols. 11439 (Target_arm::do_finalize_sections): Add parameter for symbol table 11440 pointer. Add __exidx_start and __exidx_end symbols as appropriate. 11441 * i386.cc (Target_i386::do_finalize_sections): Add an additional 11442 parameter for symbol table pointer. 11443 * layout.cc (Layout::finalize): Call Target::finalize_sections with 11444 an additional parameter for a pointer to symbol table. 11445 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional 11446 parameter for a symbol table pointer. 11447 * sparc.cc (Target_sparc::do_finalize_sections): Ditto. 11448 * target.h (Target::finalize_sections, Target::do_finalize_sections): 11449 Ditto. 11450 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional 11451 parameter for a symbol table pointer. 11452 11453 2009-12-03 Rafael Avila de Espindola <espindola (a] google.com> 11454 11455 * incremental.cc (Incremental_inputs_header) 11456 (Incremental_inputs_header_write, Incremental_inputs_entry) 11457 (Incremental_inputs_entry_write): Move ... 11458 * incremental.h (Incremental_inputs_header) 11459 (Incremental_inputs_header_write, Incremental_inputs_entry) 11460 (Incremental_inputs_entry_write): here. 11461 11462 2009-12-02 Rafael Avila de Espindola <espindola (a] google.com> 11463 11464 * incremental.cc (make_sized_incremental_binary): Set the target. 11465 Error if it is incompatible. 11466 * output.h (Output_file): Add filename method. 11467 11468 2009-12-02 Rafael Avila de Espindola <espindola (a] google.com> 11469 11470 * incremental.cc (Incremental_inputs_entry): Remove unused argument 11471 from the get_* methods. 11472 11473 2009-12-02 Rafael Avila de Espindola <espindola (a] google.com> 11474 11475 * incremental-dump.cc (main): Check that the offeset of a script is 0. 11476 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data): 11477 Write 0 for the data_offset of scripts. 11478 11479 2009-12-02 Rafael Avila de Espindola <espindola (a] google.com> 11480 11481 * testsuite/Makefile.am: Add the incremental_test.sh test. 11482 * testsuite/incremental_test.sh: New. 11483 * testsuite/incremental_test_1.c: New. 11484 * testsuite/incremental_test_2.c: New. 11485 11486 2009-12-01 Rafael Avila de Espindola <espindola (a] google.com> 11487 11488 * incremental-dump.cc (main): Fix typos. 11489 11490 2009-11-27 Rafael Avila de Espindola <espindola (a] google.com> 11491 11492 PR gold/11025 11493 * incremental-dump.cc (main): Use llu to print 64 bit values. 11494 11495 2009-11-26 Per yvind Karlsen <peroyvind (a] mandriva.org> 11496 H.J. Lu <hongjiu.lu (a] intel.com> 11497 11498 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB) 11499 $(LIBDL). 11500 (incremental_dump_LDADD): Likewise. 11501 * Makefile.in: Regenerated. 11502 11503 2009-11-25 Doug Kwan <dougkwan (a] google.com> 11504 11505 Revert: 11506 11507 2009-11-25 Doug Kwan <dougkwan (a] google.com> 11508 11509 * arm.cc (Target_arm::Target_arm): Move method definition 11510 outside of class definition. Add code to handle 11511 --target1-rel, --target1-abs and --target2= options. 11512 (Target_arm::get_reloc_reloc_type): Change method to be 11513 non-static and const. 11514 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): 11515 New data member declaration. 11516 (Target_arm::Scan::local, Target_arm::Scan::global, 11517 Target_arm::Relocate::relocate, 11518 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): 11519 Adjust call to Target_arm::get_real_reloc_type. 11520 (Target_arm::get_real_reloc_type): Use command line options 11521 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2. 11522 * options.h (--target1-rel, --target1-abs, --target2): New 11523 ARM-only options. 11524 11525 2009-11-25 Doug Kwan <dougkwan (a] google.com> 11526 11527 * arm.cc (Target_arm::Target_arm): Move method definition outside of 11528 class definition. Add code to handle --target1-rel, --target1-abs 11529 and --target2= options. 11530 (Target_arm::get_reloc_reloc_type): Change method to be non-static 11531 and const. 11532 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data 11533 member declaration. 11534 (Target_arm::Scan::local, Target_arm::Scan::global, 11535 Target_arm::Relocate::relocate, 11536 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust 11537 call to Target_arm::get_real_reloc_type. 11538 (Target_arm::get_real_reloc_type): Use command line options to 11539 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2. 11540 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only 11541 options. 11542 11543 2009-11-25 Doug Kwan <dougkwan (a] google.com> 11544 11545 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition. 11546 (Arm_relocate_functions::thumb_branch_common): New metod declaration. 11547 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix 11548 formatting. 11549 (Arm_relocate_functions::thm_call): Replace body with a call to 11550 Arm_relocate_functions::thumb_branch_common. 11551 (Arm_relocate_functions::thm_jump24, 11552 Arm_relocate_functions::thm_xpc22): New method definitions. 11553 (Arm_relocate_functions::thumb_branch_common): New method definition. 11554 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or 11555 operator. 11556 (Target_arm::Relocate::relocate): Adjust call to thm_call. 11557 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24. 11558 11559 2009-11-24 Rafael Avila de Espindola <espindola (a] google.com> 11560 11561 * Makefile.am: Build incremental-dump 11562 * Makefile.in: Regenerate. 11563 * incremental-dump.cc: New. 11564 * incremental.cc (Incremental_inputs_header_data, 11565 Incremental_inputs_entry_data): Move to incremental.h 11566 * incremental.h: (Incremental_inputs_header_data, 11567 Incremental_inputs_entry_data): Move from incremental.cc 11568 11569 2009-11-24 Rafael Avila de Espindola <espindola (a] google.com> 11570 11571 * incremental.cc (Incremental_inputs_header, 11572 Incremental_inputs_header_write, Incremental_inputs_entry, 11573 Incremental_inputs_entry_write): Add a typedef with the data type. 11574 11575 2009-11-24 Rafael Avila de Espindola <espindola (a] google.com> 11576 11577 * incremental.cc (Incremental_inputs_header, 11578 Incremental_inputs_header_write, Incremental_inputs_entry, 11579 Incremental_inputs_entry_write): Update comment about which 11580 type has the filed descriptions. 11581 11582 2009-11-15 Doug Kwan <dougkwan (a] google.com> 11583 11584 * arm.cc (Target_arm::may_use_arm_nop): New method definition. 11585 (Arm_relocate_functions::arm_branch_common): Change method defintion 11586 in class definition to a method declaration and update list of formal 11587 parameters. 11588 (Arm_relocate_functions::plt32, Arm_relocate_functions::call, 11589 Arm_relocation_functions::jump24): Adjust call to 11590 Arm_relocate_functions::arm_branch_common. Update list of formal 11591 parameters. 11592 (Arm_relocate_functions::xpc25): New method definition. 11593 (Arm_relocate_functions::arm_branch_common): Move method defintion 11594 out from class definition. Use stubs for mode-switching and extending 11595 branch ranges. 11596 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols 11597 specially. Change code to enable use of stubs in ARM branches. 11598 11599 2009-11-10 Doug Kwan <dougkwan (a] google.com> 11600 11601 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter 11602 in method declaration. 11603 (Target_arm::relocate_stub): New method declaration. 11604 (Target_arm::default_target): Change to return a pointer instead of 11605 a const reference. 11606 (Reloc_stub::stub_type_for_reloc): Adjust for the change in 11607 Target_arm::default_target. 11608 (Arm_Relobj::do_relocate_sections): Remove options paramater in 11609 method definition. 11610 (Target_arm::relocate_section): Adjust view. 11611 (Target_arm::relocate_stub): New method definition. 11612 11613 2009-11-10 Doug Kwan <dougkwan (a] google.com> 11614 11615 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid 11616 a format warning. 11617 * incremental.cc (open_incremental_binary): Initialized local 11618 variables to avoid warnings. 11619 * object.cc (make_elf_object): Ditto. 11620 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid 11621 a format warning. 11622 11623 009-11-09 H.J. Lu <hongjiu.lu (a] intel.com> 11624 11625 PR gold/10930 11626 * testsuite/plugin_test.c: Include "config.h". 11627 11628 2009-11-09 Doug Kwan <dougkwan (a] google.com> 11629 11630 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant. 11631 (arm_symbol_value): Remove. 11632 (Arm_relocate_functions::arm_branch_common, 11633 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5, 11634 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16, 11635 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32, 11636 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32, 11637 Arm_relocate_functions::call, Arm_relocate_functions::jump24, 11638 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc, 11639 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc, 11640 Arm_relocate_functions::thm_mobw_abs_nc, 11641 Arm_relocate_functions::thm_mov_abs, 11642 Arm_relocate_functions::movw_prel_nc, 11643 Arm_relocate_functions::thm_movt_abs, 11644 Arm_relocate_functions::movt_prel, 11645 Arm_relocate_functions::thm_movw_prel_nc, 11646 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above. 11647 (Target_arm::Relocate::relocate): Only decompose address into two 11648 parts if relocation type uses the thumb-bit and pass the actual 11649 bit instead of a flag indicating that the thumb-bit is used. Adjust 11650 calls to methods in Arm_relocate_functions for this change. 11651 11652 2009-11-08 Ian Lance Taylor <iant (a] google.com> 11653 11654 PR 10925 11655 * reloc.cc: Instantiate 11656 Sized_relobj::initialize_input_to_output_maps and 11657 Sized_relobj:free_input_to_output_maps. 11658 11659 2009-11-06 Ian Lance Taylor <iant (a] google.com> 11660 11661 PR 10876 11662 * defstd.cc (in_segment): Set only_if_ref true for "end". 11663 11664 2009-11-06 Doug Kwan <dougkwan (a] google.com> 11665 11666 * arm.cc (class Reloc_stub): Correct a comment. 11667 (Target_arm::Target_arm): Initialize arm_input_section_map_. 11668 (Target_arm::scan_section_for_stubs): New method declaration. 11669 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section): 11670 Change methods from private to protected. 11671 (Target_arm::do_may_relax): New method definition. 11672 (Target_arm::do_relax, Target_arm::group_sections, 11673 Target_arm::scan_reloc_for_stub, 11674 Target_arm::scan_reloc_section_for_stubs): New method declarations. 11675 (Target_arm::arm_input_section_map_): New data member declaration. 11676 (Target_arm::scan_reloc_for_stub, 11677 Target_arm::scan_reloc_section_for_stubs, 11678 Target_arm::scan_section_for_stubs, Target_arm::group_sections, 11679 Target_arm::do_relax): New method definitions. 11680 11681 2009-11-06 Mikolaj Zalewski <mikolaj (a] google.com> 11682 11683 * configure.ac: Check for (struct stat)::st_mtim 11684 * fileread.cc (File_read::get_mtime): Use st_mtim if available. 11685 * config.in: Regenerate. 11686 * configure: Regenerate. 11687 11688 2009-11-05 Ian Lance Taylor <iant (a] google.com> 11689 11690 PR 10910 11691 * output.cc (Output_segment::add_output_section): Add missing 11692 return statement. 11693 11694 2009-11-04 Ian Lance Taylor <iant (a] google.com> 11695 11696 PR 10880 11697 * object.h (class Object): Add is_needed and set_is_needed 11698 methods. Add is_needed_ field. Make bool fields into bitfields. 11699 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is 11700 defined in a dynamic object and referenced by a regular object, 11701 set is_needed for the dynamic object. 11702 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED 11703 if the file is marked with as_needed and it is not needed. 11704 11705 2009-11-04 Ian Lance Taylor <iant (a] google.com> 11706 11707 PR 10887 11708 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic 11709 tags if data is discarded by linker script. 11710 * i386.cc (Target_i386::do_finalize_sections): Likewise. 11711 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise. 11712 * sparc.cc (Target_sparc::do_finalize_sections): Likewise. 11713 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise. 11714 11715 2009-11-04 Ian Lance Taylor <iant (a] google.com> 11716 11717 * layout.cc (Layout::get_output_section): Add is_interp and 11718 is_dynamic_linker_section parameters. Change all callers. 11719 (Layout::choose_output_section): Likewise. 11720 (Layout::make_output_section): Likewise. 11721 (Layout::add_output_section_data): Add is_dynamic_linker_section 11722 parameter. Change all callers. 11723 * layout.h (class Layout): Update declarations. 11724 * output.h (class Output_section): Add is_interp, set_is_interp, 11725 is_dynamic_linker_section, set_is_dynamic_linker_section methods. 11726 Add is_interp_, is_dynamic_linker_section_ fields. Change 11727 generate_code_fills_at_write_ to a bitfield. 11728 * output.cc (Output_section::Output_sections): Initialize new 11729 fields. 11730 (Output_segment::add_output_section): Add do_sort parameter. 11731 Change all callers. 11732 11733 2009-11-03 Ian Lance Taylor <iant (a] google.com> 11734 11735 PR 10860 11736 * options.h (class General_options): Add --warn-common. 11737 * resolve.cc (Symbol_table::resolve): Handle --warn-common when 11738 merging two common symbols. 11739 (Symbol_table::should_override): Handle --warn-common when merging 11740 a common symbol with a defined symbol. Use report_resolve_problem 11741 for multiple definitions. 11742 (Symbol_table::report_resolve_problem): New function. 11743 * symtab.h (class Symbol_table): Declare report_resolve_problem. 11744 11745 2009-11-03 Doug Kwan <dougkwan (a] google.com> 11746 11747 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and 11748 stub_factory_. 11749 (Target_arm::stub_factory): New method definition. 11750 (Target_arm::new_arm_input_section, 11751 Target_arm::find_arm_input_section, Target_arm::new_stub_table, 11752 Target_arm::reloc_uses_thumb_bit): New method declarations. 11753 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map): 11754 New type definitions. 11755 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data 11756 member declarations. 11757 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section, 11758 Target_arm::find_arm_input_section, Target_arm::new_stub_table): 11759 New method definitions. 11760 11761 2009-11-03 Ian Lance Taylor <iant (a] google.com> 11762 11763 * options.h (class General_options): Add --warn_constructors. 11764 11765 2009-11-03 Ian Lance Taylor <iant (a] google.com> 11766 11767 PR 10893 11768 * defstd.cc (in_section): Add entries for __rel_iplt_start, 11769 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack. 11770 11771 2009-11-03 Ian Lance Taylor <iant (a] google.com> 11772 11773 PR 10895 11774 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and 11775 --msgid-bugs-address. 11776 (install-pdf): New target. 11777 (install-data_yes): Look up one directory to find mkinstalldirs. 11778 11779 2009-11-03 H.J. Lu <hongjiu.lu (a] intel.com> 11780 11781 * po/Make-in (.po.gmo): Don't generate .gmo files in source 11782 tree. 11783 11784 2009-10-30 Doug Kwan <dougkwan (a] google.com> 11785 11786 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in. 11787 11788 2009-10-30 Doug Kwan <dougkwan (a] google.com> 11789 11790 * arm.cc (Stub_addend_reader): New struct template definition 11791 and partial specializations. 11792 (Stub_addend_reader::operator()): New method definition for a 11793 partially specialized template. 11794 11795 2009-10-30 Doug Kwan <dougkwan (a] google.com> 11796 11797 * arm.cc (Arm_relobj::processor_specific_flags): New method 11798 definition. 11799 (Arm_relobj::do_read_symbols): New method declaration. 11800 (Arm_relobj::processor_specific_flags_): New data member declaration. 11801 (Arm_dynobj): New class definition. 11802 (Target_arm::do_finalize_sections): Add input_objects parameter. 11803 (Target_arm::do_adjust_elf_header): New method declaration. 11804 (Target_arm::are_eabi_versions_compatible, 11805 (Target_arm::merge_processor_specific_flags): New method declaration. 11806 (Target_arm::do_make_elf_object): New overloaded method definitions 11807 and declaration. 11808 (Arm_relobj::do_read_symbols): New method definition. 11809 (Arm_dynobj::do_read_symbols): Ditto. 11810 (Target_arm::do_finalize_sections): Add input_objects parameters. 11811 Merge processor-specific flags from all input objects. 11812 (Target_arm::are_eabi_versions_compatible, 11813 Target_arm::merge_processor_specific_flags, 11814 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object): 11815 New method definitions. 11816 * i386.cc (Target_i386::do_finalize_sections): Add unnamed 11817 Input_objects pointer type parameter. 11818 * layout.cc (Layout::finalize): Pass input objects to target's. 11819 finalize_sections function. 11820 * output.cc (Output_file_header::do_sized_write): Set ELF file 11821 header's processor-specific flags. 11822 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed 11823 Input_objects pointer type parameter. 11824 * sparc.cc (Target_sparc::do_finalize_sections): Same. 11825 * target.h (Input_objects): New forward class declaration. 11826 (Target::processor_specific_flags, 11827 Target::are_processor_specific_flags_sect): New method definitions. 11828 (Target::finalize_sections): Add input_objects parameter. 11829 (Target::Target): Initialize processor_specific_flags_ and 11830 are_processor_specific_flags_set_. 11831 (Target::do_finalize_sections): Add unnamed Input_objects pointer type 11832 parameter. 11833 (Target::set_processor_specific_flags): New method definition. 11834 (Target::processor_specific_flags_, 11835 Target::are_processor_specific_flags_set_): New data member 11836 declarations. 11837 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed 11838 Input_objects pointer type parameter. 11839 11840 2009-10-30 Doug Kwan <dougkwan (a] google.com> 11841 11842 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr. 11843 11844 2009-10-28 Ian Lance Taylor <iant (a] google.com> 11845 11846 * object.h (class Relobj): Drop options parameter from 11847 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs, 11848 do_scan_relocs, do_relocate. Change all callers. 11849 (class Sized_relobj): Drop options parameters from 11850 do_gc_process_relocs, do_scan_relocs, do_relocate, 11851 do_relocate_sections, relocate_sections, emit_relocs_scan, 11852 emit_relocs_scan_reltype. Change all callers. 11853 (struct Relocate_info): Remove options field and all references to 11854 it. 11855 * reloc.h (class Read_relocs): Remove options constructor 11856 parameter and options_ field. Change all callers. 11857 (class Gc_process_relocs, class Scan_relocs): Likewise. 11858 (class Relocate_task): Likewise. 11859 * target-reloc.h (scan_relocs): Remove options parameter. Change 11860 all callers. 11861 (scan_relocatable_relocs): Likewise. 11862 * target.h (class Sized_target): Remove options parameter from 11863 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change 11864 all callers. 11865 * gc.h (gc_process_relocs): Remove options parameter. Change all 11866 callers. 11867 * arm.cc: Update functions to remove options parameters. 11868 * i386.cc: Likewise. 11869 * powerpc.cc: Likewise. 11870 * sparc.cc: Likewise. 11871 * x86_64.cc: Likewise. 11872 * testsuite/testfile.cc: Likewise. 11873 11874 2009-10-28 Doug Kwan <dougkwan (a] google.com> 11875 11876 * arm.cc (Arm_relobj): New class definition. 11877 (Arm_relobj::scan_sections_for_stubs, 11878 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections): 11879 New method definitions. 11880 11881 2009-10-28 Cary Coutant <ccoutant (a] google.com> 11882 11883 * plugin.h (Plugin::Plugin): Initialize cleanup_done_. 11884 (Plugin::cleanup_done_): New member. 11885 (Plugin_manager::Plugin_manager): Remove cleanup_done_. 11886 (Plugin_manager::cleanup_done_): Remove. 11887 (Plugin_manager::add_input_file): Edit error message. 11888 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_. 11889 (Plugin_manager::cleanup): Remove use of cleanup_done_. 11890 11891 2009-10-27 Mikolaj Zalewski <mikolajz (a] google.com> 11892 11893 * fileread.cc: (File_read::View::~View): Use the new 11894 data_ownership_ filed. 11895 (File_read::~File_read): Dispose the new whole_file_view_. 11896 (File_read::open): Mmap the whole file if needed. 11897 (File_read::open): Use whole_file_view_ instead of contents_. 11898 (File_read::find_view): Use whole_file_view_ if applicable. 11899 (File_read::do_read): Use whole_file_view_ instead of contents_. 11900 (File_read::make_view): Use whole_file_view_ instead of contents_, 11901 update File_read::View::View call. 11902 (File_read::find_or_make_view): Update File_read::View::View 11903 call. 11904 * fileread.h: (File_read::File_read): Initialize whole_file_view_, 11905 remove contents_ 11906 (File_read::View::Data_ownership): New enum. 11907 (File_read::View::View): Replace bool mapped_ with Data_ownership 11908 argument. 11909 (File_read::View::mapped_): Remove (replaced by data_ownership_). 11910 (File_read::View::data_ownership_): New field. 11911 (File_read::contents_): Remove (replaced by whole_file_view_). 11912 (File_read::whole_file_view_): New field. 11913 * options.h (class General_options): Add --keep-files-mapped. 11914 11915 2009-10-27 Cary Coutant <ccoutant (a] google.com> 11916 11917 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary. 11918 * testsuite/Makefile.am (plugin_test_5): New test case. 11919 * testsuite/Makefile.in: Regenerate. 11920 11921 2009-10-25 Doug Kwan <dougkwan (a] google.com> 11922 11923 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change 11924 from private to protected to allow access by child class. 11925 (Sized_relobj::do_relocate_sections): New method declaration. 11926 (Sized_relobj::relocate_sections): Virtualize. 11927 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from 11928 Sized_relobj::relocate_sections. Instantiate template explicitly 11929 for different target sizes and endianity. 11930 11931 2009-10-24 Doug Kwan <dougkwan (a] google.com> 11932 11933 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations. 11934 (Arm_input_section::as_arm_input_section): New method. 11935 (Arm_output_section): New class definition. 11936 (Arm_output_section::create_stub_group, 11937 Arm_output_section::group_sections): New method definitions. 11938 11939 2009-10-22 Doug Kwan <dougkwan (a] google.com> 11940 11941 * arm.cc (Arm_input_section): New class definition. 11942 (Arm_input_section::init, Arm_input_section:do_write, 11943 Arm_input_section::set_final_data_size, 11944 Arm_input_section::do_reset_address_and_file_offset): New method 11945 definitions. 11946 11947 2009-10-21 Doug Kwan <dougkwan (a] google.com> 11948 11949 * arm.cc (Stub_table, Arm_input_section): New forward class 11950 declarations. 11951 (Stub_table): New class defintion. 11952 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs 11953 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write): 11954 New method definition. 11955 11956 2009-10-21 Doug Kwan <dougkwan (a] google.com> 11957 11958 * arm.cc: Update copyright comments. 11959 (Target_arm): New forward class template declaration. 11960 (Arm_address): New type. 11961 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET, 11962 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET, 11963 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New 11964 constants. 11965 (Insn_template): Same. 11966 (DEF_STUBS): New macro. 11967 (Stub_type): New enum type. 11968 (Stub_template): New class definition. 11969 (Stub): Same. 11970 (Reloc_stub): Same. 11971 (Stub_factory): Same. 11972 (Target_arm::Target_arm): Initialize may_use_blx_ and 11973 should_force_pic_veneer_. 11974 (Target_arm::may_use_blx, Target_arm::set_may_use_blx, 11975 Target_arm::should_force_pic_veneer, 11976 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2, 11977 Target_arm::using_thumb_only, Target_arm:;default_target): New 11978 method defintions. 11979 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_): 11980 New data member declarations. 11981 (Insn_template::size, Insn_template::alignment): New method defintions. 11982 (Stub_template::Stub_template): New method definition. 11983 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc, 11984 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same. 11985 (Stub_factory::Stub_factory): New method definition. 11986 * gold.h (string_hash): New template. 11987 * output.h (Input_section_specifier::hash_value): Use 11988 gold::string_hash. 11989 (Input_section_specifier::string_hash): Remove. 11990 * stringpool.cc (Stringpool_template::string_hash): Use 11991 gold::string_hash. 11992 11993 2009-10-20 Doug Kwan <dougkwan (a] google.com> 11994 11995 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section 11996 symbols of relaxed input sections. 11997 * output.h (Output_section::find_relaxed_input_section): Make 11998 method public. 11999 12000 2009-10-16 Doug Kwan <dougkwan (a] google.com> 12001 12002 * dynobj.cc (Versions::Versions): Initialize version_script_. 12003 Only insert base version symbol definition for a shared object 12004 if version script defines any version versions. 12005 (Versions::define_base_version): New method definition. 12006 (Versions::add_def): Check that base version is not needed. 12007 (Versions::add_need): Define base version lazily. 12008 * dynobj.h (Versions::define_base_version): New method declaration. 12009 (Versions::needs_base_version_): New data member declaration. 12010 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh 12011 (check_DATA): Add no_version_test.stdout. 12012 (libno_version_test.so, no_version_test.o no_version_test.stdout): 12013 New make rules. 12014 * testsuite/Makefile.in: Regenerate. 12015 * testsuite/no_version_test.c: New file. 12016 * testsuite/no_version_test.sh: Ditto. 12017 12018 2009-10-16 Doug Kwan <dougkwan (a] google.com> 12019 12020 * expression.cc (class Segment_start_expression): New class definition. 12021 (Segment_start_expression::value): New method definition. 12022 (script_exp_function_segment_start): Return a new 12023 Segment_start_expression. 12024 * gold/script-c.h (script_saw_segment_start_expression): New function 12025 prototype. 12026 * script-sections.cc (Script_sections::Script_sections): Initialize 12027 SAW_SEGMENT_START_EXPRESSION_ to false. 12028 (Script_sections::set_section_addresses): Use -Ttext, -Tdata 12029 and -Tbbs options to specify section addresses if given in 12030 command line and no SEGMENT_START expression is seen in a script. 12031 * script-sections.h (Script_sections::saw_segment_start_expression, 12032 Script_sections::set_saw_segment_start_expression): New method 12033 definition. 12034 (Script_sections::saw_segment_start_expression_): New data member 12035 declaration. 12036 * script.cc (script_saw_segment_start_expression): New function. 12037 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression. 12038 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh, 12039 script_test_7.sh and script_test_8.sh. 12040 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and 12041 script_test_8.stdout. 12042 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8. 12043 (script_test_6, script_test_6.stdout, script_test_7, 12044 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules. 12045 * Makefile.in: Regenerate. 12046 * testsuite/script_test_6.sh: New file. 12047 * testsuite/script_test_6.t: Same. 12048 * testsuite/script_test_7.sh: Same. 12049 * testsuite/script_test_7.t: Same. 12050 * testsuite/script_test_8.sh: Same. 12051 12052 2009-10-16 Doug Kwan <dougkwan (a] google.com> 12053 12054 * output.cc (Output_segment::set_section_list_address): Cast 12055 expressions to unsigned long long type to avoid format warnings. 12056 12057 2009-10-15 Ian Lance Taylor <iant (a] google.com> 12058 12059 * script.cc (Script_options::add_symbol_assignment): Always add a 12060 dot assignment to script_sections_. 12061 * script-sections.cc (Script_sections::add_dot_assignment): 12062 Initialize if necessary. 12063 12064 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see 12065 program headers with no load segment if there is a linker script. 12066 12067 * layout.cc (Layout::set_segment_offsets): Align the file offset 12068 to the segment aligment for -N or -n with no load segment. 12069 * output.cc (Output_segment::add_output_section): Don't crash if 12070 the first section is a TLS section. 12071 (Output_segment::set_section_list_addresses): Print an error 12072 message if the address moves backward in a linker script. 12073 * script-sections.cc 12074 (Output_section_element_input::set_section_addresses): Don't 12075 increase *dot_value for a SHF_TLS/SHT_NOBITS section. 12076 (Orphan_output_section::set_section_addresses): Likewise. 12077 12078 2009-10-15 Doug Kwan <dougkwan (a] google.com> 12079 12080 * layout.cc (Layout::finish_dynamic_section): Generate tags 12081 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ, 12082 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is 12083 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS. 12084 12085 2009-10-14 Ian Lance Taylor <iant (a] google.com> 12086 12087 * object.h (class Relocate_info): Add reloc_shdr and data_shdr 12088 fields. 12089 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and 12090 data_shdr fields of relinfo. 12091 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field. 12092 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For 12093 R_386_TLS_LDO_32, adjust based on section flags. 12094 (Target_i386::Relocate::fix_up_ldo): Remove. 12095 12096 2009-10-13 Ian Lance Taylor <iant (a] google.com> 12097 12098 Add support for -pie. 12099 * options.h (class General_options): Add -pie and 12100 --pic-executable. 12101 (General_options::output_is_position_independent): Test -pie. 12102 (General_options::output_is_executable): Return true if not shared 12103 and not relocatable. 12104 (General_options::output_is_pie): Remove. 12105 * options.cc (General_options::finalize): Reject incompatible uses 12106 of -pie. 12107 * gold.cc (queue_middle_tasks): A -pie link is not static. 12108 * symtab.h (Symbol::needs_plt_entry): Return false if -pie. 12109 * symtab.cc (Symbol::final_value_is_known): Return false if 12110 output_is_position_independent. 12111 * layout.cc (Layout::set_segment_offsets): Start at address 0 if 12112 output_is_position_independent. 12113 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if 12114 output_is_position_independent. 12115 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if 12116 output_is_position_independent. 12117 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and 12118 two_file_pie_test. 12119 (basic_pie_test.o, basic_pie_test): New targets. 12120 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets. 12121 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets. 12122 (two_file_pie_test): New target. 12123 * testsuite/Makefile.in: Rebuild. 12124 * README: Remove note saying that -pie is not supported. 12125 12126 2009-10-13 Bernhard Reutner-Fischer <aldot (a] gcc.gnu.org> 12127 12128 * options.h (class General_options): Add -init and -fini. 12129 * layout.cc (Layout::finish_dynamic_section): Emit 12130 given init and fini functions. 12131 12132 2009-10-13 Sriraman Tallam <tmsriram (a] google.com> 12133 12134 * gc.h (gc_process_relocs): Check if icf is enabled using new 12135 function. 12136 * gold.cc (queue_initial_tasks): Likewise. 12137 (queue_middle_tasks): Likewise. 12138 * object.cc (do_layout): Likewise. 12139 * symtab.cc (is_section_folded): Likewise. 12140 * main.cc (main): Likewise. 12141 * reloc.cc (Read_relocs::run): Likewise. 12142 (Sized_relobj::do_scan_relocs): Likewise. 12143 * icf.cc (is_function_ctor_or_dtor): New function. 12144 (Icf::find_identical_sections): Check if function is ctor or dtor when 12145 safe icf is chosen. 12146 * options.h (General_options::icf): Change option to be an enum. 12147 (Icf_status): New enum. 12148 (icf_enabled): New method. 12149 (icf_safe_folding): New method. 12150 (set_icf_status): New method. 12151 (icf_status_): New variable. 12152 * (options.cc) (General_options::finalize): Set icf_status_. 12153 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify 12154 icf_test and icf_keep_unique_test to use the --icf enum flag. 12155 * testsuite/icf_safe_test.sh: New file. 12156 * testsuite/icf_safe_test.cc: New file. 12157 12158 2009-10-12 Sriraman Tallam <tmsriram (a] google.com> 12159 12160 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove 12161 includes to gc.h and icf.h. 12162 * arm.cc: Include gc.h. 12163 * gold.cc: Likewise. 12164 * i386.cc: Likewise. 12165 * powerpc.cc: Likewise. 12166 * sparc.cc: Likewise. 12167 * x86_64.cc: Likewise. 12168 * gc.h: Include icf.h. 12169 12170 2009-10-11 Ian Lance Taylor <iant (a] google.com> 12171 12172 * plugin.cc: Include "gold.h" before other header files. 12173 12174 2009-10-10 Chris Demetriou <cgd (a] google.com> 12175 12176 * options.h (Input_file_argument::Input_file_type): New enum. 12177 (Input_file_argument::is_lib_): Replace with... 12178 (Input_file_argument::type_): New member. 12179 (Input_file_argument::Input_file_argument): Take Input_file_type 12180 'type' rather than boolean 'is_lib' as second argument. 12181 (Input_file_argument::is_lib): Use type_. 12182 (Input_file_argument::is_searched_file): New function. 12183 (Input_file_argument::may_need_search): Handle is_searched_file. 12184 * options.cc (General_options::parse_library): Support -l:filename. 12185 (General_options::parse_just_symbols): Update for Input_file_argument 12186 changes. 12187 (Command_line::process): Likewise. 12188 * archive.cc (Archive::get_file_and_offset): Likewise. 12189 * plugin.cc (Plugin_manager::release_input_file): Likewise. 12190 * script.cc (read_script_file, script_add_file): Likewise. 12191 * fileread.cc (Input_file::Input_file): Likewise. 12192 (Input_file::will_search_for): Handle is_searched_file. 12193 (Input_file::open): Likewise. 12194 * readsyms.cc (Read_symbols::get_name): Likewise. 12195 * testsuite/Makefile.am (searched_file_test): New test. 12196 * testsuite/Makefile.in: Regenerate. 12197 * testsuite/searched_file_test.cc: New file. 12198 * testsuite/searched_file_test_lib.cc: New file. 12199 12200 2009-10-09 Andrew Pinski <andrew_pinski (a] playstation.sony.com> 12201 Ian Lance Taylor <iant (a] google.com> 12202 12203 * descriptor.cc: Include <cstdio> and "binary-io.h". 12204 (Descriptors::open): Open the files in binary mode always. 12205 * script.cc (Lex::get_token): Treat \r as whitespace. 12206 12207 2009-10-09 Ian Lance Taylor <iant (a] google.com> 12208 12209 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0. 12210 12211 2009-10-09 Andrew Pinski <andrew_pinski (a] playstation.sony.com> 12212 Ian Lance Taylor <iant (a] google.com> 12213 12214 * configure.ac: Check for readv function also. 12215 * fileread.cc (readv): Define if not HAVE_READV. 12216 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv 12217 does not exist. 12218 * config.in: Regenerate. 12219 * configure: Regenerate. 12220 12221 2009-10-09 Doug Kwan <dougkwan (a] google.com> 12222 12223 * layout.cc (Layout::make_output_section): Call target hook to make 12224 ordinary output section. 12225 (Layout::finalize): Adjust parameter list of call the 12226 Target::may_relax(). 12227 * layout.h (class Layout::section_list): New method. 12228 * merge.h (Output_merge_base::entsize): Change visibility to public. 12229 (Output_merge_base::is_string, Output_merge_base::do_is_string): 12230 New methods. 12231 (Output_merge_string::do_is_string): New method. 12232 * object.cc (Sized_relobj::do_setup): renamed from 12233 Sized_relobj::set_up. 12234 * object.h (Sized_relobj::adjust_shndx, 12235 Sized_relobj::initializ_input_to_output_maps, 12236 Sized_relobj::free_input_to_output_maps): Change visibilities to 12237 protected. 12238 (Sized_relobj::setup): Virtualize. 12239 (Sized_relobj::do_setup): New method declaration. 12240 (Sized_relobj::invalidate_section_offset, 12241 Sized_relobj::do_invalidate_section_offset): New method decfinitions. 12242 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods. 12243 * options.cc (parse_int): New function. 12244 * options.h (parse_int): New declaration. 12245 (DEFINE_int): New macro. 12246 (stub_group_size): New option. 12247 * output.cc (Output_section::Output_section): Initialize memebers 12248 merge_section_map_, merge_section_by_properties_map_, 12249 relaxed_input_section_map_, is_relaxed_input_section_map_valid_. 12250 (Output_section::add_input_section): Handled deferred code-fill 12251 generation and remove an old comment. 12252 (Output_section::add_relaxed_input_section): New method definition. 12253 (Output_section::add_merge_input_section): Use merge section by 12254 properties map to speed to search. Update merge section maps 12255 as appropriate. 12256 (Output_section::build_relaxation_map): New method definition. 12257 (Output_section::convert_input_sections_in_list_to_relaxed_sections): 12258 Same. 12259 (Output_section::relax_input_section): Renamed to 12260 Output_section::convert_input_sections_to_relaxed_sections and change 12261 interface to take a vector of pointers to relaxed sections. 12262 (Output_section::find_merge_section, 12263 Output_section::find_relaxed_input_section): New method definitions. 12264 (Output_section::is_input_address_mapped, 12265 Output_section::output_offset, Output_section::output_address): 12266 Use output section data maps to speed up searching. 12267 (Output_section::find_starting_output_address): Add comments. 12268 (Output_section::do_write, 12269 Output_section::write_to_postprocessing_buffer): Do code-fill 12270 generation as appropriate. 12271 (Output_section::get_input_sections): Invalidate relaxed input section 12272 map. 12273 (Output_section::restore_states): Adjust type of checkpoint . 12274 Invalidate relaxed input section map. 12275 * output.h (Output_merge_base): New class declaration. 12276 (Input_section_specifier): New class defintion. 12277 (class Output_relaxed_input_section) Change base class to 12278 Output_section_data_build. 12279 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust 12280 base class initializer. 12281 (Output_section::add_relaxed_input_section): New method declaration. 12282 (Output_section::Input_section): Change visibility to protected. 12283 (Output_section::Input_section::relobj, 12284 Output_section::Input_section::shndx): Handle relaxed input sections. 12285 Output_section::input_sections) Change visibility to protected. Also 12286 define overload to return a non-const pointer. 12287 (Output_section::Merge_section_properties): New class defintion. 12288 (Output_section::Merge_section_by_properties_map, 12289 Output_section::Output_section_data_by_input_section_map, 12290 Output_section::Relaxation_map): New types. 12291 (Output_section::relax_input_section): Rename method to 12292 Output_section::convert_input_sections_to_relaxed_sections and change 12293 interface to take a vector of relaxed section pointers. 12294 (Output_section::find_merge_section, 12295 Output_section::find_relaxed_input_section, 12296 Output_section::build_relaxation_map, 12297 Output_section::convert_input_sections_in_list_to_relaxed_sections): 12298 New method declarations. 12299 (Output_section::merge_section_map_ 12300 Output_section::merge_section_by_properties_map_, 12301 Output_section::relaxed_input_section_map_, 12302 Output_section::is_relaxed_input_section_map_valid_, 12303 Output_section::generate_code_fills_at_write_): New data members. 12304 * script-sections.cc 12305 (Output_section_element_input::set_section_addresses): Call 12306 current_data_size and addralign methods of relaxed input sections. 12307 (Orphan_output_section::set_section_addresses): Call current_data_size 12308 and addralign methods of relaxed input sections. 12309 * symtab.cc (Symbol_table::compute_final_value): Extract template 12310 from the body of Symbol_table::sized_finalize_symbol. 12311 (Symbol_table::sized_finalized_symbol): Call 12312 Symbol_table::compute_final_value. 12313 * symtab.h (Symbol_table::Compute_final_value_status): New enum type. 12314 (Symbol_table::compute_final_value): New templated method declaration. 12315 * target.cc (Target::do_make_output_section): New method defintion. 12316 * target.h (Target::make_output_section): New method declaration. 12317 (Target::relax): Add more parameters for input objects, symbol table 12318 and layout. Adjust call to do_relax. 12319 (Target::do_make_output_section): New method declaration. 12320 (Target::do_relax): Add parameters for input objects, symbol table 12321 and layout. 12322 12323 2009-10-09 Andrew Pinski <andrew_pinski (a] playstation.sony.com> 12324 12325 * pread.c: Include stdio.h. 12326 12327 2009-10-09 Andrew Pinski <andrew_pinski (a] playstation.sony.com> 12328 12329 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not 12330 defined. 12331 12332 2009-10-09 Andrew Pinski <andrew_pinski (a] playstation.sony.com> 12333 12334 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info): 12335 Change read_shndx type to unsigned int. 12336 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned 12337 int. 12338 (Sized_dwarf_line_info::read_line_mappings): Likewise. 12339 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info): 12340 Change read_shndx type to unsigned int. 12341 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned 12342 int. 12343 (Sized_dwarf_line_info::read_line_mappings): Likewise. 12344 * layout.cc (Layout::create_symtab_sections): Cast the result of 12345 local_symcount * symsize to off_t in the gold_assert. 12346 12347 2009-10-09 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 12348 12349 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for 12350 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16, 12351 R_ARM_BASE_ABS. 12352 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter. 12353 (Arm_relocate_functions::thm_abs5): New function. 12354 (Arm_relocate_functions::abs12): New function. 12355 (Arm_relocate_functions::abs16): New function. 12356 (Arm_relocate_functions::base_abs): New function. 12357 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI. 12358 (Scan::local): Remove special handling of R_ARM_ABS8. Handle 12359 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and 12360 R_ARM_BASE_ABS. 12361 (Scan::global): Likewise. 12362 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16, 12363 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS. 12364 (Relocatable_size_for_reloc::get_size_for_reloc): Handle 12365 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and 12366 R_ARM_BASE_ABS. 12367 12368 2009-10-09 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 12369 12370 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function. 12371 (Arm_relocate_functions::movt_prel): New function. 12372 (Arm_relocate_functions::thm_movw_prel_nc): New function. 12373 (Arm_relocate_functions::thm_movt_prel): New function. 12374 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL, 12375 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL. 12376 (Scan::global, Relocate::relocate): Likewise. 12377 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise. 12378 12379 2009-10-09 Mikolaj Zalewski <mikolajz (a] google.com> 12380 12381 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to 12382 Incremental_checker. 12383 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to 12384 unsigned int. 12385 (class Incremental_inputs_header): New class. 12386 (Incremental_inputs_header_writer): Edit comment. 12387 (Incremental_inputs_entry): New class. 12388 (Incremental_inputs_entry_writer): Edit comment. 12389 (Sized_incremental_binary::do_find_incremental_inputs_section): 12390 Add *strtab_shndx parameter, fill it. 12391 (Sized_incremental_binary::do_check_inputs): New method. 12392 (Incremental_checker::can_incrementally_link_output_file): Use 12393 Sized_incremental_binary::check_inputs. 12394 (Incremental_inputs::report_command_line): Save command line in 12395 command_line_. 12396 * incremental.h: 12397 (Incremental_binary::find_incremental_inputs_section): New 12398 method. 12399 (Incremental_binary::do_find_incremental_inputs_section): Add 12400 strtab_shndx parameter. 12401 (Incremental_binary::do_check_inputs): New pure virtual method. 12402 (Sized_incremental_binary::do_check_inputs): Declare. 12403 (Incremental_checker::Incremental_checker): Add incremental_inputs 12404 parameter, use it to initialize incremental_inputs_. 12405 (Incremental_checker::incremental_inputs_): New field. 12406 (Incremental_checker::command_line): New method. 12407 (Incremental_checker::inputs): New method. 12408 (Incremental_checker::command_line_): New field. 12409 12410 2009-10-09 Mikolaj Zalewski <mikolajz (a] google.com> 12411 12412 * incremental.cc: Include <cstdarg> and "target-select.h". 12413 (vexplain_no_incremental): New function. 12414 (explain_no_incremental): New function. 12415 (Incremental_binary::error): New method. 12416 (Sized_incremental_binary::do_find_incremental_inputs_section): New 12417 method. 12418 (make_sized_incremental_binary): New function. 12419 (open_incremental_binary): New function. 12420 (can_incrementally_link_file): Add checks if output is ELF and has 12421 inputs section. 12422 * incremental.h: Include "elfcpp_file.h" and "output.h". 12423 (Incremental_binary): New class. 12424 (Sized_incremental_binary): New class. 12425 (open_incremental_binary): Declare. 12426 * object.cc (is_elf_object): Use 12427 elfcpp::Elf_recognizer::is_elf_file. 12428 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header. 12429 * output.h (Output_file::filesize): New method. 12430 12431 2009-10-07 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 12432 12433 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend): 12434 New function. 12435 (Arm_relocate_functions::insert_val_arm_movw_movt): New function. 12436 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New 12437 function. 12438 (Arm_relocate_functions::insert_val_thumb_movw_movt): New 12439 function. 12440 (Arm_relocate_functions::movw_abs_nc): New function. 12441 (Arm_relocate_functions::movt_abs): New function. 12442 (Arm_relocate_functions::thm_movw_abs_nc): New function. 12443 (Arm_relocate_functions::thm_movt_abs): New function. 12444 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS, 12445 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS. 12446 (Scan::global): Likewise. 12447 (Relocate::relocate): Likewise. 12448 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise. 12449 12450 2009-10-07 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 12451 12452 * arm.cc (Arm_relocate_functions::got_prel) New function. 12453 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL. 12454 (Relocate::relocate): Likewise. 12455 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise. 12456 12457 2009-10-06 Ian Lance Taylor <iant (a] google.com> 12458 12459 * options.h (class General_options): Define 12460 split_stack_adjust_size parameter. 12461 * object.h (class Object): Add uses_split_stack_ and 12462 has_no_split_stack_ fields. Add uses_split_stack and 12463 has_no_split_stack accessor functions. Declare 12464 handle_split_stack_section. 12465 (class Reloc_symbol_changes): Define. 12466 (class Sized_relobj): Define Function_offsets. Declare 12467 split_stack_adjust, split_stack_adjust_reltype, and 12468 find_functions. 12469 * object.cc (Object::handle_split_stack_section): New function. 12470 (Sized_relobj::do_layout): Call handle_split_stack_section. 12471 * dynobj.cc (Sized_dynobj::do_layout): Call 12472 handle_split_stack_section. 12473 * reloc.cc (Sized_relobj::relocate_sections): Call 12474 split_stack_adjust for executable sections in split_stack 12475 objects. Pass reloc_map to relocate_section. 12476 (Sized_relobj::split_stack_adjust): New function. 12477 (Sized_relobj::split_stack_adjust_reltype): New function. 12478 (Sized_relobj::find_functions): New function. 12479 * target-reloc.h: Include "object.h". 12480 (relocate_section): Add reloc_symbol_changes parameter. Change 12481 all callers. 12482 * target.h (class Target): Add calls_non_split method. Declare 12483 do_calls_non_split virtual method. Declare match_view and 12484 set_view_to_nop. 12485 * target.cc: Include "elfcpp.h". 12486 (Target::do_calls_non_split): New function. 12487 (Target::match_view): New function. 12488 (Target::set_view_to_nop): New function. 12489 * gold.cc (queue_middle_tasks): Give an error if mixing 12490 split-stack and non-split-stack objects with -r. 12491 * i386.cc (Target_i386::relocate_section): Add 12492 reloc_symbol_changes parameter. 12493 (Target_i386::do_calls_non_split): New function. 12494 * x86_64.cc (Target_x86_64::relocate_section): Add 12495 reloc_symbol_changes parameter. 12496 (Target_x86_64::do_calls_non_split): New function. 12497 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes 12498 parameter. 12499 * powerpc.cc (Target_powerpc::relocate_section): Add 12500 reloc_symbol_changes parameter. 12501 * sparc.cc (Target_sparc::relocate_section): Add 12502 reloc_symbol_changes parameter. 12503 * configure.ac: Call AM_CONDITIONAL for the default target. 12504 * configure: Rebuild. 12505 * testsuite/Makefile.am (TEST_AS): New variable. 12506 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh. 12507 (check_DATA): Add split_i386 and split_x86_64 files. 12508 (SPLIT_DEFSYMS): Define. 12509 (split_i386_[1234n].o): New targets. 12510 (split_i386_[124]): New targets. 12511 (split_i386_[1234r].stdout): New targets. 12512 (split_x86_64_[1234n].o): New targets. 12513 (split_x86_64_[124]): New targets. 12514 (split_x86_64_[1234r].stdout): New targets. 12515 (MOSTLYCLEANFILES): Add new executables. 12516 * testsuite/split_i386.sh: New file. 12517 * testsuite/split_x86_64.sh: New file. 12518 * testsuite/split_i386_1.s: New file. 12519 * testsuite/split_i386_2.s: New file. 12520 * testsuite/split_i386_3.s: New file. 12521 * testsuite/split_i386_4.s: New file. 12522 * testsuite/split_i386_n.s: New file. 12523 * testsuite/split_x86_64_1.s: New file. 12524 * testsuite/split_x86_64_2.s: New file. 12525 * testsuite/split_x86_64_3.s: New file. 12526 * testsuite/split_x86_64_4.s: New file. 12527 * testsuite/split_x86_64_n.s: New file. 12528 * testsuite/testfile.cc (Target_test): Update relocation_section 12529 function. 12530 * testsuite/Makefile.in: Rebuild. 12531 12532 2009-10-06 Ian Lance Taylor <iant (a] google.com> 12533 12534 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field. 12535 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before 12536 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When 12537 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push 12538 the address on ldo_addrs_. 12539 (Target_i386::Relocate::fix_up_ldo): New function. 12540 12541 2009-10-06 Rafael Espindola <espindola (a] google.com> 12542 12543 * plugin.cc (add_input_library): New. 12544 (Plugin::load): Add add_input_library to tv. 12545 (Plugin_manager::add_input_file): Add the is_lib argument. 12546 (add_input_file): Update call to Plugin_manager::add_input_file. 12547 (add_input_library): New. 12548 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument. 12549 12550 2009-09-30 Doug Kwan <dougkwan (a] google.com> 12551 12552 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function 12553 symbol and call Symbol::may_need_copy_reloc to determine if 12554 a copy reloc is needed. 12555 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z 12556 nocopyreloc is given in command line. 12557 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not 12558 given in command line. 12559 * i386.cc (Target_i386::may_need_copy_reloc): Remove. 12560 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead 12561 of the removed Target_i386::may_need_copy_reloc. 12562 * options.h (copyreloc): New option with default value false. 12563 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove. 12564 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc 12565 instead of the removed Target_powerpc::may_need_copy_reloc. 12566 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove. 12567 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc 12568 instead of the removed Target_sparc::may_need_copy_reloc. 12569 * symtab.h (Symbol::may_need_copy_reloc): New method definition. 12570 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove. 12571 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc 12572 instead of the removed Target_x86_64::may_need_copy_reloc. 12573 12574 2009-09-30 Ian Lance Taylor <iant (a] google.com> 12575 12576 * object.h (class Object): Remove target_ field, and target, 12577 sized_target, and set_target methods. 12578 (Object::sized_target): Remove. 12579 (class Sized_relobj): Update declarations. Remove sized_target. 12580 * object.cc (Sized_relobj::setup): Remove target parameter. 12581 Change all callers. 12582 (Input_objects::add_object): Don't do anything with the target. 12583 (make_elf_sized_object): Add punconfigured parameter. Change all 12584 callers. Set or test parameter target. 12585 * dynobj.cc (Sized_dynobj::target): Remove target parameter. 12586 Change all callers. 12587 * parameters.cc (Parameters::set_target): Change parameter type to 12588 be non-const. 12589 (Parameters::default_target): Remove. 12590 (set_parameters_target): Change parameter type to be non-const. 12591 (parameters_force_valid_target): New function. 12592 (parameters_clear_target): New function. 12593 * parameters.h (class Parameters): Update declarations. Remove 12594 default_target method. Add sized_target and clear_target 12595 methods. Change target_ to be non-const. 12596 (set_parameters_target): Update declaration. 12597 (parameters_force_valid_target): Declare. 12598 (parameters_clear_target): Declare. 12599 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured 12600 as NULL if we aren't searching. 12601 (Add_symbols::run): Don't check for compatible target. 12602 * fileread.cc (Input_file::open_binary): Call 12603 parameters_force_valid_target. 12604 * gold.cc (queue_middle_tasks): Likewise. 12605 * plugin.cc (make_sized_plugin_object): Likewise. Don't call 12606 set_target on object. 12607 * dynobj.h (class Sized_dynobj): Update declarations. 12608 * archive.cc (Archive::get_elf_object_for_member): Return NULL if 12609 make_elf_object returns NULL. 12610 (Archive::include_member): Don't check whether object target is 12611 compatible. 12612 * output.cc (Output_section::add_input_section): Get target from 12613 parameters. 12614 (Output_section::relax_input_section): Likewise. 12615 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from 12616 parameters. 12617 (Sized_relobj::do_scan_relocs): Likewise. 12618 (Sized_relobj::relocate_sections): Likewise. 12619 * resolve.cc (Symbol_table::resolve): Likewise. 12620 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object 12621 parameter. Change all callers. 12622 (Symbol_table::add_from_object): Get target from parameters. 12623 (Symbol_table::add_from_relobj): Don't check object target. 12624 (Symbol_table::add_from_dynobj): Likewise. 12625 (Symbol_table::define_special_symbol): Get target from 12626 parameters. 12627 * symtab.h (class Symbol_table): Update declaration. 12628 * testsuite/binary_unittest.cc (gold_testsuite): Remove target 12629 parameter. Change all callers. Clear parameter target. 12630 (Binary_test): Test target here. 12631 * testsuite/object_unittest.cc (gold_testsuite): Remove 12632 target_test_pointer parameter. Change all callers. 12633 (Object_test): Test target here. 12634 12635 2009-09-26 Ian Lance Taylor <iant (a] google.com> 12636 12637 * testsuite/initpri1.c: Don't try to use constructor priorities if 12638 compiling with gcc before 4.3. 12639 12640 2009-09-22 Mikolaj Zalewski <mikolajz (a] google.com> 12641 12642 * testsuite/retain_symbols_file_test.sh (check_present): Change 12643 output file name to retain_symbols_file_test.stdout. 12644 (check_absent): Likewise. 12645 12646 2009-09-18 Craig Silverstein <csilvers (a] google.com> 12647 12648 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map. 12649 * options.cc: Include <cerrno> and <fstream>. 12650 (General_options::finalize): Parse -retain-symbols-file tag. 12651 * options.h: New flag. 12652 (General_options): New method should_retain_symbol, new 12653 variable symbols_to_retain. 12654 * symtab.cc (Symbol_table::sized_finalize_symbol): Test 12655 should_retain_symbol map. 12656 * testsuite/Makefile.am (retain_symbols_file_test): New test. 12657 * testsuite/Makefile.in: Regenerate. 12658 * testsuite/retain_symbols_file_test.sh: New file. 12659 12660 2009-09-18 Nick Clifton <nickc (a] redhat.com> 12661 12662 * po/es.po: Updated Spanish translation. 12663 12664 2009-09-17 Doug Kwan <dougkwan (a] google.com> 12665 12666 * debug.h (DEBUG_RELAXATION): New constant. 12667 (DEBUG_ALL): Add DEBUG_RELAXATION. 12668 (debug_string_to_enum): Add relaxation debug option. 12669 * layout.cc 12670 (Layout::Relaxation_debug_check::check_output_data_for_reset_values, 12671 Layout::Relaxation_debug_check::read_sections, 12672 Layout::Relaxation_debug_check::read_sections): New method definitions. 12673 (Layout::Layout): Initialize data members 12674 record_output_section_data_from_scrips_, 12675 script_output_section_data_list_ and relaxation_debug_check_. 12676 (Layout::save_segments, Layout::restore_segments, 12677 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation, 12678 Layout::relaxation_loop_body): New method definitions. 12679 (Layout::finalize): Support relaxation. Move section layout code to 12680 Layout::relaxation_loop_body. 12681 (Layout::set_asection_address_from_script): Move code for orphan 12682 section placement out. 12683 (Layout::place_orphan_sections_in_script): New method definition. 12684 * layout.h (Output_segment_headers, Output_file_header): 12685 New forward class declarations. 12686 (Layout::~Layout): Define. 12687 (Layout::new_output_section_data_from_script): New method definition. 12688 (Layout::place_orphan_sections_in_script): New method declaration. 12689 (Layout::Segment_states): New type declaration. 12690 (Layout::save_segments, Layout::restore_segments, 12691 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation, 12692 Layout::relaxation_loop_body): New method declarations. 12693 (Layout::Output_section_data_list): New type declaration. 12694 (Layout::Relaxation_debug_check): New class definition. 12695 (Layout::record_output_section_data_from_script_, 12696 Layout::script_output_section_data_list_, Layout::segment_states_, 12697 Layout::relaxation_debug_check_): New data members. 12698 * output.cc: (Output_section_headers::do_size): New method definition. 12699 (Output_section_headers::Output_section_headers): Move size 12700 computation to Output_section_headers::do_size. 12701 (Output_segment_headers::do_size): New method definition. 12702 (Output_file_header::Output_file_header): Move size computation to 12703 Output_file_header::do_size and call it. 12704 (Output_file_header::do_size): New method definition. 12705 (Output_data_group::Output_data_group): Adjust call to 12706 Output_section_data. 12707 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once. 12708 (Output_symtab_xindex::do_write): Add array bound check. 12709 (Output_section::Input_section::print_to_mapfile): Handle 12710 RELAXED_INPUT_SECTION_CODE. 12711 (Output_section::Output_section): Initialize data member checkpoint_. 12712 (Output_section::~Output_section): Delete checkpoint object pointed 12713 by checkpoint_. 12714 (Output_section::add_input_section): Always add an Input_section if 12715 relaxing. 12716 (Output_section::add_merge_input_section): Add assert. 12717 (Output_section::relax_input_section): New method definition. 12718 (Output_section::set_final_data_size): Set load address to zero for 12719 an unallocated section. 12720 (Output_section::do_address_and_file_offset_have_reset_values): 12721 New method definition. 12722 (Output_section::Input_section_sort_enty::Input_section_sort_enty): 12723 Handle relaxed input section. 12724 (Output_section::sort_attached_input_sections): Checkpoint input 12725 section list lazily. 12726 (Output_section::get_input_sections): Change type of input_sections to 12727 list of Simple_input_section pointers. Checkpoint input section list 12728 lazily. Also handle relaxed input sections. 12729 (Output_section::add_input_section_for_script): Take a reference to 12730 a Simple_input_section object instead of Relobj pointer and section 12731 index as parameter. Handle relaxed input sections. 12732 (Output_section::save_states, Output_section::restore_states): New 12733 method definitions. 12734 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_. 12735 (Output_data::is_data_size_fixed): New method definition. 12736 (Output_data::reset_addresss_and_file_offset): Do not reset data size 12737 if it is fixed. 12738 (Output_data::address_and_file_offset_have_reset_values): New method 12739 definition. 12740 (Output_data::do_address_and_file_offset_have_reset_values): New method 12741 definition. 12742 (Output_data::set_data_size): Check that data size is not fixed. 12743 (Output_data::fix_data_size): New method definition. 12744 (Output_data::is_data_size_fixed_): New data member. 12745 (Output_section_headers::set_final_data_size): New method definition. 12746 (Output_section_headers::do_size): New method declaration. 12747 (Output_segment_headers::set_final_data_size): New method definition. 12748 (Output_segment_headers::do_size): New method declaration. 12749 (Output_file_header::set_final_data_size)::New method definition. 12750 (Output_file_header::do_size)::New method declaration. 12751 (Output_section_data::Output_section_data): Add new parameter 12752 is_data_size_fixed and use it to fix data size. 12753 (Output_data_const::Output_data_const): Adjust call to base class 12754 constructor and fix data size. 12755 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to 12756 base class constructor and fix data size. 12757 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to 12758 base class constructor and fix data size. 12759 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base 12760 class constructor and fix data size. 12761 (Output_data_group::set_final_data_size): New method definition. 12762 (Output_data_dynamic::Dynamic_entry::tag): New method definition. 12763 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base 12764 class constructor and fix data size. 12765 (Output_relaxed_input_section): New class definition. 12766 (Output_section::Simple_input_section): New class definition. 12767 (Output_section::get_input_sections): Adjust parameter list. 12768 (Output_section::add_input_section_for_script): Same. 12769 (Output_section::save_states, Output_section::restore_states, 12770 Output_section::do_address_and_file_offset_have_reset_values, 12771 (Output_section::Input_section::Input_section): Handle 12772 RELAXED_INPUT_SECTION_CODE. Add new overload for 12773 Output_relaxed_input_section. 12774 (Output_section::Input_section::is_input_section, 12775 Output_section::Input_section::set_output_section): Handle relaxed 12776 input section. 12777 (Output_section::Input_section::is_relaxed_input_section, 12778 Output_section::Input_section::output_section_data, 12779 Output_section::Input_section::relaxed_input_section): New method 12780 definitions. 12781 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum 12782 value. 12783 (Output_section::Input_section::u1_): Update comments. 12784 (Output_section::Input_section::u2_): Add new union member poris. 12785 (Output_section::Checkpoint_output_section): New classs definition. 12786 (Output_section::relax_input_section): New method declaration. 12787 (Output_section::checkpoint_): New data member. 12788 (Output_segment): Update comments. 12789 (Output_segment::Output_segment): Un-privatize copy constructor. 12790 (Output_segment::operator=): Un-privatize. 12791 * script-sections.cc (Output_section_element::Input_section_list): 12792 Change element type to Output_section::Simple_input_section. 12793 (Output_section_element_dot_assignment::set_section_addresses): 12794 Register output section data for relaxation clean up. 12795 (Output_data_exression::Output_data_expression): Adjust call to base 12796 constructor to fix data size. 12797 (Output_section_element_data::set_section_addresses): Register 12798 Output_data_expression object for relaxation clean up. 12799 (struct Input_section_info): Replace Relobj pointer and section index 12800 pair with Output_section::Simple_input_section and Convert struct to a 12801 class. 12802 (Input_section_sorter::operator()): Adjust access to 12803 Input_section_info data member to use accessors. 12804 (Output_section_element_input::set_section_addresses): Use layout 12805 parameter. Adjust code to use Output_section::Simple_input_section 12806 and Input_secction_info classes. Register filler for relaxation 12807 clean up. 12808 (Orphan_output_section::set_section_addresses): Replace Relobj pointer 12809 and section index pair with Output_section::Simple_input_section 12810 class. Adjust code accordingly. 12811 (Phdrs_element::release_segment): New method definition. 12812 (Script_sections::attach_sections_using_phdrs_clause): Do not modify 12813 segment list. 12814 (Script_sections::release_segments): New method definition. 12815 * gold/script-sections.h (Script_sections::release_segments): New 12816 method declaration. 12817 * gold/target.h (Target::may_relax, Target::relax, 12818 Target::do_may_relax, Target::do_relax): New method definitions. 12819 12820 2009-09-17 Viktor Kutuzov <vkutuzov (a] accesssoftek.com> 12821 12822 * arm.cc (has_signed_unsigned_overflow): New function. 12823 (Arm_relocate_functions::abs8): New function. 12824 (Target_arm::Scan::local): Handle R_ARM_ABS8. 12825 (Target_arm::Scan::global): Likewise. 12826 (Target_arm::relocate::relocate): Likewise. 12827 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): 12828 Likewise. 12829 12830 2009-09-16 Cary Coutant <ccoutant (a] google.com> 12831 12832 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files. 12833 * testsuite/Makefile.in: Regenerate. 12834 12835 2009-09-11 Nick Clifton <nickc (a] redhat.com> 12836 12837 * po/gold.pot: Updated by the Translation project. 12838 12839 2009-09-08 Cary Coutant <ccoutant (a] google.com> 12840 12841 * output.cc (Output_file::open): Add execute permission to empty file. 12842 * testsuite/Makefile.am (permission_test): New test. 12843 * testsuite/Makefile.in: Regenerate. 12844 12845 2009-09-02 Ian Lance Taylor <iant (a] google.com> 12846 12847 * output.cc (Output_file::resize): Call map_no_anonymous rather 12848 than map. 12849 12850 2009-09-01 Mikolaj Zalewski <mikolajz (a] google.com> 12851 12852 * gold.cc: Include "incremental.h". 12853 (queue_initial_tasks): Call Incremental_checker methods. 12854 * incremental.cc: Include "output.h". 12855 (Incremental_checker::can_incrementally_link_output_file): New 12856 method. 12857 * incremental.h (Incremental_checker): New class. 12858 12859 * output.cc (Output_file::open_for_modification): New method. 12860 (Output_file::map_anonymous): Changed return type to bool. Record 12861 map in base_ field. 12862 (Output_file::map_no_anonymous): New method, broken out of map. 12863 (Output_file::map): Use map_no_anonymous and map_anonymous. 12864 * output.h (class Output_file): Update declarations. 12865 12866 2009-08-24 Cary Coutant <ccoutant (a] google.com> 12867 12868 * options.h (Command_line::Pre_options): New class. 12869 (Command_line::pre_options): New member. 12870 * options.cc (gold::options::ready_to_register): New variable. 12871 (One_option::register_option): Do nothing if not registering options. 12872 Assert if same short option registered twice. 12873 (General_options::General_options): Turn off option registration when 12874 done constructing. 12875 (Command_line::Pre_options::Pre_options): New constructor. 12876 12877 2009-08-24 Cary Coutant <ccoutant (a] google.com> 12878 12879 * options.h (General_options::no_keep_memory): Remove incorrect 12880 short option. 12881 12882 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues (a] gmx.de> 12883 12884 * Makefile.am (am__skiplex, am__skipyacc): New. 12885 * Makefile.in: Regenerate. 12886 12887 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues (a] gmx.de> 12888 12889 * Makefile.am (AM_CPPFLAGS): Renamed from ... 12890 (INCLUDES): ... this. 12891 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability. 12892 (AM_CPPFLAGS): Renamed from ... 12893 (INCLUDE): ... this. 12894 * Makefile.in, testsuite/Makefile.in: Regenerate. 12895 12896 * Makefile.in: Regenerate. 12897 * aclocal.m4: Likewise. 12898 * config.in: Likewise. 12899 * configure: Likewise. 12900 * testsuite/Makefile.in: Likewise. 12901 12902 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign. 12903 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign. 12904 * Makefile.in: Regenerate. 12905 * testsuite/Makefile.in: Regenerate. 12906 12907 2009-08-19 Cary Coutant <ccoutant (a] google.com> 12908 12909 * resolve.cc (Symbol_table::resolve): Don't complain about defined 12910 symbols in shared libraries overridden by hidden or internal symbols 12911 in the main program. 12912 12913 2009-08-19 Chris Demetriou <cgd (a] google.com> 12914 12915 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when 12916 checking source file names in error messages. 12917 12918 2009-08-18 Doug Kwan <dougkwan (a] google.com> 12919 12920 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of 12921 an elcpp::Ehdr as parameter. Adjust call to set_target. 12922 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of 12923 an elfcpp::Ehdr as parameter. 12924 * object.cc (Object::set_target): Remove the version that looks up 12925 a target and sets it. 12926 (Sized_relobj::setup): Take a Target object instead of 12927 an elfcpp::Ehdr as parameter. Adjust call to set_target. 12928 (make_elf_sized_object): Find target and ask target to 12929 make an ELF object. 12930 * object.h: (Object::set_target): Remove the version that looks up 12931 a target and sets it. 12932 (Sized_relobj::setup): Take a Target object instead of 12933 an elfcpp:Ehdr as parameter. 12934 * target.cc: Include dynobj.h. 12935 (Target::do_make_elf_object_implementation): New. 12936 (Target::do_make_elf_object): New. 12937 * target.h (Target::make_elf_object): New template declaration. 12938 (Target::do_make_elf_object): New method declarations. 12939 (Target::do_make_elf_object_implementation): New template declaration. 12940 12941 2009-08-14 Ian Lance Taylor <iant (a] google.com> 12942 12943 * gold.h (FUNCTION_NAME): Define. 12944 (gold_unreachable): Use FUNCTION_NAME. 12945 12946 2009-08-12 Sriraman Tallam <tmsriram (a] google.com> 12947 12948 * icf.cc (Icf::find_identical_sections): Issue a warning when a 12949 symbol in the --keep-unique list is not found. 12950 12951 2009-08-12 Sriraman Tallam <tmsriram (a] google.com> 12952 12953 * icf.cc (Icf::find_identical_sections): Unfold symbols that have 12954 been maked as --keep-unique. 12955 (Icf::unfold_section): New function. 12956 * icf.h (Icf::unfold_section): New function. 12957 * options.h (General_options::keep_unique): New option. 12958 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test. 12959 * testsuite/Makefile.in: Regenerate. 12960 * testsuite/icf_keep_unique_test.sh: New file. 12961 * testsuite/icf_keep_unique_test.cc: New file. 12962 12963 2009-08-12 Cary Coutant <ccoutant (a] google.com> 12964 12965 PR 10471 12966 * resolve.cc (Symbol_table::resolve): Check for references from 12967 dynamic objects to hidden and internal symbols. 12968 * testsuite/Makefile.am (hidden_test.sh): New test. 12969 * testsuite/Makefile.in: Regenerate. 12970 * testsuite/hidden_test.sh: New script. 12971 * testsuite/hidden_test_1.c: New test source. 12972 * testsuite/hidden_test_main.c: New test source. 12973 12974 2009-08-11 Doug Kwan <dougkwan (a] google.com> 12975 12976 * arm.cc: Update comments. 12977 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX 12978 segment to locate the .ARM.exidx section if present. 12979 12980 2009-08-09 Doug Kwan <dougkwan (a] google.com> 12981 12982 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous 12983 patch. 12984 12985 2009-08-07 Sriraman Tallam <tmsriram (a] google.com> 12986 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid 12987 compiler warnings. 12988 12989 2009-08-06 Sriraman Tallam <tmsriram (a] google.com> 12990 12991 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a 12992 valid tls_segment only for non-debug-section relocations. 12993 * testsuite/Makefile.am: Add gc_tls_test. 12994 * testsuite/Makefile.in: Regenerate. 12995 * testsuite/gc_tls_test.cc: New file. 12996 * testsuite/gc_tls_test.sh: New file. 12997 12998 2009-08-05 Sriraman Tallam <tmsriram (a] google.com> 12999 13000 * icf.cc: New file. 13001 * icf.h: New file. 13002 * Makefile.am (CCFILES): Add icf.cc. 13003 (HFILES): Add icf.h 13004 * Makefile.in: Regenerate. 13005 * dynobj.h (Sized_dynobj::do_section_entsize): New function. 13006 * gc.h (gc_process_relocs): Populate lists used by icf to contain 13007 section, symbol and addend information for the relocs. 13008 * gold.cc (queue_middle_tasks): Call identical code folding. 13009 * gold.h: Add defines for multimap. 13010 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter 13011 to the call of finalize_local_symbols. 13012 * main.cc (main): Create object of class Icf. 13013 * object.cc (Sized_relobj::do_layout): Allow this function to be 13014 called twice during icf. 13015 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding 13016 to sections marked as identical by icf. 13017 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data 13018 when available. 13019 (Sized_relobj::do_section_entsize): New function. 13020 * object.h (Object::section_entsize): New function. 13021 (Object::do_section_entsize): New pure virtual function. 13022 (Relobj::finalize_local_symbols): Add new parameter. 13023 (Relobj::do_section_entsize): New function. 13024 * options.h (General_options::icf): New option. 13025 (General_options::icf_iterations): New option. 13026 (General_options::print_icf_sections): New option. 13027 * plugin.cc (Sized_pluginobj::do_section_entsize): New function. 13028 * plugin.h (Sized_pluginobj::do_section_entsize): New function. 13029 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing 13030 icf. 13031 * symtab.cc (Symbol_table::is_section_folded): New function. 13032 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding 13033 to sections marked as identical by icf. 13034 * symtab.h (Symbol_table::set_icf): New function. 13035 (Symbol_table::icf): New function. 13036 (Symbol_table::is_section_folded): New function. 13037 (Symbol_table::icf_): New data member. 13038 * target-reloc.h (relocate_section): Ignore sections folded by icf. 13039 * testsuite/Makefile.am: Add commands to build icf_test. 13040 * testsuite/Makefile.in: Regenerate. 13041 * testsuite/icf_test.sh: New file. 13042 * testsuite/icf_test.cc: New file. 13043 13044 2009-07-24 Chris Demetriou <cgd (a] google.com> 13045 13046 * layout.cc (is_compressible_debug_section): Fix incorrect 13047 comment about compressed section names. 13048 13049 2009-07-20 Ian Lance Taylor <ian (a] airs.com> 13050 13051 PR 10419 13052 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences. 13053 13054 2009-07-16 Ian Lance Taylor <iant (a] google.com> 13055 13056 PR 10400 13057 * layout.h: #include <map>. 13058 (class Kept_section): Change from struct to class. Add accessors 13059 and setters. Add section size to Comdat_group mapping. Change 13060 Comdat_group to std::map. Add is_comdat_ field. Add 13061 linkonce_size field in union. 13062 (class Layout): Update declaration of find_or_add_kept_section. 13063 Don't declare find_kept_object. 13064 * layout.cc (Layout::find_or_add_kept_section): Remove candidate 13065 parameter. Add object, shndx, is_comdat, and is_group_name 13066 parameters. Change all callers. Adjust for new Kept_section. 13067 (Layout::find_kept_object): Remove. 13068 * object.cc (Sized_relobj::include_section_group): Update use of 13069 Kept_section. Rename secnum to shndx. Only record 13070 Kept_comdat_section if sections are the same size. 13071 (Sized_relobj::include_linkonce_section): Update use of 13072 Kept_section. Only record Kept_comdat_section if sections are the 13073 same size. Set size of linkonce section. 13074 (Sized_relobj::map_to_kept_section): Update call to 13075 get_kept_comdat_section. 13076 * object.h (class Sized_relobj): Rename fields in 13077 Kept_comdat_section to drop trailing underscores; change object 13078 field to Relobj*. Change Kept_comdat_section_table to store 13079 struct rather than pointer. 13080 (Sized_relobj::set_kept_comdat_section): Remove kept parameter. 13081 Add kept_object and kept_shndx parameters. Change all callers. 13082 (Sized_relobj::get_kept_comdat_section): Change return type to 13083 bool. Add kept_object and kept_shndx parameters. Change all 13084 callers. 13085 * plugin.cc (Pluginobj::include_comdat_group): Update call to 13086 Layout::find_or_add_kept_section. 13087 13088 2009-07-09 Ian Lance Taylor <iant (a] google.com> 13089 13090 * merge.cc (Object_merge_map::initialize_input_to_output_map): 13091 Reserve space in the hash table. 13092 13093 2009-07-06 Mikolaj Zalewski <mikolajz (a] google.com> 13094 13095 * fileread.cc (File_read::get_mtime): New method. 13096 * fileread.h (Timespec): New structure. 13097 (File_read::get_mtime): New method. 13098 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec): 13099 Renamed from timestamp_nsec. 13100 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to 13101 Elf_Xword. 13102 (Incremental_inputs_entry_write::timestamp_usec): Renamed from 13103 timestamp_nsec. 13104 (Incremental_inputs::report_archive): Save mtime; style fix. 13105 (Incremental_inputs::report_obejct): Save mtime; style fix. 13106 (Incremental_inputs::report_script): Save mtime; style fix. 13107 (Incremental_inputs::finalize_inputs): Style fix. 13108 (Incremental_inputs::finalize): Style fix. 13109 (Incremental_inputs::create_input_section_data): Store inputs 13110 mtime. 13111 * incremental.h (Incremental_inputs::report_script): Add mtime 13112 argument. 13113 (Incremental_inputs::Input_info::Input_info): Intialize only one 13114 union member. 13115 (Incremental_inputs::Input_info::archive): Move to nameless 13116 union. 13117 (Incremental_inputs::Input_info::obejct): Move to nameless union. 13118 (Incremental_inputs::Input_info::script): Move to nameless union. 13119 (Incremental_inputs::mtime): New field. 13120 * script.cc (read_input_script): Pass file mtime to 13121 Incremental_input. 13122 * script.h (Script_info::inputs): Style fix. 13123 13124 2009-07-01 Ian Lance Taylor <ian (a] airs.com> 13125 13126 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size 13127 instead of 32. 13128 13129 2009-06-24 Ian Lance Taylor <iant (a] google.com> 13130 13131 PR 10156 13132 * layout.cc (Layout::choose_output_section): If we find an 13133 existing section, update the flags. 13134 (Layout::create_notes): New function, broken out of 13135 Layout::finalize. 13136 (Layout::finalize): Don't create note sections. 13137 (Layout::create_note): Don't crash if linker script discards 13138 section. 13139 (Layout::create_gold_note): Likewise. 13140 (Layout::create_build_id): Likewise. Don't set 13141 after_input_sections on the section. 13142 (Layout::create_executable_stack_info): Remove target parameter. 13143 Change caller. 13144 * layout.h (class Layout): Declare create_notes. Update 13145 declaration of create_executable_stack_info. 13146 * gold.cc (queue_middle_tasks): Call create_notes. 13147 * output.cc (Output_section::update_flags_for_input_section): Move 13148 here from output.h. If SHF_ALLOC flag is newly set, mark address 13149 invalid. 13150 * output.h (Output_data::mark_address_invalid): New function. 13151 (class Output_section): Only declare, not define, 13152 update_flags_for_input_section. Remove set_flags. 13153 13154 2009-06-24 Ian Lance Taylor <iant (a] google.com> 13155 13156 * script-sections.cc (Output_section_definition:: 13157 set_section_addresses): Rename shadowing local load_address to 13158 laddr. 13159 13160 2009-06-24 Ian Lance Taylor <iant (a] google.com> 13161 13162 PR 10244 13163 * reloc.cc (relocate_sections): Skip empty relocation sections. 13164 13165 2009-06-23 Ian Lance Taylor <iant (a] google.com> 13166 13167 PR 10156 13168 * layout.cc (Layout::create_note): Use choose_output_section 13169 rather than make_output_section. 13170 13171 2009-06-23 Ian Lance Taylor <iant (a] google.com> 13172 13173 PR 10237 13174 * options.cc (General_options::parse_V): Set printed_version_. 13175 (General_options::General_options): Initialize printed_version_. 13176 * options.h (class General_options): Add printed_version_ field. 13177 * gold.cc (queue_initial_tasks): If there are no input files, 13178 don't give a fatal error if we printed the version information. 13179 (queue_middle_tasks): If using -r with a shared object, give a 13180 fatal error rather than an ordinary error. 13181 13182 2009-06-23 Ian Lance Taylor <iant (a] google.com> 13183 13184 PR 10219 13185 * layout.cc (Layout::Layout): Initialize have_stabstr_section_. 13186 (Layout::make_output_section): Set have_stabstr_section_ if we see 13187 a .stab*str section. 13188 (Layout::finalize): Call link_stabs_sections. 13189 (Layout::link_stabs_sections): New file. 13190 * layout.h (class Layout): Add have_stabstr_section_ field. 13191 Declare link_stabs_sections. 13192 13193 2009-06-23 Doug Kwan <dougkwan (a] google.com> 13194 13195 * Makefile.am (libgold_a_LIBADD): New. 13196 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS 13197 * Makefile.in: Regenerate. 13198 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New. 13199 * configure: Regenerate. 13200 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem. 13201 * fileread.cc: Include sys/state.h 13202 * gold.h: Declare memmem and strndup if found missing. 13203 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined. 13204 13205 2009-06-23 Ian Lance Taylor <iant (a] google.com> 13206 13207 * configure.ac: Call AC_CHECK_DECLS using C, not C++. 13208 * configure: Rebuild. 13209 13210 2009-06-23 Ian Lance Taylor <iant (a] google.com> 13211 13212 PR 10147 13213 * object.cc (Object::section_contents): Don't try to get a view if 13214 the section has length zero. 13215 (Object::handle_gnu_warning_section): If the section is empty, use 13216 the name of the section as the warning. 13217 13218 2009-06-23 Ian Lance Taylor <iant (a] google.com> 13219 13220 PR 10133 13221 * stringpool.h (class Stringpool_template): Add optimize_ field. 13222 (Stringpool_template::set_optimize): New function. 13223 * stringpool.cc (Stringpool_template::Stringpool_template): 13224 Initialize optimize_ field. 13225 (Stringpool_template::set_string_offsets): Test local optimize 13226 fild rather than parameter. 13227 * layout.cc (Layout::Layout): Call set_optimize on the section 13228 name stringpool. 13229 13230 2009-06-22 Ian Lance Taylor <iant (a] google.com> 13231 13232 PR 10030 13233 * yyscript.y: Parse TARGET. 13234 * script.cc (script_set_target): New function. 13235 * script-c.h (script_set_target): Declare. 13236 * options.cc (General_options::string_to_object_format): Rename 13237 from string_to_object_format in anonymous namespace. Change 13238 callers. 13239 * options.h (class General_options): Declare 13240 string_to_object_format. 13241 13242 2009-06-22 Ian Lance Taylor <iant (a] google.com> 13243 13244 * script-sections.cc (Script_sections::create_segments): Don't put 13245 program headers in a PT_LOAD segment if -n or -N. 13246 13247 2009-06-22 Ian Lance Taylor <iant (a] google.com> 13248 13249 PR 10141 13250 * options.h (class General_options): Add -z lazy and -z now. Sort 13251 -z options into alphabetical order. 13252 * layout.cc (Layout::finish_dynamic_section): Handle -z now. 13253 13254 2009-06-21 Ian Lance Taylor <iant (a] google.com> 13255 13256 * layout.cc (Layout::make_output_section): Call 13257 Target::new_output_section. 13258 (Layout::attach_allocated_section_to_segment): Put large section 13259 sections in a separate load segment with the large segment flag 13260 set. 13261 (Layout::segment_precedes): Sort large data segments after other 13262 load segments. 13263 (align_file_offset): New static function. 13264 (Layout::set_segment_offsets): Use align_file_offset. 13265 * output.h (class Output_section): Add is_small_section_ and 13266 is_large_section_ fields. 13267 (Output_section::is_small_section): New function. 13268 (Output_section::set_is_small_section): New function. 13269 (Output_section::is_large_section): New function. 13270 (Output_section::set_is_large_section): New function. 13271 (Output_section::is_large_data_section): New function. 13272 (class Output_segment): Add is_large_data_segment_ field. 13273 (Output_segment::is_large_data_segment): New function. 13274 (Output_segment::set_is_large_data_segment): New function. 13275 * output.cc (Output_section::Output_section): Initialize new 13276 fields. 13277 (Output_segment::Output_segment): Likewise. 13278 (Output_segment::add_output_section): Add assertion that large 13279 data sections always go in large data segments. Force small data 13280 sections to the end of the list of data sections. Force small BSS 13281 sections to the start of the list of BSS sections. For large BSS 13282 sections to the end of the list of BSS sections. 13283 * symtab.h (class Symbol): Declare is_common_shndx. 13284 (Symbol::is_defined): Check Symbol::is_common_shndx. 13285 (Symbol::is_common): Likewise. 13286 (class Symbol_table): Define enum Commons_section_type. Update 13287 declarations. Add small_commons_ and large_commons_ fields. 13288 * symtab.cc (Symbol::is_common_shndx): New function. 13289 (Symbol_table::Symbol_table): Initialize new fields. 13290 (Symbol_table::add_from_object): Put small and large common 13291 symbols in the right list. 13292 (Symbol_table::sized_finalized_symbol): Check 13293 Symbol::is_common_shndx. 13294 (Symbol_table::sized_write_globals): Likewise. 13295 * common.cc (Symbol_table::do_allocate_commons): Allocate new 13296 common symbol lists. Don't call do_allocate_commons_list if the 13297 list is empty. 13298 (Symbol_table::do_allocate_commons_list): Remove is_tls 13299 parameter. Add comons_section_type parameter. Change all 13300 callers. Handle small and large common symbols. 13301 * object.cc (Sized_relobj::do_finalize_local_symbols): Check 13302 Symbol::is_common_shndx. 13303 * resolve.cc (symbol_to_bits): Likewise. 13304 * target.h (Target::small_common_shndx): New function. 13305 (Target::small_common_section_flags): New function. 13306 (Target::large_common_shndx): New function. 13307 (Target::large_common_section_flags): New function. 13308 (Target::new_output_section): New function. 13309 (Target::Target_info): Add small_common_shndx, large_common_shndx, 13310 small_common_section_flags, and large_common_section_flags 13311 fields. 13312 (Target::do_new_output_section): New virtual function. 13313 * arm.cc (Target_arm::arm_info): Initialize new fields. 13314 * i386.cc (Target_i386::i386_info): Likewise. 13315 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]: 13316 Likewise. 13317 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise. 13318 * x86_64.cc (Target_x86_64::x86_64_info): Likewise. 13319 (Target_x86_64::do_new_output_section): New function. 13320 * configure.ac: Define conditional MCMODEL_MEDIUM. 13321 * testsuite/Makefile.am (check_PROGRAMS): Add large. 13322 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define. 13323 (large_LDFLAGS): Define. 13324 * testsuite/large.c: New file. 13325 * testsuite/testfile.cc (Target_test::test_target_info): 13326 Initialize new fields. 13327 * configure, testsuite/Makefile.in: Rebuild. 13328 13329 2009-06-05 Doug Kwan <dougkwan (a] google.com> 13330 13331 * Makefile.am (CCFILES): Add target.cc. 13332 * Makefile.in: Regenerate. 13333 * i386.cc (class Target_i386): Define new virtual method to 13334 override do_is_local_label_name in parent. 13335 * object.cc (Sized_relobj::do_count_local_symbols): Discard 13336 local symbols if --discard-locals or -X is given. 13337 * options.h (class General_options): Declare new options 13338 '--discard-locals' and '-X' for discarding locals. 13339 * target.h (class Target): Define new methods is_local_label_name. 13340 Declare new virtual method do_is_local_label_name. 13341 * target.cc: New file. 13342 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test. 13343 (check_SCRIPTS): Add discard_locals_test.sh. 13344 (check_DATA): Add discard_local_tests.syms. 13345 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define. 13346 (discard_local_tests.syms, discard_locals_test.o): New make rules. 13347 * testsuite/Makefile.in: Regenerate. 13348 * testsuite/discard_locals_test.c: New file. 13349 * testsuite/discard_locals_test.sh: Same. 13350 13351 2009-06-05 Doug Kwan <dougkwan (a] google.com> 13352 13353 * object.cc (Sized_relobj::Sized_relobj): Initialize 13354 discarded_eh_frame_shndx_ to -1U. 13355 (Sized_relobj::do_layout): Record index of a discard .eh_frame 13356 section. 13357 (Sized_relobj::do_count_local_symbols): Skip local symbols in 13358 a discarded .eh_frame section. 13359 (Sized_relobj::do_finalize_local_symbols): Ditto. 13360 * object.h (class Sized_relobj): Declare new member 13361 discarded_eh_frame_shndx_. 13362 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test. 13363 (local_labels_test.o, local_labels_test): New rules. 13364 * testsuite/Makefile.in: Regenerate. 13365 13366 2009-06-04 Doug Kwan <dougkwan (a] google.com> 13367 13368 * layout.cc (Layout::section_name_mapping): Add mapping for 13369 special ARM sections. 13370 13371 2009-06-03 Doug Kwan <dougkwan (a] google.com> 13372 13373 * arm.cc (utils::sign_extend): Reverse test in gold_assert. 13374 (utils::has_overflow): Same. 13375 13376 2009-06-03 Ian Lance Taylor <iant (a] google.com> 13377 13378 * layout.cc (Layout::section_name_mapping): New array, replacing 13379 Layout::linkonce_mapping. 13380 (Layout::section_name_mapping_count): New variable, replacing 13381 Layout::linkonce_mapping_count. 13382 (Layout::linkonce_output_name): Remove. 13383 (Layout::output_section_name): Rewrite. 13384 * layout.h (class Layout): Rename Linkonce_mapping to 13385 Section_name_mapping, linkonce_mapping to section_name_mapping, 13386 linkonce_mapping_count to section_name_mapping_count. Don't 13387 declare linkonce_output_name. 13388 13389 2009-06-03 Doug Kwan <dougkwan (a] google.com> 13390 13391 * gold/arm.cc (namespace utils): New. 13392 (Target_arm::reloc_is_non_pic): Define new method. 13393 (class Arm_relocate_functions): New. 13394 (Target_arm::Relocate::relocate): Handle relocation types used by 13395 Android. 13396 13397 2009-06-03 Ian Lance Taylor <iant (a] google.com> 13398 13399 * arm.cc (Target_arm::scan::global): Use || instead of |. 13400 13401 2009-06-02 Doug Kwan <dougkwan (a] google.com> 13402 13403 * gold/arm.cc (Target_arm::Scan::Scan): Initialize 13404 issued_non_pic_error_. 13405 (class Target_arm::Scan): Declare new method check_non_pic. 13406 Define new method symbol_needs_plt_entry. 13407 Declare new data member issued_non_pic_error_. 13408 (class Target_arm::Relocate): Declare new method 13409 should_apply_static_reloc. 13410 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC. 13411 (Target_arm::Scan::check_non_pic): Define new method. 13412 (Target_arm::Scan::local): Handle a small subset of reloc types used 13413 by Android. 13414 (Target_arm::Scan::local): Same. 13415 (Target_arm::Relocate::should_apply_statci_reloc): Define new method. 13416 13417 2009-05-31 Mikolaj Zalewski <mikolajz (a] google.com> 13418 13419 * incremental.cc (Incremental_inputs::report_command_line): Filter 13420 out --incremental-* options. 13421 13422 2009-05-29 Doug Kwan <dougkwan (a] google.com> 13423 13424 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new 13425 template class. 13426 (class Target_arm): Update comment. 13427 (Target_arm::Target_arm): Initialize new data members GOT_, 13428 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_. 13429 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry 13430 and Target_arm::rel_dyn_section. 13431 Declare new_enum Target_arm::Got_type. 13432 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ 13433 and DYNBSS_. 13434 Update commments for member do_dynsym_value. 13435 (Target_arm::got_size, Target_arm::plt_section, 13436 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define 13437 new methods inside class defintion. 13438 (Target_arm::got_section): Define new method. 13439 (Target_arm::rel_dyn_section): Same. 13440 (Output_data_plt_arm): New template class. 13441 (Output_data_plt_arm::Output_data_plt_arm): Define constructor. 13442 (Output_data_plt_arm:do_adjust_output_section): Define new method. 13443 (Output_data_plt_arm::add_entry): Same. 13444 (Output_data_plt_arm::first_plt_entry): Define new 13445 static data member for PLT instruction template. 13446 (Output_data_plt_arm::plt_entry): Same. 13447 (Output_data_plt_arm::do_write): Define new method. 13448 (Target_arm::make_plt_entry): Same. 13449 (Target_arm::do_finalize_sections): Same. 13450 (Target_arm::do_dynsym_value): Same. 13451 13452 2009-05-28 Doug Kwan <dougkwan (a] google.com> 13453 13454 * Makefile.am (TARGETSOURCES): Add arm.cc. 13455 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT) 13456 * Makefile.in: Regenerate. 13457 * arm.cc: New file. 13458 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets. 13459 13460 2009-05-26 Doug Kwan <dougkwan (a] google.com> 13461 13462 * options.cc (General_options::parse_exclude_libs). Fix a comment. 13463 (General_options::check_excluded_libs): Strip off directories in 13464 archive name before matching like GNU ld does. 13465 * testsuite/Makefile.am (MOSTLYCLEANFILES, 13466 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a 13467 (exclude_libs_test_LDFLAGS): Add linker option 13468 -Wl,--exclude-libs,libexclude_libs_test_3 13469 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as 13470 an explicit archive without using -l. 13471 (alt/libexclude_libs_test_3.a): New make rule. 13472 * testsuite/Makefile.in: Regenerate. 13473 * testsuite/exclude_libs_test.c : Declare lib3_default(). 13474 (main): Call it. 13475 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a. 13476 * exclude_libs_test_3.c: New file. 13477 13478 2009-05-26 Nick Clifton <nickc (a] redhat.com> 13479 13480 * po/id.po: New Indonesian translation. 13481 * po/gold.pot: Updated template file. 13482 13483 2009-05-22 Sriraman Tallam <tmsriram (a] google.com> 13484 13485 * testsuite/Makefile.am: Add -ffunction-sections to compile 13486 gc_comdat_test files. Add -Wl,--gc-sections to build 13487 gc_comdat_test. 13488 * testsuite/Makefile.in: Regenerate. 13489 * testsuite/gc_comdat_test.sh: Fix the condition around grep. 13490 13491 2009-05-21 Sriraman Tallam <tmsriram (a] google.com> 13492 13493 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the 13494 kept comdat section was garbage collected. 13495 * testsuite/Makefile.am: Add test gc_comdat_test.sh. 13496 * testsuite/Makefile.in: Regenerate. 13497 * testsuite/gc_comdat_test.sh: New file. 13498 * testsuite/gc_comdat_test_1.cc: New file. 13499 * testsuite/gc_comdat_test_2.cc: New file. 13500 13501 2009-05-19 Doug Kwan <dougkwan (a] google.com> 13502 13503 * archive.cc (Archive::Archive): Move constructor from archive.h 13504 to here. Initialize no_export_. 13505 (Archive::get_elf_object_for_member): Set no_export flag of object. 13506 * archive.h (Archive::Archive): Move constructor body to 13507 archive.cc. 13508 (Archive::no_export): New method. 13509 (Archive::no_export_): New field. 13510 * object.h (Object::Object): Initialize no_export_ to false. 13511 (Object::no_export, Object::set_no_export): New methods. 13512 (Object::no_export_): New field. 13513 * options.cc (General_options::parse_exclude_libs): New method. 13514 (General_options::check_excluded_libs) Same. 13515 * options.h (exclude_libs): New option. 13516 (General_options::check_excluded_libs): New method declaration. 13517 (General_options::excluded_libs_): New field. 13518 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with 13519 default or protected visibility if an object has no-export flag set. 13520 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test. 13521 (check_SCRIPTS): Add exclude_libs_test.sh. 13522 (check_DATA): Add exclude_libs_test.syms. 13523 (MOSTLYCLEANFILES): Add exclude_libs_test.syms, 13524 libexclude_libs_test_1.a and libexclude_libs_test_2.a. 13525 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES, 13526 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define. 13527 (exclude_libs_test.syms, libexclude_libs_test_1.a, 13528 libexclude_libs_test_2.a): New rules. 13529 * testsuite/Makefile.in: Regenerate. 13530 * testsuite/exclude_libs_test.c: New file. 13531 * testsuite/exclude_libs_test.sh: Ditto. 13532 * testsuite/exclude_libs_test_1.c: Ditto. 13533 * testsuite/exclude_libs_test_2.c: Ditto. 13534 13535 2009-05-15 Ian Lance Taylor <iant (a] google.com> 13536 13537 * configure.ac: Check for declarations for cases where libiberty.h 13538 checks HAVE_DECL_xxx. 13539 * configure, config.in: Rebuild. 13540 13541 2009-05-15 Mikolaj Zalewski <mikolajz (a] google.com> 13542 13543 * gold.h (Incremental_argument_list): Remove (invalid) forward 13544 declaration. 13545 * incremental.cc (Incremental_inputs::report_achive): New method. 13546 (Incremental_inputs::report_object): New method. 13547 (Incremental_inputs::report_script): New method. 13548 (Incremental_inputs::finalize_inputs): New method. 13549 (Incremental_inputs::finalize): Call finalize_inputs(). 13550 (Incremental_inputs::sized_create_incremental_inputs_section_data): 13551 Create inputs entries. 13552 * incremental.h (Incremental_input_type): New enum. 13553 (Incremental_inputs::Incremental_input): Initialize new fields. 13554 (Incremental_inputs::report_inputs): New method. 13555 (Incremental_inputs::report_achive): New method. 13556 (Incremental_inputs::report_object): New method. 13557 (Incremental_inputs::report_script): New method. 13558 (Incremental_inputs::finalize_inputs): New method. 13559 (Incremental_inputs::Input_info): New struct. 13560 (Incremental_inputs::Input_info_map): New typedef. 13561 (Incremental_inputs::lock_): New field. 13562 (Incremental_inputs::Inputs_): New field. 13563 (Incremental_inputs::Inputs_map): New field. 13564 * main.cc (main): Call Incremental_input::report_inputs. 13565 * options.h (Input_argument_list): Typedef moved from 13566 Input_arguments. 13567 (Input_file_group::Files): Remove, use ::Input_argument_list. 13568 (Input_file_group::Input_argument_list): Remove, use 13569 ::Input_argument_list. 13570 * plugin.cc (Plugin_manager::add_input_file): Add error in 13571 incremental build. 13572 * read_syms.cc (do_read_syms): Call Incremental_input::report_* 13573 functions. 13574 * script.cc (read_input_script): Call 13575 Incremental_input::report_script. 13576 * script.h (Script_info): New class. 13577 13578 2009-04-27 Ian Lance Taylor <iant (a] google.com> 13579 13580 * x86_64.cc (do_adjust_output_section): Set entsize to 13581 plt_entry_size. 13582 13583 2009-04-23 Elliott Hughes <enh (a] google.com> 13584 13585 * output.cc (Output_file::close): After short writes, continue 13586 writing from the correct offset in the buffer being written. 13587 13588 2009-04-23 Chris Demetriou <cgd (a] google.com> 13589 13590 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define. 13591 * configure: Regenerate. 13592 * config.in: Regenerate. 13593 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set 13594 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined. 13595 13596 2009-04-21 Mikolaj Zalewski <mikolajz (a] google.com> 13597 13598 * incremental.cc (Incremental_inputs_header_data): Renamed from 13599 Incremental_input_header_data. 13600 (Incremental_inputs_header_data::data_size): New field. 13601 (Incremental_inputs_header_data::put_input_file_count): Renamed 13602 from input_file_count. 13603 (Incremental_inputs_header_data::put_command_line_offset): Renamed 13604 from command_line_offset. 13605 (Incremental_inputs_header_data::put_reserved): Renamed from 13606 put_reserved. 13607 (Incremental_inputs_entry_data): Renamed from 13608 Incremental_input_entry_data. 13609 (Incremental_inputs_entry_data::data_size): New field. 13610 (Incremental_inputs::report_command_line): New method. 13611 (Incremental_inputs::finalize): New method. 13612 (Incremental_inputs::create_incremental_inputs_data): New method. 13613 (Incremental_inputs::sized_create_incremental_inputs_data): New method. 13614 * incremental.h: New file. 13615 * layout.cc (Layout::Layout): Handle new incremental_inputs_. 13616 (Layout::finalize): Create incremental inputs section in 13617 incremental builds. 13618 (Layout::create_incremental_info_sections): New method. 13619 * layout.h (Layout::incremental_inputs): New method. 13620 (Layout::create_incremental_info_sections): New method. 13621 (Layout::incremental_inputs_): New field. 13622 * main.cc (main): Notify Incremental_input of the command line. 13623 13624 2009-04-01 Ian Lance Taylor <iant (a] google.com> 13625 Mikolaj Zalewski <mikolajz (a] google.com> 13626 13627 * gold.h (reserve_unordered_map): Define, three versions, one for 13628 each version of Unordered_map. 13629 * layout.cc (Layout::Layout): Remove options parameter. Add 13630 number_of_input_files parameter. Don't initialize options_. 13631 Initialize number_of_input_files_ and resized_signatures_. Move 13632 sections_are_attached_. 13633 (Layout::layout_group): Reserve space for group_signatures_. 13634 (Layout::find_or_add_kept_section): Change name parameter to be a 13635 reference. Resize signatures_ map when it gets large enough. 13636 (Layout::layout_eh_frame): Use parameters->options() instead of 13637 this->options_. 13638 (Layout::make_output_section): Likewise. 13639 (Layout::attach_allocated_section_to_segment): Likewise. 13640 (Layout::finalize, Layout::create_executable_stack): Likewise. 13641 (Layout::set_segment_offsets, Layout::create_interp): Likewise. 13642 (Layout::finish_dynamic_section, Layout::write_binary): Likewise. 13643 * layout.h (class Layout): Update declarations. Remove options_ 13644 field. Add number_of_input_files_ and resized_signatures_ 13645 fields. Move sections_are_attached_ field. 13646 * main.cc (main): Pass number of input files to Layout 13647 constructor. Don't pass options. 13648 13649 2009-03-30 Ian Lance Taylor <iant (a] google.com> 13650 13651 * ffsll.c (ffsll): Correct implementation. 13652 13653 2009-03-27 Ian Lance Taylor <iant (a] google.com> 13654 13655 * ffsll.c: New file. 13656 * configure.ac: Call AC_REPLACE_FUNCS on ffsll. 13657 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined. 13658 * ftruncate.c (ftruncate): Declare before definition. 13659 * mremap.c (mremap): Likewise. 13660 * pread.c (pread): Likewise. 13661 * configure, Makefile.in, config.in: Rebuild. 13662 13663 * mremap.c: New file. 13664 * configure.ac: Call AC_REPLACE_FUNCS on mremap. 13665 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined. 13666 (mremap): Declare if HAVE_MREMAP is not defined. 13667 * configure, Makefile.in, config.in: Rebuild. 13668 13669 2009-03-27 Cary Coutant <ccoutant (a] google.com> 13670 13671 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is 13672 position independent. 13673 * sparc.cc (Target_sparc::check_non_pic): Likewise. 13674 * x86_64.cc (Target_x86_64::check_non_pic): Likewise. 13675 13676 2009-03-24 Cary Coutant <ccoutant (a] google.com> 13677 13678 * symtab.h (needs_plt_entry): Check for unsatisfied reference from 13679 an executable. 13680 (needs_dynamic_reloc): Likewise. 13681 13682 2009-03-24 Ian Lance Taylor <iant (a] google.com> 13683 13684 * yyscript.y (file_cmd): Recognize EXTERN. 13685 (extern_name_list, extern_name_list_body): New nonterminals. 13686 * script.cc (script_add_extern): Define. 13687 * script-c.h (script_add_extern): Declare. 13688 13689 2009-03-24 Rafael Avila de Espindola <espindola (a] google.com> 13690 13691 * object.cc (is_elf_object): Define. 13692 * object.h (is_elf_object): Declare. 13693 * archive.cc (Archive::get_elf_object_for_member): Call 13694 is_elf_object. 13695 * readsyms.cc (Read_symbols::do_read_symbols): Likewise. 13696 13697 2009-03-24 Elliott Hughes <enh (a] google.com> 13698 13699 * output.cc (Output_file::map_anonymous): Define. 13700 (Output_file::map): Use map_anonymous. If the regular mmap fails, 13701 try an anonymous one. Report the size if the mmap fails. 13702 * output.h (class Output_file): Declare map_anonymous. 13703 13704 2009-03-24 Ian Lance Taylor <iant (a] google.com> 13705 13706 * target-select.cc (instantiate_target): Don't acquire the lock if 13707 the instantiated_target_ field has already been set. 13708 13709 2009-03-23 Ian Lance Taylor <iant (a] google.com> 13710 13711 * gold-threads.h (class Initialize_lock): Define. 13712 * gold-threads.cc (class Initialize_lock_once): Define. 13713 (initialize_lock_control): New static variable. 13714 (initialize_lock_pointer): New static variable. 13715 (initialize_lock_once): New static function. 13716 (Initialize_lock::Initialize_lock): Define. 13717 (Initialize_lock::initialize): Define. 13718 * target-select.h: Include "gold-threads.h". 13719 (class Target_selector): Add lock_ and initialize_lock_ fields. 13720 Don't define instantiate_target, just declare it. 13721 * target-select.cc (Target_selector::Target_selector): Initialize 13722 new fields. 13723 (Target_selector::instantiate_target): Define. 13724 * descriptors.h: Include "gold-threads.h". 13725 (class Descriptors): Add initialize_lock_ field. 13726 * descriptors.cc (Descriptors::Descriptors): Initialize new 13727 field. 13728 (Descriptors::open): Use initialize_lock_ field 13729 * errors.h (class Errors): Add initialize_lock_ field. 13730 * errors.cc (Errors::Errors): Initialize new field. 13731 (Errors::initialize_lock): Use initialize_lock_ field. 13732 * powerpc.cc (class Target_selector_powerpc): Remove 13733 instantiated_target_ field. In do_recognize call 13734 instantiate_target rather than do_instantiate_target. In 13735 do_instantiate_target just allocate a new target. 13736 * sparc.cc (class Target_selector_sparc): Likewise. 13737 13738 * freebsd.h: New file. 13739 * i386.cc: Include "freebsd.h". 13740 (Target_i386): Derive from Target_freebsd rather than 13741 Sized_target. 13742 (Target_selector_i386): Derive from Target_selector_freebsd rather 13743 than Target_selector. 13744 * x86_64.cc: Include "freebsd.h". 13745 (Target_x86_64): Derive from Target_freebsd rather than 13746 Sized_target. 13747 (Target_selector_x86_64): Derive from Target_selector_freebsd 13748 rather than Target_selector. 13749 * target.h (class Target): Add adjust_elf_header and 13750 do_adjust_elf_header. 13751 * output.cc (Output_file_header:: do_sized_write): Call target 13752 adjust_elf_header routine. 13753 * configure.tgt: Set targ_osabi. 13754 * configure.ac: Define GOLD_DEFAULT_OSABI. 13755 * parameters.cc (Parameters::default_target): Pass 13756 GOLD_DEFAULT_OSABI to select_target. 13757 * target-select.h (class Target_selector): Make instantiate_target 13758 protected rather than private. 13759 * Makefile.am (HFILES): Add freebsd.h. 13760 * configure, Makefile.in, config.in: Rebuild. 13761 13762 * merge.cc (do_add_input_section): Correct pend value. Change 13763 message about last entry not being null terminated from error to 13764 warning. 13765 13766 2009-03-20 Mikolaj Zalewski <mikolajz (a] google.com> 13767 13768 * incremental.cc: New file. 13769 * Makefile.am (CCFILES): Add incremental.cc. 13770 * Makefile.in: Rebuild. 13771 13772 2009-03-19 Paul Pluzhnikov <ppluzhnikov (a] google.com> 13773 13774 * layout.cc (Layout::output_section_name): Preserve names 13775 of '.note.' sections. 13776 13777 2009-03-19 Ian Lance Taylor <iant (a] google.com> 13778 13779 * descriptors.cc (Descriptors::open): Check that the options are 13780 valid before using them. 13781 13782 2009-03-18 Ian Lance Taylor <iant (a] google.com> 13783 13784 * script-sections.h: Include <list>. 13785 (class Script_sections): Change Sections_elements from std::vector 13786 to std::list. Typedef public Elements_iterator. Add 13787 orphan_section_placement_, data_segment_align_start_, and 13788 saw_data_segment_align_ fields. Remove data_segment_align_index_ 13789 field. 13790 * script-sections.cc (class Orphan_section_placement): New class. 13791 (class Sections_element): Add virtual functions is_relro and 13792 orphan_section_init. Remove virtual function place_orphan_here. 13793 (class Output_section_definition): Add is_relro and 13794 orphan_section_init. Remove place_orphan_here. 13795 (class Orphan_output_section): Likewise. 13796 (Script_sections::Script_sections): Update for field changes. 13797 (Script_sections::data_segment_align): Set saw_data_segment_align_ 13798 and data_segment_align_start_, not data_segment_align_index. 13799 (Script_sections::data_segment_relro_end): Check 13800 saw_data_segment_align_. Use data_segment_align_start_ rather 13801 than data_segment_align_index_. 13802 (Script_sections::place_orphan): Rewrite to use 13803 Orphan_section_placement. 13804 13805 2009-03-17 Ian Lance Taylor <iant (a] google.com> 13806 13807 * archive.cc (Archive::add_symbols): Check for a version attached 13808 to the symbol name in the archive map. 13809 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11. 13810 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define. 13811 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define. 13812 (ver_test_11.a): New target. 13813 * testsuite/Makefile.in: Rebuild. 13814 13815 * configure.ac: Check for chsize and posix_fallocate. Replace 13816 ftruncate. 13817 * ftruncate.c: New file, from gnulib. 13818 * output.cc (posix_fallocate): Define dummy version if not 13819 HAVE_POSIX_FALLOCATE. 13820 (Output_file::map): Call posix_fallocate rather than lseek and 13821 write. 13822 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE. 13823 * configure, Makefile.in, config.in: Rebuild. 13824 13825 2009-03-17 Paul Pluzhnikov <ppluzhnikov (a] google.com> 13826 13827 * layout.h (Layout::create_note): Add section_name parameter. 13828 * layout.cc (Layout::create_note): Likewise. 13829 (Layout::create_build_id, Layout::create_gold_note): Fix callers. 13830 13831 2009-03-17 Ian Lance Taylor <iant (a] google.com> 13832 13833 * descriptors.cc: Include "options.h". 13834 (FD_CLOEXEC, O_CLOEXEC): Define if not defined. 13835 (Descriptors::open): Always use O_CLOEXEC when opening a new 13836 descriptor. If we have a plugin, and O_CLOEXEC was not defined, 13837 then set FD_CLOEXEC. 13838 13839 * sparc.cc (class Target_sparc): Add has_got_section. 13840 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_, 13841 make sure we have a GOT section. 13842 13843 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD. 13844 (Target_sparc::Scan::local): Likewise. 13845 (Target_sparc::Scan::global): Likewise. 13846 (Target_sparc::Relocate::relocate): Likewise. 13847 (Target_sparc::Relocate::relocate_tls): Likewise. 13848 13849 * symtab.cc (Symbol_table::define_default_version): New function, 13850 broken out of add_from_object. 13851 (Symbol_table::add_from_object): Call define_default_version. 13852 (Symbol_table::define_special_symbol): Add resolve_oldsym 13853 parameter. Change all callers. If the version for a symbol comes 13854 from a version script, resolve it with the symbol with the same 13855 name with no version. Also add the symbol without a version if 13856 appropriate. 13857 (do_define_in_output_data): If resolving with oldsym, don't delete 13858 sym. 13859 (do_define_in_output_segment): Likewise. 13860 (do_define_as_constant): Likewise. 13861 * symtab.h (class Symbol_table): Update declarations. 13862 13863 2009-03-13 Ian Lance Taylor <iant (a] google.com> 13864 13865 * readsyms.cc (Read_symbols::incompatible_warning): New function. 13866 (Read_symbols::requeue): New function. 13867 (Read_symbols::do_read_symbols): If make_elf_object fails because 13868 the target type is not configured, and the file was searched for, 13869 issue a warning and retry with the next directory. 13870 (Add_symbols::run): If the file has an incompatible format, and 13871 it was searched for, requeue the Read_symbols task. On error, 13872 release the object. 13873 * readsyms.h (class Read_symbols): Add dirindex_ field. Add 13874 dirindex parameter to constructor. Change all callers. Declare 13875 incompatible_warning and requeue. 13876 (class Add_symbols): Add dirpath_, dirindex_, mapfile_, 13877 input_argument_ and input_group_ fields. Add them to 13878 constructor. Change all callers. 13879 (class Read_script): Add dirindex_ field. Add it to constructor. 13880 Change all callers. 13881 * archive.cc (Archive::setup): Remove input_objects parameter. 13882 Change all callers. 13883 (Archive::get_file_and_offset): Likewise. 13884 (Archive::read_all_symbols): Likewise. 13885 (Archive::read_symbols): Likewise. 13886 (Archive::get_elf_object_for_member): Remove input_objects 13887 parameter. Add punconfigured parameter. Change all callers. 13888 (Archive::add_symbols): Change return type to bool. Check return 13889 value of include_member. 13890 (Archive::include_all_members): Likewise. 13891 (Archive::include_member): Change return type to bool. Return 13892 false if first included object has incompatible target. Set 13893 included_member_ field. 13894 (Add_archive_symbols::run): If add_symbols returns false, requeue 13895 Read_symbols task. 13896 * archive.h (class Archive): Add included_member_ field. 13897 Initialize it in constructor. Add input_file and searched_for 13898 methods. Update declarations. 13899 (class Add_archive_symbols): Add dirpath_, dirindex_, and 13900 input_argument_ fields. Add them to constructor. Change all 13901 callers. 13902 * script.cc: Include "target-select.h". 13903 (class Parser_closure): Add skip_on_incompatible_target_ and 13904 found_incompatible_target_ fields. Add 13905 skip_on_incompatible_target parameter to constructor. Change all 13906 callers. Add methods skip_on_incompatible_target, 13907 clear_skip_on_incompatible_target, found_incompatible_target, and 13908 set_found_incompatible_target. 13909 (read_input_script): Add dirindex parameter. Change all callers. 13910 If parser finds an incompatible target, requeue Read_symbols 13911 task. 13912 (script_set_symbol): Clear skip_on_incompatible_target in 13913 closure. 13914 (script_add_assertion, script_parse_option): Likewise. 13915 (script_start_sections, script_add_phdr): Likewise. 13916 (script_check_output_format): New function. 13917 * script.h (read_input_script): Update declaration. 13918 * script-c.h (script_check_output_format): Declare. 13919 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT. 13920 (ignore_cmd): Remove OUTPUT_FORMAT. 13921 * fileread.cc (Input_file::Input_file): Add explicit this. 13922 (Input_file::will_search_for): New function. 13923 (Input_file::open): Add pindex parameter. Change all callers. 13924 * fileread.h (class Input_file): Add input_file_argument method. 13925 Declare will_search_for. Update declarations. 13926 * object.cc (make_elf_object): Add punconfigured parameter. 13927 Change all callers. 13928 * object.h (class Object): Make input_file public. Add 13929 searched_for method. 13930 (make_elf_object): Update declaration. 13931 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to 13932 restart search. 13933 * dirsearch.h (class Dirsearch): Update declaration. 13934 * options.h (class General_options): Add --warn-search-mismatch. 13935 * parameters.cc (Parameters::is_compatible_target): New function. 13936 * parameters.h (class Parameters): Declare is_compatible_target. 13937 * workqueue.cc (Workqueue::add_blocker): New function. 13938 * workqueue.h (class Workqueue): Declare add_blocker. 13939 13940 * fileread.cc (Input_file::open): Remove options parameter. 13941 Change all callers. 13942 (Input_file::open_binary): Likewise. 13943 * script.cc (read_input_script): Likewise. 13944 * readsyms.h (class Read_symbols): Remove options_ field. Remove 13945 options parameter from constructor. Change all callers. 13946 (class Read_script): Likewise. 13947 * fileread.h (class Input_file): Update declarations. 13948 * script.h (read_input_script): Update declaration. 13949 13950 2009-03-10 Nick Clifton <nickc (a] redhat.com> 13951 13952 * po/es.po: New Spanish translation. 13953 13954 2009-03-06 Cary Coutant <ccoutant (a] google.com> 13955 13956 * options.cc (parse_short_option): Keep dash_z from registering itself. 13957 13958 2009-03-03 Ian Lance Taylor <iant (a] google.com> 13959 13960 PR 9918 13961 * target-reloc.h (relocate_section): Pass output_section to 13962 relocate. 13963 * i386.cc (Target_i386::should_apply_static_reloc): Add 13964 output_section parameter. Change all callers. 13965 (Target_i386::Relocate::relocate): Add output_section parameter. 13966 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise. 13967 * sparc.cc (Target_sparc::Relocate::relocate): Likewise. 13968 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise. 13969 * testsuite/two_file_shared.sh: New script. 13970 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh. 13971 (check_DATA): Add two_file_shared.dbg. 13972 (two_file_shared.dbg): New target. 13973 * testsuite/Makefile.in: Rebuild. 13974 13975 2009-03-01 Ian Lance Taylor <iant (a] google.com> 13976 13977 * configure.ac: Check for byteswap.h. 13978 * configure: Rebuild. 13979 * config.in: Rebuild. 13980 13981 2009-03-01 Mikolaj Zalewski <mikolajz (a] google.com> 13982 13983 * layout.cc (Layout::find_or_add_kept_section): New function. 13984 (Layout::add_comdat): Removed. 13985 * layout.h (struct Kept_section): Move out of class Layout. 13986 Remove trailing underscores from field names. Add group_sections 13987 field. Rename group_ field to is_group. Change all uses. 13988 (class Layout): Declare find_or_add_kept_section, not add_comdat. 13989 * object.cc (Sized_relobj::Sized_relobj): Don't initialize 13990 comdat_groups_ field. 13991 (Sized_relobj::include_section_group): Use 13992 find_or_add_kept_section and Kept_section::group_sections. 13993 (Sized_relobj::include_linkonce_section): Likewise. 13994 * object.cc (class Sized_relobj): Don't define Comdat_group or 13995 Comdat_group_table. Remove find_comdat_group and 13996 add_comdat_group. Remove comdat_groups_ field. 13997 * plugin.cc (include_comdat_group): Use 13998 Layout::find_or_add_kept_section. 13999 14000 2009-02-28 Ian Lance Taylor <iant (a] google.com> 14001 14002 * README: --gc-sections and map files are now supported. Document 14003 some build requirements. 14004 14005 PR 6992 14006 * symtab.cc (Symbol_table::sized_write_section_symbol): In a 14007 relocatable link set the value of the section symbol to zero. 14008 * object.cc (Sized_relobj::do_finalize_local_symbols): In a 14009 relocatable link don't include the section address in the local 14010 symbol value. 14011 14012 2009-02-27 Ian Lance Taylor <iant (a] google.com> 14013 14014 PR 6811 14015 * options.h (class Search_directory): Add is_system_directory. 14016 (class General_options): Declare is_in_system_directory. 14017 * options.cc (get_relative_sysroot): Make static. 14018 (get_default_sysroot): Make static. 14019 (General_optoins::is_in_system_directory): New function. 14020 * fileread.cc (Input_file::is_in_system_directory): New function. 14021 * fileread.h (class Input_file): Declare is_in_system_directory. 14022 * object.h (class Object): Add is_in_system_directory. 14023 (class Input_objects): Remove system_library_directory_ field. 14024 * object.cc (Input_objects::add_object): Don't set 14025 system_library_directory_. 14026 (input_objects::found_in_system_library_directory): Remove. 14027 * symtab.cc (Symbol_table::write_globals): Remove input_objects 14028 parameter. Change all callers. 14029 (Symbol_table::sized_write_globals): Likewise. 14030 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise. 14031 Call Object::is_in_system_directory. 14032 * symtab.h (class Symbol_table): Update declarations. 14033 14034 PR 5990 14035 * descriptors.h (Open_descriptor): Add is_on_stack field. 14036 * descriptors.cc (Descriptors::open): If the descriptor is on the 14037 top of the stack, remove it. Initialize is_on_stack field. 14038 (Descriptors::release): Only add pod to stack if it is not on the 14039 stack already. 14040 (Descriptors::close_some_descriptor): Clear stack_next and 14041 is_on_stack fields. 14042 14043 PR 7091 14044 * output.cc (Output_section::find_starting_output_address): Rename 14045 from starting_output_address; add PADDR parameter; change return 14046 type. 14047 * output.h (class Output_section): Declare 14048 find_starting_output_address instead of starting_output_address. 14049 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a 14050 section symbol for which we can't find a merge section. 14051 14052 PR 9836 14053 * symtab.cc (Symbol_table::add_from_object): If the visibility is 14054 hidden or internal, force the symbol to be local. 14055 * resolve.cc (Symbol::override_visibility): Define. 14056 (Symbol::override_base): Use override_visibility. 14057 (Symbol_table::resolve): Likewise. 14058 (Symbol::override_base_with_special): Likewise. 14059 (Symbol_table::override_with_special): If the visibility is hidden 14060 or internal, force the symbol to be local. 14061 * symtab.h (class Symbol): Add set_visibility and 14062 override_visibility. 14063 * testsuite/ver_test_1.sh: New file. 14064 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh. 14065 (check_DATA): Add ver_test_1.syms. 14066 (ver_test_1.syms): New target. 14067 * testsuite/Makefile.in: Rebuild. 14068 14069 2009-02-25 Cary Coutant <ccoutant (a] google.com> 14070 14071 * layout.cc (Layout::choose_output_section): Don't rename sections 14072 when using a linker script that has a SECTIONS clause. 14073 * Makefile.in: Regenerate. 14074 14075 * testsuite/Makefile.am (script_test_5.sh): New test case. 14076 * testsuite/Makefile.in: Regenerate. 14077 * testsuite/script_test_5.cc: New file. 14078 * testsuite/script_test_5.sh: New file. 14079 * testsuite/script_test_5.t: New file. 14080 14081 2009-02-13 Rafael Avila de Espindola <espindola (a] google.com> 14082 14083 * archive.cc (Archive::include_member): Update calls to add_symbols. 14084 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add 14085 the Layout argument. 14086 * dynobj.h (do_add_symbols): Add the Layout argument. 14087 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the 14088 Layout argument. 14089 * object.h (Object::add_symbols): Add the Layout argument. 14090 (Object::do_add_symbols): Add the Layout argument. 14091 (Sized_relobj::do_add_symbols): Add the Layout argument. 14092 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols): 14093 Unify the two versions. 14094 (Add_plugin_symbols): Remove. 14095 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove. 14096 (Sized_pluginobj::do_add_symbols): Unify the two versions. 14097 (Add_plugin_symbols): Remove. 14098 * readsyms.cc (Read_symbols::do_read_symbols): Update call to 14099 Add_symbols. Use Add_symbols instead of Add_plugin_symbols. 14100 (Add_symbols::run): Make it work with Pulginobj. 14101 14102 2009-02-06 Ian Lance Taylor <iant (a] google.com> 14103 14104 * object.cc (Sized_relobj::do_layout): Make info message start 14105 with lower case letter. 14106 14107 2009-02-06 Mikolaj Zalewski <mikolajz (a] google.com> 14108 14109 * binary.cc: Fix file comment. 14110 14111 * options.h (enum Incremental_disposition): Define. 14112 (class General_options): Add new options: --incremental, 14113 --incremental_changed, --incremental_unchanged, 14114 --incremental_unknown. Add incremental_disposition_ and 14115 implicit_incremental_ fields. 14116 (General_options::incremental_disposition): New function. 14117 (class Position_dependent_options): Add incremental_disposition 14118 option. 14119 (Position_dependent_options::copy_from_options): Set incremental 14120 dispositions. 14121 * options.cc (General_options::parse_incremental_changed): New 14122 function. 14123 (General_options::parse_incremental_unchanged): New function. 14124 (General_options::parse_incremental_unknown): New function. 14125 (General_options::General_options): Initialize new fields 14126 incremental_disposition_ and implicit_incremental_. 14127 (General_options::finalize): Check for uasge of --incremental-* 14128 without --incremental. 14129 14130 2009-02-06 Chris Demetriou <cgd (a] google.com> 14131 14132 * gold.h (gold_undefined_symbol): Change to take only a Symbol 14133 pointer and to report location as the file name associated with 14134 the symbol. 14135 (gold_undefined_symbol_at_location): New function to replace the 14136 old gold_undefined_symbol functionality. 14137 * target-reloc.h (relocate_section): Update to use 14138 gold_undefined_symbol_at_location. 14139 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol): 14140 Call gold_undefined_symbol function rather than gold_error. 14141 * errors.h (Errors::undefined_symbol): Take location as a 14142 string, rather than calculating it from a relocation. 14143 * errors.cc (Errors::fatal): Print "fatal error:" before the 14144 formatted message. 14145 (Errors::error, Errors::error_at_location): Print "error: " 14146 before the formatted message. 14147 (Errors::undefined_symbol): Take location as a string, rather 14148 than calculating it from a relocation. 14149 (gold_undefined_symbol_at_location): New function akin to 14150 old gold_undefined_symbol, calculates location from relocation. 14151 (gold_undefined_symbol): Change to take only a Symbol pointer 14152 and to report location as the file name associated with the symbol. 14153 * testsuite/debug_msg.sh: Update for changed error messages. 14154 * testsuite/undef_symbol.sh: Likewise. 14155 14156 2009-02-04 Duncan Sands <baldrick (a] free.fr> 14157 14158 PR 9812 14159 * reduced_debug_output.h 14160 (Output_reduced_debug_abbrev_section::failed): Use format for 14161 gold_warning. 14162 (Output_reduced_debug_info_section::faild): Likewise. 14163 14164 2009-01-31 Mikolaj Zalewski <mikolajz (a] google.com> 14165 14166 * script.cc (Lazy_demangler): New class. 14167 (Version_script_info::get_symbol_version_helper): Demangle a 14168 symbol only once. 14169 14170 2009-01-29 Cary Coutant <ccoutant (a] google.com> 14171 14172 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls 14173 to __tls_get_addr. 14174 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise. 14175 14176 2009-01-28 Ian Lance Taylor <iant (a] google.com> 14177 14178 * version.cc (version_string): Bump to 1.9. 14179 14180 * gold.h: Include <cstring> and <stdint.h>. 14181 * version.cc: Include <cstdio>. 14182 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a 14183 warning. 14184 * reduced_debug_output.cc (insert_into_vector): Rename from 14185 Insert_into_vector; change all callers. Use Swap_unaligned to 14186 avoid aliasing issue; remove union since it is unnecessary. 14187 14188 2009-01-27 Sriraman Tallam <tmsriram (a] google.com> 14189 14190 * Makefile.am (CCFILES): Add gc.cc. 14191 (HFILES): Add gc.h. 14192 * Makefile.in: Regenerate. 14193 * gold.cc (Gc_runner): New class. 14194 (queue_initial_tasks): Call garbage collection related tasks 14195 when corresponding options are invoked. 14196 (queue_middle_gc_tasks): New function. 14197 (queue_middle_tasks): Reorder tasks to allow relocs to be read and 14198 processed early before laying out sections during garbage collection. 14199 * gold.h (queue_middle_gc_tasks): New function. 14200 (is_prefix_of): Move from "layout.cc". 14201 * i386.cc (Target_i386::gc_process_relocs): New function. 14202 * layout.cc (is_prefix_of): Remove. Move to "gold.h" 14203 * main.cc (main): Create object of class "Garbage_collection". 14204 * object.cc (Relobj::copy_symbols_data): New function. 14205 (Relobj::is_section_name_included): New function. 14206 (Sized_relobj::do_layout): Allow this function to be called twice 14207 during garbage collection and defer layout of section during the 14208 first call. 14209 * object.h (Relobj::get_symbols_data): New function. 14210 (Relobj::is_section_name_included): New function. 14211 (Relobj::copy_symbols_data): New function. 14212 (Relobj::set_symbols_data): New function. 14213 (Relobj::get_relocs_data): New function. 14214 (Relobj::set_relocs_data): New function. 14215 (Relobj::is_output_section_offset_invalid): New pure virtual function. 14216 (Relobj::gc_process_relocs): New function. 14217 (Relobj::do_gc_process_relocs): New pure virtual function. 14218 (Relobj::sd_): New data member. 14219 (Sized_relobj::is_output_section_offset_invalid): New function. 14220 (Sized_relobj::do_gc_process_relocs): New function. 14221 * options.h (General_options::gc_sections): Modify to not be a no-op. 14222 (General_options::print_gc_sections): New option. 14223 * plugin.cc (Plugin_finish::run): Remove function call to 14224 Plugin_manager::layout_deferred_objects. Move it to "gold.cc". 14225 * powerpc.cc (Target_powerpc::gc_process_relocs): New function. 14226 * reloc.cc (Read_relocs::run): Add task to process relocs and 14227 determine unreferenced sections when doing garbage collection. 14228 (Gc_process_relocs): New class. 14229 (Sized_relobj::do_gc_process_relocs): New function. 14230 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for 14231 sections that are garbage collected. 14232 * reloc.h (Gc_process_relocs): New class. 14233 * sparc.cc (Target_sparc::gc_process_relocs): New function. 14234 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for 14235 symbols whose corresponding sections are garbage collected. 14236 (Symbol_table::Symbol_table): Add new parameter for the garbage 14237 collection object. 14238 (Symbol_table::gc_mark_undef_symbols): New function. 14239 (Symbol_table::gc_mark_symbol_for_shlib): New function. 14240 (Symbol_table::gc_mark_dyn_syms): New function. 14241 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects 14242 as garbage. 14243 (Symbol_table::add_from_object): Likewise. 14244 (Symbol_table::add_from_relobj): When building shared objects, do not 14245 treat externally visible symbols as garbage. 14246 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol 14247 table information for static and relocatable links. 14248 * symtab.h (Symbol_table::set_gc): New function. 14249 (Symbol_table::gc): New function. 14250 (Symbol_table::gc_mark_undef_symbols): New function. 14251 (Symbol_table::gc_mark_symbol_for_shlib): New function. 14252 (Symbol_table::gc_mark_dyn_syms): New function. 14253 (Symbol_table::gc_): New data member. 14254 * target.h (Sized_target::gc_process_relocs): New pure virtual 14255 function. 14256 * x86_64.cc (Target_x86_64::gc_process_relocs): New function. 14257 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function. 14258 14259 2009-01-20 Chris Faylor <me.sourceware (a] sourceware.org> 14260 14261 * options.h (General_options::gc_sections): Define as a no-op for now. 14262 (General_options::no_keep_memory): Ditto. 14263 (General_options::Bshareable): Define. 14264 * options.cc (General_options::finalize): Honor -Bshareable. 14265 14266 2009-01-20 Andreas Schwab <schwab (a] suse.de> 14267 14268 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to 14269 read the value in the contents, since we don't use it. Use the 14270 template endianness when writing. 14271 (Relocate::relocate): Use it for R_PPC_REL16_HA. 14272 14273 2009-01-19 Andreas Schwab <schwab (a] suse.de> 14274 14275 * configure.tgt (powerpc64-*): Fix targ_obj. 14276 14277 2009-01-15 Ian Lance Taylor <iant (a] google.com> 14278 14279 * object.cc (Sized_relobj::write_local_symbols): Don't write out 14280 local symbols when stripping all symbols. 14281 14282 2009-01-14 Cary Coutant <ccoutant (a] google.com> 14283 14284 * output.cc (Output_reloc): Add explicit instantiations. 14285 14286 2009-01-14 Cary Coutant <ccoutant (a] google.com> 14287 14288 * archive.cc (Archive::get_elf_object_for_member): Remove call 14289 to File_read::claim_for_plugin. 14290 * descriptors.cc (Descriptors::open): Remove reference to 14291 is_claimed. 14292 (Descriptors::claim_for_plugin): Remove. 14293 * descriptors.h (Descriptors::claim_for_plugin): Remove. 14294 (Descriptors::is_claimed): Remove. 14295 (claim_descriptor_for_plugin): Remove. 14296 * fileread.cc (File_read::claim_for_plugin): Remove. 14297 * fileread.h (File_read::claim_for_plugin): Remove. 14298 (File_read::descriptor): Reopen descriptor if necessary. 14299 * plugin.cc (Plugin::load): Add two new APIs to transfer vector. 14300 (Plugin_manager::all_symbols_read): Add task parameter. Change 14301 all callers. 14302 (Plugin_manager::get_input_file): New function. 14303 (Plugin_manager::release_input_file): New function. 14304 (Pluginobj::Pluginobj): Add filesize parameter and initialize 14305 corresponding data member. 14306 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter 14307 and pass to base constructor. Change all callers. 14308 (get_input_file, release_input_file): New functions. 14309 (make_sized_plugin_object): Add filesize parameter. Change all callers. 14310 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member. 14311 (Plugin_manager::all_symbols_read): Add task parameter. 14312 (Plugin_manager::get_input_file): New function. 14313 (Plugin_manager::release_input_file): New function. 14314 (Plugin_manager::task_): New data member. 14315 (Pluginobj::Pluginobj): Add filesize parameter. 14316 (Pluginobj::filename): New function. 14317 (Pluginobj::descriptor): New function. 14318 (Pluginobj::filesize): New function. 14319 (Pluginobj::filesize_): New data member. 14320 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter. 14321 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to 14322 File_read::claim_for_plugin; use Object::unlock to unlock the file. 14323 14324 * testsuite/Makefile.am (plugin_test_4): New test case for plugins 14325 with archive libraries. 14326 * testsuite/Makefile.in: Regenerate. 14327 * testsuite/plugin_test.c (struct sym_info): New type. 14328 (get_input_file, release_input_file): New static variables. 14329 (onload): Capture new transfer vector entries. 14330 (claim_file_hook): Stop reading at end of file according to filesize. 14331 Factor out parsing of readelf output into separate function. 14332 (all_symbols_read_hook): Exercise get_input_file and release_input_file 14333 APIs and get the source file name from the symbol table. Convert 14334 source file name to corresponding object file name. Print info 14335 message when adding new input files. 14336 (parse_readelf_line): New function. 14337 * testsuite/plugin_test_1.sh: Add checks for new info messages. 14338 * testsuite/plugin_test_2.sh: Likewise. 14339 * testsuite/plugin_test_3.sh: Likewise. 14340 * testsuite/plugin_test_4.sh: New test case. 14341 14342 2009-01-07 Ian Lance Taylor <iant (a] google.com> 14343 14344 * version.cc (version_string): Bump to 1.8. 14345 14346 2008-12-23 Cary Coutant <ccoutant (a] google.com> 14347 14348 * gold.cc (gold_exit): Call plugin cleanup handlers on exit. 14349 * plugin.cc (Plugin_manager::finish): Rename as 14350 layout_deferred_objects. Move cleanup to separate function. 14351 (Plugin_manager::cleanup): New function. 14352 (Plugin_finish::run): Call layout_deferred_objects and cleanup 14353 separately. 14354 * plugin.h (Plugin_manager::finish): Rename as 14355 layout_deferred_objects. 14356 (Plugin_manager::cleanup): New function. 14357 (Plugin_manager::cleanup_done): New field. 14358 14359 2008-12-23 Cary Coutant <ccoutant (a] google.com> 14360 14361 * plugin.cc (is_visible_from_outside): New function. 14362 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside 14363 so we don't return "IR only" status for exported symbols or -r links. 14364 14365 * testsuite/Makefile.am (plugin_test_3): New test case. 14366 * testsuite/Makefile.in: Regenerate. 14367 * testsuite/plugin_test_3.sh: New file. 14368 14369 2008-12-22 Cary Coutant <ccoutant (a] google.com> 14370 14371 * object.cc (Sized_relobj::layout_section): New function. 14372 (Sized_relobj::do_layout): Defer layout of input sections until after 14373 plugin has provided replacement files. 14374 (Sized_relobj::do_layout_deferred_sections): New function. 14375 * object.h (Relobj::set_section_offset): Remove virtual keyword. 14376 (Relobj::layout_deferred_sections): New function. 14377 (Relobj::do_layout_deferred_sections): New function. 14378 (Sized_relobj::do_layout_deferred_sections): New function. 14379 (Sized_relobj::layout_section): New function. 14380 (Sized_relobj::Deferred_layout): New structure. 14381 (Sized_relobj::deferred_layout_): New field. 14382 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup. 14383 Change all callers. Layout deferred sections. 14384 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all 14385 references. 14386 (Plugin_hook::run): Move code from do_plugin_hook inline. 14387 (Plugin_hook::do_plugin_hook): Remove. 14388 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers. 14389 (Plugin_manager::finish): Renamed, was cleanup. 14390 (Plugin_manager::should_defer_layout): New function. 14391 (Plugin_manager::add_deferred_layout_object): New function. 14392 (Plugin_manager::Deferred_layout_list): New type. 14393 (Plugin_manager::deferred_layout_objects_): New field. 14394 (Plugin_hook::do_plugin_hook): Remove. 14395 14396 2008-12-17 Ian Lance Taylor <iant (a] google.com> 14397 14398 * options.h (class General_options): Add --no case for 14399 --export-dynamic. 14400 14401 2008-12-16 Cary Coutant <ccoutant (a] google.com> 14402 14403 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer 14404 vector. 14405 (Plugin_manager::claim_file): Create plugin object even if 14406 plugin did not call the add_symbols callback. 14407 (Plugin_obj::get_symbol_resolution_info): Guard against plugin 14408 asking for more symbols than were added. 14409 * testsuite/Makefile.am (plugin_test_1): Add test case with 14410 no global symbols. 14411 (empty.syms): New target. 14412 * testsuite/Makefile.in: Regenerate. 14413 * testsuite/plugin_test.c (claim_file_hook): Add new debug 14414 message. Don't call add_symbols if no globals. 14415 (all_symbols_read_hook): Don't provide replacement for empty 14416 claimed file. 14417 14418 2008-12-12 Ian Lance Taylor <iant (a] google.com> 14419 14420 * target-reloc.h (Default_scan_relocatable_relocs): Only discard 14421 r_type == 0 for a local symbol with r_sym == 0. 14422 (scan_relocatable_relocs): Pass r_sym to 14423 local_non_section_strategy. 14424 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add 14425 r_sym parameter. 14426 14427 * configure.ac: Update test for TLS descriptors: they are 14428 supported as of glibc 2.9. 14429 * configure: Rebuild. 14430 14431 2008-12-11 Ian Lance Taylor <iant (a] google.com> 14432 14433 PR 7091 14434 * target-reloc.h (Default_scan_relocatable_relocs): For each 14435 function, map r_type == 0 to RELOC_DISCARD. 14436 14437 2008-12-10 Cary Coutant <ccoutant (a] google.com> 14438 14439 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement 14440 object to override a kept COMDAT group from a plugin object. 14441 14442 2008-12-09 Ian Lance Taylor <iant (a] google.com> 14443 14444 PR 7088 14445 * yyscript.y (file_cmd): Handle INPUT. 14446 14447 * testsuite/initpri1.c: Change all declarations to be full 14448 prototypes by adding void, to avoid compiler warnings. 14449 14450 2008-12-05 Rafael Avila de Espindola <espindola (a] google.com> 14451 14452 * options.cc (General_options::parse_plugin_opt): New. 14453 (General_options::add_plugin): The argument now is just the filename. 14454 (General_options::add_plugin_option): New. 14455 * options.h (plugin_opt): New. 14456 (add_plugin): Change argument name. 14457 (add_plugin_option): New. 14458 * plugin.cc (Plugin::load): Don't parse the plugin option. 14459 * plugin.h (Plugin::Plugin): Rename argument. Init filename_. 14460 (Plugin::add_option): New. 14461 (Plugin::args_): Change type. 14462 (Plugin::filename_): New. 14463 (Plugin_manager::add_plugin_option): New. 14464 * testsuite/Makefile.am (plugin_test_1): Use new syntax. 14465 * testsuite/Makefile.in: Regenerate. 14466 14467 2008-12-05 Cary Coutant <ccoutant (a] google.com> 14468 14469 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE. 14470 Handle --strip-lto-sections option. 14471 * options.h (strip_lto_sections): New option. 14472 14473 2008-12-01 Cary Coutant <ccoutant (a] google.com> 14474 14475 * plugin.cc (ld_plugin_message): Change format parameter to const. 14476 Fix mismatch between new[] and delete. 14477 14478 2008-11-14 Cary Coutant <ccoutant (a] google.com> 14479 14480 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address 14481 instead of -1U. 14482 14483 2008-11-05 Craig Silverstein <csilvers (a] google.com> 14484 14485 * options.cc (General_options::parse_dynamic_list): New function. 14486 * options.h (General_options): New flags dynamic_list, 14487 dynamic_list_data, dynamic_list_cpp_new, and 14488 dynamic_list_cpp_typeinfo. New variable dynamic_list_. 14489 (General_options::in_dynamic_list): New function. 14490 * script.cc (Lex::Mode): New enum DYNAMIC_LIST. 14491 (Lex::can_start_name): Add support for DYNAMIC_LIST mode. 14492 (Lex::can_continue_name): Likewise. 14493 (yylex): Likewise. 14494 (read_script_file): New parameter script_options. 14495 (read_dynamic_list): New function. 14496 (Script_options::define_dynamic_list): New function. 14497 (dynamic_list_keyword_parsecodes): New variable. 14498 (dynamic_list_keywords): New variable. 14499 * script.h (Script_options::define_dynamic_list): New function 14500 prototype. 14501 (read_dynamic_list): New function prototype. 14502 * symtab.cc (strprefix): New macro. 14503 (Symbol::should_add_dynsym_entry): Support dynamic_list, 14504 dynamic_list_data, dynamic_list_cpp_new, and 14505 dynamic_list_cpp_typeinfo. 14506 * yyscript.y (PARSING_DYNAMIC_LIST): New token. 14507 (dynamic_list_expr): New rule. 14508 (dynamic_list_nodes): Likewise. 14509 (dynamic_list_node): Likewise. 14510 * testsuite/Makefile.am (dynamic_list): New test. 14511 * testsuite/Makefile.in: Regenerated. 14512 * testsuite/dynamic_list.t: New file. 14513 * testsuite/dynamic_list.sh: New file. 14514 14515 2008-11-05 Craig Silverstein <csilvers (a] google.com> 14516 14517 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last. 14518 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype. 14519 (t11_last): Likewise. 14520 * testsuite/ver_test_6.c (main): Likewise. 14521 14522 2008-10-07 Cary Coutant <ccoutant (a] google.com> 14523 14524 * options.c (General_options::finalize): Add check for -static and 14525 -shared. 14526 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects 14527 is not empty. 14528 14529 2008-10-02 Cary Coutant <ccoutant (a] google.com> 14530 14531 * plugin.cc (make_sized_plugin_object): Fix conditional 14532 compilation to work when not all targets are enabled. 14533 14534 2008-09-29 Cary Coutant <ccoutant (a] google.com> 14535 14536 * archive.cc (Archive::get_file_and_offset): Use filename instead 14537 of name to get library path. 14538 (Archive::include_member): Unlock external member of a thin archive. 14539 14540 * testsuite/Makefile.am (TEST_AR): New variable. 14541 (thin_archive_test_1): New test. 14542 (thin_archive_test_2): New test. 14543 * testsuite/Makefile.in: Regenerate. 14544 * testsuite/thin_archive_main.cc: New file. 14545 * testsuite/thin_archive_test_1.cc: New file. 14546 * testsuite/thin_archive_test_2.cc: New file. 14547 * testsuite/thin_archive_test_3.cc: New file. 14548 * testsuite/thin_archive_test_4.cc: New file. 14549 14550 2008-09-29 Cary Coutant <ccoutant (a] google.com> 14551 14552 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL. 14553 * object.cc (Sized_relobj::do_layout): Use constant invalid_address 14554 instead of -1U. 14555 (Sized_relobj::do_finalize_local_symbols): Likewise. 14556 (Sized_relobj::map_to_kept_section): Likewise. 14557 * object.h (Sized_relobj::invalid_address): New constant. 14558 (Sized_relobj::do_output_section_offset): Check for invalid_address 14559 and return -1ULL. 14560 * output.cc (Output_reloc::local_section_offset): Use constant 14561 invalid_address instead of -1U. 14562 (Output_reloc::get_address): Likewise. 14563 (Output_section::output_address): Change -1U to -1ULL. 14564 * output.h (Output_reloc::invalid_address): New constant. 14565 * reloc.cc (Sized_relobj::write_sections): Use constant 14566 invalid_address instead of -1U. 14567 (Sized_relobj::relocate_sections): Likewise. 14568 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol 14569 values for merge sections. 14570 * target-reloc.h (relocate_for_relocatable): Use constant 14571 invalid_address instead of -1U. 14572 14573 2008-09-19 Cary Coutant <ccoutant (a] google.com> 14574 14575 Add plugin functionality for link-time optimization (LTO). 14576 * configure.ac (plugins): Add --enable-plugins option. 14577 * configure: Regenerate. 14578 * config.in: Regenerate. 14579 * Makefile.am (LIBDL): New variable. 14580 (CCFILES): Add plugin.cc. 14581 (HFILES): Add plugin.h. 14582 (ldadd_var): Add LIBDL. 14583 * Makefile.in: Regenerate. 14584 14585 * archive.cc: Include "plugin.h". 14586 (Archive::setup): Don't preread archive symbols when using a plugin. 14587 (Archive::get_file_and_offset): Add memsize parameter. Change callers. 14588 (Archive::get_elf_object_for_member): Call plugin hooks for claiming 14589 files. 14590 (Archive::include_member): Add symbols from plugin objects. 14591 * archive.h (Archive::get_file_and_offset): Add memsize parameter. 14592 * descriptors.cc (Descriptors::open): Check for file descriptors 14593 abandoned by plugins. 14594 (Descriptors::claim_for_plugin): New function. 14595 * descriptors.h (Descriptors::claim_for_plugin): New function. 14596 (Open_descriptor::is_claimed): New field. 14597 (claim_descriptor_for_plugin): New function. 14598 * fileread.cc (File_read::claim_for_plugin): New function. 14599 * fileread.h (File_read::claim_for_plugin): New function. 14600 (File_read::descriptor): New function. 14601 * gold.cc: Include "plugin.h". 14602 (queue_initial_tasks): Add task to call plugin hooks for generating 14603 new object files. 14604 * main.cc: Include "plugin.h". 14605 (main): Load plugin libraries. 14606 * object.h (Pluginobj): Declare. 14607 (Object::pluginobj): New function. 14608 (Object::do_pluginobj): New function. 14609 (Object::set_target): New function. 14610 * options.cc: Include "plugin.h". 14611 (General_options::parse_plugin): New function. 14612 (General_options::General_options): Initialize plugins_ field. 14613 (General_options::add_plugin): New function. 14614 * options.h (Plugin_manager): Declare. 14615 (General_options): Add --plugin option. 14616 (General_options::has_plugins): New function. 14617 (General_options::plugins): New function. 14618 (General_options::add_plugin): New function. 14619 (General_options::plugins_): New field. 14620 * plugin.cc: New file. 14621 * plugin.h: New file. 14622 * readsyms.cc: Include "plugin.h". 14623 (Read_symbols::do_read_symbols): Check for archive before checking 14624 for ELF file. Call plugin hooks to claim files. 14625 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced 14626 from a real object file; force override when processing replacement 14627 files. 14628 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field. 14629 (Symbol::init_base_object): Likewise. 14630 (Symbol::init_base_output_data): Likewise. 14631 (Symbol::init_base_output_segment): Likewise. 14632 (Symbol::init_base_constant): Likewise. 14633 (Symbol::init_base_undefined): Likewise. 14634 (Symbol::output_section): Assert that object is not a plugin. 14635 (Symbol_table::add_from_pluginobj): New function. 14636 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as 14637 undefined. 14638 (Symbol_table::sized_write_globals): Likewise. 14639 (Symbol_table::add_from_pluginobj): Instantiate template. 14640 * symtab.h (Sized_pluginobj): Declare. 14641 (Symbol::in_real_elf): New function. 14642 (Symbol::set_in_real_elf): New function. 14643 (Symbol::in_real_elf_): New field. 14644 (Symbol_table::add_from_pluginobj): New function. 14645 14646 * testsuite/Makefile.am (AM_CFLAGS): New variable. 14647 (LIBDL): New variable. 14648 (LDADD): Add LIBDL. 14649 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2. 14650 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh. 14651 (check_DATA): Add plugin_test_1.err and plugin_test_2.err. 14652 (MOSTLYCLEANFILES): Likewise. 14653 * testsuite/Makefile.in: Regenerate. 14654 * testsuite/plugin_test.c: New file. 14655 * testsuite/plugin_test_1.sh: New file. 14656 * testsuite/plugin_test_2.sh: New file. 14657 14658 2008-09-16 Ian Lance Taylor <iant (a] google.com> 14659 14660 * target-reloc.h (relocate_section): Check whether a symbol is 14661 defined by the ABI before reporting an undefined symbol error. 14662 * target.h (Target::is_defined_by_abi): Make parameter const. 14663 (Target::do_is_defined_by_abi): Likewise. 14664 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise. 14665 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise. 14666 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise. 14667 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise. 14668 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs. 14669 * testsuite/Makefile.in: Rebuild. 14670 14671 * fileread.cc (make_view): Add casts to avoid warning. 14672 14673 2008-09-16 Alexandre Oliva <aoliva (a] redhat.com> 14674 14675 * i386.cc (Target_i386::define_tls_base_symbol): Update comments. 14676 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise. 14677 14678 2008-09-16 Alexandre Oliva <aoliva (a] redhat.com> 14679 14680 * options.h (General_options::output_is_executable): New. 14681 (General_options::output_is_pie): New. 14682 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START 14683 for shared libraries. 14684 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise. 14685 14686 2008-09-11 Chris Demetriou <cgd (a] google.com> 14687 14688 * options.h (origin): New -z option. 14689 * layout.cc (Layout:finish_dynamic_section): If "-z origin" 14690 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN 14691 in DT_FLAGS_1. 14692 14693 2008-09-05 Cary Coutant <ccoutant (a] google.com> 14694 14695 * fileread.cc (File_read::make_view): Add check for attempt to map 14696 beyond end of file. 14697 14698 2008-09-05 Cary Coutant <ccoutant (a] google.com> 14699 14700 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in 14701 explicit instantiations. 14702 14703 2008-08-28 Kris Van Hees <kris.van.hees (a] oracle.com> 14704 14705 PR gold/6858 14706 * options.cc (General_options::finalize): Allow undefined symbols 14707 in shlibs if linking -shared. 14708 14709 PR gold/6859 14710 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined 14711 symbols as not needing a dynsym entry. 14712 14713 2008-08-20 Craig Silverstein <csilvers (a] google.com> 14714 14715 * fileread.cc (File_read::open): Do not lock the file unless it 14716 was successfully opened. 14717 14718 2008-08-14 Cary Coutant <ccoutant (a] google.com> 14719 14720 * x86_64.cc (Target_x86_64::Relocate::relocat_tls): 14721 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs. 14722 * testsuite/tls_test.cc (struct int128): 128-bit struct 14723 for testing TLS relocs with non-zero addend. 14724 (v12): New TLS variable. 14725 (t12): New test. 14726 (t_last): Add check for v12. 14727 * testsuite/tls_test.h (t12): New function. 14728 * testsuite/tls_test_main.cc (thread_routine): Call new test. 14729 14730 2008-08-13 Ian Lance Taylor <iant (a] google.com> 14731 14732 * layout.cc (Layout::attach_allocated_section_to_segment): Don't 14733 set tls_segment_ or relro_segment_. 14734 (Layout::make_output_segment): Set tls_segment_ and relro_segment_ 14735 when appropriate. 14736 * output.h (Output_section::clear_is_relro): New function. 14737 * output.cc (Output_segment::add_output_section): Handle SHF_TLS 14738 sections specially even when output_data_ is empty. 14739 (Output_segment::maximum_alignment): When first section is relro, 14740 only force alignment for PT_LOAD segments. 14741 * script.cc (script_data_segment_align): New function. 14742 (script_data_segment_relro_end): New function. 14743 * script-c.h (script_data_segment_align): Declare. 14744 (script_data_segment_relro_end): Declare. 14745 * script-sections.h (class Script_sections): Declare 14746 data_segment_align and data_segment_relro_end. Add fields 14747 segment_align_index_ and saw_relro_end_. 14748 * script-sections.cc (class Sections_element): Add set_is_relro 14749 virtual function. Add new bool* parameter to place_orphan_here. 14750 Add get_output_section virtual function. 14751 (class Output_section_definition): Add set_is_relro. Add new 14752 bool* parameter to place_orphan_here. Add get_output_section. 14753 Add is_relro_ field. 14754 (Output_section_definition::Output_section_definition): Initialize 14755 evaluated_address_, evaluated_load_address, evaluated_addralign_, 14756 and is_relro_ fields. 14757 (Output_section_definition::place_orphan_here): Add is_relro 14758 parameter. 14759 (Output_section_definition::set_section_addresses): Set relro for 14760 output section. 14761 (Output_section_definition::alternate_constraint): Likewise. 14762 (class Orphan_output_section): Add new bool* parameter to 14763 place_orphan_here. Add get_output_section. 14764 (Orphan_output_section::place_orphan_here): Add is_relro 14765 parameter. 14766 (Script_sections::Script_sections): Initialize 14767 data_segment_align_index_ and saw_relro_end_. 14768 (Script_sections::data_segment_align): New function. 14769 (Script_sections::data_segment_relro_end): New function. 14770 (Script_sections::place_orphan): Set or clear is_relro. 14771 (Script_sections::set_section_addresses): Force alignment of first 14772 TLS section. 14773 * yyscript.y (exp): Call script_data_segment_align and 14774 script_data_segment_relro_end. 14775 * testsuite/relro_script_test.t: New file. 14776 * testsuite/relro_test.cc (using_script): Declare. 14777 (t1, t2): Test using_script. 14778 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test. 14779 (relro_script_test_SOURCES): Define. 14780 (relro_script_test_DEPENDENCIES): Define. 14781 (relro_script_test_LDFLAGS): Define. 14782 (relro_script_test_LDADD): Define. 14783 (relro_script_test.so): New target. 14784 * testsuite/Makefile.in: Rebuild. 14785 14786 2008-08-06 Cary Coutant <ccoutant (a] google.com> 14787 14788 * archive.cc (Archive::total_archives, Archive::total_members) 14789 (Archive::total_members_loaded): New variables. 14790 (Archive::setup): Add parameter. Add option to preread 14791 archive symbols. 14792 (Archive::read_armap): Add counter. 14793 (Archive::get_file_and_offset): New function. 14794 (Archive::get_elf_object_for_member): New function. 14795 (Archive::read_all_symbols): New function. 14796 (Archive::read_symbols): New function. 14797 (Archive::add_symbols): Add counters. 14798 (Archive::include_all_members): Use armap to find members if it's 14799 already built. 14800 (Archive::include_member): Skip reading symbols if already read. 14801 Factored code into Archive::get_file_and_offset and 14802 Archive::get_elf_object_for_member. Changed call to 14803 Mapfile::report_include_archive_member. 14804 (Archive::print_stats): New function. 14805 * archive.h: Declare Object and Read_symbols_data classes. 14806 (Archive::Archive): Add initializers for new members. 14807 (Archive::setup): Add parameter. 14808 (Archive::print_stats): New function. 14809 (Archive::total_archives, Archive::total_members) 14810 (Archive::total_members_loaded): New variables. 14811 (Archive::get_file_and_offset): New function. 14812 (Archive::get_elf_object_for_member): New function. 14813 (Archive::read_all_symbols): New function. 14814 (Archive::read_symbols): New function. 14815 (Archive::Archive_member): New class. 14816 (Archive::members_): New member. 14817 (Archive::num_members_): New member. 14818 * main.cc: Include archive.h. 14819 (main): Call Archive::print_stats. 14820 * mapfile.cc (Mapfile::report_include_archive_member): Delete 14821 archive parameter; member_name is now the fully-decorated name. 14822 * mapfile.h (Mapfile::report_include_archive_member): Likewise. 14823 * options.h: (General_options): Add --preread-archive-symbols option. 14824 * readsyms.cc (Read_symbols::do_read_symbols): Change call to 14825 Archive::setup. 14826 14827 2008-08-04 Ian Lance Taylor <iant (a] google.com> 14828 14829 * symtab.h (Symbol::use_plt_offset): New function. 14830 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset. 14831 * powerpc.cc (Relocate::relocate): Likewise. 14832 * sparc.cc (Relocate::relocate): Likewise. 14833 * x86_64.cc (Relocate::relocate): Likewise. 14834 * testsuite/weak_plt.sh: New test. 14835 * testsuite/weak_plt_main.cc: New test. 14836 * testsuite/weak_plt_shared.cc: New test. 14837 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh. 14838 (check_PROGRAMS): Add weak_plt. 14839 (check_DATA): Add weak_plt_shared.so. 14840 (weak_plt_main_pic.o, weak_plt): New targets. 14841 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets. 14842 * testsuite/Makefile.in: Rebuild. 14843 14844 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon 14845 gcctestdir/ld. 14846 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise. 14847 * testsuite/Makefile.in: Rebuild. 14848 14849 2008-08-04 Alan Modra <amodra (a] bigpond.net.au> 14850 14851 * Makefile.am (POTFILES.in): Set LC_ALL=C. 14852 * Makefile.in: Regenerate. 14853 * po/POTFILES.in: Regenerate. 14854 14855 2008-07-29 Ian Lance Taylor <iant (a] google.com> 14856 14857 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS 14858 symbols before other symbols. 14859 * testsuite/script_test_2.cc (test_addr): Declare. 14860 (test_addr_alias): Declare. 14861 (main): Check that test_addr and test_addr_alias have the right 14862 values. 14863 * testsuite/script_test_2.t: Define test_addr_alias and 14864 test_addr. 14865 14866 2008-07-24 Ian Lance Taylor <iant (a] google.com> 14867 14868 PR 5990 14869 * descriptors.cc: New file. 14870 * descriptors.h: New file. 14871 * gold-threads.h (class Hold_optional_lock): New class. 14872 * fileread.cc: Include "descriptors.h". 14873 (File_read::~File_read): Release descriptor rather than closing 14874 it. 14875 (File_read::open) [file]: Call open_descriptor rather than open. 14876 Set is_descriptor_opened_. 14877 (File_read::open) [memory]: Assert that descriptor is not open. 14878 (File_read::reopen_descriptor): New function. 14879 (File_read::release): Release descriptor. 14880 (File_read::do_read): Make non-const. Reopen descriptor. 14881 (File_read::read): Make non-const. 14882 (File_read::make_view): Reopen descriptor. 14883 (File_read::do_readv): Likewise. 14884 * fileread.h (class File_read): Add is_descriptor_opened_ field. 14885 Update declarations. 14886 * layout.cc: Include "descriptors.h". 14887 (Layout::create_build_id): Use open_descriptor rather than open. 14888 * output.cc: Include "descriptors.h". 14889 (Output_file::open): Use open_descriptor rather than open. 14890 * archive.cc (Archive::const_iterator): Change Archive to be 14891 non-const. 14892 (Archive::begin, Archive::end): Make non-const. 14893 (Archive::count_members): Likewise. 14894 * archive.h (class Archive): Update declarations. 14895 * object.h (Object::read): Make non-const. 14896 * Makefile.am (CCFILES): Add descriptors.cc. 14897 (HFILES): Add descriptors.h. 14898 * Makefile.in: Rebuild. 14899 14900 PR 6716 14901 * gold.h: Always include <clocale>. Add Solaris workarounds 14902 following code in binutils/sysdep.h. 14903 14904 PR 6048 14905 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether 14906 this->eh_frame_hdr_ is NULL before using it. 14907 14908 * dynobj.cc (Versions::Versions): Update comment. 14909 14910 * dynobj.cc (Versions::Versions): If there is an soname, use it as 14911 the base version name. 14912 14913 * stringpool.cc (Stringpool_template::add_with_length): Set key to 14914 array size plus one. 14915 (Stringpool_template::set_string_offsets): Subtract one from key 14916 before using it as an array index. 14917 (Stringpool_template::get_offset_with_length): Likewise. 14918 (Stringpool_template::write_to_buffer): Likewise. 14919 * stringpool.h (Stringpool_template::get_offset_from_key): 14920 Likewise. 14921 14922 2008-07-23 Ian Lance Taylor <iant (a] google.com> 14923 14924 PR 6658 14925 * object.h (Merged_symbol_value::value): Do our best to handle a 14926 negative addend. 14927 14928 PR 6647 14929 * script.cc (Version_script_info::get_versions): Don't add empty 14930 version tag to return value. 14931 (Version_script_info::get_symbol_version_helper): Change return 14932 type to bool. Add pversion parameter. Change all callers. 14933 (script_register_vers_node): Don't require a non-NULL tag. 14934 * script.h (class Version_script_info): Update declarations. 14935 (Version_script_info::get_symbol_version): Change return type to 14936 bool. Add version parameter. Change all callers. 14937 * symtab.cc (Sized_symbol::add_from_relobj): Rework version 14938 handling. Handle an empty version from a version script. 14939 (Symbol_table::define_special_symbol): Likewise. 14940 * testsuite/ver_test_10.script: New file. 14941 * testsuite/ver_test_10.sh: New file. 14942 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh. 14943 (check_DATA): Add ver_test_10.syms. 14944 (ver_test_10.syms, ver_test_10.so): New target. 14945 * testsuite/Makefile.in: Rebuild. 14946 14947 2008-07-23 Simon Baldwin <simonb (a] google.com> 14948 14949 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size 14950 to zero for undefined symbols from dynamic libraries. 14951 14952 2008-07-23 Ian Lance Taylor <iant (a] google.com> 14953 14954 * symtab.cc (Symbol_table::resolve): Remove version parameter. 14955 Change all callers. 14956 * symtab.h (class Symbol_table): Update declaration. 14957 * testsuite/ver_test_9.cc: New file. 14958 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9. 14959 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define. 14960 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define. 14961 (ver_test_9.so, ver_test_9.o): New targets. 14962 * testsuite/Makefile.in: Rebuild. 14963 14964 2008-07-22 Ian Lance Taylor <iant (a] google.com> 14965 14966 * options.h (class General_options): Define --check-sections. 14967 * layout.cc (Layout::set_segment_offsets): Handle 14968 --check-sections. 14969 14970 * options.h (class General_options): Define -n/--nmagic and 14971 -N/--omagic. 14972 * options.cc (General_options::finalize): For -n/--nmagic or 14973 -N/--omagic, set -static. 14974 * layout.cc (Layout::attach_allocated_section_to_segment): If 14975 -N/--omagic, don't put read-only and read-write sections in 14976 different segments. 14977 (Layout::find_first_load_seg): If -N/--omagic, don't insist on 14978 finding a read-only segment. 14979 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic, 14980 don't set the minimum segment alignment to the common page size, 14981 and don't set the file offset to the address modulo the page size. 14982 * script-sections.cc (Script_sections::create_segments): If 14983 -n/--omagic, don't put read-only and read-write sections in 14984 different segments. 14985 14986 * cref.cc: New file. 14987 * cref.h: New file. 14988 * options.h (class General_options): Add --print-symbol-counts. 14989 * main.cc (main): Issue defined symbol report if requested. 14990 * archive.cc (Archive::interpret_header): Make into a const member 14991 function. 14992 (Archive::add_symbols): Call Input_objects::archive_start and 14993 archive_stop. 14994 (Archive::const_iterator): Define new class. 14995 (Archive::begin, Archive::end): New functions. 14996 (Archive::include_all_members): Rewrite to use iterator. 14997 (Archive::count_members): New function. 14998 * archive.h (class Archive): Update declarations. 14999 (Archive::filename): New function. 15000 * object.cc: Include "cref.h". 15001 (Sized_relobj::Sized_relobj): Initialize defined_count_. 15002 (Sized_relobj::do_get_global_symbol_counts): New function. 15003 (Input_objects::add_object): Add object to cross-referencer. 15004 (Input_objects::archive_start): New function. 15005 (Input_objects::archive_stop): New function. 15006 (Input_objects::print_symbol_counts): New function. 15007 * object.h: Declare Cref and Archive. 15008 (Object::get_global_symbol_counts): New function. 15009 (Object::do_get_global_symbol_counts): New pure virtual function. 15010 (class Sized_relobj): Add defined_count_ field. Update 15011 declarations. 15012 (class Input_objects): Add cref_ field. Update constructor. 15013 Update declarations. 15014 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and 15015 defined_count_. 15016 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing 15017 symbol counts. 15018 (Sized_dynobj::do_get_global_symbol_counts): New function. 15019 * dynobj.h (class Sized_dynobj): Add fields symbols_ and 15020 defined_count_. Update declarations. Define Symbols typedef. 15021 * symtab.cc (Symbol_table::add_from_relobj): Add defined 15022 parameter. Change all callers. 15023 (Symbol_table::add_from_dynobj): Add sympointers and defined 15024 parameters. Change all callers. 15025 * symtab.h (class Symbol_table): Update declarations. 15026 * Makefile.am (CCFILES): Add cref.cc. 15027 (HFILES): Add cref.h. 15028 * Makefile.in: Rebuild. 15029 15030 2008-07-22 Simon Baldwin <simonb (a] google.com> 15031 15032 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size 15033 to zero when writing undefined symbols. 15034 15035 2008-07-22 Ian Lance Taylor <iant (a] google.com> 15036 15037 * output.cc (Output_section::add_input_section): Don't try to 15038 merge empty merge sections. 15039 15040 2008-07-21 Craig Silverstein <csilvers (a] google.com> 15041 15042 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol): 15043 Include symbol version in error message. 15044 15045 2008-07-20 Chris Demetriou <cgd (a] google.com> 15046 15047 * configure.ac (gold_cv_c_random_seed): New configured variable. 15048 (RANDOM_SEED_CFLAGS): New substituted variable. 15049 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS). 15050 * configure: Rebuild. 15051 * Makefile.in: Likewise. 15052 * testsuite/Makefile.in: Likewise. 15053 15054 2008-07-18 Ian Lance Taylor <iant (a] google.com> 15055 15056 * symtab.cc (Symbol_table::add_from_object): Rewrite the case 15057 where we see NAME/NULL and NAME/VERSION as separate symbols. 15058 * testsuite/ver_test_main.cc (main): Call t4. 15059 (t4, t4_2a): Define. 15060 * testsuite/ver_test_2.cc (t4_2): Define. 15061 * testsuite/ver_test_2.script: Put t4_2a in VER2. 15062 * testsuite/ver_test_4.cc (t4_2a): Define. 15063 * testsuite/ver_test_4.script: Put t4_2a in VER2. 15064 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare. 15065 15066 2008-07-17 Ian Lance Taylor <iant (a] google.com> 15067 15068 * dynobj.cc (Versions::add_def): If we give an error about a 15069 missing version, go ahead and create the version anyhow. 15070 15071 2008-07-10 Ian Lance Taylor <iant (a] google.com> 15072 15073 Handle output sections with more than 0x7fffffff bytes. 15074 * object.h (class Relobj): Change map_to_output_ to 15075 output_sections_, and just keep a section pointer. Change all 15076 uses. Move comdat group support to Sized_relobj. 15077 (Relobj::is_section_specially_mapped): Remove. 15078 (Relobj::output_section): Remove poff parameter. Change all 15079 callers. 15080 (Relobj::output_section_offset): New function. 15081 (Relobj::set_section_offset): Rewrite. 15082 (Relobj::map_to_output): Remove. 15083 (Relobj::output_sections): New function. 15084 (Relobj::do_output_section_offset): New pure virtual function. 15085 (Relobj::do_set_section_offset): Likewise. 15086 (class Sized_relobj): Add section_offsets_ field. Add comdat 15087 group support from Relobj. Update declarations. 15088 (Sized_relobj::get_output_section_offset): New function. 15089 (Sized_relobj::do_output_section_offset): New function. 15090 (Sized_relobj::do_set_section_offset): New function. 15091 * object.cc (Relobj::output_section_address): Remove. 15092 (Sized_relobj::Sized_relobj): Initialize new fields. 15093 (Sized_relobj::include_section_group): Cast find_kept_object to 15094 Sized_relobj. 15095 (Sized_relobj::include_linkonce_section): Likewise. 15096 (Sized_relobj::do_layout): Use separate arrays for output section 15097 and output offset. 15098 (Sized_relobj::do_count_local_symbols): Change map_to_output to 15099 output_sections. 15100 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to 15101 output_sections and section_offsets. 15102 (Sized_relobj::write_local_symbols): Likewise. 15103 (map_to_kept_section): Compute output address directly. 15104 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to 15105 output_sections and section_offsets. 15106 (Sized_relobj::write_sections): Likewise. 15107 (Sized_relobj::relocate_sections): Likewise. 15108 * symtab.cc (sized_finalize_symbol): Use output_section_offset. 15109 * output.h (class Output_reloc): Update declarations. Change 15110 u2_.relobj to Sized_relobj*. 15111 (class Output_data_reloc): Change add functions to use 15112 Sized_relobj*. 15113 * output.cc (Output_reloc::Output_reloc): Change relobj to 15114 Sized_relobj*. 15115 (Output_reloc::local_section_offset): Change return type to 15116 Elf_Addr. Use get_output_section_offset. 15117 (Output_reloc::get_address): Likewise. 15118 (Output_section::is_input_address_mapped): Don't call 15119 is_section_specially_mapped. 15120 (Output_section::output_offset): Likewise. 15121 (Output_section::output_address): Likewise. 15122 (Output_section::starting_output_address): Likewise. 15123 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object 15124 parameter to Sized_relobj*. 15125 (Copy_relocs::need_copy_reloc): Likewise. 15126 (Copy_relocs::save): Likewise. 15127 * copy-relocs.h (class Copy_relocs): Update declarations. 15128 (class Copy_relocs::Copy_reloc_entry): Change constructor to use 15129 Sized_relobj*. Change relobj_ field to Sized_relobj*. 15130 * target-reloc.h (relocate_for_relocatable): Change 15131 offset_in_output_section type to Elf_Addr. Change code that uses 15132 it as well. 15133 * layout.cc (Layout::layout): Always set *off. 15134 * mapfile.cc (Mapfile::print_input_section): Use 15135 output_section_offset. 15136 * i386.cc (Target_i386::copy_reloc): Change object parameter to 15137 Sized_relobj*. 15138 * powerpc.cc (Target_powerpc::copy_reloc): Likewise. 15139 * sparc.cc (Target_sparc::copy_reloc): Likewise. 15140 * x86_64.cc (Target_x86_64::copy_reloc): Likewise. 15141 15142 2008-07-03 Ian Lance Taylor <iant (a] google.com> 15143 15144 * layout.cc (Layout::include_section): Do not discard unrecognized 15145 SHT_STRTAB sections. 15146 15147 2008-06-30 Craig Silverstein <csilvers (a] cs.stanford.edu> 15148 15149 * script.cc (Lex::can_continue_name): Make '?' allowable in 15150 version-script names. 15151 * testsuite/version_script.map: Change glob pattern to use '?' 15152 15153 2008-06-30 Manish Singh <yosh (a] gimp.org> 15154 15155 PR 6585 15156 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line): 15157 Correct typo. 15158 15159 2008-06-30 Ian Lance Taylor <iant (a] google.com> 15160 15161 PR 6660 15162 PR 6682 15163 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both 15164 versions]: Don't try to read the value in the contents, since we 15165 don't use it. Use the template endianness when writing. 15166 15167 2008-06-25 Cary Coutant <ccoutant (a] google.com> 15168 15169 * fileread.cc (File_read::make_view): Assert on zero-length view. 15170 * object.cc (Sized_relobj::do_read_symbols): Don't try to read 15171 symbol table when there are no symbols to read. 15172 15173 2008-06-23 Craig Silverstein <csilvers (a] google.com> 15174 15175 * version.cc (version_string): Bump to 1.7 15176 15177 2008-06-18 Craig Silverstein <csilvers (a] google.com> 15178 15179 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast 15180 constant 0xFFFF to type Valtype. 15181 (Powerpc_relocate_functions::rel16_ha): Likewise. 15182 15183 2008-06-17 Ian Lance Taylor <iant (a] google.com> 15184 15185 * output.h (Output_section::Input_section): Initialize p2align_ to 15186 zero for Output_section_data constructors. 15187 (Output_section::Input_section::addralign): If not an input 15188 section, return the alignment of the Output_section_data. 15189 * testsuite/copy_test.cc: New file. 15190 * testsuite/copy_test_1.cc: New file. 15191 * testsuite/copy_test_2.cc: New file. 15192 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test. 15193 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables. 15194 (copy_test_LDFLAGS, copy_test_LDADD): New variables. 15195 (copy_test_1_pic.o, copy_test_1.so): New targets. 15196 (copy_test_2_pic.o, copy_test_2.so): New targets. 15197 * testsuite/Makefile.in: Rebuild. 15198 15199 * script-sections.cc (Script_sections::place_orphan): Initialize 15200 local variable exact. 15201 15202 2008-06-13 David Edelsohn <edelsohn (a] gnu.org> 15203 15204 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC. 15205 15206 2008-06-12 David Edelsohn <edelsohn (a] gnu.org> 15207 David S. Miller <davem (a] davemloft.net> 15208 15209 * powerpc.cc: New file. 15210 * Makefile.am (TARGETSOURCES): Add powerpc.cc 15211 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT) 15212 * configure.tgt: Add entries for powerpc-* and powerpc64-*. 15213 * Makefile.in: Rebuild. 15214 15215 2008-06-09 Ian Lance Taylor <iant (a] google.com> 15216 15217 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and 15218 <exception>. 15219 (throwing, orig_terminate): New static variables. 15220 (terminate_handler): New static function. 15221 (t2): Set terminate handler. 15222 15223 2008-06-05 Kris Van Hees <kris.van.hees (a] oracle.com> 15224 15225 PR 6584 15226 * binary.cc (Binary_to_elf::sized_convert): Fix .data 15227 alignment. 15228 15229 2008-05-30 Cary Coutant <ccoutant (a] google.com> 15230 15231 * archive.cc (Archive::include_all_members) Correct to step 15232 over symbol table and extended name table in thin archives. 15233 15234 2008-05-29 Kris Van Hees <kris.van.hees (a] oracle.com> 15235 15236 PR 6407 15237 * target-reloc.h (relocate_for_relocatable): Fix new_offset 15238 calculation. 15239 15240 2008-05-28 Caleb Howe <cshowe (a] google.com> 15241 15242 * reduced_debug_output.cc: New file. 15243 * reduced_debug_output.h: New file. 15244 * options.h (class General_options): Add --strip-debug-non-line. 15245 * options.cc (General_options::finalize): Add strip_debug_non_line 15246 to the strip heirarchy. 15247 * layout.h (class Layout): Add debug_abbrev_ and debug_info_ 15248 fields. 15249 * layout.cc: Include "reduced_debug_output.h". 15250 (Layout::Layout): Initialize new fields. 15251 (line_only_debug_sections): New static array. 15252 (is_lines_only_debug_sections): New static inline function. 15253 (Layout::include_section): Handle --strip-debug-non-line. 15254 (Layout::make_output_section): If --strip-debug-non-line, build 15255 new output sections for .debug_abbrev and .debug_info. 15256 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace 15257 gold. Warn about possible overflow. 15258 (read_signed_LEB_128): Likewise. 15259 * dwarf_reader.h: (read_unsigned_LEB_128): Declare. 15260 (read_signed_LEB_128): Declare. 15261 * Makefile.am (CCFILES): Add reduced_debug_output.cc. 15262 (HFILES): Add reduced_debug_output.h. 15263 * Makefile.in: Rebuild. 15264 15265 2008-05-21 Ian Lance Taylor <iant (a] google.com> 15266 15267 * mapfile.cc: New file. 15268 * mapfile.h: New file. 15269 * options.h (class General_options): Add -M/--print-map and -Map. 15270 * options.cc (General_options::finalize): Make -M equivalent to 15271 -Map -. 15272 * main.cc: Include <cstdio> and "mapfile.h". 15273 (main): Open mapfile if requested. 15274 * gold.cc (class Middle_runner): Add mapfile_ field. Update 15275 constructor. Change caller. 15276 (queue_initial_tasks): Add mapfile parameter. Change caller. 15277 (queue_middle_tasks): Likewise. 15278 * gold.h (queue_initial_tasks, queue_middle_tasks): Update 15279 declarations. 15280 * archive.cc: Include "mapfile.h". 15281 (Archive::add_symbols): Add mapfile parameter. Change all 15282 callers. Pass mapfile, symbol, and reason to include_member. 15283 (Archive::include_all_members): Add mapfile parameter. Change all 15284 callers. 15285 (Archive::include_member): Add mapfile, sym, and why parameters. 15286 Change all callers. Report inclusion to map file. 15287 * archive.h: Include "fileread.h". 15288 (class Archive): Update declarations. 15289 (Archive::file): New const method. 15290 (class Add_archive_symbols): Add mapfile_ field. Update 15291 constructor. Change all callers. 15292 * readsyms.h (class Read_symbols): Likewise. 15293 (class Finish_group): Likewise. 15294 (class Read_script): Likewise. 15295 * common.cc: Include "mapfile.h". 15296 (Symbol_table::allocate_commons): Add mapfile parameter. Change 15297 all callers. 15298 (Symbol_table::do_allocate_commons): Likewise. 15299 (Symbol_table::do_allocate_commons_list): Likewise. Report common 15300 symbol allocation to mapfile. 15301 * common.h (class Allocate_commons_task): Add mapfile_ field. 15302 Update constructor. Change all callers. 15303 * symtab.h (class Symbol_table): Update declarations. 15304 * layout.cc: Include "mapfile.h". 15305 (Layout_task_runner::run): Print information to mapfile. 15306 (Layout::create_gold_note): Change Output_data_fixed_space to 15307 Output_data_zero_fill. 15308 (Layout::create_build_id): Likewise. 15309 (Layout::print_to_mapfile): New function. 15310 * layout.h (class Layout_task_runner): Add mapfile_ field. Update 15311 constructor. Change caller. 15312 (class Layout): Declare print_to_mapfile. 15313 * output.cc (Output_section::Input_section::print_to_mapfile): New 15314 function. 15315 (Output_section::add_input_section): If producing a map, always 15316 add to input_sections_ list. 15317 (Output_section::do_print_to_mapfile): New function. 15318 (Output_segment::print_sections_to_mapfile): New function. 15319 (Output_segment::print_section_list_to_mapfile): New function. 15320 * output.h: Include "mapfile.h". 15321 (Output_data::print_to_mapfile): New function. 15322 (Output_data::do_print_to_mapfile): New virtual function. 15323 (Output_segment_headers::do_print_to_mapfile): New function. 15324 (Output_file_header::do_print_to_mapfile): New function. 15325 (Output_data_const::do_print_to_mapfile): New function. 15326 (class Output_data_const_buffer): Add map_name_ field. Update 15327 constructor. Change all callers. Add do_print_to_mapfile 15328 function. 15329 (class Output_data_fixed_space): Likewise. 15330 (class Output_data_space): Likewise. 15331 (class Output_data_zero_fill): New class. 15332 (Output_data_strtab::do_print_to_mapfile): New function. 15333 (Output_data_reloc_base::do_print_to_mapfile): New function. 15334 (Output_relocatable_relocs::do_print_to_mapfile): New function. 15335 (Output_data_group::do_print_to_mapfile): New function. 15336 (Output_data_got::do_print_to_mapfile): New function. 15337 (Output_data_dynamic::do_print_to_mapfile): New function. 15338 (Output_symtab_xindex::do_print_to_mapfile): New function. 15339 (class Output_section): Declare do_print_to_mapflie. Declare 15340 print_to_mapfile in Input_section. 15341 (class Output_segment): Declare new functions. 15342 * object.h (Sized_relobj::symbol_count): New function. 15343 * script-sections.cc 15344 (Output_section_element_dot_assignment::set_section_addresses): 15345 Change Output_data_fixed_space to Output_data_zero_fill. 15346 (Output_data_expression::do_print_to_mapfile): New function. 15347 * script.cc (read_input_script): Add mapfile parameter. Change 15348 all callers. 15349 * script.h (read_input_script): Update declaration. 15350 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function. 15351 (Eh_frame::do_print_to_mapfile): New function. 15352 * merge.h (Output_merge_data::do_print_to_mapfile): New function. 15353 (Output_merge_string::do_print_to_mapfile): New function. 15354 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New 15355 function. 15356 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New 15357 function. 15358 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New 15359 function. 15360 * Makefile.am (CCFILES): Add mapfile.cc. 15361 (HFILES): Add mapfile.h. 15362 * Makefile.in: Rebuild. 15363 15364 2008-05-19 Ian Lance Taylor <iant (a] google.com> 15365 15366 * options.h (class General_options): Add -z relro. 15367 * layout.cc (Layout::Layout): Initialize relro_segment_. 15368 (Layout::add_output_section_data): Return the output section. 15369 (Layout::make_output_section): Rcognize relro sections and mark 15370 them appropriately. 15371 (Layout::attach_allocated_section_to_segment): Put relro sections 15372 in a PT_GNU_RELRO segment. 15373 (Layout::create_initial_dynamic_sections): Mark the .dynamic 15374 section as relro. 15375 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after 15376 PT_TLS segments. 15377 (Layout::linkonce_mapping): Map d.rel.ro.local to 15378 .data.rel.ro.local. 15379 (Layout::output_section_name): Us .data.rel.ro.local for any 15380 section which begins with that. 15381 * layout.h (class Layout): Update add_output_section_data 15382 declaration. Add relro_segment_ field. 15383 * output.cc (Output_section::Output_section): Initialize is_relro_ 15384 and is_relro_local_ fields. 15385 (Output_segment::add_output_section): Group relro sections. 15386 (Output_segment::is_first_section_relro): New function. 15387 (Output_segment::maximum_alignment): If there is a relro section, 15388 align the segment to the common page size. 15389 (Output_segment::set_section_addresses): Track whether we are 15390 looking at relro sections. If the last section is a relro 15391 section, align to the common page size. 15392 (Output_segment::set_section_list_addresses): Add in_relro 15393 parameter. Change all callers. Align to the page size when 15394 moving from relro to non-relro section. 15395 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO 15396 segment. 15397 * output.h (class Output_section): Add is_relro_ and 15398 is_relro_local_ fields. 15399 (Output_section::is_relro): New function. 15400 (Output_section::set_is_relro): New function. 15401 (Output_section::is_relro_local): New function. 15402 (Output_section::set_is_relro_local): New function. 15403 (class Output_segment): Update declarations. 15404 * i386.cc (Target_i386::got_section): Mark .got section as relro. 15405 * sparc.cc (Target_sparc::got_section): Likewise. 15406 * x86_64.cc (Target_x86_64::got_section): Likewise. 15407 * testsuite/relro_test_main.cc: New file. 15408 * testsuite/relro_test.cc: New file. 15409 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test. 15410 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables. 15411 (relro_test_LDFLAGS, relro_test_LDADD): New variables. 15412 (relro_test.so, relro_test_pic.o): New targets. 15413 * testsuite/Makefile.in: Rebuild. 15414 15415 2008-05-16 Ian Lance Taylor <iant (a] google.com> 15416 15417 * output.cc (Output_segment::add_output_section): Remove front 15418 parameter. 15419 * output.h (class Output_segment): Remove 15420 add_initial_output_section and overloaded add_output_section. 15421 Update declaration of remaining add_output_section. 15422 * layout.cc (Layout::create_interp): Call add_output_section 15423 rather than add_initial_output_section. 15424 (Layout::finish_dynamic_section): Likewise. 15425 15426 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type 15427 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we 15428 know the dynamic type. 15429 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_ 15430 field. Initialize it in constructor. 15431 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS 15432 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD. 15433 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block 15434 reloc. 15435 15436 * output.cc (Output_reloc::get_address): Change return type to 15437 Elf_Addr. 15438 * output.h (class Output_reloc): Update get_address declaration. 15439 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types 15440 for section addresses. 15441 15442 2008-05-09 Ian Lance Taylor <iant (a] google.com> 15443 15444 PR 6493 15445 * gold.cc (gold_nomem): Use return value of write. 15446 15447 2008-05-08 Ian Lance Taylor <iant (a] google.com> 15448 15449 * symtab.c (Symbol::init_base_output_data): Add version 15450 parameter. Change all callers. 15451 (Symbol::init_base_output_segment): Likewise. 15452 (Symbol::init_base_constant): Likewise. 15453 (Symbol::init_base_undefined): Likewise. 15454 (Sized_symbol::init_output_data): Likewise. 15455 (Sized_symbol::init_output_segment): Likewise. 15456 (Sized_symbol::init_constant): Likewise. 15457 (Sized_symbol::init_undefined): Likewise. 15458 (Symbol_table::do_define_in_output_data): If the new symbol has a 15459 version, mark it as the default. 15460 (Symbol_table::do_define_in_output_segment): Likewise. 15461 (Symbol_table::do_define_as_constant): Likewise. 15462 * symtab.h (class Symbol): Update declarations. 15463 (class Sized_symbol): Likewise. 15464 * resolve.cc (Symbol::override_version): New function. 15465 (Symbol::override_base): Call override_version. 15466 (Symbol::override_base_with_special): Likewise. 15467 * testsuite/ver_script_8.script: New file. 15468 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8. 15469 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define. 15470 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define. 15471 (ver_test_8_1.so, ver_test_8_2.so): New targets. 15472 15473 2008-05-06 Ian Lance Taylor <iant (a] google.com> 15474 15475 PR 6049 15476 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end 15477 functions. 15478 (class General_options): Remove existing --undefined, and add 15479 --no-undefined instead. Add new --undefined as synonym for -u. 15480 * archive.cc (Archive::add_symbols): Check whether symbol was 15481 named with -u. 15482 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table. 15483 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change 15484 all uses. Add IS_UNDEFINED. Update declarations to split 15485 different versions of init_base. Declare init_base_undefined. 15486 (Symbol::is_defined): Handle IS_UNDEFINED. 15487 (Symbol::is_undefined): Likewise. 15488 (Symbol::is_weak_undefined): Call is_undefined. 15489 (Symbol::is_absolute): Handle IS_CONSTANT. 15490 (class Sized_symbol): Update declarations to split different 15491 versions of init. Declare init_undefined. 15492 (class Symbol_table): Declare new functions. 15493 * symtab.cc (Symbol::init_base_object): Rename from init_base. 15494 Change all callers. 15495 (Symbol::init_base_output_data): Likewise. 15496 (Symbol::init_base_output_segment): Likewise. 15497 (Symbol::init_base_constant): Likewise. 15498 (Symbol::init_base_undefined): New function. 15499 (Sized_symbol::init_object): Rename from init. Change all 15500 callers. 15501 (Sized_symbol::init_output_data): Likewise. 15502 (Sized_symbol::init_output_segment): Likewise. 15503 (Sized_symbol::init_constant): Likewise. 15504 (Sized_symbol::init_undefined): New function. 15505 (Symbol_table::add_undefined_symbols_from_command_line): New 15506 function. 15507 (Symbol_table::do_add_undefined_symbols_from_command_line): New 15508 function. 15509 (Symbol::final_value_is_known): Handle IS_UNDEFINED. 15510 (Symbol::output_section): Likewise. 15511 (Symbol::set_output_section): Likewise. 15512 (Symbol_table::sized_finalize_symbol): Likewise. 15513 (Symbol_table::sized_write_globals): Likewise. 15514 * resolve.cc (Symbol_table::should_override): Likewise. 15515 (Symbol::override_base_with_special): Likewise. 15516 15517 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected 15518 symbol, change it to have default visibility. 15519 * testsuite/protected_1.cc: New file. 15520 * testsuite/protected_2.cc: New file. 15521 * testsuite/protected_3.cc: New file. 15522 * testsuite/protected_main_1.cc: New file. 15523 * testsuite/protected_main_2.cc: New file. 15524 * testsuite/protected_main_3.cc: New file. 15525 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1. 15526 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define. 15527 (protected_1_LDFLAGS, protected_1_LDADD): Define. 15528 (protected_1.so): New target. 15529 (protected_1_pic.o, protected_2_pic.o): New targets. 15530 (protected_3_pic.o): New target. 15531 (check_PROGRAMS): Add protected_2. 15532 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define. 15533 (protected_2_LDFLAGS, protected_2_LDADD): Define. 15534 * testsuite/Makefile.in: Rebuild. 15535 15536 * options.h (DEFINE_var): Add set_user_set_##varname__. 15537 (DEFINE_bool_alias): New macro. 15538 (class General_options): Define -Bstatic using DEFINE_bool_alias 15539 rather than DEFINE_special. Add --undefined as an alias for -z 15540 defs. 15541 * options.cc (General_options::parse_Bstatic): Remove. 15542 15543 * options.h (class General_options): Add --fatal-warnings. 15544 * main.cc (main): Implement --fatal-warnings. 15545 * errors.h (Errors::warning_count): New function. 15546 15547 * options.h (class General_options): Add -Bsymbolic-functions. 15548 * symtab.h (Symbol::is_preemptible): Check for 15549 -Bsymbolic-functions. 15550 15551 2008-05-05 Ian Lance Taylor <iant (a] google.com> 15552 15553 * options.h (DEFINE_bool): For DASH_Z, create the negative option 15554 as noVARNAME rather than no-VARNAME. 15555 (class General_options): Add option -z combreloc. 15556 * output.h (class Output_reloc) [SHT_REL]: Declare compare and 15557 get_address. 15558 (Output_reloc::sort_before) [SHT_REL]: New function. 15559 (Output_reloc::sort_before) [SHT_RELA]: New function. 15560 (class Output_data_reloc_base): Add sort_relocs_ field. Define 15561 Sort_relocs_comparison. 15562 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs 15563 parameter. Change all callers. 15564 (Output_data_reloc::Output_data_reloc) [both versions]: Add 15565 sort_relocs parameter. Change all callers. 15566 * output.cc (Output_reloc::get_address): New function, broken out 15567 of write_rel. 15568 (Output_reloc::write_rel): Call it. 15569 (Output_reloc::compare): New function. 15570 (Output_data_reloc_base::do_write): Optionally sort relocs. 15571 15572 * configure.ac: If targ_extra_obj is set, link it in. 15573 * configure.tgt: Initialize all variables. 15574 (x86_64*): Set targ_extra_obj and targ_extra_size. 15575 * configure: Rebuild. 15576 15577 * object.cc (Sized_relobj::include_section_group): Adjust section 15578 indexes read from group data. Build vector to pass to 15579 layout_group. 15580 * layout.cc (Layout::layout_group): Add flags and shndxes 15581 parameters. Remove contents parameter. Change caller. Update 15582 explicit instantiations. 15583 * layout.h (class Layout): Update layout_group declaration. 15584 * output.cc (Output_data_group::Output_data_group): Add flags and 15585 input_shndxes parameters. Remove contents parameter. Change 15586 caller. 15587 (Output_data_group::do_write): Change input_sections_ to 15588 input_shndxes_. 15589 * output.h (class Output_data_group): Update constructor 15590 declaration. Rename input_sections_ to input_shndxes_. 15591 * testsuite/many_sections_test.cc: Add template. 15592 15593 2008-04-30 Cary Coutant <ccoutant (a] google.com> 15594 15595 * target-reloc.h (relocate_section): Fix dead-pointer bug. 15596 15597 * layout.cc (Layout::include_section): Refactored check for debug 15598 info section. 15599 (Layout::add_comdat): Add new parameters. Change type 15600 of signature parameter. Add object and shndx to signatures table. 15601 (Layout::find_kept_object): New function. 15602 * layout.h: Include <cstring>. 15603 (Layout::is_debug_info_section): New function. 15604 (Layout::add_comdat): Add new parameters. 15605 (Layout::find_kept_object): New function. 15606 (Layout::Kept_section): New struct. 15607 (Layout::Signatures): Change type of map range. 15608 * object.cc (Relobj::output_section_address): New function. 15609 (Sized_relobj::include_section_group): Add new parameters. Change 15610 calls to Layout::add_comdat. Change to build table of kept comdat 15611 groups and table mapping discarded sections to kept sections. 15612 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter. 15613 (Sized_relobj::do_layout): Change calls to include_section_group and 15614 include_linkonce_section. 15615 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol 15616 value to zero when section is discarded. 15617 (Sized_relobj::map_to_kept_section): New function. 15618 * object.h (Relobj::output_section_address): New function. 15619 (Relobj::Comdat_group): New type. 15620 (Relobj::find_comdat_group): New function. 15621 (Relobj::Comdat_group_table): New type. 15622 (Relobj::Kept_comdat_section): New type. 15623 (Relobj::Kept_comdat_section_table): New type. 15624 (Relobj::add_comdat_group): New function. 15625 (Relobj::set_kept_comdat_section): New function. 15626 (Relobj::get_kept_comdat_section): New function. 15627 (Relobj::comdat_groups_): New field. 15628 (Relobj::kept_comdat_sections_): New field. 15629 (Symbol_value::input_value): Update comment. 15630 (Sized_relobj::map_to_kept_section) New function. 15631 (Sized_relobj::include_linkonce_section): Add new parameter. 15632 * target-reloc.h (Comdat_behavior): New type. 15633 (get_comdat_behavior): New function. 15634 (relocate_section): Add code to map a discarded section to the 15635 corresponding kept section when applying a relocation. 15636 15637 2008-04-30 Craig Silverstein <csilvers (a] google.com> 15638 15639 * dwarf_reader.cc (next_generation_count): New static var. 15640 (Addr2line_cache_entry): New struct. 15641 (addr2line_cache): New static var. 15642 (Dwarf_line_info::one_addr2line): Added caching. 15643 (Dwarf_line_info::clear_addr2line_cache): New function. 15644 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add 15645 cache-size parameter. 15646 (Dwarf_line_info::one_addr2line_cache): New function. 15647 * symtab.cc (Symbol_table::detect_odr_violations): Pass 15648 new cache-size argument to one_addr2line(), and clear cache. 15649 15650 2008-04-28 Cary Coutant <ccoutant (a] google.com> 15651 15652 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and 15653 R_386_PC8 relocations. 15654 15655 2008-04-23 Ian Lance Taylor <iant (a] google.com> 15656 15657 * object.cc (Sized_relobj::include_section_group): Check for 15658 invalid section group. 15659 15660 * object.cc (make_elf_object): Correct test for 64-bit ELF file 15661 header size. 15662 15663 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather 15664 than read for file header. 15665 * archive.cc (Archive::include_member): Likewise. 15666 15667 2008-04-23 Paolo Bonzini <bonzini (a] gnu.org> 15668 15669 * aclocal.m4: Regenerate. 15670 * configure: Regenerate. 15671 15672 2008-04-19 Ian Lance Taylor <iant (a] google.com> 15673 15674 * version.cc (version_string): Bump to 1.6. 15675 15676 * testsuite/Makefile.am (many_sections_r_test): New target. 15677 (many_sections_r_test_SOURCES): Remove. 15678 (many_sections_r_test_DEPENDENCIES): Remove. 15679 (many_sections_r_test_LDFLAGS): Remove. 15680 (many_sections_r_test_LDADD): Remove. 15681 15682 * object.cc (Sized_relobj::do_add_symbols): Always pass 15683 local_symbol_count_ to add_from_relobj. 15684 15685 * testsuite/Makefile.am (many_sections_check.h): Only check one in 15686 every thousand variables. 15687 * testsuite/Makefile.in: Rebuild. 15688 15689 * object.cc (Xindex::initialize_symtab_xindex): New function. 15690 (Xindex::read_symtab_xindex): New function. 15691 (Xindex::sym_xindex_to_shndx): New function. 15692 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if 15693 available. 15694 (Sized_relobj::do_initialize_xindex): New function. 15695 (Sized_relobj::do_read_symbols): Adjust section links. 15696 (Sized_relobj::symbol_section_and_value): Add is_ordinary 15697 parameter. Change all callers. 15698 (Sized_relobj::include_section_group): Adjust section links and 15699 symbol section indexes. 15700 (Sized_relobj::do_layout): Adjust section links. 15701 (Sized_relobj::do_count_local_symbols): Adjust section links and 15702 symbol section indexes. 15703 (Sized_relobj::do_finalize_local_symbols): Distinguish between 15704 ordinary and special symbols. 15705 (Sized_relobj::write_local_symbols): Add symtab_xindex and 15706 dynsym_xindex parameters. Change all callers. Adjust section 15707 links. Use SHN_XINDEX when needed. 15708 (Sized_relobj::get_symbol_location_info): Adjust section links. 15709 Don't get fooled by special symbols. 15710 * object.h (class Xindex): Define. 15711 (class Object): Add xindex_ parameter. Declare virtual functoin 15712 do_initialize_xindex. 15713 (Object::adjust_sym_shndx): New function. 15714 (Object::set_xindex): New protected function. 15715 (class Symbol_value): Add is_ordinary_shndx_ field. 15716 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_. 15717 (Symbol_value::value): Assert ordinary section. 15718 (Symbol_value::initialize_input_to_output_map): Likewise. 15719 (Symbol_value::set_input_shndx): Add is_ordinary parameter. 15720 Change all callers. 15721 (Symbol_value::input_shndx): Add is_ordinary parameter. Change 15722 all callers. 15723 (class Sized_relobj): Update declarations. 15724 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary 15725 parameter. Change all callers. 15726 (Sized_relobj::adjust_shndx): New function. 15727 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_ 15728 field. 15729 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx 15730 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section 15731 for SHT_DYNSYM section if available. Set dynsym_shndx_ field. 15732 (Sized_dynobj::read_dynsym_section): Adjust section links. 15733 (Sized_dynobj::read_dynamic): Likewise. 15734 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust 15735 section links. 15736 (Sized_dynobj::do_initialize_xindex): New function. 15737 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare 15738 do_initialize_xindex. 15739 (Sized_dynobj::adjust_shndx): New function. 15740 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and 15741 dynsym_xindex_ fields. 15742 (Layout::finalize): Add a call to set_section_indexes before 15743 creating the symtab sections. 15744 (Layout::set_section_indexes): Don't do anything if the section 15745 already has a section index. 15746 (Layout::create_symtab_sections): Add shnum parameter. Change 15747 caller. Create .symtab_shndx section if needed. 15748 (Layout::create_shdrs): Add shstrtab_section parameter. Change 15749 caller. 15750 (Layout::allocated_output_section_count): New function. 15751 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if 15752 needed. 15753 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_ 15754 fields. Update declarations. 15755 (Layout::symtab_xindex): New function. 15756 (Layout::dynsym_xindex): New function. 15757 (class Write_symbols_task): Add layout_ field. 15758 (Write_symbols_task::Write_symbols_task): Add layout parameter. 15759 Change caller. 15760 * output.cc (Output_section_headers::Output_section_headers): Add 15761 shstrtab_section parameter. Change all callers. 15762 (Output_section_headers::do_sized_write): Store overflow values 15763 for section count and section string table section index in 15764 section header zero. 15765 (Output_file_header::do_sized_write): Check for overflow of 15766 section count and section string table section index. 15767 (Output_symtab_xindex::do_write): New function. 15768 (Output_symtab_xindex::endian_do_write): New function. 15769 * output.h (class Output_section_headers): Add shstrtab_section_. 15770 Update declarations. 15771 (class Output_symtab_xindex): Define. 15772 (Output_section::has_out_shndx): New function. 15773 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_ 15774 field. 15775 (Symbol::init_base): Add st_shndx and is_ordinary parameters. 15776 Change all callers. 15777 (Sized_symbol::init): Likewise. 15778 (Symbol::output_section): Check for ordinary symbol. 15779 (Symbol_table::add_from_object): Remove orig_sym parameter. Add 15780 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all 15781 callers. 15782 (Symbol_table::add_from_relobj): Add symndx_offset parameter. 15783 Change all callers. Simplify handling of symbols from sections 15784 not included in the link. 15785 (Symbol_table::add_from_dynobj): Handle ordinary symbol 15786 distinction. 15787 (Weak_alias_sorter::operator()): Assert that symbols are 15788 ordinary. 15789 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol 15790 distinction. 15791 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex 15792 parameters. Change all callers. 15793 (Symbol_table::sized_write_globals): Likewise. Handle ordinary 15794 symbol distinction. Use SHN_XINDEX when needed. 15795 (Symbol_table::write_section_symbol): Add symtab_xindex 15796 parameter. Change all callers. 15797 (Symbol_table::sized_write_section_symbol): Likewise. Use 15798 SHN_XINDEX when needed. 15799 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update 15800 declarations. 15801 (Symbol::shndx): Add is_ordinary parameter. Change all callers. 15802 (Symbol::is_defined): Check is_ordinary. 15803 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise. 15804 (Symbol::is_absolute, Symbol::is_common): Likewise. 15805 (class Sized_symbol): Update declarations. 15806 (class Symbol_table): Update declarations. 15807 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary 15808 parameters. Change all callers. 15809 (Sized_symbol::override): Likewise. 15810 (Symbol_table::override): Likewise. 15811 (symbol_to_bits): Add is_ordinary parameter. Change all callers. 15812 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx, 15813 is_ordinary, and orig_st_shndx parameters. Change all callers. 15814 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol 15815 to be in an ordinary section. 15816 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add 15817 object and is_ordinary parameters. Change all callers. 15818 (Sized_dwarf_line_info::read_relocs): Add object parameter. 15819 Change all callers. Don't add undefined or non-ordinary symbols 15820 to reloc_map_. 15821 (Sized_dwarf_line_info::read_line_mappings): Add object parameter. 15822 Change all callers. 15823 * dwarf_reader.h (class Sized_dwarf_line_info): Update 15824 declarations. 15825 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol. 15826 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links. 15827 (Sized_relobj::relocate_sections): Likewise. 15828 * target-reloc.h (scan_relocs): Adjust section symbol index. 15829 (scan_relocatable_relocs): Likewise. 15830 * i386.cc (Scan::local): Check for ordinary symbols. 15831 * sparc.cc (Scan::local): Likewise. 15832 * x86_64.cc (Scan::local): Likewise. 15833 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls 15834 to symbol_section_and_value. 15835 * testsuite/many_sections_test.cc: New file. 15836 * testsuite/Makefile.am (BUILT_SOURCES): Define. 15837 (check_PROGRAMS): Add many_sections_test. 15838 (many_sections_test_SOURCES): Define. 15839 (many_sections_test_DEPENDENCIES): Define. 15840 (many_sections_test_LDFLAGS): Define. 15841 (BUILT_SOURCES): Add many_sections_define.h. 15842 (many_sections_define.h): New target. 15843 (BUILT_SOURCES): Add many_sections_check.h. 15844 (many_sections_check.h): New target. 15845 (check_PROGRAMS): Add many_sections_r_test. 15846 (many_sections_r_test_SOURCES): Define. 15847 (many_sections_r_test_DEPENDENCIES): Define. 15848 (many_sections_r_test_LDFLAGS): Define. 15849 (many_sections_r_test_LDADD): Define. 15850 (many_sections_r_test.o): New target. 15851 * testsuite/Makefile.in: Rebuild. 15852 15853 2008-04-17 Cary Coutant <ccoutant (a] google.com> 15854 15855 * errors.cc (Errors::info): New function. 15856 (gold_info): New function. 15857 * errors.h (Errors::info): New function. 15858 * gold.h (gold_info): New function. 15859 * object.cc (Input_objects::add_object): Print trace output. 15860 * options.cc (options::parse_set): New function. 15861 (General_options::parse_wrap): Deleted. 15862 (General_options::General_options): Deleted initializer. 15863 * options.h (options::String_set): New typedef. 15864 (options::parse_set): New function. 15865 (DEFINE_set): New macro. 15866 (General_options::wrap): Changed to use DEFINE_set. Changed 15867 callers of any_wrap_symbols and is_wrap_symbol. 15868 (General_options::trace, General_options::trace_symbol): 15869 New options. 15870 (General_options::any_wrap_symbols, General_options::is_wrap_symbol) 15871 (General_options::wrap_symbols_): Deleted. 15872 * symtab.cc (Symbol_table::add_from_object): Print trace output. 15873 15874 2008-04-17 David S. Miller <davem (a] davemloft.net> 15875 15876 * options.cc (General_options::parse_V): New function. 15877 * options.h: Add entries for -V and -Qy. 15878 15879 2008-04-17 Ian Lance Taylor <iant (a] google.com> 15880 15881 * common.cc (Symbol_table::allocate_commons): Remove options 15882 parameter. Change caller. 15883 (Symbol_table::do_allocate_commons): Remove options parameter. 15884 Change caller. Just call do_allocate_commons_list twice. 15885 (Symbol_table::do_allocate_commons_list): New function, broken out 15886 of do_allocate_commons. 15887 * common.h (class Allocate_commons_task): Remove options_ field. 15888 Update constructor. 15889 * symtab.cc (Symbol_table::Symbol_table): Initialize 15890 tls_commons_. 15891 (Symbol_table::add_from_object): Put TLS common symbols on 15892 tls_commons_ list. 15893 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols 15894 which are IN_OUTPUT_DATA. 15895 * symtab.h (class Symbol_table): Add tls_commons_ field. Update 15896 allocate_commons and do_allocate_commons declarations. Declare 15897 do_allocate_commons_list. 15898 * gold.cc (queue_middle_tasks): Update creation of 15899 Allocate_commons_task to not pass options. 15900 * testsuite/Makefile.am (INCLUDES): Add -I.. . 15901 (TLS_TEST_C_FLAGS): New variable. 15902 (tls_test_c_pic.o): New target. 15903 (tls_test_shared.so): Link in tls_test_c_pic.o. 15904 (tls_test_c_pic_ie.o): New target. 15905 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o. 15906 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o. 15907 (tls_test_c.o): New target. 15908 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o. 15909 (tls_pic_test_LDADD): Likewise. 15910 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o. 15911 (tls_shared_gd_to_ie_test_LDADD): Likewise. 15912 (tls_test_c_gnu2.o): New target. 15913 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add 15914 tls_test_c_gnu2.o. 15915 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise. 15916 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o. 15917 (tls_test_shared_nonpic.so): Link in tls_test_c.o. 15918 * testsuite/tls_test.cc: Include "config.h". 15919 (t_last): Call t11_last. 15920 * testsuite/tls_test.h (t11, t11_last): Declare. 15921 * testsuite/tls_test_c.c: New file. 15922 * testsuite/tls_test_main.cc (thread_routine): Call t11. 15923 * configure.ac: Check for OpenMP support. 15924 * configure, config.in, Makefile.in: Rebuild. 15925 * testsuite/Makefile.in: Rebuild. 15926 15927 2008-04-16 Cary Coutant <ccoutant (a] google.com> 15928 15929 * i386.cc (Target_i386::define_tls_base_symbol): New function. 15930 (Target_i386::tls_base_symbol_defined_): New field. 15931 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol. 15932 (Target_i386::Scan::global): Likewise. 15933 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol. 15934 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function. 15935 (Target_x86_64::tls_base_symbol_defined_): New field. 15936 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol. 15937 (Target_x86_64::Scan::global): Likewise. 15938 15939 2008-04-16 Cary Coutant <ccoutant (a] google.com> 15940 15941 * symtab.h (Symbol::is_strong_undefined): Removed unused function. 15942 (Symbol::needs_plt_entry): Allow weak undefined symbols. 15943 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when 15944 building shared libraries. 15945 * testsuite/Makefile.am (weak_undef_nonpic_test): New target. 15946 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o) 15947 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets. 15948 * testsuite/Makefile.in: Rebuild. 15949 * testsuite/weak_undef.h: New file. 15950 * testsuite/weak_undef_file1.cc: Add extra test cases. 15951 * testsuite/weak_undef_file2.cc: Likewise. 15952 * testsuite/weak_undef_test.cc: Likewise. 15953 15954 2008-04-16 David S. Miller <davem (a] davemloft.net> 15955 15956 * sparc.cc (Target_sparc::Scan): Change from struct to class. 15957 Add issued_non_pic_error_ field. Declare check_non_pic. 15958 (Target_sparc::Scan::check_non_pic): New function. 15959 (Target_sparc::Scan::local): Call check_non_pic as appropriate. 15960 (Target_sparc::Scan::global): Likewise. 15961 15962 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64. 15963 * configure: Rebuild. 15964 15965 * options.h (DEFINE_enable): New macro. 15966 (new_dtags): New enable option. 15967 (initfirst, interpose, loadfltr, nodefaultlib, 15968 nodelete, nodlopen, nodump): New -z options. 15969 * layout.cc (Layout:finish_dynamic_section): If new 15970 dtags enabled, emit DT_RUNPATH. Also, emit a 15971 DT_FLAGS_1 containing any specified -z flags. 15972 15973 2008-04-16 Ian Lance Taylor <iant (a] google.com> 15974 15975 * copy-relocs.cc: New file. 15976 * copy-relocs.h: New file. 15977 * reloc.cc: Remove Copy_relocs code. 15978 * reloc.h: Likewise. 15979 * reloc-types.h (struct Reloc_types) [both versions]: Add 15980 get_reloc_addend_noerror. 15981 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add 15982 variants of add_global which take an addend which must be zero. 15983 * i386.cc: Include "copy-relocs.h". 15984 (class Target_i386): Change type of copy_relocs_ to variable, 15985 update initializer. 15986 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class. 15987 Change all callers. 15988 (Target_i386::do_finalize_sections): Change handling of 15989 copy_relocs_. 15990 * sparc.cc: Include "copy-relocs.h". 15991 (class Target_sparc): Change type of copy_relocs_ to variable, 15992 update initializer. 15993 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class. 15994 Change all callers. 15995 (Target_sparc::do_finalize_sections): Change handling of 15996 copy_relocs_. 15997 * x86_64.cc: Include "copy-relocs.h". 15998 (class Target_x86_64): Change type of copy_relocs_ to variable, 15999 update initializer. 16000 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs 16001 class. Change all callers. 16002 (Target_x86_64::do_finalize_sections): Change handling of 16003 copy_relocs_. 16004 * Makefile.am (CCFILES): Add copy-relocs.cc. 16005 (HFILES): Add copy-relocs.h. 16006 16007 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild. 16008 16009 * testsuite/script_test_4.sh: Permit leading zeroes. 16010 16011 2008-04-15 Ian Lance Taylor <iant (a] google.com> 16012 16013 * script-sections.cc (Script_sections::create_segments): Use 16014 header_size_adjustment even when there is enough room for the 16015 headers. 16016 * testsuite/script_test_4.sh: New file. 16017 * testsuite/script_test_4.t: New file. 16018 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh. 16019 (check_DATA): Add script_test_4.stdout. 16020 (MOSTLYCLEANFILES): Likewise. 16021 (script_test_4): New target. 16022 (script_test_4.stdout): New target. 16023 * testsuite/Makefile.in: Rebuild. 16024 16025 * sparc.cc: Add definitions for Output_data_plt_sparc class 16026 constants. 16027 16028 2008-04-14 David S. Miller <davem (a] davemloft.net> 16029 16030 * sparc.cc: New file. 16031 * Makefile.am (TARGETSOURCES): Add sparc.cc 16032 (ALL_TARGETOBJS): Add sparc.$(OBJEXT) 16033 * configure.tgt: Document targ_extra_size and 16034 targ_extra_big_endian. Add entries for sparc-* and 16035 sparc64-*. 16036 * configure.ac: Handle targ_extra_size and 16037 targ_extra_big_endian. 16038 * Makefile.in: Rebuild. 16039 * configure: Likewise. 16040 * po/POTFILES.in: Likewise. 16041 * po/gold.pot: Likewise. 16042 16043 2008-04-14 Ian Lance Taylor <iant (a] google.com> 16044 16045 * layout.cc (Layout::Layout): Initialize sections_are_attached_. 16046 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR 16047 in the name/type/flags to section mapping. Don't call 16048 allocate_output_section. 16049 (Layout::choose_output_section): Change parameter from adjust_name 16050 to is_input_section. Don't permit input sections after sections 16051 are attached to segments. Don't call allocate_output_section. 16052 (Layout::layout_eh_frame): Call update_flags_for_input_section, 16053 not write_enable_output_section. 16054 (Layout::make_output_section): Don't push to 16055 unattached_section_list_ nor call attach_to_segment. Call 16056 attach_section_to_segment if sections are attached. 16057 (Layout::attach_sections_to_segments): New function. 16058 (Layout::attach_section_to_segment): New function. 16059 (Layout::attach_allocated_section_to_segment): Rename from 16060 attach_to_segment. Remove flags parameter. 16061 (Layout::allocate_output_section): Remove function. 16062 (Layout::write_enable_output_section): Remove function. 16063 * layout.h (class Layout): Update for above changes. Add new 16064 field sections_are_attached_. 16065 * output.h (Output_section::update_flags_for_input_section): New 16066 function. 16067 * output.cc (Output_section::add_input_section): Call 16068 update_flags_for_input_section. 16069 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments. 16070 16071 2008-04-11 Cary Coutant <ccoutant (a] google.com> 16072 16073 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously 16074 thought unnecessary. 16075 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise. 16076 16077 2008-04-11 Ian Lance Taylor <iant (a] google.com> 16078 16079 * output.h (class Output_section_data): Remove inline definition 16080 of set_addralign. 16081 * output.cc (Output_section_data::set_addralign): New function. 16082 16083 2008-04-11 Cary Coutant <ccoutant (a] google.com> 16084 16085 Add support for TLS descriptors for i386 and x86_64. 16086 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function. 16087 (Target_i386::Relocate::tls_desc_gd_to_le): New function. 16088 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and 16089 GOT_TYPE_TLS_DESC. 16090 (Target_i386::got_mod_index_entry): Remove unnecessary code. 16091 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and 16092 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec 16093 relocations. 16094 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation. 16095 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations; 16096 Fix problem with initial-exec relocations. 16097 (Target_i386::Relocate::relocate_tls): Likewise. 16098 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE 16099 relaxation. 16100 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add 16101 support for section-plus-offset dynamic table entries. 16102 * output.h (Output_data_dynamic::add_section_plus_offset): New function. 16103 (Output_data_dynamic::Dynamic_entry): Add support for 16104 section-plus-offset dynamic table entries. 16105 (Output_data_dynamic::Classification): Likewise. 16106 (Output_data_dynamic::classification_): Renamed offset_. 16107 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function. 16108 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function. 16109 (Target_x86_64::make_plt_section): New function. 16110 (Target_x86_64::reserve_tlsdesc_entries): New function. 16111 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter. 16112 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function. 16113 (Output_data_plt_x86_64::has_tlsdesc_entry): New function. 16114 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function. 16115 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function. 16116 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field. 16117 (Output_data_plt_x86_64::set_final_data_size): Move out of line; 16118 add extra PLT entry for TLS descriptors. 16119 (Output_data_plt_x86_64::got_): New field. 16120 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field. 16121 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new 16122 fields. 16123 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS 16124 descriptors. 16125 (Target_x86_64::make_plt_entry): Factor out make_plt_section. 16126 (Target_x86_64::got_mod_index_entry): Remove unnecessary code. 16127 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and 16128 R_386_TLS_DESC_CALL relocations. 16129 (Target_x86_64::Scan::global): Likewise. 16130 (Target_x86_64::do_finalize_sections): Add dynamic table entries 16131 for TLS descriptors. 16132 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation. 16133 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations. 16134 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with 16135 GD-to-IE relaxation. 16136 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT 16137 and TLS_DESCRIPTORS. 16138 * Makefile.in: Rebuild. 16139 * configure: Rebuild. 16140 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target. 16141 (tls_test_shared2.so): New target. 16142 (tls_shared_gd_to_ie_test_SOURCES): New variable. 16143 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable. 16144 (tls_shared_gd_to_ie_test_LDFLAGS): New variable. 16145 (tls_shared_gd_to_ie_test_LDADD): New variable. 16146 (tls_shared_gnu2_gd_to_ie_test): New target. 16147 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so): 16148 New targets. 16149 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable. 16150 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable. 16151 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable. 16152 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable. 16153 (tls_shared_gnu2_test): New target. 16154 (tls_test_gnu2_shared.so): New target. 16155 (tls_shared_gnu2_test_SOURCES): New variable. 16156 (tls_shared_gnu2_test_DEPENDENCIES): New variable. 16157 (tls_shared_gnu2_test_LDFLAGS): New variable. 16158 (tls_shared_gnu2_test_LDADD): New variable. 16159 * testsuite/Makefile.in: Rebuild. 16160 * testsuite/Makefile. 16161 16162 2008-04-11 Ian Lance Taylor <iant (a] google.com> 16163 16164 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on 16165 justsyms.t. 16166 * testsuite/Makefile.in: Rebuild. 16167 16168 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes 16169 long. 16170 * testsuite/script_test_2.cc (main): Adjust test. 16171 16172 2008-04-11 David S. Miller <davem (a] davemloft.net> 16173 Ian Lance Taylor <iant (a] google.com> 16174 16175 * options.h (General_options): Add entries for '-Y' and 16176 '-relax'. 16177 * options.cc (General_options:finalize): If -Y was used, add those 16178 entries to the library path instead of the default "/lib" and 16179 "/usr/lib". 16180 16181 2008-04-11 David S. Miller <davem (a] davemloft.net> 16182 16183 * testsuite/justsyms.t: Start at 0x100. 16184 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion. 16185 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes 16186 long. 16187 * testsuite/script_test_2.cc: Adjust string and section length 16188 checks. 16189 16190 2008-04-09 Ian Lance Taylor <iant (a] google.com> 16191 16192 PR gold/5996 16193 * script-sections.cc (Sections_element::allocate_to_segment): Add 16194 orphan parameter. 16195 (Output_section_definition::allocate_to_segment): Likewise. 16196 (Orphan_output_section::allocate_to_segment): Likewise. 16197 (Script_sections::attach_sections_using_phdrs_clause): Don't 16198 propagate non-PT_LOAD segments to orphan sections. 16199 * testsuite/Makefile.am (script_test_3.stdout): Generate using 16200 readelf rather than objdump. 16201 * testsuite/script_test_3.sh: Adjust accordingly. Test that 16202 .interp section and PT_INTERP segment are the same size. 16203 * testsuite/Makefile.in: Rebuild. 16204 16205 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak 16206 aliases for symbols defined in the same object. 16207 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test. 16208 (weak_alias_test_SOURCES): New variable. 16209 (weak_alias_test_DEPENDENCIES): New variable. 16210 (weak_alias_test_LDFLAGS): New variable. 16211 (weak_alias_test_LDADD): New variable. 16212 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets. 16213 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets. 16214 (weak_alias_test_3.o): New target. 16215 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets. 16216 * testsuite/weak_alias_test_main.cc: New file. 16217 * testsuite/weak_alias_test_1.cc: New file. 16218 * testsuite/weak_alias_test_2.cc: New file. 16219 * testsuite/weak_alias_test_3.cc: New file. 16220 16221 2008-04-08 Ian Lance Taylor <iant (a] google.com> 16222 16223 * options.h (class General_options): Add --noinhibit-exec option. 16224 * main.cc (main): Check --noinhibit-exec. 16225 16226 * options.h (class General_options): Define --wrap as a special 16227 option. Add wrap_symbols_ field. 16228 (General_options::any_wrap_symbols): New function. 16229 (General_options::is_wrap_symbol): New function. 16230 * options.cc (General_options::parse_wrap): New function. 16231 (General_options::General_options): Initialize wrap_symbols_. 16232 * symtab.cc (Symbol_table::wrap_symbol): New function. 16233 (Symbol_table::add_from_object): Handle --wrap. 16234 * symtab.h (class Symbol_table): Declare wrap_symbol. 16235 * target.h (Target::wrap_char): New function. 16236 (Target::Target_info): Add wrap_char field. 16237 * i386.cc (Target_i386::i386_info): Initialize wrap_char. 16238 * x86_64.cc (Target_x86_64::x86_64_info): Likewise. 16239 * testsuite/testfile.cc (Target_test::test_target_info): 16240 Likewise. 16241 16242 * errors.cc (Errors::undefined_symbol): Mention symbol version if 16243 there is one. 16244 16245 * layout.h (class Layout): Add added_eh_frame_data_ field. 16246 * layout.cc (Layout::Layout): Initialize new field. 16247 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame 16248 output section until we find a section we merged successfully. 16249 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require 16250 that the size be non-zero. 16251 16252 * merge.cc (Object_merge_map::get_output_offset): Remove inline 16253 qualifier. 16254 16255 2008-04-08 Craig Silverstein <csilvers (a] google.com> 16256 16257 * configure.ac: Export new conditional variable HAVE_ZLIB. 16258 * testsuite/Makefile.am (flagstest_o_specialfile): Condition 16259 on HAVE_ZLIB. 16260 (flagstest_o_specialfile_and_compress_debug_sections): Likewise. 16261 * configure, Makefile.in, testsuite/Makefile.in: Rebuild. 16262 16263 2008-04-07 Ian Lance Taylor <iant (a] google.com> 16264 16265 * version.cc (version_string): Set to "1.5". 16266 16267 * x86_64.cc (Target_x86_64::Scan): Change from struct to class. 16268 Add issued_non_pic_error_ field. Declare check_non_pic. 16269 (Target_x86_64::Scan::check_non_pic): New function. 16270 (Target_x86_64::Scan::local): Call check_non_pic as appropriate. 16271 (Target_x86_64::Scan::global): Likewise. 16272 16273 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add 16274 addend parameter. Change caller. Handle merge sections. 16275 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from 16276 Address to Addend. Don't add in the result of 16277 local_section_offset, pass down the addend and use the returned 16278 value. 16279 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef. 16280 Update declarations of local_section_offset and symbol_value. 16281 * testsuite/two_file_test_1.cc (t18): New function. 16282 * testsuite/two_file_test_2.cc (f18): New function. 16283 * testsuite/two_file_test_main.cc (main): Call t18. 16284 * testsuite/two_file_test.h (t18, f18): Declare. 16285 16286 * configure.ac: Don't test for objdump, c++filt, or readelf. 16287 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT 16288 conditionals. 16289 (TEST_READELF): New variable. 16290 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables. 16291 (check_PROGRAMS): Add two_file_strip_test. 16292 (two_file_strip_test): New target. 16293 (check_PROGRAMS): Add two_file_same_shared_strip_test. 16294 (two_file_same_shared_strip_test_SOURCES): New variable. 16295 (two_file_same_shared_strip_test_DEPENDENCIES): New variable. 16296 (two_file_same_shared_strip_test_LDFLAGS): New variable. 16297 (two_file_same_shared_strip_test_LDADD): New variable. 16298 (two_file_shared_strip.so): New target. 16299 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF. 16300 (ver_test_5.syms, ver_test_7.syms): Likewise. 16301 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT. 16302 (strip_test_3.stdout): Use TEST_OBJDUMP. 16303 * configure, Makefile.in, testsuite/Makefile.in: Rebuild. 16304 16305 2008-04-04 Cary Coutant <ccoutant (a] google.com> 16306 16307 * symtab.h (Symbol::is_weak_undefined): New function. 16308 (Symbol::is_strong_undefined): New function. 16309 (Symbol::is_absolute): New function. 16310 (Symbol::needs_plt_entry): Exclude weak undefined symbols. 16311 (Symbol::needs_dynamic_reloc): Exclude weak undefined and 16312 absolute symbols. 16313 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test. 16314 (weak_undef_test): New target. 16315 * testsuite/Makefile.in: Rebuild. 16316 * testsuite/weak_undef_file1.cc: New file. 16317 * testsuite/weak_undef_file2.cc: New file. 16318 * testsuite/weak_undef_test.cc: New file. 16319 16320 2008-04-03 Craig Silverstein <csilvers (a] google.com> 16321 16322 * compressed_output.h (class Output_compressed_section): Use 16323 unsigned buffer. 16324 * compressed_output.cc (zlib_compress): Use unsigned buffers, 16325 add zlib header. 16326 (zlib_compressed_suffix): Removed. 16327 (Output_compressed_section::set_final_data_size): Use unsigned 16328 buffers. 16329 * testsuite/Makefile.am (flagstest_compress_debug_sections): 16330 Fix linker invocation. 16331 (flagstest_o_specialfile_and_compress_debug_sections): 16332 Likewise. 16333 * testsuite/Makefile.in: Regenerated. 16334 16335 2008-04-02 David S. Miller <davem (a] davemloft.net> 16336 16337 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog, 16338 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned. 16339 16340 2008-04-02 Craig Silverstein <csilvers (a] google.com> 16341 16342 * TODO: New file. 16343 16344 2008-04-02 Ian Lance Taylor <iant (a] google.com> 16345 16346 * fileread.cc (File_read::find_view): Add byteshift and vshifted 16347 parameters. Update for new key type to views_. Change all 16348 callers. 16349 (File_read::read): Adjust for byteshift in returned view. 16350 (File_read::add_view): New function, broken out of 16351 find_and_make_view. 16352 (File_read::make_view): New function, broken out of 16353 find_and_make_view. 16354 (File_read::find_or_make_view): Add offset and aligned 16355 parameters. Rewrite accordingly. Change all callers. 16356 (File_read::get_view): Add offset and aligned parameters. Adjust 16357 for byteshift in return value. 16358 (File_read::get_lasting_view): Likewise. 16359 * fileread.h (class File_read): Update declarations. 16360 (class File_read::View): Add byteshift_ field. Add byteshift to 16361 constructor. Add byteshift method. 16362 * archive.h (Archive::clear_uncached_views): New function. 16363 (Archive::get_view): Add aligned parameter. Change all callers. 16364 * object.h (Object::get_view): Add aligned parameter. Change all 16365 callers. 16366 (Object::get_lasting_view): Likewise. 16367 16368 * fileread.cc (File_read::release): Don't call clear_views if 16369 there are multiple objects. 16370 * fileread.h (File_read::clear_uncached_views): New function. 16371 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views 16372 on the archive. 16373 16374 2008-03-31 Cary Coutant <ccoutant (a] google.com> 16375 16376 Add thin archive support. 16377 * archive.cc (Archive::armagt): New const. 16378 (Archive::setup): Remove task parameter and calls to unlock. 16379 (Archive::unlock_nested_archives): New function. 16380 (Archive::read_header): Add nested_off parameter. Change 16381 all callers. 16382 (Archive::interpret_header): Likewise. 16383 (Archive::include_all_members): Change to handle thin 16384 archives. 16385 (Archive::include_member): Likewise. 16386 * archive.h (Archive::Archive): Add new parameters and 16387 initializers. 16388 (Archive::armagt): New const. 16389 (Archive::setup): Remove task parameter. 16390 (Archive::unlock_nested_archives): New function. 16391 (Archive::read_header): Add nested_off parameter. 16392 (Archive::interpret_header): Likewise. 16393 (Archive::Nested_archive_table): New typedef. 16394 (Archive::is_thin_archive_): New field. 16395 (Archive::nested_archives_): New field. 16396 (Archive::options_): New field. 16397 (Archive::dirpath_): New field. 16398 (Archive::task_): New field. 16399 * readsyms.cc (Read_symbols::do_read_symbols): Add check 16400 for thin archives. Pass additional parameters to 16401 Archive::Archive. Unlock the archive file after calling 16402 Archive::setup. 16403 16404 2008-03-29 Ian Lance Taylor <iant (a] google.com> 16405 16406 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a 16407 version symbol to be local. 16408 * testsuite/ver_test_4.sh: New file. 16409 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh. 16410 (check_DATA): Add ver_test_4.syms. 16411 (ver_test_4.syms): New target. 16412 * testsuite/Makefile.in: Rebuild. 16413 16414 * output.cc 16415 (Output_section::Input_section_sort_entry::has_priority): New 16416 function. 16417 (Output_section::Input_section_sort_entry::match_file_name): New 16418 function. 16419 (Output_section::Input_section_sort_entry::match_section_name): 16420 Remove. 16421 (Output_section::Input_section_sort_entry::match_section_name_prefix): 16422 Remove. 16423 (Output_section::Input_section_sort_entry::match_section_file): 16424 Remove. 16425 (Output_section::Input_section_sort_compare::operator()): Rewrite 16426 using new Input_section_sort_entry functions. Sort crtbegin and 16427 crtend first. Sort sections with no priority before sections with 16428 a priority. 16429 * testsuite/initpri1.c (d3): Check j != 4. 16430 (cd5): New constructor/destructor function. 16431 (main): Check j != 2. 16432 16433 * symtab.cc (Symbol_table::add_from_object): If we don't use the 16434 new symbol when resolving, don't call set_is_default. 16435 * testsuite/ver_test_7.cc: New file. 16436 * testsuite/ver_test_7.sh: New file. 16437 * testsuite/Makefile.am (ver_test_7.so): New target. 16438 (ver_test_7.o): New target. 16439 (check_SCRIPTS): Add ver_test_7.sh. 16440 (check_DATA): Add ver_test_7.syms. 16441 (ver_test_7.syms): New target. 16442 16443 2008-03-28 Ian Lance Taylor <iant (a] google.com> 16444 16445 * layout.cc (Layout::layout): If we see an input section with a 16446 name that needs sorting, set the must_sort flag for the output 16447 section. 16448 (Layout::make_output_section): If the name of the output section 16449 indicates that it might require sorting, set the may_sort flag. 16450 * output.h (Output_section::may_sort_attached_input_sections): New 16451 function. 16452 (Output_section::set_may_sort_attached_input_sections): New 16453 function. 16454 (Output_section::must_sort_attached_input_sections): New 16455 function. 16456 (Output_section::set_must_sort_attached_input_sections): New 16457 function. 16458 (class Output_section): Declare Input_section_sort_entry. Define 16459 Input_section_sort_compare. Declare 16460 sort_attached_input_sections. Add new fields: 16461 may_sort_attached_input_sections_, 16462 must_sort_attached_input_sections_, 16463 attached_input_sections_are_sorted_. 16464 * output.cc (Output_section::Output_section): Initialize new 16465 fields. 16466 (Output_section::add_input_section): Add an entry to 16467 input_sections_ if may_sort or must_sort are true. 16468 (Output_section::set_final_data_size): Call 16469 sort_attached_input_sections if necessary. 16470 (Output_section::Input_section_sort_entry): Define new class. 16471 (Output_section::Input_section_sort_compare::operator()): New 16472 function. 16473 (Output_section::sort_attached_input_sections): New function. 16474 * configure.ac: Check whether the compiler supports constructor 16475 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional. 16476 * testsuite/initpri1.c: New file. 16477 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if 16478 CONSTRUCTOR_PRIORITY. 16479 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables. 16480 (initpri1_LDFLAGS): New variable. 16481 * configure, Makefile.in, testsuite/Makefile.in: Rebuild. 16482 16483 2008-03-27 Ian Lance Taylor <iant (a] google.com> 16484 16485 * common.cc (Sort_commons::operator): Correct sorting algorithm. 16486 * testsuite/common_test_1.c: New file. 16487 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1. 16488 (common_test_1_SOURCES): New variable. 16489 (common_test_1_DEPENDENCIES): New variable. 16490 (common_test_1_LDFLAGS): New variable. 16491 16492 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_ 16493 and commons_ correctly when NAME/VERSION does not override 16494 NAME/NULL. 16495 * testsuite/ver_test_6.c: New file. 16496 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6 16497 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables. 16498 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables. 16499 16500 2008-03-26 Ian Lance Taylor <iant (a] google.com> 16501 16502 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version 16503 of an undefined symbol from a version script. 16504 * testsuite/Makefile.am (ver_test_5.so): New target. 16505 (ver_test_5.o): New target. 16506 (check_SCRIPTS): Add ver_test_5.sh. 16507 (check_DATA): Add ver_test_5.syms. 16508 (ver_test_5.syms): New target. 16509 * testsuite/ver_test_5.cc: New file. 16510 * testsuite/ver_test_5.script: New file. 16511 * testsuite/ver_test_5.sh: New file. 16512 * Makefile.in, testsuite/Makefile.in: Rebuild. 16513 16514 PR gold/5986 16515 Fix problems building gold with gcc 4.3.0. 16516 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define. 16517 (gold_error_at_location, gold_warning_at_location): Use it. 16518 * configure.ac: Check whether we can compile and use a template 16519 function with a printf attribute. 16520 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value 16521 when jumping over bytes. 16522 * object.cc: Instantiate Object::read_section_data. 16523 * debug.h: Include <cstring> 16524 * dwarf_reader.cc: Include <algorithm> 16525 * main.cc: Include <cstring>. 16526 * options.cc: Include <cstring>. 16527 * output.cc: Include <cstring>. 16528 * script.cc: Include <cstring>. 16529 * script.h: Include <string>. 16530 * symtab.cc: Include <cstring> and <algorithm>. 16531 * target-select.cc: Include <cstring>. 16532 * version.cc: Include <string>. 16533 * testsuite/testmain.cc: Include <cstdlib>. 16534 * configure, config.in: Rebuild. 16535 16536 2008-03-25 Ian Lance Taylor <iant (a] google.com> 16537 16538 * options.cc: Include "../bfd/bfdver.h". 16539 (options::help): Print bug reporting address. 16540 16541 * version.cc (print_version): Adjust output for current value of 16542 BFD_VERSION_STRING. 16543 16544 * NEWS: New file. 16545 16546 * options.cc (options::help): Print list of supported targets. 16547 * target-select.h: Include <vector>. 16548 (class Target_selector): Make machine_, size_, and is_big_endian_ 16549 fields const. Add bfd_name_ and instantiated_target_ fields. 16550 (Target_selector::Target_selector): Add bfd_name parameter. 16551 (Target_selector::recognize): Make non-virtual, call 16552 do_recognize. 16553 (Target_selector::recognize_by_name): Make non-virtual, call 16554 do_recognize_by_name. 16555 (Target_selector::supported_names): New function. 16556 (Target_selector::bfd_name): New function. 16557 (Target_selector::do_instantiate_target): New pure virtual 16558 function. 16559 (Target_selector::do_recognize): New virtual function. 16560 (Target_selector::do_recognize_by_name): New virtual function. 16561 (Target_selector::instantiate_target): New private function. 16562 (supported_target_names): Declare. 16563 * target-select.cc (Target_selector::Target_selector): Update for 16564 new parameter and fields. 16565 (select_target_by_name): Check that the name matches before 16566 calling recognize_by_name. 16567 (supported_target_names): New function. 16568 * i386.cc (class Target_selector_i386): Update Target_selector 16569 constructor call. Remove recognize and recognize_by_name. Add 16570 do_instantiate_target. 16571 * x86_64.cc (class Target_selector_x86_64): Likewise. 16572 * testsuite/testfile.cc (class Target_selector_test): Update for 16573 changes to Target_selector. 16574 16575 * README: Rewrite, with some notes on unsupported features. 16576 16577 2008-03-24 Cary Coutant <ccoutant (a] google.com> 16578 16579 * i386.cc (Target_i386::Got_type): New enum declaration. 16580 (Target_i386::Scan::local): Updated callers of Output_data_got 16581 member functions. 16582 (Target_i386::Scan::global): Likewise. 16583 (Target_i386::Relocate::relocate): Likewise. 16584 (Target_i386::Relocate::relocate_tls): Likewise. 16585 * object.h (Got_offset_list): New class. 16586 (Sized_relobj::local_has_got_offset): Added got_type parameter. 16587 (Sized_relobj::local_got_offset): Likewise. 16588 (Sized_relobj::set_local_got_offset): Likewise. 16589 (Sized_relobj::local_has_tls_got_offset): Removed. 16590 (Sized_relobj::local_tls_got_offset): Removed. 16591 (Sized_relobj::set_local_tls_got_offset): Removed. 16592 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets. 16593 * output.cc (Output_data_got::add_global): Added got_type parameter. 16594 (Output_data_got::add_global_with_rel): Likewise. 16595 (Output_data_got::add_global_with_rela): Likewise. 16596 (Output_data_got::add_global_pair_with_rel): New function. 16597 (Output_data_got::add_global_pair_with_rela): New function. 16598 (Output_data_got::add_local): Added got_type parameter. 16599 (Output_data_got::add_local_with_rel): Likewise. 16600 (Output_data_got::add_local_with_rela): Likewise. 16601 (Output_data_got::add_local_pair_with_rel): New function. 16602 (Output_data_got::add_local_pair_with_rela): New function. 16603 (Output_data_got::add_global_tls): Removed. 16604 (Output_data_got::add_global_tls_with_rel): Removed. 16605 (Output_data_got::add_global_tls_with_rela): Removed. 16606 (Output_data_got::add_local_tls): Removed. 16607 (Output_data_got::add_local_tls_with_rel): Removed. 16608 (Output_data_got::add_local_tls_with_rela): Removed. 16609 * output.h (Output_data_got::add_global): Added got_type parameter. 16610 (Output_data_got::add_global_with_rel): Likewise. 16611 (Output_data_got::add_global_with_rela): Likewise. 16612 (Output_data_got::add_global_pair_with_rel): New function. 16613 (Output_data_got::add_global_pair_with_rela): New function. 16614 (Output_data_got::add_local): Added got_type parameter. 16615 (Output_data_got::add_local_with_rel): Likewise. 16616 (Output_data_got::add_local_with_rela): Likewise. 16617 (Output_data_got::add_local_pair_with_rel): New function. 16618 (Output_data_got::add_local_pair_with_rela): New function. 16619 (Output_data_got::add_global_tls): Removed. 16620 (Output_data_got::add_global_tls_with_rel): Removed. 16621 (Output_data_got::add_global_tls_with_rela): Removed. 16622 (Output_data_got::add_local_tls): Removed. 16623 (Output_data_got::add_local_tls_with_rel): Removed. 16624 (Output_data_got::add_local_tls_with_rela): Removed. 16625 * resolve.cc (Symbol::override_base_with_special): Removed 16626 reference to has_got_offset_ field. 16627 * symtab.cc (Symbol::init_fields): Replaced initialization 16628 of got_offset_ with got_offsets_. Removed initialization 16629 of has_got_offset_ 16630 * symtab.h (Symbol::has_got_offset): Aded got_type parameter. 16631 (Symbol::got_offset): Likewise. 16632 (Symbol::set_got_offset): Likewise. 16633 (Symbol::has_tls_got_offset): Removed. 16634 (Symbol::tls_got_offset): Removed. 16635 (Symbol::set_tls_got_offset): Removed. 16636 (Symbol::got_offset_): Removed. 16637 (Symbol::tls_mod_got_offset_): Removed. 16638 (Symbol::tls_pair_got_offset_): Removed. 16639 (Symbol::got_offsets_): New field. 16640 (Symbol::has_got_offset): Removed. 16641 (Symbol::has_tls_mod_got_offset): Removed. 16642 (Symbol::has_tls_pair_got_offset): Removed. 16643 * x86_64.cc (Target_x86_64::Got_type): New enum declaration. 16644 (Target_x86_64::Scan::local): Updated callers of Output_data_got 16645 member functions. 16646 (Target_x86_64::Scan::global): Likewise. 16647 (Target_x86_64::Relocate::relocate): Likewise. 16648 (Target_x86_64::Relocate::relocate_tls): Likewise. 16649 16650 2008-03-25 Ben Elliston <bje (a] au.ibm.com> 16651 16652 * yyscript.y: Fix spelling error in comment. 16653 16654 2008-03-24 Ian Lance Taylor <iant (a] google.com> 16655 16656 * options.h (class General_options): Define build_id option. 16657 * layout.h (class Layout): Declare write_build_id, create_note, 16658 create_build_id. Add build_id_note_ member. 16659 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>, 16660 "libiberty.h", "md5.h", "sha1.h". 16661 (Layout::Layout): Initialize eh_frame_data_, 16662 eh_frame_hdr_section_, and build_id_note_. 16663 (Layout::finalize): Call create_build_id. 16664 (Layout::create_note): New function, broken out of 16665 Layout::create_gold_note. 16666 (Layout::create_gold_note): Call create_note. 16667 (Layout::create_build_id): New function. 16668 (Layout::write_build_id): New function. 16669 (Close_task_runner::run): Call write_build_id. 16670 16671 * x86_64.cc: Correct license to GPLv3. 16672 16673 2008-03-23 Ian Lance Taylor <iant (a] google.com> 16674 16675 * options.cc: Include "demangle.h". 16676 (parse_optional_string): New function. 16677 (parse_long_option): Handle takes_optional_argument. 16678 (parse_short_option): Update dash_z initializer. Handle 16679 takes_optional_argument. 16680 (General_options::General_options): Initialize do_demangle_. 16681 (General_options::finalize): Set do_demangle_. Handle demangling 16682 style. 16683 * options.h (parse_optional_string): Declare. 16684 (struct One_option): Add optional_arg field. Update constructor. 16685 Update call constructor calls. Add takes_optional_argument 16686 function. 16687 (DEFINE_var): Add optional_arg__ parameter. Change all callers. 16688 (DEFINE_optional_string): Define. 16689 (General_options::demangle): Change from DEFINE_bool to 16690 DEFINE_optional_string. 16691 (General_options::no_demangle): New function. 16692 (General_options::do_demangle): New function. 16693 (General_options::set_do_demangle): New function. 16694 (General_options::execstack_status_): Move definition to end of 16695 class definition. 16696 (General_options::static_): Likewise. 16697 (General_options::do_demangle_): New field. 16698 * object.cc (big_endian>::get_symbol_location_info): Call 16699 Options::do_demangle, not Options::demangle. 16700 * symtab.cc (demangle): Likewise. 16701 16702 2008-03-22 Ian Lance Taylor <iant (a] google.com> 16703 16704 * gold.h: Include <cstddef> and <sys/types.h> 16705 * options.h: Include <cstring>. 16706 16707 2008-03-21 Ian Lance Taylor <iant (a] google.com> 16708 16709 * Added source code to GNU binutils. 16710 16712 Copyright (C) 2008-2014 Free Software Foundation, Inc. 16713 16714 Copying and distribution of this file, with or without modification, 16715 are permitted in any medium without royalty provided the copyright 16716 notice and this notice are preserved. 16717 16718 Local Variables: 16719 mode: change-log 16720 left-margin: 8 16721 fill-column: 74 16722 version-control: never 16723 End: 16724