* defs.h (quit_flag): Don't declare.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
1d5dfe78
CC
12012-08-21 Cary Coutant <ccoutant@google.com>
2
3 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4 if --export-dynamic-symbol names an undef symbol.
5
c9269dff
AM
62012-08-18 Alan Modra <amodra@gmail.com>
7
8 * powerpc.cc: Formatting and white space.
9 (Powerpc_relobj): Rename got2_section_ to special_.
10 Add opd_ent_shndx_ and opd_ent_off_ vectors.
11 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
12 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
13 (Target_powerpc): Add Address typedef and invalid_address. Use
14 throughout.
15 (Target_powerpc::is_branch_reloc): New function.
16 (Powerpc_relocate_functions): Add Address typedef, use throughout.
17 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
18 for dst_mask, value and addend.
19 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
20 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
21 (Output_data_glink::do_write): Correct toc base. Don't try to use
22 uint16_t for 24-bit offset. Use get_output_section_offset and
23 check return.
24 (Target_powerpc::Scan::local): Handle more relocs.
25 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
26 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
27 Plug in toc restoring insn after plt calls. Translate branches
28 to function descriptor symbols to corresponding entry point.
29 (Target_powerpc::relocate_for_relocatable): Check return from
30 get_output_section_offset.
31 * symtab.h: Comment typo.
32
b1759dce
ILT
332012-08-14 Ian Lance Taylor <iant@google.com>
34
35 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
36 unsupported_relocal_local to call unsupported_reloc_global.
37
b9b2ae8b
NC
382012-08-14 Nick Clifton <nickc@redhat.com>
39
40 PR ld/14265
41 * script-sections.cc (Sections_element::output_section_name): Add
42 keep return parameter.
43 (Output_section_element::match_name): Add keep return parameter.
44 Return the value of the keep_ member.
45 * script-sections.h (class Output_section): Update
46 output_section_name prototype.
47 * layout.cc (Layout::keep_input_section): New public member
48 function.
49 (Layout::choose_output_section): Pass keep parameter to
50 output_section_name.
51 * layout.h (class Layout): Add keep_input_section.
52 * object.cc (Sized_relobj_file::do_layout): Check for kept input
53 sections.
54 * testsuite/Makefile.am: Add a test.
55 * testsuite/Makefile.in: Regenerate.
56 * testsuite/pr14265.c: Source file for the test.
57 * testsuite/pr14265.t: Linker script for the test.
58 * testsuite/pr14265.sh: Shell script for the test.
59
921b5322
AM
602012-08-14 Alan Modra <amodra@gmail.com>
61
62 * target.h (Target::output_section_name): New function.
63 (Target::do_output_section_name): New function.
64 * layout.cc (Layout::choose_output_section): Call the above.
65 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
66
6ce78956
AM
672012-08-14 Alan Modra <amodra@gmail.com>
68
69 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
70 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
71 for replace_constant call.
72 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
73 (Output_data_glink::do_print_to_mapfile): New function.
74 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
75 (Target_powerpc::Relocate::relocate): Likewise.
76
d1a8cabd
AM
772012-08-14 Alan Modra <amodra@gmail.com>
78
79 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
80 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
81 (Output_data_glink::add_entry,find_entry): Remove shndx param.
82 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
83 all references to shndx_. Handle special case for R_PPC_PLTREL24
84 here.
85 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
86 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
87 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
88 here.
89 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
90 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
91
d83ce4e3
AM
922012-08-12 Alan Modra <amodra@gmail.com>
93
94 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
95 (glink insn constants): Use uint32_t.
96 (Output_data_glink::add_entry): Use insert, not [] operator.
97
cf43a2fe
AM
982012-08-11 Alan Modra <amodra@gmail.com>
99
100 * object.h (Sized_relobj_file::find_shdr): New function.
101 (Sized_relobj_file::find_special_sections): New function.
102 * object.cc (Sized_relobj_file::find_shdr): New function.
103 (Sized_relobj_file::find_eh_frame): Use find_shdr.
104 (Sized_relobj_file::find_special_sections): New function, split out..
105 (Sized_relobj_file::do_read_symbols): ..from here.
106 * output.h (Output_data_got::replace_constant): New function.
107 (Output_data_got::num_entries): New function.
108 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
109 (Output_data_got::got_offset): Protected rather than private.
110 (Output_data_got::replace_got_entry): New function.
111 * output.cc (Output_data_got::replace_got_entry): New function.
112 * powerpc.cc (class Powerpc_relobj): New.
113 (class Powerpc_relocate_functions): Delete all psymval variants or
114 convert to value,addend type. Delete pcrela, pcrela_unaligned.
115 Implement _ha functions using corresponding _hi function.
116 (Powerpc_relobj::find_special_sections): New function.
117 (Target_powerpc::do_make_elf_object): New function.
118 (class Output_data_got_powerpc): New.
119 (class Output_data_glink): New.
120 (class Powerpc_scan_relocatable_reloc): New.
121 Many more changes througout file.
122
3c892704
NC
1232012-08-09 Nick Clifton <nickc@redhat.com>
124
125 * po/vi.po: Updated Vietnamese translation.
126
82435b3b
ILT
1272012-08-07 Ian Lance Taylor <iant@google.com>
128
129 * layout.cc (Layout::add_target_dynamic_tags): If
130 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
131 plt_rel.
132
a6dc81d2
NC
1332012-07-30 Nick Clifton <nickc@redhat.com>
134
135 * po/gold.pot: Updated template.
136 * po/es.po: Updated Spanish translation.
137
f1415016
CC
1382012-07-18 Cary Coutant <ccoutant@google.com>
139
140 PR gold/14344
141 * configure.ac: Add check for -gpubnames support.
142 * configure: Regenerate.
143 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
144 support; force -gno-pubnames.
145 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
146 support.
147 (gdb_index_test_4): New test.
148 * testsuite/Makefile.in: Regenerate.
149 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
150 * testsuite/gdb_index_test_2.sh: Likewise.
151 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
152 * testsuite/gdb_index_test_4.sh: New script.
153 * testsuite/gdb_index_test_comm.sh: New script with common code;
154 don't look for space after colon.
155
b7fd7c37
ST
1562012-07-16 Sriraman Tallam <tmsriram@google.com>
157
158 * gold.cc (queue_middle_tasks): Update function order only after
159 deferred objects due to plugins are processed.
160
1f3212db
ILT
1612012-07-11 Ian Lance Taylor <iant@google.com>
162
163 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
164 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
165 (Target_arm::scan_reloc_for_stub): Likewise.
166 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
167 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
168 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
169 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
170 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
171
81c82a68
ILT
1722012-07-10 Dodji Seketeli <dodji@redhat.com>
173 Ian Lance Taylor <iant@google.com>
174
175 PR gold/14309
176 * configure.ac: Test whether std::tr1::hash<off_t> works.
177 * gold.h: Add a specialization for std::tr1::hash<off_t> if
178 needed.
179 * output.h (class Output_fill): Add virtual destructor.
180 * configure, config.in: Rebuild.
181
eabc84f4
RM
1822012-06-22 Roland McGrath <mcgrathr@google.com>
183
184 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
185
370e30b6
RÁE
1862012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
187
188 * plugin.cc (Plugin::load): Handle position independent executables.
189
fb1b895d
CC
1902012-06-06 Cary Coutant <ccoutant@google.com>
191
192 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
193 add .debug_macro.
194 (lines_only_debug_sections): Likewise.
195 (gdb_fast_lookup_sections): New static array.
196 (is_gdb_debug_section): Rename formal parameter.
197 (is_lines_only_debug_section): Likewise.
198 (is_gdb_fast_lookup_section): New function.
199 (Layout::include_section): Check for ".zdebug_" prefix; pass
200 section name suffix to is_gdb_debug_section, et al.; check for
201 fast-lookup sections when building .gdb_index.
202 * options.h (--strip-debug-gdb): Update GDB version number.
203
7c0640fa
CC
2042012-06-06 Cary Coutant <ccoutant@google.com>
205
206 * configure.ac: Add check for fallocate.
207 * configure: Regenerate.
208 * config.in: Regenerate.
209
210 * options.h (class General_options): Add --mmap-output-file and
211 --posix-fallocate options.
212 * output.cc: (posix_fallocate): Remove; replace with...
213 (gold_fallocate): New function.
214 (Output_file::map_no_anonymous): Call gold_fallocate.
215 (Output_file::map): Check --mmap-output-file option.
216
2a49eb69
DK
2172012-06-05 Jing Yu <jingyu@google.com>
218
219 * gold.h (textdomain): Add do {} to empty while(0).
220 (bindtextdomain): Likewise.
221
fad072ac
CC
2222012-06-04 Cary Coutant <ccoutant@google.com>
223
224 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
225 has_dynsym_index.
226
8cc69fb6
ST
2272012-05-25 Sriraman Tallam <tmsriram@google.com>
228
229 * symtab.cc (Symbol_table::define_special_symbol):
230 Initialize *poldsym to prevent uninitialized variable errors.
231
1be75daa
CC
2322012-05-23 Cary Coutant <ccoutant@google.com>
233
234 * layout.cc (Layout::section_name_mapping): Add rules to handle
235 exact match on .data.rel.ro.local or .data.rel.ro.
236 (Layout::output_section_name): Check for exact matches.
237
9b689de0
CC
2382012-05-23 Cary Coutant <ccoutant@google.com>
239
240 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
241 more carefully.
242
b24fdbf5
CC
2432012-05-22 Cary Coutant <ccoutant@google.com>
244
245 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
246 object before exporting symbol.
247
e550e1a2
L
2482012-05-21 H.J. Lu <hongjiu.lu@intel.com>
249
250 * testsuite/tls_test.cc: Include "config.h" first.
251 * testsuite/tls_test_c.c: Likewise.
252
df7b86aa
NC
2532012-05-17 Daniel Richard G. <skunk@iskunk.org>
254 Nick Clifton <nickc@redhat.com>
255
256 PR 14072
257 * configure.in: Add check that sysdep.h has been included before
258 any system header files.
259 * configure: Regenerate.
260 * config.in: Regenerate.
261
1007b503
CC
2622012-05-14 Cary Coutant <ccoutant@google.com>
263
264 * layout.cc (Layout::make_output_section): Mark .tdata section
265 as RELRO.
266 * testsuite/relro_test.cc: Add a TLS variable.
267
fd885f3a
L
2682012-05-10 H.J. Lu <hongjiu.lu@intel.com>
269
270 PR gold/14091
271 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
272 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
273 R_X86_64_64.
274
80f5885c
CC
2752012-05-08 Cary Coutant <ccoutant@google.com>
276
277 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
278 (lines_only_debug_sections): Likewise.
279
2e702c99
RM
2802012-05-02 Roland McGrath <mcgrathr@google.com>
281
282 * nacl.cc: New file.
283 * nacl.h: New file.
284 * Makefile.am (CCFILES, HFILES): Add them.
285 * Makefile.in: Regenerate.
286 * i386.cc (Output_data_plt_i386_nacl): New class.
287 (Output_data_plt_i386_nacl_exec): New class.
288 (Output_data_plt_i386_nacl_dyn): New class.
289 (Target_i386_nacl): New class.
290 (Target_selector_i386_nacl): New class.
291 (target_selector_i386): Use it instead of Target_selector_i386.
292 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
293 (Target_x86_64_nacl): New class.
294 (Target_selector_x86_64_nacl): New class.
295 (target_selector_x86_64, target_selector_x32): Use it instead of
296 Target_selector_x86_64.
297 * arm.cc (Output_data_plt_arm_nacl): New class.
298 (Target_arm_nacl): New class.
299 (Target_selector_arm_nacl): New class.
300 (target_selector_arm, target_selector_armbe): Use it instead of
301 Target_selector_arm.
302
303 * target-select.cc (select_target): Take new Input_file* and off_t
304 arguments, pass them on to recognize method of selector.
305 * object.cc (make_elf_sized_object): Update caller.
306 * parameters.cc (parameters_force_valid_target): Likewise.
307 * incremental.cc (make_sized_incremental_binary): Likewise.
308 * target-select.h: Update decl.
309 (Target_selector::recognize): Take new Input_file* argument,
310 pass it on to do_recognize.
311 (Target_selector::do_recognize): Take new Input_file* argument.
312 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
313 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
314 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
315 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
316
317 * target.h (Target::Target_info): New members isolate_execinstr
318 and rosegment_gap.
319 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
320 * arm.cc (Target_arm::arm_info): Update initializer.
321 * i386.cc (Target_i386::i386_info): Likewise.
322 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
323 * sparc.cc (Target_sparc::sparc_info): Likewise.
324 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
325 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
326 * layout.cc (Layout::attach_allocated_section_to_segment):
327 Take new const Target* argument. If target->isolate_execinstr(), act
328 like --rosegment.
329 (Layout::find_first_load_seg): Take new const Target* argument;
330 if target->isolate_execinstr(), reject PF_X segments.
331 (Layout::relaxation_loop_body): Update caller.
332 (Layout::set_segment_offsets): If target->isolate_execinstr(),
333 reset file offset to zero when we hit LOAD_SEG, and then do a second
334 loop over the segments before LOAD_SEG to reassign offsets after
335 addresses have been determined. Handle target->rosegment_gap().
336 (Layout::attach_section_to_segment): Take new const Target* argument;
337 pass it to attach_allocated_section_to_segment.
338 (Layout::make_output_section): Update caller.
339 (Layout::attach_sections_to_segments): Take new const Target* argument;
340 pass it to attach_section_to_segment.
341 * gold.cc (queue_middle_tasks): Update caller.
342 * layout.h (Layout): Update method decls with new arguments.
343
344 * arm.cc (Target_arm::Target_arm): Take optional argument for the
345 Target_info pointer to use.
346 (Target_arm::do_make_data_plt): New virtual method.
347 (Target_arm::make_data_plt): New method that calls it.
348 (Target_arm::make_plt_entry): Use it.
349 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
350 for the section alignment.
351 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
352 method.
353 (Output_data_plt_arm::first_plt_entry_offset): Call it.
354 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
355 method.
356 (Output_data_plt_arm::get_plt_entry_size): Call it.
357 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
358 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
359 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
360 method.
361 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
362 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
363 method instead of sizeof(plt_entry).
364 (Output_data_plt_arm::add_entry): Likewise.
365 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
366 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
367 than static method.
368 (Target_arm::plt_entry_size): Likewise.
369 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
370 Move to ...
371 (Output_data_plt_arm_standard): ... here, new class.
372 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
373 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
374 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
375
376 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
377 Take additional argument for the PLT entry size.
378 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
379 Use get_plt_entry_size method rather than plt_entry_size variable.
380 (Output_data_plt_x86_64::reserve_slot): Likewise.
381 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
382 (Output_data_plt_x86_64::add_entry): Likewise.
383 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
384 (Output_data_plt_x86_64::address_for_global): Likewise.
385 (Output_data_plt_x86_64::address_for_local): Likewise.
386 (Output_data_plt_x86_64::set_final_data_size): Likewise.
387 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
388 Make method non-static.
389 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
390 method.
391 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
392 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
393 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
394 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
395 virtual method.
396 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
397 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
398 virtual method.
399 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
400 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
401 virtual method.
402 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
403 (Output_data_plt_x86_64::plt_entry_size)
404 (Output_data_plt_x86_64::first_plt_entry)
405 (Output_data_plt_x86_64::plt_entry)
406 (Output_data_plt_x86_64::tlsdesc_plt_entry)
407 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
408 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
409 (Output_data_plt_x86_64_standard): ... here, new class.
410 (Target_x86_64::Target_x86_64): Take optional argument for the
411 Target_info pointer to use.
412 (Target_x86_64::do_make_data_plt): New virtual method.
413 (Target_x86_64::make_data_plt): New method to call it.
414 (Target_x86_64::init_got_plt_for_update): Use that.
415 Call this->plt_->add_eh_frame method here.
416 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
417 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
418 rather than static method.
419 (Target_x86_64::plt_entry_size): Likewise.
420 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
421 rather than plt_entry_size variable. Move guts of PLT filling to...
422 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
423 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
424 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
425
426 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
427 additional argument for the section alignment.
428 Don't do add_eh_frame_for_plt here.
429 (Output_data_plt_i386::first_plt_entry_offset): Make the method
430 non-static. Use get_plt_entry_size method rather than plt_entry_size
431 variable.
432 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
433 method.
434 (Output_data_plt_i386::get_plt_entry_size): Call it.
435 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
436 (Output_data_plt_i386::add_eh_frame): New method to call it.
437 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
438 method.
439 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
440 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
441 method.
442 (Output_data_plt_i386::fill_plt_entry): New method to call it.
443 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
444 method instead of plt_entry_size.
445 (Output_data_plt_i386::plt_entry_size)
446 (Output_data_plt_i386::plt_eh_frame_fde_size)
447 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
448 (Output_data_plt_i386_standard): ... here, new class.
449 (Output_data_plt_i386_exec): New class.
450 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
451 (Output_data_plt_i386_exec::first_plt_entry): ... here.
452 (Output_data_plt_i386::exec_plt_entry): Move to ...
453 (Output_data_plt_i386_exec::plt_entry): ... here.
454 (Output_data_plt_i386_dyn): New class.
455 (Output_data_plt_i386::first_plt_entry): Move to ...
456 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
457 (Output_data_plt_i386::dyn_plt_entry): Move to ...
458 (Output_data_plt_i386_dyn::plt_entry): ... here.
459 (Target_i386::Target_i386): Take optional argument for the Target_info
460 pointer to use.
461 (Target_i386::do_make_data_plt): New virtual method.
462 (Target_i386::make_data_plt): New method to call it.
463 (Target_i386::make_plt_section): Use that.
464 Call this->plt_->add_eh_frame method here.
465 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
466 rather than plt_entry_size variable.
467 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
468 (Output_data_plt_i386::address_for_local): Likewise.
469 (Output_data_plt_i386::do_write): Likewise.
470 Move guts of PLT filling to...
471 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
472 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
473 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
474 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
475
b9b9f2ee
CC
4762012-05-01 Cary Coutant <ccoutant@google.com>
477
478 * dwarf_reader.cc (Dwarf_die::read_attributes)
479 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
480 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
481 * reduced_debug_output.cc
482 (Output_reduced_debug_info_section::get_die_end): Remove
483 DW_FORM_GNU_ref_index. Add default case.
484
57923f48
MW
4852012-04-26 Mark Wielaard <mjw@redhat.com>
486
487 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
488 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
489 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
490 DW_AT_high_pc as offset from DW_AT_low_pc.
491
492 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
493 * testsuite/Makefile.in: Regenerate.
494 * testsuite/gdb_index_test_3.c: New test source file.
495 * testsuite/gdb_index_test_3.sh: New test source file.
496
2c54b4f4
ILT
4972012-04-25 Ian Lance Taylor <iant@google.com>
498
499 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
500 pointer.
501 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
502 as a class, not a struct.
503 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
504 (Target_arm::apply_cortex_a8_workaround): Likewise.
505 * gc.h: Declare Reloc_types as a struct, not a class.
506 * object.h: Declare Symbols_data as a struct.
507 * reloc.h: Declare Read_relocs_data as a struct.
508 * target.h: Declare Relocate_info as a struct.
509
a5a5f7a3
DM
5102012-04-24 David S. Miller <davem@davemloft.net>
511
512 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
513 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
514 and R_SPARC_WPLT30.
515
f038d496
CC
5162012-04-24 Cary Coutant <ccoutant@google.com>
517
518 * incremental-dump.cc (find_input_containing_global): Replace
519 magic number with symbolic constant.
520 (dump_incremental_inputs): Update version number.
521 * incremental.cc (Output_section_incremental_inputs): Update version
522 number; import symbolic constants from Incremental_inputs_reader.
523 (Incremental_inputs::create_data_sections): Align relocations
524 section correctly for 64-bit targets.
525 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
526 constants; add padding.
527 (Output_section_incremental_inputs::write_header): Add assert for
528 header_size.
529 (Output_section_incremental_inputs::write_input_files): Add assert
530 for input_entry_size.
531 (Output_section_incremental_inputs::write_info_blocks): Add padding;
532 add assert for object_info_size, input_section_entry_size,
533 global_sym_entry_size.
534 * incremental.h (Incremental_inputs_reader): Add symbolic constants
535 for data structure sizes; use them.
536 (Incremental_input_entry_reader): Import symbolic constants from
537 Incremental_inputs_reader; use them.
538
a4d85145
DM
5392012-04-23 David S. Miller <davem@davemloft.net>
540
541 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
542 and elf_flags_set_.
543 (Target_sparc::Target_sparc): Initialize new fields.
544 (Target_sparc::do_make_elf_object): New function.
545 (Target_sparc::do_adjust_elf_header): New function.
546
1d509098
CC
5472012-04-23 Cary Coutant <ccoutant@google.com>
548
549 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
550 CU range table of gdb index.
551
7ebeff7f
DM
5522012-04-20 David S. Miller <davem@davemloft.net>
553
554 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
555 instead of false.
556
13cf9988
DM
5572012-04-16 David S. Miller <davem@davemloft.net>
558
2a1079e8
DM
559 * sparc.cc (Target_sparc::got_address): New function.
560 (Sparc_relocate_functions::gdop_hix22): New function.
561 (Sparc_relocate_functions::gdop_lox10): New function.
562 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
563 relocs.
564 (Target_sparc::Scan::local): Likewise if the global symbol is not
565 preemptible and is not IFUNC.
566 (Target_sparc::Relocate::relocate): Perform GOTDATA code
567 transformations for local and non-preemptible non-IFUNC global
568 symbols.
569
0bc964fc
DM
570 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
571 writing out 64-bit part of ranges.
572
661d7a80
DM
573 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
574 -fpic and -fpie respectively.
575 * Makefile.in: Regenerate.
576
8c2bf391
DM
577 * sparc.cc (class Target_sparc): Add rela_ifunc_.
578 (Target_sparc::Target_sparc): Initialize new field.
579 (Target_sparc::do_plt_section_for_global): New function.
580 (Target_sparc::do_plt_section_for_local): New function.
581 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
582 (Target_sparc::make_plt_section): New function, broken out of
583 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
584 (Target_sparc::make_plt_entry): Call make_plt_section.
585 (Target_sparc::make_local_ifunc_plt_entry): New function.
586 (Target_sparc::rela_ifunc_section): New function.
587 (Target_sparc::plt_section): Remove const.
588 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
589 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
590 and ifunc_count_ fields.
591 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
592 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
593 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
594 (Output_data_plt_sparc::rela_ifunc): New function.
595 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
596 (Output_data_plt_sparc::has_ifunc_section): New function.
597 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
598 (Output_data_plt_sparc::address_for_global): New function.
599 (Output_data_plt_sparc::address_for_local): New function.
600 (Output_data_plt_sparc::plt_index_to_offset): New function.
601 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
602 and entry_count.
603 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
604 entry_count.
605 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
606 R_SPARC_JMP_IREL to switch.
607 (Target_sparc::Scan::check_non_pic): Likewise.
608 (Target_sparc::Scan::local): Handle IFUNC symbols.
609 (Target_sparc::Scan::local): Likewise.
610 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
611 and plt_address_for_local.
612 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
613 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
614
13cf9988
DM
615 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
616 (class Output_data_reloc): Adjust calls to Output_reloc_type.
617 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
618 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
619 global relocs too.
620 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
621 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
622 calls.
623 * sparc.cc (Target_sparc::Scan::global): Likewise.
624 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
625
31821be0
CC
6262012-04-16 Cary Coutant <ccoutant@google.com>
627
628 * archive.cc (Library_base::should_include_member): Check for
629 --export-dynamic-symbol.
630 * options.h (class General_options): Add --export-dynamic-symbol.
631 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
632 --export-dynamic-symbol.
633 (Symbol_table::gc_mark_undef_symbols): Likewise.
634 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
635
2615994e
DM
6362012-04-12 David S. Miller <davem@davemloft.net>
637
638 * sparc.cc (Reloc::wdisp10): New relocation method.
639 (Reloc::h34): Likewise.
640 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
641 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
642 R_SPARC_WDISP10.
643 (Target_sparc::Scan::local): Likewise.
644 (Target_sparc::Scan::global): Likewise.
645 (Target_sparc::Relocate::relocate): Likewise.
646
6782735d
CC
6472012-04-09 Cary Coutant <ccoutant@google.com>
648
649 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
650 low_pc == 0.
651
8c7a0b00
ILT
6522012-04-06 Ian Lance Taylor <iant@google.com>
653
654 * timer.cc: #include <unistd.h>.
655
58797674
RM
6562012-04-06 Roland McGrath <mcgrathr@google.com>
657
658 * configure.in (AC_CHECK_HEADERS): Add locale.h.
659 * config.in: Regenerate.
660 * configure: Regenerate.
661
44350750
NC
6622012-04-05 Nick Clifton <nickc@redhat.com>
663
664 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
665 (AM_LC_MESSAGES): Add.
666 * aclocal.m4: Regenerate.
667 * config.in: Regenerate.
668 * configure: Regenerate.
669
c1027032
CC
6702012-03-21 Cary Coutant <ccoutant@google.com>
671
672 * Makefile.am: Add gdb-index.cc, gdb-index.h.
673 * Makefile.in: Regenerate.
674 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
675 (Sized_elf_reloc_mapper::symbol_section): New function.
676 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
677 (make_elf_reloc_mapper): New function.
678 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
679 (Dwarf_abbrev_table::do_read_abbrevs): New function.
680 (Dwarf_abbrev_table::do_get_abbrev): New function.
681 (Dwarf_ranges_table::read_ranges_table): New function.
682 (Dwarf_ranges_table::read_range_list): New function.
683 (Dwarf_pubnames_table::read_section): New function.
684 (Dwarf_pubnames_table::read_header): New function.
685 (Dwarf_pubnames_table::next_name): New function.
686 (Dwarf_die::Dwarf_die): New function.
687 (Dwarf_die::read_attributes): New function.
688 (Dwarf_die::skip_attributes): New function.
689 (Dwarf_die::set_name): New function.
690 (Dwarf_die::set_linkage_name): New function.
691 (Dwarf_die::attribute): New function.
692 (Dwarf_die::string_attribute): New function.
693 (Dwarf_die::int_attribute): New function.
694 (Dwarf_die::uint_attribute): New function.
695 (Dwarf_die::ref_attribute): New function.
696 (Dwarf_die::child_offset): New function.
697 (Dwarf_die::sibling_offset): New function.
698 (Dwarf_info_reader::check_buffer): New function.
699 (Dwarf_info_reader::parse): New function.
700 (Dwarf_info_reader::do_parse): New function.
701 (Dwarf_info_reader::do_read_string_table): New function.
702 (Dwarf_info_reader::lookup_reloc): New function.
703 (Dwarf_info_reader::get_string): New function.
704 (Dwarf_info_reader::visit_compilation_unit): New function.
705 (Dwarf_info_reader::visit_type_unit): New function.
706 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
707 Sized_elf_reloc_mapper.
708 (Sized_dwarf_line_info::symbol_section): Remove function.
709 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
710 (Sized_dwarf_line_info::read_line_mappings): Remove object
711 parameter, adjust callers.
712 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
713 * dwarf_reader.h: Include <sys/types.h>.
714 (class Track_relocs): Remove forward declaration.
715 (class Elf_reloc_mapper): New class.
716 (class Sized_elf_reloc_mapper): New class.
717 (class Dwarf_abbrev_table): New class.
718 (class Dwarf_range_list): New class.
719 (class Dwarf_ranges_table): New class.
720 (class Dwarf_pubnames_table): New class.
721 (class Dwarf_die): New class.
722 (class Dwarf_info_reader): New class.
723 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
724 (Sized_dwarf_line_info::symbol_section): Remove member function.
725 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
726 base class.
727 * gdb-index.cc: New source file.
728 * gdb-index.h: New source file.
729 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
730 and .debug_types sections, call Layout::add_to_gdb_index.
731 (Sized_relobj_incr::do_section_name): Implement.
732 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
733 return type; Implement.
734 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
735 return type.
736 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
737 parameter list and return type.
738 (Sized_incr_dynobj::do_section_contents): Likewise.
739 * layout.cc: Include gdb-index.h.
740 (Layout::Layout): Initialize gdb_index_data_.
741 (Layout::init_fixed_output_section): Check for .gdb_index section.
742 (Layout::add_to_gdb_index): New function. Instantiate.
743 * layout.h: Add forward declaration for class Gdb_index.
744 (Layout::add_to_gdb_index): New member function.
745 (Layout::gdb_index_data_): New data member.
746 * main.cc: Include gdb-index.h.
747 (main): Print statistics for gdb index.
748 * object.cc (Object::section_contents): Move code into
749 do_section_contents.
750 (need_decompressed_section): Check for sections needed when building
751 gdb index.
752 (build_compressed_section_map): Likewise.
753 (Sized_relobj_file::do_read_symbols): Need local symbols when building
754 gdb index.
755 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
756 sections; call Layout::add_to_gdb_index.
757 (Sized_relobj_file::do_decompressed_section_contents): Call
758 do_section_contents directly.
759 * object.h (Object::do_section_contents): Adjust parameter list and
760 return type.
761 (Object::do_decompressed_section_contents): Call do_section_contents
762 directly.
763 (Sized_relobj_file::do_section_contents): Adjust parameter list and
764 return type.
765 * options.h (class General_options): Add --gdb-index option.
766 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
767 list and return type.
768 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
769 * reloc.h (Track_relocs::checkpoint): New function.
770 (Track_relocs::reset): New function.
771
772 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
773 New test cases.
774 * testsuite/Makefile.in: Regenerate.
775 * testsuite/gdb_index_test.cc: New test source file.
776 * testsuite/gdb_index_test_1.sh: New test source file.
777 * testsuite/gdb_index_test_2.sh: New test source file.
778
647f1574
DK
7792012-03-19 Doug Kwan <dougkwan@google.com>
780
781 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 782 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
783 __exidx_start and __exidx_end. Make symbol table parameter
784 anonymous as it is not used.
785 * gold.cc (queue_middle_tasks): Call target hook to define any
786 target-specific symbols.
787 * target.h (Target::define_standard_symbols): New method.
788 (Target::do_define_standard_symbols): Same.
789 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
790 * testsuite/Makefile.in: Regenerate.
791 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
792 and __exidx_end.
793 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
794 relocations are generated for __exidx_start and __exidx_end.
795
7c6109da
DK
7962012-03-16 Doug Kwan <dougkwan@google.com>
797
798 * testsuite/Makefile.am: Disable test initpri3b.
799 * testsuite/Makefile.in: Regenerate.
800
7b8957f8
DK
8012012-03-15 Doug Kwan <dougkwan@google.com>
802
803 * arm.cc (Target_arm::got_section): Make .got section read-only
804 if -z now is given.
805
14dc9ef7
ILT
8062012-03-15 Ian Lance Taylor <iant@google.com>
807
808 PR gold/13850
809 * layout.cc (Layout::make_output_section): Correctly mark
810 SHT_INIT_ARRAY, et. al., as relro.
811
fa40b62a
DK
8122012-03-14 Doug Kwan <dougkwan@google.com>
813
814 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
815 dynamic relocations for protected symbols in shared objects.
816
fd325007
ILT
8172012-03-13 Ian Lance Taylor <iant@google.com>
818
819 * resolve.cc (Symbol_table::resolve): When merging common symbols,
820 keep the larger alignment.
821
e8dd54e1
CC
8222012-03-12 Cary Coutant <ccoutant@google.com>
823
824 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
825 handling of DW_LNE_define_file.
826
feb5f3b0
CC
8272012-03-12 Cary Coutant <ccoutant@google.com>
828
829 * reduced_debug_output.cc
830 (Output_reduced_debug_info_section::get_die_end): Add new FORM
831 codes to switch.
832
a1fb4256
CC
8332012-02-29 Cary Coutant <ccoutant@google.com>
834
835 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
836
5dd8762a
CC
8372012-02-29 Cary Coutant <ccoutant@google.com>
838
839 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
840 Call Object::decompressed_section_contents.
841 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
842 New dtor.
843 (Sized_dwarf_line_info::buffer_start_): New data member.
844 * merge.cc (Output_merge_data::do_add_input_section): Call
845 Object::decompressed_section_contents.
846 (Output_merge_string::do_add_input_section): Likewise.
847 * object.cc (need_decompressed_section): New function.
848 (build_compressed_section_map): Decompress sections needed later.
849 (Sized_relobj_file::do_decompressed_section_contents): New function.
850 (Sized_relobj_file::do_discard_decompressed_sections): New function.
851 * object.h (Object::decompressed_section_contents): New function.
852 (Object::discard_decompressed_sections): New function.
853 (Object::do_decompressed_section_contents): New function.
854 (Object::do_discard_decompressed_sections): New function.
855 (Compressed_section_info): New type.
856 (Compressed_section_map): Include decompressed section contents.
857 (Sized_relobj_file::do_decompressed_section_contents): New function.
858 (Sized_relobj_file::do_discard_decompressed_sections): New function.
859
7b5de7ee
CC
8602012-02-16 Cary Coutant <ccoutant@google.com>
861
862 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
863 * testsuite/Makefile.in: Regenerate.
864
f9fa4a63
CC
8652012-02-14 Cary Coutant <ccoutant@google.com>
866
867 * options.cc (General_options::finalize): Disallow -pie and -static.
868
2c175ebc
DK
8692012-02-03 Doug Kwan <dougkwan@google.com>
870
871 * arm.cc (Arm_relocate_functions::abs8,
872 Arm_relocate_functions::abs16): Use
873 Bits::has_signed_unsigned_overflow32.
874 (Arm_relocate_functions::thm_abs8): Correct range of
875 overflow check.
876 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
877 in assertions.
878
90cff06f
DK
8792012-02-02 Doug Kwan <dougkwan@google.com>
880
881 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
882 position independent outputs, not just shared objects.
883
63887f3d
L
8842012-01-30 H.J. Lu <hongjiu.lu@intel.com>
885
886 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
887 * configure: Regenerated.
888
bef2b434
ILT
8892012-01-27 Ian Lance Taylor <iant@google.com>
890
891 * reloc.h (Bits): New class with static functions, copied from
892 namespace utils in arm.cc.
893 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
894 instead.
895
c335b55d
L
8962012-01-27 H.J. Lu <hongjiu.lu@intel.com>
897
898 * incremental.cc (write_info_blocks): Correct relocation offset.
899
41194d9f
L
9002012-01-27 H.J. Lu <hongjiu.lu@intel.com>
901
902 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
903 (Relocate::tls_gd_to_le): Likewise.
904
1bae613c
L
9052012-01-27 H.J. Lu <hongjiu.lu@intel.com>
906
907 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
908
24482ca0
L
9092012-01-27 H.J. Lu <hongjiu.lu@intel.com>
910
911 * configure.ac: Check if -mcmodel=medium works.
912 * configure: Regenerated.
913
c2c7840a
CC
9142012-01-24 Cary Coutant <ccoutant@google.com>
915
916 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
917 definition and ...
918 (read_unsigned_LEB_128_x): ... this new function.
919 (read_signed_LEB_128): Replaced with inline definition and ...
920 (read_signed_LEB_128_x): ... this new function.
921 * int_encoding.h (read_unsigned_LEB_128_x): New function.
922 (read_unsigned_LEB_128): Add inline definition.
923 (read_signed_LEB_128_x): New function.
924 (read_signed_LEB_128): Add inline definition.
925 * testsuite/Makefile.am (leb128_unittest): New unit test.
926 * testsuite/Makefile.in: Regenerate.
927 * testsuite/leb128_unittest.cc: New unit test.
928
833de760 9292012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
930
931 PR gold/13617
932 * i386.cc (Target_i386::do_code_fill): When using a jmp
933 instruction, pad with nop instructions.
934 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
935
618d6666
L
9362012-01-22 H.J. Lu <hongjiu.lu@intel.com>
937
938 * x86_64.cc (gc_process_relocs): Add typename on types used in
939 template.
940 (scan_relocs): Likewise.
941 (relocate_section): Likewise.
942 (apply_relocation): Likewise.
943
3660ff06
L
9442012-01-10 H.J. Lu <hongjiu.lu@intel.com>
945
946 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
947 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
948 under x32.
949
fc51264f
L
9502012-01-09 H.J. Lu <hongjiu.lu@intel.com>
951
952 * x86_64.cc: Initial support for x32.
953
dd74ae06
CC
9542012-01-03 Cary Coutant <ccoutant@google.com>
955
956 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
957 Use abstract base class for GOT.
958 * gold/output.h (class Output_data_got_base): New abstract base class.
959 (class Output_data_got): Derive from new base class, adjust ctors.
960 (Output_data_got::reserve_slot): Make virtual; rename to
961 do_reserve_slot; Adjust callers.
962 * gold/target.h (Sized_target::init_got_plt_for_update): Return
963 pointer to abstract base class.
964 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
965
83896202
ILT
9662011-12-18 Ian Lance Taylor <iant@google.com>
967
968 * object.h (Relobj::local_symbol_value): New function.
969 (Relobj::local_plt_offset): New function.
970 (Relobj::local_has_got_offset): New function.
971 (Relobj::local_got_offset): New function.
972 (Relobj::set_local_got_offset): New function.
973 (Relobj::do_local_symbol_value): New pure virtual function.
974 (Relobj::do_local_plt_offset): Likewise.
975 (Relobj::do_local_has_got_offset): Likewise.
976 (Relobj::do_local_got_offset): Likewise.
977 (Relobj::do_set_local_got_offset): Likewise.
978 (Sized_relobj::do_local_has_got_offset): Rename from
979 local_has_got_offset.
980 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
981 (Sized_relobj::do_set_local_got_offset): Rename from
982 set_local_got_offset.
983 (Sized_relobj_file::do_local_plt_offset): Rename from
984 local_plt_offset.
985 (Sized_relobj_file::do_local_symbol_value): New function.
986 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
987 local_plt_offset.
988 * output.cc (Output_data_got::Got_entry::write): Change object to
989 Relobj. Use local_symbol_value.
990 (Output_data_got::add_global_with_rel): Change rel_dyn to
991 Output_data_reloc_generic*. Use add_global_generic.
992 (Output_data_got::add_global_with_rela): Remove. Change all
993 callers to use add_global_with_rel.
994 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
995 Output_data_reloc_generic*. Use add_global_generic.
996 (Output_data_got::add_global_pair_with_rela): Remove. Change all
997 callers to use add_global_pair_with_rel.
998 (Output_data_got::add_local): Change object to Relobj*.
999 (Output_data_got::add_local_plt): Likewise.
1000 (Output_data_got::add_local_with_rel): Change object to Relobj*,
1001 change rel_dyn to Output_data_reloc_generic*. Use
1002 add_local_generic.
1003 (Output_data_got::add_local_with_rela): Remove. Change all
1004 callers to use all_local_with_rel.
1005 (Output_data_got::add_local_pair_with_rel): Change object to
1006 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1007 add_output_section_generic.
1008 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1009 callers to use add_local_pair_with_rel.
1010 (Output_data_got::reserve_local): Change object to Relobj*.
1011 * output.h: (class Output_data_reloc_generic): Add pure virtual
1012 declarations for add_global_generic, add_local_generic,
1013 add_output_section_generic.
1014 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
1015 functions for Output_data_reloc_generic. Update declarations for
1016 changes listed in output.cc.
1017 (class Output_data_got): Change template parameter to got_size.
1018 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
1019 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
1020 function.
1021 (Sized_relobj_incr::do_local_plt_offset): New function.
1022 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
1023 add_global_generic.
1024
76677ad0
CC
10252011-12-17 Cary Coutant <ccoutant@google.com>
1026
1027 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
1028 * resolve.cc (Symbol_table::resolve): Likewise.
1029 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
1030 arrays.
1031 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1032
8b8dd8d5
ILT
10332011-12-16 Ian Lance Taylor <iant@google.com>
1034
1035 * output.h (Output_data_reloc_generic::add): Only call
1036 add_dynamic_reloc if this is a dynamic reloc section.
1037
d55525b9
L
10382011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1039
1040 PR gold/13505
1041 * target-reloc.h (apply_relocation): Replace <64, false> with
1042 <size, big_endian>.
1043
ff81c7c1
NC
10442011-11-25 Nick Clifton <nickc@redhat.com>
1045
1046 * po/it.po: New Italian translation.
1047
628f39be
SA
10482011-11-17 Sterling Augustine <saugustine@google.com>
1049
1050 * script.cc (script_include_directive): Implement.
1051 (read_script_file): New local variables name and search_path. Update
1052 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
1053 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
1054 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
1055
98ef3ea4
SA
10562011-11-11 Sterling Augustine <saugustine@google.com>
1057
1058 * yyscript.y (section_cmd): Add support for INCLUDE directive.
1059 (file_or_sections_cmd): Likewise.
1060
f4a8b6d7
DK
10612011-11-11 Doug Kwan <dougkwan@google.com>
1062
1063 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
1064 if --just-symbols is given.
1065
29ab395d
DK
10662011-11-10 Doug Kwan <dougkwan@google.com>
1067
1068 PR gold/13362
1069 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
1070 when processing data relocs.
1071 * reloc.h (Relocate_functions::rel_unaligned): New method.
1072 (Relocate_functions::pcrel_unaligned): Ditto.
1073 (Relocate_functions::rel32_unaligned): Ditto.
1074 (Relocate_functions::pcrel32_unaligned): Ditto.
1075
2c339f71
DK
10762011-11-09 Doug Kwan <dougkwan@google.com>
1077
1078 PR gold/13362
1079 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
1080 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
1081 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
1082 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1083 (Relocate_functions::rel_unaligned): New.
1084 (Relocate_functions::rel32_unaligned): New.
1085 * target-reloc.h (relocate_for_relocatable): Add code to handle
1086 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1087 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
1088 arm_unaligned_reloc_r): New targets.
1089 * testsuite/Makefile.in: Regenerate.
1090 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
1091 linking.
1092
3f3cddf1
ILT
10932011-11-02 Ian Lance Taylor <iant@google.com>
1094
1095 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
1096 NATIVE_LINKER.
1097 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1098 * options.cc (General_options::finalize): Use library search path
1099 from configure script if specified. If not native and no sysroot,
1100 only search TOOLLIBDIR.
1101 * options.h (Search_directory::Search_directory): Change name to
1102 const std::string&.
1103 (General_options::add_to_library_path_with_sysroot): Change arg to
1104 const std::string&.
1105 * configure, Makefile.in, config.in: Rebuild.
1106
a8e2273b
ILT
11072011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1108
1109 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1110 we are working around the ARM1176 Erratum.
1111 * options.h (General_options::fix_arm1176): Add option.
1112 * testsuite/Makefile.am: Add testcases, and keep current ones
1113 working.
1114 * testsuite/Makefile.in: Regenerate.
1115 * testsuite/arm_fix_1176.s: New file.
1116 * testsuite/arm_fix_1176.sh: Likewise.
1117
cd6eab1c
ILT
11182011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1119
1120 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1121 may_use_blx_.
1122 (Target_arm::may_use_blx): Remove method.
1123 (Target_arm::set_may_use_blx): Likewise.
1124 (Target_arm::may_use_v4t_interworking): New method.
1125 (Target_arm::may_use_v5t_interworking): Likewise.
1126 (Target_arm::may_use_blx_): Remove member variable.
1127 (Arm_relocate_functions::arm_branch_common): Check for v5T
1128 interworking.
1129 (Arm_relocate_functions::thumb_branch_common): Likewise.
1130 (Reloc_stub::stub_type_for_reloc): Likewise.
1131 (Target_arm::do_finalize_sections): Correct interworking checks.
1132 * testsuite/Makefile.am: Add new tests.
1133 * testsuite/Makefile.in: Regenerate.
1134 * testsuite/arm_farcall_arm_arm.s: New test.
1135 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1136 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1137 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1138 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1139 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1140 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1141 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1142
286adcf4
CC
11432011-10-31 Cary Coutant <ccoutant@google.com>
1144
1145 PR gold/13023
1146 * expression.cc (Expression::eval_with_dot): Add
1147 is_section_dot_assignment parameter.
1148 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1149 absolute and assigning to dot within a section.
1150 * script-sections.cc
1151 (Output_section_element_assignment::set_section_addresses): Pass
1152 dot_section to set_if_absolute.
1153 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1154 as is_section_dot_assignment flag to eval_with_dot.
1155 (Output_section_element_dot_assignment::set_section_addresses):
1156 Likewise.
1157 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1158 parameter. Also set value if relative to dot_section; set the
1159 symbol's output_section.
1160 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1161 parameter. Adjust all callers.
1162 (Expression::eval_maybe_dot): Likewise.
1163 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1164 Adjust all callers.
1165 * testsuite/script_test_2.t: Test assignment of an absolute value
1166 to dot within an output section element.
1167
9634ed06
CC
11682011-10-31 Cary Coutant <ccoutant@google.com>
1169
1170 * options.h (class General_options): Add --[no-]gnu-unique options.
1171 * symtab.cc (Symbol_table::sized_write_globals): Convert
1172 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1173
de4101c7
CC
11742011-10-31 Cary Coutant <ccoutant@google.com>
1175
1176 PR gold/13359
1177 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1178 unnecessary assertion.
1179 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1180
7257cc92
ST
11812011-10-31 Sriraman Tallam <tmsriram@google.com>
1182
1183 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1184 gc_mark_symbol.
1185 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1186 gc_mark_symbol.
1187 Change to just keep the section associated with symbol.
1188 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1189 they are externally visible and --export-dynamic is turned on.
1190 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1191
bfc34b3f
ILT
11922011-10-19 Ian Lance Taylor <iant@google.com>
1193
1194 PR gold/13163
1195 * script-sections.cc
1196 (Output_section_element_dot_assignment::needs_output_section): New
1197 function.
1198
ea0d8c47
ILT
11992011-10-19 Ian Lance Taylor <iant@google.com>
1200
1201 PR gold/13204
1202 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1203 --section-start option was seen.
1204 * options.h (General_options::any_section_start): New function.
1205
abd242a9
DM
12062011-10-18 David S. Miller <davem@davemloft.net>
1207
1208 PR binutils/13301
1209 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1210 member to track relocation locations that have moved during TLS
1211 reloc optimizations.
1212 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1213 (Target_sparc::Relocate::relocate): Adjust view down by 4
1214 bytes if it matches reloc_adjust_addr_.
1215 (Target_sparc::Relocate::relocate_tls): Always move the
1216 __tls_get_addr call delay slot instruction forward 4 bytes when
1217 performing relaxation.
1218
bab9090f
CC
12192011-10-18 Cary Coutant <ccoutant@google.com>
1220
1221 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1222 (Output_file::map_no_anonymous): Check for non-zero
1223 return code from posix_fallocate.
1224
f7c5b166
CC
12252011-10-17 Cary Coutant <ccoutant@google.com>
1226
1227 PR gold/13245
1228 * plugin.cc (is_visible_from_outside): Check for symbols
1229 referenced from dynamic objects.
1230 * resolve.cc (Symbol_table::resolve): Don't count references
1231 from dynamic objects as references from real ELF files.
1232 * testsuite/plugin_test_2.sh: Adjust expected result.
1233
b490c0bb
CC
12342011-10-17 Cary Coutant <ccoutant@google.com>
1235
1236 * gold.cc: Include timer.h.
1237 (queue_middle_tasks): Stamp time.
1238 (queue_final_tasks): Likewise.
1239 * main.cc (main): Store timer in parameters. Print timers
1240 for each pass.
1241 * parameters.cc (Parameters::Parameters): Initialize timer_.
1242 (Parameters::set_timer): New function.
1243 (set_parameters_timer): New function.
1244 * parameters.h (Parameters::set_timer): New function.
1245 (Parameters::timer): New function.
1246 (Parameters::timer_): New data member.
1247 (set_parameters_timer): New function.
1248 * timer.cc (Timer::stamp): New function.
1249 (Timer::get_pass_time): New function.
1250 * timer.h (Timer::stamp): New function.
1251 (Timer::get_pass_time): New function.
1252 (Timer::pass_times_): New data member.
1253
f475cf7b
CC
12542011-10-17 Cary Coutant <ccoutant@google.com>
1255
1256 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1257 task for members of lib groups.
1258
cdd7e244
CC
12592011-10-17 Cary Coutant <ccoutant@google.com>
1260
1261 PR gold/13288
4f95c8b4 1262 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
1263 (File_read::make_view): Move bounds check (replace with assert)...
1264 (File_read::find_or_make_view): ... to here.
1265
dfb45471
CC
12662011-10-12 Cary Coutant <ccoutant@google.com>
1267
4f95c8b4 1268 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
1269 ::read returns less than requested size.
1270
53bbcc1b
CC
12712011-10-10 Cary Coutant <ccoutant@google.com>
1272
4f95c8b4 1273 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
1274 Initialize defined_count_.
1275 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1276 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1277 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1278 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1279 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 1280 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
1281 member.
1282 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 1283 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
1284 Return zeroes instead of internal error.
1285
397b129b
CC
12862011-10-10 Cary Coutant <ccoutant@google.com>
1287
1288 PR gold/13249
4f95c8b4 1289 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 1290 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 1291 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
1292 (Output_reloc::type_): Adjust size of bit field.
1293 (Output_reloc::use_plt_offset_): New bit field.
1294 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1295 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1296 flag. Adjust all callers.
4f95c8b4 1297 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
1298 creating RELATIVE relocations.
1299
d5698657
NC
13002011-10-10 Nick Clifton <nickc@redhat.com>
1301
1302 * po/es.po: Updated Spanish translation.
1303 * po/fi.po: Updated Finnish translation.
1304
6a59a5c2
DN
13052011-10-03 Diego Novillo <dnovillo@google.com>
1306
1307 * options.cc (parse_uint): Fix dereference of RETVAL.
1308
f0558624
ST
13092011-09-29 Sriraman Tallam <tmsriram@google.com>
1310
1311 * layout.h (section_order_map_): New member.
1312 (get_section_order_map): New member function.
1313 * output.cc (Output_section::add_input_section): Check for patterns
1314 only when --section-ordering-file is specified.
1315 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1316 output_sections have been formed.
1317 * layout.cc (Layout_Layout): Initialize section_order_map_.
1318 * plugin.cc (update_section_order): Store order in order_map. Do not
1319 update the order.
1320 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1321 * testsuite/Makefile.in: Regenerate.
1322 * testsuite/plugin_section_order.c: New file.
1323 * testsuite/plugin_final_layout.cc: New file.
1324 * testsuite/plugin_final_layout.sh: New file.
1325
a7dac153
CC
13262011-09-29 Cary Coutant <ccoutant@google.com>
1327
4f95c8b4 1328 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 1329 Check for NULL.
4f95c8b4 1330 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
1331 symbols during incremental update.
1332 (Symbol_table::add_from_dynobj): Likewise.
1333
eebd87a5
ILT
13342011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1335 Ian Lance Taylor <iant@google.com>
1336
1337 * symtab.cc (Symbol_table::define_special_symbol): Always
1338 canonicalize version string.
1339
403a3331
CC
13402011-09-26 Cary Coutant <ccoutant@google.com>
1341
4f95c8b4
CC
1342 * gold.cc (queue_initial_tasks): Move option checks ...
1343 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
1344 some options; make others fatal.
1345
235061c2
CC
13462011-09-26 Cary Coutant <ccoutant@google.com>
1347
1348 gcc PR lto/47247
1349 * plugin.cc (get_symbols_v2): New function.
1350 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1351 (is_referenced_from_outside): New function.
1352 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1353 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1354 (get_symbols): Pass version parameter.
1355 (get_symbols_v2): New function.
1356 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1357 parameter.
1358 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1359 (onload): Add LDPT_GET_SYMBOLS_V2.
1360 (all_symbols_read_hook): Use get_symbols_v2; check for
1361 LDPR_PREVAILING_DEF_IRONLY_EXP.
1362 * testsuite/plugin_test_3.sh: Update expected results.
1363
dc87f620
ILT
13642011-09-23 Simon Baldwin <simonb@google.com>
1365
1366 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1367 configuration options.
1368 * configure: Regenerate.
1369 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1370 * Makefile.in: Regenerate.
1371 * testsuite/Makefile.in: Regenerate.
1372
a8279f82
ST
13732011-09-19 Sriraman Tallam <tmsriram@google.com>
1374
1375 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1376
0c9350c8
CC
13772011-09-19 Cary Coutant <ccoutant@google.com>
1378
1379 * incremental.cc (can_incremental_update): Fix typo in comment.
1380 * incremental.h (can_incremental_update): Likewise.
1381
aa06ae28
CC
13822011-09-18 Cary Coutant <ccoutant@google.com>
1383
1384 * incremental.cc (can_incremental_update): New function.
1385 * incremental.h (can_incremental_update): New function.
1386 * layout.cc (Layout::init_fixed_output_section): Call it.
1387 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1388 * object.cc (Sized_relobj_file::do_layout): Call
1389 can_incremental_update.
1390
ebb300b2
CC
13912011-09-13 Cary Coutant <ccoutant@google.com>
1392
1393 * configure.ac: Check for glibc support for gnu_indirect_function
1394 support with static linking, setting automake conditional
1395 IFUNC_STATIC.
1396 * Makefile.in: Regenerate.
1397 * configure: Regenerate.
1398
1399 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1400 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1401 for IFUNC_STATIC.
1402 * testsuite/Makefile.in: Regenerate.
1403
1206d0d5
CC
14042011-09-13 Cary Coutant <ccoutant@google.com>
1405
1406 * incremental.cc (Sized_relobj_incr::do_layout): Call
1407 report_comdat_group for kept comdat sections.
1408 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1409 * testsuite/Makefile.in: Regenerate.
1410 * testsuite/incr_comdat_test_1.cc: New source file.
1411 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1412 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1413 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1414
40b29874
ILT
14152011-09-13 Ian Lance Taylor <iant@google.com>
1416
1417 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1418 variable external_symbols_offset.
1419
1b045aac
ILT
14202011-09-12 Ian Lance Taylor <iant@google.com>
1421
1422 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1423 triggered if object has no symbols.
1424
24c6c55a
DM
14252011-09-09 David S. Miller <davem@davemloft.net>
1426
1427 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1428 (Output_fill_debug_line::do_write): Likewise.
1429
66570254
CC
14302011-08-29 Cary Coutant <ccoutant@google.com>
1431
1432 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1433 casts to match formatting specs.
1434 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1435
8ea8cd50
CC
14362011-08-26 Cary Coutant <ccoutant@google.com>
1437
1438 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1439 remaining hole size when allocating.
1440 (Layout::make_output_section): Set fill methods for debug sections.
1441 * layout.h (Free_list::Free_list_node): Move from private to
1442 public.
1443 (Free_list::set_min_hole_size): New function.
1444 (Free_list::begin, Free_list::end): New functions.
1445 (Free_list::min_hole_): New data member.
1446 * output.cc: Include dwarf.h.
1447 (Output_fill_debug_info::do_minimum_hole_size): New function.
1448 (Output_fill_debug_info::do_write): New function.
1449 (Output_fill_debug_line::do_minimum_hole_size): New function.
1450 (Output_fill_debug_line::do_write): New function.
1451 (Output_section::Output_section): Initialize new data member.
1452 (Output_section::set_final_data_size): Ensure patch space is larger
1453 than minimum hole size.
1454 (Output_section::do_write): Fill holes in debug sections.
1455 * output.h (Output_fill): New class.
1456 (Output_fill_debug_info): New class.
1457 (Output_fill_debug_line): New class.
1458 (Output_section::set_free_space_fill): New function.
1459 (Output_section::free_space_fill_): New data member.
1460 * testsuite/Makefile.am (incremental_test_3): Add
1461 --incremental-patch option.
1462 (incremental_test_4): Likewise.
1463 (incremental_test_5): Likewise.
1464 (incremental_test_6): Likewise.
1465 (incremental_copy_test): Likewise.
1466 (incremental_common_test_1): Likewise.
1467 * testsuite/Makefile.in: Regenerate.
1468
7cf80422
NC
14692011-08-26 Nick Clifton <nickc@redhat.com>
1470
1471 * po/es.po: Updated Spanish translation.
1472
c3f7b0e5
CC
14732011-08-01 Cary Coutant <ccoutant@google.com>
1474
1475 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1476 * gold/testsuite/Makefile.in: Regenerate.
1477 * gold/testsuite/justsyms_exec.c: New source file.
1478 * gold/testsuite/justsyms_lib.c: New source file.
1479
9590bf25
CC
14802011-08-01 Cary Coutant <ccoutant@google.com>
1481
1482 * layout.cc (Layout::set_segment_offsets): Don't realign text
1483 segment if -Ttext was specified.
1484 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1485 file type.
1486 * object.h (Sized_relobj_file::e_type): New function.
1487 (Sized_relobj_file::e_type_): New data member.
1488 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1489 base address for ET_EXEC files.
1490 * target.cc (Target::do_make_elf_object_implementation): Allow
1491 ET_EXEC files with --just-symbols option.
1492
dcd8d12e
CC
14932011-07-28 Cary Coutant <ccoutant@google.com>
1494
1495 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1496 Add thread_number parameter.
1497 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1498 * workqueue-threads.cc
1499 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1500 current thread if its thread number is greater than desired thread
1501 count.
1502 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1503 Add thread_number parameter.
1504 (Workqueue::should_cancel_thread): Likewise.
1505 (Workqueue::find_runnable_or_wait): Pass thread_number to
1506 should_cancel_thread.
1507 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1508 parameter.
1509
804eb480
ST
15102011-07-22 Sriraman Tallam <tmsriram@google.com>
1511
1512 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1513 only after checking if it cannot be forced local.
1514 * symtab.h (is_externally_visible): Check if the symbol is not forced
1515 local.
1516
f1ddb600
ILT
15172011-07-15 Ian Lance Taylor <iant@google.com>
1518
1519 * options.h (class General_options): Add --print-output-format.
1520 Move -EL next to -EB, for better --help output.
1521 * target-select.cc: Include <cstdio>, "options.h", and
1522 "parameters.h".
1523 (Target_selector::do_target_bfd_name): New function.
1524 (print_output_format): New function.
1525 * target-select.h (class Target_selector): Update declarations.
1526 (Target_selector::target_bfd_name): New function.
1527 (print_output_format): Declare.
1528 * main.cc: Include "target-select.h".
1529 (main): Handle --print-output-format.
1530 * gold.cc: Include "target-select.h".
1531 (queue_initial_tasks): Handle --print-output-format when there are
1532 no input files.
1533 * parameters.cc (parameters_force_valid_target): Give a better
1534 error message if -EB/-EL does not match target.
1535 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1536 function.
1537
7d172687
ILT
15382011-07-15 Ian Lance Taylor <iant@google.com>
1539
1540 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1541 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1542 (Output_data_plt_i386::do_write): Write address of .dynamic
1543 section to first entry in .got.plt section.
1544 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1545 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1546 Initialize layout_.
1547 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1548 section to first entry in .got.plt section.
1549 * layout.h (Layout::dynamic_section): New function.
1550
e9552f7e
ST
15512011-07-13 Sriraman Tallam <tmsriram@google.com>
1552
1553 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1554 to claim_file call.
1555 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1556 input_section_position_, and input_section_glob_.
1557 (read_layout_from_file): Call function section_ordering_specified.
1558 * layout.h (is_section_ordering_specified): New function.
1559 (section_ordering_specified): New function.
1560 (section_ordering_specified_): New boolean member.
1561 * main.cc(main): Call load_plugins after layout object is defined.
1562 * output.cc (Output_section::add_input_section): Use
1563 function section_ordering_specified to check if section ordering is
1564 needed.
1565 * output.cc (Output_section::add_relaxed_input_section): Use
1566 function section_ordering_specified to check if section ordering is
1567 needed.
1568 (Output_section::update_section_layout): New function.
1569 (Output_section::sort_attached_input_sections): Check if input section
1570 must be reordered.
1571 * output.h (Output_section::update_section_layout): New function.
1572 * plugin.cc (get_section_count): New function.
1573 (get_section_type): New function.
1574 (get_section_name): New function.
1575 (get_section_contents): New function.
1576 (update_section_order): New function.
58797674 1577 (allow_section_ordering): New function.
e9552f7e
ST
1578 (Plugin::load): Add the new interfaces to the transfer vector.
1579 (Plugin_manager::load_plugins): New parameter.
1580 (Plugin_manager::all_symbols_read): New parameter.
1581 (Plugin_manager::claim_file): New parameter. Save the elf object for
1582 unclaimed objects.
1583 (Plugin_manager::get_elf_object): New function.
1584 (Plugin_manager::get_view): Change to directly use the bool to check
1585 if get_view is called from claim_file_hook.
1586 * plugin.h (input_objects): New function
1587 (Plugin__manager::load_plugins): New parameter.
1588 (Plugin_manager::claim_file): New parameter.
1589 (Plugin_manager::get_elf_object): New function.
1590 (Plugin_manager::in_claim_file_handler): New function.
1591 (Plugin_manager::in_claim_file_handler_): New member.
1592 (layout): New function.
1593 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1594 handler with an extra parameter. Make the elf object before calling
1595 claim_file handler.
1596 * testsuite/plugin_test.c (get_section_count): New function pointer.
1597 (get_section_type): New function pointer.
1598 (get_section_name): New function pointer.
1599 (get_section_contents): New function pointer.
1600 (update_section_order): New function pointer.
1601 (allow_section_ordering): New function pointer.
1602 (onload): Check if the new interfaces exist.
1603
9446efde
ILT
16042011-07-13 Ian Lance Taylor <iant@google.com>
1605
1606 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1607 relro section.
1608 * x86_64.cc (Target_x86_64::got_section): Likewise.
1609 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1610 (relro_now_test_SOURCES): New variable.
1611 (relro_now_test_DEPENDENCIES): New variable.
1612 (relro_now_test_LDFLAGS): New variable.
1613 (relro_now_test_LDADD): New variable.
1614 (relro_now_test.so): New target.
1615 * testsuite/Makefile.in: Rebuild.
1616
07aa62f2
ILT
16172011-07-12 Ian Lance Taylor <iant@google.com>
1618
1619 PR gold/12980
1620 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1621 GLOB_DAT relocation rather than a RELATIVE relocation for a
1622 protected symbol when creating a shared library.
1623 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1624 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1625 * testsuite/protected_main_1.cc (main): Test that protected
1626 function has same address.
1627
e2153196
ILT
16282011-07-11 Ian Lance Taylor <iant@google.com>
1629
1630 PR gold/12979
1631 * options.h (class General_options): Add -Bgroup.
1632 * options.cc (General_options::finalize): If -Bgroup is set,
1633 default to --unresolved-symbols=report-all.
1634 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1635 * target-reloc.h (issue_undefined_symbol_error): Handle
1636 --unresolved-symbols=report-all.
1637
6daf5215
ILT
16382011-07-08 Ian Lance Taylor <iant@google.com>
1639
1640 PR gold/11985
1641 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1642 if linker script discards key sections.
1643 (Layout::create_dynamic_symtab): Likewise.
1644 (Layout::assign_local_dynsym_offsets): Likewise.
1645 (Layout::sized_create_version_sections): Likewise.
1646 (Layout::create_interp): Likewise.
1647 (Layout::finish_dynamic_section): Likewise.
1648 (Layout::set_dynamic_symbol_size): Likewise.
1649
beabb2c6
ILT
16502011-07-08 Ian Lance Taylor <iant@google.com>
1651
1652 PR gold/12386
1653 * options.h (class General_options): Add --unresolved-symbols.
1654 * target-reloc.h (issue_undefined_symbol_error): Check
1655 --unresolved-symbols. Add comments.
1656
9c16daf1
ILT
16572011-07-08 Ian Lance Taylor <iant@google.com>
1658
1659 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1660 expression more complex.
1661
191f1a2d
ILT
16622011-07-08 Ian Lance Taylor <iant@google.com>
1663
1664 PR gold/11317
1665 * target-reloc.h (issue_undefined_symbol_error): New inline
1666 function, broken out of relocate_section.
1667 (relocate_section): Call issue_undefined_symbol_error.
1668 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1669 there is no TLS segment if we are about to issue an undefined
1670 symbol error.
1671 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1672
62855347
ILT
16732011-07-08 Ian Lance Taylor <iant@google.com>
1674
1675 PR gold/12279
1676 * resolve.cc (Symbol_table::should_override): Add fromtype
1677 parameter. Change all callers. Give error when linking together
1678 TLS and non-TLS symbol.
1679 (Symbol_table::should_override_with_special): Add fromtype
1680 parameter. Change all callers.
1681 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1682 there is no TLS segment if we have reported some errors.
1683 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1684
67181c72
ILT
16852011-07-08 Ian Lance Taylor <iant@google.com>
1686
1687 PR gold/12372
1688 * target.h (Target::plt_address_for_global): New function.
1689 (Target::plt_address_for_local): New function.
1690 (Target::plt_section_for_global): Remove.
1691 (Target::plt_section_for_local): Remove.
1692 (Target::do_plt_address_for_global): New virtual function.
1693 (Target::do_plt_address_for_local): New virtual function.
1694 (Target::do_plt_section_for_global): Remove.
1695 (Target::do_plt_section_for_local): Remove.
1696 (Target::register_global_plt_entry): Add Symbol_table and Layout
1697 parameters.
1698 * output.cc (Output_data_got::Got_entry::write): Use
1699 plt_address_for_global and plt_address_for_local.
1700 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1701 address of output section.
1702 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1703 got_irelative_, and irelative_count_ fields. Update
1704 declarations.
1705 (Output_data_plt_i386::has_irelative_section): New function.
1706 (Output_data_plt_i386::entry_count): Add irelative_count_.
1707 (Output_data_plt_i386::set_final_data_size): Likewise.
1708 (class Target_i386): Add got_irelative_ and rel_irelative_
1709 fields. Update declarations.
1710 (Target_i386::Target_i386): Initialize new fields.
1711 (Target_i386::do_plt_address_for_global): New function replacing
1712 do_plt_section_for_global.
1713 (Target_i386::do_plt_address_for_local): New function replacing
1714 do_plt_section_for_local.
1715 (Target_i386::got_section): Create got_irelative_.
1716 (Target_i386::rel_irelative_section): New function.
1717 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1718 fields. Don't define __rel_iplt_{start,end}.
1719 (Output_data_plt_i386::add_entry): Add symtab and layout
1720 parameters. Change all callers. Use different PLT and GOT for
1721 IFUNC symbols.
1722 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1723 layout parameters. Change all callers. Use different PLT and
1724 GOT.
1725 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1726 (Output_data_plt_i386::rel_irelative): New function.
1727 (Output_data_plt_i386::address_for_global): New function.
1728 (Output_data_plt_i386::address_for_local): New function.
1729 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1730 IRELATIVE GOT when changing IFUNC GOT entries.
1731 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1732 reloc.
1733 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1734 if we didn't create an IRELATIVE GOT.
1735 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1736 plt_address_for_local.
1737 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1738 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1739 got_irelative_, and irelative_count_ fields. Update
1740 declarations.
1741 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1742 Initialize new fields. Remove symtab parameter. Change all
1743 callers.
1744 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1745 irelative_count_.
1746 (Output_data_plt_x86_64::has_irelative_section): New function.
1747 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1748 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1749 fields. Update declarations.
1750 (Target_x86_64::Target_x86_64): Initialize new fields.
1751 (Target_x86_64::do_plt_address_for_global): New function replacing
1752 do_plt_section_for_global.
1753 (Target_x86_64::do_plt_address_for_local): New function replacing
1754 do_plt_section_for_local.
1755 (Target_x86_64::got_section): Create got_irelative_.
1756 (Target_x86_64::rela_irelative_section): New function.
1757 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1758 all callers. Don't create __rel_iplt_{start,end}.
1759 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1760 parameters. Change all callers. Use different PLT and GOT for
1761 IFUNC symbols.
1762 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1763 layout parameters. Change all callers. Use different PLT and
1764 GOT.
1765 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1766 parameters. Change all callers. Use different PLT and GOT for
1767 IFUNC symbols.
1768 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1769 (Output_data_plt_x86_64::rela_irelative): New function.
1770 (Output_data_plt_x86_64::address_for_global): New function.
1771 (Output_data_plt_x86_64::address_for_local): New function.
1772 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1773 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1774 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1775 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1776 parameters.
1777 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1778 reloc.
1779 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1780 symbols if we didn't create an IRELATIVE GOT.
1781 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1782 plt_address_for_local.
1783 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1784 * testsuite/ifuncvar1.c: New test file.
1785 * testsuite/ifuncvar2.c: New test file.
1786 * testsuite/ifuncvar3.c: New test file.
1787 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1788 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1789 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1790 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1791 * testsuite/Makefile.in: Rebuild.
1792
33c15b45
CC
17932011-07-07 Cary Coutant <ccoutant@google.com>
1794
1795 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1796 (two_file_test_1_ndebug.o): Likewise.
1797 (two_file_test_1b_ndebug.o): Likewise.
1798 (two_file_test_2_ndebug.o): Likewise.
1799 (two_file_test_main_ndebug.o): Likewise.
1800 (incremental_test_2): Link with no-debug versions.
1801
f48b5fb7
CC
18022011-07-06 Cary Coutant <ccoutant@google.com>
1803
1804 * gold/incremental.cc
1805 (Output_section_incremental_inputs::write_info_blocks): Check for
1806 hidden and internal symbols.
1807
221597a5
CC
18082011-07-06 Cary Coutant <ccoutant@google.com>
1809
1810 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1811 Check disposition for startup file.
1812 (Incremental_inputs::report_command_line): Ignore
1813 --incremental-startup-unchanged option.
1814 * options.cc (General_options::parse_incremental_startup_unchanged):
1815 New function.
1816 (General_options::General_options): Initialize new data member.
1817 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1818 (General_options): Add --incremental-startup-unchanged option.
1819 (General_options::incremental_startup_disposition): New function.
1820 (General_options::incremental_startup_disposition_): New data member.
1821
e24719f6
CC
18222011-07-06 Cary Coutant <ccoutant@google.com>
1823
1824 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1825 input file index to Script_info ctor.
1826 (Sized_incremental_binary::do_file_has_changed): Find the
1827 command-line argument for files named in scripts.
1828 * incremental.h (Script_info::Script_info): New ctor
1829 with input file index.
1830 (Script_info::input_file_index): New function.
1831 (Script_info::input_file_index_): New data member.
1832 (Incremental_binary::get_library): Add const.
1833 (Incremental_binary::get_script_info): Add const.
1834 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1835 * testsuite/Makefile.am (incremental_test_5): New test case.
1836 (incremental_test_6): New test case.
1837 * testsuite/Makefile.in: Regenerate.
1838
8f7c81e8
CC
18392011-07-06 Cary Coutant <ccoutant@google.com>
1840
1841 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1842 debug output when command lines differ.
1843
9fbd3822
CC
18442011-07-06 Cary Coutant <ccoutant@google.com>
1845
1846 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1847 --incremental-patch option.
1848 * layout.cc (Free_list::allocate): Extend allocation beyond original
1849 end if enabled.
1850 (Layout::make_output_section): Mark sections that should get
1851 patch space.
1852 * options.cc (parse_percent): New function.
1853 * options.h (parse_percent): New function.
1854 (DEFINE_percent): New macro.
1855 (General_options): Add --incremental-patch option.
1856 * output.cc (Output_section::Output_section): Initialize new data
1857 members.
1858 (Output_section::add_input_section): Print section name when out
1859 of patch space.
1860 (Output_section::add_output_section_data): Likewise.
1861 (Output_section::set_final_data_size): Add patch space when
1862 doing --incremental-full.
1863 (Output_section::do_reset_address_and_file_offset): Remove patch
1864 space.
1865 (Output_segment::set_section_list_addresses): Print debug output
1866 only if --incremental-update.
1867 * output.h (Output_section::set_is_patch_space_allowed): New function.
1868 (Output_section::is_patch_space_allowed_): New data member.
1869 (Output_section::patch_space_): New data member.
1870 * parameters.cc (Parameters::incremental_full): New function.
1871 * parameters.h (Parameters::incremental_full): New function
1872 * testsuite/Makefile.am (incremental_test_2): Add test for
1873 --incremental-patch option.
1874 * testsuite/Makefile.in: Regenerate.
1875 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1876 (t18): Remove function body.
1877
f6cccc2c
DK
18782011-07-05 Doug Kwan <dougkwan@google.com>
1879
1880 PR gold/12771
1881 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1882 Arm_Address type for relocation result.
1883 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1884 overflow check.
1885 (Arm_relocate_functions::abs32): Use unaligned access.
1886 (Arm_relocate_functions::rel32): Ditto.
1887 (Arm_relocate_functions::prel31): Ditto.
1888 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1889 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1890 static data relocations.
1891 * testsuite/Makefile.in: Regnerate.
1892 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1893
28a13fec
ILT
18942011-07-05 Ian Lance Taylor <iant@google.com>
1895
1896 PR gold/12392
1897 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1898 symbols if necessary.
1899 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1900
24d47b34
ILT
19012011-07-05 Ian Lance Taylor <iant@google.com>
1902
1903 PR gold/12952
1904 * resolve.cc (Symbol::override_base_with_special): Simply override
1905 version with special symbol version, ignoring previous version.
1906
41f9cbbe
ILT
19072011-07-05 Ian Lance Taylor <iant@google.com>
1908
1909 * object.cc (Sized_relobj_file::include_section_group): Add
1910 information to comment about signature location.
1911
886288f1
ILT
19122011-07-02 Ian Lance Taylor <iant@google.com>
1913
1914 PR gold/12957
1915 * options.h (class General_options): Add -f and -F.
1916 * options.cc (General_options::finalize): Fatal error if -f/-F
1917 are used without -shared.
1918 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1919
ae3a6d4f
ILT
19202011-07-02 Ian Lance Taylor <iant@google.com>
1921
1922 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1923
21131061
ILT
19242011-07-01 Ian Lance Taylor <iant@google.com>
1925
1926 PR gold/12525
1927 PR gold/12952
1928 * resolve.cc (Symbol::override_base_with_special): Don't override
1929 the version if the overriding symbol has a different name.
1930 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1931 all callers. If we give an error about an undefined version,
1932 define the base version if necessary.
1933 * dynobj.h (class Versions): Update declaration.
1934 * testsuite/weak_alias_test_5.cc: New file.
1935 * testsuite/weak_alias_test.script: New file.
1936 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1937 and versioned_alias have the right value, and call t2.
1938 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1939 weak_alias_test_5.so.
1940 (weak_alias_test_LDADD): Likewise.
1941 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1942 * testsuite/Makefile.in: Rebuild.
1943
611062c0
ILT
19442011-07-01 Ian Lance Taylor <iant@google.com>
1945
1946 PR gold/12525
1947 * options.h (class General_options): Support -z notext.
1948 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1949 -Wl,-z,notext.
1950 (two_file_shared_nonpic.so): Likewise.
1951 (two_file_shared_mixed.so): Likewise.
1952 (two_file_shared_mixed_1.so): Likewise.
1953 (weak_undef_lib_nonpic.so): Likewise.
1954 (alt/weak_undef_lib_nonpic.so): Likewise.
1955 (tls_test_shared_nonpic.so): Likewise.
1956 * testsuite/Makefile.in: Rebuild.
1957
328c7c2f
ILT
19582011-07-01 Ian Lance Taylor <iant@google.com>
1959
1960 PR gold/12525
1961 * configure.ac: Test whether static linking works, setting
1962 the automake conditional HAVE_STATIC.
1963 * testsuite/Makefile.am: Disable tests using -static if
1964 HAVE_STATIC is not true.
1965 * configure, testsuite/Makefile.in: Rebuild.
1966
02d7cd44
ILT
19672011-07-01 Ian Lance Taylor <iant@google.com>
1968
1969 PR gold/12525
1970 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1971 Assert if we see DW_EH_PE_indirect.
1972 * target.h (Target::ehframe_datarel_base): New function.
1973 (Target::do_ehframe_datarel_base): New target function.
1974 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1975 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1976 function.
1977
07a60597
ILT
19782011-07-01 Ian Lance Taylor <iant@google.com>
1979
1980 PR gold/12571
1981 * options.h (class General_options): Add
1982 --ld-generated-unwind-info.
1983 * ehframe.cc (Fde::write): Add address parameter. Change all
1984 callers. If associated with PLT, fill in address and size.
1985 (Cie::set_output_offset): Only add merge mapping if there is an
1986 object.
1987 (Cie::write): Add address parameter. Change all callers.
1988 (Eh_frame::add_ehframe_for_plt): New function.
1989 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1990 input_offset_ fields into union u_, with new plt field.
1991 (Fde::Fde): Adjust for new union field.
1992 (Fde::Fde) [Output_data version]: New constructor.
1993 (Fde::add_mapping): Only add merge mapping if there is an object.
1994 (class Cie): Update declarations.
1995 (class Eh_frame): Declare add_ehframe_for_plt.
1996 * layout.cc (Layout::layout_eh_frame): Break out code into
1997 make_eh_frame_section, and call it.
1998 (Layout::make_eh_frame_section): New function.
1999 (Layout::add_eh_frame_for_plt): New function.
2000 * layout.h (class Layout): Update declarations.
2001 * merge.cc (Merge_map::add_mapping): Add assertion.
2002 * i386.cc: Include "dwarf.h".
2003 (class Output_data_plt_i386): Make first_plt_entry,
2004 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2005 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2006 and plt_eh_frame_fde.
2007 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2008 boundary. Call add_eh_frame_for_plt if appropriate.
2009 * x86_64.cc: Include "dwarf.h".
2010 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2011 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2012 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2013 and plt_eh_frame_fde.
2014 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
2015 appropriate.
2016
14788a3f
ILT
20172011-06-29 Ian Lance Taylor <iant@google.com>
2018
2019 PR gold/12629
2020 * object.cc (Sized_relobj_file::layout_section): Change shdr
2021 parameter to be const.
2022 (Sized_relobj_file::layout_eh_frame_section): New function, broken
2023 out of do_layout.
2024 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
2025 appropriate. Call layout_eh_frame_section.
2026 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
2027 sections.
2028 * object.h (class Sized_relobj_file): Update declarations.
2029
6c21fce1
ILT
20302011-06-29 Ian Lance Taylor <iant@google.com>
2031
37e41b03 2032 PR gold/12652
6c21fce1
ILT
2033 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2034 modifier.
2035 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2036
4d5e4e62
ILT
20372011-06-29 Ian Lance Taylor <iant@google.com>
2038
2039 PR gold/12675
2040 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2041 SHT_X86_64_UNWIND.
2042 * layout.cc (Layout::layout_eh_frame): Likewise.
2043
886f533a
ILT
20442011-06-29 Ian Lance Taylor <iant@google.com>
2045
2046 PR gold/12695
2047 * layout.cc (Layout::symtab_section_shndx): New function.
2048 * layout.h (class Layout): Declare symtab_section_shndx.
2049 * output.cc (Output_section::write_header): Call it.
2050
f3ae1b28
ILT
20512011-06-29 Ian Lance Taylor <iant@google.com>
2052
2053 PR gold/12818
2054 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
2055 symbols which are not used in a relocation.
2056
aecf301f
ILT
20572011-06-28 Ian Lance Taylor <iant@google.com>
2058
2059 PR gold/12898
2060 * layout.cc (Layout::segment_precedes): Don't crash if a linker
2061 script create indistinguishable segments.
2062 (Layout::set_segment_offsets): Use stable_sort when sorting
2063 segments. Pass this to Compare_segments constructor.
2064 * layout.h (class Layout): Make segment_precedes non-static.
2065 (class Compare_segments): Change from struct to class. Add
2066 layout_ field. Add constructor.
2067 * script-sections.cc
2068 (Script_sections::attach_sections_using_phdrs_clause): Rename
2069 local orphan to is_orphan. Don't report failure to put empty
2070 section in segment. On attachment failure, report name of
2071 section, and attach to first PT_LOAD segment.
2072
03ef7571
ILT
20732011-06-28 Ian Lance Taylor <iant@google.com>
2074
2075 PR gold/12934
2076 * target-select.cc (Target_selector::Target_selector): Add
2077 emulation parameter. Change all callers.
2078 (select_target_by_bfd_name): Rename from select_target_by_name.
2079 Change all callers.
2080 (select_target_by_emulation): New function.
2081 (supported_emulation_names): New function.
2082 * target-select.h (class Target_selector): Add emulation_ field.
2083 Update declarations.
2084 (Target_selector::recognize_by_bfd_name): Rename from
2085 recognize_by_name. Change all callers.
2086 (Target_selector::supported_bfd_names): Rename from
2087 supported_names. Change all callers.
2088 (Target_selector::recognize_by_emulation): New function.
2089 (Target_selector::supported_emulations): New function.
2090 (Target_selector::emulation): New function.
2091 (Target_selector::do_recognize_by_bfd_name): Rename from
2092 do_recognize_by_name. Change all callers.
2093 (Target_selector::do_supported_bfd_names): Rename from
2094 do_supported_names. Change all callers.
2095 (Target_selector::do_recognize_by_emulation): New function.
2096 (Target_selector::do_supported_emulations): New function.
2097 (select_target_by_bfd_name): Change name in declaration.
2098 (select_target_by_emulation): Declare.
2099 (supported_emulation_names): Declare.
2100 * parameters.cc (parameters_force_valid_target): Try to find
2101 target based on emulation from -m option.
2102 * options.h (class General_options): Change doc string for -m.
2103 * options.cc (help): Print emulations.
2104 (General_options::parse_V): Likewise.
2105 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2106 Add emulation parameter. Change all callers.
2107
200b2bb9
ILT
21082011-06-28 Ian Lance Taylor <iant@google.com>
2109
2110 * target.h (class Target): Add osabi_ field.
2111 (Target::osabi): New function.
2112 (Target::set_osabi): New function.
2113 (Target::Target): Initialize osabi_.
2114 (Target::do_adjust_elf_header): Make pure virtual.
2115 (Sized_target::do_adjust_elf_header): Declare.
2116 * target.cc (Sized_target::do_adjust_elf_header): New function.
2117 (class Sized_target): Instantiate all versions.
2118 * freebsd.h (class Target_freebsd): Remove.
2119 (Target_selector_freebsd::do_recognize): Call set_osabi on
2120 Target.
2121 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2122 (Target_selector_freebsd::set_osabi): Remove.
2123 * i386.cc (class Target_i386): Inherit from Sized_target rather
2124 than Target_freebsd.
2125 * x86_64.cc (class Target_x86_64): Likewise.
2126
b3ce541e
ILT
21272011-06-28 Ian Lance Taylor <iant@google.com>
2128
2129 * target.h (Target::can_check_for_function_pointers): Rewrite.
2130 Make non-virtual.
2131 (Target::can_icf_inline_merge_sections): Likewise.
2132 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2133 (Target::Target_info): Add can_icf_inline_merge_sections field.
2134 (Target::do_can_check_for_function_pointers): New virtual
2135 function.
2136 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2137 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2138 from can_check_for_function_pointers, move in file.
2139 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2140 section_may_have_icf_unsafe_poineters, move in file.
2141 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2142 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2143 Rename from can_check_for_function_pointers, move in file.
2144 (Target_i386::can_icf_inline_merge_sections): Remove.
2145 (Target_i386::i386_info): Initialize
2146 can_icf_inline_merge_sections.
2147 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2148 Initialize can_icf_inline_merge_sections.
2149 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2150 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2151 Rename from can_check_for_function_pointers, move in file.
2152 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2153 (Target_x86_64::x86_64_info): Initialize
2154 can_icf_inline_merge_sections.
2155 * testsuite/testfile.cc (Target_test::test_target_info):
2156 Likewise.
2157 * icf.cc (get_section_contents): Correct formatting.
2158
6d1c4efb
ILT
21592011-06-27 Ian Lance Taylor <iant@google.com>
2160
2161 * symtab.cc (Symbol::versioned_name): New function.
2162 (Symbol_table::add_to_final_symtab): Use versioned_name when
2163 appropriate.
2164 (Symbol_table::sized_write_symbol): Likewise.
2165 * symtab.h (class Symbol): Declare versioned_name.
2166 * stringpool.h (class Stringpool_template): Add variant of add
2167 which takes a std::basic_string.
2168 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2169 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2170 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2171 (ver_test_12.o): New target.
2172 * testsuite/Makefile.in: Rebuild.
2173
57eb9b50
DK
21742011-06-27 Doug Kwan <dougkwan@google.com>
2175
2176 * arm.cc (Arm_relocate_functions::thm_jump8,
2177 Arm_relocate_functions::thm_jump11): Use a wider signed
2178 type to compute offset.
2179 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2180 arm_thm_jump8.
2181 * testsuite/Makefile.in: Regenerate.
2182 * testsuite/arm_branch_in_range.sh: Check test results of
2183 arm_thm_jump11 and arm_thm_jump8.
2184 * testsuite/arm_thm_jump11.s: New test source file.
2185 * testsuite/arm_thm_jump11.t: New linker script.
2186 * testsuite/arm_thm_jump8.s: New test source file.
2187 * testsuite/arm_thm_jump8.t: New linker script.
2188
487b39df
ILT
21892011-06-24 Ian Lance Taylor <iant@google.com>
2190
2191 * layout.cc: Include "object.h".
2192 (ctors_sections_in_init_array): New static variable.
2193 (Layout::is_ctors_in_init_array): New function.
2194 (Layout::layout): Add entry to ctors_sections_in_init_array if
2195 appropriate.
2196 * layout.h (class Layout): Declare is_ctors_in_init_array.
2197 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2198 is_ctors_reverse_view is set.
2199 (Sized_relobj_file::write_sections): Add layout parameter. Change
2200 all callers. Set is_ctors_reverse_view field of View_size.
2201 (Sized_relobj_file::reverse_words): New function.
2202 * object.h (Sized_relobj_file::View_size): Add
2203 is_ctors_reverse_view field.
2204 (class Sized_relobj_file): Update declarations.
2205 * testsuite/initpri3.c: New test.
2206 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2207 initpri3b.
2208 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2209 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2210 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2211 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2212 * testsuite/Makefile.in: Rebuild.
2213
472076e4
CC
22142011-06-24 Cary Coutant <ccoutant@google.com>
2215
2216 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2217 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2218 (debug_msg_cdebug.err): New targets.
2219 * testsuite/Makefile.in: Regenerate.
2220 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2221 Fix checks for link with shared library.
2222
a60af0db
DK
22232011-06-24 Doug Kwan <dougkwan@google.com>
2224
2225 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2226 skip empty text sections.
2227 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2228
5393d741
ILT
22292011-06-22 Ian Lance Taylor <iant@google.com>
2230
2231 PR gold/12910
2232 * options.h (class General_options): Add --ctors-in-init-array.
2233 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2234 friends as SHT_PROGBITS for merging sections.
2235 (Layout::layout): Remove special handling of .init_array and
2236 friends. Don't sort if doing relocatable link. Sort for .ctors
2237 and .dtors if ctors_in_init_array.
2238 (Layout::make_output_section): Force correct section types for
2239 .init_array and friends. Don't sort if doing relocatable link,
2240 Don't sort .ctors and .dtors if ctors_in_init_array.
2241 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2242 (Layout::output_section_name): Add relobj parameter. Change all
2243 callers. Handle .ctors. and .dtors. in code rather than table.
2244 Handle .ctors and .dtors if ctors_in_init_array.
2245 (Layout::match_file_name): New function, moved from output.cc.
2246 * layout.h (class Layout): Update declarations.
2247 * output.cc: Include "layout.h".
2248 (Input_section_sort_entry::get_priority): New function.
2249 (Input_section_sort_entry::match_file_name): Just call
2250 Layout::match_file_name.
2251 (Output_section::Input_section_sort_init_fini_compare::operator()):
2252 Handle .ctors and .dtors. Sort by explicit priority rather than
2253 by name.
2254 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2255 * testsuite/initpri2.c: New test.
2256 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2257 (check_PROGRAMS): Add initpri2.
2258 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2259 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2260 * configure, testsuite/Makefile.in: Rebuild.
2261
e1f74f98
ILT
22622011-06-19 Ian Lance Taylor <iant@google.com>
2263
2264 PR gold/12880
2265 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2266 .interp section to a PT_INTERP segment even if we have seen a
2267 --dynamic-linker option. Don't do it if we have seen a PHDRS
2268 clause in a linker script.
2269 (Layout::finalize): Don't create a .interp section if we've
2270 already create a PT_INTERP segment.
2271 (Layout::create_interp): Always call choose_output_section (revert
2272 patch of 2011-06-17). Don't create PT_INTERP segment.
2273 * script-sections.cc
2274 (Script_sections::create_note_and_tls_segments): Add a .interp
2275 section to a PT_INTERP segment even if we have seen a
2276 --dynamic-linker option.
2277
766f91bb
ILT
22782011-06-18 Ian Lance Taylor <iant@google.com>
2279
2280 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2281 merely because a non-PT_LOAD segment has a dynamic reloc.
2282
0d212c3a
ILT
22832011-06-18 Ian Lance Taylor <iant@google.com>
2284
2285 * layout.cc (Layout::finish_dynamic_section): Don't create
2286 DT_FLAGS entry if not needed.
2287
911a5072
ILT
22882011-06-18 Ian Lance Taylor <iant@google.com>
2289
2290 PR gold/12745
2291 * layout.cc (Layout::layout_eh_frame): Correct handling of
2292 writable .eh_frame section.
2293
534b4e5f
ILT
22942011-06-17 Ian Lance Taylor <iant@google.com>
2295
2296 PR gold/12893
2297 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2298 symbol is redefined with the exact same object and value.
2299
10b4f102
ILT
23002011-06-17 Ian Lance Taylor <iant@google.com>
2301
2302 PR gold/12880
2303 * layout.h (class Layout): Add interp_segment_ field.
2304 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2305 (Layout::attach_allocated_section_to_segment): If making shared
2306 library, put .interp section in PT_INTERP segment.
2307 (Layout::finalize): Also call create_interp if -dynamic-linker
2308 option was used.
2309 (Layout::create_interp): Assert that there is no PT_INTERP
2310 segment. If not using a SECTIONS clause, use make_output_section.
2311 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2312 * script-sections.cc
2313 (Script_sections::create_note_and_tls_segments): If making shared
2314 library, put .interp section in PT_INTERP segment.
2315
a29b0dad
ILT
23162011-06-17 Ian Lance Taylor <iant@google.com>
2317
e588ea8d
ILT
2318 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2319 when making a shared library.
2320
23212011-06-17 Ian Lance Taylor <iant@google.com>
2322
2323 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2324 parameter. Change all callers. Don't issue warning about PC32
2325 against locally defined symbol.
a29b0dad 2326
9d3b0698
ILT
23272011-06-16 Ian Lance Taylor <iant@google.com>
2328
2329 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2330 occurs in same object.
2331
85b0f90c
AM
23322011-06-14 Alan Modra <amodra@gmail.com>
2333
2334 * po/POTFILES.in: Regenerate.
2335
a94907d9
ILT
23362011-06-09 Ian Lance Taylor <iant@google.com>
2337
2338 * script-sections.cc
2339 (Orphan_output_section::set_section_addresses): For a relocatable
2340 link set address to 0.
2341
4fb3a1c3
CC
23422011-06-09 Cary Coutant <ccoutant@google.com>
2343
2344 PR gold/12804
2345 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2346 used with --compress-debug-sections.
2347 * gold/object.cc (Sized_relobj_file::do_layout): Report
2348 uncompressed size of compressed input sections.
2349
61220854
CC
23502011-06-08 Cary Coutant <ccoutant@google.com>
2351
2352 PR gold/12804
2353 * testsuite/two_file_test_2_v1.cc: Change initialization of
2354 v2 to keep it in .data.
2355
e6455dfb
CC
23562011-06-07 Cary Coutant <ccoutant@google.com>
2357
2358 * common.cc (Symbol_table::do_allocate_commons_list): Call
2359 gold_fallback.
2360 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2361 (Errors::fallback): New function.
2362 (gold_fallback): New function.
2363 * errors.h (Errors::fallback): New function.
2364 * gold.cc (gold_exit): Change status parameter to enum; adjust
2365 all callers.
2366 (queue_initial_tasks): Call gold_fallback.
2367 * gold.h: Include cstdlib.
2368 (Exit_status): New enum type.
2369 (gold_exit): Change status parameter to enum.
2370 (gold_fallback): New function.
2371 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2372 (Layout::create_symtab_sections): Likewise.
2373 (Layout::create_shdrs): Likewise.
2374 * main.cc (main): Adjust call to gold_exit.
2375 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2376 (Output_data_got::add_got_entry_pair): Likewise.
2377 (Output_section::add_input_section): Likewise.
2378 (Output_section::add_output_section_data): Likewise.
2379 (Output_segment::set_section_list_addresses): Likewise.
2380 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2381
fb0e076f
CC
23822011-06-07 Cary Coutant <ccoutant@google.com>
2383
2384 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2385 for incremental links.
2386 * output.cc (Output_segment::set_section_list_addresses): Remove
2387 FIXME and test for TLS or BSS.
2388
a5ee4d5d
CC
23892011-06-07 Cary Coutant <ccoutant@google.com>
2390
2391 * testsuite/Makefile.am: Add incremental_copy_test,
2392 incremental_common_test_1.
2393 * testsuite/Makefile.in: Regenerate.
2394 * testsuite/common_test_1_v1.c: New source file.
2395 * testsuite/common_test_1_v2.c: New source file.
2396 * testsuite/copy_test_v1.cc: New source file.
2397
5146f448
CC
23982011-06-07 Cary Coutant <ccoutant@google.com>
2399
2400 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2401 update, allocate common from bss section's free list.
2402 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2403 linker-defined symbols.
2404 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2405 Skip GOT and PLT entries that are no longer referenced.
2406 (Output_section_incremental_inputs::write_info_blocks): Mark
2407 linker-defined symbols.
2408 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2409 * output.cc (Output_section::allocate): New function.
2410 * output.h (Output_section::allocate): New function.
2411 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2412 linker-defined symbols.
2413 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2414 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2415 (Symbol::init_base_output_data): Likewise.
2416 (Symbol::init_base_output_segment): Likewise.
2417 (Symbol::init_base_constant): Likewise.
2418 (Sized_symbol::init_output_data): Likewise.
2419 (Sized_symbol::init_output_segment): Likewise.
2420 (Sized_symbol::init_constant): Likewise.
2421 (Symbol_table::do_define_in_output_data): Likewise.
2422 (Symbol_table::do_define_in_output_segment): Likewise.
2423 (Symbol_table::do_define_as_constant): Likewise.
2424 * symtab.h (Symbol::is_predefined): New function.
2425 (Symbol::init_base_output_data): Add is_predefined parameter.
2426 (Symbol::init_base_output_segment): Likewise.
2427 (Symbol::init_base_constant): Likewise.
2428 (Symbol::is_predefined_): New data member.
2429 (Sized_symbol::init_output_data): Add is_predefined parameter.
2430 (Sized_symbol::init_output_segment): Likewise.
2431 (Sized_symbol::init_constant): Likewise.
2432 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2433
26d3c67d
CC
24342011-06-07 Cary Coutant <ccoutant@google.com>
2435
2436 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2437 instead of emit_copy_reloc.
2438 (Copy_relocs::emit_copy_reloc): Refactor.
2439 (Copy_relocs::make_copy_reloc): New function.
2440 (Copy_relocs::add_copy_reloc): Remove.
2441 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2442 section.
2443 (Copy_relocs::make_copy_reloc): New function.
2444 (Copy_relocs::add_copy_reloc): Remove.
2445 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2446 unchanged input files.
2447 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2448 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2449 Reserve BSS space for COPY relocations.
2450 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2451 (Output_section_incremental_inputs::write_info_blocks): Record
2452 whether a symbol is copied from a shared object.
2453 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2454 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2455 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2456 (Incremental_input_entry_reader::get_output_symbol_index): Add
2457 is_copy parameter.
2458 (Incremental_binary::emit_copy_relocs): New function.
2459 (Incremental_binary::do_emit_copy_relocs): New function.
2460 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2461 new data member.
2462 (Sized_incremental_binary::add_copy_reloc): New function.
2463 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2464 (Sized_incremental_binary::Copy_reloc): New struct.
2465 (Sized_incremental_binary::Copy_relocs): New typedef.
2466 (Sized_incremental_binary::copy_relocs_): New data member.
2467 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2468 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2469 * target.h (Sized_target::emit_copy_reloc): New function.
2470 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2471
7cdb37d9
CC
24722011-06-02 Cary Coutant <ccoutant@google.com>
2473
2474 PR gold/12163
2475 * gold/archive.cc (Archive::Archive): Initialize new data member.
2476 (Archive::include_all_members): Return if archive has already been
2477 included.
2478 * gold/archive.h (Archive::include_all_members_): New data member.
2479
cc643b88
NC
24802011-06-02 Nick Clifton <nickc@redhat.com>
2481
2482 * dynobj.h: Fix spelling mistake in comment.
2483 * output.cc: Likewise.
2484
f62a3ca7 24852011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 2486 Asier Llano
f62a3ca7
DK
2487
2488 PR gold/12826
cc643b88 2489 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
2490 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2491 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2492 redundant arm_exidx_test.so.
2493 * testsuite/Makefile.in: Regenerate.
2494 (check_SCRIPTS): Add pr12826.sh
2495 (check_DATA): Add pr12826.stdout
2496 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2497 * testsuite/pr12826.sh: New file.
2498 * testsuite/pr12826_1.s: Ditto.
2499 * testsuite/pr12826_1.s: Ditto.
2500
8dbe1edc
ILT
25012011-05-30 Ian Lance Taylor <iant@google.com>
2502
2503 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2504 sections.
2505
c49875be
ILT
25062011-05-29 Ian Lance Taylor <iant@google.com>
2507
2508 PR gold/12804
2509 * testsuite/Makefile.am: Use different file name for two_file_test
2510 temporary file for each incremental test.
2511 * testsuite/Makefile.in: Rebuild.
2512
69d53f7a
ILT
25132011-05-29 Ian Lance Taylor <iant@google.com>
2514
2515 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2516 binary input file is empty.
2517
41d0ab5f
ILT
25182011-05-27 Ian Lance Taylor <iant@google.com>
2519
2520 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2521 (ver_test_9.so): Likewise.
2522 * testsuite/Makefile.in: Rebuild.
2523
89d8a36b
CC
25242011-05-26 Cary Coutant <ccoutant@google.com>
2525
2526 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2527 * incremental.cc (Incremental_inputs::report_input_section): Fix
2528 comment, indentation.
2529 (Incremental_inputs::report_comdat_group): New function.
2530 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2531 of data for incremental input file entry.
2532 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2533 group count, COMDAT group signatures.
2534 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2535 an unchanged input file.
2536 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2537 Initialize new data member.
2538 (Incremental_object_entry::add_comdat_group): New function.
2539 (Incremental_object_entry::get_comdat_group_count): New function.
2540 (Incremental_object_entry::get_comdat_signature_key): New function.
2541 (Incremental_object_entry::groups_): New data member.
2542 (Incremental_inputs::report_comdat_group): New function.
2543 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2544 data for incremental input file entry.
2545 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2546 (Incremental_input_entry_reader::get_input_section): Adjust size of
2547 data for incremental input file entry.
2548 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2549 (Incremental_input_entry_reader::get_comdat_group_signature): New
2550 function.
2551 * object.cc (Sized_relobj::include_section_group): Report kept
2552 COMDAT groups for incremental links.
2553
1706a06f
ILT
25542011-05-24 David Meyer <pdox@google.com>
2555
2556 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2557 with name parameter. Add found_name parameter.
2558 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2559 * dirsearch.h (class Dirsearch): Update declaration.
2560
a10ae760
ILT
25612011-05-24 Ian Lance Taylor <iant@google.com>
2562
2563 * archive.cc (Library_base::should_include_member): Pull in object
2564 from archive if it defines the entry symbol.
2565 * parameters.cc (Parameters::entry): New function.
2566 * parameters.h (class Parameters): Declare entry.
2567 * output.h (class Output_file_header): Remove entry_ field.
2568 * output.cc (Output_file_header::Output_file_header): Remove entry
2569 parameter. Change all callers.
2570 (Output_file_header::entry): Use parameters->entry.
2571 * gold.cc (queue_middle_tasks): Likewise.
2572 * plugin.cc (Plugin_hook::run): Likewise.
2573
aa92d6ed
CC
25742011-05-24 Cary Coutant <ccoutant@google.com>
2575
2576 * gold.cc (queue_initial_tasks): Pass incremental base filename
2577 to Output_file::open_base_file; don't print error message.
2578 * incremental-dump.cc (main): Adjust call to
2579 Output_file::open_for_modification.
2580 * incremental-dump.cc (main): Likewise.
2581 * incremental.cc (Incremental_inputs::report_command_line):
2582 Ignore --incremental-base option when comparing command lines.
2583 Ignore parameter when given as separate argument.
2584 * options.h (class General_options): Add --incremental-base.
2585 * output.cc (Output_file::Output_file):
2586 (Output_file::open_base_file): Add base_name and writable parameters;
2587 read base file into new file; print error message here.
2588 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2589 callers.
2590 * output.h (Output_file::open_for_modification): Rename to...
2591 (Output_file::open_base_file): ...this; add base_name and
2592 writable parameters; adjust all callers.
2593 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2594 callers.
2595 * testsuite/Makefile.am (incremental_test_4): Test
2596 --incremental-base.
2597 * testsuite/Makefile.in: Regenerate.
2598
2eedd706
CC
25992011-05-24 Cary Coutant <ccoutant@google.com>
2600
2601 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2602 incremental_test_4.
2603 * testsuite/Makefile.in: Regenerate.
2604 * testsuite/two_file_test_1_v1.cc: New test source file.
2605 * testsuite/two_file_test_1b_v1.cc: New test source file.
2606 * testsuite/two_file_test_2_v1.cc: New test source file.
2607
0f1c85a6
CC
26082011-05-24 Cary Coutant <ccoutant@google.com>
2609
2610 * dynobj.h (Dynobj::do_dynobj): New function.
2611 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2612 flag and soname for shared objects.
2613 * incremental.cc (Incremental_inputs::report_object): Make
2614 either Incremental_object_entry or Incremental_dynobj_entry; add
2615 soname to string table.
2616 (Incremental_inputs::report_input_section): Add assertion.
2617 (Output_section_incremental_inputs::set_final_data_size): Adjust
2618 type of input file entry for shared libraries; adjust size of
2619 shared library info entry.
2620 (Output_section_incremental_inputs::write_input_files): Write
2621 as_needed flag for shared libraries.
2622 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2623 of input file entry for shared libraries; write soname.
2624 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2625 soname from incremental info.
2626 * incremental.h (enum Incremental_input_flags): Add
2627 INCREMENTAL_INPUT_AS_NEEDED.
2628 (Incremental_input_entry::Incremental_input_entry): Initialize new
2629 data member.
2630 (Incremental_input_entry::set_as_needed): New function.
2631 (Incremental_input_entry::as_needed): New function.
2632 (Incremental_input_entry::do_dynobj_entry): New function.
2633 (Incremental_input_entry::as_needed_): New data member.
2634 (Incremental_object_entry::Incremental_object_entry): Don't check
2635 for shared library.
2636 (Incremental_object_entry::do_type): Likewise.
2637 (class Incremental_dynobj_entry): New class.
2638 (Incremental_input_entry_reader::as_needed): New function.
2639 (Incremental_input_entry_reader::get_soname): New function.
2640 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2641 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2642 size of shared library info entry.
58797674 2643 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
2644 incremental link when adding DT_NEEDED entries.
2645 * object.h (Object::Object): Initialize new data member.
2646 (Object::dynobj): New function.
2647 (Object::set_as_needed): New function.
2648 (Object::as_needed): New function.
2649 (Object::do_dynobj): New function.
2650 (Object::as_needed_): New data member.
2651
6fa2a40b
CC
26522011-05-24 Cary Coutant <ccoutant@google.com>
2653
2654 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2655 info; adjust display of GOT entries.
2656 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2657 vector of input objects; remove file_status_.
2658 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2659 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2660 got_plt reader; call target hooks to reserve GOT entries.
2661 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2662 of input file info header and GOT info entry.
2663 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2664 relocation info.
2665 (Got_plt_view_info::got_descriptor): Remove.
2666 (Got_plt_view_info::sym_index): New data member.
2667 (Got_plt_view_info::input_index): New data member.
2668 (Local_got_offset_visitor::visit): Write input file index.
2669 (Global_got_offset_visitor::visit): Write 0 for input file index.
2670 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2671 with sym_index and input_index.
2672 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2673 incremental info GOT entry; replace got_descriptor with input_index.
2674 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2675 map from input file index to object.
2676 (Sized_relobj_incr::do_layout): Replace direct data member reference
2677 with accessor function.
2678 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2679 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2680 Adjust size of input file info header.
2681 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2682 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2683 (Incremental_input_entry_reader::get_input_section): Adjust size of
2684 input file info header.
2685 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2686 of incremental info GOT entry.
2687 (Incremental_got_plt_reader::get_got_desc): Remove.
2688 (Incremental_got_plt_reader::get_got_symndx): New function.
2689 (Incremental_got_plt_reader::get_got_input_index): New function.
2690 (Sized_incremental_binary::Sized_incremental_binary): Remove
2691 file_status_; add input_objects_.
2692 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2693 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2694 (Sized_incremental_binary::file_is_unchanged): Remove.
2695 (Sized_incremental_binary::set_input_object): New function.
2696 (Sized_incremental_binary::input_object): New function.
2697 (Sized_incremental_binary::file_status_): Remove.
2698 (Sized_incremental_binary::input_objects_): New data member.
2699 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2700 references.
2701 (Sized_relobj_incr::invalid_address): Move to base class.
2702 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2703 class.
2704 (Sized_relobj_incr::do_output_section_offset): Likewise.
2705 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2706 (Sized_relobj_incr::section_offsets_): Likewise.
2707 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2708 function.
2709 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2710 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2711 with accessor function.
2712 (Sized_relobj_file::do_layout): Likewise.
2713 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2714 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2715 (Sized_relobj_file::compute_final_local_value): Replace refs to
2716 section_offsets_ with accessor function.
2717 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2718 * object.h (Relobj::Relobj): Initialize new data members.
2719 (Relobj::add_dyn_reloc): New function.
2720 (Relobj::first_dyn_reloc): New function.
2721 (Relobj::dyn_reloc_count): New function.
2722 (Relobj::first_dyn_reloc_): New data member.
2723 (Relobj::dyn_reloc_count_): New data member.
2724 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2725 references.
2726 (Sized_relobj::Address): New typedef.
2727 (Sized_relobj::invalid_address): Move here from child class.
2728 (Sized_relobj::Sized_relobj): Initialize new data members.
2729 (Sized_relobj::sized_relobj): New function.
2730 (Sized_relobj::is_output_section_offset_invalid): Move here from
2731 child class.
2732 (Sized_relobj::get_output_section_offset): Likewise.
2733 (Sized_relobj::local_has_got_offset): Likewise.
2734 (Sized_relobj::local_got_offset): Likewise.
2735 (Sized_relobj::set_local_got_offset): Likewise.
2736 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2737 (Sized_relobj::clear_got_offsets): New function.
2738 (Sized_relobj::section_offsets): Move here from child class.
2739 (Sized_relobj::do_output_section_offset): Likewise.
2740 (Sized_relobj::do_set_section_offset): Likewise.
2741 (Sized_relobj::Local_got_offsets): Likewise.
2742 (Sized_relobj::local_got_offsets_): Likewise.
2743 (Sized_relobj::section_offsets_): Likewise.
2744 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2745 references.
2746 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2747 class.
2748 (Sized_relobj_file::sized_relobj): New function
2749 (Sized_relobj_file::local_has_got_offset): Move to base class.
2750 (Sized_relobj_file::local_got_offset): Likewise.
2751 (Sized_relobj_file::set_local_got_offset): Likewise.
2752 (Sized_relobj_file::get_output_section_offset): Likewise.
2753 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2754 (Sized_relobj_file::do_output_section_offset): Likewise.
2755 (Sized_relobj_file::do_set_section_offset): Likewise.
2756 (Sized_relobj_file::Local_got_offsets): Likewise.
2757 (Sized_relobj_file::local_got_offsets_): Likewise.
2758 (Sized_relobj_file::section_offsets_): Likewise.
2759 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2760 (all constructors).
2761 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2762 (Output_reloc::get_symbol_index): Likewise.
2763 (Output_reloc::local_section_offset): Likewise.
2764 (Output_reloc::get_address): Likewise.
2765 (Output_reloc::symbol_value): Likewise.
2766 (Output_data_got::reserve_slot): Move to class definition.
2767 (Output_data_got::reserve_local): New function.
2768 (Output_data_got::reserve_slot_for_global): Remove.
2769 (Output_data_got::reserve_global): New function.
2770 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2771 (all constructors, two instantiations).
2772 (Output_reloc::get_relobj): New function (two instantiations).
2773 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2774 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2775 (Output_data_reloc::add_global): Adjust type of relobj.
2776 (Output_data_reloc::add_global_relative): Likewise.
2777 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2778 (Output_data_reloc::add_local): Likewise.
2779 (Output_data_reloc::add_local_relative): Likewise.
2780 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2781 (Output_data_reloc::add_local_section): Likewise.
2782 (Output_data_reloc::add_output_section): Likewise.
2783 (Output_data_reloc::add_absolute): Likewise.
2784 (Output_data_reloc::add_target_specific): Likewise.
2785 (Output_data_got::reserve_slot): Move definition here.
2786 (Output_data_got::reserve_local): New function.
2787 (Output_data_got::reserve_global): New function.
2788 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2789 section_offsets_ with accessor function.
2790 (Sized_relobj_file::write_sections): Likewise.
2791 (Sized_relobj_file::do_relocate_sections): Likewise.
2792 * target.h (Sized_target::reserve_local_got_entry): New function.
2793 (Sized_target::reserve_global_got_entry): New function.
2794 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2795 (Target_x86_64::reserve_global_got_entry): New function.
2796 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2797
4829d394
CC
27982011-05-23 Cary Coutant <ccoutant@google.com>
2799
2800 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2801 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2802 bit when checking got_type.
2803 * incremental.cc (Sized_incremental_binary::setup_readers):
2804 Store symbol table and string table locations; initialize bit vector
2805 of file status flags.
2806 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2807 unchanged files.
2808 (Sized_incremental_binary::do_process_got_plt): New function.
2809 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2810 (Output_section_incremental_inputs::set_final_data_size): Record
2811 file index for each input file.
2812 (Output_section_incremental_inputs::write_got_plt): Store file index
2813 instead of input entry offset for each GOT entry.
2814 * incremental.h
2815 (Incremental_input_entry::Incremental_input_entry): Initialize new
2816 data member.
2817 (Incremental_input_entry::set_offset): Store file index.
2818 (Incremental_input_entry::get_file_index): New function.
2819 (Incremental_input_entry::file_index_): New data member.
2820 (Incremental_binary::process_got_plt): New function.
2821 (Incremental_binary::do_process_got_plt): New function.
2822 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2823 data members.
2824 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2825 (Sized_incremental_binary::set_file_is_unchanged): New function.
2826 (Sized_incremental_binary::file_is_unchanged): New function.
2827 (Sized_incremental_binary::do_process_got_plt): New function.
2828 (Sized_incremental_binary::file_status_): New data member.
2829 (Sized_incremental_binary::main_symtab_loc_): New data member.
2830 (Sized_incremental_binary::main_strtab_loc_): New data member.
2831 * output.cc (Output_data_got::Got_entry::write): Add case
2832 RESERVED_CODE.
2833 (Output_data_got::add_global): Call add_got_entry.
2834 (Output_data_got::add_global_plt): Likewise.
2835 (Output_data_got::add_global_with_rel): Likewise.
2836 (Output_data_got::add_global_with_rela): Likewise.
2837 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2838 (Output_data_got::add_global_pair_with_rela): Likewise.
2839 (Output_data_got::add_local): Call add_got_entry.
2840 (Output_data_got::add_local_plt): Likewise.
2841 (Output_data_got::add_local_with_rel): Likewise.
2842 (Output_data_got::add_local_with_rela): Likewise.
2843 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2844 (Output_data_got::add_local_pair_with_rela): Likewise.
2845 (Output_data_got::reserve_slot): New function.
2846 (Output_data_got::reserve_slot_for_global): New function.
2847 (Output_data_got::add_got_entry): New function.
2848 (Output_data_got::add_got_entry_pair): New function.
2849 (Output_section::add_output_section_data): Edit FIXME.
2850 * output.h
2851 (Output_section_data_build::Output_section_data_build): New
2852 constructor with size parameter.
2853 (Output_data_space::Output_data_space): Likewise.
2854 (Output_data_got::Output_data_got): Initialize new data member; new
2855 constructor with size parameter.
2856 (Output_data_got::add_constant): Call add_got_entry.
2857 (Output_data_got::reserve_slot): New function.
2858 (Output_data_got::reserve_slot_for_global): New function.
2859 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2860 (Output_data_got::add_got_entry): New function.
2861 (Output_data_got::add_got_entry_pair): New function.
2862 (Output_data_got::free_list_): New data member.
2863 * target.h (Sized_target::init_got_plt_for_update): New function.
2864 (Sized_target::register_global_plt_entry): New function.
2865 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2866 Initialize new data member; call init; add constructor with PLT count.
2867 (Output_data_plt_x86_64::init): New function.
2868 (Output_data_plt_x86_64::add_relocation): New function.
2869 (Output_data_plt_x86_64::reserve_slot): New function.
2870 (Output_data_plt_x86_64::free_list_): New data member.
2871 (Target_x86_64::init_got_plt_for_update): New function.
2872 (Target_x86_64::register_global_plt_entry): New function.
2873 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2874 incremental updates.
2875 (Output_data_plt_x86_64::add_relocation): New function.
2876 * testsuite/object_unittest.cc (Object_test): Set default options.
2877
ec69d6da
ILT
28782011-05-16 Ian Lance Taylor <iant@google.com>
2879
2880 * options.h (class General_options): Make -i a synonym for -r.
2881
732e31de
ILT
28822011-05-16 Ian Lance Taylor <iant@google.com>
2883
2884 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2885
403676b5
CC
28862011-05-10 Cary Coutant <ccoutant@google.com>
2887
2888 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2889 strip_all (-s).
2890
5b7b7d6e
ILT
28912011-05-06 Ian Lance Taylor <iant@google.com>
2892
2893 * layout.cc (Layout::layout): If the output section flags change,
2894 update the ordering.
2895
f0f9babf
CC
28962011-04-25 Cary Coutant <ccoutant@google.com>
2897
2898 * incremental-dump.cc (dump_incremental_inputs): Print local
2899 symbol info for each input file.
2900 * incremental.cc
2901 (Output_section_incremental_inputs::set_final_data_size): Add local
2902 symbol info to input file entries in incremental info.
2903 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2904 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2905 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2906 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2907 implementation.
2908 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2909 (Sized_incr_relobj::do_relocate): Write the local symbols.
2910 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2911 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2912 Adjust size of input file header.
2913 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2914 (Incremental_inputs_reader::get_local_symbol_count): New function.
2915 (Incremental_inputs_reader::get_input_section): Adjust size of input
2916 file header.
2917 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2918 (Sized_incr_relobj::This): New typedef.
2919 (Sized_incr_relobj::sym_size): New const data member.
2920 (Sized_incr_relobj::Local_symbol): New struct.
2921 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2922 (Sized_incr_relobj::do_local_symbol_offset): New function.
2923 (Sized_incr_relobj::local_symbol_count_): New data member.
2924 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2925 (Sized_incr_relobj::local_symbol_index_): New data member.
2926 (Sized_incr_relobj::local_symbol_offset_): New data member.
2927 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2928 (Sized_incr_relobj::local_symbols_): New data member.
2929 * object.h (Relobj::output_local_symbol_count): New function.
2930 (Relobj::local_symbol_offset): New function.
2931 (Relobj::do_output_local_symbol_count): New function.
2932 (Relobj::do_local_symbol_offset): New function.
2933 (Sized_relobj::do_output_local_symbol_count): New function.
2934 (Sized_relobj::do_local_symbol_offset): New function.
2935
d0a9ace3
ILT
29362011-04-22 Vladimir Simonov <sv@sw.ru>
2937
2938 * descriptors.cc (set_close_on_exec): New function.
2939 (Descriptors::open): Use set_close_on_exec.
2940 * output.cc (S_ISLNK): Define if not defined.
2941
94a3fc8b
CC
29422011-04-22 Cary Coutant <ccoutant@google.com>
2943
2944 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2945 global symbol map.
2946 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2947 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2948 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2949 relocations.
2950 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2951 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2952 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2953 * incremental.h
2954 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2955 function.
2956 (Incremental_binary::apply_incremental_relocs): New function.
2957 (Incremental_binary::do_apply_incremental_relocs): New function.
2958 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2959 data member.
2960 (Sized_incremental_binary::add_global_symbol): New function.
2961 (Sized_incremental_binary::global_symbol): New function.
2962 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2963 (Sized_incremental_binary::symbol_map_): New data member.
2964 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2965 * target.h (Sized_target::apply_relocation): New function.
2966 * target-reloc.h (apply_relocation): New function.
2967 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2968
c87e4302
DK
29692011-04-22 Doug Kwan <dougkwan@google.com>
2970
2971 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2972 flag of a SHT_ARM_EXIDX section.
2e702c99 2973 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
2974 * testsuite/Makefile.in: Regenerate.
2975 * testsuite/arm_exidx_test.s: New file.
2976 * testsuite/arm_exidx_test.sh: Same.
2977
e7782cf6
CC
29782011-04-20 Cary Coutant <ccoutant@google.com>
2979
2980 PR gold/12689
2981 * archive.h (Incremental_archive_entry::Archive_member):
2982 Initialize arg_serial_ (second constructor).
2983
308ecdc7
ILT
29842011-04-17 Ian Lance Taylor <iant@google.com>
2985
2986 * object.cc (Relocate_info::location): Simplify location string.
2987 * errors.cc (Errors::error_at_location): Don't print program
2988 name.
2989 (Errors::warning_at_location): Likewise.
2990 (Errors::undefined_symbol): Likewise.
2991 * testsuite/debug_msg.sh: Update accordingly.
2992
bec5b579
CC
29932011-04-14 Cary Coutant <ccoutant@google.com>
2994
2995 * gold/layout.cc (Layout::symtab_section_offset): New function.
2996 * gold/layout.h (Layout::symtab_section_offset): New function.
2997 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2998
88597d34
ILT
29992011-04-12 Ian Lance Taylor <iant@google.com>
3000
3001 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
3002 with MREMAP_MAYMOVE.
3003 * output.h (class Output_file): Add map_is_allocated_ field.
3004 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3005 not available, provide stubs. If mremap is not available, #define
3006 it to gold_mremap.
3007 (MREMAP_MAYMOVE): Define if not defined.
3008 (Output_file::Output_file): Initialize map_is_allocated_.
3009 (Output_file::resize): Check map_is_allocated_.
3010 (Output_file::map_anonymous): If mmap fails, use malloc.
3011 (Output_file::unmap): Don't do anything for an anonymous map.
3012 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3013 is not available, provide stubs.
3014 (File_read::View::~View): Use free rather than delete[].
3015 (File_read::make_view): Use malloc rather than new[]. If mmap
3016 fails, use malloc.
3017 (File_read::find_or_make_view): Use malloc rather than new[].
3018 * gold.h: Remove HAVE_REMAP code.
3019 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
3020 exists. Rename mremap to gold_mremap. If mmap is not available
3021 don't do anything.
3022 * configure, config.in: Rebuild.
3023
11e361bc
ILT
30242011-04-11 Ian Lance Taylor <iant@google.com>
3025
3026 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
3027 initialize local variable v.
3028
cdc29364
CC
30292011-04-11 Cary Coutant <ccoutant@google.com>
3030
3031 * archive.cc (Archive::include_member): Adjust call to
3032 report_object.
3033 (Add_archive_symbols::run): Track argument serial numbers.
3034 (Lib_group::include_member): Likewise.
3035 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3036 * archive.h (Incremental_archive_entry::Archive_member):
3037 Initialize arg_serial_.
3038 (Archive_member::arg_serial_): New data member.
3039 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3040 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3041 incremental link.
3042 (Sized_dynobj::do_for_all_local_got_entries): New function.
3043 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
3044 function.
3045 * fileread.cc (get_mtime): New function.
3046 * fileread.h (get_mtime): New function.
3047 * gold.cc (queue_initial_tasks): Check for incremental update.
3048 (process_incremental_input): New function.
3049 (queue_middle_tasks): Don't force valid target for incremental
3050 update.
3051 * incremental-dump.cc (find_input_containing_global): Adjust
3052 size of symbol info entry.
3053 (dump_incremental_inputs): Dump argument serial number and
3054 in_system_directory flag; bias shndx by 1; print symbol names
3055 when dumping per-file symbol lists; use new symbol info readers.
3056 * incremental.cc
3057 (Output_section_incremental_inputs:update_data_size): New function.
3058 (Sized_incremental_binary::setup_readers): Setup input readers
3059 for each input file; build maps for files added from libraries
3060 and scripts.
3061 (Sized_incremental_binary::check_input_args): New function.
3062 (Sized_incremental_binary::do_check_inputs): Build map of argument
3063 serial numbers to input arguments.
3064 (Sized_incremental_binary::do_file_has_changed): Rename
3065 do_file_is_unchanged to this; compare file modification times.
3066 (Sized_incremental_binary::do_init_layout): New function.
3067 (Sized_incremental_binary::do_reserve_layout): New function.
3068 (Sized_incremental_binary::do_get_input_reader): Remove.
3069 (Sized_incremental_binary::get_symtab_view): New function.
3070 (Incremental_checker::can_incrementally_link_output_file): Remove.
3071 (Incremental_inputs::report_command_line): Exclude --debug options.
3072 (Incremental_inputs::report_archive_begin): Add parameter; track
3073 argument serial numbers; don't put input file entry for archive
3074 before archive members.
3075 (Incremental_inputs::report_archive_end): Put input file entry
3076 for archive after archive members.
3077 (Incremental_inputs::report_object): Add parameter; track argument
3078 serial numbers and in_system_directory flag.
3079 (Incremental_inputs::report_script): Add parameter; track argument
3080 serial numbers.
3081 (Output_section_incremental_inputs::set_final_data_size): Adjust
3082 size of symbol info entry; check for forwarding symbols.
3083 (Output_section_incremental_inputs::write_input_files): Write
3084 in_system_directory flag and argument serial number.
3085 (Output_section_incremental_inputs::write_info_blocks): Map section
3086 indices between incremental info and original input file; store
3087 input section index for each symbol.
3088 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
3089 change operator() to visit().
3090 (class Global_got_offset_visitor): Likewise.
3091 (class Global_symbol_visitor_got_plt):
3092 (Output_section_incremental_inputs::write_got_plt): Use new visitor
3093 classes.
3094 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
3095 (Sized_incr_relobj::do_read_symbols): New function.
3096 (Sized_incr_relobj::do_layout): New function.
3097 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3098 (Sized_incr_relobj::do_add_symbols): New function.
3099 (Sized_incr_relobj::do_should_include_member): New function.
3100 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3101 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3102 (Sized_incr_relobj::do_section_size): New function.
3103 (Sized_incr_relobj::do_section_name): New function.
3104 (Sized_incr_relobj::do_section_contents): New function.
3105 (Sized_incr_relobj::do_section_flags): New function.
3106 (Sized_incr_relobj::do_section_entsize): New function.
3107 (Sized_incr_relobj::do_section_address): New function.
3108 (Sized_incr_relobj::do_section_type): New function.
3109 (Sized_incr_relobj::do_section_link): New function.
3110 (Sized_incr_relobj::do_section_info): New function.
3111 (Sized_incr_relobj::do_section_addralign): New function.
3112 (Sized_incr_relobj::do_initialize_xindex): New function.
3113 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3114 (Sized_incr_relobj::do_read_relocs): New function.
3115 (Sized_incr_relobj::do_gc_process_relocs): New function.
3116 (Sized_incr_relobj::do_scan_relocs): New function.
3117 (Sized_incr_relobj::do_count_local_symbols): New function.
3118 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3119 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3120 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3121 (Sized_incr_relobj::do_relocate): New function.
3122 (Sized_incr_relobj::do_set_section_offset): New function.
3123 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3124 (Sized_incr_dynobj::do_read_symbols): New function.
3125 (Sized_incr_dynobj::do_layout): New function.
3126 (Sized_incr_dynobj::do_add_symbols): New function.
3127 (Sized_incr_dynobj::do_should_include_member): New function.
3128 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3129 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3130 (Sized_incr_dynobj::do_section_size): New function.
3131 (Sized_incr_dynobj::do_section_name): New function.
3132 (Sized_incr_dynobj::do_section_contents): New function.
3133 (Sized_incr_dynobj::do_section_flags): New function.
3134 (Sized_incr_dynobj::do_section_entsize): New function.
3135 (Sized_incr_dynobj::do_section_address): New function.
3136 (Sized_incr_dynobj::do_section_type): New function.
3137 (Sized_incr_dynobj::do_section_link): New function.
3138 (Sized_incr_dynobj::do_section_info): New function.
3139 (Sized_incr_dynobj::do_section_addralign): New function.
3140 (Sized_incr_dynobj::do_initialize_xindex): New function.
3141 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3142 (make_sized_incremental_object): New function.
3143 (Incremental_library::copy_unused_symbols): New function.
3144 (Incremental_library::do_for_all_unused_symbols): New function.
3145 * incremental.h (enum Incremental_input_flags): New type.
3146 (class Incremental_checker): Remove.
3147 (Incremental_input_entry::Incremental_input_entry): Add argument
3148 serial number.
3149 (Incremental_input_entry::arg_serial): New function.
3150 (Incremental_input_entry::set_is_in_system_directory): New function.
3151 (Incremental_input_entry::is_in_system_directory): New function.
3152 (Incremental_input_entry::arg_serial_): New data member.
3153 (Incremental_input_entry::is_in_system_directory_): New data member.
3154 (class Script_info): Move here from script.h.
3155 (Script_info::Script_info): Add filename parameter.
3156 (Script_info::filename): New function.
3157 (Script_info::filename_): New data member.
3158 (Incremental_script_entry::Incremental_script_entry): Add argument
3159 serial number.
3160 (Incremental_object_entry::Incremental_object_entry): Likewise.
3161 (Incremental_object_entry::add_input_section): Build list of input
3162 sections with map to original shndx.
3163 (Incremental_object_entry::get_input_section_index): New function.
3164 (Incremental_object_entry::shndx_): New data member.
3165 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3166 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3167 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3168 serial number.
3169 (Incremental_inputs::report_archive_begin): Likewise.
3170 (Incremental_inputs::report_object): Likewise.
3171 (Incremental_inputs::report_script): Likewise.
3172 (class Incremental_global_symbol_reader): New class.
3173 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3174 and store flags and input file type.
3175 (Incremental_input_entry_reader::arg_serial): New function.
3176 (Incremental_input_entry_reader::type): Extract type from flags.
3177 (Incremental_input_entry_reader::is_in_system_directory): New function.
3178 (Incremental_input_entry_reader::get_input_section_count): Call
3179 accessor function for type.
3180 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3181 function for type; adjust size of global symbol entry.
3182 (Incremental_input_entry_reader::get_global_symbol_count): Call
3183 accessor function for type.
3184 (Incremental_input_entry_reader::get_object_count): Likewise.
3185 (Incremental_input_entry_reader::get_object_offset): Likewise.
3186 (Incremental_input_entry_reader::get_member_count): Likewise.
3187 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3188 (Incremental_input_entry_reader::get_member_offset): Likewise.
3189 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3190 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3191 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3192 (Incremental_input_entry_reader::get_global_symbol_reader): New
3193 function.
3194 (Incremental_input_entry_reader::get_output_symbol_index): New
3195 function.
3196 (Incremental_input_entry_reader::type_): Remove.
3197 (Incremental_input_entry_reader::flags_): New data member.
3198 (Incremental_inputs_reader::input_file_offset): New function.
3199 (Incremental_inputs_reader::input_file_index): New function.
3200 (Incremental_inputs_reader::input_file): Call input_file_offset.
3201 (Incremental_inputs_reader::input_file_at_offset): New function.
3202 (Incremental_relocs_reader::get_r_type): Reformat.
3203 (Incremental_relocs_reader::get_r_shndx): Reformat.
3204 (Incremental_relocs_reader::get_r_offset): Reformat.
3205 (Incremental_relocs_reader::data): New function.
3206 (Incremental_binary::Incremental_binary): Initialize new data members.
3207 (Incremental_binary::check_inputs): Add cmdline parameter.
3208 (Incremental_binary::file_is_unchanged): Remove.
3209 (Input_reader::arg_serial): New function.
3210 (Input_reader::get_unused_symbol_count): New function.
3211 (Input_reader::get_unused_symbol): New function.
3212 (Input_reader::do_arg_serial): New function.
3213 (Input_reader::do_get_unused_symbol_count): New function.
3214 (Input_reader::do_get_unused_symbol): New function.
3215 (Incremental_binary::input_file_count): New function.
3216 (Incremental_binary::get_input_reader): Change signature to use
3217 index instead of filename.
3218 (Incremental_binary::file_has_changed): New function.
3219 (Incremental_binary::get_input_argument): New function.
3220 (Incremental_binary::get_library): New function.
3221 (Incremental_binary::get_script_info): New function.
3222 (Incremental_binary::init_layout): New function.
3223 (Incremental_binary::reserve_layout): New function.
3224 (Incremental_binary::output_file): New function.
3225 (Incremental_binary::do_check_inputs): New function.
3226 (Incremental_binary::do_file_is_unchanged): Remove.
3227 (Incremental_binary::do_file_has_changed): New function.
3228 (Incremental_binary::do_init_layout): New function.
3229 (Incremental_binary::do_reserve_layout): New function.
3230 (Incremental_binary::do_input_file_count): New function.
3231 (Incremental_binary::do_get_input_reader): Change signature.
3232 (Incremental_binary::input_args_map_): New data member.
3233 (Incremental_binary::library_map_): New data member.
3234 (Incremental_binary::script_map_): New data member.
3235 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3236 new data members.
3237 (Sized_incremental_binary::output_section): New function.
3238 (Sized_incremental_binary::inputs_reader): Add const.
3239 (Sized_incremental_binary::symtab_reader): Add const.
3240 (Sized_incremental_binary::relocs_reader): Add const.
3241 (Sized_incremental_binary::got_plt_reader): Add const.
3242 (Sized_incremental_binary::get_symtab_view): New function.
3243 (Sized_incremental_binary::Inputs_reader): New typedef.
3244 (Sized_incremental_binary::Input_entry_reader): New typedef.
3245 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3246 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3247 (Sized_incremental_binary::do_file_has_changed): New function.
3248 (Sized_incremental_binary::do_init_layout): New function.
3249 (Sized_incremental_binary::do_reserve_layout): New function.
3250 (Sized_input_reader::Inputs_reader): Remove.
3251 (Sized_input_reader::Input_entry_reader): Remove.
3252 (Sized_input_reader::do_arg_serial): New function.
3253 (Sized_input_reader::do_get_unused_symbol_count): New function.
3254 (Sized_input_reader::do_get_unused_symbol): New function.
3255 (Sized_incremental_binary::do_input_file_count): New function.
3256 (Sized_incremental_binary::do_get_input_reader): Change signature;
3257 use index instead of filename.
3258 (Sized_incremental_binary::section_map_): New data member.
3259 (Sized_incremental_binary::input_entry_readers_): New data member.
3260 (class Sized_incr_relobj): New class.
3261 (class Sized_incr_dynobj): New class.
3262 (make_sized_incremental_object): New function.
3263 (class Incremental_library): New class.
3264 * layout.cc (Free_list::num_lists): New static data member.
3265 (Free_list::num_nodes): New static data member.
3266 (Free_list::num_removes): New static data member.
3267 (Free_list::num_remove_visits): New static data member.
3268 (Free_list::num_allocates): New static data member.
3269 (Free_list::num_allocate_visits): New static data member.
3270 (Free_list::init): New function.
3271 (Free_list::remove): New function.
3272 (Free_list::allocate): New function.
3273 (Free_list::dump): New function.
3274 (Free_list::print_stats): New function.
3275 (Layout_task_runner::run): Resize output file for incremental updates.
3276 (Layout::Layout): Initialize new data members.
3277 (Layout::set_incremental_base): New function.
3278 (Layout::init_fixed_output_section): New function.
3279 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3280 incremental updates.
3281 (Layout::create_gold_note): Do not create gold note section for
3282 incremental updates.
3283 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3284 for incremental updates.
3285 (Layout::set_section_offsets): For incremental updates, allocate space
3286 from free list.
3287 (Layout::create_symtab_sections): Layout with offsets relative to
3288 start of section; for incremental updates, allocate space from free
3289 list.
3290 (Layout::create_shdrs): For incremental updates, allocate space from
3291 free list.
3292 (Layout::finish_dynamic_section): For incremental updates, do not
3293 check --as-needed (fixed in subsequent patch).
3294 * layout.h (class Free_list): New class.
3295 (Layout::set_incremental_base): New function.
3296 (Layout::incremental_base): New function.
3297 (Layout::init_fixed_output_section): New function.
3298 (Layout::allocate): New function.
3299 (Layout::incremental_base_): New data member.
3300 (Layout::free_list_): New data member.
3301 * main.cc (main): Print Free_list statistics.
3302 * object.cc (Relobj::finalize_incremental_relocs): Add
3303 clear_counts parameter; clear counts only when clear_counts is set.
3304 (Sized_relobj::Sized_relobj): Initialize new base class.
3305 (Sized_relobj::do_layout): Don't report special sections.
3306 (Sized_relobj::do_for_all_local_got_entries): New function.
3307 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3308 symtab_off to all symbol table offsets.
3309 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3310 * object.h (class Got_offset_list): Move to top of file.
3311 (Object::Object): Allow case where input_file == NULL.
3312 (Object::~Object): Likewise.
3313 (Object::input_file): Assert that input_file != NULL.
3314 (Object::lock): Allow case where input_file == NULL.
3315 (Object::unlock): Likewise.
3316 (Object::is_locked): Likewise.
3317 (Object::token): Likewise.
3318 (Object::release): Likewise.
3319 (Object::is_incremental): New function.
3320 (Object::get_mtime): New function.
3321 (Object::for_all_local_got_entries): New function.
3322 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3323 (Object::set_is_in_system_directory): New function.
3324 (Object::is_in_system_directory): New function.
3325 (Object::do_is_incremental): New function.
3326 (Object::do_get_mtime): New function.
3327 (Object::do_for_all_local_got_entries): New function.
3328 (Object::is_in_system_directory_): New data member.
3329 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3330 (class Sized_relobj_base): New class.
3331 (class Sized_relobj): Derive from Sized_relobj_base.
3332 (class Sized_relobj::Symbols): Redeclare from base class.
3333 (class Sized_relobj::local_got_offset_list): Remove.
3334 (class Sized_relobj::Output_sections): Redeclare from base class.
3335 (class Sized_relobj::do_for_all_local_got_entries): New function.
3336 (class Sized_relobj::write_local_symbols): Add offset parameter.
3337 (class Sized_relobj::local_symbol_offset_): Update comment.
3338 (class Sized_relobj::local_dynsym_offset_): Update comment.
3339 * options.cc (Input_arguments::add_file): Remove const.
3340 * options.h (Input_file_argument::Input_file_argument):
3341 Initialize arg_serial_ (all constructors).
3342 (Input_file_argument::set_arg_serial): New function.
3343 (Input_file_argument::arg_serial): New function.
3344 (Input_file_argument::arg_serial_): New data member.
3345 (Input_arguments::Input_arguments): Initialize file_count_.
3346 (Input_arguments::add_file): Remove const.
3347 (Input_arguments::number_of_input_files): New function.
3348 (Input_arguments::file_count_): New data member.
3349 (Command_line::number_of_input_files): Call
3350 Input_arguments::number_of_input_files.
3351 * output.cc (Output_segment_headers::Output_segment_headers):
3352 Set current size.
3353 (Output_section::Input_section::current_data_size): New function.
3354 (Output_section::Output_section): Initialize new data members.
3355 (Output_section::add_input_section): Don't do merge sections for
3356 an incremental link; allocate space from free list for an
3357 incremental update.
3358 (Output_section::add_output_section_data): Allocate space from
3359 free list for an incremental update.
3360 (Output_section::update_data_size): New function.
3361 (Output_section::set_fixed_layout): New function.
3362 (Output_section::reserve): New function.
3363 (Output_segment::set_section_addresses): Remove const.
3364 (Output_segment::set_section_list_addresses): Remove const; allocate
3365 space from free list for an incremental update.
3366 (Output_segment::set_offset): Adjust size of RELRO segment for an
3367 incremental update.
3368 * output.h (Output_data::current_data_size): Move here from
3369 child classes.
3370 (Output_data::pre_finalize_data_size): New function.
3371 (Output_data::update_data_size): New function.
3372 (Output_section_headers::update_data_size): new function.
3373 (Output_section_data_build::current_data_size): Move to Output_data.
3374 (Output_data_strtab::update_data_size): New function.
3375 (Output_section::current_data_size): Move to Output_data.
3376 (Output_section::set_fixed_layout): New function.
3377 (Output_section::has_fixed_layout): New function.
3378 (Output_section::reserve): New function.
3379 (Output_section::update_data_size): New function.
3380 (Output_section::has_fixed_layout_): New data member.
3381 (Output_section::free_list_): New data member.
3382 (Output_segment::set_section_addresses): Remove const.
3383 (Output_segment::set_section_list_addresses): Remove const.
3384 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3385 New function.
3386 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3387 New function.
3388 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3389 parameter when calling Add_symbols constructor; store argument
3390 serial number for members of a lib group.
3391 (Add_symbols::locks): Allow case where token == NULL.
3392 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3393 (Read_member::~Read_member): New function.
3394 (Read_member::is_runnable): New function.
3395 (Read_member::locks): New function.
3396 (Read_member::run): New function.
3397 (Check_script::~Check_script): New function.
3398 (Check_script::is_runnable): New function.
3399 (Check_script::locks): New function.
3400 (Check_script::run): New function.
3401 (Check_library::~Check_library): New function.
3402 (Check_library::is_runnable): New function.
3403 (Check_library::locks): New function.
3404 (Check_library::run): New function.
3405 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3406 (Add_symbols::library_): New data member.
3407 (class Read_member): New class.
3408 (class Check_script): New class.
3409 (class Check_library): New class.
3410 * reloc.cc (Read_relocs::is_runnable): Allow case where
3411 token == NULL.
3412 (Read_relocs::locks): Likewise.
3413 (Scan_relocs::locks): Likewise.
3414 (Relocate_task::locks): Likewise.
3415 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3416 to clear counters.
3417 (Sized_relobj::incremental_relocs_scan): Fix comment.
3418 (Sized_relobj::do_relocate): Pass output file offset to
3419 write_local_symbols.
3420 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3421 from class declaration.
3422 * script.cc (read_input_script): Allocate Script_info; pass
3423 argument serial number to report_script.
3424 * script.h (class Script_info): Move to incremental.h.
3425 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3426 * symtab.h (Symbol_table::add_from_incrobj): New function.
3427 (Symbol_table::set_file_offset): New function.
3428
b961d0d7
CC
34292011-04-05 Cary Coutant <ccoutant@google.com>
3430
3431 * incremental-dump.cc (dump_incremental_inputs): Change signature
3432 to take a Sized_incremental_binary; change caller. Use readers
3433 in Sized_incremental_binary.
3434 * incremental.cc
3435 (Sized_incremental_binary::find_incremental_inputs_sections):
3436 Rename do_find_incremental_inputs_sections to this.
3437 (Sized_incremental_binary::setup_readers): New function.
3438 (Sized_incremental_binary::do_check_inputs): Check
3439 has_incremental_info_ flag; move setup code to setup_readers;
3440 use input readers.
3441 (Sized_incremental_binary::do_file_is_unchanged): New function.
3442 (Sized_incremental_binary::do_get_input_reader): New function.
3443 * incremental.h (class Incremental_binary): Move to end of file.
3444 (Incremental_binary::file_is_unchanged): New function.
3445 (Incremental_binary::do_file_is_unchanged): New function.
3446 (Incremental_binary::Input_reader): New class.
3447 (Incremental_binary::get_input_reader): New function.
3448 (class Sized_incremental_binary): Move to end of file.
3449 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3450 input section reader classes.
3451 (Sized_incremental_binary::has_incremental_info): New function.
3452 (Sized_incremental_binary::inputs_reader): New function.
3453 (Sized_incremental_binary::symtab_reader): New function.
3454 (Sized_incremental_binary::relocs_reader): New function.
3455 (Sized_incremental_binary::got_plt_reader): New function.
3456 (Sized_incremental_binary::do_file_is_unchanged): New function.
3457 (Sized_incremental_binary::Sized_input_reader): New class.
3458 (Sized_incremental_binary::get_input_reader): New function.
3459 (Sized_incremental_binary::find_incremental_inputs_sections):
3460 Rename do_find_incremental_inputs_sections to this.
3461 (Sized_incremental_binary::setup_readers): New function.
3462 (Sized_incremental_binary::has_incremental_info_): New data member.
3463 (Sized_incremental_binary::inputs_reader_): New data member.
3464 (Sized_incremental_binary::symtab_reader_): New data member.
3465 (Sized_incremental_binary::relocs_reader_): New data member.
3466 (Sized_incremental_binary::got_plt_reader_): New data member.
3467 (Sized_incremental_binary::current_input_file_): New data member.
3468
a869183f
PP
34692011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3470
3471 PR gold/12640
3472 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3473 violation.
3474
34752011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
3476
3477 * archive.cc (Archive::include_member): Adjust call to report_object.
3478 (Add_archive_symbols::run): Add script_info to call to
3479 report_archive_begin.
3480 (Lib_group::include_member): Adjust call to report_object.
3481 (Add_lib_group_symbols::run): Adjust call to report_object.
3482 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3483 blocks. Add object count for script input files.
3484 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3485 script_info parameter; change all callers.
3486 (Incremental_inputs::report_object): Add script_info parameter;
3487 change all callers.
3488 (Incremental_inputs::report_script): Store backpointer to
3489 incremental info entry.
3490 (Output_section_incremental_inputs::set_final_data_size): Record
3491 additional information for scripts.
3492 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3493 * incremental.h (Incremental_script_entry::add_object): New function.
3494 (Incremental_script_entry::get_object_count): New function.
3495 (Incremental_script_entry::get_object): New function.
3496 (Incremental_script_entry::objects_): New data member; adjust
3497 constructor.
3498 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3499 (Incremental_inputs::report_object): Add script_info parameter.
3500 (Incremental_inputs_reader::get_object_count): New function.
3501 (Incremental_inputs_reader::get_object_offset): New function.
3502 * options.cc (Input_arguments::add_file): Return reference to
3503 new input argument.
3504 * options.h (Input_argument::set_script_info): New function.
3505 (Input_argument::script_info): New function.
3506 (Input_argument::script_info_): New data member; adjust all
3507 constructors.
3508 (Input_file_group::add_file): Return reference to new input argument.
3509 (Input_file_lib::add_file): Likewise.
3510 (Input_arguments::add_file): Likewise.
3511 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3512 * script.cc (Parser_closure::Parser_closure): Add script_info
3513 parameter; adjust all callers.
3514 (Parser_closure::script_info): New function.
3515 (Parser_closure::script_info_): New data member.
3516 (read_input_script): Report scripts earlier to incremental info.
3517 (script_add_file): Set script_info in Input_argument.
3518 (script_add_library): Likewise.
3519 * script.h (Script_options::Script_info): Rewrite class.
3520
a869183f 35212011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
3522
3523 * archive.cc (Library_base::should_include_member): Move
3524 method here from class Archive.
3525 (Archive::Archive): Initialize base class.
3526 (Archive::should_include_member): Move to base class.
3527 (Archive::do_for_all_unused_symbols): New function.
3528 (Add_archive_symbols::run): Remove redundant access to
3529 incremental_inputs.
3530 (Lib_group::Lib_group): Initialize base class.
3531 (Lib_group::do_filename): New function.
3532 (Lib_group::include_member): Pass pointer to Lib_group to
3533 report_object.
3534 (Lib_group::do_for_all_unused_symbols): New function.
3535 (Add_lib_group_symbols::run): Report archive information for
3536 incremental links.
3537 * archive.h (class Library_base): New base class.
3538 (class Archive): Derive from Library_base.
3539 (Archive::filename): Move to base class.
3540 (Archive::set_incremental_info): Likewise.
3541 (Archive::incremental_info): Likewise.
3542 (Archive::Should_include): Likewise.
3543 (Archive::should_include_member): Likewise.
3544 (Archive::Armap_entry): Remove.
3545 (Archive::Unused_symbol_iterator): Remove.
3546 (Archive::unused_symbols_begin): Remove.
3547 (Archive::unused_symbols_end): Remove.
3548 (Archive::do_filename): New function.
3549 (Archive::do_get_mtime): New function.
3550 (Archive::do_for_all_unused_symbols): New function.
3551 (Archive::task_): Move to base class.
3552 (Archive::incremental_info_): Likewise.
3553 (class Lib_group): Derive from Library_base.
3554 (Lib_group::do_filename): New function.
3555 (Lib_group::do_get_mtime): New function.
3556 (Lib_group::do_for_all_unused_symbols): New function.
3557 (Lib_group::task_): Move to base class.
3558 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3559 function.
3560 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3561 function.
3562 * incremental.cc (Incremental_inputs::report_archive_begin):
3563 Use Library_base; call library's get_mtime; add incremental inputs
3564 entry before members.
3565 (class Unused_symbol_visitor): New class.
3566 (Incremental_inputs::report_archive_end): Use Library_base; use
3567 visitor class to record unused symbols; don't add incremental inputs
3568 entry after members.
3569 (Incremental_inputs::report_object): Use Library_base.
3570 * incremental.h
3571 (Incremental_archive_entry::Incremental_archive_entry): Remove
3572 unused Archive parameter.
3573 (Incremental_inputs::report_archive_begin): Use Library_base.
3574 (Incremental_inputs::report_archive_end): Likewise.
3575 (Incremental_inputs::report_object): Likewise.
3576 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3577 function.
3578 * object.h (Object::for_all_global_symbols): New function.
3579 (Object::do_for_all_global_symbols): New function.
3580 (Sized_relobj::do_for_all_global_symbols): New function.
3581 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3582 function.
3583 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3584 function.
3585
61ab3e40
ILT
35862011-03-27 Ian Lance Taylor <iant@google.com>
3587
3588 * archive.cc (Archive::interpret_header): Return -1 if something
3589 goes wrong. Change callers accordingly.
3590
30e1f9e6
CC
35912011-03-25 Cary Coutant <ccoutant@google.com>
3592
3593 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3594 * testsuite/Makefile.in: Regenerate.
3595
9370ce59 35962011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
3597
3598 * plugin.cc (get_view): New.
3599 (Plugin::load): Pass get_view to the plugin.
3600 (Plugin_manager::get_view): New.
3601
9312bb0a
ILT
36022011-03-21 Ian Lance Taylor <iant@google.com>
3603
3604 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 3605 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 3606
7e12ba9e
ST
36072011-03-21 Sriraman Tallam <tmsriram@google.com>
3608
3609 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3610 Change == to -eq.
3611 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3612 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3613 Change == to -eq.
3614 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3615 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3616
fd7a005d
ILT
36172011-03-14 Ian Lance Taylor <iant@google.com>
3618
3619 * script-sections.cc (Sort_output_sections::script_compare):
3620 Rename from is_before, change return type.
3621 (Sort_output_sections::operator()): Adjust accordingly.
3622
ed16fd1b
ILT
36232011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3624
3625 PR gold/12572
3626 * testsuite/odr_violation2.cc: Add comment to make all error line
3627 numbers double digits.
3628 * testsuite/debug_msg.sh: Adjust expected errors.
3629
71ff8986
ILT
36302011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3631
3632 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3633 but mark earlier ones as non-canonical
3634 (offset_to_iterator): Update search target and example
3635 (do_addr2line): Return extra lines in a vector*
3636 (format_file_lineno): Extract from do_addr2line
3637 (one_addr2line): Add vector* out-param
3638 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3639 when a lineno entry appeared last for its instruction
3640 (Dwarf_line_info): Add vector* out-param
3641 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3642 * symtab.cc (Odr_violation_compare): Include the lineno in the
3643 comparison again.
3644 (linenos_from_loc): New. Combine the canonical line for an
3645 address with its other lines.
3646 (True_if_intersect): New. Helper functor to make
3647 std::set_intersection a query.
3648 (detect_odr_violations): Compare sets of lines instead of just
3649 one line for each function. This became less deterministic, but
3650 has fewer false positives.
3651 * symtab.h: Declarations.
3652 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3653 mix an optimized and non-optimized object in the same binary
3654 (odr_violation2.so): Same.
3655 * testsuite/Makefile.in: Regenerate from Makefile.am.
3656 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3657 * testsuite/debug_msg.sh: Update line numbers and add
3658 assertions.
3659 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3660 non-optimized context.
3661 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3662 isn't inlined, and use OdrDerived in an optimized context.
3663 * testsuite/odr_header1.h: Defines OdrDerived, where
3664 optimization will change the
3665 first-instruction-in-the-destructor's file and line number.
3666 * testsuite/odr_header2.h: Defines OdrBase.
3667
a19fefdc
ILT
36682011-03-09 Ian Lance Taylor <iant@google.com>
3669
3670 * fileread.cc (File_read::clear_views): Don't delete the whole
3671 file view.
3672
ecb351e9
ILT
36732011-03-08 Ian Lance Taylor <iant@google.com>
3674
3675 PR gold/12525
3676 * fileread.cc: #include <climits>.
3677 (GOLD_IOV_MAX): Define.
3678 (File_read::read_multiple): Limit number of entries by iov_max.
3679 * fileread.h (class File_read): Always set max_readv_entries to
3680 128.
3681
b821d13c
ILT
36822011-03-07 Ian Lance Taylor <iant@google.com>
3683
3684 PR gold/12525
3685 * options.h (class General_options): Add -dy and -dn.
3686
89243142
CC
36872011-03-02 Cary Coutant <ccoutant@google.com>
3688
3689 * testsuite/script_test_9.t: Add TLS segment.
3690
d0773f31
ILT
36912011-03-02 Simon Baldwin <simonb@google.com>
3692
3693 * configure.ac: Add check for gnu_indirect_function support in
3694 the toolchain building binutils.
3695 * configure: Rebuild.
3696
9370ce59 36972011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
3698
3699 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3700 plugin only symbols.
3701 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3702 in plugin files as not needed in the symbol table.
3703
4cf7a849
ST
37042011-02-11 Sriraman Tallam <tmsriram@google.com>
3705
3706 * output.cc (Output_section::add_input_section): Delay fill
3707 generation for section ordering.
3708
b578bd7d
ILT
37092011-02-09 Ian Lance Taylor <iant@google.com>
3710
3711 PR gold/12316
3712 * object.h (class Sized_relobj): Remove clear_local_symbols.
3713 * reloc.cc (Sized_relobj::do_relocate): Don't call
3714 clear_local_symbols.
3715
9370ce59 37162011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
3717
3718 * plugin.cc (is_visible_from_outside): Return true for symbols
3719 in the -u option.
3720
55382fb7
ILT
37212011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3722
3723 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3724 filename.
3725
4e271fff
ST
37262011-02-02 Sriraman Tallam <tmsriram@google.com>
3727
3728 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 3729 to std::string.
4e271fff 3730 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 3731 section_name to be std::string.
4e271fff
ST
3732 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3733
d433c3ac
ILT
37342011-01-25 Ian Lance Taylor <iant@google.com>
3735
3736 * script.cc (script_add_extern): Rewrite to use
3737 add_symbol_reference.
3738
880473a6
DK
37392011-01-25 Doug Kwan <dougkwan@google.com>
3740
d433c3ac 3741 * icf.cc (get_section_contents): Always lock section's object.
880473a6 3742
f30f86fa
ILT
37432011-01-24 Ian Lance Taylor <iant@google.com>
3744
3745 * options.h (class General_options): Accept
3746 --no-detect-odr-violations.
3747
8e51a0b9
ILT
37482011-01-24 Ian Lance Taylor <iant@google.com>
3749
3750 * version.cc (version_string): Bump to 1.11.
3751
0f3b89d8
ILT
37522011-01-24 Ian Lance Taylor <iant@google.com>
3753
3754 * plugin.cc (class Plugin_rescan): Define new class.
3755 (Plugin_manager::claim_file): Set any_claimed_.
3756 (Plugin_manager::save_archive): New function.
3757 (Plugin_manager::save_input_group): New function.
3758 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3759 necessary.
3760 (Plugin_manager::new_undefined_symbol): New function.
3761 (Plugin_manager::rescan): New function.
3762 (Plugin_manager::rescannable_defines): New function.
3763 (Plugin_manager::add_input_file): Set any_added_.
3764 * plugin.h (class Plugin_manager): define new fields rescannable_,
3765 undefined_symbols_, any_claimed_, and any_added_. Declare
3766 Plugin_rescan as friend. Declare new functions.
3767 (Plugin_manager::Rescannable): Define type.
3768 (Plugin_manager::Rescannable_list): Define type.
3769 (Plugin_manager::Undefined_symbol_list): Define type.
3770 (Plugin_manager::Plugin_manager): Initialize new fields.
3771 * archive.cc (Archive::defines_symbol): New function.
3772 (Add_archive_symbols::run): Pass archive to plugins if any.
3773 * archive.h (class Archive): Declare defines_symbol.
3774 * readsyms.cc (Input_group::~Input_group): New function.
3775 (Finish_group::run): Pass input_group to plugins if any.
3776 * readsyms.h (class Input_group): Declare destructor.
3777 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3778 any.
3779
3bb951e5
ILT
37802011-01-10 Ian Lance Taylor <iant@google.com>
3781
3782 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3783 section as relro.
3784 (Layout::set_segment_offsets): Reset increase_relro before calling
3785 set_section_addresses a second time.
3786
0aa45fac
CC
37872011-01-04 Cary Coutant <ccoutant@google.com>
3788
3789 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3790 sections before NOBITS sections.
3791
0db46eb4
L
37922011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3793
3794 * version.cc (print_version): Update copyright to 2011.
3795
829c9745
CC
37962010-12-23 Cary Coutant <ccoutant@google.com>
3797
3798 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3799 of OS to this->add. Add OD parameter to second form of the function.
3800
7500420b
ILT
38012010-12-20 Ian Lance Taylor <iant@google.com>
3802
3803 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3804 second of two consecutive entries with same offset.
3805
f8e9a930
RW
38062010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3807
3808 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3809 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3810 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3811 to avoid unneeded links against $(LDADD).
3812 * testsuite/Makefile.in: Regenerate.
3813
2fbb4320
ILT
38142010-12-15 Ian Lance Taylor <iant@google.com>
3815
3816 PR gold/12324
3817 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3818 for R_X86_64_32 and R_X86_64_PC32.
3819 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3820 ver_matching_def_pic.o.
3821 (ver_matching_def_pic.o): New target.
3822
fedb228d
RW
38232010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3824
3825 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3826 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3827 Move definition before File_read::View member definitions.
3828 (File_read::View::~View): Initialize and hold lock before
3829 updating current_mapped_bytes.
3830
9b547ce6
RW
38312010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3832
3833 * dwarf_reader.cc: Remove outdated comment.
3834 * gold-threads.cc: Fix typo in error message.
3835 * archive.cc: Fix typos in comments.
3836 * archive.h: Likewise.
3837 * arm-reloc-property.cc: Likewise.
3838 * arm-reloc-property.h: Likewise.
3839 * arm-reloc.def: Likewise.
3840 * arm.cc: Likewise.
3841 * attributes.h: Likewise.
3842 * cref.cc: Likewise.
3843 * ehframe.cc: Likewise.
3844 * fileread.h: Likewise.
3845 * gold.h: Likewise.
3846 * i386.cc: Likewise.
3847 * icf.cc: Likewise.
3848 * incremental.h: Likewise.
3849 * int_encoding.cc: Likewise.
3850 * layout.h: Likewise.
3851 * main.cc: Likewise.
3852 * merge.h: Likewise.
3853 * object.cc: Likewise.
3854 * object.h: Likewise.
3855 * options.cc: Likewise.
3856 * readsyms.cc: Likewise.
3857 * reduced_debug_output.cc: Likewise.
3858 * reloc.cc: Likewise.
3859 * script-sections.cc: Likewise.
3860 * sparc.cc: Likewise.
3861 * symtab.h: Likewise.
3862 * target-reloc.h: Likewise.
3863 * target.cc: Likewise.
3864 * target.h: Likewise.
3865 * timer.cc: Likewise.
3866 * timer.h: Likewise.
3867 * x86_64.cc: Likewise.
3868
83e17bd5
CC
38692010-12-09 Cary Coutant <ccoutant@google.com>
3870
3871 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3872 stack.
3873 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3874 parameter; change all callers.
3875 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3876 * options.h (warn_execstack): New option.
3877
017257f8
DK
38782010-12-07 Doug Kwan <dougkwan@google.com>
3879
3880 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3881 like function call relocations.
3882
c20cbc06
ILT
38832010-12-07 Ian Lance Taylor <iant@google.com>
3884
3885 * archive.cc (Archive::get_elf_object_for_member): Permit
3886 punconfigured to be NULL.
3887 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3888 (Archive::include_member): Pass NULL to get_elf_object_for_member
3889 if we searched for the archive and this is the first included
3890 object.
3891
4dbfafcc
ILT
38922010-12-01 Ian Lance Taylor <iant@google.com>
3893
3894 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3895 track_relocs_type_ field.
3896 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3897 Set track_relocs_type_.
3898 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3899 contents when using RELA relocs.
3900 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3901 reloc_map_.
3902 * reloc.cc (Track_relocs::next_addend): New function.
3903 * reloc.h (class Track_relocs): Declare next_addend.
3904
e5e19edd
ILT
39052010-12-01 Ian Lance Taylor <iant@google.com>
3906
3907 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3908 virtual destructor.
3909
9a5ce24c
ILT
39102010-12-01 Ian Lance Taylor <iant@google.com>
3911
3912 * README: Update compilers known to work and fail.
3913
c7791212
NC
39142010-11-23 Matthias Klose <doko@ubuntu.com>
3915
3916 * configure.in: For --enable-gold, handle value `default' instead of
3917 `both*'. Always install ld as ld.bfd, install as ld if gold is
3918 not the default.
3919 * configure: Regenerate.
3920
0ad220c9
DK
39212010-11-18 Doug Kwan <dougkwan@google.com>
3922
3923 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3924 and right_alignment to be zero. Store result alignment only if it is
3925 greater than existing alignment.
3926
ab8056e0
CC
39272010-11-16 Cary Coutant <ccoutant@google.com>
3928
3929 PR gold/12220
3930 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3931 Check for ".zdebug_line".
3932
fd064a5b
CC
39332010-11-16 Doug Kwan <dougkwan@google.com>
3934 Cary Coutant <ccoutant@google.com>
3935
3936 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3937 by reference; adjust all callers.
3938 * output.cc (Output_segment::set_section_addresses): Adjust references
3939 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3940 list is empty.
3941 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3942 end at page boundary.
3943
6fc6ea19
CC
39442010-11-16 Cary Coutant <ccoutant@google.com>
3945
3946 PR gold/12220
3947 * layout.cc (Layout::choose_output_section): Transform names of
3948 compressed sections even when using a script with a SECTIONS clause.
3949 (Layout::output_section_name): Remove code to transform
3950 compressed debug section names.
3951 * output.cc (Output_section::add_input_section): Use uncompressed
3952 section size when tracking input sections.
3953
95a2c8d6
RS
39542010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3955
3956 * symtab.h (Symbol::NON_PIC_REF): Remove.
3957 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3958 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3959 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3960 (Symbol::use_plt_offset): Take a flags argument and pass it
3961 directly to needs_dynamic_reloc. Restrict check for undefined
3962 weak symbols to function calls.
3963 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3964 (Target_arm::Scan::global): Use it.
3965 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3966 (Target_arm::Relocate::relocate): Likewise.
3967 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3968 parameter with an r_type parameter. Use get_reference_flags
3969 to get the flags.
3970 (Target_arm::Relocate::relocate): Update accordingly.
3971 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3972 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3973 (Target_i386::Scan::global): Likewise.
3974 (Target_i386::Relocate::relocate): Likewise.
3975 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3976 parameter with an r_type parameter. Use get_reference_flags
3977 to get the flags.
3978 (Target_i386::Relocate::relocate): Update accordingly.
3979 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3980 (Target_powerpc::Scan::global): Use it.
3981 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3982 (Target_powerpc::Relocate::relocate): Likewise.
3983 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3984 (Target_sparc::Scan::global): Use it.
3985 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3986 (Target_sparc::Relocate::relocate): Likewise.
3987 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3988 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3989 (Target_x86_64::Scan::global): Likewise.
3990 (Target_x86_64::Relocate::relocate): Likewise.
3991
f625ae50
DK
39922010-11-08 Doug Kwan <dougkwan@google.com>
3993 Cary Coutant <ccoutant@google.com>
3994
3995 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3996 (Arm_exidx_merge_section::section_contents_): New data member.
3997 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3998 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 3999 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
4000 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
4001 in parameters instead of calling Object::section_contents without
4002 locking.
4003 (Arm_output_section::group_section): New parameter TASK. Pass it
4004 to callees that need locking objects.
4005 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4006 to lock EXIDX input sections. Fix a formatting issue. Call
4007 Arm_exidx_merged_section::build_contents to create merged section
4008 contents.
4009 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4010 to lock object of stub table owner.
4011 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4012 TEXT_SIZE to initialize data member TEXT_SIZE_.
4013 (Arm_exidx_input_section::addralign): Fix typo in comment.
4014 (Arm_exidx_input_section::text_size): New method.
4015 (Target_arm::do_relax): New parameter TASK. Pass it to callees
4016 that require locking objects. Lock objects before scanning for stubs
4017 and updating local symbols.
4018 (Arm_input_section<big_endian>::init): Copy contents of original
4019 input section.
2e702c99 4020 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
4021 original input section instead of calling Object::section_contents
4022 without locking.
4023 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
4024 size without calling Object::section_size().
4025 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
4026 for size. Allocate a buffer for merged EXIDX entries.
4027 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 4028 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
4029 building code to Arm_exidx_merged_section::build_contetns. Write
4030 out contetns in buffer instead of building it on the fly.
4031 (Arm_relobj::make_exidx_input_section): Also pass text section size
4032 to Arm_exidx_input_section constructor.
4033 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4034 (Arm_dynobj::do_read_symbols): Fix memory leak.
4035 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4036 * target.h: (class Task): Add forward declaration.
4037 (Target::relax): Add new parameter TASK and pass it to
4038 Target::do_relax().
4039 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4040
5f9bcf58
CC
40412010-11-05 Cary Coutant <ccoutant@google.com>
4042
4043 PR gold/10708
4044 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
4045 object when reading from the file.
4046 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
4047 second layout pass.
4048 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
4049 when reading section contents.
4050 (get_section_contents): Likewise.
4051 (icf::find_identical_sections): Likewise.
4052 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
4053 object when reading from the file.
4054 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
4055 the object when doing deferred section layout.
4056
e597fa08
NC
40572010-11-03 Nick Clifton <nickc@redhat.com>
4058
4059 PR gold/12001
4060 * script.h (class Symbol_assignment: name): New member. Returns
4061 the name of the symbol.
4062 * scrfipt.cc (Script_options::is_pending_assignment): New member.
4063 Returns true if the given symbol name is on the list of
4064 assignments wating to be processed.
4065 * archive.cc (should_incldue_member): If the symbol is undefined,
4066 check to see if it is on the list of symbols pending assignment.
4067
3f9a3278
ILT
40682010-11-03 Ryan Mansfield <rmansfield@qnx.com>
4069
4070 * script-sections.cc (Script_sections::find_memory_region): Check
4071 for a NULL output section pointer.
4072
d06fb4d1
DK
40732010-10-29 Doug Kwan <dougkwan@google.com>
4074
4075 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
4076 Output_section::add_relaxed_input_section.
4077 * output.cc (Output_section::add_relaxed_input_section): Add new
4078 arguments LAYOUT and NAME. Set section order index.
4079 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4080 Copy section order index.
4081 * output.h (Output_section::add_relaxed_input_section): Add new
4082 arguments LAYOUT and NAME.
4083
90e24de5
ILT
40842010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4085
4086 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 4087 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
4088 * testsuite/Makefile.in: Regenerate.
4089
c9484ea5
DK
40902010-10-20 Doug Kwan <dougkwan@google.com>
4091
4092 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
4093 without SHF_LINK_ORDER flags.
4094 * layout.cc (Layout::choose_output_section): Do not filter
4095 SHF_LINK_ORDER flag in a relocatable link.
4096
5bc2f5be
CC
40972010-10-17 Cary Coutant <ccoutant@google.com>
4098
4099 * output.h (Output_segment::set_section_addresses): Change function
4100 signature. Update all callers.
4101 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4102 sections.
4103 (Output_segment::set_section_addresses): Align after last TLS
4104 section. Add padding before last relro section instead of after.
4105
0c91cf04
DK
41062010-10-17 Doug Kwan <dougkwan@google.com>
4107
4108 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4109 GOT output section to be writable.
4110
8c21d9d3
CC
41112010-10-14 Cary Coutant <ccoutant@google.com>
4112
4113 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
4114 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4115 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4116 mode.
4117 * incremental.cc (report_command_line): Ignore all forms of
4118 --incremental.
4119 * layout.cc (Layout::Layout): Check parameters for incremental link
4120 mode.
4121 * options.cc (General_options::parse_incremental): New function.
4122 (General_options::parse_no_incremental): New function.
4123 (General_options::parse_incremental_full): New function.
4124 (General_options::parse_incremental_update): New function.
4125 (General_options::incremental_mode_): New data member.
4126 (General_options::finalize): Check incremental_mode_.
4127 * options.h (General_options): Update help text for --incremental.
4128 Add --no-incremental, --incremental-full, --incremental-update.
4129 (General_options::Incremental_mode): New enum type.
4130 (General_options::incremental_mode): New function.
4131 (General_options::incremental_mode_): New data member.
4132 * parameters.cc (Parameters::incremental_mode_): New data member.
4133 (Parameters::set_options): Set incremental_mode_.
4134 (Parameters::set_incremental_full): New function.
4135 (Parameters::incremental): New function.
4136 (Parameters::incremental_update): New function.
4137 (set_parameters_incremental_full): New function.
4138 * parameters.h (Parameters::set_incremental_full): New function.
4139 (Parameters::incremental): New function.
4140 (Parameters::incremental_update): New function.
4141 (Parameters::incremental_mode_): New data member.
4142 (set_parameters_incremental_full): New function.
4143 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4144 incremental link mode.
4145 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4146 (Sized_relobj::do_relocate_sections): Likewise.
4147 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4148 option.
4149 * testsuite/Makefile.in: Regenerate.
4150 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 4151
bb32aa18 41522010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
4153
4154 * script-sections.h (class Script_sections): Make
4155 Sections_elements typedef public.
4156 * script-sections.cc (class Sort_output_sections): Add elements_
4157 field. Add constructor which sets it; change all callers.
4158 (Sort_output_sections::is_before): New function.
4159 (Sort_output_sections::operator()): Call is_before.
4160 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4161 conditional.
4162 * testsuite/script_test_10.sh: New test. Test script section
4163 order.
4164 * testsuite/script_test_10.t: Likewise.
4165 * testsuite/script_test_10.s: Likewise.
4166 * testsuite/Makefile.am: Wrap the cross linker tests and the
4167 common tests into NATIVE_OR_CROSS_LINKER.
4168 (check_SCRIPTS): Add script_test_10.sh.
4169 (check_DATA): Add script_test_10.stdout.
4170 (script_test_10.o, script_test_10): New targets.
4171 (script_test_10.stdout): New target.
4172 * configure, testsuite/Makefile.in: Regenerate.
4173
3cef7179
ILT
41742010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4175
4176 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4177 error for the deprecated relocations.
4178 (Target_arm::Scan::global): Likewise.
4179 (Target_arm::Relocate::relocate): Likewise.
4180
7411e9a8
RS
41812010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4182
4183 * fileread.cc (Input_file::find_file): Initialize *found_name
4184 and *namep when using the fallback search for case 4.
4185
6a9da32a
CC
41862010-10-11 Cary Coutant <ccoutant@google.com>
4187
4188 * options.h (class General_options): Redefine -z lazy as an alias for
4189 the negation of -z now.
4190
ac897c20
ILT
41912010-10-11 Ian Lance Taylor <iant@google.com>
4192
4193 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4194 binding.
4195
ea5cae92
NC
41962010-10-06 Nick Clifton <nickc@redhat.com>
4197
4198 * script-sections.cc(class Memory_region): Remove
4199 current_lma_offset_ field. Rename current_vma_offset_ to
4200 current_offset_. Add last_section_ field.
4201 (Memory_region::get_current_vma_address): Rename to
4202 get_current_address.
4203 (Memory_region::get_current_lma_address): Delete.
4204 (Memory_region::increment_vma_offset): Rename to
4205 increment_offset.
4206 (Memory_region::increment_lma_offset): Delete.
4207 (Memory_region::attributes_compatible): New method. Returns
4208 true if the provided section is compatible with the region.
4209 (Memory_region::get_last_section): New method. Returns the last
4210 section to use the region.
4211 (Memory_region::set_last_section): New method. Stores the last
4212 section to use the region.
4213 (Script_sections::block_in_region): New method. Returns true if
4214 a block of memory is contained within a region.
4215 (Script_sections::find_memory_region): New method. Locates a
4216 memory region to be used to set a VMA or LMA address.
4217 (Output_section_definition::set_section_addresses): Add code to
4218 check for addresses set by memory regions.
4219 (Output_segment::set_section_addresses): Remove memory region
4220 walking code.
4221 (Script_sections::create_segment): Add a warning if a header
4222 segment is created outside of any region.
4223 * script-sections.h (class Script_sections): Add prototypes for
4224 find_memory_region and block_in_region methods.
4225 * testsuite/memory_test.s: Use .long instead of .word.
4226 * testsuite/memory_test.t: Add some more output sections.
4227 * testsuite/memory_test.sh: Update expected output.
4228
a9bfd952
DK
42292010-10-02 Doug Kwan <dougkwan@google.com>
4230
4231 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4232 defintion to symtab.h
4233 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4234 declaration to defintion.
4235
bacff3ab
NC
42362010-10-01 Nick Clifton <nickc@redhat.com>
4237
4238 * expression.cc (eval): Replace dummy argument with NULL.
4239 (eval_maybe_dot): Check for a NULL result section pointer.
4240 (Symbol_expression::value): Likewise.
4241 (Dot_expression::value): Likewise.
4242 (BINARY_EXPRESSION): Likewise.
4243 (Max_expression::value): Likewise.
4244 (Min_expression::value): Likewise.
4245 (Absolute_expression::value): Likewise.
4246 (Addr_expression::value_from_output_section): Likewise.
4247 (Loaddddr_expression::value_from_output_section): Likewise.
4248 (Segment_start_expression::value): Likewise.
4249 * script-sections.cc
4250 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4251 argument with NULL.
4252 (Sections_elememt_dot_assignment::set_section_addresses):
4253 Likewise.
4254 (Output_data_expression::do_write_to_buffer): Likewise.
4255 (Output_section_definition::finalize_symbols): Likewise.
4256 (Output_section_definition::set_section_addresses): Likewise.
4257
f81bc8b5
DK
42582010-09-30 Doug Kwan <dougkwan@google.com>
4259
4260 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4261
c95e9f27
ST
42622010-09-28 Sriraman Tallam <tmsriram@google.com>
4263
4264 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 4265 function.
c95e9f27
ST
4266 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4267 virtual function.
4268 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4269 virtual function.
4270 * icf.cc (get_section_contents): Inline merge sections only when
4271 target allows it.
4272
3cac54d2
RW
42732010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4274
4275 * configure: Regenerate.
4276
2904037a
ILT
42772010-09-17 Ian Lance Taylor <iant@google.com>
4278
4279 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
4280 * testsuite/Makefile.am (memory_test.o): New target.
4281 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4282 memory_test.t.
4283 * testsuite/Makefile.in: Rebuild.
2904037a 4284
bca7fb63
DK
42852010-09-17 Doug Kwan <dougkwan@google.com>
4286
4287 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4288 defintion if relocation uses GOT entries of the symbol.
4289 * testsuite/icf_safe_test.sh: Fix test.
4290 * testsuite/icf_safe_so_test.sh: Fix test.
4291
4ef28648
CC
42922010-09-16 Cary Coutant <ccoutant@google.com>
4293
4294 * script_sections.cc (class Memory_region): Remove "NULL" from
4295 vector initializations.
4296
793990de
CC
42972010-09-15 Cary Coutant <ccoutant@google.com>
4298
4299 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4300 Resolve forwarding symbols.
4301
81e015e2
DK
43022010-09-15 Doug Kwan <dougkwan@google.com>
4303
4304 * gold/testsuite/script_test_3.t: Add ARM special sections.
4305 * gold/testsuite/script_test_4.t: Same.
4306 * gold/testsuite/script_test_5.t: Same.
4307 * gold/testsuite/script_test_6.t: Same.
4308 * gold/testsuite/script_test_7.t: Same.
4309 * gold/testsuite/script_test_7.t: Same.
4310 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4311
36171d64
CC
43122010-09-14 Cary Coutant <ccoutant@google.com>
4313
4314 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4315 (Target_x86_64::Relocate::relocate_tls): Replace check for
4316 saw_tls_block_reloc_ with test for executable section.
4317
d89051bd
CC
43182010-09-12 Cary Coutant <ccoutant@google.com>
4319
4320 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4321 position-independent executables to shared libraries need dynamic
4322 relocations.
4323 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4324 position-independent executables.
4325 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4326 * testsuite/Makefile.in: Regenerate.
4327
fca41f0f
NC
43282010-09-10 Nick Clifton <nickc@redhat.com>
4329
4330 PR gold/11997
4331 * testsuite/memory_test.t: Discard any sections that are not
4332 needed.
4333
6695e4b3
L
43342010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4335
4336 PR gold/11996
4337 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4338 "This::" to work around a bug in gcc 4.2.
4339
4340 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4341
0f72bf6f
RÁE
43422010-09-09 Rafael Espindola <espindola@google.com>
4343
4344 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4345 sections with different PF_X flags in the same segment.
4346 (Layout::find_first_load_seg): Search all segments to find the first
4347 one.
4348 * options.h (rosegment): New.
4349
43502010-09-08 Rafael Espindola <espindola@google.com>
a6577478 4351
05a79166 4352 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 4353
aa98ff75
DK
43542010-09-08 Doug Kwan <dougkwan@google.com>
4355
4356 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4357 (Arm_relobj::do_relocate_sections): Add new parameter for output
4358 file to match the parent.
4359 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4360 of local symbols instead of input values. Update code to track
4361 changes in gold::relocate_section.
4362 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4363 (Sized_relobj::compute_final_local_value_internal): New methods.
4364 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4365 body into private version of Sized_relobj::compute_final_local_value.
4366 Call the inline method.
4367 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4368 merged symbol value if there is one.
4369 (Symbol_value::has_output_value): New method defintiion.
4370 (Sized_relobj::Compute_final_local_value_status): New enum type.
4371 (Sized_relobj::compute_final_local_value): New methods.
4372 (Sized_relobj::compute_final_local_value_internal): New methods.
4373 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4374 and arm_cortex_a8.sh.
4375 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4376 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4377 New tests.
4378 * Makefile.in: Regenerate.
4379 * testsuite/arm_bl_out_of_range.s: Update test.
4380 * testsuite/thumb_bl_out_of_range.s: Ditto.
4381 * testsuite/thumb_blx_out_of_range.s: Ditto.
4382 * testsuite/arm_branch_out_of_range.sh: New file.
4383 * testsuite/arm_cortex_a8.sh: Ditto.
4384 * testsuite/arm_cortex_a8_b.s: Ditto.
4385 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4386 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4387 * testsuite/arm_cortex_a8_bl.s: Ditto.
4388 * testsuite/arm_cortex_a8_blx.s: Ditto.
4389 * testsuite/arm_cortex_a8_local.s: Ditto.
4390 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4391 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4392
05a79166
L
43932010-09-08 Rafael Espindola <espindola@google.com>
4394
4395 * Makefile.am (memory_test.stdout): Run readelf with -W.
4396 * Makefile.in: Regenerate.
4397 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4398 64 bit output.
4399
33dbc701
RÁE
44002010-09-08 Rafael Espindola <espindola@google.com>
4401
4402 * script-sections.cc (Script_sections::add_memory_region): Convert
4403 field precision to int.
4404 * script.cc (script_set_section_region, script_set_section_region):
4405 Convert field precision to int.
4406
731ca54a
RÁE
44072010-09-08 Rafael Espindola <espindola@google.com>
4408
4409 * arm.cc (do_finalize_sections): Create the __exidx_start and
4410 __exdix_end symbols even when the section is missing.
4411
7f8cd844
NC
44122010-09-08 Nick Clifton <nickc@redhat.com>
4413
4414 * README: Remove claim that MEMORY is not supported.
4415 * expression.cc (script_exp_function_origin)
4416 (script_exp_function_length): Move from here to ...
4417 * script.cc: ... here.
4418 (script_set_section_region, script_add_memory)
4419 (script_parse_memory_attr, script_include_directive): New
4420 functions.
4421 * script-sections.cc
4422 (class Memory_region): New class.
4423 (class Output_section_definition): Add set_memory_region,
4424 set_section_vma, set_section_lma and get_section_name methods.
4425 (class Script_Sections): Add add_memory_region,
4426 find_memory_region, find_memory_region_origin,
4427 find_memory_region_length and set_memory_region methods.
4428 Have set_section_addresses method walk the list of set memory
4429 regions.
4430 Extend the print methos to display memory regions.
4431 * script-sections.h: Add prototypes for new methods.
4432 Add enum for MEMORY region attributes.
4433 * yyscript.y: Add support for parsing MEMORY regions.
4434 * script-c.h: Add prototypes for new functions.
4435 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4436 * testsuite/Makefile.in: Regenerate.
4437 * testsuite/memory_test.sh: New script.
4438 * testsuite/memory_test.s: New assembler source file.
4439 * testsuite/memory_test.t: New linker script.
4440
a4649286
DK
44412010-08-27 Doug Kwan <dougkwan@google.com>
4442
4443 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4444 reference override an existing dynamic weak reference.
4445 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4446 * testsuite/Makefile.in: Regenerate.
4447 * testsuite/dyn_weak_ref.sh: New file.
4448 * testsuite/dyn_weak_ref_1.c: Ditto.
4449 * testsuite/dyn_weak_ref_2.c: Ditto.
4450
b56648ad
ILT
44512010-08-27 Ian Lance Taylor <iant@google.com>
4452
4453 * incremental.h (class Incremental_input_entry): Add virtual
4454 destructor.
4455
809313cb
ILT
44562010-08-27 Ian Lance Taylor <iant@google.com>
4457
4458 * testsuite/start_lib_test_3.c: Mark t3 as used.
4459
11e32464
NC
44602010-08-27 Nick Clifton <nickc@redhat.com>
4461
4462 * options.cc (version_script): Fix small typo in previous
4463 whitespace tidyup.
4464
ca09d69a
NC
44652010-08-25 Nick Clifton <nickc@redhat.com>
4466
4467 * archive.cc: Formatting fixes: Remove whitespace between
4468 typename and following asterisk. Remove whitespace between
4469 function name and opening parenthesis.
4470 * archive.h: Likewise.
4471 * arm.cc: Likewise.
4472 * attributes.cc: Likewise.
4473 * attributes.h: Likewise.
4474 * common.cc: Likewise.
4475 * copy-relocs.cc: Likewise.
4476 * dirsearch.h: Likewise.
4477 * dynobj.cc: Likewise.
4478 * ehframe.cc: Likewise.
4479 * ehframe.h: Likewise.
4480 * expression.cc: Likewise.
4481 * fileread.cc: Likewise.
4482 * fileread.h: Likewise.
4483 * gc.h: Likewise.
4484 * gold-threads.cc: Likewise.
4485 * gold.cc: Likewise.
4486 * i386.cc: Likewise.
4487 * icf.h: Likewise.
4488 * incremental-dump.cc: Likewise.
4489 * incremental.cc: Likewise.
4490 * layout.cc: Likewise.
4491 * layout.h: Likewise.
4492 * main.cc: Likewise.
4493 * merge.cc: Likewise.
4494 * merge.h: Likewise.
4495 * object.cc: Likewise.
4496 * object.h: Likewise.
4497 * options.cc: Likewise.
4498 * options.h: Likewise.
4499 * output.cc: Likewise.
4500 * output.h: Likewise.
4501 * plugin.cc: Likewise.
4502 * plugin.h: Likewise.
4503 * powerpc.cc: Likewise.
4504 * reloc.cc: Likewise.
4505 * script-c.h: Likewise.
4506 * script-sections.cc: Likewise.
4507 * script.cc: Likewise.
4508 * stringpool.cc: Likewise.
4509 * symtab.cc: Likewise.
4510 * symtab.h: Likewise.
4511 * target.cc: Likewise.
4512 * timer.cc: Likewise.
4513 * timer.h: Likewise.
4514 * version.cc: Likewise.
4515 * x86_64.cc: Likewise.
4516
b8fa8750
NC
45172010-08-24 Nick Clifton <nickc@redhat.com>
4518
4519 PR 11899
4520 * layout.cc (segment_precedes): Sort segments by their physical
4521 addresses, if they have been set.
4522
9919d93b
CC
45232010-08-23 Cary Coutant <ccoutant@google.com>
4524
4525 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4526 symbols data.
4527 (Lib_group::include_member): Unlock object after deleting its
4528 symbols data.
4529 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4530 the bug fixed here.
4531
97b4be1c
CC
45322010-08-19 Neil Vachharajani <nvachhar@google.com>
4533 Cary Coutant <ccoutant@google.com>
4534
4535 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4536 constructor, and set_blocker.
4537 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4538 readsyms_blocker_.
4539 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4540 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4541 * testsuite/Makefile.am (start_lib_test): New test case.
4542 * testsuite/Makefile.in: Regenerate.
4543 * testsuite/start_lib_test_main.c: New file.
4544 * testsuite/start_lib_test_1.c: New file.
4545 * testsuite/start_lib_test_2.c: New file.
4546 * testsuite/start_lib_test_3.c: New file.
4547
dd0b1884
ILT
45482010-08-19 Ian Lance Taylor <iant@google.com>
4549
4550 * Makefile.in: Rebuild with automake 1.11.1.
4551 * aclocal.m4: Likewise.
4552 * testsuite/Makefile.in: Likewise.
4553
7223e9ca
ILT
45542010-08-19 Ian Lance Taylor <iant@google.com>
4555
4556 PR 10893
4557 * i386.cc (class Output_data_plt_i386): Update declarations.
4558 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4559 local_ifuncs_ fields.
4560 (Target_i386::do_plt_section_for_global): New function.
4561 (Target_i386::do_plt_section_for_local): New function.
4562 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4563 parameter; change all callers. Initialize global_ifuncs_ and
4564 local_ifuncs_. If doing a static link define __rel_iplt_start and
4565 __rel_iplt_end.
4566 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4567 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4568 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4569 symbols.
4570 (Target_i386::make_plt_section): New function, broken out of
4571 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4572 (Target_i386::make_plt_entry): Call make_plt_section.
4573 (Target_i386::make_local_ifunc_plt_entry): New function.
4574 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4575 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4576 R_386_IRELATIVE to switch.
4577 (Target_i386::Scan::global): Likewise.
4578 (Target_i386::Relocate::relocate): Likewise.
4579 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4580 switch.
4581 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4582 (Target_x86_64::do_plt_section_for_global): New function.
4583 (Target_x86_64::do_plt_section_for_local): New function.
4584 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4585 parameter; change all callers. If doing a static link define
4586 __rela_iplt_start and __rela_iplt_end.
4587 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4588 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4589 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4590 to point to .plt.
4591 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4592 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4593 switch.
4594 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4595 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4596 R_X86_64_IRELATIVE to switch.
4597 (Target_x86_64::Scan::global): Likewise.
4598 (Target_x86_64::Relocate::relocate): Likewise.
4599 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4600 switch.
4601 * target.h (class Target): Add plt_section_for_global and
4602 plt_section_for_local functions. Add do_plt_section_for_global
4603 and do_plt_section_for_local virtual functions.
4604 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4605 clarifying comments.
4606 (Symbol::use_plt_offset): Handle IFUNC symbol.
4607 * object.cc (Sized_relobj::Sized_relobj): Initialize
4608 local_plt_offsets_.
4609 (Sized_relobj::local_has_plt_offset): New function.
4610 (Sized_relobj::local_plt_offset): New function.
4611 (Sized_relobj::set_local_plt_offset): New function.
4612 (Sized_relobj::do_count): Handle IFUNC symbol.
4613 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4614 a bit away from input_shndx_ field. Add set_is_func_symbol and
4615 is_ifunc_symbol functions.
4616 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4617 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4618 local_plt_offsets_ field.
4619 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4620 * output.h (class Output_section_data): Add non-const
4621 output_section function.
4622 (class Output_data_got): Update declarations.
4623 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4624 Add use_plt_offset parameter to global and local constructors.
4625 Change all callers. Change local_sym_index_ field to 31 bits.
4626 Change GSYM_CODE and CONSTANT_CODE accordingly.
4627 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4628 doing a static link don't set sh_link field.
4629 (Output_data_got::Got_entry::write): Use PLT offset if
4630 appropriate.
4631 (Output_data_got::add_global_plt): New function.
4632 (Output_data_got::add_local_plt): New function.
4633 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4634 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4635 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4636 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4637 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4638 IFUNC conditional.
4639 * testsuite/ifunc-sel.h: New file.
4640 * testsuite/ifuncmain1.c: New file.
4641 * testsuite/ifuncmain1vis.c: New file.
4642 * testsuite/ifuncmod1.c: New file.
4643 * testsuite/ifuncdep2.c: New file.
4644 * testsuite/ifuncmain2.c: New file.
4645 * testsuite/ifuncmain3.c: New file.
4646 * testsuite/ifuncmod3.c: New file.
4647 * testsuite/ifuncmain4.c: New file.
4648 * testsuite/ifuncmain5.c: New file.
4649 * testsuite/ifuncmod5.c: New file.
4650 * testsuite/ifuncmain6pie.c: New file.
4651 * testsuite/ifuncmod6.c: New file.
4652 * testsuite/ifuncmain7.c: New file.
4653 * configure, testsuite/Makefile.in: Rebuild.
4654
56f75c03
ILT
46552010-08-18 Ian Lance Taylor <iant@google.com>
4656
4657 * incremental.cc
4658 (Output_section_incremental_inputs::write_input_files): Add cast
4659 to avoid signed/unsigned comparison warning.
4660 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4661
55455f89
CC
46622010-08-12 Cary Coutant <ccoutant@google.com>
4663
4664 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4665
e2054bcb
ILT
46662010-08-13 Ian Lance Taylor <iant@google.com>
4667
4668 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4669
74f67560
DK
46702010-08-12 Cary Coutant <ccoutant@google.com>
4671 Doug Kwan <dougkwan@google.com>
4672
4673 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4674 defintion overrides non-weak undef, remember that the original undef
4675 is not weak.
4676 * symtab.cc (Symbol_table::sized_write_global): For undef without
4677 an original weak binding, set binding to global in output.
4678 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4679 * testsuite/Makefile.in: Regenerate.
4680 * testsuite/strong_ref_weak_def.sh: New file.
4681 * testsuite/strong_ref_weak_def_1.c: Ditto.
4682 * testsuite/strong_ref_weak_def_2.c: Ditto.
4683
d1238d12
CC
46842010-08-12 Cary Coutant <ccoutant@google.com>
4685
4686 * testsuite/incremental_test.sh: Rewrite.
4687 * testsuite/incremental_test_1.c: Rewrite.
4688 * testsuite/incremental_test_2.c: Rewrite.
4689
0e70b911
CC
46902010-08-12 Cary Coutant <ccoutant@google.com>
4691
4692 * arm.cc (Target_arm::got_size): Add const.
4693 (Target_arm::got_entry_count): New function.
4694 (Target_arm::plt_entry_count): New function.
4695 (Target_arm::first_plt_entry_offset): New function.
4696 (Target_arm::plt_entry_size): New function.
4697 (Output_data_plt_arm::entry_count): New function.
4698 (Output_data_plt_arm::first_plt_entry_offset): New function.
4699 (Output_data_plt_arm::get_plt_entry_size): New function.
4700 * i386.cc (Target_i386::got_size): Add const.
4701 (Target_i386::got_entry_count): New function.
4702 (Target_i386::plt_entry_count): New function.
4703 (Target_i386::first_plt_entry_offset): New function.
4704 (Target_i386::plt_entry_size): New function.
4705 (Output_data_plt_i386::entry_count): New function.
4706 (Output_data_plt_i386::first_plt_entry_offset): New function.
4707 (Output_data_plt_i386::get_plt_entry_size): New function.
4708 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4709 find_incremental_inputs_sections. Dump incremental_got_plt section.
4710 * incremental.cc: Include target.h.
4711 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4712 parameter. Adjust all callers. Find incremental_got_plt section.
4713 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4714 section.
4715 (Output_section_incremental_inputs::set_final_data_size): Calculate
4716 size of incremental_got_plt section.
4717 (Output_section_incremental_inputs::do_write): Write the
4718 incremental_got_plt section.
4719 (Got_plt_view_info): New struct.
4720 (Local_got_offset_visitor): New class.
4721 (Global_got_offset_visitor): New class.
4722 (Global_symbol_visitor_got_plt): New class.
4723 (Output_section_incremental_inputs::write_got_plt): New function.
4724 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4725 Add parameter. Adjust all callers.
4726 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4727 (Incremental_inputs::got_plt_section): New function.
4728 (Incremental_inputs::got_plt_section_): New data member.
4729 (Incremental_got_plt_reader): New class.
4730 * layout.cc (Layout::create_incremental_info_sections): Add the
4731 incremental_got_plt section.
4732 * object.h (Got_offset_list::get_list): New function.
4733 (Got offset_list::for_all_got_offsets): New function.
4734 (Sized_relobj::local_got_offset_list): New function.
4735 * powerpc.cc (Target_powerpc::got_size): Add const.
4736 (Target_powerpc::got_entry_count): New function.
4737 (Target_powerpc::plt_entry_count): New function.
4738 (Target_powerpc::first_plt_entry_offset): New function.
4739 (Target_powerpc::plt_entry_size): New function.
4740 (Output_data_plt_powerpc::entry_count): New function.
4741 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4742 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4743 * sparc.cc (Target_sparc::got_size): Add const.
4744 (Target_sparc::got_entry_count): New function.
4745 (Target_sparc::plt_entry_count): New function.
4746 (Target_sparc::first_plt_entry_offset): New function.
4747 (Target_sparc::plt_entry_size): New function.
4748 (Output_data_plt_sparc::entry_count): New function.
4749 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4750 (Output_data_plt_sparc::get_plt_entry_size): New function.
4751 * symtab.h (Symbol::got_offset_list): New function.
4752 (Symbol_table::for_all_symbols): New function.
4753 * target.h (Sized_target::got_entry_count): New function.
4754 (Sized_target::plt_entry_count): New function.
4755 (Sized_target::plt_entry_size): New function.
4756 * x86_64.cc (Target_x86_64::got_size): Add const.
4757 (Target_x86_64::got_entry_count): New function.
4758 (Target_x86_64::plt_entry_count): New function.
4759 (Target_x86_64::first_plt_entry_offset): New function.
4760 (Target_x86_64::plt_entry_size): New function.
4761 (Output_data_plt_x86_64::entry_count): New function.
4762 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4763 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4764
09ec0418
CC
47652010-08-12 Cary Coutant <ccoutant@google.com>
4766
4767 * archive.cc: Include incremental.h.
4768 (Archive::Archive): Initialize incremental_info_.
4769 (Archive::include_member): Record archive members in incremental info.
4770 (Add_archive_symbols::run): Record begin and end of an archive in
4771 incremental info.
4772 (Lib_group::include_member): Record objects in incremental info.
4773 * archive.h (Incremental_archive_entry): Forward declaration.
4774 (Archive::set_incremental_info): New member function.
4775 (Archive::incremental_info): New member function.
4776 (Archive::Unused_symbol_iterator): New class.
4777 (Archive::unused_symbols_begin): New member function.
4778 (Archive::unused_symbols_end): New member function.
4779 (Archive::incremental_info_): New data member.
4780 * incremental-dump.cc (find_input_containing_global): New function.
4781 (dump_incremental_inputs): Dump new incremental info sections.
4782 * incremental.cc: Include symtab.h.
4783 (Output_section_incremental_inputs): New class.
4784 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4785 new incremental info sections.
4786 (Sized_incremental_binary::do_check_inputs): Likewise.
4787 (Incremental_inputs::report_archive): Remove.
4788 (Incremental_inputs::report_archive_begin): New function.
4789 (Incremental_inputs::report_archive_end): New function.
4790 (Incremental_inputs::report_object): New function.
4791 (Incremental_inputs::finalize_inputs): Remove.
4792 (Incremental_inputs::report_input_section): New function.
4793 (Incremental_inputs::report_script): Rewrite.
4794 (Incremental_inputs::finalize): Do nothing but finalize string table.
4795 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4796 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4797 (Incremental_inputs::create_data_sections): New function.
4798 (Incremental_inputs::relocs_entsize): New function.
4799 (Output_section_incremental_inputs::set_final_data_size): New function.
4800 (Output_section_incremental_inputs::do_write): New function.
4801 (Output_section_incremental_inputs::write_header): New function.
4802 (Output_section_incremental_inputs::write_input_files): New function.
4803 (Output_section_incremental_inputs::write_info_blocks): New function.
4804 (Output_section_incremental_inputs::write_symtab): New function.
4805 * incremental.h (Incremental_script_entry): Forward declaration.
4806 (Incremental_object_entry): Forward declaration.
4807 (Incremental_archive_entry): Forward declaration.
4808 (Incremental_inputs): Forward declaration.
4809 (Incremental_inputs_header_data): Remove.
4810 (Incremental_inputs_header): Remove.
4811 (Incremental_inputs_header_write): Remove.
4812 (Incremental_inputs_entry_data): Remove.
4813 (Incremental_inputs_entry): Remove.
4814 (Incremental_inputs_entry_write): Remove.
4815 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4816 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4817 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4818 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4819 Likewise.
4820 (Incremental_input_entry): New class.
4821 (Incremental_script_entry): New class.
4822 (Incremental_object_entry): New class.
4823 (Incremental_archive_entry): New class.
4824 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4825 (Incremental_inputs::report_inputs): Remove.
4826 (Incremental_inputs::report_archive): Remove.
4827 (Incremental_inputs::report_archive_begin): New function.
4828 (Incremental_inputs::report_archive_end): New function.
4829 (Incremental_inputs::report_object): Change prototype.
4830 (Incremental_inputs::report_input_section): New function.
4831 (Incremental_inputs::report_script): Change prototype.
4832 (Incremental_inputs::get_reloc_count): New function.
4833 (Incremental_inputs::set_reloc_count): New function.
4834 (Incremental_inputs::create_data_sections): New function.
4835 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4836 (Incremental_inputs::inputs_section): New function.
4837 (Incremental_inputs::symtab_section): New function.
4838 (Incremental_inputs::relocs_section): New function.
4839 (Incremental_inputs::get_stringpool): Add const.
4840 (Incremental_inputs::command_line): Add const.
4841 (Incremental_inputs::inputs): Remove.
4842 (Incremental_inputs::command_line_key): New function.
4843 (Incremental_inputs::input_file_count): New function.
4844 (Incremental_inputs::input_files): New function.
4845 (Incremental_inputs::relocs_entsize): New function.
4846 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4847 (Incremental_inputs::finalize_inputs): Remove.
4848 (Incremental_inputs::Input_info): Remove.
4849 (Incremental_inputs::lock_): Remove.
4850 (Incremental_inputs::inputs_): Change type.
4851 (Incremental_inputs::inputs_map_): Remove.
4852 (Incremental_inputs::current_object_entry_): New data member.
4853 (Incremental_inputs::inputs_section_): New data member.
4854 (Incremental_inputs::symtab_section_): New data member.
4855 (Incremental_inputs::relocs_section_): New data member.
4856 (Incremental_inputs::reloc_count_): New data member.
4857 (Incremental_inputs_reader): New class.
4858 (Incremental_symtab_reader): New class.
4859 (Incremental_relocs_reader): New class.
4860 * layout.cc (Layout::finalize): Move finalization of incremental info
4861 and creation of incremental info sections to follow finalization of
4862 symbol table. Set offsets for postprocessing sections.
4863 (Layout::create_incremental_info_sections): Call
4864 Incremental_inputs::create_data_sections. Add incremental symtab
4865 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4866 sections to layout after input sections.
4867 * layout.h (struct Timespec): Forward declaration.
4868 (Layout::incremental_inputs): Add const.
4869 (Layout::create_incremental_info_sections): Add parameter.
4870 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4871 * object.cc: Include incremental.h.
4872 (Relobj::finalize_incremental_relocs): New function.
4873 (Sized_relobj::do_layout): Record input sections in incremental info.
4874 * object.h (Object::output_section): New function.
4875 (Object::output_section_offset): Moved from Relobj.
4876 (Object::get_incremental_reloc_base): New function.
4877 (Object::get_incremental_reloc_count): New function.
4878 (Object::do_output_section): New function.
4879 (Object::do_output_section_offset): Moved from Relobj.
4880 (Object::do_get_incremental_reloc_base): New function.
4881 (Object::do_get_incremental_reloc_count): New function.
4882 (Object::Object): Initialize new data members.
4883 (Relobj::output_section): Renamed do_output_section and moved to
4884 protected.
4885 (Relobj::output_section_offset): Moved to Object.
4886 (Relobj::do_get_incremental_reloc_base): New function.
4887 (Relobj::do_get_incremental_reloc_count): New function.
4888 (Relobj::allocate_incremental_reloc_counts): New function.
4889 (Relobj::count_incremental_reloc): New function.
4890 (Relobj::finalize_incremental_relocs): New function.
4891 (Relobj::next_incremental_reloc_index): New function.
4892 (Relobj::reloc_counts_): New data member.
4893 (Relobj::reloc_bases_): New data member.
4894 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4895 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4896 (Sized_relobj::incremental_relocs_scan): New function.
4897 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4898 (Sized_relobj::incremental_relocs_write): New function.
4899 (Sized_relobj::incremental_relocs_write_reltype): New function.
4900 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4901 incremental link.
4902 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4903 archives and object files elsewhere.
4904 (Add_symbols::run): Report object files here.
4905 (Finish_group::run): Report end of archive at end of group.
4906 * reloc.cc: Include layout.h, incremental.h.
4907 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4908 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4909 (Sized_relobj::incremental_relocs_scan): New function.
4910 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4911 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4912 (Sized_relobj::incremental_relocs_write): New function.
4913 (Sized_relobj::incremental_relocs_write_reltype): New function.
4914 * script.cc (read_input_script): Rewrite test for incremental link.
4915 Change call to Incremental_inputs::report_script.
4916 * symtab.h (Symbol_table::first_global_index): New function.
4917 (Symbol_table::output_count): New function.
4918
ce0d1972
DK
49192010-08-12 Doug Kwan <dougkwan@google.com>
4920
4921 * arm.cc (Target_arm::merge_object_attributes): Check command line
4922 options --no-wchar-size-warning and --no-enum-size-warning.
4923 * options.h (General_options): Add ld-compatible options
4924 --no-enum-size-warning and --no-wchar-size-warning.
4925
6e5710ce
ILT
49262010-08-04 Ian Lance Taylor <iant@google.com>
4927
4928 * x86_64.cc (Target_x86_64::Scan::local): Use
4929 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4930 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4931 (Target_x86_64::Scan::global): Likewise.
4932 (Target_x86_64::Relocate::relocate): Likewise.
4933 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4934 Likewise.
4935
fef830db
CC
49362010-08-03 Cary Coutant <ccoutant@google.com>
4937
4938 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4939 to reserve space in merged_strings vector. Keep total input size
4940 for stats.
4941 (Output_merge_string::do_print_merge_stats): Print total input size.
4942 * merge.h (Output_merge_string): Add input_size_ field.
4943 * stringpool.cc (Stringpool_template::string_length): Move
4944 implementations out of Stringpool_template class and place in
4945 stringpool.h.
4946 * stringpool.h (string_length): Move out of Stringpool_template.
4947
1e3811b0
ILT
49482010-08-03 Ian Lance Taylor <iant@google.com>
4949
4950 PR 11712
4951 * layout.cc (relaxation_loop_body): If address of load segment is
4952 set, adjust address to include headers if possible.
4953
7af0c620
ILT
49542010-08-03 Ian Lance Taylor <iant@google.com>
4955
4956 * version.cc (version_string): Bump to 1.10.
4957
22f0da72
ILT
49582010-08-03 Ian Lance Taylor <iant@google.com>
4959
4960 PR 11805
4961 * layout.h (enum Output_section_order): Define.
4962 (class Layout): Update declarations.
4963 * layout.cc (Layout::get_output_section): Add order parameter.
4964 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4965 is_first_non_relro parameters. Change all callers.
4966 (Layout::choose_output_section): Likewise.
4967 (Layout::add_output_section_data): Likewise.
4968 (Layout::make_output_section): Likewise. Set order.
4969 (Layout::default_section_order): New function.
4970 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4971 * output.cc (Output_section::Output_section): Initialize order_.
4972 Don't initialize deleted fields.
4973 (Output_segment::Output_segment): Don't initialize deleted
4974 fields.
4975 (Output_segment::add_output_section_to_load): New function
4976 replacing add_output_section. Change all callers to call this or
4977 add_output_section_to_nonload.
4978 (Output_segment::add_output_section_to_nonload): New function.
4979 (Output_segment::remove_output_section): Rewrite.
4980 (Output_segment::add_initial_output_data): Likewise.
4981 (Output_segment::has_any_data_sections): Likewise.
4982 (Output_segment::is_first_section_relro): Likewise.
4983 (Output_segment::maximum_alignment): Likewise.
4984 (Output_segment::has_dynamic_reloc): New function replacing
4985 dynamic_reloc_count. Change all callers.
4986 (Output_segment::has_dynamic_reloc_list): New function replacing
4987 dynamic_reloc_count_list. Change all callers.
4988 (Output_segment::set_section_addresses): Rewrite.
4989 (Output_segment::set_offset): Rewrite.
4990 (Output_segment::find_first_and_last_list): Remove.
4991 (Output_segment::set_tls_offsets): Rewrite.
4992 (Output_segment::first_section_load_address): Likewise.
4993 (Output_segment::output_section_count): Likewise.
4994 (Output_segment::section_with_lowest_load_address): Likewise.
4995 (Output_segment::write_section_headers): Likewise.
4996 (Output_segment::print_sections_to_map): Likewise.
4997 * output.h (class Output_data): Remove dynamic_reloc_count_
4998 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4999 (Output_data::add_dynamic_reloc): Rewrite.
5000 (Output_data::has_dynamic_reloc): New function.
5001 (Output_data::dynamic_reloc_count): Remove.
5002 (class Output_section): Add order_ field. Remvoe is_relro_local_,
5003 is_last_relro_, is_first_non_relro_, is_interp_,
5004 is_dynamic_linker_section_ fields. Add order and set_order
5005 functions. Remove is_relro_local, set_is_relro_local,
5006 is_last_relro, set_is_last_relro, is_first_non_relro,
5007 set_is_first_non_relro functions, is_interp, set_is_interp,
5008 is_dynamic_linker_section, and set_is_dynamic_linker_section
5009 functions.
5010 (class Output_segment): Change Output_data_list from std::list to
5011 std:;vector. Add output_lists_ field. Remove output_data_ and
5012 output_bss_ fields. Update declarations.
5013
3ff2ccb0
ILT
50142010-08-02 Ian Lance Taylor <iant@google.com>
5015
5016 * arm.cc (Target_arm::gc_process_relocs): Use typename.
5017 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
5018 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
5019
88a4108b
ILT
50202010-08-02 Ian Lance Taylor <iant@google.com>
5021
5022 PR 11855
5023 * script.cc (Script_options::Script_options): Initialize
5024 symbol_definitions_ and symbol_references_.
5025 (Script_options::add_symbol_assignment): Update
5026 symbol_definitions_ and symbol_references_.
5027 (Script_options::add_symbol_reference): New function.
5028 (script_symbol): New function.
5029 * script.h (class Script_options): Add symbol_definitions_ and
5030 symbol_references_ fields.
5031 (Script_options::referenced_const_iterator): New type.
5032 (Script_options::referenced_begin): New function.
5033 (Script_options::referenced_end): New function.
5034 (Script_options::is_referenced): New function.
5035 (Script_options::any_unreferenced): New function.
5036 * script-c.h (script_symbol): Declare.
5037 * yyscript.y (exp): Call script_symbol.
5038 * symtab.cc: Include "script.h".
5039 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5040 Change all callers. Check symbols referenced by scripts.
5041 (Symbol_table::add_undefined_symbols_from_command_line): Add
5042 layout parameter. Change all callers.
5043 (Symbol_table::do_add_undefined_symbols_from_command_line):
5044 Likewise. Break out loop body. Check symbols referenced by
5045 scripts.
5046 (Symbol_table::add_undefined_symbol_from_command_line): New
5047 function broken out of
5048 do_add_undefined_symbols_from_command_line.
5049 * symtab.h (class Symbol_table): Update declarations.
5050 * archive.cc: Include "layout.h".
5051 (Archive::should_include_member): Add layout parameter. Change
5052 all callers. Check for symbol mentioned in expression.
5053 * archive.h (class Archive): Update declaration.
5054 * object.cc (Sized_relobj::do_should_include_member): Add layout
5055 parameter.
5056 * object.h (Object::should_include_member): Add layout parameter.
5057 Change all callers.
5058 (Object::do_should_include_member): Add layout parameter.
5059 (class Sized_relobj): Update declaration.
5060 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
5061 parameter.
5062 * dynobj.h (class Sized_dynobj): Update declaration.
5063 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
5064 layout parameter.
5065 * plugin.h (class Sized_pluginobj): Update declaration.
5066
5f1ab67a
ILT
50672010-08-02 Ian Lance Taylor <iant@google.com>
5068
5069 PR 11866
5070 * output.cc (Output_segment::set_offset): Search for the first and
5071 last sections rather than assuming that the list is in order.
5072 (Output_segment::find_first_and_last_list): New function.
5073 * output.h (class Output_segment): Update declarations.
5074 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
5075 (relro_strip_test_SOURCES): New variable.
5076 (relro_strip_test_DEPENDENCIES): New variable.
5077 (relro_strip_test_LDFLAGS): New variable.
5078 (relro_strip_test_LDADD): New variable.
5079 (relro_strip_test.so): New target.
5080
a8df5856
ILT
50812010-08-02 Ian Lance Taylor <iant@google.com>
5082
5083 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
5084 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
5085 (Target_i386::got_tlsdesc_section): New function.
5086 (Target_i386::got_section): Create space for GOT entries for
5087 TLSDESC relocations.
5088 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
5089 R_386_TLS_GOTDESC.
5090 (Target_i386::Scan::global): Likewise.
5091 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
5092 using TLSDESC GOT.
5093 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
5094 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
5095 (Target_x86_64::got_tlsdesc_section): New function.
5096 (Target_x86_64::got_section): Create space for GOT entries for
5097 TLSDESC relocations.
5098 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5099 R_386_TLS_GOTDESC.
5100 (Target_x86_64::Scan::global): Likewise.
5101 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5102 using TLSDESC GOT.
5103
0c10a0a6
ILT
51042010-08-02 Ian Lance Taylor <iant@google.com>
5105
5106 * testsuite/final_layout.sh: Use dc to convert from hex to
5107 decimal.
5108
41cbeecc
ST
51092010-07-29 Sriraman Tallam <tmsriram@google.com>
5110
5111 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5112 paramter to the call to gold::gc_process_relocs.
5113 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5114 paramter to the call to gold::gc_process_relocs.
5115 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5116 parameter to the call to gold::gc_process_relocs.
5117 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5118 template parameter to the call to gold::gc_process_relocs.
5119 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5120 paramter to the call to gold::gc_process_relocs.
5121 * gc.h (get_embedded_addend_size): New function.
5122 (gc_process_relocs): Save the size of the reloc for use by ICF.
5123 * icf.cc (get_section_contents): Get the addend from the text section
5124 for SHT_REL relocation sections.
5125 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5126 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5127 * int_encoding.h (read_from_pointer): New overloaded function.
5128 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5129 * testsuite/icf_sht_rel_addend_test.sh: New file.
5130 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5131 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5132
6ea55b82
RW
51332010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5134
5135 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5136 * Makefile.in: Regenerate.
5137 * testsuite/Makefile.in: Regenerate.
5138
9691462b
ILT
51392010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5140
5141 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5142 * gold/testsuite/debug_msg.cc: Likewise.
5143 * gold/testsuite/odr_violation1.cc
5144 * gold/testsuite/odr_violation2.cc
5145
76897331
CC
51462010-07-21 Cary Coutant <ccoutant@google.com>
5147
5148 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5149 string, and length fields.
5150 (Output_merge_string::Merged_strings_list): New type.
5151 (Output_merge_string::Merged_strings_lists): New typedef.
5152 (Output_merge_string): Replace merged_strings_ with
5153 merged_strings_lists_.
5154 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5155 Merged_strings_list per input object and section. Don't store pointer
5156 to the string. Don't store length with each merged string entry.
5157 (Output_merge_string::finalize_merged_data): Loop over list of merged
5158 strings lists. Recompute length of each merged string.
5159
78384e8f
CC
51602010-07-15 Cary Coutant <ccoutant@google.com>
5161
5162 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5163 here.
5164
783659f9
ILT
51652010-07-14 Ian Lance Taylor <iant@google.com>
5166
5167 * descriptors.cc (Descriptors::open): Report correct name in error
5168 message.
5169
131687b4
DK
51702010-07-13 Doug Kwan <dougkwan@google.com>
5171
5172 * arm.cc (Arm_input_section::Arm_input_section): For a
5173 SHT_ARM_EXIDX section, always keeps the input sections.
5174 (Arm_input_section::set_exidx_section_link): New method.
5175 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5176 has_errors_ to false.
5177 (Arm_exidx_input_section::has_errors,
5178 Arm_exidx_input_section::set_has_errors): New methods.
5179 (Arm_exidx_input_section::has_errors_): New data member.
5180 (Arm_relobj::get_exidx_shndx_list): New method.
5181 (Arm_output_section::append_text_sections_to_list): Do not skip
5182 section without SHF_EXECINSTR.
5183 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5184 errors.
2e702c99 5185 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
5186 section header. Make error messages more verbose. Check for
5187 a non-executable section linked to an EXIDX section.
5188 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5189 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5190 check that there is no deferred EXIDX section if we exit early.
5191 Instead of not making an EXIDX section in case of an error, make one
5192 and set the has_errors flag of it.
5193 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5194 in a relocatable link.
5195 (Target_arm::do_relax): Look for the EXIDX output section instead of
5196 assuming that it is called .ARM.exidx.
2e702c99 5197 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
5198 section list. Do not check for SHF_EXECINSTR section flags but
5199 skip any input section with errors.
5200 * output.cc (Output_section::Output_section): Initialize
5201 always_keeps_input_sections_ to false.
5202 (Output_section::add_input_section): Check for
5203 always_keeps_input_sections_.
5204 * output.h (Output_section::always_keeps_input_sections,
5205 Output_section::set_always_keeps_input_sections): New methods.
5206 (Output_section::always_keeps_input_sections): New data member.
5207
69517287
RÁE
52082010-07-13 Rafael Espindola <espindola@google.com>
5209
5210 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5211 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5212
82742395
ILT
52132010-07-13 Philip Herron <herron.philip@googlemail.com>
5214 Ian Lance Taylor <iant@google.com>
5215
5216 * output.h (Output_section_lookup_maps::add_merge_section):
5217 Correct check of whether value was inserted.
5218 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5219 (Output_section_lookup_maps::add_relaxed_input_section):
5220 Likewise.
5221 * arm.cc (Target_arm::got_section): Remove used local os.
5222 * i386.cc (Target_i386::got_section): Likewise.
5223 * x86_64.cc (Target_x86_64::got_section): Likewise.
5224 * sparc.cc (Target_sparc::got_section): Likewise.
5225 (Target_sparc::relocate): Remove unused local have_got_offset.
5226 * powerpc.cc (Target_powerpc::relocate): Likewise.
5227
f2d707b5
ILT
52282010-07-13 Ian Lance Taylor <iant@google.com>
5229
241531d6
ILT
5230 * compressed_output.cc (zlib_decompress): Fix signature in
5231 !HAVE_ZLIB_H case.
5232
f2d707b5
ILT
5233 * archive.cc (Archive::include_member): Unlock an external member
5234 of a thin archive. Don't bother to delete an object we know is
5235 NULL.
5236
a2e47362
CC
52372010-07-12 Cary Coutant <ccoutant@google.com>
5238
5239 * compressed_output.cc (zlib_decompress): New function.
5240 (get_uncompressed_size): New function.
5241 (decompress_input_section): New function.
5242 * compressed_output.h (get_uncompressed_size): New function.
5243 (decompress_input_section): New function.
5244 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5245 Handle compressed debug sections.
5246 * layout.cc (is_compressed_debug_section): New function.
5247 (Layout::output_section_name): Map compressed section names to
5248 canonical names.
5249 * layout.h (is_compressed_debug_section): New function.
5250 (is_debug_info_section): Recognize compressed debug sections.
5251 * merge.cc: Include compressed_output.h.
5252 (Output_merge_data::do_add_input_section): Handle compressed
5253 debug sections.
5254 (Output_merge_string::do_add_input_section): Handle compressed
5255 debug sections.
5256 * object.cc: Include compressed_output.h.
5257 (Sized_relobj::Sized_relobj): Initialize new data members.
5258 (build_compressed_section_map): New function.
5259 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5260 * object.h (Object::section_is_compressed): New method.
5261 (Object::do_section_is_compressed): New method.
5262 (Sized_relobj::Compressed_section_map): New type.
5263 (Sized_relobj::do_section_is_compressed): New method.
5264 (Sized_relobj::compressed_sections_): New data member.
5265 * output.cc (Output_section::add_input_section): Handle compressed
5266 debug sections.
5267 * reloc.cc: Include compressed_output.h.
5268 (Sized_relobj::write_sections): Handle compressed debug sections.
5269
ce279a62
CC
52702010-07-08 Cary Coutant <ccoutant@google.com>
5271
5272 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5273 weak when resolving to a dynamic def.
5274 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5275 for weak undef/dynamic def cases. Adjust callers.
5276 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5277 undef_binding_weak_.
5278 (Symbol_table::sized_write_globals): Adjust symbol binding.
5279 (Symbol_table::sized_write_symbol): Add binding parameter.
5280 * symtab.h (Symbol::set_undef_binding): New method.
5281 (Symbol::is_undef_binding_weak): New method.
5282 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5283 (Symbol_table::should_override): Add new parameter.
5284 (Symbol_table::sized_write_symbol): Add new parameter.
5285
5286 * testsuite/weak_undef_file1.cc: Add new test case.
5287 * testsuite/weak_undef_file2.cc: Fix header comment.
5288 * testsuite/weak_undef_test.cc: Add new test case.
5289
b2286c10
DK
52902010-06-29 Doug Kwan <dougkwan@google.com>
5291
5292 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5293 Initialize USE_SYMBOL_.
5294 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5295 definition.
5296 (Arm_reloc_property::uses_symbol_): New data member declaration.
5297 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5298 uses symbol value and symbol is undefined but not weakly undefined.
5299
4802450a
RÁE
53002010-06-28 Rafael Espindola <espindola@google.com>
5301
5302 * plugin.cc (Plugin::load): Use dlerror.
5303
e5ca47ba
ILT
53042010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5305
5306 * symtab.cc (detect_odr_violations): When reporting an ODR
5307 violation, report an object where the symbol is defined.
5308
8a75a161
DK
53092010-06-25 Doug Kwan <dougkwan@google.com>
5310
5311 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5312 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5313 definition.
5314 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5315 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5316 target hook to detect function points.
5317 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5318 * icf.h (Icf::check_section_for_function_pointers): Change type of
5319 parameter SECTION_NAME to const reference to std::string. Use
5320 target hook to determine if section may have unsafe pointers.
5321 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5322 method definition.
5323
42218b9f
RÁE
53242010-06-21 Rafael Espindola <espindola@google.com>
5325
5326 * fileread.cc (Input_file::find_fie): New
5327 (Input_file::open): Use Input_file::find_fie.
5328 * fileread.h (Input_file::find_fie): New
5329 * plugin.cc (set_extra_library_path): New.
5330 (Plugin::load): Add set_extra_library_path to the transfer vector.
5331 (Plugin_manager::set_extra_library_path): New.
5332 (Plugin_manager::add_input_file): Use the extra search path if set.
5333 (set_extra_library_path(): New.
5334 * plugin.h (Plugin_manager): Add set_extra_library_path and
5335 extra_search_path_.
5336
a0506cca
CC
53372010-06-19 Cary Coutant <ccoutant@google.com>
5338
5339 * layout.cc (gdb_sections): Add .debug_types.
5340 (lines_only_debug_sections): Likewise.
5341
6508b958
RÁE
53422010-06-18 Rafael Espindola <espindola@google.com>
5343
5344 * plugin.cc (add_input_file,add_input_library)
5345 (Plugin_manager::add_input_file): Make filename arguments const.
5346 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5347 const.
5348
3e235302
DK
53492010-06-16 Doug Kwan <dougkwan@google.com>
5350
5351 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5352 .ARM.attributes section if we have not merged any input
5353 attributes sections.
5354
106e8a6c
DK
53552010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5356
5357 * arm.cc: Allow combining objects with no EABI version
5358 information.
5359
91ff43fe
RÁE
53602010-06-15 Rafael Espindola <espindola@google.com>
5361
5362 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5363
68ed838c
ILT
53642010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5365
5366 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5367 (struct iovec): Correct !HAVE_READV definition.
5368
f3a2388f
CC
53692010-06-10 Cary Coutant <ccoutant@google.com>
5370
5371 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5372 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5373 reloc sections.
5374 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5375
5376 PR 11683
5377 * symtab.h (Symbol::is_placeholder): New member function.
5378 * target-reloc.h (relocate_section): Check for placeholder symbols.
5379
5380 * testsuite/Makefile.am (plugin_test_8): New test.
5381 (plugin_test_9): New test.
5382 * testsuite/Makefile.in: Regenerate.
5383
e1df38aa
NC
53842010-06-09 Nick Clifton <nickc@redhat.com>
5385
5386 * yyscript.y (input_list_element): Allow strings prefixed with
5387 the '-' character. Treat these as libraries.
5388 * script.cc (script_add_library): New function. Adds a library
5389 specified by "-l<name>" found in an input script.
5390 * script-c.h: Add prototype for script_add_library.
5391
25bbe950
DK
53922010-06-07 Doug Kwan <dougkwan@google.com>
5393
5394 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5395 Restrict stub-group size to be within long conditional branch
5396 range when working around cortex-A8 erratum.
5397
0f32ea4c
ILT
53982010-06-07 Damien Diederen <dd@crosstwine.com>
5399
5400 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5401 #ifdef typo.
5402
8fe2a369
ST
54032010-06-03 Sriraman Tallam <tmsriram@google.com>
5404
5405 PR gold/11658
5406 * output.cc
5407 (Output_section::Input_section_sort_entry::compare_section_ordering):
5408 Change to return non-zero correctly.
5409 (Output_section::Input_section_sort_section_order_index_compare
5410 ::operator()): Change to fix ambiguity in comparisons.
5411
6e9ba2ca
ST
54122010-06-01 Sriraman Tallam <tmsriram@google.com>
5413
5414 * gold.h (is_wildcard_string): New function.
5415 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5416 (Layout::layout_eh_frame): Ditto.
5417 (Layout::find_section_order_index): New method.
5418 (Layout::read_layout_from_file): New method.
5419 * layout.h (Layout::find_section_order_index): New method.
5420 (Layout::read_layout_from_file): New method.
5421 (Layout::input_section_position_): New private member.
5422 (Layout::input_section_glob_): New private member.
5423 * main.cc (main): Call read_layout_from_file here.
5424 * options.h (--section-ordering-file): New option.
5425 * output.cc (Output_section::input_section_order_specified_): New
5426 member.
5427 (Output_section::Output_section): Initialize new member.
5428 (Output_section::add_input_section): Add new parameter.
5429 Keep input sections when --section-ordering-file is used.
5430 (Output_section::set_final_data_size): Sort input sections when
5431 section ordering file is specified.
5432 (Output_section::Input_section_sort_entry): Add new parameter.
5433 Check sorting type.
5434 (Output_section::Input_section_sort_entry::compare_section_ordering):
5435 New method.
5436 (Output_section::Input_section_sort_compare::operator()): Change to
5437 consider section_order_index.
5438 (Output_section::Input_section_sort_init_fini_compare::operator()):
5439 Change to consider section_order_index.
5440 (Output_section::Input_section_sort_section_order_index_compare
5441 ::operator()): New method.
5442 (Output_section::sort_attached_input_sections): Change to sort
5443 according to section order when specified.
e1df38aa
NC
5444 (Output_section::add_input_section<32, true>): Add new parameter.
5445 (Output_section::add_input_section<64, true>): Add new parameter.
5446 (Output_section::add_input_section<32, false>): Add new parameter.
5447 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
5448 * output.h (Output_section::add_input_section): Add new parameter.
5449 (Output_section::input_section_order_specified): New
5450 method.
5451 (Output_section::set_input_section_order_specified): New method.
5452 (Input_section::Input_section): Initialize section_order_index_.
5453 (Input_section::section_order_index): New method.
5454 (Input_section::set_section_order_index): New method.
5455 (Input_section::section_order_index_): New member.
5456 (Input_section::Input_section_sort_section_order_index_compare): New
5457 struct.
5458 (Output_section::input_section_order_specified_): New member.
5459 * script-sections.cc (is_wildcard_string): Delete and move modified
5460 method to gold.h.
5461 (Output_section_element_input::Output_section_element_input): Modify
5462 call to is_wildcard_string.
5463 (Output_section_element_input::Input_section_pattern
5464 ::Input_section_pattern): Ditto.
5465 (Output_section_element_input::Output_section_element_input): Ditto.
5466 * testsuite/Makefile.am (final_layout): New test case.
5467 * testsuite/Makefile.in: Regenerate.
5468 * testsuite/final_layout.cc: New file.
5469 * testsuite/final_layout.sh: New file.
5470
3537c84b
RÁE
54712010-06-01 Rafael Espindola <espindola@google.com>
5472
5473 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5474
105b6afd
RÁE
54752010-06-01 Rafael Espindola <espindola@google.com>
5476
5477 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5478 visibility of symbols.
5479
29e11421
DK
54802010-05-27 Doug Kwan <dougkwan@google.com>
5481
5482 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5483 from start of output section instead of address for a local symbol
5484 in a merged or relaxed section when doing a relocatable link.
5485
5e0f337e
RÁE
54862010-05-26 Rafael Espindola <espindola@google.com>
5487
5488 PR 11604
5489 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5490 adding sections the garbage collector removed.
5491 * gold/testsuite/Makefile.am: Add test.
5492 * gold/testsuite/Makefile.in: Regenerate.
5493 * gold/testsuite/plugin_test_7.sh: New.
5494 * gold/testsuite/plugin_test_7_1.c: New.
5495 * gold/testsuite/plugin_test_7_2.c: New.
5496
f4187277
RÁE
54972010-05-26 Rafael Espindola <espindola@google.com>
5498
5499 * script-sections.cc (Output_section_definition::set_section_addresses):
5500 Check for --section-start.
5501
5c388529
DK
55022010-05-26 Doug Kwan <dougkwan@google.com>
5503
5504 * arm.cc (Arm_scan_relocatable_relocs): New class.
5505 (Target_arm::relocate_special_relocatable): New method.
5506 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5507 (Arm_relocate_functions::thumb_branch_common): Same.
5508 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5509 instead of Default_scan_relocatable_relocs.
5510 * target-reloc.h (relocate_for_relocatable): Let target handle
5511 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5512 * target.h (Sized_target::relocate_special_relocatable): New method.
5513
bca1c3ae
ILT
55142010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5515
5516 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5517
0439c796
DK
55182010-05-23 Doug Kwan <dougkwan@google.com>
5519
5520 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5521 instead of a cast.
5522 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5523 with a direct branch, not a conditional branch, to a stub.
5524 * merge.cc (Output_merge_base::record_input_section): New method
5525 defintion.
5526 (Output_merge_data::do_add_input_section): Record input section if
5527 keeps-input-sections flag is set.
5528 (Output_merge_string::do_add_input_section): Ditto.
5529 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5530 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5531 INPUT_SECTIONS_.
5532 (Output_merge_base::keeps_input_sections,
5533 Output_merge_base::set_keeps_input_sections,
5534 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5535 method definitions.
5536 (Output_merge_base::Input_sections): New type declaration.
5537 (Output_merge_base::input_sections_begin,
5538 Output_merge_base::input_sections_end,
5539 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5540 (Output_merge_base::bool keeps_input_sections_,
5541 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5542 Output_merge_base::input_sections_): New data members.
5543 (Output_merge_data::do_set_keeps_input_sections): New method
5544 defintion.
5545 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5546 * output.cc (Output_section::Input_section::relobj): Move method
5547 defintion from class declaration to here and handle merge sections.
5548 (Output_section::Input_section::shndx): Ditto.
5549 (Output_section::Output_section): Remove initializations of removed
5550 data members and initialize new data member LOOKUP_MAPS_.
5551 (Output_section::add_input_section): Set keeps-input-sections flag
5552 for a newly created merge output section as appropriate. Adjust code
5553 to use Output_section_lookup_maps class.
5554 (Output_section::add_relaxed_input_section): Adjst code for lookup
5555 maps code refactoring.
2e702c99 5556 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
5557 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5558 class. If adding input section to a newly created merge output
5559 section fails, remove the new merge section.
5560 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 5561 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 5562 (Output_section::find_merge_section): Ditto.
0439c796 5563 (Output_section::build_lookup_maps): New method defintion.
2e702c99 5564 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
5565 Output_section_lookup_maps class.
5566 (Output_section::get_input_sections): Export merge sections. Adjust
5567 code to use Output_section_lookup_maps class.
5568 (Output_section:::add_script_input_section): Adjust code to use
5569 Output_section_lookup_maps class. Update lookup maps for merge
5570 sections also.
5571 (Output_section::discard_states): Use Output_section_lookup_maps.
5572 (Output_section::restore_states): Same.
5573 * output.h (Merge_section_properties): Move class defintion out of
5574 Output_section.
5575 (Output_section_lookup_maps): New class.
5576 (Output_section::Input_section::is_merge_section): New method
5577 defintion.
5578 (Output_section::Input_section::relobj): Move defintion out of class
5579 defintion. Declare method only.
5580 (Output_section::Input_section::shndx): Ditto.
5581 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 5582 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
5583 (Output_section::Merge_section_by_properties_map,
5584 Output_section::Output_section_data_by_input_section_map,
5585 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5586 Remove types.
2e702c99 5587 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
5588 KEEPS_INPUT_SECTIONS.
5589 (Output_section::build_lookup_maps): New method declaration.
5590 (Output_section::merge_section_map_,
5591 Output_section::merge_section_by_properties_map_,
5592 Output_section::relaxed_input_section_map_,
5593 Output_section::is_relaxed_input_section_map_valid_): Remove data
5594 members.
5595 (Output_section::lookup_maps_): New data member.
5596
76295588
L
55972010-05-21 Doug Kwan <dougkwan@google.com>
5598
5599 PR gold/11619
5600 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5601 avoid a compilation error.
5602
d103a984
RÁE
56032010-05-19 Rafael Espindola <espindola@google.com>
5604
5605 * script-sections.cc (Output_section_definition::allocate_to_segment):
5606 Update the phdrs_list even when the output section is NULL.
5607 * testsuite/Makefile.am: Add test.
5608 * testsuite/Makefile.in: Regenerate.
5609 * testsuite/script_test_9.cc: New.
5610 * testsuite/script_test_9.sh: New.
5611 * testsuite/script_test_9.t: New.
5612
6625d24e
DK
56132010-05-19 Doug Kwan <dougkwan@google.com>
5614
5615 * arm.cc (Arm_input_section::original_size): New method.
5616 (Arm_input_section::do_addralign): Add a cast.
5617 (Arm_input_section::do_output_offset): Remove static cast.
5618 (Arm_input_section::original_addralign,
5619 Arm_input_section::original_size_): Change type to uint32_t.
5620 (Arm_input_section::init): Add safe casts for section alignment
5621 and size.
5622 (Arm_input_section::set_final_data_size): Do not set address and
5623 offset of stub table.
5624 (Arm_output_section::fix_exidx_coverage): Change use of of
5625 Output_section::Simple_input_section to that of
5626 Output_section::Input_section.
5627 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5628 except for the first pass.
5629 * output.cc (Output_section::get_input_sections): Change type of
5630 input_sections to std::list<Input_section>.
5631 (Output_section::add_script_input_section): Rename from
5632 Output_section::add_simple_input_section. Change type of SIS
5633 parameter from Simple_input_section to Input_section.
5634 * output.h (Output_section::Simple_input_section): Remove class.
5635 (Output_section::Input_section): Change class visibility to public.
5636 (Output_section::Input_section::addralign): Use stored alignments
5637 for special input sections if set.
5638 (Output_section::Input_section::set_addralign): New method.
5639 (Output_section::get_input_sections): Change parameter type from
5640 list of Simple_input_section to list of Input_section.
5641 (Output_section::add_script_input_section): Rename from
5642 Output_section::add_simple_input_section. Change first parameter's
5643 type from Simple_input_section to Input_section and remove the
5644 second and third parameters.
5645 * script-sections.cc (Input_section::Input_section_list): Change
5646 type to list of Output_section::Input_section/
5647 (Input_section_info::Input_section_info): Change parameter type of
5648 INPUT_SECTION to Output_section::Input_section.
5649 (Input_section_info::input_section): Change return type.
5650 (Input_section_info::input_section_): Change type to
5651 Output_section::Input_section.
5652 (Output_section_element_input::set_section_addresses): Adjust code
5653 to use Output_section::Input_section instead of
5654 Output_section::Simple_input_section. Adjust code for renaming
5655 of Output_section::add_simple_input_section.
5656 (Orphan_output_section::set_section_addresses): Ditto.
5657
e1e82ea4
RW
56582010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5659
5660 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5661 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5662
91e75c8a
RÁE
56632010-05-18 Rafael Espindola <espindola@google.com>
5664
5665 * options.cc (General_options::finalize): Handle -nostdlib.
5666 * options.h (nostdlib): New option.
5667 * script.cc (script_add_search_dir): Handle -nostdlib.
5668
da59ad79
DK
56692010-05-12 Doug Kwan <dougkwan@google.com>
5670
5671 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5672 attributes section only if there no attributes section after merging.
5673 (Target_arm::merge_object_attributes): Move value of
e1df38aa 5674 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
5675 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5676 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5677 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5678 and arm_attr_merge_7.stdout.
5679 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5680 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5681 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5682 arm_attr_merge_7b.o): New rules.
5683 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5684 arm_attr_merge_7
5685 * testsuite/Makefile.in: Regenerate.
5686 * testsuite/arm_attr_merge.sh: New file.
5687 * testsuite/arm_attr_merge_[67][ab].s: Same.
5688
3e01a7fd
NC
56892010-05-05 Nick Clifton <nickc@redhat.com>
5690
5691 * po/es.po: Updated Spanish translation.
5692
7ad2014a
L
56932010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5694
5695 * Makefile.am (install-exec-local): Properly install gold as
5696 default cross linker.
5697 * Makefile.in: Regenerated.
5698
4fda8867
NC
56992010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5700 Nick Clifton <nickc@redhat.com>
5701
5702 * configure.ac (install_as_default): Define and set to false
5703 unless --enable-gold or --enable-gold=both/gold has been
5704 specified.
5705 * configure: Regenerate.
5706
5707 * Makefile.am (install-exec-local): Install the executable as
5708 'ld.gold'. If install_as_default is true then also install it as
5709 'ld'.
5710 * Makefile.in: Regenerated.
5711
bd288ea2
ILT
57122010-04-24 Ian Lance Taylor <iant@google.com>
5713
5714 * layout.cc (Layout::layout_reloc): In relocatable link don't
5715 combine reloc sections for grouped sections.
5716
ef38fd8a
ST
57172010-04-23 Sriraman Tallam <tmsriram@google.com>
5718
5719 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5720 sections that are not ordinary to icf.
5721 * icf.cc (get_section_contents): Handle relocation pointing to section
5722 with no object or shndx information.
5723 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5724 * testsuite/Makefile.in: Regenerate.
5725 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5726 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5727
f6973bdc
ILT
57282010-04-22 Ian Lance Taylor <iant@google.com>
5729
5730 * expression.cc (Expression::Expression_eval_info): Add
5731 result_alignment_pointer field.
5732 (Expression::eval_with_dot): Add result_alignment_pointer
5733 parameter. Change all callers.
5734 (Expression::eval_maybe_dot): Likewise.
5735 (class Binary_expression): Add alignment_pointer parameter to
5736 left_value and right_value. Change all callers.
5737 (BINARY_EXPRESSION): Set result alignment.
5738 (class Trinary_expression): Add alignment_pointer parameter to
5739 arg2_value and arg3_value. Change all callers.
5740 (Trinary_cond::value): Set result alignment.
5741 (Max_expression::value, Min_expression::value): Likewise.
5742 (Align_expression::value): Likewise.
5743 * script-sections.cc (class Sections_element): Add dot_alignment
5744 parameter to set_section_addresses virtual function. Update
5745 instantiations.
5746 (class Output_section_element): Likewise.
5747 (Script_sections::create_segments): Add dot_alignment parameter.
5748 Change all callers.
5749 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5750 (Script_sections::set_phdrs_clause_addresses): Likewise.
5751 * script-sections.h: Update declarations.
5752 * script.h: Update declarations.
5753 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5754 min_p_align.
5755 * testsuite/script_test_3.t: Set large alignment.
5756 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5757 segment has expected alignment.
5758
9c9c98a5
NC
57592010-04-22 Nick Clifton <nickc@redhat.com>
5760
5761 * po/gold.pot: Updated by the Translation project.
5762 * po/vi.po: Updated Vietnamese translation.
5763
2253bfba
L
57642010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5765
5766 * testsuite/Makefile.am (check_PROGRAMS): Add
5767 icf_virtual_function_folding_test.
5768 * testsuite/Makefile.in: Regenerated.
5769
85fdf906
AH
57702010-04-15 Andrew Haley <aph@redhat.com>
5771
5772 * options.h (merge_exidx_entries): New option.
5773 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5774 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5775 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5776 (Target_arm::merge_exidx_entries): New function.
5777 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5778 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5779 to Arm_exidx_fixup constructor.
5780 Add new arg, merge_exidx_entries.
5781 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5782 Arm_output_section::fix_exidx_coverage.
5783
ce97fa81
ST
57842010-04-18 Sriraman Tallam <tmsriram@google.com>
5785
5786 * icf.cc (get_section_contents): Check for preemptible functions.
5787 Ignore addend when appropriate.
5788 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5789 section folded.
5790 (add_from_relobj): Check for section folded.
5791 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5792 * symtab.h (should_add_dynsym_entry): Add new parameter.
5793 * target-reloc.h (scan_relocs): Check for section folded.
5794 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5795 Check reloc types for function pointers in shared objects.
5796 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5797 case.
5798 (icf_preemptible_functions_test): New test case.
5799 (icf_string_merge_test): New test case.
5800 * testsuite.Makefile.in: Regenerate.
5801 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5802 bar_glob. Refactor code.
5803 * testsuite/icf_preemptible_functions_test.cc: New file.
5804 * testsuite/icf_preemptible_functions_test.sh: New file.
5805 * testsuite/icf_string_merge_test.cc: New file.
5806 * testsuite/icf_string_merge_test.sh: New file.
5807 * testsuite/icf_virtual_function_folding_test.cc: New file.
5808 * testsuite/icf_virtual_function_folding_test.sh: New file.
5809
04ceb17c
DK
58102010-04-14 Doug Kwan <dougkwan@google.com>
5811
5812 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5813 for local symbol recounting if we remove a section due to ICF.
5814 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5815 there are no regular objects in input.
5816
153e7da4
DK
58172010-04-13 Doug Kwan <dougkwan@google.com>
5818
5819 * arm.cc (Arm_input_section::set_final_data_size): Compute
5820 accurate final data size instead of using current data size.
5821
4dbd9faf
DK
58222010-04-09 Doug Kwan <dougkwan@google.com>
5823
5824 * layout.cc (Layout::choose_output_section): Handle script section
5825 types.
5826 (Layout::make_output_section_for_script): Add section type parameter.
5827 Handle script section types.
5828 * layout.h (Layout::make_output_section_for_script): Add section
5829 type parameter.
5830 * output.cc (Output_section::Output_section): Initialize data member
5831 is_noload_.
5832 (Output_section::do_reset_address_and_file_offset): Do not set address
5833 to 0 if section is a NOLOAD section.
5834 * output.h (Output_section::is_noload): New method.
5835 (Output_section::set_is_noload): Ditto.
5836 (Output_section::is_noload_): New data member.
5837 * script-c.h (Script_section_type): New enum type.
5838 (struct Parser_output_section_header): Add new file section_type.
5839 * script-sections.cc (Sections_element::output_section_name): Add
5840 parameter for returning script section type.
5841 (Output_section_definition::output_section_name): Ditto.
5842 (Output_section_definition::section_type)P; New method.
5843 (Output_section_definiton::script_section_type_name): Ditto.
5844 (Output_section_definition::script_section_type_): New data member.
5845 (Output_section_definition::Output_section_definition): Initialize
5846 data member Output_section_definition::script_section_type_.
5847 (Output_section_definition::create_sections): Pass script section type
5848 to Layout::make_output_section_for_script.
5849 (Output_section_definition::output_section_name): Return script
5850 section type to caller.
5851 (Output_section_definition::set_section_address): Do not advance
5852 dot value and load address if section type is NOLOAD. Set address
5853 of NOLOAD sections regardless of section flags.
5854 (Output_section_definition::print): Print section type if it is
5855 not SCRIPT_SECTION_TYPE_NONE.
5856 (Output_section_definition::section_type): New method.
5857 (Output_section_definition::script_section_type_name): Ditto.
5858 (Script_sections::output_section_name): Add new parameter
5859 PSECTION_TYPE for returning script section type. Pass it to
5860 section elements. Handle discard sections.
5861 (Sort_output_sections::operator()): Handle NOLOAD sections.
5862 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 5863 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
5864 returning script section type.
5865 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5866 INFO and NOLOAD.
5867 * yyscript.y (union): Add new field SECTION_TYPE.
5868 (COPY, DSECT, INFO, NOLOAD): New tokens.
5869 (opt_address_and_section_type): Change type to output_section_header.
5870 (section_type): New non-terminal
5871 (section_header): Handle section type.
2253bfba 5872 (opt_address_and_section_type): Return section type value.
4dbd9faf 5873
721ea635
L
58742010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5875
5876 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5877 * testsuite/plugin_common_test_2.c (foo): Likewise.
5878
6bf924b0
DK
58792010-04-08 Doug Kwan <dougkwan@google.com>
5880
5881 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5882 Output_merge_data.
5883 * output.cc (Output_section::add_merge_input_section): Simplify
5884 code and return status of Output_merge_base::add_input_section.
e1df38aa 5885 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
5886 returns true.
5887
24af6f92
DK
58882010-04-07 Doug Kwan <dougkwan@google.com>
5889
5890 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5891 if section is marked as containing instructions but has no mapping
5892 symbols.
5893 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5894 correct section index.
5895 (Arm_relobj::find_linked_text_section): Ditto.
5896
00698fc5
CC
58972010-04-07 Cary Coutant <ccoutant@google.com>
5898
5899 * archive.cc (include_member): Destroy Read_symbols_data object before
5900 releasing file.
5901 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5902 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5903 (Read_symbols_data::~Read_symbols_data) New destructor.
5904 (Section_relocs::Section_relocs) New constructor.
5905 (Section_relocs::~Section_relocs) New destructor.
5906 (Read_relocs_data::Read_relocs_data) New constructor.
5907 (Read_relocs_data::~Read_relocs_data) New destructor.
5908 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5909 pointers to NULL after deleting.
5910
7296d933
DK
59112010-04-07 Doug Kwan <dougkwan@google.com>
5912
5913 * arm.cc: Replace "endianity" with "endianness" in comments.
5914 (Arm_exidx_cantunwind): Ditto.
5915 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5916 (Arm_relobj::merge_flags_and_attributes): New method.
5917 (Arm_relobj::merge_flags_and_attributes_): New data member.
5918 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5919 (Arm_relobj::scan_sections_for_stubs): Ditto.
5920 (Arm_relobj::do_read_symbols): Check to see if we really want to
5921 merge processor-specific flags and attributes. Exit early if
5922 an object is empty except for section names and the undefined symbol.
5923 (Target_arm::do_finalize_sections): Move check for ELF format to
5924 Arm_relobj::do_read_symbols. Merge processor specific flags and
5925 attributes from a regular object only when we have determined that
5926 it is aapropriate. Do not create an .ARM.attributes section in
5927 output if there is no regular input object.
5928 (Target_arm::merge_processor_specific_flags): Check
5929 --warn-mismatch before printing any error.
5930 (Target_arm::merge_object_attributes): Ditto.
5931 * gold.cc (queue_middle_tasks): Handle the case in which there is
5932 no regular object in input.
5933 * options.cc (General_options::parse_EB): New method.
5934 (General_options::parse_EL): Same.
5935 (General_options::General_options): Initialize endianness_.
5936 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5937 New options.
5938 (General_options::Endianness): New enum.
5939 (General_options::endianness): New method.
5940 (General_options::endianness_): New data member.
5941 * parameters.cc (Parameters::set_options): Check target endianness.
5942 (Parameters::set_target_once): Ditto.
5943 (Parameters::check_target_endianness): New method.
5944 (parameters_force_valid_target): If either -EL or -EB is specified,
5945 use it to define endianness of default target.
5946 * parameters.h (Parameters::check_target_endianness): New method
5947 declaration.
5948 * target.h (class Target): Change "endianity" to "endianness"
5949 in comments.
5950
efc8d4f2
RW
59512010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5952
5953 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5954 * configure: Regenerate.
5955 * Makefile.in: Regenerate.
5956 * testsuite/Makefile.in: Regenerate.
5957
be234d88
CC
59582010-04-06 Cary Coutant <ccoutant@google.com>
5959
5960 gcc PR lto/42757
5961 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5962 prevailing definitions of common symbols.
5963 * testsuite/plugin_test_6.sh: New test case.
5964 * testsuite/plugin_common_test_1.c: New test case.
5965 * testsuite/plugin_common_test_2.c: New test case.
5966 * testsuite/Makefile.am (plugin_test_6): New test case.
5967 * testsuite/Makefile.in: Regenerate.
5968
bd32c6bd
NC
59692010-04-06 Nick Clifton <nickc@redhat.com>
5970
5971 * po/vi.po: New Vietnamese translation.
5972
323c532f
DK
59732010-03-30 Doug Kwan <dougkwan@google.com>
5974
5975 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5976
4fcd97eb
DK
59772010-03-25 Doug Kwan <dougkwan@google.com>
5978
5979 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5980 to avoid a conversion warning on a 32-bit host.
5981
4ebf39db
ILT
59822010-03-24 Ian Lance Taylor <iant@google.com>
5983
5984 * testsuite/script_test_3.t: Add a TLS segment.
5985 * testsuite/Makefile.am (check_PROGRAMS): Add
5986 tls_phdrs_script_test.
5987 (tls_phdrs_script_test_SOURCES): Define.
5988 (tls_phdrs_script_test_DEPENDENCIES): Define.
5989 (tls_phdrs_script_test_LDFLAGS): Define.
5990 (tls_phdrs_script_test_LDADD): Define.
5991 * testsuite/Makefile.in: Rebuild.
5992
4a599bdd
CC
59932010-03-23 Cary Coutant <ccoutant@google.com>
5994
5995 * fileread.cc (find_or_make_view): Fix comment.
5996
6c93b22c
ILT
59972010-03-23 Ian Lance Taylor <iant@google.com>
5998
5999 * script-sections.cc (class Orphan_section_placement): Define
6000 PLACE_TLS and PLACE_TLS_BSS.
6001 (Orphan_section_placement::Orphan_section_placement): Initialize
6002 new places.
6003 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
6004 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6005 (tls_script_test_SOURCES): Define.
6006 (tls_script_test_DEPENDENCIES): Define.
6007 (tls_script_test_LDFLAGS): Define.
6008 (tls_script_test_LDADD): Define.
6009 * testsuite/Makefile.in: Rebuild.
6010
a2c7281b
DK
60112010-03-22 Doug Kwan <dougkwan@google.com>
6012
6013 * arm.cc (Arm_relocate_functions::abs8,
6014 Arm_relocate_functions::abs16): Use correct check for overflow
6015 specified in the ARM ELF specs.
6016 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
6017 target of a BLX instruction specially.
6018 (Reloc_stub::stub_type_for_reloc): Ditto.
6019 (Relocate::relocate): Use symbolic names instead of numeric relocation
6020 codes to report error.
6021 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
6022 workaround.
6023 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
6024 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
6025 thumb2_blx_out_of_range.stdout
6026 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
6027 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
6028 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
6029 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
6030 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
6031 thumb2_blx_in_range, thumb2_blx_in_range.o,
6032 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6033 thumb2_blx_out_of_range.o): New rules.
2e702c99 6034 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
6035 thumb2_blx_in_range and thumb2_blx_out_of_range.
6036 * testsuite/Makefile.in: Regenerate.
6037 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6038 * testsuite/thumb_blx_in_range.s: New file.
6039 * testsuite/thumb_blx_out_of_range.s: New file.
6040
b0193076
RÁE
60412010-03-22 Rafael Espindola <espindola@google.com>
6042
6043 * archive.cc (Should_include): Move to archive.h.
6044 (should_include_member): Make it a member of Archive.
6045 (Lib_group): New.
6046 (Add_lib_group_symbols): New.
6047 * archive.h: Include options.h.
6048 (Archive_member): Moved from Archive.
6049 (Should_include): Moved from archive.cc.
6050 (Lib_group): New.
6051 (Add_lib_group_symbols): New.
6052 * dynobj.cc (do_should_include_member): New.
6053 * dynobj.h (do_should_include_member): New.
6054 * gold.cc (queue_initial_tasks): Update call to queue.
6055 * main.cc (main): Print lib group stats.
6056 * object.cc (do_should_include_member): New.
6057 * object.h: Include archive.h.
6058 (Object::should_include_member): New.
6059 (Object::do_should_include_member): New.
6060 (Sized_relobj::do_should_include_member): New.
6061 * options.cc (General_options::parse_start_lib): New.
6062 (General_options::parse_end_lib): New.
6063 (Input_arguments::add_file): Handle lib groups.
6064 (Input_arguments::start_group): Check we are not in a lib.
6065 (Input_arguments::start_lib): New.
6066 (Input_arguments::end_lib): New.
6067 * options.h (General_options): Add start_lib and end_lib.
6068 (Input_argument::lib_): New.
6069 (Input_argument::lib): New.
6070 (Input_argument::is_lib): New.
6071 (Input_file_lib): New.
6072 (Input_arguments::in_lib_): New.
6073 (Input_arguments::in_lib): New.
6074 (Input_arguments::start_lib): New.
6075 (Input_arguments::end_lib_): New.
6076 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
6077 in unused members as preempted.
6078 (Sized_pluginobj::do_should_include_member): New.
6079 * plugin.h (Sized_pluginobj::do_should_include_member): New.
6080 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
6081 return the blocker.
6082 (Read_symbols::do_whole_lib_group): New.
6083 (Read_symbols::do_lib_group): New.
6084 (Read_symbols::do_read_symbols): Handle lib groups.
6085 (Read_symbols::get_name): Handle lib groups.
6086 * readsyms.h (Read_symbols): Add an archive member pointer.
6087 (Read_symbols::do_whole_lib_group): New.
6088 (Read_symbols::do_lib_group): New.
6089 (Read_symbols::member_): New.
6090 * script.cc (read_input_script): Update call to queue_soon.
6091
d099120c
DK
60922010-03-19 Doug Kwan <dougkwan@google.com>
6093
6094 * arm.cc (Stub_table::Stub_table): Initialize new data members
6095 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6096 (Stub_table::add_reloc_stub): Assign stub offset and update
6097 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6098 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6099 New data members.
2e702c99 6100 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
6101 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6102 instead of going over all reloc stubs.
2e702c99 6103 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
6104 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6105 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 6106 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
6107 Stringpool_template::offset_.
6108 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6109 Stringpool_template::offset_ to zero.
6110
1aa37384
DK
61112010-03-15 Doug Kwan <dougkwan@google.com>
6112
6113 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6114 offset_.
6115 (Stringpool_template::new_key_offset): New method.
6116 (Stringpool_template::add_string): Assign offsets when adding new
6117 strings.
6118 (Stringpool_template::set_string_offsets): Do not set string offsets
6119 when not optimizing.
6120 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6121 member size_.
2e702c99
RM
6122 (Chunked_vector::clear): Clear size_.
6123 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6124 (Chunked_vector::size): Return size_.
6125 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 6126 (Chunked_vector::size_): New data member.
1aa37384
DK
6127 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6128 (Stringpool_template::new_key_offset): New method declaration.
6129 (Stringpool_template::offset_): New data member.
6130
b672b057
RÁE
61312010-03-15 Rafael Espindola <espindola@google.com>
6132
6133 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6134 Add_symbols' constructor.
6135 * readsyms.h (Add_symbols): Remove the input_group member.
6136
b6848d3c
ILT
61372010-03-10 Ian Lance Taylor <iant@google.com>
6138
6139 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6140 target to ask whether a reference to a symbol requires a stack
6141 split.
6142 * target.h (Target::is_call_to_non_split): New function.
6143 (Target::do_is_call_to_non_split): Declare virtual function.
6144 * target.cc: Include "symtab.h".
6145 (Target::do_is_call_to_non_split): New function.
6146 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6147
a2a5469e
CC
61482010-03-10 Cary Coutant <ccoutant@google.com>
6149
6150 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6151 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6152 (File_read::open[2]): Add whole_file_view_ to list of views.
6153 (File_read::make_view): Remove test of whole_file_view_.
6154 (File_read::find_or_make_view): Create whole_file_view_ if
6155 necessary.
6156 (File_read::clear_views): Replace bool parameter with enum;
6157 adjust all callers. Don't delete views with permanent data;
6158 do delete cached views and views from archives if
6159 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6160 if clearing the corresponding view.
6161 * fileread.h (File_read::Clear_views_mode): New enum.
6162 (File_read::View::is_permanent_view): New method.
6163 (File_read::clear_views): Replace bool parameter
6164 with enum; adjust all callers.
6165 * options.h (General_options): Change keep_files_mapped option;
6166 add map_whole_files.
6167 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6168 releasing the file.
6169 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6170 the file.
6171
8861f32b
DM
61722010-03-10 David S. Miller <davem@davemloft.net>
6173
6174 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6175
d62d0f5f
ST
61762010-03-09 Sriraman Tallam <tmsriram@google.com>
6177
6178 * icf.cc (get_section_contents): Add '@' marker after processing the
6179 merge reloc.
6180
9177756d
DK
61812010-03-08 Doug Kwan <dougkwan@google.com>
6182
6183 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6184 due to a conversion warning.
6185 (Arm_relobj::update_output_local_symbol_count): Check for local
6186 symbol with unset output index.
6187
9e9e071b
ILT
61882010-03-05 Ian Lance Taylor <iant@google.com>
6189
6190 * options.h (class General_options): Add --spare-dynamic-tags.
6191 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6192 --spare-dynamic-tags.
6193
a81ee015
ILT
61942010-03-05 Ian Lance Taylor <iant@google.com>
6195
6196 * incremental.cc: Include "libiberty.h".
6197
44ec90b9
RO
61982010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6199
6200 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6201 function, is_info_ member.
6202 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6203 (Versions::Versions): Update caller.
6204 (Versions::define_base_version): Likewise.
6205 (Versions::add_def): Likewise.
6206
0897ed3b
ST
62072010-03-03 Sriraman Tallam <tmsriram@google.com>
6208
6209 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6210 (Scan::possible_function_pointer_reloc): New function.
6211 (Scan::local_reloc_may_be_function_pointer): Change to call
6212 possible_function_pointer_reloc.
6213 (Scan::global_reloc_may_be_function_pointer): Ditto.
6214 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6215 relocations in ".data.rel.ro._ZTV" section.
6216 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6217 * testsuite/icf_safe_so_test.cc: Ditto.
6218 * testsuite/icf_safe_test.cc: Ditto.
6219 * testsuite/icf_safe_test.sh: Ditto.
6220
d3bbad62
ILT
62212010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6222 Ian Lance Taylor <iant@google.com>
6223
6224 * target-reloc.h (relocate_section): Check the symbol table index
6225 for -1U before setting the local symbol index.
6226 (scan_relocatable_relocs): If copying the relocation, record that
6227 the local symbol is required.
6228 * object.h (Symbol_value::is_output_symtab_index_set): New
6229 function.
6230 (Symbol_value::may_be_discarded_from_output_symtab): New
6231 function.
6232 (Symbol_value::has_output_symtab_entry): New function.
6233 (Symbol_value::needs_output_symtab_entry): Remove.
6234 (Symbol_value::output_symtab_index): Make sure the symbol index is
6235 set.
6236 (Symbol_value::set_output_symtab_index): Make sure the symbol
6237 index is not set. Make sure the new index is valid.
6238 (Symbol_value::set_must_have_output_symtab_entry): New function.
6239 (Symbol_value::has_output_dynsym_entry): New function.
6240 (Symbol_value::set_output_dynsym_index): Make sure the new index
6241 is valid.
6242 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6243 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6244 local symbol if permitted.
6245 (Sized_relobj::do_finalize_local_symbols): Call
6246 is_output_symtab_index_set rather than needs_output_symtab_entry.
6247 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6248 rather than needs_output_symtab_entry. Call
6249 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6250 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6251 is_output_symtab_index_set rather than needs_output_symtab_entry.
6252 * testsuite/discard_locals_relocatable_test.c: New file.
6253 * testsuite/discard_locals_test.sh: Test -r.
6254 * testsuite/Makefile.am (check_DATA): Add
6255 discard_locals_relocatable_test1.syms,
6256 discard_local_relocatable_test2.syms.
6257 (MOSTLYCLEANFILES): Likewise. Also add
6258 discard_locals_relocatable_test1.lout and
6259 discard_locals_relocatable_test2.out.
6260 (discard_locals_relocatable_test1.syms): New target.
6261 (discard_locals_relocatable_test.o): New target.
6262 (discard_locals_relocatable_test1.out): New target.
6263 (discard_locals_relocatable_test2.syms): New target.
6264 (discard_locals_relocatable_test2.out): New target.
6265 (various): Add missing ../ld-new dependencies.
6266 * testsuite/Makefile.in: Rebuild.
6267
7e8ccf26
NC
62682010-03-03 Nick Clifton <nickc@redhat.com>
6269
6270 * po/fi.po: New Finnish translation.
6271
2a0ff005
DK
62722010-03-01 Doug Kwan <dougkwan@google.com>
6273
6274 * layout.cc (Layout::Layout): Force section types of .init_array*,
6275 .preinit_array* and .fini_array* sections.
6276 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6277 Fix check of return value of std::string::find.().
6278 (Output_section::Input_section_sort_compare::operator()): Remove
6279 comment about .init_array.
6280 (Output_section::Input_section_sort_init_fini_compare::operator()):
6281 New method.
6282 (Output_section::sort_attached_input_sections): Handle .init_array
6283 and .fini_array specially.
6284 * output.h (Output_section::Inut_section_sort_compare): Update
6285 comment.
6286 (Output_section::Input_section_sort_init_fini_compare): New struct.
6287
c3e4ae29
DK
62882010-02-26 Doug Kwan <dougkwan@google.com>
6289
6290 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6291 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6292 * testsuite/debug_msg.sh: Avoid matching source line number for
6293 use of global variable undef_int.
6294
2fd9ae7a
DK
62952010-02-26 Doug Kwan <dougkwan@google.com>
6296
6297 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6298 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6299 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6300 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6301 * options.cc (General_options::General_options): Initialize member
6302 fix_v4bx_.
6303 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6304 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6305 and rm_no_fix_v4bx.stdout
6306 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6307 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6308 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6309 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6310 and arm_no_fix_v4bx.
6311 * Makefile.in: Regenerate.
6312 * testsuite/arm_fix_v4bx.s: New file.
6313 * testsuite/arm_fix_v4bx.sh: Ditto.
6314
67ec7d0b
DK
63152010-02-24 Doug Kwan <dougkwan@google.com>
6316
6317 * arm.cc (Target_arm::got_section): Make the .got section the first
6318 non RELRO section in the data segment.
6319 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6320 suffixes of section names.
6321
10165461
DK
63222010-02-24 Doug Kwan <dougkwan@google.com>
6323
6324 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6325 flags and attributes merging if an input file is a binary file.
6326 * fileread.cc (Input_file::open): Record format of original file.
6327 * fileread.h (Input_file::Format): New enum type.
2e702c99 6328 (Input_file::Input_file): Initialize data member format_.
10165461
DK
6329 (Input_file::format): New method definition.
6330 (Input_file::format_):: New data member.
6331
4a54abbb
DK
63322010-02-24 Doug Kwan <dougkwan@google.com>
6333
6334 * arm.cc (Arm_output_data_got): New class.
6335 (ARM_TCB_SIZE): New constant
6336 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6337 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6338 If user uses a script with a SECTIONS clause, issue only a warning
6339 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 6340 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
6341 garbage collection.
6342 (Target_arm::got_mode_index_entry): Handle static linking.
6343 (Target_arm::Scan::local): Ditto.
6344 (Target_arm::Scan::global): Ditto.
6345 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6346 all incorrectly implemented relocations.
e1df38aa 6347 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
6348 Arm_output_section::fix_exidx_coverage.
6349 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6350 from ".ARM.exidx." and ".ARM.extab.".
6351
ca419a6f
ILT
63522010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6353
6354 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6355 section if it does not already exist.
6356 * attributes.cc (Attributes_section_data::Attributes_section_data):
6357 Don't crash if size is zero.
6358
135b9c78
ILT
63592010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6360 Ian Lance Taylor <iant@google.com>
6361
6362 * gold.cc (queue_middle_tasks): If no input files were opened,
6363 exit.
6364 * workqueue.h (Task_function::Task_function): Assert that there is
6365 a blocker.
6366
bb0bfe4f
DK
63672010-02-22 Doug Kwan <dougkwan@google.com>
6368
6369 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6370 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6371 types to avoid warnings due to different uint64_t implementations
6372 on different hosts.
6373
2a2b6d42
DK
63742010-02-21 Doug Kwan <dougkwan@google.com>
6375
6376 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6377 handling of the maximum backward branch offset.
2e702c99 6378 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
6379 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6380 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 6381 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
6382 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6383 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6384 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6385 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6386 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6387 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6388 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6389 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6390 thumb2_bl_out_of_range.o): New rules.
6391 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6392 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6393 thumb2_bl_out_of_range
6394 * testsuite/Makefile.in: Regenerate.
6395 * testsuite/arm_bl_in_range.s: New file.
6396 * testsuite/arm_bl_out_of_range.s: Ditto.
6397 * testsuite/arm_branch_in_range.sh: Ditto.
6398 * testsuite/arm_branch_range.t: Ditto.
6399 * testsuite/thumb2_branch_range.t: Ditto.
6400 * testsuite/thumb_bl_in_range.s: Ditto.
6401 * testsuite/thumb_bl_out_of_range.s: Ditto.
6402 * testsuite/thumb_branch_range.t: Ditto.
6403
b487ad64
ST
64042010-02-20 Sriraman Tallam <tmsriram@google.com>
6405
6406 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6407 Add reloc offset information.
6408 * icf.cc (get_section_contents): Change iterators to point to the new
6409 vectors. Add reloc offset information to the contents.
6410 * icf.h (Icf::Sections_reachable_info): New typedef.
6411 (Icf::Sections_reachable_list): New typedef.
6412 (Icf::Offset_info): New typedef.
6413 (Icf::Reloc_info): New struct typedef.
6414 (Icf::Reloc_info_list): New typedef.
6415 (Icf::symbol_reloc_list): Delete method.
6416 (Icf::addend_reloc_list): Delete method.
6417 (Icf::section_reloc_list): Delete method.
6418 (Icf::reloc_info_list): New method.
6419 (Icf::reloc_info_list_): New member.
6420
f96accdf
DK
64212010-02-19 Doug Kwan <dougkwan@google.com>
6422
6423 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6424 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6425 * arm.cc (Arm_relocation_functions): New forward declaration.
6426 (Target_arm::Target_arm): Initialize new data members
6427 got_mod_index_offset_ and tls_base_symbol_defined_.
6428 (Target_arm::Relocate::relocate_tls): New method.
6429 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6430 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6431 New methods.
2e702c99 6432 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
6433 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6434 (Target_arm::got_mod_index_offset_,
6435 Target_arm::tls_base_symbol_defined_): New data members.
6436 (Target_arm::Scan::local, Target::Scan::global,
6437 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6438 relocations.
6439
c8761b9a
DK
64402010-02-18 Doug Kwan <dougkwan@google.com>
6441
6442 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6443 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6444 text section as a parameter becuase some broken tools may not set
6445 the link in section header.
6446 (Target_arm::has_got_section): New method.
6447 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6448 without any mapping symbol as data only. Remove warning.
6449 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6450 link in its section header, try to discover the link by inspecting the
6451 REL31 relocation at the beginning of the section.
6452 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6453 in error message.
6454 (Target_arm::Scan::global): Treat any reference to the symbol
6455 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6456
21bb3914
ST
64572010-02-12 Sriraman Tallam <tmsriram@google.com>
6458
6459 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6460 (Scan::global_reloc_may_be_function_pointer): New function.
6461 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6462 (Scan::global_reloc_may_be_function_pointer): New function.
6463 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6464 (Scan::global_reloc_may_be_function_pointer): New function.
6465 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6466 (Scan::global_reloc_may_be_function_pointer): New function.
6467 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6468 (Scan::global_reloc_may_be_function_pointer): New function.
6469 (Scan::possible_function_pointer_reloc): New function.
6470 (Target_x86_64::can_check_for_function_pointers): New function.
6471 * gc.h (gc_process_relocs): Scan relocation types to determine if
6472 function pointers were taken for targets that support it.
6473 * icf.cc (Icf::find_identical_sections): Include functions for
6474 folding in safe ICF whose pointer is not taken.
6475 * icf.h (Secn_fptr_taken_set): New typedef.
6476 (fptr_section_id_): New member.
6477 (section_has_function_pointers): New function.
6478 (set_section_has_function_pointers): New function.
6479 (check_section_for_function_pointers): New function.
6480 * options.h: Fix comment for safe ICF option.
6481 * target.h (can_check_for_function_pointers): New function.
6482 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6483 Modify icf_safe_test for X86-64.
6484 * testsuite/Makefile.in: Regenerate.
6485 * testsuite/icf_safe_so_test.cc: New file.
6486 * testsuite/icf_safe_so_test.sh: New file.
6487 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6488 (main): Change to take pointer to function kept_func_3.
6489 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6490 folding is done correctly for X86-64.
6491
0da6fa6c
DM
64922010-02-12 David S. Miller <davem@davemloft.net>
6493
6494 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6495 is_symbolless parameter.
6496 (Output_reloc<SHT_REL>::is_symbolless): New.
6497 (Output_reloc<SHT_REL>::is_symbolless_): New.
6498 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6499 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6500 (Output_reloc<SHT_RELA>::is_symbolless): New.
6501 (Output_data_reloc::add_global): Handle is_symbolless.
6502 (Output_data_reloc::add_global_relative): Likewise.
6503 (Output_data_reloc::add_local): Likewise.
6504 (Output_data_reloc::add_local_relative): Likewise.
6505 (Output_data_reloc::add_symbolless_global_addend): New.
6506 (Output_data_reloc::add_symbolless_local_addend): New.
6507 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6508 is_symbolless.
6509 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6510 instead of ->is_relative_
6511 (Output_reloc::write): Likewise.
6512 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6513 (Output_reloc::write_rel): Simplify.
6514
6515 * sparc.cc (Target_sparc::Scan::local): Use
6516 ->add_symbolless_local_addend as needed.
6517 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6518 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6519 based upon relocation offset.
6520
e4782e83
DK
65212010-02-11 Doug Kwan <dougkwan@google.com>
6522
6523 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6524 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6525 beginning of function.
6526 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6527 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6528 parameter is_32bit in calls to should_apply_static_reloc.
6529 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6530 (check_DATA): Add arm_abs_global.stdout.
6531 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6532 arm_abs_global.stdout): New rules.
6533 (MOSTLLYCLEANFILES): Add arm_abs_global
6534 * Makefile.in: Regenerate.
6535 * testsuite/arm_abs_global.s: New file.
6536 * testsuite/arm_abs_global.sh: Ditto.
6537 * testsuite/arm_abs_lib.s: Ditto.
6538
93ceb764
ILT
65392010-02-11 Ian Lance Taylor <iant@google.com>
6540
6541 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6542 Read_relocs task.
6543 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6544 Allocate_commons_task first.
6545 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6546 task, rather than symtab_lock_.
6547 (Gc_process_relocs::~Gc_process_relocs): New function.
6548 (Gc_process_relocs::is_runnable): Check this_blocker_.
6549 (Gc_process_relocs::locks): Use next_blocker_ rather than
6550 blocker_.
6551 (Scan_relocs::~Scan_relocs): New function.
6552 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6553 symtab_lock_.
6554 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6555 next_blocker_.
6556 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6557 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6558 constructor accordingly.
6559 (class Gc_process_relocs): Likewise.
6560 (class Scan_relocs): Likewise.
6561 * common.h (class Allocate_commons_task): Remove symtab_lock_
6562 field, and corresponding constructor parameter.
6563 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6564 symtab_lock_.
6565 (Allocate_commons_task::locks): Likewise.
6566
114dfbe1
ILT
65672010-02-11 Ian Lance Taylor <iant@google.com>
6568
6569 * gold-threads.h (class Once): Define.
6570 (class Initialize_lock): Rewrite as child of Once.
6571 * gold-threads.cc (class Once_initialize): Define.
6572 (once_pointer_control): New static variable.
6573 (once_pointer, once_arg): New static variables.
6574 (c_run_once): New static function.
6575 (Once::Once, Once::run_once, Once::internal_run): New functions.
6576 (class Initialize_lock_once): Remove.
6577 (initialize_lock_control): Remove.
6578 (initialize_lock_pointer): Remove.
6579 (initialize_lock_once): Remove.
6580 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6581 (Initialize_lock::initialize): Rewrite.
6582 (Initialize_lock::do_run_once): New function.
6583 * archive.cc (Archive::interpret_header): Only clear name if it is
6584 not already empty.
6585 * fileread.cc: Include "gold-threads.h"
6586 (file_counts_lock): New static variable.
6587 (file_counts_initialize_lock): Likewise.
6588 (File_read::release): Only increment counts when using --stats.
6589 Use a lock around the increment.
6590 * parameters.cc (class Set_parameters_target_once): Define.
6591 (set_parameters_target_once): New static variable.
6592 (Parameters::Parameters): Move here from parameters.h.
6593 (Parameters::set_target): Rewrite.
6594 (Parameters::set_target_once): New function.
6595 (Parameters::clear_target): Move here and rewrite.
6596 * parameters.h (class Parameters): Update declarations. Add
6597 set_parameters_target_once_ field.
6598 (Parameters::Parameters): Move to parameters.cc.
6599 (Parameters::clear_target): Likewise.
6600 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6601 task.
6602 (Start_group::~Start_group): New function.
6603 (Start_group::is_runnable): New function.
6604 (Start_group::locks, Start_group::run): New functions.
6605 (Finish_group::run): Change saw_undefined to size_t.
6606 * readsyms.h (class Start_group): Define.
6607 (class Finish_group): Change saw_undefined_ field to size_t.
6608 (Finish_group::Finish_group): Remove saw_undefined and
6609 this_blocker parameters. Change all callers.
6610 (Finish_group::set_saw_undefined): New function.
6611 (Finish_group::set_blocker): New function.
6612 * symtab.h (class Symbol_table): Change saw_undefined to return
6613 size_t. Change saw_undefined_ field to size_t.
6614 * target-select.cc (Set_target_once::do_run_once): New function.
6615 (Target_selector::Target_selector): Initialize set_target_once_
6616 field. Don't initialize lock_ and initialize_lock_ fields.
6617 (Target_selector::instantiate_target): Rewrite.
6618 (Target_selector::set_target): New function.
6619 * target-select.h (class Set_target_once): Define.
6620 (class Target_selector): Update declarations. Make
6621 Set_target_once a friend. Remove lock_ and initialize_lock_
6622 fields. Add set_target_once_ field.
6623
fa17a3f4
ILT
66242010-02-10 Ian Lance Taylor <iant@google.com>
6625
6626 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6627 queueing any tasks.
6628 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6629 (queue_middle_tasks): Add all blockers before queueing any tasks.
6630 (queue_final_tasks): Likewise.
6631 * token.h (Task_token::add_blockers): New function.
6632 * object.h (Input_objects::number_of_relobjs): New function.
6633
c7177d31
ILT
66342010-02-10 Ian Lance Taylor <iant@google.com>
6635
5de0e392
ILT
6636 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6637 shared, not if not position independent.
6638 * x86_64.cc (Relocate::relocate_tls): Likewise.
6639 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6640 (tls_pie_pic_test): New target.
6641 * testsuite/Makefile.in: Rebuild.
6642
c7177d31
ILT
6643 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6644 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6645 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6646 * testsuite/Makefile.in: Rebuild.
6647
684b268a
DM
66482010-02-09 David S. Miller <davem@davemloft.net>
6649
6650 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6651 R_SPARC_RELATIVE using ->add_local_relative().
6652 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6653
612a8d3d
DM
6654 * output.h (Output_data_dynamic::add_section_size): New method
6655 that takes two Output_data objects.
6656 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6657 entry param. Handle it in initializers.
6658 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6659 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6660 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6661 arg.
6662 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6663 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6664 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6665 for dynrel_includes_plt.
6666 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6667 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6668 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6669 before .rela.plt
6670 (Target_sparc::do_finalize_sections): Update to pass true for
6671 dynrel_includes_plt.
6672 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6673 output before .rela.plt
6674 (Target_powerpc::do_finalize_sections): Update to pass true for
6675 dynrel_includes_plt when 32-bit.
6676
cb1be87e
DK
66772010-02-08 Doug Kwan <dougkwan@google.com>
6678
6679 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6680 method.
6681 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6682 Arm_relobj::scan_section_for_cortex_a8_stubs,
6683 Arm_relobj::do_relocation_section): Instead of calling
6684 Output_section::output_address, use faster
6685 Arm_relobj::simple_input_section_output_address.
6686
705b5121
DM
66872010-02-08 David S. Miller <davem@davemloft.net>
6688
6689 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6690 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6691 relocation helper function.
6692
024c4466
DM
6693 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6694 just like R_SPARC_GOT{10,13,22}.
6695 (Target_sparc::Scan::local): Likewise.
6696 (Target_sparc::Relocate:relocate): Likewise.
6697
9109c078
ILT
66982010-02-06 Ian Lance Taylor <iant@google.com>
6699
6700 * configure.ac: Rewrite targetobjs duplicate removal code to use
6701 only shell constructs.
6702 * configure: Rebuild.
6703
cf846138
DK
67042010-02-05 Doug Kwan <dougkwan@google.com>
6705
6706 PR 11247
6707 * arm.cc (Arm_relobj::section_is_scannable): New method.
6708 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6709 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6710
6cfaf60b
DK
67112010-02-04 Doug Kwan <dougkwan@google.com>
6712
6713 PR 11247
6714 * arm-reloc-property.cc (cstdio): Include.
6715 * configure.ac (targetobjs): Remove duplicates.
6716 * configure: Regenerate.
6717 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6718 big and little endian version for a given address size.
6719
5c57f1be
DK
67202010-02-03 Doug Kwan <dougkwan@google.com>
6721
6722 * arm-reloc-property.cc
6723 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6724 definition.
6725 * arm-reloc-property.h
6726 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6727 New method definition.
6728 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6729 declaration.
6730 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6731 overflow to N.
6732 (GOT_PREL): Change implemented to Y.
6733 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6734 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6735 (Arm_relocate_functions::movw_abs_nc): Remove method.
6736 (Arm_relocate_functions::movt_abs): Ditto.
6737 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6738 (Arm_relocate_functions::thm_movt_abs): Ditto.
6739 (Arm_relocate_functions::movw_rel_nc): Ditto.
6740 (Arm_relocate_functions::movw_rel): Ditto.
6741 (Arm_relocate_functions::movt_rel): Ditto.
6742 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6743 (Arm_relocate_functions:thm_movw_rel): Ditto.
6744 (Arm_relocate_functions:thm_movt_rel): Ditto.
6745 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6746 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6747 New method definitions.
6748 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6749 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6750 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6751 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6752 (Target_arm::Relocate::relocate): Check for non-static or
6753 unimplemented relocation code and exit early. Change calls to
6754 Target_arm::reloc_uses_thumb_bit and
6755 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6756 instead. Refactor code to handle similar relocations to increase
6757 code sharing. Remove check for unsupported relocation code in switch
6758 statement.
6759 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6760 relocation property table to find out size. Change error message to
6761 print out the name of a relocation code instead of the numeric value.
6762 (Target_arm::scan_reloc_for_stub): Use relocation property table
6763 instead of calling Target_arm::reloc_uses_thumb_bit().
6764
218c5831
DK
67652010-02-02 Doug Kwan <dougkwan@google.com>
6766
6767 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6768 types of relaxed input section.
6769
0d31c79d
DK
67702010-02-02 Doug Kwan <dougkwan@google.com>
6771
6772 * Makefile.am (HFILES): Add arm-reloc-property.h.
6773 (DEFFILES): New.
2e702c99
RM
6774 (TARGETSOURCES): Add arm-reloc-property.cc
6775 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
6776 (libgold_a_SOURCES): $(DEFFILES)
6777 * Makefile.in: Regenerate.
6778 * arm-reloc-property.cc: New file.
6779 * arm-reloc-property.h: New file.
6780 * arm-reloc.def: New file.
6781 * arm.cc: Update comments.
6782 (arm-reloc-property.h): New included header.
6783 (arm_reloc_property_table): New global variable.
6784 (Target_arm::do_select_as_default_target): New method definition.
6785 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6786 arm-reloc-property to targ_extra_obj.
6787 * parameters.cc (set_parameters_target): Call
6788 Target::select_as_default_target().
6789 * target.h (Target::select_as_default_target): New method definition.
6790 (Target::do_select_as_default_target): Same.
6791
546c7457
DK
67922010-02-01 Doug Kwan <dougkwan@google.com>
6793
6794 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6795 first_output_text_section_.
6796 (Arm_exidx_fixup::first_output_text_section): New method definition.
6797 (Arm_exidx_fixup::first_output_text_section_): New data member.
6798 (Arm_exidx_fixup::process_exidx_section): Record the first text
6799 output section seen.
6800 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6801 and entsize in output section header.
6802
11b861d5
DK
68032010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6804
6805 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6806 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6807 (Arm_relocate_functions::thm_alu11): New Method.
6808 (Arm_relocate_functions::thm_pc8): New Method.
6809 (Arm_relocate_functions::thm_pc12): New Method.
6810 (Target_arm::Scan::local): Handle the relocations.
6811 (Target_arm::Scan::global): Likewise.
6812 (Target_arm::Relocate::relocate): Likewise.
6813 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6814
c9a2c125
DK
68152010-01-29 Doug Kwan <dougkwan@google.com>
6816
6817 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6818 of relocation types as ld.
6819
1521477a
DK
68202010-01-29 Doug Kwan <dougkwan@google.com>
6821
6822 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6823 to public.
6824 (Arm_relocate_functions::thumb_branch_common): Ditto.
6825 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6826 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6827 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6828 Arm_relocate_functions::jump24): Remove.
6829 (Target_arm::Relocate::relocate): Adjust code to call
6830 Arm_relocation_functions::arm_branch_common and
6831 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 6832 wrappers. Merge switch-cases together to reduce source code size.
1521477a 6833
e7eca48c
DK
68342010-01-29 Doug Kwan <dougkwan@google.com>
6835
6836 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6837 output_local_symbol_count_needs_update_.
6838 (Arm_relobj::output_local_symbol_count_needs_update,
6839 Arm_relobj::set_output_local_symbol_count_needs_update,
6840 Arm_relobj::update_output_local_symbol_count): New methods.
6841 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6842 member.
6843 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6844 of pointed function as in a R_ARM_PREL31 relocation.
6845 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6846 for output local symbol count updating.
6847 (Target_arm::do_relax): Update output local symbol counts in objects
6848 if necessary.
6849 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6850
02961d7e
ILT
68512010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6852
6853 * arm.cc: Added support for the ARM relocations:
6854 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6855 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6856 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6857 movw_prel_nc).
6858 (Arm_relocate_functions::movw_rel): New method.
6859 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6860 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6861 thm_movw_prel_nc).
6862 (Arm_relocate_functions::thm_movw_rel): New method.
6863 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6864 thm_movt_prel).
6865 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6866 relocations.
6867 (Target_arm::Scan::global): Likewise.
6868 (Target_arm::Relocate::relocate): Likewise.
6869 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6870 Likewise.
6871
b10d2873
ILT
68722010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6873
6874 * arm.cc: Added support for ARM group relocations.
6875 (Target_arm::reloc_needs_sym_origin): New method.
6876 (Arm_relocate_functions::calc_grp_kn): New method.
6877 (Arm_relocate_functions::calc_grp_residual): New method.
6878 (Arm_relocate_functions::calc_grp_gn): New method.
6879 (Arm_relocate_functions::arm_grp_alu): New Method.
6880 (Arm_relocate_functions::arm_grp_ldr): New Method.
6881 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6882 (Arm_relocate_functions::arm_grp_ldc): New Method.
6883 (Target_arm::Scan::local): Handle the ARM group relocations.
6884 (Target_arm::Scan::global): Likewise.
6885 (Target_arm::Relocate::relocate): Likewise.
6886 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6887 Likewise.
6888
2b328d4e
DK
68892010-01-26 Doug Kwan <dougkwan@google.com>
6890
6891 * arm.cc (set): Include.
6892 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6893 pointer type.
2e702c99 6894 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
6895 (Arm_output_section::append_text_sections_to_list): New method.
6896 (Arm_output_section::fix_exidx_coverage): Ditto.
6897 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 6898 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
6899 Relobj::set_section_offset() instead of
6900 Sized_relobj::invalidate_section_offset().
2e702c99 6901 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
6902 parameter for section headers. Ignore relocation sections for
6903 unallocated sections and EXIDX sections.
6904 (Target_arm::fix_exidx_coverage): New method.
6905 (Target_arm::output_section_address_less_than): New type.
6906 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6907 linked text section instead of the EXIDX section.
6908 (Arm_output_section::create_stub_group): Add an assertion to check
6909 that this is not an EXIDX output section.
6910 (Arm_output_section::append_text_sections_to_list): New method.
6911 (Arm_output_section::fix_exidx_coverage): Ditto.
6912 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 6913 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
6914 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6915 first pass.
6916 (Target_arm::fix_exidx_coverage): New method.
6917 * object.h (Relobj::set_output_section): New method.
6918 (Sized_relobj::invalidate_section_offset): Remove method.
6919 (Sized_relobj::do_invalidate_section_offset): Remove method.
6920 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6921
c7f3c371
DK
69222010-01-25 Doug Kwan <dougkwan@google.com>
6923
6924 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6925 Fix warning due to signed and unsigned comparison on a 32-bit host.
6926
8923b24c
DK
69272010-01-22 Doug Kwan <dougkwan@google.com>
6928
6929 * arm.cc (Target_arm::do_relax): Record an output section for section
6930 offset adjustment it contains any stub table that has changed.
6931 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6932 offsets in an output section if necessary.
6933 * output.cc (Output_section::Output_section): Initialize
6934 section_offsets_need_adjustments_.
6935 (Output_section::add_input_section_for_script): Renamed to
6936 Output_section::add_simple_input_section.
6937 (Output_section::save_states): Add a comment.
6938 (Output_section::discard_states): New method defintion.
6939 (Output_section::adjust_section_offsets): Same.
6940 * output.h (Output_section::add_input_section_for_script): Renamed to
6941 Output_section::add_simple_input_section.
6942 (Output_section::discard_states): New method declaration.
6943 (Output_section::adjust_section_offsets): Same.
6944 (Output_section::section_offsets_need_adjustment,
6945 Output_section::set_section_offsets_need_adjustment): New method
6946 definitions.
6947 (Output_section::section_offsets_need_adjustment_): New data member.
6948 * script-sections.cc
6949 (Output_section_element_input::set_section_address): Adjust code for
6950 renaming of Output_section::add_input_section_for_script.
6951 (Orphan_output_section::set_section_address): Same.
6952
9b2fd367
DK
69532010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6954
6955 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6956 Fix_v4bx enum values .
6957 * gold/options.h (General_options): New option definitions.
6958 (General_options::fix_v4bx): New method.
6959 (General_options::Fix_v4bx): New enum.
6960 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6961 (General_options::parse_fix_v4bx_interworking): New method.
6962
80d0d023
DK
69632010-01-22 Doug Kwan <dougkwan@google.com>
6964
6965 * arm.cc (Arm_exidx_fixup): New class.
6966
af2cdeae
DK
69672010-01-21 Doug Kwan <dougkwan@google.com>
6968
6969 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6970 classes.
6971 (Arm_exidx_section_offset_map): New type.
6972
993d07c1
DK
69732010-01-21 Doug Kwan <dougkwan@google.com>
6974
6975 * arm.cc (Arm_exidx_input_section): New class.
6976 (Arm_relobj::exidx_input_section_by_link,
6977 Arm_relobj::exidx_input_section_by_shndx,
6978 Arm_relobj::make_exidx_input_section): New methods.
6979 (read_arm_attributes_section): Remove.
6980 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6981 information about them.
6982 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6983 to here.
6984
5ac169d4
DK
69852010-01-20 Doug Kwan <dougkwan@google.com>
6986
6987 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6988 Input_section_specifier to Section_id.
6989 (Target_arm::new_arm_input_section: Adjust code for change of key
6990 type.
6991 (Target_arm::find_arm_input_section): Ditto.
6992 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6993 (Section_id): Remove.
6994 (Garbage_collection::Section_id_hash): Remove.
6995 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6996 (Section_id): Remove.
6997 (Icf::Section_id_hash): Remove.
6998 * object.h (Section_id, Const_section_id, Section_id_hash,
6999 Const_section_id_hash): New type definitions.
7000 * output.cc (Output_section::add_relaxed_input_section): Change to
7001 use Const_section_id instead of Input_section_specifier as key type.
7002 (Output_section::add_merge_input_section): Ditto.
7003 (Output_section::build_relaxation_map): Change to use Section_id
7004 instead of Input_section_specifier as key type.
2e702c99 7005 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
7006 Ditto.
7007 (Output_section::convert_input_sections_to_relaxed_sections): Change
7008 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 7009 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
7010 (Output_section::find_relaxed_input_section): Ditto.
7011 * output.h (Input_section_specifier): Remove class.
7012 (Output_section::Output_section_data_by_input_section_map): Change
7013 key type to Const_section_id.
7014 (Output_section::Output_relaxed_input_section_by_input_section_map):
7015 Ditto.
7016 (Output_section::Relaxation_map): Change key type to Section_id.
7017
a2162063
ILT
70182010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7019
7020 * gold/arm.cc: Added support for R_ARM_V4BX relocation
7021 (class Arm_v4bx_stub): New class.
7022 (DEF_STUBS): Updated definition to support v4_veneer_bx.
7023 (Stub_factory::make_arm_v4bx_stub): New method.
7024 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
7025 (Stub_table::empty): Handle v4bx stubs.
7026 (Stub_table::add_arm_v4bx_stub): New method.
7027 (Stub_table::find_arm_v4bx_stub): New method.
7028 (Arm_relocate_functions::v4bx): New method.
7029 (Target_arm::fix_v4bx): New method.
7030 (Target_arm::Target_arm): Handle R_ARM_V4BX.
7031 (Stub_table::relocate_stubs): Likewise.
7032 (Stub_table::do_write): Likewise.
7033 (Stub_table::update_data_size_and_addralign): Likewise.
7034 (Stub_table::finalize_stubs): Likewise.
7035 (Target_arm::Scan::local): Likewise.
7036 (Target_arm::Scan::global): Likewise.
7037 (Target_arm::do_finalize_sections): Likewise.
7038 (Target_arm::Relocate::relocate): Likewise.
7039 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7040 Likewise.
7041 (Target_arm::scan_reloc_for_stub): Likewise.
7042 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7043
5696ab0b
ILT
70442010-01-19 Ian Lance Taylor <iant@google.com>
7045
7046 * output.cc (Output_section_headers::do_sized_write): Write large
7047 segment count to sh_info field.
7048 (Output_file_header::do_sized_write): For large segment count,
7049 write PN_XNUM to e_phnum field.
7050
800d0f56
ILT
70512010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7052
7053 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
7054 (Arm_relocate_functions::thm_jump8): New function.
7055 (Arm_relocate_functions::thm_jump11): New function.
7056 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
7057 R_ARM_THM_JUMP11.
7058 (Target_arm::Scan::global): Likewise.
7059 (Target_arm::Relocate::relocate): Likewise.
7060 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7061 Likewise.
7062
41263c05
DK
70632010-01-14 Doug Kwan <dougkwan@google.com>
7064
7065 * arm.cc (map, utility): Include headers.
7066 (Target_arm::apply_cortex_a8_workaround): New method.
7067 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
7068 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
7069 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
7070 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
7071 the --[no-]fix-cortex-a8 command line options.
7072 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
7073 (Target_arm::relocate_stub): Use addend in instruction template.
7074 * options.h (DEFINE_bool): Set the user-set flag.
7075 (General_options): Add --[no-]-fix-cortex options.
7076 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 7077 : Update fast look-up map after conversion.
41263c05 7078
459e9b03
ST
70792010-01-14 Sriraman Tallam <tmsriram@google.com>
7080
7081 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
7082 in the first pass of do_layout.
7083
b521dfe4
DK
70842010-01-13 Doug Kwan <dougkwan@google.com>
7085
7086 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7087 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
7088 apparent compiler problem of not folding static constant integral
7089 data members of elfcpp::Elf_sizes<32>.
7090
44272192
DK
70912010-01-13 Doug Kwan <dougkwan@google.com>
7092
7093 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7094 Arm_relobj::section_needs_cortex_a8_stub_scanning,
7095 Arm_relobj::scan_section_for_cortex_a8_erratum,
7096 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7097 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7098 sections to scan for relocation stubs into a new method
7099 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7100 relocation and Cortex-A8 stub scanning.
7101 (Target_arm::do_relax): Force stubs to be after stubbed sections
7102 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 7103 the beginning of a new relaxation pass. Update a comment.
44272192
DK
7104 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7105
44b71ece
ILT
71062010-01-12 Ian Lance Taylor <iant@google.com>
7107
7108 * target-reloc.h (visibility_error): New inline function.
7109 (relocate_section): Call visibility_error.
7110 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7111 (MOSTLYCLEANFILES): Likewise.
7112 (protected_4_pic.o, protected_3.err): New targets.
7113 * testsuite/protected_4.cc: New file.
7114
a120bc7f
DK
71152010-01-12 Doug Kwan <dougkwan@google.com>
7116
7117 * arm.cc (Cortex_a8_reloc): New class.
7118 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7119 and cortex_a8_relocs_info_.
7120 (Target_arm::fix_cortex_a8): New method definition.
7121 (Target_arm::Cortex_a8_relocs_info): New type.
7122 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7123 New data member declarations.
7124 (Target_arm::scan_reloc_for_stub): Record information about
7125 relocations for THUMB branches that might be exempted from the
7126 Cortex-A8 workaround.
7127 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7128 at the beginning of a relaxation pass.
7129
20138696
DK
71302010-01-12 Doug Kwan <dougkwan@google.com>
7131
7132 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7133 (Arm_relobj::Mapping_symbol_position,
7134 Arm_reloj::Mapping_symbol_position_less,
7135 Arm_relobj::Mapping_symbols_info): New types.
7136 (Target_arm::is_mapping_symbol_name): New method definition.
7137 (Arm_relobj::do_count_local_symbols): Save information about mapping
7138 symbols.
7139
089d69dc
DK
71402010-01-11 Doug Kwan <dougkwan@google.com>
7141
7142 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7143 Arm_relocate_functions::thumb32_branch_upper,
7144 Arm_relocate_functions::thumb32_branch_lower,
7145 Arm_relocate_functions::thumb32_cond_branch_offset,
7146 Arm_relocate_functions::thumb32_cond_branch_upper,
7147 Arm_relocate_functions::thumb32_cond_branch_lower,
7148 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7149 branch offset encoding.
7150 (Arm_relocate_functions::thumb_branch_common): Use new branch
7151 offset encoding methods to avoid code duplication.
7152 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7153 (Stub_addend_reader::operator()): Use new branch encoding method
7154 to avoid code duplication.
7155
99e5bff2
DK
71562010-01-11 Doug Kwan <dougkwan@google.com>
7157
7158 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7159 (Target_arm::do_finalize_sections): Define special EXIDX section
7160 symbols only if referenced.
7161 * gc.h (Garbage_collection::add_reference): New method.
7162 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7163 code duplication.
7164
98e090bd
ILT
71652010-01-11 Ian Lance Taylor <iant@google.com>
7166
d0a91bd8
ILT
7167 * script.cc (Version_script_info::build_expression_list_lookup):
7168 Change complaing about duplicate wildcard match from error to
7169 warning.
7170
98e090bd
ILT
7171 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7172 of 2009-12-30.
7173 (Version_script_info::Version_script_info): Initialize globs_,
7174 default_version_, default_is_global_, and exact_. Don't
7175 initialize globals_ or locals_.
7176 (Version_script_info::build_lookup_tables): Build local symbols
7177 first.
7178 (Version_script_info::unquote): New function.
7179 (Version_script_info::add_exact_match): New function.
7180 (Version_script_info::build_expression_list_lookup): Remove lookup
7181 parameter. Add is_global parameter. Change all callers. Handle
7182 wildcard pattern specially. Unquote pattern. Call
7183 add_exact_match.
7184 (Version_script_info::get_name_to_match): New function.
7185 (Version_script_info::get_symbol_version): New function.
7186 (Version_script_info::get_symbol_version_helper): Remove.
7187 (Version_script_info::check_unmatched_names): Call unquote.
7188 * script.h (class Version_script_info): Change get_symbol_version
7189 to be non-inline and add is_global parameter; change all callers.
7190 Rewrite symbol_is_local. Update declarations. Define struct
7191 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7192 Remove globals_ and locals_ members. Add exact_, globs_,
7193 default_version_, is_global_.
7194 (Version_script_info::Glob): Remove pattern, add expression and
7195 is_global. Update constructor. Change all callers.
7196 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7197 default version.
7198 (Versions::symbol_section_contents): If a symbol is undefined, or
7199 defined in a dynamic object, set the version index to
7200 VER_NDX_LOCAL.
7201 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7202 symbol_is_local.
7203 (Symbol_table::add_from_pluginobj): Likewise.
7204 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7205
d56962d3
DK
72062010-01-11 Doug Kwan <dougkwan@google.com>
7207
7208 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7209 (incremental_dump_LDADD): Add linking option for libintl.
7210 * Makefile.in: Regenerate.
7211
94e6ee91
L
72122010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7213
7214 PR gold/11144
7215 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7216 instead of -Ds.
7217 * testsuite/Makefile.in: Regenerated.
7218
e96c574b
DK
72192010-01-10 Doug Kwan <dougkwan@google.com>
7220
7221 * options.h (DEFINE_var): Use parentheses around argument varname__
7222 in macro body to avoid any unintended subsequent substitutions.
7223
7198066b
ILT
72242010-01-10 Ian Lance Taylor <iant@google.com>
7225
ba4d53bf
ILT
7226 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7227 candidates before doing symbol resolution.
7228
7198066b
ILT
7229 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7230 ODR candidates if only one is weak.
7231
a2beed37
ILT
72322010-01-08 Ian Lance Taylor <iant@google.com>
7233
7234 * script.cc (Version_script_info::build_expression_list_lookup):
7235 Don't warn about ambiguous version, just record the ambiguity.
7236 (Version_script_info::get_symbol_version_helper): Give error if
7237 version is ambiguous.
7238
2fb7225c
DK
72392010-01-08 Doug Kwan <dougkwan@google.com>
7240
7241 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7242 prev_data_size_ and prev_addralign_. Remove initializer for
7243 deleted data member has_been_changed_.
7244 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7245 to determine if the table is empty.
7246 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7247 Remove.
7248 (Stub_table::add_reloc_stub): Define method in class definition
7249 instead of just declaring it there.
7250 (Stub_table::add_cortex_a8_stub): New method definition.
7251 (Stub_table::update_data_size_and_addralign): Ditto.
7252 (Stub_table::finalize_stubs): Ditto.
7253 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7254 (Stub_table::do_addralign_): Return address alignment in the
7255 (Stub_table::do_reset_address_and_file_offset): Define method in
7256 class definition instead of declaring it there. Set current data
7257 size to be the data size of the previous pass.
7258 (Stub_table::set_final_data_size): Use current data size as the
7259 final data size.
7260 (Stub_table::relocate_stub): Change parameter type of stub from
7261 Reloc_stub pointer to Stub pointer.
7262 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7263 (Stub_table::Cortex_a8_stub_list): New typedef.
7264 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7265 Stub_table::prev_addralign_): New data member.
7266 (Arm_relobj::Arm_relobj): Initialize data member
7267 section_has_cortex_a8_workaround_.
7268 (Arm_relobj::section_has_cortex_a8_workaround,
7269 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7270 definitions.
7271 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7272 declarations.
7273 (Target_arm::relocate_stub): Change parameter type of stub from
7274 Reloc_stub pointer to Stub pointer.
7275 (Insn_template::size, Insn_template::alignment): Handle
7276 THUMB16_SPECIAL_TYPE.
7277 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7278 Stub_table::update_data_size_and_addralign,
7279 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7280 definitions.
2e702c99 7281 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
2fb7225c
DK
7282 (Stub_table::do_write): Ditto.
7283 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7284
880cd20d
ILT
72852010-01-08 Ian Lance Taylor <iant@google.com>
7286
7287 PR 11108
7288 * symtab.h (class Symbol): Remove fields is_target_special_ and
7289 has_plt_offset_. Add field is_defined_in_discarded_section_.
7290 (Symbol::is_defined_in_discarded_section): New function.
7291 (Symbol::set_is_defined_in_discarded_section): New function.
7292 (Symbol::has_plt_offset): Rewrite.
7293 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7294 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7295 Don't initialize is_target_special_ or has_plt_offset_.
7296 Initialize is_defined_in_discarded_section_.
7297 (Symbol_table::add_from_relobj): If appropriate, set
7298 is_defined_in_discarded_section.
7299 * resolve.cc (Symbol::override_base_with_special): Don't test
7300 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7301 * target-reloc.h (relocate_section): Do special handling for
7302 symbols defined in discarded sections for global symbols as well
7303 as local symbols.
7304
2703e3eb
ILT
73052010-01-08 Ian Lance Taylor <iant@google.com>
7306
7307 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7308 the SHT_SYMTAB case.
7309
339d40a3
ILT
73102010-01-08 Ian Lance Taylor <iant@google.com>
7311
7312 * object.cc (Sized_relobj::do_layout): Don't get confused if
7313 layout_eh_frame returns NULL.
7314
abecea76
ILT
73152010-01-08 Ian Lance Taylor <iant@google.com>
7316
7317 PR 11084
7318 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7319 dynamic symbol table, use the normal symbol table.
7320 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7321 symbol table.
7322
6b7dd3f3
ILT
73232010-01-08 Ian Lance Taylor <iant@google.com>
7324
7325 PR 11072
7326 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7327 sections.
7328
36c50e63
L
73292010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7330
7331 * version.cc (print_version): Change to "Copyright 2010".
7332
e291e7b9
ILT
73332010-01-08 Ian Lance Taylor <iant@google.com>
7334
7335 PR 10287
7336 PR 11063
7337 * i386.cc (class Target_i386): Change return type of plt_section
7338 to be non-const.
7339 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7340 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7341 tls_desc_rel_ field.
7342 (Output_data_plt_i386::rel_tls_desc): New function.
7343 (Target_i386::rel_tls_desc_section): New function.
7344 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7345 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7346 R_386_TLS_DESC reloc in rel_tls_desc_section.
7347 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7348 Define struct Tlsdesc_info.
7349 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7350 (Target_x86_64::do_reloc_symbol_index): New function.
7351 (Target_x86_64::add_tlsdesc_info): New function.
7352 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7353 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7354 tlsdesc_rel_ field.
7355 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7356 all callers.
7357 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7358 (Target_x86_64::rela_tlsdesc_section): New function.
7359 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7360 handling.
7361 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7362 (Target_x86_64::do_reloc_addend): New function.
7363 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7364 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7365 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7366 (Output_reloc::type): New function.
7367 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7368 (Output_reloc::is_target_specific): New function.
7369 (Output_reloc::target_arg): New function.
7370 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7371 absolute relocs and target specific relocs.
7372 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7373 add_target_specific.
7374 (class Output_data_reloc) [SHT_RELA]: Likewise.
7375 * output.cc (Output_reloc::Output_reloc): Add four new versions
7376 for absolute relocs and target specific relocs.
7377 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7378 (Output_reloc::get_symbol_index): Likewise.
7379 (Output_reloc::local_section_offset): Check that local_sym_index_
7380 is not TARGET_CODE or 0.
7381 (Output_reloc::symbol_value): Likewise.
7382 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7383 reloc.
7384 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7385 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7386 functions.
7387 * layout.cc (add_target_dynamic_tags): Use output section for
7388 DT_PLTRELSZ and DT_JMPREL.
7389
3a44184e
ILT
73902010-01-07 Ian Lance Taylor <iant@google.com>
7391
7392 PR 11061
7393 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7394 function.
7395 (class Output_data_reloc_generic): Define.
7396 (class Output_data_reloc_base): Change base class to
7397 Output_data_reloc_generic. Change add() method to call
7398 bump_relative_reloc_count for a relative reloc. Remove
7399 sort_relocs_ field.
7400 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7401 to sort_relocs().
7402 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7403 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7404 appropriate.
7405 * layout.h (class Layout): Update declaration.
7406
ea715a34
ILT
74072010-01-07 Ian Lance Taylor <iant@google.com>
7408
7409 * output.h (class Output_data): Add const version of
7410 output_section and do_output_section.
7411 (class Output_section_data): Add const version of
7412 do_output_section.
7413 (class Output_section): Likewise.
7414 * layout.cc (Layout::add_target_dynamic_tags): New function.
7415 * layout.h (class Layout): Update declarations.
7416 * arm.cc (Target_arm::do_finalize_sections): Use
7417 add_target_dynamic_tags.
7418 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7419 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7420 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7421 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7422
659948a4
ILT
74232010-01-07 Ian Lance Taylor <iant@google.com>
7424
7425 PR 11042
7426 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7427 object as needed.
7428
9d3b86f6
ILT
74292010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7430 Ian Lance Taylor <iant@google.com>
7431
7432 PR 11019
7433 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7434 Xindex::read_symtab_xindex.
7435
bb0d3eb0
DK
74362010-01-07 Doug Kwan <dougkwan@google.com>
7437
7438 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7439 (Insn_template::thumb16_bcond_insn): New method declaration.
7440 (Insn_template): Fix spelling.
7441 (Stub::thumb16_special): New method declaration.
7442 (Stub::do_write): Define virtual method which was previously pure
7443 virtual.
7444 (Stub::do_thumb16_special): New method declaration.
7445 (Stub::do_fixed_endian_write): New template member.
7446 (Reloc_stub::do_write): Remove.
7447 (Reloc_stub::do_fixed_endian_write): Remove.
7448 (Cortex_a8_stub): New class definition.
7449 (Stub_factory::make_cortex_a8_stub): New method definition.
7450 (Stub_factory::Stub_factory): Add missing static storage class
7451 qualifier for elf32_arm_stub_a8_veneer_blx.
7452
ffeef7df
ILT
74532010-01-07 Ian Lance Taylor <iant@google.com>
7454
dc3f80fe
ILT
7455 PR 10980
7456 * options.h (class General_options): Add --warn-unresolved-symbols
7457 and --error-unresolved-symbols.
7458 * errors.cc (Errors::undefined_symbol): Implement
7459 --warn-unresolved-symbols.
7460
ffeef7df
ILT
7461 * options.h (class General_options): Add -z text and -z textoff.
7462 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7463
f1ec9ded
ST
74642010-01-06 Sriraman Tallam <tmsriram@google.com>
7465
7466 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7467 (Garbage_collection::cident_sections): New function.
7468 (Garbage_collection::add_cident_section): New function.
7469 (Garbage_collection::cident_sections_): New member.
7470 (gc_process_relocs): Add references to sections whose names are C
7471 identifiers.
7472 * gold.h (cident_section_start_prefix): New constant.
7473 (cident_section_stop_prefix): New constant.
7474 (is_cident): New function.
7475 * layout.cc (Layout::define_section_symbols): Replace string constants
7476 with the newly defined constants.
7477 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7478 C identifiers.
7479 * testsuite/Makefile.am: Add gc_orphan_section_test.
7480 * testsuite/Makefile.in: Regenerate.
7481 * testsuite/gc_orphan_section_test.cc: New file.
7482 * testsuite/gc_orphan_section_test.sh: New file.
7483
6eda8c29
ILT
74842010-01-06 Ian Lance Taylor <iant@google.com>
7485
b9674e17
ILT
7486 PR 10980
7487 * options.h (class General_options): Add --warn-shared-textrel.
7488 * layout.cc (Layout::finish_dynamic_section): Implement
7489 --warn-shared-textrel.
7490
6eda8c29
ILT
7491 PR 10980
7492 * options.h (class General_options): Add --warn-multiple-gp.
7493
32dcd44e
ILT
74942010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7495
7496 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7497 $(THREADSLIB) and $(LIBDL).
7498 * Makefile.in: Rebuild.
7499
a192ba05
ILT
75002010-01-06 Ian Lance Taylor <iant@google.com>
7501
7502 PR 10980
7503 * options.cc (General_options::parse_section_start): New function.
7504 (General_options::section_start): New function.
7505 (General_options::General_options): Initialize all members.
7506 * options.h: Include <map>
7507 (class General_options): Add --section-start. Add section_starts_
7508 member.
7509 * layout.cc (Layout::attach_allocated_section_to_segment): If
7510 --section-start was used, set the address of the segment. Remove
7511 local sort_sections.
7512 (Layout::relaxation_loop_body): If the address of the load segment
7513 has been set by --section-start, don't use it.
7514 * output.h (Output_segment::update_flags_for_output_section): New
7515 function.
7516 * output.cc (Output_segment::add_output_section): Call
7517 update_flags_for_output_section.
7518
dde3f402
ILT
75192010-01-05 Ian Lance Taylor <iant@google.com>
7520
62dfdd4d
ILT
7521 PR 10980
7522 * options.h (class General_options): Add --undefined-version.
7523 * script.cc (struct Version_expression): Add was_matched_by_symbol
7524 field.
7525 (Version_script_info::matched_symbol): New function.
7526 (Version_script_info::get_symbol_version_helper): Call
7527 matched_symbol.
7528 (Version_script_info::check_unmatched_names): New function.
7529 * script.h (class Version_script_info): Update declarations.
7530 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7531
9c4ae156
ILT
7532 * options.h (class General_options): Use DEFINE_bool_alias for
7533 allow_multiple_definition.
7534 * resolve.cc (Symbol_table::should_override): Don't test
7535 allow_multiple_definition.
7536
dde3f402
ILT
7537 PR 10980
7538 * options.h (class General_options): Add --cref.
7539 * main.cc (main): Print cref table if --cref. Don't close mapfile
7540 until after printing cref table.
7541 * cref.cc: Include "symtab.h".
7542 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7543 (Cref_table_compare::operator()): New function.
7544 (Cref_inputs::gather_cref): New function.
7545 (filecol): New static const.
7546 (Cref_inputs::print_cref): New function.
7547 (Cref::print_cref): New function.
7548 * cref.h: Include <cstdio>.
7549 (class Cref): Update declarations.
7550 * mapfile.h (Mapfile::file): New function.
7551 * object.h (class Object): Define Symbols. Declare virtual
7552 do_get_global_symbols.
7553 (Object::get_global_symbols): New function.
7554 * object.cc (Input_objects::add_object): Pass object to cref_ if
7555 --cref.
7556 (Input_objects::archive_start): Likewise.
7557 (Input_objects::archive_stop): Likewise.
7558 (Input_objects::print_cref): New function.
7559 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7560 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7561 --cref.
7562 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7563 function.
7564 * plugin.h (class Sized_pluginobj): Update declarations.
7565
8781f709
ILT
75662010-01-05 Ian Lance Taylor <iant@google.com>
7567
7568 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7569 to is_default_version. Rename insdef to insdefault.
7570 (Symbol_table::add_from_relobj): Rename def to is_default_version
7571 and local to is_forced_local.
7572 (Symbol_table::add_from_pluginobj): Likewise.
7573 (Symbol_table::add_from_dynobj): Likewise.
7574 (Symbol_table::define_special_symbol): Rename insdef to
7575 insdefault.
7576
fe35d28d
ILT
75772010-01-04 Ian Lance Taylor <iant@google.com>
7578
30bc8c46
ILT
7579 PR 10980
7580 * options.h (class General_options): Add
7581 --allow-multiple-definition and -z muldefs.
7582 * resolve.cc (Symbol_table::should_override): Don't warn about a
7583 multiple symbol definition if --allow-multiple-definition or -z
7584 muldefs.
7585
7eaea549
ILT
7586 PR 10980
7587 * options.h (class General_options): Add --add-needed and
7588 --copy-dt-needed-entries. Tweak --as-needed help entry.
7589 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7590 error if --copy-dt-needed-entries aka --add-needed is used and
7591 would cause a change in behaviour.
7592
fe35d28d
ILT
7593 PR 10980
7594 * options.h (class General_options): Add -G as a short version of
7595 --shared. Add no-op options -assert, -g, and -i.
7596
55a2bb35
ST
75972010-01-04 Sriraman Tallam <tmsriram@google.com>
7598
7599 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7600 check for .text or .gnu.linkonce.t sections.
7601 * icf.cc (Icf::find_identical_sections): Ditto.
7602 Change the detection for mangled function name within the section
7603 name.
7604 * icf.h (is_section_foldable_candidate): New function.
7605
719328e1
ILT
76062009-12-30 Ian Lance Taylor <iant@google.com>
7607
7608 PR 10980
7609 * options.h (class General_options): Permit two dashes with
7610 --retain-symbols-file.
7611
d7bb5745
ILT
76122009-12-30 Ian Lance Taylor <iant@google.com>
7613
403a15dd
ILT
7614 PR 10979
7615 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7616 don't put the file header and segment headers in the text
7617 segment.
7618
eda294df
ILT
7619 PR 10979
7620 * common.cc (Sort_commons::operator()): Stabilize sort when both
7621 entries are NULL.
7622 (Symbol_table::do_allocate_commons_list): When allocating common
7623 symbols, skip a symbol which is no longer common.
7624 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7625 an object before checking its type.
7626 * testsuite/common_test_2.c: New file.
7627 * testsuite/common_test_3.c: New file.
7628 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7629 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7630 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7631 (common_test_2_pic.o, common_test_2.so): New targets.
7632 (common_test_3_pic.o, common_test_3.so): New targets.
7633 * testsuite/Makefile.in: Rebuild.
7634
d7bb5745
ILT
7635 PR 10979
7636 * script.cc (read_input_script): If we see a new SECTIONS clause,
7637 and we have added an input section, give an error.
7638 * layout.h (class Layout): Add have_added_input_section function.
7639 Add have_added_input_section_ field.
7640 * layout.cc (Layout::Layout): Initialize
7641 have_added_input_section_.
7642 (Layout::layout): Set have_added_input_section_.
7643 (Layout::layout_eh_frame): Likewise.
7644
fc59c572
ILT
76452009-12-30 Ian Lance Taylor <iant@google.com>
7646
7647 PR 10931
7648 * options.h (class General_options): Add --sort-common option.
7649 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7650 * common.cc (Sort_common): Add sort_order parameter to
7651 constructor. Add sort_order_ field.
7652 (Sort_commons::operator): Check sort_order_.
7653 (Symbol_table::allocate_commons): Determine the sort order.
7654 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7655 Change all callers.
7656 (Symbol_table::do_allocate_commons_list): Likewise.
7657
1c74fab0
ILT
76582009-12-30 Ian Lance Taylor <iant@google.com>
7659
7660 PR 10916
7661 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7662 symbols from this object, don't change the visibility of an
7663 undefined symbol.
7664 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7665
6affe781
ILT
76662009-12-30 Ian Lance Taylor <iant@google.com>
7667
7668 PR 10861
7669 * script.h (class Version_script_info): Define Language enum.
7670 Update declarations. Define Glob, Exact, and Lookup types. Add
7671 new fields globals_, locals_, and is_finalized_.
7672 * script.cc: Various formatting fixes.
7673 (class Parser_closure): Change language_stack_ from a vector of
7674 std::string to one of Version_script_info::Language. Adjust all
7675 uses accordingly.
7676 (class Lazy_demangler): Remove.
7677 (struct Version_expression): Change language from std::string to
7678 Version_script_info::Language.
7679 (Version_script_info::Version_script_info): New function.
7680 (Version_script_info::~Version_script_info): Don't call clear.
7681 (Version_script_info::finalize): New function.
7682 (Version_script_info::build_lookup_tables): New function.
7683 (Version_script_info::build_expression_list_lookup): New
7684 function.
7685 (Version_script_info::get_symbol_version_helper): Rewrite to use
7686 lookup tables.
7687 (Version_script_info::print_expression_list): Adjust to use
7688 Version_script_info::Language.
7689 (script_push_lex_into_version_mode): Check that the version script
7690 has not been finalized.
7691 (version_script_push_lang): Change language string to
7692 Version_script_info::Language.
7693 * options.cc (Command_line::version_script): New function.
7694 * options.h (class General_options): Add finalize_dynamic_list
7695 function. Change version_script from declaration to definition.
7696 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7697 * testsuite/version_script.map: Remove duplicate def of foo.
7698 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7699 version_script.map.
7700 * testsuite/Makefile.in: Rebuild.
7701
818bf354
ILT
77022009-12-30 Ian Lance Taylor <iant@google.com>
7703
7704 PR 10843
7705 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7706 if the input symbol index is 0, make the output symbol index 0.
7707
ebcc8304
ILT
77082009-12-30 Ian Lance Taylor <iant@google.com>
7709
7710 PR 10670
7711 * options.h (class General_options): Add -x/--discard-all.
7712 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7713 --discard-all. If the local symbol needs a dynamic entry, check
7714 that before handling --discard-locals.
7715
176fe33f
ILT
77162009-12-30 Ian Lance Taylor <iant@google.com>
7717
bb321bb1
ILT
7718 PR 10450
7719 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7720 flags to PF_R.
7721 (Output_segment::add_output_section): Don't change the flags if
7722 the type is PT_TLS.
7723
176fe33f
ILT
7724 PR 10450
7725 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7726 GNU hash table if they need a dynamic value. Otherwise, don't add
7727 them if they are defined in a dynamic object or are forced local.
7728
e8cd95c7
ILT
77292009-12-29 Ian Lance Taylor <iant@google.com>
7730
1b81fb71
ILT
7731 PR 10450
7732 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7733 .gnu.hash table for a 32-bit target.
7734
8d6d383d
ILT
7735 PR 10450
7736 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7737 regular and a dynamic object only needs a dynamic symbol table
7738 entry if it is externally visible.
7739
e785ec03
ILT
7740 PR 10450
7741 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7742 constructor. Add global_offset_table_ field.
7743 (Target_i386::got_section): Set global_offset_table_.
7744 (Target_i386::do_finalize_sections): Set global_offset_table_
7745 size.
7746 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7747 in constructor. Add global_offset_table_ field.
7748 (Target_x86_64::got_section): Set global_offset_table_.
7749 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7750 size.
7751
1a2dff53
ILT
7752 * layout.cc (Layout::Layout): Initialize increase_relro_.
7753 (Layout::get_output_section): Add is_relro, is_last_relro, and
7754 is_first_non_relro parameters. Change all callers.
7755 (Layout::choose_output_section): Likewise.
7756 (Layout::add_output_section_data): Likewise.
7757 (Layout::make_output_section): Likewise.
7758 (Layout::set_segment_offsets): Clear increase_relro when using a
7759 linker script.
7760 * layout.h (class Layout): Add increase_relro method. Add
7761 increase_relro_ field. Update declarations.
7762 * output.cc (Output_section::Output_section): Initialize
7763 is_last_relro_ and is_first_non_relro_.
7764 (Output_segment::add_output_section): Group relro sections is
7765 do_sort is true. Handle is_last_relro and is_first_non_relro.
7766 (Output_segment::maximum_alignment): Remove relro handling.
7767 (Output_segment::set_section_addresses): Add increase_relro
7768 parameter. Change all callers. Add initial alignment to align
7769 relro sections on separate page. Remove old relro handling.
7770 (Output_segment::set_section_list_addresses): Remove in_relro
7771 parameter. Change all callers.
7772 (Output_segment::set_offset): Add increase parameter. Change all
7773 callers. Remove old relro handling.
7774 * output.h (class Output_section): Add new methods: is_last_relro,
7775 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7776 Add is_last_relro_ and is_first_non_relro_ fields.
7777 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7778 Create separate .got.plt section. Call increase_relro.
7779 * x86_64.cc (Target_x86_64::got_section): Likewise.
7780 * testsuite/relro_script_test.t: Add .got.plt.
7781
f0ba79e2
ILT
7782 PR 10450
7783 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7784 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7785 (Layout::finalize): Call set_dynamic_symbol_size.
7786 (Layout::set_dynamic_symbol_size): New function.
7787 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7788 set_dynamic_symbol_size.
7789
e8cd95c7
ILT
7790 PR 10450
7791 * output.h (class Output_section): Add is_entsize_zero_ field.
7792 * output.cc (Output_section::Output_section): Initialize
7793 is_entsize_zero_.
7794 (Output_section::set_entsize): If two different entsizes are
7795 requested, force it to zero.
7796 (Output_section::add_input_section): Set flags for .debug_str
7797 before updating section flags. Set entsize.
7798 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7799 and SHF_STRING if all input sections have those flags.
7800
3e1b9a8a
RÁE
78012009-12-29 Rafael Espindola <espindola@google.com>
7802
7803 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
7804 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7805 reporting.
3e1b9a8a 7806
3dcad376
ST
78072009-12-29 Sriraman Tallam <tmsriram@google.com>
7808
7809 * options.cc (General_options::parse_version): Allow -v to exit
7810 without an error if there is nothing to link.
7811
084e2665
ILT
78122009-12-29 Ian Lance Taylor <iant@google.com>
7813
7814 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7815 using a version of gcc before 4.1.
7816 * configure: Rebuild.
7817
250acde3
CD
78182009-12-28 Chris Demetriou <cgd@google.com>
7819
7820 * attributes.cc (Output_attributes_section_data::do_write): Use
7821 std::vector::front rather than std::vector::data.
7822
99fff23b
ILT
78232009-12-28 Ian Lance Taylor <iant@google.com>
7824
7825 * symtab.h (class Symbol_table): Add enum Defined.
7826 * resolve.cc (Symbol_table::should_override): Add defined
7827 parameter. Change all callers. Test whether object is NULL
7828 before calling a method on it.
7829 (Symbol_table::report_resolve_problem): Add defined parameter.
7830 Change all callers.
7831 (Symbol_table::should_override_with_special): Likewise.
7832 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7833 parameter. Change all callers.
7834 (Symbol_table::do_define_in_output_data): Likewise.
7835 (Symbol_table::define_in_output_segment): Likewise.
7836 (Symbol_table::do_define_in_output_segment): Likewise.
7837 (Symbol_table::define_as_constant): Likewise.
7838 (Symbol_table::do_define_as_constant): Likewise.
7839 * script.h (class Symbol_assignment): Add is_defsym parameter to
7840 constructor; change all callers.
7841 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7842 parameter. Change all callers. Add is_defsym_ field.
7843 (class Parser_closure): Add parsing_defsym parameter to
7844 constructor; change all callers. Add parsing_defsym accessor
7845 function. Add parsing_defsym_ field.
7846
556bd683
ILT
78472009-12-28 Ian Lance Taylor <iant@google.com>
7848
7849 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 7850 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 7851
1782c879
ILT
78522009-12-23 Ian Lance Taylor <iant@google.com>
7853
7854 * i386.cc (Target_i386::do_calls_non_split): Recognize
7855 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
7856 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7857 -fsplit-stack prologue when using %r11.
1782c879 7858
329ca2b1
ST
78592009-12-21 Sriraman Tallam <tmsriram@google.com>
7860
7861 * options.cc (General_options::parse_version): Make -v continue and do
7862 the link like GNU ld does.
7863
d675ff46
RÁE
78642009-12-17 Rafael Avila de Espindola <espindola@google.com>
7865
7866 * Makefile.am (CCFILES): Add timer.cc.
7867 (HFILES): Add timer.h.
7868 * configure.ac: Check for sysconf and times.
7869 * main.cc: include timer.h.
7870 (main): Use Timer instead of get_run_time.
7871 * timer.cc: New.
7872 * timer.h: New.
7873 * workqueue.cc: include timer.h.
7874 (Workqueue::find_and_run_task):
7875 Report user, sys and wall time.
7876 * Makefile.in: Regenerate.
7877 * config.in: Regenerate.
7878 * configure: Regenerate.
7879
d6344fb5
DK
78802009-12-16 Doug Kwan <dougkwan@google.com>
7881
7882 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7883 sections.
7884 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7885 relaxed input sections.
7886 * output.cc (Output_section::find_relaxed_input_section): Change
7887 return type to Output_relaxed_input_section pointer. Adjust code
7888 for new type of relaxed_input_section_map_.
7889 * output.h (Output_section::find_relaxed_input_section): Change
7890 return type to Output_relaxed_input_section pointer.
7891 (Output_section::Output_relaxed_input_section_by_input_section_map):
7892 New type.
7893 (Output_section::relaxed_input_section_map_): Change type to
7894 Output_section::Output_relaxed_input_section_by_input_section_map.
7895 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7896 input section.
7897
0e0d5469
ILT
78982009-12-15 Ian Lance Taylor <iant@google.com>
7899
7900 * layout.cc (Layout::create_shstrtab): Only write out after input
7901 sections if we are compressing debug sections.
7902
0649a889
ILT
79032009-12-15 Ian Lance Taylor <iant@google.com>
7904
7905 * archive.cc (Archive::add_symbols): Only look up a symbol without
7906 a version if there is, in fact, a version.
7907
2ea97941
ILT
79082009-12-14 Ian Lance Taylor <iant@google.com>
7909
7910 Revert -Wshadow changes, all changes from:
7911 2009-12-11 Doug Kwan <dougkwan@google.com>
7912 2009-12-11 Nick Clifton <nickc@redhat.com>
7913 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7914
b0eec2cc
DK
79152009-12-11 Doug Kwan <dougkwan@google.com>
7916
7917 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7918 due to -Wshadow.
7919 * attributes.cc (Object_attribute::size): Ditto.
7920 (Attributes_section_data::size): Ditto.
7921 (Attributes_section_data::Attributes_section_data): Ditto.
7922 (Output_attributes_section_data::do_write): Ditto.
7923 * attributes.h (Object_attribute::set_type): Ditto.
7924 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7925
91d6fa6a
NC
79262009-12-11 Nick Clifton <nickc@redhat.com>
7927
7928 * archive.cc: Fix shadowed variable warnings.
7929 * arm.cc: Likewise.
7930 * compressed_output.cc: Likewise.
7931 * compressed_output.h: Likewise.
7932 * configure: Likewise.
7933 * dwarf_reader.cc: Likewise.
7934 * dynobj.cc: Likewise.
7935 * dynobj.h: Likewise.
7936 * ehframe.cc: Likewise.
7937 * ehframe.h: Likewise.
7938 * errors.cc: Likewise.
7939 * expression.cc: Likewise.
7940 * fileread.cc: Likewise.
7941 * fileread.h: Likewise.
7942 * freebsd.h: Likewise.
7943 * i386.cc: Likewise.
7944 * icf.cc: Likewise.
7945 * incremental.h: Likewise.
7946 * layout.cc: Likewise.
7947 * layout.h: Likewise.
7948 * mapfile.cc: Likewise.
7949 * merge.cc: Likewise.
7950 * merge.h: Likewise.
7951 * object.cc: Likewise.
7952 * object.h: Likewise.
7953 * options.h: Likewise.
7954 * output.cc: Likewise.
7955 * output.h: Likewise.
7956 * parameters.cc: Likewise.
7957 * plugin.cc: Likewise.
7958 * powerpc.cc: Likewise.
7959 * reduced_debug_output.cc: Likewise.
7960 * reduced_debug_output.h: Likewise.
7961 * reloc.cc: Likewise.
7962 * reloc.h: Likewise.
7963 * resolve.cc: Likewise.
7964 * script-sections.cc: Likewise.
7965 * script.cc: Likewise.
7966 * script.h: Likewise.
7967 * sparc.cc: Likewise.
7968 * symtab.cc: Likewise.
7969 * symtab.h: Likewise.
7970 * target-select.cc: Likewise.
7971 * target-select.h: Likewise.
7972 * token.h: Likewise.
7973 * workqueue.cc: Likewise.
7974 * workqueue.h: Likewise.
7975 * x86_64.cc: Likewise.
7976
a0351a69
DK
79772009-12-10 Doug Kwan <dougkwan@google.com>
7978
7979 * arm.cc (attributes.h): New include.
7980 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7981 (Arm_relobj::~Arm_relobj): Delete object pointed by
7982 attributes_section_data_.
7983 (Arm_relobj::attributes_section_data): New method definition.
7984 (Arm_relobj::attributes_section_data_): New data member declaration.
7985 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7986 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7987 attributes_section_data_.
7988 (Arm_dynobj::attributes_section_data): New method definition.
7989 (Arm_dynobj::attributes_section_data_): New data member declaration.
7990 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7991 initialization value of may_use_blx_ to false.
2e702c99 7992 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
7993 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7994 object attributes to compute results instead of hard-coding.
7995 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7996 Target_arm::get_secondary_compatible_arch,
7997 Target_arm::set_secondary_compatible_arch
7998 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7999 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
8000 New method declarations.
8001 (Target_arm::get_aeabi_object_attribute): New method definition.
8002 (Target_arm::attributes_section_data_): New data member declaration.
8003 (read_arm_attributes_section): New template definition.
8004 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8005 (Arm_dynobj::do_read_symbols): Ditto.
8006 (Target_arm::do_finalize_sections): Merge attributes sections from
8007 input. Check for BLX use after attributes section merging.
8008 Fix __exidx_start and __exidx_end visibility. Create an
8009 .ARM.attributes section if necessary.
8010 (Target_arm::get_secondary_compatible_arch,
8011 Target_arm::set_secondary_compatible_arch,
8012 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8013 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 8014 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
8015 New method definitions.
8016
b59befec
ILT
80172009-12-09 Ian Lance Taylor <iant@google.com>
8018
8019 * plugin.cc (Plugin::load): Don't cast from void* to a function
8020 pointer.
8021
1276bc89
ILT
80222009-12-09 Ian Lance Taylor <iant@google.com>
8023
8024 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
8025 information fields.
8026
2f2de248
L
80272009-12-09 H.J. Lu <hongjiu.lu@intel.com>
8028
8029 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
8030 Replace two_file_shared_1.so with two_file_shared_2.so.
8031 * testsuite/Makefile.in: Regenerated.
8032
4f787271
DK
80332009-12-08 Doug Kwan <dougkwan@google.com>
8034
8035 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8036 (HFILES): Add attributes.h and int_encoding.h.
8037 * Makefile.in: Regenerate.
8038 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8039 function definitions to int_encoding.cc
8040 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8041 prototypes to int_encoding.h
8042 * reduced_debug_output.cc (int_encoding.h): New include.
8043 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
8044 function definitions to int_encoding.cc
8045 (insert_into_vector, read_from_pointer): Move template definitions to
8046 int_encoding.h
8047 * attributes.cc: New file.
8048 * attributes.h: New file.
8049 * int_encoding.cc: New file.
8050 * int_encoding.h: New file.
8051
20b52f1a
RÁE
80522009-12-07 Rafael Avila de Espindola <espindola@google.com>
8053
8054 PR gold/11055
8055 * incremental-dump.cc (dump_incremental_inputs): New.
8056 (main): Use dump_incremental_inputs.
8057
53d7974c
L
80582009-12-07 H.J. Lu <hongjiu.lu@intel.com>
8059
8060 PR gold/10893
8061 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
8062 checking elfcpp::STT_FUNC.
8063 (Target_i386::Relocate::relocate): Likewise.
8064 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8065
8066 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
8067 symbols from shared libraries into normal FUNC symbols.
8068
8069 * symtab.h (Symbol): Add is_func and use it.
8070
05a352e6
DK
80712009-12-05 Doug Kwan <dougkwan@google.com>
8072
8073 * arm.cc (Target_arm::arm_info): Initialize new fields
8074 attributes_section and attributes_vendor.
8075 * i386.cc (Target_i386::i386_info): Same.
8076 * object.cc (Sized_relobj::do_layout): Skip attribute section.
8077 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
8078 fields attributes_section and attributes_vendor.
53d7974c 8079 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
8080 * target.h (Target::attributes_section, Target::attributes_vendor,
8081 Target::is_attributes_section, Target::attribute_arg_type,
8082 Target::attributes_order): New method definitions.
8083 (Target::Target_info::attributes_section,
8084 Target::Target_info::attributes_vendor): New fields.
8085 (Target::do_attribute_arg_type, Target::do_attributes_order): New
8086 virtual method definitions.
8087 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
8088 attributes_section and attributes_vendor.
8089 * testsuite/testfile.cc (Target_test::test_target_info): Same.
8090
f4e5969c
DK
80912009-12-05 Doug Kwan <dougkwan@google.com>
8092
8093 * arm.cc: Update comments about interworking and stub generation.
8094 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
8095 considered as non-PIC.
8096 (Arm_relocate_functions::base_abs): Fix formatting.
8097 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8098 of function to use GOT entry address instead of offset.
8099 (Target_arm::Scan::global): Issue an error if a symbol would need a
8100 PLT does not get one because it is untyped. Remove code to create
8101 dynamic symbols for relative branches.
8102 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8103 takes unsigned integer instead of boolean.
8104
1abce4a6
L
81052009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8106
8107 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8108 (two_file_test_LDADD): Likewise.
8109 (common_test_1_LDADD): Likewise.
8110 (exception_test_LDADD) Likewise.
8111 (weak_test_LDADD): Likewise.
8112 (many_sections_test_LDADD): Likewise.
8113 (initpri1_LDADD): Likewise.
8114 (script_test_1_LDADD): Likewise.
8115 (script_test_2_LDADD): Likewise.
8116 (justsyms_LDADD): Likewise.
8117 (binary_test_LDADD): Likewise.
8118 (large_LDADD): Likewise.
8119 * testsuite/Makefile.in: Regenerated.
8120
adcf2816 81212009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 8122
adcf2816
L
8123 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8124 (Symbol_table::override_with_special): Likewise.
8125 (Symbol_table::add_from_object): Likewise.
8126
28e67f5d
RÁE
81272009-12-04 Rafael Avila de Espindola <espindola@google.com>
8128
8129 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8130 Don't set the data_offset twice.
8131
ae10a101
RÁE
81322009-12-04 Rafael Avila de Espindola <espindola@google.com>
8133
8134 * testsuite/Makefile.in: Regenerate.
8135
f59f41f3
DK
81362009-12-03 Doug Kwan <dougkwan@google.com>
8137
8138 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8139 (Target_arm::do_finalize_sections): Add parameter for symbol table
8140 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8141 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8142 parameter for symbol table pointer.
8143 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8144 an additional parameter for a pointer to symbol table.
8145 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8146 parameter for a symbol table pointer.
8147 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8148 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8149 Ditto.
8150 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8151 parameter for a symbol table pointer.
8152
ca55d848
RÁE
81532009-12-03 Rafael Avila de Espindola <espindola@google.com>
8154
8155 * incremental.cc (Incremental_inputs_header)
8156 (Incremental_inputs_header_write, Incremental_inputs_entry)
8157 (Incremental_inputs_entry_write): Move ...
8158 * incremental.h (Incremental_inputs_header)
8159 (Incremental_inputs_header_write, Incremental_inputs_entry)
8160 (Incremental_inputs_entry_write): here.
8161
3aec4f9c
RÁE
81622009-12-02 Rafael Avila de Espindola <espindola@google.com>
8163
8164 * incremental.cc (make_sized_incremental_binary): Set the target.
8165 Error if it is incompatible.
8166 * output.h (Output_file): Add filename method.
8167
9c0ae74d
RÁE
81682009-12-02 Rafael Avila de Espindola <espindola@google.com>
8169
8170 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8171 from the get_* methods.
8172
a45500ae
RÁE
81732009-12-02 Rafael Avila de Espindola <espindola@google.com>
8174
8175 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8176 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8177 Write 0 for the data_offset of scripts.
8178
325e6408
RÁE
81792009-12-02 Rafael Avila de Espindola <espindola@google.com>
8180
8181 * testsuite/Makefile.am: Add the incremental_test.sh test.
8182 * testsuite/incremental_test.sh: New.
8183 * testsuite/incremental_test_1.c: New.
8184 * testsuite/incremental_test_2.c: New.
8185
954c3e2e
RÁE
81862009-12-01 Rafael Avila de Espindola <espindola@google.com>
8187
8188 * incremental-dump.cc (main): Fix typos.
8189
f8086623
RÁE
81902009-11-27 Rafael Avila de Espindola <espindola@google.com>
8191
8192 PR gold/11025
8193 * incremental-dump.cc (main): Use llu to print 64 bit values.
8194
3b0dd6ac
L
81952009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8196 H.J. Lu <hongjiu.lu@intel.com>
8197
8198 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8199 $(LIBDL).
8200 (incremental_dump_LDADD): Likewise.
8201 * Makefile.in: Regenerated.
8202
a6d1ef57 82032009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 8204
a6d1ef57
DK
8205 Revert:
8206
8207 2009-11-25 Doug Kwan <dougkwan@google.com>
8208
8209 * arm.cc (Target_arm::Target_arm): Move method definition
8210 outside of class definition. Add code to handle
8211 --target1-rel, --target1-abs and --target2= options.
8212 (Target_arm::get_reloc_reloc_type): Change method to be
8213 non-static and const.
8214 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8215 New data member declaration.
8216 (Target_arm::Scan::local, Target_arm::Scan::global,
8217 Target_arm::Relocate::relocate,
8218 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8219 Adjust call to Target_arm::get_real_reloc_type.
8220 (Target_arm::get_real_reloc_type): Use command line options
8221 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8222 * options.h (--target1-rel, --target1-abs, --target2): New
8223 ARM-only options.
8224
50aeb7d4
DK
82252009-11-25 Doug Kwan <dougkwan@google.com>
8226
8227 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8228 class definition. Add code to handle --target1-rel, --target1-abs
8229 and --target2= options.
8230 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8231 and const.
8232 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8233 member declaration.
8234 (Target_arm::Scan::local, Target_arm::Scan::global,
8235 Target_arm::Relocate::relocate,
8236 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8237 call to Target_arm::get_real_reloc_type.
8238 (Target_arm::get_real_reloc_type): Use command line options to
8239 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8240 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8241 options.
8242
51938283
DK
82432009-11-25 Doug Kwan <dougkwan@google.com>
8244
8245 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8246 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8247 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8248 formatting.
8249 (Arm_relocate_functions::thm_call): Replace body with a call to
8250 Arm_relocate_functions::thumb_branch_common.
8251 (Arm_relocate_functions::thm_jump24,
8252 Arm_relocate_functions::thm_xpc22): New method definitions.
8253 (Arm_relocate_functions::thumb_branch_common): New method definition.
8254 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8255 operator.
8256 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8257 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8258
e2b8f3c4
RÁE
82592009-11-24 Rafael Avila de Espindola <espindola@google.com>
8260
8261 * Makefile.am: Build incremental-dump
8262 * Makefile.in: Regenerate.
8263 * incremental-dump.cc: New.
8264 * incremental.cc (Incremental_inputs_header_data,
8265 Incremental_inputs_entry_data): Move to incremental.h
8266 * incremental.h: (Incremental_inputs_header_data,
8267 Incremental_inputs_entry_data): Move from incremental.cc
8268
bcba9aec
RÁE
82692009-11-24 Rafael Avila de Espindola <espindola@google.com>
8270
8271 * incremental.cc (Incremental_inputs_header,
8272 Incremental_inputs_header_write, Incremental_inputs_entry,
8273 Incremental_inputs_entry_write): Add a typedef with the data type.
8274
7c3afe08
RÁE
82752009-11-24 Rafael Avila de Espindola <espindola@google.com>
8276
8277 * incremental.cc (Incremental_inputs_header,
8278 Incremental_inputs_header_write, Incremental_inputs_entry,
8279 Incremental_inputs_entry_write): Update comment about which
8280 type has the filed descriptions.
8281
d204b6e9
DK
82822009-11-15 Doug Kwan <dougkwan@google.com>
8283
8284 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8285 (Arm_relocate_functions::arm_branch_common): Change method defintion
8286 in class definition to a method declaration and update list of formal
8287 parameters.
8288 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8289 Arm_relocation_functions::jump24): Adjust call to
8290 Arm_relocate_functions::arm_branch_common. Update list of formal
8291 parameters.
8292 (Arm_relocate_functions::xpc25): New method definition.
8293 (Arm_relocate_functions::arm_branch_common): Move method defintion
8294 out from class definition. Use stubs for mode-switching and extending
8295 branch ranges.
8296 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8297 specially. Change code to enable use of stubs in ARM branches.
8298
43d12afe
DK
82992009-11-10 Doug Kwan <dougkwan@google.com>
8300
8301 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8302 in method declaration.
8303 (Target_arm::relocate_stub): New method declaration.
8304 (Target_arm::default_target): Change to return a pointer instead of
8305 a const reference.
8306 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8307 Target_arm::default_target.
8308 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8309 method definition.
8310 (Target_arm::relocate_section): Adjust view.
8311 (Target_arm::relocate_stub): New method definition.
8312
ac33a407
DK
83132009-11-10 Doug Kwan <dougkwan@google.com>
8314
8315 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8316 a format warning.
8317 * incremental.cc (open_incremental_binary): Initialized local
8318 variables to avoid warnings.
8319 * object.cc (make_elf_object): Ditto.
8320 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8321 a format warning.
e1df38aa 8322
88ee28e9
L
8323009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8324
8325 PR gold/10930
8326 * testsuite/plugin_test.c: Include "config.h".
8327
2daedcd6
DK
83282009-11-09 Doug Kwan <dougkwan@google.com>
8329
8330 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8331 (arm_symbol_value): Remove.
8332 (Arm_relocate_functions::arm_branch_common,
8333 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8334 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8335 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8336 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8337 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8338 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8339 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8340 Arm_relocate_functions::thm_mobw_abs_nc,
8341 Arm_relocate_functions::thm_mov_abs,
8342 Arm_relocate_functions::movw_prel_nc,
8343 Arm_relocate_functions::thm_movt_abs,
8344 Arm_relocate_functions::movt_prel,
8345 Arm_relocate_functions::thm_movw_prel_nc,
8346 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8347 (Target_arm::Relocate::relocate): Only decompose address into two
8348 parts if relocation type uses the thumb-bit and pass the actual
8349 bit instead of a flag indicating that the thumb-bit is used. Adjust
8350 calls to methods in Arm_relocate_functions for this change.
8351
1276bc89 83522009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
8353
8354 PR 10925
8355 * reloc.cc: Instantiate
8356 Sized_relobj::initialize_input_to_output_maps and
8357 Sized_relobj:free_input_to_output_maps.
8358
e53ad1b5
ILT
83592009-11-06 Ian Lance Taylor <iant@google.com>
8360
8361 PR 10876
8362 * defstd.cc (in_segment): Set only_if_ref true for "end".
8363
eb44217c
DK
83642009-11-06 Doug Kwan <dougkwan@google.com>
8365
8366 * arm.cc (class Reloc_stub): Correct a comment.
8367 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8368 (Target_arm::scan_section_for_stubs): New method declaration.
8369 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8370 Change methods from private to protected.
8371 (Target_arm::do_may_relax): New method definition.
8372 (Target_arm::do_relax, Target_arm::group_sections,
8373 Target_arm::scan_reloc_for_stub,
8374 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8375 (Target_arm::arm_input_section_map_): New data member declaration.
8376 (Target_arm::scan_reloc_for_stub,
8377 Target_arm::scan_reloc_section_for_stubs,
8378 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8379 Target_arm::do_relax): New method definitions.
8380
5d329b7d
ILT
83812009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8382
8383 * configure.ac: Check for (struct stat)::st_mtim
8384 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8385 * config.in: Regenerate.
8386 * configure: Regenerate.
8387
96a0d71b
ILT
83882009-11-05 Ian Lance Taylor <iant@google.com>
8389
8390 PR 10910
8391 * output.cc (Output_segment::add_output_section): Add missing
8392 return statement.
8393
594c8e5e
ILT
83942009-11-04 Ian Lance Taylor <iant@google.com>
8395
8396 PR 10880
8397 * object.h (class Object): Add is_needed and set_is_needed
8398 methods. Add is_needed_ field. Make bool fields into bitfields.
8399 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8400 defined in a dynamic object and referenced by a regular object,
8401 set is_needed for the dynamic object.
8402 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8403 if the file is marked with as_needed and it is not needed.
8404
22b127cc
ILT
84052009-11-04 Ian Lance Taylor <iant@google.com>
8406
8407 PR 10887
8408 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8409 tags if data is discarded by linker script.
8410 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8411 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8412 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8413 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8414
f5c870d2
ILT
84152009-11-04 Ian Lance Taylor <iant@google.com>
8416
8417 * layout.cc (Layout::get_output_section): Add is_interp and
8418 is_dynamic_linker_section parameters. Change all callers.
8419 (Layout::choose_output_section): Likewise.
8420 (Layout::make_output_section): Likewise.
8421 (Layout::add_output_section_data): Add is_dynamic_linker_section
8422 parameter. Change all callers.
8423 * layout.h (class Layout): Update declarations.
8424 * output.h (class Output_section): Add is_interp, set_is_interp,
8425 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8426 Add is_interp_, is_dynamic_linker_section_ fields. Change
8427 generate_code_fills_at_write_ to a bitfield.
8428 * output.cc (Output_section::Output_sections): Initialize new
8429 fields.
8430 (Output_segment::add_output_section): Add do_sort parameter.
8431 Change all callers.
8432
1ae4d23b
ILT
84332009-11-03 Ian Lance Taylor <iant@google.com>
8434
8435 PR 10860
8436 * options.h (class General_options): Add --warn-common.
8437 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8438 merging two common symbols.
8439 (Symbol_table::should_override): Handle --warn-common when merging
8440 a common symbol with a defined symbol. Use report_resolve_problem
8441 for multiple definitions.
8442 (Symbol_table::report_resolve_problem): New function.
8443 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8444
55da9579
DK
84452009-11-03 Doug Kwan <dougkwan@google.com>
8446
8447 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8448 stub_factory_.
8449 (Target_arm::stub_factory): New method definition.
8450 (Target_arm::new_arm_input_section,
8451 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8452 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 8453 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
8454 New type definitions.
8455 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8456 member declarations.
8457 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8458 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8459 New method definitions.
8460
37a9ac43
ILT
84612009-11-03 Ian Lance Taylor <iant@google.com>
8462
8463 * options.h (class General_options): Add --warn_constructors.
8464
b3d6a3d4
ILT
84652009-11-03 Ian Lance Taylor <iant@google.com>
8466
8467 PR 10893
8468 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8469 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8470
934b01dd
ILT
84712009-11-03 Ian Lance Taylor <iant@google.com>
8472
8473 PR 10895
8474 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8475 --msgid-bugs-address.
8476 (install-pdf): New target.
8477 (install-data_yes): Look up one directory to find mkinstalldirs.
8478
03c1939b
L
84792009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8480
8481 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8482 tree.
8483
ebd95253
DK
84842009-10-30 Doug Kwan <dougkwan@google.com>
8485
8486 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8487
e9bbb538
DK
84882009-10-30 Doug Kwan <dougkwan@google.com>
8489
8490 * arm.cc (Stub_addend_reader): New struct template definition
8491 and partial specializations.
8492 (Stub_addend_reader::operator()): New method definition for a
8493 partially specialized template.
8494
d5b40221
DK
84952009-10-30 Doug Kwan <dougkwan@google.com>
8496
8497 * arm.cc (Arm_relobj::processor_specific_flags): New method
8498 definition.
8499 (Arm_relobj::do_read_symbols): New method declaration.
8500 (Arm_relobj::processor_specific_flags_): New data member declaration.
8501 (Arm_dynobj): New class definition.
8502 (Target_arm::do_finalize_sections): Add input_objects parameter.
8503 (Target_arm::do_adjust_elf_header): New method declaration.
8504 (Target_arm::are_eabi_versions_compatible,
8505 (Target_arm::merge_processor_specific_flags): New method declaration.
8506 (Target_arm::do_make_elf_object): New overloaded method definitions
8507 and declaration.
8508 (Arm_relobj::do_read_symbols): New method definition.
8509 (Arm_dynobj::do_read_symbols): Ditto.
8510 (Target_arm::do_finalize_sections): Add input_objects parameters.
8511 Merge processor-specific flags from all input objects.
8512 (Target_arm::are_eabi_versions_compatible,
8513 Target_arm::merge_processor_specific_flags,
8514 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8515 New method definitions.
8516 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8517 Input_objects pointer type parameter.
8518 * layout.cc (Layout::finalize): Pass input objects to target's.
8519 finalize_sections function.
8520 * output.cc (Output_file_header::do_sized_write): Set ELF file
8521 header's processor-specific flags.
8522 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8523 Input_objects pointer type parameter.
8524 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8525 * target.h (Input_objects): New forward class declaration.
8526 (Target::processor_specific_flags,
8527 Target::are_processor_specific_flags_sect): New method definitions.
8528 (Target::finalize_sections): Add input_objects parameter.
8529 (Target::Target): Initialize processor_specific_flags_ and
8530 are_processor_specific_flags_set_.
8531 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8532 parameter.
8533 (Target::set_processor_specific_flags): New method definition.
8534 (Target::processor_specific_flags_,
8535 Target::are_processor_specific_flags_set_): New data member
8536 declarations.
8537 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8538 Input_objects pointer type parameter.
8539
ebabffbd
DK
85402009-10-30 Doug Kwan <dougkwan@google.com>
8541
8542 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8543
ad0f2072
ILT
85442009-10-28 Ian Lance Taylor <iant@google.com>
8545
8546 * object.h (class Relobj): Drop options parameter from
8547 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8548 do_scan_relocs, do_relocate. Change all callers.
8549 (class Sized_relobj): Drop options parameters from
8550 do_gc_process_relocs, do_scan_relocs, do_relocate,
8551 do_relocate_sections, relocate_sections, emit_relocs_scan,
8552 emit_relocs_scan_reltype. Change all callers.
8553 (struct Relocate_info): Remove options field and all references to
8554 it.
8555 * reloc.h (class Read_relocs): Remove options constructor
8556 parameter and options_ field. Change all callers.
8557 (class Gc_process_relocs, class Scan_relocs): Likewise.
8558 (class Relocate_task): Likewise.
8559 * target-reloc.h (scan_relocs): Remove options parameter. Change
8560 all callers.
8561 (scan_relocatable_relocs): Likewise.
8562 * target.h (class Sized_target): Remove options parameter from
8563 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8564 all callers.
8565 * gc.h (gc_process_relocs): Remove options parameter. Change all
8566 callers.
8567 * arm.cc: Update functions to remove options parameters.
8568 * i386.cc: Likewise.
8569 * powerpc.cc: Likewise.
8570 * sparc.cc: Likewise.
8571 * x86_64.cc: Likewise.
8572 * testsuite/testfile.cc: Likewise.
8573
8ffa3667
DK
85742009-10-28 Doug Kwan <dougkwan@google.com>
8575
8576 * arm.cc (Arm_relobj): New class definition.
e1df38aa 8577 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
8578 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8579 New method definitions.
8580
40f36857
CC
85812009-10-28 Cary Coutant <ccoutant@google.com>
8582
8583 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8584 (Plugin::cleanup_done_): New member.
8585 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8586 (Plugin_manager::cleanup_done_): Remove.
8587 (Plugin_manager::add_input_file): Edit error message.
8588 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8589 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8590
2c849493
ILT
85912009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8592
8593 * fileread.cc: (File_read::View::~View): Use the new
8594 data_ownership_ filed.
8595 (File_read::~File_read): Dispose the new whole_file_view_.
8596 (File_read::open): Mmap the whole file if needed.
8597 (File_read::open): Use whole_file_view_ instead of contents_.
8598 (File_read::find_view): Use whole_file_view_ if applicable.
8599 (File_read::do_read): Use whole_file_view_ instead of contents_.
8600 (File_read::make_view): Use whole_file_view_ instead of contents_,
8601 update File_read::View::View call.
8602 (File_read::find_or_make_view): Update File_read::View::View
8603 call.
8604 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8605 remove contents_
8606 (File_read::View::Data_ownership): New enum.
8607 (File_read::View::View): Replace bool mapped_ with Data_ownership
8608 argument.
8609 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8610 (File_read::View::data_ownership_): New field.
8611 (File_read::contents_): Remove (replaced by whole_file_view_).
8612 (File_read::whole_file_view_): New field.
8613 * options.h (class General_options): Add --keep-files-mapped.
8614
24998053
CC
86152009-10-27 Cary Coutant <ccoutant@google.com>
8616
8617 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8618 * testsuite/Makefile.am (plugin_test_5): New test case.
8619 * testsuite/Makefile.in: Regenerate.
8620
72adc4fa
DK
86212009-10-25 Doug Kwan <dougkwan@google.com>
8622
8623 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8624 from private to protected to allow access by child class.
8625 (Sized_relobj::do_relocate_sections): New method declaration.
8626 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 8627 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
8628 Sized_relobj::relocate_sections. Instantiate template explicitly
8629 for different target sizes and endianity.
8630
07f508a2
DK
86312009-10-24 Doug Kwan <dougkwan@google.com>
8632
8633 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8634 (Arm_input_section::as_arm_input_section): New method.
8635 (Arm_output_section): New class definition.
8636 (Arm_output_section::create_stub_group,
8637 Arm_output_section::group_sections): New method definitions.
8638
10ad9fe5
DK
86392009-10-22 Doug Kwan <dougkwan@google.com>
8640
8641 * arm.cc (Arm_input_section): New class definition.
8642 (Arm_input_section::init, Arm_input_section:do_write,
8643 Arm_input_section::set_final_data_size,
8644 Arm_input_section::do_reset_address_and_file_offset): New method
8645 definitions.
8646
56ee5e00
DK
86472009-10-21 Doug Kwan <dougkwan@google.com>
8648
8649 * arm.cc (Stub_table, Arm_input_section): New forward class
8650 declarations.
8651 (Stub_table): New class defintion.
8652 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8653 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8654 New method definition.
8655
b569affa
DK
86562009-10-21 Doug Kwan <dougkwan@google.com>
8657
8658 * arm.cc: Update copyright comments.
8659 (Target_arm): New forward class template declaration.
8660 (Arm_address): New type.
8661 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8662 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8663 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8664 constants.
8665 (Insn_template): Same.
8666 (DEF_STUBS): New macro.
8667 (Stub_type): New enum type.
8668 (Stub_template): New class definition.
8669 (Stub): Same.
8670 (Reloc_stub): Same.
8671 (Stub_factory): Same.
8672 (Target_arm::Target_arm): Initialize may_use_blx_ and
8673 should_force_pic_veneer_.
8674 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8675 Target_arm::should_force_pic_veneer,
8676 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8677 Target_arm::using_thumb_only, Target_arm:;default_target): New
8678 method defintions.
8679 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8680 New data member declarations.
8681 (Insn_template::size, Insn_template::alignment): New method defintions.
8682 (Stub_template::Stub_template): New method definition.
8683 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8684 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8685 (Stub_factory::Stub_factory): New method definition.
8686 * gold.h (string_hash): New template.
8687 * output.h (Input_section_specifier::hash_value): Use
8688 gold::string_hash.
8689 (Input_section_specifier::string_hash): Remove.
8690 * stringpool.cc (Stringpool_template::string_hash): Use
8691 gold::string_hash.
8692
6c172549
DK
86932009-10-20 Doug Kwan <dougkwan@google.com>
8694
8695 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8696 symbols of relaxed input sections.
8697 * output.h (Output_section::find_relaxed_input_section): Make
8698 method public.
8699
c5617f2f
DK
87002009-10-16 Doug Kwan <dougkwan@google.com>
8701
8702 * dynobj.cc (Versions::Versions): Initialize version_script_.
8703 Only insert base version symbol definition for a shared object
8704 if version script defines any version versions.
8705 (Versions::define_base_version): New method definition.
8706 (Versions::add_def): Check that base version is not needed.
8707 (Versions::add_need): Define base version lazily.
8708 * dynobj.h (Versions::define_base_version): New method declaration.
8709 (Versions::needs_base_version_): New data member declaration.
8710 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8711 (check_DATA): Add no_version_test.stdout.
8712 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8713 New make rules.
8714 * testsuite/Makefile.in: Regenerate.
8715 * testsuite/no_version_test.c: New file.
8716 * testsuite/no_version_test.sh: Ditto.
8717
3c12dcdb
DK
87182009-10-16 Doug Kwan <dougkwan@google.com>
8719
8720 * expression.cc (class Segment_start_expression): New class definition.
8721 (Segment_start_expression::value): New method definition.
8722 (script_exp_function_segment_start): Return a new
8723 Segment_start_expression.
8724 * gold/script-c.h (script_saw_segment_start_expression): New function
8725 prototype.
8726 * script-sections.cc (Script_sections::Script_sections): Initialize
8727 SAW_SEGMENT_START_EXPRESSION_ to false.
8728 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8729 and -Tbbs options to specify section addresses if given in
8730 command line and no SEGMENT_START expression is seen in a script.
8731 * script-sections.h (Script_sections::saw_segment_start_expression,
8732 Script_sections::set_saw_segment_start_expression): New method
8733 definition.
8734 (Script_sections::saw_segment_start_expression_): New data member
8735 declaration.
8736 * script.cc (script_saw_segment_start_expression): New function.
8737 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8738 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8739 script_test_7.sh and script_test_8.sh.
8740 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8741 script_test_8.stdout.
8742 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8743 (script_test_6, script_test_6.stdout, script_test_7,
8744 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8745 * Makefile.in: Regenerate.
8746 * testsuite/script_test_6.sh: New file.
8747 * testsuite/script_test_6.t: Same.
8748 * testsuite/script_test_7.sh: Same.
8749 * testsuite/script_test_7.t: Same.
8750 * testsuite/script_test_8.sh: Same.
8751
64b1ae37
DK
87522009-10-16 Doug Kwan <dougkwan@google.com>
8753
8754 * output.cc (Output_segment::set_section_list_address): Cast
8755 expressions to unsigned long long type to avoid format warnings.
8756
661be1e2
ILT
87572009-10-15 Ian Lance Taylor <iant@google.com>
8758
12edd763 8759 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 8760 dot assignment to script_sections_.
12edd763
ILT
8761 * script-sections.cc (Script_sections::add_dot_assignment):
8762 Initialize if necessary.
8763
68b6574b
ILT
8764 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8765 program headers with no load segment if there is a linker script.
8766
661be1e2
ILT
8767 * layout.cc (Layout::set_segment_offsets): Align the file offset
8768 to the segment aligment for -N or -n with no load segment.
8769 * output.cc (Output_segment::add_output_section): Don't crash if
8770 the first section is a TLS section.
8771 (Output_segment::set_section_list_addresses): Print an error
8772 message if the address moves backward in a linker script.
8773 * script-sections.cc
8774 (Output_section_element_input::set_section_addresses): Don't
8775 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8776 (Orphan_output_section::set_section_addresses): Likewise.
8777
f15f61a7
DK
87782009-10-15 Doug Kwan <dougkwan@google.com>
8779
8780 * layout.cc (Layout::finish_dynamic_section): Generate tags
8781 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8782 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8783 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8784
82bb573a
ILT
87852009-10-14 Ian Lance Taylor <iant@google.com>
8786
8787 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8788 fields.
8789 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8790 data_shdr fields of relinfo.
8791 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8792 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8793 R_386_TLS_LDO_32, adjust based on section flags.
8794 (Target_i386::Relocate::fix_up_ldo): Remove.
8795
374ad285
ILT
87962009-10-13 Ian Lance Taylor <iant@google.com>
8797
8798 Add support for -pie.
8799 * options.h (class General_options): Add -pie and
8800 --pic-executable.
8801 (General_options::output_is_position_independent): Test -pie.
8802 (General_options::output_is_executable): Return true if not shared
8803 and not relocatable.
8804 (General_options::output_is_pie): Remove.
8805 * options.cc (General_options::finalize): Reject incompatible uses
8806 of -pie.
8807 * gold.cc (queue_middle_tasks): A -pie link is not static.
8808 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8809 * symtab.cc (Symbol::final_value_is_known): Return false if
8810 output_is_position_independent.
8811 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8812 output_is_position_independent.
8813 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8814 output_is_position_independent.
8815 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8816 output_is_position_independent.
8817 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8818 two_file_pie_test.
8819 (basic_pie_test.o, basic_pie_test): New targets.
8820 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8821 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8822 (two_file_pie_test): New target.
8823 * testsuite/Makefile.in: Rebuild.
8824 * README: Remove note saying that -pie is not supported.
8825
c6585162
ILT
88262009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8827
8828 * options.h (class General_options): Add -init and -fini.
8829 * layout.cc (Layout::finish_dynamic_section): Emit
8830 given init and fini functions.
8831
032ce4e9
ST
88322009-10-13 Sriraman Tallam <tmsriram@google.com>
8833
8834 * gc.h (gc_process_relocs): Check if icf is enabled using new
8835 function.
8836 * gold.cc (queue_initial_tasks): Likewise.
8837 (queue_middle_tasks): Likewise.
8838 * object.cc (do_layout): Likewise.
8839 * symtab.cc (is_section_folded): Likewise.
8840 * main.cc (main): Likewise.
8841 * reloc.cc (Read_relocs::run): Likewise.
8842 (Sized_relobj::do_scan_relocs): Likewise.
8843 * icf.cc (is_function_ctor_or_dtor): New function.
8844 (Icf::find_identical_sections): Check if function is ctor or dtor when
8845 safe icf is chosen.
8846 * options.h (General_options::icf): Change option to be an enum.
8847 (Icf_status): New enum.
8848 (icf_enabled): New method.
8849 (icf_safe_folding): New method.
8850 (set_icf_status): New method.
8851 (icf_status_): New variable.
8852 * (options.cc) (General_options::finalize): Set icf_status_.
8853 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8854 icf_test and icf_keep_unique_test to use the --icf enum flag.
8855 * testsuite/icf_safe_test.sh: New file.
e1df38aa 8856 * testsuite/icf_safe_test.cc: New file.
032ce4e9 8857
f345227a
ST
88582009-10-12 Sriraman Tallam <tmsriram@google.com>
8859
8860 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8861 includes to gc.h and icf.h.
8862 * arm.cc: Include gc.h.
8863 * gold.cc: Likewise.
8864 * i386.cc: Likewise.
8865 * powerpc.cc: Likewise.
8866 * sparc.cc: Likewise.
8867 * x86_64.cc: Likewise.
8868 * gc.h: Include icf.h.
8869
1c7814ed
ILT
88702009-10-11 Ian Lance Taylor <iant@google.com>
8871
8872 * plugin.cc: Include "gold.h" before other header files.
8873
ae3b5189
CD
88742009-10-10 Chris Demetriou <cgd@google.com>
8875
8876 * options.h (Input_file_argument::Input_file_type): New enum.
8877 (Input_file_argument::is_lib_): Replace with...
8878 (Input_file_argument::type_): New member.
8879 (Input_file_argument::Input_file_argument): Take Input_file_type
8880 'type' rather than boolean 'is_lib' as second argument.
8881 (Input_file_argument::is_lib): Use type_.
8882 (Input_file_argument::is_searched_file): New function.
8883 (Input_file_argument::may_need_search): Handle is_searched_file.
8884 * options.cc (General_options::parse_library): Support -l:filename.
8885 (General_options::parse_just_symbols): Update for Input_file_argument
8886 changes.
8887 (Command_line::process): Likewise.
8888 * archive.cc (Archive::get_file_and_offset): Likewise.
8889 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8890 * script.cc (read_script_file, script_add_file): Likewise.
8891 * fileread.cc (Input_file::Input_file): Likewise.
8892 (Input_file::will_search_for): Handle is_searched_file.
8893 (Input_file::open): Likewise.
8894 * readsyms.cc (Read_symbols::get_name): Likewise.
8895 * testsuite/Makefile.am (searched_file_test): New test.
8896 * testsuite/Makefile.in: Regenerate.
8897 * testsuite/searched_file_test.cc: New file.
8898 * testsuite/searched_file_test_lib.cc: New file.
8899
f3048a1d
ILT
89002009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8901 Ian Lance Taylor <iant@google.com>
8902
8903 * descriptor.cc: Include <cstdio> and "binary-io.h".
8904 (Descriptors::open): Open the files in binary mode always.
8905 * script.cc (Lex::get_token): Treat \r as whitespace.
8906
d4780e57
ILT
89072009-10-09 Ian Lance Taylor <iant@google.com>
8908
8909 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8910
d9a893b8
ILT
89112009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8912 Ian Lance Taylor <iant@google.com>
8913
8914 * configure.ac: Check for readv function also.
8915 * fileread.cc (readv): Define if not HAVE_READV.
8916 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8917 does not exist.
8918 * config.in: Regenerate.
8919 * configure: Regenerate.
8920
c0a62865
DK
89212009-10-09 Doug Kwan <dougkwan@google.com>
8922
8923 * layout.cc (Layout::make_output_section): Call target hook to make
8924 ordinary output section.
8925 (Layout::finalize): Adjust parameter list of call the
8926 Target::may_relax().
8927 * layout.h (class Layout::section_list): New method.
8928 * merge.h (Output_merge_base::entsize): Change visibility to public.
8929 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8930 New methods.
8931 (Output_merge_string::do_is_string): New method.
8932 * object.cc (Sized_relobj::do_setup): renamed from
8933 Sized_relobj::set_up.
8934 * object.h (Sized_relobj::adjust_shndx,
8935 Sized_relobj::initializ_input_to_output_maps,
8936 Sized_relobj::free_input_to_output_maps): Change visibilities to
8937 protected.
8938 (Sized_relobj::setup): Virtualize.
8939 (Sized_relobj::do_setup): New method declaration.
8940 (Sized_relobj::invalidate_section_offset,
8941 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8942 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8943 * options.cc (parse_int): New function.
8944 * options.h (parse_int): New declaration.
8945 (DEFINE_int): New macro.
8946 (stub_group_size): New option.
8947 * output.cc (Output_section::Output_section): Initialize memebers
8948 merge_section_map_, merge_section_by_properties_map_,
8949 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8950 (Output_section::add_input_section): Handled deferred code-fill
8951 generation and remove an old comment.
8952 (Output_section::add_relaxed_input_section): New method definition.
8953 (Output_section::add_merge_input_section): Use merge section by
8954 properties map to speed to search. Update merge section maps
8955 as appropriate.
8956 (Output_section::build_relaxation_map): New method definition.
8957 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8958 Same.
8959 (Output_section::relax_input_section): Renamed to
8960 Output_section::convert_input_sections_to_relaxed_sections and change
8961 interface to take a vector of pointers to relaxed sections.
8962 (Output_section::find_merge_section,
8963 Output_section::find_relaxed_input_section): New method definitions.
8964 (Output_section::is_input_address_mapped,
8965 Output_section::output_offset, Output_section::output_address):
8966 Use output section data maps to speed up searching.
8967 (Output_section::find_starting_output_address): Add comments.
8968 (Output_section::do_write,
8969 Output_section::write_to_postprocessing_buffer): Do code-fill
8970 generation as appropriate.
8971 (Output_section::get_input_sections): Invalidate relaxed input section
8972 map.
8973 (Output_section::restore_states): Adjust type of checkpoint .
8974 Invalidate relaxed input section map.
8975 * output.h (Output_merge_base): New class declaration.
8976 (Input_section_specifier): New class defintion.
8977 (class Output_relaxed_input_section) Change base class to
8978 Output_section_data_build.
8979 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8980 base class initializer.
8981 (Output_section::add_relaxed_input_section): New method declaration.
8982 (Output_section::Input_section): Change visibility to protected.
2e702c99 8983 (Output_section::Input_section::relobj,
c0a62865
DK
8984 Output_section::Input_section::shndx): Handle relaxed input sections.
8985 Output_section::input_sections) Change visibility to protected. Also
8986 define overload to return a non-const pointer.
8987 (Output_section::Merge_section_properties): New class defintion.
8988 (Output_section::Merge_section_by_properties_map,
8989 Output_section::Output_section_data_by_input_section_map,
8990 Output_section::Relaxation_map): New types.
8991 (Output_section::relax_input_section): Rename method to
8992 Output_section::convert_input_sections_to_relaxed_sections and change
8993 interface to take a vector of relaxed section pointers.
8994 (Output_section::find_merge_section,
8995 Output_section::find_relaxed_input_section,
8996 Output_section::build_relaxation_map,
8997 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8998 New method declarations.
8999 (Output_section::merge_section_map_
9000 Output_section::merge_section_by_properties_map_,
9001 Output_section::relaxed_input_section_map_,
9002 Output_section::is_relaxed_input_section_map_valid_,
9003 Output_section::generate_code_fills_at_write_): New data members.
9004 * script-sections.cc
9005 (Output_section_element_input::set_section_addresses): Call
9006 current_data_size and addralign methods of relaxed input sections.
9007 (Orphan_output_section::set_section_addresses): Call current_data_size
9008 and addralign methods of relaxed input sections.
9009 * symtab.cc (Symbol_table::compute_final_value): Extract template
9010 from the body of Symbol_table::sized_finalize_symbol.
9011 (Symbol_table::sized_finalized_symbol): Call
9012 Symbol_table::compute_final_value.
9013 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
9014 (Symbol_table::compute_final_value): New templated method declaration.
9015 * target.cc (Target::do_make_output_section): New method defintion.
9016 * target.h (Target::make_output_section): New method declaration.
9017 (Target::relax): Add more parameters for input objects, symbol table
9018 and layout. Adjust call to do_relax.
9019 (Target::do_make_output_section): New method declaration.
9020 (Target::do_relax): Add parameters for input objects, symbol table
9021 and layout.
9022
d446d6c4
ILT
90232009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9024
9025 * pread.c: Include stdio.h.
9026
bc06c745
ILT
90272009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9028
9029 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
9030 defined.
9031
75aea3d0
ILT
90322009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9033
9034 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9035 Change read_shndx type to unsigned int.
9036 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9037 int.
9038 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9039 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
9040 Change read_shndx type to unsigned int.
9041 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9042 int.
9043 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9044 * layout.cc (Layout::create_symtab_sections): Cast the result of
9045 local_symcount * symsize to off_t in the gold_assert.
9046
be8fcb75
ILT
90472009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9048
9049 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
9050 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
9051 R_ARM_BASE_ABS.
9052 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
9053 (Arm_relocate_functions::thm_abs5): New function.
9054 (Arm_relocate_functions::abs12): New function.
9055 (Arm_relocate_functions::abs16): New function.
9056 (Arm_relocate_functions::base_abs): New function.
9057 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
9058 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
9059 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
9060 R_ARM_BASE_ABS.
9061 (Scan::global): Likewise.
9062 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
9063 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
9064 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
9065 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9066 R_ARM_BASE_ABS.
9067
c2a122b6
ILT
90682009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9069
9070 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
9071 (Arm_relocate_functions::movt_prel): New function.
9072 (Arm_relocate_functions::thm_movw_prel_nc): New function.
9073 (Arm_relocate_functions::thm_movt_prel): New function.
9074 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
9075 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
9076 (Scan::global, Relocate::relocate): Likewise.
9077 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9078
c4aa1e2d
ILT
90792009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9080
9081 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
9082 Incremental_checker.
9083 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
9084 unsigned int.
9085 (class Incremental_inputs_header): New class.
9086 (Incremental_inputs_header_writer): Edit comment.
9087 (Incremental_inputs_entry): New class.
9088 (Incremental_inputs_entry_writer): Edit comment.
9089 (Sized_incremental_binary::do_find_incremental_inputs_section):
9090 Add *strtab_shndx parameter, fill it.
9091 (Sized_incremental_binary::do_check_inputs): New method.
9092 (Incremental_checker::can_incrementally_link_output_file): Use
9093 Sized_incremental_binary::check_inputs.
9094 (Incremental_inputs::report_command_line): Save command line in
9095 command_line_.
9096 * incremental.h:
9097 (Incremental_binary::find_incremental_inputs_section): New
9098 method.
9099 (Incremental_binary::do_find_incremental_inputs_section): Add
9100 strtab_shndx parameter.
9101 (Incremental_binary::do_check_inputs): New pure virtual method.
9102 (Sized_incremental_binary::do_check_inputs): Declare.
9103 (Incremental_checker::Incremental_checker): Add incremental_inputs
9104 parameter, use it to initialize incremental_inputs_.
9105 (Incremental_checker::incremental_inputs_): New field.
9106 (Incremental_checker::command_line): New method.
9107 (Incremental_checker::inputs): New method.
9108 (Incremental_checker::command_line_): New field.
9109
c549a694
ILT
91102009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9111
9112 * incremental.cc: Include <cstdarg> and "target-select.h".
9113 (vexplain_no_incremental): New function.
9114 (explain_no_incremental): New function.
9115 (Incremental_binary::error): New method.
9116 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9117 method.
9118 (make_sized_incremental_binary): New function.
9119 (open_incremental_binary): New function.
9120 (can_incrementally_link_file): Add checks if output is ELF and has
9121 inputs section.
9122 * incremental.h: Include "elfcpp_file.h" and "output.h".
9123 (Incremental_binary): New class.
9124 (Sized_incremental_binary): New class.
9125 (open_incremental_binary): Declare.
9126 * object.cc (is_elf_object): Use
9127 elfcpp::Elf_recognizer::is_elf_file.
9128 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9129 * output.h (Output_file::filesize): New method.
9130
fd3c5f0b
ILT
91312009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9132
9133 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9134 New function.
9135 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9136 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9137 function.
9138 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9139 function.
9140 (Arm_relocate_functions::movw_abs_nc): New function.
9141 (Arm_relocate_functions::movt_abs): New function.
9142 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9143 (Arm_relocate_functions::thm_movt_abs): New function.
9144 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9145 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9146 (Scan::global): Likewise.
9147 (Relocate::relocate): Likewise.
9148 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9149
7f5309a5
ILT
91502009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9151
9152 * arm.cc (Arm_relocate_functions::got_prel) New function.
9153 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9154 (Relocate::relocate): Likewise.
9155 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9156
364c7fa5
ILT
91572009-10-06 Ian Lance Taylor <iant@google.com>
9158
9159 * options.h (class General_options): Define
9160 split_stack_adjust_size parameter.
9161 * object.h (class Object): Add uses_split_stack_ and
9162 has_no_split_stack_ fields. Add uses_split_stack and
9163 has_no_split_stack accessor functions. Declare
9164 handle_split_stack_section.
9165 (class Reloc_symbol_changes): Define.
9166 (class Sized_relobj): Define Function_offsets. Declare
9167 split_stack_adjust, split_stack_adjust_reltype, and
9168 find_functions.
9169 * object.cc (Object::handle_split_stack_section): New function.
9170 (Sized_relobj::do_layout): Call handle_split_stack_section.
9171 * dynobj.cc (Sized_dynobj::do_layout): Call
9172 handle_split_stack_section.
9173 * reloc.cc (Sized_relobj::relocate_sections): Call
9174 split_stack_adjust for executable sections in split_stack
9175 objects. Pass reloc_map to relocate_section.
9176 (Sized_relobj::split_stack_adjust): New function.
9177 (Sized_relobj::split_stack_adjust_reltype): New function.
9178 (Sized_relobj::find_functions): New function.
9179 * target-reloc.h: Include "object.h".
9180 (relocate_section): Add reloc_symbol_changes parameter. Change
9181 all callers.
9182 * target.h (class Target): Add calls_non_split method. Declare
9183 do_calls_non_split virtual method. Declare match_view and
9184 set_view_to_nop.
9185 * target.cc: Include "elfcpp.h".
9186 (Target::do_calls_non_split): New function.
9187 (Target::match_view): New function.
9188 (Target::set_view_to_nop): New function.
9189 * gold.cc (queue_middle_tasks): Give an error if mixing
9190 split-stack and non-split-stack objects with -r.
9191 * i386.cc (Target_i386::relocate_section): Add
9192 reloc_symbol_changes parameter.
9193 (Target_i386::do_calls_non_split): New function.
9194 * x86_64.cc (Target_x86_64::relocate_section): Add
9195 reloc_symbol_changes parameter.
9196 (Target_x86_64::do_calls_non_split): New function.
9197 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9198 parameter.
9199 * powerpc.cc (Target_powerpc::relocate_section): Add
9200 reloc_symbol_changes parameter.
9201 * sparc.cc (Target_sparc::relocate_section): Add
9202 reloc_symbol_changes parameter.
9203 * configure.ac: Call AM_CONDITIONAL for the default target.
9204 * configure: Rebuild.
9205 * testsuite/Makefile.am (TEST_AS): New variable.
9206 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9207 (check_DATA): Add split_i386 and split_x86_64 files.
9208 (SPLIT_DEFSYMS): Define.
9209 (split_i386_[1234n].o): New targets.
9210 (split_i386_[124]): New targets.
9211 (split_i386_[1234r].stdout): New targets.
9212 (split_x86_64_[1234n].o): New targets.
9213 (split_x86_64_[124]): New targets.
9214 (split_x86_64_[1234r].stdout): New targets.
9215 (MOSTLYCLEANFILES): Add new executables.
9216 * testsuite/split_i386.sh: New file.
9217 * testsuite/split_x86_64.sh: New file.
9218 * testsuite/split_i386_1.s: New file.
9219 * testsuite/split_i386_2.s: New file.
9220 * testsuite/split_i386_3.s: New file.
9221 * testsuite/split_i386_4.s: New file.
9222 * testsuite/split_i386_n.s: New file.
9223 * testsuite/split_x86_64_1.s: New file.
9224 * testsuite/split_x86_64_2.s: New file.
9225 * testsuite/split_x86_64_3.s: New file.
9226 * testsuite/split_x86_64_4.s: New file.
9227 * testsuite/split_x86_64_n.s: New file.
9228 * testsuite/testfile.cc (Target_test): Update relocation_section
9229 function.
9230 * testsuite/Makefile.in: Rebuild.
9231
e8a9fcda
ILT
92322009-10-06 Ian Lance Taylor <iant@google.com>
9233
9234 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9235 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9236 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9237 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9238 the address on ldo_addrs_.
9239 (Target_i386::Relocate::fix_up_ldo): New function.
9240
e99daf92
ILT
92412009-10-06 Rafael Espindola <espindola@google.com>
9242
9243 * plugin.cc (add_input_library): New.
9244 (Plugin::load): Add add_input_library to tv.
9245 (Plugin_manager::add_input_file): Add the is_lib argument.
9246 (add_input_file): Update call to Plugin_manager::add_input_file.
9247 (add_input_library): New.
9248 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9249
966d4097
DK
92502009-09-30 Doug Kwan <dougkwan@google.com>
9251
9252 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9253 symbol and call Symbol::may_need_copy_reloc to determine if
9254 a copy reloc is needed.
9255 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9256 nocopyreloc is given in command line.
9257 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9258 given in command line.
9259 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9260 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9261 of the removed Target_i386::may_need_copy_reloc.
9262 * options.h (copyreloc): New option with default value false.
9263 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9264 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9265 instead of the removed Target_powerpc::may_need_copy_reloc.
9266 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9267 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9268 instead of the removed Target_sparc::may_need_copy_reloc.
9269 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9270 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9271 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9272 instead of the removed Target_x86_64::may_need_copy_reloc.
9273
029ba973
ILT
92742009-09-30 Ian Lance Taylor <iant@google.com>
9275
9276 * object.h (class Object): Remove target_ field, and target,
9277 sized_target, and set_target methods.
9278 (Object::sized_target): Remove.
9279 (class Sized_relobj): Update declarations. Remove sized_target.
9280 * object.cc (Sized_relobj::setup): Remove target parameter.
9281 Change all callers.
9282 (Input_objects::add_object): Don't do anything with the target.
9283 (make_elf_sized_object): Add punconfigured parameter. Change all
9284 callers. Set or test parameter target.
9285 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9286 Change all callers.
9287 * parameters.cc (Parameters::set_target): Change parameter type to
9288 be non-const.
9289 (Parameters::default_target): Remove.
9290 (set_parameters_target): Change parameter type to be non-const.
9291 (parameters_force_valid_target): New function.
9292 (parameters_clear_target): New function.
9293 * parameters.h (class Parameters): Update declarations. Remove
9294 default_target method. Add sized_target and clear_target
9295 methods. Change target_ to be non-const.
9296 (set_parameters_target): Update declaration.
9297 (parameters_force_valid_target): Declare.
9298 (parameters_clear_target): Declare.
9299 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9300 as NULL if we aren't searching.
9301 (Add_symbols::run): Don't check for compatible target.
9302 * fileread.cc (Input_file::open_binary): Call
9303 parameters_force_valid_target.
9304 * gold.cc (queue_middle_tasks): Likewise.
9305 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9306 set_target on object.
9307 * dynobj.h (class Sized_dynobj): Update declarations.
9308 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9309 make_elf_object returns NULL.
9310 (Archive::include_member): Don't check whether object target is
9311 compatible.
9312 * output.cc (Output_section::add_input_section): Get target from
9313 parameters.
9314 (Output_section::relax_input_section): Likewise.
9315 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9316 parameters.
9317 (Sized_relobj::do_scan_relocs): Likewise.
9318 (Sized_relobj::relocate_sections): Likewise.
9319 * resolve.cc (Symbol_table::resolve): Likewise.
9320 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9321 parameter. Change all callers.
9322 (Symbol_table::add_from_object): Get target from parameters.
9323 (Symbol_table::add_from_relobj): Don't check object target.
9324 (Symbol_table::add_from_dynobj): Likewise.
9325 (Symbol_table::define_special_symbol): Get target from
9326 parameters.
9327 * symtab.h (class Symbol_table): Update declaration.
9328 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9329 parameter. Change all callers. Clear parameter target.
9330 (Binary_test): Test target here.
9331 * testsuite/object_unittest.cc (gold_testsuite): Remove
9332 target_test_pointer parameter. Change all callers.
9333 (Object_test): Test target here.
9334
a6a22b83
ILT
93352009-09-26 Ian Lance Taylor <iant@google.com>
9336
9337 * testsuite/initpri1.c: Don't try to use constructor priorities if
9338 compiling with gcc before 4.3.
9339
6a8f49fe
ILT
93402009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9341
9342 * testsuite/retain_symbols_file_test.sh (check_present): Change
9343 output file name to retain_symbols_file_test.stdout.
9344 (check_absent): Likewise.
9345
8c604651
CS
93462009-09-18 Craig Silverstein <csilvers@google.com>
9347
9348 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9349 * options.cc: Include <cerrno> and <fstream>.
9350 (General_options::finalize): Parse -retain-symbols-file tag.
9351 * options.h: New flag.
9352 (General_options): New method should_retain_symbol, new
9353 variable symbols_to_retain.
9354 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9355 should_retain_symbol map.
9356 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9357 * testsuite/Makefile.in: Regenerate.
9358 * testsuite/retain_symbols_file_test.sh: New file.
9359
ca58b19f
NC
93602009-09-18 Nick Clifton <nickc@redhat.com>
9361
9362 * po/es.po: Updated Spanish translation.
9363
20e6d0d6
DK
93642009-09-17 Doug Kwan <dougkwan@google.com>
9365
9366 * debug.h (DEBUG_RELAXATION): New constant.
9367 (DEBUG_ALL): Add DEBUG_RELAXATION.
9368 (debug_string_to_enum): Add relaxation debug option.
9369 * layout.cc
9370 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9371 Layout::Relaxation_debug_check::read_sections,
9372 Layout::Relaxation_debug_check::read_sections): New method definitions.
9373 (Layout::Layout): Initialize data members
9374 record_output_section_data_from_scrips_,
9375 script_output_section_data_list_ and relaxation_debug_check_.
9376 (Layout::save_segments, Layout::restore_segments,
9377 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9378 Layout::relaxation_loop_body): New method definitions.
9379 (Layout::finalize): Support relaxation. Move section layout code to
9380 Layout::relaxation_loop_body.
9381 (Layout::set_asection_address_from_script): Move code for orphan
9382 section placement out.
9383 (Layout::place_orphan_sections_in_script): New method definition.
9384 * layout.h (Output_segment_headers, Output_file_header):
9385 New forward class declarations.
9386 (Layout::~Layout): Define.
9387 (Layout::new_output_section_data_from_script): New method definition.
9388 (Layout::place_orphan_sections_in_script): New method declaration.
9389 (Layout::Segment_states): New type declaration.
9390 (Layout::save_segments, Layout::restore_segments,
9391 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9392 Layout::relaxation_loop_body): New method declarations.
9393 (Layout::Output_section_data_list): New type declaration.
9394 (Layout::Relaxation_debug_check): New class definition.
9395 (Layout::record_output_section_data_from_script_,
9396 Layout::script_output_section_data_list_, Layout::segment_states_,
9397 Layout::relaxation_debug_check_): New data members.
9398 * output.cc: (Output_section_headers::do_size): New method definition.
9399 (Output_section_headers::Output_section_headers): Move size
9400 computation to Output_section_headers::do_size.
9401 (Output_segment_headers::do_size): New method definition.
e1df38aa 9402 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
9403 Output_file_header::do_size and call it.
9404 (Output_file_header::do_size): New method definition.
9405 (Output_data_group::Output_data_group): Adjust call to
9406 Output_section_data.
9407 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9408 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 9409 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
9410 RELAXED_INPUT_SECTION_CODE.
9411 (Output_section::Output_section): Initialize data member checkpoint_.
9412 (Output_section::~Output_section): Delete checkpoint object pointed
9413 by checkpoint_.
9414 (Output_section::add_input_section): Always add an Input_section if
9415 relaxing.
9416 (Output_section::add_merge_input_section): Add assert.
9417 (Output_section::relax_input_section): New method definition.
9418 (Output_section::set_final_data_size): Set load address to zero for
9419 an unallocated section.
9420 (Output_section::do_address_and_file_offset_have_reset_values):
9421 New method definition.
9422 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9423 Handle relaxed input section.
9424 (Output_section::sort_attached_input_sections): Checkpoint input
9425 section list lazily.
9426 (Output_section::get_input_sections): Change type of input_sections to
9427 list of Simple_input_section pointers. Checkpoint input section list
9428 lazily. Also handle relaxed input sections.
9429 (Output_section::add_input_section_for_script): Take a reference to
9430 a Simple_input_section object instead of Relobj pointer and section
9431 index as parameter. Handle relaxed input sections.
9432 (Output_section::save_states, Output_section::restore_states): New
9433 method definitions.
9434 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9435 (Output_data::is_data_size_fixed): New method definition.
9436 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9437 if it is fixed.
9438 (Output_data::address_and_file_offset_have_reset_values): New method
9439 definition.
9440 (Output_data::do_address_and_file_offset_have_reset_values): New method
9441 definition.
9442 (Output_data::set_data_size): Check that data size is not fixed.
9443 (Output_data::fix_data_size): New method definition.
9444 (Output_data::is_data_size_fixed_): New data member.
9445 (Output_section_headers::set_final_data_size): New method definition.
9446 (Output_section_headers::do_size): New method declaration.
9447 (Output_segment_headers::set_final_data_size): New method definition.
9448 (Output_segment_headers::do_size): New method declaration.
9449 (Output_file_header::set_final_data_size)::New method definition.
9450 (Output_file_header::do_size)::New method declaration.
9451 (Output_section_data::Output_section_data): Add new parameter
9452 is_data_size_fixed and use it to fix data size.
9453 (Output_data_const::Output_data_const): Adjust call to base class
9454 constructor and fix data size.
9455 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9456 base class constructor and fix data size.
9457 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9458 base class constructor and fix data size.
9459 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9460 class constructor and fix data size.
9461 (Output_data_group::set_final_data_size): New method definition.
9462 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9463 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9464 class constructor and fix data size.
9465 (Output_relaxed_input_section): New class definition.
9466 (Output_section::Simple_input_section): New class definition.
9467 (Output_section::get_input_sections): Adjust parameter list.
9468 (Output_section::add_input_section_for_script): Same.
9469 (Output_section::save_states, Output_section::restore_states,
9470 Output_section::do_address_and_file_offset_have_reset_values,
9471 (Output_section::Input_section::Input_section): Handle
9472 RELAXED_INPUT_SECTION_CODE. Add new overload for
9473 Output_relaxed_input_section.
9474 (Output_section::Input_section::is_input_section,
9475 Output_section::Input_section::set_output_section): Handle relaxed
9476 input section.
9477 (Output_section::Input_section::is_relaxed_input_section,
9478 Output_section::Input_section::output_section_data,
9479 Output_section::Input_section::relaxed_input_section): New method
9480 definitions.
9481 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9482 value.
9483 (Output_section::Input_section::u1_): Update comments.
9484 (Output_section::Input_section::u2_): Add new union member poris.
9485 (Output_section::Checkpoint_output_section): New classs definition.
9486 (Output_section::relax_input_section): New method declaration.
9487 (Output_section::checkpoint_): New data member.
9488 (Output_segment): Update comments.
9489 (Output_segment::Output_segment): Un-privatize copy constructor.
9490 (Output_segment::operator=): Un-privatize.
9491 * script-sections.cc (Output_section_element::Input_section_list):
9492 Change element type to Output_section::Simple_input_section.
9493 (Output_section_element_dot_assignment::set_section_addresses):
9494 Register output section data for relaxation clean up.
9495 (Output_data_exression::Output_data_expression): Adjust call to base
9496 constructor to fix data size.
9497 (Output_section_element_data::set_section_addresses): Register
9498 Output_data_expression object for relaxation clean up.
9499 (struct Input_section_info): Replace Relobj pointer and section index
9500 pair with Output_section::Simple_input_section and Convert struct to a
9501 class.
9502 (Input_section_sorter::operator()): Adjust access to
e1df38aa 9503 Input_section_info data member to use accessors.
20e6d0d6
DK
9504 (Output_section_element_input::set_section_addresses): Use layout
9505 parameter. Adjust code to use Output_section::Simple_input_section
9506 and Input_secction_info classes. Register filler for relaxation
9507 clean up.
9508 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9509 and section index pair with Output_section::Simple_input_section
9510 class. Adjust code accordingly.
9511 (Phdrs_element::release_segment): New method definition.
9512 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9513 segment list.
9514 (Script_sections::release_segments): New method definition.
9515 * gold/script-sections.h (Script_sections::release_segments): New
9516 method declaration.
9517 * gold/target.h (Target::may_relax, Target::relax,
9518 Target::do_may_relax, Target::do_relax): New method definitions.
9519
5e445df6
ILT
95202009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9521
9522 * arm.cc (has_signed_unsigned_overflow): New function.
9523 (Arm_relocate_functions::abs8): New function.
9524 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9525 (Target_arm::Scan::global): Likewise.
9526 (Target_arm::relocate::relocate): Likewise.
9527 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9528 Likewise.
9529
8c604651 95302009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
9531
9532 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9533 * testsuite/Makefile.in: Regenerate.
9534
1e9cc1c2
NC
95352009-09-11 Nick Clifton <nickc@redhat.com>
9536
9537 * po/gold.pot: Updated by the Translation project.
9538
6a89f575
CC
95392009-09-08 Cary Coutant <ccoutant@google.com>
9540
9541 * output.cc (Output_file::open): Add execute permission to empty file.
9542 * testsuite/Makefile.am (permission_test): New test.
9543 * testsuite/Makefile.in: Regenerate.
9544
fdcac5af
ILT
95452009-09-02 Ian Lance Taylor <iant@google.com>
9546
9547 * output.cc (Output_file::resize): Call map_no_anonymous rather
9548 than map.
9549
44453f85
ILT
95502009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9551
9552 * gold.cc: Include "incremental.h".
9553 (queue_initial_tasks): Call Incremental_checker methods.
9554 * incremental.cc: Include "output.h".
9555 (Incremental_checker::can_incrementally_link_output_file): New
9556 method.
9557 * incremental.h (Incremental_checker): New class.
9558
9559 * output.cc (Output_file::open_for_modification): New method.
9560 (Output_file::map_anonymous): Changed return type to bool. Record
9561 map in base_ field.
9562 (Output_file::map_no_anonymous): New method, broken out of map.
9563 (Output_file::map): Use map_no_anonymous and map_anonymous.
9564 * output.h (class Output_file): Update declarations.
9565
293c1386
CC
95662009-08-24 Cary Coutant <ccoutant@google.com>
9567
9568 * options.h (Command_line::Pre_options): New class.
9569 (Command_line::pre_options): New member.
9570 * options.cc (gold::options::ready_to_register): New variable.
9571 (One_option::register_option): Do nothing if not registering options.
9572 Assert if same short option registered twice.
9573 (General_options::General_options): Turn off option registration when
9574 done constructing.
9575 (Command_line::Pre_options::Pre_options): New constructor.
9576
f773f3d2
CC
95772009-08-24 Cary Coutant <ccoutant@google.com>
9578
06a73cfe
CC
9579 * options.h (General_options::no_keep_memory): Remove incorrect
9580 short option.
f773f3d2 9581
a15af8e2
RW
95822009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9583
9584 * Makefile.am (am__skiplex, am__skipyacc): New.
9585 * Makefile.in: Regenerate.
9586
c462b41b
RW
95872009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9588
14ec8efd
RW
9589 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9590 (INCLUDES): ... this.
9591 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9592 (AM_CPPFLAGS): Renamed from ...
9593 (INCLUDE): ... this.
9594 * Makefile.in, testsuite/Makefile.in: Regenerate.
9595
81ecdfbb
RW
9596 * Makefile.in: Regenerate.
9597 * aclocal.m4: Likewise.
9598 * config.in: Likewise.
9599 * configure: Likewise.
9600 * testsuite/Makefile.in: Likewise.
9601
c462b41b
RW
9602 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9603 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9604 * Makefile.in: Regenerate.
9605 * testsuite/Makefile.in: Regenerate.
9606
2da73f13
CC
96072009-08-19 Cary Coutant <ccoutant@google.com>
9608
9609 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9610 symbols in shared libraries overridden by hidden or internal symbols
9611 in the main program.
9612
2db70501
CD
96132009-08-19 Chris Demetriou <cgd@google.com>
9614
9615 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9616 checking source file names in error messages.
9617
f733487b
DK
96182009-08-18 Doug Kwan <dougkwan@google.com>
9619
9620 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9621 an elcpp::Ehdr as parameter. Adjust call to set_target.
9622 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9623 an elfcpp::Ehdr as parameter.
9624 * object.cc (Object::set_target): Remove the version that looks up
9625 a target and sets it.
9626 (Sized_relobj::setup): Take a Target object instead of
9627 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9628 (make_elf_sized_object): Find target and ask target to
9629 make an ELF object.
9630 * object.h: (Object::set_target): Remove the version that looks up
9631 a target and sets it.
9632 (Sized_relobj::setup): Take a Target object instead of
9633 an elfcpp:Ehdr as parameter.
9634 * target.cc: Include dynobj.h.
9635 (Target::do_make_elf_object_implementation): New.
2e702c99 9636 (Target::do_make_elf_object): New.
f733487b
DK
9637 * target.h (Target::make_elf_object): New template declaration.
9638 (Target::do_make_elf_object): New method declarations.
9639 (Target::do_make_elf_object_implementation): New template declaration.
9640
cc70f101
ILT
96412009-08-14 Ian Lance Taylor <iant@google.com>
9642
9643 * gold.h (FUNCTION_NAME): Define.
9644 (gold_unreachable): Use FUNCTION_NAME.
9645
ef5e0cb1
ST
96462009-08-12 Sriraman Tallam <tmsriram@google.com>
9647
9648 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9649 symbol in the --keep-unique list is not found.
9650
48c187ce
ST
96512009-08-12 Sriraman Tallam <tmsriram@google.com>
9652
9653 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9654 been maked as --keep-unique.
9655 (Icf::unfold_section): New function.
9656 * icf.h (Icf::unfold_section): New function.
9657 * options.h (General_options::keep_unique): New option.
9658 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9659 * testsuite/Makefile.in: Regenerate.
9660 * testsuite/icf_keep_unique_test.sh: New file.
9661 * testsuite/icf_keep_unique_test.cc: New file.
9662
645afe0c
CC
96632009-08-12 Cary Coutant <ccoutant@google.com>
9664
9665 PR 10471
9666 * resolve.cc (Symbol_table::resolve): Check for references from
9667 dynamic objects to hidden and internal symbols.
9668 * testsuite/Makefile.am (hidden_test.sh): New test.
9669 * testsuite/Makefile.in: Regenerate.
9670 * testsuite/hidden_test.sh: New script.
9671 * testsuite/hidden_test_1.c: New test source.
9672 * testsuite/hidden_test_main.c: New test source.
9673
11af873f
DK
96742009-08-11 Doug Kwan <dougkwan@google.com>
9675
9676 * arm.cc: Update comments.
9677 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9678 segment to locate the .ARM.exidx section if present.
9679
b9f7d72d
DK
96802009-08-09 Doug Kwan <dougkwan@google.com>
9681
9682 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9683 patch.
9684
ddd3c53c
ST
96852009-08-07 Sriraman Tallam <tmsriram@google.com>
9686 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9687 compiler warnings.
9688
27721062
ST
96892009-08-06 Sriraman Tallam <tmsriram@google.com>
9690
9691 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9692 valid tls_segment only for non-debug-section relocations.
9693 * testsuite/Makefile.am: Add gc_tls_test.
9694 * testsuite/Makefile.in: Regenerate.
9695 * testsuite/gc_tls_test.cc: New file.
9696 * testsuite/gc_tls_test.sh: New file.
9697
ef15dade 96982009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 9699
ef15dade
ST
9700 * icf.cc: New file.
9701 * icf.h: New file.
9702 * Makefile.am (CCFILES): Add icf.cc.
9703 (HFILES): Add icf.h
9704 * Makefile.in: Regenerate.
9705 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9706 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9707 section, symbol and addend information for the relocs.
9708 * gold.cc (queue_middle_tasks): Call identical code folding.
9709 * gold.h: Add defines for multimap.
9710 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9711 to the call of finalize_local_symbols.
9712 * main.cc (main): Create object of class Icf.
9713 * object.cc (Sized_relobj::do_layout): Allow this function to be
9714 called twice during icf.
9715 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9716 to sections marked as identical by icf.
9717 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9718 when available.
9719 (Sized_relobj::do_section_entsize): New function.
9720 * object.h (Object::section_entsize): New function.
9721 (Object::do_section_entsize): New pure virtual function.
9722 (Relobj::finalize_local_symbols): Add new parameter.
9723 (Relobj::do_section_entsize): New function.
9724 * options.h (General_options::icf): New option.
9725 (General_options::icf_iterations): New option.
9726 (General_options::print_icf_sections): New option.
9727 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9728 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9729 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9730 icf.
9731 * symtab.cc (Symbol_table::is_section_folded): New function.
9732 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9733 to sections marked as identical by icf.
9734 * symtab.h (Symbol_table::set_icf): New function.
9735 (Symbol_table::icf): New function.
9736 (Symbol_table::is_section_folded): New function.
9737 (Symbol_table::icf_): New data member.
9738 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9739 * testsuite/Makefile.am: Add commands to build icf_test.
9740 * testsuite/Makefile.in: Regenerate.
9741 * testsuite/icf_test.sh: New file.
9742 * testsuite/icf_test.cc: New file.
9743
c3b65ac4
CD
97442009-07-24 Chris Demetriou <cgd@google.com>
9745
9746 * layout.cc (is_compressible_debug_section): Fix incorrect
9747 comment about compressed section names.
9748
1caf2c51
ILT
97492009-07-20 Ian Lance Taylor <ian@airs.com>
9750
9751 PR 10419
9752 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9753
1ef4d87f
ILT
97542009-07-16 Ian Lance Taylor <iant@google.com>
9755
9756 PR 10400
9757 * layout.h: #include <map>.
9758 (class Kept_section): Change from struct to class. Add accessors
9759 and setters. Add section size to Comdat_group mapping. Change
9760 Comdat_group to std::map. Add is_comdat_ field. Add
9761 linkonce_size field in union.
9762 (class Layout): Update declaration of find_or_add_kept_section.
9763 Don't declare find_kept_object.
9764 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9765 parameter. Add object, shndx, is_comdat, and is_group_name
9766 parameters. Change all callers. Adjust for new Kept_section.
9767 (Layout::find_kept_object): Remove.
9768 * object.cc (Sized_relobj::include_section_group): Update use of
9769 Kept_section. Rename secnum to shndx. Only record
9770 Kept_comdat_section if sections are the same size.
9771 (Sized_relobj::include_linkonce_section): Update use of
9772 Kept_section. Only record Kept_comdat_section if sections are the
9773 same size. Set size of linkonce section.
9774 (Sized_relobj::map_to_kept_section): Update call to
9775 get_kept_comdat_section.
9776 * object.h (class Sized_relobj): Rename fields in
9777 Kept_comdat_section to drop trailing underscores; change object
9778 field to Relobj*. Change Kept_comdat_section_table to store
9779 struct rather than pointer.
9780 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9781 Add kept_object and kept_shndx parameters. Change all callers.
9782 (Sized_relobj::get_kept_comdat_section): Change return type to
9783 bool. Add kept_object and kept_shndx parameters. Change all
9784 callers.
9785 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9786 Layout::find_or_add_kept_section.
9787
37c3b7b0
ILT
97882009-07-09 Ian Lance Taylor <iant@google.com>
9789
9790 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9791 Reserve space in the hash table.
9792
98fa85cb
ILT
97932009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9794
9795 * fileread.cc (File_read::get_mtime): New method.
9796 * fileread.h (Timespec): New structure.
9797 (File_read::get_mtime): New method.
9798 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9799 Renamed from timestamp_nsec.
9800 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9801 Elf_Xword.
e1df38aa 9802 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 9803 timestamp_nsec.
e1df38aa 9804 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
9805 (Incremental_inputs::report_obejct): Save mtime; style fix.
9806 (Incremental_inputs::report_script): Save mtime; style fix.
9807 (Incremental_inputs::finalize_inputs): Style fix.
9808 (Incremental_inputs::finalize): Style fix.
9809 (Incremental_inputs::create_input_section_data): Store inputs
9810 mtime.
9811 * incremental.h (Incremental_inputs::report_script): Add mtime
9812 argument.
9813 (Incremental_inputs::Input_info::Input_info): Intialize only one
9814 union member.
9815 (Incremental_inputs::Input_info::archive): Move to nameless
9816 union.
9817 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9818 (Incremental_inputs::Input_info::script): Move to nameless union.
9819 (Incremental_inputs::mtime): New field.
9820 * script.cc (read_input_script): Pass file mtime to
9821 Incremental_input.
9822 * script.h (Script_info::inputs): Style fix.
9823
c9d70757
ILT
98242009-07-01 Ian Lance Taylor <ian@airs.com>
9825
9826 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9827 instead of 32.
9828
9c547ec3
ILT
98292009-06-24 Ian Lance Taylor <iant@google.com>
9830
9831 PR 10156
9832 * layout.cc (Layout::choose_output_section): If we find an
9833 existing section, update the flags.
9834 (Layout::create_notes): New function, broken out of
9835 Layout::finalize.
9836 (Layout::finalize): Don't create note sections.
9837 (Layout::create_note): Don't crash if linker script discards
9838 section.
9839 (Layout::create_gold_note): Likewise.
9840 (Layout::create_build_id): Likewise. Don't set
9841 after_input_sections on the section.
9842 (Layout::create_executable_stack_info): Remove target parameter.
9843 Change caller.
9844 * layout.h (class Layout): Declare create_notes. Update
9845 declaration of create_executable_stack_info.
9846 * gold.cc (queue_middle_tasks): Call create_notes.
9847 * output.cc (Output_section::update_flags_for_input_section): Move
9848 here from output.h. If SHF_ALLOC flag is newly set, mark address
9849 invalid.
9850 * output.h (Output_data::mark_address_invalid): New function.
9851 (class Output_section): Only declare, not define,
9852 update_flags_for_input_section. Remove set_flags.
9853
55458500
ILT
98542009-06-24 Ian Lance Taylor <iant@google.com>
9855
9856 * script-sections.cc (Output_section_definition::
9857 set_section_addresses): Rename shadowing local load_address to
9858 laddr.
9859
1307d6cd
ILT
98602009-06-24 Ian Lance Taylor <iant@google.com>
9861
9862 PR 10244
9863 * reloc.cc (relocate_sections): Skip empty relocation sections.
9864
ec3f783e
ILT
98652009-06-23 Ian Lance Taylor <iant@google.com>
9866
9867 PR 10156
9868 * layout.cc (Layout::create_note): Use choose_output_section
9869 rather than make_output_section.
9870
459c9f1c
ILT
98712009-06-23 Ian Lance Taylor <iant@google.com>
9872
9873 PR 10237
9874 * options.cc (General_options::parse_V): Set printed_version_.
9875 (General_options::General_options): Initialize printed_version_.
9876 * options.h (class General_options): Add printed_version_ field.
9877 * gold.cc (queue_initial_tasks): If there are no input files,
9878 don't give a fatal error if we printed the version information.
9879 (queue_middle_tasks): If using -r with a shared object, give a
9880 fatal error rather than an ordinary error.
9881
1518dc8f
ILT
98822009-06-23 Ian Lance Taylor <iant@google.com>
9883
9884 PR 10219
9885 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9886 (Layout::make_output_section): Set have_stabstr_section_ if we see
9887 a .stab*str section.
9888 (Layout::finalize): Call link_stabs_sections.
9889 (Layout::link_stabs_sections): New file.
9890 * layout.h (class Layout): Add have_stabstr_section_ field.
9891 Declare link_stabs_sections.
9892
3d857b98
DK
98932009-06-23 Doug Kwan <dougkwan@google.com>
9894
9895 * Makefile.am (libgold_a_LIBADD): New.
9896 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 9897 * Makefile.in: Regenerate.
3d857b98
DK
9898 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9899 * configure: Regenerate.
9900 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9901 * fileread.cc: Include sys/state.h
9902 * gold.h: Declare memmem and strndup if found missing.
9903 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9904
0639a6f6
ILT
99052009-06-23 Ian Lance Taylor <iant@google.com>
9906
9907 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9908 * configure: Rebuild.
9909
8d63875c
ILT
99102009-06-23 Ian Lance Taylor <iant@google.com>
9911
9912 PR 10147
9913 * object.cc (Object::section_contents): Don't try to get a view if
9914 the section has length zero.
9915 (Object::handle_gnu_warning_section): If the section is empty, use
9916 the name of the section as the warning.
9917
f7c8a183
ILT
99182009-06-23 Ian Lance Taylor <iant@google.com>
9919
9920 PR 10133
9921 * stringpool.h (class Stringpool_template): Add optimize_ field.
9922 (Stringpool_template::set_optimize): New function.
9923 * stringpool.cc (Stringpool_template::Stringpool_template):
9924 Initialize optimize_ field.
9925 (Stringpool_template::set_string_offsets): Test local optimize
9926 fild rather than parameter.
9927 * layout.cc (Layout::Layout): Call set_optimize on the section
9928 name stringpool.
9929
e6a307ba
ILT
99302009-06-22 Ian Lance Taylor <iant@google.com>
9931
9932 PR 10030
9933 * yyscript.y: Parse TARGET.
9934 * script.cc (script_set_target): New function.
9935 * script-c.h (script_set_target): Declare.
9936 * options.cc (General_options::string_to_object_format): Rename
9937 from string_to_object_format in anonymous namespace. Change
9938 callers.
9939 * options.h (class General_options): Declare
9940 string_to_object_format.
9941
3ee173de
ILT
99422009-06-22 Ian Lance Taylor <iant@google.com>
9943
9944 * script-sections.cc (Script_sections::create_segments): Don't put
9945 program headers in a PT_LOAD segment if -n or -N.
9946
99472009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
9948
9949 PR 10141
9950 * options.h (class General_options): Add -z lazy and -z now. Sort
9951 -z options into alphabetical order.
9952 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9953
cd6739a1 99542009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
9955
9956 * layout.cc (Layout::make_output_section): Call
9957 Target::new_output_section.
9958 (Layout::attach_allocated_section_to_segment): Put large section
9959 sections in a separate load segment with the large segment flag
9960 set.
9961 (Layout::segment_precedes): Sort large data segments after other
9962 load segments.
9963 (align_file_offset): New static function.
9964 (Layout::set_segment_offsets): Use align_file_offset.
9965 * output.h (class Output_section): Add is_small_section_ and
9966 is_large_section_ fields.
9967 (Output_section::is_small_section): New function.
9968 (Output_section::set_is_small_section): New function.
9969 (Output_section::is_large_section): New function.
9970 (Output_section::set_is_large_section): New function.
9971 (Output_section::is_large_data_section): New function.
9972 (class Output_segment): Add is_large_data_segment_ field.
9973 (Output_segment::is_large_data_segment): New function.
9974 (Output_segment::set_is_large_data_segment): New function.
9975 * output.cc (Output_section::Output_section): Initialize new
9976 fields.
9977 (Output_segment::Output_segment): Likewise.
9978 (Output_segment::add_output_section): Add assertion that large
9979 data sections always go in large data segments. Force small data
9980 sections to the end of the list of data sections. Force small BSS
9981 sections to the start of the list of BSS sections. For large BSS
9982 sections to the end of the list of BSS sections.
9983 * symtab.h (class Symbol): Declare is_common_shndx.
9984 (Symbol::is_defined): Check Symbol::is_common_shndx.
9985 (Symbol::is_common): Likewise.
9986 (class Symbol_table): Define enum Commons_section_type. Update
9987 declarations. Add small_commons_ and large_commons_ fields.
9988 * symtab.cc (Symbol::is_common_shndx): New function.
9989 (Symbol_table::Symbol_table): Initialize new fields.
9990 (Symbol_table::add_from_object): Put small and large common
9991 symbols in the right list.
9992 (Symbol_table::sized_finalized_symbol): Check
9993 Symbol::is_common_shndx.
9994 (Symbol_table::sized_write_globals): Likewise.
9995 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9996 common symbol lists. Don't call do_allocate_commons_list if the
9997 list is empty.
9998 (Symbol_table::do_allocate_commons_list): Remove is_tls
9999 parameter. Add comons_section_type parameter. Change all
10000 callers. Handle small and large common symbols.
10001 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
10002 Symbol::is_common_shndx.
10003 * resolve.cc (symbol_to_bits): Likewise.
10004 * target.h (Target::small_common_shndx): New function.
10005 (Target::small_common_section_flags): New function.
10006 (Target::large_common_shndx): New function.
10007 (Target::large_common_section_flags): New function.
10008 (Target::new_output_section): New function.
10009 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10010 small_common_section_flags, and large_common_section_flags
10011 fields.
10012 (Target::do_new_output_section): New virtual function.
10013 * arm.cc (Target_arm::arm_info): Initialize new fields.
10014 * i386.cc (Target_i386::i386_info): Likewise.
10015 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
10016 Likewise.
10017 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
10018 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10019 (Target_x86_64::do_new_output_section): New function.
10020 * configure.ac: Define conditional MCMODEL_MEDIUM.
10021 * testsuite/Makefile.am (check_PROGRAMS): Add large.
10022 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
10023 (large_LDFLAGS): Define.
10024 * testsuite/large.c: New file.
10025 * testsuite/testfile.cc (Target_test::test_target_info):
10026 Initialize new fields.
10027 * configure, testsuite/Makefile.in: Rebuild.
10028
bb04269c
DK
100292009-06-05 Doug Kwan <dougkwan@google.com>
10030
10031 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 10032 * Makefile.in: Regenerate.
bb04269c
DK
10033 * i386.cc (class Target_i386): Define new virtual method to
10034 override do_is_local_label_name in parent.
10035 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10036 local symbols if --discard-locals or -X is given.
10037 * options.h (class General_options): Declare new options
10038 '--discard-locals' and '-X' for discarding locals.
10039 * target.h (class Target): Define new methods is_local_label_name.
10040 Declare new virtual method do_is_local_label_name.
10041 * target.cc: New file.
10042 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10043 (check_SCRIPTS): Add discard_locals_test.sh.
10044 (check_DATA): Add discard_local_tests.syms.
10045 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
10046 (discard_local_tests.syms, discard_locals_test.o): New make rules.
10047 * testsuite/Makefile.in: Regenerate.
10048 * testsuite/discard_locals_test.c: New file.
10049 * testsuite/discard_locals_test.sh: Same.
10050
805bb01c
DK
100512009-06-05 Doug Kwan <dougkwan@google.com>
10052
10053 * object.cc (Sized_relobj::Sized_relobj): Initialize
10054 discarded_eh_frame_shndx_ to -1U.
10055 (Sized_relobj::do_layout): Record index of a discard .eh_frame
10056 section.
10057 (Sized_relobj::do_count_local_symbols): Skip local symbols in
10058 a discarded .eh_frame section.
10059 (Sized_relobj::do_finalize_local_symbols): Ditto.
10060 * object.h (class Sized_relobj): Declare new member
10061 discarded_eh_frame_shndx_.
10062 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
10063 (local_labels_test.o, local_labels_test): New rules.
10064 * testsuite/Makefile.in: Regenerate.
10065
1dcd334d
DK
100662009-06-04 Doug Kwan <dougkwan@google.com>
10067
10068 * layout.cc (Layout::section_name_mapping): Add mapping for
10069 special ARM sections.
10070
96d49306
DK
100712009-06-03 Doug Kwan <dougkwan@google.com>
10072
10073 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
10074 (utils::has_overflow): Same.
10075
dff16297
ILT
100762009-06-03 Ian Lance Taylor <iant@google.com>
10077
10078 * layout.cc (Layout::section_name_mapping): New array, replacing
10079 Layout::linkonce_mapping.
10080 (Layout::section_name_mapping_count): New variable, replacing
10081 Layout::linkonce_mapping_count.
10082 (Layout::linkonce_output_name): Remove.
10083 (Layout::output_section_name): Rewrite.
10084 * layout.h (class Layout): Rename Linkonce_mapping to
10085 Section_name_mapping, linkonce_mapping to section_name_mapping,
10086 linkonce_mapping_count to section_name_mapping_count. Don't
10087 declare linkonce_output_name.
10088
c121c671
DK
100892009-06-03 Doug Kwan <dougkwan@google.com>
10090
10091 * gold/arm.cc (namespace utils): New.
10092 (Target_arm::reloc_is_non_pic): Define new method.
10093 (class Arm_relocate_functions): New.
10094 (Target_arm::Relocate::relocate): Handle relocation types used by
10095 Android.
10096
07800fab
ILT
100972009-06-03 Ian Lance Taylor <iant@google.com>
10098
10099 * arm.cc (Target_arm::scan::global): Use || instead of |.
10100
c121c671
DK
101012009-06-02 Doug Kwan <dougkwan@google.com>
10102
10103 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10104 issued_non_pic_error_.
10105 (class Target_arm::Scan): Declare new method check_non_pic.
10106 Define new method symbol_needs_plt_entry.
10107 Declare new data member issued_non_pic_error_.
10108 (class Target_arm::Relocate): Declare new method
10109 should_apply_static_reloc.
10110 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10111 (Target_arm::Scan::check_non_pic): Define new method.
10112 (Target_arm::Scan::local): Handle a small subset of reloc types used
10113 by Android.
10114 (Target_arm::Scan::local): Same.
10115 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10116
b19b0c6d
ILT
101172009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10118
10119 * incremental.cc (Incremental_inputs::report_command_line): Filter
10120 out --incremental-* options.
10121
94cdfcff
DK
101222009-05-29 Doug Kwan <dougkwan@google.com>
10123
10124 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10125 template class.
10126 (class Target_arm): Update comment.
10127 (Target_arm::Target_arm): Initialize new data members GOT_,
10128 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10129 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10130 and Target_arm::rel_dyn_section.
10131 Declare new_enum Target_arm::Got_type.
10132 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10133 and DYNBSS_.
10134 Update commments for member do_dynsym_value.
10135 (Target_arm::got_size, Target_arm::plt_section,
10136 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10137 new methods inside class defintion.
10138 (Target_arm::got_section): Define new method.
10139 (Target_arm::rel_dyn_section): Same.
10140 (Output_data_plt_arm): New template class.
10141 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10142 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10143 (Output_data_plt_arm::add_entry): Same.
10144 (Output_data_plt_arm::first_plt_entry): Define new
10145 static data member for PLT instruction template.
10146 (Output_data_plt_arm::plt_entry): Same.
10147 (Output_data_plt_arm::do_write): Define new method.
10148 (Target_arm::make_plt_entry): Same.
10149 (Target_arm::do_finalize_sections): Same.
10150 (Target_arm::do_dynsym_value): Same.
10151
4a657b0d
DK
101522009-05-28 Doug Kwan <dougkwan@google.com>
10153
10154 * Makefile.am (TARGETSOURCES): Add arm.cc.
10155 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10156 * Makefile.in: Regenerate.
10157 * arm.cc: New file.
10158 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10159
e7ae8c36
DK
101602009-05-26 Doug Kwan <dougkwan@google.com>
10161
10162 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10163 (General_options::check_excluded_libs): Strip off directories in
10164 archive name before matching like GNU ld does.
10165 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10166 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10167 (exclude_libs_test_LDFLAGS): Add linker option
10168 -Wl,--exclude-libs,libexclude_libs_test_3
10169 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10170 an explicit archive without using -l.
10171 (alt/libexclude_libs_test_3.a): New make rule.
10172 * testsuite/Makefile.in: Regenerate.
10173 * testsuite/exclude_libs_test.c : Declare lib3_default().
10174 (main): Call it.
10175 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10176 * exclude_libs_test_3.c: New file.
10177
f12e7348
NC
101782009-05-26 Nick Clifton <nickc@redhat.com>
10179
10180 * po/id.po: New Indonesian translation.
10181 * po/gold.pot: Updated template file.
10182
4daadc0d
ST
101832009-05-22 Sriraman Tallam <tmsriram@google.com>
10184
e1df38aa 10185 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
10186 gc_comdat_test files. Add -Wl,--gc-sections to build
10187 gc_comdat_test.
10188 * testsuite/Makefile.in: Regenerate.
10189 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10190
531813ad
ST
101912009-05-21 Sriraman Tallam <tmsriram@google.com>
10192
10193 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10194 kept comdat section was garbage collected.
10195 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10196 * testsuite/Makefile.in: Regenerate.
10197 * testsuite/gc_comdat_test.sh: New file.
10198 * testsuite/gc_comdat_test_1.cc: New file.
10199 * testsuite/gc_comdat_test_2.cc: New file.
10200
65514900
CC
102012009-05-19 Doug Kwan <dougkwan@google.com>
10202
10203 * archive.cc (Archive::Archive): Move constructor from archive.h
10204 to here. Initialize no_export_.
10205 (Archive::get_elf_object_for_member): Set no_export flag of object.
10206 * archive.h (Archive::Archive): Move constructor body to
10207 archive.cc.
10208 (Archive::no_export): New method.
10209 (Archive::no_export_): New field.
10210 * object.h (Object::Object): Initialize no_export_ to false.
10211 (Object::no_export, Object::set_no_export): New methods.
10212 (Object::no_export_): New field.
10213 * options.cc (General_options::parse_exclude_libs): New method.
10214 (General_options::check_excluded_libs) Same.
10215 * options.h (exclude_libs): New option.
10216 (General_options::check_excluded_libs): New method declaration.
10217 (General_options::excluded_libs_): New field.
10218 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10219 default or protected visibility if an object has no-export flag set.
10220 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10221 (check_SCRIPTS): Add exclude_libs_test.sh.
10222 (check_DATA): Add exclude_libs_test.syms.
10223 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10224 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10225 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10226 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10227 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10228 libexclude_libs_test_2.a): New rules.
10229 * testsuite/Makefile.in: Regenerate.
10230 * testsuite/exclude_libs_test.c: New file.
10231 * testsuite/exclude_libs_test.sh: Ditto.
10232 * testsuite/exclude_libs_test_1.c: Ditto.
10233 * testsuite/exclude_libs_test_2.c: Ditto.
10234
1b77ea50
ILT
102352009-05-15 Ian Lance Taylor <iant@google.com>
10236
10237 * configure.ac: Check for declarations for cases where libiberty.h
10238 checks HAVE_DECL_xxx.
10239 * configure, config.in: Rebuild.
10240
072fe7ce
ILT
102412009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10242
10243 * gold.h (Incremental_argument_list): Remove (invalid) forward
10244 declaration.
10245 * incremental.cc (Incremental_inputs::report_achive): New method.
10246 (Incremental_inputs::report_object): New method.
10247 (Incremental_inputs::report_script): New method.
10248 (Incremental_inputs::finalize_inputs): New method.
10249 (Incremental_inputs::finalize): Call finalize_inputs().
10250 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10251 Create inputs entries.
10252 * incremental.h (Incremental_input_type): New enum.
10253 (Incremental_inputs::Incremental_input): Initialize new fields.
10254 (Incremental_inputs::report_inputs): New method.
10255 (Incremental_inputs::report_achive): New method.
10256 (Incremental_inputs::report_object): New method.
10257 (Incremental_inputs::report_script): New method.
10258 (Incremental_inputs::finalize_inputs): New method.
10259 (Incremental_inputs::Input_info): New struct.
10260 (Incremental_inputs::Input_info_map): New typedef.
10261 (Incremental_inputs::lock_): New field.
10262 (Incremental_inputs::Inputs_): New field.
10263 (Incremental_inputs::Inputs_map): New field.
10264 * main.cc (main): Call Incremental_input::report_inputs.
10265 * options.h (Input_argument_list): Typedef moved from
10266 Input_arguments.
10267 (Input_file_group::Files): Remove, use ::Input_argument_list.
10268 (Input_file_group::Input_argument_list): Remove, use
10269 ::Input_argument_list.
10270 * plugin.cc (Plugin_manager::add_input_file): Add error in
10271 incremental build.
10272 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10273 functions.
10274 * script.cc (read_input_script): Call
10275 Incremental_input::report_script.
10276 * script.h (Script_info): New class.
10277
b0481b0b
ILT
102782009-04-27 Ian Lance Taylor <iant@google.com>
10279
10280 * x86_64.cc (do_adjust_output_section): Set entsize to
10281 plt_entry_size.
10282
b22a5a41 102832009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
10284
10285 * output.cc (Output_file::close): After short writes, continue
10286 writing from the correct offset in the buffer being written.
10287
40fde488
CD
102882009-04-23 Chris Demetriou <cgd@google.com>
10289
10290 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10291 * configure: Regenerate.
10292 * config.in: Regenerate.
10293 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10294 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10295
3ce2c28e
ILT
102962009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10297
10298 * incremental.cc (Incremental_inputs_header_data): Renamed from
10299 Incremental_input_header_data.
10300 (Incremental_inputs_header_data::data_size): New field.
10301 (Incremental_inputs_header_data::put_input_file_count): Renamed
10302 from input_file_count.
10303 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10304 from command_line_offset.
10305 (Incremental_inputs_header_data::put_reserved): Renamed from
10306 put_reserved.
10307 (Incremental_inputs_entry_data): Renamed from
10308 Incremental_input_entry_data.
10309 (Incremental_inputs_entry_data::data_size): New field.
10310 (Incremental_inputs::report_command_line): New method.
10311 (Incremental_inputs::finalize): New method.
10312 (Incremental_inputs::create_incremental_inputs_data): New method.
10313 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10314 * incremental.h: New file.
10315 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10316 (Layout::finalize): Create incremental inputs section in
10317 incremental builds.
10318 (Layout::create_incremental_info_sections): New method.
10319 * layout.h (Layout::incremental_inputs): New method.
10320 (Layout::create_incremental_info_sections): New method.
10321 (Layout::incremental_inputs_): New field.
10322 * main.cc (main): Notify Incremental_input of the command line.
10323
e55bde5e
ILT
103242009-04-01 Ian Lance Taylor <iant@google.com>
10325 Mikolaj Zalewski <mikolajz@google.com>
10326
10327 * gold.h (reserve_unordered_map): Define, three versions, one for
10328 each version of Unordered_map.
10329 * layout.cc (Layout::Layout): Remove options parameter. Add
10330 number_of_input_files parameter. Don't initialize options_.
10331 Initialize number_of_input_files_ and resized_signatures_. Move
10332 sections_are_attached_.
10333 (Layout::layout_group): Reserve space for group_signatures_.
10334 (Layout::find_or_add_kept_section): Change name parameter to be a
10335 reference. Resize signatures_ map when it gets large enough.
10336 (Layout::layout_eh_frame): Use parameters->options() instead of
10337 this->options_.
10338 (Layout::make_output_section): Likewise.
10339 (Layout::attach_allocated_section_to_segment): Likewise.
10340 (Layout::finalize, Layout::create_executable_stack): Likewise.
10341 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10342 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10343 * layout.h (class Layout): Update declarations. Remove options_
10344 field. Add number_of_input_files_ and resized_signatures_
10345 fields. Move sections_are_attached_ field.
10346 * main.cc (main): Pass number of input files to Layout
10347 constructor. Don't pass options.
10348
154b857c
ILT
103492009-03-30 Ian Lance Taylor <iant@google.com>
10350
10351 * ffsll.c (ffsll): Correct implementation.
10352
2f35ab9b
ILT
103532009-03-27 Ian Lance Taylor <iant@google.com>
10354
fd03461a
ILT
10355 * ffsll.c: New file.
10356 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10357 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10358 * ftruncate.c (ftruncate): Declare before definition.
10359 * mremap.c (mremap): Likewise.
10360 * pread.c (pread): Likewise.
10361 * configure, Makefile.in, config.in: Rebuild.
10362
2f35ab9b
ILT
10363 * mremap.c: New file.
10364 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10365 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10366 (mremap): Declare if HAVE_MREMAP is not defined.
10367 * configure, Makefile.in, config.in: Rebuild.
10368
33aea2fd
CC
103692009-03-27 Cary Coutant <ccoutant@google.com>
10370
10371 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10372 position independent.
10373 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10374 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10375
6d479619
CC
103762009-03-24 Cary Coutant <ccoutant@google.com>
10377
10378 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10379 an executable.
10380 (needs_dynamic_reloc): Likewise.
10381
afc06bb8
ILT
103822009-03-24 Ian Lance Taylor <iant@google.com>
10383
10384 * yyscript.y (file_cmd): Recognize EXTERN.
10385 (extern_name_list, extern_name_list_body): New nonterminals.
10386 * script.cc (script_add_extern): Define.
10387 * script-c.h (script_add_extern): Declare.
10388
f6060a4d
ILT
103892009-03-24 Rafael Avila de Espindola <espindola@google.com>
10390
10391 * object.cc (is_elf_object): Define.
10392 * object.h (is_elf_object): Declare.
10393 * archive.cc (Archive::get_elf_object_for_member): Call
10394 is_elf_object.
33aea2fd 10395 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 10396
26736d8e
ILT
103972009-03-24 Elliott Hughes <enh@google.com>
10398
10399 * output.cc (Output_file::map_anonymous): Define.
10400 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10401 try an anonymous one. Report the size if the mmap fails.
10402 * output.h (class Output_file): Declare map_anonymous.
10403
22fd9730
ILT
104042009-03-24 Ian Lance Taylor <iant@google.com>
10405
10406 * target-select.cc (instantiate_target): Don't acquire the lock if
10407 the instantiated_target_ field has already been set.
10408
cb010894
ILT
104092009-03-23 Ian Lance Taylor <iant@google.com>
10410
7f055c20
ILT
10411 * gold-threads.h (class Initialize_lock): Define.
10412 * gold-threads.cc (class Initialize_lock_once): Define.
10413 (initialize_lock_control): New static variable.
10414 (initialize_lock_pointer): New static variable.
10415 (initialize_lock_once): New static function.
10416 (Initialize_lock::Initialize_lock): Define.
10417 (Initialize_lock::initialize): Define.
10418 * target-select.h: Include "gold-threads.h".
10419 (class Target_selector): Add lock_ and initialize_lock_ fields.
10420 Don't define instantiate_target, just declare it.
10421 * target-select.cc (Target_selector::Target_selector): Initialize
10422 new fields.
10423 (Target_selector::instantiate_target): Define.
10424 * descriptors.h: Include "gold-threads.h".
10425 (class Descriptors): Add initialize_lock_ field.
10426 * descriptors.cc (Descriptors::Descriptors): Initialize new
10427 field.
10428 (Descriptors::open): Use initialize_lock_ field
10429 * errors.h (class Errors): Add initialize_lock_ field.
10430 * errors.cc (Errors::Errors): Initialize new field.
10431 (Errors::initialize_lock): Use initialize_lock_ field.
10432 * powerpc.cc (class Target_selector_powerpc): Remove
10433 instantiated_target_ field. In do_recognize call
10434 instantiate_target rather than do_instantiate_target. In
10435 do_instantiate_target just allocate a new target.
10436 * sparc.cc (class Target_selector_sparc): Likewise.
10437
36959681
ILT
10438 * freebsd.h: New file.
10439 * i386.cc: Include "freebsd.h".
10440 (Target_i386): Derive from Target_freebsd rather than
10441 Sized_target.
10442 (Target_selector_i386): Derive from Target_selector_freebsd rather
10443 than Target_selector.
10444 * x86_64.cc: Include "freebsd.h".
10445 (Target_x86_64): Derive from Target_freebsd rather than
10446 Sized_target.
10447 (Target_selector_x86_64): Derive from Target_selector_freebsd
10448 rather than Target_selector.
10449 * target.h (class Target): Add adjust_elf_header and
10450 do_adjust_elf_header.
10451 * output.cc (Output_file_header:: do_sized_write): Call target
10452 adjust_elf_header routine.
10453 * configure.tgt: Set targ_osabi.
10454 * configure.ac: Define GOLD_DEFAULT_OSABI.
10455 * parameters.cc (Parameters::default_target): Pass
10456 GOLD_DEFAULT_OSABI to select_target.
10457 * target-select.h (class Target_selector): Make instantiate_target
10458 protected rather than private.
10459 * Makefile.am (HFILES): Add freebsd.h.
10460 * configure, Makefile.in, config.in: Rebuild.
10461
cb010894
ILT
10462 * merge.cc (do_add_input_section): Correct pend value. Change
10463 message about last entry not being null terminated from error to
10464 warning.
10465
0e879927
ILT
104662009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10467
10468 * incremental.cc: New file.
10469 * Makefile.am (CCFILES): Add incremental.cc.
10470 * Makefile.in: Rebuild.
10471
41105937
PP
104722009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10473
10474 * layout.cc (Layout::output_section_name): Preserve names
10475 of '.note.' sections.
e1df38aa 10476
60439920
ILT
104772009-03-19 Ian Lance Taylor <iant@google.com>
10478
10479 * descriptors.cc (Descriptors::open): Check that the options are
10480 valid before using them.
10481
0d371ad3
ILT
104822009-03-18 Ian Lance Taylor <iant@google.com>
10483
10484 * script-sections.h: Include <list>.
10485 (class Script_sections): Change Sections_elements from std::vector
10486 to std::list. Typedef public Elements_iterator. Add
10487 orphan_section_placement_, data_segment_align_start_, and
10488 saw_data_segment_align_ fields. Remove data_segment_align_index_
10489 field.
10490 * script-sections.cc (class Orphan_section_placement): New class.
10491 (class Sections_element): Add virtual functions is_relro and
10492 orphan_section_init. Remove virtual function place_orphan_here.
10493 (class Output_section_definition): Add is_relro and
10494 orphan_section_init. Remove place_orphan_here.
10495 (class Orphan_output_section): Likewise.
10496 (Script_sections::Script_sections): Update for field changes.
10497 (Script_sections::data_segment_align): Set saw_data_segment_align_
10498 and data_segment_align_start_, not data_segment_align_index.
10499 (Script_sections::data_segment_relro_end): Check
10500 saw_data_segment_align_. Use data_segment_align_start_ rather
10501 than data_segment_align_index_.
10502 (Script_sections::place_orphan): Rewrite to use
10503 Orphan_section_placement.
10504
9201d894
ILT
105052009-03-17 Ian Lance Taylor <iant@google.com>
10506
9c5b8369
ILT
10507 * archive.cc (Archive::add_symbols): Check for a version attached
10508 to the symbol name in the archive map.
10509 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10510 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10511 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10512 (ver_test_11.a): New target.
10513 * testsuite/Makefile.in: Rebuild.
10514
9201d894
ILT
10515 * configure.ac: Check for chsize and posix_fallocate. Replace
10516 ftruncate.
10517 * ftruncate.c: New file, from gnulib.
10518 * output.cc (posix_fallocate): Define dummy version if not
10519 HAVE_POSIX_FALLOCATE.
10520 (Output_file::map): Call posix_fallocate rather than lseek and
10521 write.
10522 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10523 * configure, Makefile.in, config.in: Rebuild.
10524
ef4ab7a8 105252009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 10526
ef4ab7a8
PP
10527 * layout.h (Layout::create_note): Add section_name parameter.
10528 * layout.cc (Layout::create_note): Likewise.
10529 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 10530
8c500701
ILT
105312009-03-17 Ian Lance Taylor <iant@google.com>
10532
e85b18e1
ILT
10533 * descriptors.cc: Include "options.h".
10534 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10535 (Descriptors::open): Always use O_CLOEXEC when opening a new
10536 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10537 then set FD_CLOEXEC.
10538
9efe6174
ILT
10539 * sparc.cc (class Target_sparc): Add has_got_section.
10540 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10541 make sure we have a GOT section.
10542
10543 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10544 (Target_sparc::Scan::local): Likewise.
10545 (Target_sparc::Scan::global): Likewise.
10546 (Target_sparc::Relocate::relocate): Likewise.
10547 (Target_sparc::Relocate::relocate_tls): Likewise.
10548
8c500701
ILT
10549 * symtab.cc (Symbol_table::define_default_version): New function,
10550 broken out of add_from_object.
10551 (Symbol_table::add_from_object): Call define_default_version.
10552 (Symbol_table::define_special_symbol): Add resolve_oldsym
10553 parameter. Change all callers. If the version for a symbol comes
10554 from a version script, resolve it with the symbol with the same
10555 name with no version. Also add the symbol without a version if
10556 appropriate.
10557 (do_define_in_output_data): If resolving with oldsym, don't delete
10558 sym.
10559 (do_define_in_output_segment): Likewise.
10560 (do_define_as_constant): Likewise.
10561 * symtab.h (class Symbol_table): Update declarations.
10562
f1ed28fb
ILT
105632009-03-13 Ian Lance Taylor <iant@google.com>
10564
15f8229b
ILT
10565 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10566 (Read_symbols::requeue): New function.
10567 (Read_symbols::do_read_symbols): If make_elf_object fails because
10568 the target type is not configured, and the file was searched for,
10569 issue a warning and retry with the next directory.
10570 (Add_symbols::run): If the file has an incompatible format, and
10571 it was searched for, requeue the Read_symbols task. On error,
10572 release the object.
10573 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10574 dirindex parameter to constructor. Change all callers. Declare
10575 incompatible_warning and requeue.
10576 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10577 input_argument_ and input_group_ fields. Add them to
10578 constructor. Change all callers.
10579 (class Read_script): Add dirindex_ field. Add it to constructor.
10580 Change all callers.
10581 * archive.cc (Archive::setup): Remove input_objects parameter.
10582 Change all callers.
10583 (Archive::get_file_and_offset): Likewise.
10584 (Archive::read_all_symbols): Likewise.
10585 (Archive::read_symbols): Likewise.
10586 (Archive::get_elf_object_for_member): Remove input_objects
10587 parameter. Add punconfigured parameter. Change all callers.
10588 (Archive::add_symbols): Change return type to bool. Check return
10589 value of include_member.
10590 (Archive::include_all_members): Likewise.
10591 (Archive::include_member): Change return type to bool. Return
10592 false if first included object has incompatible target. Set
10593 included_member_ field.
10594 (Add_archive_symbols::run): If add_symbols returns false, requeue
10595 Read_symbols task.
10596 * archive.h (class Archive): Add included_member_ field.
10597 Initialize it in constructor. Add input_file and searched_for
10598 methods. Update declarations.
10599 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10600 input_argument_ fields. Add them to constructor. Change all
10601 callers.
10602 * script.cc: Include "target-select.h".
10603 (class Parser_closure): Add skip_on_incompatible_target_ and
10604 found_incompatible_target_ fields. Add
10605 skip_on_incompatible_target parameter to constructor. Change all
10606 callers. Add methods skip_on_incompatible_target,
10607 clear_skip_on_incompatible_target, found_incompatible_target, and
10608 set_found_incompatible_target.
10609 (read_input_script): Add dirindex parameter. Change all callers.
10610 If parser finds an incompatible target, requeue Read_symbols
10611 task.
10612 (script_set_symbol): Clear skip_on_incompatible_target in
10613 closure.
10614 (script_add_assertion, script_parse_option): Likewise.
10615 (script_start_sections, script_add_phdr): Likewise.
10616 (script_check_output_format): New function.
10617 * script.h (read_input_script): Update declaration.
10618 * script-c.h (script_check_output_format): Declare.
10619 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10620 (ignore_cmd): Remove OUTPUT_FORMAT.
10621 * fileread.cc (Input_file::Input_file): Add explicit this.
10622 (Input_file::will_search_for): New function.
10623 (Input_file::open): Add pindex parameter. Change all callers.
10624 * fileread.h (class Input_file): Add input_file_argument method.
10625 Declare will_search_for. Update declarations.
10626 * object.cc (make_elf_object): Add punconfigured parameter.
10627 Change all callers.
10628 * object.h (class Object): Make input_file public. Add
10629 searched_for method.
10630 (make_elf_object): Update declaration.
10631 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10632 restart search.
10633 * dirsearch.h (class Dirsearch): Update declaration.
10634 * options.h (class General_options): Add --warn-search-mismatch.
10635 * parameters.cc (Parameters::is_compatible_target): New function.
10636 * parameters.h (class Parameters): Declare is_compatible_target.
10637 * workqueue.cc (Workqueue::add_blocker): New function.
10638 * workqueue.h (class Workqueue): Declare add_blocker.
10639
f1ed28fb
ILT
10640 * fileread.cc (Input_file::open): Remove options parameter.
10641 Change all callers.
10642 (Input_file::open_binary): Likewise.
10643 * script.cc (read_input_script): Likewise.
10644 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10645 options parameter from constructor. Change all callers.
10646 (class Read_script): Likewise.
10647 * fileread.h (class Input_file): Update declarations.
10648 * script.h (read_input_script): Update declaration.
10649
34dd024a
NC
106502009-03-10 Nick Clifton <nickc@redhat.com>
10651
10652 * po/es.po: New Spanish translation.
10653
6d71b17c
CC
106542009-03-06 Cary Coutant <ccoutant@google.com>
10655
10656 * options.cc (parse_short_option): Keep dash_z from registering itself.
10657
031cdbed
ILT
106582009-03-03 Ian Lance Taylor <iant@google.com>
10659
10660 PR 9918
10661 * target-reloc.h (relocate_section): Pass output_section to
10662 relocate.
10663 * i386.cc (Target_i386::should_apply_static_reloc): Add
10664 output_section parameter. Change all callers.
10665 (Target_i386::Relocate::relocate): Add output_section parameter.
10666 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10667 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10668 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10669 * testsuite/two_file_shared.sh: New script.
10670 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10671 (check_DATA): Add two_file_shared.dbg.
10672 (two_file_shared.dbg): New target.
10673 * testsuite/Makefile.in: Rebuild.
10674
15d5fa16
ILT
106752009-03-01 Ian Lance Taylor <iant@google.com>
10676
10677 * configure.ac: Check for byteswap.h.
10678 * configure: Rebuild.
10679 * config.in: Rebuild.
10680
8a4c0b0d
ILT
106812009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10682
10683 * layout.cc (Layout::find_or_add_kept_section): New function.
10684 (Layout::add_comdat): Removed.
10685 * layout.h (struct Kept_section): Move out of class Layout.
10686 Remove trailing underscores from field names. Add group_sections
10687 field. Rename group_ field to is_group. Change all uses.
10688 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10689 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10690 comdat_groups_ field.
10691 (Sized_relobj::include_section_group): Use
10692 find_or_add_kept_section and Kept_section::group_sections.
10693 (Sized_relobj::include_linkonce_section): Likewise.
10694 * object.cc (class Sized_relobj): Don't define Comdat_group or
10695 Comdat_group_table. Remove find_comdat_group and
10696 add_comdat_group. Remove comdat_groups_ field.
10697 * plugin.cc (include_comdat_group): Use
10698 Layout::find_or_add_kept_section.
10699
b4ecf66b
ILT
107002009-02-28 Ian Lance Taylor <iant@google.com>
10701
14359ca0
ILT
10702 * README: --gc-sections and map files are now supported. Document
10703 some build requirements.
10704
b4ecf66b
ILT
10705 PR 6992
10706 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10707 relocatable link set the value of the section symbol to zero.
10708 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10709 relocatable link don't include the section address in the local
10710 symbol value.
10711
0602e05a
ILT
107122009-02-27 Ian Lance Taylor <iant@google.com>
10713
fd9d194f
ILT
10714 PR 6811
10715 * options.h (class Search_directory): Add is_system_directory.
10716 (class General_options): Declare is_in_system_directory.
10717 * options.cc (get_relative_sysroot): Make static.
10718 (get_default_sysroot): Make static.
10719 (General_optoins::is_in_system_directory): New function.
10720 * fileread.cc (Input_file::is_in_system_directory): New function.
10721 * fileread.h (class Input_file): Declare is_in_system_directory.
10722 * object.h (class Object): Add is_in_system_directory.
10723 (class Input_objects): Remove system_library_directory_ field.
10724 * object.cc (Input_objects::add_object): Don't set
10725 system_library_directory_.
10726 (input_objects::found_in_system_library_directory): Remove.
10727 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10728 parameter. Change all callers.
10729 (Symbol_table::sized_write_globals): Likewise.
10730 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10731 Call Object::is_in_system_directory.
10732 * symtab.h (class Symbol_table): Update declarations.
10733
61edd21f
ILT
10734 PR 5990
10735 * descriptors.h (Open_descriptor): Add is_on_stack field.
10736 * descriptors.cc (Descriptors::open): If the descriptor is on the
10737 top of the stack, remove it. Initialize is_on_stack field.
10738 (Descriptors::release): Only add pod to stack if it is not on the
10739 stack already.
10740 (Descriptors::close_some_descriptor): Clear stack_next and
10741 is_on_stack fields.
10742
e29e076a
ILT
10743 PR 7091
10744 * output.cc (Output_section::find_starting_output_address): Rename
10745 from starting_output_address; add PADDR parameter; change return
10746 type.
10747 * output.h (class Output_section): Declare
10748 find_starting_output_address instead of starting_output_address.
10749 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10750 section symbol for which we can't find a merge section.
10751
0602e05a
ILT
10752 PR 9836
10753 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10754 hidden or internal, force the symbol to be local.
10755 * resolve.cc (Symbol::override_visibility): Define.
10756 (Symbol::override_base): Use override_visibility.
10757 (Symbol_table::resolve): Likewise.
10758 (Symbol::override_base_with_special): Likewise.
10759 (Symbol_table::override_with_special): If the visibility is hidden
10760 or internal, force the symbol to be local.
10761 * symtab.h (class Symbol): Add set_visibility and
10762 override_visibility.
10763 * testsuite/ver_test_1.sh: New file.
10764 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10765 (check_DATA): Add ver_test_1.syms.
10766 (ver_test_1.syms): New target.
10767 * testsuite/Makefile.in: Rebuild.
10768
401a9a73
CC
107692009-02-25 Cary Coutant <ccoutant@google.com>
10770
10771 * layout.cc (Layout::choose_output_section): Don't rename sections
10772 when using a linker script that has a SECTIONS clause.
10773 * Makefile.in: Regenerate.
10774
10775 * testsuite/Makefile.am (script_test_5.sh): New test case.
10776 * testsuite/Makefile.in: Regenerate.
10777 * testsuite/script_test_5.cc: New file.
10778 * testsuite/script_test_5.sh: New file.
10779 * testsuite/script_test_5.t: New file.
10780
f488e4b0
CC
107812009-02-13 Rafael Avila de Espindola <espindola@google.com>
10782
10783 * archive.cc (Archive::include_member): Update calls to add_symbols.
10784 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10785 the Layout argument.
10786 * dynobj.h (do_add_symbols): Add the Layout argument.
10787 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10788 Layout argument.
10789 * object.h (Object::add_symbols): Add the Layout argument.
10790 (Object::do_add_symbols): Add the Layout argument.
10791 (Sized_relobj::do_add_symbols): Add the Layout argument.
10792 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10793 Unify the two versions.
10794 (Add_plugin_symbols): Remove.
10795 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10796 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10797 (Add_plugin_symbols): Remove.
10798 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10799 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10800 (Add_symbols::run): Make it work with Pulginobj.
10801
89dd1680
ILT
108022009-02-06 Ian Lance Taylor <iant@google.com>
10803
10804 * object.cc (Sized_relobj::do_layout): Make info message start
10805 with lower case letter.
10806
266d0a74
ILT
108072009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10808
602b464e
ILT
10809 * binary.cc: Fix file comment.
10810
266d0a74
ILT
10811 * options.h (enum Incremental_disposition): Define.
10812 (class General_options): Add new options: --incremental,
10813 --incremental_changed, --incremental_unchanged,
10814 --incremental_unknown. Add incremental_disposition_ and
10815 implicit_incremental_ fields.
10816 (General_options::incremental_disposition): New function.
10817 (class Position_dependent_options): Add incremental_disposition
10818 option.
10819 (Position_dependent_options::copy_from_options): Set incremental
10820 dispositions.
10821 * options.cc (General_options::parse_incremental_changed): New
10822 function.
2e702c99
RM
10823 (General_options::parse_incremental_unchanged): New function.
10824 (General_options::parse_incremental_unknown): New function.
10825 (General_options::General_options): Initialize new fields
266d0a74 10826 incremental_disposition_ and implicit_incremental_.
2e702c99 10827 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
10828 without --incremental.
10829
f073bbf7
CD
108302009-02-06 Chris Demetriou <cgd@google.com>
10831
10832 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10833 pointer and to report location as the file name associated with
10834 the symbol.
10835 (gold_undefined_symbol_at_location): New function to replace the
10836 old gold_undefined_symbol functionality.
10837 * target-reloc.h (relocate_section): Update to use
10838 gold_undefined_symbol_at_location.
10839 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10840 Call gold_undefined_symbol function rather than gold_error.
10841 * errors.h (Errors::undefined_symbol): Take location as a
10842 string, rather than calculating it from a relocation.
10843 * errors.cc (Errors::fatal): Print "fatal error:" before the
10844 formatted message.
10845 (Errors::error, Errors::error_at_location): Print "error: "
10846 before the formatted message.
10847 (Errors::undefined_symbol): Take location as a string, rather
10848 than calculating it from a relocation.
10849 (gold_undefined_symbol_at_location): New function akin to
10850 old gold_undefined_symbol, calculates location from relocation.
10851 (gold_undefined_symbol): Change to take only a Symbol pointer
10852 and to report location as the file name associated with the symbol.
10853 * testsuite/debug_msg.sh: Update for changed error messages.
10854 * testsuite/undef_symbol.sh: Likewise.
10855
8e94a90c
ILT
108562009-02-04 Duncan Sands <baldrick@free.fr>
10857
10858 PR 9812
10859 * reduced_debug_output.h
10860 (Output_reduced_debug_abbrev_section::failed): Use format for
10861 gold_warning.
10862 (Output_reduced_debug_info_section::faild): Likewise.
10863
88a0e15b
ILT
108642009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10865
10866 * script.cc (Lazy_demangler): New class.
2e702c99 10867 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
10868 symbol only once.
10869
5efc7cd2
CC
108702009-01-29 Cary Coutant <ccoutant@google.com>
10871
10872 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10873 to __tls_get_addr.
10874 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10875
e0ebcf42
ILT
108762009-01-28 Ian Lance Taylor <iant@google.com>
10877
5efc7cd2 10878 * version.cc (version_string): Bump to 1.9.
75fe7426 10879
e0ebcf42
ILT
10880 * gold.h: Include <cstring> and <stdint.h>.
10881 * version.cc: Include <cstdio>.
10882 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10883 warning.
10884 * reduced_debug_output.cc (insert_into_vector): Rename from
10885 Insert_into_vector; change all callers. Use Swap_unaligned to
10886 avoid aliasing issue; remove union since it is unnecessary.
10887
8e2813be 108882009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
10889
10890 * Makefile.am (CCFILES): Add gc.cc.
10891 (HFILES): Add gc.h.
10892 * Makefile.in: Regenerate.
10893 * gold.cc (Gc_runner): New class.
10894 (queue_initial_tasks): Call garbage collection related tasks
10895 when corresponding options are invoked.
10896 (queue_middle_gc_tasks): New function.
10897 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10898 processed early before laying out sections during garbage collection.
10899 * gold.h (queue_middle_gc_tasks): New function.
10900 (is_prefix_of): Move from "layout.cc".
10901 * i386.cc (Target_i386::gc_process_relocs): New function.
10902 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10903 * main.cc (main): Create object of class "Garbage_collection".
10904 * object.cc (Relobj::copy_symbols_data): New function.
10905 (Relobj::is_section_name_included): New function.
e1df38aa
NC
10906 (Sized_relobj::do_layout): Allow this function to be called twice
10907 during garbage collection and defer layout of section during the
6d03d481
ST
10908 first call.
10909 * object.h (Relobj::get_symbols_data): New function.
10910 (Relobj::is_section_name_included): New function.
10911 (Relobj::copy_symbols_data): New function.
10912 (Relobj::set_symbols_data): New function.
10913 (Relobj::get_relocs_data): New function.
10914 (Relobj::set_relocs_data): New function.
10915 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10916 (Relobj::gc_process_relocs): New function.
10917 (Relobj::do_gc_process_relocs): New pure virtual function.
10918 (Relobj::sd_): New data member.
10919 (Sized_relobj::is_output_section_offset_invalid): New function.
10920 (Sized_relobj::do_gc_process_relocs): New function.
10921 * options.h (General_options::gc_sections): Modify to not be a no-op.
10922 (General_options::print_gc_sections): New option.
10923 * plugin.cc (Plugin_finish::run): Remove function call to
10924 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10925 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10926 * reloc.cc (Read_relocs::run): Add task to process relocs and
10927 determine unreferenced sections when doing garbage collection.
10928 (Gc_process_relocs): New class.
10929 (Sized_relobj::do_gc_process_relocs): New function.
10930 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10931 sections that are garbage collected.
10932 * reloc.h (Gc_process_relocs): New class.
10933 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10934 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10935 symbols whose corresponding sections are garbage collected.
10936 (Symbol_table::Symbol_table): Add new parameter for the garbage
10937 collection object.
10938 (Symbol_table::gc_mark_undef_symbols): New function.
10939 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10940 (Symbol_table::gc_mark_dyn_syms): New function.
10941 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10942 as garbage.
10943 (Symbol_table::add_from_object): Likewise.
10944 (Symbol_table::add_from_relobj): When building shared objects, do not
10945 treat externally visible symbols as garbage.
10946 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10947 table information for static and relocatable links.
10948 * symtab.h (Symbol_table::set_gc): New function.
10949 (Symbol_table::gc): New function.
10950 (Symbol_table::gc_mark_undef_symbols): New function.
10951 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10952 (Symbol_table::gc_mark_dyn_syms): New function.
10953 (Symbol_table::gc_): New data member.
e1df38aa 10954 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
10955 function.
10956 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10957 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10958
3b293544
CF
109592009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10960
10961 * options.h (General_options::gc_sections): Define as a no-op for now.
10962 (General_options::no_keep_memory): Ditto.
10963 (General_options::Bshareable): Define.
10964 * options.cc (General_options::finalize): Honor -Bshareable.
10965
83d22aa8
AS
109662009-01-20 Andreas Schwab <schwab@suse.de>
10967
10968 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10969 read the value in the contents, since we don't use it. Use the
10970 template endianness when writing.
10971 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10972
cd536b21
AS
109732009-01-19 Andreas Schwab <schwab@suse.de>
10974
10975 * configure.tgt (powerpc64-*): Fix targ_obj.
10976
99e9a495
ILT
109772009-01-15 Ian Lance Taylor <iant@google.com>
10978
10979 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10980 local symbols when stripping all symbols.
10981
bbbfea06
CC
109822009-01-14 Cary Coutant <ccoutant@google.com>
10983
99e9a495 10984 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 10985
0f7c0701
CC
109862009-01-14 Cary Coutant <ccoutant@google.com>
10987
10988 * archive.cc (Archive::get_elf_object_for_member): Remove call
10989 to File_read::claim_for_plugin.
10990 * descriptors.cc (Descriptors::open): Remove reference to
10991 is_claimed.
10992 (Descriptors::claim_for_plugin): Remove.
10993 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10994 (Descriptors::is_claimed): Remove.
10995 (claim_descriptor_for_plugin): Remove.
10996 * fileread.cc (File_read::claim_for_plugin): Remove.
10997 * fileread.h (File_read::claim_for_plugin): Remove.
10998 (File_read::descriptor): Reopen descriptor if necessary.
10999 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
11000 (Plugin_manager::all_symbols_read): Add task parameter. Change
11001 all callers.
11002 (Plugin_manager::get_input_file): New function.
11003 (Plugin_manager::release_input_file): New function.
11004 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11005 corresponding data member.
11006 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11007 and pass to base constructor. Change all callers.
11008 (get_input_file, release_input_file): New functions.
11009 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11010 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11011 (Plugin_manager::all_symbols_read): Add task parameter.
11012 (Plugin_manager::get_input_file): New function.
11013 (Plugin_manager::release_input_file): New function.
11014 (Plugin_manager::task_): New data member.
11015 (Pluginobj::Pluginobj): Add filesize parameter.
11016 (Pluginobj::filename): New function.
11017 (Pluginobj::descriptor): New function.
11018 (Pluginobj::filesize): New function.
11019 (Pluginobj::filesize_): New data member.
11020 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
11021 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
11022 File_read::claim_for_plugin; use Object::unlock to unlock the file.
11023
11024 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
11025 with archive libraries.
11026 * testsuite/Makefile.in: Regenerate.
11027 * testsuite/plugin_test.c (struct sym_info): New type.
11028 (get_input_file, release_input_file): New static variables.
11029 (onload): Capture new transfer vector entries.
11030 (claim_file_hook): Stop reading at end of file according to filesize.
11031 Factor out parsing of readelf output into separate function.
11032 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11033 APIs and get the source file name from the symbol table. Convert
11034 source file name to corresponding object file name. Print info
11035 message when adding new input files.
11036 (parse_readelf_line): New function.
11037 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11038 * testsuite/plugin_test_2.sh: Likewise.
11039 * testsuite/plugin_test_3.sh: Likewise.
11040 * testsuite/plugin_test_4.sh: New test case.
11041
62a6d109
ILT
110422009-01-07 Ian Lance Taylor <iant@google.com>
11043
11044 * version.cc (version_string): Bump to 1.8.
11045
483620e8
CC
110462008-12-23 Cary Coutant <ccoutant@google.com>
11047
11048 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
11049 * plugin.cc (Plugin_manager::finish): Rename as
11050 layout_deferred_objects. Move cleanup to separate function.
11051 (Plugin_manager::cleanup): New function.
11052 (Plugin_finish::run): Call layout_deferred_objects and cleanup
11053 separately.
11054 * plugin.h (Plugin_manager::finish): Rename as
11055 layout_deferred_objects.
11056 (Plugin_manager::cleanup): New function.
11057 (Plugin_manager::cleanup_done): New field.
11058
d66a9eb3
CC
110592008-12-23 Cary Coutant <ccoutant@google.com>
11060
11061 * plugin.cc (is_visible_from_outside): New function.
11062 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
11063 so we don't return "IR only" status for exported symbols or -r links.
11064
11065 * testsuite/Makefile.am (plugin_test_3): New test case.
11066 * testsuite/Makefile.in: Regenerate.
11067 * testsuite/plugin_test_3.sh: New file.
11068
5995b570
CC
110692008-12-22 Cary Coutant <ccoutant@google.com>
11070
11071 * object.cc (Sized_relobj::layout_section): New function.
11072 (Sized_relobj::do_layout): Defer layout of input sections until after
11073 plugin has provided replacement files.
11074 (Sized_relobj::do_layout_deferred_sections): New function.
11075 * object.h (Relobj::set_section_offset): Remove virtual keyword.
11076 (Relobj::layout_deferred_sections): New function.
11077 (Relobj::do_layout_deferred_sections): New function.
11078 (Sized_relobj::do_layout_deferred_sections): New function.
11079 (Sized_relobj::layout_section): New function.
11080 (Sized_relobj::Deferred_layout): New structure.
11081 (Sized_relobj::deferred_layout_): New field.
11082 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
11083 Change all callers. Layout deferred sections.
11084 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
11085 references.
11086 (Plugin_hook::run): Move code from do_plugin_hook inline.
11087 (Plugin_hook::do_plugin_hook): Remove.
11088 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
11089 (Plugin_manager::finish): Renamed, was cleanup.
11090 (Plugin_manager::should_defer_layout): New function.
11091 (Plugin_manager::add_deferred_layout_object): New function.
11092 (Plugin_manager::Deferred_layout_list): New type.
11093 (Plugin_manager::deferred_layout_objects_): New field.
11094 (Plugin_hook::do_plugin_hook): Remove.
11095
ee769c88
ILT
110962008-12-17 Ian Lance Taylor <iant@google.com>
11097
11098 * options.h (class General_options): Add --no case for
11099 --export-dynamic.
11100
abc8dcba
CC
111012008-12-16 Cary Coutant <ccoutant@google.com>
11102
11103 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11104 vector.
11105 (Plugin_manager::claim_file): Create plugin object even if
11106 plugin did not call the add_symbols callback.
11107 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11108 asking for more symbols than were added.
11109 * testsuite/Makefile.am (plugin_test_1): Add test case with
11110 no global symbols.
11111 (empty.syms): New target.
11112 * testsuite/Makefile.in: Regenerate.
11113 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11114 message. Don't call add_symbols if no globals.
11115 (all_symbols_read_hook): Don't provide replacement for empty
11116 claimed file.
11117
b0074644
ILT
111182008-12-12 Ian Lance Taylor <iant@google.com>
11119
68943102
ILT
11120 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11121 r_type == 0 for a local symbol with r_sym == 0.
11122 (scan_relocatable_relocs): Pass r_sym to
11123 local_non_section_strategy.
11124 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11125 r_sym parameter.
11126
b0074644
ILT
11127 * configure.ac: Update test for TLS descriptors: they are
11128 supported as of glibc 2.9.
11129 * configure: Rebuild.
11130
c2508178
ILT
111312008-12-11 Ian Lance Taylor <iant@google.com>
11132
11133 PR 7091
11134 * target-reloc.h (Default_scan_relocatable_relocs): For each
11135 function, map r_type == 0 to RELOC_DISCARD.
11136
2756a258
CC
111372008-12-10 Cary Coutant <ccoutant@google.com>
11138
11139 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11140 object to override a kept COMDAT group from a plugin object.
11141
bb6f53d3
ILT
111422008-12-09 Ian Lance Taylor <iant@google.com>
11143
fbc558e1
ILT
11144 PR 7088
11145 * yyscript.y (file_cmd): Handle INPUT.
11146
bb6f53d3
ILT
11147 * testsuite/initpri1.c: Change all declarations to be full
11148 prototypes by adding void, to avoid compiler warnings.
11149
4674ecfc
CC
111502008-12-05 Rafael Avila de Espindola <espindola@google.com>
11151
11152 * options.cc (General_options::parse_plugin_opt): New.
11153 (General_options::add_plugin): The argument now is just the filename.
11154 (General_options::add_plugin_option): New.
11155 * options.h (plugin_opt): New.
11156 (add_plugin): Change argument name.
11157 (add_plugin_option): New.
11158 * plugin.cc (Plugin::load): Don't parse the plugin option.
11159 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11160 (Plugin::add_option): New.
11161 (Plugin::args_): Change type.
11162 (Plugin::filename_): New.
11163 (Plugin_manager::add_plugin_option): New.
11164 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11165 * testsuite/Makefile.in: Regenerate.
11166
fd06b4aa
CC
111672008-12-05 Cary Coutant <ccoutant@google.com>
11168
11169 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11170 Handle --strip-lto-sections option.
11171 * options.h (strip_lto_sections): New option.
11172
6c52134c
CC
111732008-12-01 Cary Coutant <ccoutant@google.com>
11174
11175 * plugin.cc (ld_plugin_message): Change format parameter to const.
11176 Fix mismatch between new[] and delete.
11177
a45248e0
CC
111782008-11-14 Cary Coutant <ccoutant@google.com>
11179
11180 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11181 instead of -1U.
11182
c82fbeee
CS
111832008-11-05 Craig Silverstein <csilvers@google.com>
11184
11185 * options.cc (General_options::parse_dynamic_list): New function.
11186 * options.h (General_options): New flags dynamic_list,
11187 dynamic_list_data, dynamic_list_cpp_new, and
11188 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11189 (General_options::in_dynamic_list): New function.
11190 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11191 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11192 (Lex::can_continue_name): Likewise.
11193 (yylex): Likewise.
11194 (read_script_file): New parameter script_options.
11195 (read_dynamic_list): New function.
11196 (Script_options::define_dynamic_list): New function.
11197 (dynamic_list_keyword_parsecodes): New variable.
11198 (dynamic_list_keywords): New variable.
11199 * script.h (Script_options::define_dynamic_list): New function
11200 prototype.
11201 (read_dynamic_list): New function prototype.
11202 * symtab.cc (strprefix): New macro.
11203 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11204 dynamic_list_data, dynamic_list_cpp_new, and
11205 dynamic_list_cpp_typeinfo.
11206 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11207 (dynamic_list_expr): New rule.
11208 (dynamic_list_nodes): Likewise.
11209 (dynamic_list_node): Likewise.
11210 * testsuite/Makefile.am (dynamic_list): New test.
11211 * testsuite/Makefile.in: Regenerated.
11212 * testsuite/dynamic_list.t: New file.
11213 * testsuite/dynamic_list.sh: New file.
11214
e0bb29a5
CS
112152008-11-05 Craig Silverstein <csilvers@google.com>
11216
11217 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11218 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11219 (t11_last): Likewise.
11220 * testsuite/ver_test_6.c (main): Likewise.
11221
4e1e25e0
CC
112222008-10-07 Cary Coutant <ccoutant@google.com>
11223
11224 * options.c (General_options::finalize): Add check for -static and
11225 -shared.
11226 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11227 is not empty.
11228
92f03fcb
CC
112292008-10-02 Cary Coutant <ccoutant@google.com>
11230
11231 * plugin.cc (make_sized_plugin_object): Fix conditional
11232 compilation to work when not all targets are enabled.
11233
fbd8a257
CC
112342008-09-29 Cary Coutant <ccoutant@google.com>
11235
11236 * archive.cc (Archive::get_file_and_offset): Use filename instead
11237 of name to get library path.
11238 (Archive::include_member): Unlock external member of a thin archive.
11239
11240 * testsuite/Makefile.am (TEST_AR): New variable.
11241 (thin_archive_test_1): New test.
11242 (thin_archive_test_2): New test.
81636b3f
CC
11243 * testsuite/Makefile.in: Regenerate.
11244 * testsuite/thin_archive_main.cc: New file.
11245 * testsuite/thin_archive_test_1.cc: New file.
11246 * testsuite/thin_archive_test_2.cc: New file.
11247 * testsuite/thin_archive_test_3.cc: New file.
11248 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 11249
eff45813
CC
112502008-09-29 Cary Coutant <ccoutant@google.com>
11251
11252 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11253 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11254 instead of -1U.
11255 (Sized_relobj::do_finalize_local_symbols): Likewise.
11256 (Sized_relobj::map_to_kept_section): Likewise.
11257 * object.h (Sized_relobj::invalid_address): New constant.
11258 (Sized_relobj::do_output_section_offset): Check for invalid_address
11259 and return -1ULL.
11260 * output.cc (Output_reloc::local_section_offset): Use constant
11261 invalid_address instead of -1U.
11262 (Output_reloc::get_address): Likewise.
11263 (Output_section::output_address): Change -1U to -1ULL.
11264 * output.h (Output_reloc::invalid_address): New constant.
11265 * reloc.cc (Sized_relobj::write_sections): Use constant
11266 invalid_address instead of -1U.
11267 (Sized_relobj::relocate_sections): Likewise.
11268 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11269 values for merge sections.
11270 * target-reloc.h (relocate_for_relocatable): Use constant
11271 invalid_address instead of -1U.
11272
89fc3421
CC
112732008-09-19 Cary Coutant <ccoutant@google.com>
11274
11275 Add plugin functionality for link-time optimization (LTO).
11276 * configure.ac (plugins): Add --enable-plugins option.
11277 * configure: Regenerate.
11278 * config.in: Regenerate.
11279 * Makefile.am (LIBDL): New variable.
11280 (CCFILES): Add plugin.cc.
11281 (HFILES): Add plugin.h.
11282 (ldadd_var): Add LIBDL.
11283 * Makefile.in: Regenerate.
11284
11285 * archive.cc: Include "plugin.h".
11286 (Archive::setup): Don't preread archive symbols when using a plugin.
11287 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11288 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11289 files.
11290 (Archive::include_member): Add symbols from plugin objects.
11291 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11292 * descriptors.cc (Descriptors::open): Check for file descriptors
11293 abandoned by plugins.
11294 (Descriptors::claim_for_plugin): New function.
11295 * descriptors.h (Descriptors::claim_for_plugin): New function.
11296 (Open_descriptor::is_claimed): New field.
11297 (claim_descriptor_for_plugin): New function.
11298 * fileread.cc (File_read::claim_for_plugin): New function.
11299 * fileread.h (File_read::claim_for_plugin): New function.
11300 (File_read::descriptor): New function.
11301 * gold.cc: Include "plugin.h".
11302 (queue_initial_tasks): Add task to call plugin hooks for generating
11303 new object files.
11304 * main.cc: Include "plugin.h".
11305 (main): Load plugin libraries.
11306 * object.h (Pluginobj): Declare.
11307 (Object::pluginobj): New function.
11308 (Object::do_pluginobj): New function.
11309 (Object::set_target): New function.
11310 * options.cc: Include "plugin.h".
11311 (General_options::parse_plugin): New function.
11312 (General_options::General_options): Initialize plugins_ field.
11313 (General_options::add_plugin): New function.
11314 * options.h (Plugin_manager): Declare.
11315 (General_options): Add --plugin option.
11316 (General_options::has_plugins): New function.
11317 (General_options::plugins): New function.
11318 (General_options::add_plugin): New function.
11319 (General_options::plugins_): New field.
11320 * plugin.cc: New file.
11321 * plugin.h: New file.
11322 * readsyms.cc: Include "plugin.h".
11323 (Read_symbols::do_read_symbols): Check for archive before checking
11324 for ELF file. Call plugin hooks to claim files.
11325 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11326 from a real object file; force override when processing replacement
11327 files.
11328 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11329 (Symbol::init_base_object): Likewise.
11330 (Symbol::init_base_output_data): Likewise.
11331 (Symbol::init_base_output_segment): Likewise.
11332 (Symbol::init_base_constant): Likewise.
11333 (Symbol::init_base_undefined): Likewise.
11334 (Symbol::output_section): Assert that object is not a plugin.
11335 (Symbol_table::add_from_pluginobj): New function.
11336 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11337 undefined.
11338 (Symbol_table::sized_write_globals): Likewise.
11339 (Symbol_table::add_from_pluginobj): Instantiate template.
11340 * symtab.h (Sized_pluginobj): Declare.
11341 (Symbol::in_real_elf): New function.
11342 (Symbol::set_in_real_elf): New function.
11343 (Symbol::in_real_elf_): New field.
11344 (Symbol_table::add_from_pluginobj): New function.
11345
11346 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11347 (LIBDL): New variable.
11348 (LDADD): Add LIBDL.
11349 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11350 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11351 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11352 (MOSTLYCLEANFILES): Likewise.
11353 * testsuite/Makefile.in: Regenerate.
11354 * testsuite/plugin_test.c: New file.
11355 * testsuite/plugin_test_1.sh: New file.
11356 * testsuite/plugin_test_2.sh: New file.
11357
de31bda5
ILT
113582008-09-16 Ian Lance Taylor <iant@google.com>
11359
9c2d0ef9
ILT
11360 * target-reloc.h (relocate_section): Check whether a symbol is
11361 defined by the ABI before reporting an undefined symbol error.
11362 * target.h (Target::is_defined_by_abi): Make parameter const.
11363 (Target::do_is_defined_by_abi): Likewise.
11364 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11365 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11366 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11367 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11368 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11369 * testsuite/Makefile.in: Rebuild.
11370
de31bda5
ILT
11371 * fileread.cc (make_view): Add casts to avoid warning.
11372
9fa33bee
AO
113732008-09-16 Alexandre Oliva <aoliva@redhat.com>
11374
11375 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11376 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11377
183fd0e3
AO
113782008-09-16 Alexandre Oliva <aoliva@redhat.com>
11379
11380 * options.h (General_options::output_is_executable): New.
11381 (General_options::output_is_pie): New.
11382 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11383 for shared libraries.
11384 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11385
7be8330a
CD
113862008-09-11 Chris Demetriou <cgd@google.com>
11387
11388 * options.h (origin): New -z option.
11389 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11390 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11391 in DT_FLAGS_1.
11392
a9caad02
CC
113932008-09-05 Cary Coutant <ccoutant@google.com>
11394
11395 * fileread.cc (File_read::make_view): Add check for attempt to map
11396 beyond end of file.
11397
ae6dce4d
CC
113982008-09-05 Cary Coutant <ccoutant@google.com>
11399
11400 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11401 explicit instantiations.
11402
d7ab2a47
KVH
114032008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11404
11405 PR gold/6858
11406 * options.cc (General_options::finalize): Allow undefined symbols
11407 in shlibs if linking -shared.
11408
11409 PR gold/6859
11410 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11411 symbols as not needing a dynsym entry.
11412
1e52a9c1
CS
114132008-08-20 Craig Silverstein <csilvers@google.com>
11414
11415 * fileread.cc (File_read::open): Do not lock the file unless it
11416 was successfully opened.
11417
d85c80a3
CC
114182008-08-14 Cary Coutant <ccoutant@google.com>
11419
11420 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11421 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11422 * testsuite/tls_test.cc (struct int128): 128-bit struct
11423 for testing TLS relocs with non-zero addend.
11424 (v12): New TLS variable.
11425 (t12): New test.
11426 (t_last): Add check for v12.
11427 * testsuite/tls_test.h (t12): New function.
11428 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11429
2d924fd9
ILT
114302008-08-13 Ian Lance Taylor <iant@google.com>
11431
11432 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11433 set tls_segment_ or relro_segment_.
11434 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11435 when appropriate.
11436 * output.h (Output_section::clear_is_relro): New function.
11437 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11438 sections specially even when output_data_ is empty.
11439 (Output_segment::maximum_alignment): When first section is relro,
11440 only force alignment for PT_LOAD segments.
11441 * script.cc (script_data_segment_align): New function.
11442 (script_data_segment_relro_end): New function.
11443 * script-c.h (script_data_segment_align): Declare.
11444 (script_data_segment_relro_end): Declare.
11445 * script-sections.h (class Script_sections): Declare
11446 data_segment_align and data_segment_relro_end. Add fields
11447 segment_align_index_ and saw_relro_end_.
11448 * script-sections.cc (class Sections_element): Add set_is_relro
11449 virtual function. Add new bool* parameter to place_orphan_here.
11450 Add get_output_section virtual function.
11451 (class Output_section_definition): Add set_is_relro. Add new
11452 bool* parameter to place_orphan_here. Add get_output_section.
11453 Add is_relro_ field.
11454 (Output_section_definition::Output_section_definition): Initialize
11455 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11456 and is_relro_ fields.
11457 (Output_section_definition::place_orphan_here): Add is_relro
11458 parameter.
11459 (Output_section_definition::set_section_addresses): Set relro for
11460 output section.
11461 (Output_section_definition::alternate_constraint): Likewise.
11462 (class Orphan_output_section): Add new bool* parameter to
11463 place_orphan_here. Add get_output_section.
11464 (Orphan_output_section::place_orphan_here): Add is_relro
11465 parameter.
11466 (Script_sections::Script_sections): Initialize
11467 data_segment_align_index_ and saw_relro_end_.
11468 (Script_sections::data_segment_align): New function.
11469 (Script_sections::data_segment_relro_end): New function.
11470 (Script_sections::place_orphan): Set or clear is_relro.
11471 (Script_sections::set_section_addresses): Force alignment of first
11472 TLS section.
11473 * yyscript.y (exp): Call script_data_segment_align and
11474 script_data_segment_relro_end.
11475 * testsuite/relro_script_test.t: New file.
11476 * testsuite/relro_test.cc (using_script): Declare.
11477 (t1, t2): Test using_script.
11478 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11479 (relro_script_test_SOURCES): Define.
11480 (relro_script_test_DEPENDENCIES): Define.
11481 (relro_script_test_LDFLAGS): Define.
11482 (relro_script_test_LDADD): Define.
11483 (relro_script_test.so): New target.
11484 * testsuite/Makefile.in: Rebuild.
11485
f827c9a9
CC
114862008-08-06 Cary Coutant <ccoutant@google.com>
11487
11488 * archive.cc (Archive::total_archives, Archive::total_members)
11489 (Archive::total_members_loaded): New variables.
11490 (Archive::setup): Add parameter. Add option to preread
11491 archive symbols.
11492 (Archive::read_armap): Add counter.
11493 (Archive::get_file_and_offset): New function.
11494 (Archive::get_elf_object_for_member): New function.
11495 (Archive::read_all_symbols): New function.
11496 (Archive::read_symbols): New function.
11497 (Archive::add_symbols): Add counters.
11498 (Archive::include_all_members): Use armap to find members if it's
11499 already built.
11500 (Archive::include_member): Skip reading symbols if already read.
11501 Factored code into Archive::get_file_and_offset and
11502 Archive::get_elf_object_for_member. Changed call to
11503 Mapfile::report_include_archive_member.
11504 (Archive::print_stats): New function.
11505 * archive.h: Declare Object and Read_symbols_data classes.
11506 (Archive::Archive): Add initializers for new members.
11507 (Archive::setup): Add parameter.
11508 (Archive::print_stats): New function.
11509 (Archive::total_archives, Archive::total_members)
11510 (Archive::total_members_loaded): New variables.
11511 (Archive::get_file_and_offset): New function.
11512 (Archive::get_elf_object_for_member): New function.
11513 (Archive::read_all_symbols): New function.
11514 (Archive::read_symbols): New function.
11515 (Archive::Archive_member): New class.
11516 (Archive::members_): New member.
11517 (Archive::num_members_): New member.
11518 * main.cc: Include archive.h.
11519 (main): Call Archive::print_stats.
11520 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11521 archive parameter; member_name is now the fully-decorated name.
11522 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11523 * options.h: (General_options): Add --preread-archive-symbols option.
11524 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11525 Archive::setup.
11526
de4c45bd
ILT
115272008-08-04 Ian Lance Taylor <iant@google.com>
11528
11529 * symtab.h (Symbol::use_plt_offset): New function.
11530 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11531 * powerpc.cc (Relocate::relocate): Likewise.
11532 * sparc.cc (Relocate::relocate): Likewise.
11533 * x86_64.cc (Relocate::relocate): Likewise.
11534 * testsuite/weak_plt.sh: New test.
11535 * testsuite/weak_plt_main.cc: New test.
11536 * testsuite/weak_plt_shared.cc: New test.
11537 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11538 (check_PROGRAMS): Add weak_plt.
11539 (check_DATA): Add weak_plt_shared.so.
11540 (weak_plt_main_pic.o, weak_plt): New targets.
11541 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11542 * testsuite/Makefile.in: Rebuild.
11543
11544 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11545 gcctestdir/ld.
11546 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11547 * testsuite/Makefile.in: Rebuild.
11548
323ee3f4
AM
115492008-08-04 Alan Modra <amodra@bigpond.net.au>
11550
11551 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11552 * Makefile.in: Regenerate.
11553 * po/POTFILES.in: Regenerate.
11554
7c07ecec
ILT
115552008-07-29 Ian Lance Taylor <iant@google.com>
11556
11557 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11558 symbols before other symbols.
11559 * testsuite/script_test_2.cc (test_addr): Declare.
11560 (test_addr_alias): Declare.
11561 (main): Check that test_addr and test_addr_alias have the right
cd536b21 11562 values.
7c07ecec
ILT
11563 * testsuite/script_test_2.t: Define test_addr_alias and
11564 test_addr.
11565
5778530e
ILT
115662008-07-24 Ian Lance Taylor <iant@google.com>
11567
2a00e4fb
ILT
11568 PR 5990
11569 * descriptors.cc: New file.
11570 * descriptors.h: New file.
11571 * gold-threads.h (class Hold_optional_lock): New class.
11572 * fileread.cc: Include "descriptors.h".
11573 (File_read::~File_read): Release descriptor rather than closing
11574 it.
11575 (File_read::open) [file]: Call open_descriptor rather than open.
11576 Set is_descriptor_opened_.
11577 (File_read::open) [memory]: Assert that descriptor is not open.
11578 (File_read::reopen_descriptor): New function.
11579 (File_read::release): Release descriptor.
11580 (File_read::do_read): Make non-const. Reopen descriptor.
11581 (File_read::read): Make non-const.
11582 (File_read::make_view): Reopen descriptor.
11583 (File_read::do_readv): Likewise.
11584 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11585 Update declarations.
11586 * layout.cc: Include "descriptors.h".
11587 (Layout::create_build_id): Use open_descriptor rather than open.
11588 * output.cc: Include "descriptors.h".
11589 (Output_file::open): Use open_descriptor rather than open.
11590 * archive.cc (Archive::const_iterator): Change Archive to be
11591 non-const.
11592 (Archive::begin, Archive::end): Make non-const.
11593 (Archive::count_members): Likewise.
11594 * archive.h (class Archive): Update declarations.
11595 * object.h (Object::read): Make non-const.
11596 * Makefile.am (CCFILES): Add descriptors.cc.
11597 (HFILES): Add descriptors.h.
11598 * Makefile.in: Rebuild.
11599
801647d1
ILT
11600 PR 6716
11601 * gold.h: Always include <clocale>. Add Solaris workarounds
11602 following code in binutils/sysdep.h.
11603
5edd166e
ILT
11604 PR 6048
11605 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11606 this->eh_frame_hdr_ is NULL before using it.
11607
c89ad728
ILT
11608 * dynobj.cc (Versions::Versions): Update comment.
11609
aa86f06b
ILT
11610 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11611 the base version name.
11612
5778530e
ILT
11613 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11614 array size plus one.
11615 (Stringpool_template::set_string_offsets): Subtract one from key
11616 before using it as an array index.
11617 (Stringpool_template::get_offset_with_length): Likewise.
11618 (Stringpool_template::write_to_buffer): Likewise.
11619 * stringpool.h (Stringpool_template::get_offset_from_key):
11620 Likewise.
11621
057ead22
ILT
116222008-07-23 Ian Lance Taylor <iant@google.com>
11623
7f649c59
ILT
11624 PR 6658
11625 * object.h (Merged_symbol_value::value): Do our best to handle a
11626 negative addend.
11627
057ead22
ILT
11628 PR 6647
11629 * script.cc (Version_script_info::get_versions): Don't add empty
11630 version tag to return value.
11631 (Version_script_info::get_symbol_version_helper): Change return
11632 type to bool. Add pversion parameter. Change all callers.
11633 (script_register_vers_node): Don't require a non-NULL tag.
11634 * script.h (class Version_script_info): Update declarations.
11635 (Version_script_info::get_symbol_version): Change return type to
11636 bool. Add version parameter. Change all callers.
11637 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11638 handling. Handle an empty version from a version script.
11639 (Symbol_table::define_special_symbol): Likewise.
11640 * testsuite/ver_test_10.script: New file.
11641 * testsuite/ver_test_10.sh: New file.
11642 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11643 (check_DATA): Add ver_test_10.syms.
11644 (ver_test_10.syms, ver_test_10.so): New target.
11645 * testsuite/Makefile.in: Rebuild.
11646
58e54ac2
CD
116472008-07-23 Simon Baldwin <simonb@google.com>
11648
11649 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11650 to zero for undefined symbols from dynamic libraries.
11651
95d14cd3
ILT
116522008-07-23 Ian Lance Taylor <iant@google.com>
11653
11654 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11655 Change all callers.
11656 * symtab.h (class Symbol_table): Update declaration.
11657 * testsuite/ver_test_9.cc: New file.
11658 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11659 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11660 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11661 (ver_test_9.so, ver_test_9.o): New targets.
11662 * testsuite/Makefile.in: Rebuild.
11663
92de84a6
ILT
116642008-07-22 Ian Lance Taylor <iant@google.com>
11665
34810851
ILT
11666 * options.h (class General_options): Define --check-sections.
11667 * layout.cc (Layout::set_segment_offsets): Handle
11668 --check-sections.
11669
af6156ef
ILT
11670 * options.h (class General_options): Define -n/--nmagic and
11671 -N/--omagic.
11672 * options.cc (General_options::finalize): For -n/--nmagic or
11673 -N/--omagic, set -static.
11674 * layout.cc (Layout::attach_allocated_section_to_segment): If
11675 -N/--omagic, don't put read-only and read-write sections in
11676 different segments.
11677 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11678 finding a read-only segment.
11679 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11680 don't set the minimum segment alignment to the common page size,
11681 and don't set the file offset to the address modulo the page size.
11682 * script-sections.cc (Script_sections::create_segments): If
11683 -n/--omagic, don't put read-only and read-write sections in
11684 different segments.
11685
92de84a6
ILT
11686 * cref.cc: New file.
11687 * cref.h: New file.
11688 * options.h (class General_options): Add --print-symbol-counts.
11689 * main.cc (main): Issue defined symbol report if requested.
11690 * archive.cc (Archive::interpret_header): Make into a const member
11691 function.
11692 (Archive::add_symbols): Call Input_objects::archive_start and
11693 archive_stop.
11694 (Archive::const_iterator): Define new class.
11695 (Archive::begin, Archive::end): New functions.
11696 (Archive::include_all_members): Rewrite to use iterator.
11697 (Archive::count_members): New function.
11698 * archive.h (class Archive): Update declarations.
11699 (Archive::filename): New function.
11700 * object.cc: Include "cref.h".
11701 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11702 (Sized_relobj::do_get_global_symbol_counts): New function.
11703 (Input_objects::add_object): Add object to cross-referencer.
11704 (Input_objects::archive_start): New function.
11705 (Input_objects::archive_stop): New function.
11706 (Input_objects::print_symbol_counts): New function.
11707 * object.h: Declare Cref and Archive.
11708 (Object::get_global_symbol_counts): New function.
11709 (Object::do_get_global_symbol_counts): New pure virtual function.
11710 (class Sized_relobj): Add defined_count_ field. Update
11711 declarations.
11712 (class Input_objects): Add cref_ field. Update constructor.
11713 Update declarations.
11714 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11715 defined_count_.
11716 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11717 symbol counts.
11718 (Sized_dynobj::do_get_global_symbol_counts): New function.
11719 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11720 defined_count_. Update declarations. Define Symbols typedef.
11721 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11722 parameter. Change all callers.
11723 (Symbol_table::add_from_dynobj): Add sympointers and defined
11724 parameters. Change all callers.
11725 * symtab.h (class Symbol_table): Update declarations.
11726 * Makefile.am (CCFILES): Add cref.cc.
11727 (HFILES): Add cref.h.
11728 * Makefile.in: Rebuild.
11729
3f7c5e1d
CD
117302008-07-22 Simon Baldwin <simonb@google.com>
11731
11732 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11733 to zero when writing undefined symbols.
11734
e0b64032
ILT
117352008-07-22 Ian Lance Taylor <iant@google.com>
11736
11737 * output.cc (Output_section::add_input_section): Don't try to
11738 merge empty merge sections.
11739
096b02cf
CS
117402008-07-21 Craig Silverstein <csilvers@google.com>
11741
11742 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11743 Include symbol version in error message.
cd536b21 11744
1d1f116d
CD
117452008-07-20 Chris Demetriou <cgd@google.com>
11746
cd536b21 11747 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
11748 (RANDOM_SEED_CFLAGS): New substituted variable.
11749 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11750 * configure: Rebuild.
11751 * Makefile.in: Likewise.
11752 * testsuite/Makefile.in: Likewise.
11753
a18f591e
ILT
117542008-07-18 Ian Lance Taylor <iant@google.com>
11755
11756 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11757 where we see NAME/NULL and NAME/VERSION as separate symbols.
11758 * testsuite/ver_test_main.cc (main): Call t4.
11759 (t4, t4_2a): Define.
11760 * testsuite/ver_test_2.cc (t4_2): Define.
11761 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11762 * testsuite/ver_test_4.cc (t4_2a): Define.
11763 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11764 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11765
c6e3f6ed
ILT
117662008-07-17 Ian Lance Taylor <iant@google.com>
11767
11768 * dynobj.cc (Versions::add_def): If we give an error about a
11769 missing version, go ahead and create the version anyhow.
11770
ef9beddf
ILT
117712008-07-10 Ian Lance Taylor <iant@google.com>
11772
11773 Handle output sections with more than 0x7fffffff bytes.
11774 * object.h (class Relobj): Change map_to_output_ to
11775 output_sections_, and just keep a section pointer. Change all
11776 uses. Move comdat group support to Sized_relobj.
11777 (Relobj::is_section_specially_mapped): Remove.
11778 (Relobj::output_section): Remove poff parameter. Change all
11779 callers.
11780 (Relobj::output_section_offset): New function.
11781 (Relobj::set_section_offset): Rewrite.
11782 (Relobj::map_to_output): Remove.
11783 (Relobj::output_sections): New function.
11784 (Relobj::do_output_section_offset): New pure virtual function.
11785 (Relobj::do_set_section_offset): Likewise.
11786 (class Sized_relobj): Add section_offsets_ field. Add comdat
11787 group support from Relobj. Update declarations.
11788 (Sized_relobj::get_output_section_offset): New function.
11789 (Sized_relobj::do_output_section_offset): New function.
11790 (Sized_relobj::do_set_section_offset): New function.
11791 * object.cc (Relobj::output_section_address): Remove.
11792 (Sized_relobj::Sized_relobj): Initialize new fields.
11793 (Sized_relobj::include_section_group): Cast find_kept_object to
11794 Sized_relobj.
11795 (Sized_relobj::include_linkonce_section): Likewise.
11796 (Sized_relobj::do_layout): Use separate arrays for output section
11797 and output offset.
11798 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11799 output_sections.
11800 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11801 output_sections and section_offsets.
11802 (Sized_relobj::write_local_symbols): Likewise.
11803 (map_to_kept_section): Compute output address directly.
11804 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11805 output_sections and section_offsets.
11806 (Sized_relobj::write_sections): Likewise.
11807 (Sized_relobj::relocate_sections): Likewise.
11808 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11809 * output.h (class Output_reloc): Update declarations. Change
11810 u2_.relobj to Sized_relobj*.
11811 (class Output_data_reloc): Change add functions to use
11812 Sized_relobj*.
11813 * output.cc (Output_reloc::Output_reloc): Change relobj to
11814 Sized_relobj*.
11815 (Output_reloc::local_section_offset): Change return type to
11816 Elf_Addr. Use get_output_section_offset.
11817 (Output_reloc::get_address): Likewise.
11818 (Output_section::is_input_address_mapped): Don't call
11819 is_section_specially_mapped.
11820 (Output_section::output_offset): Likewise.
11821 (Output_section::output_address): Likewise.
11822 (Output_section::starting_output_address): Likewise.
11823 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11824 parameter to Sized_relobj*.
11825 (Copy_relocs::need_copy_reloc): Likewise.
11826 (Copy_relocs::save): Likewise.
11827 * copy-relocs.h (class Copy_relocs): Update declarations.
11828 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11829 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11830 * target-reloc.h (relocate_for_relocatable): Change
11831 offset_in_output_section type to Elf_Addr. Change code that uses
11832 it as well.
11833 * layout.cc (Layout::layout): Always set *off.
11834 * mapfile.cc (Mapfile::print_input_section): Use
11835 output_section_offset.
11836 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11837 Sized_relobj*.
11838 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11839 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11840 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11841
5cb66f97
ILT
118422008-07-03 Ian Lance Taylor <iant@google.com>
11843
11844 * layout.cc (Layout::include_section): Do not discard unrecognized
11845 SHT_STRTAB sections.
11846
afe47622
CS
118472008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11848
11849 * script.cc (Lex::can_continue_name): Make '?' allowable in
11850 version-script names.
11851 * testsuite/version_script.map: Change glob pattern to use '?'
11852
5adf9721
ILT
118532008-06-30 Manish Singh <yosh@gimp.org>
11854
11855 PR 6585
11856 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11857 Correct typo.
11858
e6fde208
ILT
118592008-06-30 Ian Lance Taylor <iant@google.com>
11860
11861 PR 6660
11862 PR 6682
11863 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11864 versions]: Don't try to read the value in the contents, since we
11865 don't use it. Use the template endianness when writing.
11866
3f2e6a2d
CC
118672008-06-25 Cary Coutant <ccoutant@google.com>
11868
11869 * fileread.cc (File_read::make_view): Assert on zero-length view.
11870 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11871 symbol table when there are no symbols to read.
11872
c43d3a48
CS
118732008-06-23 Craig Silverstein <csilvers@google.com>
11874
11875 * version.cc (version_string): Bump to 1.7
11876
5f494ea0
CS
118772008-06-18 Craig Silverstein <csilvers@google.com>
11878
11879 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11880 constant 0xFFFF to type Valtype.
11881 (Powerpc_relocate_functions::rel16_ha): Likewise.
11882
c42e122e
ILT
118832008-06-17 Ian Lance Taylor <iant@google.com>
11884
f34787f8
ILT
11885 * output.h (Output_section::Input_section): Initialize p2align_ to
11886 zero for Output_section_data constructors.
11887 (Output_section::Input_section::addralign): If not an input
11888 section, return the alignment of the Output_section_data.
11889 * testsuite/copy_test.cc: New file.
11890 * testsuite/copy_test_1.cc: New file.
11891 * testsuite/copy_test_2.cc: New file.
11892 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11893 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11894 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11895 (copy_test_1_pic.o, copy_test_1.so): New targets.
11896 (copy_test_2_pic.o, copy_test_2.so): New targets.
11897 * testsuite/Makefile.in: Rebuild.
11898
c42e122e
ILT
11899 * script-sections.cc (Script_sections::place_orphan): Initialize
11900 local variable exact.
11901
ce3ac18a
DE
119022008-06-13 David Edelsohn <edelsohn@gnu.org>
11903
11904 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11905
42cacb20
DE
119062008-06-12 David Edelsohn <edelsohn@gnu.org>
11907 David S. Miller <davem@davemloft.net>
11908
11909 * powerpc.cc: New file.
11910 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11911 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11912 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11913 * Makefile.in: Rebuild.
11914
7b308235
ILT
119152008-06-09 Ian Lance Taylor <iant@google.com>
11916
11917 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11918 <exception>.
11919 (throwing, orig_terminate): New static variables.
11920 (terminate_handler): New static function.
11921 (t2): Set terminate handler.
11922
f0b886e3
ILT
119232008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11924
11925 PR 6584
cd536b21 11926 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
11927 alignment.
11928
3e90f135
CC
119292008-05-30 Cary Coutant <ccoutant@google.com>
11930
11931 * archive.cc (Archive::include_all_members) Correct to step
11932 over symbol table and extended name table in thin archives.
11933
e09ad04a
ILT
119342008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11935
11936 PR 6407
11937 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11938 calculation.
11939
62b01cb5
ILT
119402008-05-28 Caleb Howe <cshowe@google.com>
11941
11942 * reduced_debug_output.cc: New file.
11943 * reduced_debug_output.h: New file.
92de84a6 11944 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
11945 * options.cc (General_options::finalize): Add strip_debug_non_line
11946 to the strip heirarchy.
11947 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11948 fields.
11949 * layout.cc: Include "reduced_debug_output.h".
11950 (Layout::Layout): Initialize new fields.
11951 (line_only_debug_sections): New static array.
11952 (is_lines_only_debug_sections): New static inline function.
11953 (Layout::include_section): Handle --strip-debug-non-line.
11954 (Layout::make_output_section): If --strip-debug-non-line, build
11955 new output sections for .debug_abbrev and .debug_info.
11956 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11957 gold. Warn about possible overflow.
11958 (read_signed_LEB_128): Likewise.
11959 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11960 (read_signed_LEB_128): Declare.
11961 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11962 (HFILES): Add reduced_debug_output.h.
11963 * Makefile.in: Rebuild.
11964
7d9e3d98
ILT
119652008-05-21 Ian Lance Taylor <iant@google.com>
11966
11967 * mapfile.cc: New file.
11968 * mapfile.h: New file.
11969 * options.h (class General_options): Add -M/--print-map and -Map.
11970 * options.cc (General_options::finalize): Make -M equivalent to
11971 -Map -.
11972 * main.cc: Include <cstdio> and "mapfile.h".
11973 (main): Open mapfile if requested.
11974 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11975 constructor. Change caller.
11976 (queue_initial_tasks): Add mapfile parameter. Change caller.
11977 (queue_middle_tasks): Likewise.
11978 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11979 declarations.
11980 * archive.cc: Include "mapfile.h".
11981 (Archive::add_symbols): Add mapfile parameter. Change all
11982 callers. Pass mapfile, symbol, and reason to include_member.
11983 (Archive::include_all_members): Add mapfile parameter. Change all
11984 callers.
11985 (Archive::include_member): Add mapfile, sym, and why parameters.
11986 Change all callers. Report inclusion to map file.
11987 * archive.h: Include "fileread.h".
11988 (class Archive): Update declarations.
11989 (Archive::file): New const method.
11990 (class Add_archive_symbols): Add mapfile_ field. Update
11991 constructor. Change all callers.
11992 * readsyms.h (class Read_symbols): Likewise.
11993 (class Finish_group): Likewise.
11994 (class Read_script): Likewise.
11995 * common.cc: Include "mapfile.h".
11996 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11997 all callers.
11998 (Symbol_table::do_allocate_commons): Likewise.
11999 (Symbol_table::do_allocate_commons_list): Likewise. Report common
12000 symbol allocation to mapfile.
12001 * common.h (class Allocate_commons_task): Add mapfile_ field.
12002 Update constructor. Change all callers.
12003 * symtab.h (class Symbol_table): Update declarations.
12004 * layout.cc: Include "mapfile.h".
12005 (Layout_task_runner::run): Print information to mapfile.
12006 (Layout::create_gold_note): Change Output_data_fixed_space to
12007 Output_data_zero_fill.
12008 (Layout::create_build_id): Likewise.
12009 (Layout::print_to_mapfile): New function.
12010 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12011 constructor. Change caller.
12012 (class Layout): Declare print_to_mapfile.
12013 * output.cc (Output_section::Input_section::print_to_mapfile): New
12014 function.
12015 (Output_section::add_input_section): If producing a map, always
12016 add to input_sections_ list.
12017 (Output_section::do_print_to_mapfile): New function.
12018 (Output_segment::print_sections_to_mapfile): New function.
12019 (Output_segment::print_section_list_to_mapfile): New function.
12020 * output.h: Include "mapfile.h".
12021 (Output_data::print_to_mapfile): New function.
12022 (Output_data::do_print_to_mapfile): New virtual function.
12023 (Output_segment_headers::do_print_to_mapfile): New function.
12024 (Output_file_header::do_print_to_mapfile): New function.
12025 (Output_data_const::do_print_to_mapfile): New function.
12026 (class Output_data_const_buffer): Add map_name_ field. Update
12027 constructor. Change all callers. Add do_print_to_mapfile
12028 function.
12029 (class Output_data_fixed_space): Likewise.
12030 (class Output_data_space): Likewise.
12031 (class Output_data_zero_fill): New class.
12032 (Output_data_strtab::do_print_to_mapfile): New function.
12033 (Output_data_reloc_base::do_print_to_mapfile): New function.
12034 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12035 (Output_data_group::do_print_to_mapfile): New function.
12036 (Output_data_got::do_print_to_mapfile): New function.
12037 (Output_data_dynamic::do_print_to_mapfile): New function.
12038 (Output_symtab_xindex::do_print_to_mapfile): New function.
12039 (class Output_section): Declare do_print_to_mapflie. Declare
12040 print_to_mapfile in Input_section.
12041 (class Output_segment): Declare new functions.
12042 * object.h (Sized_relobj::symbol_count): New function.
12043 * script-sections.cc
12044 (Output_section_element_dot_assignment::set_section_addresses):
12045 Change Output_data_fixed_space to Output_data_zero_fill.
12046 (Output_data_expression::do_print_to_mapfile): New function.
12047 * script.cc (read_input_script): Add mapfile parameter. Change
12048 all callers.
12049 * script.h (read_input_script): Update declaration.
12050 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
12051 (Eh_frame::do_print_to_mapfile): New function.
12052 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
12053 (Output_merge_string::do_print_to_mapfile): New function.
12054 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
12055 function.
12056 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
12057 function.
12058 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
12059 function.
12060 * Makefile.am (CCFILES): Add mapfile.cc.
12061 (HFILES): Add mapfile.h.
12062 * Makefile.in: Rebuild.
12063
9f1d377b
ILT
120642008-05-19 Ian Lance Taylor <iant@google.com>
12065
12066 * options.h (class General_options): Add -z relro.
12067 * layout.cc (Layout::Layout): Initialize relro_segment_.
12068 (Layout::add_output_section_data): Return the output section.
12069 (Layout::make_output_section): Rcognize relro sections and mark
12070 them appropriately.
12071 (Layout::attach_allocated_section_to_segment): Put relro sections
12072 in a PT_GNU_RELRO segment.
12073 (Layout::create_initial_dynamic_sections): Mark the .dynamic
12074 section as relro.
12075 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
12076 PT_TLS segments.
12077 (Layout::linkonce_mapping): Map d.rel.ro.local to
12078 .data.rel.ro.local.
12079 (Layout::output_section_name): Us .data.rel.ro.local for any
12080 section which begins with that.
12081 * layout.h (class Layout): Update add_output_section_data
12082 declaration. Add relro_segment_ field.
12083 * output.cc (Output_section::Output_section): Initialize is_relro_
12084 and is_relro_local_ fields.
12085 (Output_segment::add_output_section): Group relro sections.
12086 (Output_segment::is_first_section_relro): New function.
12087 (Output_segment::maximum_alignment): If there is a relro section,
12088 align the segment to the common page size.
12089 (Output_segment::set_section_addresses): Track whether we are
12090 looking at relro sections. If the last section is a relro
12091 section, align to the common page size.
12092 (Output_segment::set_section_list_addresses): Add in_relro
12093 parameter. Change all callers. Align to the page size when
12094 moving from relro to non-relro section.
12095 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
12096 segment.
12097 * output.h (class Output_section): Add is_relro_ and
12098 is_relro_local_ fields.
12099 (Output_section::is_relro): New function.
12100 (Output_section::set_is_relro): New function.
12101 (Output_section::is_relro_local): New function.
12102 (Output_section::set_is_relro_local): New function.
12103 (class Output_segment): Update declarations.
12104 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12105 * sparc.cc (Target_sparc::got_section): Likewise.
12106 * x86_64.cc (Target_x86_64::got_section): Likewise.
12107 * testsuite/relro_test_main.cc: New file.
12108 * testsuite/relro_test.cc: New file.
12109 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12110 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12111 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12112 (relro_test.so, relro_test_pic.o): New targets.
12113 * testsuite/Makefile.in: Rebuild.
12114
a984ee1d
ILT
121152008-05-16 Ian Lance Taylor <iant@google.com>
12116
01676dcd
ILT
12117 * output.cc (Output_segment::add_output_section): Remove front
12118 parameter.
12119 * output.h (class Output_segment): Remove
12120 add_initial_output_section and overloaded add_output_section.
12121 Update declaration of remaining add_output_section.
12122 * layout.cc (Layout::create_interp): Call add_output_section
12123 rather than add_initial_output_section.
12124 (Layout::finish_dynamic_section): Likewise.
12125
497897f9
ILT
12126 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12127 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12128 know the dynamic type.
12129 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12130 field. Initialize it in constructor.
12131 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12132 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12133 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12134 reloc.
12135
a984ee1d
ILT
12136 * output.cc (Output_reloc::get_address): Change return type to
12137 Elf_Addr.
12138 * output.h (class Output_reloc): Update get_address declaration.
12139 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12140 for section addresses.
12141
55ba0940
ILT
121422008-05-09 Ian Lance Taylor <iant@google.com>
12143
12144 PR 6493
12145 * gold.cc (gold_nomem): Use return value of write.
12146
75517b77
ILT
121472008-05-08 Ian Lance Taylor <iant@google.com>
12148
12149 * symtab.c (Symbol::init_base_output_data): Add version
12150 parameter. Change all callers.
12151 (Symbol::init_base_output_segment): Likewise.
12152 (Symbol::init_base_constant): Likewise.
12153 (Symbol::init_base_undefined): Likewise.
12154 (Sized_symbol::init_output_data): Likewise.
12155 (Sized_symbol::init_output_segment): Likewise.
12156 (Sized_symbol::init_constant): Likewise.
12157 (Sized_symbol::init_undefined): Likewise.
12158 (Symbol_table::do_define_in_output_data): If the new symbol has a
12159 version, mark it as the default.
12160 (Symbol_table::do_define_in_output_segment): Likewise.
12161 (Symbol_table::do_define_as_constant): Likewise.
12162 * symtab.h (class Symbol): Update declarations.
12163 (class Sized_symbol): Likewise.
12164 * resolve.cc (Symbol::override_version): New function.
c42e122e 12165 (Symbol::override_base): Call override_version.
75517b77
ILT
12166 (Symbol::override_base_with_special): Likewise.
12167 * testsuite/ver_script_8.script: New file.
12168 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12169 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12170 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12171 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12172
f1f70eae
ILT
121732008-05-06 Ian Lance Taylor <iant@google.com>
12174
f3e9c5c5
ILT
12175 PR 6049
12176 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12177 functions.
12178 (class General_options): Remove existing --undefined, and add
12179 --no-undefined instead. Add new --undefined as synonym for -u.
12180 * archive.cc (Archive::add_symbols): Check whether symbol was
12181 named with -u.
12182 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12183 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12184 all uses. Add IS_UNDEFINED. Update declarations to split
12185 different versions of init_base. Declare init_base_undefined.
12186 (Symbol::is_defined): Handle IS_UNDEFINED.
12187 (Symbol::is_undefined): Likewise.
12188 (Symbol::is_weak_undefined): Call is_undefined.
12189 (Symbol::is_absolute): Handle IS_CONSTANT.
12190 (class Sized_symbol): Update declarations to split different
12191 versions of init. Declare init_undefined.
12192 (class Symbol_table): Declare new functions.
12193 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12194 Change all callers.
12195 (Symbol::init_base_output_data): Likewise.
12196 (Symbol::init_base_output_segment): Likewise.
12197 (Symbol::init_base_constant): Likewise.
12198 (Symbol::init_base_undefined): New function.
12199 (Sized_symbol::init_object): Rename from init. Change all
12200 callers.
12201 (Sized_symbol::init_output_data): Likewise.
12202 (Sized_symbol::init_output_segment): Likewise.
12203 (Sized_symbol::init_constant): Likewise.
12204 (Sized_symbol::init_undefined): New function.
12205 (Symbol_table::add_undefined_symbols_from_command_line): New
12206 function.
12207 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12208 function.
12209 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12210 (Symbol::output_section): Likewise.
12211 (Symbol::set_output_section): Likewise.
12212 (Symbol_table::sized_finalize_symbol): Likewise.
12213 (Symbol_table::sized_write_globals): Likewise.
12214 * resolve.cc (Symbol_table::should_override): Likewise.
12215 (Symbol::override_base_with_special): Likewise.
12216
8bdcdf2c
ILT
12217 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12218 symbol, change it to have default visibility.
12219 * testsuite/protected_1.cc: New file.
12220 * testsuite/protected_2.cc: New file.
12221 * testsuite/protected_3.cc: New file.
12222 * testsuite/protected_main_1.cc: New file.
12223 * testsuite/protected_main_2.cc: New file.
12224 * testsuite/protected_main_3.cc: New file.
12225 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12226 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12227 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12228 (protected_1.so): New target.
12229 (protected_1_pic.o, protected_2_pic.o): New targets.
12230 (protected_3_pic.o): New target.
12231 (check_PROGRAMS): Add protected_2.
12232 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12233 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12234 * testsuite/Makefile.in: Rebuild.
12235
2b706932
ILT
12236 * options.h (DEFINE_var): Add set_user_set_##varname__.
12237 (DEFINE_bool_alias): New macro.
12238 (class General_options): Define -Bstatic using DEFINE_bool_alias
12239 rather than DEFINE_special. Add --undefined as an alias for -z
12240 defs.
12241 * options.cc (General_options::parse_Bstatic): Remove.
12242
d82a5bcc
ILT
12243 * options.h (class General_options): Add --fatal-warnings.
12244 * main.cc (main): Implement --fatal-warnings.
12245 * errors.h (Errors::warning_count): New function.
12246
f1f70eae
ILT
12247 * options.h (class General_options): Add -Bsymbolic-functions.
12248 * symtab.h (Symbol::is_preemptible): Check for
12249 -Bsymbolic-functions.
12250
8825ac63
ILT
122512008-05-05 Ian Lance Taylor <iant@google.com>
12252
d98bc257
ILT
12253 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12254 as noVARNAME rather than no-VARNAME.
12255 (class General_options): Add option -z combreloc.
12256 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12257 get_address.
12258 (Output_reloc::sort_before) [SHT_REL]: New function.
12259 (Output_reloc::sort_before) [SHT_RELA]: New function.
12260 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12261 Sort_relocs_comparison.
12262 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12263 parameter. Change all callers.
12264 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12265 sort_relocs parameter. Change all callers.
12266 * output.cc (Output_reloc::get_address): New function, broken out
12267 of write_rel.
12268 (Output_reloc::write_rel): Call it.
12269 (Output_reloc::compare): New function.
12270 (Output_data_reloc_base::do_write): Optionally sort relocs.
12271
60b2b4e7
ILT
12272 * configure.ac: If targ_extra_obj is set, link it in.
12273 * configure.tgt: Initialize all variables.
12274 (x86_64*): Set targ_extra_obj and targ_extra_size.
12275 * configure: Rebuild.
12276
8825ac63
ILT
12277 * object.cc (Sized_relobj::include_section_group): Adjust section
12278 indexes read from group data. Build vector to pass to
12279 layout_group.
12280 * layout.cc (Layout::layout_group): Add flags and shndxes
12281 parameters. Remove contents parameter. Change caller. Update
12282 explicit instantiations.
12283 * layout.h (class Layout): Update layout_group declaration.
12284 * output.cc (Output_data_group::Output_data_group): Add flags and
12285 input_shndxes parameters. Remove contents parameter. Change
12286 caller.
12287 (Output_data_group::do_write): Change input_sections_ to
12288 input_shndxes_.
12289 * output.h (class Output_data_group): Update constructor
12290 declaration. Rename input_sections_ to input_shndxes_.
12291 * testsuite/many_sections_test.cc: Add template.
12292
e94cf127
CC
122932008-04-30 Cary Coutant <ccoutant@google.com>
12294
4418b2d5
CC
12295 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12296
e94cf127
CC
12297 * layout.cc (Layout::include_section): Refactored check for debug
12298 info section.
12299 (Layout::add_comdat): Add new parameters. Change type
12300 of signature parameter. Add object and shndx to signatures table.
12301 (Layout::find_kept_object): New function.
12302 * layout.h: Include <cstring>.
12303 (Layout::is_debug_info_section): New function.
12304 (Layout::add_comdat): Add new parameters.
12305 (Layout::find_kept_object): New function.
12306 (Layout::Kept_section): New struct.
12307 (Layout::Signatures): Change type of map range.
12308 * object.cc (Relobj::output_section_address): New function.
12309 (Sized_relobj::include_section_group): Add new parameters. Change
12310 calls to Layout::add_comdat. Change to build table of kept comdat
12311 groups and table mapping discarded sections to kept sections.
12312 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12313 (Sized_relobj::do_layout): Change calls to include_section_group and
12314 include_linkonce_section.
12315 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12316 value to zero when section is discarded.
12317 (Sized_relobj::map_to_kept_section): New function.
12318 * object.h (Relobj::output_section_address): New function.
12319 (Relobj::Comdat_group): New type.
12320 (Relobj::find_comdat_group): New function.
12321 (Relobj::Comdat_group_table): New type.
12322 (Relobj::Kept_comdat_section): New type.
12323 (Relobj::Kept_comdat_section_table): New type.
12324 (Relobj::add_comdat_group): New function.
12325 (Relobj::set_kept_comdat_section): New function.
12326 (Relobj::get_kept_comdat_section): New function.
12327 (Relobj::comdat_groups_): New field.
12328 (Relobj::kept_comdat_sections_): New field.
12329 (Symbol_value::input_value): Update comment.
12330 (Sized_relobj::map_to_kept_section) New function.
12331 (Sized_relobj::include_linkonce_section): Add new parameter.
12332 * target-reloc.h (Comdat_behavior): New type.
12333 (get_comdat_behavior): New function.
12334 (relocate_section): Add code to map a discarded section to the
12335 corresponding kept section when applying a relocation.
12336
e4e5049b
CS
123372008-04-30 Craig Silverstein <csilvers@google.com>
12338
12339 * dwarf_reader.cc (next_generation_count): New static var.
12340 (Addr2line_cache_entry): New struct.
12341 (addr2line_cache): New static var.
12342 (Dwarf_line_info::one_addr2line): Added caching.
12343 (Dwarf_line_info::clear_addr2line_cache): New function.
12344 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12345 cache-size parameter.
12346 (Dwarf_line_info::one_addr2line_cache): New function.
12347 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12348 new cache-size argument to one_addr2line(), and clear cache.
12349
d09e9154
CC
123502008-04-28 Cary Coutant <ccoutant@google.com>
12351
12352 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12353 R_386_PC8 relocations.
12354
7ef73768
ILT
123552008-04-23 Ian Lance Taylor <iant@google.com>
12356
55438702
ILT
12357 * object.cc (Sized_relobj::include_section_group): Check for
12358 invalid section group.
12359
c165fb93
ILT
12360 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12361 header size.
12362
7ef73768
ILT
12363 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12364 than read for file header.
12365 * archive.cc (Archive::include_member): Likewise.
12366
6194aaab
L
123672008-04-23 Paolo Bonzini <bonzini@gnu.org>
12368
12369 * aclocal.m4: Regenerate.
12370 * configure: Regenerate.
12371
d491d34e
ILT
123722008-04-19 Ian Lance Taylor <iant@google.com>
12373
5ea2bac6
ILT
12374 * version.cc (version_string): Bump to 1.6.
12375
7bc3e21a
ILT
12376 * testsuite/Makefile.am (many_sections_r_test): New target.
12377 (many_sections_r_test_SOURCES): Remove.
12378 (many_sections_r_test_DEPENDENCIES): Remove.
12379 (many_sections_r_test_LDFLAGS): Remove.
12380 (many_sections_r_test_LDADD): Remove.
12381
7fcd3aa9
ILT
12382 * object.cc (Sized_relobj::do_add_symbols): Always pass
12383 local_symbol_count_ to add_from_relobj.
12384
4c94d6ae
ILT
12385 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12386 every thousand variables.
12387 * testsuite/Makefile.in: Rebuild.
12388
d491d34e
ILT
12389 * object.cc (Xindex::initialize_symtab_xindex): New function.
12390 (Xindex::read_symtab_xindex): New function.
12391 (Xindex::sym_xindex_to_shndx): New function.
12392 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12393 available.
12394 (Sized_relobj::do_initialize_xindex): New function.
12395 (Sized_relobj::do_read_symbols): Adjust section links.
12396 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12397 parameter. Change all callers.
12398 (Sized_relobj::include_section_group): Adjust section links and
12399 symbol section indexes.
12400 (Sized_relobj::do_layout): Adjust section links.
12401 (Sized_relobj::do_count_local_symbols): Adjust section links and
12402 symbol section indexes.
12403 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12404 ordinary and special symbols.
12405 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12406 dynsym_xindex parameters. Change all callers. Adjust section
12407 links. Use SHN_XINDEX when needed.
12408 (Sized_relobj::get_symbol_location_info): Adjust section links.
12409 Don't get fooled by special symbols.
12410 * object.h (class Xindex): Define.
12411 (class Object): Add xindex_ parameter. Declare virtual functoin
12412 do_initialize_xindex.
12413 (Object::adjust_sym_shndx): New function.
12414 (Object::set_xindex): New protected function.
12415 (class Symbol_value): Add is_ordinary_shndx_ field.
12416 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12417 (Symbol_value::value): Assert ordinary section.
12418 (Symbol_value::initialize_input_to_output_map): Likewise.
12419 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12420 Change all callers.
12421 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12422 all callers.
12423 (class Sized_relobj): Update declarations.
12424 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12425 parameter. Change all callers.
12426 (Sized_relobj::adjust_shndx): New function.
12427 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12428 field.
12429 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12430 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12431 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12432 (Sized_dynobj::read_dynsym_section): Adjust section links.
12433 (Sized_dynobj::read_dynamic): Likewise.
12434 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12435 section links.
12436 (Sized_dynobj::do_initialize_xindex): New function.
12437 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12438 do_initialize_xindex.
12439 (Sized_dynobj::adjust_shndx): New function.
12440 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12441 dynsym_xindex_ fields.
12442 (Layout::finalize): Add a call to set_section_indexes before
12443 creating the symtab sections.
12444 (Layout::set_section_indexes): Don't do anything if the section
12445 already has a section index.
12446 (Layout::create_symtab_sections): Add shnum parameter. Change
12447 caller. Create .symtab_shndx section if needed.
12448 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12449 caller.
12450 (Layout::allocated_output_section_count): New function.
12451 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12452 needed.
12453 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12454 fields. Update declarations.
12455 (Layout::symtab_xindex): New function.
12456 (Layout::dynsym_xindex): New function.
12457 (class Write_symbols_task): Add layout_ field.
12458 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12459 Change caller.
12460 * output.cc (Output_section_headers::Output_section_headers): Add
12461 shstrtab_section parameter. Change all callers.
12462 (Output_section_headers::do_sized_write): Store overflow values
12463 for section count and section string table section index in
12464 section header zero.
12465 (Output_file_header::do_sized_write): Check for overflow of
12466 section count and section string table section index.
12467 (Output_symtab_xindex::do_write): New function.
12468 (Output_symtab_xindex::endian_do_write): New function.
12469 * output.h (class Output_section_headers): Add shstrtab_section_.
12470 Update declarations.
12471 (class Output_symtab_xindex): Define.
12472 (Output_section::has_out_shndx): New function.
12473 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12474 field.
12475 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12476 Change all callers.
12477 (Sized_symbol::init): Likewise.
12478 (Symbol::output_section): Check for ordinary symbol.
12479 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12480 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12481 callers.
12482 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12483 Change all callers. Simplify handling of symbols from sections
12484 not included in the link.
12485 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12486 distinction.
12487 (Weak_alias_sorter::operator()): Assert that symbols are
12488 ordinary.
12489 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12490 distinction.
12491 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12492 parameters. Change all callers.
12493 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12494 symbol distinction. Use SHN_XINDEX when needed.
12495 (Symbol_table::write_section_symbol): Add symtab_xindex
12496 parameter. Change all callers.
12497 (Symbol_table::sized_write_section_symbol): Likewise. Use
12498 SHN_XINDEX when needed.
12499 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12500 declarations.
12501 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12502 (Symbol::is_defined): Check is_ordinary.
12503 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12504 (Symbol::is_absolute, Symbol::is_common): Likewise.
12505 (class Sized_symbol): Update declarations.
12506 (class Symbol_table): Update declarations.
12507 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12508 parameters. Change all callers.
12509 (Sized_symbol::override): Likewise.
12510 (Symbol_table::override): Likewise.
12511 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12512 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12513 is_ordinary, and orig_st_shndx parameters. Change all callers.
12514 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12515 to be in an ordinary section.
12516 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12517 object and is_ordinary parameters. Change all callers.
12518 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12519 Change all callers. Don't add undefined or non-ordinary symbols
12520 to reloc_map_.
12521 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12522 Change all callers.
12523 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12524 declarations.
12525 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12526 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12527 (Sized_relobj::relocate_sections): Likewise.
12528 * target-reloc.h (scan_relocs): Adjust section symbol index.
12529 (scan_relocatable_relocs): Likewise.
12530 * i386.cc (Scan::local): Check for ordinary symbols.
12531 * sparc.cc (Scan::local): Likewise.
12532 * x86_64.cc (Scan::local): Likewise.
12533 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12534 to symbol_section_and_value.
12535 * testsuite/many_sections_test.cc: New file.
12536 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12537 (check_PROGRAMS): Add many_sections_test.
12538 (many_sections_test_SOURCES): Define.
12539 (many_sections_test_DEPENDENCIES): Define.
12540 (many_sections_test_LDFLAGS): Define.
12541 (BUILT_SOURCES): Add many_sections_define.h.
12542 (many_sections_define.h): New target.
12543 (BUILT_SOURCES): Add many_sections_check.h.
12544 (many_sections_check.h): New target.
12545 (check_PROGRAMS): Add many_sections_r_test.
12546 (many_sections_r_test_SOURCES): Define.
12547 (many_sections_r_test_DEPENDENCIES): Define.
12548 (many_sections_r_test_LDFLAGS): Define.
12549 (many_sections_r_test_LDADD): Define.
12550 (many_sections_r_test.o): New target.
12551 * testsuite/Makefile.in: Rebuild.
12552
c5818ff1
CC
125532008-04-17 Cary Coutant <ccoutant@google.com>
12554
12555 * errors.cc (Errors::info): New function.
12556 (gold_info): New function.
12557 * errors.h (Errors::info): New function.
12558 * gold.h (gold_info): New function.
12559 * object.cc (Input_objects::add_object): Print trace output.
12560 * options.cc (options::parse_set): New function.
12561 (General_options::parse_wrap): Deleted.
12562 (General_options::General_options): Deleted initializer.
12563 * options.h (options::String_set): New typedef.
12564 (options::parse_set): New function.
12565 (DEFINE_set): New macro.
12566 (General_options::wrap): Changed to use DEFINE_set. Changed
12567 callers of any_wrap_symbols and is_wrap_symbol.
12568 (General_options::trace, General_options::trace_symbol):
12569 New options.
12570 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12571 (General_options::wrap_symbols_): Deleted.
12572 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12573
b5be4a7c
DM
125742008-04-17 David S. Miller <davem@davemloft.net>
12575
12576 * options.cc (General_options::parse_V): New function.
12577 * options.h: Add entries for -V and -Qy.
12578
155a0dd7
ILT
125792008-04-17 Ian Lance Taylor <iant@google.com>
12580
12581 * common.cc (Symbol_table::allocate_commons): Remove options
12582 parameter. Change caller.
12583 (Symbol_table::do_allocate_commons): Remove options parameter.
12584 Change caller. Just call do_allocate_commons_list twice.
12585 (Symbol_table::do_allocate_commons_list): New function, broken out
12586 of do_allocate_commons.
12587 * common.h (class Allocate_commons_task): Remove options_ field.
12588 Update constructor.
12589 * symtab.cc (Symbol_table::Symbol_table): Initialize
12590 tls_commons_.
12591 (Symbol_table::add_from_object): Put TLS common symbols on
12592 tls_commons_ list.
12593 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12594 which are IN_OUTPUT_DATA.
12595 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12596 allocate_commons and do_allocate_commons declarations. Declare
12597 do_allocate_commons_list.
12598 * gold.cc (queue_middle_tasks): Update creation of
12599 Allocate_commons_task to not pass options.
12600 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12601 (TLS_TEST_C_FLAGS): New variable.
12602 (tls_test_c_pic.o): New target.
12603 (tls_test_shared.so): Link in tls_test_c_pic.o.
12604 (tls_test_c_pic_ie.o): New target.
12605 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12606 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12607 (tls_test_c.o): New target.
12608 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12609 (tls_pic_test_LDADD): Likewise.
12610 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12611 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12612 (tls_test_c_gnu2.o): New target.
12613 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12614 tls_test_c_gnu2.o.
12615 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12616 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12617 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12618 * testsuite/tls_test.cc: Include "config.h".
12619 (t_last): Call t11_last.
12620 * testsuite/tls_test.h (t11, t11_last): Declare.
12621 * testsuite/tls_test_c.c: New file.
12622 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12623 * configure.ac: Check for OpenMP support.
12624 * configure, config.in, Makefile.in: Rebuild.
12625 * testsuite/Makefile.in: Rebuild.
12626
edfbb029
CC
126272008-04-16 Cary Coutant <ccoutant@google.com>
12628
12629 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12630 (Target_i386::tls_base_symbol_defined_): New field.
12631 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12632 (Target_i386::Scan::global): Likewise.
12633 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12634 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12635 (Target_x86_64::tls_base_symbol_defined_): New field.
12636 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12637 (Target_x86_64::Scan::global): Likewise.
12638
f3c69fca
CC
126392008-04-16 Cary Coutant <ccoutant@google.com>
12640
12641 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12642 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12643 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12644 building shared libraries.
12645 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12646 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12647 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12648 * testsuite/Makefile.in: Rebuild.
12649 * testsuite/weak_undef.h: New file.
12650 * testsuite/weak_undef_file1.cc: Add extra test cases.
12651 * testsuite/weak_undef_file2.cc: Likewise.
12652 * testsuite/weak_undef_test.cc: Likewise.
12653
7c414435
DM
126542008-04-16 David S. Miller <davem@davemloft.net>
12655
32b769e1
DM
12656 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12657 Add issued_non_pic_error_ field. Declare check_non_pic.
12658 (Target_sparc::Scan::check_non_pic): New function.
12659 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12660 (Target_sparc::Scan::global): Likewise.
12661
11936fb1
DM
12662 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12663 * configure: Rebuild.
12664
7c414435
DM
12665 * options.h (DEFINE_enable): New macro.
12666 (new_dtags): New enable option.
12667 (initfirst, interpose, loadfltr, nodefaultlib,
12668 nodelete, nodlopen, nodump): New -z options.
12669 * layout.cc (Layout:finish_dynamic_section): If new
12670 dtags enabled, emit DT_RUNPATH. Also, emit a
12671 DT_FLAGS_1 containing any specified -z flags.
12672
85c7bf8b
ILT
126732008-04-16 Ian Lance Taylor <iant@google.com>
12674
12c0daef
ILT
12675 * copy-relocs.cc: New file.
12676 * copy-relocs.h: New file.
12677 * reloc.cc: Remove Copy_relocs code.
12678 * reloc.h: Likewise.
12679 * reloc-types.h (struct Reloc_types) [both versions]: Add
12680 get_reloc_addend_noerror.
12681 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12682 variants of add_global which take an addend which must be zero.
12683 * i386.cc: Include "copy-relocs.h".
12684 (class Target_i386): Change type of copy_relocs_ to variable,
12685 update initializer.
12686 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12687 Change all callers.
12688 (Target_i386::do_finalize_sections): Change handling of
12689 copy_relocs_.
12690 * sparc.cc: Include "copy-relocs.h".
12691 (class Target_sparc): Change type of copy_relocs_ to variable,
12692 update initializer.
12693 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12694 Change all callers.
12695 (Target_sparc::do_finalize_sections): Change handling of
12696 copy_relocs_.
12697 * x86_64.cc: Include "copy-relocs.h".
12698 (class Target_x86_64): Change type of copy_relocs_ to variable,
12699 update initializer.
12700 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12701 class. Change all callers.
12702 (Target_x86_64::do_finalize_sections): Change handling of
12703 copy_relocs_.
12704 * Makefile.am (CCFILES): Add copy-relocs.cc.
12705 (HFILES): Add copy-relocs.h.
12706
4f4995b6
ILT
12707 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12708
85c7bf8b
ILT
12709 * testsuite/script_test_4.sh: Permit leading zeroes.
12710
4f2a9edd
ILT
127112008-04-15 Ian Lance Taylor <iant@google.com>
12712
e6188289
ILT
12713 * script-sections.cc (Script_sections::create_segments): Use
12714 header_size_adjustment even when there is enough room for the
12715 headers.
12716 * testsuite/script_test_4.sh: New file.
12717 * testsuite/script_test_4.t: New file.
12718 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12719 (check_DATA): Add script_test_4.stdout.
12720 (MOSTLYCLEANFILES): Likewise.
12721 (script_test_4): New target.
12722 (script_test_4.stdout): New target.
12723 * testsuite/Makefile.in: Rebuild.
12724
4f2a9edd
ILT
12725 * sparc.cc: Add definitions for Output_data_plt_sparc class
12726 constants.
12727
f5314dd5
DM
127282008-04-14 David S. Miller <davem@davemloft.net>
12729
12730 * sparc.cc: New file.
12731 * Makefile.am (TARGETSOURCES): Add sparc.cc
12732 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12733 * configure.tgt: Document targ_extra_size and
12734 targ_extra_big_endian. Add entries for sparc-* and
12735 sparc64-*.
12736 * configure.ac: Handle targ_extra_size and
12737 targ_extra_big_endian.
12738 * Makefile.in: Rebuild.
12739 * configure: Likewise.
12740 * po/POTFILES.in: Likewise.
12741 * po/gold.pot: Likewise.
12742
154e0e9a
ILT
127432008-04-14 Ian Lance Taylor <iant@google.com>
12744
12745 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12746 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12747 in the name/type/flags to section mapping. Don't call
12748 allocate_output_section.
12749 (Layout::choose_output_section): Change parameter from adjust_name
12750 to is_input_section. Don't permit input sections after sections
12751 are attached to segments. Don't call allocate_output_section.
12752 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12753 not write_enable_output_section.
12754 (Layout::make_output_section): Don't push to
12755 unattached_section_list_ nor call attach_to_segment. Call
12756 attach_section_to_segment if sections are attached.
12757 (Layout::attach_sections_to_segments): New function.
12758 (Layout::attach_section_to_segment): New function.
12759 (Layout::attach_allocated_section_to_segment): Rename from
12760 attach_to_segment. Remove flags parameter.
12761 (Layout::allocate_output_section): Remove function.
12762 (Layout::write_enable_output_section): Remove function.
12763 * layout.h (class Layout): Update for above changes. Add new
12764 field sections_are_attached_.
12765 * output.h (Output_section::update_flags_for_input_section): New
12766 function.
12767 * output.cc (Output_section::add_input_section): Call
12768 update_flags_for_input_section.
12769 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12770
009a67a2
CC
127712008-04-11 Cary Coutant <ccoutant@google.com>
12772
12773 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12774 thought unnecessary.
12775 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12776
759b1a24
ILT
127772008-04-11 Ian Lance Taylor <iant@google.com>
12778
12779 * output.h (class Output_section_data): Remove inline definition
12780 of set_addralign.
12781 * output.cc (Output_section_data::set_addralign): New function.
12782
c2b45e22
CC
127832008-04-11 Cary Coutant <ccoutant@google.com>
12784
12785 Add support for TLS descriptors for i386 and x86_64.
12786 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12787 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12788 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12789 GOT_TYPE_TLS_DESC.
12790 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12791 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12792 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12793 relocations.
12794 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12795 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12796 Fix problem with initial-exec relocations.
12797 (Target_i386::Relocate::relocate_tls): Likewise.
12798 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12799 relaxation.
12800 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12801 support for section-plus-offset dynamic table entries.
12802 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12803 (Output_data_dynamic::Dynamic_entry): Add support for
12804 section-plus-offset dynamic table entries.
12805 (Output_data_dynamic::Classification): Likewise.
12806 (Output_data_dynamic::classification_): Renamed offset_.
12807 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12808 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12809 (Target_x86_64::make_plt_section): New function.
12810 (Target_x86_64::reserve_tlsdesc_entries): New function.
12811 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12812 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12813 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12814 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12815 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12816 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12817 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12818 add extra PLT entry for TLS descriptors.
12819 (Output_data_plt_x86_64::got_): New field.
12820 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12821 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12822 fields.
12823 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12824 descriptors.
12825 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12826 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12827 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12828 R_386_TLS_DESC_CALL relocations.
12829 (Target_x86_64::Scan::global): Likewise.
12830 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12831 for TLS descriptors.
12832 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12833 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12834 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12835 GD-to-IE relaxation.
12836 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12837 and TLS_DESCRIPTORS.
12838 * Makefile.in: Rebuild.
12839 * configure: Rebuild.
12840 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12841 (tls_test_shared2.so): New target.
12842 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12843 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12844 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12845 (tls_shared_gd_to_ie_test_LDADD): New variable.
12846 (tls_shared_gnu2_gd_to_ie_test): New target.
12847 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12848 New targets.
12849 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12850 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12851 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12852 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12853 (tls_shared_gnu2_test): New target.
12854 (tls_test_gnu2_shared.so): New target.
12855 (tls_shared_gnu2_test_SOURCES): New variable.
12856 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12857 (tls_shared_gnu2_test_LDFLAGS): New variable.
12858 (tls_shared_gnu2_test_LDADD): New variable.
12859 * testsuite/Makefile.in: Rebuild.
12860 * testsuite/Makefile.
12861
83bfb6b7
ILT
128622008-04-11 Ian Lance Taylor <iant@google.com>
12863
12864 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12865 justsyms.t.
12866 * testsuite/Makefile.in: Rebuild.
12867
12868 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12869 long.
12870 * testsuite/script_test_2.cc (main): Adjust test.
12871
706e1f5e
ILT
128722008-04-11 David S. Miller <davem@davemloft.net>
12873 Ian Lance Taylor <iant@google.com>
12874
12875 * options.h (General_options): Add entries for '-Y' and
12876 '-relax'.
12877 * options.cc (General_options:finalize): If -Y was used, add those
12878 entries to the library path instead of the default "/lib" and
12879 "/usr/lib".
12880
7c98e6bb
DM
128812008-04-11 David S. Miller <davem@davemloft.net>
12882
12883 * testsuite/justsyms.t: Start at 0x100.
12884 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
12885 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12886 long.
12887 * testsuite/script_test_2.cc: Adjust string and section length
12888 checks.
7c98e6bb 12889
99a37bfd
ILT
128902008-04-09 Ian Lance Taylor <iant@google.com>
12891
2cefc357
ILT
12892 PR gold/5996
12893 * script-sections.cc (Sections_element::allocate_to_segment): Add
12894 orphan parameter.
12895 (Output_section_definition::allocate_to_segment): Likewise.
12896 (Orphan_output_section::allocate_to_segment): Likewise.
12897 (Script_sections::attach_sections_using_phdrs_clause): Don't
12898 propagate non-PT_LOAD segments to orphan sections.
12899 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12900 readelf rather than objdump.
12901 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12902 .interp section and PT_INTERP segment are the same size.
12903 * testsuite/Makefile.in: Rebuild.
12904
99a37bfd
ILT
12905 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12906 aliases for symbols defined in the same object.
12907 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12908 (weak_alias_test_SOURCES): New variable.
12909 (weak_alias_test_DEPENDENCIES): New variable.
12910 (weak_alias_test_LDFLAGS): New variable.
12911 (weak_alias_test_LDADD): New variable.
12912 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12913 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12914 (weak_alias_test_3.o): New target.
12915 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12916 * testsuite/weak_alias_test_main.cc: New file.
12917 * testsuite/weak_alias_test_1.cc: New file.
12918 * testsuite/weak_alias_test_2.cc: New file.
12919 * testsuite/weak_alias_test_3.cc: New file.
12920
780e49c5
ILT
129212008-04-08 Ian Lance Taylor <iant@google.com>
12922
cdb0b8f5
ILT
12923 * options.h (class General_options): Add --noinhibit-exec option.
12924 * main.cc (main): Check --noinhibit-exec.
12925
0864d551
ILT
12926 * options.h (class General_options): Define --wrap as a special
12927 option. Add wrap_symbols_ field.
12928 (General_options::any_wrap_symbols): New function.
12929 (General_options::is_wrap_symbol): New function.
12930 * options.cc (General_options::parse_wrap): New function.
12931 (General_options::General_options): Initialize wrap_symbols_.
12932 * symtab.cc (Symbol_table::wrap_symbol): New function.
12933 (Symbol_table::add_from_object): Handle --wrap.
12934 * symtab.h (class Symbol_table): Declare wrap_symbol.
12935 * target.h (Target::wrap_char): New function.
12936 (Target::Target_info): Add wrap_char field.
12937 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12938 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12939 * testsuite/testfile.cc (Target_test::test_target_info):
12940 Likewise.
12941
789aa6de
ILT
12942 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12943 there is one.
12944
2c38906f
ILT
12945 * layout.h (class Layout): Add added_eh_frame_data_ field.
12946 * layout.cc (Layout::Layout): Initialize new field.
12947 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12948 output section until we find a section we merged successfully.
12949 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12950 that the size be non-zero.
12951
780e49c5
ILT
12952 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12953 qualifier.
12954
7fcd0256
ILT
129552008-04-08 Craig Silverstein <csilvers@google.com>
12956
12957 * configure.ac: Export new conditional variable HAVE_ZLIB.
12958 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12959 on HAVE_ZLIB.
12960 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12961 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12962
6835af53
ILT
129632008-04-07 Ian Lance Taylor <iant@google.com>
12964
e24f324c
ILT
12965 * version.cc (version_string): Set to "1.5".
12966
a036edd8
ILT
12967 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12968 Add issued_non_pic_error_ field. Declare check_non_pic.
12969 (Target_x86_64::Scan::check_non_pic): New function.
12970 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12971 (Target_x86_64::Scan::global): Likewise.
12972
624f8810
ILT
12973 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12974 addend parameter. Change caller. Handle merge sections.
12975 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12976 Address to Addend. Don't add in the result of
12977 local_section_offset, pass down the addend and use the returned
12978 value.
12979 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12980 Update declarations of local_section_offset and symbol_value.
12981 * testsuite/two_file_test_1.cc (t18): New function.
12982 * testsuite/two_file_test_2.cc (f18): New function.
12983 * testsuite/two_file_test_main.cc (main): Call t18.
12984 * testsuite/two_file_test.h (t18, f18): Declare.
12985
6835af53
ILT
12986 * configure.ac: Don't test for objdump, c++filt, or readelf.
12987 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12988 conditionals.
12989 (TEST_READELF): New variable.
12990 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12991 (check_PROGRAMS): Add two_file_strip_test.
12992 (two_file_strip_test): New target.
12993 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12994 (two_file_same_shared_strip_test_SOURCES): New variable.
12995 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12996 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12997 (two_file_same_shared_strip_test_LDADD): New variable.
12998 (two_file_shared_strip.so): New target.
12999 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
13000 (ver_test_5.syms, ver_test_7.syms): Likewise.
13001 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
13002 (strip_test_3.stdout): Use TEST_OBJDUMP.
13003 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13004
86925eef
CC
130052008-04-04 Cary Coutant <ccoutant@google.com>
13006
13007 * symtab.h (Symbol::is_weak_undefined): New function.
13008 (Symbol::is_strong_undefined): New function.
13009 (Symbol::is_absolute): New function.
13010 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13011 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13012 absolute symbols.
13013 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
13014 (weak_undef_test): New target.
13015 * testsuite/Makefile.in: Rebuild.
13016 * testsuite/weak_undef_file1.cc: New file.
13017 * testsuite/weak_undef_file2.cc: New file.
13018 * testsuite/weak_undef_test.cc: New file.
13019
126f3ece
ILT
130202008-04-03 Craig Silverstein <csilvers@google.com>
13021
13022 * compressed_output.h (class Output_compressed_section): Use
13023 unsigned buffer.
13024 * compressed_output.cc (zlib_compress): Use unsigned buffers,
13025 add zlib header.
13026 (zlib_compressed_suffix): Removed.
13027 (Output_compressed_section::set_final_data_size): Use unsigned
13028 buffers.
13029 * testsuite/Makefile.am (flagstest_compress_debug_sections):
13030 Fix linker invocation.
13031 (flagstest_o_specialfile_and_compress_debug_sections):
13032 Likewise.
13033 * testsuite/Makefile.in: Regenerated.
13034
deae2a14
DM
130352008-04-02 David S. Miller <davem@davemloft.net>
13036
13037 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13038 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13039
70752818
ILT
130402008-04-02 Craig Silverstein <csilvers@google.com>
13041
13042 * TODO: New file.
13043
39d0cb0e
ILT
130442008-04-02 Ian Lance Taylor <iant@google.com>
13045
13046 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13047 parameters. Update for new key type to views_. Change all
13048 callers.
13049 (File_read::read): Adjust for byteshift in returned view.
13050 (File_read::add_view): New function, broken out of
13051 find_and_make_view.
13052 (File_read::make_view): New function, broken out of
13053 find_and_make_view.
13054 (File_read::find_or_make_view): Add offset and aligned
13055 parameters. Rewrite accordingly. Change all callers.
13056 (File_read::get_view): Add offset and aligned parameters. Adjust
13057 for byteshift in return value.
13058 (File_read::get_lasting_view): Likewise.
13059 * fileread.h (class File_read): Update declarations.
13060 (class File_read::View): Add byteshift_ field. Add byteshift to
13061 constructor. Add byteshift method.
13062 * archive.h (Archive::clear_uncached_views): New function.
13063 (Archive::get_view): Add aligned parameter. Change all callers.
13064 * object.h (Object::get_view): Add aligned parameter. Change all
13065 callers.
13066 (Object::get_lasting_view): Likewise.
13067
13068 * fileread.cc (File_read::release): Don't call clear_views if
13069 there are multiple objects.
13070 * fileread.h (File_read::clear_uncached_views): New function.
13071 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
13072 on the archive.
13073
a1207466
CC
130742008-03-31 Cary Coutant <ccoutant@google.com>
13075
13076 Add thin archive support.
13077 * archive.cc (Archive::armagt): New const.
13078 (Archive::setup): Remove task parameter and calls to unlock.
13079 (Archive::unlock_nested_archives): New function.
13080 (Archive::read_header): Add nested_off parameter. Change
13081 all callers.
13082 (Archive::interpret_header): Likewise.
13083 (Archive::include_all_members): Change to handle thin
13084 archives.
13085 (Archive::include_member): Likewise.
13086 * archive.h (Archive::Archive): Add new parameters and
13087 initializers.
13088 (Archive::armagt): New const.
13089 (Archive::setup): Remove task parameter.
13090 (Archive::unlock_nested_archives): New function.
13091 (Archive::read_header): Add nested_off parameter.
13092 (Archive::interpret_header): Likewise.
13093 (Archive::Nested_archive_table): New typedef.
13094 (Archive::is_thin_archive_): New field.
13095 (Archive::nested_archives_): New field.
13096 (Archive::options_): New field.
13097 (Archive::dirpath_): New field.
13098 (Archive::task_): New field.
13099 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13100 for thin archives. Pass additional parameters to
13101 Archive::Archive. Unlock the archive file after calling
13102 Archive::setup.
cd536b21 13103
479f6503
ILT
131042008-03-29 Ian Lance Taylor <iant@google.com>
13105
686c8caf
ILT
13106 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13107 version symbol to be local.
13108 * testsuite/ver_test_4.sh: New file.
13109 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13110 (check_DATA): Add ver_test_4.syms.
13111 (ver_test_4.syms): New target.
13112 * testsuite/Makefile.in: Rebuild.
13113
ab794b6b
ILT
13114 * output.cc
13115 (Output_section::Input_section_sort_entry::has_priority): New
13116 function.
13117 (Output_section::Input_section_sort_entry::match_file_name): New
13118 function.
13119 (Output_section::Input_section_sort_entry::match_section_name):
13120 Remove.
13121 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13122 Remove.
13123 (Output_section::Input_section_sort_entry::match_section_file):
13124 Remove.
13125 (Output_section::Input_section_sort_compare::operator()): Rewrite
13126 using new Input_section_sort_entry functions. Sort crtbegin and
13127 crtend first. Sort sections with no priority before sections with
13128 a priority.
13129 * testsuite/initpri1.c (d3): Check j != 4.
13130 (cd5): New constructor/destructor function.
13131 (main): Check j != 2.
13132
479f6503
ILT
13133 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13134 new symbol when resolving, don't call set_is_default.
13135 * testsuite/ver_test_7.cc: New file.
13136 * testsuite/ver_test_7.sh: New file.
13137 * testsuite/Makefile.am (ver_test_7.so): New target.
13138 (ver_test_7.o): New target.
13139 (check_SCRIPTS): Add ver_test_7.sh.
13140 (check_DATA): Add ver_test_7.syms.
13141 (ver_test_7.syms): New target.
13142
2fd32231
ILT
131432008-03-28 Ian Lance Taylor <iant@google.com>
13144
13145 * layout.cc (Layout::layout): If we see an input section with a
13146 name that needs sorting, set the must_sort flag for the output
13147 section.
13148 (Layout::make_output_section): If the name of the output section
13149 indicates that it might require sorting, set the may_sort flag.
13150 * output.h (Output_section::may_sort_attached_input_sections): New
13151 function.
13152 (Output_section::set_may_sort_attached_input_sections): New
13153 function.
13154 (Output_section::must_sort_attached_input_sections): New
13155 function.
13156 (Output_section::set_must_sort_attached_input_sections): New
13157 function.
13158 (class Output_section): Declare Input_section_sort_entry. Define
13159 Input_section_sort_compare. Declare
13160 sort_attached_input_sections. Add new fields:
13161 may_sort_attached_input_sections_,
13162 must_sort_attached_input_sections_,
13163 attached_input_sections_are_sorted_.
13164 * output.cc (Output_section::Output_section): Initialize new
13165 fields.
13166 (Output_section::add_input_section): Add an entry to
13167 input_sections_ if may_sort or must_sort are true.
13168 (Output_section::set_final_data_size): Call
13169 sort_attached_input_sections if necessary.
13170 (Output_section::Input_section_sort_entry): Define new class.
13171 (Output_section::Input_section_sort_compare::operator()): New
13172 function.
13173 (Output_section::sort_attached_input_sections): New function.
13174 * configure.ac: Check whether the compiler supports constructor
13175 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13176 * testsuite/initpri1.c: New file.
13177 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13178 CONSTRUCTOR_PRIORITY.
13179 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13180 (initpri1_LDFLAGS): New variable.
13181 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13182
18e6b24e
ILT
131832008-03-27 Ian Lance Taylor <iant@google.com>
13184
49bdd526
ILT
13185 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13186 * testsuite/common_test_1.c: New file.
13187 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13188 (common_test_1_SOURCES): New variable.
13189 (common_test_1_DEPENDENCIES): New variable.
13190 (common_test_1_LDFLAGS): New variable.
13191
18e6b24e
ILT
13192 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13193 and commons_ correctly when NAME/VERSION does not override
13194 NAME/NULL.
13195 * testsuite/ver_test_6.c: New file.
13196 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13197 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13198 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13199
04bf7072
ILT
132002008-03-26 Ian Lance Taylor <iant@google.com>
13201
5871526f
ILT
13202 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13203 of an undefined symbol from a version script.
13204 * testsuite/Makefile.am (ver_test_5.so): New target.
13205 (ver_test_5.o): New target.
13206 (check_SCRIPTS): Add ver_test_5.sh.
13207 (check_DATA): Add ver_test_5.syms.
13208 (ver_test_5.syms): New target.
13209 * testsuite/ver_test_5.cc: New file.
13210 * testsuite/ver_test_5.script: New file.
13211 * testsuite/ver_test_5.sh: New file.
13212 * Makefile.in, testsuite/Makefile.in: Rebuild.
13213
04bf7072
ILT
13214 PR gold/5986
13215 Fix problems building gold with gcc 4.3.0.
13216 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13217 (gold_error_at_location, gold_warning_at_location): Use it.
13218 * configure.ac: Check whether we can compile and use a template
13219 function with a printf attribute.
13220 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13221 when jumping over bytes.
13222 * object.cc: Instantiate Object::read_section_data.
13223 * debug.h: Include <cstring>
13224 * dwarf_reader.cc: Include <algorithm>
13225 * main.cc: Include <cstring>.
13226 * options.cc: Include <cstring>.
13227 * output.cc: Include <cstring>.
13228 * script.cc: Include <cstring>.
13229 * script.h: Include <string>.
13230 * symtab.cc: Include <cstring> and <algorithm>.
13231 * target-select.cc: Include <cstring>.
13232 * version.cc: Include <string>.
13233 * testsuite/testmain.cc: Include <cstdlib>.
13234 * configure, config.in: Rebuild.
13235
874c5b28
ILT
132362008-03-25 Ian Lance Taylor <iant@google.com>
13237
819d6c3a
ILT
13238 * options.cc: Include "../bfd/bfdver.h".
13239 (options::help): Print bug reporting address.
13240
f4b2c6f5
ILT
13241 * version.cc (print_version): Adjust output for current value of
13242 BFD_VERSION_STRING.
13243
13244 * NEWS: New file.
13245
e96caa79
ILT
13246 * options.cc (options::help): Print list of supported targets.
13247 * target-select.h: Include <vector>.
13248 (class Target_selector): Make machine_, size_, and is_big_endian_
13249 fields const. Add bfd_name_ and instantiated_target_ fields.
13250 (Target_selector::Target_selector): Add bfd_name parameter.
13251 (Target_selector::recognize): Make non-virtual, call
13252 do_recognize.
13253 (Target_selector::recognize_by_name): Make non-virtual, call
13254 do_recognize_by_name.
13255 (Target_selector::supported_names): New function.
13256 (Target_selector::bfd_name): New function.
13257 (Target_selector::do_instantiate_target): New pure virtual
13258 function.
13259 (Target_selector::do_recognize): New virtual function.
13260 (Target_selector::do_recognize_by_name): New virtual function.
13261 (Target_selector::instantiate_target): New private function.
13262 (supported_target_names): Declare.
13263 * target-select.cc (Target_selector::Target_selector): Update for
13264 new parameter and fields.
13265 (select_target_by_name): Check that the name matches before
13266 calling recognize_by_name.
13267 (supported_target_names): New function.
13268 * i386.cc (class Target_selector_i386): Update Target_selector
13269 constructor call. Remove recognize and recognize_by_name. Add
13270 do_instantiate_target.
13271 * x86_64.cc (class Target_selector_x86_64): Likewise.
13272 * testsuite/testfile.cc (class Target_selector_test): Update for
13273 changes to Target_selector.
13274
874c5b28
ILT
13275 * README: Rewrite, with some notes on unsupported features.
13276
0a65a3a7
CC
132772008-03-24 Cary Coutant <ccoutant@google.com>
13278
13279 * i386.cc (Target_i386::Got_type): New enum declaration.
13280 (Target_i386::Scan::local): Updated callers of Output_data_got
13281 member functions.
13282 (Target_i386::Scan::global): Likewise.
13283 (Target_i386::Relocate::relocate): Likewise.
13284 (Target_i386::Relocate::relocate_tls): Likewise.
13285 * object.h (Got_offset_list): New class.
13286 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13287 (Sized_relobj::local_got_offset): Likewise.
13288 (Sized_relobj::set_local_got_offset): Likewise.
13289 (Sized_relobj::local_has_tls_got_offset): Removed.
13290 (Sized_relobj::local_tls_got_offset): Removed.
13291 (Sized_relobj::set_local_tls_got_offset): Removed.
13292 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13293 * output.cc (Output_data_got::add_global): Added got_type parameter.
13294 (Output_data_got::add_global_with_rel): Likewise.
13295 (Output_data_got::add_global_with_rela): Likewise.
13296 (Output_data_got::add_global_pair_with_rel): New function.
13297 (Output_data_got::add_global_pair_with_rela): New function.
13298 (Output_data_got::add_local): Added got_type parameter.
13299 (Output_data_got::add_local_with_rel): Likewise.
13300 (Output_data_got::add_local_with_rela): Likewise.
13301 (Output_data_got::add_local_pair_with_rel): New function.
13302 (Output_data_got::add_local_pair_with_rela): New function.
13303 (Output_data_got::add_global_tls): Removed.
13304 (Output_data_got::add_global_tls_with_rel): Removed.
13305 (Output_data_got::add_global_tls_with_rela): Removed.
13306 (Output_data_got::add_local_tls): Removed.
13307 (Output_data_got::add_local_tls_with_rel): Removed.
13308 (Output_data_got::add_local_tls_with_rela): Removed.
13309 * output.h (Output_data_got::add_global): Added got_type parameter.
13310 (Output_data_got::add_global_with_rel): Likewise.
13311 (Output_data_got::add_global_with_rela): Likewise.
13312 (Output_data_got::add_global_pair_with_rel): New function.
13313 (Output_data_got::add_global_pair_with_rela): New function.
13314 (Output_data_got::add_local): Added got_type parameter.
13315 (Output_data_got::add_local_with_rel): Likewise.
13316 (Output_data_got::add_local_with_rela): Likewise.
13317 (Output_data_got::add_local_pair_with_rel): New function.
13318 (Output_data_got::add_local_pair_with_rela): New function.
13319 (Output_data_got::add_global_tls): Removed.
13320 (Output_data_got::add_global_tls_with_rel): Removed.
13321 (Output_data_got::add_global_tls_with_rela): Removed.
13322 (Output_data_got::add_local_tls): Removed.
13323 (Output_data_got::add_local_tls_with_rel): Removed.
13324 (Output_data_got::add_local_tls_with_rela): Removed.
13325 * resolve.cc (Symbol::override_base_with_special): Removed
13326 reference to has_got_offset_ field.
13327 * symtab.cc (Symbol::init_fields): Replaced initialization
13328 of got_offset_ with got_offsets_. Removed initialization
13329 of has_got_offset_
53fcba31 13330 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
13331 (Symbol::got_offset): Likewise.
13332 (Symbol::set_got_offset): Likewise.
13333 (Symbol::has_tls_got_offset): Removed.
13334 (Symbol::tls_got_offset): Removed.
13335 (Symbol::set_tls_got_offset): Removed.
13336 (Symbol::got_offset_): Removed.
13337 (Symbol::tls_mod_got_offset_): Removed.
13338 (Symbol::tls_pair_got_offset_): Removed.
13339 (Symbol::got_offsets_): New field.
13340 (Symbol::has_got_offset): Removed.
13341 (Symbol::has_tls_mod_got_offset): Removed.
13342 (Symbol::has_tls_pair_got_offset): Removed.
13343 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13344 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13345 member functions.
13346 (Target_x86_64::Scan::global): Likewise.
13347 (Target_x86_64::Relocate::relocate): Likewise.
13348 (Target_x86_64::Relocate::relocate_tls): Likewise.
13349
bd52eafb
BE
133502008-03-25 Ben Elliston <bje@au.ibm.com>
13351
13352 * yyscript.y: Fix spelling error in comment.
13353
8b105e34
ILT
133542008-03-24 Ian Lance Taylor <iant@google.com>
13355
8ed814a9
ILT
13356 * options.h (class General_options): Define build_id option.
13357 * layout.h (class Layout): Declare write_build_id, create_note,
13358 create_build_id. Add build_id_note_ member.
13359 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13360 "libiberty.h", "md5.h", "sha1.h".
13361 (Layout::Layout): Initialize eh_frame_data_,
13362 eh_frame_hdr_section_, and build_id_note_.
13363 (Layout::finalize): Call create_build_id.
13364 (Layout::create_note): New function, broken out of
13365 Layout::create_gold_note.
13366 (Layout::create_gold_note): Call create_note.
13367 (Layout::create_build_id): New function.
13368 (Layout::write_build_id): New function.
13369 (Close_task_runner::run): Call write_build_id.
13370
8b105e34
ILT
13371 * x86_64.cc: Correct license to GPLv3.
13372
086a1841
ILT
133732008-03-23 Ian Lance Taylor <iant@google.com>
13374
13375 * options.cc: Include "demangle.h".
13376 (parse_optional_string): New function.
13377 (parse_long_option): Handle takes_optional_argument.
13378 (parse_short_option): Update dash_z initializer. Handle
13379 takes_optional_argument.
13380 (General_options::General_options): Initialize do_demangle_.
13381 (General_options::finalize): Set do_demangle_. Handle demangling
13382 style.
13383 * options.h (parse_optional_string): Declare.
13384 (struct One_option): Add optional_arg field. Update constructor.
13385 Update call constructor calls. Add takes_optional_argument
13386 function.
13387 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13388 (DEFINE_optional_string): Define.
13389 (General_options::demangle): Change from DEFINE_bool to
13390 DEFINE_optional_string.
13391 (General_options::no_demangle): New function.
13392 (General_options::do_demangle): New function.
13393 (General_options::set_do_demangle): New function.
13394 (General_options::execstack_status_): Move definition to end of
13395 class definition.
13396 (General_options::static_): Likewise.
13397 (General_options::do_demangle_): New field.
13398 * object.cc (big_endian>::get_symbol_location_info): Call
13399 Options::do_demangle, not Options::demangle.
13400 * symtab.cc (demangle): Likewise.
13401
cbb93e63
ILT
134022008-03-22 Ian Lance Taylor <iant@google.com>
13403
13404 * gold.h: Include <cstddef> and <sys/types.h>
13405 * options.h: Include <cstring>.
13406
ec531623
ILT
134072008-03-21 Ian Lance Taylor <iant@google.com>
13408
13409 * Added source code to GNU binutils.
This page took 0.799269 seconds and 4 git commands to generate.