* gdb.hp/gdb.aCC/exception.exp: Remove.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
c9269dff
AM
12012-08-18 Alan Modra <amodra@gmail.com>
2
3 * powerpc.cc: Formatting and white space.
4 (Powerpc_relobj): Rename got2_section_ to special_.
5 Add opd_ent_shndx_ and opd_ent_off_ vectors.
6 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
7 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
8 (Target_powerpc): Add Address typedef and invalid_address. Use
9 throughout.
10 (Target_powerpc::is_branch_reloc): New function.
11 (Powerpc_relocate_functions): Add Address typedef, use throughout.
12 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
13 for dst_mask, value and addend.
14 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
15 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
16 (Output_data_glink::do_write): Correct toc base. Don't try to use
17 uint16_t for 24-bit offset. Use get_output_section_offset and
18 check return.
19 (Target_powerpc::Scan::local): Handle more relocs.
20 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
21 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
22 Plug in toc restoring insn after plt calls. Translate branches
23 to function descriptor symbols to corresponding entry point.
24 (Target_powerpc::relocate_for_relocatable): Check return from
25 get_output_section_offset.
26 * symtab.h: Comment typo.
27
b1759dce
ILT
282012-08-14 Ian Lance Taylor <iant@google.com>
29
30 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
31 unsupported_relocal_local to call unsupported_reloc_global.
32
b9b2ae8b
NC
332012-08-14 Nick Clifton <nickc@redhat.com>
34
35 PR ld/14265
36 * script-sections.cc (Sections_element::output_section_name): Add
37 keep return parameter.
38 (Output_section_element::match_name): Add keep return parameter.
39 Return the value of the keep_ member.
40 * script-sections.h (class Output_section): Update
41 output_section_name prototype.
42 * layout.cc (Layout::keep_input_section): New public member
43 function.
44 (Layout::choose_output_section): Pass keep parameter to
45 output_section_name.
46 * layout.h (class Layout): Add keep_input_section.
47 * object.cc (Sized_relobj_file::do_layout): Check for kept input
48 sections.
49 * testsuite/Makefile.am: Add a test.
50 * testsuite/Makefile.in: Regenerate.
51 * testsuite/pr14265.c: Source file for the test.
52 * testsuite/pr14265.t: Linker script for the test.
53 * testsuite/pr14265.sh: Shell script for the test.
54
921b5322
AM
552012-08-14 Alan Modra <amodra@gmail.com>
56
57 * target.h (Target::output_section_name): New function.
58 (Target::do_output_section_name): New function.
59 * layout.cc (Layout::choose_output_section): Call the above.
60 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
61
6ce78956
AM
622012-08-14 Alan Modra <amodra@gmail.com>
63
64 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
65 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
66 for replace_constant call.
67 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
68 (Output_data_glink::do_print_to_mapfile): New function.
69 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
70 (Target_powerpc::Relocate::relocate): Likewise.
71
d1a8cabd
AM
722012-08-14 Alan Modra <amodra@gmail.com>
73
74 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
75 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
76 (Output_data_glink::add_entry,find_entry): Remove shndx param.
77 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
78 all references to shndx_. Handle special case for R_PPC_PLTREL24
79 here.
80 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
81 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
82 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
83 here.
84 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
85 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
86
d83ce4e3
AM
872012-08-12 Alan Modra <amodra@gmail.com>
88
89 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
90 (glink insn constants): Use uint32_t.
91 (Output_data_glink::add_entry): Use insert, not [] operator.
92
cf43a2fe
AM
932012-08-11 Alan Modra <amodra@gmail.com>
94
95 * object.h (Sized_relobj_file::find_shdr): New function.
96 (Sized_relobj_file::find_special_sections): New function.
97 * object.cc (Sized_relobj_file::find_shdr): New function.
98 (Sized_relobj_file::find_eh_frame): Use find_shdr.
99 (Sized_relobj_file::find_special_sections): New function, split out..
100 (Sized_relobj_file::do_read_symbols): ..from here.
101 * output.h (Output_data_got::replace_constant): New function.
102 (Output_data_got::num_entries): New function.
103 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
104 (Output_data_got::got_offset): Protected rather than private.
105 (Output_data_got::replace_got_entry): New function.
106 * output.cc (Output_data_got::replace_got_entry): New function.
107 * powerpc.cc (class Powerpc_relobj): New.
108 (class Powerpc_relocate_functions): Delete all psymval variants or
109 convert to value,addend type. Delete pcrela, pcrela_unaligned.
110 Implement _ha functions using corresponding _hi function.
111 (Powerpc_relobj::find_special_sections): New function.
112 (Target_powerpc::do_make_elf_object): New function.
113 (class Output_data_got_powerpc): New.
114 (class Output_data_glink): New.
115 (class Powerpc_scan_relocatable_reloc): New.
116 Many more changes througout file.
117
3c892704
NC
1182012-08-09 Nick Clifton <nickc@redhat.com>
119
120 * po/vi.po: Updated Vietnamese translation.
121
82435b3b
ILT
1222012-08-07 Ian Lance Taylor <iant@google.com>
123
124 * layout.cc (Layout::add_target_dynamic_tags): If
125 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
126 plt_rel.
127
a6dc81d2
NC
1282012-07-30 Nick Clifton <nickc@redhat.com>
129
130 * po/gold.pot: Updated template.
131 * po/es.po: Updated Spanish translation.
132
f1415016
CC
1332012-07-18 Cary Coutant <ccoutant@google.com>
134
135 PR gold/14344
136 * configure.ac: Add check for -gpubnames support.
137 * configure: Regenerate.
138 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
139 support; force -gno-pubnames.
140 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
141 support.
142 (gdb_index_test_4): New test.
143 * testsuite/Makefile.in: Regenerate.
144 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
145 * testsuite/gdb_index_test_2.sh: Likewise.
146 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
147 * testsuite/gdb_index_test_4.sh: New script.
148 * testsuite/gdb_index_test_comm.sh: New script with common code;
149 don't look for space after colon.
150
b7fd7c37
ST
1512012-07-16 Sriraman Tallam <tmsriram@google.com>
152
153 * gold.cc (queue_middle_tasks): Update function order only after
154 deferred objects due to plugins are processed.
155
1f3212db
ILT
1562012-07-11 Ian Lance Taylor <iant@google.com>
157
158 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
159 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
160 (Target_arm::scan_reloc_for_stub): Likewise.
161 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
162 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
163 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
164 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
165 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
166
81c82a68
ILT
1672012-07-10 Dodji Seketeli <dodji@redhat.com>
168 Ian Lance Taylor <iant@google.com>
169
170 PR gold/14309
171 * configure.ac: Test whether std::tr1::hash<off_t> works.
172 * gold.h: Add a specialization for std::tr1::hash<off_t> if
173 needed.
174 * output.h (class Output_fill): Add virtual destructor.
175 * configure, config.in: Rebuild.
176
eabc84f4
RM
1772012-06-22 Roland McGrath <mcgrathr@google.com>
178
179 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
180
370e30b6
RÁE
1812012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
182
183 * plugin.cc (Plugin::load): Handle position independent executables.
184
fb1b895d
CC
1852012-06-06 Cary Coutant <ccoutant@google.com>
186
187 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
188 add .debug_macro.
189 (lines_only_debug_sections): Likewise.
190 (gdb_fast_lookup_sections): New static array.
191 (is_gdb_debug_section): Rename formal parameter.
192 (is_lines_only_debug_section): Likewise.
193 (is_gdb_fast_lookup_section): New function.
194 (Layout::include_section): Check for ".zdebug_" prefix; pass
195 section name suffix to is_gdb_debug_section, et al.; check for
196 fast-lookup sections when building .gdb_index.
197 * options.h (--strip-debug-gdb): Update GDB version number.
198
7c0640fa
CC
1992012-06-06 Cary Coutant <ccoutant@google.com>
200
201 * configure.ac: Add check for fallocate.
202 * configure: Regenerate.
203 * config.in: Regenerate.
204
205 * options.h (class General_options): Add --mmap-output-file and
206 --posix-fallocate options.
207 * output.cc: (posix_fallocate): Remove; replace with...
208 (gold_fallocate): New function.
209 (Output_file::map_no_anonymous): Call gold_fallocate.
210 (Output_file::map): Check --mmap-output-file option.
211
2a49eb69
DK
2122012-06-05 Jing Yu <jingyu@google.com>
213
214 * gold.h (textdomain): Add do {} to empty while(0).
215 (bindtextdomain): Likewise.
216
fad072ac
CC
2172012-06-04 Cary Coutant <ccoutant@google.com>
218
219 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
220 has_dynsym_index.
221
8cc69fb6
ST
2222012-05-25 Sriraman Tallam <tmsriram@google.com>
223
224 * symtab.cc (Symbol_table::define_special_symbol):
225 Initialize *poldsym to prevent uninitialized variable errors.
226
1be75daa
CC
2272012-05-23 Cary Coutant <ccoutant@google.com>
228
229 * layout.cc (Layout::section_name_mapping): Add rules to handle
230 exact match on .data.rel.ro.local or .data.rel.ro.
231 (Layout::output_section_name): Check for exact matches.
232
9b689de0
CC
2332012-05-23 Cary Coutant <ccoutant@google.com>
234
235 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
236 more carefully.
237
b24fdbf5
CC
2382012-05-22 Cary Coutant <ccoutant@google.com>
239
240 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
241 object before exporting symbol.
242
e550e1a2
L
2432012-05-21 H.J. Lu <hongjiu.lu@intel.com>
244
245 * testsuite/tls_test.cc: Include "config.h" first.
246 * testsuite/tls_test_c.c: Likewise.
247
df7b86aa
NC
2482012-05-17 Daniel Richard G. <skunk@iskunk.org>
249 Nick Clifton <nickc@redhat.com>
250
251 PR 14072
252 * configure.in: Add check that sysdep.h has been included before
253 any system header files.
254 * configure: Regenerate.
255 * config.in: Regenerate.
256
1007b503
CC
2572012-05-14 Cary Coutant <ccoutant@google.com>
258
259 * layout.cc (Layout::make_output_section): Mark .tdata section
260 as RELRO.
261 * testsuite/relro_test.cc: Add a TLS variable.
262
fd885f3a
L
2632012-05-10 H.J. Lu <hongjiu.lu@intel.com>
264
265 PR gold/14091
266 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
267 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
268 R_X86_64_64.
269
80f5885c
CC
2702012-05-08 Cary Coutant <ccoutant@google.com>
271
272 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
273 (lines_only_debug_sections): Likewise.
274
2e702c99
RM
2752012-05-02 Roland McGrath <mcgrathr@google.com>
276
277 * nacl.cc: New file.
278 * nacl.h: New file.
279 * Makefile.am (CCFILES, HFILES): Add them.
280 * Makefile.in: Regenerate.
281 * i386.cc (Output_data_plt_i386_nacl): New class.
282 (Output_data_plt_i386_nacl_exec): New class.
283 (Output_data_plt_i386_nacl_dyn): New class.
284 (Target_i386_nacl): New class.
285 (Target_selector_i386_nacl): New class.
286 (target_selector_i386): Use it instead of Target_selector_i386.
287 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
288 (Target_x86_64_nacl): New class.
289 (Target_selector_x86_64_nacl): New class.
290 (target_selector_x86_64, target_selector_x32): Use it instead of
291 Target_selector_x86_64.
292 * arm.cc (Output_data_plt_arm_nacl): New class.
293 (Target_arm_nacl): New class.
294 (Target_selector_arm_nacl): New class.
295 (target_selector_arm, target_selector_armbe): Use it instead of
296 Target_selector_arm.
297
298 * target-select.cc (select_target): Take new Input_file* and off_t
299 arguments, pass them on to recognize method of selector.
300 * object.cc (make_elf_sized_object): Update caller.
301 * parameters.cc (parameters_force_valid_target): Likewise.
302 * incremental.cc (make_sized_incremental_binary): Likewise.
303 * target-select.h: Update decl.
304 (Target_selector::recognize): Take new Input_file* argument,
305 pass it on to do_recognize.
306 (Target_selector::do_recognize): Take new Input_file* argument.
307 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
308 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
309 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
310 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
311
312 * target.h (Target::Target_info): New members isolate_execinstr
313 and rosegment_gap.
314 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
315 * arm.cc (Target_arm::arm_info): Update initializer.
316 * i386.cc (Target_i386::i386_info): Likewise.
317 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
318 * sparc.cc (Target_sparc::sparc_info): Likewise.
319 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
320 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
321 * layout.cc (Layout::attach_allocated_section_to_segment):
322 Take new const Target* argument. If target->isolate_execinstr(), act
323 like --rosegment.
324 (Layout::find_first_load_seg): Take new const Target* argument;
325 if target->isolate_execinstr(), reject PF_X segments.
326 (Layout::relaxation_loop_body): Update caller.
327 (Layout::set_segment_offsets): If target->isolate_execinstr(),
328 reset file offset to zero when we hit LOAD_SEG, and then do a second
329 loop over the segments before LOAD_SEG to reassign offsets after
330 addresses have been determined. Handle target->rosegment_gap().
331 (Layout::attach_section_to_segment): Take new const Target* argument;
332 pass it to attach_allocated_section_to_segment.
333 (Layout::make_output_section): Update caller.
334 (Layout::attach_sections_to_segments): Take new const Target* argument;
335 pass it to attach_section_to_segment.
336 * gold.cc (queue_middle_tasks): Update caller.
337 * layout.h (Layout): Update method decls with new arguments.
338
339 * arm.cc (Target_arm::Target_arm): Take optional argument for the
340 Target_info pointer to use.
341 (Target_arm::do_make_data_plt): New virtual method.
342 (Target_arm::make_data_plt): New method that calls it.
343 (Target_arm::make_plt_entry): Use it.
344 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
345 for the section alignment.
346 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
347 method.
348 (Output_data_plt_arm::first_plt_entry_offset): Call it.
349 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
350 method.
351 (Output_data_plt_arm::get_plt_entry_size): Call it.
352 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
353 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
354 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
355 method.
356 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
357 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
358 method instead of sizeof(plt_entry).
359 (Output_data_plt_arm::add_entry): Likewise.
360 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
361 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
362 than static method.
363 (Target_arm::plt_entry_size): Likewise.
364 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
365 Move to ...
366 (Output_data_plt_arm_standard): ... here, new class.
367 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
368 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
369 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
370
371 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
372 Take additional argument for the PLT entry size.
373 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
374 Use get_plt_entry_size method rather than plt_entry_size variable.
375 (Output_data_plt_x86_64::reserve_slot): Likewise.
376 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
377 (Output_data_plt_x86_64::add_entry): Likewise.
378 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
379 (Output_data_plt_x86_64::address_for_global): Likewise.
380 (Output_data_plt_x86_64::address_for_local): Likewise.
381 (Output_data_plt_x86_64::set_final_data_size): Likewise.
382 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
383 Make method non-static.
384 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
385 method.
386 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
387 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
388 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
389 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
390 virtual method.
391 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
392 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
393 virtual method.
394 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
395 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
396 virtual method.
397 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
398 (Output_data_plt_x86_64::plt_entry_size)
399 (Output_data_plt_x86_64::first_plt_entry)
400 (Output_data_plt_x86_64::plt_entry)
401 (Output_data_plt_x86_64::tlsdesc_plt_entry)
402 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
403 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
404 (Output_data_plt_x86_64_standard): ... here, new class.
405 (Target_x86_64::Target_x86_64): Take optional argument for the
406 Target_info pointer to use.
407 (Target_x86_64::do_make_data_plt): New virtual method.
408 (Target_x86_64::make_data_plt): New method to call it.
409 (Target_x86_64::init_got_plt_for_update): Use that.
410 Call this->plt_->add_eh_frame method here.
411 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
412 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
413 rather than static method.
414 (Target_x86_64::plt_entry_size): Likewise.
415 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
416 rather than plt_entry_size variable. Move guts of PLT filling to...
417 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
418 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
419 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
420
421 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
422 additional argument for the section alignment.
423 Don't do add_eh_frame_for_plt here.
424 (Output_data_plt_i386::first_plt_entry_offset): Make the method
425 non-static. Use get_plt_entry_size method rather than plt_entry_size
426 variable.
427 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
428 method.
429 (Output_data_plt_i386::get_plt_entry_size): Call it.
430 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
431 (Output_data_plt_i386::add_eh_frame): New method to call it.
432 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
433 method.
434 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
435 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
436 method.
437 (Output_data_plt_i386::fill_plt_entry): New method to call it.
438 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
439 method instead of plt_entry_size.
440 (Output_data_plt_i386::plt_entry_size)
441 (Output_data_plt_i386::plt_eh_frame_fde_size)
442 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
443 (Output_data_plt_i386_standard): ... here, new class.
444 (Output_data_plt_i386_exec): New class.
445 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
446 (Output_data_plt_i386_exec::first_plt_entry): ... here.
447 (Output_data_plt_i386::exec_plt_entry): Move to ...
448 (Output_data_plt_i386_exec::plt_entry): ... here.
449 (Output_data_plt_i386_dyn): New class.
450 (Output_data_plt_i386::first_plt_entry): Move to ...
451 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
452 (Output_data_plt_i386::dyn_plt_entry): Move to ...
453 (Output_data_plt_i386_dyn::plt_entry): ... here.
454 (Target_i386::Target_i386): Take optional argument for the Target_info
455 pointer to use.
456 (Target_i386::do_make_data_plt): New virtual method.
457 (Target_i386::make_data_plt): New method to call it.
458 (Target_i386::make_plt_section): Use that.
459 Call this->plt_->add_eh_frame method here.
460 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
461 rather than plt_entry_size variable.
462 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
463 (Output_data_plt_i386::address_for_local): Likewise.
464 (Output_data_plt_i386::do_write): Likewise.
465 Move guts of PLT filling to...
466 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
467 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
468 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
469 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
470
b9b9f2ee
CC
4712012-05-01 Cary Coutant <ccoutant@google.com>
472
473 * dwarf_reader.cc (Dwarf_die::read_attributes)
474 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
475 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
476 * reduced_debug_output.cc
477 (Output_reduced_debug_info_section::get_die_end): Remove
478 DW_FORM_GNU_ref_index. Add default case.
479
57923f48
MW
4802012-04-26 Mark Wielaard <mjw@redhat.com>
481
482 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
483 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
484 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
485 DW_AT_high_pc as offset from DW_AT_low_pc.
486
487 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
488 * testsuite/Makefile.in: Regenerate.
489 * testsuite/gdb_index_test_3.c: New test source file.
490 * testsuite/gdb_index_test_3.sh: New test source file.
491
2c54b4f4
ILT
4922012-04-25 Ian Lance Taylor <iant@google.com>
493
494 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
495 pointer.
496 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
497 as a class, not a struct.
498 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
499 (Target_arm::apply_cortex_a8_workaround): Likewise.
500 * gc.h: Declare Reloc_types as a struct, not a class.
501 * object.h: Declare Symbols_data as a struct.
502 * reloc.h: Declare Read_relocs_data as a struct.
503 * target.h: Declare Relocate_info as a struct.
504
a5a5f7a3
DM
5052012-04-24 David S. Miller <davem@davemloft.net>
506
507 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
508 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
509 and R_SPARC_WPLT30.
510
f038d496
CC
5112012-04-24 Cary Coutant <ccoutant@google.com>
512
513 * incremental-dump.cc (find_input_containing_global): Replace
514 magic number with symbolic constant.
515 (dump_incremental_inputs): Update version number.
516 * incremental.cc (Output_section_incremental_inputs): Update version
517 number; import symbolic constants from Incremental_inputs_reader.
518 (Incremental_inputs::create_data_sections): Align relocations
519 section correctly for 64-bit targets.
520 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
521 constants; add padding.
522 (Output_section_incremental_inputs::write_header): Add assert for
523 header_size.
524 (Output_section_incremental_inputs::write_input_files): Add assert
525 for input_entry_size.
526 (Output_section_incremental_inputs::write_info_blocks): Add padding;
527 add assert for object_info_size, input_section_entry_size,
528 global_sym_entry_size.
529 * incremental.h (Incremental_inputs_reader): Add symbolic constants
530 for data structure sizes; use them.
531 (Incremental_input_entry_reader): Import symbolic constants from
532 Incremental_inputs_reader; use them.
533
a4d85145
DM
5342012-04-23 David S. Miller <davem@davemloft.net>
535
536 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
537 and elf_flags_set_.
538 (Target_sparc::Target_sparc): Initialize new fields.
539 (Target_sparc::do_make_elf_object): New function.
540 (Target_sparc::do_adjust_elf_header): New function.
541
1d509098
CC
5422012-04-23 Cary Coutant <ccoutant@google.com>
543
544 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
545 CU range table of gdb index.
546
7ebeff7f
DM
5472012-04-20 David S. Miller <davem@davemloft.net>
548
549 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
550 instead of false.
551
13cf9988
DM
5522012-04-16 David S. Miller <davem@davemloft.net>
553
2a1079e8
DM
554 * sparc.cc (Target_sparc::got_address): New function.
555 (Sparc_relocate_functions::gdop_hix22): New function.
556 (Sparc_relocate_functions::gdop_lox10): New function.
557 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
558 relocs.
559 (Target_sparc::Scan::local): Likewise if the global symbol is not
560 preemptible and is not IFUNC.
561 (Target_sparc::Relocate::relocate): Perform GOTDATA code
562 transformations for local and non-preemptible non-IFUNC global
563 symbols.
564
0bc964fc
DM
565 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
566 writing out 64-bit part of ranges.
567
661d7a80
DM
568 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
569 -fpic and -fpie respectively.
570 * Makefile.in: Regenerate.
571
8c2bf391
DM
572 * sparc.cc (class Target_sparc): Add rela_ifunc_.
573 (Target_sparc::Target_sparc): Initialize new field.
574 (Target_sparc::do_plt_section_for_global): New function.
575 (Target_sparc::do_plt_section_for_local): New function.
576 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
577 (Target_sparc::make_plt_section): New function, broken out of
578 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
579 (Target_sparc::make_plt_entry): Call make_plt_section.
580 (Target_sparc::make_local_ifunc_plt_entry): New function.
581 (Target_sparc::rela_ifunc_section): New function.
582 (Target_sparc::plt_section): Remove const.
583 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
584 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
585 and ifunc_count_ fields.
586 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
587 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
588 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
589 (Output_data_plt_sparc::rela_ifunc): New function.
590 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
591 (Output_data_plt_sparc::has_ifunc_section): New function.
592 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
593 (Output_data_plt_sparc::address_for_global): New function.
594 (Output_data_plt_sparc::address_for_local): New function.
595 (Output_data_plt_sparc::plt_index_to_offset): New function.
596 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
597 and entry_count.
598 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
599 entry_count.
600 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
601 R_SPARC_JMP_IREL to switch.
602 (Target_sparc::Scan::check_non_pic): Likewise.
603 (Target_sparc::Scan::local): Handle IFUNC symbols.
604 (Target_sparc::Scan::local): Likewise.
605 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
606 and plt_address_for_local.
607 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
608 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
609
13cf9988
DM
610 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
611 (class Output_data_reloc): Adjust calls to Output_reloc_type.
612 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
613 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
614 global relocs too.
615 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
616 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
617 calls.
618 * sparc.cc (Target_sparc::Scan::global): Likewise.
619 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
620
31821be0
CC
6212012-04-16 Cary Coutant <ccoutant@google.com>
622
623 * archive.cc (Library_base::should_include_member): Check for
624 --export-dynamic-symbol.
625 * options.h (class General_options): Add --export-dynamic-symbol.
626 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
627 --export-dynamic-symbol.
628 (Symbol_table::gc_mark_undef_symbols): Likewise.
629 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
630
2615994e
DM
6312012-04-12 David S. Miller <davem@davemloft.net>
632
633 * sparc.cc (Reloc::wdisp10): New relocation method.
634 (Reloc::h34): Likewise.
635 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
636 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
637 R_SPARC_WDISP10.
638 (Target_sparc::Scan::local): Likewise.
639 (Target_sparc::Scan::global): Likewise.
640 (Target_sparc::Relocate::relocate): Likewise.
641
6782735d
CC
6422012-04-09 Cary Coutant <ccoutant@google.com>
643
644 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
645 low_pc == 0.
646
8c7a0b00
ILT
6472012-04-06 Ian Lance Taylor <iant@google.com>
648
649 * timer.cc: #include <unistd.h>.
650
58797674
RM
6512012-04-06 Roland McGrath <mcgrathr@google.com>
652
653 * configure.in (AC_CHECK_HEADERS): Add locale.h.
654 * config.in: Regenerate.
655 * configure: Regenerate.
656
44350750
NC
6572012-04-05 Nick Clifton <nickc@redhat.com>
658
659 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
660 (AM_LC_MESSAGES): Add.
661 * aclocal.m4: Regenerate.
662 * config.in: Regenerate.
663 * configure: Regenerate.
664
c1027032
CC
6652012-03-21 Cary Coutant <ccoutant@google.com>
666
667 * Makefile.am: Add gdb-index.cc, gdb-index.h.
668 * Makefile.in: Regenerate.
669 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
670 (Sized_elf_reloc_mapper::symbol_section): New function.
671 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
672 (make_elf_reloc_mapper): New function.
673 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
674 (Dwarf_abbrev_table::do_read_abbrevs): New function.
675 (Dwarf_abbrev_table::do_get_abbrev): New function.
676 (Dwarf_ranges_table::read_ranges_table): New function.
677 (Dwarf_ranges_table::read_range_list): New function.
678 (Dwarf_pubnames_table::read_section): New function.
679 (Dwarf_pubnames_table::read_header): New function.
680 (Dwarf_pubnames_table::next_name): New function.
681 (Dwarf_die::Dwarf_die): New function.
682 (Dwarf_die::read_attributes): New function.
683 (Dwarf_die::skip_attributes): New function.
684 (Dwarf_die::set_name): New function.
685 (Dwarf_die::set_linkage_name): New function.
686 (Dwarf_die::attribute): New function.
687 (Dwarf_die::string_attribute): New function.
688 (Dwarf_die::int_attribute): New function.
689 (Dwarf_die::uint_attribute): New function.
690 (Dwarf_die::ref_attribute): New function.
691 (Dwarf_die::child_offset): New function.
692 (Dwarf_die::sibling_offset): New function.
693 (Dwarf_info_reader::check_buffer): New function.
694 (Dwarf_info_reader::parse): New function.
695 (Dwarf_info_reader::do_parse): New function.
696 (Dwarf_info_reader::do_read_string_table): New function.
697 (Dwarf_info_reader::lookup_reloc): New function.
698 (Dwarf_info_reader::get_string): New function.
699 (Dwarf_info_reader::visit_compilation_unit): New function.
700 (Dwarf_info_reader::visit_type_unit): New function.
701 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
702 Sized_elf_reloc_mapper.
703 (Sized_dwarf_line_info::symbol_section): Remove function.
704 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
705 (Sized_dwarf_line_info::read_line_mappings): Remove object
706 parameter, adjust callers.
707 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
708 * dwarf_reader.h: Include <sys/types.h>.
709 (class Track_relocs): Remove forward declaration.
710 (class Elf_reloc_mapper): New class.
711 (class Sized_elf_reloc_mapper): New class.
712 (class Dwarf_abbrev_table): New class.
713 (class Dwarf_range_list): New class.
714 (class Dwarf_ranges_table): New class.
715 (class Dwarf_pubnames_table): New class.
716 (class Dwarf_die): New class.
717 (class Dwarf_info_reader): New class.
718 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
719 (Sized_dwarf_line_info::symbol_section): Remove member function.
720 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
721 base class.
722 * gdb-index.cc: New source file.
723 * gdb-index.h: New source file.
724 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
725 and .debug_types sections, call Layout::add_to_gdb_index.
726 (Sized_relobj_incr::do_section_name): Implement.
727 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
728 return type; Implement.
729 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
730 return type.
731 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
732 parameter list and return type.
733 (Sized_incr_dynobj::do_section_contents): Likewise.
734 * layout.cc: Include gdb-index.h.
735 (Layout::Layout): Initialize gdb_index_data_.
736 (Layout::init_fixed_output_section): Check for .gdb_index section.
737 (Layout::add_to_gdb_index): New function. Instantiate.
738 * layout.h: Add forward declaration for class Gdb_index.
739 (Layout::add_to_gdb_index): New member function.
740 (Layout::gdb_index_data_): New data member.
741 * main.cc: Include gdb-index.h.
742 (main): Print statistics for gdb index.
743 * object.cc (Object::section_contents): Move code into
744 do_section_contents.
745 (need_decompressed_section): Check for sections needed when building
746 gdb index.
747 (build_compressed_section_map): Likewise.
748 (Sized_relobj_file::do_read_symbols): Need local symbols when building
749 gdb index.
750 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
751 sections; call Layout::add_to_gdb_index.
752 (Sized_relobj_file::do_decompressed_section_contents): Call
753 do_section_contents directly.
754 * object.h (Object::do_section_contents): Adjust parameter list and
755 return type.
756 (Object::do_decompressed_section_contents): Call do_section_contents
757 directly.
758 (Sized_relobj_file::do_section_contents): Adjust parameter list and
759 return type.
760 * options.h (class General_options): Add --gdb-index option.
761 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
762 list and return type.
763 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
764 * reloc.h (Track_relocs::checkpoint): New function.
765 (Track_relocs::reset): New function.
766
767 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
768 New test cases.
769 * testsuite/Makefile.in: Regenerate.
770 * testsuite/gdb_index_test.cc: New test source file.
771 * testsuite/gdb_index_test_1.sh: New test source file.
772 * testsuite/gdb_index_test_2.sh: New test source file.
773
647f1574
DK
7742012-03-19 Doug Kwan <dougkwan@google.com>
775
776 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 777 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
778 __exidx_start and __exidx_end. Make symbol table parameter
779 anonymous as it is not used.
780 * gold.cc (queue_middle_tasks): Call target hook to define any
781 target-specific symbols.
782 * target.h (Target::define_standard_symbols): New method.
783 (Target::do_define_standard_symbols): Same.
784 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
785 * testsuite/Makefile.in: Regenerate.
786 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
787 and __exidx_end.
788 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
789 relocations are generated for __exidx_start and __exidx_end.
790
7c6109da
DK
7912012-03-16 Doug Kwan <dougkwan@google.com>
792
793 * testsuite/Makefile.am: Disable test initpri3b.
794 * testsuite/Makefile.in: Regenerate.
795
7b8957f8
DK
7962012-03-15 Doug Kwan <dougkwan@google.com>
797
798 * arm.cc (Target_arm::got_section): Make .got section read-only
799 if -z now is given.
800
14dc9ef7
ILT
8012012-03-15 Ian Lance Taylor <iant@google.com>
802
803 PR gold/13850
804 * layout.cc (Layout::make_output_section): Correctly mark
805 SHT_INIT_ARRAY, et. al., as relro.
806
fa40b62a
DK
8072012-03-14 Doug Kwan <dougkwan@google.com>
808
809 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
810 dynamic relocations for protected symbols in shared objects.
811
fd325007
ILT
8122012-03-13 Ian Lance Taylor <iant@google.com>
813
814 * resolve.cc (Symbol_table::resolve): When merging common symbols,
815 keep the larger alignment.
816
e8dd54e1
CC
8172012-03-12 Cary Coutant <ccoutant@google.com>
818
819 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
820 handling of DW_LNE_define_file.
821
feb5f3b0
CC
8222012-03-12 Cary Coutant <ccoutant@google.com>
823
824 * reduced_debug_output.cc
825 (Output_reduced_debug_info_section::get_die_end): Add new FORM
826 codes to switch.
827
a1fb4256
CC
8282012-02-29 Cary Coutant <ccoutant@google.com>
829
830 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
831
5dd8762a
CC
8322012-02-29 Cary Coutant <ccoutant@google.com>
833
834 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
835 Call Object::decompressed_section_contents.
836 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
837 New dtor.
838 (Sized_dwarf_line_info::buffer_start_): New data member.
839 * merge.cc (Output_merge_data::do_add_input_section): Call
840 Object::decompressed_section_contents.
841 (Output_merge_string::do_add_input_section): Likewise.
842 * object.cc (need_decompressed_section): New function.
843 (build_compressed_section_map): Decompress sections needed later.
844 (Sized_relobj_file::do_decompressed_section_contents): New function.
845 (Sized_relobj_file::do_discard_decompressed_sections): New function.
846 * object.h (Object::decompressed_section_contents): New function.
847 (Object::discard_decompressed_sections): New function.
848 (Object::do_decompressed_section_contents): New function.
849 (Object::do_discard_decompressed_sections): New function.
850 (Compressed_section_info): New type.
851 (Compressed_section_map): Include decompressed section contents.
852 (Sized_relobj_file::do_decompressed_section_contents): New function.
853 (Sized_relobj_file::do_discard_decompressed_sections): New function.
854
7b5de7ee
CC
8552012-02-16 Cary Coutant <ccoutant@google.com>
856
857 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
858 * testsuite/Makefile.in: Regenerate.
859
f9fa4a63
CC
8602012-02-14 Cary Coutant <ccoutant@google.com>
861
862 * options.cc (General_options::finalize): Disallow -pie and -static.
863
2c175ebc
DK
8642012-02-03 Doug Kwan <dougkwan@google.com>
865
866 * arm.cc (Arm_relocate_functions::abs8,
867 Arm_relocate_functions::abs16): Use
868 Bits::has_signed_unsigned_overflow32.
869 (Arm_relocate_functions::thm_abs8): Correct range of
870 overflow check.
871 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
872 in assertions.
873
90cff06f
DK
8742012-02-02 Doug Kwan <dougkwan@google.com>
875
876 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
877 position independent outputs, not just shared objects.
878
63887f3d
L
8792012-01-30 H.J. Lu <hongjiu.lu@intel.com>
880
881 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
882 * configure: Regenerated.
883
bef2b434
ILT
8842012-01-27 Ian Lance Taylor <iant@google.com>
885
886 * reloc.h (Bits): New class with static functions, copied from
887 namespace utils in arm.cc.
888 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
889 instead.
890
c335b55d
L
8912012-01-27 H.J. Lu <hongjiu.lu@intel.com>
892
893 * incremental.cc (write_info_blocks): Correct relocation offset.
894
41194d9f
L
8952012-01-27 H.J. Lu <hongjiu.lu@intel.com>
896
897 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
898 (Relocate::tls_gd_to_le): Likewise.
899
1bae613c
L
9002012-01-27 H.J. Lu <hongjiu.lu@intel.com>
901
902 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
903
24482ca0
L
9042012-01-27 H.J. Lu <hongjiu.lu@intel.com>
905
906 * configure.ac: Check if -mcmodel=medium works.
907 * configure: Regenerated.
908
c2c7840a
CC
9092012-01-24 Cary Coutant <ccoutant@google.com>
910
911 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
912 definition and ...
913 (read_unsigned_LEB_128_x): ... this new function.
914 (read_signed_LEB_128): Replaced with inline definition and ...
915 (read_signed_LEB_128_x): ... this new function.
916 * int_encoding.h (read_unsigned_LEB_128_x): New function.
917 (read_unsigned_LEB_128): Add inline definition.
918 (read_signed_LEB_128_x): New function.
919 (read_signed_LEB_128): Add inline definition.
920 * testsuite/Makefile.am (leb128_unittest): New unit test.
921 * testsuite/Makefile.in: Regenerate.
922 * testsuite/leb128_unittest.cc: New unit test.
923
833de760 9242012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
925
926 PR gold/13617
927 * i386.cc (Target_i386::do_code_fill): When using a jmp
928 instruction, pad with nop instructions.
929 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
930
618d6666
L
9312012-01-22 H.J. Lu <hongjiu.lu@intel.com>
932
933 * x86_64.cc (gc_process_relocs): Add typename on types used in
934 template.
935 (scan_relocs): Likewise.
936 (relocate_section): Likewise.
937 (apply_relocation): Likewise.
938
3660ff06
L
9392012-01-10 H.J. Lu <hongjiu.lu@intel.com>
940
941 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
942 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
943 under x32.
944
fc51264f
L
9452012-01-09 H.J. Lu <hongjiu.lu@intel.com>
946
947 * x86_64.cc: Initial support for x32.
948
dd74ae06
CC
9492012-01-03 Cary Coutant <ccoutant@google.com>
950
951 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
952 Use abstract base class for GOT.
953 * gold/output.h (class Output_data_got_base): New abstract base class.
954 (class Output_data_got): Derive from new base class, adjust ctors.
955 (Output_data_got::reserve_slot): Make virtual; rename to
956 do_reserve_slot; Adjust callers.
957 * gold/target.h (Sized_target::init_got_plt_for_update): Return
958 pointer to abstract base class.
959 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
960
83896202
ILT
9612011-12-18 Ian Lance Taylor <iant@google.com>
962
963 * object.h (Relobj::local_symbol_value): New function.
964 (Relobj::local_plt_offset): New function.
965 (Relobj::local_has_got_offset): New function.
966 (Relobj::local_got_offset): New function.
967 (Relobj::set_local_got_offset): New function.
968 (Relobj::do_local_symbol_value): New pure virtual function.
969 (Relobj::do_local_plt_offset): Likewise.
970 (Relobj::do_local_has_got_offset): Likewise.
971 (Relobj::do_local_got_offset): Likewise.
972 (Relobj::do_set_local_got_offset): Likewise.
973 (Sized_relobj::do_local_has_got_offset): Rename from
974 local_has_got_offset.
975 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
976 (Sized_relobj::do_set_local_got_offset): Rename from
977 set_local_got_offset.
978 (Sized_relobj_file::do_local_plt_offset): Rename from
979 local_plt_offset.
980 (Sized_relobj_file::do_local_symbol_value): New function.
981 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
982 local_plt_offset.
983 * output.cc (Output_data_got::Got_entry::write): Change object to
984 Relobj. Use local_symbol_value.
985 (Output_data_got::add_global_with_rel): Change rel_dyn to
986 Output_data_reloc_generic*. Use add_global_generic.
987 (Output_data_got::add_global_with_rela): Remove. Change all
988 callers to use add_global_with_rel.
989 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
990 Output_data_reloc_generic*. Use add_global_generic.
991 (Output_data_got::add_global_pair_with_rela): Remove. Change all
992 callers to use add_global_pair_with_rel.
993 (Output_data_got::add_local): Change object to Relobj*.
994 (Output_data_got::add_local_plt): Likewise.
995 (Output_data_got::add_local_with_rel): Change object to Relobj*,
996 change rel_dyn to Output_data_reloc_generic*. Use
997 add_local_generic.
998 (Output_data_got::add_local_with_rela): Remove. Change all
999 callers to use all_local_with_rel.
1000 (Output_data_got::add_local_pair_with_rel): Change object to
1001 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1002 add_output_section_generic.
1003 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1004 callers to use add_local_pair_with_rel.
1005 (Output_data_got::reserve_local): Change object to Relobj*.
1006 * output.h: (class Output_data_reloc_generic): Add pure virtual
1007 declarations for add_global_generic, add_local_generic,
1008 add_output_section_generic.
1009 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
1010 functions for Output_data_reloc_generic. Update declarations for
1011 changes listed in output.cc.
1012 (class Output_data_got): Change template parameter to got_size.
1013 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
1014 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
1015 function.
1016 (Sized_relobj_incr::do_local_plt_offset): New function.
1017 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
1018 add_global_generic.
1019
76677ad0
CC
10202011-12-17 Cary Coutant <ccoutant@google.com>
1021
1022 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
1023 * resolve.cc (Symbol_table::resolve): Likewise.
1024 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
1025 arrays.
1026 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1027
8b8dd8d5
ILT
10282011-12-16 Ian Lance Taylor <iant@google.com>
1029
1030 * output.h (Output_data_reloc_generic::add): Only call
1031 add_dynamic_reloc if this is a dynamic reloc section.
1032
d55525b9
L
10332011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1034
1035 PR gold/13505
1036 * target-reloc.h (apply_relocation): Replace <64, false> with
1037 <size, big_endian>.
1038
ff81c7c1
NC
10392011-11-25 Nick Clifton <nickc@redhat.com>
1040
1041 * po/it.po: New Italian translation.
1042
628f39be
SA
10432011-11-17 Sterling Augustine <saugustine@google.com>
1044
1045 * script.cc (script_include_directive): Implement.
1046 (read_script_file): New local variables name and search_path. Update
1047 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
1048 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
1049 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
1050
98ef3ea4
SA
10512011-11-11 Sterling Augustine <saugustine@google.com>
1052
1053 * yyscript.y (section_cmd): Add support for INCLUDE directive.
1054 (file_or_sections_cmd): Likewise.
1055
f4a8b6d7
DK
10562011-11-11 Doug Kwan <dougkwan@google.com>
1057
1058 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
1059 if --just-symbols is given.
1060
29ab395d
DK
10612011-11-10 Doug Kwan <dougkwan@google.com>
1062
1063 PR gold/13362
1064 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
1065 when processing data relocs.
1066 * reloc.h (Relocate_functions::rel_unaligned): New method.
1067 (Relocate_functions::pcrel_unaligned): Ditto.
1068 (Relocate_functions::rel32_unaligned): Ditto.
1069 (Relocate_functions::pcrel32_unaligned): Ditto.
1070
2c339f71
DK
10712011-11-09 Doug Kwan <dougkwan@google.com>
1072
1073 PR gold/13362
1074 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
1075 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
1076 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
1077 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1078 (Relocate_functions::rel_unaligned): New.
1079 (Relocate_functions::rel32_unaligned): New.
1080 * target-reloc.h (relocate_for_relocatable): Add code to handle
1081 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1082 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
1083 arm_unaligned_reloc_r): New targets.
1084 * testsuite/Makefile.in: Regenerate.
1085 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
1086 linking.
1087
3f3cddf1
ILT
10882011-11-02 Ian Lance Taylor <iant@google.com>
1089
1090 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
1091 NATIVE_LINKER.
1092 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1093 * options.cc (General_options::finalize): Use library search path
1094 from configure script if specified. If not native and no sysroot,
1095 only search TOOLLIBDIR.
1096 * options.h (Search_directory::Search_directory): Change name to
1097 const std::string&.
1098 (General_options::add_to_library_path_with_sysroot): Change arg to
1099 const std::string&.
1100 * configure, Makefile.in, config.in: Rebuild.
1101
a8e2273b
ILT
11022011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1103
1104 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1105 we are working around the ARM1176 Erratum.
1106 * options.h (General_options::fix_arm1176): Add option.
1107 * testsuite/Makefile.am: Add testcases, and keep current ones
1108 working.
1109 * testsuite/Makefile.in: Regenerate.
1110 * testsuite/arm_fix_1176.s: New file.
1111 * testsuite/arm_fix_1176.sh: Likewise.
1112
cd6eab1c
ILT
11132011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1114
1115 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1116 may_use_blx_.
1117 (Target_arm::may_use_blx): Remove method.
1118 (Target_arm::set_may_use_blx): Likewise.
1119 (Target_arm::may_use_v4t_interworking): New method.
1120 (Target_arm::may_use_v5t_interworking): Likewise.
1121 (Target_arm::may_use_blx_): Remove member variable.
1122 (Arm_relocate_functions::arm_branch_common): Check for v5T
1123 interworking.
1124 (Arm_relocate_functions::thumb_branch_common): Likewise.
1125 (Reloc_stub::stub_type_for_reloc): Likewise.
1126 (Target_arm::do_finalize_sections): Correct interworking checks.
1127 * testsuite/Makefile.am: Add new tests.
1128 * testsuite/Makefile.in: Regenerate.
1129 * testsuite/arm_farcall_arm_arm.s: New test.
1130 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1131 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1132 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1133 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1134 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1135 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1136 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1137
286adcf4
CC
11382011-10-31 Cary Coutant <ccoutant@google.com>
1139
1140 PR gold/13023
1141 * expression.cc (Expression::eval_with_dot): Add
1142 is_section_dot_assignment parameter.
1143 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1144 absolute and assigning to dot within a section.
1145 * script-sections.cc
1146 (Output_section_element_assignment::set_section_addresses): Pass
1147 dot_section to set_if_absolute.
1148 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1149 as is_section_dot_assignment flag to eval_with_dot.
1150 (Output_section_element_dot_assignment::set_section_addresses):
1151 Likewise.
1152 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1153 parameter. Also set value if relative to dot_section; set the
1154 symbol's output_section.
1155 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1156 parameter. Adjust all callers.
1157 (Expression::eval_maybe_dot): Likewise.
1158 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1159 Adjust all callers.
1160 * testsuite/script_test_2.t: Test assignment of an absolute value
1161 to dot within an output section element.
1162
9634ed06
CC
11632011-10-31 Cary Coutant <ccoutant@google.com>
1164
1165 * options.h (class General_options): Add --[no-]gnu-unique options.
1166 * symtab.cc (Symbol_table::sized_write_globals): Convert
1167 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1168
de4101c7
CC
11692011-10-31 Cary Coutant <ccoutant@google.com>
1170
1171 PR gold/13359
1172 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1173 unnecessary assertion.
1174 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1175
7257cc92
ST
11762011-10-31 Sriraman Tallam <tmsriram@google.com>
1177
1178 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1179 gc_mark_symbol.
1180 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1181 gc_mark_symbol.
1182 Change to just keep the section associated with symbol.
1183 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1184 they are externally visible and --export-dynamic is turned on.
1185 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1186
bfc34b3f
ILT
11872011-10-19 Ian Lance Taylor <iant@google.com>
1188
1189 PR gold/13163
1190 * script-sections.cc
1191 (Output_section_element_dot_assignment::needs_output_section): New
1192 function.
1193
ea0d8c47
ILT
11942011-10-19 Ian Lance Taylor <iant@google.com>
1195
1196 PR gold/13204
1197 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1198 --section-start option was seen.
1199 * options.h (General_options::any_section_start): New function.
1200
abd242a9
DM
12012011-10-18 David S. Miller <davem@davemloft.net>
1202
1203 PR binutils/13301
1204 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1205 member to track relocation locations that have moved during TLS
1206 reloc optimizations.
1207 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1208 (Target_sparc::Relocate::relocate): Adjust view down by 4
1209 bytes if it matches reloc_adjust_addr_.
1210 (Target_sparc::Relocate::relocate_tls): Always move the
1211 __tls_get_addr call delay slot instruction forward 4 bytes when
1212 performing relaxation.
1213
bab9090f
CC
12142011-10-18 Cary Coutant <ccoutant@google.com>
1215
1216 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1217 (Output_file::map_no_anonymous): Check for non-zero
1218 return code from posix_fallocate.
1219
f7c5b166
CC
12202011-10-17 Cary Coutant <ccoutant@google.com>
1221
1222 PR gold/13245
1223 * plugin.cc (is_visible_from_outside): Check for symbols
1224 referenced from dynamic objects.
1225 * resolve.cc (Symbol_table::resolve): Don't count references
1226 from dynamic objects as references from real ELF files.
1227 * testsuite/plugin_test_2.sh: Adjust expected result.
1228
b490c0bb
CC
12292011-10-17 Cary Coutant <ccoutant@google.com>
1230
1231 * gold.cc: Include timer.h.
1232 (queue_middle_tasks): Stamp time.
1233 (queue_final_tasks): Likewise.
1234 * main.cc (main): Store timer in parameters. Print timers
1235 for each pass.
1236 * parameters.cc (Parameters::Parameters): Initialize timer_.
1237 (Parameters::set_timer): New function.
1238 (set_parameters_timer): New function.
1239 * parameters.h (Parameters::set_timer): New function.
1240 (Parameters::timer): New function.
1241 (Parameters::timer_): New data member.
1242 (set_parameters_timer): New function.
1243 * timer.cc (Timer::stamp): New function.
1244 (Timer::get_pass_time): New function.
1245 * timer.h (Timer::stamp): New function.
1246 (Timer::get_pass_time): New function.
1247 (Timer::pass_times_): New data member.
1248
f475cf7b
CC
12492011-10-17 Cary Coutant <ccoutant@google.com>
1250
1251 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1252 task for members of lib groups.
1253
cdd7e244
CC
12542011-10-17 Cary Coutant <ccoutant@google.com>
1255
1256 PR gold/13288
4f95c8b4 1257 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
1258 (File_read::make_view): Move bounds check (replace with assert)...
1259 (File_read::find_or_make_view): ... to here.
1260
dfb45471
CC
12612011-10-12 Cary Coutant <ccoutant@google.com>
1262
4f95c8b4 1263 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
1264 ::read returns less than requested size.
1265
53bbcc1b
CC
12662011-10-10 Cary Coutant <ccoutant@google.com>
1267
4f95c8b4 1268 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
1269 Initialize defined_count_.
1270 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1271 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1272 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1273 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1274 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 1275 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
1276 member.
1277 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 1278 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
1279 Return zeroes instead of internal error.
1280
397b129b
CC
12812011-10-10 Cary Coutant <ccoutant@google.com>
1282
1283 PR gold/13249
4f95c8b4 1284 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 1285 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 1286 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
1287 (Output_reloc::type_): Adjust size of bit field.
1288 (Output_reloc::use_plt_offset_): New bit field.
1289 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1290 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1291 flag. Adjust all callers.
4f95c8b4 1292 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
1293 creating RELATIVE relocations.
1294
d5698657
NC
12952011-10-10 Nick Clifton <nickc@redhat.com>
1296
1297 * po/es.po: Updated Spanish translation.
1298 * po/fi.po: Updated Finnish translation.
1299
6a59a5c2
DN
13002011-10-03 Diego Novillo <dnovillo@google.com>
1301
1302 * options.cc (parse_uint): Fix dereference of RETVAL.
1303
f0558624
ST
13042011-09-29 Sriraman Tallam <tmsriram@google.com>
1305
1306 * layout.h (section_order_map_): New member.
1307 (get_section_order_map): New member function.
1308 * output.cc (Output_section::add_input_section): Check for patterns
1309 only when --section-ordering-file is specified.
1310 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1311 output_sections have been formed.
1312 * layout.cc (Layout_Layout): Initialize section_order_map_.
1313 * plugin.cc (update_section_order): Store order in order_map. Do not
1314 update the order.
1315 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1316 * testsuite/Makefile.in: Regenerate.
1317 * testsuite/plugin_section_order.c: New file.
1318 * testsuite/plugin_final_layout.cc: New file.
1319 * testsuite/plugin_final_layout.sh: New file.
1320
a7dac153
CC
13212011-09-29 Cary Coutant <ccoutant@google.com>
1322
4f95c8b4 1323 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 1324 Check for NULL.
4f95c8b4 1325 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
1326 symbols during incremental update.
1327 (Symbol_table::add_from_dynobj): Likewise.
1328
eebd87a5
ILT
13292011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1330 Ian Lance Taylor <iant@google.com>
1331
1332 * symtab.cc (Symbol_table::define_special_symbol): Always
1333 canonicalize version string.
1334
403a3331
CC
13352011-09-26 Cary Coutant <ccoutant@google.com>
1336
4f95c8b4
CC
1337 * gold.cc (queue_initial_tasks): Move option checks ...
1338 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
1339 some options; make others fatal.
1340
235061c2
CC
13412011-09-26 Cary Coutant <ccoutant@google.com>
1342
1343 gcc PR lto/47247
1344 * plugin.cc (get_symbols_v2): New function.
1345 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1346 (is_referenced_from_outside): New function.
1347 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1348 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1349 (get_symbols): Pass version parameter.
1350 (get_symbols_v2): New function.
1351 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1352 parameter.
1353 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1354 (onload): Add LDPT_GET_SYMBOLS_V2.
1355 (all_symbols_read_hook): Use get_symbols_v2; check for
1356 LDPR_PREVAILING_DEF_IRONLY_EXP.
1357 * testsuite/plugin_test_3.sh: Update expected results.
1358
dc87f620
ILT
13592011-09-23 Simon Baldwin <simonb@google.com>
1360
1361 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1362 configuration options.
1363 * configure: Regenerate.
1364 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1365 * Makefile.in: Regenerate.
1366 * testsuite/Makefile.in: Regenerate.
1367
a8279f82
ST
13682011-09-19 Sriraman Tallam <tmsriram@google.com>
1369
1370 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1371
0c9350c8
CC
13722011-09-19 Cary Coutant <ccoutant@google.com>
1373
1374 * incremental.cc (can_incremental_update): Fix typo in comment.
1375 * incremental.h (can_incremental_update): Likewise.
1376
aa06ae28
CC
13772011-09-18 Cary Coutant <ccoutant@google.com>
1378
1379 * incremental.cc (can_incremental_update): New function.
1380 * incremental.h (can_incremental_update): New function.
1381 * layout.cc (Layout::init_fixed_output_section): Call it.
1382 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1383 * object.cc (Sized_relobj_file::do_layout): Call
1384 can_incremental_update.
1385
ebb300b2
CC
13862011-09-13 Cary Coutant <ccoutant@google.com>
1387
1388 * configure.ac: Check for glibc support for gnu_indirect_function
1389 support with static linking, setting automake conditional
1390 IFUNC_STATIC.
1391 * Makefile.in: Regenerate.
1392 * configure: Regenerate.
1393
1394 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1395 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1396 for IFUNC_STATIC.
1397 * testsuite/Makefile.in: Regenerate.
1398
1206d0d5
CC
13992011-09-13 Cary Coutant <ccoutant@google.com>
1400
1401 * incremental.cc (Sized_relobj_incr::do_layout): Call
1402 report_comdat_group for kept comdat sections.
1403 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1404 * testsuite/Makefile.in: Regenerate.
1405 * testsuite/incr_comdat_test_1.cc: New source file.
1406 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1407 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1408 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1409
40b29874
ILT
14102011-09-13 Ian Lance Taylor <iant@google.com>
1411
1412 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1413 variable external_symbols_offset.
1414
1b045aac
ILT
14152011-09-12 Ian Lance Taylor <iant@google.com>
1416
1417 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1418 triggered if object has no symbols.
1419
24c6c55a
DM
14202011-09-09 David S. Miller <davem@davemloft.net>
1421
1422 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1423 (Output_fill_debug_line::do_write): Likewise.
1424
66570254
CC
14252011-08-29 Cary Coutant <ccoutant@google.com>
1426
1427 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1428 casts to match formatting specs.
1429 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1430
8ea8cd50
CC
14312011-08-26 Cary Coutant <ccoutant@google.com>
1432
1433 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1434 remaining hole size when allocating.
1435 (Layout::make_output_section): Set fill methods for debug sections.
1436 * layout.h (Free_list::Free_list_node): Move from private to
1437 public.
1438 (Free_list::set_min_hole_size): New function.
1439 (Free_list::begin, Free_list::end): New functions.
1440 (Free_list::min_hole_): New data member.
1441 * output.cc: Include dwarf.h.
1442 (Output_fill_debug_info::do_minimum_hole_size): New function.
1443 (Output_fill_debug_info::do_write): New function.
1444 (Output_fill_debug_line::do_minimum_hole_size): New function.
1445 (Output_fill_debug_line::do_write): New function.
1446 (Output_section::Output_section): Initialize new data member.
1447 (Output_section::set_final_data_size): Ensure patch space is larger
1448 than minimum hole size.
1449 (Output_section::do_write): Fill holes in debug sections.
1450 * output.h (Output_fill): New class.
1451 (Output_fill_debug_info): New class.
1452 (Output_fill_debug_line): New class.
1453 (Output_section::set_free_space_fill): New function.
1454 (Output_section::free_space_fill_): New data member.
1455 * testsuite/Makefile.am (incremental_test_3): Add
1456 --incremental-patch option.
1457 (incremental_test_4): Likewise.
1458 (incremental_test_5): Likewise.
1459 (incremental_test_6): Likewise.
1460 (incremental_copy_test): Likewise.
1461 (incremental_common_test_1): Likewise.
1462 * testsuite/Makefile.in: Regenerate.
1463
7cf80422
NC
14642011-08-26 Nick Clifton <nickc@redhat.com>
1465
1466 * po/es.po: Updated Spanish translation.
1467
c3f7b0e5
CC
14682011-08-01 Cary Coutant <ccoutant@google.com>
1469
1470 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1471 * gold/testsuite/Makefile.in: Regenerate.
1472 * gold/testsuite/justsyms_exec.c: New source file.
1473 * gold/testsuite/justsyms_lib.c: New source file.
1474
9590bf25
CC
14752011-08-01 Cary Coutant <ccoutant@google.com>
1476
1477 * layout.cc (Layout::set_segment_offsets): Don't realign text
1478 segment if -Ttext was specified.
1479 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1480 file type.
1481 * object.h (Sized_relobj_file::e_type): New function.
1482 (Sized_relobj_file::e_type_): New data member.
1483 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1484 base address for ET_EXEC files.
1485 * target.cc (Target::do_make_elf_object_implementation): Allow
1486 ET_EXEC files with --just-symbols option.
1487
dcd8d12e
CC
14882011-07-28 Cary Coutant <ccoutant@google.com>
1489
1490 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1491 Add thread_number parameter.
1492 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1493 * workqueue-threads.cc
1494 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1495 current thread if its thread number is greater than desired thread
1496 count.
1497 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1498 Add thread_number parameter.
1499 (Workqueue::should_cancel_thread): Likewise.
1500 (Workqueue::find_runnable_or_wait): Pass thread_number to
1501 should_cancel_thread.
1502 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1503 parameter.
1504
804eb480
ST
15052011-07-22 Sriraman Tallam <tmsriram@google.com>
1506
1507 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1508 only after checking if it cannot be forced local.
1509 * symtab.h (is_externally_visible): Check if the symbol is not forced
1510 local.
1511
f1ddb600
ILT
15122011-07-15 Ian Lance Taylor <iant@google.com>
1513
1514 * options.h (class General_options): Add --print-output-format.
1515 Move -EL next to -EB, for better --help output.
1516 * target-select.cc: Include <cstdio>, "options.h", and
1517 "parameters.h".
1518 (Target_selector::do_target_bfd_name): New function.
1519 (print_output_format): New function.
1520 * target-select.h (class Target_selector): Update declarations.
1521 (Target_selector::target_bfd_name): New function.
1522 (print_output_format): Declare.
1523 * main.cc: Include "target-select.h".
1524 (main): Handle --print-output-format.
1525 * gold.cc: Include "target-select.h".
1526 (queue_initial_tasks): Handle --print-output-format when there are
1527 no input files.
1528 * parameters.cc (parameters_force_valid_target): Give a better
1529 error message if -EB/-EL does not match target.
1530 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1531 function.
1532
7d172687
ILT
15332011-07-15 Ian Lance Taylor <iant@google.com>
1534
1535 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1536 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1537 (Output_data_plt_i386::do_write): Write address of .dynamic
1538 section to first entry in .got.plt section.
1539 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1540 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1541 Initialize layout_.
1542 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1543 section to first entry in .got.plt section.
1544 * layout.h (Layout::dynamic_section): New function.
1545
e9552f7e
ST
15462011-07-13 Sriraman Tallam <tmsriram@google.com>
1547
1548 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1549 to claim_file call.
1550 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1551 input_section_position_, and input_section_glob_.
1552 (read_layout_from_file): Call function section_ordering_specified.
1553 * layout.h (is_section_ordering_specified): New function.
1554 (section_ordering_specified): New function.
1555 (section_ordering_specified_): New boolean member.
1556 * main.cc(main): Call load_plugins after layout object is defined.
1557 * output.cc (Output_section::add_input_section): Use
1558 function section_ordering_specified to check if section ordering is
1559 needed.
1560 * output.cc (Output_section::add_relaxed_input_section): Use
1561 function section_ordering_specified to check if section ordering is
1562 needed.
1563 (Output_section::update_section_layout): New function.
1564 (Output_section::sort_attached_input_sections): Check if input section
1565 must be reordered.
1566 * output.h (Output_section::update_section_layout): New function.
1567 * plugin.cc (get_section_count): New function.
1568 (get_section_type): New function.
1569 (get_section_name): New function.
1570 (get_section_contents): New function.
1571 (update_section_order): New function.
58797674 1572 (allow_section_ordering): New function.
e9552f7e
ST
1573 (Plugin::load): Add the new interfaces to the transfer vector.
1574 (Plugin_manager::load_plugins): New parameter.
1575 (Plugin_manager::all_symbols_read): New parameter.
1576 (Plugin_manager::claim_file): New parameter. Save the elf object for
1577 unclaimed objects.
1578 (Plugin_manager::get_elf_object): New function.
1579 (Plugin_manager::get_view): Change to directly use the bool to check
1580 if get_view is called from claim_file_hook.
1581 * plugin.h (input_objects): New function
1582 (Plugin__manager::load_plugins): New parameter.
1583 (Plugin_manager::claim_file): New parameter.
1584 (Plugin_manager::get_elf_object): New function.
1585 (Plugin_manager::in_claim_file_handler): New function.
1586 (Plugin_manager::in_claim_file_handler_): New member.
1587 (layout): New function.
1588 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1589 handler with an extra parameter. Make the elf object before calling
1590 claim_file handler.
1591 * testsuite/plugin_test.c (get_section_count): New function pointer.
1592 (get_section_type): New function pointer.
1593 (get_section_name): New function pointer.
1594 (get_section_contents): New function pointer.
1595 (update_section_order): New function pointer.
1596 (allow_section_ordering): New function pointer.
1597 (onload): Check if the new interfaces exist.
1598
9446efde
ILT
15992011-07-13 Ian Lance Taylor <iant@google.com>
1600
1601 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1602 relro section.
1603 * x86_64.cc (Target_x86_64::got_section): Likewise.
1604 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1605 (relro_now_test_SOURCES): New variable.
1606 (relro_now_test_DEPENDENCIES): New variable.
1607 (relro_now_test_LDFLAGS): New variable.
1608 (relro_now_test_LDADD): New variable.
1609 (relro_now_test.so): New target.
1610 * testsuite/Makefile.in: Rebuild.
1611
07aa62f2
ILT
16122011-07-12 Ian Lance Taylor <iant@google.com>
1613
1614 PR gold/12980
1615 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1616 GLOB_DAT relocation rather than a RELATIVE relocation for a
1617 protected symbol when creating a shared library.
1618 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1619 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1620 * testsuite/protected_main_1.cc (main): Test that protected
1621 function has same address.
1622
e2153196
ILT
16232011-07-11 Ian Lance Taylor <iant@google.com>
1624
1625 PR gold/12979
1626 * options.h (class General_options): Add -Bgroup.
1627 * options.cc (General_options::finalize): If -Bgroup is set,
1628 default to --unresolved-symbols=report-all.
1629 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1630 * target-reloc.h (issue_undefined_symbol_error): Handle
1631 --unresolved-symbols=report-all.
1632
6daf5215
ILT
16332011-07-08 Ian Lance Taylor <iant@google.com>
1634
1635 PR gold/11985
1636 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1637 if linker script discards key sections.
1638 (Layout::create_dynamic_symtab): Likewise.
1639 (Layout::assign_local_dynsym_offsets): Likewise.
1640 (Layout::sized_create_version_sections): Likewise.
1641 (Layout::create_interp): Likewise.
1642 (Layout::finish_dynamic_section): Likewise.
1643 (Layout::set_dynamic_symbol_size): Likewise.
1644
beabb2c6
ILT
16452011-07-08 Ian Lance Taylor <iant@google.com>
1646
1647 PR gold/12386
1648 * options.h (class General_options): Add --unresolved-symbols.
1649 * target-reloc.h (issue_undefined_symbol_error): Check
1650 --unresolved-symbols. Add comments.
1651
9c16daf1
ILT
16522011-07-08 Ian Lance Taylor <iant@google.com>
1653
1654 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1655 expression more complex.
1656
191f1a2d
ILT
16572011-07-08 Ian Lance Taylor <iant@google.com>
1658
1659 PR gold/11317
1660 * target-reloc.h (issue_undefined_symbol_error): New inline
1661 function, broken out of relocate_section.
1662 (relocate_section): Call issue_undefined_symbol_error.
1663 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1664 there is no TLS segment if we are about to issue an undefined
1665 symbol error.
1666 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1667
62855347
ILT
16682011-07-08 Ian Lance Taylor <iant@google.com>
1669
1670 PR gold/12279
1671 * resolve.cc (Symbol_table::should_override): Add fromtype
1672 parameter. Change all callers. Give error when linking together
1673 TLS and non-TLS symbol.
1674 (Symbol_table::should_override_with_special): Add fromtype
1675 parameter. Change all callers.
1676 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1677 there is no TLS segment if we have reported some errors.
1678 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1679
67181c72
ILT
16802011-07-08 Ian Lance Taylor <iant@google.com>
1681
1682 PR gold/12372
1683 * target.h (Target::plt_address_for_global): New function.
1684 (Target::plt_address_for_local): New function.
1685 (Target::plt_section_for_global): Remove.
1686 (Target::plt_section_for_local): Remove.
1687 (Target::do_plt_address_for_global): New virtual function.
1688 (Target::do_plt_address_for_local): New virtual function.
1689 (Target::do_plt_section_for_global): Remove.
1690 (Target::do_plt_section_for_local): Remove.
1691 (Target::register_global_plt_entry): Add Symbol_table and Layout
1692 parameters.
1693 * output.cc (Output_data_got::Got_entry::write): Use
1694 plt_address_for_global and plt_address_for_local.
1695 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1696 address of output section.
1697 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1698 got_irelative_, and irelative_count_ fields. Update
1699 declarations.
1700 (Output_data_plt_i386::has_irelative_section): New function.
1701 (Output_data_plt_i386::entry_count): Add irelative_count_.
1702 (Output_data_plt_i386::set_final_data_size): Likewise.
1703 (class Target_i386): Add got_irelative_ and rel_irelative_
1704 fields. Update declarations.
1705 (Target_i386::Target_i386): Initialize new fields.
1706 (Target_i386::do_plt_address_for_global): New function replacing
1707 do_plt_section_for_global.
1708 (Target_i386::do_plt_address_for_local): New function replacing
1709 do_plt_section_for_local.
1710 (Target_i386::got_section): Create got_irelative_.
1711 (Target_i386::rel_irelative_section): New function.
1712 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1713 fields. Don't define __rel_iplt_{start,end}.
1714 (Output_data_plt_i386::add_entry): Add symtab and layout
1715 parameters. Change all callers. Use different PLT and GOT for
1716 IFUNC symbols.
1717 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1718 layout parameters. Change all callers. Use different PLT and
1719 GOT.
1720 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1721 (Output_data_plt_i386::rel_irelative): New function.
1722 (Output_data_plt_i386::address_for_global): New function.
1723 (Output_data_plt_i386::address_for_local): New function.
1724 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1725 IRELATIVE GOT when changing IFUNC GOT entries.
1726 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1727 reloc.
1728 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1729 if we didn't create an IRELATIVE GOT.
1730 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1731 plt_address_for_local.
1732 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1733 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1734 got_irelative_, and irelative_count_ fields. Update
1735 declarations.
1736 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1737 Initialize new fields. Remove symtab parameter. Change all
1738 callers.
1739 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1740 irelative_count_.
1741 (Output_data_plt_x86_64::has_irelative_section): New function.
1742 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1743 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1744 fields. Update declarations.
1745 (Target_x86_64::Target_x86_64): Initialize new fields.
1746 (Target_x86_64::do_plt_address_for_global): New function replacing
1747 do_plt_section_for_global.
1748 (Target_x86_64::do_plt_address_for_local): New function replacing
1749 do_plt_section_for_local.
1750 (Target_x86_64::got_section): Create got_irelative_.
1751 (Target_x86_64::rela_irelative_section): New function.
1752 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1753 all callers. Don't create __rel_iplt_{start,end}.
1754 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1755 parameters. Change all callers. Use different PLT and GOT for
1756 IFUNC symbols.
1757 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1758 layout parameters. Change all callers. Use different PLT and
1759 GOT.
1760 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1761 parameters. Change all callers. Use different PLT and GOT for
1762 IFUNC symbols.
1763 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1764 (Output_data_plt_x86_64::rela_irelative): New function.
1765 (Output_data_plt_x86_64::address_for_global): New function.
1766 (Output_data_plt_x86_64::address_for_local): New function.
1767 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1768 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1769 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1770 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1771 parameters.
1772 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1773 reloc.
1774 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1775 symbols if we didn't create an IRELATIVE GOT.
1776 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1777 plt_address_for_local.
1778 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1779 * testsuite/ifuncvar1.c: New test file.
1780 * testsuite/ifuncvar2.c: New test file.
1781 * testsuite/ifuncvar3.c: New test file.
1782 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1783 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1784 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1785 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1786 * testsuite/Makefile.in: Rebuild.
1787
33c15b45
CC
17882011-07-07 Cary Coutant <ccoutant@google.com>
1789
1790 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1791 (two_file_test_1_ndebug.o): Likewise.
1792 (two_file_test_1b_ndebug.o): Likewise.
1793 (two_file_test_2_ndebug.o): Likewise.
1794 (two_file_test_main_ndebug.o): Likewise.
1795 (incremental_test_2): Link with no-debug versions.
1796
f48b5fb7
CC
17972011-07-06 Cary Coutant <ccoutant@google.com>
1798
1799 * gold/incremental.cc
1800 (Output_section_incremental_inputs::write_info_blocks): Check for
1801 hidden and internal symbols.
1802
221597a5
CC
18032011-07-06 Cary Coutant <ccoutant@google.com>
1804
1805 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1806 Check disposition for startup file.
1807 (Incremental_inputs::report_command_line): Ignore
1808 --incremental-startup-unchanged option.
1809 * options.cc (General_options::parse_incremental_startup_unchanged):
1810 New function.
1811 (General_options::General_options): Initialize new data member.
1812 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1813 (General_options): Add --incremental-startup-unchanged option.
1814 (General_options::incremental_startup_disposition): New function.
1815 (General_options::incremental_startup_disposition_): New data member.
1816
e24719f6
CC
18172011-07-06 Cary Coutant <ccoutant@google.com>
1818
1819 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1820 input file index to Script_info ctor.
1821 (Sized_incremental_binary::do_file_has_changed): Find the
1822 command-line argument for files named in scripts.
1823 * incremental.h (Script_info::Script_info): New ctor
1824 with input file index.
1825 (Script_info::input_file_index): New function.
1826 (Script_info::input_file_index_): New data member.
1827 (Incremental_binary::get_library): Add const.
1828 (Incremental_binary::get_script_info): Add const.
1829 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1830 * testsuite/Makefile.am (incremental_test_5): New test case.
1831 (incremental_test_6): New test case.
1832 * testsuite/Makefile.in: Regenerate.
1833
8f7c81e8
CC
18342011-07-06 Cary Coutant <ccoutant@google.com>
1835
1836 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1837 debug output when command lines differ.
1838
9fbd3822
CC
18392011-07-06 Cary Coutant <ccoutant@google.com>
1840
1841 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1842 --incremental-patch option.
1843 * layout.cc (Free_list::allocate): Extend allocation beyond original
1844 end if enabled.
1845 (Layout::make_output_section): Mark sections that should get
1846 patch space.
1847 * options.cc (parse_percent): New function.
1848 * options.h (parse_percent): New function.
1849 (DEFINE_percent): New macro.
1850 (General_options): Add --incremental-patch option.
1851 * output.cc (Output_section::Output_section): Initialize new data
1852 members.
1853 (Output_section::add_input_section): Print section name when out
1854 of patch space.
1855 (Output_section::add_output_section_data): Likewise.
1856 (Output_section::set_final_data_size): Add patch space when
1857 doing --incremental-full.
1858 (Output_section::do_reset_address_and_file_offset): Remove patch
1859 space.
1860 (Output_segment::set_section_list_addresses): Print debug output
1861 only if --incremental-update.
1862 * output.h (Output_section::set_is_patch_space_allowed): New function.
1863 (Output_section::is_patch_space_allowed_): New data member.
1864 (Output_section::patch_space_): New data member.
1865 * parameters.cc (Parameters::incremental_full): New function.
1866 * parameters.h (Parameters::incremental_full): New function
1867 * testsuite/Makefile.am (incremental_test_2): Add test for
1868 --incremental-patch option.
1869 * testsuite/Makefile.in: Regenerate.
1870 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1871 (t18): Remove function body.
1872
f6cccc2c
DK
18732011-07-05 Doug Kwan <dougkwan@google.com>
1874
1875 PR gold/12771
1876 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1877 Arm_Address type for relocation result.
1878 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1879 overflow check.
1880 (Arm_relocate_functions::abs32): Use unaligned access.
1881 (Arm_relocate_functions::rel32): Ditto.
1882 (Arm_relocate_functions::prel31): Ditto.
1883 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1884 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1885 static data relocations.
1886 * testsuite/Makefile.in: Regnerate.
1887 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1888
28a13fec
ILT
18892011-07-05 Ian Lance Taylor <iant@google.com>
1890
1891 PR gold/12392
1892 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1893 symbols if necessary.
1894 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1895
24d47b34
ILT
18962011-07-05 Ian Lance Taylor <iant@google.com>
1897
1898 PR gold/12952
1899 * resolve.cc (Symbol::override_base_with_special): Simply override
1900 version with special symbol version, ignoring previous version.
1901
41f9cbbe
ILT
19022011-07-05 Ian Lance Taylor <iant@google.com>
1903
1904 * object.cc (Sized_relobj_file::include_section_group): Add
1905 information to comment about signature location.
1906
886288f1
ILT
19072011-07-02 Ian Lance Taylor <iant@google.com>
1908
1909 PR gold/12957
1910 * options.h (class General_options): Add -f and -F.
1911 * options.cc (General_options::finalize): Fatal error if -f/-F
1912 are used without -shared.
1913 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1914
ae3a6d4f
ILT
19152011-07-02 Ian Lance Taylor <iant@google.com>
1916
1917 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1918
21131061
ILT
19192011-07-01 Ian Lance Taylor <iant@google.com>
1920
1921 PR gold/12525
1922 PR gold/12952
1923 * resolve.cc (Symbol::override_base_with_special): Don't override
1924 the version if the overriding symbol has a different name.
1925 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1926 all callers. If we give an error about an undefined version,
1927 define the base version if necessary.
1928 * dynobj.h (class Versions): Update declaration.
1929 * testsuite/weak_alias_test_5.cc: New file.
1930 * testsuite/weak_alias_test.script: New file.
1931 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1932 and versioned_alias have the right value, and call t2.
1933 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1934 weak_alias_test_5.so.
1935 (weak_alias_test_LDADD): Likewise.
1936 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1937 * testsuite/Makefile.in: Rebuild.
1938
611062c0
ILT
19392011-07-01 Ian Lance Taylor <iant@google.com>
1940
1941 PR gold/12525
1942 * options.h (class General_options): Support -z notext.
1943 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1944 -Wl,-z,notext.
1945 (two_file_shared_nonpic.so): Likewise.
1946 (two_file_shared_mixed.so): Likewise.
1947 (two_file_shared_mixed_1.so): Likewise.
1948 (weak_undef_lib_nonpic.so): Likewise.
1949 (alt/weak_undef_lib_nonpic.so): Likewise.
1950 (tls_test_shared_nonpic.so): Likewise.
1951 * testsuite/Makefile.in: Rebuild.
1952
328c7c2f
ILT
19532011-07-01 Ian Lance Taylor <iant@google.com>
1954
1955 PR gold/12525
1956 * configure.ac: Test whether static linking works, setting
1957 the automake conditional HAVE_STATIC.
1958 * testsuite/Makefile.am: Disable tests using -static if
1959 HAVE_STATIC is not true.
1960 * configure, testsuite/Makefile.in: Rebuild.
1961
02d7cd44
ILT
19622011-07-01 Ian Lance Taylor <iant@google.com>
1963
1964 PR gold/12525
1965 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1966 Assert if we see DW_EH_PE_indirect.
1967 * target.h (Target::ehframe_datarel_base): New function.
1968 (Target::do_ehframe_datarel_base): New target function.
1969 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1970 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1971 function.
1972
07a60597
ILT
19732011-07-01 Ian Lance Taylor <iant@google.com>
1974
1975 PR gold/12571
1976 * options.h (class General_options): Add
1977 --ld-generated-unwind-info.
1978 * ehframe.cc (Fde::write): Add address parameter. Change all
1979 callers. If associated with PLT, fill in address and size.
1980 (Cie::set_output_offset): Only add merge mapping if there is an
1981 object.
1982 (Cie::write): Add address parameter. Change all callers.
1983 (Eh_frame::add_ehframe_for_plt): New function.
1984 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1985 input_offset_ fields into union u_, with new plt field.
1986 (Fde::Fde): Adjust for new union field.
1987 (Fde::Fde) [Output_data version]: New constructor.
1988 (Fde::add_mapping): Only add merge mapping if there is an object.
1989 (class Cie): Update declarations.
1990 (class Eh_frame): Declare add_ehframe_for_plt.
1991 * layout.cc (Layout::layout_eh_frame): Break out code into
1992 make_eh_frame_section, and call it.
1993 (Layout::make_eh_frame_section): New function.
1994 (Layout::add_eh_frame_for_plt): New function.
1995 * layout.h (class Layout): Update declarations.
1996 * merge.cc (Merge_map::add_mapping): Add assertion.
1997 * i386.cc: Include "dwarf.h".
1998 (class Output_data_plt_i386): Make first_plt_entry,
1999 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2000 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2001 and plt_eh_frame_fde.
2002 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2003 boundary. Call add_eh_frame_for_plt if appropriate.
2004 * x86_64.cc: Include "dwarf.h".
2005 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2006 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2007 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2008 and plt_eh_frame_fde.
2009 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
2010 appropriate.
2011
14788a3f
ILT
20122011-06-29 Ian Lance Taylor <iant@google.com>
2013
2014 PR gold/12629
2015 * object.cc (Sized_relobj_file::layout_section): Change shdr
2016 parameter to be const.
2017 (Sized_relobj_file::layout_eh_frame_section): New function, broken
2018 out of do_layout.
2019 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
2020 appropriate. Call layout_eh_frame_section.
2021 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
2022 sections.
2023 * object.h (class Sized_relobj_file): Update declarations.
2024
6c21fce1
ILT
20252011-06-29 Ian Lance Taylor <iant@google.com>
2026
37e41b03 2027 PR gold/12652
6c21fce1
ILT
2028 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2029 modifier.
2030 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2031
4d5e4e62
ILT
20322011-06-29 Ian Lance Taylor <iant@google.com>
2033
2034 PR gold/12675
2035 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2036 SHT_X86_64_UNWIND.
2037 * layout.cc (Layout::layout_eh_frame): Likewise.
2038
886f533a
ILT
20392011-06-29 Ian Lance Taylor <iant@google.com>
2040
2041 PR gold/12695
2042 * layout.cc (Layout::symtab_section_shndx): New function.
2043 * layout.h (class Layout): Declare symtab_section_shndx.
2044 * output.cc (Output_section::write_header): Call it.
2045
f3ae1b28
ILT
20462011-06-29 Ian Lance Taylor <iant@google.com>
2047
2048 PR gold/12818
2049 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
2050 symbols which are not used in a relocation.
2051
aecf301f
ILT
20522011-06-28 Ian Lance Taylor <iant@google.com>
2053
2054 PR gold/12898
2055 * layout.cc (Layout::segment_precedes): Don't crash if a linker
2056 script create indistinguishable segments.
2057 (Layout::set_segment_offsets): Use stable_sort when sorting
2058 segments. Pass this to Compare_segments constructor.
2059 * layout.h (class Layout): Make segment_precedes non-static.
2060 (class Compare_segments): Change from struct to class. Add
2061 layout_ field. Add constructor.
2062 * script-sections.cc
2063 (Script_sections::attach_sections_using_phdrs_clause): Rename
2064 local orphan to is_orphan. Don't report failure to put empty
2065 section in segment. On attachment failure, report name of
2066 section, and attach to first PT_LOAD segment.
2067
03ef7571
ILT
20682011-06-28 Ian Lance Taylor <iant@google.com>
2069
2070 PR gold/12934
2071 * target-select.cc (Target_selector::Target_selector): Add
2072 emulation parameter. Change all callers.
2073 (select_target_by_bfd_name): Rename from select_target_by_name.
2074 Change all callers.
2075 (select_target_by_emulation): New function.
2076 (supported_emulation_names): New function.
2077 * target-select.h (class Target_selector): Add emulation_ field.
2078 Update declarations.
2079 (Target_selector::recognize_by_bfd_name): Rename from
2080 recognize_by_name. Change all callers.
2081 (Target_selector::supported_bfd_names): Rename from
2082 supported_names. Change all callers.
2083 (Target_selector::recognize_by_emulation): New function.
2084 (Target_selector::supported_emulations): New function.
2085 (Target_selector::emulation): New function.
2086 (Target_selector::do_recognize_by_bfd_name): Rename from
2087 do_recognize_by_name. Change all callers.
2088 (Target_selector::do_supported_bfd_names): Rename from
2089 do_supported_names. Change all callers.
2090 (Target_selector::do_recognize_by_emulation): New function.
2091 (Target_selector::do_supported_emulations): New function.
2092 (select_target_by_bfd_name): Change name in declaration.
2093 (select_target_by_emulation): Declare.
2094 (supported_emulation_names): Declare.
2095 * parameters.cc (parameters_force_valid_target): Try to find
2096 target based on emulation from -m option.
2097 * options.h (class General_options): Change doc string for -m.
2098 * options.cc (help): Print emulations.
2099 (General_options::parse_V): Likewise.
2100 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2101 Add emulation parameter. Change all callers.
2102
200b2bb9
ILT
21032011-06-28 Ian Lance Taylor <iant@google.com>
2104
2105 * target.h (class Target): Add osabi_ field.
2106 (Target::osabi): New function.
2107 (Target::set_osabi): New function.
2108 (Target::Target): Initialize osabi_.
2109 (Target::do_adjust_elf_header): Make pure virtual.
2110 (Sized_target::do_adjust_elf_header): Declare.
2111 * target.cc (Sized_target::do_adjust_elf_header): New function.
2112 (class Sized_target): Instantiate all versions.
2113 * freebsd.h (class Target_freebsd): Remove.
2114 (Target_selector_freebsd::do_recognize): Call set_osabi on
2115 Target.
2116 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2117 (Target_selector_freebsd::set_osabi): Remove.
2118 * i386.cc (class Target_i386): Inherit from Sized_target rather
2119 than Target_freebsd.
2120 * x86_64.cc (class Target_x86_64): Likewise.
2121
b3ce541e
ILT
21222011-06-28 Ian Lance Taylor <iant@google.com>
2123
2124 * target.h (Target::can_check_for_function_pointers): Rewrite.
2125 Make non-virtual.
2126 (Target::can_icf_inline_merge_sections): Likewise.
2127 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2128 (Target::Target_info): Add can_icf_inline_merge_sections field.
2129 (Target::do_can_check_for_function_pointers): New virtual
2130 function.
2131 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2132 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2133 from can_check_for_function_pointers, move in file.
2134 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2135 section_may_have_icf_unsafe_poineters, move in file.
2136 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2137 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2138 Rename from can_check_for_function_pointers, move in file.
2139 (Target_i386::can_icf_inline_merge_sections): Remove.
2140 (Target_i386::i386_info): Initialize
2141 can_icf_inline_merge_sections.
2142 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2143 Initialize can_icf_inline_merge_sections.
2144 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2145 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2146 Rename from can_check_for_function_pointers, move in file.
2147 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2148 (Target_x86_64::x86_64_info): Initialize
2149 can_icf_inline_merge_sections.
2150 * testsuite/testfile.cc (Target_test::test_target_info):
2151 Likewise.
2152 * icf.cc (get_section_contents): Correct formatting.
2153
6d1c4efb
ILT
21542011-06-27 Ian Lance Taylor <iant@google.com>
2155
2156 * symtab.cc (Symbol::versioned_name): New function.
2157 (Symbol_table::add_to_final_symtab): Use versioned_name when
2158 appropriate.
2159 (Symbol_table::sized_write_symbol): Likewise.
2160 * symtab.h (class Symbol): Declare versioned_name.
2161 * stringpool.h (class Stringpool_template): Add variant of add
2162 which takes a std::basic_string.
2163 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2164 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2165 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2166 (ver_test_12.o): New target.
2167 * testsuite/Makefile.in: Rebuild.
2168
57eb9b50
DK
21692011-06-27 Doug Kwan <dougkwan@google.com>
2170
2171 * arm.cc (Arm_relocate_functions::thm_jump8,
2172 Arm_relocate_functions::thm_jump11): Use a wider signed
2173 type to compute offset.
2174 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2175 arm_thm_jump8.
2176 * testsuite/Makefile.in: Regenerate.
2177 * testsuite/arm_branch_in_range.sh: Check test results of
2178 arm_thm_jump11 and arm_thm_jump8.
2179 * testsuite/arm_thm_jump11.s: New test source file.
2180 * testsuite/arm_thm_jump11.t: New linker script.
2181 * testsuite/arm_thm_jump8.s: New test source file.
2182 * testsuite/arm_thm_jump8.t: New linker script.
2183
487b39df
ILT
21842011-06-24 Ian Lance Taylor <iant@google.com>
2185
2186 * layout.cc: Include "object.h".
2187 (ctors_sections_in_init_array): New static variable.
2188 (Layout::is_ctors_in_init_array): New function.
2189 (Layout::layout): Add entry to ctors_sections_in_init_array if
2190 appropriate.
2191 * layout.h (class Layout): Declare is_ctors_in_init_array.
2192 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2193 is_ctors_reverse_view is set.
2194 (Sized_relobj_file::write_sections): Add layout parameter. Change
2195 all callers. Set is_ctors_reverse_view field of View_size.
2196 (Sized_relobj_file::reverse_words): New function.
2197 * object.h (Sized_relobj_file::View_size): Add
2198 is_ctors_reverse_view field.
2199 (class Sized_relobj_file): Update declarations.
2200 * testsuite/initpri3.c: New test.
2201 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2202 initpri3b.
2203 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2204 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2205 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2206 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2207 * testsuite/Makefile.in: Rebuild.
2208
472076e4
CC
22092011-06-24 Cary Coutant <ccoutant@google.com>
2210
2211 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2212 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2213 (debug_msg_cdebug.err): New targets.
2214 * testsuite/Makefile.in: Regenerate.
2215 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2216 Fix checks for link with shared library.
2217
a60af0db
DK
22182011-06-24 Doug Kwan <dougkwan@google.com>
2219
2220 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2221 skip empty text sections.
2222 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2223
5393d741
ILT
22242011-06-22 Ian Lance Taylor <iant@google.com>
2225
2226 PR gold/12910
2227 * options.h (class General_options): Add --ctors-in-init-array.
2228 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2229 friends as SHT_PROGBITS for merging sections.
2230 (Layout::layout): Remove special handling of .init_array and
2231 friends. Don't sort if doing relocatable link. Sort for .ctors
2232 and .dtors if ctors_in_init_array.
2233 (Layout::make_output_section): Force correct section types for
2234 .init_array and friends. Don't sort if doing relocatable link,
2235 Don't sort .ctors and .dtors if ctors_in_init_array.
2236 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2237 (Layout::output_section_name): Add relobj parameter. Change all
2238 callers. Handle .ctors. and .dtors. in code rather than table.
2239 Handle .ctors and .dtors if ctors_in_init_array.
2240 (Layout::match_file_name): New function, moved from output.cc.
2241 * layout.h (class Layout): Update declarations.
2242 * output.cc: Include "layout.h".
2243 (Input_section_sort_entry::get_priority): New function.
2244 (Input_section_sort_entry::match_file_name): Just call
2245 Layout::match_file_name.
2246 (Output_section::Input_section_sort_init_fini_compare::operator()):
2247 Handle .ctors and .dtors. Sort by explicit priority rather than
2248 by name.
2249 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2250 * testsuite/initpri2.c: New test.
2251 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2252 (check_PROGRAMS): Add initpri2.
2253 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2254 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2255 * configure, testsuite/Makefile.in: Rebuild.
2256
e1f74f98
ILT
22572011-06-19 Ian Lance Taylor <iant@google.com>
2258
2259 PR gold/12880
2260 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2261 .interp section to a PT_INTERP segment even if we have seen a
2262 --dynamic-linker option. Don't do it if we have seen a PHDRS
2263 clause in a linker script.
2264 (Layout::finalize): Don't create a .interp section if we've
2265 already create a PT_INTERP segment.
2266 (Layout::create_interp): Always call choose_output_section (revert
2267 patch of 2011-06-17). Don't create PT_INTERP segment.
2268 * script-sections.cc
2269 (Script_sections::create_note_and_tls_segments): Add a .interp
2270 section to a PT_INTERP segment even if we have seen a
2271 --dynamic-linker option.
2272
766f91bb
ILT
22732011-06-18 Ian Lance Taylor <iant@google.com>
2274
2275 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2276 merely because a non-PT_LOAD segment has a dynamic reloc.
2277
0d212c3a
ILT
22782011-06-18 Ian Lance Taylor <iant@google.com>
2279
2280 * layout.cc (Layout::finish_dynamic_section): Don't create
2281 DT_FLAGS entry if not needed.
2282
911a5072
ILT
22832011-06-18 Ian Lance Taylor <iant@google.com>
2284
2285 PR gold/12745
2286 * layout.cc (Layout::layout_eh_frame): Correct handling of
2287 writable .eh_frame section.
2288
534b4e5f
ILT
22892011-06-17 Ian Lance Taylor <iant@google.com>
2290
2291 PR gold/12893
2292 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2293 symbol is redefined with the exact same object and value.
2294
10b4f102
ILT
22952011-06-17 Ian Lance Taylor <iant@google.com>
2296
2297 PR gold/12880
2298 * layout.h (class Layout): Add interp_segment_ field.
2299 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2300 (Layout::attach_allocated_section_to_segment): If making shared
2301 library, put .interp section in PT_INTERP segment.
2302 (Layout::finalize): Also call create_interp if -dynamic-linker
2303 option was used.
2304 (Layout::create_interp): Assert that there is no PT_INTERP
2305 segment. If not using a SECTIONS clause, use make_output_section.
2306 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2307 * script-sections.cc
2308 (Script_sections::create_note_and_tls_segments): If making shared
2309 library, put .interp section in PT_INTERP segment.
2310
a29b0dad
ILT
23112011-06-17 Ian Lance Taylor <iant@google.com>
2312
e588ea8d
ILT
2313 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2314 when making a shared library.
2315
23162011-06-17 Ian Lance Taylor <iant@google.com>
2317
2318 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2319 parameter. Change all callers. Don't issue warning about PC32
2320 against locally defined symbol.
a29b0dad 2321
9d3b0698
ILT
23222011-06-16 Ian Lance Taylor <iant@google.com>
2323
2324 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2325 occurs in same object.
2326
85b0f90c
AM
23272011-06-14 Alan Modra <amodra@gmail.com>
2328
2329 * po/POTFILES.in: Regenerate.
2330
a94907d9
ILT
23312011-06-09 Ian Lance Taylor <iant@google.com>
2332
2333 * script-sections.cc
2334 (Orphan_output_section::set_section_addresses): For a relocatable
2335 link set address to 0.
2336
4fb3a1c3
CC
23372011-06-09 Cary Coutant <ccoutant@google.com>
2338
2339 PR gold/12804
2340 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2341 used with --compress-debug-sections.
2342 * gold/object.cc (Sized_relobj_file::do_layout): Report
2343 uncompressed size of compressed input sections.
2344
61220854
CC
23452011-06-08 Cary Coutant <ccoutant@google.com>
2346
2347 PR gold/12804
2348 * testsuite/two_file_test_2_v1.cc: Change initialization of
2349 v2 to keep it in .data.
2350
e6455dfb
CC
23512011-06-07 Cary Coutant <ccoutant@google.com>
2352
2353 * common.cc (Symbol_table::do_allocate_commons_list): Call
2354 gold_fallback.
2355 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2356 (Errors::fallback): New function.
2357 (gold_fallback): New function.
2358 * errors.h (Errors::fallback): New function.
2359 * gold.cc (gold_exit): Change status parameter to enum; adjust
2360 all callers.
2361 (queue_initial_tasks): Call gold_fallback.
2362 * gold.h: Include cstdlib.
2363 (Exit_status): New enum type.
2364 (gold_exit): Change status parameter to enum.
2365 (gold_fallback): New function.
2366 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2367 (Layout::create_symtab_sections): Likewise.
2368 (Layout::create_shdrs): Likewise.
2369 * main.cc (main): Adjust call to gold_exit.
2370 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2371 (Output_data_got::add_got_entry_pair): Likewise.
2372 (Output_section::add_input_section): Likewise.
2373 (Output_section::add_output_section_data): Likewise.
2374 (Output_segment::set_section_list_addresses): Likewise.
2375 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2376
fb0e076f
CC
23772011-06-07 Cary Coutant <ccoutant@google.com>
2378
2379 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2380 for incremental links.
2381 * output.cc (Output_segment::set_section_list_addresses): Remove
2382 FIXME and test for TLS or BSS.
2383
a5ee4d5d
CC
23842011-06-07 Cary Coutant <ccoutant@google.com>
2385
2386 * testsuite/Makefile.am: Add incremental_copy_test,
2387 incremental_common_test_1.
2388 * testsuite/Makefile.in: Regenerate.
2389 * testsuite/common_test_1_v1.c: New source file.
2390 * testsuite/common_test_1_v2.c: New source file.
2391 * testsuite/copy_test_v1.cc: New source file.
2392
5146f448
CC
23932011-06-07 Cary Coutant <ccoutant@google.com>
2394
2395 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2396 update, allocate common from bss section's free list.
2397 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2398 linker-defined symbols.
2399 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2400 Skip GOT and PLT entries that are no longer referenced.
2401 (Output_section_incremental_inputs::write_info_blocks): Mark
2402 linker-defined symbols.
2403 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2404 * output.cc (Output_section::allocate): New function.
2405 * output.h (Output_section::allocate): New function.
2406 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2407 linker-defined symbols.
2408 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2409 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2410 (Symbol::init_base_output_data): Likewise.
2411 (Symbol::init_base_output_segment): Likewise.
2412 (Symbol::init_base_constant): Likewise.
2413 (Sized_symbol::init_output_data): Likewise.
2414 (Sized_symbol::init_output_segment): Likewise.
2415 (Sized_symbol::init_constant): Likewise.
2416 (Symbol_table::do_define_in_output_data): Likewise.
2417 (Symbol_table::do_define_in_output_segment): Likewise.
2418 (Symbol_table::do_define_as_constant): Likewise.
2419 * symtab.h (Symbol::is_predefined): New function.
2420 (Symbol::init_base_output_data): Add is_predefined parameter.
2421 (Symbol::init_base_output_segment): Likewise.
2422 (Symbol::init_base_constant): Likewise.
2423 (Symbol::is_predefined_): New data member.
2424 (Sized_symbol::init_output_data): Add is_predefined parameter.
2425 (Sized_symbol::init_output_segment): Likewise.
2426 (Sized_symbol::init_constant): Likewise.
2427 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2428
26d3c67d
CC
24292011-06-07 Cary Coutant <ccoutant@google.com>
2430
2431 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2432 instead of emit_copy_reloc.
2433 (Copy_relocs::emit_copy_reloc): Refactor.
2434 (Copy_relocs::make_copy_reloc): New function.
2435 (Copy_relocs::add_copy_reloc): Remove.
2436 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2437 section.
2438 (Copy_relocs::make_copy_reloc): New function.
2439 (Copy_relocs::add_copy_reloc): Remove.
2440 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2441 unchanged input files.
2442 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2443 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2444 Reserve BSS space for COPY relocations.
2445 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2446 (Output_section_incremental_inputs::write_info_blocks): Record
2447 whether a symbol is copied from a shared object.
2448 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2449 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2450 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2451 (Incremental_input_entry_reader::get_output_symbol_index): Add
2452 is_copy parameter.
2453 (Incremental_binary::emit_copy_relocs): New function.
2454 (Incremental_binary::do_emit_copy_relocs): New function.
2455 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2456 new data member.
2457 (Sized_incremental_binary::add_copy_reloc): New function.
2458 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2459 (Sized_incremental_binary::Copy_reloc): New struct.
2460 (Sized_incremental_binary::Copy_relocs): New typedef.
2461 (Sized_incremental_binary::copy_relocs_): New data member.
2462 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2463 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2464 * target.h (Sized_target::emit_copy_reloc): New function.
2465 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2466
7cdb37d9
CC
24672011-06-02 Cary Coutant <ccoutant@google.com>
2468
2469 PR gold/12163
2470 * gold/archive.cc (Archive::Archive): Initialize new data member.
2471 (Archive::include_all_members): Return if archive has already been
2472 included.
2473 * gold/archive.h (Archive::include_all_members_): New data member.
2474
cc643b88
NC
24752011-06-02 Nick Clifton <nickc@redhat.com>
2476
2477 * dynobj.h: Fix spelling mistake in comment.
2478 * output.cc: Likewise.
2479
f62a3ca7 24802011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 2481 Asier Llano
f62a3ca7
DK
2482
2483 PR gold/12826
cc643b88 2484 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
2485 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2486 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2487 redundant arm_exidx_test.so.
2488 * testsuite/Makefile.in: Regenerate.
2489 (check_SCRIPTS): Add pr12826.sh
2490 (check_DATA): Add pr12826.stdout
2491 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2492 * testsuite/pr12826.sh: New file.
2493 * testsuite/pr12826_1.s: Ditto.
2494 * testsuite/pr12826_1.s: Ditto.
2495
8dbe1edc
ILT
24962011-05-30 Ian Lance Taylor <iant@google.com>
2497
2498 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2499 sections.
2500
c49875be
ILT
25012011-05-29 Ian Lance Taylor <iant@google.com>
2502
2503 PR gold/12804
2504 * testsuite/Makefile.am: Use different file name for two_file_test
2505 temporary file for each incremental test.
2506 * testsuite/Makefile.in: Rebuild.
2507
69d53f7a
ILT
25082011-05-29 Ian Lance Taylor <iant@google.com>
2509
2510 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2511 binary input file is empty.
2512
41d0ab5f
ILT
25132011-05-27 Ian Lance Taylor <iant@google.com>
2514
2515 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2516 (ver_test_9.so): Likewise.
2517 * testsuite/Makefile.in: Rebuild.
2518
89d8a36b
CC
25192011-05-26 Cary Coutant <ccoutant@google.com>
2520
2521 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2522 * incremental.cc (Incremental_inputs::report_input_section): Fix
2523 comment, indentation.
2524 (Incremental_inputs::report_comdat_group): New function.
2525 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2526 of data for incremental input file entry.
2527 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2528 group count, COMDAT group signatures.
2529 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2530 an unchanged input file.
2531 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2532 Initialize new data member.
2533 (Incremental_object_entry::add_comdat_group): New function.
2534 (Incremental_object_entry::get_comdat_group_count): New function.
2535 (Incremental_object_entry::get_comdat_signature_key): New function.
2536 (Incremental_object_entry::groups_): New data member.
2537 (Incremental_inputs::report_comdat_group): New function.
2538 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2539 data for incremental input file entry.
2540 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2541 (Incremental_input_entry_reader::get_input_section): Adjust size of
2542 data for incremental input file entry.
2543 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2544 (Incremental_input_entry_reader::get_comdat_group_signature): New
2545 function.
2546 * object.cc (Sized_relobj::include_section_group): Report kept
2547 COMDAT groups for incremental links.
2548
1706a06f
ILT
25492011-05-24 David Meyer <pdox@google.com>
2550
2551 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2552 with name parameter. Add found_name parameter.
2553 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2554 * dirsearch.h (class Dirsearch): Update declaration.
2555
a10ae760
ILT
25562011-05-24 Ian Lance Taylor <iant@google.com>
2557
2558 * archive.cc (Library_base::should_include_member): Pull in object
2559 from archive if it defines the entry symbol.
2560 * parameters.cc (Parameters::entry): New function.
2561 * parameters.h (class Parameters): Declare entry.
2562 * output.h (class Output_file_header): Remove entry_ field.
2563 * output.cc (Output_file_header::Output_file_header): Remove entry
2564 parameter. Change all callers.
2565 (Output_file_header::entry): Use parameters->entry.
2566 * gold.cc (queue_middle_tasks): Likewise.
2567 * plugin.cc (Plugin_hook::run): Likewise.
2568
aa92d6ed
CC
25692011-05-24 Cary Coutant <ccoutant@google.com>
2570
2571 * gold.cc (queue_initial_tasks): Pass incremental base filename
2572 to Output_file::open_base_file; don't print error message.
2573 * incremental-dump.cc (main): Adjust call to
2574 Output_file::open_for_modification.
2575 * incremental-dump.cc (main): Likewise.
2576 * incremental.cc (Incremental_inputs::report_command_line):
2577 Ignore --incremental-base option when comparing command lines.
2578 Ignore parameter when given as separate argument.
2579 * options.h (class General_options): Add --incremental-base.
2580 * output.cc (Output_file::Output_file):
2581 (Output_file::open_base_file): Add base_name and writable parameters;
2582 read base file into new file; print error message here.
2583 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2584 callers.
2585 * output.h (Output_file::open_for_modification): Rename to...
2586 (Output_file::open_base_file): ...this; add base_name and
2587 writable parameters; adjust all callers.
2588 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2589 callers.
2590 * testsuite/Makefile.am (incremental_test_4): Test
2591 --incremental-base.
2592 * testsuite/Makefile.in: Regenerate.
2593
2eedd706
CC
25942011-05-24 Cary Coutant <ccoutant@google.com>
2595
2596 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2597 incremental_test_4.
2598 * testsuite/Makefile.in: Regenerate.
2599 * testsuite/two_file_test_1_v1.cc: New test source file.
2600 * testsuite/two_file_test_1b_v1.cc: New test source file.
2601 * testsuite/two_file_test_2_v1.cc: New test source file.
2602
0f1c85a6
CC
26032011-05-24 Cary Coutant <ccoutant@google.com>
2604
2605 * dynobj.h (Dynobj::do_dynobj): New function.
2606 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2607 flag and soname for shared objects.
2608 * incremental.cc (Incremental_inputs::report_object): Make
2609 either Incremental_object_entry or Incremental_dynobj_entry; add
2610 soname to string table.
2611 (Incremental_inputs::report_input_section): Add assertion.
2612 (Output_section_incremental_inputs::set_final_data_size): Adjust
2613 type of input file entry for shared libraries; adjust size of
2614 shared library info entry.
2615 (Output_section_incremental_inputs::write_input_files): Write
2616 as_needed flag for shared libraries.
2617 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2618 of input file entry for shared libraries; write soname.
2619 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2620 soname from incremental info.
2621 * incremental.h (enum Incremental_input_flags): Add
2622 INCREMENTAL_INPUT_AS_NEEDED.
2623 (Incremental_input_entry::Incremental_input_entry): Initialize new
2624 data member.
2625 (Incremental_input_entry::set_as_needed): New function.
2626 (Incremental_input_entry::as_needed): New function.
2627 (Incremental_input_entry::do_dynobj_entry): New function.
2628 (Incremental_input_entry::as_needed_): New data member.
2629 (Incremental_object_entry::Incremental_object_entry): Don't check
2630 for shared library.
2631 (Incremental_object_entry::do_type): Likewise.
2632 (class Incremental_dynobj_entry): New class.
2633 (Incremental_input_entry_reader::as_needed): New function.
2634 (Incremental_input_entry_reader::get_soname): New function.
2635 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2636 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2637 size of shared library info entry.
58797674 2638 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
2639 incremental link when adding DT_NEEDED entries.
2640 * object.h (Object::Object): Initialize new data member.
2641 (Object::dynobj): New function.
2642 (Object::set_as_needed): New function.
2643 (Object::as_needed): New function.
2644 (Object::do_dynobj): New function.
2645 (Object::as_needed_): New data member.
2646
6fa2a40b
CC
26472011-05-24 Cary Coutant <ccoutant@google.com>
2648
2649 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2650 info; adjust display of GOT entries.
2651 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2652 vector of input objects; remove file_status_.
2653 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2654 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2655 got_plt reader; call target hooks to reserve GOT entries.
2656 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2657 of input file info header and GOT info entry.
2658 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2659 relocation info.
2660 (Got_plt_view_info::got_descriptor): Remove.
2661 (Got_plt_view_info::sym_index): New data member.
2662 (Got_plt_view_info::input_index): New data member.
2663 (Local_got_offset_visitor::visit): Write input file index.
2664 (Global_got_offset_visitor::visit): Write 0 for input file index.
2665 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2666 with sym_index and input_index.
2667 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2668 incremental info GOT entry; replace got_descriptor with input_index.
2669 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2670 map from input file index to object.
2671 (Sized_relobj_incr::do_layout): Replace direct data member reference
2672 with accessor function.
2673 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2674 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2675 Adjust size of input file info header.
2676 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2677 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2678 (Incremental_input_entry_reader::get_input_section): Adjust size of
2679 input file info header.
2680 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2681 of incremental info GOT entry.
2682 (Incremental_got_plt_reader::get_got_desc): Remove.
2683 (Incremental_got_plt_reader::get_got_symndx): New function.
2684 (Incremental_got_plt_reader::get_got_input_index): New function.
2685 (Sized_incremental_binary::Sized_incremental_binary): Remove
2686 file_status_; add input_objects_.
2687 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2688 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2689 (Sized_incremental_binary::file_is_unchanged): Remove.
2690 (Sized_incremental_binary::set_input_object): New function.
2691 (Sized_incremental_binary::input_object): New function.
2692 (Sized_incremental_binary::file_status_): Remove.
2693 (Sized_incremental_binary::input_objects_): New data member.
2694 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2695 references.
2696 (Sized_relobj_incr::invalid_address): Move to base class.
2697 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2698 class.
2699 (Sized_relobj_incr::do_output_section_offset): Likewise.
2700 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2701 (Sized_relobj_incr::section_offsets_): Likewise.
2702 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2703 function.
2704 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2705 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2706 with accessor function.
2707 (Sized_relobj_file::do_layout): Likewise.
2708 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2709 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2710 (Sized_relobj_file::compute_final_local_value): Replace refs to
2711 section_offsets_ with accessor function.
2712 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2713 * object.h (Relobj::Relobj): Initialize new data members.
2714 (Relobj::add_dyn_reloc): New function.
2715 (Relobj::first_dyn_reloc): New function.
2716 (Relobj::dyn_reloc_count): New function.
2717 (Relobj::first_dyn_reloc_): New data member.
2718 (Relobj::dyn_reloc_count_): New data member.
2719 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2720 references.
2721 (Sized_relobj::Address): New typedef.
2722 (Sized_relobj::invalid_address): Move here from child class.
2723 (Sized_relobj::Sized_relobj): Initialize new data members.
2724 (Sized_relobj::sized_relobj): New function.
2725 (Sized_relobj::is_output_section_offset_invalid): Move here from
2726 child class.
2727 (Sized_relobj::get_output_section_offset): Likewise.
2728 (Sized_relobj::local_has_got_offset): Likewise.
2729 (Sized_relobj::local_got_offset): Likewise.
2730 (Sized_relobj::set_local_got_offset): Likewise.
2731 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2732 (Sized_relobj::clear_got_offsets): New function.
2733 (Sized_relobj::section_offsets): Move here from child class.
2734 (Sized_relobj::do_output_section_offset): Likewise.
2735 (Sized_relobj::do_set_section_offset): Likewise.
2736 (Sized_relobj::Local_got_offsets): Likewise.
2737 (Sized_relobj::local_got_offsets_): Likewise.
2738 (Sized_relobj::section_offsets_): Likewise.
2739 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2740 references.
2741 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2742 class.
2743 (Sized_relobj_file::sized_relobj): New function
2744 (Sized_relobj_file::local_has_got_offset): Move to base class.
2745 (Sized_relobj_file::local_got_offset): Likewise.
2746 (Sized_relobj_file::set_local_got_offset): Likewise.
2747 (Sized_relobj_file::get_output_section_offset): Likewise.
2748 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2749 (Sized_relobj_file::do_output_section_offset): Likewise.
2750 (Sized_relobj_file::do_set_section_offset): Likewise.
2751 (Sized_relobj_file::Local_got_offsets): Likewise.
2752 (Sized_relobj_file::local_got_offsets_): Likewise.
2753 (Sized_relobj_file::section_offsets_): Likewise.
2754 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2755 (all constructors).
2756 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2757 (Output_reloc::get_symbol_index): Likewise.
2758 (Output_reloc::local_section_offset): Likewise.
2759 (Output_reloc::get_address): Likewise.
2760 (Output_reloc::symbol_value): Likewise.
2761 (Output_data_got::reserve_slot): Move to class definition.
2762 (Output_data_got::reserve_local): New function.
2763 (Output_data_got::reserve_slot_for_global): Remove.
2764 (Output_data_got::reserve_global): New function.
2765 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2766 (all constructors, two instantiations).
2767 (Output_reloc::get_relobj): New function (two instantiations).
2768 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2769 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2770 (Output_data_reloc::add_global): Adjust type of relobj.
2771 (Output_data_reloc::add_global_relative): Likewise.
2772 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2773 (Output_data_reloc::add_local): Likewise.
2774 (Output_data_reloc::add_local_relative): Likewise.
2775 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2776 (Output_data_reloc::add_local_section): Likewise.
2777 (Output_data_reloc::add_output_section): Likewise.
2778 (Output_data_reloc::add_absolute): Likewise.
2779 (Output_data_reloc::add_target_specific): Likewise.
2780 (Output_data_got::reserve_slot): Move definition here.
2781 (Output_data_got::reserve_local): New function.
2782 (Output_data_got::reserve_global): New function.
2783 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2784 section_offsets_ with accessor function.
2785 (Sized_relobj_file::write_sections): Likewise.
2786 (Sized_relobj_file::do_relocate_sections): Likewise.
2787 * target.h (Sized_target::reserve_local_got_entry): New function.
2788 (Sized_target::reserve_global_got_entry): New function.
2789 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2790 (Target_x86_64::reserve_global_got_entry): New function.
2791 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2792
4829d394
CC
27932011-05-23 Cary Coutant <ccoutant@google.com>
2794
2795 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2796 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2797 bit when checking got_type.
2798 * incremental.cc (Sized_incremental_binary::setup_readers):
2799 Store symbol table and string table locations; initialize bit vector
2800 of file status flags.
2801 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2802 unchanged files.
2803 (Sized_incremental_binary::do_process_got_plt): New function.
2804 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2805 (Output_section_incremental_inputs::set_final_data_size): Record
2806 file index for each input file.
2807 (Output_section_incremental_inputs::write_got_plt): Store file index
2808 instead of input entry offset for each GOT entry.
2809 * incremental.h
2810 (Incremental_input_entry::Incremental_input_entry): Initialize new
2811 data member.
2812 (Incremental_input_entry::set_offset): Store file index.
2813 (Incremental_input_entry::get_file_index): New function.
2814 (Incremental_input_entry::file_index_): New data member.
2815 (Incremental_binary::process_got_plt): New function.
2816 (Incremental_binary::do_process_got_plt): New function.
2817 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2818 data members.
2819 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2820 (Sized_incremental_binary::set_file_is_unchanged): New function.
2821 (Sized_incremental_binary::file_is_unchanged): New function.
2822 (Sized_incremental_binary::do_process_got_plt): New function.
2823 (Sized_incremental_binary::file_status_): New data member.
2824 (Sized_incremental_binary::main_symtab_loc_): New data member.
2825 (Sized_incremental_binary::main_strtab_loc_): New data member.
2826 * output.cc (Output_data_got::Got_entry::write): Add case
2827 RESERVED_CODE.
2828 (Output_data_got::add_global): Call add_got_entry.
2829 (Output_data_got::add_global_plt): Likewise.
2830 (Output_data_got::add_global_with_rel): Likewise.
2831 (Output_data_got::add_global_with_rela): Likewise.
2832 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2833 (Output_data_got::add_global_pair_with_rela): Likewise.
2834 (Output_data_got::add_local): Call add_got_entry.
2835 (Output_data_got::add_local_plt): Likewise.
2836 (Output_data_got::add_local_with_rel): Likewise.
2837 (Output_data_got::add_local_with_rela): Likewise.
2838 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2839 (Output_data_got::add_local_pair_with_rela): Likewise.
2840 (Output_data_got::reserve_slot): New function.
2841 (Output_data_got::reserve_slot_for_global): New function.
2842 (Output_data_got::add_got_entry): New function.
2843 (Output_data_got::add_got_entry_pair): New function.
2844 (Output_section::add_output_section_data): Edit FIXME.
2845 * output.h
2846 (Output_section_data_build::Output_section_data_build): New
2847 constructor with size parameter.
2848 (Output_data_space::Output_data_space): Likewise.
2849 (Output_data_got::Output_data_got): Initialize new data member; new
2850 constructor with size parameter.
2851 (Output_data_got::add_constant): Call add_got_entry.
2852 (Output_data_got::reserve_slot): New function.
2853 (Output_data_got::reserve_slot_for_global): New function.
2854 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2855 (Output_data_got::add_got_entry): New function.
2856 (Output_data_got::add_got_entry_pair): New function.
2857 (Output_data_got::free_list_): New data member.
2858 * target.h (Sized_target::init_got_plt_for_update): New function.
2859 (Sized_target::register_global_plt_entry): New function.
2860 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2861 Initialize new data member; call init; add constructor with PLT count.
2862 (Output_data_plt_x86_64::init): New function.
2863 (Output_data_plt_x86_64::add_relocation): New function.
2864 (Output_data_plt_x86_64::reserve_slot): New function.
2865 (Output_data_plt_x86_64::free_list_): New data member.
2866 (Target_x86_64::init_got_plt_for_update): New function.
2867 (Target_x86_64::register_global_plt_entry): New function.
2868 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2869 incremental updates.
2870 (Output_data_plt_x86_64::add_relocation): New function.
2871 * testsuite/object_unittest.cc (Object_test): Set default options.
2872
ec69d6da
ILT
28732011-05-16 Ian Lance Taylor <iant@google.com>
2874
2875 * options.h (class General_options): Make -i a synonym for -r.
2876
732e31de
ILT
28772011-05-16 Ian Lance Taylor <iant@google.com>
2878
2879 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2880
403676b5
CC
28812011-05-10 Cary Coutant <ccoutant@google.com>
2882
2883 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2884 strip_all (-s).
2885
5b7b7d6e
ILT
28862011-05-06 Ian Lance Taylor <iant@google.com>
2887
2888 * layout.cc (Layout::layout): If the output section flags change,
2889 update the ordering.
2890
f0f9babf
CC
28912011-04-25 Cary Coutant <ccoutant@google.com>
2892
2893 * incremental-dump.cc (dump_incremental_inputs): Print local
2894 symbol info for each input file.
2895 * incremental.cc
2896 (Output_section_incremental_inputs::set_final_data_size): Add local
2897 symbol info to input file entries in incremental info.
2898 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2899 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2900 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2901 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2902 implementation.
2903 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2904 (Sized_incr_relobj::do_relocate): Write the local symbols.
2905 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2906 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2907 Adjust size of input file header.
2908 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2909 (Incremental_inputs_reader::get_local_symbol_count): New function.
2910 (Incremental_inputs_reader::get_input_section): Adjust size of input
2911 file header.
2912 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2913 (Sized_incr_relobj::This): New typedef.
2914 (Sized_incr_relobj::sym_size): New const data member.
2915 (Sized_incr_relobj::Local_symbol): New struct.
2916 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2917 (Sized_incr_relobj::do_local_symbol_offset): New function.
2918 (Sized_incr_relobj::local_symbol_count_): New data member.
2919 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2920 (Sized_incr_relobj::local_symbol_index_): New data member.
2921 (Sized_incr_relobj::local_symbol_offset_): New data member.
2922 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2923 (Sized_incr_relobj::local_symbols_): New data member.
2924 * object.h (Relobj::output_local_symbol_count): New function.
2925 (Relobj::local_symbol_offset): New function.
2926 (Relobj::do_output_local_symbol_count): New function.
2927 (Relobj::do_local_symbol_offset): New function.
2928 (Sized_relobj::do_output_local_symbol_count): New function.
2929 (Sized_relobj::do_local_symbol_offset): New function.
2930
d0a9ace3
ILT
29312011-04-22 Vladimir Simonov <sv@sw.ru>
2932
2933 * descriptors.cc (set_close_on_exec): New function.
2934 (Descriptors::open): Use set_close_on_exec.
2935 * output.cc (S_ISLNK): Define if not defined.
2936
94a3fc8b
CC
29372011-04-22 Cary Coutant <ccoutant@google.com>
2938
2939 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2940 global symbol map.
2941 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2942 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2943 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2944 relocations.
2945 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2946 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2947 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2948 * incremental.h
2949 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2950 function.
2951 (Incremental_binary::apply_incremental_relocs): New function.
2952 (Incremental_binary::do_apply_incremental_relocs): New function.
2953 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2954 data member.
2955 (Sized_incremental_binary::add_global_symbol): New function.
2956 (Sized_incremental_binary::global_symbol): New function.
2957 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2958 (Sized_incremental_binary::symbol_map_): New data member.
2959 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2960 * target.h (Sized_target::apply_relocation): New function.
2961 * target-reloc.h (apply_relocation): New function.
2962 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2963
c87e4302
DK
29642011-04-22 Doug Kwan <dougkwan@google.com>
2965
2966 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2967 flag of a SHT_ARM_EXIDX section.
2e702c99 2968 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
2969 * testsuite/Makefile.in: Regenerate.
2970 * testsuite/arm_exidx_test.s: New file.
2971 * testsuite/arm_exidx_test.sh: Same.
2972
e7782cf6
CC
29732011-04-20 Cary Coutant <ccoutant@google.com>
2974
2975 PR gold/12689
2976 * archive.h (Incremental_archive_entry::Archive_member):
2977 Initialize arg_serial_ (second constructor).
2978
308ecdc7
ILT
29792011-04-17 Ian Lance Taylor <iant@google.com>
2980
2981 * object.cc (Relocate_info::location): Simplify location string.
2982 * errors.cc (Errors::error_at_location): Don't print program
2983 name.
2984 (Errors::warning_at_location): Likewise.
2985 (Errors::undefined_symbol): Likewise.
2986 * testsuite/debug_msg.sh: Update accordingly.
2987
bec5b579
CC
29882011-04-14 Cary Coutant <ccoutant@google.com>
2989
2990 * gold/layout.cc (Layout::symtab_section_offset): New function.
2991 * gold/layout.h (Layout::symtab_section_offset): New function.
2992 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2993
88597d34
ILT
29942011-04-12 Ian Lance Taylor <iant@google.com>
2995
2996 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2997 with MREMAP_MAYMOVE.
2998 * output.h (class Output_file): Add map_is_allocated_ field.
2999 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3000 not available, provide stubs. If mremap is not available, #define
3001 it to gold_mremap.
3002 (MREMAP_MAYMOVE): Define if not defined.
3003 (Output_file::Output_file): Initialize map_is_allocated_.
3004 (Output_file::resize): Check map_is_allocated_.
3005 (Output_file::map_anonymous): If mmap fails, use malloc.
3006 (Output_file::unmap): Don't do anything for an anonymous map.
3007 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3008 is not available, provide stubs.
3009 (File_read::View::~View): Use free rather than delete[].
3010 (File_read::make_view): Use malloc rather than new[]. If mmap
3011 fails, use malloc.
3012 (File_read::find_or_make_view): Use malloc rather than new[].
3013 * gold.h: Remove HAVE_REMAP code.
3014 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
3015 exists. Rename mremap to gold_mremap. If mmap is not available
3016 don't do anything.
3017 * configure, config.in: Rebuild.
3018
11e361bc
ILT
30192011-04-11 Ian Lance Taylor <iant@google.com>
3020
3021 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
3022 initialize local variable v.
3023
cdc29364
CC
30242011-04-11 Cary Coutant <ccoutant@google.com>
3025
3026 * archive.cc (Archive::include_member): Adjust call to
3027 report_object.
3028 (Add_archive_symbols::run): Track argument serial numbers.
3029 (Lib_group::include_member): Likewise.
3030 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3031 * archive.h (Incremental_archive_entry::Archive_member):
3032 Initialize arg_serial_.
3033 (Archive_member::arg_serial_): New data member.
3034 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3035 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3036 incremental link.
3037 (Sized_dynobj::do_for_all_local_got_entries): New function.
3038 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
3039 function.
3040 * fileread.cc (get_mtime): New function.
3041 * fileread.h (get_mtime): New function.
3042 * gold.cc (queue_initial_tasks): Check for incremental update.
3043 (process_incremental_input): New function.
3044 (queue_middle_tasks): Don't force valid target for incremental
3045 update.
3046 * incremental-dump.cc (find_input_containing_global): Adjust
3047 size of symbol info entry.
3048 (dump_incremental_inputs): Dump argument serial number and
3049 in_system_directory flag; bias shndx by 1; print symbol names
3050 when dumping per-file symbol lists; use new symbol info readers.
3051 * incremental.cc
3052 (Output_section_incremental_inputs:update_data_size): New function.
3053 (Sized_incremental_binary::setup_readers): Setup input readers
3054 for each input file; build maps for files added from libraries
3055 and scripts.
3056 (Sized_incremental_binary::check_input_args): New function.
3057 (Sized_incremental_binary::do_check_inputs): Build map of argument
3058 serial numbers to input arguments.
3059 (Sized_incremental_binary::do_file_has_changed): Rename
3060 do_file_is_unchanged to this; compare file modification times.
3061 (Sized_incremental_binary::do_init_layout): New function.
3062 (Sized_incremental_binary::do_reserve_layout): New function.
3063 (Sized_incremental_binary::do_get_input_reader): Remove.
3064 (Sized_incremental_binary::get_symtab_view): New function.
3065 (Incremental_checker::can_incrementally_link_output_file): Remove.
3066 (Incremental_inputs::report_command_line): Exclude --debug options.
3067 (Incremental_inputs::report_archive_begin): Add parameter; track
3068 argument serial numbers; don't put input file entry for archive
3069 before archive members.
3070 (Incremental_inputs::report_archive_end): Put input file entry
3071 for archive after archive members.
3072 (Incremental_inputs::report_object): Add parameter; track argument
3073 serial numbers and in_system_directory flag.
3074 (Incremental_inputs::report_script): Add parameter; track argument
3075 serial numbers.
3076 (Output_section_incremental_inputs::set_final_data_size): Adjust
3077 size of symbol info entry; check for forwarding symbols.
3078 (Output_section_incremental_inputs::write_input_files): Write
3079 in_system_directory flag and argument serial number.
3080 (Output_section_incremental_inputs::write_info_blocks): Map section
3081 indices between incremental info and original input file; store
3082 input section index for each symbol.
3083 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
3084 change operator() to visit().
3085 (class Global_got_offset_visitor): Likewise.
3086 (class Global_symbol_visitor_got_plt):
3087 (Output_section_incremental_inputs::write_got_plt): Use new visitor
3088 classes.
3089 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
3090 (Sized_incr_relobj::do_read_symbols): New function.
3091 (Sized_incr_relobj::do_layout): New function.
3092 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3093 (Sized_incr_relobj::do_add_symbols): New function.
3094 (Sized_incr_relobj::do_should_include_member): New function.
3095 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3096 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3097 (Sized_incr_relobj::do_section_size): New function.
3098 (Sized_incr_relobj::do_section_name): New function.
3099 (Sized_incr_relobj::do_section_contents): New function.
3100 (Sized_incr_relobj::do_section_flags): New function.
3101 (Sized_incr_relobj::do_section_entsize): New function.
3102 (Sized_incr_relobj::do_section_address): New function.
3103 (Sized_incr_relobj::do_section_type): New function.
3104 (Sized_incr_relobj::do_section_link): New function.
3105 (Sized_incr_relobj::do_section_info): New function.
3106 (Sized_incr_relobj::do_section_addralign): New function.
3107 (Sized_incr_relobj::do_initialize_xindex): New function.
3108 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3109 (Sized_incr_relobj::do_read_relocs): New function.
3110 (Sized_incr_relobj::do_gc_process_relocs): New function.
3111 (Sized_incr_relobj::do_scan_relocs): New function.
3112 (Sized_incr_relobj::do_count_local_symbols): New function.
3113 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3114 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3115 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3116 (Sized_incr_relobj::do_relocate): New function.
3117 (Sized_incr_relobj::do_set_section_offset): New function.
3118 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3119 (Sized_incr_dynobj::do_read_symbols): New function.
3120 (Sized_incr_dynobj::do_layout): New function.
3121 (Sized_incr_dynobj::do_add_symbols): New function.
3122 (Sized_incr_dynobj::do_should_include_member): New function.
3123 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3124 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3125 (Sized_incr_dynobj::do_section_size): New function.
3126 (Sized_incr_dynobj::do_section_name): New function.
3127 (Sized_incr_dynobj::do_section_contents): New function.
3128 (Sized_incr_dynobj::do_section_flags): New function.
3129 (Sized_incr_dynobj::do_section_entsize): New function.
3130 (Sized_incr_dynobj::do_section_address): New function.
3131 (Sized_incr_dynobj::do_section_type): New function.
3132 (Sized_incr_dynobj::do_section_link): New function.
3133 (Sized_incr_dynobj::do_section_info): New function.
3134 (Sized_incr_dynobj::do_section_addralign): New function.
3135 (Sized_incr_dynobj::do_initialize_xindex): New function.
3136 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3137 (make_sized_incremental_object): New function.
3138 (Incremental_library::copy_unused_symbols): New function.
3139 (Incremental_library::do_for_all_unused_symbols): New function.
3140 * incremental.h (enum Incremental_input_flags): New type.
3141 (class Incremental_checker): Remove.
3142 (Incremental_input_entry::Incremental_input_entry): Add argument
3143 serial number.
3144 (Incremental_input_entry::arg_serial): New function.
3145 (Incremental_input_entry::set_is_in_system_directory): New function.
3146 (Incremental_input_entry::is_in_system_directory): New function.
3147 (Incremental_input_entry::arg_serial_): New data member.
3148 (Incremental_input_entry::is_in_system_directory_): New data member.
3149 (class Script_info): Move here from script.h.
3150 (Script_info::Script_info): Add filename parameter.
3151 (Script_info::filename): New function.
3152 (Script_info::filename_): New data member.
3153 (Incremental_script_entry::Incremental_script_entry): Add argument
3154 serial number.
3155 (Incremental_object_entry::Incremental_object_entry): Likewise.
3156 (Incremental_object_entry::add_input_section): Build list of input
3157 sections with map to original shndx.
3158 (Incremental_object_entry::get_input_section_index): New function.
3159 (Incremental_object_entry::shndx_): New data member.
3160 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3161 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3162 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3163 serial number.
3164 (Incremental_inputs::report_archive_begin): Likewise.
3165 (Incremental_inputs::report_object): Likewise.
3166 (Incremental_inputs::report_script): Likewise.
3167 (class Incremental_global_symbol_reader): New class.
3168 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3169 and store flags and input file type.
3170 (Incremental_input_entry_reader::arg_serial): New function.
3171 (Incremental_input_entry_reader::type): Extract type from flags.
3172 (Incremental_input_entry_reader::is_in_system_directory): New function.
3173 (Incremental_input_entry_reader::get_input_section_count): Call
3174 accessor function for type.
3175 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3176 function for type; adjust size of global symbol entry.
3177 (Incremental_input_entry_reader::get_global_symbol_count): Call
3178 accessor function for type.
3179 (Incremental_input_entry_reader::get_object_count): Likewise.
3180 (Incremental_input_entry_reader::get_object_offset): Likewise.
3181 (Incremental_input_entry_reader::get_member_count): Likewise.
3182 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3183 (Incremental_input_entry_reader::get_member_offset): Likewise.
3184 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3185 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3186 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3187 (Incremental_input_entry_reader::get_global_symbol_reader): New
3188 function.
3189 (Incremental_input_entry_reader::get_output_symbol_index): New
3190 function.
3191 (Incremental_input_entry_reader::type_): Remove.
3192 (Incremental_input_entry_reader::flags_): New data member.
3193 (Incremental_inputs_reader::input_file_offset): New function.
3194 (Incremental_inputs_reader::input_file_index): New function.
3195 (Incremental_inputs_reader::input_file): Call input_file_offset.
3196 (Incremental_inputs_reader::input_file_at_offset): New function.
3197 (Incremental_relocs_reader::get_r_type): Reformat.
3198 (Incremental_relocs_reader::get_r_shndx): Reformat.
3199 (Incremental_relocs_reader::get_r_offset): Reformat.
3200 (Incremental_relocs_reader::data): New function.
3201 (Incremental_binary::Incremental_binary): Initialize new data members.
3202 (Incremental_binary::check_inputs): Add cmdline parameter.
3203 (Incremental_binary::file_is_unchanged): Remove.
3204 (Input_reader::arg_serial): New function.
3205 (Input_reader::get_unused_symbol_count): New function.
3206 (Input_reader::get_unused_symbol): New function.
3207 (Input_reader::do_arg_serial): New function.
3208 (Input_reader::do_get_unused_symbol_count): New function.
3209 (Input_reader::do_get_unused_symbol): New function.
3210 (Incremental_binary::input_file_count): New function.
3211 (Incremental_binary::get_input_reader): Change signature to use
3212 index instead of filename.
3213 (Incremental_binary::file_has_changed): New function.
3214 (Incremental_binary::get_input_argument): New function.
3215 (Incremental_binary::get_library): New function.
3216 (Incremental_binary::get_script_info): New function.
3217 (Incremental_binary::init_layout): New function.
3218 (Incremental_binary::reserve_layout): New function.
3219 (Incremental_binary::output_file): New function.
3220 (Incremental_binary::do_check_inputs): New function.
3221 (Incremental_binary::do_file_is_unchanged): Remove.
3222 (Incremental_binary::do_file_has_changed): New function.
3223 (Incremental_binary::do_init_layout): New function.
3224 (Incremental_binary::do_reserve_layout): New function.
3225 (Incremental_binary::do_input_file_count): New function.
3226 (Incremental_binary::do_get_input_reader): Change signature.
3227 (Incremental_binary::input_args_map_): New data member.
3228 (Incremental_binary::library_map_): New data member.
3229 (Incremental_binary::script_map_): New data member.
3230 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3231 new data members.
3232 (Sized_incremental_binary::output_section): New function.
3233 (Sized_incremental_binary::inputs_reader): Add const.
3234 (Sized_incremental_binary::symtab_reader): Add const.
3235 (Sized_incremental_binary::relocs_reader): Add const.
3236 (Sized_incremental_binary::got_plt_reader): Add const.
3237 (Sized_incremental_binary::get_symtab_view): New function.
3238 (Sized_incremental_binary::Inputs_reader): New typedef.
3239 (Sized_incremental_binary::Input_entry_reader): New typedef.
3240 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3241 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3242 (Sized_incremental_binary::do_file_has_changed): New function.
3243 (Sized_incremental_binary::do_init_layout): New function.
3244 (Sized_incremental_binary::do_reserve_layout): New function.
3245 (Sized_input_reader::Inputs_reader): Remove.
3246 (Sized_input_reader::Input_entry_reader): Remove.
3247 (Sized_input_reader::do_arg_serial): New function.
3248 (Sized_input_reader::do_get_unused_symbol_count): New function.
3249 (Sized_input_reader::do_get_unused_symbol): New function.
3250 (Sized_incremental_binary::do_input_file_count): New function.
3251 (Sized_incremental_binary::do_get_input_reader): Change signature;
3252 use index instead of filename.
3253 (Sized_incremental_binary::section_map_): New data member.
3254 (Sized_incremental_binary::input_entry_readers_): New data member.
3255 (class Sized_incr_relobj): New class.
3256 (class Sized_incr_dynobj): New class.
3257 (make_sized_incremental_object): New function.
3258 (class Incremental_library): New class.
3259 * layout.cc (Free_list::num_lists): New static data member.
3260 (Free_list::num_nodes): New static data member.
3261 (Free_list::num_removes): New static data member.
3262 (Free_list::num_remove_visits): New static data member.
3263 (Free_list::num_allocates): New static data member.
3264 (Free_list::num_allocate_visits): New static data member.
3265 (Free_list::init): New function.
3266 (Free_list::remove): New function.
3267 (Free_list::allocate): New function.
3268 (Free_list::dump): New function.
3269 (Free_list::print_stats): New function.
3270 (Layout_task_runner::run): Resize output file for incremental updates.
3271 (Layout::Layout): Initialize new data members.
3272 (Layout::set_incremental_base): New function.
3273 (Layout::init_fixed_output_section): New function.
3274 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3275 incremental updates.
3276 (Layout::create_gold_note): Do not create gold note section for
3277 incremental updates.
3278 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3279 for incremental updates.
3280 (Layout::set_section_offsets): For incremental updates, allocate space
3281 from free list.
3282 (Layout::create_symtab_sections): Layout with offsets relative to
3283 start of section; for incremental updates, allocate space from free
3284 list.
3285 (Layout::create_shdrs): For incremental updates, allocate space from
3286 free list.
3287 (Layout::finish_dynamic_section): For incremental updates, do not
3288 check --as-needed (fixed in subsequent patch).
3289 * layout.h (class Free_list): New class.
3290 (Layout::set_incremental_base): New function.
3291 (Layout::incremental_base): New function.
3292 (Layout::init_fixed_output_section): New function.
3293 (Layout::allocate): New function.
3294 (Layout::incremental_base_): New data member.
3295 (Layout::free_list_): New data member.
3296 * main.cc (main): Print Free_list statistics.
3297 * object.cc (Relobj::finalize_incremental_relocs): Add
3298 clear_counts parameter; clear counts only when clear_counts is set.
3299 (Sized_relobj::Sized_relobj): Initialize new base class.
3300 (Sized_relobj::do_layout): Don't report special sections.
3301 (Sized_relobj::do_for_all_local_got_entries): New function.
3302 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3303 symtab_off to all symbol table offsets.
3304 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3305 * object.h (class Got_offset_list): Move to top of file.
3306 (Object::Object): Allow case where input_file == NULL.
3307 (Object::~Object): Likewise.
3308 (Object::input_file): Assert that input_file != NULL.
3309 (Object::lock): Allow case where input_file == NULL.
3310 (Object::unlock): Likewise.
3311 (Object::is_locked): Likewise.
3312 (Object::token): Likewise.
3313 (Object::release): Likewise.
3314 (Object::is_incremental): New function.
3315 (Object::get_mtime): New function.
3316 (Object::for_all_local_got_entries): New function.
3317 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3318 (Object::set_is_in_system_directory): New function.
3319 (Object::is_in_system_directory): New function.
3320 (Object::do_is_incremental): New function.
3321 (Object::do_get_mtime): New function.
3322 (Object::do_for_all_local_got_entries): New function.
3323 (Object::is_in_system_directory_): New data member.
3324 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3325 (class Sized_relobj_base): New class.
3326 (class Sized_relobj): Derive from Sized_relobj_base.
3327 (class Sized_relobj::Symbols): Redeclare from base class.
3328 (class Sized_relobj::local_got_offset_list): Remove.
3329 (class Sized_relobj::Output_sections): Redeclare from base class.
3330 (class Sized_relobj::do_for_all_local_got_entries): New function.
3331 (class Sized_relobj::write_local_symbols): Add offset parameter.
3332 (class Sized_relobj::local_symbol_offset_): Update comment.
3333 (class Sized_relobj::local_dynsym_offset_): Update comment.
3334 * options.cc (Input_arguments::add_file): Remove const.
3335 * options.h (Input_file_argument::Input_file_argument):
3336 Initialize arg_serial_ (all constructors).
3337 (Input_file_argument::set_arg_serial): New function.
3338 (Input_file_argument::arg_serial): New function.
3339 (Input_file_argument::arg_serial_): New data member.
3340 (Input_arguments::Input_arguments): Initialize file_count_.
3341 (Input_arguments::add_file): Remove const.
3342 (Input_arguments::number_of_input_files): New function.
3343 (Input_arguments::file_count_): New data member.
3344 (Command_line::number_of_input_files): Call
3345 Input_arguments::number_of_input_files.
3346 * output.cc (Output_segment_headers::Output_segment_headers):
3347 Set current size.
3348 (Output_section::Input_section::current_data_size): New function.
3349 (Output_section::Output_section): Initialize new data members.
3350 (Output_section::add_input_section): Don't do merge sections for
3351 an incremental link; allocate space from free list for an
3352 incremental update.
3353 (Output_section::add_output_section_data): Allocate space from
3354 free list for an incremental update.
3355 (Output_section::update_data_size): New function.
3356 (Output_section::set_fixed_layout): New function.
3357 (Output_section::reserve): New function.
3358 (Output_segment::set_section_addresses): Remove const.
3359 (Output_segment::set_section_list_addresses): Remove const; allocate
3360 space from free list for an incremental update.
3361 (Output_segment::set_offset): Adjust size of RELRO segment for an
3362 incremental update.
3363 * output.h (Output_data::current_data_size): Move here from
3364 child classes.
3365 (Output_data::pre_finalize_data_size): New function.
3366 (Output_data::update_data_size): New function.
3367 (Output_section_headers::update_data_size): new function.
3368 (Output_section_data_build::current_data_size): Move to Output_data.
3369 (Output_data_strtab::update_data_size): New function.
3370 (Output_section::current_data_size): Move to Output_data.
3371 (Output_section::set_fixed_layout): New function.
3372 (Output_section::has_fixed_layout): New function.
3373 (Output_section::reserve): New function.
3374 (Output_section::update_data_size): New function.
3375 (Output_section::has_fixed_layout_): New data member.
3376 (Output_section::free_list_): New data member.
3377 (Output_segment::set_section_addresses): Remove const.
3378 (Output_segment::set_section_list_addresses): Remove const.
3379 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3380 New function.
3381 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3382 New function.
3383 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3384 parameter when calling Add_symbols constructor; store argument
3385 serial number for members of a lib group.
3386 (Add_symbols::locks): Allow case where token == NULL.
3387 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3388 (Read_member::~Read_member): New function.
3389 (Read_member::is_runnable): New function.
3390 (Read_member::locks): New function.
3391 (Read_member::run): New function.
3392 (Check_script::~Check_script): New function.
3393 (Check_script::is_runnable): New function.
3394 (Check_script::locks): New function.
3395 (Check_script::run): New function.
3396 (Check_library::~Check_library): New function.
3397 (Check_library::is_runnable): New function.
3398 (Check_library::locks): New function.
3399 (Check_library::run): New function.
3400 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3401 (Add_symbols::library_): New data member.
3402 (class Read_member): New class.
3403 (class Check_script): New class.
3404 (class Check_library): New class.
3405 * reloc.cc (Read_relocs::is_runnable): Allow case where
3406 token == NULL.
3407 (Read_relocs::locks): Likewise.
3408 (Scan_relocs::locks): Likewise.
3409 (Relocate_task::locks): Likewise.
3410 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3411 to clear counters.
3412 (Sized_relobj::incremental_relocs_scan): Fix comment.
3413 (Sized_relobj::do_relocate): Pass output file offset to
3414 write_local_symbols.
3415 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3416 from class declaration.
3417 * script.cc (read_input_script): Allocate Script_info; pass
3418 argument serial number to report_script.
3419 * script.h (class Script_info): Move to incremental.h.
3420 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3421 * symtab.h (Symbol_table::add_from_incrobj): New function.
3422 (Symbol_table::set_file_offset): New function.
3423
b961d0d7
CC
34242011-04-05 Cary Coutant <ccoutant@google.com>
3425
3426 * incremental-dump.cc (dump_incremental_inputs): Change signature
3427 to take a Sized_incremental_binary; change caller. Use readers
3428 in Sized_incremental_binary.
3429 * incremental.cc
3430 (Sized_incremental_binary::find_incremental_inputs_sections):
3431 Rename do_find_incremental_inputs_sections to this.
3432 (Sized_incremental_binary::setup_readers): New function.
3433 (Sized_incremental_binary::do_check_inputs): Check
3434 has_incremental_info_ flag; move setup code to setup_readers;
3435 use input readers.
3436 (Sized_incremental_binary::do_file_is_unchanged): New function.
3437 (Sized_incremental_binary::do_get_input_reader): New function.
3438 * incremental.h (class Incremental_binary): Move to end of file.
3439 (Incremental_binary::file_is_unchanged): New function.
3440 (Incremental_binary::do_file_is_unchanged): New function.
3441 (Incremental_binary::Input_reader): New class.
3442 (Incremental_binary::get_input_reader): New function.
3443 (class Sized_incremental_binary): Move to end of file.
3444 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3445 input section reader classes.
3446 (Sized_incremental_binary::has_incremental_info): New function.
3447 (Sized_incremental_binary::inputs_reader): New function.
3448 (Sized_incremental_binary::symtab_reader): New function.
3449 (Sized_incremental_binary::relocs_reader): New function.
3450 (Sized_incremental_binary::got_plt_reader): New function.
3451 (Sized_incremental_binary::do_file_is_unchanged): New function.
3452 (Sized_incremental_binary::Sized_input_reader): New class.
3453 (Sized_incremental_binary::get_input_reader): New function.
3454 (Sized_incremental_binary::find_incremental_inputs_sections):
3455 Rename do_find_incremental_inputs_sections to this.
3456 (Sized_incremental_binary::setup_readers): New function.
3457 (Sized_incremental_binary::has_incremental_info_): New data member.
3458 (Sized_incremental_binary::inputs_reader_): New data member.
3459 (Sized_incremental_binary::symtab_reader_): New data member.
3460 (Sized_incremental_binary::relocs_reader_): New data member.
3461 (Sized_incremental_binary::got_plt_reader_): New data member.
3462 (Sized_incremental_binary::current_input_file_): New data member.
3463
a869183f
PP
34642011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3465
3466 PR gold/12640
3467 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3468 violation.
3469
34702011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
3471
3472 * archive.cc (Archive::include_member): Adjust call to report_object.
3473 (Add_archive_symbols::run): Add script_info to call to
3474 report_archive_begin.
3475 (Lib_group::include_member): Adjust call to report_object.
3476 (Add_lib_group_symbols::run): Adjust call to report_object.
3477 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3478 blocks. Add object count for script input files.
3479 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3480 script_info parameter; change all callers.
3481 (Incremental_inputs::report_object): Add script_info parameter;
3482 change all callers.
3483 (Incremental_inputs::report_script): Store backpointer to
3484 incremental info entry.
3485 (Output_section_incremental_inputs::set_final_data_size): Record
3486 additional information for scripts.
3487 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3488 * incremental.h (Incremental_script_entry::add_object): New function.
3489 (Incremental_script_entry::get_object_count): New function.
3490 (Incremental_script_entry::get_object): New function.
3491 (Incremental_script_entry::objects_): New data member; adjust
3492 constructor.
3493 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3494 (Incremental_inputs::report_object): Add script_info parameter.
3495 (Incremental_inputs_reader::get_object_count): New function.
3496 (Incremental_inputs_reader::get_object_offset): New function.
3497 * options.cc (Input_arguments::add_file): Return reference to
3498 new input argument.
3499 * options.h (Input_argument::set_script_info): New function.
3500 (Input_argument::script_info): New function.
3501 (Input_argument::script_info_): New data member; adjust all
3502 constructors.
3503 (Input_file_group::add_file): Return reference to new input argument.
3504 (Input_file_lib::add_file): Likewise.
3505 (Input_arguments::add_file): Likewise.
3506 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3507 * script.cc (Parser_closure::Parser_closure): Add script_info
3508 parameter; adjust all callers.
3509 (Parser_closure::script_info): New function.
3510 (Parser_closure::script_info_): New data member.
3511 (read_input_script): Report scripts earlier to incremental info.
3512 (script_add_file): Set script_info in Input_argument.
3513 (script_add_library): Likewise.
3514 * script.h (Script_options::Script_info): Rewrite class.
3515
a869183f 35162011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
3517
3518 * archive.cc (Library_base::should_include_member): Move
3519 method here from class Archive.
3520 (Archive::Archive): Initialize base class.
3521 (Archive::should_include_member): Move to base class.
3522 (Archive::do_for_all_unused_symbols): New function.
3523 (Add_archive_symbols::run): Remove redundant access to
3524 incremental_inputs.
3525 (Lib_group::Lib_group): Initialize base class.
3526 (Lib_group::do_filename): New function.
3527 (Lib_group::include_member): Pass pointer to Lib_group to
3528 report_object.
3529 (Lib_group::do_for_all_unused_symbols): New function.
3530 (Add_lib_group_symbols::run): Report archive information for
3531 incremental links.
3532 * archive.h (class Library_base): New base class.
3533 (class Archive): Derive from Library_base.
3534 (Archive::filename): Move to base class.
3535 (Archive::set_incremental_info): Likewise.
3536 (Archive::incremental_info): Likewise.
3537 (Archive::Should_include): Likewise.
3538 (Archive::should_include_member): Likewise.
3539 (Archive::Armap_entry): Remove.
3540 (Archive::Unused_symbol_iterator): Remove.
3541 (Archive::unused_symbols_begin): Remove.
3542 (Archive::unused_symbols_end): Remove.
3543 (Archive::do_filename): New function.
3544 (Archive::do_get_mtime): New function.
3545 (Archive::do_for_all_unused_symbols): New function.
3546 (Archive::task_): Move to base class.
3547 (Archive::incremental_info_): Likewise.
3548 (class Lib_group): Derive from Library_base.
3549 (Lib_group::do_filename): New function.
3550 (Lib_group::do_get_mtime): New function.
3551 (Lib_group::do_for_all_unused_symbols): New function.
3552 (Lib_group::task_): Move to base class.
3553 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3554 function.
3555 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3556 function.
3557 * incremental.cc (Incremental_inputs::report_archive_begin):
3558 Use Library_base; call library's get_mtime; add incremental inputs
3559 entry before members.
3560 (class Unused_symbol_visitor): New class.
3561 (Incremental_inputs::report_archive_end): Use Library_base; use
3562 visitor class to record unused symbols; don't add incremental inputs
3563 entry after members.
3564 (Incremental_inputs::report_object): Use Library_base.
3565 * incremental.h
3566 (Incremental_archive_entry::Incremental_archive_entry): Remove
3567 unused Archive parameter.
3568 (Incremental_inputs::report_archive_begin): Use Library_base.
3569 (Incremental_inputs::report_archive_end): Likewise.
3570 (Incremental_inputs::report_object): Likewise.
3571 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3572 function.
3573 * object.h (Object::for_all_global_symbols): New function.
3574 (Object::do_for_all_global_symbols): New function.
3575 (Sized_relobj::do_for_all_global_symbols): New function.
3576 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3577 function.
3578 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3579 function.
3580
61ab3e40
ILT
35812011-03-27 Ian Lance Taylor <iant@google.com>
3582
3583 * archive.cc (Archive::interpret_header): Return -1 if something
3584 goes wrong. Change callers accordingly.
3585
30e1f9e6
CC
35862011-03-25 Cary Coutant <ccoutant@google.com>
3587
3588 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3589 * testsuite/Makefile.in: Regenerate.
3590
9370ce59 35912011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
3592
3593 * plugin.cc (get_view): New.
3594 (Plugin::load): Pass get_view to the plugin.
3595 (Plugin_manager::get_view): New.
3596
9312bb0a
ILT
35972011-03-21 Ian Lance Taylor <iant@google.com>
3598
3599 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 3600 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 3601
7e12ba9e
ST
36022011-03-21 Sriraman Tallam <tmsriram@google.com>
3603
3604 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3605 Change == to -eq.
3606 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3607 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3608 Change == to -eq.
3609 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3610 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3611
fd7a005d
ILT
36122011-03-14 Ian Lance Taylor <iant@google.com>
3613
3614 * script-sections.cc (Sort_output_sections::script_compare):
3615 Rename from is_before, change return type.
3616 (Sort_output_sections::operator()): Adjust accordingly.
3617
ed16fd1b
ILT
36182011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3619
3620 PR gold/12572
3621 * testsuite/odr_violation2.cc: Add comment to make all error line
3622 numbers double digits.
3623 * testsuite/debug_msg.sh: Adjust expected errors.
3624
71ff8986
ILT
36252011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3626
3627 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3628 but mark earlier ones as non-canonical
3629 (offset_to_iterator): Update search target and example
3630 (do_addr2line): Return extra lines in a vector*
3631 (format_file_lineno): Extract from do_addr2line
3632 (one_addr2line): Add vector* out-param
3633 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3634 when a lineno entry appeared last for its instruction
3635 (Dwarf_line_info): Add vector* out-param
3636 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3637 * symtab.cc (Odr_violation_compare): Include the lineno in the
3638 comparison again.
3639 (linenos_from_loc): New. Combine the canonical line for an
3640 address with its other lines.
3641 (True_if_intersect): New. Helper functor to make
3642 std::set_intersection a query.
3643 (detect_odr_violations): Compare sets of lines instead of just
3644 one line for each function. This became less deterministic, but
3645 has fewer false positives.
3646 * symtab.h: Declarations.
3647 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3648 mix an optimized and non-optimized object in the same binary
3649 (odr_violation2.so): Same.
3650 * testsuite/Makefile.in: Regenerate from Makefile.am.
3651 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3652 * testsuite/debug_msg.sh: Update line numbers and add
3653 assertions.
3654 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3655 non-optimized context.
3656 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3657 isn't inlined, and use OdrDerived in an optimized context.
3658 * testsuite/odr_header1.h: Defines OdrDerived, where
3659 optimization will change the
3660 first-instruction-in-the-destructor's file and line number.
3661 * testsuite/odr_header2.h: Defines OdrBase.
3662
a19fefdc
ILT
36632011-03-09 Ian Lance Taylor <iant@google.com>
3664
3665 * fileread.cc (File_read::clear_views): Don't delete the whole
3666 file view.
3667
ecb351e9
ILT
36682011-03-08 Ian Lance Taylor <iant@google.com>
3669
3670 PR gold/12525
3671 * fileread.cc: #include <climits>.
3672 (GOLD_IOV_MAX): Define.
3673 (File_read::read_multiple): Limit number of entries by iov_max.
3674 * fileread.h (class File_read): Always set max_readv_entries to
3675 128.
3676
b821d13c
ILT
36772011-03-07 Ian Lance Taylor <iant@google.com>
3678
3679 PR gold/12525
3680 * options.h (class General_options): Add -dy and -dn.
3681
89243142
CC
36822011-03-02 Cary Coutant <ccoutant@google.com>
3683
3684 * testsuite/script_test_9.t: Add TLS segment.
3685
d0773f31
ILT
36862011-03-02 Simon Baldwin <simonb@google.com>
3687
3688 * configure.ac: Add check for gnu_indirect_function support in
3689 the toolchain building binutils.
3690 * configure: Rebuild.
3691
9370ce59 36922011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
3693
3694 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3695 plugin only symbols.
3696 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3697 in plugin files as not needed in the symbol table.
3698
4cf7a849
ST
36992011-02-11 Sriraman Tallam <tmsriram@google.com>
3700
3701 * output.cc (Output_section::add_input_section): Delay fill
3702 generation for section ordering.
3703
b578bd7d
ILT
37042011-02-09 Ian Lance Taylor <iant@google.com>
3705
3706 PR gold/12316
3707 * object.h (class Sized_relobj): Remove clear_local_symbols.
3708 * reloc.cc (Sized_relobj::do_relocate): Don't call
3709 clear_local_symbols.
3710
9370ce59 37112011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
3712
3713 * plugin.cc (is_visible_from_outside): Return true for symbols
3714 in the -u option.
3715
55382fb7
ILT
37162011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3717
3718 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3719 filename.
3720
4e271fff
ST
37212011-02-02 Sriraman Tallam <tmsriram@google.com>
3722
3723 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 3724 to std::string.
4e271fff 3725 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 3726 section_name to be std::string.
4e271fff
ST
3727 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3728
d433c3ac
ILT
37292011-01-25 Ian Lance Taylor <iant@google.com>
3730
3731 * script.cc (script_add_extern): Rewrite to use
3732 add_symbol_reference.
3733
880473a6
DK
37342011-01-25 Doug Kwan <dougkwan@google.com>
3735
d433c3ac 3736 * icf.cc (get_section_contents): Always lock section's object.
880473a6 3737
f30f86fa
ILT
37382011-01-24 Ian Lance Taylor <iant@google.com>
3739
3740 * options.h (class General_options): Accept
3741 --no-detect-odr-violations.
3742
8e51a0b9
ILT
37432011-01-24 Ian Lance Taylor <iant@google.com>
3744
3745 * version.cc (version_string): Bump to 1.11.
3746
0f3b89d8
ILT
37472011-01-24 Ian Lance Taylor <iant@google.com>
3748
3749 * plugin.cc (class Plugin_rescan): Define new class.
3750 (Plugin_manager::claim_file): Set any_claimed_.
3751 (Plugin_manager::save_archive): New function.
3752 (Plugin_manager::save_input_group): New function.
3753 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3754 necessary.
3755 (Plugin_manager::new_undefined_symbol): New function.
3756 (Plugin_manager::rescan): New function.
3757 (Plugin_manager::rescannable_defines): New function.
3758 (Plugin_manager::add_input_file): Set any_added_.
3759 * plugin.h (class Plugin_manager): define new fields rescannable_,
3760 undefined_symbols_, any_claimed_, and any_added_. Declare
3761 Plugin_rescan as friend. Declare new functions.
3762 (Plugin_manager::Rescannable): Define type.
3763 (Plugin_manager::Rescannable_list): Define type.
3764 (Plugin_manager::Undefined_symbol_list): Define type.
3765 (Plugin_manager::Plugin_manager): Initialize new fields.
3766 * archive.cc (Archive::defines_symbol): New function.
3767 (Add_archive_symbols::run): Pass archive to plugins if any.
3768 * archive.h (class Archive): Declare defines_symbol.
3769 * readsyms.cc (Input_group::~Input_group): New function.
3770 (Finish_group::run): Pass input_group to plugins if any.
3771 * readsyms.h (class Input_group): Declare destructor.
3772 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3773 any.
3774
3bb951e5
ILT
37752011-01-10 Ian Lance Taylor <iant@google.com>
3776
3777 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3778 section as relro.
3779 (Layout::set_segment_offsets): Reset increase_relro before calling
3780 set_section_addresses a second time.
3781
0aa45fac
CC
37822011-01-04 Cary Coutant <ccoutant@google.com>
3783
3784 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3785 sections before NOBITS sections.
3786
0db46eb4
L
37872011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3788
3789 * version.cc (print_version): Update copyright to 2011.
3790
829c9745
CC
37912010-12-23 Cary Coutant <ccoutant@google.com>
3792
3793 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3794 of OS to this->add. Add OD parameter to second form of the function.
3795
7500420b
ILT
37962010-12-20 Ian Lance Taylor <iant@google.com>
3797
3798 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3799 second of two consecutive entries with same offset.
3800
f8e9a930
RW
38012010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3802
3803 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3804 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3805 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3806 to avoid unneeded links against $(LDADD).
3807 * testsuite/Makefile.in: Regenerate.
3808
2fbb4320
ILT
38092010-12-15 Ian Lance Taylor <iant@google.com>
3810
3811 PR gold/12324
3812 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3813 for R_X86_64_32 and R_X86_64_PC32.
3814 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3815 ver_matching_def_pic.o.
3816 (ver_matching_def_pic.o): New target.
3817
fedb228d
RW
38182010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3819
3820 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3821 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3822 Move definition before File_read::View member definitions.
3823 (File_read::View::~View): Initialize and hold lock before
3824 updating current_mapped_bytes.
3825
9b547ce6
RW
38262010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3827
3828 * dwarf_reader.cc: Remove outdated comment.
3829 * gold-threads.cc: Fix typo in error message.
3830 * archive.cc: Fix typos in comments.
3831 * archive.h: Likewise.
3832 * arm-reloc-property.cc: Likewise.
3833 * arm-reloc-property.h: Likewise.
3834 * arm-reloc.def: Likewise.
3835 * arm.cc: Likewise.
3836 * attributes.h: Likewise.
3837 * cref.cc: Likewise.
3838 * ehframe.cc: Likewise.
3839 * fileread.h: Likewise.
3840 * gold.h: Likewise.
3841 * i386.cc: Likewise.
3842 * icf.cc: Likewise.
3843 * incremental.h: Likewise.
3844 * int_encoding.cc: Likewise.
3845 * layout.h: Likewise.
3846 * main.cc: Likewise.
3847 * merge.h: Likewise.
3848 * object.cc: Likewise.
3849 * object.h: Likewise.
3850 * options.cc: Likewise.
3851 * readsyms.cc: Likewise.
3852 * reduced_debug_output.cc: Likewise.
3853 * reloc.cc: Likewise.
3854 * script-sections.cc: Likewise.
3855 * sparc.cc: Likewise.
3856 * symtab.h: Likewise.
3857 * target-reloc.h: Likewise.
3858 * target.cc: Likewise.
3859 * target.h: Likewise.
3860 * timer.cc: Likewise.
3861 * timer.h: Likewise.
3862 * x86_64.cc: Likewise.
3863
83e17bd5
CC
38642010-12-09 Cary Coutant <ccoutant@google.com>
3865
3866 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3867 stack.
3868 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3869 parameter; change all callers.
3870 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3871 * options.h (warn_execstack): New option.
3872
017257f8
DK
38732010-12-07 Doug Kwan <dougkwan@google.com>
3874
3875 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3876 like function call relocations.
3877
c20cbc06
ILT
38782010-12-07 Ian Lance Taylor <iant@google.com>
3879
3880 * archive.cc (Archive::get_elf_object_for_member): Permit
3881 punconfigured to be NULL.
3882 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3883 (Archive::include_member): Pass NULL to get_elf_object_for_member
3884 if we searched for the archive and this is the first included
3885 object.
3886
4dbfafcc
ILT
38872010-12-01 Ian Lance Taylor <iant@google.com>
3888
3889 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3890 track_relocs_type_ field.
3891 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3892 Set track_relocs_type_.
3893 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3894 contents when using RELA relocs.
3895 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3896 reloc_map_.
3897 * reloc.cc (Track_relocs::next_addend): New function.
3898 * reloc.h (class Track_relocs): Declare next_addend.
3899
e5e19edd
ILT
39002010-12-01 Ian Lance Taylor <iant@google.com>
3901
3902 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3903 virtual destructor.
3904
9a5ce24c
ILT
39052010-12-01 Ian Lance Taylor <iant@google.com>
3906
3907 * README: Update compilers known to work and fail.
3908
c7791212
NC
39092010-11-23 Matthias Klose <doko@ubuntu.com>
3910
3911 * configure.in: For --enable-gold, handle value `default' instead of
3912 `both*'. Always install ld as ld.bfd, install as ld if gold is
3913 not the default.
3914 * configure: Regenerate.
3915
0ad220c9
DK
39162010-11-18 Doug Kwan <dougkwan@google.com>
3917
3918 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3919 and right_alignment to be zero. Store result alignment only if it is
3920 greater than existing alignment.
3921
ab8056e0
CC
39222010-11-16 Cary Coutant <ccoutant@google.com>
3923
3924 PR gold/12220
3925 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3926 Check for ".zdebug_line".
3927
fd064a5b
CC
39282010-11-16 Doug Kwan <dougkwan@google.com>
3929 Cary Coutant <ccoutant@google.com>
3930
3931 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3932 by reference; adjust all callers.
3933 * output.cc (Output_segment::set_section_addresses): Adjust references
3934 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3935 list is empty.
3936 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3937 end at page boundary.
3938
6fc6ea19
CC
39392010-11-16 Cary Coutant <ccoutant@google.com>
3940
3941 PR gold/12220
3942 * layout.cc (Layout::choose_output_section): Transform names of
3943 compressed sections even when using a script with a SECTIONS clause.
3944 (Layout::output_section_name): Remove code to transform
3945 compressed debug section names.
3946 * output.cc (Output_section::add_input_section): Use uncompressed
3947 section size when tracking input sections.
3948
95a2c8d6
RS
39492010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3950
3951 * symtab.h (Symbol::NON_PIC_REF): Remove.
3952 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3953 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3954 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3955 (Symbol::use_plt_offset): Take a flags argument and pass it
3956 directly to needs_dynamic_reloc. Restrict check for undefined
3957 weak symbols to function calls.
3958 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3959 (Target_arm::Scan::global): Use it.
3960 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3961 (Target_arm::Relocate::relocate): Likewise.
3962 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3963 parameter with an r_type parameter. Use get_reference_flags
3964 to get the flags.
3965 (Target_arm::Relocate::relocate): Update accordingly.
3966 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3967 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3968 (Target_i386::Scan::global): Likewise.
3969 (Target_i386::Relocate::relocate): Likewise.
3970 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3971 parameter with an r_type parameter. Use get_reference_flags
3972 to get the flags.
3973 (Target_i386::Relocate::relocate): Update accordingly.
3974 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3975 (Target_powerpc::Scan::global): Use it.
3976 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3977 (Target_powerpc::Relocate::relocate): Likewise.
3978 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3979 (Target_sparc::Scan::global): Use it.
3980 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3981 (Target_sparc::Relocate::relocate): Likewise.
3982 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3983 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3984 (Target_x86_64::Scan::global): Likewise.
3985 (Target_x86_64::Relocate::relocate): Likewise.
3986
f625ae50
DK
39872010-11-08 Doug Kwan <dougkwan@google.com>
3988 Cary Coutant <ccoutant@google.com>
3989
3990 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3991 (Arm_exidx_merge_section::section_contents_): New data member.
3992 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3993 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 3994 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
3995 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3996 in parameters instead of calling Object::section_contents without
3997 locking.
3998 (Arm_output_section::group_section): New parameter TASK. Pass it
3999 to callees that need locking objects.
4000 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4001 to lock EXIDX input sections. Fix a formatting issue. Call
4002 Arm_exidx_merged_section::build_contents to create merged section
4003 contents.
4004 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4005 to lock object of stub table owner.
4006 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4007 TEXT_SIZE to initialize data member TEXT_SIZE_.
4008 (Arm_exidx_input_section::addralign): Fix typo in comment.
4009 (Arm_exidx_input_section::text_size): New method.
4010 (Target_arm::do_relax): New parameter TASK. Pass it to callees
4011 that require locking objects. Lock objects before scanning for stubs
4012 and updating local symbols.
4013 (Arm_input_section<big_endian>::init): Copy contents of original
4014 input section.
2e702c99 4015 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
4016 original input section instead of calling Object::section_contents
4017 without locking.
4018 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
4019 size without calling Object::section_size().
4020 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
4021 for size. Allocate a buffer for merged EXIDX entries.
4022 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 4023 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
4024 building code to Arm_exidx_merged_section::build_contetns. Write
4025 out contetns in buffer instead of building it on the fly.
4026 (Arm_relobj::make_exidx_input_section): Also pass text section size
4027 to Arm_exidx_input_section constructor.
4028 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4029 (Arm_dynobj::do_read_symbols): Fix memory leak.
4030 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4031 * target.h: (class Task): Add forward declaration.
4032 (Target::relax): Add new parameter TASK and pass it to
4033 Target::do_relax().
4034 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4035
5f9bcf58
CC
40362010-11-05 Cary Coutant <ccoutant@google.com>
4037
4038 PR gold/10708
4039 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
4040 object when reading from the file.
4041 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
4042 second layout pass.
4043 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
4044 when reading section contents.
4045 (get_section_contents): Likewise.
4046 (icf::find_identical_sections): Likewise.
4047 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
4048 object when reading from the file.
4049 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
4050 the object when doing deferred section layout.
4051
e597fa08
NC
40522010-11-03 Nick Clifton <nickc@redhat.com>
4053
4054 PR gold/12001
4055 * script.h (class Symbol_assignment: name): New member. Returns
4056 the name of the symbol.
4057 * scrfipt.cc (Script_options::is_pending_assignment): New member.
4058 Returns true if the given symbol name is on the list of
4059 assignments wating to be processed.
4060 * archive.cc (should_incldue_member): If the symbol is undefined,
4061 check to see if it is on the list of symbols pending assignment.
4062
3f9a3278
ILT
40632010-11-03 Ryan Mansfield <rmansfield@qnx.com>
4064
4065 * script-sections.cc (Script_sections::find_memory_region): Check
4066 for a NULL output section pointer.
4067
d06fb4d1
DK
40682010-10-29 Doug Kwan <dougkwan@google.com>
4069
4070 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
4071 Output_section::add_relaxed_input_section.
4072 * output.cc (Output_section::add_relaxed_input_section): Add new
4073 arguments LAYOUT and NAME. Set section order index.
4074 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4075 Copy section order index.
4076 * output.h (Output_section::add_relaxed_input_section): Add new
4077 arguments LAYOUT and NAME.
4078
90e24de5
ILT
40792010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4080
4081 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 4082 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
4083 * testsuite/Makefile.in: Regenerate.
4084
c9484ea5
DK
40852010-10-20 Doug Kwan <dougkwan@google.com>
4086
4087 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
4088 without SHF_LINK_ORDER flags.
4089 * layout.cc (Layout::choose_output_section): Do not filter
4090 SHF_LINK_ORDER flag in a relocatable link.
4091
5bc2f5be
CC
40922010-10-17 Cary Coutant <ccoutant@google.com>
4093
4094 * output.h (Output_segment::set_section_addresses): Change function
4095 signature. Update all callers.
4096 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4097 sections.
4098 (Output_segment::set_section_addresses): Align after last TLS
4099 section. Add padding before last relro section instead of after.
4100
0c91cf04
DK
41012010-10-17 Doug Kwan <dougkwan@google.com>
4102
4103 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4104 GOT output section to be writable.
4105
8c21d9d3
CC
41062010-10-14 Cary Coutant <ccoutant@google.com>
4107
4108 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
4109 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4110 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4111 mode.
4112 * incremental.cc (report_command_line): Ignore all forms of
4113 --incremental.
4114 * layout.cc (Layout::Layout): Check parameters for incremental link
4115 mode.
4116 * options.cc (General_options::parse_incremental): New function.
4117 (General_options::parse_no_incremental): New function.
4118 (General_options::parse_incremental_full): New function.
4119 (General_options::parse_incremental_update): New function.
4120 (General_options::incremental_mode_): New data member.
4121 (General_options::finalize): Check incremental_mode_.
4122 * options.h (General_options): Update help text for --incremental.
4123 Add --no-incremental, --incremental-full, --incremental-update.
4124 (General_options::Incremental_mode): New enum type.
4125 (General_options::incremental_mode): New function.
4126 (General_options::incremental_mode_): New data member.
4127 * parameters.cc (Parameters::incremental_mode_): New data member.
4128 (Parameters::set_options): Set incremental_mode_.
4129 (Parameters::set_incremental_full): New function.
4130 (Parameters::incremental): New function.
4131 (Parameters::incremental_update): New function.
4132 (set_parameters_incremental_full): New function.
4133 * parameters.h (Parameters::set_incremental_full): New function.
4134 (Parameters::incremental): New function.
4135 (Parameters::incremental_update): New function.
4136 (Parameters::incremental_mode_): New data member.
4137 (set_parameters_incremental_full): New function.
4138 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4139 incremental link mode.
4140 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4141 (Sized_relobj::do_relocate_sections): Likewise.
4142 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4143 option.
4144 * testsuite/Makefile.in: Regenerate.
4145 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 4146
bb32aa18 41472010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
4148
4149 * script-sections.h (class Script_sections): Make
4150 Sections_elements typedef public.
4151 * script-sections.cc (class Sort_output_sections): Add elements_
4152 field. Add constructor which sets it; change all callers.
4153 (Sort_output_sections::is_before): New function.
4154 (Sort_output_sections::operator()): Call is_before.
4155 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4156 conditional.
4157 * testsuite/script_test_10.sh: New test. Test script section
4158 order.
4159 * testsuite/script_test_10.t: Likewise.
4160 * testsuite/script_test_10.s: Likewise.
4161 * testsuite/Makefile.am: Wrap the cross linker tests and the
4162 common tests into NATIVE_OR_CROSS_LINKER.
4163 (check_SCRIPTS): Add script_test_10.sh.
4164 (check_DATA): Add script_test_10.stdout.
4165 (script_test_10.o, script_test_10): New targets.
4166 (script_test_10.stdout): New target.
4167 * configure, testsuite/Makefile.in: Regenerate.
4168
3cef7179
ILT
41692010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4170
4171 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4172 error for the deprecated relocations.
4173 (Target_arm::Scan::global): Likewise.
4174 (Target_arm::Relocate::relocate): Likewise.
4175
7411e9a8
RS
41762010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4177
4178 * fileread.cc (Input_file::find_file): Initialize *found_name
4179 and *namep when using the fallback search for case 4.
4180
6a9da32a
CC
41812010-10-11 Cary Coutant <ccoutant@google.com>
4182
4183 * options.h (class General_options): Redefine -z lazy as an alias for
4184 the negation of -z now.
4185
ac897c20
ILT
41862010-10-11 Ian Lance Taylor <iant@google.com>
4187
4188 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4189 binding.
4190
ea5cae92
NC
41912010-10-06 Nick Clifton <nickc@redhat.com>
4192
4193 * script-sections.cc(class Memory_region): Remove
4194 current_lma_offset_ field. Rename current_vma_offset_ to
4195 current_offset_. Add last_section_ field.
4196 (Memory_region::get_current_vma_address): Rename to
4197 get_current_address.
4198 (Memory_region::get_current_lma_address): Delete.
4199 (Memory_region::increment_vma_offset): Rename to
4200 increment_offset.
4201 (Memory_region::increment_lma_offset): Delete.
4202 (Memory_region::attributes_compatible): New method. Returns
4203 true if the provided section is compatible with the region.
4204 (Memory_region::get_last_section): New method. Returns the last
4205 section to use the region.
4206 (Memory_region::set_last_section): New method. Stores the last
4207 section to use the region.
4208 (Script_sections::block_in_region): New method. Returns true if
4209 a block of memory is contained within a region.
4210 (Script_sections::find_memory_region): New method. Locates a
4211 memory region to be used to set a VMA or LMA address.
4212 (Output_section_definition::set_section_addresses): Add code to
4213 check for addresses set by memory regions.
4214 (Output_segment::set_section_addresses): Remove memory region
4215 walking code.
4216 (Script_sections::create_segment): Add a warning if a header
4217 segment is created outside of any region.
4218 * script-sections.h (class Script_sections): Add prototypes for
4219 find_memory_region and block_in_region methods.
4220 * testsuite/memory_test.s: Use .long instead of .word.
4221 * testsuite/memory_test.t: Add some more output sections.
4222 * testsuite/memory_test.sh: Update expected output.
4223
a9bfd952
DK
42242010-10-02 Doug Kwan <dougkwan@google.com>
4225
4226 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4227 defintion to symtab.h
4228 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4229 declaration to defintion.
4230
bacff3ab
NC
42312010-10-01 Nick Clifton <nickc@redhat.com>
4232
4233 * expression.cc (eval): Replace dummy argument with NULL.
4234 (eval_maybe_dot): Check for a NULL result section pointer.
4235 (Symbol_expression::value): Likewise.
4236 (Dot_expression::value): Likewise.
4237 (BINARY_EXPRESSION): Likewise.
4238 (Max_expression::value): Likewise.
4239 (Min_expression::value): Likewise.
4240 (Absolute_expression::value): Likewise.
4241 (Addr_expression::value_from_output_section): Likewise.
4242 (Loaddddr_expression::value_from_output_section): Likewise.
4243 (Segment_start_expression::value): Likewise.
4244 * script-sections.cc
4245 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4246 argument with NULL.
4247 (Sections_elememt_dot_assignment::set_section_addresses):
4248 Likewise.
4249 (Output_data_expression::do_write_to_buffer): Likewise.
4250 (Output_section_definition::finalize_symbols): Likewise.
4251 (Output_section_definition::set_section_addresses): Likewise.
4252
f81bc8b5
DK
42532010-09-30 Doug Kwan <dougkwan@google.com>
4254
4255 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4256
c95e9f27
ST
42572010-09-28 Sriraman Tallam <tmsriram@google.com>
4258
4259 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 4260 function.
c95e9f27
ST
4261 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4262 virtual function.
4263 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4264 virtual function.
4265 * icf.cc (get_section_contents): Inline merge sections only when
4266 target allows it.
4267
3cac54d2
RW
42682010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4269
4270 * configure: Regenerate.
4271
2904037a
ILT
42722010-09-17 Ian Lance Taylor <iant@google.com>
4273
4274 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
4275 * testsuite/Makefile.am (memory_test.o): New target.
4276 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4277 memory_test.t.
4278 * testsuite/Makefile.in: Rebuild.
2904037a 4279
bca7fb63
DK
42802010-09-17 Doug Kwan <dougkwan@google.com>
4281
4282 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4283 defintion if relocation uses GOT entries of the symbol.
4284 * testsuite/icf_safe_test.sh: Fix test.
4285 * testsuite/icf_safe_so_test.sh: Fix test.
4286
4ef28648
CC
42872010-09-16 Cary Coutant <ccoutant@google.com>
4288
4289 * script_sections.cc (class Memory_region): Remove "NULL" from
4290 vector initializations.
4291
793990de
CC
42922010-09-15 Cary Coutant <ccoutant@google.com>
4293
4294 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4295 Resolve forwarding symbols.
4296
81e015e2
DK
42972010-09-15 Doug Kwan <dougkwan@google.com>
4298
4299 * gold/testsuite/script_test_3.t: Add ARM special sections.
4300 * gold/testsuite/script_test_4.t: Same.
4301 * gold/testsuite/script_test_5.t: Same.
4302 * gold/testsuite/script_test_6.t: Same.
4303 * gold/testsuite/script_test_7.t: Same.
4304 * gold/testsuite/script_test_7.t: Same.
4305 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4306
36171d64
CC
43072010-09-14 Cary Coutant <ccoutant@google.com>
4308
4309 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4310 (Target_x86_64::Relocate::relocate_tls): Replace check for
4311 saw_tls_block_reloc_ with test for executable section.
4312
d89051bd
CC
43132010-09-12 Cary Coutant <ccoutant@google.com>
4314
4315 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4316 position-independent executables to shared libraries need dynamic
4317 relocations.
4318 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4319 position-independent executables.
4320 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4321 * testsuite/Makefile.in: Regenerate.
4322
fca41f0f
NC
43232010-09-10 Nick Clifton <nickc@redhat.com>
4324
4325 PR gold/11997
4326 * testsuite/memory_test.t: Discard any sections that are not
4327 needed.
4328
6695e4b3
L
43292010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4330
4331 PR gold/11996
4332 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4333 "This::" to work around a bug in gcc 4.2.
4334
4335 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4336
0f72bf6f
RÁE
43372010-09-09 Rafael Espindola <espindola@google.com>
4338
4339 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4340 sections with different PF_X flags in the same segment.
4341 (Layout::find_first_load_seg): Search all segments to find the first
4342 one.
4343 * options.h (rosegment): New.
4344
43452010-09-08 Rafael Espindola <espindola@google.com>
a6577478 4346
05a79166 4347 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 4348
aa98ff75
DK
43492010-09-08 Doug Kwan <dougkwan@google.com>
4350
4351 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4352 (Arm_relobj::do_relocate_sections): Add new parameter for output
4353 file to match the parent.
4354 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4355 of local symbols instead of input values. Update code to track
4356 changes in gold::relocate_section.
4357 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4358 (Sized_relobj::compute_final_local_value_internal): New methods.
4359 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4360 body into private version of Sized_relobj::compute_final_local_value.
4361 Call the inline method.
4362 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4363 merged symbol value if there is one.
4364 (Symbol_value::has_output_value): New method defintiion.
4365 (Sized_relobj::Compute_final_local_value_status): New enum type.
4366 (Sized_relobj::compute_final_local_value): New methods.
4367 (Sized_relobj::compute_final_local_value_internal): New methods.
4368 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4369 and arm_cortex_a8.sh.
4370 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4371 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4372 New tests.
4373 * Makefile.in: Regenerate.
4374 * testsuite/arm_bl_out_of_range.s: Update test.
4375 * testsuite/thumb_bl_out_of_range.s: Ditto.
4376 * testsuite/thumb_blx_out_of_range.s: Ditto.
4377 * testsuite/arm_branch_out_of_range.sh: New file.
4378 * testsuite/arm_cortex_a8.sh: Ditto.
4379 * testsuite/arm_cortex_a8_b.s: Ditto.
4380 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4381 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4382 * testsuite/arm_cortex_a8_bl.s: Ditto.
4383 * testsuite/arm_cortex_a8_blx.s: Ditto.
4384 * testsuite/arm_cortex_a8_local.s: Ditto.
4385 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4386 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4387
05a79166
L
43882010-09-08 Rafael Espindola <espindola@google.com>
4389
4390 * Makefile.am (memory_test.stdout): Run readelf with -W.
4391 * Makefile.in: Regenerate.
4392 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4393 64 bit output.
4394
33dbc701
RÁE
43952010-09-08 Rafael Espindola <espindola@google.com>
4396
4397 * script-sections.cc (Script_sections::add_memory_region): Convert
4398 field precision to int.
4399 * script.cc (script_set_section_region, script_set_section_region):
4400 Convert field precision to int.
4401
731ca54a
RÁE
44022010-09-08 Rafael Espindola <espindola@google.com>
4403
4404 * arm.cc (do_finalize_sections): Create the __exidx_start and
4405 __exdix_end symbols even when the section is missing.
4406
7f8cd844
NC
44072010-09-08 Nick Clifton <nickc@redhat.com>
4408
4409 * README: Remove claim that MEMORY is not supported.
4410 * expression.cc (script_exp_function_origin)
4411 (script_exp_function_length): Move from here to ...
4412 * script.cc: ... here.
4413 (script_set_section_region, script_add_memory)
4414 (script_parse_memory_attr, script_include_directive): New
4415 functions.
4416 * script-sections.cc
4417 (class Memory_region): New class.
4418 (class Output_section_definition): Add set_memory_region,
4419 set_section_vma, set_section_lma and get_section_name methods.
4420 (class Script_Sections): Add add_memory_region,
4421 find_memory_region, find_memory_region_origin,
4422 find_memory_region_length and set_memory_region methods.
4423 Have set_section_addresses method walk the list of set memory
4424 regions.
4425 Extend the print methos to display memory regions.
4426 * script-sections.h: Add prototypes for new methods.
4427 Add enum for MEMORY region attributes.
4428 * yyscript.y: Add support for parsing MEMORY regions.
4429 * script-c.h: Add prototypes for new functions.
4430 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4431 * testsuite/Makefile.in: Regenerate.
4432 * testsuite/memory_test.sh: New script.
4433 * testsuite/memory_test.s: New assembler source file.
4434 * testsuite/memory_test.t: New linker script.
4435
a4649286
DK
44362010-08-27 Doug Kwan <dougkwan@google.com>
4437
4438 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4439 reference override an existing dynamic weak reference.
4440 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4441 * testsuite/Makefile.in: Regenerate.
4442 * testsuite/dyn_weak_ref.sh: New file.
4443 * testsuite/dyn_weak_ref_1.c: Ditto.
4444 * testsuite/dyn_weak_ref_2.c: Ditto.
4445
b56648ad
ILT
44462010-08-27 Ian Lance Taylor <iant@google.com>
4447
4448 * incremental.h (class Incremental_input_entry): Add virtual
4449 destructor.
4450
809313cb
ILT
44512010-08-27 Ian Lance Taylor <iant@google.com>
4452
4453 * testsuite/start_lib_test_3.c: Mark t3 as used.
4454
11e32464
NC
44552010-08-27 Nick Clifton <nickc@redhat.com>
4456
4457 * options.cc (version_script): Fix small typo in previous
4458 whitespace tidyup.
4459
ca09d69a
NC
44602010-08-25 Nick Clifton <nickc@redhat.com>
4461
4462 * archive.cc: Formatting fixes: Remove whitespace between
4463 typename and following asterisk. Remove whitespace between
4464 function name and opening parenthesis.
4465 * archive.h: Likewise.
4466 * arm.cc: Likewise.
4467 * attributes.cc: Likewise.
4468 * attributes.h: Likewise.
4469 * common.cc: Likewise.
4470 * copy-relocs.cc: Likewise.
4471 * dirsearch.h: Likewise.
4472 * dynobj.cc: Likewise.
4473 * ehframe.cc: Likewise.
4474 * ehframe.h: Likewise.
4475 * expression.cc: Likewise.
4476 * fileread.cc: Likewise.
4477 * fileread.h: Likewise.
4478 * gc.h: Likewise.
4479 * gold-threads.cc: Likewise.
4480 * gold.cc: Likewise.
4481 * i386.cc: Likewise.
4482 * icf.h: Likewise.
4483 * incremental-dump.cc: Likewise.
4484 * incremental.cc: Likewise.
4485 * layout.cc: Likewise.
4486 * layout.h: Likewise.
4487 * main.cc: Likewise.
4488 * merge.cc: Likewise.
4489 * merge.h: Likewise.
4490 * object.cc: Likewise.
4491 * object.h: Likewise.
4492 * options.cc: Likewise.
4493 * options.h: Likewise.
4494 * output.cc: Likewise.
4495 * output.h: Likewise.
4496 * plugin.cc: Likewise.
4497 * plugin.h: Likewise.
4498 * powerpc.cc: Likewise.
4499 * reloc.cc: Likewise.
4500 * script-c.h: Likewise.
4501 * script-sections.cc: Likewise.
4502 * script.cc: Likewise.
4503 * stringpool.cc: Likewise.
4504 * symtab.cc: Likewise.
4505 * symtab.h: Likewise.
4506 * target.cc: Likewise.
4507 * timer.cc: Likewise.
4508 * timer.h: Likewise.
4509 * version.cc: Likewise.
4510 * x86_64.cc: Likewise.
4511
b8fa8750
NC
45122010-08-24 Nick Clifton <nickc@redhat.com>
4513
4514 PR 11899
4515 * layout.cc (segment_precedes): Sort segments by their physical
4516 addresses, if they have been set.
4517
9919d93b
CC
45182010-08-23 Cary Coutant <ccoutant@google.com>
4519
4520 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4521 symbols data.
4522 (Lib_group::include_member): Unlock object after deleting its
4523 symbols data.
4524 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4525 the bug fixed here.
4526
97b4be1c
CC
45272010-08-19 Neil Vachharajani <nvachhar@google.com>
4528 Cary Coutant <ccoutant@google.com>
4529
4530 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4531 constructor, and set_blocker.
4532 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4533 readsyms_blocker_.
4534 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4535 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4536 * testsuite/Makefile.am (start_lib_test): New test case.
4537 * testsuite/Makefile.in: Regenerate.
4538 * testsuite/start_lib_test_main.c: New file.
4539 * testsuite/start_lib_test_1.c: New file.
4540 * testsuite/start_lib_test_2.c: New file.
4541 * testsuite/start_lib_test_3.c: New file.
4542
dd0b1884
ILT
45432010-08-19 Ian Lance Taylor <iant@google.com>
4544
4545 * Makefile.in: Rebuild with automake 1.11.1.
4546 * aclocal.m4: Likewise.
4547 * testsuite/Makefile.in: Likewise.
4548
7223e9ca
ILT
45492010-08-19 Ian Lance Taylor <iant@google.com>
4550
4551 PR 10893
4552 * i386.cc (class Output_data_plt_i386): Update declarations.
4553 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4554 local_ifuncs_ fields.
4555 (Target_i386::do_plt_section_for_global): New function.
4556 (Target_i386::do_plt_section_for_local): New function.
4557 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4558 parameter; change all callers. Initialize global_ifuncs_ and
4559 local_ifuncs_. If doing a static link define __rel_iplt_start and
4560 __rel_iplt_end.
4561 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4562 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4563 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4564 symbols.
4565 (Target_i386::make_plt_section): New function, broken out of
4566 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4567 (Target_i386::make_plt_entry): Call make_plt_section.
4568 (Target_i386::make_local_ifunc_plt_entry): New function.
4569 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4570 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4571 R_386_IRELATIVE to switch.
4572 (Target_i386::Scan::global): Likewise.
4573 (Target_i386::Relocate::relocate): Likewise.
4574 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4575 switch.
4576 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4577 (Target_x86_64::do_plt_section_for_global): New function.
4578 (Target_x86_64::do_plt_section_for_local): New function.
4579 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4580 parameter; change all callers. If doing a static link define
4581 __rela_iplt_start and __rela_iplt_end.
4582 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4583 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4584 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4585 to point to .plt.
4586 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4587 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4588 switch.
4589 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4590 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4591 R_X86_64_IRELATIVE to switch.
4592 (Target_x86_64::Scan::global): Likewise.
4593 (Target_x86_64::Relocate::relocate): Likewise.
4594 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4595 switch.
4596 * target.h (class Target): Add plt_section_for_global and
4597 plt_section_for_local functions. Add do_plt_section_for_global
4598 and do_plt_section_for_local virtual functions.
4599 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4600 clarifying comments.
4601 (Symbol::use_plt_offset): Handle IFUNC symbol.
4602 * object.cc (Sized_relobj::Sized_relobj): Initialize
4603 local_plt_offsets_.
4604 (Sized_relobj::local_has_plt_offset): New function.
4605 (Sized_relobj::local_plt_offset): New function.
4606 (Sized_relobj::set_local_plt_offset): New function.
4607 (Sized_relobj::do_count): Handle IFUNC symbol.
4608 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4609 a bit away from input_shndx_ field. Add set_is_func_symbol and
4610 is_ifunc_symbol functions.
4611 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4612 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4613 local_plt_offsets_ field.
4614 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4615 * output.h (class Output_section_data): Add non-const
4616 output_section function.
4617 (class Output_data_got): Update declarations.
4618 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4619 Add use_plt_offset parameter to global and local constructors.
4620 Change all callers. Change local_sym_index_ field to 31 bits.
4621 Change GSYM_CODE and CONSTANT_CODE accordingly.
4622 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4623 doing a static link don't set sh_link field.
4624 (Output_data_got::Got_entry::write): Use PLT offset if
4625 appropriate.
4626 (Output_data_got::add_global_plt): New function.
4627 (Output_data_got::add_local_plt): New function.
4628 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4629 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4630 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4631 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4632 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4633 IFUNC conditional.
4634 * testsuite/ifunc-sel.h: New file.
4635 * testsuite/ifuncmain1.c: New file.
4636 * testsuite/ifuncmain1vis.c: New file.
4637 * testsuite/ifuncmod1.c: New file.
4638 * testsuite/ifuncdep2.c: New file.
4639 * testsuite/ifuncmain2.c: New file.
4640 * testsuite/ifuncmain3.c: New file.
4641 * testsuite/ifuncmod3.c: New file.
4642 * testsuite/ifuncmain4.c: New file.
4643 * testsuite/ifuncmain5.c: New file.
4644 * testsuite/ifuncmod5.c: New file.
4645 * testsuite/ifuncmain6pie.c: New file.
4646 * testsuite/ifuncmod6.c: New file.
4647 * testsuite/ifuncmain7.c: New file.
4648 * configure, testsuite/Makefile.in: Rebuild.
4649
56f75c03
ILT
46502010-08-18 Ian Lance Taylor <iant@google.com>
4651
4652 * incremental.cc
4653 (Output_section_incremental_inputs::write_input_files): Add cast
4654 to avoid signed/unsigned comparison warning.
4655 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4656
55455f89
CC
46572010-08-12 Cary Coutant <ccoutant@google.com>
4658
4659 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4660
e2054bcb
ILT
46612010-08-13 Ian Lance Taylor <iant@google.com>
4662
4663 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4664
74f67560
DK
46652010-08-12 Cary Coutant <ccoutant@google.com>
4666 Doug Kwan <dougkwan@google.com>
4667
4668 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4669 defintion overrides non-weak undef, remember that the original undef
4670 is not weak.
4671 * symtab.cc (Symbol_table::sized_write_global): For undef without
4672 an original weak binding, set binding to global in output.
4673 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4674 * testsuite/Makefile.in: Regenerate.
4675 * testsuite/strong_ref_weak_def.sh: New file.
4676 * testsuite/strong_ref_weak_def_1.c: Ditto.
4677 * testsuite/strong_ref_weak_def_2.c: Ditto.
4678
d1238d12
CC
46792010-08-12 Cary Coutant <ccoutant@google.com>
4680
4681 * testsuite/incremental_test.sh: Rewrite.
4682 * testsuite/incremental_test_1.c: Rewrite.
4683 * testsuite/incremental_test_2.c: Rewrite.
4684
0e70b911
CC
46852010-08-12 Cary Coutant <ccoutant@google.com>
4686
4687 * arm.cc (Target_arm::got_size): Add const.
4688 (Target_arm::got_entry_count): New function.
4689 (Target_arm::plt_entry_count): New function.
4690 (Target_arm::first_plt_entry_offset): New function.
4691 (Target_arm::plt_entry_size): New function.
4692 (Output_data_plt_arm::entry_count): New function.
4693 (Output_data_plt_arm::first_plt_entry_offset): New function.
4694 (Output_data_plt_arm::get_plt_entry_size): New function.
4695 * i386.cc (Target_i386::got_size): Add const.
4696 (Target_i386::got_entry_count): New function.
4697 (Target_i386::plt_entry_count): New function.
4698 (Target_i386::first_plt_entry_offset): New function.
4699 (Target_i386::plt_entry_size): New function.
4700 (Output_data_plt_i386::entry_count): New function.
4701 (Output_data_plt_i386::first_plt_entry_offset): New function.
4702 (Output_data_plt_i386::get_plt_entry_size): New function.
4703 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4704 find_incremental_inputs_sections. Dump incremental_got_plt section.
4705 * incremental.cc: Include target.h.
4706 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4707 parameter. Adjust all callers. Find incremental_got_plt section.
4708 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4709 section.
4710 (Output_section_incremental_inputs::set_final_data_size): Calculate
4711 size of incremental_got_plt section.
4712 (Output_section_incremental_inputs::do_write): Write the
4713 incremental_got_plt section.
4714 (Got_plt_view_info): New struct.
4715 (Local_got_offset_visitor): New class.
4716 (Global_got_offset_visitor): New class.
4717 (Global_symbol_visitor_got_plt): New class.
4718 (Output_section_incremental_inputs::write_got_plt): New function.
4719 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4720 Add parameter. Adjust all callers.
4721 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4722 (Incremental_inputs::got_plt_section): New function.
4723 (Incremental_inputs::got_plt_section_): New data member.
4724 (Incremental_got_plt_reader): New class.
4725 * layout.cc (Layout::create_incremental_info_sections): Add the
4726 incremental_got_plt section.
4727 * object.h (Got_offset_list::get_list): New function.
4728 (Got offset_list::for_all_got_offsets): New function.
4729 (Sized_relobj::local_got_offset_list): New function.
4730 * powerpc.cc (Target_powerpc::got_size): Add const.
4731 (Target_powerpc::got_entry_count): New function.
4732 (Target_powerpc::plt_entry_count): New function.
4733 (Target_powerpc::first_plt_entry_offset): New function.
4734 (Target_powerpc::plt_entry_size): New function.
4735 (Output_data_plt_powerpc::entry_count): New function.
4736 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4737 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4738 * sparc.cc (Target_sparc::got_size): Add const.
4739 (Target_sparc::got_entry_count): New function.
4740 (Target_sparc::plt_entry_count): New function.
4741 (Target_sparc::first_plt_entry_offset): New function.
4742 (Target_sparc::plt_entry_size): New function.
4743 (Output_data_plt_sparc::entry_count): New function.
4744 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4745 (Output_data_plt_sparc::get_plt_entry_size): New function.
4746 * symtab.h (Symbol::got_offset_list): New function.
4747 (Symbol_table::for_all_symbols): New function.
4748 * target.h (Sized_target::got_entry_count): New function.
4749 (Sized_target::plt_entry_count): New function.
4750 (Sized_target::plt_entry_size): New function.
4751 * x86_64.cc (Target_x86_64::got_size): Add const.
4752 (Target_x86_64::got_entry_count): New function.
4753 (Target_x86_64::plt_entry_count): New function.
4754 (Target_x86_64::first_plt_entry_offset): New function.
4755 (Target_x86_64::plt_entry_size): New function.
4756 (Output_data_plt_x86_64::entry_count): New function.
4757 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4758 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4759
09ec0418
CC
47602010-08-12 Cary Coutant <ccoutant@google.com>
4761
4762 * archive.cc: Include incremental.h.
4763 (Archive::Archive): Initialize incremental_info_.
4764 (Archive::include_member): Record archive members in incremental info.
4765 (Add_archive_symbols::run): Record begin and end of an archive in
4766 incremental info.
4767 (Lib_group::include_member): Record objects in incremental info.
4768 * archive.h (Incremental_archive_entry): Forward declaration.
4769 (Archive::set_incremental_info): New member function.
4770 (Archive::incremental_info): New member function.
4771 (Archive::Unused_symbol_iterator): New class.
4772 (Archive::unused_symbols_begin): New member function.
4773 (Archive::unused_symbols_end): New member function.
4774 (Archive::incremental_info_): New data member.
4775 * incremental-dump.cc (find_input_containing_global): New function.
4776 (dump_incremental_inputs): Dump new incremental info sections.
4777 * incremental.cc: Include symtab.h.
4778 (Output_section_incremental_inputs): New class.
4779 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4780 new incremental info sections.
4781 (Sized_incremental_binary::do_check_inputs): Likewise.
4782 (Incremental_inputs::report_archive): Remove.
4783 (Incremental_inputs::report_archive_begin): New function.
4784 (Incremental_inputs::report_archive_end): New function.
4785 (Incremental_inputs::report_object): New function.
4786 (Incremental_inputs::finalize_inputs): Remove.
4787 (Incremental_inputs::report_input_section): New function.
4788 (Incremental_inputs::report_script): Rewrite.
4789 (Incremental_inputs::finalize): Do nothing but finalize string table.
4790 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4791 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4792 (Incremental_inputs::create_data_sections): New function.
4793 (Incremental_inputs::relocs_entsize): New function.
4794 (Output_section_incremental_inputs::set_final_data_size): New function.
4795 (Output_section_incremental_inputs::do_write): New function.
4796 (Output_section_incremental_inputs::write_header): New function.
4797 (Output_section_incremental_inputs::write_input_files): New function.
4798 (Output_section_incremental_inputs::write_info_blocks): New function.
4799 (Output_section_incremental_inputs::write_symtab): New function.
4800 * incremental.h (Incremental_script_entry): Forward declaration.
4801 (Incremental_object_entry): Forward declaration.
4802 (Incremental_archive_entry): Forward declaration.
4803 (Incremental_inputs): Forward declaration.
4804 (Incremental_inputs_header_data): Remove.
4805 (Incremental_inputs_header): Remove.
4806 (Incremental_inputs_header_write): Remove.
4807 (Incremental_inputs_entry_data): Remove.
4808 (Incremental_inputs_entry): Remove.
4809 (Incremental_inputs_entry_write): Remove.
4810 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4811 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4812 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4813 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4814 Likewise.
4815 (Incremental_input_entry): New class.
4816 (Incremental_script_entry): New class.
4817 (Incremental_object_entry): New class.
4818 (Incremental_archive_entry): New class.
4819 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4820 (Incremental_inputs::report_inputs): Remove.
4821 (Incremental_inputs::report_archive): Remove.
4822 (Incremental_inputs::report_archive_begin): New function.
4823 (Incremental_inputs::report_archive_end): New function.
4824 (Incremental_inputs::report_object): Change prototype.
4825 (Incremental_inputs::report_input_section): New function.
4826 (Incremental_inputs::report_script): Change prototype.
4827 (Incremental_inputs::get_reloc_count): New function.
4828 (Incremental_inputs::set_reloc_count): New function.
4829 (Incremental_inputs::create_data_sections): New function.
4830 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4831 (Incremental_inputs::inputs_section): New function.
4832 (Incremental_inputs::symtab_section): New function.
4833 (Incremental_inputs::relocs_section): New function.
4834 (Incremental_inputs::get_stringpool): Add const.
4835 (Incremental_inputs::command_line): Add const.
4836 (Incremental_inputs::inputs): Remove.
4837 (Incremental_inputs::command_line_key): New function.
4838 (Incremental_inputs::input_file_count): New function.
4839 (Incremental_inputs::input_files): New function.
4840 (Incremental_inputs::relocs_entsize): New function.
4841 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4842 (Incremental_inputs::finalize_inputs): Remove.
4843 (Incremental_inputs::Input_info): Remove.
4844 (Incremental_inputs::lock_): Remove.
4845 (Incremental_inputs::inputs_): Change type.
4846 (Incremental_inputs::inputs_map_): Remove.
4847 (Incremental_inputs::current_object_entry_): New data member.
4848 (Incremental_inputs::inputs_section_): New data member.
4849 (Incremental_inputs::symtab_section_): New data member.
4850 (Incremental_inputs::relocs_section_): New data member.
4851 (Incremental_inputs::reloc_count_): New data member.
4852 (Incremental_inputs_reader): New class.
4853 (Incremental_symtab_reader): New class.
4854 (Incremental_relocs_reader): New class.
4855 * layout.cc (Layout::finalize): Move finalization of incremental info
4856 and creation of incremental info sections to follow finalization of
4857 symbol table. Set offsets for postprocessing sections.
4858 (Layout::create_incremental_info_sections): Call
4859 Incremental_inputs::create_data_sections. Add incremental symtab
4860 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4861 sections to layout after input sections.
4862 * layout.h (struct Timespec): Forward declaration.
4863 (Layout::incremental_inputs): Add const.
4864 (Layout::create_incremental_info_sections): Add parameter.
4865 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4866 * object.cc: Include incremental.h.
4867 (Relobj::finalize_incremental_relocs): New function.
4868 (Sized_relobj::do_layout): Record input sections in incremental info.
4869 * object.h (Object::output_section): New function.
4870 (Object::output_section_offset): Moved from Relobj.
4871 (Object::get_incremental_reloc_base): New function.
4872 (Object::get_incremental_reloc_count): New function.
4873 (Object::do_output_section): New function.
4874 (Object::do_output_section_offset): Moved from Relobj.
4875 (Object::do_get_incremental_reloc_base): New function.
4876 (Object::do_get_incremental_reloc_count): New function.
4877 (Object::Object): Initialize new data members.
4878 (Relobj::output_section): Renamed do_output_section and moved to
4879 protected.
4880 (Relobj::output_section_offset): Moved to Object.
4881 (Relobj::do_get_incremental_reloc_base): New function.
4882 (Relobj::do_get_incremental_reloc_count): New function.
4883 (Relobj::allocate_incremental_reloc_counts): New function.
4884 (Relobj::count_incremental_reloc): New function.
4885 (Relobj::finalize_incremental_relocs): New function.
4886 (Relobj::next_incremental_reloc_index): New function.
4887 (Relobj::reloc_counts_): New data member.
4888 (Relobj::reloc_bases_): New data member.
4889 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4890 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4891 (Sized_relobj::incremental_relocs_scan): New function.
4892 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4893 (Sized_relobj::incremental_relocs_write): New function.
4894 (Sized_relobj::incremental_relocs_write_reltype): New function.
4895 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4896 incremental link.
4897 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4898 archives and object files elsewhere.
4899 (Add_symbols::run): Report object files here.
4900 (Finish_group::run): Report end of archive at end of group.
4901 * reloc.cc: Include layout.h, incremental.h.
4902 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4903 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4904 (Sized_relobj::incremental_relocs_scan): New function.
4905 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4906 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4907 (Sized_relobj::incremental_relocs_write): New function.
4908 (Sized_relobj::incremental_relocs_write_reltype): New function.
4909 * script.cc (read_input_script): Rewrite test for incremental link.
4910 Change call to Incremental_inputs::report_script.
4911 * symtab.h (Symbol_table::first_global_index): New function.
4912 (Symbol_table::output_count): New function.
4913
ce0d1972
DK
49142010-08-12 Doug Kwan <dougkwan@google.com>
4915
4916 * arm.cc (Target_arm::merge_object_attributes): Check command line
4917 options --no-wchar-size-warning and --no-enum-size-warning.
4918 * options.h (General_options): Add ld-compatible options
4919 --no-enum-size-warning and --no-wchar-size-warning.
4920
6e5710ce
ILT
49212010-08-04 Ian Lance Taylor <iant@google.com>
4922
4923 * x86_64.cc (Target_x86_64::Scan::local): Use
4924 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4925 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4926 (Target_x86_64::Scan::global): Likewise.
4927 (Target_x86_64::Relocate::relocate): Likewise.
4928 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4929 Likewise.
4930
fef830db
CC
49312010-08-03 Cary Coutant <ccoutant@google.com>
4932
4933 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4934 to reserve space in merged_strings vector. Keep total input size
4935 for stats.
4936 (Output_merge_string::do_print_merge_stats): Print total input size.
4937 * merge.h (Output_merge_string): Add input_size_ field.
4938 * stringpool.cc (Stringpool_template::string_length): Move
4939 implementations out of Stringpool_template class and place in
4940 stringpool.h.
4941 * stringpool.h (string_length): Move out of Stringpool_template.
4942
1e3811b0
ILT
49432010-08-03 Ian Lance Taylor <iant@google.com>
4944
4945 PR 11712
4946 * layout.cc (relaxation_loop_body): If address of load segment is
4947 set, adjust address to include headers if possible.
4948
7af0c620
ILT
49492010-08-03 Ian Lance Taylor <iant@google.com>
4950
4951 * version.cc (version_string): Bump to 1.10.
4952
22f0da72
ILT
49532010-08-03 Ian Lance Taylor <iant@google.com>
4954
4955 PR 11805
4956 * layout.h (enum Output_section_order): Define.
4957 (class Layout): Update declarations.
4958 * layout.cc (Layout::get_output_section): Add order parameter.
4959 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4960 is_first_non_relro parameters. Change all callers.
4961 (Layout::choose_output_section): Likewise.
4962 (Layout::add_output_section_data): Likewise.
4963 (Layout::make_output_section): Likewise. Set order.
4964 (Layout::default_section_order): New function.
4965 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4966 * output.cc (Output_section::Output_section): Initialize order_.
4967 Don't initialize deleted fields.
4968 (Output_segment::Output_segment): Don't initialize deleted
4969 fields.
4970 (Output_segment::add_output_section_to_load): New function
4971 replacing add_output_section. Change all callers to call this or
4972 add_output_section_to_nonload.
4973 (Output_segment::add_output_section_to_nonload): New function.
4974 (Output_segment::remove_output_section): Rewrite.
4975 (Output_segment::add_initial_output_data): Likewise.
4976 (Output_segment::has_any_data_sections): Likewise.
4977 (Output_segment::is_first_section_relro): Likewise.
4978 (Output_segment::maximum_alignment): Likewise.
4979 (Output_segment::has_dynamic_reloc): New function replacing
4980 dynamic_reloc_count. Change all callers.
4981 (Output_segment::has_dynamic_reloc_list): New function replacing
4982 dynamic_reloc_count_list. Change all callers.
4983 (Output_segment::set_section_addresses): Rewrite.
4984 (Output_segment::set_offset): Rewrite.
4985 (Output_segment::find_first_and_last_list): Remove.
4986 (Output_segment::set_tls_offsets): Rewrite.
4987 (Output_segment::first_section_load_address): Likewise.
4988 (Output_segment::output_section_count): Likewise.
4989 (Output_segment::section_with_lowest_load_address): Likewise.
4990 (Output_segment::write_section_headers): Likewise.
4991 (Output_segment::print_sections_to_map): Likewise.
4992 * output.h (class Output_data): Remove dynamic_reloc_count_
4993 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4994 (Output_data::add_dynamic_reloc): Rewrite.
4995 (Output_data::has_dynamic_reloc): New function.
4996 (Output_data::dynamic_reloc_count): Remove.
4997 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4998 is_last_relro_, is_first_non_relro_, is_interp_,
4999 is_dynamic_linker_section_ fields. Add order and set_order
5000 functions. Remove is_relro_local, set_is_relro_local,
5001 is_last_relro, set_is_last_relro, is_first_non_relro,
5002 set_is_first_non_relro functions, is_interp, set_is_interp,
5003 is_dynamic_linker_section, and set_is_dynamic_linker_section
5004 functions.
5005 (class Output_segment): Change Output_data_list from std::list to
5006 std:;vector. Add output_lists_ field. Remove output_data_ and
5007 output_bss_ fields. Update declarations.
5008
3ff2ccb0
ILT
50092010-08-02 Ian Lance Taylor <iant@google.com>
5010
5011 * arm.cc (Target_arm::gc_process_relocs): Use typename.
5012 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
5013 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
5014
88a4108b
ILT
50152010-08-02 Ian Lance Taylor <iant@google.com>
5016
5017 PR 11855
5018 * script.cc (Script_options::Script_options): Initialize
5019 symbol_definitions_ and symbol_references_.
5020 (Script_options::add_symbol_assignment): Update
5021 symbol_definitions_ and symbol_references_.
5022 (Script_options::add_symbol_reference): New function.
5023 (script_symbol): New function.
5024 * script.h (class Script_options): Add symbol_definitions_ and
5025 symbol_references_ fields.
5026 (Script_options::referenced_const_iterator): New type.
5027 (Script_options::referenced_begin): New function.
5028 (Script_options::referenced_end): New function.
5029 (Script_options::is_referenced): New function.
5030 (Script_options::any_unreferenced): New function.
5031 * script-c.h (script_symbol): Declare.
5032 * yyscript.y (exp): Call script_symbol.
5033 * symtab.cc: Include "script.h".
5034 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5035 Change all callers. Check symbols referenced by scripts.
5036 (Symbol_table::add_undefined_symbols_from_command_line): Add
5037 layout parameter. Change all callers.
5038 (Symbol_table::do_add_undefined_symbols_from_command_line):
5039 Likewise. Break out loop body. Check symbols referenced by
5040 scripts.
5041 (Symbol_table::add_undefined_symbol_from_command_line): New
5042 function broken out of
5043 do_add_undefined_symbols_from_command_line.
5044 * symtab.h (class Symbol_table): Update declarations.
5045 * archive.cc: Include "layout.h".
5046 (Archive::should_include_member): Add layout parameter. Change
5047 all callers. Check for symbol mentioned in expression.
5048 * archive.h (class Archive): Update declaration.
5049 * object.cc (Sized_relobj::do_should_include_member): Add layout
5050 parameter.
5051 * object.h (Object::should_include_member): Add layout parameter.
5052 Change all callers.
5053 (Object::do_should_include_member): Add layout parameter.
5054 (class Sized_relobj): Update declaration.
5055 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
5056 parameter.
5057 * dynobj.h (class Sized_dynobj): Update declaration.
5058 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
5059 layout parameter.
5060 * plugin.h (class Sized_pluginobj): Update declaration.
5061
5f1ab67a
ILT
50622010-08-02 Ian Lance Taylor <iant@google.com>
5063
5064 PR 11866
5065 * output.cc (Output_segment::set_offset): Search for the first and
5066 last sections rather than assuming that the list is in order.
5067 (Output_segment::find_first_and_last_list): New function.
5068 * output.h (class Output_segment): Update declarations.
5069 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
5070 (relro_strip_test_SOURCES): New variable.
5071 (relro_strip_test_DEPENDENCIES): New variable.
5072 (relro_strip_test_LDFLAGS): New variable.
5073 (relro_strip_test_LDADD): New variable.
5074 (relro_strip_test.so): New target.
5075
a8df5856
ILT
50762010-08-02 Ian Lance Taylor <iant@google.com>
5077
5078 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
5079 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
5080 (Target_i386::got_tlsdesc_section): New function.
5081 (Target_i386::got_section): Create space for GOT entries for
5082 TLSDESC relocations.
5083 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
5084 R_386_TLS_GOTDESC.
5085 (Target_i386::Scan::global): Likewise.
5086 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
5087 using TLSDESC GOT.
5088 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
5089 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
5090 (Target_x86_64::got_tlsdesc_section): New function.
5091 (Target_x86_64::got_section): Create space for GOT entries for
5092 TLSDESC relocations.
5093 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5094 R_386_TLS_GOTDESC.
5095 (Target_x86_64::Scan::global): Likewise.
5096 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5097 using TLSDESC GOT.
5098
0c10a0a6
ILT
50992010-08-02 Ian Lance Taylor <iant@google.com>
5100
5101 * testsuite/final_layout.sh: Use dc to convert from hex to
5102 decimal.
5103
41cbeecc
ST
51042010-07-29 Sriraman Tallam <tmsriram@google.com>
5105
5106 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5107 paramter to the call to gold::gc_process_relocs.
5108 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5109 paramter to the call to gold::gc_process_relocs.
5110 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5111 parameter to the call to gold::gc_process_relocs.
5112 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5113 template parameter to the call to gold::gc_process_relocs.
5114 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5115 paramter to the call to gold::gc_process_relocs.
5116 * gc.h (get_embedded_addend_size): New function.
5117 (gc_process_relocs): Save the size of the reloc for use by ICF.
5118 * icf.cc (get_section_contents): Get the addend from the text section
5119 for SHT_REL relocation sections.
5120 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5121 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5122 * int_encoding.h (read_from_pointer): New overloaded function.
5123 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5124 * testsuite/icf_sht_rel_addend_test.sh: New file.
5125 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5126 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5127
6ea55b82
RW
51282010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5129
5130 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5131 * Makefile.in: Regenerate.
5132 * testsuite/Makefile.in: Regenerate.
5133
9691462b
ILT
51342010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5135
5136 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5137 * gold/testsuite/debug_msg.cc: Likewise.
5138 * gold/testsuite/odr_violation1.cc
5139 * gold/testsuite/odr_violation2.cc
5140
76897331
CC
51412010-07-21 Cary Coutant <ccoutant@google.com>
5142
5143 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5144 string, and length fields.
5145 (Output_merge_string::Merged_strings_list): New type.
5146 (Output_merge_string::Merged_strings_lists): New typedef.
5147 (Output_merge_string): Replace merged_strings_ with
5148 merged_strings_lists_.
5149 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5150 Merged_strings_list per input object and section. Don't store pointer
5151 to the string. Don't store length with each merged string entry.
5152 (Output_merge_string::finalize_merged_data): Loop over list of merged
5153 strings lists. Recompute length of each merged string.
5154
78384e8f
CC
51552010-07-15 Cary Coutant <ccoutant@google.com>
5156
5157 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5158 here.
5159
783659f9
ILT
51602010-07-14 Ian Lance Taylor <iant@google.com>
5161
5162 * descriptors.cc (Descriptors::open): Report correct name in error
5163 message.
5164
131687b4
DK
51652010-07-13 Doug Kwan <dougkwan@google.com>
5166
5167 * arm.cc (Arm_input_section::Arm_input_section): For a
5168 SHT_ARM_EXIDX section, always keeps the input sections.
5169 (Arm_input_section::set_exidx_section_link): New method.
5170 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5171 has_errors_ to false.
5172 (Arm_exidx_input_section::has_errors,
5173 Arm_exidx_input_section::set_has_errors): New methods.
5174 (Arm_exidx_input_section::has_errors_): New data member.
5175 (Arm_relobj::get_exidx_shndx_list): New method.
5176 (Arm_output_section::append_text_sections_to_list): Do not skip
5177 section without SHF_EXECINSTR.
5178 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5179 errors.
2e702c99 5180 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
5181 section header. Make error messages more verbose. Check for
5182 a non-executable section linked to an EXIDX section.
5183 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5184 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5185 check that there is no deferred EXIDX section if we exit early.
5186 Instead of not making an EXIDX section in case of an error, make one
5187 and set the has_errors flag of it.
5188 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5189 in a relocatable link.
5190 (Target_arm::do_relax): Look for the EXIDX output section instead of
5191 assuming that it is called .ARM.exidx.
2e702c99 5192 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
5193 section list. Do not check for SHF_EXECINSTR section flags but
5194 skip any input section with errors.
5195 * output.cc (Output_section::Output_section): Initialize
5196 always_keeps_input_sections_ to false.
5197 (Output_section::add_input_section): Check for
5198 always_keeps_input_sections_.
5199 * output.h (Output_section::always_keeps_input_sections,
5200 Output_section::set_always_keeps_input_sections): New methods.
5201 (Output_section::always_keeps_input_sections): New data member.
5202
69517287
RÁE
52032010-07-13 Rafael Espindola <espindola@google.com>
5204
5205 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5206 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5207
82742395
ILT
52082010-07-13 Philip Herron <herron.philip@googlemail.com>
5209 Ian Lance Taylor <iant@google.com>
5210
5211 * output.h (Output_section_lookup_maps::add_merge_section):
5212 Correct check of whether value was inserted.
5213 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5214 (Output_section_lookup_maps::add_relaxed_input_section):
5215 Likewise.
5216 * arm.cc (Target_arm::got_section): Remove used local os.
5217 * i386.cc (Target_i386::got_section): Likewise.
5218 * x86_64.cc (Target_x86_64::got_section): Likewise.
5219 * sparc.cc (Target_sparc::got_section): Likewise.
5220 (Target_sparc::relocate): Remove unused local have_got_offset.
5221 * powerpc.cc (Target_powerpc::relocate): Likewise.
5222
f2d707b5
ILT
52232010-07-13 Ian Lance Taylor <iant@google.com>
5224
241531d6
ILT
5225 * compressed_output.cc (zlib_decompress): Fix signature in
5226 !HAVE_ZLIB_H case.
5227
f2d707b5
ILT
5228 * archive.cc (Archive::include_member): Unlock an external member
5229 of a thin archive. Don't bother to delete an object we know is
5230 NULL.
5231
a2e47362
CC
52322010-07-12 Cary Coutant <ccoutant@google.com>
5233
5234 * compressed_output.cc (zlib_decompress): New function.
5235 (get_uncompressed_size): New function.
5236 (decompress_input_section): New function.
5237 * compressed_output.h (get_uncompressed_size): New function.
5238 (decompress_input_section): New function.
5239 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5240 Handle compressed debug sections.
5241 * layout.cc (is_compressed_debug_section): New function.
5242 (Layout::output_section_name): Map compressed section names to
5243 canonical names.
5244 * layout.h (is_compressed_debug_section): New function.
5245 (is_debug_info_section): Recognize compressed debug sections.
5246 * merge.cc: Include compressed_output.h.
5247 (Output_merge_data::do_add_input_section): Handle compressed
5248 debug sections.
5249 (Output_merge_string::do_add_input_section): Handle compressed
5250 debug sections.
5251 * object.cc: Include compressed_output.h.
5252 (Sized_relobj::Sized_relobj): Initialize new data members.
5253 (build_compressed_section_map): New function.
5254 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5255 * object.h (Object::section_is_compressed): New method.
5256 (Object::do_section_is_compressed): New method.
5257 (Sized_relobj::Compressed_section_map): New type.
5258 (Sized_relobj::do_section_is_compressed): New method.
5259 (Sized_relobj::compressed_sections_): New data member.
5260 * output.cc (Output_section::add_input_section): Handle compressed
5261 debug sections.
5262 * reloc.cc: Include compressed_output.h.
5263 (Sized_relobj::write_sections): Handle compressed debug sections.
5264
ce279a62
CC
52652010-07-08 Cary Coutant <ccoutant@google.com>
5266
5267 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5268 weak when resolving to a dynamic def.
5269 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5270 for weak undef/dynamic def cases. Adjust callers.
5271 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5272 undef_binding_weak_.
5273 (Symbol_table::sized_write_globals): Adjust symbol binding.
5274 (Symbol_table::sized_write_symbol): Add binding parameter.
5275 * symtab.h (Symbol::set_undef_binding): New method.
5276 (Symbol::is_undef_binding_weak): New method.
5277 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5278 (Symbol_table::should_override): Add new parameter.
5279 (Symbol_table::sized_write_symbol): Add new parameter.
5280
5281 * testsuite/weak_undef_file1.cc: Add new test case.
5282 * testsuite/weak_undef_file2.cc: Fix header comment.
5283 * testsuite/weak_undef_test.cc: Add new test case.
5284
b2286c10
DK
52852010-06-29 Doug Kwan <dougkwan@google.com>
5286
5287 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5288 Initialize USE_SYMBOL_.
5289 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5290 definition.
5291 (Arm_reloc_property::uses_symbol_): New data member declaration.
5292 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5293 uses symbol value and symbol is undefined but not weakly undefined.
5294
4802450a
RÁE
52952010-06-28 Rafael Espindola <espindola@google.com>
5296
5297 * plugin.cc (Plugin::load): Use dlerror.
5298
e5ca47ba
ILT
52992010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5300
5301 * symtab.cc (detect_odr_violations): When reporting an ODR
5302 violation, report an object where the symbol is defined.
5303
8a75a161
DK
53042010-06-25 Doug Kwan <dougkwan@google.com>
5305
5306 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5307 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5308 definition.
5309 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5310 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5311 target hook to detect function points.
5312 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5313 * icf.h (Icf::check_section_for_function_pointers): Change type of
5314 parameter SECTION_NAME to const reference to std::string. Use
5315 target hook to determine if section may have unsafe pointers.
5316 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5317 method definition.
5318
42218b9f
RÁE
53192010-06-21 Rafael Espindola <espindola@google.com>
5320
5321 * fileread.cc (Input_file::find_fie): New
5322 (Input_file::open): Use Input_file::find_fie.
5323 * fileread.h (Input_file::find_fie): New
5324 * plugin.cc (set_extra_library_path): New.
5325 (Plugin::load): Add set_extra_library_path to the transfer vector.
5326 (Plugin_manager::set_extra_library_path): New.
5327 (Plugin_manager::add_input_file): Use the extra search path if set.
5328 (set_extra_library_path(): New.
5329 * plugin.h (Plugin_manager): Add set_extra_library_path and
5330 extra_search_path_.
5331
a0506cca
CC
53322010-06-19 Cary Coutant <ccoutant@google.com>
5333
5334 * layout.cc (gdb_sections): Add .debug_types.
5335 (lines_only_debug_sections): Likewise.
5336
6508b958
RÁE
53372010-06-18 Rafael Espindola <espindola@google.com>
5338
5339 * plugin.cc (add_input_file,add_input_library)
5340 (Plugin_manager::add_input_file): Make filename arguments const.
5341 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5342 const.
5343
3e235302
DK
53442010-06-16 Doug Kwan <dougkwan@google.com>
5345
5346 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5347 .ARM.attributes section if we have not merged any input
5348 attributes sections.
5349
106e8a6c
DK
53502010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5351
5352 * arm.cc: Allow combining objects with no EABI version
5353 information.
5354
91ff43fe
RÁE
53552010-06-15 Rafael Espindola <espindola@google.com>
5356
5357 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5358
68ed838c
ILT
53592010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5360
5361 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5362 (struct iovec): Correct !HAVE_READV definition.
5363
f3a2388f
CC
53642010-06-10 Cary Coutant <ccoutant@google.com>
5365
5366 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5367 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5368 reloc sections.
5369 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5370
5371 PR 11683
5372 * symtab.h (Symbol::is_placeholder): New member function.
5373 * target-reloc.h (relocate_section): Check for placeholder symbols.
5374
5375 * testsuite/Makefile.am (plugin_test_8): New test.
5376 (plugin_test_9): New test.
5377 * testsuite/Makefile.in: Regenerate.
5378
e1df38aa
NC
53792010-06-09 Nick Clifton <nickc@redhat.com>
5380
5381 * yyscript.y (input_list_element): Allow strings prefixed with
5382 the '-' character. Treat these as libraries.
5383 * script.cc (script_add_library): New function. Adds a library
5384 specified by "-l<name>" found in an input script.
5385 * script-c.h: Add prototype for script_add_library.
5386
25bbe950
DK
53872010-06-07 Doug Kwan <dougkwan@google.com>
5388
5389 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5390 Restrict stub-group size to be within long conditional branch
5391 range when working around cortex-A8 erratum.
5392
0f32ea4c
ILT
53932010-06-07 Damien Diederen <dd@crosstwine.com>
5394
5395 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5396 #ifdef typo.
5397
8fe2a369
ST
53982010-06-03 Sriraman Tallam <tmsriram@google.com>
5399
5400 PR gold/11658
5401 * output.cc
5402 (Output_section::Input_section_sort_entry::compare_section_ordering):
5403 Change to return non-zero correctly.
5404 (Output_section::Input_section_sort_section_order_index_compare
5405 ::operator()): Change to fix ambiguity in comparisons.
5406
6e9ba2ca
ST
54072010-06-01 Sriraman Tallam <tmsriram@google.com>
5408
5409 * gold.h (is_wildcard_string): New function.
5410 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5411 (Layout::layout_eh_frame): Ditto.
5412 (Layout::find_section_order_index): New method.
5413 (Layout::read_layout_from_file): New method.
5414 * layout.h (Layout::find_section_order_index): New method.
5415 (Layout::read_layout_from_file): New method.
5416 (Layout::input_section_position_): New private member.
5417 (Layout::input_section_glob_): New private member.
5418 * main.cc (main): Call read_layout_from_file here.
5419 * options.h (--section-ordering-file): New option.
5420 * output.cc (Output_section::input_section_order_specified_): New
5421 member.
5422 (Output_section::Output_section): Initialize new member.
5423 (Output_section::add_input_section): Add new parameter.
5424 Keep input sections when --section-ordering-file is used.
5425 (Output_section::set_final_data_size): Sort input sections when
5426 section ordering file is specified.
5427 (Output_section::Input_section_sort_entry): Add new parameter.
5428 Check sorting type.
5429 (Output_section::Input_section_sort_entry::compare_section_ordering):
5430 New method.
5431 (Output_section::Input_section_sort_compare::operator()): Change to
5432 consider section_order_index.
5433 (Output_section::Input_section_sort_init_fini_compare::operator()):
5434 Change to consider section_order_index.
5435 (Output_section::Input_section_sort_section_order_index_compare
5436 ::operator()): New method.
5437 (Output_section::sort_attached_input_sections): Change to sort
5438 according to section order when specified.
e1df38aa
NC
5439 (Output_section::add_input_section<32, true>): Add new parameter.
5440 (Output_section::add_input_section<64, true>): Add new parameter.
5441 (Output_section::add_input_section<32, false>): Add new parameter.
5442 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
5443 * output.h (Output_section::add_input_section): Add new parameter.
5444 (Output_section::input_section_order_specified): New
5445 method.
5446 (Output_section::set_input_section_order_specified): New method.
5447 (Input_section::Input_section): Initialize section_order_index_.
5448 (Input_section::section_order_index): New method.
5449 (Input_section::set_section_order_index): New method.
5450 (Input_section::section_order_index_): New member.
5451 (Input_section::Input_section_sort_section_order_index_compare): New
5452 struct.
5453 (Output_section::input_section_order_specified_): New member.
5454 * script-sections.cc (is_wildcard_string): Delete and move modified
5455 method to gold.h.
5456 (Output_section_element_input::Output_section_element_input): Modify
5457 call to is_wildcard_string.
5458 (Output_section_element_input::Input_section_pattern
5459 ::Input_section_pattern): Ditto.
5460 (Output_section_element_input::Output_section_element_input): Ditto.
5461 * testsuite/Makefile.am (final_layout): New test case.
5462 * testsuite/Makefile.in: Regenerate.
5463 * testsuite/final_layout.cc: New file.
5464 * testsuite/final_layout.sh: New file.
5465
3537c84b
RÁE
54662010-06-01 Rafael Espindola <espindola@google.com>
5467
5468 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5469
105b6afd
RÁE
54702010-06-01 Rafael Espindola <espindola@google.com>
5471
5472 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5473 visibility of symbols.
5474
29e11421
DK
54752010-05-27 Doug Kwan <dougkwan@google.com>
5476
5477 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5478 from start of output section instead of address for a local symbol
5479 in a merged or relaxed section when doing a relocatable link.
5480
5e0f337e
RÁE
54812010-05-26 Rafael Espindola <espindola@google.com>
5482
5483 PR 11604
5484 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5485 adding sections the garbage collector removed.
5486 * gold/testsuite/Makefile.am: Add test.
5487 * gold/testsuite/Makefile.in: Regenerate.
5488 * gold/testsuite/plugin_test_7.sh: New.
5489 * gold/testsuite/plugin_test_7_1.c: New.
5490 * gold/testsuite/plugin_test_7_2.c: New.
5491
f4187277
RÁE
54922010-05-26 Rafael Espindola <espindola@google.com>
5493
5494 * script-sections.cc (Output_section_definition::set_section_addresses):
5495 Check for --section-start.
5496
5c388529
DK
54972010-05-26 Doug Kwan <dougkwan@google.com>
5498
5499 * arm.cc (Arm_scan_relocatable_relocs): New class.
5500 (Target_arm::relocate_special_relocatable): New method.
5501 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5502 (Arm_relocate_functions::thumb_branch_common): Same.
5503 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5504 instead of Default_scan_relocatable_relocs.
5505 * target-reloc.h (relocate_for_relocatable): Let target handle
5506 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5507 * target.h (Sized_target::relocate_special_relocatable): New method.
5508
bca1c3ae
ILT
55092010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5510
5511 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5512
0439c796
DK
55132010-05-23 Doug Kwan <dougkwan@google.com>
5514
5515 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5516 instead of a cast.
5517 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5518 with a direct branch, not a conditional branch, to a stub.
5519 * merge.cc (Output_merge_base::record_input_section): New method
5520 defintion.
5521 (Output_merge_data::do_add_input_section): Record input section if
5522 keeps-input-sections flag is set.
5523 (Output_merge_string::do_add_input_section): Ditto.
5524 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5525 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5526 INPUT_SECTIONS_.
5527 (Output_merge_base::keeps_input_sections,
5528 Output_merge_base::set_keeps_input_sections,
5529 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5530 method definitions.
5531 (Output_merge_base::Input_sections): New type declaration.
5532 (Output_merge_base::input_sections_begin,
5533 Output_merge_base::input_sections_end,
5534 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5535 (Output_merge_base::bool keeps_input_sections_,
5536 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5537 Output_merge_base::input_sections_): New data members.
5538 (Output_merge_data::do_set_keeps_input_sections): New method
5539 defintion.
5540 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5541 * output.cc (Output_section::Input_section::relobj): Move method
5542 defintion from class declaration to here and handle merge sections.
5543 (Output_section::Input_section::shndx): Ditto.
5544 (Output_section::Output_section): Remove initializations of removed
5545 data members and initialize new data member LOOKUP_MAPS_.
5546 (Output_section::add_input_section): Set keeps-input-sections flag
5547 for a newly created merge output section as appropriate. Adjust code
5548 to use Output_section_lookup_maps class.
5549 (Output_section::add_relaxed_input_section): Adjst code for lookup
5550 maps code refactoring.
2e702c99 5551 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
5552 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5553 class. If adding input section to a newly created merge output
5554 section fails, remove the new merge section.
5555 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 5556 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 5557 (Output_section::find_merge_section): Ditto.
0439c796 5558 (Output_section::build_lookup_maps): New method defintion.
2e702c99 5559 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
5560 Output_section_lookup_maps class.
5561 (Output_section::get_input_sections): Export merge sections. Adjust
5562 code to use Output_section_lookup_maps class.
5563 (Output_section:::add_script_input_section): Adjust code to use
5564 Output_section_lookup_maps class. Update lookup maps for merge
5565 sections also.
5566 (Output_section::discard_states): Use Output_section_lookup_maps.
5567 (Output_section::restore_states): Same.
5568 * output.h (Merge_section_properties): Move class defintion out of
5569 Output_section.
5570 (Output_section_lookup_maps): New class.
5571 (Output_section::Input_section::is_merge_section): New method
5572 defintion.
5573 (Output_section::Input_section::relobj): Move defintion out of class
5574 defintion. Declare method only.
5575 (Output_section::Input_section::shndx): Ditto.
5576 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 5577 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
5578 (Output_section::Merge_section_by_properties_map,
5579 Output_section::Output_section_data_by_input_section_map,
5580 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5581 Remove types.
2e702c99 5582 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
5583 KEEPS_INPUT_SECTIONS.
5584 (Output_section::build_lookup_maps): New method declaration.
5585 (Output_section::merge_section_map_,
5586 Output_section::merge_section_by_properties_map_,
5587 Output_section::relaxed_input_section_map_,
5588 Output_section::is_relaxed_input_section_map_valid_): Remove data
5589 members.
5590 (Output_section::lookup_maps_): New data member.
5591
76295588
L
55922010-05-21 Doug Kwan <dougkwan@google.com>
5593
5594 PR gold/11619
5595 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5596 avoid a compilation error.
5597
d103a984
RÁE
55982010-05-19 Rafael Espindola <espindola@google.com>
5599
5600 * script-sections.cc (Output_section_definition::allocate_to_segment):
5601 Update the phdrs_list even when the output section is NULL.
5602 * testsuite/Makefile.am: Add test.
5603 * testsuite/Makefile.in: Regenerate.
5604 * testsuite/script_test_9.cc: New.
5605 * testsuite/script_test_9.sh: New.
5606 * testsuite/script_test_9.t: New.
5607
6625d24e
DK
56082010-05-19 Doug Kwan <dougkwan@google.com>
5609
5610 * arm.cc (Arm_input_section::original_size): New method.
5611 (Arm_input_section::do_addralign): Add a cast.
5612 (Arm_input_section::do_output_offset): Remove static cast.
5613 (Arm_input_section::original_addralign,
5614 Arm_input_section::original_size_): Change type to uint32_t.
5615 (Arm_input_section::init): Add safe casts for section alignment
5616 and size.
5617 (Arm_input_section::set_final_data_size): Do not set address and
5618 offset of stub table.
5619 (Arm_output_section::fix_exidx_coverage): Change use of of
5620 Output_section::Simple_input_section to that of
5621 Output_section::Input_section.
5622 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5623 except for the first pass.
5624 * output.cc (Output_section::get_input_sections): Change type of
5625 input_sections to std::list<Input_section>.
5626 (Output_section::add_script_input_section): Rename from
5627 Output_section::add_simple_input_section. Change type of SIS
5628 parameter from Simple_input_section to Input_section.
5629 * output.h (Output_section::Simple_input_section): Remove class.
5630 (Output_section::Input_section): Change class visibility to public.
5631 (Output_section::Input_section::addralign): Use stored alignments
5632 for special input sections if set.
5633 (Output_section::Input_section::set_addralign): New method.
5634 (Output_section::get_input_sections): Change parameter type from
5635 list of Simple_input_section to list of Input_section.
5636 (Output_section::add_script_input_section): Rename from
5637 Output_section::add_simple_input_section. Change first parameter's
5638 type from Simple_input_section to Input_section and remove the
5639 second and third parameters.
5640 * script-sections.cc (Input_section::Input_section_list): Change
5641 type to list of Output_section::Input_section/
5642 (Input_section_info::Input_section_info): Change parameter type of
5643 INPUT_SECTION to Output_section::Input_section.
5644 (Input_section_info::input_section): Change return type.
5645 (Input_section_info::input_section_): Change type to
5646 Output_section::Input_section.
5647 (Output_section_element_input::set_section_addresses): Adjust code
5648 to use Output_section::Input_section instead of
5649 Output_section::Simple_input_section. Adjust code for renaming
5650 of Output_section::add_simple_input_section.
5651 (Orphan_output_section::set_section_addresses): Ditto.
5652
e1e82ea4
RW
56532010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5654
5655 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5656 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5657
91e75c8a
RÁE
56582010-05-18 Rafael Espindola <espindola@google.com>
5659
5660 * options.cc (General_options::finalize): Handle -nostdlib.
5661 * options.h (nostdlib): New option.
5662 * script.cc (script_add_search_dir): Handle -nostdlib.
5663
da59ad79
DK
56642010-05-12 Doug Kwan <dougkwan@google.com>
5665
5666 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5667 attributes section only if there no attributes section after merging.
5668 (Target_arm::merge_object_attributes): Move value of
e1df38aa 5669 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
5670 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5671 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5672 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5673 and arm_attr_merge_7.stdout.
5674 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5675 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5676 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5677 arm_attr_merge_7b.o): New rules.
5678 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5679 arm_attr_merge_7
5680 * testsuite/Makefile.in: Regenerate.
5681 * testsuite/arm_attr_merge.sh: New file.
5682 * testsuite/arm_attr_merge_[67][ab].s: Same.
5683
3e01a7fd
NC
56842010-05-05 Nick Clifton <nickc@redhat.com>
5685
5686 * po/es.po: Updated Spanish translation.
5687
7ad2014a
L
56882010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5689
5690 * Makefile.am (install-exec-local): Properly install gold as
5691 default cross linker.
5692 * Makefile.in: Regenerated.
5693
4fda8867
NC
56942010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5695 Nick Clifton <nickc@redhat.com>
5696
5697 * configure.ac (install_as_default): Define and set to false
5698 unless --enable-gold or --enable-gold=both/gold has been
5699 specified.
5700 * configure: Regenerate.
5701
5702 * Makefile.am (install-exec-local): Install the executable as
5703 'ld.gold'. If install_as_default is true then also install it as
5704 'ld'.
5705 * Makefile.in: Regenerated.
5706
bd288ea2
ILT
57072010-04-24 Ian Lance Taylor <iant@google.com>
5708
5709 * layout.cc (Layout::layout_reloc): In relocatable link don't
5710 combine reloc sections for grouped sections.
5711
ef38fd8a
ST
57122010-04-23 Sriraman Tallam <tmsriram@google.com>
5713
5714 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5715 sections that are not ordinary to icf.
5716 * icf.cc (get_section_contents): Handle relocation pointing to section
5717 with no object or shndx information.
5718 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5719 * testsuite/Makefile.in: Regenerate.
5720 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5721 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5722
f6973bdc
ILT
57232010-04-22 Ian Lance Taylor <iant@google.com>
5724
5725 * expression.cc (Expression::Expression_eval_info): Add
5726 result_alignment_pointer field.
5727 (Expression::eval_with_dot): Add result_alignment_pointer
5728 parameter. Change all callers.
5729 (Expression::eval_maybe_dot): Likewise.
5730 (class Binary_expression): Add alignment_pointer parameter to
5731 left_value and right_value. Change all callers.
5732 (BINARY_EXPRESSION): Set result alignment.
5733 (class Trinary_expression): Add alignment_pointer parameter to
5734 arg2_value and arg3_value. Change all callers.
5735 (Trinary_cond::value): Set result alignment.
5736 (Max_expression::value, Min_expression::value): Likewise.
5737 (Align_expression::value): Likewise.
5738 * script-sections.cc (class Sections_element): Add dot_alignment
5739 parameter to set_section_addresses virtual function. Update
5740 instantiations.
5741 (class Output_section_element): Likewise.
5742 (Script_sections::create_segments): Add dot_alignment parameter.
5743 Change all callers.
5744 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5745 (Script_sections::set_phdrs_clause_addresses): Likewise.
5746 * script-sections.h: Update declarations.
5747 * script.h: Update declarations.
5748 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5749 min_p_align.
5750 * testsuite/script_test_3.t: Set large alignment.
5751 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5752 segment has expected alignment.
5753
9c9c98a5
NC
57542010-04-22 Nick Clifton <nickc@redhat.com>
5755
5756 * po/gold.pot: Updated by the Translation project.
5757 * po/vi.po: Updated Vietnamese translation.
5758
2253bfba
L
57592010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5760
5761 * testsuite/Makefile.am (check_PROGRAMS): Add
5762 icf_virtual_function_folding_test.
5763 * testsuite/Makefile.in: Regenerated.
5764
85fdf906
AH
57652010-04-15 Andrew Haley <aph@redhat.com>
5766
5767 * options.h (merge_exidx_entries): New option.
5768 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5769 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5770 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5771 (Target_arm::merge_exidx_entries): New function.
5772 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5773 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5774 to Arm_exidx_fixup constructor.
5775 Add new arg, merge_exidx_entries.
5776 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5777 Arm_output_section::fix_exidx_coverage.
5778
ce97fa81
ST
57792010-04-18 Sriraman Tallam <tmsriram@google.com>
5780
5781 * icf.cc (get_section_contents): Check for preemptible functions.
5782 Ignore addend when appropriate.
5783 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5784 section folded.
5785 (add_from_relobj): Check for section folded.
5786 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5787 * symtab.h (should_add_dynsym_entry): Add new parameter.
5788 * target-reloc.h (scan_relocs): Check for section folded.
5789 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5790 Check reloc types for function pointers in shared objects.
5791 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5792 case.
5793 (icf_preemptible_functions_test): New test case.
5794 (icf_string_merge_test): New test case.
5795 * testsuite.Makefile.in: Regenerate.
5796 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5797 bar_glob. Refactor code.
5798 * testsuite/icf_preemptible_functions_test.cc: New file.
5799 * testsuite/icf_preemptible_functions_test.sh: New file.
5800 * testsuite/icf_string_merge_test.cc: New file.
5801 * testsuite/icf_string_merge_test.sh: New file.
5802 * testsuite/icf_virtual_function_folding_test.cc: New file.
5803 * testsuite/icf_virtual_function_folding_test.sh: New file.
5804
04ceb17c
DK
58052010-04-14 Doug Kwan <dougkwan@google.com>
5806
5807 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5808 for local symbol recounting if we remove a section due to ICF.
5809 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5810 there are no regular objects in input.
5811
153e7da4
DK
58122010-04-13 Doug Kwan <dougkwan@google.com>
5813
5814 * arm.cc (Arm_input_section::set_final_data_size): Compute
5815 accurate final data size instead of using current data size.
5816
4dbd9faf
DK
58172010-04-09 Doug Kwan <dougkwan@google.com>
5818
5819 * layout.cc (Layout::choose_output_section): Handle script section
5820 types.
5821 (Layout::make_output_section_for_script): Add section type parameter.
5822 Handle script section types.
5823 * layout.h (Layout::make_output_section_for_script): Add section
5824 type parameter.
5825 * output.cc (Output_section::Output_section): Initialize data member
5826 is_noload_.
5827 (Output_section::do_reset_address_and_file_offset): Do not set address
5828 to 0 if section is a NOLOAD section.
5829 * output.h (Output_section::is_noload): New method.
5830 (Output_section::set_is_noload): Ditto.
5831 (Output_section::is_noload_): New data member.
5832 * script-c.h (Script_section_type): New enum type.
5833 (struct Parser_output_section_header): Add new file section_type.
5834 * script-sections.cc (Sections_element::output_section_name): Add
5835 parameter for returning script section type.
5836 (Output_section_definition::output_section_name): Ditto.
5837 (Output_section_definition::section_type)P; New method.
5838 (Output_section_definiton::script_section_type_name): Ditto.
5839 (Output_section_definition::script_section_type_): New data member.
5840 (Output_section_definition::Output_section_definition): Initialize
5841 data member Output_section_definition::script_section_type_.
5842 (Output_section_definition::create_sections): Pass script section type
5843 to Layout::make_output_section_for_script.
5844 (Output_section_definition::output_section_name): Return script
5845 section type to caller.
5846 (Output_section_definition::set_section_address): Do not advance
5847 dot value and load address if section type is NOLOAD. Set address
5848 of NOLOAD sections regardless of section flags.
5849 (Output_section_definition::print): Print section type if it is
5850 not SCRIPT_SECTION_TYPE_NONE.
5851 (Output_section_definition::section_type): New method.
5852 (Output_section_definition::script_section_type_name): Ditto.
5853 (Script_sections::output_section_name): Add new parameter
5854 PSECTION_TYPE for returning script section type. Pass it to
5855 section elements. Handle discard sections.
5856 (Sort_output_sections::operator()): Handle NOLOAD sections.
5857 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 5858 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
5859 returning script section type.
5860 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5861 INFO and NOLOAD.
5862 * yyscript.y (union): Add new field SECTION_TYPE.
5863 (COPY, DSECT, INFO, NOLOAD): New tokens.
5864 (opt_address_and_section_type): Change type to output_section_header.
5865 (section_type): New non-terminal
5866 (section_header): Handle section type.
2253bfba 5867 (opt_address_and_section_type): Return section type value.
4dbd9faf 5868
721ea635
L
58692010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5870
5871 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5872 * testsuite/plugin_common_test_2.c (foo): Likewise.
5873
6bf924b0
DK
58742010-04-08 Doug Kwan <dougkwan@google.com>
5875
5876 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5877 Output_merge_data.
5878 * output.cc (Output_section::add_merge_input_section): Simplify
5879 code and return status of Output_merge_base::add_input_section.
e1df38aa 5880 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
5881 returns true.
5882
24af6f92
DK
58832010-04-07 Doug Kwan <dougkwan@google.com>
5884
5885 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5886 if section is marked as containing instructions but has no mapping
5887 symbols.
5888 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5889 correct section index.
5890 (Arm_relobj::find_linked_text_section): Ditto.
5891
00698fc5
CC
58922010-04-07 Cary Coutant <ccoutant@google.com>
5893
5894 * archive.cc (include_member): Destroy Read_symbols_data object before
5895 releasing file.
5896 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5897 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5898 (Read_symbols_data::~Read_symbols_data) New destructor.
5899 (Section_relocs::Section_relocs) New constructor.
5900 (Section_relocs::~Section_relocs) New destructor.
5901 (Read_relocs_data::Read_relocs_data) New constructor.
5902 (Read_relocs_data::~Read_relocs_data) New destructor.
5903 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5904 pointers to NULL after deleting.
5905
7296d933
DK
59062010-04-07 Doug Kwan <dougkwan@google.com>
5907
5908 * arm.cc: Replace "endianity" with "endianness" in comments.
5909 (Arm_exidx_cantunwind): Ditto.
5910 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5911 (Arm_relobj::merge_flags_and_attributes): New method.
5912 (Arm_relobj::merge_flags_and_attributes_): New data member.
5913 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5914 (Arm_relobj::scan_sections_for_stubs): Ditto.
5915 (Arm_relobj::do_read_symbols): Check to see if we really want to
5916 merge processor-specific flags and attributes. Exit early if
5917 an object is empty except for section names and the undefined symbol.
5918 (Target_arm::do_finalize_sections): Move check for ELF format to
5919 Arm_relobj::do_read_symbols. Merge processor specific flags and
5920 attributes from a regular object only when we have determined that
5921 it is aapropriate. Do not create an .ARM.attributes section in
5922 output if there is no regular input object.
5923 (Target_arm::merge_processor_specific_flags): Check
5924 --warn-mismatch before printing any error.
5925 (Target_arm::merge_object_attributes): Ditto.
5926 * gold.cc (queue_middle_tasks): Handle the case in which there is
5927 no regular object in input.
5928 * options.cc (General_options::parse_EB): New method.
5929 (General_options::parse_EL): Same.
5930 (General_options::General_options): Initialize endianness_.
5931 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5932 New options.
5933 (General_options::Endianness): New enum.
5934 (General_options::endianness): New method.
5935 (General_options::endianness_): New data member.
5936 * parameters.cc (Parameters::set_options): Check target endianness.
5937 (Parameters::set_target_once): Ditto.
5938 (Parameters::check_target_endianness): New method.
5939 (parameters_force_valid_target): If either -EL or -EB is specified,
5940 use it to define endianness of default target.
5941 * parameters.h (Parameters::check_target_endianness): New method
5942 declaration.
5943 * target.h (class Target): Change "endianity" to "endianness"
5944 in comments.
5945
efc8d4f2
RW
59462010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5947
5948 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5949 * configure: Regenerate.
5950 * Makefile.in: Regenerate.
5951 * testsuite/Makefile.in: Regenerate.
5952
be234d88
CC
59532010-04-06 Cary Coutant <ccoutant@google.com>
5954
5955 gcc PR lto/42757
5956 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5957 prevailing definitions of common symbols.
5958 * testsuite/plugin_test_6.sh: New test case.
5959 * testsuite/plugin_common_test_1.c: New test case.
5960 * testsuite/plugin_common_test_2.c: New test case.
5961 * testsuite/Makefile.am (plugin_test_6): New test case.
5962 * testsuite/Makefile.in: Regenerate.
5963
bd32c6bd
NC
59642010-04-06 Nick Clifton <nickc@redhat.com>
5965
5966 * po/vi.po: New Vietnamese translation.
5967
323c532f
DK
59682010-03-30 Doug Kwan <dougkwan@google.com>
5969
5970 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5971
4fcd97eb
DK
59722010-03-25 Doug Kwan <dougkwan@google.com>
5973
5974 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5975 to avoid a conversion warning on a 32-bit host.
5976
4ebf39db
ILT
59772010-03-24 Ian Lance Taylor <iant@google.com>
5978
5979 * testsuite/script_test_3.t: Add a TLS segment.
5980 * testsuite/Makefile.am (check_PROGRAMS): Add
5981 tls_phdrs_script_test.
5982 (tls_phdrs_script_test_SOURCES): Define.
5983 (tls_phdrs_script_test_DEPENDENCIES): Define.
5984 (tls_phdrs_script_test_LDFLAGS): Define.
5985 (tls_phdrs_script_test_LDADD): Define.
5986 * testsuite/Makefile.in: Rebuild.
5987
4a599bdd
CC
59882010-03-23 Cary Coutant <ccoutant@google.com>
5989
5990 * fileread.cc (find_or_make_view): Fix comment.
5991
6c93b22c
ILT
59922010-03-23 Ian Lance Taylor <iant@google.com>
5993
5994 * script-sections.cc (class Orphan_section_placement): Define
5995 PLACE_TLS and PLACE_TLS_BSS.
5996 (Orphan_section_placement::Orphan_section_placement): Initialize
5997 new places.
5998 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5999 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6000 (tls_script_test_SOURCES): Define.
6001 (tls_script_test_DEPENDENCIES): Define.
6002 (tls_script_test_LDFLAGS): Define.
6003 (tls_script_test_LDADD): Define.
6004 * testsuite/Makefile.in: Rebuild.
6005
a2c7281b
DK
60062010-03-22 Doug Kwan <dougkwan@google.com>
6007
6008 * arm.cc (Arm_relocate_functions::abs8,
6009 Arm_relocate_functions::abs16): Use correct check for overflow
6010 specified in the ARM ELF specs.
6011 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
6012 target of a BLX instruction specially.
6013 (Reloc_stub::stub_type_for_reloc): Ditto.
6014 (Relocate::relocate): Use symbolic names instead of numeric relocation
6015 codes to report error.
6016 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
6017 workaround.
6018 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
6019 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
6020 thumb2_blx_out_of_range.stdout
6021 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
6022 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
6023 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
6024 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
6025 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
6026 thumb2_blx_in_range, thumb2_blx_in_range.o,
6027 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6028 thumb2_blx_out_of_range.o): New rules.
2e702c99 6029 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
6030 thumb2_blx_in_range and thumb2_blx_out_of_range.
6031 * testsuite/Makefile.in: Regenerate.
6032 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6033 * testsuite/thumb_blx_in_range.s: New file.
6034 * testsuite/thumb_blx_out_of_range.s: New file.
6035
b0193076
RÁE
60362010-03-22 Rafael Espindola <espindola@google.com>
6037
6038 * archive.cc (Should_include): Move to archive.h.
6039 (should_include_member): Make it a member of Archive.
6040 (Lib_group): New.
6041 (Add_lib_group_symbols): New.
6042 * archive.h: Include options.h.
6043 (Archive_member): Moved from Archive.
6044 (Should_include): Moved from archive.cc.
6045 (Lib_group): New.
6046 (Add_lib_group_symbols): New.
6047 * dynobj.cc (do_should_include_member): New.
6048 * dynobj.h (do_should_include_member): New.
6049 * gold.cc (queue_initial_tasks): Update call to queue.
6050 * main.cc (main): Print lib group stats.
6051 * object.cc (do_should_include_member): New.
6052 * object.h: Include archive.h.
6053 (Object::should_include_member): New.
6054 (Object::do_should_include_member): New.
6055 (Sized_relobj::do_should_include_member): New.
6056 * options.cc (General_options::parse_start_lib): New.
6057 (General_options::parse_end_lib): New.
6058 (Input_arguments::add_file): Handle lib groups.
6059 (Input_arguments::start_group): Check we are not in a lib.
6060 (Input_arguments::start_lib): New.
6061 (Input_arguments::end_lib): New.
6062 * options.h (General_options): Add start_lib and end_lib.
6063 (Input_argument::lib_): New.
6064 (Input_argument::lib): New.
6065 (Input_argument::is_lib): New.
6066 (Input_file_lib): New.
6067 (Input_arguments::in_lib_): New.
6068 (Input_arguments::in_lib): New.
6069 (Input_arguments::start_lib): New.
6070 (Input_arguments::end_lib_): New.
6071 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
6072 in unused members as preempted.
6073 (Sized_pluginobj::do_should_include_member): New.
6074 * plugin.h (Sized_pluginobj::do_should_include_member): New.
6075 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
6076 return the blocker.
6077 (Read_symbols::do_whole_lib_group): New.
6078 (Read_symbols::do_lib_group): New.
6079 (Read_symbols::do_read_symbols): Handle lib groups.
6080 (Read_symbols::get_name): Handle lib groups.
6081 * readsyms.h (Read_symbols): Add an archive member pointer.
6082 (Read_symbols::do_whole_lib_group): New.
6083 (Read_symbols::do_lib_group): New.
6084 (Read_symbols::member_): New.
6085 * script.cc (read_input_script): Update call to queue_soon.
6086
d099120c
DK
60872010-03-19 Doug Kwan <dougkwan@google.com>
6088
6089 * arm.cc (Stub_table::Stub_table): Initialize new data members
6090 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6091 (Stub_table::add_reloc_stub): Assign stub offset and update
6092 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6093 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6094 New data members.
2e702c99 6095 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
6096 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6097 instead of going over all reloc stubs.
2e702c99 6098 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
6099 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6100 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 6101 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
6102 Stringpool_template::offset_.
6103 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6104 Stringpool_template::offset_ to zero.
6105
1aa37384
DK
61062010-03-15 Doug Kwan <dougkwan@google.com>
6107
6108 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6109 offset_.
6110 (Stringpool_template::new_key_offset): New method.
6111 (Stringpool_template::add_string): Assign offsets when adding new
6112 strings.
6113 (Stringpool_template::set_string_offsets): Do not set string offsets
6114 when not optimizing.
6115 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6116 member size_.
2e702c99
RM
6117 (Chunked_vector::clear): Clear size_.
6118 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6119 (Chunked_vector::size): Return size_.
6120 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 6121 (Chunked_vector::size_): New data member.
1aa37384
DK
6122 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6123 (Stringpool_template::new_key_offset): New method declaration.
6124 (Stringpool_template::offset_): New data member.
6125
b672b057
RÁE
61262010-03-15 Rafael Espindola <espindola@google.com>
6127
6128 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6129 Add_symbols' constructor.
6130 * readsyms.h (Add_symbols): Remove the input_group member.
6131
b6848d3c
ILT
61322010-03-10 Ian Lance Taylor <iant@google.com>
6133
6134 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6135 target to ask whether a reference to a symbol requires a stack
6136 split.
6137 * target.h (Target::is_call_to_non_split): New function.
6138 (Target::do_is_call_to_non_split): Declare virtual function.
6139 * target.cc: Include "symtab.h".
6140 (Target::do_is_call_to_non_split): New function.
6141 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6142
a2a5469e
CC
61432010-03-10 Cary Coutant <ccoutant@google.com>
6144
6145 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6146 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6147 (File_read::open[2]): Add whole_file_view_ to list of views.
6148 (File_read::make_view): Remove test of whole_file_view_.
6149 (File_read::find_or_make_view): Create whole_file_view_ if
6150 necessary.
6151 (File_read::clear_views): Replace bool parameter with enum;
6152 adjust all callers. Don't delete views with permanent data;
6153 do delete cached views and views from archives if
6154 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6155 if clearing the corresponding view.
6156 * fileread.h (File_read::Clear_views_mode): New enum.
6157 (File_read::View::is_permanent_view): New method.
6158 (File_read::clear_views): Replace bool parameter
6159 with enum; adjust all callers.
6160 * options.h (General_options): Change keep_files_mapped option;
6161 add map_whole_files.
6162 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6163 releasing the file.
6164 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6165 the file.
6166
8861f32b
DM
61672010-03-10 David S. Miller <davem@davemloft.net>
6168
6169 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6170
d62d0f5f
ST
61712010-03-09 Sriraman Tallam <tmsriram@google.com>
6172
6173 * icf.cc (get_section_contents): Add '@' marker after processing the
6174 merge reloc.
6175
9177756d
DK
61762010-03-08 Doug Kwan <dougkwan@google.com>
6177
6178 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6179 due to a conversion warning.
6180 (Arm_relobj::update_output_local_symbol_count): Check for local
6181 symbol with unset output index.
6182
9e9e071b
ILT
61832010-03-05 Ian Lance Taylor <iant@google.com>
6184
6185 * options.h (class General_options): Add --spare-dynamic-tags.
6186 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6187 --spare-dynamic-tags.
6188
a81ee015
ILT
61892010-03-05 Ian Lance Taylor <iant@google.com>
6190
6191 * incremental.cc: Include "libiberty.h".
6192
44ec90b9
RO
61932010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6194
6195 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6196 function, is_info_ member.
6197 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6198 (Versions::Versions): Update caller.
6199 (Versions::define_base_version): Likewise.
6200 (Versions::add_def): Likewise.
6201
0897ed3b
ST
62022010-03-03 Sriraman Tallam <tmsriram@google.com>
6203
6204 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6205 (Scan::possible_function_pointer_reloc): New function.
6206 (Scan::local_reloc_may_be_function_pointer): Change to call
6207 possible_function_pointer_reloc.
6208 (Scan::global_reloc_may_be_function_pointer): Ditto.
6209 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6210 relocations in ".data.rel.ro._ZTV" section.
6211 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6212 * testsuite/icf_safe_so_test.cc: Ditto.
6213 * testsuite/icf_safe_test.cc: Ditto.
6214 * testsuite/icf_safe_test.sh: Ditto.
6215
d3bbad62
ILT
62162010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6217 Ian Lance Taylor <iant@google.com>
6218
6219 * target-reloc.h (relocate_section): Check the symbol table index
6220 for -1U before setting the local symbol index.
6221 (scan_relocatable_relocs): If copying the relocation, record that
6222 the local symbol is required.
6223 * object.h (Symbol_value::is_output_symtab_index_set): New
6224 function.
6225 (Symbol_value::may_be_discarded_from_output_symtab): New
6226 function.
6227 (Symbol_value::has_output_symtab_entry): New function.
6228 (Symbol_value::needs_output_symtab_entry): Remove.
6229 (Symbol_value::output_symtab_index): Make sure the symbol index is
6230 set.
6231 (Symbol_value::set_output_symtab_index): Make sure the symbol
6232 index is not set. Make sure the new index is valid.
6233 (Symbol_value::set_must_have_output_symtab_entry): New function.
6234 (Symbol_value::has_output_dynsym_entry): New function.
6235 (Symbol_value::set_output_dynsym_index): Make sure the new index
6236 is valid.
6237 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6238 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6239 local symbol if permitted.
6240 (Sized_relobj::do_finalize_local_symbols): Call
6241 is_output_symtab_index_set rather than needs_output_symtab_entry.
6242 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6243 rather than needs_output_symtab_entry. Call
6244 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6245 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6246 is_output_symtab_index_set rather than needs_output_symtab_entry.
6247 * testsuite/discard_locals_relocatable_test.c: New file.
6248 * testsuite/discard_locals_test.sh: Test -r.
6249 * testsuite/Makefile.am (check_DATA): Add
6250 discard_locals_relocatable_test1.syms,
6251 discard_local_relocatable_test2.syms.
6252 (MOSTLYCLEANFILES): Likewise. Also add
6253 discard_locals_relocatable_test1.lout and
6254 discard_locals_relocatable_test2.out.
6255 (discard_locals_relocatable_test1.syms): New target.
6256 (discard_locals_relocatable_test.o): New target.
6257 (discard_locals_relocatable_test1.out): New target.
6258 (discard_locals_relocatable_test2.syms): New target.
6259 (discard_locals_relocatable_test2.out): New target.
6260 (various): Add missing ../ld-new dependencies.
6261 * testsuite/Makefile.in: Rebuild.
6262
7e8ccf26
NC
62632010-03-03 Nick Clifton <nickc@redhat.com>
6264
6265 * po/fi.po: New Finnish translation.
6266
2a0ff005
DK
62672010-03-01 Doug Kwan <dougkwan@google.com>
6268
6269 * layout.cc (Layout::Layout): Force section types of .init_array*,
6270 .preinit_array* and .fini_array* sections.
6271 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6272 Fix check of return value of std::string::find.().
6273 (Output_section::Input_section_sort_compare::operator()): Remove
6274 comment about .init_array.
6275 (Output_section::Input_section_sort_init_fini_compare::operator()):
6276 New method.
6277 (Output_section::sort_attached_input_sections): Handle .init_array
6278 and .fini_array specially.
6279 * output.h (Output_section::Inut_section_sort_compare): Update
6280 comment.
6281 (Output_section::Input_section_sort_init_fini_compare): New struct.
6282
c3e4ae29
DK
62832010-02-26 Doug Kwan <dougkwan@google.com>
6284
6285 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6286 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6287 * testsuite/debug_msg.sh: Avoid matching source line number for
6288 use of global variable undef_int.
6289
2fd9ae7a
DK
62902010-02-26 Doug Kwan <dougkwan@google.com>
6291
6292 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6293 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6294 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6295 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6296 * options.cc (General_options::General_options): Initialize member
6297 fix_v4bx_.
6298 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6299 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6300 and rm_no_fix_v4bx.stdout
6301 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6302 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6303 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6304 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6305 and arm_no_fix_v4bx.
6306 * Makefile.in: Regenerate.
6307 * testsuite/arm_fix_v4bx.s: New file.
6308 * testsuite/arm_fix_v4bx.sh: Ditto.
6309
67ec7d0b
DK
63102010-02-24 Doug Kwan <dougkwan@google.com>
6311
6312 * arm.cc (Target_arm::got_section): Make the .got section the first
6313 non RELRO section in the data segment.
6314 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6315 suffixes of section names.
6316
10165461
DK
63172010-02-24 Doug Kwan <dougkwan@google.com>
6318
6319 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6320 flags and attributes merging if an input file is a binary file.
6321 * fileread.cc (Input_file::open): Record format of original file.
6322 * fileread.h (Input_file::Format): New enum type.
2e702c99 6323 (Input_file::Input_file): Initialize data member format_.
10165461
DK
6324 (Input_file::format): New method definition.
6325 (Input_file::format_):: New data member.
6326
4a54abbb
DK
63272010-02-24 Doug Kwan <dougkwan@google.com>
6328
6329 * arm.cc (Arm_output_data_got): New class.
6330 (ARM_TCB_SIZE): New constant
6331 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6332 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6333 If user uses a script with a SECTIONS clause, issue only a warning
6334 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 6335 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
6336 garbage collection.
6337 (Target_arm::got_mode_index_entry): Handle static linking.
6338 (Target_arm::Scan::local): Ditto.
6339 (Target_arm::Scan::global): Ditto.
6340 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6341 all incorrectly implemented relocations.
e1df38aa 6342 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
6343 Arm_output_section::fix_exidx_coverage.
6344 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6345 from ".ARM.exidx." and ".ARM.extab.".
6346
ca419a6f
ILT
63472010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6348
6349 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6350 section if it does not already exist.
6351 * attributes.cc (Attributes_section_data::Attributes_section_data):
6352 Don't crash if size is zero.
6353
135b9c78
ILT
63542010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6355 Ian Lance Taylor <iant@google.com>
6356
6357 * gold.cc (queue_middle_tasks): If no input files were opened,
6358 exit.
6359 * workqueue.h (Task_function::Task_function): Assert that there is
6360 a blocker.
6361
bb0bfe4f
DK
63622010-02-22 Doug Kwan <dougkwan@google.com>
6363
6364 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6365 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6366 types to avoid warnings due to different uint64_t implementations
6367 on different hosts.
6368
2a2b6d42
DK
63692010-02-21 Doug Kwan <dougkwan@google.com>
6370
6371 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6372 handling of the maximum backward branch offset.
2e702c99 6373 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
6374 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6375 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 6376 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
6377 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6378 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6379 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6380 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6381 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6382 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6383 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6384 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6385 thumb2_bl_out_of_range.o): New rules.
6386 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6387 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6388 thumb2_bl_out_of_range
6389 * testsuite/Makefile.in: Regenerate.
6390 * testsuite/arm_bl_in_range.s: New file.
6391 * testsuite/arm_bl_out_of_range.s: Ditto.
6392 * testsuite/arm_branch_in_range.sh: Ditto.
6393 * testsuite/arm_branch_range.t: Ditto.
6394 * testsuite/thumb2_branch_range.t: Ditto.
6395 * testsuite/thumb_bl_in_range.s: Ditto.
6396 * testsuite/thumb_bl_out_of_range.s: Ditto.
6397 * testsuite/thumb_branch_range.t: Ditto.
6398
b487ad64
ST
63992010-02-20 Sriraman Tallam <tmsriram@google.com>
6400
6401 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6402 Add reloc offset information.
6403 * icf.cc (get_section_contents): Change iterators to point to the new
6404 vectors. Add reloc offset information to the contents.
6405 * icf.h (Icf::Sections_reachable_info): New typedef.
6406 (Icf::Sections_reachable_list): New typedef.
6407 (Icf::Offset_info): New typedef.
6408 (Icf::Reloc_info): New struct typedef.
6409 (Icf::Reloc_info_list): New typedef.
6410 (Icf::symbol_reloc_list): Delete method.
6411 (Icf::addend_reloc_list): Delete method.
6412 (Icf::section_reloc_list): Delete method.
6413 (Icf::reloc_info_list): New method.
6414 (Icf::reloc_info_list_): New member.
6415
f96accdf
DK
64162010-02-19 Doug Kwan <dougkwan@google.com>
6417
6418 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6419 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6420 * arm.cc (Arm_relocation_functions): New forward declaration.
6421 (Target_arm::Target_arm): Initialize new data members
6422 got_mod_index_offset_ and tls_base_symbol_defined_.
6423 (Target_arm::Relocate::relocate_tls): New method.
6424 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6425 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6426 New methods.
2e702c99 6427 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
6428 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6429 (Target_arm::got_mod_index_offset_,
6430 Target_arm::tls_base_symbol_defined_): New data members.
6431 (Target_arm::Scan::local, Target::Scan::global,
6432 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6433 relocations.
6434
c8761b9a
DK
64352010-02-18 Doug Kwan <dougkwan@google.com>
6436
6437 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6438 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6439 text section as a parameter becuase some broken tools may not set
6440 the link in section header.
6441 (Target_arm::has_got_section): New method.
6442 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6443 without any mapping symbol as data only. Remove warning.
6444 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6445 link in its section header, try to discover the link by inspecting the
6446 REL31 relocation at the beginning of the section.
6447 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6448 in error message.
6449 (Target_arm::Scan::global): Treat any reference to the symbol
6450 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6451
21bb3914
ST
64522010-02-12 Sriraman Tallam <tmsriram@google.com>
6453
6454 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6455 (Scan::global_reloc_may_be_function_pointer): New function.
6456 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6457 (Scan::global_reloc_may_be_function_pointer): New function.
6458 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6459 (Scan::global_reloc_may_be_function_pointer): New function.
6460 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6461 (Scan::global_reloc_may_be_function_pointer): New function.
6462 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6463 (Scan::global_reloc_may_be_function_pointer): New function.
6464 (Scan::possible_function_pointer_reloc): New function.
6465 (Target_x86_64::can_check_for_function_pointers): New function.
6466 * gc.h (gc_process_relocs): Scan relocation types to determine if
6467 function pointers were taken for targets that support it.
6468 * icf.cc (Icf::find_identical_sections): Include functions for
6469 folding in safe ICF whose pointer is not taken.
6470 * icf.h (Secn_fptr_taken_set): New typedef.
6471 (fptr_section_id_): New member.
6472 (section_has_function_pointers): New function.
6473 (set_section_has_function_pointers): New function.
6474 (check_section_for_function_pointers): New function.
6475 * options.h: Fix comment for safe ICF option.
6476 * target.h (can_check_for_function_pointers): New function.
6477 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6478 Modify icf_safe_test for X86-64.
6479 * testsuite/Makefile.in: Regenerate.
6480 * testsuite/icf_safe_so_test.cc: New file.
6481 * testsuite/icf_safe_so_test.sh: New file.
6482 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6483 (main): Change to take pointer to function kept_func_3.
6484 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6485 folding is done correctly for X86-64.
6486
0da6fa6c
DM
64872010-02-12 David S. Miller <davem@davemloft.net>
6488
6489 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6490 is_symbolless parameter.
6491 (Output_reloc<SHT_REL>::is_symbolless): New.
6492 (Output_reloc<SHT_REL>::is_symbolless_): New.
6493 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6494 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6495 (Output_reloc<SHT_RELA>::is_symbolless): New.
6496 (Output_data_reloc::add_global): Handle is_symbolless.
6497 (Output_data_reloc::add_global_relative): Likewise.
6498 (Output_data_reloc::add_local): Likewise.
6499 (Output_data_reloc::add_local_relative): Likewise.
6500 (Output_data_reloc::add_symbolless_global_addend): New.
6501 (Output_data_reloc::add_symbolless_local_addend): New.
6502 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6503 is_symbolless.
6504 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6505 instead of ->is_relative_
6506 (Output_reloc::write): Likewise.
6507 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6508 (Output_reloc::write_rel): Simplify.
6509
6510 * sparc.cc (Target_sparc::Scan::local): Use
6511 ->add_symbolless_local_addend as needed.
6512 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6513 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6514 based upon relocation offset.
6515
e4782e83
DK
65162010-02-11 Doug Kwan <dougkwan@google.com>
6517
6518 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6519 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6520 beginning of function.
6521 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6522 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6523 parameter is_32bit in calls to should_apply_static_reloc.
6524 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6525 (check_DATA): Add arm_abs_global.stdout.
6526 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6527 arm_abs_global.stdout): New rules.
6528 (MOSTLLYCLEANFILES): Add arm_abs_global
6529 * Makefile.in: Regenerate.
6530 * testsuite/arm_abs_global.s: New file.
6531 * testsuite/arm_abs_global.sh: Ditto.
6532 * testsuite/arm_abs_lib.s: Ditto.
6533
93ceb764
ILT
65342010-02-11 Ian Lance Taylor <iant@google.com>
6535
6536 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6537 Read_relocs task.
6538 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6539 Allocate_commons_task first.
6540 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6541 task, rather than symtab_lock_.
6542 (Gc_process_relocs::~Gc_process_relocs): New function.
6543 (Gc_process_relocs::is_runnable): Check this_blocker_.
6544 (Gc_process_relocs::locks): Use next_blocker_ rather than
6545 blocker_.
6546 (Scan_relocs::~Scan_relocs): New function.
6547 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6548 symtab_lock_.
6549 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6550 next_blocker_.
6551 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6552 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6553 constructor accordingly.
6554 (class Gc_process_relocs): Likewise.
6555 (class Scan_relocs): Likewise.
6556 * common.h (class Allocate_commons_task): Remove symtab_lock_
6557 field, and corresponding constructor parameter.
6558 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6559 symtab_lock_.
6560 (Allocate_commons_task::locks): Likewise.
6561
114dfbe1
ILT
65622010-02-11 Ian Lance Taylor <iant@google.com>
6563
6564 * gold-threads.h (class Once): Define.
6565 (class Initialize_lock): Rewrite as child of Once.
6566 * gold-threads.cc (class Once_initialize): Define.
6567 (once_pointer_control): New static variable.
6568 (once_pointer, once_arg): New static variables.
6569 (c_run_once): New static function.
6570 (Once::Once, Once::run_once, Once::internal_run): New functions.
6571 (class Initialize_lock_once): Remove.
6572 (initialize_lock_control): Remove.
6573 (initialize_lock_pointer): Remove.
6574 (initialize_lock_once): Remove.
6575 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6576 (Initialize_lock::initialize): Rewrite.
6577 (Initialize_lock::do_run_once): New function.
6578 * archive.cc (Archive::interpret_header): Only clear name if it is
6579 not already empty.
6580 * fileread.cc: Include "gold-threads.h"
6581 (file_counts_lock): New static variable.
6582 (file_counts_initialize_lock): Likewise.
6583 (File_read::release): Only increment counts when using --stats.
6584 Use a lock around the increment.
6585 * parameters.cc (class Set_parameters_target_once): Define.
6586 (set_parameters_target_once): New static variable.
6587 (Parameters::Parameters): Move here from parameters.h.
6588 (Parameters::set_target): Rewrite.
6589 (Parameters::set_target_once): New function.
6590 (Parameters::clear_target): Move here and rewrite.
6591 * parameters.h (class Parameters): Update declarations. Add
6592 set_parameters_target_once_ field.
6593 (Parameters::Parameters): Move to parameters.cc.
6594 (Parameters::clear_target): Likewise.
6595 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6596 task.
6597 (Start_group::~Start_group): New function.
6598 (Start_group::is_runnable): New function.
6599 (Start_group::locks, Start_group::run): New functions.
6600 (Finish_group::run): Change saw_undefined to size_t.
6601 * readsyms.h (class Start_group): Define.
6602 (class Finish_group): Change saw_undefined_ field to size_t.
6603 (Finish_group::Finish_group): Remove saw_undefined and
6604 this_blocker parameters. Change all callers.
6605 (Finish_group::set_saw_undefined): New function.
6606 (Finish_group::set_blocker): New function.
6607 * symtab.h (class Symbol_table): Change saw_undefined to return
6608 size_t. Change saw_undefined_ field to size_t.
6609 * target-select.cc (Set_target_once::do_run_once): New function.
6610 (Target_selector::Target_selector): Initialize set_target_once_
6611 field. Don't initialize lock_ and initialize_lock_ fields.
6612 (Target_selector::instantiate_target): Rewrite.
6613 (Target_selector::set_target): New function.
6614 * target-select.h (class Set_target_once): Define.
6615 (class Target_selector): Update declarations. Make
6616 Set_target_once a friend. Remove lock_ and initialize_lock_
6617 fields. Add set_target_once_ field.
6618
fa17a3f4
ILT
66192010-02-10 Ian Lance Taylor <iant@google.com>
6620
6621 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6622 queueing any tasks.
6623 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6624 (queue_middle_tasks): Add all blockers before queueing any tasks.
6625 (queue_final_tasks): Likewise.
6626 * token.h (Task_token::add_blockers): New function.
6627 * object.h (Input_objects::number_of_relobjs): New function.
6628
c7177d31
ILT
66292010-02-10 Ian Lance Taylor <iant@google.com>
6630
5de0e392
ILT
6631 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6632 shared, not if not position independent.
6633 * x86_64.cc (Relocate::relocate_tls): Likewise.
6634 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6635 (tls_pie_pic_test): New target.
6636 * testsuite/Makefile.in: Rebuild.
6637
c7177d31
ILT
6638 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6639 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6640 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6641 * testsuite/Makefile.in: Rebuild.
6642
684b268a
DM
66432010-02-09 David S. Miller <davem@davemloft.net>
6644
6645 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6646 R_SPARC_RELATIVE using ->add_local_relative().
6647 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6648
612a8d3d
DM
6649 * output.h (Output_data_dynamic::add_section_size): New method
6650 that takes two Output_data objects.
6651 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6652 entry param. Handle it in initializers.
6653 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6654 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6655 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6656 arg.
6657 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6658 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6659 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6660 for dynrel_includes_plt.
6661 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6662 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6663 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6664 before .rela.plt
6665 (Target_sparc::do_finalize_sections): Update to pass true for
6666 dynrel_includes_plt.
6667 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6668 output before .rela.plt
6669 (Target_powerpc::do_finalize_sections): Update to pass true for
6670 dynrel_includes_plt when 32-bit.
6671
cb1be87e
DK
66722010-02-08 Doug Kwan <dougkwan@google.com>
6673
6674 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6675 method.
6676 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6677 Arm_relobj::scan_section_for_cortex_a8_stubs,
6678 Arm_relobj::do_relocation_section): Instead of calling
6679 Output_section::output_address, use faster
6680 Arm_relobj::simple_input_section_output_address.
6681
705b5121
DM
66822010-02-08 David S. Miller <davem@davemloft.net>
6683
6684 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6685 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6686 relocation helper function.
6687
024c4466
DM
6688 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6689 just like R_SPARC_GOT{10,13,22}.
6690 (Target_sparc::Scan::local): Likewise.
6691 (Target_sparc::Relocate:relocate): Likewise.
6692
9109c078
ILT
66932010-02-06 Ian Lance Taylor <iant@google.com>
6694
6695 * configure.ac: Rewrite targetobjs duplicate removal code to use
6696 only shell constructs.
6697 * configure: Rebuild.
6698
cf846138
DK
66992010-02-05 Doug Kwan <dougkwan@google.com>
6700
6701 PR 11247
6702 * arm.cc (Arm_relobj::section_is_scannable): New method.
6703 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6704 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6705
6cfaf60b
DK
67062010-02-04 Doug Kwan <dougkwan@google.com>
6707
6708 PR 11247
6709 * arm-reloc-property.cc (cstdio): Include.
6710 * configure.ac (targetobjs): Remove duplicates.
6711 * configure: Regenerate.
6712 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6713 big and little endian version for a given address size.
6714
5c57f1be
DK
67152010-02-03 Doug Kwan <dougkwan@google.com>
6716
6717 * arm-reloc-property.cc
6718 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6719 definition.
6720 * arm-reloc-property.h
6721 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6722 New method definition.
6723 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6724 declaration.
6725 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6726 overflow to N.
6727 (GOT_PREL): Change implemented to Y.
6728 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6729 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6730 (Arm_relocate_functions::movw_abs_nc): Remove method.
6731 (Arm_relocate_functions::movt_abs): Ditto.
6732 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6733 (Arm_relocate_functions::thm_movt_abs): Ditto.
6734 (Arm_relocate_functions::movw_rel_nc): Ditto.
6735 (Arm_relocate_functions::movw_rel): Ditto.
6736 (Arm_relocate_functions::movt_rel): Ditto.
6737 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6738 (Arm_relocate_functions:thm_movw_rel): Ditto.
6739 (Arm_relocate_functions:thm_movt_rel): Ditto.
6740 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6741 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6742 New method definitions.
6743 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6744 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6745 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6746 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6747 (Target_arm::Relocate::relocate): Check for non-static or
6748 unimplemented relocation code and exit early. Change calls to
6749 Target_arm::reloc_uses_thumb_bit and
6750 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6751 instead. Refactor code to handle similar relocations to increase
6752 code sharing. Remove check for unsupported relocation code in switch
6753 statement.
6754 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6755 relocation property table to find out size. Change error message to
6756 print out the name of a relocation code instead of the numeric value.
6757 (Target_arm::scan_reloc_for_stub): Use relocation property table
6758 instead of calling Target_arm::reloc_uses_thumb_bit().
6759
218c5831
DK
67602010-02-02 Doug Kwan <dougkwan@google.com>
6761
6762 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6763 types of relaxed input section.
6764
0d31c79d
DK
67652010-02-02 Doug Kwan <dougkwan@google.com>
6766
6767 * Makefile.am (HFILES): Add arm-reloc-property.h.
6768 (DEFFILES): New.
2e702c99
RM
6769 (TARGETSOURCES): Add arm-reloc-property.cc
6770 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
6771 (libgold_a_SOURCES): $(DEFFILES)
6772 * Makefile.in: Regenerate.
6773 * arm-reloc-property.cc: New file.
6774 * arm-reloc-property.h: New file.
6775 * arm-reloc.def: New file.
6776 * arm.cc: Update comments.
6777 (arm-reloc-property.h): New included header.
6778 (arm_reloc_property_table): New global variable.
6779 (Target_arm::do_select_as_default_target): New method definition.
6780 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6781 arm-reloc-property to targ_extra_obj.
6782 * parameters.cc (set_parameters_target): Call
6783 Target::select_as_default_target().
6784 * target.h (Target::select_as_default_target): New method definition.
6785 (Target::do_select_as_default_target): Same.
6786
546c7457
DK
67872010-02-01 Doug Kwan <dougkwan@google.com>
6788
6789 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6790 first_output_text_section_.
6791 (Arm_exidx_fixup::first_output_text_section): New method definition.
6792 (Arm_exidx_fixup::first_output_text_section_): New data member.
6793 (Arm_exidx_fixup::process_exidx_section): Record the first text
6794 output section seen.
6795 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6796 and entsize in output section header.
6797
11b861d5
DK
67982010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6799
6800 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6801 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6802 (Arm_relocate_functions::thm_alu11): New Method.
6803 (Arm_relocate_functions::thm_pc8): New Method.
6804 (Arm_relocate_functions::thm_pc12): New Method.
6805 (Target_arm::Scan::local): Handle the relocations.
6806 (Target_arm::Scan::global): Likewise.
6807 (Target_arm::Relocate::relocate): Likewise.
6808 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6809
c9a2c125
DK
68102010-01-29 Doug Kwan <dougkwan@google.com>
6811
6812 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6813 of relocation types as ld.
6814
1521477a
DK
68152010-01-29 Doug Kwan <dougkwan@google.com>
6816
6817 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6818 to public.
6819 (Arm_relocate_functions::thumb_branch_common): Ditto.
6820 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6821 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6822 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6823 Arm_relocate_functions::jump24): Remove.
6824 (Target_arm::Relocate::relocate): Adjust code to call
6825 Arm_relocation_functions::arm_branch_common and
6826 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 6827 wrappers. Merge switch-cases together to reduce source code size.
1521477a 6828
e7eca48c
DK
68292010-01-29 Doug Kwan <dougkwan@google.com>
6830
6831 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6832 output_local_symbol_count_needs_update_.
6833 (Arm_relobj::output_local_symbol_count_needs_update,
6834 Arm_relobj::set_output_local_symbol_count_needs_update,
6835 Arm_relobj::update_output_local_symbol_count): New methods.
6836 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6837 member.
6838 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6839 of pointed function as in a R_ARM_PREL31 relocation.
6840 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6841 for output local symbol count updating.
6842 (Target_arm::do_relax): Update output local symbol counts in objects
6843 if necessary.
6844 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6845
02961d7e
ILT
68462010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6847
6848 * arm.cc: Added support for the ARM relocations:
6849 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6850 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6851 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6852 movw_prel_nc).
6853 (Arm_relocate_functions::movw_rel): New method.
6854 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6855 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6856 thm_movw_prel_nc).
6857 (Arm_relocate_functions::thm_movw_rel): New method.
6858 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6859 thm_movt_prel).
6860 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6861 relocations.
6862 (Target_arm::Scan::global): Likewise.
6863 (Target_arm::Relocate::relocate): Likewise.
6864 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6865 Likewise.
6866
b10d2873
ILT
68672010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6868
6869 * arm.cc: Added support for ARM group relocations.
6870 (Target_arm::reloc_needs_sym_origin): New method.
6871 (Arm_relocate_functions::calc_grp_kn): New method.
6872 (Arm_relocate_functions::calc_grp_residual): New method.
6873 (Arm_relocate_functions::calc_grp_gn): New method.
6874 (Arm_relocate_functions::arm_grp_alu): New Method.
6875 (Arm_relocate_functions::arm_grp_ldr): New Method.
6876 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6877 (Arm_relocate_functions::arm_grp_ldc): New Method.
6878 (Target_arm::Scan::local): Handle the ARM group relocations.
6879 (Target_arm::Scan::global): Likewise.
6880 (Target_arm::Relocate::relocate): Likewise.
6881 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6882 Likewise.
6883
2b328d4e
DK
68842010-01-26 Doug Kwan <dougkwan@google.com>
6885
6886 * arm.cc (set): Include.
6887 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6888 pointer type.
2e702c99 6889 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
6890 (Arm_output_section::append_text_sections_to_list): New method.
6891 (Arm_output_section::fix_exidx_coverage): Ditto.
6892 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 6893 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
6894 Relobj::set_section_offset() instead of
6895 Sized_relobj::invalidate_section_offset().
2e702c99 6896 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
6897 parameter for section headers. Ignore relocation sections for
6898 unallocated sections and EXIDX sections.
6899 (Target_arm::fix_exidx_coverage): New method.
6900 (Target_arm::output_section_address_less_than): New type.
6901 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6902 linked text section instead of the EXIDX section.
6903 (Arm_output_section::create_stub_group): Add an assertion to check
6904 that this is not an EXIDX output section.
6905 (Arm_output_section::append_text_sections_to_list): New method.
6906 (Arm_output_section::fix_exidx_coverage): Ditto.
6907 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 6908 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
6909 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6910 first pass.
6911 (Target_arm::fix_exidx_coverage): New method.
6912 * object.h (Relobj::set_output_section): New method.
6913 (Sized_relobj::invalidate_section_offset): Remove method.
6914 (Sized_relobj::do_invalidate_section_offset): Remove method.
6915 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6916
c7f3c371
DK
69172010-01-25 Doug Kwan <dougkwan@google.com>
6918
6919 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6920 Fix warning due to signed and unsigned comparison on a 32-bit host.
6921
8923b24c
DK
69222010-01-22 Doug Kwan <dougkwan@google.com>
6923
6924 * arm.cc (Target_arm::do_relax): Record an output section for section
6925 offset adjustment it contains any stub table that has changed.
6926 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6927 offsets in an output section if necessary.
6928 * output.cc (Output_section::Output_section): Initialize
6929 section_offsets_need_adjustments_.
6930 (Output_section::add_input_section_for_script): Renamed to
6931 Output_section::add_simple_input_section.
6932 (Output_section::save_states): Add a comment.
6933 (Output_section::discard_states): New method defintion.
6934 (Output_section::adjust_section_offsets): Same.
6935 * output.h (Output_section::add_input_section_for_script): Renamed to
6936 Output_section::add_simple_input_section.
6937 (Output_section::discard_states): New method declaration.
6938 (Output_section::adjust_section_offsets): Same.
6939 (Output_section::section_offsets_need_adjustment,
6940 Output_section::set_section_offsets_need_adjustment): New method
6941 definitions.
6942 (Output_section::section_offsets_need_adjustment_): New data member.
6943 * script-sections.cc
6944 (Output_section_element_input::set_section_address): Adjust code for
6945 renaming of Output_section::add_input_section_for_script.
6946 (Orphan_output_section::set_section_address): Same.
6947
9b2fd367
DK
69482010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6949
6950 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6951 Fix_v4bx enum values .
6952 * gold/options.h (General_options): New option definitions.
6953 (General_options::fix_v4bx): New method.
6954 (General_options::Fix_v4bx): New enum.
6955 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6956 (General_options::parse_fix_v4bx_interworking): New method.
6957
80d0d023
DK
69582010-01-22 Doug Kwan <dougkwan@google.com>
6959
6960 * arm.cc (Arm_exidx_fixup): New class.
6961
af2cdeae
DK
69622010-01-21 Doug Kwan <dougkwan@google.com>
6963
6964 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6965 classes.
6966 (Arm_exidx_section_offset_map): New type.
6967
993d07c1
DK
69682010-01-21 Doug Kwan <dougkwan@google.com>
6969
6970 * arm.cc (Arm_exidx_input_section): New class.
6971 (Arm_relobj::exidx_input_section_by_link,
6972 Arm_relobj::exidx_input_section_by_shndx,
6973 Arm_relobj::make_exidx_input_section): New methods.
6974 (read_arm_attributes_section): Remove.
6975 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6976 information about them.
6977 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6978 to here.
6979
5ac169d4
DK
69802010-01-20 Doug Kwan <dougkwan@google.com>
6981
6982 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6983 Input_section_specifier to Section_id.
6984 (Target_arm::new_arm_input_section: Adjust code for change of key
6985 type.
6986 (Target_arm::find_arm_input_section): Ditto.
6987 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6988 (Section_id): Remove.
6989 (Garbage_collection::Section_id_hash): Remove.
6990 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6991 (Section_id): Remove.
6992 (Icf::Section_id_hash): Remove.
6993 * object.h (Section_id, Const_section_id, Section_id_hash,
6994 Const_section_id_hash): New type definitions.
6995 * output.cc (Output_section::add_relaxed_input_section): Change to
6996 use Const_section_id instead of Input_section_specifier as key type.
6997 (Output_section::add_merge_input_section): Ditto.
6998 (Output_section::build_relaxation_map): Change to use Section_id
6999 instead of Input_section_specifier as key type.
2e702c99 7000 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
7001 Ditto.
7002 (Output_section::convert_input_sections_to_relaxed_sections): Change
7003 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 7004 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
7005 (Output_section::find_relaxed_input_section): Ditto.
7006 * output.h (Input_section_specifier): Remove class.
7007 (Output_section::Output_section_data_by_input_section_map): Change
7008 key type to Const_section_id.
7009 (Output_section::Output_relaxed_input_section_by_input_section_map):
7010 Ditto.
7011 (Output_section::Relaxation_map): Change key type to Section_id.
7012
a2162063
ILT
70132010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7014
7015 * gold/arm.cc: Added support for R_ARM_V4BX relocation
7016 (class Arm_v4bx_stub): New class.
7017 (DEF_STUBS): Updated definition to support v4_veneer_bx.
7018 (Stub_factory::make_arm_v4bx_stub): New method.
7019 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
7020 (Stub_table::empty): Handle v4bx stubs.
7021 (Stub_table::add_arm_v4bx_stub): New method.
7022 (Stub_table::find_arm_v4bx_stub): New method.
7023 (Arm_relocate_functions::v4bx): New method.
7024 (Target_arm::fix_v4bx): New method.
7025 (Target_arm::Target_arm): Handle R_ARM_V4BX.
7026 (Stub_table::relocate_stubs): Likewise.
7027 (Stub_table::do_write): Likewise.
7028 (Stub_table::update_data_size_and_addralign): Likewise.
7029 (Stub_table::finalize_stubs): Likewise.
7030 (Target_arm::Scan::local): Likewise.
7031 (Target_arm::Scan::global): Likewise.
7032 (Target_arm::do_finalize_sections): Likewise.
7033 (Target_arm::Relocate::relocate): Likewise.
7034 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7035 Likewise.
7036 (Target_arm::scan_reloc_for_stub): Likewise.
7037 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7038
5696ab0b
ILT
70392010-01-19 Ian Lance Taylor <iant@google.com>
7040
7041 * output.cc (Output_section_headers::do_sized_write): Write large
7042 segment count to sh_info field.
7043 (Output_file_header::do_sized_write): For large segment count,
7044 write PN_XNUM to e_phnum field.
7045
800d0f56
ILT
70462010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7047
7048 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
7049 (Arm_relocate_functions::thm_jump8): New function.
7050 (Arm_relocate_functions::thm_jump11): New function.
7051 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
7052 R_ARM_THM_JUMP11.
7053 (Target_arm::Scan::global): Likewise.
7054 (Target_arm::Relocate::relocate): Likewise.
7055 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7056 Likewise.
7057
41263c05
DK
70582010-01-14 Doug Kwan <dougkwan@google.com>
7059
7060 * arm.cc (map, utility): Include headers.
7061 (Target_arm::apply_cortex_a8_workaround): New method.
7062 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
7063 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
7064 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
7065 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
7066 the --[no-]fix-cortex-a8 command line options.
7067 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
7068 (Target_arm::relocate_stub): Use addend in instruction template.
7069 * options.h (DEFINE_bool): Set the user-set flag.
7070 (General_options): Add --[no-]-fix-cortex options.
7071 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 7072 : Update fast look-up map after conversion.
41263c05 7073
459e9b03
ST
70742010-01-14 Sriraman Tallam <tmsriram@google.com>
7075
7076 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
7077 in the first pass of do_layout.
7078
b521dfe4
DK
70792010-01-13 Doug Kwan <dougkwan@google.com>
7080
7081 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7082 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
7083 apparent compiler problem of not folding static constant integral
7084 data members of elfcpp::Elf_sizes<32>.
7085
44272192
DK
70862010-01-13 Doug Kwan <dougkwan@google.com>
7087
7088 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7089 Arm_relobj::section_needs_cortex_a8_stub_scanning,
7090 Arm_relobj::scan_section_for_cortex_a8_erratum,
7091 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7092 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7093 sections to scan for relocation stubs into a new method
7094 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7095 relocation and Cortex-A8 stub scanning.
7096 (Target_arm::do_relax): Force stubs to be after stubbed sections
7097 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 7098 the beginning of a new relaxation pass. Update a comment.
44272192
DK
7099 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7100
44b71ece
ILT
71012010-01-12 Ian Lance Taylor <iant@google.com>
7102
7103 * target-reloc.h (visibility_error): New inline function.
7104 (relocate_section): Call visibility_error.
7105 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7106 (MOSTLYCLEANFILES): Likewise.
7107 (protected_4_pic.o, protected_3.err): New targets.
7108 * testsuite/protected_4.cc: New file.
7109
a120bc7f
DK
71102010-01-12 Doug Kwan <dougkwan@google.com>
7111
7112 * arm.cc (Cortex_a8_reloc): New class.
7113 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7114 and cortex_a8_relocs_info_.
7115 (Target_arm::fix_cortex_a8): New method definition.
7116 (Target_arm::Cortex_a8_relocs_info): New type.
7117 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7118 New data member declarations.
7119 (Target_arm::scan_reloc_for_stub): Record information about
7120 relocations for THUMB branches that might be exempted from the
7121 Cortex-A8 workaround.
7122 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7123 at the beginning of a relaxation pass.
7124
20138696
DK
71252010-01-12 Doug Kwan <dougkwan@google.com>
7126
7127 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7128 (Arm_relobj::Mapping_symbol_position,
7129 Arm_reloj::Mapping_symbol_position_less,
7130 Arm_relobj::Mapping_symbols_info): New types.
7131 (Target_arm::is_mapping_symbol_name): New method definition.
7132 (Arm_relobj::do_count_local_symbols): Save information about mapping
7133 symbols.
7134
089d69dc
DK
71352010-01-11 Doug Kwan <dougkwan@google.com>
7136
7137 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7138 Arm_relocate_functions::thumb32_branch_upper,
7139 Arm_relocate_functions::thumb32_branch_lower,
7140 Arm_relocate_functions::thumb32_cond_branch_offset,
7141 Arm_relocate_functions::thumb32_cond_branch_upper,
7142 Arm_relocate_functions::thumb32_cond_branch_lower,
7143 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7144 branch offset encoding.
7145 (Arm_relocate_functions::thumb_branch_common): Use new branch
7146 offset encoding methods to avoid code duplication.
7147 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7148 (Stub_addend_reader::operator()): Use new branch encoding method
7149 to avoid code duplication.
7150
99e5bff2
DK
71512010-01-11 Doug Kwan <dougkwan@google.com>
7152
7153 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7154 (Target_arm::do_finalize_sections): Define special EXIDX section
7155 symbols only if referenced.
7156 * gc.h (Garbage_collection::add_reference): New method.
7157 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7158 code duplication.
7159
98e090bd
ILT
71602010-01-11 Ian Lance Taylor <iant@google.com>
7161
d0a91bd8
ILT
7162 * script.cc (Version_script_info::build_expression_list_lookup):
7163 Change complaing about duplicate wildcard match from error to
7164 warning.
7165
98e090bd
ILT
7166 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7167 of 2009-12-30.
7168 (Version_script_info::Version_script_info): Initialize globs_,
7169 default_version_, default_is_global_, and exact_. Don't
7170 initialize globals_ or locals_.
7171 (Version_script_info::build_lookup_tables): Build local symbols
7172 first.
7173 (Version_script_info::unquote): New function.
7174 (Version_script_info::add_exact_match): New function.
7175 (Version_script_info::build_expression_list_lookup): Remove lookup
7176 parameter. Add is_global parameter. Change all callers. Handle
7177 wildcard pattern specially. Unquote pattern. Call
7178 add_exact_match.
7179 (Version_script_info::get_name_to_match): New function.
7180 (Version_script_info::get_symbol_version): New function.
7181 (Version_script_info::get_symbol_version_helper): Remove.
7182 (Version_script_info::check_unmatched_names): Call unquote.
7183 * script.h (class Version_script_info): Change get_symbol_version
7184 to be non-inline and add is_global parameter; change all callers.
7185 Rewrite symbol_is_local. Update declarations. Define struct
7186 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7187 Remove globals_ and locals_ members. Add exact_, globs_,
7188 default_version_, is_global_.
7189 (Version_script_info::Glob): Remove pattern, add expression and
7190 is_global. Update constructor. Change all callers.
7191 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7192 default version.
7193 (Versions::symbol_section_contents): If a symbol is undefined, or
7194 defined in a dynamic object, set the version index to
7195 VER_NDX_LOCAL.
7196 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7197 symbol_is_local.
7198 (Symbol_table::add_from_pluginobj): Likewise.
7199 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7200
d56962d3
DK
72012010-01-11 Doug Kwan <dougkwan@google.com>
7202
7203 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7204 (incremental_dump_LDADD): Add linking option for libintl.
7205 * Makefile.in: Regenerate.
7206
94e6ee91
L
72072010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7208
7209 PR gold/11144
7210 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7211 instead of -Ds.
7212 * testsuite/Makefile.in: Regenerated.
7213
e96c574b
DK
72142010-01-10 Doug Kwan <dougkwan@google.com>
7215
7216 * options.h (DEFINE_var): Use parentheses around argument varname__
7217 in macro body to avoid any unintended subsequent substitutions.
7218
7198066b
ILT
72192010-01-10 Ian Lance Taylor <iant@google.com>
7220
ba4d53bf
ILT
7221 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7222 candidates before doing symbol resolution.
7223
7198066b
ILT
7224 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7225 ODR candidates if only one is weak.
7226
a2beed37
ILT
72272010-01-08 Ian Lance Taylor <iant@google.com>
7228
7229 * script.cc (Version_script_info::build_expression_list_lookup):
7230 Don't warn about ambiguous version, just record the ambiguity.
7231 (Version_script_info::get_symbol_version_helper): Give error if
7232 version is ambiguous.
7233
2fb7225c
DK
72342010-01-08 Doug Kwan <dougkwan@google.com>
7235
7236 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7237 prev_data_size_ and prev_addralign_. Remove initializer for
7238 deleted data member has_been_changed_.
7239 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7240 to determine if the table is empty.
7241 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7242 Remove.
7243 (Stub_table::add_reloc_stub): Define method in class definition
7244 instead of just declaring it there.
7245 (Stub_table::add_cortex_a8_stub): New method definition.
7246 (Stub_table::update_data_size_and_addralign): Ditto.
7247 (Stub_table::finalize_stubs): Ditto.
7248 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7249 (Stub_table::do_addralign_): Return address alignment in the
7250 (Stub_table::do_reset_address_and_file_offset): Define method in
7251 class definition instead of declaring it there. Set current data
7252 size to be the data size of the previous pass.
7253 (Stub_table::set_final_data_size): Use current data size as the
7254 final data size.
7255 (Stub_table::relocate_stub): Change parameter type of stub from
7256 Reloc_stub pointer to Stub pointer.
7257 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7258 (Stub_table::Cortex_a8_stub_list): New typedef.
7259 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7260 Stub_table::prev_addralign_): New data member.
7261 (Arm_relobj::Arm_relobj): Initialize data member
7262 section_has_cortex_a8_workaround_.
7263 (Arm_relobj::section_has_cortex_a8_workaround,
7264 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7265 definitions.
7266 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7267 declarations.
7268 (Target_arm::relocate_stub): Change parameter type of stub from
7269 Reloc_stub pointer to Stub pointer.
7270 (Insn_template::size, Insn_template::alignment): Handle
7271 THUMB16_SPECIAL_TYPE.
7272 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7273 Stub_table::update_data_size_and_addralign,
7274 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7275 definitions.
2e702c99 7276 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
2fb7225c
DK
7277 (Stub_table::do_write): Ditto.
7278 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7279
880cd20d
ILT
72802010-01-08 Ian Lance Taylor <iant@google.com>
7281
7282 PR 11108
7283 * symtab.h (class Symbol): Remove fields is_target_special_ and
7284 has_plt_offset_. Add field is_defined_in_discarded_section_.
7285 (Symbol::is_defined_in_discarded_section): New function.
7286 (Symbol::set_is_defined_in_discarded_section): New function.
7287 (Symbol::has_plt_offset): Rewrite.
7288 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7289 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7290 Don't initialize is_target_special_ or has_plt_offset_.
7291 Initialize is_defined_in_discarded_section_.
7292 (Symbol_table::add_from_relobj): If appropriate, set
7293 is_defined_in_discarded_section.
7294 * resolve.cc (Symbol::override_base_with_special): Don't test
7295 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7296 * target-reloc.h (relocate_section): Do special handling for
7297 symbols defined in discarded sections for global symbols as well
7298 as local symbols.
7299
2703e3eb
ILT
73002010-01-08 Ian Lance Taylor <iant@google.com>
7301
7302 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7303 the SHT_SYMTAB case.
7304
339d40a3
ILT
73052010-01-08 Ian Lance Taylor <iant@google.com>
7306
7307 * object.cc (Sized_relobj::do_layout): Don't get confused if
7308 layout_eh_frame returns NULL.
7309
abecea76
ILT
73102010-01-08 Ian Lance Taylor <iant@google.com>
7311
7312 PR 11084
7313 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7314 dynamic symbol table, use the normal symbol table.
7315 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7316 symbol table.
7317
6b7dd3f3
ILT
73182010-01-08 Ian Lance Taylor <iant@google.com>
7319
7320 PR 11072
7321 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7322 sections.
7323
36c50e63
L
73242010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7325
7326 * version.cc (print_version): Change to "Copyright 2010".
7327
e291e7b9
ILT
73282010-01-08 Ian Lance Taylor <iant@google.com>
7329
7330 PR 10287
7331 PR 11063
7332 * i386.cc (class Target_i386): Change return type of plt_section
7333 to be non-const.
7334 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7335 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7336 tls_desc_rel_ field.
7337 (Output_data_plt_i386::rel_tls_desc): New function.
7338 (Target_i386::rel_tls_desc_section): New function.
7339 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7340 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7341 R_386_TLS_DESC reloc in rel_tls_desc_section.
7342 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7343 Define struct Tlsdesc_info.
7344 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7345 (Target_x86_64::do_reloc_symbol_index): New function.
7346 (Target_x86_64::add_tlsdesc_info): New function.
7347 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7348 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7349 tlsdesc_rel_ field.
7350 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7351 all callers.
7352 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7353 (Target_x86_64::rela_tlsdesc_section): New function.
7354 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7355 handling.
7356 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7357 (Target_x86_64::do_reloc_addend): New function.
7358 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7359 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7360 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7361 (Output_reloc::type): New function.
7362 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7363 (Output_reloc::is_target_specific): New function.
7364 (Output_reloc::target_arg): New function.
7365 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7366 absolute relocs and target specific relocs.
7367 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7368 add_target_specific.
7369 (class Output_data_reloc) [SHT_RELA]: Likewise.
7370 * output.cc (Output_reloc::Output_reloc): Add four new versions
7371 for absolute relocs and target specific relocs.
7372 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7373 (Output_reloc::get_symbol_index): Likewise.
7374 (Output_reloc::local_section_offset): Check that local_sym_index_
7375 is not TARGET_CODE or 0.
7376 (Output_reloc::symbol_value): Likewise.
7377 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7378 reloc.
7379 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7380 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7381 functions.
7382 * layout.cc (add_target_dynamic_tags): Use output section for
7383 DT_PLTRELSZ and DT_JMPREL.
7384
3a44184e
ILT
73852010-01-07 Ian Lance Taylor <iant@google.com>
7386
7387 PR 11061
7388 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7389 function.
7390 (class Output_data_reloc_generic): Define.
7391 (class Output_data_reloc_base): Change base class to
7392 Output_data_reloc_generic. Change add() method to call
7393 bump_relative_reloc_count for a relative reloc. Remove
7394 sort_relocs_ field.
7395 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7396 to sort_relocs().
7397 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7398 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7399 appropriate.
7400 * layout.h (class Layout): Update declaration.
7401
ea715a34
ILT
74022010-01-07 Ian Lance Taylor <iant@google.com>
7403
7404 * output.h (class Output_data): Add const version of
7405 output_section and do_output_section.
7406 (class Output_section_data): Add const version of
7407 do_output_section.
7408 (class Output_section): Likewise.
7409 * layout.cc (Layout::add_target_dynamic_tags): New function.
7410 * layout.h (class Layout): Update declarations.
7411 * arm.cc (Target_arm::do_finalize_sections): Use
7412 add_target_dynamic_tags.
7413 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7414 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7415 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7416 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7417
659948a4
ILT
74182010-01-07 Ian Lance Taylor <iant@google.com>
7419
7420 PR 11042
7421 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7422 object as needed.
7423
9d3b86f6
ILT
74242010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7425 Ian Lance Taylor <iant@google.com>
7426
7427 PR 11019
7428 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7429 Xindex::read_symtab_xindex.
7430
bb0d3eb0
DK
74312010-01-07 Doug Kwan <dougkwan@google.com>
7432
7433 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7434 (Insn_template::thumb16_bcond_insn): New method declaration.
7435 (Insn_template): Fix spelling.
7436 (Stub::thumb16_special): New method declaration.
7437 (Stub::do_write): Define virtual method which was previously pure
7438 virtual.
7439 (Stub::do_thumb16_special): New method declaration.
7440 (Stub::do_fixed_endian_write): New template member.
7441 (Reloc_stub::do_write): Remove.
7442 (Reloc_stub::do_fixed_endian_write): Remove.
7443 (Cortex_a8_stub): New class definition.
7444 (Stub_factory::make_cortex_a8_stub): New method definition.
7445 (Stub_factory::Stub_factory): Add missing static storage class
7446 qualifier for elf32_arm_stub_a8_veneer_blx.
7447
ffeef7df
ILT
74482010-01-07 Ian Lance Taylor <iant@google.com>
7449
dc3f80fe
ILT
7450 PR 10980
7451 * options.h (class General_options): Add --warn-unresolved-symbols
7452 and --error-unresolved-symbols.
7453 * errors.cc (Errors::undefined_symbol): Implement
7454 --warn-unresolved-symbols.
7455
ffeef7df
ILT
7456 * options.h (class General_options): Add -z text and -z textoff.
7457 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7458
f1ec9ded
ST
74592010-01-06 Sriraman Tallam <tmsriram@google.com>
7460
7461 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7462 (Garbage_collection::cident_sections): New function.
7463 (Garbage_collection::add_cident_section): New function.
7464 (Garbage_collection::cident_sections_): New member.
7465 (gc_process_relocs): Add references to sections whose names are C
7466 identifiers.
7467 * gold.h (cident_section_start_prefix): New constant.
7468 (cident_section_stop_prefix): New constant.
7469 (is_cident): New function.
7470 * layout.cc (Layout::define_section_symbols): Replace string constants
7471 with the newly defined constants.
7472 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7473 C identifiers.
7474 * testsuite/Makefile.am: Add gc_orphan_section_test.
7475 * testsuite/Makefile.in: Regenerate.
7476 * testsuite/gc_orphan_section_test.cc: New file.
7477 * testsuite/gc_orphan_section_test.sh: New file.
7478
6eda8c29
ILT
74792010-01-06 Ian Lance Taylor <iant@google.com>
7480
b9674e17
ILT
7481 PR 10980
7482 * options.h (class General_options): Add --warn-shared-textrel.
7483 * layout.cc (Layout::finish_dynamic_section): Implement
7484 --warn-shared-textrel.
7485
6eda8c29
ILT
7486 PR 10980
7487 * options.h (class General_options): Add --warn-multiple-gp.
7488
32dcd44e
ILT
74892010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7490
7491 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7492 $(THREADSLIB) and $(LIBDL).
7493 * Makefile.in: Rebuild.
7494
a192ba05
ILT
74952010-01-06 Ian Lance Taylor <iant@google.com>
7496
7497 PR 10980
7498 * options.cc (General_options::parse_section_start): New function.
7499 (General_options::section_start): New function.
7500 (General_options::General_options): Initialize all members.
7501 * options.h: Include <map>
7502 (class General_options): Add --section-start. Add section_starts_
7503 member.
7504 * layout.cc (Layout::attach_allocated_section_to_segment): If
7505 --section-start was used, set the address of the segment. Remove
7506 local sort_sections.
7507 (Layout::relaxation_loop_body): If the address of the load segment
7508 has been set by --section-start, don't use it.
7509 * output.h (Output_segment::update_flags_for_output_section): New
7510 function.
7511 * output.cc (Output_segment::add_output_section): Call
7512 update_flags_for_output_section.
7513
dde3f402
ILT
75142010-01-05 Ian Lance Taylor <iant@google.com>
7515
62dfdd4d
ILT
7516 PR 10980
7517 * options.h (class General_options): Add --undefined-version.
7518 * script.cc (struct Version_expression): Add was_matched_by_symbol
7519 field.
7520 (Version_script_info::matched_symbol): New function.
7521 (Version_script_info::get_symbol_version_helper): Call
7522 matched_symbol.
7523 (Version_script_info::check_unmatched_names): New function.
7524 * script.h (class Version_script_info): Update declarations.
7525 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7526
9c4ae156
ILT
7527 * options.h (class General_options): Use DEFINE_bool_alias for
7528 allow_multiple_definition.
7529 * resolve.cc (Symbol_table::should_override): Don't test
7530 allow_multiple_definition.
7531
dde3f402
ILT
7532 PR 10980
7533 * options.h (class General_options): Add --cref.
7534 * main.cc (main): Print cref table if --cref. Don't close mapfile
7535 until after printing cref table.
7536 * cref.cc: Include "symtab.h".
7537 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7538 (Cref_table_compare::operator()): New function.
7539 (Cref_inputs::gather_cref): New function.
7540 (filecol): New static const.
7541 (Cref_inputs::print_cref): New function.
7542 (Cref::print_cref): New function.
7543 * cref.h: Include <cstdio>.
7544 (class Cref): Update declarations.
7545 * mapfile.h (Mapfile::file): New function.
7546 * object.h (class Object): Define Symbols. Declare virtual
7547 do_get_global_symbols.
7548 (Object::get_global_symbols): New function.
7549 * object.cc (Input_objects::add_object): Pass object to cref_ if
7550 --cref.
7551 (Input_objects::archive_start): Likewise.
7552 (Input_objects::archive_stop): Likewise.
7553 (Input_objects::print_cref): New function.
7554 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7555 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7556 --cref.
7557 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7558 function.
7559 * plugin.h (class Sized_pluginobj): Update declarations.
7560
8781f709
ILT
75612010-01-05 Ian Lance Taylor <iant@google.com>
7562
7563 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7564 to is_default_version. Rename insdef to insdefault.
7565 (Symbol_table::add_from_relobj): Rename def to is_default_version
7566 and local to is_forced_local.
7567 (Symbol_table::add_from_pluginobj): Likewise.
7568 (Symbol_table::add_from_dynobj): Likewise.
7569 (Symbol_table::define_special_symbol): Rename insdef to
7570 insdefault.
7571
fe35d28d
ILT
75722010-01-04 Ian Lance Taylor <iant@google.com>
7573
30bc8c46
ILT
7574 PR 10980
7575 * options.h (class General_options): Add
7576 --allow-multiple-definition and -z muldefs.
7577 * resolve.cc (Symbol_table::should_override): Don't warn about a
7578 multiple symbol definition if --allow-multiple-definition or -z
7579 muldefs.
7580
7eaea549
ILT
7581 PR 10980
7582 * options.h (class General_options): Add --add-needed and
7583 --copy-dt-needed-entries. Tweak --as-needed help entry.
7584 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7585 error if --copy-dt-needed-entries aka --add-needed is used and
7586 would cause a change in behaviour.
7587
fe35d28d
ILT
7588 PR 10980
7589 * options.h (class General_options): Add -G as a short version of
7590 --shared. Add no-op options -assert, -g, and -i.
7591
55a2bb35
ST
75922010-01-04 Sriraman Tallam <tmsriram@google.com>
7593
7594 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7595 check for .text or .gnu.linkonce.t sections.
7596 * icf.cc (Icf::find_identical_sections): Ditto.
7597 Change the detection for mangled function name within the section
7598 name.
7599 * icf.h (is_section_foldable_candidate): New function.
7600
719328e1
ILT
76012009-12-30 Ian Lance Taylor <iant@google.com>
7602
7603 PR 10980
7604 * options.h (class General_options): Permit two dashes with
7605 --retain-symbols-file.
7606
d7bb5745
ILT
76072009-12-30 Ian Lance Taylor <iant@google.com>
7608
403a15dd
ILT
7609 PR 10979
7610 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7611 don't put the file header and segment headers in the text
7612 segment.
7613
eda294df
ILT
7614 PR 10979
7615 * common.cc (Sort_commons::operator()): Stabilize sort when both
7616 entries are NULL.
7617 (Symbol_table::do_allocate_commons_list): When allocating common
7618 symbols, skip a symbol which is no longer common.
7619 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7620 an object before checking its type.
7621 * testsuite/common_test_2.c: New file.
7622 * testsuite/common_test_3.c: New file.
7623 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7624 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7625 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7626 (common_test_2_pic.o, common_test_2.so): New targets.
7627 (common_test_3_pic.o, common_test_3.so): New targets.
7628 * testsuite/Makefile.in: Rebuild.
7629
d7bb5745
ILT
7630 PR 10979
7631 * script.cc (read_input_script): If we see a new SECTIONS clause,
7632 and we have added an input section, give an error.
7633 * layout.h (class Layout): Add have_added_input_section function.
7634 Add have_added_input_section_ field.
7635 * layout.cc (Layout::Layout): Initialize
7636 have_added_input_section_.
7637 (Layout::layout): Set have_added_input_section_.
7638 (Layout::layout_eh_frame): Likewise.
7639
fc59c572
ILT
76402009-12-30 Ian Lance Taylor <iant@google.com>
7641
7642 PR 10931
7643 * options.h (class General_options): Add --sort-common option.
7644 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7645 * common.cc (Sort_common): Add sort_order parameter to
7646 constructor. Add sort_order_ field.
7647 (Sort_commons::operator): Check sort_order_.
7648 (Symbol_table::allocate_commons): Determine the sort order.
7649 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7650 Change all callers.
7651 (Symbol_table::do_allocate_commons_list): Likewise.
7652
1c74fab0
ILT
76532009-12-30 Ian Lance Taylor <iant@google.com>
7654
7655 PR 10916
7656 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7657 symbols from this object, don't change the visibility of an
7658 undefined symbol.
7659 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7660
6affe781
ILT
76612009-12-30 Ian Lance Taylor <iant@google.com>
7662
7663 PR 10861
7664 * script.h (class Version_script_info): Define Language enum.
7665 Update declarations. Define Glob, Exact, and Lookup types. Add
7666 new fields globals_, locals_, and is_finalized_.
7667 * script.cc: Various formatting fixes.
7668 (class Parser_closure): Change language_stack_ from a vector of
7669 std::string to one of Version_script_info::Language. Adjust all
7670 uses accordingly.
7671 (class Lazy_demangler): Remove.
7672 (struct Version_expression): Change language from std::string to
7673 Version_script_info::Language.
7674 (Version_script_info::Version_script_info): New function.
7675 (Version_script_info::~Version_script_info): Don't call clear.
7676 (Version_script_info::finalize): New function.
7677 (Version_script_info::build_lookup_tables): New function.
7678 (Version_script_info::build_expression_list_lookup): New
7679 function.
7680 (Version_script_info::get_symbol_version_helper): Rewrite to use
7681 lookup tables.
7682 (Version_script_info::print_expression_list): Adjust to use
7683 Version_script_info::Language.
7684 (script_push_lex_into_version_mode): Check that the version script
7685 has not been finalized.
7686 (version_script_push_lang): Change language string to
7687 Version_script_info::Language.
7688 * options.cc (Command_line::version_script): New function.
7689 * options.h (class General_options): Add finalize_dynamic_list
7690 function. Change version_script from declaration to definition.
7691 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7692 * testsuite/version_script.map: Remove duplicate def of foo.
7693 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7694 version_script.map.
7695 * testsuite/Makefile.in: Rebuild.
7696
818bf354
ILT
76972009-12-30 Ian Lance Taylor <iant@google.com>
7698
7699 PR 10843
7700 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7701 if the input symbol index is 0, make the output symbol index 0.
7702
ebcc8304
ILT
77032009-12-30 Ian Lance Taylor <iant@google.com>
7704
7705 PR 10670
7706 * options.h (class General_options): Add -x/--discard-all.
7707 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7708 --discard-all. If the local symbol needs a dynamic entry, check
7709 that before handling --discard-locals.
7710
176fe33f
ILT
77112009-12-30 Ian Lance Taylor <iant@google.com>
7712
bb321bb1
ILT
7713 PR 10450
7714 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7715 flags to PF_R.
7716 (Output_segment::add_output_section): Don't change the flags if
7717 the type is PT_TLS.
7718
176fe33f
ILT
7719 PR 10450
7720 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7721 GNU hash table if they need a dynamic value. Otherwise, don't add
7722 them if they are defined in a dynamic object or are forced local.
7723
e8cd95c7
ILT
77242009-12-29 Ian Lance Taylor <iant@google.com>
7725
1b81fb71
ILT
7726 PR 10450
7727 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7728 .gnu.hash table for a 32-bit target.
7729
8d6d383d
ILT
7730 PR 10450
7731 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7732 regular and a dynamic object only needs a dynamic symbol table
7733 entry if it is externally visible.
7734
e785ec03
ILT
7735 PR 10450
7736 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7737 constructor. Add global_offset_table_ field.
7738 (Target_i386::got_section): Set global_offset_table_.
7739 (Target_i386::do_finalize_sections): Set global_offset_table_
7740 size.
7741 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7742 in constructor. Add global_offset_table_ field.
7743 (Target_x86_64::got_section): Set global_offset_table_.
7744 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7745 size.
7746
1a2dff53
ILT
7747 * layout.cc (Layout::Layout): Initialize increase_relro_.
7748 (Layout::get_output_section): Add is_relro, is_last_relro, and
7749 is_first_non_relro parameters. Change all callers.
7750 (Layout::choose_output_section): Likewise.
7751 (Layout::add_output_section_data): Likewise.
7752 (Layout::make_output_section): Likewise.
7753 (Layout::set_segment_offsets): Clear increase_relro when using a
7754 linker script.
7755 * layout.h (class Layout): Add increase_relro method. Add
7756 increase_relro_ field. Update declarations.
7757 * output.cc (Output_section::Output_section): Initialize
7758 is_last_relro_ and is_first_non_relro_.
7759 (Output_segment::add_output_section): Group relro sections is
7760 do_sort is true. Handle is_last_relro and is_first_non_relro.
7761 (Output_segment::maximum_alignment): Remove relro handling.
7762 (Output_segment::set_section_addresses): Add increase_relro
7763 parameter. Change all callers. Add initial alignment to align
7764 relro sections on separate page. Remove old relro handling.
7765 (Output_segment::set_section_list_addresses): Remove in_relro
7766 parameter. Change all callers.
7767 (Output_segment::set_offset): Add increase parameter. Change all
7768 callers. Remove old relro handling.
7769 * output.h (class Output_section): Add new methods: is_last_relro,
7770 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7771 Add is_last_relro_ and is_first_non_relro_ fields.
7772 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7773 Create separate .got.plt section. Call increase_relro.
7774 * x86_64.cc (Target_x86_64::got_section): Likewise.
7775 * testsuite/relro_script_test.t: Add .got.plt.
7776
f0ba79e2
ILT
7777 PR 10450
7778 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7779 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7780 (Layout::finalize): Call set_dynamic_symbol_size.
7781 (Layout::set_dynamic_symbol_size): New function.
7782 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7783 set_dynamic_symbol_size.
7784
e8cd95c7
ILT
7785 PR 10450
7786 * output.h (class Output_section): Add is_entsize_zero_ field.
7787 * output.cc (Output_section::Output_section): Initialize
7788 is_entsize_zero_.
7789 (Output_section::set_entsize): If two different entsizes are
7790 requested, force it to zero.
7791 (Output_section::add_input_section): Set flags for .debug_str
7792 before updating section flags. Set entsize.
7793 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7794 and SHF_STRING if all input sections have those flags.
7795
3e1b9a8a
RÁE
77962009-12-29 Rafael Espindola <espindola@google.com>
7797
7798 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
7799 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7800 reporting.
3e1b9a8a 7801
3dcad376
ST
78022009-12-29 Sriraman Tallam <tmsriram@google.com>
7803
7804 * options.cc (General_options::parse_version): Allow -v to exit
7805 without an error if there is nothing to link.
7806
084e2665
ILT
78072009-12-29 Ian Lance Taylor <iant@google.com>
7808
7809 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7810 using a version of gcc before 4.1.
7811 * configure: Rebuild.
7812
250acde3
CD
78132009-12-28 Chris Demetriou <cgd@google.com>
7814
7815 * attributes.cc (Output_attributes_section_data::do_write): Use
7816 std::vector::front rather than std::vector::data.
7817
99fff23b
ILT
78182009-12-28 Ian Lance Taylor <iant@google.com>
7819
7820 * symtab.h (class Symbol_table): Add enum Defined.
7821 * resolve.cc (Symbol_table::should_override): Add defined
7822 parameter. Change all callers. Test whether object is NULL
7823 before calling a method on it.
7824 (Symbol_table::report_resolve_problem): Add defined parameter.
7825 Change all callers.
7826 (Symbol_table::should_override_with_special): Likewise.
7827 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7828 parameter. Change all callers.
7829 (Symbol_table::do_define_in_output_data): Likewise.
7830 (Symbol_table::define_in_output_segment): Likewise.
7831 (Symbol_table::do_define_in_output_segment): Likewise.
7832 (Symbol_table::define_as_constant): Likewise.
7833 (Symbol_table::do_define_as_constant): Likewise.
7834 * script.h (class Symbol_assignment): Add is_defsym parameter to
7835 constructor; change all callers.
7836 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7837 parameter. Change all callers. Add is_defsym_ field.
7838 (class Parser_closure): Add parsing_defsym parameter to
7839 constructor; change all callers. Add parsing_defsym accessor
7840 function. Add parsing_defsym_ field.
7841
556bd683
ILT
78422009-12-28 Ian Lance Taylor <iant@google.com>
7843
7844 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 7845 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 7846
1782c879
ILT
78472009-12-23 Ian Lance Taylor <iant@google.com>
7848
7849 * i386.cc (Target_i386::do_calls_non_split): Recognize
7850 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
7851 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7852 -fsplit-stack prologue when using %r11.
1782c879 7853
329ca2b1
ST
78542009-12-21 Sriraman Tallam <tmsriram@google.com>
7855
7856 * options.cc (General_options::parse_version): Make -v continue and do
7857 the link like GNU ld does.
7858
d675ff46
RÁE
78592009-12-17 Rafael Avila de Espindola <espindola@google.com>
7860
7861 * Makefile.am (CCFILES): Add timer.cc.
7862 (HFILES): Add timer.h.
7863 * configure.ac: Check for sysconf and times.
7864 * main.cc: include timer.h.
7865 (main): Use Timer instead of get_run_time.
7866 * timer.cc: New.
7867 * timer.h: New.
7868 * workqueue.cc: include timer.h.
7869 (Workqueue::find_and_run_task):
7870 Report user, sys and wall time.
7871 * Makefile.in: Regenerate.
7872 * config.in: Regenerate.
7873 * configure: Regenerate.
7874
d6344fb5
DK
78752009-12-16 Doug Kwan <dougkwan@google.com>
7876
7877 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7878 sections.
7879 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7880 relaxed input sections.
7881 * output.cc (Output_section::find_relaxed_input_section): Change
7882 return type to Output_relaxed_input_section pointer. Adjust code
7883 for new type of relaxed_input_section_map_.
7884 * output.h (Output_section::find_relaxed_input_section): Change
7885 return type to Output_relaxed_input_section pointer.
7886 (Output_section::Output_relaxed_input_section_by_input_section_map):
7887 New type.
7888 (Output_section::relaxed_input_section_map_): Change type to
7889 Output_section::Output_relaxed_input_section_by_input_section_map.
7890 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7891 input section.
7892
0e0d5469
ILT
78932009-12-15 Ian Lance Taylor <iant@google.com>
7894
7895 * layout.cc (Layout::create_shstrtab): Only write out after input
7896 sections if we are compressing debug sections.
7897
0649a889
ILT
78982009-12-15 Ian Lance Taylor <iant@google.com>
7899
7900 * archive.cc (Archive::add_symbols): Only look up a symbol without
7901 a version if there is, in fact, a version.
7902
2ea97941
ILT
79032009-12-14 Ian Lance Taylor <iant@google.com>
7904
7905 Revert -Wshadow changes, all changes from:
7906 2009-12-11 Doug Kwan <dougkwan@google.com>
7907 2009-12-11 Nick Clifton <nickc@redhat.com>
7908 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7909
b0eec2cc
DK
79102009-12-11 Doug Kwan <dougkwan@google.com>
7911
7912 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7913 due to -Wshadow.
7914 * attributes.cc (Object_attribute::size): Ditto.
7915 (Attributes_section_data::size): Ditto.
7916 (Attributes_section_data::Attributes_section_data): Ditto.
7917 (Output_attributes_section_data::do_write): Ditto.
7918 * attributes.h (Object_attribute::set_type): Ditto.
7919 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7920
91d6fa6a
NC
79212009-12-11 Nick Clifton <nickc@redhat.com>
7922
7923 * archive.cc: Fix shadowed variable warnings.
7924 * arm.cc: Likewise.
7925 * compressed_output.cc: Likewise.
7926 * compressed_output.h: Likewise.
7927 * configure: Likewise.
7928 * dwarf_reader.cc: Likewise.
7929 * dynobj.cc: Likewise.
7930 * dynobj.h: Likewise.
7931 * ehframe.cc: Likewise.
7932 * ehframe.h: Likewise.
7933 * errors.cc: Likewise.
7934 * expression.cc: Likewise.
7935 * fileread.cc: Likewise.
7936 * fileread.h: Likewise.
7937 * freebsd.h: Likewise.
7938 * i386.cc: Likewise.
7939 * icf.cc: Likewise.
7940 * incremental.h: Likewise.
7941 * layout.cc: Likewise.
7942 * layout.h: Likewise.
7943 * mapfile.cc: Likewise.
7944 * merge.cc: Likewise.
7945 * merge.h: Likewise.
7946 * object.cc: Likewise.
7947 * object.h: Likewise.
7948 * options.h: Likewise.
7949 * output.cc: Likewise.
7950 * output.h: Likewise.
7951 * parameters.cc: Likewise.
7952 * plugin.cc: Likewise.
7953 * powerpc.cc: Likewise.
7954 * reduced_debug_output.cc: Likewise.
7955 * reduced_debug_output.h: Likewise.
7956 * reloc.cc: Likewise.
7957 * reloc.h: Likewise.
7958 * resolve.cc: Likewise.
7959 * script-sections.cc: Likewise.
7960 * script.cc: Likewise.
7961 * script.h: Likewise.
7962 * sparc.cc: Likewise.
7963 * symtab.cc: Likewise.
7964 * symtab.h: Likewise.
7965 * target-select.cc: Likewise.
7966 * target-select.h: Likewise.
7967 * token.h: Likewise.
7968 * workqueue.cc: Likewise.
7969 * workqueue.h: Likewise.
7970 * x86_64.cc: Likewise.
7971
a0351a69
DK
79722009-12-10 Doug Kwan <dougkwan@google.com>
7973
7974 * arm.cc (attributes.h): New include.
7975 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7976 (Arm_relobj::~Arm_relobj): Delete object pointed by
7977 attributes_section_data_.
7978 (Arm_relobj::attributes_section_data): New method definition.
7979 (Arm_relobj::attributes_section_data_): New data member declaration.
7980 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7981 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7982 attributes_section_data_.
7983 (Arm_dynobj::attributes_section_data): New method definition.
7984 (Arm_dynobj::attributes_section_data_): New data member declaration.
7985 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7986 initialization value of may_use_blx_ to false.
2e702c99 7987 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
7988 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7989 object attributes to compute results instead of hard-coding.
7990 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7991 Target_arm::get_secondary_compatible_arch,
7992 Target_arm::set_secondary_compatible_arch
7993 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7994 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7995 New method declarations.
7996 (Target_arm::get_aeabi_object_attribute): New method definition.
7997 (Target_arm::attributes_section_data_): New data member declaration.
7998 (read_arm_attributes_section): New template definition.
7999 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8000 (Arm_dynobj::do_read_symbols): Ditto.
8001 (Target_arm::do_finalize_sections): Merge attributes sections from
8002 input. Check for BLX use after attributes section merging.
8003 Fix __exidx_start and __exidx_end visibility. Create an
8004 .ARM.attributes section if necessary.
8005 (Target_arm::get_secondary_compatible_arch,
8006 Target_arm::set_secondary_compatible_arch,
8007 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8008 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 8009 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
8010 New method definitions.
8011
b59befec
ILT
80122009-12-09 Ian Lance Taylor <iant@google.com>
8013
8014 * plugin.cc (Plugin::load): Don't cast from void* to a function
8015 pointer.
8016
1276bc89
ILT
80172009-12-09 Ian Lance Taylor <iant@google.com>
8018
8019 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
8020 information fields.
8021
2f2de248
L
80222009-12-09 H.J. Lu <hongjiu.lu@intel.com>
8023
8024 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
8025 Replace two_file_shared_1.so with two_file_shared_2.so.
8026 * testsuite/Makefile.in: Regenerated.
8027
4f787271
DK
80282009-12-08 Doug Kwan <dougkwan@google.com>
8029
8030 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8031 (HFILES): Add attributes.h and int_encoding.h.
8032 * Makefile.in: Regenerate.
8033 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8034 function definitions to int_encoding.cc
8035 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8036 prototypes to int_encoding.h
8037 * reduced_debug_output.cc (int_encoding.h): New include.
8038 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
8039 function definitions to int_encoding.cc
8040 (insert_into_vector, read_from_pointer): Move template definitions to
8041 int_encoding.h
8042 * attributes.cc: New file.
8043 * attributes.h: New file.
8044 * int_encoding.cc: New file.
8045 * int_encoding.h: New file.
8046
20b52f1a
RÁE
80472009-12-07 Rafael Avila de Espindola <espindola@google.com>
8048
8049 PR gold/11055
8050 * incremental-dump.cc (dump_incremental_inputs): New.
8051 (main): Use dump_incremental_inputs.
8052
53d7974c
L
80532009-12-07 H.J. Lu <hongjiu.lu@intel.com>
8054
8055 PR gold/10893
8056 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
8057 checking elfcpp::STT_FUNC.
8058 (Target_i386::Relocate::relocate): Likewise.
8059 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8060
8061 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
8062 symbols from shared libraries into normal FUNC symbols.
8063
8064 * symtab.h (Symbol): Add is_func and use it.
8065
05a352e6
DK
80662009-12-05 Doug Kwan <dougkwan@google.com>
8067
8068 * arm.cc (Target_arm::arm_info): Initialize new fields
8069 attributes_section and attributes_vendor.
8070 * i386.cc (Target_i386::i386_info): Same.
8071 * object.cc (Sized_relobj::do_layout): Skip attribute section.
8072 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
8073 fields attributes_section and attributes_vendor.
53d7974c 8074 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
8075 * target.h (Target::attributes_section, Target::attributes_vendor,
8076 Target::is_attributes_section, Target::attribute_arg_type,
8077 Target::attributes_order): New method definitions.
8078 (Target::Target_info::attributes_section,
8079 Target::Target_info::attributes_vendor): New fields.
8080 (Target::do_attribute_arg_type, Target::do_attributes_order): New
8081 virtual method definitions.
8082 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
8083 attributes_section and attributes_vendor.
8084 * testsuite/testfile.cc (Target_test::test_target_info): Same.
8085
f4e5969c
DK
80862009-12-05 Doug Kwan <dougkwan@google.com>
8087
8088 * arm.cc: Update comments about interworking and stub generation.
8089 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
8090 considered as non-PIC.
8091 (Arm_relocate_functions::base_abs): Fix formatting.
8092 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8093 of function to use GOT entry address instead of offset.
8094 (Target_arm::Scan::global): Issue an error if a symbol would need a
8095 PLT does not get one because it is untyped. Remove code to create
8096 dynamic symbols for relative branches.
8097 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8098 takes unsigned integer instead of boolean.
8099
1abce4a6
L
81002009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8101
8102 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8103 (two_file_test_LDADD): Likewise.
8104 (common_test_1_LDADD): Likewise.
8105 (exception_test_LDADD) Likewise.
8106 (weak_test_LDADD): Likewise.
8107 (many_sections_test_LDADD): Likewise.
8108 (initpri1_LDADD): Likewise.
8109 (script_test_1_LDADD): Likewise.
8110 (script_test_2_LDADD): Likewise.
8111 (justsyms_LDADD): Likewise.
8112 (binary_test_LDADD): Likewise.
8113 (large_LDADD): Likewise.
8114 * testsuite/Makefile.in: Regenerated.
8115
adcf2816 81162009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 8117
adcf2816
L
8118 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8119 (Symbol_table::override_with_special): Likewise.
8120 (Symbol_table::add_from_object): Likewise.
8121
28e67f5d
RÁE
81222009-12-04 Rafael Avila de Espindola <espindola@google.com>
8123
8124 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8125 Don't set the data_offset twice.
8126
ae10a101
RÁE
81272009-12-04 Rafael Avila de Espindola <espindola@google.com>
8128
8129 * testsuite/Makefile.in: Regenerate.
8130
f59f41f3
DK
81312009-12-03 Doug Kwan <dougkwan@google.com>
8132
8133 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8134 (Target_arm::do_finalize_sections): Add parameter for symbol table
8135 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8136 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8137 parameter for symbol table pointer.
8138 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8139 an additional parameter for a pointer to symbol table.
8140 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8141 parameter for a symbol table pointer.
8142 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8143 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8144 Ditto.
8145 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8146 parameter for a symbol table pointer.
8147
ca55d848
RÁE
81482009-12-03 Rafael Avila de Espindola <espindola@google.com>
8149
8150 * incremental.cc (Incremental_inputs_header)
8151 (Incremental_inputs_header_write, Incremental_inputs_entry)
8152 (Incremental_inputs_entry_write): Move ...
8153 * incremental.h (Incremental_inputs_header)
8154 (Incremental_inputs_header_write, Incremental_inputs_entry)
8155 (Incremental_inputs_entry_write): here.
8156
3aec4f9c
RÁE
81572009-12-02 Rafael Avila de Espindola <espindola@google.com>
8158
8159 * incremental.cc (make_sized_incremental_binary): Set the target.
8160 Error if it is incompatible.
8161 * output.h (Output_file): Add filename method.
8162
9c0ae74d
RÁE
81632009-12-02 Rafael Avila de Espindola <espindola@google.com>
8164
8165 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8166 from the get_* methods.
8167
a45500ae
RÁE
81682009-12-02 Rafael Avila de Espindola <espindola@google.com>
8169
8170 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8171 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8172 Write 0 for the data_offset of scripts.
8173
325e6408
RÁE
81742009-12-02 Rafael Avila de Espindola <espindola@google.com>
8175
8176 * testsuite/Makefile.am: Add the incremental_test.sh test.
8177 * testsuite/incremental_test.sh: New.
8178 * testsuite/incremental_test_1.c: New.
8179 * testsuite/incremental_test_2.c: New.
8180
954c3e2e
RÁE
81812009-12-01 Rafael Avila de Espindola <espindola@google.com>
8182
8183 * incremental-dump.cc (main): Fix typos.
8184
f8086623
RÁE
81852009-11-27 Rafael Avila de Espindola <espindola@google.com>
8186
8187 PR gold/11025
8188 * incremental-dump.cc (main): Use llu to print 64 bit values.
8189
3b0dd6ac
L
81902009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8191 H.J. Lu <hongjiu.lu@intel.com>
8192
8193 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8194 $(LIBDL).
8195 (incremental_dump_LDADD): Likewise.
8196 * Makefile.in: Regenerated.
8197
a6d1ef57 81982009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 8199
a6d1ef57
DK
8200 Revert:
8201
8202 2009-11-25 Doug Kwan <dougkwan@google.com>
8203
8204 * arm.cc (Target_arm::Target_arm): Move method definition
8205 outside of class definition. Add code to handle
8206 --target1-rel, --target1-abs and --target2= options.
8207 (Target_arm::get_reloc_reloc_type): Change method to be
8208 non-static and const.
8209 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8210 New data member declaration.
8211 (Target_arm::Scan::local, Target_arm::Scan::global,
8212 Target_arm::Relocate::relocate,
8213 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8214 Adjust call to Target_arm::get_real_reloc_type.
8215 (Target_arm::get_real_reloc_type): Use command line options
8216 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8217 * options.h (--target1-rel, --target1-abs, --target2): New
8218 ARM-only options.
8219
50aeb7d4
DK
82202009-11-25 Doug Kwan <dougkwan@google.com>
8221
8222 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8223 class definition. Add code to handle --target1-rel, --target1-abs
8224 and --target2= options.
8225 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8226 and const.
8227 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8228 member declaration.
8229 (Target_arm::Scan::local, Target_arm::Scan::global,
8230 Target_arm::Relocate::relocate,
8231 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8232 call to Target_arm::get_real_reloc_type.
8233 (Target_arm::get_real_reloc_type): Use command line options to
8234 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8235 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8236 options.
8237
51938283
DK
82382009-11-25 Doug Kwan <dougkwan@google.com>
8239
8240 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8241 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8242 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8243 formatting.
8244 (Arm_relocate_functions::thm_call): Replace body with a call to
8245 Arm_relocate_functions::thumb_branch_common.
8246 (Arm_relocate_functions::thm_jump24,
8247 Arm_relocate_functions::thm_xpc22): New method definitions.
8248 (Arm_relocate_functions::thumb_branch_common): New method definition.
8249 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8250 operator.
8251 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8252 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8253
e2b8f3c4
RÁE
82542009-11-24 Rafael Avila de Espindola <espindola@google.com>
8255
8256 * Makefile.am: Build incremental-dump
8257 * Makefile.in: Regenerate.
8258 * incremental-dump.cc: New.
8259 * incremental.cc (Incremental_inputs_header_data,
8260 Incremental_inputs_entry_data): Move to incremental.h
8261 * incremental.h: (Incremental_inputs_header_data,
8262 Incremental_inputs_entry_data): Move from incremental.cc
8263
bcba9aec
RÁE
82642009-11-24 Rafael Avila de Espindola <espindola@google.com>
8265
8266 * incremental.cc (Incremental_inputs_header,
8267 Incremental_inputs_header_write, Incremental_inputs_entry,
8268 Incremental_inputs_entry_write): Add a typedef with the data type.
8269
7c3afe08
RÁE
82702009-11-24 Rafael Avila de Espindola <espindola@google.com>
8271
8272 * incremental.cc (Incremental_inputs_header,
8273 Incremental_inputs_header_write, Incremental_inputs_entry,
8274 Incremental_inputs_entry_write): Update comment about which
8275 type has the filed descriptions.
8276
d204b6e9
DK
82772009-11-15 Doug Kwan <dougkwan@google.com>
8278
8279 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8280 (Arm_relocate_functions::arm_branch_common): Change method defintion
8281 in class definition to a method declaration and update list of formal
8282 parameters.
8283 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8284 Arm_relocation_functions::jump24): Adjust call to
8285 Arm_relocate_functions::arm_branch_common. Update list of formal
8286 parameters.
8287 (Arm_relocate_functions::xpc25): New method definition.
8288 (Arm_relocate_functions::arm_branch_common): Move method defintion
8289 out from class definition. Use stubs for mode-switching and extending
8290 branch ranges.
8291 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8292 specially. Change code to enable use of stubs in ARM branches.
8293
43d12afe
DK
82942009-11-10 Doug Kwan <dougkwan@google.com>
8295
8296 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8297 in method declaration.
8298 (Target_arm::relocate_stub): New method declaration.
8299 (Target_arm::default_target): Change to return a pointer instead of
8300 a const reference.
8301 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8302 Target_arm::default_target.
8303 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8304 method definition.
8305 (Target_arm::relocate_section): Adjust view.
8306 (Target_arm::relocate_stub): New method definition.
8307
ac33a407
DK
83082009-11-10 Doug Kwan <dougkwan@google.com>
8309
8310 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8311 a format warning.
8312 * incremental.cc (open_incremental_binary): Initialized local
8313 variables to avoid warnings.
8314 * object.cc (make_elf_object): Ditto.
8315 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8316 a format warning.
e1df38aa 8317
88ee28e9
L
8318009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8319
8320 PR gold/10930
8321 * testsuite/plugin_test.c: Include "config.h".
8322
2daedcd6
DK
83232009-11-09 Doug Kwan <dougkwan@google.com>
8324
8325 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8326 (arm_symbol_value): Remove.
8327 (Arm_relocate_functions::arm_branch_common,
8328 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8329 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8330 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8331 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8332 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8333 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8334 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8335 Arm_relocate_functions::thm_mobw_abs_nc,
8336 Arm_relocate_functions::thm_mov_abs,
8337 Arm_relocate_functions::movw_prel_nc,
8338 Arm_relocate_functions::thm_movt_abs,
8339 Arm_relocate_functions::movt_prel,
8340 Arm_relocate_functions::thm_movw_prel_nc,
8341 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8342 (Target_arm::Relocate::relocate): Only decompose address into two
8343 parts if relocation type uses the thumb-bit and pass the actual
8344 bit instead of a flag indicating that the thumb-bit is used. Adjust
8345 calls to methods in Arm_relocate_functions for this change.
8346
1276bc89 83472009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
8348
8349 PR 10925
8350 * reloc.cc: Instantiate
8351 Sized_relobj::initialize_input_to_output_maps and
8352 Sized_relobj:free_input_to_output_maps.
8353
e53ad1b5
ILT
83542009-11-06 Ian Lance Taylor <iant@google.com>
8355
8356 PR 10876
8357 * defstd.cc (in_segment): Set only_if_ref true for "end".
8358
eb44217c
DK
83592009-11-06 Doug Kwan <dougkwan@google.com>
8360
8361 * arm.cc (class Reloc_stub): Correct a comment.
8362 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8363 (Target_arm::scan_section_for_stubs): New method declaration.
8364 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8365 Change methods from private to protected.
8366 (Target_arm::do_may_relax): New method definition.
8367 (Target_arm::do_relax, Target_arm::group_sections,
8368 Target_arm::scan_reloc_for_stub,
8369 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8370 (Target_arm::arm_input_section_map_): New data member declaration.
8371 (Target_arm::scan_reloc_for_stub,
8372 Target_arm::scan_reloc_section_for_stubs,
8373 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8374 Target_arm::do_relax): New method definitions.
8375
5d329b7d
ILT
83762009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8377
8378 * configure.ac: Check for (struct stat)::st_mtim
8379 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8380 * config.in: Regenerate.
8381 * configure: Regenerate.
8382
96a0d71b
ILT
83832009-11-05 Ian Lance Taylor <iant@google.com>
8384
8385 PR 10910
8386 * output.cc (Output_segment::add_output_section): Add missing
8387 return statement.
8388
594c8e5e
ILT
83892009-11-04 Ian Lance Taylor <iant@google.com>
8390
8391 PR 10880
8392 * object.h (class Object): Add is_needed and set_is_needed
8393 methods. Add is_needed_ field. Make bool fields into bitfields.
8394 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8395 defined in a dynamic object and referenced by a regular object,
8396 set is_needed for the dynamic object.
8397 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8398 if the file is marked with as_needed and it is not needed.
8399
22b127cc
ILT
84002009-11-04 Ian Lance Taylor <iant@google.com>
8401
8402 PR 10887
8403 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8404 tags if data is discarded by linker script.
8405 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8406 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8407 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8408 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8409
f5c870d2
ILT
84102009-11-04 Ian Lance Taylor <iant@google.com>
8411
8412 * layout.cc (Layout::get_output_section): Add is_interp and
8413 is_dynamic_linker_section parameters. Change all callers.
8414 (Layout::choose_output_section): Likewise.
8415 (Layout::make_output_section): Likewise.
8416 (Layout::add_output_section_data): Add is_dynamic_linker_section
8417 parameter. Change all callers.
8418 * layout.h (class Layout): Update declarations.
8419 * output.h (class Output_section): Add is_interp, set_is_interp,
8420 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8421 Add is_interp_, is_dynamic_linker_section_ fields. Change
8422 generate_code_fills_at_write_ to a bitfield.
8423 * output.cc (Output_section::Output_sections): Initialize new
8424 fields.
8425 (Output_segment::add_output_section): Add do_sort parameter.
8426 Change all callers.
8427
1ae4d23b
ILT
84282009-11-03 Ian Lance Taylor <iant@google.com>
8429
8430 PR 10860
8431 * options.h (class General_options): Add --warn-common.
8432 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8433 merging two common symbols.
8434 (Symbol_table::should_override): Handle --warn-common when merging
8435 a common symbol with a defined symbol. Use report_resolve_problem
8436 for multiple definitions.
8437 (Symbol_table::report_resolve_problem): New function.
8438 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8439
55da9579
DK
84402009-11-03 Doug Kwan <dougkwan@google.com>
8441
8442 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8443 stub_factory_.
8444 (Target_arm::stub_factory): New method definition.
8445 (Target_arm::new_arm_input_section,
8446 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8447 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 8448 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
8449 New type definitions.
8450 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8451 member declarations.
8452 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8453 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8454 New method definitions.
8455
37a9ac43
ILT
84562009-11-03 Ian Lance Taylor <iant@google.com>
8457
8458 * options.h (class General_options): Add --warn_constructors.
8459
b3d6a3d4
ILT
84602009-11-03 Ian Lance Taylor <iant@google.com>
8461
8462 PR 10893
8463 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8464 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8465
934b01dd
ILT
84662009-11-03 Ian Lance Taylor <iant@google.com>
8467
8468 PR 10895
8469 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8470 --msgid-bugs-address.
8471 (install-pdf): New target.
8472 (install-data_yes): Look up one directory to find mkinstalldirs.
8473
03c1939b
L
84742009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8475
8476 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8477 tree.
8478
ebd95253
DK
84792009-10-30 Doug Kwan <dougkwan@google.com>
8480
8481 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8482
e9bbb538
DK
84832009-10-30 Doug Kwan <dougkwan@google.com>
8484
8485 * arm.cc (Stub_addend_reader): New struct template definition
8486 and partial specializations.
8487 (Stub_addend_reader::operator()): New method definition for a
8488 partially specialized template.
8489
d5b40221
DK
84902009-10-30 Doug Kwan <dougkwan@google.com>
8491
8492 * arm.cc (Arm_relobj::processor_specific_flags): New method
8493 definition.
8494 (Arm_relobj::do_read_symbols): New method declaration.
8495 (Arm_relobj::processor_specific_flags_): New data member declaration.
8496 (Arm_dynobj): New class definition.
8497 (Target_arm::do_finalize_sections): Add input_objects parameter.
8498 (Target_arm::do_adjust_elf_header): New method declaration.
8499 (Target_arm::are_eabi_versions_compatible,
8500 (Target_arm::merge_processor_specific_flags): New method declaration.
8501 (Target_arm::do_make_elf_object): New overloaded method definitions
8502 and declaration.
8503 (Arm_relobj::do_read_symbols): New method definition.
8504 (Arm_dynobj::do_read_symbols): Ditto.
8505 (Target_arm::do_finalize_sections): Add input_objects parameters.
8506 Merge processor-specific flags from all input objects.
8507 (Target_arm::are_eabi_versions_compatible,
8508 Target_arm::merge_processor_specific_flags,
8509 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8510 New method definitions.
8511 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8512 Input_objects pointer type parameter.
8513 * layout.cc (Layout::finalize): Pass input objects to target's.
8514 finalize_sections function.
8515 * output.cc (Output_file_header::do_sized_write): Set ELF file
8516 header's processor-specific flags.
8517 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8518 Input_objects pointer type parameter.
8519 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8520 * target.h (Input_objects): New forward class declaration.
8521 (Target::processor_specific_flags,
8522 Target::are_processor_specific_flags_sect): New method definitions.
8523 (Target::finalize_sections): Add input_objects parameter.
8524 (Target::Target): Initialize processor_specific_flags_ and
8525 are_processor_specific_flags_set_.
8526 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8527 parameter.
8528 (Target::set_processor_specific_flags): New method definition.
8529 (Target::processor_specific_flags_,
8530 Target::are_processor_specific_flags_set_): New data member
8531 declarations.
8532 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8533 Input_objects pointer type parameter.
8534
ebabffbd
DK
85352009-10-30 Doug Kwan <dougkwan@google.com>
8536
8537 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8538
ad0f2072
ILT
85392009-10-28 Ian Lance Taylor <iant@google.com>
8540
8541 * object.h (class Relobj): Drop options parameter from
8542 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8543 do_scan_relocs, do_relocate. Change all callers.
8544 (class Sized_relobj): Drop options parameters from
8545 do_gc_process_relocs, do_scan_relocs, do_relocate,
8546 do_relocate_sections, relocate_sections, emit_relocs_scan,
8547 emit_relocs_scan_reltype. Change all callers.
8548 (struct Relocate_info): Remove options field and all references to
8549 it.
8550 * reloc.h (class Read_relocs): Remove options constructor
8551 parameter and options_ field. Change all callers.
8552 (class Gc_process_relocs, class Scan_relocs): Likewise.
8553 (class Relocate_task): Likewise.
8554 * target-reloc.h (scan_relocs): Remove options parameter. Change
8555 all callers.
8556 (scan_relocatable_relocs): Likewise.
8557 * target.h (class Sized_target): Remove options parameter from
8558 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8559 all callers.
8560 * gc.h (gc_process_relocs): Remove options parameter. Change all
8561 callers.
8562 * arm.cc: Update functions to remove options parameters.
8563 * i386.cc: Likewise.
8564 * powerpc.cc: Likewise.
8565 * sparc.cc: Likewise.
8566 * x86_64.cc: Likewise.
8567 * testsuite/testfile.cc: Likewise.
8568
8ffa3667
DK
85692009-10-28 Doug Kwan <dougkwan@google.com>
8570
8571 * arm.cc (Arm_relobj): New class definition.
e1df38aa 8572 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
8573 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8574 New method definitions.
8575
40f36857
CC
85762009-10-28 Cary Coutant <ccoutant@google.com>
8577
8578 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8579 (Plugin::cleanup_done_): New member.
8580 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8581 (Plugin_manager::cleanup_done_): Remove.
8582 (Plugin_manager::add_input_file): Edit error message.
8583 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8584 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8585
2c849493
ILT
85862009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8587
8588 * fileread.cc: (File_read::View::~View): Use the new
8589 data_ownership_ filed.
8590 (File_read::~File_read): Dispose the new whole_file_view_.
8591 (File_read::open): Mmap the whole file if needed.
8592 (File_read::open): Use whole_file_view_ instead of contents_.
8593 (File_read::find_view): Use whole_file_view_ if applicable.
8594 (File_read::do_read): Use whole_file_view_ instead of contents_.
8595 (File_read::make_view): Use whole_file_view_ instead of contents_,
8596 update File_read::View::View call.
8597 (File_read::find_or_make_view): Update File_read::View::View
8598 call.
8599 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8600 remove contents_
8601 (File_read::View::Data_ownership): New enum.
8602 (File_read::View::View): Replace bool mapped_ with Data_ownership
8603 argument.
8604 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8605 (File_read::View::data_ownership_): New field.
8606 (File_read::contents_): Remove (replaced by whole_file_view_).
8607 (File_read::whole_file_view_): New field.
8608 * options.h (class General_options): Add --keep-files-mapped.
8609
24998053
CC
86102009-10-27 Cary Coutant <ccoutant@google.com>
8611
8612 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8613 * testsuite/Makefile.am (plugin_test_5): New test case.
8614 * testsuite/Makefile.in: Regenerate.
8615
72adc4fa
DK
86162009-10-25 Doug Kwan <dougkwan@google.com>
8617
8618 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8619 from private to protected to allow access by child class.
8620 (Sized_relobj::do_relocate_sections): New method declaration.
8621 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 8622 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
8623 Sized_relobj::relocate_sections. Instantiate template explicitly
8624 for different target sizes and endianity.
8625
07f508a2
DK
86262009-10-24 Doug Kwan <dougkwan@google.com>
8627
8628 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8629 (Arm_input_section::as_arm_input_section): New method.
8630 (Arm_output_section): New class definition.
8631 (Arm_output_section::create_stub_group,
8632 Arm_output_section::group_sections): New method definitions.
8633
10ad9fe5
DK
86342009-10-22 Doug Kwan <dougkwan@google.com>
8635
8636 * arm.cc (Arm_input_section): New class definition.
8637 (Arm_input_section::init, Arm_input_section:do_write,
8638 Arm_input_section::set_final_data_size,
8639 Arm_input_section::do_reset_address_and_file_offset): New method
8640 definitions.
8641
56ee5e00
DK
86422009-10-21 Doug Kwan <dougkwan@google.com>
8643
8644 * arm.cc (Stub_table, Arm_input_section): New forward class
8645 declarations.
8646 (Stub_table): New class defintion.
8647 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8648 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8649 New method definition.
8650
b569affa
DK
86512009-10-21 Doug Kwan <dougkwan@google.com>
8652
8653 * arm.cc: Update copyright comments.
8654 (Target_arm): New forward class template declaration.
8655 (Arm_address): New type.
8656 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8657 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8658 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8659 constants.
8660 (Insn_template): Same.
8661 (DEF_STUBS): New macro.
8662 (Stub_type): New enum type.
8663 (Stub_template): New class definition.
8664 (Stub): Same.
8665 (Reloc_stub): Same.
8666 (Stub_factory): Same.
8667 (Target_arm::Target_arm): Initialize may_use_blx_ and
8668 should_force_pic_veneer_.
8669 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8670 Target_arm::should_force_pic_veneer,
8671 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8672 Target_arm::using_thumb_only, Target_arm:;default_target): New
8673 method defintions.
8674 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8675 New data member declarations.
8676 (Insn_template::size, Insn_template::alignment): New method defintions.
8677 (Stub_template::Stub_template): New method definition.
8678 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8679 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8680 (Stub_factory::Stub_factory): New method definition.
8681 * gold.h (string_hash): New template.
8682 * output.h (Input_section_specifier::hash_value): Use
8683 gold::string_hash.
8684 (Input_section_specifier::string_hash): Remove.
8685 * stringpool.cc (Stringpool_template::string_hash): Use
8686 gold::string_hash.
8687
6c172549
DK
86882009-10-20 Doug Kwan <dougkwan@google.com>
8689
8690 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8691 symbols of relaxed input sections.
8692 * output.h (Output_section::find_relaxed_input_section): Make
8693 method public.
8694
c5617f2f
DK
86952009-10-16 Doug Kwan <dougkwan@google.com>
8696
8697 * dynobj.cc (Versions::Versions): Initialize version_script_.
8698 Only insert base version symbol definition for a shared object
8699 if version script defines any version versions.
8700 (Versions::define_base_version): New method definition.
8701 (Versions::add_def): Check that base version is not needed.
8702 (Versions::add_need): Define base version lazily.
8703 * dynobj.h (Versions::define_base_version): New method declaration.
8704 (Versions::needs_base_version_): New data member declaration.
8705 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8706 (check_DATA): Add no_version_test.stdout.
8707 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8708 New make rules.
8709 * testsuite/Makefile.in: Regenerate.
8710 * testsuite/no_version_test.c: New file.
8711 * testsuite/no_version_test.sh: Ditto.
8712
3c12dcdb
DK
87132009-10-16 Doug Kwan <dougkwan@google.com>
8714
8715 * expression.cc (class Segment_start_expression): New class definition.
8716 (Segment_start_expression::value): New method definition.
8717 (script_exp_function_segment_start): Return a new
8718 Segment_start_expression.
8719 * gold/script-c.h (script_saw_segment_start_expression): New function
8720 prototype.
8721 * script-sections.cc (Script_sections::Script_sections): Initialize
8722 SAW_SEGMENT_START_EXPRESSION_ to false.
8723 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8724 and -Tbbs options to specify section addresses if given in
8725 command line and no SEGMENT_START expression is seen in a script.
8726 * script-sections.h (Script_sections::saw_segment_start_expression,
8727 Script_sections::set_saw_segment_start_expression): New method
8728 definition.
8729 (Script_sections::saw_segment_start_expression_): New data member
8730 declaration.
8731 * script.cc (script_saw_segment_start_expression): New function.
8732 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8733 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8734 script_test_7.sh and script_test_8.sh.
8735 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8736 script_test_8.stdout.
8737 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8738 (script_test_6, script_test_6.stdout, script_test_7,
8739 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8740 * Makefile.in: Regenerate.
8741 * testsuite/script_test_6.sh: New file.
8742 * testsuite/script_test_6.t: Same.
8743 * testsuite/script_test_7.sh: Same.
8744 * testsuite/script_test_7.t: Same.
8745 * testsuite/script_test_8.sh: Same.
8746
64b1ae37
DK
87472009-10-16 Doug Kwan <dougkwan@google.com>
8748
8749 * output.cc (Output_segment::set_section_list_address): Cast
8750 expressions to unsigned long long type to avoid format warnings.
8751
661be1e2
ILT
87522009-10-15 Ian Lance Taylor <iant@google.com>
8753
12edd763 8754 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 8755 dot assignment to script_sections_.
12edd763
ILT
8756 * script-sections.cc (Script_sections::add_dot_assignment):
8757 Initialize if necessary.
8758
68b6574b
ILT
8759 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8760 program headers with no load segment if there is a linker script.
8761
661be1e2
ILT
8762 * layout.cc (Layout::set_segment_offsets): Align the file offset
8763 to the segment aligment for -N or -n with no load segment.
8764 * output.cc (Output_segment::add_output_section): Don't crash if
8765 the first section is a TLS section.
8766 (Output_segment::set_section_list_addresses): Print an error
8767 message if the address moves backward in a linker script.
8768 * script-sections.cc
8769 (Output_section_element_input::set_section_addresses): Don't
8770 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8771 (Orphan_output_section::set_section_addresses): Likewise.
8772
f15f61a7
DK
87732009-10-15 Doug Kwan <dougkwan@google.com>
8774
8775 * layout.cc (Layout::finish_dynamic_section): Generate tags
8776 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8777 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8778 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8779
82bb573a
ILT
87802009-10-14 Ian Lance Taylor <iant@google.com>
8781
8782 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8783 fields.
8784 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8785 data_shdr fields of relinfo.
8786 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8787 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8788 R_386_TLS_LDO_32, adjust based on section flags.
8789 (Target_i386::Relocate::fix_up_ldo): Remove.
8790
374ad285
ILT
87912009-10-13 Ian Lance Taylor <iant@google.com>
8792
8793 Add support for -pie.
8794 * options.h (class General_options): Add -pie and
8795 --pic-executable.
8796 (General_options::output_is_position_independent): Test -pie.
8797 (General_options::output_is_executable): Return true if not shared
8798 and not relocatable.
8799 (General_options::output_is_pie): Remove.
8800 * options.cc (General_options::finalize): Reject incompatible uses
8801 of -pie.
8802 * gold.cc (queue_middle_tasks): A -pie link is not static.
8803 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8804 * symtab.cc (Symbol::final_value_is_known): Return false if
8805 output_is_position_independent.
8806 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8807 output_is_position_independent.
8808 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8809 output_is_position_independent.
8810 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8811 output_is_position_independent.
8812 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8813 two_file_pie_test.
8814 (basic_pie_test.o, basic_pie_test): New targets.
8815 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8816 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8817 (two_file_pie_test): New target.
8818 * testsuite/Makefile.in: Rebuild.
8819 * README: Remove note saying that -pie is not supported.
8820
c6585162
ILT
88212009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8822
8823 * options.h (class General_options): Add -init and -fini.
8824 * layout.cc (Layout::finish_dynamic_section): Emit
8825 given init and fini functions.
8826
032ce4e9
ST
88272009-10-13 Sriraman Tallam <tmsriram@google.com>
8828
8829 * gc.h (gc_process_relocs): Check if icf is enabled using new
8830 function.
8831 * gold.cc (queue_initial_tasks): Likewise.
8832 (queue_middle_tasks): Likewise.
8833 * object.cc (do_layout): Likewise.
8834 * symtab.cc (is_section_folded): Likewise.
8835 * main.cc (main): Likewise.
8836 * reloc.cc (Read_relocs::run): Likewise.
8837 (Sized_relobj::do_scan_relocs): Likewise.
8838 * icf.cc (is_function_ctor_or_dtor): New function.
8839 (Icf::find_identical_sections): Check if function is ctor or dtor when
8840 safe icf is chosen.
8841 * options.h (General_options::icf): Change option to be an enum.
8842 (Icf_status): New enum.
8843 (icf_enabled): New method.
8844 (icf_safe_folding): New method.
8845 (set_icf_status): New method.
8846 (icf_status_): New variable.
8847 * (options.cc) (General_options::finalize): Set icf_status_.
8848 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8849 icf_test and icf_keep_unique_test to use the --icf enum flag.
8850 * testsuite/icf_safe_test.sh: New file.
e1df38aa 8851 * testsuite/icf_safe_test.cc: New file.
032ce4e9 8852
f345227a
ST
88532009-10-12 Sriraman Tallam <tmsriram@google.com>
8854
8855 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8856 includes to gc.h and icf.h.
8857 * arm.cc: Include gc.h.
8858 * gold.cc: Likewise.
8859 * i386.cc: Likewise.
8860 * powerpc.cc: Likewise.
8861 * sparc.cc: Likewise.
8862 * x86_64.cc: Likewise.
8863 * gc.h: Include icf.h.
8864
1c7814ed
ILT
88652009-10-11 Ian Lance Taylor <iant@google.com>
8866
8867 * plugin.cc: Include "gold.h" before other header files.
8868
ae3b5189
CD
88692009-10-10 Chris Demetriou <cgd@google.com>
8870
8871 * options.h (Input_file_argument::Input_file_type): New enum.
8872 (Input_file_argument::is_lib_): Replace with...
8873 (Input_file_argument::type_): New member.
8874 (Input_file_argument::Input_file_argument): Take Input_file_type
8875 'type' rather than boolean 'is_lib' as second argument.
8876 (Input_file_argument::is_lib): Use type_.
8877 (Input_file_argument::is_searched_file): New function.
8878 (Input_file_argument::may_need_search): Handle is_searched_file.
8879 * options.cc (General_options::parse_library): Support -l:filename.
8880 (General_options::parse_just_symbols): Update for Input_file_argument
8881 changes.
8882 (Command_line::process): Likewise.
8883 * archive.cc (Archive::get_file_and_offset): Likewise.
8884 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8885 * script.cc (read_script_file, script_add_file): Likewise.
8886 * fileread.cc (Input_file::Input_file): Likewise.
8887 (Input_file::will_search_for): Handle is_searched_file.
8888 (Input_file::open): Likewise.
8889 * readsyms.cc (Read_symbols::get_name): Likewise.
8890 * testsuite/Makefile.am (searched_file_test): New test.
8891 * testsuite/Makefile.in: Regenerate.
8892 * testsuite/searched_file_test.cc: New file.
8893 * testsuite/searched_file_test_lib.cc: New file.
8894
f3048a1d
ILT
88952009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8896 Ian Lance Taylor <iant@google.com>
8897
8898 * descriptor.cc: Include <cstdio> and "binary-io.h".
8899 (Descriptors::open): Open the files in binary mode always.
8900 * script.cc (Lex::get_token): Treat \r as whitespace.
8901
d4780e57
ILT
89022009-10-09 Ian Lance Taylor <iant@google.com>
8903
8904 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8905
d9a893b8
ILT
89062009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8907 Ian Lance Taylor <iant@google.com>
8908
8909 * configure.ac: Check for readv function also.
8910 * fileread.cc (readv): Define if not HAVE_READV.
8911 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8912 does not exist.
8913 * config.in: Regenerate.
8914 * configure: Regenerate.
8915
c0a62865
DK
89162009-10-09 Doug Kwan <dougkwan@google.com>
8917
8918 * layout.cc (Layout::make_output_section): Call target hook to make
8919 ordinary output section.
8920 (Layout::finalize): Adjust parameter list of call the
8921 Target::may_relax().
8922 * layout.h (class Layout::section_list): New method.
8923 * merge.h (Output_merge_base::entsize): Change visibility to public.
8924 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8925 New methods.
8926 (Output_merge_string::do_is_string): New method.
8927 * object.cc (Sized_relobj::do_setup): renamed from
8928 Sized_relobj::set_up.
8929 * object.h (Sized_relobj::adjust_shndx,
8930 Sized_relobj::initializ_input_to_output_maps,
8931 Sized_relobj::free_input_to_output_maps): Change visibilities to
8932 protected.
8933 (Sized_relobj::setup): Virtualize.
8934 (Sized_relobj::do_setup): New method declaration.
8935 (Sized_relobj::invalidate_section_offset,
8936 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8937 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8938 * options.cc (parse_int): New function.
8939 * options.h (parse_int): New declaration.
8940 (DEFINE_int): New macro.
8941 (stub_group_size): New option.
8942 * output.cc (Output_section::Output_section): Initialize memebers
8943 merge_section_map_, merge_section_by_properties_map_,
8944 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8945 (Output_section::add_input_section): Handled deferred code-fill
8946 generation and remove an old comment.
8947 (Output_section::add_relaxed_input_section): New method definition.
8948 (Output_section::add_merge_input_section): Use merge section by
8949 properties map to speed to search. Update merge section maps
8950 as appropriate.
8951 (Output_section::build_relaxation_map): New method definition.
8952 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8953 Same.
8954 (Output_section::relax_input_section): Renamed to
8955 Output_section::convert_input_sections_to_relaxed_sections and change
8956 interface to take a vector of pointers to relaxed sections.
8957 (Output_section::find_merge_section,
8958 Output_section::find_relaxed_input_section): New method definitions.
8959 (Output_section::is_input_address_mapped,
8960 Output_section::output_offset, Output_section::output_address):
8961 Use output section data maps to speed up searching.
8962 (Output_section::find_starting_output_address): Add comments.
8963 (Output_section::do_write,
8964 Output_section::write_to_postprocessing_buffer): Do code-fill
8965 generation as appropriate.
8966 (Output_section::get_input_sections): Invalidate relaxed input section
8967 map.
8968 (Output_section::restore_states): Adjust type of checkpoint .
8969 Invalidate relaxed input section map.
8970 * output.h (Output_merge_base): New class declaration.
8971 (Input_section_specifier): New class defintion.
8972 (class Output_relaxed_input_section) Change base class to
8973 Output_section_data_build.
8974 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8975 base class initializer.
8976 (Output_section::add_relaxed_input_section): New method declaration.
8977 (Output_section::Input_section): Change visibility to protected.
2e702c99 8978 (Output_section::Input_section::relobj,
c0a62865
DK
8979 Output_section::Input_section::shndx): Handle relaxed input sections.
8980 Output_section::input_sections) Change visibility to protected. Also
8981 define overload to return a non-const pointer.
8982 (Output_section::Merge_section_properties): New class defintion.
8983 (Output_section::Merge_section_by_properties_map,
8984 Output_section::Output_section_data_by_input_section_map,
8985 Output_section::Relaxation_map): New types.
8986 (Output_section::relax_input_section): Rename method to
8987 Output_section::convert_input_sections_to_relaxed_sections and change
8988 interface to take a vector of relaxed section pointers.
8989 (Output_section::find_merge_section,
8990 Output_section::find_relaxed_input_section,
8991 Output_section::build_relaxation_map,
8992 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8993 New method declarations.
8994 (Output_section::merge_section_map_
8995 Output_section::merge_section_by_properties_map_,
8996 Output_section::relaxed_input_section_map_,
8997 Output_section::is_relaxed_input_section_map_valid_,
8998 Output_section::generate_code_fills_at_write_): New data members.
8999 * script-sections.cc
9000 (Output_section_element_input::set_section_addresses): Call
9001 current_data_size and addralign methods of relaxed input sections.
9002 (Orphan_output_section::set_section_addresses): Call current_data_size
9003 and addralign methods of relaxed input sections.
9004 * symtab.cc (Symbol_table::compute_final_value): Extract template
9005 from the body of Symbol_table::sized_finalize_symbol.
9006 (Symbol_table::sized_finalized_symbol): Call
9007 Symbol_table::compute_final_value.
9008 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
9009 (Symbol_table::compute_final_value): New templated method declaration.
9010 * target.cc (Target::do_make_output_section): New method defintion.
9011 * target.h (Target::make_output_section): New method declaration.
9012 (Target::relax): Add more parameters for input objects, symbol table
9013 and layout. Adjust call to do_relax.
9014 (Target::do_make_output_section): New method declaration.
9015 (Target::do_relax): Add parameters for input objects, symbol table
9016 and layout.
9017
d446d6c4
ILT
90182009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9019
9020 * pread.c: Include stdio.h.
9021
bc06c745
ILT
90222009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9023
9024 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
9025 defined.
9026
75aea3d0
ILT
90272009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9028
9029 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9030 Change read_shndx type to unsigned int.
9031 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9032 int.
9033 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9034 * dwarf_reader.h (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 * layout.cc (Layout::create_symtab_sections): Cast the result of
9040 local_symcount * symsize to off_t in the gold_assert.
9041
be8fcb75
ILT
90422009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9043
9044 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
9045 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
9046 R_ARM_BASE_ABS.
9047 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
9048 (Arm_relocate_functions::thm_abs5): New function.
9049 (Arm_relocate_functions::abs12): New function.
9050 (Arm_relocate_functions::abs16): New function.
9051 (Arm_relocate_functions::base_abs): New function.
9052 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
9053 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
9054 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
9055 R_ARM_BASE_ABS.
9056 (Scan::global): Likewise.
9057 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
9058 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
9059 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
9060 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9061 R_ARM_BASE_ABS.
9062
c2a122b6
ILT
90632009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9064
9065 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
9066 (Arm_relocate_functions::movt_prel): New function.
9067 (Arm_relocate_functions::thm_movw_prel_nc): New function.
9068 (Arm_relocate_functions::thm_movt_prel): New function.
9069 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
9070 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
9071 (Scan::global, Relocate::relocate): Likewise.
9072 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9073
c4aa1e2d
ILT
90742009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9075
9076 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
9077 Incremental_checker.
9078 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
9079 unsigned int.
9080 (class Incremental_inputs_header): New class.
9081 (Incremental_inputs_header_writer): Edit comment.
9082 (Incremental_inputs_entry): New class.
9083 (Incremental_inputs_entry_writer): Edit comment.
9084 (Sized_incremental_binary::do_find_incremental_inputs_section):
9085 Add *strtab_shndx parameter, fill it.
9086 (Sized_incremental_binary::do_check_inputs): New method.
9087 (Incremental_checker::can_incrementally_link_output_file): Use
9088 Sized_incremental_binary::check_inputs.
9089 (Incremental_inputs::report_command_line): Save command line in
9090 command_line_.
9091 * incremental.h:
9092 (Incremental_binary::find_incremental_inputs_section): New
9093 method.
9094 (Incremental_binary::do_find_incremental_inputs_section): Add
9095 strtab_shndx parameter.
9096 (Incremental_binary::do_check_inputs): New pure virtual method.
9097 (Sized_incremental_binary::do_check_inputs): Declare.
9098 (Incremental_checker::Incremental_checker): Add incremental_inputs
9099 parameter, use it to initialize incremental_inputs_.
9100 (Incremental_checker::incremental_inputs_): New field.
9101 (Incremental_checker::command_line): New method.
9102 (Incremental_checker::inputs): New method.
9103 (Incremental_checker::command_line_): New field.
9104
c549a694
ILT
91052009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9106
9107 * incremental.cc: Include <cstdarg> and "target-select.h".
9108 (vexplain_no_incremental): New function.
9109 (explain_no_incremental): New function.
9110 (Incremental_binary::error): New method.
9111 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9112 method.
9113 (make_sized_incremental_binary): New function.
9114 (open_incremental_binary): New function.
9115 (can_incrementally_link_file): Add checks if output is ELF and has
9116 inputs section.
9117 * incremental.h: Include "elfcpp_file.h" and "output.h".
9118 (Incremental_binary): New class.
9119 (Sized_incremental_binary): New class.
9120 (open_incremental_binary): Declare.
9121 * object.cc (is_elf_object): Use
9122 elfcpp::Elf_recognizer::is_elf_file.
9123 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9124 * output.h (Output_file::filesize): New method.
9125
fd3c5f0b
ILT
91262009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9127
9128 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9129 New function.
9130 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9131 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9132 function.
9133 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9134 function.
9135 (Arm_relocate_functions::movw_abs_nc): New function.
9136 (Arm_relocate_functions::movt_abs): New function.
9137 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9138 (Arm_relocate_functions::thm_movt_abs): New function.
9139 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9140 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9141 (Scan::global): Likewise.
9142 (Relocate::relocate): Likewise.
9143 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9144
7f5309a5
ILT
91452009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9146
9147 * arm.cc (Arm_relocate_functions::got_prel) New function.
9148 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9149 (Relocate::relocate): Likewise.
9150 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9151
364c7fa5
ILT
91522009-10-06 Ian Lance Taylor <iant@google.com>
9153
9154 * options.h (class General_options): Define
9155 split_stack_adjust_size parameter.
9156 * object.h (class Object): Add uses_split_stack_ and
9157 has_no_split_stack_ fields. Add uses_split_stack and
9158 has_no_split_stack accessor functions. Declare
9159 handle_split_stack_section.
9160 (class Reloc_symbol_changes): Define.
9161 (class Sized_relobj): Define Function_offsets. Declare
9162 split_stack_adjust, split_stack_adjust_reltype, and
9163 find_functions.
9164 * object.cc (Object::handle_split_stack_section): New function.
9165 (Sized_relobj::do_layout): Call handle_split_stack_section.
9166 * dynobj.cc (Sized_dynobj::do_layout): Call
9167 handle_split_stack_section.
9168 * reloc.cc (Sized_relobj::relocate_sections): Call
9169 split_stack_adjust for executable sections in split_stack
9170 objects. Pass reloc_map to relocate_section.
9171 (Sized_relobj::split_stack_adjust): New function.
9172 (Sized_relobj::split_stack_adjust_reltype): New function.
9173 (Sized_relobj::find_functions): New function.
9174 * target-reloc.h: Include "object.h".
9175 (relocate_section): Add reloc_symbol_changes parameter. Change
9176 all callers.
9177 * target.h (class Target): Add calls_non_split method. Declare
9178 do_calls_non_split virtual method. Declare match_view and
9179 set_view_to_nop.
9180 * target.cc: Include "elfcpp.h".
9181 (Target::do_calls_non_split): New function.
9182 (Target::match_view): New function.
9183 (Target::set_view_to_nop): New function.
9184 * gold.cc (queue_middle_tasks): Give an error if mixing
9185 split-stack and non-split-stack objects with -r.
9186 * i386.cc (Target_i386::relocate_section): Add
9187 reloc_symbol_changes parameter.
9188 (Target_i386::do_calls_non_split): New function.
9189 * x86_64.cc (Target_x86_64::relocate_section): Add
9190 reloc_symbol_changes parameter.
9191 (Target_x86_64::do_calls_non_split): New function.
9192 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9193 parameter.
9194 * powerpc.cc (Target_powerpc::relocate_section): Add
9195 reloc_symbol_changes parameter.
9196 * sparc.cc (Target_sparc::relocate_section): Add
9197 reloc_symbol_changes parameter.
9198 * configure.ac: Call AM_CONDITIONAL for the default target.
9199 * configure: Rebuild.
9200 * testsuite/Makefile.am (TEST_AS): New variable.
9201 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9202 (check_DATA): Add split_i386 and split_x86_64 files.
9203 (SPLIT_DEFSYMS): Define.
9204 (split_i386_[1234n].o): New targets.
9205 (split_i386_[124]): New targets.
9206 (split_i386_[1234r].stdout): New targets.
9207 (split_x86_64_[1234n].o): New targets.
9208 (split_x86_64_[124]): New targets.
9209 (split_x86_64_[1234r].stdout): New targets.
9210 (MOSTLYCLEANFILES): Add new executables.
9211 * testsuite/split_i386.sh: New file.
9212 * testsuite/split_x86_64.sh: New file.
9213 * testsuite/split_i386_1.s: New file.
9214 * testsuite/split_i386_2.s: New file.
9215 * testsuite/split_i386_3.s: New file.
9216 * testsuite/split_i386_4.s: New file.
9217 * testsuite/split_i386_n.s: New file.
9218 * testsuite/split_x86_64_1.s: New file.
9219 * testsuite/split_x86_64_2.s: New file.
9220 * testsuite/split_x86_64_3.s: New file.
9221 * testsuite/split_x86_64_4.s: New file.
9222 * testsuite/split_x86_64_n.s: New file.
9223 * testsuite/testfile.cc (Target_test): Update relocation_section
9224 function.
9225 * testsuite/Makefile.in: Rebuild.
9226
e8a9fcda
ILT
92272009-10-06 Ian Lance Taylor <iant@google.com>
9228
9229 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9230 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9231 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9232 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9233 the address on ldo_addrs_.
9234 (Target_i386::Relocate::fix_up_ldo): New function.
9235
e99daf92
ILT
92362009-10-06 Rafael Espindola <espindola@google.com>
9237
9238 * plugin.cc (add_input_library): New.
9239 (Plugin::load): Add add_input_library to tv.
9240 (Plugin_manager::add_input_file): Add the is_lib argument.
9241 (add_input_file): Update call to Plugin_manager::add_input_file.
9242 (add_input_library): New.
9243 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9244
966d4097
DK
92452009-09-30 Doug Kwan <dougkwan@google.com>
9246
9247 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9248 symbol and call Symbol::may_need_copy_reloc to determine if
9249 a copy reloc is needed.
9250 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9251 nocopyreloc is given in command line.
9252 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9253 given in command line.
9254 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9255 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9256 of the removed Target_i386::may_need_copy_reloc.
9257 * options.h (copyreloc): New option with default value false.
9258 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9259 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9260 instead of the removed Target_powerpc::may_need_copy_reloc.
9261 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9262 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9263 instead of the removed Target_sparc::may_need_copy_reloc.
9264 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9265 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9266 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9267 instead of the removed Target_x86_64::may_need_copy_reloc.
9268
029ba973
ILT
92692009-09-30 Ian Lance Taylor <iant@google.com>
9270
9271 * object.h (class Object): Remove target_ field, and target,
9272 sized_target, and set_target methods.
9273 (Object::sized_target): Remove.
9274 (class Sized_relobj): Update declarations. Remove sized_target.
9275 * object.cc (Sized_relobj::setup): Remove target parameter.
9276 Change all callers.
9277 (Input_objects::add_object): Don't do anything with the target.
9278 (make_elf_sized_object): Add punconfigured parameter. Change all
9279 callers. Set or test parameter target.
9280 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9281 Change all callers.
9282 * parameters.cc (Parameters::set_target): Change parameter type to
9283 be non-const.
9284 (Parameters::default_target): Remove.
9285 (set_parameters_target): Change parameter type to be non-const.
9286 (parameters_force_valid_target): New function.
9287 (parameters_clear_target): New function.
9288 * parameters.h (class Parameters): Update declarations. Remove
9289 default_target method. Add sized_target and clear_target
9290 methods. Change target_ to be non-const.
9291 (set_parameters_target): Update declaration.
9292 (parameters_force_valid_target): Declare.
9293 (parameters_clear_target): Declare.
9294 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9295 as NULL if we aren't searching.
9296 (Add_symbols::run): Don't check for compatible target.
9297 * fileread.cc (Input_file::open_binary): Call
9298 parameters_force_valid_target.
9299 * gold.cc (queue_middle_tasks): Likewise.
9300 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9301 set_target on object.
9302 * dynobj.h (class Sized_dynobj): Update declarations.
9303 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9304 make_elf_object returns NULL.
9305 (Archive::include_member): Don't check whether object target is
9306 compatible.
9307 * output.cc (Output_section::add_input_section): Get target from
9308 parameters.
9309 (Output_section::relax_input_section): Likewise.
9310 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9311 parameters.
9312 (Sized_relobj::do_scan_relocs): Likewise.
9313 (Sized_relobj::relocate_sections): Likewise.
9314 * resolve.cc (Symbol_table::resolve): Likewise.
9315 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9316 parameter. Change all callers.
9317 (Symbol_table::add_from_object): Get target from parameters.
9318 (Symbol_table::add_from_relobj): Don't check object target.
9319 (Symbol_table::add_from_dynobj): Likewise.
9320 (Symbol_table::define_special_symbol): Get target from
9321 parameters.
9322 * symtab.h (class Symbol_table): Update declaration.
9323 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9324 parameter. Change all callers. Clear parameter target.
9325 (Binary_test): Test target here.
9326 * testsuite/object_unittest.cc (gold_testsuite): Remove
9327 target_test_pointer parameter. Change all callers.
9328 (Object_test): Test target here.
9329
a6a22b83
ILT
93302009-09-26 Ian Lance Taylor <iant@google.com>
9331
9332 * testsuite/initpri1.c: Don't try to use constructor priorities if
9333 compiling with gcc before 4.3.
9334
6a8f49fe
ILT
93352009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9336
9337 * testsuite/retain_symbols_file_test.sh (check_present): Change
9338 output file name to retain_symbols_file_test.stdout.
9339 (check_absent): Likewise.
9340
8c604651
CS
93412009-09-18 Craig Silverstein <csilvers@google.com>
9342
9343 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9344 * options.cc: Include <cerrno> and <fstream>.
9345 (General_options::finalize): Parse -retain-symbols-file tag.
9346 * options.h: New flag.
9347 (General_options): New method should_retain_symbol, new
9348 variable symbols_to_retain.
9349 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9350 should_retain_symbol map.
9351 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9352 * testsuite/Makefile.in: Regenerate.
9353 * testsuite/retain_symbols_file_test.sh: New file.
9354
ca58b19f
NC
93552009-09-18 Nick Clifton <nickc@redhat.com>
9356
9357 * po/es.po: Updated Spanish translation.
9358
20e6d0d6
DK
93592009-09-17 Doug Kwan <dougkwan@google.com>
9360
9361 * debug.h (DEBUG_RELAXATION): New constant.
9362 (DEBUG_ALL): Add DEBUG_RELAXATION.
9363 (debug_string_to_enum): Add relaxation debug option.
9364 * layout.cc
9365 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9366 Layout::Relaxation_debug_check::read_sections,
9367 Layout::Relaxation_debug_check::read_sections): New method definitions.
9368 (Layout::Layout): Initialize data members
9369 record_output_section_data_from_scrips_,
9370 script_output_section_data_list_ and relaxation_debug_check_.
9371 (Layout::save_segments, Layout::restore_segments,
9372 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9373 Layout::relaxation_loop_body): New method definitions.
9374 (Layout::finalize): Support relaxation. Move section layout code to
9375 Layout::relaxation_loop_body.
9376 (Layout::set_asection_address_from_script): Move code for orphan
9377 section placement out.
9378 (Layout::place_orphan_sections_in_script): New method definition.
9379 * layout.h (Output_segment_headers, Output_file_header):
9380 New forward class declarations.
9381 (Layout::~Layout): Define.
9382 (Layout::new_output_section_data_from_script): New method definition.
9383 (Layout::place_orphan_sections_in_script): New method declaration.
9384 (Layout::Segment_states): New type declaration.
9385 (Layout::save_segments, Layout::restore_segments,
9386 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9387 Layout::relaxation_loop_body): New method declarations.
9388 (Layout::Output_section_data_list): New type declaration.
9389 (Layout::Relaxation_debug_check): New class definition.
9390 (Layout::record_output_section_data_from_script_,
9391 Layout::script_output_section_data_list_, Layout::segment_states_,
9392 Layout::relaxation_debug_check_): New data members.
9393 * output.cc: (Output_section_headers::do_size): New method definition.
9394 (Output_section_headers::Output_section_headers): Move size
9395 computation to Output_section_headers::do_size.
9396 (Output_segment_headers::do_size): New method definition.
e1df38aa 9397 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
9398 Output_file_header::do_size and call it.
9399 (Output_file_header::do_size): New method definition.
9400 (Output_data_group::Output_data_group): Adjust call to
9401 Output_section_data.
9402 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9403 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 9404 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
9405 RELAXED_INPUT_SECTION_CODE.
9406 (Output_section::Output_section): Initialize data member checkpoint_.
9407 (Output_section::~Output_section): Delete checkpoint object pointed
9408 by checkpoint_.
9409 (Output_section::add_input_section): Always add an Input_section if
9410 relaxing.
9411 (Output_section::add_merge_input_section): Add assert.
9412 (Output_section::relax_input_section): New method definition.
9413 (Output_section::set_final_data_size): Set load address to zero for
9414 an unallocated section.
9415 (Output_section::do_address_and_file_offset_have_reset_values):
9416 New method definition.
9417 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9418 Handle relaxed input section.
9419 (Output_section::sort_attached_input_sections): Checkpoint input
9420 section list lazily.
9421 (Output_section::get_input_sections): Change type of input_sections to
9422 list of Simple_input_section pointers. Checkpoint input section list
9423 lazily. Also handle relaxed input sections.
9424 (Output_section::add_input_section_for_script): Take a reference to
9425 a Simple_input_section object instead of Relobj pointer and section
9426 index as parameter. Handle relaxed input sections.
9427 (Output_section::save_states, Output_section::restore_states): New
9428 method definitions.
9429 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9430 (Output_data::is_data_size_fixed): New method definition.
9431 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9432 if it is fixed.
9433 (Output_data::address_and_file_offset_have_reset_values): New method
9434 definition.
9435 (Output_data::do_address_and_file_offset_have_reset_values): New method
9436 definition.
9437 (Output_data::set_data_size): Check that data size is not fixed.
9438 (Output_data::fix_data_size): New method definition.
9439 (Output_data::is_data_size_fixed_): New data member.
9440 (Output_section_headers::set_final_data_size): New method definition.
9441 (Output_section_headers::do_size): New method declaration.
9442 (Output_segment_headers::set_final_data_size): New method definition.
9443 (Output_segment_headers::do_size): New method declaration.
9444 (Output_file_header::set_final_data_size)::New method definition.
9445 (Output_file_header::do_size)::New method declaration.
9446 (Output_section_data::Output_section_data): Add new parameter
9447 is_data_size_fixed and use it to fix data size.
9448 (Output_data_const::Output_data_const): Adjust call to base class
9449 constructor and fix data size.
9450 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9451 base class constructor and fix data size.
9452 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9453 base class constructor and fix data size.
9454 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9455 class constructor and fix data size.
9456 (Output_data_group::set_final_data_size): New method definition.
9457 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9458 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9459 class constructor and fix data size.
9460 (Output_relaxed_input_section): New class definition.
9461 (Output_section::Simple_input_section): New class definition.
9462 (Output_section::get_input_sections): Adjust parameter list.
9463 (Output_section::add_input_section_for_script): Same.
9464 (Output_section::save_states, Output_section::restore_states,
9465 Output_section::do_address_and_file_offset_have_reset_values,
9466 (Output_section::Input_section::Input_section): Handle
9467 RELAXED_INPUT_SECTION_CODE. Add new overload for
9468 Output_relaxed_input_section.
9469 (Output_section::Input_section::is_input_section,
9470 Output_section::Input_section::set_output_section): Handle relaxed
9471 input section.
9472 (Output_section::Input_section::is_relaxed_input_section,
9473 Output_section::Input_section::output_section_data,
9474 Output_section::Input_section::relaxed_input_section): New method
9475 definitions.
9476 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9477 value.
9478 (Output_section::Input_section::u1_): Update comments.
9479 (Output_section::Input_section::u2_): Add new union member poris.
9480 (Output_section::Checkpoint_output_section): New classs definition.
9481 (Output_section::relax_input_section): New method declaration.
9482 (Output_section::checkpoint_): New data member.
9483 (Output_segment): Update comments.
9484 (Output_segment::Output_segment): Un-privatize copy constructor.
9485 (Output_segment::operator=): Un-privatize.
9486 * script-sections.cc (Output_section_element::Input_section_list):
9487 Change element type to Output_section::Simple_input_section.
9488 (Output_section_element_dot_assignment::set_section_addresses):
9489 Register output section data for relaxation clean up.
9490 (Output_data_exression::Output_data_expression): Adjust call to base
9491 constructor to fix data size.
9492 (Output_section_element_data::set_section_addresses): Register
9493 Output_data_expression object for relaxation clean up.
9494 (struct Input_section_info): Replace Relobj pointer and section index
9495 pair with Output_section::Simple_input_section and Convert struct to a
9496 class.
9497 (Input_section_sorter::operator()): Adjust access to
e1df38aa 9498 Input_section_info data member to use accessors.
20e6d0d6
DK
9499 (Output_section_element_input::set_section_addresses): Use layout
9500 parameter. Adjust code to use Output_section::Simple_input_section
9501 and Input_secction_info classes. Register filler for relaxation
9502 clean up.
9503 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9504 and section index pair with Output_section::Simple_input_section
9505 class. Adjust code accordingly.
9506 (Phdrs_element::release_segment): New method definition.
9507 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9508 segment list.
9509 (Script_sections::release_segments): New method definition.
9510 * gold/script-sections.h (Script_sections::release_segments): New
9511 method declaration.
9512 * gold/target.h (Target::may_relax, Target::relax,
9513 Target::do_may_relax, Target::do_relax): New method definitions.
9514
5e445df6
ILT
95152009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9516
9517 * arm.cc (has_signed_unsigned_overflow): New function.
9518 (Arm_relocate_functions::abs8): New function.
9519 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9520 (Target_arm::Scan::global): Likewise.
9521 (Target_arm::relocate::relocate): Likewise.
9522 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9523 Likewise.
9524
8c604651 95252009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
9526
9527 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9528 * testsuite/Makefile.in: Regenerate.
9529
1e9cc1c2
NC
95302009-09-11 Nick Clifton <nickc@redhat.com>
9531
9532 * po/gold.pot: Updated by the Translation project.
9533
6a89f575
CC
95342009-09-08 Cary Coutant <ccoutant@google.com>
9535
9536 * output.cc (Output_file::open): Add execute permission to empty file.
9537 * testsuite/Makefile.am (permission_test): New test.
9538 * testsuite/Makefile.in: Regenerate.
9539
fdcac5af
ILT
95402009-09-02 Ian Lance Taylor <iant@google.com>
9541
9542 * output.cc (Output_file::resize): Call map_no_anonymous rather
9543 than map.
9544
44453f85
ILT
95452009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9546
9547 * gold.cc: Include "incremental.h".
9548 (queue_initial_tasks): Call Incremental_checker methods.
9549 * incremental.cc: Include "output.h".
9550 (Incremental_checker::can_incrementally_link_output_file): New
9551 method.
9552 * incremental.h (Incremental_checker): New class.
9553
9554 * output.cc (Output_file::open_for_modification): New method.
9555 (Output_file::map_anonymous): Changed return type to bool. Record
9556 map in base_ field.
9557 (Output_file::map_no_anonymous): New method, broken out of map.
9558 (Output_file::map): Use map_no_anonymous and map_anonymous.
9559 * output.h (class Output_file): Update declarations.
9560
293c1386
CC
95612009-08-24 Cary Coutant <ccoutant@google.com>
9562
9563 * options.h (Command_line::Pre_options): New class.
9564 (Command_line::pre_options): New member.
9565 * options.cc (gold::options::ready_to_register): New variable.
9566 (One_option::register_option): Do nothing if not registering options.
9567 Assert if same short option registered twice.
9568 (General_options::General_options): Turn off option registration when
9569 done constructing.
9570 (Command_line::Pre_options::Pre_options): New constructor.
9571
f773f3d2
CC
95722009-08-24 Cary Coutant <ccoutant@google.com>
9573
06a73cfe
CC
9574 * options.h (General_options::no_keep_memory): Remove incorrect
9575 short option.
f773f3d2 9576
a15af8e2
RW
95772009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9578
9579 * Makefile.am (am__skiplex, am__skipyacc): New.
9580 * Makefile.in: Regenerate.
9581
c462b41b
RW
95822009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9583
14ec8efd
RW
9584 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9585 (INCLUDES): ... this.
9586 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9587 (AM_CPPFLAGS): Renamed from ...
9588 (INCLUDE): ... this.
9589 * Makefile.in, testsuite/Makefile.in: Regenerate.
9590
81ecdfbb
RW
9591 * Makefile.in: Regenerate.
9592 * aclocal.m4: Likewise.
9593 * config.in: Likewise.
9594 * configure: Likewise.
9595 * testsuite/Makefile.in: Likewise.
9596
c462b41b
RW
9597 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9598 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9599 * Makefile.in: Regenerate.
9600 * testsuite/Makefile.in: Regenerate.
9601
2da73f13
CC
96022009-08-19 Cary Coutant <ccoutant@google.com>
9603
9604 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9605 symbols in shared libraries overridden by hidden or internal symbols
9606 in the main program.
9607
2db70501
CD
96082009-08-19 Chris Demetriou <cgd@google.com>
9609
9610 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9611 checking source file names in error messages.
9612
f733487b
DK
96132009-08-18 Doug Kwan <dougkwan@google.com>
9614
9615 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9616 an elcpp::Ehdr as parameter. Adjust call to set_target.
9617 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9618 an elfcpp::Ehdr as parameter.
9619 * object.cc (Object::set_target): Remove the version that looks up
9620 a target and sets it.
9621 (Sized_relobj::setup): Take a Target object instead of
9622 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9623 (make_elf_sized_object): Find target and ask target to
9624 make an ELF object.
9625 * object.h: (Object::set_target): Remove the version that looks up
9626 a target and sets it.
9627 (Sized_relobj::setup): Take a Target object instead of
9628 an elfcpp:Ehdr as parameter.
9629 * target.cc: Include dynobj.h.
9630 (Target::do_make_elf_object_implementation): New.
2e702c99 9631 (Target::do_make_elf_object): New.
f733487b
DK
9632 * target.h (Target::make_elf_object): New template declaration.
9633 (Target::do_make_elf_object): New method declarations.
9634 (Target::do_make_elf_object_implementation): New template declaration.
9635
cc70f101
ILT
96362009-08-14 Ian Lance Taylor <iant@google.com>
9637
9638 * gold.h (FUNCTION_NAME): Define.
9639 (gold_unreachable): Use FUNCTION_NAME.
9640
ef5e0cb1
ST
96412009-08-12 Sriraman Tallam <tmsriram@google.com>
9642
9643 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9644 symbol in the --keep-unique list is not found.
9645
48c187ce
ST
96462009-08-12 Sriraman Tallam <tmsriram@google.com>
9647
9648 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9649 been maked as --keep-unique.
9650 (Icf::unfold_section): New function.
9651 * icf.h (Icf::unfold_section): New function.
9652 * options.h (General_options::keep_unique): New option.
9653 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9654 * testsuite/Makefile.in: Regenerate.
9655 * testsuite/icf_keep_unique_test.sh: New file.
9656 * testsuite/icf_keep_unique_test.cc: New file.
9657
645afe0c
CC
96582009-08-12 Cary Coutant <ccoutant@google.com>
9659
9660 PR 10471
9661 * resolve.cc (Symbol_table::resolve): Check for references from
9662 dynamic objects to hidden and internal symbols.
9663 * testsuite/Makefile.am (hidden_test.sh): New test.
9664 * testsuite/Makefile.in: Regenerate.
9665 * testsuite/hidden_test.sh: New script.
9666 * testsuite/hidden_test_1.c: New test source.
9667 * testsuite/hidden_test_main.c: New test source.
9668
11af873f
DK
96692009-08-11 Doug Kwan <dougkwan@google.com>
9670
9671 * arm.cc: Update comments.
9672 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9673 segment to locate the .ARM.exidx section if present.
9674
b9f7d72d
DK
96752009-08-09 Doug Kwan <dougkwan@google.com>
9676
9677 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9678 patch.
9679
ddd3c53c
ST
96802009-08-07 Sriraman Tallam <tmsriram@google.com>
9681 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9682 compiler warnings.
9683
27721062
ST
96842009-08-06 Sriraman Tallam <tmsriram@google.com>
9685
9686 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9687 valid tls_segment only for non-debug-section relocations.
9688 * testsuite/Makefile.am: Add gc_tls_test.
9689 * testsuite/Makefile.in: Regenerate.
9690 * testsuite/gc_tls_test.cc: New file.
9691 * testsuite/gc_tls_test.sh: New file.
9692
ef15dade 96932009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 9694
ef15dade
ST
9695 * icf.cc: New file.
9696 * icf.h: New file.
9697 * Makefile.am (CCFILES): Add icf.cc.
9698 (HFILES): Add icf.h
9699 * Makefile.in: Regenerate.
9700 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9701 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9702 section, symbol and addend information for the relocs.
9703 * gold.cc (queue_middle_tasks): Call identical code folding.
9704 * gold.h: Add defines for multimap.
9705 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9706 to the call of finalize_local_symbols.
9707 * main.cc (main): Create object of class Icf.
9708 * object.cc (Sized_relobj::do_layout): Allow this function to be
9709 called twice during icf.
9710 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9711 to sections marked as identical by icf.
9712 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9713 when available.
9714 (Sized_relobj::do_section_entsize): New function.
9715 * object.h (Object::section_entsize): New function.
9716 (Object::do_section_entsize): New pure virtual function.
9717 (Relobj::finalize_local_symbols): Add new parameter.
9718 (Relobj::do_section_entsize): New function.
9719 * options.h (General_options::icf): New option.
9720 (General_options::icf_iterations): New option.
9721 (General_options::print_icf_sections): New option.
9722 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9723 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9724 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9725 icf.
9726 * symtab.cc (Symbol_table::is_section_folded): New function.
9727 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9728 to sections marked as identical by icf.
9729 * symtab.h (Symbol_table::set_icf): New function.
9730 (Symbol_table::icf): New function.
9731 (Symbol_table::is_section_folded): New function.
9732 (Symbol_table::icf_): New data member.
9733 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9734 * testsuite/Makefile.am: Add commands to build icf_test.
9735 * testsuite/Makefile.in: Regenerate.
9736 * testsuite/icf_test.sh: New file.
9737 * testsuite/icf_test.cc: New file.
9738
c3b65ac4
CD
97392009-07-24 Chris Demetriou <cgd@google.com>
9740
9741 * layout.cc (is_compressible_debug_section): Fix incorrect
9742 comment about compressed section names.
9743
1caf2c51
ILT
97442009-07-20 Ian Lance Taylor <ian@airs.com>
9745
9746 PR 10419
9747 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9748
1ef4d87f
ILT
97492009-07-16 Ian Lance Taylor <iant@google.com>
9750
9751 PR 10400
9752 * layout.h: #include <map>.
9753 (class Kept_section): Change from struct to class. Add accessors
9754 and setters. Add section size to Comdat_group mapping. Change
9755 Comdat_group to std::map. Add is_comdat_ field. Add
9756 linkonce_size field in union.
9757 (class Layout): Update declaration of find_or_add_kept_section.
9758 Don't declare find_kept_object.
9759 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9760 parameter. Add object, shndx, is_comdat, and is_group_name
9761 parameters. Change all callers. Adjust for new Kept_section.
9762 (Layout::find_kept_object): Remove.
9763 * object.cc (Sized_relobj::include_section_group): Update use of
9764 Kept_section. Rename secnum to shndx. Only record
9765 Kept_comdat_section if sections are the same size.
9766 (Sized_relobj::include_linkonce_section): Update use of
9767 Kept_section. Only record Kept_comdat_section if sections are the
9768 same size. Set size of linkonce section.
9769 (Sized_relobj::map_to_kept_section): Update call to
9770 get_kept_comdat_section.
9771 * object.h (class Sized_relobj): Rename fields in
9772 Kept_comdat_section to drop trailing underscores; change object
9773 field to Relobj*. Change Kept_comdat_section_table to store
9774 struct rather than pointer.
9775 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9776 Add kept_object and kept_shndx parameters. Change all callers.
9777 (Sized_relobj::get_kept_comdat_section): Change return type to
9778 bool. Add kept_object and kept_shndx parameters. Change all
9779 callers.
9780 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9781 Layout::find_or_add_kept_section.
9782
37c3b7b0
ILT
97832009-07-09 Ian Lance Taylor <iant@google.com>
9784
9785 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9786 Reserve space in the hash table.
9787
98fa85cb
ILT
97882009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9789
9790 * fileread.cc (File_read::get_mtime): New method.
9791 * fileread.h (Timespec): New structure.
9792 (File_read::get_mtime): New method.
9793 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9794 Renamed from timestamp_nsec.
9795 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9796 Elf_Xword.
e1df38aa 9797 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 9798 timestamp_nsec.
e1df38aa 9799 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
9800 (Incremental_inputs::report_obejct): Save mtime; style fix.
9801 (Incremental_inputs::report_script): Save mtime; style fix.
9802 (Incremental_inputs::finalize_inputs): Style fix.
9803 (Incremental_inputs::finalize): Style fix.
9804 (Incremental_inputs::create_input_section_data): Store inputs
9805 mtime.
9806 * incremental.h (Incremental_inputs::report_script): Add mtime
9807 argument.
9808 (Incremental_inputs::Input_info::Input_info): Intialize only one
9809 union member.
9810 (Incremental_inputs::Input_info::archive): Move to nameless
9811 union.
9812 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9813 (Incremental_inputs::Input_info::script): Move to nameless union.
9814 (Incremental_inputs::mtime): New field.
9815 * script.cc (read_input_script): Pass file mtime to
9816 Incremental_input.
9817 * script.h (Script_info::inputs): Style fix.
9818
c9d70757
ILT
98192009-07-01 Ian Lance Taylor <ian@airs.com>
9820
9821 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9822 instead of 32.
9823
9c547ec3
ILT
98242009-06-24 Ian Lance Taylor <iant@google.com>
9825
9826 PR 10156
9827 * layout.cc (Layout::choose_output_section): If we find an
9828 existing section, update the flags.
9829 (Layout::create_notes): New function, broken out of
9830 Layout::finalize.
9831 (Layout::finalize): Don't create note sections.
9832 (Layout::create_note): Don't crash if linker script discards
9833 section.
9834 (Layout::create_gold_note): Likewise.
9835 (Layout::create_build_id): Likewise. Don't set
9836 after_input_sections on the section.
9837 (Layout::create_executable_stack_info): Remove target parameter.
9838 Change caller.
9839 * layout.h (class Layout): Declare create_notes. Update
9840 declaration of create_executable_stack_info.
9841 * gold.cc (queue_middle_tasks): Call create_notes.
9842 * output.cc (Output_section::update_flags_for_input_section): Move
9843 here from output.h. If SHF_ALLOC flag is newly set, mark address
9844 invalid.
9845 * output.h (Output_data::mark_address_invalid): New function.
9846 (class Output_section): Only declare, not define,
9847 update_flags_for_input_section. Remove set_flags.
9848
55458500
ILT
98492009-06-24 Ian Lance Taylor <iant@google.com>
9850
9851 * script-sections.cc (Output_section_definition::
9852 set_section_addresses): Rename shadowing local load_address to
9853 laddr.
9854
1307d6cd
ILT
98552009-06-24 Ian Lance Taylor <iant@google.com>
9856
9857 PR 10244
9858 * reloc.cc (relocate_sections): Skip empty relocation sections.
9859
ec3f783e
ILT
98602009-06-23 Ian Lance Taylor <iant@google.com>
9861
9862 PR 10156
9863 * layout.cc (Layout::create_note): Use choose_output_section
9864 rather than make_output_section.
9865
459c9f1c
ILT
98662009-06-23 Ian Lance Taylor <iant@google.com>
9867
9868 PR 10237
9869 * options.cc (General_options::parse_V): Set printed_version_.
9870 (General_options::General_options): Initialize printed_version_.
9871 * options.h (class General_options): Add printed_version_ field.
9872 * gold.cc (queue_initial_tasks): If there are no input files,
9873 don't give a fatal error if we printed the version information.
9874 (queue_middle_tasks): If using -r with a shared object, give a
9875 fatal error rather than an ordinary error.
9876
1518dc8f
ILT
98772009-06-23 Ian Lance Taylor <iant@google.com>
9878
9879 PR 10219
9880 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9881 (Layout::make_output_section): Set have_stabstr_section_ if we see
9882 a .stab*str section.
9883 (Layout::finalize): Call link_stabs_sections.
9884 (Layout::link_stabs_sections): New file.
9885 * layout.h (class Layout): Add have_stabstr_section_ field.
9886 Declare link_stabs_sections.
9887
3d857b98
DK
98882009-06-23 Doug Kwan <dougkwan@google.com>
9889
9890 * Makefile.am (libgold_a_LIBADD): New.
9891 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 9892 * Makefile.in: Regenerate.
3d857b98
DK
9893 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9894 * configure: Regenerate.
9895 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9896 * fileread.cc: Include sys/state.h
9897 * gold.h: Declare memmem and strndup if found missing.
9898 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9899
0639a6f6
ILT
99002009-06-23 Ian Lance Taylor <iant@google.com>
9901
9902 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9903 * configure: Rebuild.
9904
8d63875c
ILT
99052009-06-23 Ian Lance Taylor <iant@google.com>
9906
9907 PR 10147
9908 * object.cc (Object::section_contents): Don't try to get a view if
9909 the section has length zero.
9910 (Object::handle_gnu_warning_section): If the section is empty, use
9911 the name of the section as the warning.
9912
f7c8a183
ILT
99132009-06-23 Ian Lance Taylor <iant@google.com>
9914
9915 PR 10133
9916 * stringpool.h (class Stringpool_template): Add optimize_ field.
9917 (Stringpool_template::set_optimize): New function.
9918 * stringpool.cc (Stringpool_template::Stringpool_template):
9919 Initialize optimize_ field.
9920 (Stringpool_template::set_string_offsets): Test local optimize
9921 fild rather than parameter.
9922 * layout.cc (Layout::Layout): Call set_optimize on the section
9923 name stringpool.
9924
e6a307ba
ILT
99252009-06-22 Ian Lance Taylor <iant@google.com>
9926
9927 PR 10030
9928 * yyscript.y: Parse TARGET.
9929 * script.cc (script_set_target): New function.
9930 * script-c.h (script_set_target): Declare.
9931 * options.cc (General_options::string_to_object_format): Rename
9932 from string_to_object_format in anonymous namespace. Change
9933 callers.
9934 * options.h (class General_options): Declare
9935 string_to_object_format.
9936
3ee173de
ILT
99372009-06-22 Ian Lance Taylor <iant@google.com>
9938
9939 * script-sections.cc (Script_sections::create_segments): Don't put
9940 program headers in a PT_LOAD segment if -n or -N.
9941
99422009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
9943
9944 PR 10141
9945 * options.h (class General_options): Add -z lazy and -z now. Sort
9946 -z options into alphabetical order.
9947 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9948
cd6739a1 99492009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
9950
9951 * layout.cc (Layout::make_output_section): Call
9952 Target::new_output_section.
9953 (Layout::attach_allocated_section_to_segment): Put large section
9954 sections in a separate load segment with the large segment flag
9955 set.
9956 (Layout::segment_precedes): Sort large data segments after other
9957 load segments.
9958 (align_file_offset): New static function.
9959 (Layout::set_segment_offsets): Use align_file_offset.
9960 * output.h (class Output_section): Add is_small_section_ and
9961 is_large_section_ fields.
9962 (Output_section::is_small_section): New function.
9963 (Output_section::set_is_small_section): New function.
9964 (Output_section::is_large_section): New function.
9965 (Output_section::set_is_large_section): New function.
9966 (Output_section::is_large_data_section): New function.
9967 (class Output_segment): Add is_large_data_segment_ field.
9968 (Output_segment::is_large_data_segment): New function.
9969 (Output_segment::set_is_large_data_segment): New function.
9970 * output.cc (Output_section::Output_section): Initialize new
9971 fields.
9972 (Output_segment::Output_segment): Likewise.
9973 (Output_segment::add_output_section): Add assertion that large
9974 data sections always go in large data segments. Force small data
9975 sections to the end of the list of data sections. Force small BSS
9976 sections to the start of the list of BSS sections. For large BSS
9977 sections to the end of the list of BSS sections.
9978 * symtab.h (class Symbol): Declare is_common_shndx.
9979 (Symbol::is_defined): Check Symbol::is_common_shndx.
9980 (Symbol::is_common): Likewise.
9981 (class Symbol_table): Define enum Commons_section_type. Update
9982 declarations. Add small_commons_ and large_commons_ fields.
9983 * symtab.cc (Symbol::is_common_shndx): New function.
9984 (Symbol_table::Symbol_table): Initialize new fields.
9985 (Symbol_table::add_from_object): Put small and large common
9986 symbols in the right list.
9987 (Symbol_table::sized_finalized_symbol): Check
9988 Symbol::is_common_shndx.
9989 (Symbol_table::sized_write_globals): Likewise.
9990 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9991 common symbol lists. Don't call do_allocate_commons_list if the
9992 list is empty.
9993 (Symbol_table::do_allocate_commons_list): Remove is_tls
9994 parameter. Add comons_section_type parameter. Change all
9995 callers. Handle small and large common symbols.
9996 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9997 Symbol::is_common_shndx.
9998 * resolve.cc (symbol_to_bits): Likewise.
9999 * target.h (Target::small_common_shndx): New function.
10000 (Target::small_common_section_flags): New function.
10001 (Target::large_common_shndx): New function.
10002 (Target::large_common_section_flags): New function.
10003 (Target::new_output_section): New function.
10004 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10005 small_common_section_flags, and large_common_section_flags
10006 fields.
10007 (Target::do_new_output_section): New virtual function.
10008 * arm.cc (Target_arm::arm_info): Initialize new fields.
10009 * i386.cc (Target_i386::i386_info): Likewise.
10010 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
10011 Likewise.
10012 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
10013 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10014 (Target_x86_64::do_new_output_section): New function.
10015 * configure.ac: Define conditional MCMODEL_MEDIUM.
10016 * testsuite/Makefile.am (check_PROGRAMS): Add large.
10017 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
10018 (large_LDFLAGS): Define.
10019 * testsuite/large.c: New file.
10020 * testsuite/testfile.cc (Target_test::test_target_info):
10021 Initialize new fields.
10022 * configure, testsuite/Makefile.in: Rebuild.
10023
bb04269c
DK
100242009-06-05 Doug Kwan <dougkwan@google.com>
10025
10026 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 10027 * Makefile.in: Regenerate.
bb04269c
DK
10028 * i386.cc (class Target_i386): Define new virtual method to
10029 override do_is_local_label_name in parent.
10030 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10031 local symbols if --discard-locals or -X is given.
10032 * options.h (class General_options): Declare new options
10033 '--discard-locals' and '-X' for discarding locals.
10034 * target.h (class Target): Define new methods is_local_label_name.
10035 Declare new virtual method do_is_local_label_name.
10036 * target.cc: New file.
10037 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10038 (check_SCRIPTS): Add discard_locals_test.sh.
10039 (check_DATA): Add discard_local_tests.syms.
10040 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
10041 (discard_local_tests.syms, discard_locals_test.o): New make rules.
10042 * testsuite/Makefile.in: Regenerate.
10043 * testsuite/discard_locals_test.c: New file.
10044 * testsuite/discard_locals_test.sh: Same.
10045
805bb01c
DK
100462009-06-05 Doug Kwan <dougkwan@google.com>
10047
10048 * object.cc (Sized_relobj::Sized_relobj): Initialize
10049 discarded_eh_frame_shndx_ to -1U.
10050 (Sized_relobj::do_layout): Record index of a discard .eh_frame
10051 section.
10052 (Sized_relobj::do_count_local_symbols): Skip local symbols in
10053 a discarded .eh_frame section.
10054 (Sized_relobj::do_finalize_local_symbols): Ditto.
10055 * object.h (class Sized_relobj): Declare new member
10056 discarded_eh_frame_shndx_.
10057 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
10058 (local_labels_test.o, local_labels_test): New rules.
10059 * testsuite/Makefile.in: Regenerate.
10060
1dcd334d
DK
100612009-06-04 Doug Kwan <dougkwan@google.com>
10062
10063 * layout.cc (Layout::section_name_mapping): Add mapping for
10064 special ARM sections.
10065
96d49306
DK
100662009-06-03 Doug Kwan <dougkwan@google.com>
10067
10068 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
10069 (utils::has_overflow): Same.
10070
dff16297
ILT
100712009-06-03 Ian Lance Taylor <iant@google.com>
10072
10073 * layout.cc (Layout::section_name_mapping): New array, replacing
10074 Layout::linkonce_mapping.
10075 (Layout::section_name_mapping_count): New variable, replacing
10076 Layout::linkonce_mapping_count.
10077 (Layout::linkonce_output_name): Remove.
10078 (Layout::output_section_name): Rewrite.
10079 * layout.h (class Layout): Rename Linkonce_mapping to
10080 Section_name_mapping, linkonce_mapping to section_name_mapping,
10081 linkonce_mapping_count to section_name_mapping_count. Don't
10082 declare linkonce_output_name.
10083
c121c671
DK
100842009-06-03 Doug Kwan <dougkwan@google.com>
10085
10086 * gold/arm.cc (namespace utils): New.
10087 (Target_arm::reloc_is_non_pic): Define new method.
10088 (class Arm_relocate_functions): New.
10089 (Target_arm::Relocate::relocate): Handle relocation types used by
10090 Android.
10091
07800fab
ILT
100922009-06-03 Ian Lance Taylor <iant@google.com>
10093
10094 * arm.cc (Target_arm::scan::global): Use || instead of |.
10095
c121c671
DK
100962009-06-02 Doug Kwan <dougkwan@google.com>
10097
10098 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10099 issued_non_pic_error_.
10100 (class Target_arm::Scan): Declare new method check_non_pic.
10101 Define new method symbol_needs_plt_entry.
10102 Declare new data member issued_non_pic_error_.
10103 (class Target_arm::Relocate): Declare new method
10104 should_apply_static_reloc.
10105 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10106 (Target_arm::Scan::check_non_pic): Define new method.
10107 (Target_arm::Scan::local): Handle a small subset of reloc types used
10108 by Android.
10109 (Target_arm::Scan::local): Same.
10110 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10111
b19b0c6d
ILT
101122009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10113
10114 * incremental.cc (Incremental_inputs::report_command_line): Filter
10115 out --incremental-* options.
10116
94cdfcff
DK
101172009-05-29 Doug Kwan <dougkwan@google.com>
10118
10119 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10120 template class.
10121 (class Target_arm): Update comment.
10122 (Target_arm::Target_arm): Initialize new data members GOT_,
10123 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10124 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10125 and Target_arm::rel_dyn_section.
10126 Declare new_enum Target_arm::Got_type.
10127 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10128 and DYNBSS_.
10129 Update commments for member do_dynsym_value.
10130 (Target_arm::got_size, Target_arm::plt_section,
10131 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10132 new methods inside class defintion.
10133 (Target_arm::got_section): Define new method.
10134 (Target_arm::rel_dyn_section): Same.
10135 (Output_data_plt_arm): New template class.
10136 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10137 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10138 (Output_data_plt_arm::add_entry): Same.
10139 (Output_data_plt_arm::first_plt_entry): Define new
10140 static data member for PLT instruction template.
10141 (Output_data_plt_arm::plt_entry): Same.
10142 (Output_data_plt_arm::do_write): Define new method.
10143 (Target_arm::make_plt_entry): Same.
10144 (Target_arm::do_finalize_sections): Same.
10145 (Target_arm::do_dynsym_value): Same.
10146
4a657b0d
DK
101472009-05-28 Doug Kwan <dougkwan@google.com>
10148
10149 * Makefile.am (TARGETSOURCES): Add arm.cc.
10150 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10151 * Makefile.in: Regenerate.
10152 * arm.cc: New file.
10153 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10154
e7ae8c36
DK
101552009-05-26 Doug Kwan <dougkwan@google.com>
10156
10157 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10158 (General_options::check_excluded_libs): Strip off directories in
10159 archive name before matching like GNU ld does.
10160 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10161 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10162 (exclude_libs_test_LDFLAGS): Add linker option
10163 -Wl,--exclude-libs,libexclude_libs_test_3
10164 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10165 an explicit archive without using -l.
10166 (alt/libexclude_libs_test_3.a): New make rule.
10167 * testsuite/Makefile.in: Regenerate.
10168 * testsuite/exclude_libs_test.c : Declare lib3_default().
10169 (main): Call it.
10170 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10171 * exclude_libs_test_3.c: New file.
10172
f12e7348
NC
101732009-05-26 Nick Clifton <nickc@redhat.com>
10174
10175 * po/id.po: New Indonesian translation.
10176 * po/gold.pot: Updated template file.
10177
4daadc0d
ST
101782009-05-22 Sriraman Tallam <tmsriram@google.com>
10179
e1df38aa 10180 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
10181 gc_comdat_test files. Add -Wl,--gc-sections to build
10182 gc_comdat_test.
10183 * testsuite/Makefile.in: Regenerate.
10184 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10185
531813ad
ST
101862009-05-21 Sriraman Tallam <tmsriram@google.com>
10187
10188 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10189 kept comdat section was garbage collected.
10190 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10191 * testsuite/Makefile.in: Regenerate.
10192 * testsuite/gc_comdat_test.sh: New file.
10193 * testsuite/gc_comdat_test_1.cc: New file.
10194 * testsuite/gc_comdat_test_2.cc: New file.
10195
65514900
CC
101962009-05-19 Doug Kwan <dougkwan@google.com>
10197
10198 * archive.cc (Archive::Archive): Move constructor from archive.h
10199 to here. Initialize no_export_.
10200 (Archive::get_elf_object_for_member): Set no_export flag of object.
10201 * archive.h (Archive::Archive): Move constructor body to
10202 archive.cc.
10203 (Archive::no_export): New method.
10204 (Archive::no_export_): New field.
10205 * object.h (Object::Object): Initialize no_export_ to false.
10206 (Object::no_export, Object::set_no_export): New methods.
10207 (Object::no_export_): New field.
10208 * options.cc (General_options::parse_exclude_libs): New method.
10209 (General_options::check_excluded_libs) Same.
10210 * options.h (exclude_libs): New option.
10211 (General_options::check_excluded_libs): New method declaration.
10212 (General_options::excluded_libs_): New field.
10213 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10214 default or protected visibility if an object has no-export flag set.
10215 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10216 (check_SCRIPTS): Add exclude_libs_test.sh.
10217 (check_DATA): Add exclude_libs_test.syms.
10218 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10219 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10220 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10221 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10222 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10223 libexclude_libs_test_2.a): New rules.
10224 * testsuite/Makefile.in: Regenerate.
10225 * testsuite/exclude_libs_test.c: New file.
10226 * testsuite/exclude_libs_test.sh: Ditto.
10227 * testsuite/exclude_libs_test_1.c: Ditto.
10228 * testsuite/exclude_libs_test_2.c: Ditto.
10229
1b77ea50
ILT
102302009-05-15 Ian Lance Taylor <iant@google.com>
10231
10232 * configure.ac: Check for declarations for cases where libiberty.h
10233 checks HAVE_DECL_xxx.
10234 * configure, config.in: Rebuild.
10235
072fe7ce
ILT
102362009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10237
10238 * gold.h (Incremental_argument_list): Remove (invalid) forward
10239 declaration.
10240 * incremental.cc (Incremental_inputs::report_achive): New method.
10241 (Incremental_inputs::report_object): New method.
10242 (Incremental_inputs::report_script): New method.
10243 (Incremental_inputs::finalize_inputs): New method.
10244 (Incremental_inputs::finalize): Call finalize_inputs().
10245 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10246 Create inputs entries.
10247 * incremental.h (Incremental_input_type): New enum.
10248 (Incremental_inputs::Incremental_input): Initialize new fields.
10249 (Incremental_inputs::report_inputs): New method.
10250 (Incremental_inputs::report_achive): New method.
10251 (Incremental_inputs::report_object): New method.
10252 (Incremental_inputs::report_script): New method.
10253 (Incremental_inputs::finalize_inputs): New method.
10254 (Incremental_inputs::Input_info): New struct.
10255 (Incremental_inputs::Input_info_map): New typedef.
10256 (Incremental_inputs::lock_): New field.
10257 (Incremental_inputs::Inputs_): New field.
10258 (Incremental_inputs::Inputs_map): New field.
10259 * main.cc (main): Call Incremental_input::report_inputs.
10260 * options.h (Input_argument_list): Typedef moved from
10261 Input_arguments.
10262 (Input_file_group::Files): Remove, use ::Input_argument_list.
10263 (Input_file_group::Input_argument_list): Remove, use
10264 ::Input_argument_list.
10265 * plugin.cc (Plugin_manager::add_input_file): Add error in
10266 incremental build.
10267 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10268 functions.
10269 * script.cc (read_input_script): Call
10270 Incremental_input::report_script.
10271 * script.h (Script_info): New class.
10272
b0481b0b
ILT
102732009-04-27 Ian Lance Taylor <iant@google.com>
10274
10275 * x86_64.cc (do_adjust_output_section): Set entsize to
10276 plt_entry_size.
10277
b22a5a41 102782009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
10279
10280 * output.cc (Output_file::close): After short writes, continue
10281 writing from the correct offset in the buffer being written.
10282
40fde488
CD
102832009-04-23 Chris Demetriou <cgd@google.com>
10284
10285 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10286 * configure: Regenerate.
10287 * config.in: Regenerate.
10288 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10289 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10290
3ce2c28e
ILT
102912009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10292
10293 * incremental.cc (Incremental_inputs_header_data): Renamed from
10294 Incremental_input_header_data.
10295 (Incremental_inputs_header_data::data_size): New field.
10296 (Incremental_inputs_header_data::put_input_file_count): Renamed
10297 from input_file_count.
10298 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10299 from command_line_offset.
10300 (Incremental_inputs_header_data::put_reserved): Renamed from
10301 put_reserved.
10302 (Incremental_inputs_entry_data): Renamed from
10303 Incremental_input_entry_data.
10304 (Incremental_inputs_entry_data::data_size): New field.
10305 (Incremental_inputs::report_command_line): New method.
10306 (Incremental_inputs::finalize): New method.
10307 (Incremental_inputs::create_incremental_inputs_data): New method.
10308 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10309 * incremental.h: New file.
10310 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10311 (Layout::finalize): Create incremental inputs section in
10312 incremental builds.
10313 (Layout::create_incremental_info_sections): New method.
10314 * layout.h (Layout::incremental_inputs): New method.
10315 (Layout::create_incremental_info_sections): New method.
10316 (Layout::incremental_inputs_): New field.
10317 * main.cc (main): Notify Incremental_input of the command line.
10318
e55bde5e
ILT
103192009-04-01 Ian Lance Taylor <iant@google.com>
10320 Mikolaj Zalewski <mikolajz@google.com>
10321
10322 * gold.h (reserve_unordered_map): Define, three versions, one for
10323 each version of Unordered_map.
10324 * layout.cc (Layout::Layout): Remove options parameter. Add
10325 number_of_input_files parameter. Don't initialize options_.
10326 Initialize number_of_input_files_ and resized_signatures_. Move
10327 sections_are_attached_.
10328 (Layout::layout_group): Reserve space for group_signatures_.
10329 (Layout::find_or_add_kept_section): Change name parameter to be a
10330 reference. Resize signatures_ map when it gets large enough.
10331 (Layout::layout_eh_frame): Use parameters->options() instead of
10332 this->options_.
10333 (Layout::make_output_section): Likewise.
10334 (Layout::attach_allocated_section_to_segment): Likewise.
10335 (Layout::finalize, Layout::create_executable_stack): Likewise.
10336 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10337 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10338 * layout.h (class Layout): Update declarations. Remove options_
10339 field. Add number_of_input_files_ and resized_signatures_
10340 fields. Move sections_are_attached_ field.
10341 * main.cc (main): Pass number of input files to Layout
10342 constructor. Don't pass options.
10343
154b857c
ILT
103442009-03-30 Ian Lance Taylor <iant@google.com>
10345
10346 * ffsll.c (ffsll): Correct implementation.
10347
2f35ab9b
ILT
103482009-03-27 Ian Lance Taylor <iant@google.com>
10349
fd03461a
ILT
10350 * ffsll.c: New file.
10351 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10352 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10353 * ftruncate.c (ftruncate): Declare before definition.
10354 * mremap.c (mremap): Likewise.
10355 * pread.c (pread): Likewise.
10356 * configure, Makefile.in, config.in: Rebuild.
10357
2f35ab9b
ILT
10358 * mremap.c: New file.
10359 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10360 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10361 (mremap): Declare if HAVE_MREMAP is not defined.
10362 * configure, Makefile.in, config.in: Rebuild.
10363
33aea2fd
CC
103642009-03-27 Cary Coutant <ccoutant@google.com>
10365
10366 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10367 position independent.
10368 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10369 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10370
6d479619
CC
103712009-03-24 Cary Coutant <ccoutant@google.com>
10372
10373 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10374 an executable.
10375 (needs_dynamic_reloc): Likewise.
10376
afc06bb8
ILT
103772009-03-24 Ian Lance Taylor <iant@google.com>
10378
10379 * yyscript.y (file_cmd): Recognize EXTERN.
10380 (extern_name_list, extern_name_list_body): New nonterminals.
10381 * script.cc (script_add_extern): Define.
10382 * script-c.h (script_add_extern): Declare.
10383
f6060a4d
ILT
103842009-03-24 Rafael Avila de Espindola <espindola@google.com>
10385
10386 * object.cc (is_elf_object): Define.
10387 * object.h (is_elf_object): Declare.
10388 * archive.cc (Archive::get_elf_object_for_member): Call
10389 is_elf_object.
33aea2fd 10390 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 10391
26736d8e
ILT
103922009-03-24 Elliott Hughes <enh@google.com>
10393
10394 * output.cc (Output_file::map_anonymous): Define.
10395 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10396 try an anonymous one. Report the size if the mmap fails.
10397 * output.h (class Output_file): Declare map_anonymous.
10398
22fd9730
ILT
103992009-03-24 Ian Lance Taylor <iant@google.com>
10400
10401 * target-select.cc (instantiate_target): Don't acquire the lock if
10402 the instantiated_target_ field has already been set.
10403
cb010894
ILT
104042009-03-23 Ian Lance Taylor <iant@google.com>
10405
7f055c20
ILT
10406 * gold-threads.h (class Initialize_lock): Define.
10407 * gold-threads.cc (class Initialize_lock_once): Define.
10408 (initialize_lock_control): New static variable.
10409 (initialize_lock_pointer): New static variable.
10410 (initialize_lock_once): New static function.
10411 (Initialize_lock::Initialize_lock): Define.
10412 (Initialize_lock::initialize): Define.
10413 * target-select.h: Include "gold-threads.h".
10414 (class Target_selector): Add lock_ and initialize_lock_ fields.
10415 Don't define instantiate_target, just declare it.
10416 * target-select.cc (Target_selector::Target_selector): Initialize
10417 new fields.
10418 (Target_selector::instantiate_target): Define.
10419 * descriptors.h: Include "gold-threads.h".
10420 (class Descriptors): Add initialize_lock_ field.
10421 * descriptors.cc (Descriptors::Descriptors): Initialize new
10422 field.
10423 (Descriptors::open): Use initialize_lock_ field
10424 * errors.h (class Errors): Add initialize_lock_ field.
10425 * errors.cc (Errors::Errors): Initialize new field.
10426 (Errors::initialize_lock): Use initialize_lock_ field.
10427 * powerpc.cc (class Target_selector_powerpc): Remove
10428 instantiated_target_ field. In do_recognize call
10429 instantiate_target rather than do_instantiate_target. In
10430 do_instantiate_target just allocate a new target.
10431 * sparc.cc (class Target_selector_sparc): Likewise.
10432
36959681
ILT
10433 * freebsd.h: New file.
10434 * i386.cc: Include "freebsd.h".
10435 (Target_i386): Derive from Target_freebsd rather than
10436 Sized_target.
10437 (Target_selector_i386): Derive from Target_selector_freebsd rather
10438 than Target_selector.
10439 * x86_64.cc: Include "freebsd.h".
10440 (Target_x86_64): Derive from Target_freebsd rather than
10441 Sized_target.
10442 (Target_selector_x86_64): Derive from Target_selector_freebsd
10443 rather than Target_selector.
10444 * target.h (class Target): Add adjust_elf_header and
10445 do_adjust_elf_header.
10446 * output.cc (Output_file_header:: do_sized_write): Call target
10447 adjust_elf_header routine.
10448 * configure.tgt: Set targ_osabi.
10449 * configure.ac: Define GOLD_DEFAULT_OSABI.
10450 * parameters.cc (Parameters::default_target): Pass
10451 GOLD_DEFAULT_OSABI to select_target.
10452 * target-select.h (class Target_selector): Make instantiate_target
10453 protected rather than private.
10454 * Makefile.am (HFILES): Add freebsd.h.
10455 * configure, Makefile.in, config.in: Rebuild.
10456
cb010894
ILT
10457 * merge.cc (do_add_input_section): Correct pend value. Change
10458 message about last entry not being null terminated from error to
10459 warning.
10460
0e879927
ILT
104612009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10462
10463 * incremental.cc: New file.
10464 * Makefile.am (CCFILES): Add incremental.cc.
10465 * Makefile.in: Rebuild.
10466
41105937
PP
104672009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10468
10469 * layout.cc (Layout::output_section_name): Preserve names
10470 of '.note.' sections.
e1df38aa 10471
60439920
ILT
104722009-03-19 Ian Lance Taylor <iant@google.com>
10473
10474 * descriptors.cc (Descriptors::open): Check that the options are
10475 valid before using them.
10476
0d371ad3
ILT
104772009-03-18 Ian Lance Taylor <iant@google.com>
10478
10479 * script-sections.h: Include <list>.
10480 (class Script_sections): Change Sections_elements from std::vector
10481 to std::list. Typedef public Elements_iterator. Add
10482 orphan_section_placement_, data_segment_align_start_, and
10483 saw_data_segment_align_ fields. Remove data_segment_align_index_
10484 field.
10485 * script-sections.cc (class Orphan_section_placement): New class.
10486 (class Sections_element): Add virtual functions is_relro and
10487 orphan_section_init. Remove virtual function place_orphan_here.
10488 (class Output_section_definition): Add is_relro and
10489 orphan_section_init. Remove place_orphan_here.
10490 (class Orphan_output_section): Likewise.
10491 (Script_sections::Script_sections): Update for field changes.
10492 (Script_sections::data_segment_align): Set saw_data_segment_align_
10493 and data_segment_align_start_, not data_segment_align_index.
10494 (Script_sections::data_segment_relro_end): Check
10495 saw_data_segment_align_. Use data_segment_align_start_ rather
10496 than data_segment_align_index_.
10497 (Script_sections::place_orphan): Rewrite to use
10498 Orphan_section_placement.
10499
9201d894
ILT
105002009-03-17 Ian Lance Taylor <iant@google.com>
10501
9c5b8369
ILT
10502 * archive.cc (Archive::add_symbols): Check for a version attached
10503 to the symbol name in the archive map.
10504 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10505 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10506 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10507 (ver_test_11.a): New target.
10508 * testsuite/Makefile.in: Rebuild.
10509
9201d894
ILT
10510 * configure.ac: Check for chsize and posix_fallocate. Replace
10511 ftruncate.
10512 * ftruncate.c: New file, from gnulib.
10513 * output.cc (posix_fallocate): Define dummy version if not
10514 HAVE_POSIX_FALLOCATE.
10515 (Output_file::map): Call posix_fallocate rather than lseek and
10516 write.
10517 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10518 * configure, Makefile.in, config.in: Rebuild.
10519
ef4ab7a8 105202009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 10521
ef4ab7a8
PP
10522 * layout.h (Layout::create_note): Add section_name parameter.
10523 * layout.cc (Layout::create_note): Likewise.
10524 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 10525
8c500701
ILT
105262009-03-17 Ian Lance Taylor <iant@google.com>
10527
e85b18e1
ILT
10528 * descriptors.cc: Include "options.h".
10529 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10530 (Descriptors::open): Always use O_CLOEXEC when opening a new
10531 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10532 then set FD_CLOEXEC.
10533
9efe6174
ILT
10534 * sparc.cc (class Target_sparc): Add has_got_section.
10535 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10536 make sure we have a GOT section.
10537
10538 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10539 (Target_sparc::Scan::local): Likewise.
10540 (Target_sparc::Scan::global): Likewise.
10541 (Target_sparc::Relocate::relocate): Likewise.
10542 (Target_sparc::Relocate::relocate_tls): Likewise.
10543
8c500701
ILT
10544 * symtab.cc (Symbol_table::define_default_version): New function,
10545 broken out of add_from_object.
10546 (Symbol_table::add_from_object): Call define_default_version.
10547 (Symbol_table::define_special_symbol): Add resolve_oldsym
10548 parameter. Change all callers. If the version for a symbol comes
10549 from a version script, resolve it with the symbol with the same
10550 name with no version. Also add the symbol without a version if
10551 appropriate.
10552 (do_define_in_output_data): If resolving with oldsym, don't delete
10553 sym.
10554 (do_define_in_output_segment): Likewise.
10555 (do_define_as_constant): Likewise.
10556 * symtab.h (class Symbol_table): Update declarations.
10557
f1ed28fb
ILT
105582009-03-13 Ian Lance Taylor <iant@google.com>
10559
15f8229b
ILT
10560 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10561 (Read_symbols::requeue): New function.
10562 (Read_symbols::do_read_symbols): If make_elf_object fails because
10563 the target type is not configured, and the file was searched for,
10564 issue a warning and retry with the next directory.
10565 (Add_symbols::run): If the file has an incompatible format, and
10566 it was searched for, requeue the Read_symbols task. On error,
10567 release the object.
10568 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10569 dirindex parameter to constructor. Change all callers. Declare
10570 incompatible_warning and requeue.
10571 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10572 input_argument_ and input_group_ fields. Add them to
10573 constructor. Change all callers.
10574 (class Read_script): Add dirindex_ field. Add it to constructor.
10575 Change all callers.
10576 * archive.cc (Archive::setup): Remove input_objects parameter.
10577 Change all callers.
10578 (Archive::get_file_and_offset): Likewise.
10579 (Archive::read_all_symbols): Likewise.
10580 (Archive::read_symbols): Likewise.
10581 (Archive::get_elf_object_for_member): Remove input_objects
10582 parameter. Add punconfigured parameter. Change all callers.
10583 (Archive::add_symbols): Change return type to bool. Check return
10584 value of include_member.
10585 (Archive::include_all_members): Likewise.
10586 (Archive::include_member): Change return type to bool. Return
10587 false if first included object has incompatible target. Set
10588 included_member_ field.
10589 (Add_archive_symbols::run): If add_symbols returns false, requeue
10590 Read_symbols task.
10591 * archive.h (class Archive): Add included_member_ field.
10592 Initialize it in constructor. Add input_file and searched_for
10593 methods. Update declarations.
10594 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10595 input_argument_ fields. Add them to constructor. Change all
10596 callers.
10597 * script.cc: Include "target-select.h".
10598 (class Parser_closure): Add skip_on_incompatible_target_ and
10599 found_incompatible_target_ fields. Add
10600 skip_on_incompatible_target parameter to constructor. Change all
10601 callers. Add methods skip_on_incompatible_target,
10602 clear_skip_on_incompatible_target, found_incompatible_target, and
10603 set_found_incompatible_target.
10604 (read_input_script): Add dirindex parameter. Change all callers.
10605 If parser finds an incompatible target, requeue Read_symbols
10606 task.
10607 (script_set_symbol): Clear skip_on_incompatible_target in
10608 closure.
10609 (script_add_assertion, script_parse_option): Likewise.
10610 (script_start_sections, script_add_phdr): Likewise.
10611 (script_check_output_format): New function.
10612 * script.h (read_input_script): Update declaration.
10613 * script-c.h (script_check_output_format): Declare.
10614 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10615 (ignore_cmd): Remove OUTPUT_FORMAT.
10616 * fileread.cc (Input_file::Input_file): Add explicit this.
10617 (Input_file::will_search_for): New function.
10618 (Input_file::open): Add pindex parameter. Change all callers.
10619 * fileread.h (class Input_file): Add input_file_argument method.
10620 Declare will_search_for. Update declarations.
10621 * object.cc (make_elf_object): Add punconfigured parameter.
10622 Change all callers.
10623 * object.h (class Object): Make input_file public. Add
10624 searched_for method.
10625 (make_elf_object): Update declaration.
10626 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10627 restart search.
10628 * dirsearch.h (class Dirsearch): Update declaration.
10629 * options.h (class General_options): Add --warn-search-mismatch.
10630 * parameters.cc (Parameters::is_compatible_target): New function.
10631 * parameters.h (class Parameters): Declare is_compatible_target.
10632 * workqueue.cc (Workqueue::add_blocker): New function.
10633 * workqueue.h (class Workqueue): Declare add_blocker.
10634
f1ed28fb
ILT
10635 * fileread.cc (Input_file::open): Remove options parameter.
10636 Change all callers.
10637 (Input_file::open_binary): Likewise.
10638 * script.cc (read_input_script): Likewise.
10639 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10640 options parameter from constructor. Change all callers.
10641 (class Read_script): Likewise.
10642 * fileread.h (class Input_file): Update declarations.
10643 * script.h (read_input_script): Update declaration.
10644
34dd024a
NC
106452009-03-10 Nick Clifton <nickc@redhat.com>
10646
10647 * po/es.po: New Spanish translation.
10648
6d71b17c
CC
106492009-03-06 Cary Coutant <ccoutant@google.com>
10650
10651 * options.cc (parse_short_option): Keep dash_z from registering itself.
10652
031cdbed
ILT
106532009-03-03 Ian Lance Taylor <iant@google.com>
10654
10655 PR 9918
10656 * target-reloc.h (relocate_section): Pass output_section to
10657 relocate.
10658 * i386.cc (Target_i386::should_apply_static_reloc): Add
10659 output_section parameter. Change all callers.
10660 (Target_i386::Relocate::relocate): Add output_section parameter.
10661 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10662 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10663 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10664 * testsuite/two_file_shared.sh: New script.
10665 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10666 (check_DATA): Add two_file_shared.dbg.
10667 (two_file_shared.dbg): New target.
10668 * testsuite/Makefile.in: Rebuild.
10669
15d5fa16
ILT
106702009-03-01 Ian Lance Taylor <iant@google.com>
10671
10672 * configure.ac: Check for byteswap.h.
10673 * configure: Rebuild.
10674 * config.in: Rebuild.
10675
8a4c0b0d
ILT
106762009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10677
10678 * layout.cc (Layout::find_or_add_kept_section): New function.
10679 (Layout::add_comdat): Removed.
10680 * layout.h (struct Kept_section): Move out of class Layout.
10681 Remove trailing underscores from field names. Add group_sections
10682 field. Rename group_ field to is_group. Change all uses.
10683 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10684 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10685 comdat_groups_ field.
10686 (Sized_relobj::include_section_group): Use
10687 find_or_add_kept_section and Kept_section::group_sections.
10688 (Sized_relobj::include_linkonce_section): Likewise.
10689 * object.cc (class Sized_relobj): Don't define Comdat_group or
10690 Comdat_group_table. Remove find_comdat_group and
10691 add_comdat_group. Remove comdat_groups_ field.
10692 * plugin.cc (include_comdat_group): Use
10693 Layout::find_or_add_kept_section.
10694
b4ecf66b
ILT
106952009-02-28 Ian Lance Taylor <iant@google.com>
10696
14359ca0
ILT
10697 * README: --gc-sections and map files are now supported. Document
10698 some build requirements.
10699
b4ecf66b
ILT
10700 PR 6992
10701 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10702 relocatable link set the value of the section symbol to zero.
10703 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10704 relocatable link don't include the section address in the local
10705 symbol value.
10706
0602e05a
ILT
107072009-02-27 Ian Lance Taylor <iant@google.com>
10708
fd9d194f
ILT
10709 PR 6811
10710 * options.h (class Search_directory): Add is_system_directory.
10711 (class General_options): Declare is_in_system_directory.
10712 * options.cc (get_relative_sysroot): Make static.
10713 (get_default_sysroot): Make static.
10714 (General_optoins::is_in_system_directory): New function.
10715 * fileread.cc (Input_file::is_in_system_directory): New function.
10716 * fileread.h (class Input_file): Declare is_in_system_directory.
10717 * object.h (class Object): Add is_in_system_directory.
10718 (class Input_objects): Remove system_library_directory_ field.
10719 * object.cc (Input_objects::add_object): Don't set
10720 system_library_directory_.
10721 (input_objects::found_in_system_library_directory): Remove.
10722 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10723 parameter. Change all callers.
10724 (Symbol_table::sized_write_globals): Likewise.
10725 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10726 Call Object::is_in_system_directory.
10727 * symtab.h (class Symbol_table): Update declarations.
10728
61edd21f
ILT
10729 PR 5990
10730 * descriptors.h (Open_descriptor): Add is_on_stack field.
10731 * descriptors.cc (Descriptors::open): If the descriptor is on the
10732 top of the stack, remove it. Initialize is_on_stack field.
10733 (Descriptors::release): Only add pod to stack if it is not on the
10734 stack already.
10735 (Descriptors::close_some_descriptor): Clear stack_next and
10736 is_on_stack fields.
10737
e29e076a
ILT
10738 PR 7091
10739 * output.cc (Output_section::find_starting_output_address): Rename
10740 from starting_output_address; add PADDR parameter; change return
10741 type.
10742 * output.h (class Output_section): Declare
10743 find_starting_output_address instead of starting_output_address.
10744 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10745 section symbol for which we can't find a merge section.
10746
0602e05a
ILT
10747 PR 9836
10748 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10749 hidden or internal, force the symbol to be local.
10750 * resolve.cc (Symbol::override_visibility): Define.
10751 (Symbol::override_base): Use override_visibility.
10752 (Symbol_table::resolve): Likewise.
10753 (Symbol::override_base_with_special): Likewise.
10754 (Symbol_table::override_with_special): If the visibility is hidden
10755 or internal, force the symbol to be local.
10756 * symtab.h (class Symbol): Add set_visibility and
10757 override_visibility.
10758 * testsuite/ver_test_1.sh: New file.
10759 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10760 (check_DATA): Add ver_test_1.syms.
10761 (ver_test_1.syms): New target.
10762 * testsuite/Makefile.in: Rebuild.
10763
401a9a73
CC
107642009-02-25 Cary Coutant <ccoutant@google.com>
10765
10766 * layout.cc (Layout::choose_output_section): Don't rename sections
10767 when using a linker script that has a SECTIONS clause.
10768 * Makefile.in: Regenerate.
10769
10770 * testsuite/Makefile.am (script_test_5.sh): New test case.
10771 * testsuite/Makefile.in: Regenerate.
10772 * testsuite/script_test_5.cc: New file.
10773 * testsuite/script_test_5.sh: New file.
10774 * testsuite/script_test_5.t: New file.
10775
f488e4b0
CC
107762009-02-13 Rafael Avila de Espindola <espindola@google.com>
10777
10778 * archive.cc (Archive::include_member): Update calls to add_symbols.
10779 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10780 the Layout argument.
10781 * dynobj.h (do_add_symbols): Add the Layout argument.
10782 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10783 Layout argument.
10784 * object.h (Object::add_symbols): Add the Layout argument.
10785 (Object::do_add_symbols): Add the Layout argument.
10786 (Sized_relobj::do_add_symbols): Add the Layout argument.
10787 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10788 Unify the two versions.
10789 (Add_plugin_symbols): Remove.
10790 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10791 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10792 (Add_plugin_symbols): Remove.
10793 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10794 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10795 (Add_symbols::run): Make it work with Pulginobj.
10796
89dd1680
ILT
107972009-02-06 Ian Lance Taylor <iant@google.com>
10798
10799 * object.cc (Sized_relobj::do_layout): Make info message start
10800 with lower case letter.
10801
266d0a74
ILT
108022009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10803
602b464e
ILT
10804 * binary.cc: Fix file comment.
10805
266d0a74
ILT
10806 * options.h (enum Incremental_disposition): Define.
10807 (class General_options): Add new options: --incremental,
10808 --incremental_changed, --incremental_unchanged,
10809 --incremental_unknown. Add incremental_disposition_ and
10810 implicit_incremental_ fields.
10811 (General_options::incremental_disposition): New function.
10812 (class Position_dependent_options): Add incremental_disposition
10813 option.
10814 (Position_dependent_options::copy_from_options): Set incremental
10815 dispositions.
10816 * options.cc (General_options::parse_incremental_changed): New
10817 function.
2e702c99
RM
10818 (General_options::parse_incremental_unchanged): New function.
10819 (General_options::parse_incremental_unknown): New function.
10820 (General_options::General_options): Initialize new fields
266d0a74 10821 incremental_disposition_ and implicit_incremental_.
2e702c99 10822 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
10823 without --incremental.
10824
f073bbf7
CD
108252009-02-06 Chris Demetriou <cgd@google.com>
10826
10827 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10828 pointer and to report location as the file name associated with
10829 the symbol.
10830 (gold_undefined_symbol_at_location): New function to replace the
10831 old gold_undefined_symbol functionality.
10832 * target-reloc.h (relocate_section): Update to use
10833 gold_undefined_symbol_at_location.
10834 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10835 Call gold_undefined_symbol function rather than gold_error.
10836 * errors.h (Errors::undefined_symbol): Take location as a
10837 string, rather than calculating it from a relocation.
10838 * errors.cc (Errors::fatal): Print "fatal error:" before the
10839 formatted message.
10840 (Errors::error, Errors::error_at_location): Print "error: "
10841 before the formatted message.
10842 (Errors::undefined_symbol): Take location as a string, rather
10843 than calculating it from a relocation.
10844 (gold_undefined_symbol_at_location): New function akin to
10845 old gold_undefined_symbol, calculates location from relocation.
10846 (gold_undefined_symbol): Change to take only a Symbol pointer
10847 and to report location as the file name associated with the symbol.
10848 * testsuite/debug_msg.sh: Update for changed error messages.
10849 * testsuite/undef_symbol.sh: Likewise.
10850
8e94a90c
ILT
108512009-02-04 Duncan Sands <baldrick@free.fr>
10852
10853 PR 9812
10854 * reduced_debug_output.h
10855 (Output_reduced_debug_abbrev_section::failed): Use format for
10856 gold_warning.
10857 (Output_reduced_debug_info_section::faild): Likewise.
10858
88a0e15b
ILT
108592009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10860
10861 * script.cc (Lazy_demangler): New class.
2e702c99 10862 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
10863 symbol only once.
10864
5efc7cd2
CC
108652009-01-29 Cary Coutant <ccoutant@google.com>
10866
10867 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10868 to __tls_get_addr.
10869 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10870
e0ebcf42
ILT
108712009-01-28 Ian Lance Taylor <iant@google.com>
10872
5efc7cd2 10873 * version.cc (version_string): Bump to 1.9.
75fe7426 10874
e0ebcf42
ILT
10875 * gold.h: Include <cstring> and <stdint.h>.
10876 * version.cc: Include <cstdio>.
10877 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10878 warning.
10879 * reduced_debug_output.cc (insert_into_vector): Rename from
10880 Insert_into_vector; change all callers. Use Swap_unaligned to
10881 avoid aliasing issue; remove union since it is unnecessary.
10882
8e2813be 108832009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
10884
10885 * Makefile.am (CCFILES): Add gc.cc.
10886 (HFILES): Add gc.h.
10887 * Makefile.in: Regenerate.
10888 * gold.cc (Gc_runner): New class.
10889 (queue_initial_tasks): Call garbage collection related tasks
10890 when corresponding options are invoked.
10891 (queue_middle_gc_tasks): New function.
10892 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10893 processed early before laying out sections during garbage collection.
10894 * gold.h (queue_middle_gc_tasks): New function.
10895 (is_prefix_of): Move from "layout.cc".
10896 * i386.cc (Target_i386::gc_process_relocs): New function.
10897 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10898 * main.cc (main): Create object of class "Garbage_collection".
10899 * object.cc (Relobj::copy_symbols_data): New function.
10900 (Relobj::is_section_name_included): New function.
e1df38aa
NC
10901 (Sized_relobj::do_layout): Allow this function to be called twice
10902 during garbage collection and defer layout of section during the
6d03d481
ST
10903 first call.
10904 * object.h (Relobj::get_symbols_data): New function.
10905 (Relobj::is_section_name_included): New function.
10906 (Relobj::copy_symbols_data): New function.
10907 (Relobj::set_symbols_data): New function.
10908 (Relobj::get_relocs_data): New function.
10909 (Relobj::set_relocs_data): New function.
10910 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10911 (Relobj::gc_process_relocs): New function.
10912 (Relobj::do_gc_process_relocs): New pure virtual function.
10913 (Relobj::sd_): New data member.
10914 (Sized_relobj::is_output_section_offset_invalid): New function.
10915 (Sized_relobj::do_gc_process_relocs): New function.
10916 * options.h (General_options::gc_sections): Modify to not be a no-op.
10917 (General_options::print_gc_sections): New option.
10918 * plugin.cc (Plugin_finish::run): Remove function call to
10919 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10920 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10921 * reloc.cc (Read_relocs::run): Add task to process relocs and
10922 determine unreferenced sections when doing garbage collection.
10923 (Gc_process_relocs): New class.
10924 (Sized_relobj::do_gc_process_relocs): New function.
10925 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10926 sections that are garbage collected.
10927 * reloc.h (Gc_process_relocs): New class.
10928 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10929 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10930 symbols whose corresponding sections are garbage collected.
10931 (Symbol_table::Symbol_table): Add new parameter for the garbage
10932 collection object.
10933 (Symbol_table::gc_mark_undef_symbols): New function.
10934 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10935 (Symbol_table::gc_mark_dyn_syms): New function.
10936 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10937 as garbage.
10938 (Symbol_table::add_from_object): Likewise.
10939 (Symbol_table::add_from_relobj): When building shared objects, do not
10940 treat externally visible symbols as garbage.
10941 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10942 table information for static and relocatable links.
10943 * symtab.h (Symbol_table::set_gc): New function.
10944 (Symbol_table::gc): New function.
10945 (Symbol_table::gc_mark_undef_symbols): New function.
10946 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10947 (Symbol_table::gc_mark_dyn_syms): New function.
10948 (Symbol_table::gc_): New data member.
e1df38aa 10949 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
10950 function.
10951 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10952 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10953
3b293544
CF
109542009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10955
10956 * options.h (General_options::gc_sections): Define as a no-op for now.
10957 (General_options::no_keep_memory): Ditto.
10958 (General_options::Bshareable): Define.
10959 * options.cc (General_options::finalize): Honor -Bshareable.
10960
83d22aa8
AS
109612009-01-20 Andreas Schwab <schwab@suse.de>
10962
10963 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10964 read the value in the contents, since we don't use it. Use the
10965 template endianness when writing.
10966 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10967
cd536b21
AS
109682009-01-19 Andreas Schwab <schwab@suse.de>
10969
10970 * configure.tgt (powerpc64-*): Fix targ_obj.
10971
99e9a495
ILT
109722009-01-15 Ian Lance Taylor <iant@google.com>
10973
10974 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10975 local symbols when stripping all symbols.
10976
bbbfea06
CC
109772009-01-14 Cary Coutant <ccoutant@google.com>
10978
99e9a495 10979 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 10980
0f7c0701
CC
109812009-01-14 Cary Coutant <ccoutant@google.com>
10982
10983 * archive.cc (Archive::get_elf_object_for_member): Remove call
10984 to File_read::claim_for_plugin.
10985 * descriptors.cc (Descriptors::open): Remove reference to
10986 is_claimed.
10987 (Descriptors::claim_for_plugin): Remove.
10988 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10989 (Descriptors::is_claimed): Remove.
10990 (claim_descriptor_for_plugin): Remove.
10991 * fileread.cc (File_read::claim_for_plugin): Remove.
10992 * fileread.h (File_read::claim_for_plugin): Remove.
10993 (File_read::descriptor): Reopen descriptor if necessary.
10994 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10995 (Plugin_manager::all_symbols_read): Add task parameter. Change
10996 all callers.
10997 (Plugin_manager::get_input_file): New function.
10998 (Plugin_manager::release_input_file): New function.
10999 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11000 corresponding data member.
11001 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11002 and pass to base constructor. Change all callers.
11003 (get_input_file, release_input_file): New functions.
11004 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11005 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11006 (Plugin_manager::all_symbols_read): Add task parameter.
11007 (Plugin_manager::get_input_file): New function.
11008 (Plugin_manager::release_input_file): New function.
11009 (Plugin_manager::task_): New data member.
11010 (Pluginobj::Pluginobj): Add filesize parameter.
11011 (Pluginobj::filename): New function.
11012 (Pluginobj::descriptor): New function.
11013 (Pluginobj::filesize): New function.
11014 (Pluginobj::filesize_): New data member.
11015 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
11016 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
11017 File_read::claim_for_plugin; use Object::unlock to unlock the file.
11018
11019 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
11020 with archive libraries.
11021 * testsuite/Makefile.in: Regenerate.
11022 * testsuite/plugin_test.c (struct sym_info): New type.
11023 (get_input_file, release_input_file): New static variables.
11024 (onload): Capture new transfer vector entries.
11025 (claim_file_hook): Stop reading at end of file according to filesize.
11026 Factor out parsing of readelf output into separate function.
11027 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11028 APIs and get the source file name from the symbol table. Convert
11029 source file name to corresponding object file name. Print info
11030 message when adding new input files.
11031 (parse_readelf_line): New function.
11032 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11033 * testsuite/plugin_test_2.sh: Likewise.
11034 * testsuite/plugin_test_3.sh: Likewise.
11035 * testsuite/plugin_test_4.sh: New test case.
11036
62a6d109
ILT
110372009-01-07 Ian Lance Taylor <iant@google.com>
11038
11039 * version.cc (version_string): Bump to 1.8.
11040
483620e8
CC
110412008-12-23 Cary Coutant <ccoutant@google.com>
11042
11043 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
11044 * plugin.cc (Plugin_manager::finish): Rename as
11045 layout_deferred_objects. Move cleanup to separate function.
11046 (Plugin_manager::cleanup): New function.
11047 (Plugin_finish::run): Call layout_deferred_objects and cleanup
11048 separately.
11049 * plugin.h (Plugin_manager::finish): Rename as
11050 layout_deferred_objects.
11051 (Plugin_manager::cleanup): New function.
11052 (Plugin_manager::cleanup_done): New field.
11053
d66a9eb3
CC
110542008-12-23 Cary Coutant <ccoutant@google.com>
11055
11056 * plugin.cc (is_visible_from_outside): New function.
11057 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
11058 so we don't return "IR only" status for exported symbols or -r links.
11059
11060 * testsuite/Makefile.am (plugin_test_3): New test case.
11061 * testsuite/Makefile.in: Regenerate.
11062 * testsuite/plugin_test_3.sh: New file.
11063
5995b570
CC
110642008-12-22 Cary Coutant <ccoutant@google.com>
11065
11066 * object.cc (Sized_relobj::layout_section): New function.
11067 (Sized_relobj::do_layout): Defer layout of input sections until after
11068 plugin has provided replacement files.
11069 (Sized_relobj::do_layout_deferred_sections): New function.
11070 * object.h (Relobj::set_section_offset): Remove virtual keyword.
11071 (Relobj::layout_deferred_sections): New function.
11072 (Relobj::do_layout_deferred_sections): New function.
11073 (Sized_relobj::do_layout_deferred_sections): New function.
11074 (Sized_relobj::layout_section): New function.
11075 (Sized_relobj::Deferred_layout): New structure.
11076 (Sized_relobj::deferred_layout_): New field.
11077 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
11078 Change all callers. Layout deferred sections.
11079 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
11080 references.
11081 (Plugin_hook::run): Move code from do_plugin_hook inline.
11082 (Plugin_hook::do_plugin_hook): Remove.
11083 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
11084 (Plugin_manager::finish): Renamed, was cleanup.
11085 (Plugin_manager::should_defer_layout): New function.
11086 (Plugin_manager::add_deferred_layout_object): New function.
11087 (Plugin_manager::Deferred_layout_list): New type.
11088 (Plugin_manager::deferred_layout_objects_): New field.
11089 (Plugin_hook::do_plugin_hook): Remove.
11090
ee769c88
ILT
110912008-12-17 Ian Lance Taylor <iant@google.com>
11092
11093 * options.h (class General_options): Add --no case for
11094 --export-dynamic.
11095
abc8dcba
CC
110962008-12-16 Cary Coutant <ccoutant@google.com>
11097
11098 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11099 vector.
11100 (Plugin_manager::claim_file): Create plugin object even if
11101 plugin did not call the add_symbols callback.
11102 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11103 asking for more symbols than were added.
11104 * testsuite/Makefile.am (plugin_test_1): Add test case with
11105 no global symbols.
11106 (empty.syms): New target.
11107 * testsuite/Makefile.in: Regenerate.
11108 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11109 message. Don't call add_symbols if no globals.
11110 (all_symbols_read_hook): Don't provide replacement for empty
11111 claimed file.
11112
b0074644
ILT
111132008-12-12 Ian Lance Taylor <iant@google.com>
11114
68943102
ILT
11115 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11116 r_type == 0 for a local symbol with r_sym == 0.
11117 (scan_relocatable_relocs): Pass r_sym to
11118 local_non_section_strategy.
11119 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11120 r_sym parameter.
11121
b0074644
ILT
11122 * configure.ac: Update test for TLS descriptors: they are
11123 supported as of glibc 2.9.
11124 * configure: Rebuild.
11125
c2508178
ILT
111262008-12-11 Ian Lance Taylor <iant@google.com>
11127
11128 PR 7091
11129 * target-reloc.h (Default_scan_relocatable_relocs): For each
11130 function, map r_type == 0 to RELOC_DISCARD.
11131
2756a258
CC
111322008-12-10 Cary Coutant <ccoutant@google.com>
11133
11134 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11135 object to override a kept COMDAT group from a plugin object.
11136
bb6f53d3
ILT
111372008-12-09 Ian Lance Taylor <iant@google.com>
11138
fbc558e1
ILT
11139 PR 7088
11140 * yyscript.y (file_cmd): Handle INPUT.
11141
bb6f53d3
ILT
11142 * testsuite/initpri1.c: Change all declarations to be full
11143 prototypes by adding void, to avoid compiler warnings.
11144
4674ecfc
CC
111452008-12-05 Rafael Avila de Espindola <espindola@google.com>
11146
11147 * options.cc (General_options::parse_plugin_opt): New.
11148 (General_options::add_plugin): The argument now is just the filename.
11149 (General_options::add_plugin_option): New.
11150 * options.h (plugin_opt): New.
11151 (add_plugin): Change argument name.
11152 (add_plugin_option): New.
11153 * plugin.cc (Plugin::load): Don't parse the plugin option.
11154 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11155 (Plugin::add_option): New.
11156 (Plugin::args_): Change type.
11157 (Plugin::filename_): New.
11158 (Plugin_manager::add_plugin_option): New.
11159 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11160 * testsuite/Makefile.in: Regenerate.
11161
fd06b4aa
CC
111622008-12-05 Cary Coutant <ccoutant@google.com>
11163
11164 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11165 Handle --strip-lto-sections option.
11166 * options.h (strip_lto_sections): New option.
11167
6c52134c
CC
111682008-12-01 Cary Coutant <ccoutant@google.com>
11169
11170 * plugin.cc (ld_plugin_message): Change format parameter to const.
11171 Fix mismatch between new[] and delete.
11172
a45248e0
CC
111732008-11-14 Cary Coutant <ccoutant@google.com>
11174
11175 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11176 instead of -1U.
11177
c82fbeee
CS
111782008-11-05 Craig Silverstein <csilvers@google.com>
11179
11180 * options.cc (General_options::parse_dynamic_list): New function.
11181 * options.h (General_options): New flags dynamic_list,
11182 dynamic_list_data, dynamic_list_cpp_new, and
11183 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11184 (General_options::in_dynamic_list): New function.
11185 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11186 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11187 (Lex::can_continue_name): Likewise.
11188 (yylex): Likewise.
11189 (read_script_file): New parameter script_options.
11190 (read_dynamic_list): New function.
11191 (Script_options::define_dynamic_list): New function.
11192 (dynamic_list_keyword_parsecodes): New variable.
11193 (dynamic_list_keywords): New variable.
11194 * script.h (Script_options::define_dynamic_list): New function
11195 prototype.
11196 (read_dynamic_list): New function prototype.
11197 * symtab.cc (strprefix): New macro.
11198 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11199 dynamic_list_data, dynamic_list_cpp_new, and
11200 dynamic_list_cpp_typeinfo.
11201 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11202 (dynamic_list_expr): New rule.
11203 (dynamic_list_nodes): Likewise.
11204 (dynamic_list_node): Likewise.
11205 * testsuite/Makefile.am (dynamic_list): New test.
11206 * testsuite/Makefile.in: Regenerated.
11207 * testsuite/dynamic_list.t: New file.
11208 * testsuite/dynamic_list.sh: New file.
11209
e0bb29a5
CS
112102008-11-05 Craig Silverstein <csilvers@google.com>
11211
11212 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11213 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11214 (t11_last): Likewise.
11215 * testsuite/ver_test_6.c (main): Likewise.
11216
4e1e25e0
CC
112172008-10-07 Cary Coutant <ccoutant@google.com>
11218
11219 * options.c (General_options::finalize): Add check for -static and
11220 -shared.
11221 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11222 is not empty.
11223
92f03fcb
CC
112242008-10-02 Cary Coutant <ccoutant@google.com>
11225
11226 * plugin.cc (make_sized_plugin_object): Fix conditional
11227 compilation to work when not all targets are enabled.
11228
fbd8a257
CC
112292008-09-29 Cary Coutant <ccoutant@google.com>
11230
11231 * archive.cc (Archive::get_file_and_offset): Use filename instead
11232 of name to get library path.
11233 (Archive::include_member): Unlock external member of a thin archive.
11234
11235 * testsuite/Makefile.am (TEST_AR): New variable.
11236 (thin_archive_test_1): New test.
11237 (thin_archive_test_2): New test.
81636b3f
CC
11238 * testsuite/Makefile.in: Regenerate.
11239 * testsuite/thin_archive_main.cc: New file.
11240 * testsuite/thin_archive_test_1.cc: New file.
11241 * testsuite/thin_archive_test_2.cc: New file.
11242 * testsuite/thin_archive_test_3.cc: New file.
11243 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 11244
eff45813
CC
112452008-09-29 Cary Coutant <ccoutant@google.com>
11246
11247 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11248 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11249 instead of -1U.
11250 (Sized_relobj::do_finalize_local_symbols): Likewise.
11251 (Sized_relobj::map_to_kept_section): Likewise.
11252 * object.h (Sized_relobj::invalid_address): New constant.
11253 (Sized_relobj::do_output_section_offset): Check for invalid_address
11254 and return -1ULL.
11255 * output.cc (Output_reloc::local_section_offset): Use constant
11256 invalid_address instead of -1U.
11257 (Output_reloc::get_address): Likewise.
11258 (Output_section::output_address): Change -1U to -1ULL.
11259 * output.h (Output_reloc::invalid_address): New constant.
11260 * reloc.cc (Sized_relobj::write_sections): Use constant
11261 invalid_address instead of -1U.
11262 (Sized_relobj::relocate_sections): Likewise.
11263 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11264 values for merge sections.
11265 * target-reloc.h (relocate_for_relocatable): Use constant
11266 invalid_address instead of -1U.
11267
89fc3421
CC
112682008-09-19 Cary Coutant <ccoutant@google.com>
11269
11270 Add plugin functionality for link-time optimization (LTO).
11271 * configure.ac (plugins): Add --enable-plugins option.
11272 * configure: Regenerate.
11273 * config.in: Regenerate.
11274 * Makefile.am (LIBDL): New variable.
11275 (CCFILES): Add plugin.cc.
11276 (HFILES): Add plugin.h.
11277 (ldadd_var): Add LIBDL.
11278 * Makefile.in: Regenerate.
11279
11280 * archive.cc: Include "plugin.h".
11281 (Archive::setup): Don't preread archive symbols when using a plugin.
11282 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11283 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11284 files.
11285 (Archive::include_member): Add symbols from plugin objects.
11286 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11287 * descriptors.cc (Descriptors::open): Check for file descriptors
11288 abandoned by plugins.
11289 (Descriptors::claim_for_plugin): New function.
11290 * descriptors.h (Descriptors::claim_for_plugin): New function.
11291 (Open_descriptor::is_claimed): New field.
11292 (claim_descriptor_for_plugin): New function.
11293 * fileread.cc (File_read::claim_for_plugin): New function.
11294 * fileread.h (File_read::claim_for_plugin): New function.
11295 (File_read::descriptor): New function.
11296 * gold.cc: Include "plugin.h".
11297 (queue_initial_tasks): Add task to call plugin hooks for generating
11298 new object files.
11299 * main.cc: Include "plugin.h".
11300 (main): Load plugin libraries.
11301 * object.h (Pluginobj): Declare.
11302 (Object::pluginobj): New function.
11303 (Object::do_pluginobj): New function.
11304 (Object::set_target): New function.
11305 * options.cc: Include "plugin.h".
11306 (General_options::parse_plugin): New function.
11307 (General_options::General_options): Initialize plugins_ field.
11308 (General_options::add_plugin): New function.
11309 * options.h (Plugin_manager): Declare.
11310 (General_options): Add --plugin option.
11311 (General_options::has_plugins): New function.
11312 (General_options::plugins): New function.
11313 (General_options::add_plugin): New function.
11314 (General_options::plugins_): New field.
11315 * plugin.cc: New file.
11316 * plugin.h: New file.
11317 * readsyms.cc: Include "plugin.h".
11318 (Read_symbols::do_read_symbols): Check for archive before checking
11319 for ELF file. Call plugin hooks to claim files.
11320 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11321 from a real object file; force override when processing replacement
11322 files.
11323 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11324 (Symbol::init_base_object): Likewise.
11325 (Symbol::init_base_output_data): Likewise.
11326 (Symbol::init_base_output_segment): Likewise.
11327 (Symbol::init_base_constant): Likewise.
11328 (Symbol::init_base_undefined): Likewise.
11329 (Symbol::output_section): Assert that object is not a plugin.
11330 (Symbol_table::add_from_pluginobj): New function.
11331 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11332 undefined.
11333 (Symbol_table::sized_write_globals): Likewise.
11334 (Symbol_table::add_from_pluginobj): Instantiate template.
11335 * symtab.h (Sized_pluginobj): Declare.
11336 (Symbol::in_real_elf): New function.
11337 (Symbol::set_in_real_elf): New function.
11338 (Symbol::in_real_elf_): New field.
11339 (Symbol_table::add_from_pluginobj): New function.
11340
11341 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11342 (LIBDL): New variable.
11343 (LDADD): Add LIBDL.
11344 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11345 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11346 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11347 (MOSTLYCLEANFILES): Likewise.
11348 * testsuite/Makefile.in: Regenerate.
11349 * testsuite/plugin_test.c: New file.
11350 * testsuite/plugin_test_1.sh: New file.
11351 * testsuite/plugin_test_2.sh: New file.
11352
de31bda5
ILT
113532008-09-16 Ian Lance Taylor <iant@google.com>
11354
9c2d0ef9
ILT
11355 * target-reloc.h (relocate_section): Check whether a symbol is
11356 defined by the ABI before reporting an undefined symbol error.
11357 * target.h (Target::is_defined_by_abi): Make parameter const.
11358 (Target::do_is_defined_by_abi): Likewise.
11359 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11360 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11361 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11362 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11363 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11364 * testsuite/Makefile.in: Rebuild.
11365
de31bda5
ILT
11366 * fileread.cc (make_view): Add casts to avoid warning.
11367
9fa33bee
AO
113682008-09-16 Alexandre Oliva <aoliva@redhat.com>
11369
11370 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11371 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11372
183fd0e3
AO
113732008-09-16 Alexandre Oliva <aoliva@redhat.com>
11374
11375 * options.h (General_options::output_is_executable): New.
11376 (General_options::output_is_pie): New.
11377 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11378 for shared libraries.
11379 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11380
7be8330a
CD
113812008-09-11 Chris Demetriou <cgd@google.com>
11382
11383 * options.h (origin): New -z option.
11384 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11385 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11386 in DT_FLAGS_1.
11387
a9caad02
CC
113882008-09-05 Cary Coutant <ccoutant@google.com>
11389
11390 * fileread.cc (File_read::make_view): Add check for attempt to map
11391 beyond end of file.
11392
ae6dce4d
CC
113932008-09-05 Cary Coutant <ccoutant@google.com>
11394
11395 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11396 explicit instantiations.
11397
d7ab2a47
KVH
113982008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11399
11400 PR gold/6858
11401 * options.cc (General_options::finalize): Allow undefined symbols
11402 in shlibs if linking -shared.
11403
11404 PR gold/6859
11405 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11406 symbols as not needing a dynsym entry.
11407
1e52a9c1
CS
114082008-08-20 Craig Silverstein <csilvers@google.com>
11409
11410 * fileread.cc (File_read::open): Do not lock the file unless it
11411 was successfully opened.
11412
d85c80a3
CC
114132008-08-14 Cary Coutant <ccoutant@google.com>
11414
11415 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11416 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11417 * testsuite/tls_test.cc (struct int128): 128-bit struct
11418 for testing TLS relocs with non-zero addend.
11419 (v12): New TLS variable.
11420 (t12): New test.
11421 (t_last): Add check for v12.
11422 * testsuite/tls_test.h (t12): New function.
11423 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11424
2d924fd9
ILT
114252008-08-13 Ian Lance Taylor <iant@google.com>
11426
11427 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11428 set tls_segment_ or relro_segment_.
11429 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11430 when appropriate.
11431 * output.h (Output_section::clear_is_relro): New function.
11432 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11433 sections specially even when output_data_ is empty.
11434 (Output_segment::maximum_alignment): When first section is relro,
11435 only force alignment for PT_LOAD segments.
11436 * script.cc (script_data_segment_align): New function.
11437 (script_data_segment_relro_end): New function.
11438 * script-c.h (script_data_segment_align): Declare.
11439 (script_data_segment_relro_end): Declare.
11440 * script-sections.h (class Script_sections): Declare
11441 data_segment_align and data_segment_relro_end. Add fields
11442 segment_align_index_ and saw_relro_end_.
11443 * script-sections.cc (class Sections_element): Add set_is_relro
11444 virtual function. Add new bool* parameter to place_orphan_here.
11445 Add get_output_section virtual function.
11446 (class Output_section_definition): Add set_is_relro. Add new
11447 bool* parameter to place_orphan_here. Add get_output_section.
11448 Add is_relro_ field.
11449 (Output_section_definition::Output_section_definition): Initialize
11450 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11451 and is_relro_ fields.
11452 (Output_section_definition::place_orphan_here): Add is_relro
11453 parameter.
11454 (Output_section_definition::set_section_addresses): Set relro for
11455 output section.
11456 (Output_section_definition::alternate_constraint): Likewise.
11457 (class Orphan_output_section): Add new bool* parameter to
11458 place_orphan_here. Add get_output_section.
11459 (Orphan_output_section::place_orphan_here): Add is_relro
11460 parameter.
11461 (Script_sections::Script_sections): Initialize
11462 data_segment_align_index_ and saw_relro_end_.
11463 (Script_sections::data_segment_align): New function.
11464 (Script_sections::data_segment_relro_end): New function.
11465 (Script_sections::place_orphan): Set or clear is_relro.
11466 (Script_sections::set_section_addresses): Force alignment of first
11467 TLS section.
11468 * yyscript.y (exp): Call script_data_segment_align and
11469 script_data_segment_relro_end.
11470 * testsuite/relro_script_test.t: New file.
11471 * testsuite/relro_test.cc (using_script): Declare.
11472 (t1, t2): Test using_script.
11473 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11474 (relro_script_test_SOURCES): Define.
11475 (relro_script_test_DEPENDENCIES): Define.
11476 (relro_script_test_LDFLAGS): Define.
11477 (relro_script_test_LDADD): Define.
11478 (relro_script_test.so): New target.
11479 * testsuite/Makefile.in: Rebuild.
11480
f827c9a9
CC
114812008-08-06 Cary Coutant <ccoutant@google.com>
11482
11483 * archive.cc (Archive::total_archives, Archive::total_members)
11484 (Archive::total_members_loaded): New variables.
11485 (Archive::setup): Add parameter. Add option to preread
11486 archive symbols.
11487 (Archive::read_armap): Add counter.
11488 (Archive::get_file_and_offset): New function.
11489 (Archive::get_elf_object_for_member): New function.
11490 (Archive::read_all_symbols): New function.
11491 (Archive::read_symbols): New function.
11492 (Archive::add_symbols): Add counters.
11493 (Archive::include_all_members): Use armap to find members if it's
11494 already built.
11495 (Archive::include_member): Skip reading symbols if already read.
11496 Factored code into Archive::get_file_and_offset and
11497 Archive::get_elf_object_for_member. Changed call to
11498 Mapfile::report_include_archive_member.
11499 (Archive::print_stats): New function.
11500 * archive.h: Declare Object and Read_symbols_data classes.
11501 (Archive::Archive): Add initializers for new members.
11502 (Archive::setup): Add parameter.
11503 (Archive::print_stats): New function.
11504 (Archive::total_archives, Archive::total_members)
11505 (Archive::total_members_loaded): New variables.
11506 (Archive::get_file_and_offset): New function.
11507 (Archive::get_elf_object_for_member): New function.
11508 (Archive::read_all_symbols): New function.
11509 (Archive::read_symbols): New function.
11510 (Archive::Archive_member): New class.
11511 (Archive::members_): New member.
11512 (Archive::num_members_): New member.
11513 * main.cc: Include archive.h.
11514 (main): Call Archive::print_stats.
11515 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11516 archive parameter; member_name is now the fully-decorated name.
11517 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11518 * options.h: (General_options): Add --preread-archive-symbols option.
11519 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11520 Archive::setup.
11521
de4c45bd
ILT
115222008-08-04 Ian Lance Taylor <iant@google.com>
11523
11524 * symtab.h (Symbol::use_plt_offset): New function.
11525 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11526 * powerpc.cc (Relocate::relocate): Likewise.
11527 * sparc.cc (Relocate::relocate): Likewise.
11528 * x86_64.cc (Relocate::relocate): Likewise.
11529 * testsuite/weak_plt.sh: New test.
11530 * testsuite/weak_plt_main.cc: New test.
11531 * testsuite/weak_plt_shared.cc: New test.
11532 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11533 (check_PROGRAMS): Add weak_plt.
11534 (check_DATA): Add weak_plt_shared.so.
11535 (weak_plt_main_pic.o, weak_plt): New targets.
11536 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11537 * testsuite/Makefile.in: Rebuild.
11538
11539 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11540 gcctestdir/ld.
11541 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11542 * testsuite/Makefile.in: Rebuild.
11543
323ee3f4
AM
115442008-08-04 Alan Modra <amodra@bigpond.net.au>
11545
11546 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11547 * Makefile.in: Regenerate.
11548 * po/POTFILES.in: Regenerate.
11549
7c07ecec
ILT
115502008-07-29 Ian Lance Taylor <iant@google.com>
11551
11552 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11553 symbols before other symbols.
11554 * testsuite/script_test_2.cc (test_addr): Declare.
11555 (test_addr_alias): Declare.
11556 (main): Check that test_addr and test_addr_alias have the right
cd536b21 11557 values.
7c07ecec
ILT
11558 * testsuite/script_test_2.t: Define test_addr_alias and
11559 test_addr.
11560
5778530e
ILT
115612008-07-24 Ian Lance Taylor <iant@google.com>
11562
2a00e4fb
ILT
11563 PR 5990
11564 * descriptors.cc: New file.
11565 * descriptors.h: New file.
11566 * gold-threads.h (class Hold_optional_lock): New class.
11567 * fileread.cc: Include "descriptors.h".
11568 (File_read::~File_read): Release descriptor rather than closing
11569 it.
11570 (File_read::open) [file]: Call open_descriptor rather than open.
11571 Set is_descriptor_opened_.
11572 (File_read::open) [memory]: Assert that descriptor is not open.
11573 (File_read::reopen_descriptor): New function.
11574 (File_read::release): Release descriptor.
11575 (File_read::do_read): Make non-const. Reopen descriptor.
11576 (File_read::read): Make non-const.
11577 (File_read::make_view): Reopen descriptor.
11578 (File_read::do_readv): Likewise.
11579 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11580 Update declarations.
11581 * layout.cc: Include "descriptors.h".
11582 (Layout::create_build_id): Use open_descriptor rather than open.
11583 * output.cc: Include "descriptors.h".
11584 (Output_file::open): Use open_descriptor rather than open.
11585 * archive.cc (Archive::const_iterator): Change Archive to be
11586 non-const.
11587 (Archive::begin, Archive::end): Make non-const.
11588 (Archive::count_members): Likewise.
11589 * archive.h (class Archive): Update declarations.
11590 * object.h (Object::read): Make non-const.
11591 * Makefile.am (CCFILES): Add descriptors.cc.
11592 (HFILES): Add descriptors.h.
11593 * Makefile.in: Rebuild.
11594
801647d1
ILT
11595 PR 6716
11596 * gold.h: Always include <clocale>. Add Solaris workarounds
11597 following code in binutils/sysdep.h.
11598
5edd166e
ILT
11599 PR 6048
11600 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11601 this->eh_frame_hdr_ is NULL before using it.
11602
c89ad728
ILT
11603 * dynobj.cc (Versions::Versions): Update comment.
11604
aa86f06b
ILT
11605 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11606 the base version name.
11607
5778530e
ILT
11608 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11609 array size plus one.
11610 (Stringpool_template::set_string_offsets): Subtract one from key
11611 before using it as an array index.
11612 (Stringpool_template::get_offset_with_length): Likewise.
11613 (Stringpool_template::write_to_buffer): Likewise.
11614 * stringpool.h (Stringpool_template::get_offset_from_key):
11615 Likewise.
11616
057ead22
ILT
116172008-07-23 Ian Lance Taylor <iant@google.com>
11618
7f649c59
ILT
11619 PR 6658
11620 * object.h (Merged_symbol_value::value): Do our best to handle a
11621 negative addend.
11622
057ead22
ILT
11623 PR 6647
11624 * script.cc (Version_script_info::get_versions): Don't add empty
11625 version tag to return value.
11626 (Version_script_info::get_symbol_version_helper): Change return
11627 type to bool. Add pversion parameter. Change all callers.
11628 (script_register_vers_node): Don't require a non-NULL tag.
11629 * script.h (class Version_script_info): Update declarations.
11630 (Version_script_info::get_symbol_version): Change return type to
11631 bool. Add version parameter. Change all callers.
11632 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11633 handling. Handle an empty version from a version script.
11634 (Symbol_table::define_special_symbol): Likewise.
11635 * testsuite/ver_test_10.script: New file.
11636 * testsuite/ver_test_10.sh: New file.
11637 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11638 (check_DATA): Add ver_test_10.syms.
11639 (ver_test_10.syms, ver_test_10.so): New target.
11640 * testsuite/Makefile.in: Rebuild.
11641
58e54ac2
CD
116422008-07-23 Simon Baldwin <simonb@google.com>
11643
11644 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11645 to zero for undefined symbols from dynamic libraries.
11646
95d14cd3
ILT
116472008-07-23 Ian Lance Taylor <iant@google.com>
11648
11649 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11650 Change all callers.
11651 * symtab.h (class Symbol_table): Update declaration.
11652 * testsuite/ver_test_9.cc: New file.
11653 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11654 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11655 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11656 (ver_test_9.so, ver_test_9.o): New targets.
11657 * testsuite/Makefile.in: Rebuild.
11658
92de84a6
ILT
116592008-07-22 Ian Lance Taylor <iant@google.com>
11660
34810851
ILT
11661 * options.h (class General_options): Define --check-sections.
11662 * layout.cc (Layout::set_segment_offsets): Handle
11663 --check-sections.
11664
af6156ef
ILT
11665 * options.h (class General_options): Define -n/--nmagic and
11666 -N/--omagic.
11667 * options.cc (General_options::finalize): For -n/--nmagic or
11668 -N/--omagic, set -static.
11669 * layout.cc (Layout::attach_allocated_section_to_segment): If
11670 -N/--omagic, don't put read-only and read-write sections in
11671 different segments.
11672 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11673 finding a read-only segment.
11674 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11675 don't set the minimum segment alignment to the common page size,
11676 and don't set the file offset to the address modulo the page size.
11677 * script-sections.cc (Script_sections::create_segments): If
11678 -n/--omagic, don't put read-only and read-write sections in
11679 different segments.
11680
92de84a6
ILT
11681 * cref.cc: New file.
11682 * cref.h: New file.
11683 * options.h (class General_options): Add --print-symbol-counts.
11684 * main.cc (main): Issue defined symbol report if requested.
11685 * archive.cc (Archive::interpret_header): Make into a const member
11686 function.
11687 (Archive::add_symbols): Call Input_objects::archive_start and
11688 archive_stop.
11689 (Archive::const_iterator): Define new class.
11690 (Archive::begin, Archive::end): New functions.
11691 (Archive::include_all_members): Rewrite to use iterator.
11692 (Archive::count_members): New function.
11693 * archive.h (class Archive): Update declarations.
11694 (Archive::filename): New function.
11695 * object.cc: Include "cref.h".
11696 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11697 (Sized_relobj::do_get_global_symbol_counts): New function.
11698 (Input_objects::add_object): Add object to cross-referencer.
11699 (Input_objects::archive_start): New function.
11700 (Input_objects::archive_stop): New function.
11701 (Input_objects::print_symbol_counts): New function.
11702 * object.h: Declare Cref and Archive.
11703 (Object::get_global_symbol_counts): New function.
11704 (Object::do_get_global_symbol_counts): New pure virtual function.
11705 (class Sized_relobj): Add defined_count_ field. Update
11706 declarations.
11707 (class Input_objects): Add cref_ field. Update constructor.
11708 Update declarations.
11709 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11710 defined_count_.
11711 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11712 symbol counts.
11713 (Sized_dynobj::do_get_global_symbol_counts): New function.
11714 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11715 defined_count_. Update declarations. Define Symbols typedef.
11716 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11717 parameter. Change all callers.
11718 (Symbol_table::add_from_dynobj): Add sympointers and defined
11719 parameters. Change all callers.
11720 * symtab.h (class Symbol_table): Update declarations.
11721 * Makefile.am (CCFILES): Add cref.cc.
11722 (HFILES): Add cref.h.
11723 * Makefile.in: Rebuild.
11724
3f7c5e1d
CD
117252008-07-22 Simon Baldwin <simonb@google.com>
11726
11727 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11728 to zero when writing undefined symbols.
11729
e0b64032
ILT
117302008-07-22 Ian Lance Taylor <iant@google.com>
11731
11732 * output.cc (Output_section::add_input_section): Don't try to
11733 merge empty merge sections.
11734
096b02cf
CS
117352008-07-21 Craig Silverstein <csilvers@google.com>
11736
11737 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11738 Include symbol version in error message.
cd536b21 11739
1d1f116d
CD
117402008-07-20 Chris Demetriou <cgd@google.com>
11741
cd536b21 11742 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
11743 (RANDOM_SEED_CFLAGS): New substituted variable.
11744 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11745 * configure: Rebuild.
11746 * Makefile.in: Likewise.
11747 * testsuite/Makefile.in: Likewise.
11748
a18f591e
ILT
117492008-07-18 Ian Lance Taylor <iant@google.com>
11750
11751 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11752 where we see NAME/NULL and NAME/VERSION as separate symbols.
11753 * testsuite/ver_test_main.cc (main): Call t4.
11754 (t4, t4_2a): Define.
11755 * testsuite/ver_test_2.cc (t4_2): Define.
11756 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11757 * testsuite/ver_test_4.cc (t4_2a): Define.
11758 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11759 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11760
c6e3f6ed
ILT
117612008-07-17 Ian Lance Taylor <iant@google.com>
11762
11763 * dynobj.cc (Versions::add_def): If we give an error about a
11764 missing version, go ahead and create the version anyhow.
11765
ef9beddf
ILT
117662008-07-10 Ian Lance Taylor <iant@google.com>
11767
11768 Handle output sections with more than 0x7fffffff bytes.
11769 * object.h (class Relobj): Change map_to_output_ to
11770 output_sections_, and just keep a section pointer. Change all
11771 uses. Move comdat group support to Sized_relobj.
11772 (Relobj::is_section_specially_mapped): Remove.
11773 (Relobj::output_section): Remove poff parameter. Change all
11774 callers.
11775 (Relobj::output_section_offset): New function.
11776 (Relobj::set_section_offset): Rewrite.
11777 (Relobj::map_to_output): Remove.
11778 (Relobj::output_sections): New function.
11779 (Relobj::do_output_section_offset): New pure virtual function.
11780 (Relobj::do_set_section_offset): Likewise.
11781 (class Sized_relobj): Add section_offsets_ field. Add comdat
11782 group support from Relobj. Update declarations.
11783 (Sized_relobj::get_output_section_offset): New function.
11784 (Sized_relobj::do_output_section_offset): New function.
11785 (Sized_relobj::do_set_section_offset): New function.
11786 * object.cc (Relobj::output_section_address): Remove.
11787 (Sized_relobj::Sized_relobj): Initialize new fields.
11788 (Sized_relobj::include_section_group): Cast find_kept_object to
11789 Sized_relobj.
11790 (Sized_relobj::include_linkonce_section): Likewise.
11791 (Sized_relobj::do_layout): Use separate arrays for output section
11792 and output offset.
11793 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11794 output_sections.
11795 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11796 output_sections and section_offsets.
11797 (Sized_relobj::write_local_symbols): Likewise.
11798 (map_to_kept_section): Compute output address directly.
11799 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11800 output_sections and section_offsets.
11801 (Sized_relobj::write_sections): Likewise.
11802 (Sized_relobj::relocate_sections): Likewise.
11803 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11804 * output.h (class Output_reloc): Update declarations. Change
11805 u2_.relobj to Sized_relobj*.
11806 (class Output_data_reloc): Change add functions to use
11807 Sized_relobj*.
11808 * output.cc (Output_reloc::Output_reloc): Change relobj to
11809 Sized_relobj*.
11810 (Output_reloc::local_section_offset): Change return type to
11811 Elf_Addr. Use get_output_section_offset.
11812 (Output_reloc::get_address): Likewise.
11813 (Output_section::is_input_address_mapped): Don't call
11814 is_section_specially_mapped.
11815 (Output_section::output_offset): Likewise.
11816 (Output_section::output_address): Likewise.
11817 (Output_section::starting_output_address): Likewise.
11818 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11819 parameter to Sized_relobj*.
11820 (Copy_relocs::need_copy_reloc): Likewise.
11821 (Copy_relocs::save): Likewise.
11822 * copy-relocs.h (class Copy_relocs): Update declarations.
11823 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11824 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11825 * target-reloc.h (relocate_for_relocatable): Change
11826 offset_in_output_section type to Elf_Addr. Change code that uses
11827 it as well.
11828 * layout.cc (Layout::layout): Always set *off.
11829 * mapfile.cc (Mapfile::print_input_section): Use
11830 output_section_offset.
11831 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11832 Sized_relobj*.
11833 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11834 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11835 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11836
5cb66f97
ILT
118372008-07-03 Ian Lance Taylor <iant@google.com>
11838
11839 * layout.cc (Layout::include_section): Do not discard unrecognized
11840 SHT_STRTAB sections.
11841
afe47622
CS
118422008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11843
11844 * script.cc (Lex::can_continue_name): Make '?' allowable in
11845 version-script names.
11846 * testsuite/version_script.map: Change glob pattern to use '?'
11847
5adf9721
ILT
118482008-06-30 Manish Singh <yosh@gimp.org>
11849
11850 PR 6585
11851 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11852 Correct typo.
11853
e6fde208
ILT
118542008-06-30 Ian Lance Taylor <iant@google.com>
11855
11856 PR 6660
11857 PR 6682
11858 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11859 versions]: Don't try to read the value in the contents, since we
11860 don't use it. Use the template endianness when writing.
11861
3f2e6a2d
CC
118622008-06-25 Cary Coutant <ccoutant@google.com>
11863
11864 * fileread.cc (File_read::make_view): Assert on zero-length view.
11865 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11866 symbol table when there are no symbols to read.
11867
c43d3a48
CS
118682008-06-23 Craig Silverstein <csilvers@google.com>
11869
11870 * version.cc (version_string): Bump to 1.7
11871
5f494ea0
CS
118722008-06-18 Craig Silverstein <csilvers@google.com>
11873
11874 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11875 constant 0xFFFF to type Valtype.
11876 (Powerpc_relocate_functions::rel16_ha): Likewise.
11877
c42e122e
ILT
118782008-06-17 Ian Lance Taylor <iant@google.com>
11879
f34787f8
ILT
11880 * output.h (Output_section::Input_section): Initialize p2align_ to
11881 zero for Output_section_data constructors.
11882 (Output_section::Input_section::addralign): If not an input
11883 section, return the alignment of the Output_section_data.
11884 * testsuite/copy_test.cc: New file.
11885 * testsuite/copy_test_1.cc: New file.
11886 * testsuite/copy_test_2.cc: New file.
11887 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11888 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11889 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11890 (copy_test_1_pic.o, copy_test_1.so): New targets.
11891 (copy_test_2_pic.o, copy_test_2.so): New targets.
11892 * testsuite/Makefile.in: Rebuild.
11893
c42e122e
ILT
11894 * script-sections.cc (Script_sections::place_orphan): Initialize
11895 local variable exact.
11896
ce3ac18a
DE
118972008-06-13 David Edelsohn <edelsohn@gnu.org>
11898
11899 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11900
42cacb20
DE
119012008-06-12 David Edelsohn <edelsohn@gnu.org>
11902 David S. Miller <davem@davemloft.net>
11903
11904 * powerpc.cc: New file.
11905 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11906 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11907 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11908 * Makefile.in: Rebuild.
11909
7b308235
ILT
119102008-06-09 Ian Lance Taylor <iant@google.com>
11911
11912 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11913 <exception>.
11914 (throwing, orig_terminate): New static variables.
11915 (terminate_handler): New static function.
11916 (t2): Set terminate handler.
11917
f0b886e3
ILT
119182008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11919
11920 PR 6584
cd536b21 11921 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
11922 alignment.
11923
3e90f135
CC
119242008-05-30 Cary Coutant <ccoutant@google.com>
11925
11926 * archive.cc (Archive::include_all_members) Correct to step
11927 over symbol table and extended name table in thin archives.
11928
e09ad04a
ILT
119292008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11930
11931 PR 6407
11932 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11933 calculation.
11934
62b01cb5
ILT
119352008-05-28 Caleb Howe <cshowe@google.com>
11936
11937 * reduced_debug_output.cc: New file.
11938 * reduced_debug_output.h: New file.
92de84a6 11939 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
11940 * options.cc (General_options::finalize): Add strip_debug_non_line
11941 to the strip heirarchy.
11942 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11943 fields.
11944 * layout.cc: Include "reduced_debug_output.h".
11945 (Layout::Layout): Initialize new fields.
11946 (line_only_debug_sections): New static array.
11947 (is_lines_only_debug_sections): New static inline function.
11948 (Layout::include_section): Handle --strip-debug-non-line.
11949 (Layout::make_output_section): If --strip-debug-non-line, build
11950 new output sections for .debug_abbrev and .debug_info.
11951 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11952 gold. Warn about possible overflow.
11953 (read_signed_LEB_128): Likewise.
11954 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11955 (read_signed_LEB_128): Declare.
11956 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11957 (HFILES): Add reduced_debug_output.h.
11958 * Makefile.in: Rebuild.
11959
7d9e3d98
ILT
119602008-05-21 Ian Lance Taylor <iant@google.com>
11961
11962 * mapfile.cc: New file.
11963 * mapfile.h: New file.
11964 * options.h (class General_options): Add -M/--print-map and -Map.
11965 * options.cc (General_options::finalize): Make -M equivalent to
11966 -Map -.
11967 * main.cc: Include <cstdio> and "mapfile.h".
11968 (main): Open mapfile if requested.
11969 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11970 constructor. Change caller.
11971 (queue_initial_tasks): Add mapfile parameter. Change caller.
11972 (queue_middle_tasks): Likewise.
11973 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11974 declarations.
11975 * archive.cc: Include "mapfile.h".
11976 (Archive::add_symbols): Add mapfile parameter. Change all
11977 callers. Pass mapfile, symbol, and reason to include_member.
11978 (Archive::include_all_members): Add mapfile parameter. Change all
11979 callers.
11980 (Archive::include_member): Add mapfile, sym, and why parameters.
11981 Change all callers. Report inclusion to map file.
11982 * archive.h: Include "fileread.h".
11983 (class Archive): Update declarations.
11984 (Archive::file): New const method.
11985 (class Add_archive_symbols): Add mapfile_ field. Update
11986 constructor. Change all callers.
11987 * readsyms.h (class Read_symbols): Likewise.
11988 (class Finish_group): Likewise.
11989 (class Read_script): Likewise.
11990 * common.cc: Include "mapfile.h".
11991 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11992 all callers.
11993 (Symbol_table::do_allocate_commons): Likewise.
11994 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11995 symbol allocation to mapfile.
11996 * common.h (class Allocate_commons_task): Add mapfile_ field.
11997 Update constructor. Change all callers.
11998 * symtab.h (class Symbol_table): Update declarations.
11999 * layout.cc: Include "mapfile.h".
12000 (Layout_task_runner::run): Print information to mapfile.
12001 (Layout::create_gold_note): Change Output_data_fixed_space to
12002 Output_data_zero_fill.
12003 (Layout::create_build_id): Likewise.
12004 (Layout::print_to_mapfile): New function.
12005 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12006 constructor. Change caller.
12007 (class Layout): Declare print_to_mapfile.
12008 * output.cc (Output_section::Input_section::print_to_mapfile): New
12009 function.
12010 (Output_section::add_input_section): If producing a map, always
12011 add to input_sections_ list.
12012 (Output_section::do_print_to_mapfile): New function.
12013 (Output_segment::print_sections_to_mapfile): New function.
12014 (Output_segment::print_section_list_to_mapfile): New function.
12015 * output.h: Include "mapfile.h".
12016 (Output_data::print_to_mapfile): New function.
12017 (Output_data::do_print_to_mapfile): New virtual function.
12018 (Output_segment_headers::do_print_to_mapfile): New function.
12019 (Output_file_header::do_print_to_mapfile): New function.
12020 (Output_data_const::do_print_to_mapfile): New function.
12021 (class Output_data_const_buffer): Add map_name_ field. Update
12022 constructor. Change all callers. Add do_print_to_mapfile
12023 function.
12024 (class Output_data_fixed_space): Likewise.
12025 (class Output_data_space): Likewise.
12026 (class Output_data_zero_fill): New class.
12027 (Output_data_strtab::do_print_to_mapfile): New function.
12028 (Output_data_reloc_base::do_print_to_mapfile): New function.
12029 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12030 (Output_data_group::do_print_to_mapfile): New function.
12031 (Output_data_got::do_print_to_mapfile): New function.
12032 (Output_data_dynamic::do_print_to_mapfile): New function.
12033 (Output_symtab_xindex::do_print_to_mapfile): New function.
12034 (class Output_section): Declare do_print_to_mapflie. Declare
12035 print_to_mapfile in Input_section.
12036 (class Output_segment): Declare new functions.
12037 * object.h (Sized_relobj::symbol_count): New function.
12038 * script-sections.cc
12039 (Output_section_element_dot_assignment::set_section_addresses):
12040 Change Output_data_fixed_space to Output_data_zero_fill.
12041 (Output_data_expression::do_print_to_mapfile): New function.
12042 * script.cc (read_input_script): Add mapfile parameter. Change
12043 all callers.
12044 * script.h (read_input_script): Update declaration.
12045 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
12046 (Eh_frame::do_print_to_mapfile): New function.
12047 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
12048 (Output_merge_string::do_print_to_mapfile): New function.
12049 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
12050 function.
12051 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
12052 function.
12053 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
12054 function.
12055 * Makefile.am (CCFILES): Add mapfile.cc.
12056 (HFILES): Add mapfile.h.
12057 * Makefile.in: Rebuild.
12058
9f1d377b
ILT
120592008-05-19 Ian Lance Taylor <iant@google.com>
12060
12061 * options.h (class General_options): Add -z relro.
12062 * layout.cc (Layout::Layout): Initialize relro_segment_.
12063 (Layout::add_output_section_data): Return the output section.
12064 (Layout::make_output_section): Rcognize relro sections and mark
12065 them appropriately.
12066 (Layout::attach_allocated_section_to_segment): Put relro sections
12067 in a PT_GNU_RELRO segment.
12068 (Layout::create_initial_dynamic_sections): Mark the .dynamic
12069 section as relro.
12070 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
12071 PT_TLS segments.
12072 (Layout::linkonce_mapping): Map d.rel.ro.local to
12073 .data.rel.ro.local.
12074 (Layout::output_section_name): Us .data.rel.ro.local for any
12075 section which begins with that.
12076 * layout.h (class Layout): Update add_output_section_data
12077 declaration. Add relro_segment_ field.
12078 * output.cc (Output_section::Output_section): Initialize is_relro_
12079 and is_relro_local_ fields.
12080 (Output_segment::add_output_section): Group relro sections.
12081 (Output_segment::is_first_section_relro): New function.
12082 (Output_segment::maximum_alignment): If there is a relro section,
12083 align the segment to the common page size.
12084 (Output_segment::set_section_addresses): Track whether we are
12085 looking at relro sections. If the last section is a relro
12086 section, align to the common page size.
12087 (Output_segment::set_section_list_addresses): Add in_relro
12088 parameter. Change all callers. Align to the page size when
12089 moving from relro to non-relro section.
12090 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
12091 segment.
12092 * output.h (class Output_section): Add is_relro_ and
12093 is_relro_local_ fields.
12094 (Output_section::is_relro): New function.
12095 (Output_section::set_is_relro): New function.
12096 (Output_section::is_relro_local): New function.
12097 (Output_section::set_is_relro_local): New function.
12098 (class Output_segment): Update declarations.
12099 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12100 * sparc.cc (Target_sparc::got_section): Likewise.
12101 * x86_64.cc (Target_x86_64::got_section): Likewise.
12102 * testsuite/relro_test_main.cc: New file.
12103 * testsuite/relro_test.cc: New file.
12104 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12105 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12106 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12107 (relro_test.so, relro_test_pic.o): New targets.
12108 * testsuite/Makefile.in: Rebuild.
12109
a984ee1d
ILT
121102008-05-16 Ian Lance Taylor <iant@google.com>
12111
01676dcd
ILT
12112 * output.cc (Output_segment::add_output_section): Remove front
12113 parameter.
12114 * output.h (class Output_segment): Remove
12115 add_initial_output_section and overloaded add_output_section.
12116 Update declaration of remaining add_output_section.
12117 * layout.cc (Layout::create_interp): Call add_output_section
12118 rather than add_initial_output_section.
12119 (Layout::finish_dynamic_section): Likewise.
12120
497897f9
ILT
12121 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12122 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12123 know the dynamic type.
12124 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12125 field. Initialize it in constructor.
12126 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12127 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12128 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12129 reloc.
12130
a984ee1d
ILT
12131 * output.cc (Output_reloc::get_address): Change return type to
12132 Elf_Addr.
12133 * output.h (class Output_reloc): Update get_address declaration.
12134 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12135 for section addresses.
12136
55ba0940
ILT
121372008-05-09 Ian Lance Taylor <iant@google.com>
12138
12139 PR 6493
12140 * gold.cc (gold_nomem): Use return value of write.
12141
75517b77
ILT
121422008-05-08 Ian Lance Taylor <iant@google.com>
12143
12144 * symtab.c (Symbol::init_base_output_data): Add version
12145 parameter. Change all callers.
12146 (Symbol::init_base_output_segment): Likewise.
12147 (Symbol::init_base_constant): Likewise.
12148 (Symbol::init_base_undefined): Likewise.
12149 (Sized_symbol::init_output_data): Likewise.
12150 (Sized_symbol::init_output_segment): Likewise.
12151 (Sized_symbol::init_constant): Likewise.
12152 (Sized_symbol::init_undefined): Likewise.
12153 (Symbol_table::do_define_in_output_data): If the new symbol has a
12154 version, mark it as the default.
12155 (Symbol_table::do_define_in_output_segment): Likewise.
12156 (Symbol_table::do_define_as_constant): Likewise.
12157 * symtab.h (class Symbol): Update declarations.
12158 (class Sized_symbol): Likewise.
12159 * resolve.cc (Symbol::override_version): New function.
c42e122e 12160 (Symbol::override_base): Call override_version.
75517b77
ILT
12161 (Symbol::override_base_with_special): Likewise.
12162 * testsuite/ver_script_8.script: New file.
12163 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12164 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12165 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12166 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12167
f1f70eae
ILT
121682008-05-06 Ian Lance Taylor <iant@google.com>
12169
f3e9c5c5
ILT
12170 PR 6049
12171 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12172 functions.
12173 (class General_options): Remove existing --undefined, and add
12174 --no-undefined instead. Add new --undefined as synonym for -u.
12175 * archive.cc (Archive::add_symbols): Check whether symbol was
12176 named with -u.
12177 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12178 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12179 all uses. Add IS_UNDEFINED. Update declarations to split
12180 different versions of init_base. Declare init_base_undefined.
12181 (Symbol::is_defined): Handle IS_UNDEFINED.
12182 (Symbol::is_undefined): Likewise.
12183 (Symbol::is_weak_undefined): Call is_undefined.
12184 (Symbol::is_absolute): Handle IS_CONSTANT.
12185 (class Sized_symbol): Update declarations to split different
12186 versions of init. Declare init_undefined.
12187 (class Symbol_table): Declare new functions.
12188 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12189 Change all callers.
12190 (Symbol::init_base_output_data): Likewise.
12191 (Symbol::init_base_output_segment): Likewise.
12192 (Symbol::init_base_constant): Likewise.
12193 (Symbol::init_base_undefined): New function.
12194 (Sized_symbol::init_object): Rename from init. Change all
12195 callers.
12196 (Sized_symbol::init_output_data): Likewise.
12197 (Sized_symbol::init_output_segment): Likewise.
12198 (Sized_symbol::init_constant): Likewise.
12199 (Sized_symbol::init_undefined): New function.
12200 (Symbol_table::add_undefined_symbols_from_command_line): New
12201 function.
12202 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12203 function.
12204 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12205 (Symbol::output_section): Likewise.
12206 (Symbol::set_output_section): Likewise.
12207 (Symbol_table::sized_finalize_symbol): Likewise.
12208 (Symbol_table::sized_write_globals): Likewise.
12209 * resolve.cc (Symbol_table::should_override): Likewise.
12210 (Symbol::override_base_with_special): Likewise.
12211
8bdcdf2c
ILT
12212 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12213 symbol, change it to have default visibility.
12214 * testsuite/protected_1.cc: New file.
12215 * testsuite/protected_2.cc: New file.
12216 * testsuite/protected_3.cc: New file.
12217 * testsuite/protected_main_1.cc: New file.
12218 * testsuite/protected_main_2.cc: New file.
12219 * testsuite/protected_main_3.cc: New file.
12220 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12221 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12222 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12223 (protected_1.so): New target.
12224 (protected_1_pic.o, protected_2_pic.o): New targets.
12225 (protected_3_pic.o): New target.
12226 (check_PROGRAMS): Add protected_2.
12227 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12228 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12229 * testsuite/Makefile.in: Rebuild.
12230
2b706932
ILT
12231 * options.h (DEFINE_var): Add set_user_set_##varname__.
12232 (DEFINE_bool_alias): New macro.
12233 (class General_options): Define -Bstatic using DEFINE_bool_alias
12234 rather than DEFINE_special. Add --undefined as an alias for -z
12235 defs.
12236 * options.cc (General_options::parse_Bstatic): Remove.
12237
d82a5bcc
ILT
12238 * options.h (class General_options): Add --fatal-warnings.
12239 * main.cc (main): Implement --fatal-warnings.
12240 * errors.h (Errors::warning_count): New function.
12241
f1f70eae
ILT
12242 * options.h (class General_options): Add -Bsymbolic-functions.
12243 * symtab.h (Symbol::is_preemptible): Check for
12244 -Bsymbolic-functions.
12245
8825ac63
ILT
122462008-05-05 Ian Lance Taylor <iant@google.com>
12247
d98bc257
ILT
12248 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12249 as noVARNAME rather than no-VARNAME.
12250 (class General_options): Add option -z combreloc.
12251 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12252 get_address.
12253 (Output_reloc::sort_before) [SHT_REL]: New function.
12254 (Output_reloc::sort_before) [SHT_RELA]: New function.
12255 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12256 Sort_relocs_comparison.
12257 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12258 parameter. Change all callers.
12259 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12260 sort_relocs parameter. Change all callers.
12261 * output.cc (Output_reloc::get_address): New function, broken out
12262 of write_rel.
12263 (Output_reloc::write_rel): Call it.
12264 (Output_reloc::compare): New function.
12265 (Output_data_reloc_base::do_write): Optionally sort relocs.
12266
60b2b4e7
ILT
12267 * configure.ac: If targ_extra_obj is set, link it in.
12268 * configure.tgt: Initialize all variables.
12269 (x86_64*): Set targ_extra_obj and targ_extra_size.
12270 * configure: Rebuild.
12271
8825ac63
ILT
12272 * object.cc (Sized_relobj::include_section_group): Adjust section
12273 indexes read from group data. Build vector to pass to
12274 layout_group.
12275 * layout.cc (Layout::layout_group): Add flags and shndxes
12276 parameters. Remove contents parameter. Change caller. Update
12277 explicit instantiations.
12278 * layout.h (class Layout): Update layout_group declaration.
12279 * output.cc (Output_data_group::Output_data_group): Add flags and
12280 input_shndxes parameters. Remove contents parameter. Change
12281 caller.
12282 (Output_data_group::do_write): Change input_sections_ to
12283 input_shndxes_.
12284 * output.h (class Output_data_group): Update constructor
12285 declaration. Rename input_sections_ to input_shndxes_.
12286 * testsuite/many_sections_test.cc: Add template.
12287
e94cf127
CC
122882008-04-30 Cary Coutant <ccoutant@google.com>
12289
4418b2d5
CC
12290 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12291
e94cf127
CC
12292 * layout.cc (Layout::include_section): Refactored check for debug
12293 info section.
12294 (Layout::add_comdat): Add new parameters. Change type
12295 of signature parameter. Add object and shndx to signatures table.
12296 (Layout::find_kept_object): New function.
12297 * layout.h: Include <cstring>.
12298 (Layout::is_debug_info_section): New function.
12299 (Layout::add_comdat): Add new parameters.
12300 (Layout::find_kept_object): New function.
12301 (Layout::Kept_section): New struct.
12302 (Layout::Signatures): Change type of map range.
12303 * object.cc (Relobj::output_section_address): New function.
12304 (Sized_relobj::include_section_group): Add new parameters. Change
12305 calls to Layout::add_comdat. Change to build table of kept comdat
12306 groups and table mapping discarded sections to kept sections.
12307 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12308 (Sized_relobj::do_layout): Change calls to include_section_group and
12309 include_linkonce_section.
12310 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12311 value to zero when section is discarded.
12312 (Sized_relobj::map_to_kept_section): New function.
12313 * object.h (Relobj::output_section_address): New function.
12314 (Relobj::Comdat_group): New type.
12315 (Relobj::find_comdat_group): New function.
12316 (Relobj::Comdat_group_table): New type.
12317 (Relobj::Kept_comdat_section): New type.
12318 (Relobj::Kept_comdat_section_table): New type.
12319 (Relobj::add_comdat_group): New function.
12320 (Relobj::set_kept_comdat_section): New function.
12321 (Relobj::get_kept_comdat_section): New function.
12322 (Relobj::comdat_groups_): New field.
12323 (Relobj::kept_comdat_sections_): New field.
12324 (Symbol_value::input_value): Update comment.
12325 (Sized_relobj::map_to_kept_section) New function.
12326 (Sized_relobj::include_linkonce_section): Add new parameter.
12327 * target-reloc.h (Comdat_behavior): New type.
12328 (get_comdat_behavior): New function.
12329 (relocate_section): Add code to map a discarded section to the
12330 corresponding kept section when applying a relocation.
12331
e4e5049b
CS
123322008-04-30 Craig Silverstein <csilvers@google.com>
12333
12334 * dwarf_reader.cc (next_generation_count): New static var.
12335 (Addr2line_cache_entry): New struct.
12336 (addr2line_cache): New static var.
12337 (Dwarf_line_info::one_addr2line): Added caching.
12338 (Dwarf_line_info::clear_addr2line_cache): New function.
12339 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12340 cache-size parameter.
12341 (Dwarf_line_info::one_addr2line_cache): New function.
12342 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12343 new cache-size argument to one_addr2line(), and clear cache.
12344
d09e9154
CC
123452008-04-28 Cary Coutant <ccoutant@google.com>
12346
12347 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12348 R_386_PC8 relocations.
12349
7ef73768
ILT
123502008-04-23 Ian Lance Taylor <iant@google.com>
12351
55438702
ILT
12352 * object.cc (Sized_relobj::include_section_group): Check for
12353 invalid section group.
12354
c165fb93
ILT
12355 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12356 header size.
12357
7ef73768
ILT
12358 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12359 than read for file header.
12360 * archive.cc (Archive::include_member): Likewise.
12361
6194aaab
L
123622008-04-23 Paolo Bonzini <bonzini@gnu.org>
12363
12364 * aclocal.m4: Regenerate.
12365 * configure: Regenerate.
12366
d491d34e
ILT
123672008-04-19 Ian Lance Taylor <iant@google.com>
12368
5ea2bac6
ILT
12369 * version.cc (version_string): Bump to 1.6.
12370
7bc3e21a
ILT
12371 * testsuite/Makefile.am (many_sections_r_test): New target.
12372 (many_sections_r_test_SOURCES): Remove.
12373 (many_sections_r_test_DEPENDENCIES): Remove.
12374 (many_sections_r_test_LDFLAGS): Remove.
12375 (many_sections_r_test_LDADD): Remove.
12376
7fcd3aa9
ILT
12377 * object.cc (Sized_relobj::do_add_symbols): Always pass
12378 local_symbol_count_ to add_from_relobj.
12379
4c94d6ae
ILT
12380 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12381 every thousand variables.
12382 * testsuite/Makefile.in: Rebuild.
12383
d491d34e
ILT
12384 * object.cc (Xindex::initialize_symtab_xindex): New function.
12385 (Xindex::read_symtab_xindex): New function.
12386 (Xindex::sym_xindex_to_shndx): New function.
12387 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12388 available.
12389 (Sized_relobj::do_initialize_xindex): New function.
12390 (Sized_relobj::do_read_symbols): Adjust section links.
12391 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12392 parameter. Change all callers.
12393 (Sized_relobj::include_section_group): Adjust section links and
12394 symbol section indexes.
12395 (Sized_relobj::do_layout): Adjust section links.
12396 (Sized_relobj::do_count_local_symbols): Adjust section links and
12397 symbol section indexes.
12398 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12399 ordinary and special symbols.
12400 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12401 dynsym_xindex parameters. Change all callers. Adjust section
12402 links. Use SHN_XINDEX when needed.
12403 (Sized_relobj::get_symbol_location_info): Adjust section links.
12404 Don't get fooled by special symbols.
12405 * object.h (class Xindex): Define.
12406 (class Object): Add xindex_ parameter. Declare virtual functoin
12407 do_initialize_xindex.
12408 (Object::adjust_sym_shndx): New function.
12409 (Object::set_xindex): New protected function.
12410 (class Symbol_value): Add is_ordinary_shndx_ field.
12411 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12412 (Symbol_value::value): Assert ordinary section.
12413 (Symbol_value::initialize_input_to_output_map): Likewise.
12414 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12415 Change all callers.
12416 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12417 all callers.
12418 (class Sized_relobj): Update declarations.
12419 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12420 parameter. Change all callers.
12421 (Sized_relobj::adjust_shndx): New function.
12422 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12423 field.
12424 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12425 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12426 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12427 (Sized_dynobj::read_dynsym_section): Adjust section links.
12428 (Sized_dynobj::read_dynamic): Likewise.
12429 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12430 section links.
12431 (Sized_dynobj::do_initialize_xindex): New function.
12432 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12433 do_initialize_xindex.
12434 (Sized_dynobj::adjust_shndx): New function.
12435 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12436 dynsym_xindex_ fields.
12437 (Layout::finalize): Add a call to set_section_indexes before
12438 creating the symtab sections.
12439 (Layout::set_section_indexes): Don't do anything if the section
12440 already has a section index.
12441 (Layout::create_symtab_sections): Add shnum parameter. Change
12442 caller. Create .symtab_shndx section if needed.
12443 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12444 caller.
12445 (Layout::allocated_output_section_count): New function.
12446 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12447 needed.
12448 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12449 fields. Update declarations.
12450 (Layout::symtab_xindex): New function.
12451 (Layout::dynsym_xindex): New function.
12452 (class Write_symbols_task): Add layout_ field.
12453 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12454 Change caller.
12455 * output.cc (Output_section_headers::Output_section_headers): Add
12456 shstrtab_section parameter. Change all callers.
12457 (Output_section_headers::do_sized_write): Store overflow values
12458 for section count and section string table section index in
12459 section header zero.
12460 (Output_file_header::do_sized_write): Check for overflow of
12461 section count and section string table section index.
12462 (Output_symtab_xindex::do_write): New function.
12463 (Output_symtab_xindex::endian_do_write): New function.
12464 * output.h (class Output_section_headers): Add shstrtab_section_.
12465 Update declarations.
12466 (class Output_symtab_xindex): Define.
12467 (Output_section::has_out_shndx): New function.
12468 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12469 field.
12470 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12471 Change all callers.
12472 (Sized_symbol::init): Likewise.
12473 (Symbol::output_section): Check for ordinary symbol.
12474 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12475 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12476 callers.
12477 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12478 Change all callers. Simplify handling of symbols from sections
12479 not included in the link.
12480 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12481 distinction.
12482 (Weak_alias_sorter::operator()): Assert that symbols are
12483 ordinary.
12484 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12485 distinction.
12486 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12487 parameters. Change all callers.
12488 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12489 symbol distinction. Use SHN_XINDEX when needed.
12490 (Symbol_table::write_section_symbol): Add symtab_xindex
12491 parameter. Change all callers.
12492 (Symbol_table::sized_write_section_symbol): Likewise. Use
12493 SHN_XINDEX when needed.
12494 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12495 declarations.
12496 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12497 (Symbol::is_defined): Check is_ordinary.
12498 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12499 (Symbol::is_absolute, Symbol::is_common): Likewise.
12500 (class Sized_symbol): Update declarations.
12501 (class Symbol_table): Update declarations.
12502 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12503 parameters. Change all callers.
12504 (Sized_symbol::override): Likewise.
12505 (Symbol_table::override): Likewise.
12506 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12507 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12508 is_ordinary, and orig_st_shndx parameters. Change all callers.
12509 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12510 to be in an ordinary section.
12511 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12512 object and is_ordinary parameters. Change all callers.
12513 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12514 Change all callers. Don't add undefined or non-ordinary symbols
12515 to reloc_map_.
12516 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12517 Change all callers.
12518 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12519 declarations.
12520 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12521 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12522 (Sized_relobj::relocate_sections): Likewise.
12523 * target-reloc.h (scan_relocs): Adjust section symbol index.
12524 (scan_relocatable_relocs): Likewise.
12525 * i386.cc (Scan::local): Check for ordinary symbols.
12526 * sparc.cc (Scan::local): Likewise.
12527 * x86_64.cc (Scan::local): Likewise.
12528 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12529 to symbol_section_and_value.
12530 * testsuite/many_sections_test.cc: New file.
12531 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12532 (check_PROGRAMS): Add many_sections_test.
12533 (many_sections_test_SOURCES): Define.
12534 (many_sections_test_DEPENDENCIES): Define.
12535 (many_sections_test_LDFLAGS): Define.
12536 (BUILT_SOURCES): Add many_sections_define.h.
12537 (many_sections_define.h): New target.
12538 (BUILT_SOURCES): Add many_sections_check.h.
12539 (many_sections_check.h): New target.
12540 (check_PROGRAMS): Add many_sections_r_test.
12541 (many_sections_r_test_SOURCES): Define.
12542 (many_sections_r_test_DEPENDENCIES): Define.
12543 (many_sections_r_test_LDFLAGS): Define.
12544 (many_sections_r_test_LDADD): Define.
12545 (many_sections_r_test.o): New target.
12546 * testsuite/Makefile.in: Rebuild.
12547
c5818ff1
CC
125482008-04-17 Cary Coutant <ccoutant@google.com>
12549
12550 * errors.cc (Errors::info): New function.
12551 (gold_info): New function.
12552 * errors.h (Errors::info): New function.
12553 * gold.h (gold_info): New function.
12554 * object.cc (Input_objects::add_object): Print trace output.
12555 * options.cc (options::parse_set): New function.
12556 (General_options::parse_wrap): Deleted.
12557 (General_options::General_options): Deleted initializer.
12558 * options.h (options::String_set): New typedef.
12559 (options::parse_set): New function.
12560 (DEFINE_set): New macro.
12561 (General_options::wrap): Changed to use DEFINE_set. Changed
12562 callers of any_wrap_symbols and is_wrap_symbol.
12563 (General_options::trace, General_options::trace_symbol):
12564 New options.
12565 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12566 (General_options::wrap_symbols_): Deleted.
12567 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12568
b5be4a7c
DM
125692008-04-17 David S. Miller <davem@davemloft.net>
12570
12571 * options.cc (General_options::parse_V): New function.
12572 * options.h: Add entries for -V and -Qy.
12573
155a0dd7
ILT
125742008-04-17 Ian Lance Taylor <iant@google.com>
12575
12576 * common.cc (Symbol_table::allocate_commons): Remove options
12577 parameter. Change caller.
12578 (Symbol_table::do_allocate_commons): Remove options parameter.
12579 Change caller. Just call do_allocate_commons_list twice.
12580 (Symbol_table::do_allocate_commons_list): New function, broken out
12581 of do_allocate_commons.
12582 * common.h (class Allocate_commons_task): Remove options_ field.
12583 Update constructor.
12584 * symtab.cc (Symbol_table::Symbol_table): Initialize
12585 tls_commons_.
12586 (Symbol_table::add_from_object): Put TLS common symbols on
12587 tls_commons_ list.
12588 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12589 which are IN_OUTPUT_DATA.
12590 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12591 allocate_commons and do_allocate_commons declarations. Declare
12592 do_allocate_commons_list.
12593 * gold.cc (queue_middle_tasks): Update creation of
12594 Allocate_commons_task to not pass options.
12595 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12596 (TLS_TEST_C_FLAGS): New variable.
12597 (tls_test_c_pic.o): New target.
12598 (tls_test_shared.so): Link in tls_test_c_pic.o.
12599 (tls_test_c_pic_ie.o): New target.
12600 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12601 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12602 (tls_test_c.o): New target.
12603 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12604 (tls_pic_test_LDADD): Likewise.
12605 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12606 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12607 (tls_test_c_gnu2.o): New target.
12608 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12609 tls_test_c_gnu2.o.
12610 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12611 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12612 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12613 * testsuite/tls_test.cc: Include "config.h".
12614 (t_last): Call t11_last.
12615 * testsuite/tls_test.h (t11, t11_last): Declare.
12616 * testsuite/tls_test_c.c: New file.
12617 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12618 * configure.ac: Check for OpenMP support.
12619 * configure, config.in, Makefile.in: Rebuild.
12620 * testsuite/Makefile.in: Rebuild.
12621
edfbb029
CC
126222008-04-16 Cary Coutant <ccoutant@google.com>
12623
12624 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12625 (Target_i386::tls_base_symbol_defined_): New field.
12626 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12627 (Target_i386::Scan::global): Likewise.
12628 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12629 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12630 (Target_x86_64::tls_base_symbol_defined_): New field.
12631 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12632 (Target_x86_64::Scan::global): Likewise.
12633
f3c69fca
CC
126342008-04-16 Cary Coutant <ccoutant@google.com>
12635
12636 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12637 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12638 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12639 building shared libraries.
12640 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12641 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12642 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12643 * testsuite/Makefile.in: Rebuild.
12644 * testsuite/weak_undef.h: New file.
12645 * testsuite/weak_undef_file1.cc: Add extra test cases.
12646 * testsuite/weak_undef_file2.cc: Likewise.
12647 * testsuite/weak_undef_test.cc: Likewise.
12648
7c414435
DM
126492008-04-16 David S. Miller <davem@davemloft.net>
12650
32b769e1
DM
12651 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12652 Add issued_non_pic_error_ field. Declare check_non_pic.
12653 (Target_sparc::Scan::check_non_pic): New function.
12654 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12655 (Target_sparc::Scan::global): Likewise.
12656
11936fb1
DM
12657 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12658 * configure: Rebuild.
12659
7c414435
DM
12660 * options.h (DEFINE_enable): New macro.
12661 (new_dtags): New enable option.
12662 (initfirst, interpose, loadfltr, nodefaultlib,
12663 nodelete, nodlopen, nodump): New -z options.
12664 * layout.cc (Layout:finish_dynamic_section): If new
12665 dtags enabled, emit DT_RUNPATH. Also, emit a
12666 DT_FLAGS_1 containing any specified -z flags.
12667
85c7bf8b
ILT
126682008-04-16 Ian Lance Taylor <iant@google.com>
12669
12c0daef
ILT
12670 * copy-relocs.cc: New file.
12671 * copy-relocs.h: New file.
12672 * reloc.cc: Remove Copy_relocs code.
12673 * reloc.h: Likewise.
12674 * reloc-types.h (struct Reloc_types) [both versions]: Add
12675 get_reloc_addend_noerror.
12676 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12677 variants of add_global which take an addend which must be zero.
12678 * i386.cc: Include "copy-relocs.h".
12679 (class Target_i386): Change type of copy_relocs_ to variable,
12680 update initializer.
12681 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12682 Change all callers.
12683 (Target_i386::do_finalize_sections): Change handling of
12684 copy_relocs_.
12685 * sparc.cc: Include "copy-relocs.h".
12686 (class Target_sparc): Change type of copy_relocs_ to variable,
12687 update initializer.
12688 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12689 Change all callers.
12690 (Target_sparc::do_finalize_sections): Change handling of
12691 copy_relocs_.
12692 * x86_64.cc: Include "copy-relocs.h".
12693 (class Target_x86_64): Change type of copy_relocs_ to variable,
12694 update initializer.
12695 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12696 class. Change all callers.
12697 (Target_x86_64::do_finalize_sections): Change handling of
12698 copy_relocs_.
12699 * Makefile.am (CCFILES): Add copy-relocs.cc.
12700 (HFILES): Add copy-relocs.h.
12701
4f4995b6
ILT
12702 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12703
85c7bf8b
ILT
12704 * testsuite/script_test_4.sh: Permit leading zeroes.
12705
4f2a9edd
ILT
127062008-04-15 Ian Lance Taylor <iant@google.com>
12707
e6188289
ILT
12708 * script-sections.cc (Script_sections::create_segments): Use
12709 header_size_adjustment even when there is enough room for the
12710 headers.
12711 * testsuite/script_test_4.sh: New file.
12712 * testsuite/script_test_4.t: New file.
12713 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12714 (check_DATA): Add script_test_4.stdout.
12715 (MOSTLYCLEANFILES): Likewise.
12716 (script_test_4): New target.
12717 (script_test_4.stdout): New target.
12718 * testsuite/Makefile.in: Rebuild.
12719
4f2a9edd
ILT
12720 * sparc.cc: Add definitions for Output_data_plt_sparc class
12721 constants.
12722
f5314dd5
DM
127232008-04-14 David S. Miller <davem@davemloft.net>
12724
12725 * sparc.cc: New file.
12726 * Makefile.am (TARGETSOURCES): Add sparc.cc
12727 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12728 * configure.tgt: Document targ_extra_size and
12729 targ_extra_big_endian. Add entries for sparc-* and
12730 sparc64-*.
12731 * configure.ac: Handle targ_extra_size and
12732 targ_extra_big_endian.
12733 * Makefile.in: Rebuild.
12734 * configure: Likewise.
12735 * po/POTFILES.in: Likewise.
12736 * po/gold.pot: Likewise.
12737
154e0e9a
ILT
127382008-04-14 Ian Lance Taylor <iant@google.com>
12739
12740 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12741 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12742 in the name/type/flags to section mapping. Don't call
12743 allocate_output_section.
12744 (Layout::choose_output_section): Change parameter from adjust_name
12745 to is_input_section. Don't permit input sections after sections
12746 are attached to segments. Don't call allocate_output_section.
12747 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12748 not write_enable_output_section.
12749 (Layout::make_output_section): Don't push to
12750 unattached_section_list_ nor call attach_to_segment. Call
12751 attach_section_to_segment if sections are attached.
12752 (Layout::attach_sections_to_segments): New function.
12753 (Layout::attach_section_to_segment): New function.
12754 (Layout::attach_allocated_section_to_segment): Rename from
12755 attach_to_segment. Remove flags parameter.
12756 (Layout::allocate_output_section): Remove function.
12757 (Layout::write_enable_output_section): Remove function.
12758 * layout.h (class Layout): Update for above changes. Add new
12759 field sections_are_attached_.
12760 * output.h (Output_section::update_flags_for_input_section): New
12761 function.
12762 * output.cc (Output_section::add_input_section): Call
12763 update_flags_for_input_section.
12764 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12765
009a67a2
CC
127662008-04-11 Cary Coutant <ccoutant@google.com>
12767
12768 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12769 thought unnecessary.
12770 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12771
759b1a24
ILT
127722008-04-11 Ian Lance Taylor <iant@google.com>
12773
12774 * output.h (class Output_section_data): Remove inline definition
12775 of set_addralign.
12776 * output.cc (Output_section_data::set_addralign): New function.
12777
c2b45e22
CC
127782008-04-11 Cary Coutant <ccoutant@google.com>
12779
12780 Add support for TLS descriptors for i386 and x86_64.
12781 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12782 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12783 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12784 GOT_TYPE_TLS_DESC.
12785 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12786 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12787 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12788 relocations.
12789 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12790 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12791 Fix problem with initial-exec relocations.
12792 (Target_i386::Relocate::relocate_tls): Likewise.
12793 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12794 relaxation.
12795 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12796 support for section-plus-offset dynamic table entries.
12797 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12798 (Output_data_dynamic::Dynamic_entry): Add support for
12799 section-plus-offset dynamic table entries.
12800 (Output_data_dynamic::Classification): Likewise.
12801 (Output_data_dynamic::classification_): Renamed offset_.
12802 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12803 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12804 (Target_x86_64::make_plt_section): New function.
12805 (Target_x86_64::reserve_tlsdesc_entries): New function.
12806 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12807 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12808 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12809 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12810 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12811 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12812 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12813 add extra PLT entry for TLS descriptors.
12814 (Output_data_plt_x86_64::got_): New field.
12815 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12816 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12817 fields.
12818 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12819 descriptors.
12820 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12821 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12822 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12823 R_386_TLS_DESC_CALL relocations.
12824 (Target_x86_64::Scan::global): Likewise.
12825 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12826 for TLS descriptors.
12827 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12828 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12829 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12830 GD-to-IE relaxation.
12831 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12832 and TLS_DESCRIPTORS.
12833 * Makefile.in: Rebuild.
12834 * configure: Rebuild.
12835 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12836 (tls_test_shared2.so): New target.
12837 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12838 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12839 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12840 (tls_shared_gd_to_ie_test_LDADD): New variable.
12841 (tls_shared_gnu2_gd_to_ie_test): New target.
12842 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12843 New targets.
12844 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12845 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12846 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12847 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12848 (tls_shared_gnu2_test): New target.
12849 (tls_test_gnu2_shared.so): New target.
12850 (tls_shared_gnu2_test_SOURCES): New variable.
12851 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12852 (tls_shared_gnu2_test_LDFLAGS): New variable.
12853 (tls_shared_gnu2_test_LDADD): New variable.
12854 * testsuite/Makefile.in: Rebuild.
12855 * testsuite/Makefile.
12856
83bfb6b7
ILT
128572008-04-11 Ian Lance Taylor <iant@google.com>
12858
12859 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12860 justsyms.t.
12861 * testsuite/Makefile.in: Rebuild.
12862
12863 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12864 long.
12865 * testsuite/script_test_2.cc (main): Adjust test.
12866
706e1f5e
ILT
128672008-04-11 David S. Miller <davem@davemloft.net>
12868 Ian Lance Taylor <iant@google.com>
12869
12870 * options.h (General_options): Add entries for '-Y' and
12871 '-relax'.
12872 * options.cc (General_options:finalize): If -Y was used, add those
12873 entries to the library path instead of the default "/lib" and
12874 "/usr/lib".
12875
7c98e6bb
DM
128762008-04-11 David S. Miller <davem@davemloft.net>
12877
12878 * testsuite/justsyms.t: Start at 0x100.
12879 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
12880 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12881 long.
12882 * testsuite/script_test_2.cc: Adjust string and section length
12883 checks.
7c98e6bb 12884
99a37bfd
ILT
128852008-04-09 Ian Lance Taylor <iant@google.com>
12886
2cefc357
ILT
12887 PR gold/5996
12888 * script-sections.cc (Sections_element::allocate_to_segment): Add
12889 orphan parameter.
12890 (Output_section_definition::allocate_to_segment): Likewise.
12891 (Orphan_output_section::allocate_to_segment): Likewise.
12892 (Script_sections::attach_sections_using_phdrs_clause): Don't
12893 propagate non-PT_LOAD segments to orphan sections.
12894 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12895 readelf rather than objdump.
12896 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12897 .interp section and PT_INTERP segment are the same size.
12898 * testsuite/Makefile.in: Rebuild.
12899
99a37bfd
ILT
12900 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12901 aliases for symbols defined in the same object.
12902 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12903 (weak_alias_test_SOURCES): New variable.
12904 (weak_alias_test_DEPENDENCIES): New variable.
12905 (weak_alias_test_LDFLAGS): New variable.
12906 (weak_alias_test_LDADD): New variable.
12907 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12908 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12909 (weak_alias_test_3.o): New target.
12910 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12911 * testsuite/weak_alias_test_main.cc: New file.
12912 * testsuite/weak_alias_test_1.cc: New file.
12913 * testsuite/weak_alias_test_2.cc: New file.
12914 * testsuite/weak_alias_test_3.cc: New file.
12915
780e49c5
ILT
129162008-04-08 Ian Lance Taylor <iant@google.com>
12917
cdb0b8f5
ILT
12918 * options.h (class General_options): Add --noinhibit-exec option.
12919 * main.cc (main): Check --noinhibit-exec.
12920
0864d551
ILT
12921 * options.h (class General_options): Define --wrap as a special
12922 option. Add wrap_symbols_ field.
12923 (General_options::any_wrap_symbols): New function.
12924 (General_options::is_wrap_symbol): New function.
12925 * options.cc (General_options::parse_wrap): New function.
12926 (General_options::General_options): Initialize wrap_symbols_.
12927 * symtab.cc (Symbol_table::wrap_symbol): New function.
12928 (Symbol_table::add_from_object): Handle --wrap.
12929 * symtab.h (class Symbol_table): Declare wrap_symbol.
12930 * target.h (Target::wrap_char): New function.
12931 (Target::Target_info): Add wrap_char field.
12932 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12933 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12934 * testsuite/testfile.cc (Target_test::test_target_info):
12935 Likewise.
12936
789aa6de
ILT
12937 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12938 there is one.
12939
2c38906f
ILT
12940 * layout.h (class Layout): Add added_eh_frame_data_ field.
12941 * layout.cc (Layout::Layout): Initialize new field.
12942 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12943 output section until we find a section we merged successfully.
12944 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12945 that the size be non-zero.
12946
780e49c5
ILT
12947 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12948 qualifier.
12949
7fcd0256
ILT
129502008-04-08 Craig Silverstein <csilvers@google.com>
12951
12952 * configure.ac: Export new conditional variable HAVE_ZLIB.
12953 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12954 on HAVE_ZLIB.
12955 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12956 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12957
6835af53
ILT
129582008-04-07 Ian Lance Taylor <iant@google.com>
12959
e24f324c
ILT
12960 * version.cc (version_string): Set to "1.5".
12961
a036edd8
ILT
12962 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12963 Add issued_non_pic_error_ field. Declare check_non_pic.
12964 (Target_x86_64::Scan::check_non_pic): New function.
12965 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12966 (Target_x86_64::Scan::global): Likewise.
12967
624f8810
ILT
12968 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12969 addend parameter. Change caller. Handle merge sections.
12970 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12971 Address to Addend. Don't add in the result of
12972 local_section_offset, pass down the addend and use the returned
12973 value.
12974 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12975 Update declarations of local_section_offset and symbol_value.
12976 * testsuite/two_file_test_1.cc (t18): New function.
12977 * testsuite/two_file_test_2.cc (f18): New function.
12978 * testsuite/two_file_test_main.cc (main): Call t18.
12979 * testsuite/two_file_test.h (t18, f18): Declare.
12980
6835af53
ILT
12981 * configure.ac: Don't test for objdump, c++filt, or readelf.
12982 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12983 conditionals.
12984 (TEST_READELF): New variable.
12985 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12986 (check_PROGRAMS): Add two_file_strip_test.
12987 (two_file_strip_test): New target.
12988 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12989 (two_file_same_shared_strip_test_SOURCES): New variable.
12990 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12991 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12992 (two_file_same_shared_strip_test_LDADD): New variable.
12993 (two_file_shared_strip.so): New target.
12994 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12995 (ver_test_5.syms, ver_test_7.syms): Likewise.
12996 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12997 (strip_test_3.stdout): Use TEST_OBJDUMP.
12998 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12999
86925eef
CC
130002008-04-04 Cary Coutant <ccoutant@google.com>
13001
13002 * symtab.h (Symbol::is_weak_undefined): New function.
13003 (Symbol::is_strong_undefined): New function.
13004 (Symbol::is_absolute): New function.
13005 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13006 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13007 absolute symbols.
13008 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
13009 (weak_undef_test): New target.
13010 * testsuite/Makefile.in: Rebuild.
13011 * testsuite/weak_undef_file1.cc: New file.
13012 * testsuite/weak_undef_file2.cc: New file.
13013 * testsuite/weak_undef_test.cc: New file.
13014
126f3ece
ILT
130152008-04-03 Craig Silverstein <csilvers@google.com>
13016
13017 * compressed_output.h (class Output_compressed_section): Use
13018 unsigned buffer.
13019 * compressed_output.cc (zlib_compress): Use unsigned buffers,
13020 add zlib header.
13021 (zlib_compressed_suffix): Removed.
13022 (Output_compressed_section::set_final_data_size): Use unsigned
13023 buffers.
13024 * testsuite/Makefile.am (flagstest_compress_debug_sections):
13025 Fix linker invocation.
13026 (flagstest_o_specialfile_and_compress_debug_sections):
13027 Likewise.
13028 * testsuite/Makefile.in: Regenerated.
13029
deae2a14
DM
130302008-04-02 David S. Miller <davem@davemloft.net>
13031
13032 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13033 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13034
70752818
ILT
130352008-04-02 Craig Silverstein <csilvers@google.com>
13036
13037 * TODO: New file.
13038
39d0cb0e
ILT
130392008-04-02 Ian Lance Taylor <iant@google.com>
13040
13041 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13042 parameters. Update for new key type to views_. Change all
13043 callers.
13044 (File_read::read): Adjust for byteshift in returned view.
13045 (File_read::add_view): New function, broken out of
13046 find_and_make_view.
13047 (File_read::make_view): New function, broken out of
13048 find_and_make_view.
13049 (File_read::find_or_make_view): Add offset and aligned
13050 parameters. Rewrite accordingly. Change all callers.
13051 (File_read::get_view): Add offset and aligned parameters. Adjust
13052 for byteshift in return value.
13053 (File_read::get_lasting_view): Likewise.
13054 * fileread.h (class File_read): Update declarations.
13055 (class File_read::View): Add byteshift_ field. Add byteshift to
13056 constructor. Add byteshift method.
13057 * archive.h (Archive::clear_uncached_views): New function.
13058 (Archive::get_view): Add aligned parameter. Change all callers.
13059 * object.h (Object::get_view): Add aligned parameter. Change all
13060 callers.
13061 (Object::get_lasting_view): Likewise.
13062
13063 * fileread.cc (File_read::release): Don't call clear_views if
13064 there are multiple objects.
13065 * fileread.h (File_read::clear_uncached_views): New function.
13066 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
13067 on the archive.
13068
a1207466
CC
130692008-03-31 Cary Coutant <ccoutant@google.com>
13070
13071 Add thin archive support.
13072 * archive.cc (Archive::armagt): New const.
13073 (Archive::setup): Remove task parameter and calls to unlock.
13074 (Archive::unlock_nested_archives): New function.
13075 (Archive::read_header): Add nested_off parameter. Change
13076 all callers.
13077 (Archive::interpret_header): Likewise.
13078 (Archive::include_all_members): Change to handle thin
13079 archives.
13080 (Archive::include_member): Likewise.
13081 * archive.h (Archive::Archive): Add new parameters and
13082 initializers.
13083 (Archive::armagt): New const.
13084 (Archive::setup): Remove task parameter.
13085 (Archive::unlock_nested_archives): New function.
13086 (Archive::read_header): Add nested_off parameter.
13087 (Archive::interpret_header): Likewise.
13088 (Archive::Nested_archive_table): New typedef.
13089 (Archive::is_thin_archive_): New field.
13090 (Archive::nested_archives_): New field.
13091 (Archive::options_): New field.
13092 (Archive::dirpath_): New field.
13093 (Archive::task_): New field.
13094 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13095 for thin archives. Pass additional parameters to
13096 Archive::Archive. Unlock the archive file after calling
13097 Archive::setup.
cd536b21 13098
479f6503
ILT
130992008-03-29 Ian Lance Taylor <iant@google.com>
13100
686c8caf
ILT
13101 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13102 version symbol to be local.
13103 * testsuite/ver_test_4.sh: New file.
13104 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13105 (check_DATA): Add ver_test_4.syms.
13106 (ver_test_4.syms): New target.
13107 * testsuite/Makefile.in: Rebuild.
13108
ab794b6b
ILT
13109 * output.cc
13110 (Output_section::Input_section_sort_entry::has_priority): New
13111 function.
13112 (Output_section::Input_section_sort_entry::match_file_name): New
13113 function.
13114 (Output_section::Input_section_sort_entry::match_section_name):
13115 Remove.
13116 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13117 Remove.
13118 (Output_section::Input_section_sort_entry::match_section_file):
13119 Remove.
13120 (Output_section::Input_section_sort_compare::operator()): Rewrite
13121 using new Input_section_sort_entry functions. Sort crtbegin and
13122 crtend first. Sort sections with no priority before sections with
13123 a priority.
13124 * testsuite/initpri1.c (d3): Check j != 4.
13125 (cd5): New constructor/destructor function.
13126 (main): Check j != 2.
13127
479f6503
ILT
13128 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13129 new symbol when resolving, don't call set_is_default.
13130 * testsuite/ver_test_7.cc: New file.
13131 * testsuite/ver_test_7.sh: New file.
13132 * testsuite/Makefile.am (ver_test_7.so): New target.
13133 (ver_test_7.o): New target.
13134 (check_SCRIPTS): Add ver_test_7.sh.
13135 (check_DATA): Add ver_test_7.syms.
13136 (ver_test_7.syms): New target.
13137
2fd32231
ILT
131382008-03-28 Ian Lance Taylor <iant@google.com>
13139
13140 * layout.cc (Layout::layout): If we see an input section with a
13141 name that needs sorting, set the must_sort flag for the output
13142 section.
13143 (Layout::make_output_section): If the name of the output section
13144 indicates that it might require sorting, set the may_sort flag.
13145 * output.h (Output_section::may_sort_attached_input_sections): New
13146 function.
13147 (Output_section::set_may_sort_attached_input_sections): New
13148 function.
13149 (Output_section::must_sort_attached_input_sections): New
13150 function.
13151 (Output_section::set_must_sort_attached_input_sections): New
13152 function.
13153 (class Output_section): Declare Input_section_sort_entry. Define
13154 Input_section_sort_compare. Declare
13155 sort_attached_input_sections. Add new fields:
13156 may_sort_attached_input_sections_,
13157 must_sort_attached_input_sections_,
13158 attached_input_sections_are_sorted_.
13159 * output.cc (Output_section::Output_section): Initialize new
13160 fields.
13161 (Output_section::add_input_section): Add an entry to
13162 input_sections_ if may_sort or must_sort are true.
13163 (Output_section::set_final_data_size): Call
13164 sort_attached_input_sections if necessary.
13165 (Output_section::Input_section_sort_entry): Define new class.
13166 (Output_section::Input_section_sort_compare::operator()): New
13167 function.
13168 (Output_section::sort_attached_input_sections): New function.
13169 * configure.ac: Check whether the compiler supports constructor
13170 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13171 * testsuite/initpri1.c: New file.
13172 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13173 CONSTRUCTOR_PRIORITY.
13174 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13175 (initpri1_LDFLAGS): New variable.
13176 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13177
18e6b24e
ILT
131782008-03-27 Ian Lance Taylor <iant@google.com>
13179
49bdd526
ILT
13180 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13181 * testsuite/common_test_1.c: New file.
13182 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13183 (common_test_1_SOURCES): New variable.
13184 (common_test_1_DEPENDENCIES): New variable.
13185 (common_test_1_LDFLAGS): New variable.
13186
18e6b24e
ILT
13187 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13188 and commons_ correctly when NAME/VERSION does not override
13189 NAME/NULL.
13190 * testsuite/ver_test_6.c: New file.
13191 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13192 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13193 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13194
04bf7072
ILT
131952008-03-26 Ian Lance Taylor <iant@google.com>
13196
5871526f
ILT
13197 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13198 of an undefined symbol from a version script.
13199 * testsuite/Makefile.am (ver_test_5.so): New target.
13200 (ver_test_5.o): New target.
13201 (check_SCRIPTS): Add ver_test_5.sh.
13202 (check_DATA): Add ver_test_5.syms.
13203 (ver_test_5.syms): New target.
13204 * testsuite/ver_test_5.cc: New file.
13205 * testsuite/ver_test_5.script: New file.
13206 * testsuite/ver_test_5.sh: New file.
13207 * Makefile.in, testsuite/Makefile.in: Rebuild.
13208
04bf7072
ILT
13209 PR gold/5986
13210 Fix problems building gold with gcc 4.3.0.
13211 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13212 (gold_error_at_location, gold_warning_at_location): Use it.
13213 * configure.ac: Check whether we can compile and use a template
13214 function with a printf attribute.
13215 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13216 when jumping over bytes.
13217 * object.cc: Instantiate Object::read_section_data.
13218 * debug.h: Include <cstring>
13219 * dwarf_reader.cc: Include <algorithm>
13220 * main.cc: Include <cstring>.
13221 * options.cc: Include <cstring>.
13222 * output.cc: Include <cstring>.
13223 * script.cc: Include <cstring>.
13224 * script.h: Include <string>.
13225 * symtab.cc: Include <cstring> and <algorithm>.
13226 * target-select.cc: Include <cstring>.
13227 * version.cc: Include <string>.
13228 * testsuite/testmain.cc: Include <cstdlib>.
13229 * configure, config.in: Rebuild.
13230
874c5b28
ILT
132312008-03-25 Ian Lance Taylor <iant@google.com>
13232
819d6c3a
ILT
13233 * options.cc: Include "../bfd/bfdver.h".
13234 (options::help): Print bug reporting address.
13235
f4b2c6f5
ILT
13236 * version.cc (print_version): Adjust output for current value of
13237 BFD_VERSION_STRING.
13238
13239 * NEWS: New file.
13240
e96caa79
ILT
13241 * options.cc (options::help): Print list of supported targets.
13242 * target-select.h: Include <vector>.
13243 (class Target_selector): Make machine_, size_, and is_big_endian_
13244 fields const. Add bfd_name_ and instantiated_target_ fields.
13245 (Target_selector::Target_selector): Add bfd_name parameter.
13246 (Target_selector::recognize): Make non-virtual, call
13247 do_recognize.
13248 (Target_selector::recognize_by_name): Make non-virtual, call
13249 do_recognize_by_name.
13250 (Target_selector::supported_names): New function.
13251 (Target_selector::bfd_name): New function.
13252 (Target_selector::do_instantiate_target): New pure virtual
13253 function.
13254 (Target_selector::do_recognize): New virtual function.
13255 (Target_selector::do_recognize_by_name): New virtual function.
13256 (Target_selector::instantiate_target): New private function.
13257 (supported_target_names): Declare.
13258 * target-select.cc (Target_selector::Target_selector): Update for
13259 new parameter and fields.
13260 (select_target_by_name): Check that the name matches before
13261 calling recognize_by_name.
13262 (supported_target_names): New function.
13263 * i386.cc (class Target_selector_i386): Update Target_selector
13264 constructor call. Remove recognize and recognize_by_name. Add
13265 do_instantiate_target.
13266 * x86_64.cc (class Target_selector_x86_64): Likewise.
13267 * testsuite/testfile.cc (class Target_selector_test): Update for
13268 changes to Target_selector.
13269
874c5b28
ILT
13270 * README: Rewrite, with some notes on unsupported features.
13271
0a65a3a7
CC
132722008-03-24 Cary Coutant <ccoutant@google.com>
13273
13274 * i386.cc (Target_i386::Got_type): New enum declaration.
13275 (Target_i386::Scan::local): Updated callers of Output_data_got
13276 member functions.
13277 (Target_i386::Scan::global): Likewise.
13278 (Target_i386::Relocate::relocate): Likewise.
13279 (Target_i386::Relocate::relocate_tls): Likewise.
13280 * object.h (Got_offset_list): New class.
13281 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13282 (Sized_relobj::local_got_offset): Likewise.
13283 (Sized_relobj::set_local_got_offset): Likewise.
13284 (Sized_relobj::local_has_tls_got_offset): Removed.
13285 (Sized_relobj::local_tls_got_offset): Removed.
13286 (Sized_relobj::set_local_tls_got_offset): Removed.
13287 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13288 * output.cc (Output_data_got::add_global): Added got_type parameter.
13289 (Output_data_got::add_global_with_rel): Likewise.
13290 (Output_data_got::add_global_with_rela): Likewise.
13291 (Output_data_got::add_global_pair_with_rel): New function.
13292 (Output_data_got::add_global_pair_with_rela): New function.
13293 (Output_data_got::add_local): Added got_type parameter.
13294 (Output_data_got::add_local_with_rel): Likewise.
13295 (Output_data_got::add_local_with_rela): Likewise.
13296 (Output_data_got::add_local_pair_with_rel): New function.
13297 (Output_data_got::add_local_pair_with_rela): New function.
13298 (Output_data_got::add_global_tls): Removed.
13299 (Output_data_got::add_global_tls_with_rel): Removed.
13300 (Output_data_got::add_global_tls_with_rela): Removed.
13301 (Output_data_got::add_local_tls): Removed.
13302 (Output_data_got::add_local_tls_with_rel): Removed.
13303 (Output_data_got::add_local_tls_with_rela): Removed.
13304 * output.h (Output_data_got::add_global): Added got_type parameter.
13305 (Output_data_got::add_global_with_rel): Likewise.
13306 (Output_data_got::add_global_with_rela): Likewise.
13307 (Output_data_got::add_global_pair_with_rel): New function.
13308 (Output_data_got::add_global_pair_with_rela): New function.
13309 (Output_data_got::add_local): Added got_type parameter.
13310 (Output_data_got::add_local_with_rel): Likewise.
13311 (Output_data_got::add_local_with_rela): Likewise.
13312 (Output_data_got::add_local_pair_with_rel): New function.
13313 (Output_data_got::add_local_pair_with_rela): New function.
13314 (Output_data_got::add_global_tls): Removed.
13315 (Output_data_got::add_global_tls_with_rel): Removed.
13316 (Output_data_got::add_global_tls_with_rela): Removed.
13317 (Output_data_got::add_local_tls): Removed.
13318 (Output_data_got::add_local_tls_with_rel): Removed.
13319 (Output_data_got::add_local_tls_with_rela): Removed.
13320 * resolve.cc (Symbol::override_base_with_special): Removed
13321 reference to has_got_offset_ field.
13322 * symtab.cc (Symbol::init_fields): Replaced initialization
13323 of got_offset_ with got_offsets_. Removed initialization
13324 of has_got_offset_
53fcba31 13325 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
13326 (Symbol::got_offset): Likewise.
13327 (Symbol::set_got_offset): Likewise.
13328 (Symbol::has_tls_got_offset): Removed.
13329 (Symbol::tls_got_offset): Removed.
13330 (Symbol::set_tls_got_offset): Removed.
13331 (Symbol::got_offset_): Removed.
13332 (Symbol::tls_mod_got_offset_): Removed.
13333 (Symbol::tls_pair_got_offset_): Removed.
13334 (Symbol::got_offsets_): New field.
13335 (Symbol::has_got_offset): Removed.
13336 (Symbol::has_tls_mod_got_offset): Removed.
13337 (Symbol::has_tls_pair_got_offset): Removed.
13338 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13339 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13340 member functions.
13341 (Target_x86_64::Scan::global): Likewise.
13342 (Target_x86_64::Relocate::relocate): Likewise.
13343 (Target_x86_64::Relocate::relocate_tls): Likewise.
13344
bd52eafb
BE
133452008-03-25 Ben Elliston <bje@au.ibm.com>
13346
13347 * yyscript.y: Fix spelling error in comment.
13348
8b105e34
ILT
133492008-03-24 Ian Lance Taylor <iant@google.com>
13350
8ed814a9
ILT
13351 * options.h (class General_options): Define build_id option.
13352 * layout.h (class Layout): Declare write_build_id, create_note,
13353 create_build_id. Add build_id_note_ member.
13354 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13355 "libiberty.h", "md5.h", "sha1.h".
13356 (Layout::Layout): Initialize eh_frame_data_,
13357 eh_frame_hdr_section_, and build_id_note_.
13358 (Layout::finalize): Call create_build_id.
13359 (Layout::create_note): New function, broken out of
13360 Layout::create_gold_note.
13361 (Layout::create_gold_note): Call create_note.
13362 (Layout::create_build_id): New function.
13363 (Layout::write_build_id): New function.
13364 (Close_task_runner::run): Call write_build_id.
13365
8b105e34
ILT
13366 * x86_64.cc: Correct license to GPLv3.
13367
086a1841
ILT
133682008-03-23 Ian Lance Taylor <iant@google.com>
13369
13370 * options.cc: Include "demangle.h".
13371 (parse_optional_string): New function.
13372 (parse_long_option): Handle takes_optional_argument.
13373 (parse_short_option): Update dash_z initializer. Handle
13374 takes_optional_argument.
13375 (General_options::General_options): Initialize do_demangle_.
13376 (General_options::finalize): Set do_demangle_. Handle demangling
13377 style.
13378 * options.h (parse_optional_string): Declare.
13379 (struct One_option): Add optional_arg field. Update constructor.
13380 Update call constructor calls. Add takes_optional_argument
13381 function.
13382 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13383 (DEFINE_optional_string): Define.
13384 (General_options::demangle): Change from DEFINE_bool to
13385 DEFINE_optional_string.
13386 (General_options::no_demangle): New function.
13387 (General_options::do_demangle): New function.
13388 (General_options::set_do_demangle): New function.
13389 (General_options::execstack_status_): Move definition to end of
13390 class definition.
13391 (General_options::static_): Likewise.
13392 (General_options::do_demangle_): New field.
13393 * object.cc (big_endian>::get_symbol_location_info): Call
13394 Options::do_demangle, not Options::demangle.
13395 * symtab.cc (demangle): Likewise.
13396
cbb93e63
ILT
133972008-03-22 Ian Lance Taylor <iant@google.com>
13398
13399 * gold.h: Include <cstddef> and <sys/types.h>
13400 * options.h: Include <cstring>.
13401
ec531623
ILT
134022008-03-21 Ian Lance Taylor <iant@google.com>
13403
13404 * Added source code to GNU binutils.
This page took 0.81486 seconds and 4 git commands to generate.