* target.h (Target::output_section_name): New function.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
921b5322
AM
12012-08-14 Alan Modra <amodra@gmail.com>
2
3 * target.h (Target::output_section_name): New function.
4 (Target::do_output_section_name): New function.
5 * layout.cc (Layout::choose_output_section): Call the above.
6 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
7
6ce78956
AM
82012-08-14 Alan Modra <amodra@gmail.com>
9
10 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
11 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
12 for replace_constant call.
13 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
14 (Output_data_glink::do_print_to_mapfile): New function.
15 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
16 (Target_powerpc::Relocate::relocate): Likewise.
17
d1a8cabd
AM
182012-08-14 Alan Modra <amodra@gmail.com>
19
20 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
21 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
22 (Output_data_glink::add_entry,find_entry): Remove shndx param.
23 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
24 all references to shndx_. Handle special case for R_PPC_PLTREL24
25 here.
26 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
27 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
28 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
29 here.
30 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
31 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
32
d83ce4e3
AM
332012-08-12 Alan Modra <amodra@gmail.com>
34
35 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
36 (glink insn constants): Use uint32_t.
37 (Output_data_glink::add_entry): Use insert, not [] operator.
38
cf43a2fe
AM
392012-08-11 Alan Modra <amodra@gmail.com>
40
41 * object.h (Sized_relobj_file::find_shdr): New function.
42 (Sized_relobj_file::find_special_sections): New function.
43 * object.cc (Sized_relobj_file::find_shdr): New function.
44 (Sized_relobj_file::find_eh_frame): Use find_shdr.
45 (Sized_relobj_file::find_special_sections): New function, split out..
46 (Sized_relobj_file::do_read_symbols): ..from here.
47 * output.h (Output_data_got::replace_constant): New function.
48 (Output_data_got::num_entries): New function.
49 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
50 (Output_data_got::got_offset): Protected rather than private.
51 (Output_data_got::replace_got_entry): New function.
52 * output.cc (Output_data_got::replace_got_entry): New function.
53 * powerpc.cc (class Powerpc_relobj): New.
54 (class Powerpc_relocate_functions): Delete all psymval variants or
55 convert to value,addend type. Delete pcrela, pcrela_unaligned.
56 Implement _ha functions using corresponding _hi function.
57 (Powerpc_relobj::find_special_sections): New function.
58 (Target_powerpc::do_make_elf_object): New function.
59 (class Output_data_got_powerpc): New.
60 (class Output_data_glink): New.
61 (class Powerpc_scan_relocatable_reloc): New.
62 Many more changes througout file.
63
3c892704
NC
642012-08-09 Nick Clifton <nickc@redhat.com>
65
66 * po/vi.po: Updated Vietnamese translation.
67
82435b3b
ILT
682012-08-07 Ian Lance Taylor <iant@google.com>
69
70 * layout.cc (Layout::add_target_dynamic_tags): If
71 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
72 plt_rel.
73
a6dc81d2
NC
742012-07-30 Nick Clifton <nickc@redhat.com>
75
76 * po/gold.pot: Updated template.
77 * po/es.po: Updated Spanish translation.
78
f1415016
CC
792012-07-18 Cary Coutant <ccoutant@google.com>
80
81 PR gold/14344
82 * configure.ac: Add check for -gpubnames support.
83 * configure: Regenerate.
84 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
85 support; force -gno-pubnames.
86 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
87 support.
88 (gdb_index_test_4): New test.
89 * testsuite/Makefile.in: Regenerate.
90 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
91 * testsuite/gdb_index_test_2.sh: Likewise.
92 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
93 * testsuite/gdb_index_test_4.sh: New script.
94 * testsuite/gdb_index_test_comm.sh: New script with common code;
95 don't look for space after colon.
96
b7fd7c37
ST
972012-07-16 Sriraman Tallam <tmsriram@google.com>
98
99 * gold.cc (queue_middle_tasks): Update function order only after
100 deferred objects due to plugins are processed.
101
1f3212db
ILT
1022012-07-11 Ian Lance Taylor <iant@google.com>
103
104 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
105 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
106 (Target_arm::scan_reloc_for_stub): Likewise.
107 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
108 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
109 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
110 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
111 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
112
81c82a68
ILT
1132012-07-10 Dodji Seketeli <dodji@redhat.com>
114 Ian Lance Taylor <iant@google.com>
115
116 PR gold/14309
117 * configure.ac: Test whether std::tr1::hash<off_t> works.
118 * gold.h: Add a specialization for std::tr1::hash<off_t> if
119 needed.
120 * output.h (class Output_fill): Add virtual destructor.
121 * configure, config.in: Rebuild.
122
eabc84f4
RM
1232012-06-22 Roland McGrath <mcgrathr@google.com>
124
125 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
126
370e30b6
RÁE
1272012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
128
129 * plugin.cc (Plugin::load): Handle position independent executables.
130
fb1b895d
CC
1312012-06-06 Cary Coutant <ccoutant@google.com>
132
133 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
134 add .debug_macro.
135 (lines_only_debug_sections): Likewise.
136 (gdb_fast_lookup_sections): New static array.
137 (is_gdb_debug_section): Rename formal parameter.
138 (is_lines_only_debug_section): Likewise.
139 (is_gdb_fast_lookup_section): New function.
140 (Layout::include_section): Check for ".zdebug_" prefix; pass
141 section name suffix to is_gdb_debug_section, et al.; check for
142 fast-lookup sections when building .gdb_index.
143 * options.h (--strip-debug-gdb): Update GDB version number.
144
7c0640fa
CC
1452012-06-06 Cary Coutant <ccoutant@google.com>
146
147 * configure.ac: Add check for fallocate.
148 * configure: Regenerate.
149 * config.in: Regenerate.
150
151 * options.h (class General_options): Add --mmap-output-file and
152 --posix-fallocate options.
153 * output.cc: (posix_fallocate): Remove; replace with...
154 (gold_fallocate): New function.
155 (Output_file::map_no_anonymous): Call gold_fallocate.
156 (Output_file::map): Check --mmap-output-file option.
157
2a49eb69
DK
1582012-06-05 Jing Yu <jingyu@google.com>
159
160 * gold.h (textdomain): Add do {} to empty while(0).
161 (bindtextdomain): Likewise.
162
fad072ac
CC
1632012-06-04 Cary Coutant <ccoutant@google.com>
164
165 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
166 has_dynsym_index.
167
8cc69fb6
ST
1682012-05-25 Sriraman Tallam <tmsriram@google.com>
169
170 * symtab.cc (Symbol_table::define_special_symbol):
171 Initialize *poldsym to prevent uninitialized variable errors.
172
1be75daa
CC
1732012-05-23 Cary Coutant <ccoutant@google.com>
174
175 * layout.cc (Layout::section_name_mapping): Add rules to handle
176 exact match on .data.rel.ro.local or .data.rel.ro.
177 (Layout::output_section_name): Check for exact matches.
178
9b689de0
CC
1792012-05-23 Cary Coutant <ccoutant@google.com>
180
181 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
182 more carefully.
183
b24fdbf5
CC
1842012-05-22 Cary Coutant <ccoutant@google.com>
185
186 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
187 object before exporting symbol.
188
e550e1a2
L
1892012-05-21 H.J. Lu <hongjiu.lu@intel.com>
190
191 * testsuite/tls_test.cc: Include "config.h" first.
192 * testsuite/tls_test_c.c: Likewise.
193
df7b86aa
NC
1942012-05-17 Daniel Richard G. <skunk@iskunk.org>
195 Nick Clifton <nickc@redhat.com>
196
197 PR 14072
198 * configure.in: Add check that sysdep.h has been included before
199 any system header files.
200 * configure: Regenerate.
201 * config.in: Regenerate.
202
1007b503
CC
2032012-05-14 Cary Coutant <ccoutant@google.com>
204
205 * layout.cc (Layout::make_output_section): Mark .tdata section
206 as RELRO.
207 * testsuite/relro_test.cc: Add a TLS variable.
208
fd885f3a
L
2092012-05-10 H.J. Lu <hongjiu.lu@intel.com>
210
211 PR gold/14091
212 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
213 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
214 R_X86_64_64.
215
80f5885c
CC
2162012-05-08 Cary Coutant <ccoutant@google.com>
217
218 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
219 (lines_only_debug_sections): Likewise.
220
2e702c99
RM
2212012-05-02 Roland McGrath <mcgrathr@google.com>
222
223 * nacl.cc: New file.
224 * nacl.h: New file.
225 * Makefile.am (CCFILES, HFILES): Add them.
226 * Makefile.in: Regenerate.
227 * i386.cc (Output_data_plt_i386_nacl): New class.
228 (Output_data_plt_i386_nacl_exec): New class.
229 (Output_data_plt_i386_nacl_dyn): New class.
230 (Target_i386_nacl): New class.
231 (Target_selector_i386_nacl): New class.
232 (target_selector_i386): Use it instead of Target_selector_i386.
233 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
234 (Target_x86_64_nacl): New class.
235 (Target_selector_x86_64_nacl): New class.
236 (target_selector_x86_64, target_selector_x32): Use it instead of
237 Target_selector_x86_64.
238 * arm.cc (Output_data_plt_arm_nacl): New class.
239 (Target_arm_nacl): New class.
240 (Target_selector_arm_nacl): New class.
241 (target_selector_arm, target_selector_armbe): Use it instead of
242 Target_selector_arm.
243
244 * target-select.cc (select_target): Take new Input_file* and off_t
245 arguments, pass them on to recognize method of selector.
246 * object.cc (make_elf_sized_object): Update caller.
247 * parameters.cc (parameters_force_valid_target): Likewise.
248 * incremental.cc (make_sized_incremental_binary): Likewise.
249 * target-select.h: Update decl.
250 (Target_selector::recognize): Take new Input_file* argument,
251 pass it on to do_recognize.
252 (Target_selector::do_recognize): Take new Input_file* argument.
253 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
254 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
255 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
256 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
257
258 * target.h (Target::Target_info): New members isolate_execinstr
259 and rosegment_gap.
260 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
261 * arm.cc (Target_arm::arm_info): Update initializer.
262 * i386.cc (Target_i386::i386_info): Likewise.
263 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
264 * sparc.cc (Target_sparc::sparc_info): Likewise.
265 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
266 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
267 * layout.cc (Layout::attach_allocated_section_to_segment):
268 Take new const Target* argument. If target->isolate_execinstr(), act
269 like --rosegment.
270 (Layout::find_first_load_seg): Take new const Target* argument;
271 if target->isolate_execinstr(), reject PF_X segments.
272 (Layout::relaxation_loop_body): Update caller.
273 (Layout::set_segment_offsets): If target->isolate_execinstr(),
274 reset file offset to zero when we hit LOAD_SEG, and then do a second
275 loop over the segments before LOAD_SEG to reassign offsets after
276 addresses have been determined. Handle target->rosegment_gap().
277 (Layout::attach_section_to_segment): Take new const Target* argument;
278 pass it to attach_allocated_section_to_segment.
279 (Layout::make_output_section): Update caller.
280 (Layout::attach_sections_to_segments): Take new const Target* argument;
281 pass it to attach_section_to_segment.
282 * gold.cc (queue_middle_tasks): Update caller.
283 * layout.h (Layout): Update method decls with new arguments.
284
285 * arm.cc (Target_arm::Target_arm): Take optional argument for the
286 Target_info pointer to use.
287 (Target_arm::do_make_data_plt): New virtual method.
288 (Target_arm::make_data_plt): New method that calls it.
289 (Target_arm::make_plt_entry): Use it.
290 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
291 for the section alignment.
292 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
293 method.
294 (Output_data_plt_arm::first_plt_entry_offset): Call it.
295 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
296 method.
297 (Output_data_plt_arm::get_plt_entry_size): Call it.
298 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
299 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
300 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
301 method.
302 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
303 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
304 method instead of sizeof(plt_entry).
305 (Output_data_plt_arm::add_entry): Likewise.
306 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
307 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
308 than static method.
309 (Target_arm::plt_entry_size): Likewise.
310 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
311 Move to ...
312 (Output_data_plt_arm_standard): ... here, new class.
313 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
314 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
315 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
316
317 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
318 Take additional argument for the PLT entry size.
319 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
320 Use get_plt_entry_size method rather than plt_entry_size variable.
321 (Output_data_plt_x86_64::reserve_slot): Likewise.
322 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
323 (Output_data_plt_x86_64::add_entry): Likewise.
324 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
325 (Output_data_plt_x86_64::address_for_global): Likewise.
326 (Output_data_plt_x86_64::address_for_local): Likewise.
327 (Output_data_plt_x86_64::set_final_data_size): Likewise.
328 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
329 Make method non-static.
330 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
331 method.
332 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
333 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
334 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
335 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
336 virtual method.
337 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
338 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
339 virtual method.
340 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
341 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
342 virtual method.
343 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
344 (Output_data_plt_x86_64::plt_entry_size)
345 (Output_data_plt_x86_64::first_plt_entry)
346 (Output_data_plt_x86_64::plt_entry)
347 (Output_data_plt_x86_64::tlsdesc_plt_entry)
348 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
349 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
350 (Output_data_plt_x86_64_standard): ... here, new class.
351 (Target_x86_64::Target_x86_64): Take optional argument for the
352 Target_info pointer to use.
353 (Target_x86_64::do_make_data_plt): New virtual method.
354 (Target_x86_64::make_data_plt): New method to call it.
355 (Target_x86_64::init_got_plt_for_update): Use that.
356 Call this->plt_->add_eh_frame method here.
357 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
358 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
359 rather than static method.
360 (Target_x86_64::plt_entry_size): Likewise.
361 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
362 rather than plt_entry_size variable. Move guts of PLT filling to...
363 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
364 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
365 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
366
367 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
368 additional argument for the section alignment.
369 Don't do add_eh_frame_for_plt here.
370 (Output_data_plt_i386::first_plt_entry_offset): Make the method
371 non-static. Use get_plt_entry_size method rather than plt_entry_size
372 variable.
373 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
374 method.
375 (Output_data_plt_i386::get_plt_entry_size): Call it.
376 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
377 (Output_data_plt_i386::add_eh_frame): New method to call it.
378 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
379 method.
380 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
381 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
382 method.
383 (Output_data_plt_i386::fill_plt_entry): New method to call it.
384 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
385 method instead of plt_entry_size.
386 (Output_data_plt_i386::plt_entry_size)
387 (Output_data_plt_i386::plt_eh_frame_fde_size)
388 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
389 (Output_data_plt_i386_standard): ... here, new class.
390 (Output_data_plt_i386_exec): New class.
391 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
392 (Output_data_plt_i386_exec::first_plt_entry): ... here.
393 (Output_data_plt_i386::exec_plt_entry): Move to ...
394 (Output_data_plt_i386_exec::plt_entry): ... here.
395 (Output_data_plt_i386_dyn): New class.
396 (Output_data_plt_i386::first_plt_entry): Move to ...
397 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
398 (Output_data_plt_i386::dyn_plt_entry): Move to ...
399 (Output_data_plt_i386_dyn::plt_entry): ... here.
400 (Target_i386::Target_i386): Take optional argument for the Target_info
401 pointer to use.
402 (Target_i386::do_make_data_plt): New virtual method.
403 (Target_i386::make_data_plt): New method to call it.
404 (Target_i386::make_plt_section): Use that.
405 Call this->plt_->add_eh_frame method here.
406 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
407 rather than plt_entry_size variable.
408 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
409 (Output_data_plt_i386::address_for_local): Likewise.
410 (Output_data_plt_i386::do_write): Likewise.
411 Move guts of PLT filling to...
412 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
413 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
414 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
415 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
416
b9b9f2ee
CC
4172012-05-01 Cary Coutant <ccoutant@google.com>
418
419 * dwarf_reader.cc (Dwarf_die::read_attributes)
420 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
421 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
422 * reduced_debug_output.cc
423 (Output_reduced_debug_info_section::get_die_end): Remove
424 DW_FORM_GNU_ref_index. Add default case.
425
57923f48
MW
4262012-04-26 Mark Wielaard <mjw@redhat.com>
427
428 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
429 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
430 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
431 DW_AT_high_pc as offset from DW_AT_low_pc.
432
433 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
434 * testsuite/Makefile.in: Regenerate.
435 * testsuite/gdb_index_test_3.c: New test source file.
436 * testsuite/gdb_index_test_3.sh: New test source file.
437
2c54b4f4
ILT
4382012-04-25 Ian Lance Taylor <iant@google.com>
439
440 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
441 pointer.
442 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
443 as a class, not a struct.
444 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
445 (Target_arm::apply_cortex_a8_workaround): Likewise.
446 * gc.h: Declare Reloc_types as a struct, not a class.
447 * object.h: Declare Symbols_data as a struct.
448 * reloc.h: Declare Read_relocs_data as a struct.
449 * target.h: Declare Relocate_info as a struct.
450
a5a5f7a3
DM
4512012-04-24 David S. Miller <davem@davemloft.net>
452
453 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
454 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
455 and R_SPARC_WPLT30.
456
f038d496
CC
4572012-04-24 Cary Coutant <ccoutant@google.com>
458
459 * incremental-dump.cc (find_input_containing_global): Replace
460 magic number with symbolic constant.
461 (dump_incremental_inputs): Update version number.
462 * incremental.cc (Output_section_incremental_inputs): Update version
463 number; import symbolic constants from Incremental_inputs_reader.
464 (Incremental_inputs::create_data_sections): Align relocations
465 section correctly for 64-bit targets.
466 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
467 constants; add padding.
468 (Output_section_incremental_inputs::write_header): Add assert for
469 header_size.
470 (Output_section_incremental_inputs::write_input_files): Add assert
471 for input_entry_size.
472 (Output_section_incremental_inputs::write_info_blocks): Add padding;
473 add assert for object_info_size, input_section_entry_size,
474 global_sym_entry_size.
475 * incremental.h (Incremental_inputs_reader): Add symbolic constants
476 for data structure sizes; use them.
477 (Incremental_input_entry_reader): Import symbolic constants from
478 Incremental_inputs_reader; use them.
479
a4d85145
DM
4802012-04-23 David S. Miller <davem@davemloft.net>
481
482 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
483 and elf_flags_set_.
484 (Target_sparc::Target_sparc): Initialize new fields.
485 (Target_sparc::do_make_elf_object): New function.
486 (Target_sparc::do_adjust_elf_header): New function.
487
1d509098
CC
4882012-04-23 Cary Coutant <ccoutant@google.com>
489
490 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
491 CU range table of gdb index.
492
7ebeff7f
DM
4932012-04-20 David S. Miller <davem@davemloft.net>
494
495 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
496 instead of false.
497
13cf9988
DM
4982012-04-16 David S. Miller <davem@davemloft.net>
499
2a1079e8
DM
500 * sparc.cc (Target_sparc::got_address): New function.
501 (Sparc_relocate_functions::gdop_hix22): New function.
502 (Sparc_relocate_functions::gdop_lox10): New function.
503 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
504 relocs.
505 (Target_sparc::Scan::local): Likewise if the global symbol is not
506 preemptible and is not IFUNC.
507 (Target_sparc::Relocate::relocate): Perform GOTDATA code
508 transformations for local and non-preemptible non-IFUNC global
509 symbols.
510
0bc964fc
DM
511 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
512 writing out 64-bit part of ranges.
513
661d7a80
DM
514 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
515 -fpic and -fpie respectively.
516 * Makefile.in: Regenerate.
517
8c2bf391
DM
518 * sparc.cc (class Target_sparc): Add rela_ifunc_.
519 (Target_sparc::Target_sparc): Initialize new field.
520 (Target_sparc::do_plt_section_for_global): New function.
521 (Target_sparc::do_plt_section_for_local): New function.
522 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
523 (Target_sparc::make_plt_section): New function, broken out of
524 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
525 (Target_sparc::make_plt_entry): Call make_plt_section.
526 (Target_sparc::make_local_ifunc_plt_entry): New function.
527 (Target_sparc::rela_ifunc_section): New function.
528 (Target_sparc::plt_section): Remove const.
529 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
530 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
531 and ifunc_count_ fields.
532 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
533 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
534 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
535 (Output_data_plt_sparc::rela_ifunc): New function.
536 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
537 (Output_data_plt_sparc::has_ifunc_section): New function.
538 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
539 (Output_data_plt_sparc::address_for_global): New function.
540 (Output_data_plt_sparc::address_for_local): New function.
541 (Output_data_plt_sparc::plt_index_to_offset): New function.
542 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
543 and entry_count.
544 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
545 entry_count.
546 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
547 R_SPARC_JMP_IREL to switch.
548 (Target_sparc::Scan::check_non_pic): Likewise.
549 (Target_sparc::Scan::local): Handle IFUNC symbols.
550 (Target_sparc::Scan::local): Likewise.
551 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
552 and plt_address_for_local.
553 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
554 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
555
13cf9988
DM
556 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
557 (class Output_data_reloc): Adjust calls to Output_reloc_type.
558 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
559 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
560 global relocs too.
561 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
562 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
563 calls.
564 * sparc.cc (Target_sparc::Scan::global): Likewise.
565 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
566
31821be0
CC
5672012-04-16 Cary Coutant <ccoutant@google.com>
568
569 * archive.cc (Library_base::should_include_member): Check for
570 --export-dynamic-symbol.
571 * options.h (class General_options): Add --export-dynamic-symbol.
572 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
573 --export-dynamic-symbol.
574 (Symbol_table::gc_mark_undef_symbols): Likewise.
575 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
576
2615994e
DM
5772012-04-12 David S. Miller <davem@davemloft.net>
578
579 * sparc.cc (Reloc::wdisp10): New relocation method.
580 (Reloc::h34): Likewise.
581 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
582 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
583 R_SPARC_WDISP10.
584 (Target_sparc::Scan::local): Likewise.
585 (Target_sparc::Scan::global): Likewise.
586 (Target_sparc::Relocate::relocate): Likewise.
587
6782735d
CC
5882012-04-09 Cary Coutant <ccoutant@google.com>
589
590 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
591 low_pc == 0.
592
8c7a0b00
ILT
5932012-04-06 Ian Lance Taylor <iant@google.com>
594
595 * timer.cc: #include <unistd.h>.
596
58797674
RM
5972012-04-06 Roland McGrath <mcgrathr@google.com>
598
599 * configure.in (AC_CHECK_HEADERS): Add locale.h.
600 * config.in: Regenerate.
601 * configure: Regenerate.
602
44350750
NC
6032012-04-05 Nick Clifton <nickc@redhat.com>
604
605 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
606 (AM_LC_MESSAGES): Add.
607 * aclocal.m4: Regenerate.
608 * config.in: Regenerate.
609 * configure: Regenerate.
610
c1027032
CC
6112012-03-21 Cary Coutant <ccoutant@google.com>
612
613 * Makefile.am: Add gdb-index.cc, gdb-index.h.
614 * Makefile.in: Regenerate.
615 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
616 (Sized_elf_reloc_mapper::symbol_section): New function.
617 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
618 (make_elf_reloc_mapper): New function.
619 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
620 (Dwarf_abbrev_table::do_read_abbrevs): New function.
621 (Dwarf_abbrev_table::do_get_abbrev): New function.
622 (Dwarf_ranges_table::read_ranges_table): New function.
623 (Dwarf_ranges_table::read_range_list): New function.
624 (Dwarf_pubnames_table::read_section): New function.
625 (Dwarf_pubnames_table::read_header): New function.
626 (Dwarf_pubnames_table::next_name): New function.
627 (Dwarf_die::Dwarf_die): New function.
628 (Dwarf_die::read_attributes): New function.
629 (Dwarf_die::skip_attributes): New function.
630 (Dwarf_die::set_name): New function.
631 (Dwarf_die::set_linkage_name): New function.
632 (Dwarf_die::attribute): New function.
633 (Dwarf_die::string_attribute): New function.
634 (Dwarf_die::int_attribute): New function.
635 (Dwarf_die::uint_attribute): New function.
636 (Dwarf_die::ref_attribute): New function.
637 (Dwarf_die::child_offset): New function.
638 (Dwarf_die::sibling_offset): New function.
639 (Dwarf_info_reader::check_buffer): New function.
640 (Dwarf_info_reader::parse): New function.
641 (Dwarf_info_reader::do_parse): New function.
642 (Dwarf_info_reader::do_read_string_table): New function.
643 (Dwarf_info_reader::lookup_reloc): New function.
644 (Dwarf_info_reader::get_string): New function.
645 (Dwarf_info_reader::visit_compilation_unit): New function.
646 (Dwarf_info_reader::visit_type_unit): New function.
647 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
648 Sized_elf_reloc_mapper.
649 (Sized_dwarf_line_info::symbol_section): Remove function.
650 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
651 (Sized_dwarf_line_info::read_line_mappings): Remove object
652 parameter, adjust callers.
653 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
654 * dwarf_reader.h: Include <sys/types.h>.
655 (class Track_relocs): Remove forward declaration.
656 (class Elf_reloc_mapper): New class.
657 (class Sized_elf_reloc_mapper): New class.
658 (class Dwarf_abbrev_table): New class.
659 (class Dwarf_range_list): New class.
660 (class Dwarf_ranges_table): New class.
661 (class Dwarf_pubnames_table): New class.
662 (class Dwarf_die): New class.
663 (class Dwarf_info_reader): New class.
664 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
665 (Sized_dwarf_line_info::symbol_section): Remove member function.
666 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
667 base class.
668 * gdb-index.cc: New source file.
669 * gdb-index.h: New source file.
670 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
671 and .debug_types sections, call Layout::add_to_gdb_index.
672 (Sized_relobj_incr::do_section_name): Implement.
673 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
674 return type; Implement.
675 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
676 return type.
677 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
678 parameter list and return type.
679 (Sized_incr_dynobj::do_section_contents): Likewise.
680 * layout.cc: Include gdb-index.h.
681 (Layout::Layout): Initialize gdb_index_data_.
682 (Layout::init_fixed_output_section): Check for .gdb_index section.
683 (Layout::add_to_gdb_index): New function. Instantiate.
684 * layout.h: Add forward declaration for class Gdb_index.
685 (Layout::add_to_gdb_index): New member function.
686 (Layout::gdb_index_data_): New data member.
687 * main.cc: Include gdb-index.h.
688 (main): Print statistics for gdb index.
689 * object.cc (Object::section_contents): Move code into
690 do_section_contents.
691 (need_decompressed_section): Check for sections needed when building
692 gdb index.
693 (build_compressed_section_map): Likewise.
694 (Sized_relobj_file::do_read_symbols): Need local symbols when building
695 gdb index.
696 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
697 sections; call Layout::add_to_gdb_index.
698 (Sized_relobj_file::do_decompressed_section_contents): Call
699 do_section_contents directly.
700 * object.h (Object::do_section_contents): Adjust parameter list and
701 return type.
702 (Object::do_decompressed_section_contents): Call do_section_contents
703 directly.
704 (Sized_relobj_file::do_section_contents): Adjust parameter list and
705 return type.
706 * options.h (class General_options): Add --gdb-index option.
707 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
708 list and return type.
709 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
710 * reloc.h (Track_relocs::checkpoint): New function.
711 (Track_relocs::reset): New function.
712
713 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
714 New test cases.
715 * testsuite/Makefile.in: Regenerate.
716 * testsuite/gdb_index_test.cc: New test source file.
717 * testsuite/gdb_index_test_1.sh: New test source file.
718 * testsuite/gdb_index_test_2.sh: New test source file.
719
647f1574
DK
7202012-03-19 Doug Kwan <dougkwan@google.com>
721
722 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 723 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
724 __exidx_start and __exidx_end. Make symbol table parameter
725 anonymous as it is not used.
726 * gold.cc (queue_middle_tasks): Call target hook to define any
727 target-specific symbols.
728 * target.h (Target::define_standard_symbols): New method.
729 (Target::do_define_standard_symbols): Same.
730 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
731 * testsuite/Makefile.in: Regenerate.
732 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
733 and __exidx_end.
734 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
735 relocations are generated for __exidx_start and __exidx_end.
736
7c6109da
DK
7372012-03-16 Doug Kwan <dougkwan@google.com>
738
739 * testsuite/Makefile.am: Disable test initpri3b.
740 * testsuite/Makefile.in: Regenerate.
741
7b8957f8
DK
7422012-03-15 Doug Kwan <dougkwan@google.com>
743
744 * arm.cc (Target_arm::got_section): Make .got section read-only
745 if -z now is given.
746
14dc9ef7
ILT
7472012-03-15 Ian Lance Taylor <iant@google.com>
748
749 PR gold/13850
750 * layout.cc (Layout::make_output_section): Correctly mark
751 SHT_INIT_ARRAY, et. al., as relro.
752
fa40b62a
DK
7532012-03-14 Doug Kwan <dougkwan@google.com>
754
755 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
756 dynamic relocations for protected symbols in shared objects.
757
fd325007
ILT
7582012-03-13 Ian Lance Taylor <iant@google.com>
759
760 * resolve.cc (Symbol_table::resolve): When merging common symbols,
761 keep the larger alignment.
762
e8dd54e1
CC
7632012-03-12 Cary Coutant <ccoutant@google.com>
764
765 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
766 handling of DW_LNE_define_file.
767
feb5f3b0
CC
7682012-03-12 Cary Coutant <ccoutant@google.com>
769
770 * reduced_debug_output.cc
771 (Output_reduced_debug_info_section::get_die_end): Add new FORM
772 codes to switch.
773
a1fb4256
CC
7742012-02-29 Cary Coutant <ccoutant@google.com>
775
776 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
777
5dd8762a
CC
7782012-02-29 Cary Coutant <ccoutant@google.com>
779
780 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
781 Call Object::decompressed_section_contents.
782 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
783 New dtor.
784 (Sized_dwarf_line_info::buffer_start_): New data member.
785 * merge.cc (Output_merge_data::do_add_input_section): Call
786 Object::decompressed_section_contents.
787 (Output_merge_string::do_add_input_section): Likewise.
788 * object.cc (need_decompressed_section): New function.
789 (build_compressed_section_map): Decompress sections needed later.
790 (Sized_relobj_file::do_decompressed_section_contents): New function.
791 (Sized_relobj_file::do_discard_decompressed_sections): New function.
792 * object.h (Object::decompressed_section_contents): New function.
793 (Object::discard_decompressed_sections): New function.
794 (Object::do_decompressed_section_contents): New function.
795 (Object::do_discard_decompressed_sections): New function.
796 (Compressed_section_info): New type.
797 (Compressed_section_map): Include decompressed section contents.
798 (Sized_relobj_file::do_decompressed_section_contents): New function.
799 (Sized_relobj_file::do_discard_decompressed_sections): New function.
800
7b5de7ee
CC
8012012-02-16 Cary Coutant <ccoutant@google.com>
802
803 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
804 * testsuite/Makefile.in: Regenerate.
805
f9fa4a63
CC
8062012-02-14 Cary Coutant <ccoutant@google.com>
807
808 * options.cc (General_options::finalize): Disallow -pie and -static.
809
2c175ebc
DK
8102012-02-03 Doug Kwan <dougkwan@google.com>
811
812 * arm.cc (Arm_relocate_functions::abs8,
813 Arm_relocate_functions::abs16): Use
814 Bits::has_signed_unsigned_overflow32.
815 (Arm_relocate_functions::thm_abs8): Correct range of
816 overflow check.
817 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
818 in assertions.
819
90cff06f
DK
8202012-02-02 Doug Kwan <dougkwan@google.com>
821
822 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
823 position independent outputs, not just shared objects.
824
63887f3d
L
8252012-01-30 H.J. Lu <hongjiu.lu@intel.com>
826
827 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
828 * configure: Regenerated.
829
bef2b434
ILT
8302012-01-27 Ian Lance Taylor <iant@google.com>
831
832 * reloc.h (Bits): New class with static functions, copied from
833 namespace utils in arm.cc.
834 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
835 instead.
836
c335b55d
L
8372012-01-27 H.J. Lu <hongjiu.lu@intel.com>
838
839 * incremental.cc (write_info_blocks): Correct relocation offset.
840
41194d9f
L
8412012-01-27 H.J. Lu <hongjiu.lu@intel.com>
842
843 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
844 (Relocate::tls_gd_to_le): Likewise.
845
1bae613c
L
8462012-01-27 H.J. Lu <hongjiu.lu@intel.com>
847
848 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
849
24482ca0
L
8502012-01-27 H.J. Lu <hongjiu.lu@intel.com>
851
852 * configure.ac: Check if -mcmodel=medium works.
853 * configure: Regenerated.
854
c2c7840a
CC
8552012-01-24 Cary Coutant <ccoutant@google.com>
856
857 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
858 definition and ...
859 (read_unsigned_LEB_128_x): ... this new function.
860 (read_signed_LEB_128): Replaced with inline definition and ...
861 (read_signed_LEB_128_x): ... this new function.
862 * int_encoding.h (read_unsigned_LEB_128_x): New function.
863 (read_unsigned_LEB_128): Add inline definition.
864 (read_signed_LEB_128_x): New function.
865 (read_signed_LEB_128): Add inline definition.
866 * testsuite/Makefile.am (leb128_unittest): New unit test.
867 * testsuite/Makefile.in: Regenerate.
868 * testsuite/leb128_unittest.cc: New unit test.
869
833de760 8702012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
871
872 PR gold/13617
873 * i386.cc (Target_i386::do_code_fill): When using a jmp
874 instruction, pad with nop instructions.
875 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
876
618d6666
L
8772012-01-22 H.J. Lu <hongjiu.lu@intel.com>
878
879 * x86_64.cc (gc_process_relocs): Add typename on types used in
880 template.
881 (scan_relocs): Likewise.
882 (relocate_section): Likewise.
883 (apply_relocation): Likewise.
884
3660ff06
L
8852012-01-10 H.J. Lu <hongjiu.lu@intel.com>
886
887 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
888 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
889 under x32.
890
fc51264f
L
8912012-01-09 H.J. Lu <hongjiu.lu@intel.com>
892
893 * x86_64.cc: Initial support for x32.
894
dd74ae06
CC
8952012-01-03 Cary Coutant <ccoutant@google.com>
896
897 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
898 Use abstract base class for GOT.
899 * gold/output.h (class Output_data_got_base): New abstract base class.
900 (class Output_data_got): Derive from new base class, adjust ctors.
901 (Output_data_got::reserve_slot): Make virtual; rename to
902 do_reserve_slot; Adjust callers.
903 * gold/target.h (Sized_target::init_got_plt_for_update): Return
904 pointer to abstract base class.
905 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
906
83896202
ILT
9072011-12-18 Ian Lance Taylor <iant@google.com>
908
909 * object.h (Relobj::local_symbol_value): New function.
910 (Relobj::local_plt_offset): New function.
911 (Relobj::local_has_got_offset): New function.
912 (Relobj::local_got_offset): New function.
913 (Relobj::set_local_got_offset): New function.
914 (Relobj::do_local_symbol_value): New pure virtual function.
915 (Relobj::do_local_plt_offset): Likewise.
916 (Relobj::do_local_has_got_offset): Likewise.
917 (Relobj::do_local_got_offset): Likewise.
918 (Relobj::do_set_local_got_offset): Likewise.
919 (Sized_relobj::do_local_has_got_offset): Rename from
920 local_has_got_offset.
921 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
922 (Sized_relobj::do_set_local_got_offset): Rename from
923 set_local_got_offset.
924 (Sized_relobj_file::do_local_plt_offset): Rename from
925 local_plt_offset.
926 (Sized_relobj_file::do_local_symbol_value): New function.
927 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
928 local_plt_offset.
929 * output.cc (Output_data_got::Got_entry::write): Change object to
930 Relobj. Use local_symbol_value.
931 (Output_data_got::add_global_with_rel): Change rel_dyn to
932 Output_data_reloc_generic*. Use add_global_generic.
933 (Output_data_got::add_global_with_rela): Remove. Change all
934 callers to use add_global_with_rel.
935 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
936 Output_data_reloc_generic*. Use add_global_generic.
937 (Output_data_got::add_global_pair_with_rela): Remove. Change all
938 callers to use add_global_pair_with_rel.
939 (Output_data_got::add_local): Change object to Relobj*.
940 (Output_data_got::add_local_plt): Likewise.
941 (Output_data_got::add_local_with_rel): Change object to Relobj*,
942 change rel_dyn to Output_data_reloc_generic*. Use
943 add_local_generic.
944 (Output_data_got::add_local_with_rela): Remove. Change all
945 callers to use all_local_with_rel.
946 (Output_data_got::add_local_pair_with_rel): Change object to
947 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
948 add_output_section_generic.
949 (Output_data_got::add_local_pair_with_rela): Remove. Change all
950 callers to use add_local_pair_with_rel.
951 (Output_data_got::reserve_local): Change object to Relobj*.
952 * output.h: (class Output_data_reloc_generic): Add pure virtual
953 declarations for add_global_generic, add_local_generic,
954 add_output_section_generic.
955 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
956 functions for Output_data_reloc_generic. Update declarations for
957 changes listed in output.cc.
958 (class Output_data_got): Change template parameter to got_size.
959 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
960 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
961 function.
962 (Sized_relobj_incr::do_local_plt_offset): New function.
963 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
964 add_global_generic.
965
76677ad0
CC
9662011-12-17 Cary Coutant <ccoutant@google.com>
967
968 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
969 * resolve.cc (Symbol_table::resolve): Likewise.
970 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
971 arrays.
972 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
973
8b8dd8d5
ILT
9742011-12-16 Ian Lance Taylor <iant@google.com>
975
976 * output.h (Output_data_reloc_generic::add): Only call
977 add_dynamic_reloc if this is a dynamic reloc section.
978
d55525b9
L
9792011-12-15 H.J. Lu <hongjiu.lu@intel.com>
980
981 PR gold/13505
982 * target-reloc.h (apply_relocation): Replace <64, false> with
983 <size, big_endian>.
984
ff81c7c1
NC
9852011-11-25 Nick Clifton <nickc@redhat.com>
986
987 * po/it.po: New Italian translation.
988
628f39be
SA
9892011-11-17 Sterling Augustine <saugustine@google.com>
990
991 * script.cc (script_include_directive): Implement.
992 (read_script_file): New local variables name and search_path. Update
993 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
994 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
995 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
996
98ef3ea4
SA
9972011-11-11 Sterling Augustine <saugustine@google.com>
998
999 * yyscript.y (section_cmd): Add support for INCLUDE directive.
1000 (file_or_sections_cmd): Likewise.
1001
f4a8b6d7
DK
10022011-11-11 Doug Kwan <dougkwan@google.com>
1003
1004 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
1005 if --just-symbols is given.
1006
29ab395d
DK
10072011-11-10 Doug Kwan <dougkwan@google.com>
1008
1009 PR gold/13362
1010 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
1011 when processing data relocs.
1012 * reloc.h (Relocate_functions::rel_unaligned): New method.
1013 (Relocate_functions::pcrel_unaligned): Ditto.
1014 (Relocate_functions::rel32_unaligned): Ditto.
1015 (Relocate_functions::pcrel32_unaligned): Ditto.
1016
2c339f71
DK
10172011-11-09 Doug Kwan <dougkwan@google.com>
1018
1019 PR gold/13362
1020 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
1021 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
1022 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
1023 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1024 (Relocate_functions::rel_unaligned): New.
1025 (Relocate_functions::rel32_unaligned): New.
1026 * target-reloc.h (relocate_for_relocatable): Add code to handle
1027 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1028 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
1029 arm_unaligned_reloc_r): New targets.
1030 * testsuite/Makefile.in: Regenerate.
1031 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
1032 linking.
1033
3f3cddf1
ILT
10342011-11-02 Ian Lance Taylor <iant@google.com>
1035
1036 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
1037 NATIVE_LINKER.
1038 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1039 * options.cc (General_options::finalize): Use library search path
1040 from configure script if specified. If not native and no sysroot,
1041 only search TOOLLIBDIR.
1042 * options.h (Search_directory::Search_directory): Change name to
1043 const std::string&.
1044 (General_options::add_to_library_path_with_sysroot): Change arg to
1045 const std::string&.
1046 * configure, Makefile.in, config.in: Rebuild.
1047
a8e2273b
ILT
10482011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1049
1050 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1051 we are working around the ARM1176 Erratum.
1052 * options.h (General_options::fix_arm1176): Add option.
1053 * testsuite/Makefile.am: Add testcases, and keep current ones
1054 working.
1055 * testsuite/Makefile.in: Regenerate.
1056 * testsuite/arm_fix_1176.s: New file.
1057 * testsuite/arm_fix_1176.sh: Likewise.
1058
cd6eab1c
ILT
10592011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1060
1061 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1062 may_use_blx_.
1063 (Target_arm::may_use_blx): Remove method.
1064 (Target_arm::set_may_use_blx): Likewise.
1065 (Target_arm::may_use_v4t_interworking): New method.
1066 (Target_arm::may_use_v5t_interworking): Likewise.
1067 (Target_arm::may_use_blx_): Remove member variable.
1068 (Arm_relocate_functions::arm_branch_common): Check for v5T
1069 interworking.
1070 (Arm_relocate_functions::thumb_branch_common): Likewise.
1071 (Reloc_stub::stub_type_for_reloc): Likewise.
1072 (Target_arm::do_finalize_sections): Correct interworking checks.
1073 * testsuite/Makefile.am: Add new tests.
1074 * testsuite/Makefile.in: Regenerate.
1075 * testsuite/arm_farcall_arm_arm.s: New test.
1076 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1077 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1078 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1079 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1080 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1081 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1082 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1083
286adcf4
CC
10842011-10-31 Cary Coutant <ccoutant@google.com>
1085
1086 PR gold/13023
1087 * expression.cc (Expression::eval_with_dot): Add
1088 is_section_dot_assignment parameter.
1089 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1090 absolute and assigning to dot within a section.
1091 * script-sections.cc
1092 (Output_section_element_assignment::set_section_addresses): Pass
1093 dot_section to set_if_absolute.
1094 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1095 as is_section_dot_assignment flag to eval_with_dot.
1096 (Output_section_element_dot_assignment::set_section_addresses):
1097 Likewise.
1098 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1099 parameter. Also set value if relative to dot_section; set the
1100 symbol's output_section.
1101 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1102 parameter. Adjust all callers.
1103 (Expression::eval_maybe_dot): Likewise.
1104 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1105 Adjust all callers.
1106 * testsuite/script_test_2.t: Test assignment of an absolute value
1107 to dot within an output section element.
1108
9634ed06
CC
11092011-10-31 Cary Coutant <ccoutant@google.com>
1110
1111 * options.h (class General_options): Add --[no-]gnu-unique options.
1112 * symtab.cc (Symbol_table::sized_write_globals): Convert
1113 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1114
de4101c7
CC
11152011-10-31 Cary Coutant <ccoutant@google.com>
1116
1117 PR gold/13359
1118 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1119 unnecessary assertion.
1120 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1121
7257cc92
ST
11222011-10-31 Sriraman Tallam <tmsriram@google.com>
1123
1124 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1125 gc_mark_symbol.
1126 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1127 gc_mark_symbol.
1128 Change to just keep the section associated with symbol.
1129 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1130 they are externally visible and --export-dynamic is turned on.
1131 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1132
bfc34b3f
ILT
11332011-10-19 Ian Lance Taylor <iant@google.com>
1134
1135 PR gold/13163
1136 * script-sections.cc
1137 (Output_section_element_dot_assignment::needs_output_section): New
1138 function.
1139
ea0d8c47
ILT
11402011-10-19 Ian Lance Taylor <iant@google.com>
1141
1142 PR gold/13204
1143 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1144 --section-start option was seen.
1145 * options.h (General_options::any_section_start): New function.
1146
abd242a9
DM
11472011-10-18 David S. Miller <davem@davemloft.net>
1148
1149 PR binutils/13301
1150 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1151 member to track relocation locations that have moved during TLS
1152 reloc optimizations.
1153 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1154 (Target_sparc::Relocate::relocate): Adjust view down by 4
1155 bytes if it matches reloc_adjust_addr_.
1156 (Target_sparc::Relocate::relocate_tls): Always move the
1157 __tls_get_addr call delay slot instruction forward 4 bytes when
1158 performing relaxation.
1159
bab9090f
CC
11602011-10-18 Cary Coutant <ccoutant@google.com>
1161
1162 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1163 (Output_file::map_no_anonymous): Check for non-zero
1164 return code from posix_fallocate.
1165
f7c5b166
CC
11662011-10-17 Cary Coutant <ccoutant@google.com>
1167
1168 PR gold/13245
1169 * plugin.cc (is_visible_from_outside): Check for symbols
1170 referenced from dynamic objects.
1171 * resolve.cc (Symbol_table::resolve): Don't count references
1172 from dynamic objects as references from real ELF files.
1173 * testsuite/plugin_test_2.sh: Adjust expected result.
1174
b490c0bb
CC
11752011-10-17 Cary Coutant <ccoutant@google.com>
1176
1177 * gold.cc: Include timer.h.
1178 (queue_middle_tasks): Stamp time.
1179 (queue_final_tasks): Likewise.
1180 * main.cc (main): Store timer in parameters. Print timers
1181 for each pass.
1182 * parameters.cc (Parameters::Parameters): Initialize timer_.
1183 (Parameters::set_timer): New function.
1184 (set_parameters_timer): New function.
1185 * parameters.h (Parameters::set_timer): New function.
1186 (Parameters::timer): New function.
1187 (Parameters::timer_): New data member.
1188 (set_parameters_timer): New function.
1189 * timer.cc (Timer::stamp): New function.
1190 (Timer::get_pass_time): New function.
1191 * timer.h (Timer::stamp): New function.
1192 (Timer::get_pass_time): New function.
1193 (Timer::pass_times_): New data member.
1194
f475cf7b
CC
11952011-10-17 Cary Coutant <ccoutant@google.com>
1196
1197 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1198 task for members of lib groups.
1199
cdd7e244
CC
12002011-10-17 Cary Coutant <ccoutant@google.com>
1201
1202 PR gold/13288
4f95c8b4 1203 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
1204 (File_read::make_view): Move bounds check (replace with assert)...
1205 (File_read::find_or_make_view): ... to here.
1206
dfb45471
CC
12072011-10-12 Cary Coutant <ccoutant@google.com>
1208
4f95c8b4 1209 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
1210 ::read returns less than requested size.
1211
53bbcc1b
CC
12122011-10-10 Cary Coutant <ccoutant@google.com>
1213
4f95c8b4 1214 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
1215 Initialize defined_count_.
1216 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1217 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1218 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1219 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1220 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 1221 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
1222 member.
1223 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 1224 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
1225 Return zeroes instead of internal error.
1226
397b129b
CC
12272011-10-10 Cary Coutant <ccoutant@google.com>
1228
1229 PR gold/13249
4f95c8b4 1230 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 1231 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 1232 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
1233 (Output_reloc::type_): Adjust size of bit field.
1234 (Output_reloc::use_plt_offset_): New bit field.
1235 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1236 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1237 flag. Adjust all callers.
4f95c8b4 1238 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
1239 creating RELATIVE relocations.
1240
d5698657
NC
12412011-10-10 Nick Clifton <nickc@redhat.com>
1242
1243 * po/es.po: Updated Spanish translation.
1244 * po/fi.po: Updated Finnish translation.
1245
6a59a5c2
DN
12462011-10-03 Diego Novillo <dnovillo@google.com>
1247
1248 * options.cc (parse_uint): Fix dereference of RETVAL.
1249
f0558624
ST
12502011-09-29 Sriraman Tallam <tmsriram@google.com>
1251
1252 * layout.h (section_order_map_): New member.
1253 (get_section_order_map): New member function.
1254 * output.cc (Output_section::add_input_section): Check for patterns
1255 only when --section-ordering-file is specified.
1256 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1257 output_sections have been formed.
1258 * layout.cc (Layout_Layout): Initialize section_order_map_.
1259 * plugin.cc (update_section_order): Store order in order_map. Do not
1260 update the order.
1261 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1262 * testsuite/Makefile.in: Regenerate.
1263 * testsuite/plugin_section_order.c: New file.
1264 * testsuite/plugin_final_layout.cc: New file.
1265 * testsuite/plugin_final_layout.sh: New file.
1266
a7dac153
CC
12672011-09-29 Cary Coutant <ccoutant@google.com>
1268
4f95c8b4 1269 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 1270 Check for NULL.
4f95c8b4 1271 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
1272 symbols during incremental update.
1273 (Symbol_table::add_from_dynobj): Likewise.
1274
eebd87a5
ILT
12752011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1276 Ian Lance Taylor <iant@google.com>
1277
1278 * symtab.cc (Symbol_table::define_special_symbol): Always
1279 canonicalize version string.
1280
403a3331
CC
12812011-09-26 Cary Coutant <ccoutant@google.com>
1282
4f95c8b4
CC
1283 * gold.cc (queue_initial_tasks): Move option checks ...
1284 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
1285 some options; make others fatal.
1286
235061c2
CC
12872011-09-26 Cary Coutant <ccoutant@google.com>
1288
1289 gcc PR lto/47247
1290 * plugin.cc (get_symbols_v2): New function.
1291 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1292 (is_referenced_from_outside): New function.
1293 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1294 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1295 (get_symbols): Pass version parameter.
1296 (get_symbols_v2): New function.
1297 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1298 parameter.
1299 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1300 (onload): Add LDPT_GET_SYMBOLS_V2.
1301 (all_symbols_read_hook): Use get_symbols_v2; check for
1302 LDPR_PREVAILING_DEF_IRONLY_EXP.
1303 * testsuite/plugin_test_3.sh: Update expected results.
1304
dc87f620
ILT
13052011-09-23 Simon Baldwin <simonb@google.com>
1306
1307 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1308 configuration options.
1309 * configure: Regenerate.
1310 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1311 * Makefile.in: Regenerate.
1312 * testsuite/Makefile.in: Regenerate.
1313
a8279f82
ST
13142011-09-19 Sriraman Tallam <tmsriram@google.com>
1315
1316 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1317
0c9350c8
CC
13182011-09-19 Cary Coutant <ccoutant@google.com>
1319
1320 * incremental.cc (can_incremental_update): Fix typo in comment.
1321 * incremental.h (can_incremental_update): Likewise.
1322
aa06ae28
CC
13232011-09-18 Cary Coutant <ccoutant@google.com>
1324
1325 * incremental.cc (can_incremental_update): New function.
1326 * incremental.h (can_incremental_update): New function.
1327 * layout.cc (Layout::init_fixed_output_section): Call it.
1328 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1329 * object.cc (Sized_relobj_file::do_layout): Call
1330 can_incremental_update.
1331
ebb300b2
CC
13322011-09-13 Cary Coutant <ccoutant@google.com>
1333
1334 * configure.ac: Check for glibc support for gnu_indirect_function
1335 support with static linking, setting automake conditional
1336 IFUNC_STATIC.
1337 * Makefile.in: Regenerate.
1338 * configure: Regenerate.
1339
1340 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1341 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1342 for IFUNC_STATIC.
1343 * testsuite/Makefile.in: Regenerate.
1344
1206d0d5
CC
13452011-09-13 Cary Coutant <ccoutant@google.com>
1346
1347 * incremental.cc (Sized_relobj_incr::do_layout): Call
1348 report_comdat_group for kept comdat sections.
1349 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1350 * testsuite/Makefile.in: Regenerate.
1351 * testsuite/incr_comdat_test_1.cc: New source file.
1352 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1353 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1354 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1355
40b29874
ILT
13562011-09-13 Ian Lance Taylor <iant@google.com>
1357
1358 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1359 variable external_symbols_offset.
1360
1b045aac
ILT
13612011-09-12 Ian Lance Taylor <iant@google.com>
1362
1363 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1364 triggered if object has no symbols.
1365
24c6c55a
DM
13662011-09-09 David S. Miller <davem@davemloft.net>
1367
1368 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1369 (Output_fill_debug_line::do_write): Likewise.
1370
66570254
CC
13712011-08-29 Cary Coutant <ccoutant@google.com>
1372
1373 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1374 casts to match formatting specs.
1375 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1376
8ea8cd50
CC
13772011-08-26 Cary Coutant <ccoutant@google.com>
1378
1379 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1380 remaining hole size when allocating.
1381 (Layout::make_output_section): Set fill methods for debug sections.
1382 * layout.h (Free_list::Free_list_node): Move from private to
1383 public.
1384 (Free_list::set_min_hole_size): New function.
1385 (Free_list::begin, Free_list::end): New functions.
1386 (Free_list::min_hole_): New data member.
1387 * output.cc: Include dwarf.h.
1388 (Output_fill_debug_info::do_minimum_hole_size): New function.
1389 (Output_fill_debug_info::do_write): New function.
1390 (Output_fill_debug_line::do_minimum_hole_size): New function.
1391 (Output_fill_debug_line::do_write): New function.
1392 (Output_section::Output_section): Initialize new data member.
1393 (Output_section::set_final_data_size): Ensure patch space is larger
1394 than minimum hole size.
1395 (Output_section::do_write): Fill holes in debug sections.
1396 * output.h (Output_fill): New class.
1397 (Output_fill_debug_info): New class.
1398 (Output_fill_debug_line): New class.
1399 (Output_section::set_free_space_fill): New function.
1400 (Output_section::free_space_fill_): New data member.
1401 * testsuite/Makefile.am (incremental_test_3): Add
1402 --incremental-patch option.
1403 (incremental_test_4): Likewise.
1404 (incremental_test_5): Likewise.
1405 (incremental_test_6): Likewise.
1406 (incremental_copy_test): Likewise.
1407 (incremental_common_test_1): Likewise.
1408 * testsuite/Makefile.in: Regenerate.
1409
7cf80422
NC
14102011-08-26 Nick Clifton <nickc@redhat.com>
1411
1412 * po/es.po: Updated Spanish translation.
1413
c3f7b0e5
CC
14142011-08-01 Cary Coutant <ccoutant@google.com>
1415
1416 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1417 * gold/testsuite/Makefile.in: Regenerate.
1418 * gold/testsuite/justsyms_exec.c: New source file.
1419 * gold/testsuite/justsyms_lib.c: New source file.
1420
9590bf25
CC
14212011-08-01 Cary Coutant <ccoutant@google.com>
1422
1423 * layout.cc (Layout::set_segment_offsets): Don't realign text
1424 segment if -Ttext was specified.
1425 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1426 file type.
1427 * object.h (Sized_relobj_file::e_type): New function.
1428 (Sized_relobj_file::e_type_): New data member.
1429 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1430 base address for ET_EXEC files.
1431 * target.cc (Target::do_make_elf_object_implementation): Allow
1432 ET_EXEC files with --just-symbols option.
1433
dcd8d12e
CC
14342011-07-28 Cary Coutant <ccoutant@google.com>
1435
1436 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1437 Add thread_number parameter.
1438 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1439 * workqueue-threads.cc
1440 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1441 current thread if its thread number is greater than desired thread
1442 count.
1443 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1444 Add thread_number parameter.
1445 (Workqueue::should_cancel_thread): Likewise.
1446 (Workqueue::find_runnable_or_wait): Pass thread_number to
1447 should_cancel_thread.
1448 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1449 parameter.
1450
804eb480
ST
14512011-07-22 Sriraman Tallam <tmsriram@google.com>
1452
1453 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1454 only after checking if it cannot be forced local.
1455 * symtab.h (is_externally_visible): Check if the symbol is not forced
1456 local.
1457
f1ddb600
ILT
14582011-07-15 Ian Lance Taylor <iant@google.com>
1459
1460 * options.h (class General_options): Add --print-output-format.
1461 Move -EL next to -EB, for better --help output.
1462 * target-select.cc: Include <cstdio>, "options.h", and
1463 "parameters.h".
1464 (Target_selector::do_target_bfd_name): New function.
1465 (print_output_format): New function.
1466 * target-select.h (class Target_selector): Update declarations.
1467 (Target_selector::target_bfd_name): New function.
1468 (print_output_format): Declare.
1469 * main.cc: Include "target-select.h".
1470 (main): Handle --print-output-format.
1471 * gold.cc: Include "target-select.h".
1472 (queue_initial_tasks): Handle --print-output-format when there are
1473 no input files.
1474 * parameters.cc (parameters_force_valid_target): Give a better
1475 error message if -EB/-EL does not match target.
1476 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1477 function.
1478
7d172687
ILT
14792011-07-15 Ian Lance Taylor <iant@google.com>
1480
1481 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1482 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1483 (Output_data_plt_i386::do_write): Write address of .dynamic
1484 section to first entry in .got.plt section.
1485 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1486 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1487 Initialize layout_.
1488 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1489 section to first entry in .got.plt section.
1490 * layout.h (Layout::dynamic_section): New function.
1491
e9552f7e
ST
14922011-07-13 Sriraman Tallam <tmsriram@google.com>
1493
1494 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1495 to claim_file call.
1496 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1497 input_section_position_, and input_section_glob_.
1498 (read_layout_from_file): Call function section_ordering_specified.
1499 * layout.h (is_section_ordering_specified): New function.
1500 (section_ordering_specified): New function.
1501 (section_ordering_specified_): New boolean member.
1502 * main.cc(main): Call load_plugins after layout object is defined.
1503 * output.cc (Output_section::add_input_section): Use
1504 function section_ordering_specified to check if section ordering is
1505 needed.
1506 * output.cc (Output_section::add_relaxed_input_section): Use
1507 function section_ordering_specified to check if section ordering is
1508 needed.
1509 (Output_section::update_section_layout): New function.
1510 (Output_section::sort_attached_input_sections): Check if input section
1511 must be reordered.
1512 * output.h (Output_section::update_section_layout): New function.
1513 * plugin.cc (get_section_count): New function.
1514 (get_section_type): New function.
1515 (get_section_name): New function.
1516 (get_section_contents): New function.
1517 (update_section_order): New function.
58797674 1518 (allow_section_ordering): New function.
e9552f7e
ST
1519 (Plugin::load): Add the new interfaces to the transfer vector.
1520 (Plugin_manager::load_plugins): New parameter.
1521 (Plugin_manager::all_symbols_read): New parameter.
1522 (Plugin_manager::claim_file): New parameter. Save the elf object for
1523 unclaimed objects.
1524 (Plugin_manager::get_elf_object): New function.
1525 (Plugin_manager::get_view): Change to directly use the bool to check
1526 if get_view is called from claim_file_hook.
1527 * plugin.h (input_objects): New function
1528 (Plugin__manager::load_plugins): New parameter.
1529 (Plugin_manager::claim_file): New parameter.
1530 (Plugin_manager::get_elf_object): New function.
1531 (Plugin_manager::in_claim_file_handler): New function.
1532 (Plugin_manager::in_claim_file_handler_): New member.
1533 (layout): New function.
1534 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1535 handler with an extra parameter. Make the elf object before calling
1536 claim_file handler.
1537 * testsuite/plugin_test.c (get_section_count): New function pointer.
1538 (get_section_type): New function pointer.
1539 (get_section_name): New function pointer.
1540 (get_section_contents): New function pointer.
1541 (update_section_order): New function pointer.
1542 (allow_section_ordering): New function pointer.
1543 (onload): Check if the new interfaces exist.
1544
9446efde
ILT
15452011-07-13 Ian Lance Taylor <iant@google.com>
1546
1547 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1548 relro section.
1549 * x86_64.cc (Target_x86_64::got_section): Likewise.
1550 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1551 (relro_now_test_SOURCES): New variable.
1552 (relro_now_test_DEPENDENCIES): New variable.
1553 (relro_now_test_LDFLAGS): New variable.
1554 (relro_now_test_LDADD): New variable.
1555 (relro_now_test.so): New target.
1556 * testsuite/Makefile.in: Rebuild.
1557
07aa62f2
ILT
15582011-07-12 Ian Lance Taylor <iant@google.com>
1559
1560 PR gold/12980
1561 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1562 GLOB_DAT relocation rather than a RELATIVE relocation for a
1563 protected symbol when creating a shared library.
1564 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1565 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1566 * testsuite/protected_main_1.cc (main): Test that protected
1567 function has same address.
1568
e2153196
ILT
15692011-07-11 Ian Lance Taylor <iant@google.com>
1570
1571 PR gold/12979
1572 * options.h (class General_options): Add -Bgroup.
1573 * options.cc (General_options::finalize): If -Bgroup is set,
1574 default to --unresolved-symbols=report-all.
1575 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1576 * target-reloc.h (issue_undefined_symbol_error): Handle
1577 --unresolved-symbols=report-all.
1578
6daf5215
ILT
15792011-07-08 Ian Lance Taylor <iant@google.com>
1580
1581 PR gold/11985
1582 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1583 if linker script discards key sections.
1584 (Layout::create_dynamic_symtab): Likewise.
1585 (Layout::assign_local_dynsym_offsets): Likewise.
1586 (Layout::sized_create_version_sections): Likewise.
1587 (Layout::create_interp): Likewise.
1588 (Layout::finish_dynamic_section): Likewise.
1589 (Layout::set_dynamic_symbol_size): Likewise.
1590
beabb2c6
ILT
15912011-07-08 Ian Lance Taylor <iant@google.com>
1592
1593 PR gold/12386
1594 * options.h (class General_options): Add --unresolved-symbols.
1595 * target-reloc.h (issue_undefined_symbol_error): Check
1596 --unresolved-symbols. Add comments.
1597
9c16daf1
ILT
15982011-07-08 Ian Lance Taylor <iant@google.com>
1599
1600 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1601 expression more complex.
1602
191f1a2d
ILT
16032011-07-08 Ian Lance Taylor <iant@google.com>
1604
1605 PR gold/11317
1606 * target-reloc.h (issue_undefined_symbol_error): New inline
1607 function, broken out of relocate_section.
1608 (relocate_section): Call issue_undefined_symbol_error.
1609 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1610 there is no TLS segment if we are about to issue an undefined
1611 symbol error.
1612 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1613
62855347
ILT
16142011-07-08 Ian Lance Taylor <iant@google.com>
1615
1616 PR gold/12279
1617 * resolve.cc (Symbol_table::should_override): Add fromtype
1618 parameter. Change all callers. Give error when linking together
1619 TLS and non-TLS symbol.
1620 (Symbol_table::should_override_with_special): Add fromtype
1621 parameter. Change all callers.
1622 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1623 there is no TLS segment if we have reported some errors.
1624 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1625
67181c72
ILT
16262011-07-08 Ian Lance Taylor <iant@google.com>
1627
1628 PR gold/12372
1629 * target.h (Target::plt_address_for_global): New function.
1630 (Target::plt_address_for_local): New function.
1631 (Target::plt_section_for_global): Remove.
1632 (Target::plt_section_for_local): Remove.
1633 (Target::do_plt_address_for_global): New virtual function.
1634 (Target::do_plt_address_for_local): New virtual function.
1635 (Target::do_plt_section_for_global): Remove.
1636 (Target::do_plt_section_for_local): Remove.
1637 (Target::register_global_plt_entry): Add Symbol_table and Layout
1638 parameters.
1639 * output.cc (Output_data_got::Got_entry::write): Use
1640 plt_address_for_global and plt_address_for_local.
1641 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1642 address of output section.
1643 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1644 got_irelative_, and irelative_count_ fields. Update
1645 declarations.
1646 (Output_data_plt_i386::has_irelative_section): New function.
1647 (Output_data_plt_i386::entry_count): Add irelative_count_.
1648 (Output_data_plt_i386::set_final_data_size): Likewise.
1649 (class Target_i386): Add got_irelative_ and rel_irelative_
1650 fields. Update declarations.
1651 (Target_i386::Target_i386): Initialize new fields.
1652 (Target_i386::do_plt_address_for_global): New function replacing
1653 do_plt_section_for_global.
1654 (Target_i386::do_plt_address_for_local): New function replacing
1655 do_plt_section_for_local.
1656 (Target_i386::got_section): Create got_irelative_.
1657 (Target_i386::rel_irelative_section): New function.
1658 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1659 fields. Don't define __rel_iplt_{start,end}.
1660 (Output_data_plt_i386::add_entry): Add symtab and layout
1661 parameters. Change all callers. Use different PLT and GOT for
1662 IFUNC symbols.
1663 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1664 layout parameters. Change all callers. Use different PLT and
1665 GOT.
1666 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1667 (Output_data_plt_i386::rel_irelative): New function.
1668 (Output_data_plt_i386::address_for_global): New function.
1669 (Output_data_plt_i386::address_for_local): New function.
1670 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1671 IRELATIVE GOT when changing IFUNC GOT entries.
1672 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1673 reloc.
1674 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1675 if we didn't create an IRELATIVE GOT.
1676 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1677 plt_address_for_local.
1678 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1679 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1680 got_irelative_, and irelative_count_ fields. Update
1681 declarations.
1682 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1683 Initialize new fields. Remove symtab parameter. Change all
1684 callers.
1685 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1686 irelative_count_.
1687 (Output_data_plt_x86_64::has_irelative_section): New function.
1688 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1689 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1690 fields. Update declarations.
1691 (Target_x86_64::Target_x86_64): Initialize new fields.
1692 (Target_x86_64::do_plt_address_for_global): New function replacing
1693 do_plt_section_for_global.
1694 (Target_x86_64::do_plt_address_for_local): New function replacing
1695 do_plt_section_for_local.
1696 (Target_x86_64::got_section): Create got_irelative_.
1697 (Target_x86_64::rela_irelative_section): New function.
1698 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1699 all callers. Don't create __rel_iplt_{start,end}.
1700 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1701 parameters. Change all callers. Use different PLT and GOT for
1702 IFUNC symbols.
1703 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1704 layout parameters. Change all callers. Use different PLT and
1705 GOT.
1706 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1707 parameters. Change all callers. Use different PLT and GOT for
1708 IFUNC symbols.
1709 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1710 (Output_data_plt_x86_64::rela_irelative): New function.
1711 (Output_data_plt_x86_64::address_for_global): New function.
1712 (Output_data_plt_x86_64::address_for_local): New function.
1713 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1714 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1715 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1716 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1717 parameters.
1718 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1719 reloc.
1720 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1721 symbols if we didn't create an IRELATIVE GOT.
1722 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1723 plt_address_for_local.
1724 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1725 * testsuite/ifuncvar1.c: New test file.
1726 * testsuite/ifuncvar2.c: New test file.
1727 * testsuite/ifuncvar3.c: New test file.
1728 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1729 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1730 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1731 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1732 * testsuite/Makefile.in: Rebuild.
1733
33c15b45
CC
17342011-07-07 Cary Coutant <ccoutant@google.com>
1735
1736 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1737 (two_file_test_1_ndebug.o): Likewise.
1738 (two_file_test_1b_ndebug.o): Likewise.
1739 (two_file_test_2_ndebug.o): Likewise.
1740 (two_file_test_main_ndebug.o): Likewise.
1741 (incremental_test_2): Link with no-debug versions.
1742
f48b5fb7
CC
17432011-07-06 Cary Coutant <ccoutant@google.com>
1744
1745 * gold/incremental.cc
1746 (Output_section_incremental_inputs::write_info_blocks): Check for
1747 hidden and internal symbols.
1748
221597a5
CC
17492011-07-06 Cary Coutant <ccoutant@google.com>
1750
1751 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1752 Check disposition for startup file.
1753 (Incremental_inputs::report_command_line): Ignore
1754 --incremental-startup-unchanged option.
1755 * options.cc (General_options::parse_incremental_startup_unchanged):
1756 New function.
1757 (General_options::General_options): Initialize new data member.
1758 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1759 (General_options): Add --incremental-startup-unchanged option.
1760 (General_options::incremental_startup_disposition): New function.
1761 (General_options::incremental_startup_disposition_): New data member.
1762
e24719f6
CC
17632011-07-06 Cary Coutant <ccoutant@google.com>
1764
1765 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1766 input file index to Script_info ctor.
1767 (Sized_incremental_binary::do_file_has_changed): Find the
1768 command-line argument for files named in scripts.
1769 * incremental.h (Script_info::Script_info): New ctor
1770 with input file index.
1771 (Script_info::input_file_index): New function.
1772 (Script_info::input_file_index_): New data member.
1773 (Incremental_binary::get_library): Add const.
1774 (Incremental_binary::get_script_info): Add const.
1775 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1776 * testsuite/Makefile.am (incremental_test_5): New test case.
1777 (incremental_test_6): New test case.
1778 * testsuite/Makefile.in: Regenerate.
1779
8f7c81e8
CC
17802011-07-06 Cary Coutant <ccoutant@google.com>
1781
1782 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1783 debug output when command lines differ.
1784
9fbd3822
CC
17852011-07-06 Cary Coutant <ccoutant@google.com>
1786
1787 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1788 --incremental-patch option.
1789 * layout.cc (Free_list::allocate): Extend allocation beyond original
1790 end if enabled.
1791 (Layout::make_output_section): Mark sections that should get
1792 patch space.
1793 * options.cc (parse_percent): New function.
1794 * options.h (parse_percent): New function.
1795 (DEFINE_percent): New macro.
1796 (General_options): Add --incremental-patch option.
1797 * output.cc (Output_section::Output_section): Initialize new data
1798 members.
1799 (Output_section::add_input_section): Print section name when out
1800 of patch space.
1801 (Output_section::add_output_section_data): Likewise.
1802 (Output_section::set_final_data_size): Add patch space when
1803 doing --incremental-full.
1804 (Output_section::do_reset_address_and_file_offset): Remove patch
1805 space.
1806 (Output_segment::set_section_list_addresses): Print debug output
1807 only if --incremental-update.
1808 * output.h (Output_section::set_is_patch_space_allowed): New function.
1809 (Output_section::is_patch_space_allowed_): New data member.
1810 (Output_section::patch_space_): New data member.
1811 * parameters.cc (Parameters::incremental_full): New function.
1812 * parameters.h (Parameters::incremental_full): New function
1813 * testsuite/Makefile.am (incremental_test_2): Add test for
1814 --incremental-patch option.
1815 * testsuite/Makefile.in: Regenerate.
1816 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1817 (t18): Remove function body.
1818
f6cccc2c
DK
18192011-07-05 Doug Kwan <dougkwan@google.com>
1820
1821 PR gold/12771
1822 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1823 Arm_Address type for relocation result.
1824 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1825 overflow check.
1826 (Arm_relocate_functions::abs32): Use unaligned access.
1827 (Arm_relocate_functions::rel32): Ditto.
1828 (Arm_relocate_functions::prel31): Ditto.
1829 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1830 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1831 static data relocations.
1832 * testsuite/Makefile.in: Regnerate.
1833 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1834
28a13fec
ILT
18352011-07-05 Ian Lance Taylor <iant@google.com>
1836
1837 PR gold/12392
1838 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1839 symbols if necessary.
1840 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1841
24d47b34
ILT
18422011-07-05 Ian Lance Taylor <iant@google.com>
1843
1844 PR gold/12952
1845 * resolve.cc (Symbol::override_base_with_special): Simply override
1846 version with special symbol version, ignoring previous version.
1847
41f9cbbe
ILT
18482011-07-05 Ian Lance Taylor <iant@google.com>
1849
1850 * object.cc (Sized_relobj_file::include_section_group): Add
1851 information to comment about signature location.
1852
886288f1
ILT
18532011-07-02 Ian Lance Taylor <iant@google.com>
1854
1855 PR gold/12957
1856 * options.h (class General_options): Add -f and -F.
1857 * options.cc (General_options::finalize): Fatal error if -f/-F
1858 are used without -shared.
1859 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1860
ae3a6d4f
ILT
18612011-07-02 Ian Lance Taylor <iant@google.com>
1862
1863 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1864
21131061
ILT
18652011-07-01 Ian Lance Taylor <iant@google.com>
1866
1867 PR gold/12525
1868 PR gold/12952
1869 * resolve.cc (Symbol::override_base_with_special): Don't override
1870 the version if the overriding symbol has a different name.
1871 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1872 all callers. If we give an error about an undefined version,
1873 define the base version if necessary.
1874 * dynobj.h (class Versions): Update declaration.
1875 * testsuite/weak_alias_test_5.cc: New file.
1876 * testsuite/weak_alias_test.script: New file.
1877 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1878 and versioned_alias have the right value, and call t2.
1879 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1880 weak_alias_test_5.so.
1881 (weak_alias_test_LDADD): Likewise.
1882 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1883 * testsuite/Makefile.in: Rebuild.
1884
611062c0
ILT
18852011-07-01 Ian Lance Taylor <iant@google.com>
1886
1887 PR gold/12525
1888 * options.h (class General_options): Support -z notext.
1889 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1890 -Wl,-z,notext.
1891 (two_file_shared_nonpic.so): Likewise.
1892 (two_file_shared_mixed.so): Likewise.
1893 (two_file_shared_mixed_1.so): Likewise.
1894 (weak_undef_lib_nonpic.so): Likewise.
1895 (alt/weak_undef_lib_nonpic.so): Likewise.
1896 (tls_test_shared_nonpic.so): Likewise.
1897 * testsuite/Makefile.in: Rebuild.
1898
328c7c2f
ILT
18992011-07-01 Ian Lance Taylor <iant@google.com>
1900
1901 PR gold/12525
1902 * configure.ac: Test whether static linking works, setting
1903 the automake conditional HAVE_STATIC.
1904 * testsuite/Makefile.am: Disable tests using -static if
1905 HAVE_STATIC is not true.
1906 * configure, testsuite/Makefile.in: Rebuild.
1907
02d7cd44
ILT
19082011-07-01 Ian Lance Taylor <iant@google.com>
1909
1910 PR gold/12525
1911 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1912 Assert if we see DW_EH_PE_indirect.
1913 * target.h (Target::ehframe_datarel_base): New function.
1914 (Target::do_ehframe_datarel_base): New target function.
1915 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1916 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1917 function.
1918
07a60597
ILT
19192011-07-01 Ian Lance Taylor <iant@google.com>
1920
1921 PR gold/12571
1922 * options.h (class General_options): Add
1923 --ld-generated-unwind-info.
1924 * ehframe.cc (Fde::write): Add address parameter. Change all
1925 callers. If associated with PLT, fill in address and size.
1926 (Cie::set_output_offset): Only add merge mapping if there is an
1927 object.
1928 (Cie::write): Add address parameter. Change all callers.
1929 (Eh_frame::add_ehframe_for_plt): New function.
1930 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1931 input_offset_ fields into union u_, with new plt field.
1932 (Fde::Fde): Adjust for new union field.
1933 (Fde::Fde) [Output_data version]: New constructor.
1934 (Fde::add_mapping): Only add merge mapping if there is an object.
1935 (class Cie): Update declarations.
1936 (class Eh_frame): Declare add_ehframe_for_plt.
1937 * layout.cc (Layout::layout_eh_frame): Break out code into
1938 make_eh_frame_section, and call it.
1939 (Layout::make_eh_frame_section): New function.
1940 (Layout::add_eh_frame_for_plt): New function.
1941 * layout.h (class Layout): Update declarations.
1942 * merge.cc (Merge_map::add_mapping): Add assertion.
1943 * i386.cc: Include "dwarf.h".
1944 (class Output_data_plt_i386): Make first_plt_entry,
1945 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1946 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1947 and plt_eh_frame_fde.
1948 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1949 boundary. Call add_eh_frame_for_plt if appropriate.
1950 * x86_64.cc: Include "dwarf.h".
1951 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1952 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1953 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1954 and plt_eh_frame_fde.
1955 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1956 appropriate.
1957
14788a3f
ILT
19582011-06-29 Ian Lance Taylor <iant@google.com>
1959
1960 PR gold/12629
1961 * object.cc (Sized_relobj_file::layout_section): Change shdr
1962 parameter to be const.
1963 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1964 out of do_layout.
1965 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1966 appropriate. Call layout_eh_frame_section.
1967 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1968 sections.
1969 * object.h (class Sized_relobj_file): Update declarations.
1970
6c21fce1
ILT
19712011-06-29 Ian Lance Taylor <iant@google.com>
1972
37e41b03 1973 PR gold/12652
6c21fce1
ILT
1974 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1975 modifier.
1976 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1977
4d5e4e62
ILT
19782011-06-29 Ian Lance Taylor <iant@google.com>
1979
1980 PR gold/12675
1981 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1982 SHT_X86_64_UNWIND.
1983 * layout.cc (Layout::layout_eh_frame): Likewise.
1984
886f533a
ILT
19852011-06-29 Ian Lance Taylor <iant@google.com>
1986
1987 PR gold/12695
1988 * layout.cc (Layout::symtab_section_shndx): New function.
1989 * layout.h (class Layout): Declare symtab_section_shndx.
1990 * output.cc (Output_section::write_header): Call it.
1991
f3ae1b28
ILT
19922011-06-29 Ian Lance Taylor <iant@google.com>
1993
1994 PR gold/12818
1995 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1996 symbols which are not used in a relocation.
1997
aecf301f
ILT
19982011-06-28 Ian Lance Taylor <iant@google.com>
1999
2000 PR gold/12898
2001 * layout.cc (Layout::segment_precedes): Don't crash if a linker
2002 script create indistinguishable segments.
2003 (Layout::set_segment_offsets): Use stable_sort when sorting
2004 segments. Pass this to Compare_segments constructor.
2005 * layout.h (class Layout): Make segment_precedes non-static.
2006 (class Compare_segments): Change from struct to class. Add
2007 layout_ field. Add constructor.
2008 * script-sections.cc
2009 (Script_sections::attach_sections_using_phdrs_clause): Rename
2010 local orphan to is_orphan. Don't report failure to put empty
2011 section in segment. On attachment failure, report name of
2012 section, and attach to first PT_LOAD segment.
2013
03ef7571
ILT
20142011-06-28 Ian Lance Taylor <iant@google.com>
2015
2016 PR gold/12934
2017 * target-select.cc (Target_selector::Target_selector): Add
2018 emulation parameter. Change all callers.
2019 (select_target_by_bfd_name): Rename from select_target_by_name.
2020 Change all callers.
2021 (select_target_by_emulation): New function.
2022 (supported_emulation_names): New function.
2023 * target-select.h (class Target_selector): Add emulation_ field.
2024 Update declarations.
2025 (Target_selector::recognize_by_bfd_name): Rename from
2026 recognize_by_name. Change all callers.
2027 (Target_selector::supported_bfd_names): Rename from
2028 supported_names. Change all callers.
2029 (Target_selector::recognize_by_emulation): New function.
2030 (Target_selector::supported_emulations): New function.
2031 (Target_selector::emulation): New function.
2032 (Target_selector::do_recognize_by_bfd_name): Rename from
2033 do_recognize_by_name. Change all callers.
2034 (Target_selector::do_supported_bfd_names): Rename from
2035 do_supported_names. Change all callers.
2036 (Target_selector::do_recognize_by_emulation): New function.
2037 (Target_selector::do_supported_emulations): New function.
2038 (select_target_by_bfd_name): Change name in declaration.
2039 (select_target_by_emulation): Declare.
2040 (supported_emulation_names): Declare.
2041 * parameters.cc (parameters_force_valid_target): Try to find
2042 target based on emulation from -m option.
2043 * options.h (class General_options): Change doc string for -m.
2044 * options.cc (help): Print emulations.
2045 (General_options::parse_V): Likewise.
2046 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2047 Add emulation parameter. Change all callers.
2048
200b2bb9
ILT
20492011-06-28 Ian Lance Taylor <iant@google.com>
2050
2051 * target.h (class Target): Add osabi_ field.
2052 (Target::osabi): New function.
2053 (Target::set_osabi): New function.
2054 (Target::Target): Initialize osabi_.
2055 (Target::do_adjust_elf_header): Make pure virtual.
2056 (Sized_target::do_adjust_elf_header): Declare.
2057 * target.cc (Sized_target::do_adjust_elf_header): New function.
2058 (class Sized_target): Instantiate all versions.
2059 * freebsd.h (class Target_freebsd): Remove.
2060 (Target_selector_freebsd::do_recognize): Call set_osabi on
2061 Target.
2062 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2063 (Target_selector_freebsd::set_osabi): Remove.
2064 * i386.cc (class Target_i386): Inherit from Sized_target rather
2065 than Target_freebsd.
2066 * x86_64.cc (class Target_x86_64): Likewise.
2067
b3ce541e
ILT
20682011-06-28 Ian Lance Taylor <iant@google.com>
2069
2070 * target.h (Target::can_check_for_function_pointers): Rewrite.
2071 Make non-virtual.
2072 (Target::can_icf_inline_merge_sections): Likewise.
2073 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2074 (Target::Target_info): Add can_icf_inline_merge_sections field.
2075 (Target::do_can_check_for_function_pointers): New virtual
2076 function.
2077 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2078 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2079 from can_check_for_function_pointers, move in file.
2080 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2081 section_may_have_icf_unsafe_poineters, move in file.
2082 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2083 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2084 Rename from can_check_for_function_pointers, move in file.
2085 (Target_i386::can_icf_inline_merge_sections): Remove.
2086 (Target_i386::i386_info): Initialize
2087 can_icf_inline_merge_sections.
2088 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2089 Initialize can_icf_inline_merge_sections.
2090 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2091 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2092 Rename from can_check_for_function_pointers, move in file.
2093 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2094 (Target_x86_64::x86_64_info): Initialize
2095 can_icf_inline_merge_sections.
2096 * testsuite/testfile.cc (Target_test::test_target_info):
2097 Likewise.
2098 * icf.cc (get_section_contents): Correct formatting.
2099
6d1c4efb
ILT
21002011-06-27 Ian Lance Taylor <iant@google.com>
2101
2102 * symtab.cc (Symbol::versioned_name): New function.
2103 (Symbol_table::add_to_final_symtab): Use versioned_name when
2104 appropriate.
2105 (Symbol_table::sized_write_symbol): Likewise.
2106 * symtab.h (class Symbol): Declare versioned_name.
2107 * stringpool.h (class Stringpool_template): Add variant of add
2108 which takes a std::basic_string.
2109 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2110 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2111 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2112 (ver_test_12.o): New target.
2113 * testsuite/Makefile.in: Rebuild.
2114
57eb9b50
DK
21152011-06-27 Doug Kwan <dougkwan@google.com>
2116
2117 * arm.cc (Arm_relocate_functions::thm_jump8,
2118 Arm_relocate_functions::thm_jump11): Use a wider signed
2119 type to compute offset.
2120 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2121 arm_thm_jump8.
2122 * testsuite/Makefile.in: Regenerate.
2123 * testsuite/arm_branch_in_range.sh: Check test results of
2124 arm_thm_jump11 and arm_thm_jump8.
2125 * testsuite/arm_thm_jump11.s: New test source file.
2126 * testsuite/arm_thm_jump11.t: New linker script.
2127 * testsuite/arm_thm_jump8.s: New test source file.
2128 * testsuite/arm_thm_jump8.t: New linker script.
2129
487b39df
ILT
21302011-06-24 Ian Lance Taylor <iant@google.com>
2131
2132 * layout.cc: Include "object.h".
2133 (ctors_sections_in_init_array): New static variable.
2134 (Layout::is_ctors_in_init_array): New function.
2135 (Layout::layout): Add entry to ctors_sections_in_init_array if
2136 appropriate.
2137 * layout.h (class Layout): Declare is_ctors_in_init_array.
2138 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2139 is_ctors_reverse_view is set.
2140 (Sized_relobj_file::write_sections): Add layout parameter. Change
2141 all callers. Set is_ctors_reverse_view field of View_size.
2142 (Sized_relobj_file::reverse_words): New function.
2143 * object.h (Sized_relobj_file::View_size): Add
2144 is_ctors_reverse_view field.
2145 (class Sized_relobj_file): Update declarations.
2146 * testsuite/initpri3.c: New test.
2147 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2148 initpri3b.
2149 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2150 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2151 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2152 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2153 * testsuite/Makefile.in: Rebuild.
2154
472076e4
CC
21552011-06-24 Cary Coutant <ccoutant@google.com>
2156
2157 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2158 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2159 (debug_msg_cdebug.err): New targets.
2160 * testsuite/Makefile.in: Regenerate.
2161 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2162 Fix checks for link with shared library.
2163
a60af0db
DK
21642011-06-24 Doug Kwan <dougkwan@google.com>
2165
2166 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2167 skip empty text sections.
2168 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2169
5393d741
ILT
21702011-06-22 Ian Lance Taylor <iant@google.com>
2171
2172 PR gold/12910
2173 * options.h (class General_options): Add --ctors-in-init-array.
2174 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2175 friends as SHT_PROGBITS for merging sections.
2176 (Layout::layout): Remove special handling of .init_array and
2177 friends. Don't sort if doing relocatable link. Sort for .ctors
2178 and .dtors if ctors_in_init_array.
2179 (Layout::make_output_section): Force correct section types for
2180 .init_array and friends. Don't sort if doing relocatable link,
2181 Don't sort .ctors and .dtors if ctors_in_init_array.
2182 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2183 (Layout::output_section_name): Add relobj parameter. Change all
2184 callers. Handle .ctors. and .dtors. in code rather than table.
2185 Handle .ctors and .dtors if ctors_in_init_array.
2186 (Layout::match_file_name): New function, moved from output.cc.
2187 * layout.h (class Layout): Update declarations.
2188 * output.cc: Include "layout.h".
2189 (Input_section_sort_entry::get_priority): New function.
2190 (Input_section_sort_entry::match_file_name): Just call
2191 Layout::match_file_name.
2192 (Output_section::Input_section_sort_init_fini_compare::operator()):
2193 Handle .ctors and .dtors. Sort by explicit priority rather than
2194 by name.
2195 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2196 * testsuite/initpri2.c: New test.
2197 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2198 (check_PROGRAMS): Add initpri2.
2199 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2200 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2201 * configure, testsuite/Makefile.in: Rebuild.
2202
e1f74f98
ILT
22032011-06-19 Ian Lance Taylor <iant@google.com>
2204
2205 PR gold/12880
2206 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2207 .interp section to a PT_INTERP segment even if we have seen a
2208 --dynamic-linker option. Don't do it if we have seen a PHDRS
2209 clause in a linker script.
2210 (Layout::finalize): Don't create a .interp section if we've
2211 already create a PT_INTERP segment.
2212 (Layout::create_interp): Always call choose_output_section (revert
2213 patch of 2011-06-17). Don't create PT_INTERP segment.
2214 * script-sections.cc
2215 (Script_sections::create_note_and_tls_segments): Add a .interp
2216 section to a PT_INTERP segment even if we have seen a
2217 --dynamic-linker option.
2218
766f91bb
ILT
22192011-06-18 Ian Lance Taylor <iant@google.com>
2220
2221 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2222 merely because a non-PT_LOAD segment has a dynamic reloc.
2223
0d212c3a
ILT
22242011-06-18 Ian Lance Taylor <iant@google.com>
2225
2226 * layout.cc (Layout::finish_dynamic_section): Don't create
2227 DT_FLAGS entry if not needed.
2228
911a5072
ILT
22292011-06-18 Ian Lance Taylor <iant@google.com>
2230
2231 PR gold/12745
2232 * layout.cc (Layout::layout_eh_frame): Correct handling of
2233 writable .eh_frame section.
2234
534b4e5f
ILT
22352011-06-17 Ian Lance Taylor <iant@google.com>
2236
2237 PR gold/12893
2238 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2239 symbol is redefined with the exact same object and value.
2240
10b4f102
ILT
22412011-06-17 Ian Lance Taylor <iant@google.com>
2242
2243 PR gold/12880
2244 * layout.h (class Layout): Add interp_segment_ field.
2245 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2246 (Layout::attach_allocated_section_to_segment): If making shared
2247 library, put .interp section in PT_INTERP segment.
2248 (Layout::finalize): Also call create_interp if -dynamic-linker
2249 option was used.
2250 (Layout::create_interp): Assert that there is no PT_INTERP
2251 segment. If not using a SECTIONS clause, use make_output_section.
2252 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2253 * script-sections.cc
2254 (Script_sections::create_note_and_tls_segments): If making shared
2255 library, put .interp section in PT_INTERP segment.
2256
a29b0dad
ILT
22572011-06-17 Ian Lance Taylor <iant@google.com>
2258
e588ea8d
ILT
2259 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2260 when making a shared library.
2261
22622011-06-17 Ian Lance Taylor <iant@google.com>
2263
2264 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2265 parameter. Change all callers. Don't issue warning about PC32
2266 against locally defined symbol.
a29b0dad 2267
9d3b0698
ILT
22682011-06-16 Ian Lance Taylor <iant@google.com>
2269
2270 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2271 occurs in same object.
2272
85b0f90c
AM
22732011-06-14 Alan Modra <amodra@gmail.com>
2274
2275 * po/POTFILES.in: Regenerate.
2276
a94907d9
ILT
22772011-06-09 Ian Lance Taylor <iant@google.com>
2278
2279 * script-sections.cc
2280 (Orphan_output_section::set_section_addresses): For a relocatable
2281 link set address to 0.
2282
4fb3a1c3
CC
22832011-06-09 Cary Coutant <ccoutant@google.com>
2284
2285 PR gold/12804
2286 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2287 used with --compress-debug-sections.
2288 * gold/object.cc (Sized_relobj_file::do_layout): Report
2289 uncompressed size of compressed input sections.
2290
61220854
CC
22912011-06-08 Cary Coutant <ccoutant@google.com>
2292
2293 PR gold/12804
2294 * testsuite/two_file_test_2_v1.cc: Change initialization of
2295 v2 to keep it in .data.
2296
e6455dfb
CC
22972011-06-07 Cary Coutant <ccoutant@google.com>
2298
2299 * common.cc (Symbol_table::do_allocate_commons_list): Call
2300 gold_fallback.
2301 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2302 (Errors::fallback): New function.
2303 (gold_fallback): New function.
2304 * errors.h (Errors::fallback): New function.
2305 * gold.cc (gold_exit): Change status parameter to enum; adjust
2306 all callers.
2307 (queue_initial_tasks): Call gold_fallback.
2308 * gold.h: Include cstdlib.
2309 (Exit_status): New enum type.
2310 (gold_exit): Change status parameter to enum.
2311 (gold_fallback): New function.
2312 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2313 (Layout::create_symtab_sections): Likewise.
2314 (Layout::create_shdrs): Likewise.
2315 * main.cc (main): Adjust call to gold_exit.
2316 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2317 (Output_data_got::add_got_entry_pair): Likewise.
2318 (Output_section::add_input_section): Likewise.
2319 (Output_section::add_output_section_data): Likewise.
2320 (Output_segment::set_section_list_addresses): Likewise.
2321 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2322
fb0e076f
CC
23232011-06-07 Cary Coutant <ccoutant@google.com>
2324
2325 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2326 for incremental links.
2327 * output.cc (Output_segment::set_section_list_addresses): Remove
2328 FIXME and test for TLS or BSS.
2329
a5ee4d5d
CC
23302011-06-07 Cary Coutant <ccoutant@google.com>
2331
2332 * testsuite/Makefile.am: Add incremental_copy_test,
2333 incremental_common_test_1.
2334 * testsuite/Makefile.in: Regenerate.
2335 * testsuite/common_test_1_v1.c: New source file.
2336 * testsuite/common_test_1_v2.c: New source file.
2337 * testsuite/copy_test_v1.cc: New source file.
2338
5146f448
CC
23392011-06-07 Cary Coutant <ccoutant@google.com>
2340
2341 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2342 update, allocate common from bss section's free list.
2343 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2344 linker-defined symbols.
2345 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2346 Skip GOT and PLT entries that are no longer referenced.
2347 (Output_section_incremental_inputs::write_info_blocks): Mark
2348 linker-defined symbols.
2349 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2350 * output.cc (Output_section::allocate): New function.
2351 * output.h (Output_section::allocate): New function.
2352 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2353 linker-defined symbols.
2354 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2355 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2356 (Symbol::init_base_output_data): Likewise.
2357 (Symbol::init_base_output_segment): Likewise.
2358 (Symbol::init_base_constant): Likewise.
2359 (Sized_symbol::init_output_data): Likewise.
2360 (Sized_symbol::init_output_segment): Likewise.
2361 (Sized_symbol::init_constant): Likewise.
2362 (Symbol_table::do_define_in_output_data): Likewise.
2363 (Symbol_table::do_define_in_output_segment): Likewise.
2364 (Symbol_table::do_define_as_constant): Likewise.
2365 * symtab.h (Symbol::is_predefined): New function.
2366 (Symbol::init_base_output_data): Add is_predefined parameter.
2367 (Symbol::init_base_output_segment): Likewise.
2368 (Symbol::init_base_constant): Likewise.
2369 (Symbol::is_predefined_): New data member.
2370 (Sized_symbol::init_output_data): Add is_predefined parameter.
2371 (Sized_symbol::init_output_segment): Likewise.
2372 (Sized_symbol::init_constant): Likewise.
2373 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2374
26d3c67d
CC
23752011-06-07 Cary Coutant <ccoutant@google.com>
2376
2377 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2378 instead of emit_copy_reloc.
2379 (Copy_relocs::emit_copy_reloc): Refactor.
2380 (Copy_relocs::make_copy_reloc): New function.
2381 (Copy_relocs::add_copy_reloc): Remove.
2382 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2383 section.
2384 (Copy_relocs::make_copy_reloc): New function.
2385 (Copy_relocs::add_copy_reloc): Remove.
2386 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2387 unchanged input files.
2388 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2389 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2390 Reserve BSS space for COPY relocations.
2391 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2392 (Output_section_incremental_inputs::write_info_blocks): Record
2393 whether a symbol is copied from a shared object.
2394 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2395 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2396 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2397 (Incremental_input_entry_reader::get_output_symbol_index): Add
2398 is_copy parameter.
2399 (Incremental_binary::emit_copy_relocs): New function.
2400 (Incremental_binary::do_emit_copy_relocs): New function.
2401 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2402 new data member.
2403 (Sized_incremental_binary::add_copy_reloc): New function.
2404 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2405 (Sized_incremental_binary::Copy_reloc): New struct.
2406 (Sized_incremental_binary::Copy_relocs): New typedef.
2407 (Sized_incremental_binary::copy_relocs_): New data member.
2408 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2409 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2410 * target.h (Sized_target::emit_copy_reloc): New function.
2411 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2412
7cdb37d9
CC
24132011-06-02 Cary Coutant <ccoutant@google.com>
2414
2415 PR gold/12163
2416 * gold/archive.cc (Archive::Archive): Initialize new data member.
2417 (Archive::include_all_members): Return if archive has already been
2418 included.
2419 * gold/archive.h (Archive::include_all_members_): New data member.
2420
cc643b88
NC
24212011-06-02 Nick Clifton <nickc@redhat.com>
2422
2423 * dynobj.h: Fix spelling mistake in comment.
2424 * output.cc: Likewise.
2425
f62a3ca7 24262011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 2427 Asier Llano
f62a3ca7
DK
2428
2429 PR gold/12826
cc643b88 2430 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
2431 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2432 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2433 redundant arm_exidx_test.so.
2434 * testsuite/Makefile.in: Regenerate.
2435 (check_SCRIPTS): Add pr12826.sh
2436 (check_DATA): Add pr12826.stdout
2437 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2438 * testsuite/pr12826.sh: New file.
2439 * testsuite/pr12826_1.s: Ditto.
2440 * testsuite/pr12826_1.s: Ditto.
2441
8dbe1edc
ILT
24422011-05-30 Ian Lance Taylor <iant@google.com>
2443
2444 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2445 sections.
2446
c49875be
ILT
24472011-05-29 Ian Lance Taylor <iant@google.com>
2448
2449 PR gold/12804
2450 * testsuite/Makefile.am: Use different file name for two_file_test
2451 temporary file for each incremental test.
2452 * testsuite/Makefile.in: Rebuild.
2453
69d53f7a
ILT
24542011-05-29 Ian Lance Taylor <iant@google.com>
2455
2456 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2457 binary input file is empty.
2458
41d0ab5f
ILT
24592011-05-27 Ian Lance Taylor <iant@google.com>
2460
2461 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2462 (ver_test_9.so): Likewise.
2463 * testsuite/Makefile.in: Rebuild.
2464
89d8a36b
CC
24652011-05-26 Cary Coutant <ccoutant@google.com>
2466
2467 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2468 * incremental.cc (Incremental_inputs::report_input_section): Fix
2469 comment, indentation.
2470 (Incremental_inputs::report_comdat_group): New function.
2471 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2472 of data for incremental input file entry.
2473 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2474 group count, COMDAT group signatures.
2475 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2476 an unchanged input file.
2477 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2478 Initialize new data member.
2479 (Incremental_object_entry::add_comdat_group): New function.
2480 (Incremental_object_entry::get_comdat_group_count): New function.
2481 (Incremental_object_entry::get_comdat_signature_key): New function.
2482 (Incremental_object_entry::groups_): New data member.
2483 (Incremental_inputs::report_comdat_group): New function.
2484 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2485 data for incremental input file entry.
2486 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2487 (Incremental_input_entry_reader::get_input_section): Adjust size of
2488 data for incremental input file entry.
2489 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2490 (Incremental_input_entry_reader::get_comdat_group_signature): New
2491 function.
2492 * object.cc (Sized_relobj::include_section_group): Report kept
2493 COMDAT groups for incremental links.
2494
1706a06f
ILT
24952011-05-24 David Meyer <pdox@google.com>
2496
2497 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2498 with name parameter. Add found_name parameter.
2499 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2500 * dirsearch.h (class Dirsearch): Update declaration.
2501
a10ae760
ILT
25022011-05-24 Ian Lance Taylor <iant@google.com>
2503
2504 * archive.cc (Library_base::should_include_member): Pull in object
2505 from archive if it defines the entry symbol.
2506 * parameters.cc (Parameters::entry): New function.
2507 * parameters.h (class Parameters): Declare entry.
2508 * output.h (class Output_file_header): Remove entry_ field.
2509 * output.cc (Output_file_header::Output_file_header): Remove entry
2510 parameter. Change all callers.
2511 (Output_file_header::entry): Use parameters->entry.
2512 * gold.cc (queue_middle_tasks): Likewise.
2513 * plugin.cc (Plugin_hook::run): Likewise.
2514
aa92d6ed
CC
25152011-05-24 Cary Coutant <ccoutant@google.com>
2516
2517 * gold.cc (queue_initial_tasks): Pass incremental base filename
2518 to Output_file::open_base_file; don't print error message.
2519 * incremental-dump.cc (main): Adjust call to
2520 Output_file::open_for_modification.
2521 * incremental-dump.cc (main): Likewise.
2522 * incremental.cc (Incremental_inputs::report_command_line):
2523 Ignore --incremental-base option when comparing command lines.
2524 Ignore parameter when given as separate argument.
2525 * options.h (class General_options): Add --incremental-base.
2526 * output.cc (Output_file::Output_file):
2527 (Output_file::open_base_file): Add base_name and writable parameters;
2528 read base file into new file; print error message here.
2529 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2530 callers.
2531 * output.h (Output_file::open_for_modification): Rename to...
2532 (Output_file::open_base_file): ...this; add base_name and
2533 writable parameters; adjust all callers.
2534 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2535 callers.
2536 * testsuite/Makefile.am (incremental_test_4): Test
2537 --incremental-base.
2538 * testsuite/Makefile.in: Regenerate.
2539
2eedd706
CC
25402011-05-24 Cary Coutant <ccoutant@google.com>
2541
2542 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2543 incremental_test_4.
2544 * testsuite/Makefile.in: Regenerate.
2545 * testsuite/two_file_test_1_v1.cc: New test source file.
2546 * testsuite/two_file_test_1b_v1.cc: New test source file.
2547 * testsuite/two_file_test_2_v1.cc: New test source file.
2548
0f1c85a6
CC
25492011-05-24 Cary Coutant <ccoutant@google.com>
2550
2551 * dynobj.h (Dynobj::do_dynobj): New function.
2552 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2553 flag and soname for shared objects.
2554 * incremental.cc (Incremental_inputs::report_object): Make
2555 either Incremental_object_entry or Incremental_dynobj_entry; add
2556 soname to string table.
2557 (Incremental_inputs::report_input_section): Add assertion.
2558 (Output_section_incremental_inputs::set_final_data_size): Adjust
2559 type of input file entry for shared libraries; adjust size of
2560 shared library info entry.
2561 (Output_section_incremental_inputs::write_input_files): Write
2562 as_needed flag for shared libraries.
2563 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2564 of input file entry for shared libraries; write soname.
2565 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2566 soname from incremental info.
2567 * incremental.h (enum Incremental_input_flags): Add
2568 INCREMENTAL_INPUT_AS_NEEDED.
2569 (Incremental_input_entry::Incremental_input_entry): Initialize new
2570 data member.
2571 (Incremental_input_entry::set_as_needed): New function.
2572 (Incremental_input_entry::as_needed): New function.
2573 (Incremental_input_entry::do_dynobj_entry): New function.
2574 (Incremental_input_entry::as_needed_): New data member.
2575 (Incremental_object_entry::Incremental_object_entry): Don't check
2576 for shared library.
2577 (Incremental_object_entry::do_type): Likewise.
2578 (class Incremental_dynobj_entry): New class.
2579 (Incremental_input_entry_reader::as_needed): New function.
2580 (Incremental_input_entry_reader::get_soname): New function.
2581 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2582 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2583 size of shared library info entry.
58797674 2584 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
2585 incremental link when adding DT_NEEDED entries.
2586 * object.h (Object::Object): Initialize new data member.
2587 (Object::dynobj): New function.
2588 (Object::set_as_needed): New function.
2589 (Object::as_needed): New function.
2590 (Object::do_dynobj): New function.
2591 (Object::as_needed_): New data member.
2592
6fa2a40b
CC
25932011-05-24 Cary Coutant <ccoutant@google.com>
2594
2595 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2596 info; adjust display of GOT entries.
2597 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2598 vector of input objects; remove file_status_.
2599 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2600 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2601 got_plt reader; call target hooks to reserve GOT entries.
2602 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2603 of input file info header and GOT info entry.
2604 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2605 relocation info.
2606 (Got_plt_view_info::got_descriptor): Remove.
2607 (Got_plt_view_info::sym_index): New data member.
2608 (Got_plt_view_info::input_index): New data member.
2609 (Local_got_offset_visitor::visit): Write input file index.
2610 (Global_got_offset_visitor::visit): Write 0 for input file index.
2611 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2612 with sym_index and input_index.
2613 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2614 incremental info GOT entry; replace got_descriptor with input_index.
2615 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2616 map from input file index to object.
2617 (Sized_relobj_incr::do_layout): Replace direct data member reference
2618 with accessor function.
2619 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2620 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2621 Adjust size of input file info header.
2622 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2623 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2624 (Incremental_input_entry_reader::get_input_section): Adjust size of
2625 input file info header.
2626 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2627 of incremental info GOT entry.
2628 (Incremental_got_plt_reader::get_got_desc): Remove.
2629 (Incremental_got_plt_reader::get_got_symndx): New function.
2630 (Incremental_got_plt_reader::get_got_input_index): New function.
2631 (Sized_incremental_binary::Sized_incremental_binary): Remove
2632 file_status_; add input_objects_.
2633 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2634 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2635 (Sized_incremental_binary::file_is_unchanged): Remove.
2636 (Sized_incremental_binary::set_input_object): New function.
2637 (Sized_incremental_binary::input_object): New function.
2638 (Sized_incremental_binary::file_status_): Remove.
2639 (Sized_incremental_binary::input_objects_): New data member.
2640 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2641 references.
2642 (Sized_relobj_incr::invalid_address): Move to base class.
2643 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2644 class.
2645 (Sized_relobj_incr::do_output_section_offset): Likewise.
2646 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2647 (Sized_relobj_incr::section_offsets_): Likewise.
2648 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2649 function.
2650 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2651 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2652 with accessor function.
2653 (Sized_relobj_file::do_layout): Likewise.
2654 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2655 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2656 (Sized_relobj_file::compute_final_local_value): Replace refs to
2657 section_offsets_ with accessor function.
2658 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2659 * object.h (Relobj::Relobj): Initialize new data members.
2660 (Relobj::add_dyn_reloc): New function.
2661 (Relobj::first_dyn_reloc): New function.
2662 (Relobj::dyn_reloc_count): New function.
2663 (Relobj::first_dyn_reloc_): New data member.
2664 (Relobj::dyn_reloc_count_): New data member.
2665 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2666 references.
2667 (Sized_relobj::Address): New typedef.
2668 (Sized_relobj::invalid_address): Move here from child class.
2669 (Sized_relobj::Sized_relobj): Initialize new data members.
2670 (Sized_relobj::sized_relobj): New function.
2671 (Sized_relobj::is_output_section_offset_invalid): Move here from
2672 child class.
2673 (Sized_relobj::get_output_section_offset): Likewise.
2674 (Sized_relobj::local_has_got_offset): Likewise.
2675 (Sized_relobj::local_got_offset): Likewise.
2676 (Sized_relobj::set_local_got_offset): Likewise.
2677 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2678 (Sized_relobj::clear_got_offsets): New function.
2679 (Sized_relobj::section_offsets): Move here from child class.
2680 (Sized_relobj::do_output_section_offset): Likewise.
2681 (Sized_relobj::do_set_section_offset): Likewise.
2682 (Sized_relobj::Local_got_offsets): Likewise.
2683 (Sized_relobj::local_got_offsets_): Likewise.
2684 (Sized_relobj::section_offsets_): Likewise.
2685 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2686 references.
2687 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2688 class.
2689 (Sized_relobj_file::sized_relobj): New function
2690 (Sized_relobj_file::local_has_got_offset): Move to base class.
2691 (Sized_relobj_file::local_got_offset): Likewise.
2692 (Sized_relobj_file::set_local_got_offset): Likewise.
2693 (Sized_relobj_file::get_output_section_offset): Likewise.
2694 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2695 (Sized_relobj_file::do_output_section_offset): Likewise.
2696 (Sized_relobj_file::do_set_section_offset): Likewise.
2697 (Sized_relobj_file::Local_got_offsets): Likewise.
2698 (Sized_relobj_file::local_got_offsets_): Likewise.
2699 (Sized_relobj_file::section_offsets_): Likewise.
2700 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2701 (all constructors).
2702 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2703 (Output_reloc::get_symbol_index): Likewise.
2704 (Output_reloc::local_section_offset): Likewise.
2705 (Output_reloc::get_address): Likewise.
2706 (Output_reloc::symbol_value): Likewise.
2707 (Output_data_got::reserve_slot): Move to class definition.
2708 (Output_data_got::reserve_local): New function.
2709 (Output_data_got::reserve_slot_for_global): Remove.
2710 (Output_data_got::reserve_global): New function.
2711 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2712 (all constructors, two instantiations).
2713 (Output_reloc::get_relobj): New function (two instantiations).
2714 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2715 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2716 (Output_data_reloc::add_global): Adjust type of relobj.
2717 (Output_data_reloc::add_global_relative): Likewise.
2718 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2719 (Output_data_reloc::add_local): Likewise.
2720 (Output_data_reloc::add_local_relative): Likewise.
2721 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2722 (Output_data_reloc::add_local_section): Likewise.
2723 (Output_data_reloc::add_output_section): Likewise.
2724 (Output_data_reloc::add_absolute): Likewise.
2725 (Output_data_reloc::add_target_specific): Likewise.
2726 (Output_data_got::reserve_slot): Move definition here.
2727 (Output_data_got::reserve_local): New function.
2728 (Output_data_got::reserve_global): New function.
2729 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2730 section_offsets_ with accessor function.
2731 (Sized_relobj_file::write_sections): Likewise.
2732 (Sized_relobj_file::do_relocate_sections): Likewise.
2733 * target.h (Sized_target::reserve_local_got_entry): New function.
2734 (Sized_target::reserve_global_got_entry): New function.
2735 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2736 (Target_x86_64::reserve_global_got_entry): New function.
2737 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2738
4829d394
CC
27392011-05-23 Cary Coutant <ccoutant@google.com>
2740
2741 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2742 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2743 bit when checking got_type.
2744 * incremental.cc (Sized_incremental_binary::setup_readers):
2745 Store symbol table and string table locations; initialize bit vector
2746 of file status flags.
2747 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2748 unchanged files.
2749 (Sized_incremental_binary::do_process_got_plt): New function.
2750 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2751 (Output_section_incremental_inputs::set_final_data_size): Record
2752 file index for each input file.
2753 (Output_section_incremental_inputs::write_got_plt): Store file index
2754 instead of input entry offset for each GOT entry.
2755 * incremental.h
2756 (Incremental_input_entry::Incremental_input_entry): Initialize new
2757 data member.
2758 (Incremental_input_entry::set_offset): Store file index.
2759 (Incremental_input_entry::get_file_index): New function.
2760 (Incremental_input_entry::file_index_): New data member.
2761 (Incremental_binary::process_got_plt): New function.
2762 (Incremental_binary::do_process_got_plt): New function.
2763 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2764 data members.
2765 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2766 (Sized_incremental_binary::set_file_is_unchanged): New function.
2767 (Sized_incremental_binary::file_is_unchanged): New function.
2768 (Sized_incremental_binary::do_process_got_plt): New function.
2769 (Sized_incremental_binary::file_status_): New data member.
2770 (Sized_incremental_binary::main_symtab_loc_): New data member.
2771 (Sized_incremental_binary::main_strtab_loc_): New data member.
2772 * output.cc (Output_data_got::Got_entry::write): Add case
2773 RESERVED_CODE.
2774 (Output_data_got::add_global): Call add_got_entry.
2775 (Output_data_got::add_global_plt): Likewise.
2776 (Output_data_got::add_global_with_rel): Likewise.
2777 (Output_data_got::add_global_with_rela): Likewise.
2778 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2779 (Output_data_got::add_global_pair_with_rela): Likewise.
2780 (Output_data_got::add_local): Call add_got_entry.
2781 (Output_data_got::add_local_plt): Likewise.
2782 (Output_data_got::add_local_with_rel): Likewise.
2783 (Output_data_got::add_local_with_rela): Likewise.
2784 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2785 (Output_data_got::add_local_pair_with_rela): Likewise.
2786 (Output_data_got::reserve_slot): New function.
2787 (Output_data_got::reserve_slot_for_global): New function.
2788 (Output_data_got::add_got_entry): New function.
2789 (Output_data_got::add_got_entry_pair): New function.
2790 (Output_section::add_output_section_data): Edit FIXME.
2791 * output.h
2792 (Output_section_data_build::Output_section_data_build): New
2793 constructor with size parameter.
2794 (Output_data_space::Output_data_space): Likewise.
2795 (Output_data_got::Output_data_got): Initialize new data member; new
2796 constructor with size parameter.
2797 (Output_data_got::add_constant): Call add_got_entry.
2798 (Output_data_got::reserve_slot): New function.
2799 (Output_data_got::reserve_slot_for_global): New function.
2800 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2801 (Output_data_got::add_got_entry): New function.
2802 (Output_data_got::add_got_entry_pair): New function.
2803 (Output_data_got::free_list_): New data member.
2804 * target.h (Sized_target::init_got_plt_for_update): New function.
2805 (Sized_target::register_global_plt_entry): New function.
2806 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2807 Initialize new data member; call init; add constructor with PLT count.
2808 (Output_data_plt_x86_64::init): New function.
2809 (Output_data_plt_x86_64::add_relocation): New function.
2810 (Output_data_plt_x86_64::reserve_slot): New function.
2811 (Output_data_plt_x86_64::free_list_): New data member.
2812 (Target_x86_64::init_got_plt_for_update): New function.
2813 (Target_x86_64::register_global_plt_entry): New function.
2814 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2815 incremental updates.
2816 (Output_data_plt_x86_64::add_relocation): New function.
2817 * testsuite/object_unittest.cc (Object_test): Set default options.
2818
ec69d6da
ILT
28192011-05-16 Ian Lance Taylor <iant@google.com>
2820
2821 * options.h (class General_options): Make -i a synonym for -r.
2822
732e31de
ILT
28232011-05-16 Ian Lance Taylor <iant@google.com>
2824
2825 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2826
403676b5
CC
28272011-05-10 Cary Coutant <ccoutant@google.com>
2828
2829 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2830 strip_all (-s).
2831
5b7b7d6e
ILT
28322011-05-06 Ian Lance Taylor <iant@google.com>
2833
2834 * layout.cc (Layout::layout): If the output section flags change,
2835 update the ordering.
2836
f0f9babf
CC
28372011-04-25 Cary Coutant <ccoutant@google.com>
2838
2839 * incremental-dump.cc (dump_incremental_inputs): Print local
2840 symbol info for each input file.
2841 * incremental.cc
2842 (Output_section_incremental_inputs::set_final_data_size): Add local
2843 symbol info to input file entries in incremental info.
2844 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2845 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2846 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2847 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2848 implementation.
2849 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2850 (Sized_incr_relobj::do_relocate): Write the local symbols.
2851 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2852 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2853 Adjust size of input file header.
2854 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2855 (Incremental_inputs_reader::get_local_symbol_count): New function.
2856 (Incremental_inputs_reader::get_input_section): Adjust size of input
2857 file header.
2858 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2859 (Sized_incr_relobj::This): New typedef.
2860 (Sized_incr_relobj::sym_size): New const data member.
2861 (Sized_incr_relobj::Local_symbol): New struct.
2862 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2863 (Sized_incr_relobj::do_local_symbol_offset): New function.
2864 (Sized_incr_relobj::local_symbol_count_): New data member.
2865 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2866 (Sized_incr_relobj::local_symbol_index_): New data member.
2867 (Sized_incr_relobj::local_symbol_offset_): New data member.
2868 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2869 (Sized_incr_relobj::local_symbols_): New data member.
2870 * object.h (Relobj::output_local_symbol_count): New function.
2871 (Relobj::local_symbol_offset): New function.
2872 (Relobj::do_output_local_symbol_count): New function.
2873 (Relobj::do_local_symbol_offset): New function.
2874 (Sized_relobj::do_output_local_symbol_count): New function.
2875 (Sized_relobj::do_local_symbol_offset): New function.
2876
d0a9ace3
ILT
28772011-04-22 Vladimir Simonov <sv@sw.ru>
2878
2879 * descriptors.cc (set_close_on_exec): New function.
2880 (Descriptors::open): Use set_close_on_exec.
2881 * output.cc (S_ISLNK): Define if not defined.
2882
94a3fc8b
CC
28832011-04-22 Cary Coutant <ccoutant@google.com>
2884
2885 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2886 global symbol map.
2887 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2888 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2889 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2890 relocations.
2891 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2892 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2893 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2894 * incremental.h
2895 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2896 function.
2897 (Incremental_binary::apply_incremental_relocs): New function.
2898 (Incremental_binary::do_apply_incremental_relocs): New function.
2899 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2900 data member.
2901 (Sized_incremental_binary::add_global_symbol): New function.
2902 (Sized_incremental_binary::global_symbol): New function.
2903 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2904 (Sized_incremental_binary::symbol_map_): New data member.
2905 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2906 * target.h (Sized_target::apply_relocation): New function.
2907 * target-reloc.h (apply_relocation): New function.
2908 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2909
c87e4302
DK
29102011-04-22 Doug Kwan <dougkwan@google.com>
2911
2912 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2913 flag of a SHT_ARM_EXIDX section.
2e702c99 2914 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
2915 * testsuite/Makefile.in: Regenerate.
2916 * testsuite/arm_exidx_test.s: New file.
2917 * testsuite/arm_exidx_test.sh: Same.
2918
e7782cf6
CC
29192011-04-20 Cary Coutant <ccoutant@google.com>
2920
2921 PR gold/12689
2922 * archive.h (Incremental_archive_entry::Archive_member):
2923 Initialize arg_serial_ (second constructor).
2924
308ecdc7
ILT
29252011-04-17 Ian Lance Taylor <iant@google.com>
2926
2927 * object.cc (Relocate_info::location): Simplify location string.
2928 * errors.cc (Errors::error_at_location): Don't print program
2929 name.
2930 (Errors::warning_at_location): Likewise.
2931 (Errors::undefined_symbol): Likewise.
2932 * testsuite/debug_msg.sh: Update accordingly.
2933
bec5b579
CC
29342011-04-14 Cary Coutant <ccoutant@google.com>
2935
2936 * gold/layout.cc (Layout::symtab_section_offset): New function.
2937 * gold/layout.h (Layout::symtab_section_offset): New function.
2938 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2939
88597d34
ILT
29402011-04-12 Ian Lance Taylor <iant@google.com>
2941
2942 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2943 with MREMAP_MAYMOVE.
2944 * output.h (class Output_file): Add map_is_allocated_ field.
2945 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2946 not available, provide stubs. If mremap is not available, #define
2947 it to gold_mremap.
2948 (MREMAP_MAYMOVE): Define if not defined.
2949 (Output_file::Output_file): Initialize map_is_allocated_.
2950 (Output_file::resize): Check map_is_allocated_.
2951 (Output_file::map_anonymous): If mmap fails, use malloc.
2952 (Output_file::unmap): Don't do anything for an anonymous map.
2953 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2954 is not available, provide stubs.
2955 (File_read::View::~View): Use free rather than delete[].
2956 (File_read::make_view): Use malloc rather than new[]. If mmap
2957 fails, use malloc.
2958 (File_read::find_or_make_view): Use malloc rather than new[].
2959 * gold.h: Remove HAVE_REMAP code.
2960 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2961 exists. Rename mremap to gold_mremap. If mmap is not available
2962 don't do anything.
2963 * configure, config.in: Rebuild.
2964
11e361bc
ILT
29652011-04-11 Ian Lance Taylor <iant@google.com>
2966
2967 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2968 initialize local variable v.
2969
cdc29364
CC
29702011-04-11 Cary Coutant <ccoutant@google.com>
2971
2972 * archive.cc (Archive::include_member): Adjust call to
2973 report_object.
2974 (Add_archive_symbols::run): Track argument serial numbers.
2975 (Lib_group::include_member): Likewise.
2976 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2977 * archive.h (Incremental_archive_entry::Archive_member):
2978 Initialize arg_serial_.
2979 (Archive_member::arg_serial_): New data member.
2980 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2981 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2982 incremental link.
2983 (Sized_dynobj::do_for_all_local_got_entries): New function.
2984 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2985 function.
2986 * fileread.cc (get_mtime): New function.
2987 * fileread.h (get_mtime): New function.
2988 * gold.cc (queue_initial_tasks): Check for incremental update.
2989 (process_incremental_input): New function.
2990 (queue_middle_tasks): Don't force valid target for incremental
2991 update.
2992 * incremental-dump.cc (find_input_containing_global): Adjust
2993 size of symbol info entry.
2994 (dump_incremental_inputs): Dump argument serial number and
2995 in_system_directory flag; bias shndx by 1; print symbol names
2996 when dumping per-file symbol lists; use new symbol info readers.
2997 * incremental.cc
2998 (Output_section_incremental_inputs:update_data_size): New function.
2999 (Sized_incremental_binary::setup_readers): Setup input readers
3000 for each input file; build maps for files added from libraries
3001 and scripts.
3002 (Sized_incremental_binary::check_input_args): New function.
3003 (Sized_incremental_binary::do_check_inputs): Build map of argument
3004 serial numbers to input arguments.
3005 (Sized_incremental_binary::do_file_has_changed): Rename
3006 do_file_is_unchanged to this; compare file modification times.
3007 (Sized_incremental_binary::do_init_layout): New function.
3008 (Sized_incremental_binary::do_reserve_layout): New function.
3009 (Sized_incremental_binary::do_get_input_reader): Remove.
3010 (Sized_incremental_binary::get_symtab_view): New function.
3011 (Incremental_checker::can_incrementally_link_output_file): Remove.
3012 (Incremental_inputs::report_command_line): Exclude --debug options.
3013 (Incremental_inputs::report_archive_begin): Add parameter; track
3014 argument serial numbers; don't put input file entry for archive
3015 before archive members.
3016 (Incremental_inputs::report_archive_end): Put input file entry
3017 for archive after archive members.
3018 (Incremental_inputs::report_object): Add parameter; track argument
3019 serial numbers and in_system_directory flag.
3020 (Incremental_inputs::report_script): Add parameter; track argument
3021 serial numbers.
3022 (Output_section_incremental_inputs::set_final_data_size): Adjust
3023 size of symbol info entry; check for forwarding symbols.
3024 (Output_section_incremental_inputs::write_input_files): Write
3025 in_system_directory flag and argument serial number.
3026 (Output_section_incremental_inputs::write_info_blocks): Map section
3027 indices between incremental info and original input file; store
3028 input section index for each symbol.
3029 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
3030 change operator() to visit().
3031 (class Global_got_offset_visitor): Likewise.
3032 (class Global_symbol_visitor_got_plt):
3033 (Output_section_incremental_inputs::write_got_plt): Use new visitor
3034 classes.
3035 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
3036 (Sized_incr_relobj::do_read_symbols): New function.
3037 (Sized_incr_relobj::do_layout): New function.
3038 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3039 (Sized_incr_relobj::do_add_symbols): New function.
3040 (Sized_incr_relobj::do_should_include_member): New function.
3041 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3042 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3043 (Sized_incr_relobj::do_section_size): New function.
3044 (Sized_incr_relobj::do_section_name): New function.
3045 (Sized_incr_relobj::do_section_contents): New function.
3046 (Sized_incr_relobj::do_section_flags): New function.
3047 (Sized_incr_relobj::do_section_entsize): New function.
3048 (Sized_incr_relobj::do_section_address): New function.
3049 (Sized_incr_relobj::do_section_type): New function.
3050 (Sized_incr_relobj::do_section_link): New function.
3051 (Sized_incr_relobj::do_section_info): New function.
3052 (Sized_incr_relobj::do_section_addralign): New function.
3053 (Sized_incr_relobj::do_initialize_xindex): New function.
3054 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3055 (Sized_incr_relobj::do_read_relocs): New function.
3056 (Sized_incr_relobj::do_gc_process_relocs): New function.
3057 (Sized_incr_relobj::do_scan_relocs): New function.
3058 (Sized_incr_relobj::do_count_local_symbols): New function.
3059 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3060 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3061 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3062 (Sized_incr_relobj::do_relocate): New function.
3063 (Sized_incr_relobj::do_set_section_offset): New function.
3064 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3065 (Sized_incr_dynobj::do_read_symbols): New function.
3066 (Sized_incr_dynobj::do_layout): New function.
3067 (Sized_incr_dynobj::do_add_symbols): New function.
3068 (Sized_incr_dynobj::do_should_include_member): New function.
3069 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3070 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3071 (Sized_incr_dynobj::do_section_size): New function.
3072 (Sized_incr_dynobj::do_section_name): New function.
3073 (Sized_incr_dynobj::do_section_contents): New function.
3074 (Sized_incr_dynobj::do_section_flags): New function.
3075 (Sized_incr_dynobj::do_section_entsize): New function.
3076 (Sized_incr_dynobj::do_section_address): New function.
3077 (Sized_incr_dynobj::do_section_type): New function.
3078 (Sized_incr_dynobj::do_section_link): New function.
3079 (Sized_incr_dynobj::do_section_info): New function.
3080 (Sized_incr_dynobj::do_section_addralign): New function.
3081 (Sized_incr_dynobj::do_initialize_xindex): New function.
3082 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3083 (make_sized_incremental_object): New function.
3084 (Incremental_library::copy_unused_symbols): New function.
3085 (Incremental_library::do_for_all_unused_symbols): New function.
3086 * incremental.h (enum Incremental_input_flags): New type.
3087 (class Incremental_checker): Remove.
3088 (Incremental_input_entry::Incremental_input_entry): Add argument
3089 serial number.
3090 (Incremental_input_entry::arg_serial): New function.
3091 (Incremental_input_entry::set_is_in_system_directory): New function.
3092 (Incremental_input_entry::is_in_system_directory): New function.
3093 (Incremental_input_entry::arg_serial_): New data member.
3094 (Incremental_input_entry::is_in_system_directory_): New data member.
3095 (class Script_info): Move here from script.h.
3096 (Script_info::Script_info): Add filename parameter.
3097 (Script_info::filename): New function.
3098 (Script_info::filename_): New data member.
3099 (Incremental_script_entry::Incremental_script_entry): Add argument
3100 serial number.
3101 (Incremental_object_entry::Incremental_object_entry): Likewise.
3102 (Incremental_object_entry::add_input_section): Build list of input
3103 sections with map to original shndx.
3104 (Incremental_object_entry::get_input_section_index): New function.
3105 (Incremental_object_entry::shndx_): New data member.
3106 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3107 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3108 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3109 serial number.
3110 (Incremental_inputs::report_archive_begin): Likewise.
3111 (Incremental_inputs::report_object): Likewise.
3112 (Incremental_inputs::report_script): Likewise.
3113 (class Incremental_global_symbol_reader): New class.
3114 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3115 and store flags and input file type.
3116 (Incremental_input_entry_reader::arg_serial): New function.
3117 (Incremental_input_entry_reader::type): Extract type from flags.
3118 (Incremental_input_entry_reader::is_in_system_directory): New function.
3119 (Incremental_input_entry_reader::get_input_section_count): Call
3120 accessor function for type.
3121 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3122 function for type; adjust size of global symbol entry.
3123 (Incremental_input_entry_reader::get_global_symbol_count): Call
3124 accessor function for type.
3125 (Incremental_input_entry_reader::get_object_count): Likewise.
3126 (Incremental_input_entry_reader::get_object_offset): Likewise.
3127 (Incremental_input_entry_reader::get_member_count): Likewise.
3128 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3129 (Incremental_input_entry_reader::get_member_offset): Likewise.
3130 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3131 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3132 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3133 (Incremental_input_entry_reader::get_global_symbol_reader): New
3134 function.
3135 (Incremental_input_entry_reader::get_output_symbol_index): New
3136 function.
3137 (Incremental_input_entry_reader::type_): Remove.
3138 (Incremental_input_entry_reader::flags_): New data member.
3139 (Incremental_inputs_reader::input_file_offset): New function.
3140 (Incremental_inputs_reader::input_file_index): New function.
3141 (Incremental_inputs_reader::input_file): Call input_file_offset.
3142 (Incremental_inputs_reader::input_file_at_offset): New function.
3143 (Incremental_relocs_reader::get_r_type): Reformat.
3144 (Incremental_relocs_reader::get_r_shndx): Reformat.
3145 (Incremental_relocs_reader::get_r_offset): Reformat.
3146 (Incremental_relocs_reader::data): New function.
3147 (Incremental_binary::Incremental_binary): Initialize new data members.
3148 (Incremental_binary::check_inputs): Add cmdline parameter.
3149 (Incremental_binary::file_is_unchanged): Remove.
3150 (Input_reader::arg_serial): New function.
3151 (Input_reader::get_unused_symbol_count): New function.
3152 (Input_reader::get_unused_symbol): New function.
3153 (Input_reader::do_arg_serial): New function.
3154 (Input_reader::do_get_unused_symbol_count): New function.
3155 (Input_reader::do_get_unused_symbol): New function.
3156 (Incremental_binary::input_file_count): New function.
3157 (Incremental_binary::get_input_reader): Change signature to use
3158 index instead of filename.
3159 (Incremental_binary::file_has_changed): New function.
3160 (Incremental_binary::get_input_argument): New function.
3161 (Incremental_binary::get_library): New function.
3162 (Incremental_binary::get_script_info): New function.
3163 (Incremental_binary::init_layout): New function.
3164 (Incremental_binary::reserve_layout): New function.
3165 (Incremental_binary::output_file): New function.
3166 (Incremental_binary::do_check_inputs): New function.
3167 (Incremental_binary::do_file_is_unchanged): Remove.
3168 (Incremental_binary::do_file_has_changed): New function.
3169 (Incremental_binary::do_init_layout): New function.
3170 (Incremental_binary::do_reserve_layout): New function.
3171 (Incremental_binary::do_input_file_count): New function.
3172 (Incremental_binary::do_get_input_reader): Change signature.
3173 (Incremental_binary::input_args_map_): New data member.
3174 (Incremental_binary::library_map_): New data member.
3175 (Incremental_binary::script_map_): New data member.
3176 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3177 new data members.
3178 (Sized_incremental_binary::output_section): New function.
3179 (Sized_incremental_binary::inputs_reader): Add const.
3180 (Sized_incremental_binary::symtab_reader): Add const.
3181 (Sized_incremental_binary::relocs_reader): Add const.
3182 (Sized_incremental_binary::got_plt_reader): Add const.
3183 (Sized_incremental_binary::get_symtab_view): New function.
3184 (Sized_incremental_binary::Inputs_reader): New typedef.
3185 (Sized_incremental_binary::Input_entry_reader): New typedef.
3186 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3187 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3188 (Sized_incremental_binary::do_file_has_changed): New function.
3189 (Sized_incremental_binary::do_init_layout): New function.
3190 (Sized_incremental_binary::do_reserve_layout): New function.
3191 (Sized_input_reader::Inputs_reader): Remove.
3192 (Sized_input_reader::Input_entry_reader): Remove.
3193 (Sized_input_reader::do_arg_serial): New function.
3194 (Sized_input_reader::do_get_unused_symbol_count): New function.
3195 (Sized_input_reader::do_get_unused_symbol): New function.
3196 (Sized_incremental_binary::do_input_file_count): New function.
3197 (Sized_incremental_binary::do_get_input_reader): Change signature;
3198 use index instead of filename.
3199 (Sized_incremental_binary::section_map_): New data member.
3200 (Sized_incremental_binary::input_entry_readers_): New data member.
3201 (class Sized_incr_relobj): New class.
3202 (class Sized_incr_dynobj): New class.
3203 (make_sized_incremental_object): New function.
3204 (class Incremental_library): New class.
3205 * layout.cc (Free_list::num_lists): New static data member.
3206 (Free_list::num_nodes): New static data member.
3207 (Free_list::num_removes): New static data member.
3208 (Free_list::num_remove_visits): New static data member.
3209 (Free_list::num_allocates): New static data member.
3210 (Free_list::num_allocate_visits): New static data member.
3211 (Free_list::init): New function.
3212 (Free_list::remove): New function.
3213 (Free_list::allocate): New function.
3214 (Free_list::dump): New function.
3215 (Free_list::print_stats): New function.
3216 (Layout_task_runner::run): Resize output file for incremental updates.
3217 (Layout::Layout): Initialize new data members.
3218 (Layout::set_incremental_base): New function.
3219 (Layout::init_fixed_output_section): New function.
3220 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3221 incremental updates.
3222 (Layout::create_gold_note): Do not create gold note section for
3223 incremental updates.
3224 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3225 for incremental updates.
3226 (Layout::set_section_offsets): For incremental updates, allocate space
3227 from free list.
3228 (Layout::create_symtab_sections): Layout with offsets relative to
3229 start of section; for incremental updates, allocate space from free
3230 list.
3231 (Layout::create_shdrs): For incremental updates, allocate space from
3232 free list.
3233 (Layout::finish_dynamic_section): For incremental updates, do not
3234 check --as-needed (fixed in subsequent patch).
3235 * layout.h (class Free_list): New class.
3236 (Layout::set_incremental_base): New function.
3237 (Layout::incremental_base): New function.
3238 (Layout::init_fixed_output_section): New function.
3239 (Layout::allocate): New function.
3240 (Layout::incremental_base_): New data member.
3241 (Layout::free_list_): New data member.
3242 * main.cc (main): Print Free_list statistics.
3243 * object.cc (Relobj::finalize_incremental_relocs): Add
3244 clear_counts parameter; clear counts only when clear_counts is set.
3245 (Sized_relobj::Sized_relobj): Initialize new base class.
3246 (Sized_relobj::do_layout): Don't report special sections.
3247 (Sized_relobj::do_for_all_local_got_entries): New function.
3248 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3249 symtab_off to all symbol table offsets.
3250 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3251 * object.h (class Got_offset_list): Move to top of file.
3252 (Object::Object): Allow case where input_file == NULL.
3253 (Object::~Object): Likewise.
3254 (Object::input_file): Assert that input_file != NULL.
3255 (Object::lock): Allow case where input_file == NULL.
3256 (Object::unlock): Likewise.
3257 (Object::is_locked): Likewise.
3258 (Object::token): Likewise.
3259 (Object::release): Likewise.
3260 (Object::is_incremental): New function.
3261 (Object::get_mtime): New function.
3262 (Object::for_all_local_got_entries): New function.
3263 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3264 (Object::set_is_in_system_directory): New function.
3265 (Object::is_in_system_directory): New function.
3266 (Object::do_is_incremental): New function.
3267 (Object::do_get_mtime): New function.
3268 (Object::do_for_all_local_got_entries): New function.
3269 (Object::is_in_system_directory_): New data member.
3270 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3271 (class Sized_relobj_base): New class.
3272 (class Sized_relobj): Derive from Sized_relobj_base.
3273 (class Sized_relobj::Symbols): Redeclare from base class.
3274 (class Sized_relobj::local_got_offset_list): Remove.
3275 (class Sized_relobj::Output_sections): Redeclare from base class.
3276 (class Sized_relobj::do_for_all_local_got_entries): New function.
3277 (class Sized_relobj::write_local_symbols): Add offset parameter.
3278 (class Sized_relobj::local_symbol_offset_): Update comment.
3279 (class Sized_relobj::local_dynsym_offset_): Update comment.
3280 * options.cc (Input_arguments::add_file): Remove const.
3281 * options.h (Input_file_argument::Input_file_argument):
3282 Initialize arg_serial_ (all constructors).
3283 (Input_file_argument::set_arg_serial): New function.
3284 (Input_file_argument::arg_serial): New function.
3285 (Input_file_argument::arg_serial_): New data member.
3286 (Input_arguments::Input_arguments): Initialize file_count_.
3287 (Input_arguments::add_file): Remove const.
3288 (Input_arguments::number_of_input_files): New function.
3289 (Input_arguments::file_count_): New data member.
3290 (Command_line::number_of_input_files): Call
3291 Input_arguments::number_of_input_files.
3292 * output.cc (Output_segment_headers::Output_segment_headers):
3293 Set current size.
3294 (Output_section::Input_section::current_data_size): New function.
3295 (Output_section::Output_section): Initialize new data members.
3296 (Output_section::add_input_section): Don't do merge sections for
3297 an incremental link; allocate space from free list for an
3298 incremental update.
3299 (Output_section::add_output_section_data): Allocate space from
3300 free list for an incremental update.
3301 (Output_section::update_data_size): New function.
3302 (Output_section::set_fixed_layout): New function.
3303 (Output_section::reserve): New function.
3304 (Output_segment::set_section_addresses): Remove const.
3305 (Output_segment::set_section_list_addresses): Remove const; allocate
3306 space from free list for an incremental update.
3307 (Output_segment::set_offset): Adjust size of RELRO segment for an
3308 incremental update.
3309 * output.h (Output_data::current_data_size): Move here from
3310 child classes.
3311 (Output_data::pre_finalize_data_size): New function.
3312 (Output_data::update_data_size): New function.
3313 (Output_section_headers::update_data_size): new function.
3314 (Output_section_data_build::current_data_size): Move to Output_data.
3315 (Output_data_strtab::update_data_size): New function.
3316 (Output_section::current_data_size): Move to Output_data.
3317 (Output_section::set_fixed_layout): New function.
3318 (Output_section::has_fixed_layout): New function.
3319 (Output_section::reserve): New function.
3320 (Output_section::update_data_size): New function.
3321 (Output_section::has_fixed_layout_): New data member.
3322 (Output_section::free_list_): New data member.
3323 (Output_segment::set_section_addresses): Remove const.
3324 (Output_segment::set_section_list_addresses): Remove const.
3325 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3326 New function.
3327 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3328 New function.
3329 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3330 parameter when calling Add_symbols constructor; store argument
3331 serial number for members of a lib group.
3332 (Add_symbols::locks): Allow case where token == NULL.
3333 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3334 (Read_member::~Read_member): New function.
3335 (Read_member::is_runnable): New function.
3336 (Read_member::locks): New function.
3337 (Read_member::run): New function.
3338 (Check_script::~Check_script): New function.
3339 (Check_script::is_runnable): New function.
3340 (Check_script::locks): New function.
3341 (Check_script::run): New function.
3342 (Check_library::~Check_library): New function.
3343 (Check_library::is_runnable): New function.
3344 (Check_library::locks): New function.
3345 (Check_library::run): New function.
3346 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3347 (Add_symbols::library_): New data member.
3348 (class Read_member): New class.
3349 (class Check_script): New class.
3350 (class Check_library): New class.
3351 * reloc.cc (Read_relocs::is_runnable): Allow case where
3352 token == NULL.
3353 (Read_relocs::locks): Likewise.
3354 (Scan_relocs::locks): Likewise.
3355 (Relocate_task::locks): Likewise.
3356 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3357 to clear counters.
3358 (Sized_relobj::incremental_relocs_scan): Fix comment.
3359 (Sized_relobj::do_relocate): Pass output file offset to
3360 write_local_symbols.
3361 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3362 from class declaration.
3363 * script.cc (read_input_script): Allocate Script_info; pass
3364 argument serial number to report_script.
3365 * script.h (class Script_info): Move to incremental.h.
3366 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3367 * symtab.h (Symbol_table::add_from_incrobj): New function.
3368 (Symbol_table::set_file_offset): New function.
3369
b961d0d7
CC
33702011-04-05 Cary Coutant <ccoutant@google.com>
3371
3372 * incremental-dump.cc (dump_incremental_inputs): Change signature
3373 to take a Sized_incremental_binary; change caller. Use readers
3374 in Sized_incremental_binary.
3375 * incremental.cc
3376 (Sized_incremental_binary::find_incremental_inputs_sections):
3377 Rename do_find_incremental_inputs_sections to this.
3378 (Sized_incremental_binary::setup_readers): New function.
3379 (Sized_incremental_binary::do_check_inputs): Check
3380 has_incremental_info_ flag; move setup code to setup_readers;
3381 use input readers.
3382 (Sized_incremental_binary::do_file_is_unchanged): New function.
3383 (Sized_incremental_binary::do_get_input_reader): New function.
3384 * incremental.h (class Incremental_binary): Move to end of file.
3385 (Incremental_binary::file_is_unchanged): New function.
3386 (Incremental_binary::do_file_is_unchanged): New function.
3387 (Incremental_binary::Input_reader): New class.
3388 (Incremental_binary::get_input_reader): New function.
3389 (class Sized_incremental_binary): Move to end of file.
3390 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3391 input section reader classes.
3392 (Sized_incremental_binary::has_incremental_info): New function.
3393 (Sized_incremental_binary::inputs_reader): New function.
3394 (Sized_incremental_binary::symtab_reader): New function.
3395 (Sized_incremental_binary::relocs_reader): New function.
3396 (Sized_incremental_binary::got_plt_reader): New function.
3397 (Sized_incremental_binary::do_file_is_unchanged): New function.
3398 (Sized_incremental_binary::Sized_input_reader): New class.
3399 (Sized_incremental_binary::get_input_reader): New function.
3400 (Sized_incremental_binary::find_incremental_inputs_sections):
3401 Rename do_find_incremental_inputs_sections to this.
3402 (Sized_incremental_binary::setup_readers): New function.
3403 (Sized_incremental_binary::has_incremental_info_): New data member.
3404 (Sized_incremental_binary::inputs_reader_): New data member.
3405 (Sized_incremental_binary::symtab_reader_): New data member.
3406 (Sized_incremental_binary::relocs_reader_): New data member.
3407 (Sized_incremental_binary::got_plt_reader_): New data member.
3408 (Sized_incremental_binary::current_input_file_): New data member.
3409
a869183f
PP
34102011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3411
3412 PR gold/12640
3413 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3414 violation.
3415
34162011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
3417
3418 * archive.cc (Archive::include_member): Adjust call to report_object.
3419 (Add_archive_symbols::run): Add script_info to call to
3420 report_archive_begin.
3421 (Lib_group::include_member): Adjust call to report_object.
3422 (Add_lib_group_symbols::run): Adjust call to report_object.
3423 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3424 blocks. Add object count for script input files.
3425 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3426 script_info parameter; change all callers.
3427 (Incremental_inputs::report_object): Add script_info parameter;
3428 change all callers.
3429 (Incremental_inputs::report_script): Store backpointer to
3430 incremental info entry.
3431 (Output_section_incremental_inputs::set_final_data_size): Record
3432 additional information for scripts.
3433 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3434 * incremental.h (Incremental_script_entry::add_object): New function.
3435 (Incremental_script_entry::get_object_count): New function.
3436 (Incremental_script_entry::get_object): New function.
3437 (Incremental_script_entry::objects_): New data member; adjust
3438 constructor.
3439 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3440 (Incremental_inputs::report_object): Add script_info parameter.
3441 (Incremental_inputs_reader::get_object_count): New function.
3442 (Incremental_inputs_reader::get_object_offset): New function.
3443 * options.cc (Input_arguments::add_file): Return reference to
3444 new input argument.
3445 * options.h (Input_argument::set_script_info): New function.
3446 (Input_argument::script_info): New function.
3447 (Input_argument::script_info_): New data member; adjust all
3448 constructors.
3449 (Input_file_group::add_file): Return reference to new input argument.
3450 (Input_file_lib::add_file): Likewise.
3451 (Input_arguments::add_file): Likewise.
3452 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3453 * script.cc (Parser_closure::Parser_closure): Add script_info
3454 parameter; adjust all callers.
3455 (Parser_closure::script_info): New function.
3456 (Parser_closure::script_info_): New data member.
3457 (read_input_script): Report scripts earlier to incremental info.
3458 (script_add_file): Set script_info in Input_argument.
3459 (script_add_library): Likewise.
3460 * script.h (Script_options::Script_info): Rewrite class.
3461
a869183f 34622011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
3463
3464 * archive.cc (Library_base::should_include_member): Move
3465 method here from class Archive.
3466 (Archive::Archive): Initialize base class.
3467 (Archive::should_include_member): Move to base class.
3468 (Archive::do_for_all_unused_symbols): New function.
3469 (Add_archive_symbols::run): Remove redundant access to
3470 incremental_inputs.
3471 (Lib_group::Lib_group): Initialize base class.
3472 (Lib_group::do_filename): New function.
3473 (Lib_group::include_member): Pass pointer to Lib_group to
3474 report_object.
3475 (Lib_group::do_for_all_unused_symbols): New function.
3476 (Add_lib_group_symbols::run): Report archive information for
3477 incremental links.
3478 * archive.h (class Library_base): New base class.
3479 (class Archive): Derive from Library_base.
3480 (Archive::filename): Move to base class.
3481 (Archive::set_incremental_info): Likewise.
3482 (Archive::incremental_info): Likewise.
3483 (Archive::Should_include): Likewise.
3484 (Archive::should_include_member): Likewise.
3485 (Archive::Armap_entry): Remove.
3486 (Archive::Unused_symbol_iterator): Remove.
3487 (Archive::unused_symbols_begin): Remove.
3488 (Archive::unused_symbols_end): Remove.
3489 (Archive::do_filename): New function.
3490 (Archive::do_get_mtime): New function.
3491 (Archive::do_for_all_unused_symbols): New function.
3492 (Archive::task_): Move to base class.
3493 (Archive::incremental_info_): Likewise.
3494 (class Lib_group): Derive from Library_base.
3495 (Lib_group::do_filename): New function.
3496 (Lib_group::do_get_mtime): New function.
3497 (Lib_group::do_for_all_unused_symbols): New function.
3498 (Lib_group::task_): Move to base class.
3499 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3500 function.
3501 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3502 function.
3503 * incremental.cc (Incremental_inputs::report_archive_begin):
3504 Use Library_base; call library's get_mtime; add incremental inputs
3505 entry before members.
3506 (class Unused_symbol_visitor): New class.
3507 (Incremental_inputs::report_archive_end): Use Library_base; use
3508 visitor class to record unused symbols; don't add incremental inputs
3509 entry after members.
3510 (Incremental_inputs::report_object): Use Library_base.
3511 * incremental.h
3512 (Incremental_archive_entry::Incremental_archive_entry): Remove
3513 unused Archive parameter.
3514 (Incremental_inputs::report_archive_begin): Use Library_base.
3515 (Incremental_inputs::report_archive_end): Likewise.
3516 (Incremental_inputs::report_object): Likewise.
3517 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3518 function.
3519 * object.h (Object::for_all_global_symbols): New function.
3520 (Object::do_for_all_global_symbols): New function.
3521 (Sized_relobj::do_for_all_global_symbols): New function.
3522 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3523 function.
3524 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3525 function.
3526
61ab3e40
ILT
35272011-03-27 Ian Lance Taylor <iant@google.com>
3528
3529 * archive.cc (Archive::interpret_header): Return -1 if something
3530 goes wrong. Change callers accordingly.
3531
30e1f9e6
CC
35322011-03-25 Cary Coutant <ccoutant@google.com>
3533
3534 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3535 * testsuite/Makefile.in: Regenerate.
3536
9370ce59 35372011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
3538
3539 * plugin.cc (get_view): New.
3540 (Plugin::load): Pass get_view to the plugin.
3541 (Plugin_manager::get_view): New.
3542
9312bb0a
ILT
35432011-03-21 Ian Lance Taylor <iant@google.com>
3544
3545 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 3546 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 3547
7e12ba9e
ST
35482011-03-21 Sriraman Tallam <tmsriram@google.com>
3549
3550 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3551 Change == to -eq.
3552 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3553 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3554 Change == to -eq.
3555 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3556 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3557
fd7a005d
ILT
35582011-03-14 Ian Lance Taylor <iant@google.com>
3559
3560 * script-sections.cc (Sort_output_sections::script_compare):
3561 Rename from is_before, change return type.
3562 (Sort_output_sections::operator()): Adjust accordingly.
3563
ed16fd1b
ILT
35642011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3565
3566 PR gold/12572
3567 * testsuite/odr_violation2.cc: Add comment to make all error line
3568 numbers double digits.
3569 * testsuite/debug_msg.sh: Adjust expected errors.
3570
71ff8986
ILT
35712011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3572
3573 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3574 but mark earlier ones as non-canonical
3575 (offset_to_iterator): Update search target and example
3576 (do_addr2line): Return extra lines in a vector*
3577 (format_file_lineno): Extract from do_addr2line
3578 (one_addr2line): Add vector* out-param
3579 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3580 when a lineno entry appeared last for its instruction
3581 (Dwarf_line_info): Add vector* out-param
3582 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3583 * symtab.cc (Odr_violation_compare): Include the lineno in the
3584 comparison again.
3585 (linenos_from_loc): New. Combine the canonical line for an
3586 address with its other lines.
3587 (True_if_intersect): New. Helper functor to make
3588 std::set_intersection a query.
3589 (detect_odr_violations): Compare sets of lines instead of just
3590 one line for each function. This became less deterministic, but
3591 has fewer false positives.
3592 * symtab.h: Declarations.
3593 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3594 mix an optimized and non-optimized object in the same binary
3595 (odr_violation2.so): Same.
3596 * testsuite/Makefile.in: Regenerate from Makefile.am.
3597 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3598 * testsuite/debug_msg.sh: Update line numbers and add
3599 assertions.
3600 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3601 non-optimized context.
3602 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3603 isn't inlined, and use OdrDerived in an optimized context.
3604 * testsuite/odr_header1.h: Defines OdrDerived, where
3605 optimization will change the
3606 first-instruction-in-the-destructor's file and line number.
3607 * testsuite/odr_header2.h: Defines OdrBase.
3608
a19fefdc
ILT
36092011-03-09 Ian Lance Taylor <iant@google.com>
3610
3611 * fileread.cc (File_read::clear_views): Don't delete the whole
3612 file view.
3613
ecb351e9
ILT
36142011-03-08 Ian Lance Taylor <iant@google.com>
3615
3616 PR gold/12525
3617 * fileread.cc: #include <climits>.
3618 (GOLD_IOV_MAX): Define.
3619 (File_read::read_multiple): Limit number of entries by iov_max.
3620 * fileread.h (class File_read): Always set max_readv_entries to
3621 128.
3622
b821d13c
ILT
36232011-03-07 Ian Lance Taylor <iant@google.com>
3624
3625 PR gold/12525
3626 * options.h (class General_options): Add -dy and -dn.
3627
89243142
CC
36282011-03-02 Cary Coutant <ccoutant@google.com>
3629
3630 * testsuite/script_test_9.t: Add TLS segment.
3631
d0773f31
ILT
36322011-03-02 Simon Baldwin <simonb@google.com>
3633
3634 * configure.ac: Add check for gnu_indirect_function support in
3635 the toolchain building binutils.
3636 * configure: Rebuild.
3637
9370ce59 36382011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
3639
3640 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3641 plugin only symbols.
3642 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3643 in plugin files as not needed in the symbol table.
3644
4cf7a849
ST
36452011-02-11 Sriraman Tallam <tmsriram@google.com>
3646
3647 * output.cc (Output_section::add_input_section): Delay fill
3648 generation for section ordering.
3649
b578bd7d
ILT
36502011-02-09 Ian Lance Taylor <iant@google.com>
3651
3652 PR gold/12316
3653 * object.h (class Sized_relobj): Remove clear_local_symbols.
3654 * reloc.cc (Sized_relobj::do_relocate): Don't call
3655 clear_local_symbols.
3656
9370ce59 36572011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
3658
3659 * plugin.cc (is_visible_from_outside): Return true for symbols
3660 in the -u option.
3661
55382fb7
ILT
36622011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3663
3664 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3665 filename.
3666
4e271fff
ST
36672011-02-02 Sriraman Tallam <tmsriram@google.com>
3668
3669 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 3670 to std::string.
4e271fff 3671 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 3672 section_name to be std::string.
4e271fff
ST
3673 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3674
d433c3ac
ILT
36752011-01-25 Ian Lance Taylor <iant@google.com>
3676
3677 * script.cc (script_add_extern): Rewrite to use
3678 add_symbol_reference.
3679
880473a6
DK
36802011-01-25 Doug Kwan <dougkwan@google.com>
3681
d433c3ac 3682 * icf.cc (get_section_contents): Always lock section's object.
880473a6 3683
f30f86fa
ILT
36842011-01-24 Ian Lance Taylor <iant@google.com>
3685
3686 * options.h (class General_options): Accept
3687 --no-detect-odr-violations.
3688
8e51a0b9
ILT
36892011-01-24 Ian Lance Taylor <iant@google.com>
3690
3691 * version.cc (version_string): Bump to 1.11.
3692
0f3b89d8
ILT
36932011-01-24 Ian Lance Taylor <iant@google.com>
3694
3695 * plugin.cc (class Plugin_rescan): Define new class.
3696 (Plugin_manager::claim_file): Set any_claimed_.
3697 (Plugin_manager::save_archive): New function.
3698 (Plugin_manager::save_input_group): New function.
3699 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3700 necessary.
3701 (Plugin_manager::new_undefined_symbol): New function.
3702 (Plugin_manager::rescan): New function.
3703 (Plugin_manager::rescannable_defines): New function.
3704 (Plugin_manager::add_input_file): Set any_added_.
3705 * plugin.h (class Plugin_manager): define new fields rescannable_,
3706 undefined_symbols_, any_claimed_, and any_added_. Declare
3707 Plugin_rescan as friend. Declare new functions.
3708 (Plugin_manager::Rescannable): Define type.
3709 (Plugin_manager::Rescannable_list): Define type.
3710 (Plugin_manager::Undefined_symbol_list): Define type.
3711 (Plugin_manager::Plugin_manager): Initialize new fields.
3712 * archive.cc (Archive::defines_symbol): New function.
3713 (Add_archive_symbols::run): Pass archive to plugins if any.
3714 * archive.h (class Archive): Declare defines_symbol.
3715 * readsyms.cc (Input_group::~Input_group): New function.
3716 (Finish_group::run): Pass input_group to plugins if any.
3717 * readsyms.h (class Input_group): Declare destructor.
3718 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3719 any.
3720
3bb951e5
ILT
37212011-01-10 Ian Lance Taylor <iant@google.com>
3722
3723 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3724 section as relro.
3725 (Layout::set_segment_offsets): Reset increase_relro before calling
3726 set_section_addresses a second time.
3727
0aa45fac
CC
37282011-01-04 Cary Coutant <ccoutant@google.com>
3729
3730 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3731 sections before NOBITS sections.
3732
0db46eb4
L
37332011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3734
3735 * version.cc (print_version): Update copyright to 2011.
3736
829c9745
CC
37372010-12-23 Cary Coutant <ccoutant@google.com>
3738
3739 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3740 of OS to this->add. Add OD parameter to second form of the function.
3741
7500420b
ILT
37422010-12-20 Ian Lance Taylor <iant@google.com>
3743
3744 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3745 second of two consecutive entries with same offset.
3746
f8e9a930
RW
37472010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3748
3749 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3750 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3751 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3752 to avoid unneeded links against $(LDADD).
3753 * testsuite/Makefile.in: Regenerate.
3754
2fbb4320
ILT
37552010-12-15 Ian Lance Taylor <iant@google.com>
3756
3757 PR gold/12324
3758 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3759 for R_X86_64_32 and R_X86_64_PC32.
3760 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3761 ver_matching_def_pic.o.
3762 (ver_matching_def_pic.o): New target.
3763
fedb228d
RW
37642010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3765
3766 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3767 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3768 Move definition before File_read::View member definitions.
3769 (File_read::View::~View): Initialize and hold lock before
3770 updating current_mapped_bytes.
3771
9b547ce6
RW
37722010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3773
3774 * dwarf_reader.cc: Remove outdated comment.
3775 * gold-threads.cc: Fix typo in error message.
3776 * archive.cc: Fix typos in comments.
3777 * archive.h: Likewise.
3778 * arm-reloc-property.cc: Likewise.
3779 * arm-reloc-property.h: Likewise.
3780 * arm-reloc.def: Likewise.
3781 * arm.cc: Likewise.
3782 * attributes.h: Likewise.
3783 * cref.cc: Likewise.
3784 * ehframe.cc: Likewise.
3785 * fileread.h: Likewise.
3786 * gold.h: Likewise.
3787 * i386.cc: Likewise.
3788 * icf.cc: Likewise.
3789 * incremental.h: Likewise.
3790 * int_encoding.cc: Likewise.
3791 * layout.h: Likewise.
3792 * main.cc: Likewise.
3793 * merge.h: Likewise.
3794 * object.cc: Likewise.
3795 * object.h: Likewise.
3796 * options.cc: Likewise.
3797 * readsyms.cc: Likewise.
3798 * reduced_debug_output.cc: Likewise.
3799 * reloc.cc: Likewise.
3800 * script-sections.cc: Likewise.
3801 * sparc.cc: Likewise.
3802 * symtab.h: Likewise.
3803 * target-reloc.h: Likewise.
3804 * target.cc: Likewise.
3805 * target.h: Likewise.
3806 * timer.cc: Likewise.
3807 * timer.h: Likewise.
3808 * x86_64.cc: Likewise.
3809
83e17bd5
CC
38102010-12-09 Cary Coutant <ccoutant@google.com>
3811
3812 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3813 stack.
3814 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3815 parameter; change all callers.
3816 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3817 * options.h (warn_execstack): New option.
3818
017257f8
DK
38192010-12-07 Doug Kwan <dougkwan@google.com>
3820
3821 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3822 like function call relocations.
3823
c20cbc06
ILT
38242010-12-07 Ian Lance Taylor <iant@google.com>
3825
3826 * archive.cc (Archive::get_elf_object_for_member): Permit
3827 punconfigured to be NULL.
3828 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3829 (Archive::include_member): Pass NULL to get_elf_object_for_member
3830 if we searched for the archive and this is the first included
3831 object.
3832
4dbfafcc
ILT
38332010-12-01 Ian Lance Taylor <iant@google.com>
3834
3835 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3836 track_relocs_type_ field.
3837 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3838 Set track_relocs_type_.
3839 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3840 contents when using RELA relocs.
3841 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3842 reloc_map_.
3843 * reloc.cc (Track_relocs::next_addend): New function.
3844 * reloc.h (class Track_relocs): Declare next_addend.
3845
e5e19edd
ILT
38462010-12-01 Ian Lance Taylor <iant@google.com>
3847
3848 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3849 virtual destructor.
3850
9a5ce24c
ILT
38512010-12-01 Ian Lance Taylor <iant@google.com>
3852
3853 * README: Update compilers known to work and fail.
3854
c7791212
NC
38552010-11-23 Matthias Klose <doko@ubuntu.com>
3856
3857 * configure.in: For --enable-gold, handle value `default' instead of
3858 `both*'. Always install ld as ld.bfd, install as ld if gold is
3859 not the default.
3860 * configure: Regenerate.
3861
0ad220c9
DK
38622010-11-18 Doug Kwan <dougkwan@google.com>
3863
3864 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3865 and right_alignment to be zero. Store result alignment only if it is
3866 greater than existing alignment.
3867
ab8056e0
CC
38682010-11-16 Cary Coutant <ccoutant@google.com>
3869
3870 PR gold/12220
3871 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3872 Check for ".zdebug_line".
3873
fd064a5b
CC
38742010-11-16 Doug Kwan <dougkwan@google.com>
3875 Cary Coutant <ccoutant@google.com>
3876
3877 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3878 by reference; adjust all callers.
3879 * output.cc (Output_segment::set_section_addresses): Adjust references
3880 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3881 list is empty.
3882 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3883 end at page boundary.
3884
6fc6ea19
CC
38852010-11-16 Cary Coutant <ccoutant@google.com>
3886
3887 PR gold/12220
3888 * layout.cc (Layout::choose_output_section): Transform names of
3889 compressed sections even when using a script with a SECTIONS clause.
3890 (Layout::output_section_name): Remove code to transform
3891 compressed debug section names.
3892 * output.cc (Output_section::add_input_section): Use uncompressed
3893 section size when tracking input sections.
3894
95a2c8d6
RS
38952010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3896
3897 * symtab.h (Symbol::NON_PIC_REF): Remove.
3898 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3899 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3900 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3901 (Symbol::use_plt_offset): Take a flags argument and pass it
3902 directly to needs_dynamic_reloc. Restrict check for undefined
3903 weak symbols to function calls.
3904 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3905 (Target_arm::Scan::global): Use it.
3906 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3907 (Target_arm::Relocate::relocate): Likewise.
3908 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3909 parameter with an r_type parameter. Use get_reference_flags
3910 to get the flags.
3911 (Target_arm::Relocate::relocate): Update accordingly.
3912 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3913 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3914 (Target_i386::Scan::global): Likewise.
3915 (Target_i386::Relocate::relocate): Likewise.
3916 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3917 parameter with an r_type parameter. Use get_reference_flags
3918 to get the flags.
3919 (Target_i386::Relocate::relocate): Update accordingly.
3920 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3921 (Target_powerpc::Scan::global): Use it.
3922 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3923 (Target_powerpc::Relocate::relocate): Likewise.
3924 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3925 (Target_sparc::Scan::global): Use it.
3926 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3927 (Target_sparc::Relocate::relocate): Likewise.
3928 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3929 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3930 (Target_x86_64::Scan::global): Likewise.
3931 (Target_x86_64::Relocate::relocate): Likewise.
3932
f625ae50
DK
39332010-11-08 Doug Kwan <dougkwan@google.com>
3934 Cary Coutant <ccoutant@google.com>
3935
3936 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3937 (Arm_exidx_merge_section::section_contents_): New data member.
3938 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3939 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 3940 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
3941 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3942 in parameters instead of calling Object::section_contents without
3943 locking.
3944 (Arm_output_section::group_section): New parameter TASK. Pass it
3945 to callees that need locking objects.
3946 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3947 to lock EXIDX input sections. Fix a formatting issue. Call
3948 Arm_exidx_merged_section::build_contents to create merged section
3949 contents.
3950 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3951 to lock object of stub table owner.
3952 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3953 TEXT_SIZE to initialize data member TEXT_SIZE_.
3954 (Arm_exidx_input_section::addralign): Fix typo in comment.
3955 (Arm_exidx_input_section::text_size): New method.
3956 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3957 that require locking objects. Lock objects before scanning for stubs
3958 and updating local symbols.
3959 (Arm_input_section<big_endian>::init): Copy contents of original
3960 input section.
2e702c99 3961 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
3962 original input section instead of calling Object::section_contents
3963 without locking.
3964 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3965 size without calling Object::section_size().
3966 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3967 for size. Allocate a buffer for merged EXIDX entries.
3968 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 3969 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
3970 building code to Arm_exidx_merged_section::build_contetns. Write
3971 out contetns in buffer instead of building it on the fly.
3972 (Arm_relobj::make_exidx_input_section): Also pass text section size
3973 to Arm_exidx_input_section constructor.
3974 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3975 (Arm_dynobj::do_read_symbols): Fix memory leak.
3976 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3977 * target.h: (class Task): Add forward declaration.
3978 (Target::relax): Add new parameter TASK and pass it to
3979 Target::do_relax().
3980 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3981
5f9bcf58
CC
39822010-11-05 Cary Coutant <ccoutant@google.com>
3983
3984 PR gold/10708
3985 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3986 object when reading from the file.
3987 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3988 second layout pass.
3989 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3990 when reading section contents.
3991 (get_section_contents): Likewise.
3992 (icf::find_identical_sections): Likewise.
3993 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3994 object when reading from the file.
3995 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3996 the object when doing deferred section layout.
3997
e597fa08
NC
39982010-11-03 Nick Clifton <nickc@redhat.com>
3999
4000 PR gold/12001
4001 * script.h (class Symbol_assignment: name): New member. Returns
4002 the name of the symbol.
4003 * scrfipt.cc (Script_options::is_pending_assignment): New member.
4004 Returns true if the given symbol name is on the list of
4005 assignments wating to be processed.
4006 * archive.cc (should_incldue_member): If the symbol is undefined,
4007 check to see if it is on the list of symbols pending assignment.
4008
3f9a3278
ILT
40092010-11-03 Ryan Mansfield <rmansfield@qnx.com>
4010
4011 * script-sections.cc (Script_sections::find_memory_region): Check
4012 for a NULL output section pointer.
4013
d06fb4d1
DK
40142010-10-29 Doug Kwan <dougkwan@google.com>
4015
4016 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
4017 Output_section::add_relaxed_input_section.
4018 * output.cc (Output_section::add_relaxed_input_section): Add new
4019 arguments LAYOUT and NAME. Set section order index.
4020 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4021 Copy section order index.
4022 * output.h (Output_section::add_relaxed_input_section): Add new
4023 arguments LAYOUT and NAME.
4024
90e24de5
ILT
40252010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4026
4027 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 4028 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
4029 * testsuite/Makefile.in: Regenerate.
4030
c9484ea5
DK
40312010-10-20 Doug Kwan <dougkwan@google.com>
4032
4033 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
4034 without SHF_LINK_ORDER flags.
4035 * layout.cc (Layout::choose_output_section): Do not filter
4036 SHF_LINK_ORDER flag in a relocatable link.
4037
5bc2f5be
CC
40382010-10-17 Cary Coutant <ccoutant@google.com>
4039
4040 * output.h (Output_segment::set_section_addresses): Change function
4041 signature. Update all callers.
4042 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4043 sections.
4044 (Output_segment::set_section_addresses): Align after last TLS
4045 section. Add padding before last relro section instead of after.
4046
0c91cf04
DK
40472010-10-17 Doug Kwan <dougkwan@google.com>
4048
4049 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4050 GOT output section to be writable.
4051
8c21d9d3
CC
40522010-10-14 Cary Coutant <ccoutant@google.com>
4053
4054 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
4055 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4056 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4057 mode.
4058 * incremental.cc (report_command_line): Ignore all forms of
4059 --incremental.
4060 * layout.cc (Layout::Layout): Check parameters for incremental link
4061 mode.
4062 * options.cc (General_options::parse_incremental): New function.
4063 (General_options::parse_no_incremental): New function.
4064 (General_options::parse_incremental_full): New function.
4065 (General_options::parse_incremental_update): New function.
4066 (General_options::incremental_mode_): New data member.
4067 (General_options::finalize): Check incremental_mode_.
4068 * options.h (General_options): Update help text for --incremental.
4069 Add --no-incremental, --incremental-full, --incremental-update.
4070 (General_options::Incremental_mode): New enum type.
4071 (General_options::incremental_mode): New function.
4072 (General_options::incremental_mode_): New data member.
4073 * parameters.cc (Parameters::incremental_mode_): New data member.
4074 (Parameters::set_options): Set incremental_mode_.
4075 (Parameters::set_incremental_full): New function.
4076 (Parameters::incremental): New function.
4077 (Parameters::incremental_update): New function.
4078 (set_parameters_incremental_full): New function.
4079 * parameters.h (Parameters::set_incremental_full): New function.
4080 (Parameters::incremental): New function.
4081 (Parameters::incremental_update): New function.
4082 (Parameters::incremental_mode_): New data member.
4083 (set_parameters_incremental_full): New function.
4084 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4085 incremental link mode.
4086 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4087 (Sized_relobj::do_relocate_sections): Likewise.
4088 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4089 option.
4090 * testsuite/Makefile.in: Regenerate.
4091 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 4092
bb32aa18 40932010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
4094
4095 * script-sections.h (class Script_sections): Make
4096 Sections_elements typedef public.
4097 * script-sections.cc (class Sort_output_sections): Add elements_
4098 field. Add constructor which sets it; change all callers.
4099 (Sort_output_sections::is_before): New function.
4100 (Sort_output_sections::operator()): Call is_before.
4101 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4102 conditional.
4103 * testsuite/script_test_10.sh: New test. Test script section
4104 order.
4105 * testsuite/script_test_10.t: Likewise.
4106 * testsuite/script_test_10.s: Likewise.
4107 * testsuite/Makefile.am: Wrap the cross linker tests and the
4108 common tests into NATIVE_OR_CROSS_LINKER.
4109 (check_SCRIPTS): Add script_test_10.sh.
4110 (check_DATA): Add script_test_10.stdout.
4111 (script_test_10.o, script_test_10): New targets.
4112 (script_test_10.stdout): New target.
4113 * configure, testsuite/Makefile.in: Regenerate.
4114
3cef7179
ILT
41152010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4116
4117 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4118 error for the deprecated relocations.
4119 (Target_arm::Scan::global): Likewise.
4120 (Target_arm::Relocate::relocate): Likewise.
4121
7411e9a8
RS
41222010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4123
4124 * fileread.cc (Input_file::find_file): Initialize *found_name
4125 and *namep when using the fallback search for case 4.
4126
6a9da32a
CC
41272010-10-11 Cary Coutant <ccoutant@google.com>
4128
4129 * options.h (class General_options): Redefine -z lazy as an alias for
4130 the negation of -z now.
4131
ac897c20
ILT
41322010-10-11 Ian Lance Taylor <iant@google.com>
4133
4134 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4135 binding.
4136
ea5cae92
NC
41372010-10-06 Nick Clifton <nickc@redhat.com>
4138
4139 * script-sections.cc(class Memory_region): Remove
4140 current_lma_offset_ field. Rename current_vma_offset_ to
4141 current_offset_. Add last_section_ field.
4142 (Memory_region::get_current_vma_address): Rename to
4143 get_current_address.
4144 (Memory_region::get_current_lma_address): Delete.
4145 (Memory_region::increment_vma_offset): Rename to
4146 increment_offset.
4147 (Memory_region::increment_lma_offset): Delete.
4148 (Memory_region::attributes_compatible): New method. Returns
4149 true if the provided section is compatible with the region.
4150 (Memory_region::get_last_section): New method. Returns the last
4151 section to use the region.
4152 (Memory_region::set_last_section): New method. Stores the last
4153 section to use the region.
4154 (Script_sections::block_in_region): New method. Returns true if
4155 a block of memory is contained within a region.
4156 (Script_sections::find_memory_region): New method. Locates a
4157 memory region to be used to set a VMA or LMA address.
4158 (Output_section_definition::set_section_addresses): Add code to
4159 check for addresses set by memory regions.
4160 (Output_segment::set_section_addresses): Remove memory region
4161 walking code.
4162 (Script_sections::create_segment): Add a warning if a header
4163 segment is created outside of any region.
4164 * script-sections.h (class Script_sections): Add prototypes for
4165 find_memory_region and block_in_region methods.
4166 * testsuite/memory_test.s: Use .long instead of .word.
4167 * testsuite/memory_test.t: Add some more output sections.
4168 * testsuite/memory_test.sh: Update expected output.
4169
a9bfd952
DK
41702010-10-02 Doug Kwan <dougkwan@google.com>
4171
4172 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4173 defintion to symtab.h
4174 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4175 declaration to defintion.
4176
bacff3ab
NC
41772010-10-01 Nick Clifton <nickc@redhat.com>
4178
4179 * expression.cc (eval): Replace dummy argument with NULL.
4180 (eval_maybe_dot): Check for a NULL result section pointer.
4181 (Symbol_expression::value): Likewise.
4182 (Dot_expression::value): Likewise.
4183 (BINARY_EXPRESSION): Likewise.
4184 (Max_expression::value): Likewise.
4185 (Min_expression::value): Likewise.
4186 (Absolute_expression::value): Likewise.
4187 (Addr_expression::value_from_output_section): Likewise.
4188 (Loaddddr_expression::value_from_output_section): Likewise.
4189 (Segment_start_expression::value): Likewise.
4190 * script-sections.cc
4191 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4192 argument with NULL.
4193 (Sections_elememt_dot_assignment::set_section_addresses):
4194 Likewise.
4195 (Output_data_expression::do_write_to_buffer): Likewise.
4196 (Output_section_definition::finalize_symbols): Likewise.
4197 (Output_section_definition::set_section_addresses): Likewise.
4198
f81bc8b5
DK
41992010-09-30 Doug Kwan <dougkwan@google.com>
4200
4201 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4202
c95e9f27
ST
42032010-09-28 Sriraman Tallam <tmsriram@google.com>
4204
4205 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 4206 function.
c95e9f27
ST
4207 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4208 virtual function.
4209 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4210 virtual function.
4211 * icf.cc (get_section_contents): Inline merge sections only when
4212 target allows it.
4213
3cac54d2
RW
42142010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4215
4216 * configure: Regenerate.
4217
2904037a
ILT
42182010-09-17 Ian Lance Taylor <iant@google.com>
4219
4220 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
4221 * testsuite/Makefile.am (memory_test.o): New target.
4222 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4223 memory_test.t.
4224 * testsuite/Makefile.in: Rebuild.
2904037a 4225
bca7fb63
DK
42262010-09-17 Doug Kwan <dougkwan@google.com>
4227
4228 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4229 defintion if relocation uses GOT entries of the symbol.
4230 * testsuite/icf_safe_test.sh: Fix test.
4231 * testsuite/icf_safe_so_test.sh: Fix test.
4232
4ef28648
CC
42332010-09-16 Cary Coutant <ccoutant@google.com>
4234
4235 * script_sections.cc (class Memory_region): Remove "NULL" from
4236 vector initializations.
4237
793990de
CC
42382010-09-15 Cary Coutant <ccoutant@google.com>
4239
4240 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4241 Resolve forwarding symbols.
4242
81e015e2
DK
42432010-09-15 Doug Kwan <dougkwan@google.com>
4244
4245 * gold/testsuite/script_test_3.t: Add ARM special sections.
4246 * gold/testsuite/script_test_4.t: Same.
4247 * gold/testsuite/script_test_5.t: Same.
4248 * gold/testsuite/script_test_6.t: Same.
4249 * gold/testsuite/script_test_7.t: Same.
4250 * gold/testsuite/script_test_7.t: Same.
4251 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4252
36171d64
CC
42532010-09-14 Cary Coutant <ccoutant@google.com>
4254
4255 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4256 (Target_x86_64::Relocate::relocate_tls): Replace check for
4257 saw_tls_block_reloc_ with test for executable section.
4258
d89051bd
CC
42592010-09-12 Cary Coutant <ccoutant@google.com>
4260
4261 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4262 position-independent executables to shared libraries need dynamic
4263 relocations.
4264 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4265 position-independent executables.
4266 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4267 * testsuite/Makefile.in: Regenerate.
4268
fca41f0f
NC
42692010-09-10 Nick Clifton <nickc@redhat.com>
4270
4271 PR gold/11997
4272 * testsuite/memory_test.t: Discard any sections that are not
4273 needed.
4274
6695e4b3
L
42752010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4276
4277 PR gold/11996
4278 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4279 "This::" to work around a bug in gcc 4.2.
4280
4281 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4282
0f72bf6f
RÁE
42832010-09-09 Rafael Espindola <espindola@google.com>
4284
4285 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4286 sections with different PF_X flags in the same segment.
4287 (Layout::find_first_load_seg): Search all segments to find the first
4288 one.
4289 * options.h (rosegment): New.
4290
42912010-09-08 Rafael Espindola <espindola@google.com>
a6577478 4292
05a79166 4293 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 4294
aa98ff75
DK
42952010-09-08 Doug Kwan <dougkwan@google.com>
4296
4297 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4298 (Arm_relobj::do_relocate_sections): Add new parameter for output
4299 file to match the parent.
4300 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4301 of local symbols instead of input values. Update code to track
4302 changes in gold::relocate_section.
4303 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4304 (Sized_relobj::compute_final_local_value_internal): New methods.
4305 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4306 body into private version of Sized_relobj::compute_final_local_value.
4307 Call the inline method.
4308 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4309 merged symbol value if there is one.
4310 (Symbol_value::has_output_value): New method defintiion.
4311 (Sized_relobj::Compute_final_local_value_status): New enum type.
4312 (Sized_relobj::compute_final_local_value): New methods.
4313 (Sized_relobj::compute_final_local_value_internal): New methods.
4314 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4315 and arm_cortex_a8.sh.
4316 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4317 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4318 New tests.
4319 * Makefile.in: Regenerate.
4320 * testsuite/arm_bl_out_of_range.s: Update test.
4321 * testsuite/thumb_bl_out_of_range.s: Ditto.
4322 * testsuite/thumb_blx_out_of_range.s: Ditto.
4323 * testsuite/arm_branch_out_of_range.sh: New file.
4324 * testsuite/arm_cortex_a8.sh: Ditto.
4325 * testsuite/arm_cortex_a8_b.s: Ditto.
4326 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4327 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4328 * testsuite/arm_cortex_a8_bl.s: Ditto.
4329 * testsuite/arm_cortex_a8_blx.s: Ditto.
4330 * testsuite/arm_cortex_a8_local.s: Ditto.
4331 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4332 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4333
05a79166
L
43342010-09-08 Rafael Espindola <espindola@google.com>
4335
4336 * Makefile.am (memory_test.stdout): Run readelf with -W.
4337 * Makefile.in: Regenerate.
4338 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4339 64 bit output.
4340
33dbc701
RÁE
43412010-09-08 Rafael Espindola <espindola@google.com>
4342
4343 * script-sections.cc (Script_sections::add_memory_region): Convert
4344 field precision to int.
4345 * script.cc (script_set_section_region, script_set_section_region):
4346 Convert field precision to int.
4347
731ca54a
RÁE
43482010-09-08 Rafael Espindola <espindola@google.com>
4349
4350 * arm.cc (do_finalize_sections): Create the __exidx_start and
4351 __exdix_end symbols even when the section is missing.
4352
7f8cd844
NC
43532010-09-08 Nick Clifton <nickc@redhat.com>
4354
4355 * README: Remove claim that MEMORY is not supported.
4356 * expression.cc (script_exp_function_origin)
4357 (script_exp_function_length): Move from here to ...
4358 * script.cc: ... here.
4359 (script_set_section_region, script_add_memory)
4360 (script_parse_memory_attr, script_include_directive): New
4361 functions.
4362 * script-sections.cc
4363 (class Memory_region): New class.
4364 (class Output_section_definition): Add set_memory_region,
4365 set_section_vma, set_section_lma and get_section_name methods.
4366 (class Script_Sections): Add add_memory_region,
4367 find_memory_region, find_memory_region_origin,
4368 find_memory_region_length and set_memory_region methods.
4369 Have set_section_addresses method walk the list of set memory
4370 regions.
4371 Extend the print methos to display memory regions.
4372 * script-sections.h: Add prototypes for new methods.
4373 Add enum for MEMORY region attributes.
4374 * yyscript.y: Add support for parsing MEMORY regions.
4375 * script-c.h: Add prototypes for new functions.
4376 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4377 * testsuite/Makefile.in: Regenerate.
4378 * testsuite/memory_test.sh: New script.
4379 * testsuite/memory_test.s: New assembler source file.
4380 * testsuite/memory_test.t: New linker script.
4381
a4649286
DK
43822010-08-27 Doug Kwan <dougkwan@google.com>
4383
4384 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4385 reference override an existing dynamic weak reference.
4386 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4387 * testsuite/Makefile.in: Regenerate.
4388 * testsuite/dyn_weak_ref.sh: New file.
4389 * testsuite/dyn_weak_ref_1.c: Ditto.
4390 * testsuite/dyn_weak_ref_2.c: Ditto.
4391
b56648ad
ILT
43922010-08-27 Ian Lance Taylor <iant@google.com>
4393
4394 * incremental.h (class Incremental_input_entry): Add virtual
4395 destructor.
4396
809313cb
ILT
43972010-08-27 Ian Lance Taylor <iant@google.com>
4398
4399 * testsuite/start_lib_test_3.c: Mark t3 as used.
4400
11e32464
NC
44012010-08-27 Nick Clifton <nickc@redhat.com>
4402
4403 * options.cc (version_script): Fix small typo in previous
4404 whitespace tidyup.
4405
ca09d69a
NC
44062010-08-25 Nick Clifton <nickc@redhat.com>
4407
4408 * archive.cc: Formatting fixes: Remove whitespace between
4409 typename and following asterisk. Remove whitespace between
4410 function name and opening parenthesis.
4411 * archive.h: Likewise.
4412 * arm.cc: Likewise.
4413 * attributes.cc: Likewise.
4414 * attributes.h: Likewise.
4415 * common.cc: Likewise.
4416 * copy-relocs.cc: Likewise.
4417 * dirsearch.h: Likewise.
4418 * dynobj.cc: Likewise.
4419 * ehframe.cc: Likewise.
4420 * ehframe.h: Likewise.
4421 * expression.cc: Likewise.
4422 * fileread.cc: Likewise.
4423 * fileread.h: Likewise.
4424 * gc.h: Likewise.
4425 * gold-threads.cc: Likewise.
4426 * gold.cc: Likewise.
4427 * i386.cc: Likewise.
4428 * icf.h: Likewise.
4429 * incremental-dump.cc: Likewise.
4430 * incremental.cc: Likewise.
4431 * layout.cc: Likewise.
4432 * layout.h: Likewise.
4433 * main.cc: Likewise.
4434 * merge.cc: Likewise.
4435 * merge.h: Likewise.
4436 * object.cc: Likewise.
4437 * object.h: Likewise.
4438 * options.cc: Likewise.
4439 * options.h: Likewise.
4440 * output.cc: Likewise.
4441 * output.h: Likewise.
4442 * plugin.cc: Likewise.
4443 * plugin.h: Likewise.
4444 * powerpc.cc: Likewise.
4445 * reloc.cc: Likewise.
4446 * script-c.h: Likewise.
4447 * script-sections.cc: Likewise.
4448 * script.cc: Likewise.
4449 * stringpool.cc: Likewise.
4450 * symtab.cc: Likewise.
4451 * symtab.h: Likewise.
4452 * target.cc: Likewise.
4453 * timer.cc: Likewise.
4454 * timer.h: Likewise.
4455 * version.cc: Likewise.
4456 * x86_64.cc: Likewise.
4457
b8fa8750
NC
44582010-08-24 Nick Clifton <nickc@redhat.com>
4459
4460 PR 11899
4461 * layout.cc (segment_precedes): Sort segments by their physical
4462 addresses, if they have been set.
4463
9919d93b
CC
44642010-08-23 Cary Coutant <ccoutant@google.com>
4465
4466 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4467 symbols data.
4468 (Lib_group::include_member): Unlock object after deleting its
4469 symbols data.
4470 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4471 the bug fixed here.
4472
97b4be1c
CC
44732010-08-19 Neil Vachharajani <nvachhar@google.com>
4474 Cary Coutant <ccoutant@google.com>
4475
4476 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4477 constructor, and set_blocker.
4478 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4479 readsyms_blocker_.
4480 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4481 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4482 * testsuite/Makefile.am (start_lib_test): New test case.
4483 * testsuite/Makefile.in: Regenerate.
4484 * testsuite/start_lib_test_main.c: New file.
4485 * testsuite/start_lib_test_1.c: New file.
4486 * testsuite/start_lib_test_2.c: New file.
4487 * testsuite/start_lib_test_3.c: New file.
4488
dd0b1884
ILT
44892010-08-19 Ian Lance Taylor <iant@google.com>
4490
4491 * Makefile.in: Rebuild with automake 1.11.1.
4492 * aclocal.m4: Likewise.
4493 * testsuite/Makefile.in: Likewise.
4494
7223e9ca
ILT
44952010-08-19 Ian Lance Taylor <iant@google.com>
4496
4497 PR 10893
4498 * i386.cc (class Output_data_plt_i386): Update declarations.
4499 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4500 local_ifuncs_ fields.
4501 (Target_i386::do_plt_section_for_global): New function.
4502 (Target_i386::do_plt_section_for_local): New function.
4503 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4504 parameter; change all callers. Initialize global_ifuncs_ and
4505 local_ifuncs_. If doing a static link define __rel_iplt_start and
4506 __rel_iplt_end.
4507 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4508 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4509 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4510 symbols.
4511 (Target_i386::make_plt_section): New function, broken out of
4512 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4513 (Target_i386::make_plt_entry): Call make_plt_section.
4514 (Target_i386::make_local_ifunc_plt_entry): New function.
4515 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4516 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4517 R_386_IRELATIVE to switch.
4518 (Target_i386::Scan::global): Likewise.
4519 (Target_i386::Relocate::relocate): Likewise.
4520 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4521 switch.
4522 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4523 (Target_x86_64::do_plt_section_for_global): New function.
4524 (Target_x86_64::do_plt_section_for_local): New function.
4525 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4526 parameter; change all callers. If doing a static link define
4527 __rela_iplt_start and __rela_iplt_end.
4528 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4529 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4530 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4531 to point to .plt.
4532 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4533 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4534 switch.
4535 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4536 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4537 R_X86_64_IRELATIVE to switch.
4538 (Target_x86_64::Scan::global): Likewise.
4539 (Target_x86_64::Relocate::relocate): Likewise.
4540 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4541 switch.
4542 * target.h (class Target): Add plt_section_for_global and
4543 plt_section_for_local functions. Add do_plt_section_for_global
4544 and do_plt_section_for_local virtual functions.
4545 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4546 clarifying comments.
4547 (Symbol::use_plt_offset): Handle IFUNC symbol.
4548 * object.cc (Sized_relobj::Sized_relobj): Initialize
4549 local_plt_offsets_.
4550 (Sized_relobj::local_has_plt_offset): New function.
4551 (Sized_relobj::local_plt_offset): New function.
4552 (Sized_relobj::set_local_plt_offset): New function.
4553 (Sized_relobj::do_count): Handle IFUNC symbol.
4554 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4555 a bit away from input_shndx_ field. Add set_is_func_symbol and
4556 is_ifunc_symbol functions.
4557 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4558 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4559 local_plt_offsets_ field.
4560 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4561 * output.h (class Output_section_data): Add non-const
4562 output_section function.
4563 (class Output_data_got): Update declarations.
4564 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4565 Add use_plt_offset parameter to global and local constructors.
4566 Change all callers. Change local_sym_index_ field to 31 bits.
4567 Change GSYM_CODE and CONSTANT_CODE accordingly.
4568 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4569 doing a static link don't set sh_link field.
4570 (Output_data_got::Got_entry::write): Use PLT offset if
4571 appropriate.
4572 (Output_data_got::add_global_plt): New function.
4573 (Output_data_got::add_local_plt): New function.
4574 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4575 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4576 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4577 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4578 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4579 IFUNC conditional.
4580 * testsuite/ifunc-sel.h: New file.
4581 * testsuite/ifuncmain1.c: New file.
4582 * testsuite/ifuncmain1vis.c: New file.
4583 * testsuite/ifuncmod1.c: New file.
4584 * testsuite/ifuncdep2.c: New file.
4585 * testsuite/ifuncmain2.c: New file.
4586 * testsuite/ifuncmain3.c: New file.
4587 * testsuite/ifuncmod3.c: New file.
4588 * testsuite/ifuncmain4.c: New file.
4589 * testsuite/ifuncmain5.c: New file.
4590 * testsuite/ifuncmod5.c: New file.
4591 * testsuite/ifuncmain6pie.c: New file.
4592 * testsuite/ifuncmod6.c: New file.
4593 * testsuite/ifuncmain7.c: New file.
4594 * configure, testsuite/Makefile.in: Rebuild.
4595
56f75c03
ILT
45962010-08-18 Ian Lance Taylor <iant@google.com>
4597
4598 * incremental.cc
4599 (Output_section_incremental_inputs::write_input_files): Add cast
4600 to avoid signed/unsigned comparison warning.
4601 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4602
55455f89
CC
46032010-08-12 Cary Coutant <ccoutant@google.com>
4604
4605 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4606
e2054bcb
ILT
46072010-08-13 Ian Lance Taylor <iant@google.com>
4608
4609 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4610
74f67560
DK
46112010-08-12 Cary Coutant <ccoutant@google.com>
4612 Doug Kwan <dougkwan@google.com>
4613
4614 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4615 defintion overrides non-weak undef, remember that the original undef
4616 is not weak.
4617 * symtab.cc (Symbol_table::sized_write_global): For undef without
4618 an original weak binding, set binding to global in output.
4619 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4620 * testsuite/Makefile.in: Regenerate.
4621 * testsuite/strong_ref_weak_def.sh: New file.
4622 * testsuite/strong_ref_weak_def_1.c: Ditto.
4623 * testsuite/strong_ref_weak_def_2.c: Ditto.
4624
d1238d12
CC
46252010-08-12 Cary Coutant <ccoutant@google.com>
4626
4627 * testsuite/incremental_test.sh: Rewrite.
4628 * testsuite/incremental_test_1.c: Rewrite.
4629 * testsuite/incremental_test_2.c: Rewrite.
4630
0e70b911
CC
46312010-08-12 Cary Coutant <ccoutant@google.com>
4632
4633 * arm.cc (Target_arm::got_size): Add const.
4634 (Target_arm::got_entry_count): New function.
4635 (Target_arm::plt_entry_count): New function.
4636 (Target_arm::first_plt_entry_offset): New function.
4637 (Target_arm::plt_entry_size): New function.
4638 (Output_data_plt_arm::entry_count): New function.
4639 (Output_data_plt_arm::first_plt_entry_offset): New function.
4640 (Output_data_plt_arm::get_plt_entry_size): New function.
4641 * i386.cc (Target_i386::got_size): Add const.
4642 (Target_i386::got_entry_count): New function.
4643 (Target_i386::plt_entry_count): New function.
4644 (Target_i386::first_plt_entry_offset): New function.
4645 (Target_i386::plt_entry_size): New function.
4646 (Output_data_plt_i386::entry_count): New function.
4647 (Output_data_plt_i386::first_plt_entry_offset): New function.
4648 (Output_data_plt_i386::get_plt_entry_size): New function.
4649 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4650 find_incremental_inputs_sections. Dump incremental_got_plt section.
4651 * incremental.cc: Include target.h.
4652 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4653 parameter. Adjust all callers. Find incremental_got_plt section.
4654 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4655 section.
4656 (Output_section_incremental_inputs::set_final_data_size): Calculate
4657 size of incremental_got_plt section.
4658 (Output_section_incremental_inputs::do_write): Write the
4659 incremental_got_plt section.
4660 (Got_plt_view_info): New struct.
4661 (Local_got_offset_visitor): New class.
4662 (Global_got_offset_visitor): New class.
4663 (Global_symbol_visitor_got_plt): New class.
4664 (Output_section_incremental_inputs::write_got_plt): New function.
4665 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4666 Add parameter. Adjust all callers.
4667 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4668 (Incremental_inputs::got_plt_section): New function.
4669 (Incremental_inputs::got_plt_section_): New data member.
4670 (Incremental_got_plt_reader): New class.
4671 * layout.cc (Layout::create_incremental_info_sections): Add the
4672 incremental_got_plt section.
4673 * object.h (Got_offset_list::get_list): New function.
4674 (Got offset_list::for_all_got_offsets): New function.
4675 (Sized_relobj::local_got_offset_list): New function.
4676 * powerpc.cc (Target_powerpc::got_size): Add const.
4677 (Target_powerpc::got_entry_count): New function.
4678 (Target_powerpc::plt_entry_count): New function.
4679 (Target_powerpc::first_plt_entry_offset): New function.
4680 (Target_powerpc::plt_entry_size): New function.
4681 (Output_data_plt_powerpc::entry_count): New function.
4682 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4683 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4684 * sparc.cc (Target_sparc::got_size): Add const.
4685 (Target_sparc::got_entry_count): New function.
4686 (Target_sparc::plt_entry_count): New function.
4687 (Target_sparc::first_plt_entry_offset): New function.
4688 (Target_sparc::plt_entry_size): New function.
4689 (Output_data_plt_sparc::entry_count): New function.
4690 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4691 (Output_data_plt_sparc::get_plt_entry_size): New function.
4692 * symtab.h (Symbol::got_offset_list): New function.
4693 (Symbol_table::for_all_symbols): New function.
4694 * target.h (Sized_target::got_entry_count): New function.
4695 (Sized_target::plt_entry_count): New function.
4696 (Sized_target::plt_entry_size): New function.
4697 * x86_64.cc (Target_x86_64::got_size): Add const.
4698 (Target_x86_64::got_entry_count): New function.
4699 (Target_x86_64::plt_entry_count): New function.
4700 (Target_x86_64::first_plt_entry_offset): New function.
4701 (Target_x86_64::plt_entry_size): New function.
4702 (Output_data_plt_x86_64::entry_count): New function.
4703 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4704 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4705
09ec0418
CC
47062010-08-12 Cary Coutant <ccoutant@google.com>
4707
4708 * archive.cc: Include incremental.h.
4709 (Archive::Archive): Initialize incremental_info_.
4710 (Archive::include_member): Record archive members in incremental info.
4711 (Add_archive_symbols::run): Record begin and end of an archive in
4712 incremental info.
4713 (Lib_group::include_member): Record objects in incremental info.
4714 * archive.h (Incremental_archive_entry): Forward declaration.
4715 (Archive::set_incremental_info): New member function.
4716 (Archive::incremental_info): New member function.
4717 (Archive::Unused_symbol_iterator): New class.
4718 (Archive::unused_symbols_begin): New member function.
4719 (Archive::unused_symbols_end): New member function.
4720 (Archive::incremental_info_): New data member.
4721 * incremental-dump.cc (find_input_containing_global): New function.
4722 (dump_incremental_inputs): Dump new incremental info sections.
4723 * incremental.cc: Include symtab.h.
4724 (Output_section_incremental_inputs): New class.
4725 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4726 new incremental info sections.
4727 (Sized_incremental_binary::do_check_inputs): Likewise.
4728 (Incremental_inputs::report_archive): Remove.
4729 (Incremental_inputs::report_archive_begin): New function.
4730 (Incremental_inputs::report_archive_end): New function.
4731 (Incremental_inputs::report_object): New function.
4732 (Incremental_inputs::finalize_inputs): Remove.
4733 (Incremental_inputs::report_input_section): New function.
4734 (Incremental_inputs::report_script): Rewrite.
4735 (Incremental_inputs::finalize): Do nothing but finalize string table.
4736 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4737 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4738 (Incremental_inputs::create_data_sections): New function.
4739 (Incremental_inputs::relocs_entsize): New function.
4740 (Output_section_incremental_inputs::set_final_data_size): New function.
4741 (Output_section_incremental_inputs::do_write): New function.
4742 (Output_section_incremental_inputs::write_header): New function.
4743 (Output_section_incremental_inputs::write_input_files): New function.
4744 (Output_section_incremental_inputs::write_info_blocks): New function.
4745 (Output_section_incremental_inputs::write_symtab): New function.
4746 * incremental.h (Incremental_script_entry): Forward declaration.
4747 (Incremental_object_entry): Forward declaration.
4748 (Incremental_archive_entry): Forward declaration.
4749 (Incremental_inputs): Forward declaration.
4750 (Incremental_inputs_header_data): Remove.
4751 (Incremental_inputs_header): Remove.
4752 (Incremental_inputs_header_write): Remove.
4753 (Incremental_inputs_entry_data): Remove.
4754 (Incremental_inputs_entry): Remove.
4755 (Incremental_inputs_entry_write): Remove.
4756 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4757 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4758 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4759 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4760 Likewise.
4761 (Incremental_input_entry): New class.
4762 (Incremental_script_entry): New class.
4763 (Incremental_object_entry): New class.
4764 (Incremental_archive_entry): New class.
4765 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4766 (Incremental_inputs::report_inputs): Remove.
4767 (Incremental_inputs::report_archive): Remove.
4768 (Incremental_inputs::report_archive_begin): New function.
4769 (Incremental_inputs::report_archive_end): New function.
4770 (Incremental_inputs::report_object): Change prototype.
4771 (Incremental_inputs::report_input_section): New function.
4772 (Incremental_inputs::report_script): Change prototype.
4773 (Incremental_inputs::get_reloc_count): New function.
4774 (Incremental_inputs::set_reloc_count): New function.
4775 (Incremental_inputs::create_data_sections): New function.
4776 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4777 (Incremental_inputs::inputs_section): New function.
4778 (Incremental_inputs::symtab_section): New function.
4779 (Incremental_inputs::relocs_section): New function.
4780 (Incremental_inputs::get_stringpool): Add const.
4781 (Incremental_inputs::command_line): Add const.
4782 (Incremental_inputs::inputs): Remove.
4783 (Incremental_inputs::command_line_key): New function.
4784 (Incremental_inputs::input_file_count): New function.
4785 (Incremental_inputs::input_files): New function.
4786 (Incremental_inputs::relocs_entsize): New function.
4787 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4788 (Incremental_inputs::finalize_inputs): Remove.
4789 (Incremental_inputs::Input_info): Remove.
4790 (Incremental_inputs::lock_): Remove.
4791 (Incremental_inputs::inputs_): Change type.
4792 (Incremental_inputs::inputs_map_): Remove.
4793 (Incremental_inputs::current_object_entry_): New data member.
4794 (Incremental_inputs::inputs_section_): New data member.
4795 (Incremental_inputs::symtab_section_): New data member.
4796 (Incremental_inputs::relocs_section_): New data member.
4797 (Incremental_inputs::reloc_count_): New data member.
4798 (Incremental_inputs_reader): New class.
4799 (Incremental_symtab_reader): New class.
4800 (Incremental_relocs_reader): New class.
4801 * layout.cc (Layout::finalize): Move finalization of incremental info
4802 and creation of incremental info sections to follow finalization of
4803 symbol table. Set offsets for postprocessing sections.
4804 (Layout::create_incremental_info_sections): Call
4805 Incremental_inputs::create_data_sections. Add incremental symtab
4806 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4807 sections to layout after input sections.
4808 * layout.h (struct Timespec): Forward declaration.
4809 (Layout::incremental_inputs): Add const.
4810 (Layout::create_incremental_info_sections): Add parameter.
4811 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4812 * object.cc: Include incremental.h.
4813 (Relobj::finalize_incremental_relocs): New function.
4814 (Sized_relobj::do_layout): Record input sections in incremental info.
4815 * object.h (Object::output_section): New function.
4816 (Object::output_section_offset): Moved from Relobj.
4817 (Object::get_incremental_reloc_base): New function.
4818 (Object::get_incremental_reloc_count): New function.
4819 (Object::do_output_section): New function.
4820 (Object::do_output_section_offset): Moved from Relobj.
4821 (Object::do_get_incremental_reloc_base): New function.
4822 (Object::do_get_incremental_reloc_count): New function.
4823 (Object::Object): Initialize new data members.
4824 (Relobj::output_section): Renamed do_output_section and moved to
4825 protected.
4826 (Relobj::output_section_offset): Moved to Object.
4827 (Relobj::do_get_incremental_reloc_base): New function.
4828 (Relobj::do_get_incremental_reloc_count): New function.
4829 (Relobj::allocate_incremental_reloc_counts): New function.
4830 (Relobj::count_incremental_reloc): New function.
4831 (Relobj::finalize_incremental_relocs): New function.
4832 (Relobj::next_incremental_reloc_index): New function.
4833 (Relobj::reloc_counts_): New data member.
4834 (Relobj::reloc_bases_): New data member.
4835 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4836 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4837 (Sized_relobj::incremental_relocs_scan): New function.
4838 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4839 (Sized_relobj::incremental_relocs_write): New function.
4840 (Sized_relobj::incremental_relocs_write_reltype): New function.
4841 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4842 incremental link.
4843 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4844 archives and object files elsewhere.
4845 (Add_symbols::run): Report object files here.
4846 (Finish_group::run): Report end of archive at end of group.
4847 * reloc.cc: Include layout.h, incremental.h.
4848 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4849 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4850 (Sized_relobj::incremental_relocs_scan): New function.
4851 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4852 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4853 (Sized_relobj::incremental_relocs_write): New function.
4854 (Sized_relobj::incremental_relocs_write_reltype): New function.
4855 * script.cc (read_input_script): Rewrite test for incremental link.
4856 Change call to Incremental_inputs::report_script.
4857 * symtab.h (Symbol_table::first_global_index): New function.
4858 (Symbol_table::output_count): New function.
4859
ce0d1972
DK
48602010-08-12 Doug Kwan <dougkwan@google.com>
4861
4862 * arm.cc (Target_arm::merge_object_attributes): Check command line
4863 options --no-wchar-size-warning and --no-enum-size-warning.
4864 * options.h (General_options): Add ld-compatible options
4865 --no-enum-size-warning and --no-wchar-size-warning.
4866
6e5710ce
ILT
48672010-08-04 Ian Lance Taylor <iant@google.com>
4868
4869 * x86_64.cc (Target_x86_64::Scan::local): Use
4870 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4871 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4872 (Target_x86_64::Scan::global): Likewise.
4873 (Target_x86_64::Relocate::relocate): Likewise.
4874 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4875 Likewise.
4876
fef830db
CC
48772010-08-03 Cary Coutant <ccoutant@google.com>
4878
4879 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4880 to reserve space in merged_strings vector. Keep total input size
4881 for stats.
4882 (Output_merge_string::do_print_merge_stats): Print total input size.
4883 * merge.h (Output_merge_string): Add input_size_ field.
4884 * stringpool.cc (Stringpool_template::string_length): Move
4885 implementations out of Stringpool_template class and place in
4886 stringpool.h.
4887 * stringpool.h (string_length): Move out of Stringpool_template.
4888
1e3811b0
ILT
48892010-08-03 Ian Lance Taylor <iant@google.com>
4890
4891 PR 11712
4892 * layout.cc (relaxation_loop_body): If address of load segment is
4893 set, adjust address to include headers if possible.
4894
7af0c620
ILT
48952010-08-03 Ian Lance Taylor <iant@google.com>
4896
4897 * version.cc (version_string): Bump to 1.10.
4898
22f0da72
ILT
48992010-08-03 Ian Lance Taylor <iant@google.com>
4900
4901 PR 11805
4902 * layout.h (enum Output_section_order): Define.
4903 (class Layout): Update declarations.
4904 * layout.cc (Layout::get_output_section): Add order parameter.
4905 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4906 is_first_non_relro parameters. Change all callers.
4907 (Layout::choose_output_section): Likewise.
4908 (Layout::add_output_section_data): Likewise.
4909 (Layout::make_output_section): Likewise. Set order.
4910 (Layout::default_section_order): New function.
4911 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4912 * output.cc (Output_section::Output_section): Initialize order_.
4913 Don't initialize deleted fields.
4914 (Output_segment::Output_segment): Don't initialize deleted
4915 fields.
4916 (Output_segment::add_output_section_to_load): New function
4917 replacing add_output_section. Change all callers to call this or
4918 add_output_section_to_nonload.
4919 (Output_segment::add_output_section_to_nonload): New function.
4920 (Output_segment::remove_output_section): Rewrite.
4921 (Output_segment::add_initial_output_data): Likewise.
4922 (Output_segment::has_any_data_sections): Likewise.
4923 (Output_segment::is_first_section_relro): Likewise.
4924 (Output_segment::maximum_alignment): Likewise.
4925 (Output_segment::has_dynamic_reloc): New function replacing
4926 dynamic_reloc_count. Change all callers.
4927 (Output_segment::has_dynamic_reloc_list): New function replacing
4928 dynamic_reloc_count_list. Change all callers.
4929 (Output_segment::set_section_addresses): Rewrite.
4930 (Output_segment::set_offset): Rewrite.
4931 (Output_segment::find_first_and_last_list): Remove.
4932 (Output_segment::set_tls_offsets): Rewrite.
4933 (Output_segment::first_section_load_address): Likewise.
4934 (Output_segment::output_section_count): Likewise.
4935 (Output_segment::section_with_lowest_load_address): Likewise.
4936 (Output_segment::write_section_headers): Likewise.
4937 (Output_segment::print_sections_to_map): Likewise.
4938 * output.h (class Output_data): Remove dynamic_reloc_count_
4939 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4940 (Output_data::add_dynamic_reloc): Rewrite.
4941 (Output_data::has_dynamic_reloc): New function.
4942 (Output_data::dynamic_reloc_count): Remove.
4943 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4944 is_last_relro_, is_first_non_relro_, is_interp_,
4945 is_dynamic_linker_section_ fields. Add order and set_order
4946 functions. Remove is_relro_local, set_is_relro_local,
4947 is_last_relro, set_is_last_relro, is_first_non_relro,
4948 set_is_first_non_relro functions, is_interp, set_is_interp,
4949 is_dynamic_linker_section, and set_is_dynamic_linker_section
4950 functions.
4951 (class Output_segment): Change Output_data_list from std::list to
4952 std:;vector. Add output_lists_ field. Remove output_data_ and
4953 output_bss_ fields. Update declarations.
4954
3ff2ccb0
ILT
49552010-08-02 Ian Lance Taylor <iant@google.com>
4956
4957 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4958 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4959 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4960
88a4108b
ILT
49612010-08-02 Ian Lance Taylor <iant@google.com>
4962
4963 PR 11855
4964 * script.cc (Script_options::Script_options): Initialize
4965 symbol_definitions_ and symbol_references_.
4966 (Script_options::add_symbol_assignment): Update
4967 symbol_definitions_ and symbol_references_.
4968 (Script_options::add_symbol_reference): New function.
4969 (script_symbol): New function.
4970 * script.h (class Script_options): Add symbol_definitions_ and
4971 symbol_references_ fields.
4972 (Script_options::referenced_const_iterator): New type.
4973 (Script_options::referenced_begin): New function.
4974 (Script_options::referenced_end): New function.
4975 (Script_options::is_referenced): New function.
4976 (Script_options::any_unreferenced): New function.
4977 * script-c.h (script_symbol): Declare.
4978 * yyscript.y (exp): Call script_symbol.
4979 * symtab.cc: Include "script.h".
4980 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4981 Change all callers. Check symbols referenced by scripts.
4982 (Symbol_table::add_undefined_symbols_from_command_line): Add
4983 layout parameter. Change all callers.
4984 (Symbol_table::do_add_undefined_symbols_from_command_line):
4985 Likewise. Break out loop body. Check symbols referenced by
4986 scripts.
4987 (Symbol_table::add_undefined_symbol_from_command_line): New
4988 function broken out of
4989 do_add_undefined_symbols_from_command_line.
4990 * symtab.h (class Symbol_table): Update declarations.
4991 * archive.cc: Include "layout.h".
4992 (Archive::should_include_member): Add layout parameter. Change
4993 all callers. Check for symbol mentioned in expression.
4994 * archive.h (class Archive): Update declaration.
4995 * object.cc (Sized_relobj::do_should_include_member): Add layout
4996 parameter.
4997 * object.h (Object::should_include_member): Add layout parameter.
4998 Change all callers.
4999 (Object::do_should_include_member): Add layout parameter.
5000 (class Sized_relobj): Update declaration.
5001 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
5002 parameter.
5003 * dynobj.h (class Sized_dynobj): Update declaration.
5004 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
5005 layout parameter.
5006 * plugin.h (class Sized_pluginobj): Update declaration.
5007
5f1ab67a
ILT
50082010-08-02 Ian Lance Taylor <iant@google.com>
5009
5010 PR 11866
5011 * output.cc (Output_segment::set_offset): Search for the first and
5012 last sections rather than assuming that the list is in order.
5013 (Output_segment::find_first_and_last_list): New function.
5014 * output.h (class Output_segment): Update declarations.
5015 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
5016 (relro_strip_test_SOURCES): New variable.
5017 (relro_strip_test_DEPENDENCIES): New variable.
5018 (relro_strip_test_LDFLAGS): New variable.
5019 (relro_strip_test_LDADD): New variable.
5020 (relro_strip_test.so): New target.
5021
a8df5856
ILT
50222010-08-02 Ian Lance Taylor <iant@google.com>
5023
5024 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
5025 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
5026 (Target_i386::got_tlsdesc_section): New function.
5027 (Target_i386::got_section): Create space for GOT entries for
5028 TLSDESC relocations.
5029 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
5030 R_386_TLS_GOTDESC.
5031 (Target_i386::Scan::global): Likewise.
5032 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
5033 using TLSDESC GOT.
5034 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
5035 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
5036 (Target_x86_64::got_tlsdesc_section): New function.
5037 (Target_x86_64::got_section): Create space for GOT entries for
5038 TLSDESC relocations.
5039 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5040 R_386_TLS_GOTDESC.
5041 (Target_x86_64::Scan::global): Likewise.
5042 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5043 using TLSDESC GOT.
5044
0c10a0a6
ILT
50452010-08-02 Ian Lance Taylor <iant@google.com>
5046
5047 * testsuite/final_layout.sh: Use dc to convert from hex to
5048 decimal.
5049
41cbeecc
ST
50502010-07-29 Sriraman Tallam <tmsriram@google.com>
5051
5052 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5053 paramter to the call to gold::gc_process_relocs.
5054 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5055 paramter to the call to gold::gc_process_relocs.
5056 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5057 parameter to the call to gold::gc_process_relocs.
5058 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5059 template parameter to the call to gold::gc_process_relocs.
5060 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5061 paramter to the call to gold::gc_process_relocs.
5062 * gc.h (get_embedded_addend_size): New function.
5063 (gc_process_relocs): Save the size of the reloc for use by ICF.
5064 * icf.cc (get_section_contents): Get the addend from the text section
5065 for SHT_REL relocation sections.
5066 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5067 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5068 * int_encoding.h (read_from_pointer): New overloaded function.
5069 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5070 * testsuite/icf_sht_rel_addend_test.sh: New file.
5071 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5072 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5073
6ea55b82
RW
50742010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5075
5076 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5077 * Makefile.in: Regenerate.
5078 * testsuite/Makefile.in: Regenerate.
5079
9691462b
ILT
50802010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5081
5082 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5083 * gold/testsuite/debug_msg.cc: Likewise.
5084 * gold/testsuite/odr_violation1.cc
5085 * gold/testsuite/odr_violation2.cc
5086
76897331
CC
50872010-07-21 Cary Coutant <ccoutant@google.com>
5088
5089 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5090 string, and length fields.
5091 (Output_merge_string::Merged_strings_list): New type.
5092 (Output_merge_string::Merged_strings_lists): New typedef.
5093 (Output_merge_string): Replace merged_strings_ with
5094 merged_strings_lists_.
5095 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5096 Merged_strings_list per input object and section. Don't store pointer
5097 to the string. Don't store length with each merged string entry.
5098 (Output_merge_string::finalize_merged_data): Loop over list of merged
5099 strings lists. Recompute length of each merged string.
5100
78384e8f
CC
51012010-07-15 Cary Coutant <ccoutant@google.com>
5102
5103 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5104 here.
5105
783659f9
ILT
51062010-07-14 Ian Lance Taylor <iant@google.com>
5107
5108 * descriptors.cc (Descriptors::open): Report correct name in error
5109 message.
5110
131687b4
DK
51112010-07-13 Doug Kwan <dougkwan@google.com>
5112
5113 * arm.cc (Arm_input_section::Arm_input_section): For a
5114 SHT_ARM_EXIDX section, always keeps the input sections.
5115 (Arm_input_section::set_exidx_section_link): New method.
5116 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5117 has_errors_ to false.
5118 (Arm_exidx_input_section::has_errors,
5119 Arm_exidx_input_section::set_has_errors): New methods.
5120 (Arm_exidx_input_section::has_errors_): New data member.
5121 (Arm_relobj::get_exidx_shndx_list): New method.
5122 (Arm_output_section::append_text_sections_to_list): Do not skip
5123 section without SHF_EXECINSTR.
5124 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5125 errors.
2e702c99 5126 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
5127 section header. Make error messages more verbose. Check for
5128 a non-executable section linked to an EXIDX section.
5129 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5130 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5131 check that there is no deferred EXIDX section if we exit early.
5132 Instead of not making an EXIDX section in case of an error, make one
5133 and set the has_errors flag of it.
5134 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5135 in a relocatable link.
5136 (Target_arm::do_relax): Look for the EXIDX output section instead of
5137 assuming that it is called .ARM.exidx.
2e702c99 5138 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
5139 section list. Do not check for SHF_EXECINSTR section flags but
5140 skip any input section with errors.
5141 * output.cc (Output_section::Output_section): Initialize
5142 always_keeps_input_sections_ to false.
5143 (Output_section::add_input_section): Check for
5144 always_keeps_input_sections_.
5145 * output.h (Output_section::always_keeps_input_sections,
5146 Output_section::set_always_keeps_input_sections): New methods.
5147 (Output_section::always_keeps_input_sections): New data member.
5148
69517287
RÁE
51492010-07-13 Rafael Espindola <espindola@google.com>
5150
5151 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5152 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5153
82742395
ILT
51542010-07-13 Philip Herron <herron.philip@googlemail.com>
5155 Ian Lance Taylor <iant@google.com>
5156
5157 * output.h (Output_section_lookup_maps::add_merge_section):
5158 Correct check of whether value was inserted.
5159 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5160 (Output_section_lookup_maps::add_relaxed_input_section):
5161 Likewise.
5162 * arm.cc (Target_arm::got_section): Remove used local os.
5163 * i386.cc (Target_i386::got_section): Likewise.
5164 * x86_64.cc (Target_x86_64::got_section): Likewise.
5165 * sparc.cc (Target_sparc::got_section): Likewise.
5166 (Target_sparc::relocate): Remove unused local have_got_offset.
5167 * powerpc.cc (Target_powerpc::relocate): Likewise.
5168
f2d707b5
ILT
51692010-07-13 Ian Lance Taylor <iant@google.com>
5170
241531d6
ILT
5171 * compressed_output.cc (zlib_decompress): Fix signature in
5172 !HAVE_ZLIB_H case.
5173
f2d707b5
ILT
5174 * archive.cc (Archive::include_member): Unlock an external member
5175 of a thin archive. Don't bother to delete an object we know is
5176 NULL.
5177
a2e47362
CC
51782010-07-12 Cary Coutant <ccoutant@google.com>
5179
5180 * compressed_output.cc (zlib_decompress): New function.
5181 (get_uncompressed_size): New function.
5182 (decompress_input_section): New function.
5183 * compressed_output.h (get_uncompressed_size): New function.
5184 (decompress_input_section): New function.
5185 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5186 Handle compressed debug sections.
5187 * layout.cc (is_compressed_debug_section): New function.
5188 (Layout::output_section_name): Map compressed section names to
5189 canonical names.
5190 * layout.h (is_compressed_debug_section): New function.
5191 (is_debug_info_section): Recognize compressed debug sections.
5192 * merge.cc: Include compressed_output.h.
5193 (Output_merge_data::do_add_input_section): Handle compressed
5194 debug sections.
5195 (Output_merge_string::do_add_input_section): Handle compressed
5196 debug sections.
5197 * object.cc: Include compressed_output.h.
5198 (Sized_relobj::Sized_relobj): Initialize new data members.
5199 (build_compressed_section_map): New function.
5200 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5201 * object.h (Object::section_is_compressed): New method.
5202 (Object::do_section_is_compressed): New method.
5203 (Sized_relobj::Compressed_section_map): New type.
5204 (Sized_relobj::do_section_is_compressed): New method.
5205 (Sized_relobj::compressed_sections_): New data member.
5206 * output.cc (Output_section::add_input_section): Handle compressed
5207 debug sections.
5208 * reloc.cc: Include compressed_output.h.
5209 (Sized_relobj::write_sections): Handle compressed debug sections.
5210
ce279a62
CC
52112010-07-08 Cary Coutant <ccoutant@google.com>
5212
5213 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5214 weak when resolving to a dynamic def.
5215 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5216 for weak undef/dynamic def cases. Adjust callers.
5217 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5218 undef_binding_weak_.
5219 (Symbol_table::sized_write_globals): Adjust symbol binding.
5220 (Symbol_table::sized_write_symbol): Add binding parameter.
5221 * symtab.h (Symbol::set_undef_binding): New method.
5222 (Symbol::is_undef_binding_weak): New method.
5223 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5224 (Symbol_table::should_override): Add new parameter.
5225 (Symbol_table::sized_write_symbol): Add new parameter.
5226
5227 * testsuite/weak_undef_file1.cc: Add new test case.
5228 * testsuite/weak_undef_file2.cc: Fix header comment.
5229 * testsuite/weak_undef_test.cc: Add new test case.
5230
b2286c10
DK
52312010-06-29 Doug Kwan <dougkwan@google.com>
5232
5233 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5234 Initialize USE_SYMBOL_.
5235 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5236 definition.
5237 (Arm_reloc_property::uses_symbol_): New data member declaration.
5238 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5239 uses symbol value and symbol is undefined but not weakly undefined.
5240
4802450a
RÁE
52412010-06-28 Rafael Espindola <espindola@google.com>
5242
5243 * plugin.cc (Plugin::load): Use dlerror.
5244
e5ca47ba
ILT
52452010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5246
5247 * symtab.cc (detect_odr_violations): When reporting an ODR
5248 violation, report an object where the symbol is defined.
5249
8a75a161
DK
52502010-06-25 Doug Kwan <dougkwan@google.com>
5251
5252 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5253 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5254 definition.
5255 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5256 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5257 target hook to detect function points.
5258 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5259 * icf.h (Icf::check_section_for_function_pointers): Change type of
5260 parameter SECTION_NAME to const reference to std::string. Use
5261 target hook to determine if section may have unsafe pointers.
5262 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5263 method definition.
5264
42218b9f
RÁE
52652010-06-21 Rafael Espindola <espindola@google.com>
5266
5267 * fileread.cc (Input_file::find_fie): New
5268 (Input_file::open): Use Input_file::find_fie.
5269 * fileread.h (Input_file::find_fie): New
5270 * plugin.cc (set_extra_library_path): New.
5271 (Plugin::load): Add set_extra_library_path to the transfer vector.
5272 (Plugin_manager::set_extra_library_path): New.
5273 (Plugin_manager::add_input_file): Use the extra search path if set.
5274 (set_extra_library_path(): New.
5275 * plugin.h (Plugin_manager): Add set_extra_library_path and
5276 extra_search_path_.
5277
a0506cca
CC
52782010-06-19 Cary Coutant <ccoutant@google.com>
5279
5280 * layout.cc (gdb_sections): Add .debug_types.
5281 (lines_only_debug_sections): Likewise.
5282
6508b958
RÁE
52832010-06-18 Rafael Espindola <espindola@google.com>
5284
5285 * plugin.cc (add_input_file,add_input_library)
5286 (Plugin_manager::add_input_file): Make filename arguments const.
5287 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5288 const.
5289
3e235302
DK
52902010-06-16 Doug Kwan <dougkwan@google.com>
5291
5292 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5293 .ARM.attributes section if we have not merged any input
5294 attributes sections.
5295
106e8a6c
DK
52962010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5297
5298 * arm.cc: Allow combining objects with no EABI version
5299 information.
5300
91ff43fe
RÁE
53012010-06-15 Rafael Espindola <espindola@google.com>
5302
5303 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5304
68ed838c
ILT
53052010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5306
5307 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5308 (struct iovec): Correct !HAVE_READV definition.
5309
f3a2388f
CC
53102010-06-10 Cary Coutant <ccoutant@google.com>
5311
5312 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5313 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5314 reloc sections.
5315 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5316
5317 PR 11683
5318 * symtab.h (Symbol::is_placeholder): New member function.
5319 * target-reloc.h (relocate_section): Check for placeholder symbols.
5320
5321 * testsuite/Makefile.am (plugin_test_8): New test.
5322 (plugin_test_9): New test.
5323 * testsuite/Makefile.in: Regenerate.
5324
e1df38aa
NC
53252010-06-09 Nick Clifton <nickc@redhat.com>
5326
5327 * yyscript.y (input_list_element): Allow strings prefixed with
5328 the '-' character. Treat these as libraries.
5329 * script.cc (script_add_library): New function. Adds a library
5330 specified by "-l<name>" found in an input script.
5331 * script-c.h: Add prototype for script_add_library.
5332
25bbe950
DK
53332010-06-07 Doug Kwan <dougkwan@google.com>
5334
5335 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5336 Restrict stub-group size to be within long conditional branch
5337 range when working around cortex-A8 erratum.
5338
0f32ea4c
ILT
53392010-06-07 Damien Diederen <dd@crosstwine.com>
5340
5341 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5342 #ifdef typo.
5343
8fe2a369
ST
53442010-06-03 Sriraman Tallam <tmsriram@google.com>
5345
5346 PR gold/11658
5347 * output.cc
5348 (Output_section::Input_section_sort_entry::compare_section_ordering):
5349 Change to return non-zero correctly.
5350 (Output_section::Input_section_sort_section_order_index_compare
5351 ::operator()): Change to fix ambiguity in comparisons.
5352
6e9ba2ca
ST
53532010-06-01 Sriraman Tallam <tmsriram@google.com>
5354
5355 * gold.h (is_wildcard_string): New function.
5356 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5357 (Layout::layout_eh_frame): Ditto.
5358 (Layout::find_section_order_index): New method.
5359 (Layout::read_layout_from_file): New method.
5360 * layout.h (Layout::find_section_order_index): New method.
5361 (Layout::read_layout_from_file): New method.
5362 (Layout::input_section_position_): New private member.
5363 (Layout::input_section_glob_): New private member.
5364 * main.cc (main): Call read_layout_from_file here.
5365 * options.h (--section-ordering-file): New option.
5366 * output.cc (Output_section::input_section_order_specified_): New
5367 member.
5368 (Output_section::Output_section): Initialize new member.
5369 (Output_section::add_input_section): Add new parameter.
5370 Keep input sections when --section-ordering-file is used.
5371 (Output_section::set_final_data_size): Sort input sections when
5372 section ordering file is specified.
5373 (Output_section::Input_section_sort_entry): Add new parameter.
5374 Check sorting type.
5375 (Output_section::Input_section_sort_entry::compare_section_ordering):
5376 New method.
5377 (Output_section::Input_section_sort_compare::operator()): Change to
5378 consider section_order_index.
5379 (Output_section::Input_section_sort_init_fini_compare::operator()):
5380 Change to consider section_order_index.
5381 (Output_section::Input_section_sort_section_order_index_compare
5382 ::operator()): New method.
5383 (Output_section::sort_attached_input_sections): Change to sort
5384 according to section order when specified.
e1df38aa
NC
5385 (Output_section::add_input_section<32, true>): Add new parameter.
5386 (Output_section::add_input_section<64, true>): Add new parameter.
5387 (Output_section::add_input_section<32, false>): Add new parameter.
5388 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
5389 * output.h (Output_section::add_input_section): Add new parameter.
5390 (Output_section::input_section_order_specified): New
5391 method.
5392 (Output_section::set_input_section_order_specified): New method.
5393 (Input_section::Input_section): Initialize section_order_index_.
5394 (Input_section::section_order_index): New method.
5395 (Input_section::set_section_order_index): New method.
5396 (Input_section::section_order_index_): New member.
5397 (Input_section::Input_section_sort_section_order_index_compare): New
5398 struct.
5399 (Output_section::input_section_order_specified_): New member.
5400 * script-sections.cc (is_wildcard_string): Delete and move modified
5401 method to gold.h.
5402 (Output_section_element_input::Output_section_element_input): Modify
5403 call to is_wildcard_string.
5404 (Output_section_element_input::Input_section_pattern
5405 ::Input_section_pattern): Ditto.
5406 (Output_section_element_input::Output_section_element_input): Ditto.
5407 * testsuite/Makefile.am (final_layout): New test case.
5408 * testsuite/Makefile.in: Regenerate.
5409 * testsuite/final_layout.cc: New file.
5410 * testsuite/final_layout.sh: New file.
5411
3537c84b
RÁE
54122010-06-01 Rafael Espindola <espindola@google.com>
5413
5414 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5415
105b6afd
RÁE
54162010-06-01 Rafael Espindola <espindola@google.com>
5417
5418 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5419 visibility of symbols.
5420
29e11421
DK
54212010-05-27 Doug Kwan <dougkwan@google.com>
5422
5423 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5424 from start of output section instead of address for a local symbol
5425 in a merged or relaxed section when doing a relocatable link.
5426
5e0f337e
RÁE
54272010-05-26 Rafael Espindola <espindola@google.com>
5428
5429 PR 11604
5430 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5431 adding sections the garbage collector removed.
5432 * gold/testsuite/Makefile.am: Add test.
5433 * gold/testsuite/Makefile.in: Regenerate.
5434 * gold/testsuite/plugin_test_7.sh: New.
5435 * gold/testsuite/plugin_test_7_1.c: New.
5436 * gold/testsuite/plugin_test_7_2.c: New.
5437
f4187277
RÁE
54382010-05-26 Rafael Espindola <espindola@google.com>
5439
5440 * script-sections.cc (Output_section_definition::set_section_addresses):
5441 Check for --section-start.
5442
5c388529
DK
54432010-05-26 Doug Kwan <dougkwan@google.com>
5444
5445 * arm.cc (Arm_scan_relocatable_relocs): New class.
5446 (Target_arm::relocate_special_relocatable): New method.
5447 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5448 (Arm_relocate_functions::thumb_branch_common): Same.
5449 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5450 instead of Default_scan_relocatable_relocs.
5451 * target-reloc.h (relocate_for_relocatable): Let target handle
5452 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5453 * target.h (Sized_target::relocate_special_relocatable): New method.
5454
bca1c3ae
ILT
54552010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5456
5457 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5458
0439c796
DK
54592010-05-23 Doug Kwan <dougkwan@google.com>
5460
5461 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5462 instead of a cast.
5463 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5464 with a direct branch, not a conditional branch, to a stub.
5465 * merge.cc (Output_merge_base::record_input_section): New method
5466 defintion.
5467 (Output_merge_data::do_add_input_section): Record input section if
5468 keeps-input-sections flag is set.
5469 (Output_merge_string::do_add_input_section): Ditto.
5470 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5471 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5472 INPUT_SECTIONS_.
5473 (Output_merge_base::keeps_input_sections,
5474 Output_merge_base::set_keeps_input_sections,
5475 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5476 method definitions.
5477 (Output_merge_base::Input_sections): New type declaration.
5478 (Output_merge_base::input_sections_begin,
5479 Output_merge_base::input_sections_end,
5480 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5481 (Output_merge_base::bool keeps_input_sections_,
5482 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5483 Output_merge_base::input_sections_): New data members.
5484 (Output_merge_data::do_set_keeps_input_sections): New method
5485 defintion.
5486 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5487 * output.cc (Output_section::Input_section::relobj): Move method
5488 defintion from class declaration to here and handle merge sections.
5489 (Output_section::Input_section::shndx): Ditto.
5490 (Output_section::Output_section): Remove initializations of removed
5491 data members and initialize new data member LOOKUP_MAPS_.
5492 (Output_section::add_input_section): Set keeps-input-sections flag
5493 for a newly created merge output section as appropriate. Adjust code
5494 to use Output_section_lookup_maps class.
5495 (Output_section::add_relaxed_input_section): Adjst code for lookup
5496 maps code refactoring.
2e702c99 5497 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
5498 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5499 class. If adding input section to a newly created merge output
5500 section fails, remove the new merge section.
5501 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 5502 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 5503 (Output_section::find_merge_section): Ditto.
0439c796 5504 (Output_section::build_lookup_maps): New method defintion.
2e702c99 5505 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
5506 Output_section_lookup_maps class.
5507 (Output_section::get_input_sections): Export merge sections. Adjust
5508 code to use Output_section_lookup_maps class.
5509 (Output_section:::add_script_input_section): Adjust code to use
5510 Output_section_lookup_maps class. Update lookup maps for merge
5511 sections also.
5512 (Output_section::discard_states): Use Output_section_lookup_maps.
5513 (Output_section::restore_states): Same.
5514 * output.h (Merge_section_properties): Move class defintion out of
5515 Output_section.
5516 (Output_section_lookup_maps): New class.
5517 (Output_section::Input_section::is_merge_section): New method
5518 defintion.
5519 (Output_section::Input_section::relobj): Move defintion out of class
5520 defintion. Declare method only.
5521 (Output_section::Input_section::shndx): Ditto.
5522 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 5523 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
5524 (Output_section::Merge_section_by_properties_map,
5525 Output_section::Output_section_data_by_input_section_map,
5526 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5527 Remove types.
2e702c99 5528 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
5529 KEEPS_INPUT_SECTIONS.
5530 (Output_section::build_lookup_maps): New method declaration.
5531 (Output_section::merge_section_map_,
5532 Output_section::merge_section_by_properties_map_,
5533 Output_section::relaxed_input_section_map_,
5534 Output_section::is_relaxed_input_section_map_valid_): Remove data
5535 members.
5536 (Output_section::lookup_maps_): New data member.
5537
76295588
L
55382010-05-21 Doug Kwan <dougkwan@google.com>
5539
5540 PR gold/11619
5541 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5542 avoid a compilation error.
5543
d103a984
RÁE
55442010-05-19 Rafael Espindola <espindola@google.com>
5545
5546 * script-sections.cc (Output_section_definition::allocate_to_segment):
5547 Update the phdrs_list even when the output section is NULL.
5548 * testsuite/Makefile.am: Add test.
5549 * testsuite/Makefile.in: Regenerate.
5550 * testsuite/script_test_9.cc: New.
5551 * testsuite/script_test_9.sh: New.
5552 * testsuite/script_test_9.t: New.
5553
6625d24e
DK
55542010-05-19 Doug Kwan <dougkwan@google.com>
5555
5556 * arm.cc (Arm_input_section::original_size): New method.
5557 (Arm_input_section::do_addralign): Add a cast.
5558 (Arm_input_section::do_output_offset): Remove static cast.
5559 (Arm_input_section::original_addralign,
5560 Arm_input_section::original_size_): Change type to uint32_t.
5561 (Arm_input_section::init): Add safe casts for section alignment
5562 and size.
5563 (Arm_input_section::set_final_data_size): Do not set address and
5564 offset of stub table.
5565 (Arm_output_section::fix_exidx_coverage): Change use of of
5566 Output_section::Simple_input_section to that of
5567 Output_section::Input_section.
5568 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5569 except for the first pass.
5570 * output.cc (Output_section::get_input_sections): Change type of
5571 input_sections to std::list<Input_section>.
5572 (Output_section::add_script_input_section): Rename from
5573 Output_section::add_simple_input_section. Change type of SIS
5574 parameter from Simple_input_section to Input_section.
5575 * output.h (Output_section::Simple_input_section): Remove class.
5576 (Output_section::Input_section): Change class visibility to public.
5577 (Output_section::Input_section::addralign): Use stored alignments
5578 for special input sections if set.
5579 (Output_section::Input_section::set_addralign): New method.
5580 (Output_section::get_input_sections): Change parameter type from
5581 list of Simple_input_section to list of Input_section.
5582 (Output_section::add_script_input_section): Rename from
5583 Output_section::add_simple_input_section. Change first parameter's
5584 type from Simple_input_section to Input_section and remove the
5585 second and third parameters.
5586 * script-sections.cc (Input_section::Input_section_list): Change
5587 type to list of Output_section::Input_section/
5588 (Input_section_info::Input_section_info): Change parameter type of
5589 INPUT_SECTION to Output_section::Input_section.
5590 (Input_section_info::input_section): Change return type.
5591 (Input_section_info::input_section_): Change type to
5592 Output_section::Input_section.
5593 (Output_section_element_input::set_section_addresses): Adjust code
5594 to use Output_section::Input_section instead of
5595 Output_section::Simple_input_section. Adjust code for renaming
5596 of Output_section::add_simple_input_section.
5597 (Orphan_output_section::set_section_addresses): Ditto.
5598
e1e82ea4
RW
55992010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5600
5601 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5602 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5603
91e75c8a
RÁE
56042010-05-18 Rafael Espindola <espindola@google.com>
5605
5606 * options.cc (General_options::finalize): Handle -nostdlib.
5607 * options.h (nostdlib): New option.
5608 * script.cc (script_add_search_dir): Handle -nostdlib.
5609
da59ad79
DK
56102010-05-12 Doug Kwan <dougkwan@google.com>
5611
5612 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5613 attributes section only if there no attributes section after merging.
5614 (Target_arm::merge_object_attributes): Move value of
e1df38aa 5615 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
5616 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5617 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5618 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5619 and arm_attr_merge_7.stdout.
5620 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5621 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5622 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5623 arm_attr_merge_7b.o): New rules.
5624 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5625 arm_attr_merge_7
5626 * testsuite/Makefile.in: Regenerate.
5627 * testsuite/arm_attr_merge.sh: New file.
5628 * testsuite/arm_attr_merge_[67][ab].s: Same.
5629
3e01a7fd
NC
56302010-05-05 Nick Clifton <nickc@redhat.com>
5631
5632 * po/es.po: Updated Spanish translation.
5633
7ad2014a
L
56342010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5635
5636 * Makefile.am (install-exec-local): Properly install gold as
5637 default cross linker.
5638 * Makefile.in: Regenerated.
5639
4fda8867
NC
56402010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5641 Nick Clifton <nickc@redhat.com>
5642
5643 * configure.ac (install_as_default): Define and set to false
5644 unless --enable-gold or --enable-gold=both/gold has been
5645 specified.
5646 * configure: Regenerate.
5647
5648 * Makefile.am (install-exec-local): Install the executable as
5649 'ld.gold'. If install_as_default is true then also install it as
5650 'ld'.
5651 * Makefile.in: Regenerated.
5652
bd288ea2
ILT
56532010-04-24 Ian Lance Taylor <iant@google.com>
5654
5655 * layout.cc (Layout::layout_reloc): In relocatable link don't
5656 combine reloc sections for grouped sections.
5657
ef38fd8a
ST
56582010-04-23 Sriraman Tallam <tmsriram@google.com>
5659
5660 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5661 sections that are not ordinary to icf.
5662 * icf.cc (get_section_contents): Handle relocation pointing to section
5663 with no object or shndx information.
5664 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5665 * testsuite/Makefile.in: Regenerate.
5666 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5667 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5668
f6973bdc
ILT
56692010-04-22 Ian Lance Taylor <iant@google.com>
5670
5671 * expression.cc (Expression::Expression_eval_info): Add
5672 result_alignment_pointer field.
5673 (Expression::eval_with_dot): Add result_alignment_pointer
5674 parameter. Change all callers.
5675 (Expression::eval_maybe_dot): Likewise.
5676 (class Binary_expression): Add alignment_pointer parameter to
5677 left_value and right_value. Change all callers.
5678 (BINARY_EXPRESSION): Set result alignment.
5679 (class Trinary_expression): Add alignment_pointer parameter to
5680 arg2_value and arg3_value. Change all callers.
5681 (Trinary_cond::value): Set result alignment.
5682 (Max_expression::value, Min_expression::value): Likewise.
5683 (Align_expression::value): Likewise.
5684 * script-sections.cc (class Sections_element): Add dot_alignment
5685 parameter to set_section_addresses virtual function. Update
5686 instantiations.
5687 (class Output_section_element): Likewise.
5688 (Script_sections::create_segments): Add dot_alignment parameter.
5689 Change all callers.
5690 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5691 (Script_sections::set_phdrs_clause_addresses): Likewise.
5692 * script-sections.h: Update declarations.
5693 * script.h: Update declarations.
5694 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5695 min_p_align.
5696 * testsuite/script_test_3.t: Set large alignment.
5697 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5698 segment has expected alignment.
5699
9c9c98a5
NC
57002010-04-22 Nick Clifton <nickc@redhat.com>
5701
5702 * po/gold.pot: Updated by the Translation project.
5703 * po/vi.po: Updated Vietnamese translation.
5704
2253bfba
L
57052010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5706
5707 * testsuite/Makefile.am (check_PROGRAMS): Add
5708 icf_virtual_function_folding_test.
5709 * testsuite/Makefile.in: Regenerated.
5710
85fdf906
AH
57112010-04-15 Andrew Haley <aph@redhat.com>
5712
5713 * options.h (merge_exidx_entries): New option.
5714 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5715 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5716 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5717 (Target_arm::merge_exidx_entries): New function.
5718 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5719 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5720 to Arm_exidx_fixup constructor.
5721 Add new arg, merge_exidx_entries.
5722 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5723 Arm_output_section::fix_exidx_coverage.
5724
ce97fa81
ST
57252010-04-18 Sriraman Tallam <tmsriram@google.com>
5726
5727 * icf.cc (get_section_contents): Check for preemptible functions.
5728 Ignore addend when appropriate.
5729 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5730 section folded.
5731 (add_from_relobj): Check for section folded.
5732 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5733 * symtab.h (should_add_dynsym_entry): Add new parameter.
5734 * target-reloc.h (scan_relocs): Check for section folded.
5735 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5736 Check reloc types for function pointers in shared objects.
5737 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5738 case.
5739 (icf_preemptible_functions_test): New test case.
5740 (icf_string_merge_test): New test case.
5741 * testsuite.Makefile.in: Regenerate.
5742 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5743 bar_glob. Refactor code.
5744 * testsuite/icf_preemptible_functions_test.cc: New file.
5745 * testsuite/icf_preemptible_functions_test.sh: New file.
5746 * testsuite/icf_string_merge_test.cc: New file.
5747 * testsuite/icf_string_merge_test.sh: New file.
5748 * testsuite/icf_virtual_function_folding_test.cc: New file.
5749 * testsuite/icf_virtual_function_folding_test.sh: New file.
5750
04ceb17c
DK
57512010-04-14 Doug Kwan <dougkwan@google.com>
5752
5753 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5754 for local symbol recounting if we remove a section due to ICF.
5755 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5756 there are no regular objects in input.
5757
153e7da4
DK
57582010-04-13 Doug Kwan <dougkwan@google.com>
5759
5760 * arm.cc (Arm_input_section::set_final_data_size): Compute
5761 accurate final data size instead of using current data size.
5762
4dbd9faf
DK
57632010-04-09 Doug Kwan <dougkwan@google.com>
5764
5765 * layout.cc (Layout::choose_output_section): Handle script section
5766 types.
5767 (Layout::make_output_section_for_script): Add section type parameter.
5768 Handle script section types.
5769 * layout.h (Layout::make_output_section_for_script): Add section
5770 type parameter.
5771 * output.cc (Output_section::Output_section): Initialize data member
5772 is_noload_.
5773 (Output_section::do_reset_address_and_file_offset): Do not set address
5774 to 0 if section is a NOLOAD section.
5775 * output.h (Output_section::is_noload): New method.
5776 (Output_section::set_is_noload): Ditto.
5777 (Output_section::is_noload_): New data member.
5778 * script-c.h (Script_section_type): New enum type.
5779 (struct Parser_output_section_header): Add new file section_type.
5780 * script-sections.cc (Sections_element::output_section_name): Add
5781 parameter for returning script section type.
5782 (Output_section_definition::output_section_name): Ditto.
5783 (Output_section_definition::section_type)P; New method.
5784 (Output_section_definiton::script_section_type_name): Ditto.
5785 (Output_section_definition::script_section_type_): New data member.
5786 (Output_section_definition::Output_section_definition): Initialize
5787 data member Output_section_definition::script_section_type_.
5788 (Output_section_definition::create_sections): Pass script section type
5789 to Layout::make_output_section_for_script.
5790 (Output_section_definition::output_section_name): Return script
5791 section type to caller.
5792 (Output_section_definition::set_section_address): Do not advance
5793 dot value and load address if section type is NOLOAD. Set address
5794 of NOLOAD sections regardless of section flags.
5795 (Output_section_definition::print): Print section type if it is
5796 not SCRIPT_SECTION_TYPE_NONE.
5797 (Output_section_definition::section_type): New method.
5798 (Output_section_definition::script_section_type_name): Ditto.
5799 (Script_sections::output_section_name): Add new parameter
5800 PSECTION_TYPE for returning script section type. Pass it to
5801 section elements. Handle discard sections.
5802 (Sort_output_sections::operator()): Handle NOLOAD sections.
5803 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 5804 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
5805 returning script section type.
5806 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5807 INFO and NOLOAD.
5808 * yyscript.y (union): Add new field SECTION_TYPE.
5809 (COPY, DSECT, INFO, NOLOAD): New tokens.
5810 (opt_address_and_section_type): Change type to output_section_header.
5811 (section_type): New non-terminal
5812 (section_header): Handle section type.
2253bfba 5813 (opt_address_and_section_type): Return section type value.
4dbd9faf 5814
721ea635
L
58152010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5816
5817 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5818 * testsuite/plugin_common_test_2.c (foo): Likewise.
5819
6bf924b0
DK
58202010-04-08 Doug Kwan <dougkwan@google.com>
5821
5822 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5823 Output_merge_data.
5824 * output.cc (Output_section::add_merge_input_section): Simplify
5825 code and return status of Output_merge_base::add_input_section.
e1df38aa 5826 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
5827 returns true.
5828
24af6f92
DK
58292010-04-07 Doug Kwan <dougkwan@google.com>
5830
5831 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5832 if section is marked as containing instructions but has no mapping
5833 symbols.
5834 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5835 correct section index.
5836 (Arm_relobj::find_linked_text_section): Ditto.
5837
00698fc5
CC
58382010-04-07 Cary Coutant <ccoutant@google.com>
5839
5840 * archive.cc (include_member): Destroy Read_symbols_data object before
5841 releasing file.
5842 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5843 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5844 (Read_symbols_data::~Read_symbols_data) New destructor.
5845 (Section_relocs::Section_relocs) New constructor.
5846 (Section_relocs::~Section_relocs) New destructor.
5847 (Read_relocs_data::Read_relocs_data) New constructor.
5848 (Read_relocs_data::~Read_relocs_data) New destructor.
5849 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5850 pointers to NULL after deleting.
5851
7296d933
DK
58522010-04-07 Doug Kwan <dougkwan@google.com>
5853
5854 * arm.cc: Replace "endianity" with "endianness" in comments.
5855 (Arm_exidx_cantunwind): Ditto.
5856 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5857 (Arm_relobj::merge_flags_and_attributes): New method.
5858 (Arm_relobj::merge_flags_and_attributes_): New data member.
5859 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5860 (Arm_relobj::scan_sections_for_stubs): Ditto.
5861 (Arm_relobj::do_read_symbols): Check to see if we really want to
5862 merge processor-specific flags and attributes. Exit early if
5863 an object is empty except for section names and the undefined symbol.
5864 (Target_arm::do_finalize_sections): Move check for ELF format to
5865 Arm_relobj::do_read_symbols. Merge processor specific flags and
5866 attributes from a regular object only when we have determined that
5867 it is aapropriate. Do not create an .ARM.attributes section in
5868 output if there is no regular input object.
5869 (Target_arm::merge_processor_specific_flags): Check
5870 --warn-mismatch before printing any error.
5871 (Target_arm::merge_object_attributes): Ditto.
5872 * gold.cc (queue_middle_tasks): Handle the case in which there is
5873 no regular object in input.
5874 * options.cc (General_options::parse_EB): New method.
5875 (General_options::parse_EL): Same.
5876 (General_options::General_options): Initialize endianness_.
5877 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5878 New options.
5879 (General_options::Endianness): New enum.
5880 (General_options::endianness): New method.
5881 (General_options::endianness_): New data member.
5882 * parameters.cc (Parameters::set_options): Check target endianness.
5883 (Parameters::set_target_once): Ditto.
5884 (Parameters::check_target_endianness): New method.
5885 (parameters_force_valid_target): If either -EL or -EB is specified,
5886 use it to define endianness of default target.
5887 * parameters.h (Parameters::check_target_endianness): New method
5888 declaration.
5889 * target.h (class Target): Change "endianity" to "endianness"
5890 in comments.
5891
efc8d4f2
RW
58922010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5893
5894 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5895 * configure: Regenerate.
5896 * Makefile.in: Regenerate.
5897 * testsuite/Makefile.in: Regenerate.
5898
be234d88
CC
58992010-04-06 Cary Coutant <ccoutant@google.com>
5900
5901 gcc PR lto/42757
5902 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5903 prevailing definitions of common symbols.
5904 * testsuite/plugin_test_6.sh: New test case.
5905 * testsuite/plugin_common_test_1.c: New test case.
5906 * testsuite/plugin_common_test_2.c: New test case.
5907 * testsuite/Makefile.am (plugin_test_6): New test case.
5908 * testsuite/Makefile.in: Regenerate.
5909
bd32c6bd
NC
59102010-04-06 Nick Clifton <nickc@redhat.com>
5911
5912 * po/vi.po: New Vietnamese translation.
5913
323c532f
DK
59142010-03-30 Doug Kwan <dougkwan@google.com>
5915
5916 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5917
4fcd97eb
DK
59182010-03-25 Doug Kwan <dougkwan@google.com>
5919
5920 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5921 to avoid a conversion warning on a 32-bit host.
5922
4ebf39db
ILT
59232010-03-24 Ian Lance Taylor <iant@google.com>
5924
5925 * testsuite/script_test_3.t: Add a TLS segment.
5926 * testsuite/Makefile.am (check_PROGRAMS): Add
5927 tls_phdrs_script_test.
5928 (tls_phdrs_script_test_SOURCES): Define.
5929 (tls_phdrs_script_test_DEPENDENCIES): Define.
5930 (tls_phdrs_script_test_LDFLAGS): Define.
5931 (tls_phdrs_script_test_LDADD): Define.
5932 * testsuite/Makefile.in: Rebuild.
5933
4a599bdd
CC
59342010-03-23 Cary Coutant <ccoutant@google.com>
5935
5936 * fileread.cc (find_or_make_view): Fix comment.
5937
6c93b22c
ILT
59382010-03-23 Ian Lance Taylor <iant@google.com>
5939
5940 * script-sections.cc (class Orphan_section_placement): Define
5941 PLACE_TLS and PLACE_TLS_BSS.
5942 (Orphan_section_placement::Orphan_section_placement): Initialize
5943 new places.
5944 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5945 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5946 (tls_script_test_SOURCES): Define.
5947 (tls_script_test_DEPENDENCIES): Define.
5948 (tls_script_test_LDFLAGS): Define.
5949 (tls_script_test_LDADD): Define.
5950 * testsuite/Makefile.in: Rebuild.
5951
a2c7281b
DK
59522010-03-22 Doug Kwan <dougkwan@google.com>
5953
5954 * arm.cc (Arm_relocate_functions::abs8,
5955 Arm_relocate_functions::abs16): Use correct check for overflow
5956 specified in the ARM ELF specs.
5957 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5958 target of a BLX instruction specially.
5959 (Reloc_stub::stub_type_for_reloc): Ditto.
5960 (Relocate::relocate): Use symbolic names instead of numeric relocation
5961 codes to report error.
5962 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5963 workaround.
5964 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5965 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5966 thumb2_blx_out_of_range.stdout
5967 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5968 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5969 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5970 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5971 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5972 thumb2_blx_in_range, thumb2_blx_in_range.o,
5973 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5974 thumb2_blx_out_of_range.o): New rules.
2e702c99 5975 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
5976 thumb2_blx_in_range and thumb2_blx_out_of_range.
5977 * testsuite/Makefile.in: Regenerate.
5978 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5979 * testsuite/thumb_blx_in_range.s: New file.
5980 * testsuite/thumb_blx_out_of_range.s: New file.
5981
b0193076
RÁE
59822010-03-22 Rafael Espindola <espindola@google.com>
5983
5984 * archive.cc (Should_include): Move to archive.h.
5985 (should_include_member): Make it a member of Archive.
5986 (Lib_group): New.
5987 (Add_lib_group_symbols): New.
5988 * archive.h: Include options.h.
5989 (Archive_member): Moved from Archive.
5990 (Should_include): Moved from archive.cc.
5991 (Lib_group): New.
5992 (Add_lib_group_symbols): New.
5993 * dynobj.cc (do_should_include_member): New.
5994 * dynobj.h (do_should_include_member): New.
5995 * gold.cc (queue_initial_tasks): Update call to queue.
5996 * main.cc (main): Print lib group stats.
5997 * object.cc (do_should_include_member): New.
5998 * object.h: Include archive.h.
5999 (Object::should_include_member): New.
6000 (Object::do_should_include_member): New.
6001 (Sized_relobj::do_should_include_member): New.
6002 * options.cc (General_options::parse_start_lib): New.
6003 (General_options::parse_end_lib): New.
6004 (Input_arguments::add_file): Handle lib groups.
6005 (Input_arguments::start_group): Check we are not in a lib.
6006 (Input_arguments::start_lib): New.
6007 (Input_arguments::end_lib): New.
6008 * options.h (General_options): Add start_lib and end_lib.
6009 (Input_argument::lib_): New.
6010 (Input_argument::lib): New.
6011 (Input_argument::is_lib): New.
6012 (Input_file_lib): New.
6013 (Input_arguments::in_lib_): New.
6014 (Input_arguments::in_lib): New.
6015 (Input_arguments::start_lib): New.
6016 (Input_arguments::end_lib_): New.
6017 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
6018 in unused members as preempted.
6019 (Sized_pluginobj::do_should_include_member): New.
6020 * plugin.h (Sized_pluginobj::do_should_include_member): New.
6021 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
6022 return the blocker.
6023 (Read_symbols::do_whole_lib_group): New.
6024 (Read_symbols::do_lib_group): New.
6025 (Read_symbols::do_read_symbols): Handle lib groups.
6026 (Read_symbols::get_name): Handle lib groups.
6027 * readsyms.h (Read_symbols): Add an archive member pointer.
6028 (Read_symbols::do_whole_lib_group): New.
6029 (Read_symbols::do_lib_group): New.
6030 (Read_symbols::member_): New.
6031 * script.cc (read_input_script): Update call to queue_soon.
6032
d099120c
DK
60332010-03-19 Doug Kwan <dougkwan@google.com>
6034
6035 * arm.cc (Stub_table::Stub_table): Initialize new data members
6036 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6037 (Stub_table::add_reloc_stub): Assign stub offset and update
6038 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6039 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6040 New data members.
2e702c99 6041 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
6042 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6043 instead of going over all reloc stubs.
2e702c99 6044 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
6045 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6046 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 6047 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
6048 Stringpool_template::offset_.
6049 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6050 Stringpool_template::offset_ to zero.
6051
1aa37384
DK
60522010-03-15 Doug Kwan <dougkwan@google.com>
6053
6054 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6055 offset_.
6056 (Stringpool_template::new_key_offset): New method.
6057 (Stringpool_template::add_string): Assign offsets when adding new
6058 strings.
6059 (Stringpool_template::set_string_offsets): Do not set string offsets
6060 when not optimizing.
6061 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6062 member size_.
2e702c99
RM
6063 (Chunked_vector::clear): Clear size_.
6064 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6065 (Chunked_vector::size): Return size_.
6066 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 6067 (Chunked_vector::size_): New data member.
1aa37384
DK
6068 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6069 (Stringpool_template::new_key_offset): New method declaration.
6070 (Stringpool_template::offset_): New data member.
6071
b672b057
RÁE
60722010-03-15 Rafael Espindola <espindola@google.com>
6073
6074 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6075 Add_symbols' constructor.
6076 * readsyms.h (Add_symbols): Remove the input_group member.
6077
b6848d3c
ILT
60782010-03-10 Ian Lance Taylor <iant@google.com>
6079
6080 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6081 target to ask whether a reference to a symbol requires a stack
6082 split.
6083 * target.h (Target::is_call_to_non_split): New function.
6084 (Target::do_is_call_to_non_split): Declare virtual function.
6085 * target.cc: Include "symtab.h".
6086 (Target::do_is_call_to_non_split): New function.
6087 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6088
a2a5469e
CC
60892010-03-10 Cary Coutant <ccoutant@google.com>
6090
6091 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6092 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6093 (File_read::open[2]): Add whole_file_view_ to list of views.
6094 (File_read::make_view): Remove test of whole_file_view_.
6095 (File_read::find_or_make_view): Create whole_file_view_ if
6096 necessary.
6097 (File_read::clear_views): Replace bool parameter with enum;
6098 adjust all callers. Don't delete views with permanent data;
6099 do delete cached views and views from archives if
6100 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6101 if clearing the corresponding view.
6102 * fileread.h (File_read::Clear_views_mode): New enum.
6103 (File_read::View::is_permanent_view): New method.
6104 (File_read::clear_views): Replace bool parameter
6105 with enum; adjust all callers.
6106 * options.h (General_options): Change keep_files_mapped option;
6107 add map_whole_files.
6108 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6109 releasing the file.
6110 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6111 the file.
6112
8861f32b
DM
61132010-03-10 David S. Miller <davem@davemloft.net>
6114
6115 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6116
d62d0f5f
ST
61172010-03-09 Sriraman Tallam <tmsriram@google.com>
6118
6119 * icf.cc (get_section_contents): Add '@' marker after processing the
6120 merge reloc.
6121
9177756d
DK
61222010-03-08 Doug Kwan <dougkwan@google.com>
6123
6124 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6125 due to a conversion warning.
6126 (Arm_relobj::update_output_local_symbol_count): Check for local
6127 symbol with unset output index.
6128
9e9e071b
ILT
61292010-03-05 Ian Lance Taylor <iant@google.com>
6130
6131 * options.h (class General_options): Add --spare-dynamic-tags.
6132 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6133 --spare-dynamic-tags.
6134
a81ee015
ILT
61352010-03-05 Ian Lance Taylor <iant@google.com>
6136
6137 * incremental.cc: Include "libiberty.h".
6138
44ec90b9
RO
61392010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6140
6141 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6142 function, is_info_ member.
6143 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6144 (Versions::Versions): Update caller.
6145 (Versions::define_base_version): Likewise.
6146 (Versions::add_def): Likewise.
6147
0897ed3b
ST
61482010-03-03 Sriraman Tallam <tmsriram@google.com>
6149
6150 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6151 (Scan::possible_function_pointer_reloc): New function.
6152 (Scan::local_reloc_may_be_function_pointer): Change to call
6153 possible_function_pointer_reloc.
6154 (Scan::global_reloc_may_be_function_pointer): Ditto.
6155 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6156 relocations in ".data.rel.ro._ZTV" section.
6157 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6158 * testsuite/icf_safe_so_test.cc: Ditto.
6159 * testsuite/icf_safe_test.cc: Ditto.
6160 * testsuite/icf_safe_test.sh: Ditto.
6161
d3bbad62
ILT
61622010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6163 Ian Lance Taylor <iant@google.com>
6164
6165 * target-reloc.h (relocate_section): Check the symbol table index
6166 for -1U before setting the local symbol index.
6167 (scan_relocatable_relocs): If copying the relocation, record that
6168 the local symbol is required.
6169 * object.h (Symbol_value::is_output_symtab_index_set): New
6170 function.
6171 (Symbol_value::may_be_discarded_from_output_symtab): New
6172 function.
6173 (Symbol_value::has_output_symtab_entry): New function.
6174 (Symbol_value::needs_output_symtab_entry): Remove.
6175 (Symbol_value::output_symtab_index): Make sure the symbol index is
6176 set.
6177 (Symbol_value::set_output_symtab_index): Make sure the symbol
6178 index is not set. Make sure the new index is valid.
6179 (Symbol_value::set_must_have_output_symtab_entry): New function.
6180 (Symbol_value::has_output_dynsym_entry): New function.
6181 (Symbol_value::set_output_dynsym_index): Make sure the new index
6182 is valid.
6183 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6184 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6185 local symbol if permitted.
6186 (Sized_relobj::do_finalize_local_symbols): Call
6187 is_output_symtab_index_set rather than needs_output_symtab_entry.
6188 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6189 rather than needs_output_symtab_entry. Call
6190 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6191 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6192 is_output_symtab_index_set rather than needs_output_symtab_entry.
6193 * testsuite/discard_locals_relocatable_test.c: New file.
6194 * testsuite/discard_locals_test.sh: Test -r.
6195 * testsuite/Makefile.am (check_DATA): Add
6196 discard_locals_relocatable_test1.syms,
6197 discard_local_relocatable_test2.syms.
6198 (MOSTLYCLEANFILES): Likewise. Also add
6199 discard_locals_relocatable_test1.lout and
6200 discard_locals_relocatable_test2.out.
6201 (discard_locals_relocatable_test1.syms): New target.
6202 (discard_locals_relocatable_test.o): New target.
6203 (discard_locals_relocatable_test1.out): New target.
6204 (discard_locals_relocatable_test2.syms): New target.
6205 (discard_locals_relocatable_test2.out): New target.
6206 (various): Add missing ../ld-new dependencies.
6207 * testsuite/Makefile.in: Rebuild.
6208
7e8ccf26
NC
62092010-03-03 Nick Clifton <nickc@redhat.com>
6210
6211 * po/fi.po: New Finnish translation.
6212
2a0ff005
DK
62132010-03-01 Doug Kwan <dougkwan@google.com>
6214
6215 * layout.cc (Layout::Layout): Force section types of .init_array*,
6216 .preinit_array* and .fini_array* sections.
6217 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6218 Fix check of return value of std::string::find.().
6219 (Output_section::Input_section_sort_compare::operator()): Remove
6220 comment about .init_array.
6221 (Output_section::Input_section_sort_init_fini_compare::operator()):
6222 New method.
6223 (Output_section::sort_attached_input_sections): Handle .init_array
6224 and .fini_array specially.
6225 * output.h (Output_section::Inut_section_sort_compare): Update
6226 comment.
6227 (Output_section::Input_section_sort_init_fini_compare): New struct.
6228
c3e4ae29
DK
62292010-02-26 Doug Kwan <dougkwan@google.com>
6230
6231 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6232 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6233 * testsuite/debug_msg.sh: Avoid matching source line number for
6234 use of global variable undef_int.
6235
2fd9ae7a
DK
62362010-02-26 Doug Kwan <dougkwan@google.com>
6237
6238 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6239 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6240 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6241 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6242 * options.cc (General_options::General_options): Initialize member
6243 fix_v4bx_.
6244 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6245 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6246 and rm_no_fix_v4bx.stdout
6247 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6248 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6249 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6250 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6251 and arm_no_fix_v4bx.
6252 * Makefile.in: Regenerate.
6253 * testsuite/arm_fix_v4bx.s: New file.
6254 * testsuite/arm_fix_v4bx.sh: Ditto.
6255
67ec7d0b
DK
62562010-02-24 Doug Kwan <dougkwan@google.com>
6257
6258 * arm.cc (Target_arm::got_section): Make the .got section the first
6259 non RELRO section in the data segment.
6260 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6261 suffixes of section names.
6262
10165461
DK
62632010-02-24 Doug Kwan <dougkwan@google.com>
6264
6265 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6266 flags and attributes merging if an input file is a binary file.
6267 * fileread.cc (Input_file::open): Record format of original file.
6268 * fileread.h (Input_file::Format): New enum type.
2e702c99 6269 (Input_file::Input_file): Initialize data member format_.
10165461
DK
6270 (Input_file::format): New method definition.
6271 (Input_file::format_):: New data member.
6272
4a54abbb
DK
62732010-02-24 Doug Kwan <dougkwan@google.com>
6274
6275 * arm.cc (Arm_output_data_got): New class.
6276 (ARM_TCB_SIZE): New constant
6277 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6278 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6279 If user uses a script with a SECTIONS clause, issue only a warning
6280 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 6281 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
6282 garbage collection.
6283 (Target_arm::got_mode_index_entry): Handle static linking.
6284 (Target_arm::Scan::local): Ditto.
6285 (Target_arm::Scan::global): Ditto.
6286 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6287 all incorrectly implemented relocations.
e1df38aa 6288 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
6289 Arm_output_section::fix_exidx_coverage.
6290 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6291 from ".ARM.exidx." and ".ARM.extab.".
6292
ca419a6f
ILT
62932010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6294
6295 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6296 section if it does not already exist.
6297 * attributes.cc (Attributes_section_data::Attributes_section_data):
6298 Don't crash if size is zero.
6299
135b9c78
ILT
63002010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6301 Ian Lance Taylor <iant@google.com>
6302
6303 * gold.cc (queue_middle_tasks): If no input files were opened,
6304 exit.
6305 * workqueue.h (Task_function::Task_function): Assert that there is
6306 a blocker.
6307
bb0bfe4f
DK
63082010-02-22 Doug Kwan <dougkwan@google.com>
6309
6310 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6311 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6312 types to avoid warnings due to different uint64_t implementations
6313 on different hosts.
6314
2a2b6d42
DK
63152010-02-21 Doug Kwan <dougkwan@google.com>
6316
6317 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6318 handling of the maximum backward branch offset.
2e702c99 6319 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
6320 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6321 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 6322 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
6323 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6324 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6325 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6326 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6327 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6328 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6329 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6330 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6331 thumb2_bl_out_of_range.o): New rules.
6332 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6333 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6334 thumb2_bl_out_of_range
6335 * testsuite/Makefile.in: Regenerate.
6336 * testsuite/arm_bl_in_range.s: New file.
6337 * testsuite/arm_bl_out_of_range.s: Ditto.
6338 * testsuite/arm_branch_in_range.sh: Ditto.
6339 * testsuite/arm_branch_range.t: Ditto.
6340 * testsuite/thumb2_branch_range.t: Ditto.
6341 * testsuite/thumb_bl_in_range.s: Ditto.
6342 * testsuite/thumb_bl_out_of_range.s: Ditto.
6343 * testsuite/thumb_branch_range.t: Ditto.
6344
b487ad64
ST
63452010-02-20 Sriraman Tallam <tmsriram@google.com>
6346
6347 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6348 Add reloc offset information.
6349 * icf.cc (get_section_contents): Change iterators to point to the new
6350 vectors. Add reloc offset information to the contents.
6351 * icf.h (Icf::Sections_reachable_info): New typedef.
6352 (Icf::Sections_reachable_list): New typedef.
6353 (Icf::Offset_info): New typedef.
6354 (Icf::Reloc_info): New struct typedef.
6355 (Icf::Reloc_info_list): New typedef.
6356 (Icf::symbol_reloc_list): Delete method.
6357 (Icf::addend_reloc_list): Delete method.
6358 (Icf::section_reloc_list): Delete method.
6359 (Icf::reloc_info_list): New method.
6360 (Icf::reloc_info_list_): New member.
6361
f96accdf
DK
63622010-02-19 Doug Kwan <dougkwan@google.com>
6363
6364 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6365 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6366 * arm.cc (Arm_relocation_functions): New forward declaration.
6367 (Target_arm::Target_arm): Initialize new data members
6368 got_mod_index_offset_ and tls_base_symbol_defined_.
6369 (Target_arm::Relocate::relocate_tls): New method.
6370 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6371 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6372 New methods.
2e702c99 6373 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
6374 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6375 (Target_arm::got_mod_index_offset_,
6376 Target_arm::tls_base_symbol_defined_): New data members.
6377 (Target_arm::Scan::local, Target::Scan::global,
6378 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6379 relocations.
6380
c8761b9a
DK
63812010-02-18 Doug Kwan <dougkwan@google.com>
6382
6383 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6384 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6385 text section as a parameter becuase some broken tools may not set
6386 the link in section header.
6387 (Target_arm::has_got_section): New method.
6388 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6389 without any mapping symbol as data only. Remove warning.
6390 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6391 link in its section header, try to discover the link by inspecting the
6392 REL31 relocation at the beginning of the section.
6393 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6394 in error message.
6395 (Target_arm::Scan::global): Treat any reference to the symbol
6396 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6397
21bb3914
ST
63982010-02-12 Sriraman Tallam <tmsriram@google.com>
6399
6400 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6401 (Scan::global_reloc_may_be_function_pointer): New function.
6402 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6403 (Scan::global_reloc_may_be_function_pointer): New function.
6404 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6405 (Scan::global_reloc_may_be_function_pointer): New function.
6406 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6407 (Scan::global_reloc_may_be_function_pointer): New function.
6408 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6409 (Scan::global_reloc_may_be_function_pointer): New function.
6410 (Scan::possible_function_pointer_reloc): New function.
6411 (Target_x86_64::can_check_for_function_pointers): New function.
6412 * gc.h (gc_process_relocs): Scan relocation types to determine if
6413 function pointers were taken for targets that support it.
6414 * icf.cc (Icf::find_identical_sections): Include functions for
6415 folding in safe ICF whose pointer is not taken.
6416 * icf.h (Secn_fptr_taken_set): New typedef.
6417 (fptr_section_id_): New member.
6418 (section_has_function_pointers): New function.
6419 (set_section_has_function_pointers): New function.
6420 (check_section_for_function_pointers): New function.
6421 * options.h: Fix comment for safe ICF option.
6422 * target.h (can_check_for_function_pointers): New function.
6423 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6424 Modify icf_safe_test for X86-64.
6425 * testsuite/Makefile.in: Regenerate.
6426 * testsuite/icf_safe_so_test.cc: New file.
6427 * testsuite/icf_safe_so_test.sh: New file.
6428 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6429 (main): Change to take pointer to function kept_func_3.
6430 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6431 folding is done correctly for X86-64.
6432
0da6fa6c
DM
64332010-02-12 David S. Miller <davem@davemloft.net>
6434
6435 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6436 is_symbolless parameter.
6437 (Output_reloc<SHT_REL>::is_symbolless): New.
6438 (Output_reloc<SHT_REL>::is_symbolless_): New.
6439 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6440 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6441 (Output_reloc<SHT_RELA>::is_symbolless): New.
6442 (Output_data_reloc::add_global): Handle is_symbolless.
6443 (Output_data_reloc::add_global_relative): Likewise.
6444 (Output_data_reloc::add_local): Likewise.
6445 (Output_data_reloc::add_local_relative): Likewise.
6446 (Output_data_reloc::add_symbolless_global_addend): New.
6447 (Output_data_reloc::add_symbolless_local_addend): New.
6448 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6449 is_symbolless.
6450 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6451 instead of ->is_relative_
6452 (Output_reloc::write): Likewise.
6453 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6454 (Output_reloc::write_rel): Simplify.
6455
6456 * sparc.cc (Target_sparc::Scan::local): Use
6457 ->add_symbolless_local_addend as needed.
6458 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6459 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6460 based upon relocation offset.
6461
e4782e83
DK
64622010-02-11 Doug Kwan <dougkwan@google.com>
6463
6464 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6465 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6466 beginning of function.
6467 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6468 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6469 parameter is_32bit in calls to should_apply_static_reloc.
6470 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6471 (check_DATA): Add arm_abs_global.stdout.
6472 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6473 arm_abs_global.stdout): New rules.
6474 (MOSTLLYCLEANFILES): Add arm_abs_global
6475 * Makefile.in: Regenerate.
6476 * testsuite/arm_abs_global.s: New file.
6477 * testsuite/arm_abs_global.sh: Ditto.
6478 * testsuite/arm_abs_lib.s: Ditto.
6479
93ceb764
ILT
64802010-02-11 Ian Lance Taylor <iant@google.com>
6481
6482 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6483 Read_relocs task.
6484 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6485 Allocate_commons_task first.
6486 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6487 task, rather than symtab_lock_.
6488 (Gc_process_relocs::~Gc_process_relocs): New function.
6489 (Gc_process_relocs::is_runnable): Check this_blocker_.
6490 (Gc_process_relocs::locks): Use next_blocker_ rather than
6491 blocker_.
6492 (Scan_relocs::~Scan_relocs): New function.
6493 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6494 symtab_lock_.
6495 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6496 next_blocker_.
6497 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6498 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6499 constructor accordingly.
6500 (class Gc_process_relocs): Likewise.
6501 (class Scan_relocs): Likewise.
6502 * common.h (class Allocate_commons_task): Remove symtab_lock_
6503 field, and corresponding constructor parameter.
6504 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6505 symtab_lock_.
6506 (Allocate_commons_task::locks): Likewise.
6507
114dfbe1
ILT
65082010-02-11 Ian Lance Taylor <iant@google.com>
6509
6510 * gold-threads.h (class Once): Define.
6511 (class Initialize_lock): Rewrite as child of Once.
6512 * gold-threads.cc (class Once_initialize): Define.
6513 (once_pointer_control): New static variable.
6514 (once_pointer, once_arg): New static variables.
6515 (c_run_once): New static function.
6516 (Once::Once, Once::run_once, Once::internal_run): New functions.
6517 (class Initialize_lock_once): Remove.
6518 (initialize_lock_control): Remove.
6519 (initialize_lock_pointer): Remove.
6520 (initialize_lock_once): Remove.
6521 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6522 (Initialize_lock::initialize): Rewrite.
6523 (Initialize_lock::do_run_once): New function.
6524 * archive.cc (Archive::interpret_header): Only clear name if it is
6525 not already empty.
6526 * fileread.cc: Include "gold-threads.h"
6527 (file_counts_lock): New static variable.
6528 (file_counts_initialize_lock): Likewise.
6529 (File_read::release): Only increment counts when using --stats.
6530 Use a lock around the increment.
6531 * parameters.cc (class Set_parameters_target_once): Define.
6532 (set_parameters_target_once): New static variable.
6533 (Parameters::Parameters): Move here from parameters.h.
6534 (Parameters::set_target): Rewrite.
6535 (Parameters::set_target_once): New function.
6536 (Parameters::clear_target): Move here and rewrite.
6537 * parameters.h (class Parameters): Update declarations. Add
6538 set_parameters_target_once_ field.
6539 (Parameters::Parameters): Move to parameters.cc.
6540 (Parameters::clear_target): Likewise.
6541 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6542 task.
6543 (Start_group::~Start_group): New function.
6544 (Start_group::is_runnable): New function.
6545 (Start_group::locks, Start_group::run): New functions.
6546 (Finish_group::run): Change saw_undefined to size_t.
6547 * readsyms.h (class Start_group): Define.
6548 (class Finish_group): Change saw_undefined_ field to size_t.
6549 (Finish_group::Finish_group): Remove saw_undefined and
6550 this_blocker parameters. Change all callers.
6551 (Finish_group::set_saw_undefined): New function.
6552 (Finish_group::set_blocker): New function.
6553 * symtab.h (class Symbol_table): Change saw_undefined to return
6554 size_t. Change saw_undefined_ field to size_t.
6555 * target-select.cc (Set_target_once::do_run_once): New function.
6556 (Target_selector::Target_selector): Initialize set_target_once_
6557 field. Don't initialize lock_ and initialize_lock_ fields.
6558 (Target_selector::instantiate_target): Rewrite.
6559 (Target_selector::set_target): New function.
6560 * target-select.h (class Set_target_once): Define.
6561 (class Target_selector): Update declarations. Make
6562 Set_target_once a friend. Remove lock_ and initialize_lock_
6563 fields. Add set_target_once_ field.
6564
fa17a3f4
ILT
65652010-02-10 Ian Lance Taylor <iant@google.com>
6566
6567 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6568 queueing any tasks.
6569 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6570 (queue_middle_tasks): Add all blockers before queueing any tasks.
6571 (queue_final_tasks): Likewise.
6572 * token.h (Task_token::add_blockers): New function.
6573 * object.h (Input_objects::number_of_relobjs): New function.
6574
c7177d31
ILT
65752010-02-10 Ian Lance Taylor <iant@google.com>
6576
5de0e392
ILT
6577 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6578 shared, not if not position independent.
6579 * x86_64.cc (Relocate::relocate_tls): Likewise.
6580 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6581 (tls_pie_pic_test): New target.
6582 * testsuite/Makefile.in: Rebuild.
6583
c7177d31
ILT
6584 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6585 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6586 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6587 * testsuite/Makefile.in: Rebuild.
6588
684b268a
DM
65892010-02-09 David S. Miller <davem@davemloft.net>
6590
6591 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6592 R_SPARC_RELATIVE using ->add_local_relative().
6593 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6594
612a8d3d
DM
6595 * output.h (Output_data_dynamic::add_section_size): New method
6596 that takes two Output_data objects.
6597 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6598 entry param. Handle it in initializers.
6599 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6600 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6601 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6602 arg.
6603 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6604 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6605 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6606 for dynrel_includes_plt.
6607 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6608 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6609 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6610 before .rela.plt
6611 (Target_sparc::do_finalize_sections): Update to pass true for
6612 dynrel_includes_plt.
6613 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6614 output before .rela.plt
6615 (Target_powerpc::do_finalize_sections): Update to pass true for
6616 dynrel_includes_plt when 32-bit.
6617
cb1be87e
DK
66182010-02-08 Doug Kwan <dougkwan@google.com>
6619
6620 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6621 method.
6622 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6623 Arm_relobj::scan_section_for_cortex_a8_stubs,
6624 Arm_relobj::do_relocation_section): Instead of calling
6625 Output_section::output_address, use faster
6626 Arm_relobj::simple_input_section_output_address.
6627
705b5121
DM
66282010-02-08 David S. Miller <davem@davemloft.net>
6629
6630 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6631 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6632 relocation helper function.
6633
024c4466
DM
6634 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6635 just like R_SPARC_GOT{10,13,22}.
6636 (Target_sparc::Scan::local): Likewise.
6637 (Target_sparc::Relocate:relocate): Likewise.
6638
9109c078
ILT
66392010-02-06 Ian Lance Taylor <iant@google.com>
6640
6641 * configure.ac: Rewrite targetobjs duplicate removal code to use
6642 only shell constructs.
6643 * configure: Rebuild.
6644
cf846138
DK
66452010-02-05 Doug Kwan <dougkwan@google.com>
6646
6647 PR 11247
6648 * arm.cc (Arm_relobj::section_is_scannable): New method.
6649 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6650 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6651
6cfaf60b
DK
66522010-02-04 Doug Kwan <dougkwan@google.com>
6653
6654 PR 11247
6655 * arm-reloc-property.cc (cstdio): Include.
6656 * configure.ac (targetobjs): Remove duplicates.
6657 * configure: Regenerate.
6658 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6659 big and little endian version for a given address size.
6660
5c57f1be
DK
66612010-02-03 Doug Kwan <dougkwan@google.com>
6662
6663 * arm-reloc-property.cc
6664 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6665 definition.
6666 * arm-reloc-property.h
6667 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6668 New method definition.
6669 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6670 declaration.
6671 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6672 overflow to N.
6673 (GOT_PREL): Change implemented to Y.
6674 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6675 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6676 (Arm_relocate_functions::movw_abs_nc): Remove method.
6677 (Arm_relocate_functions::movt_abs): Ditto.
6678 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6679 (Arm_relocate_functions::thm_movt_abs): Ditto.
6680 (Arm_relocate_functions::movw_rel_nc): Ditto.
6681 (Arm_relocate_functions::movw_rel): Ditto.
6682 (Arm_relocate_functions::movt_rel): Ditto.
6683 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6684 (Arm_relocate_functions:thm_movw_rel): Ditto.
6685 (Arm_relocate_functions:thm_movt_rel): Ditto.
6686 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6687 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6688 New method definitions.
6689 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6690 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6691 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6692 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6693 (Target_arm::Relocate::relocate): Check for non-static or
6694 unimplemented relocation code and exit early. Change calls to
6695 Target_arm::reloc_uses_thumb_bit and
6696 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6697 instead. Refactor code to handle similar relocations to increase
6698 code sharing. Remove check for unsupported relocation code in switch
6699 statement.
6700 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6701 relocation property table to find out size. Change error message to
6702 print out the name of a relocation code instead of the numeric value.
6703 (Target_arm::scan_reloc_for_stub): Use relocation property table
6704 instead of calling Target_arm::reloc_uses_thumb_bit().
6705
218c5831
DK
67062010-02-02 Doug Kwan <dougkwan@google.com>
6707
6708 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6709 types of relaxed input section.
6710
0d31c79d
DK
67112010-02-02 Doug Kwan <dougkwan@google.com>
6712
6713 * Makefile.am (HFILES): Add arm-reloc-property.h.
6714 (DEFFILES): New.
2e702c99
RM
6715 (TARGETSOURCES): Add arm-reloc-property.cc
6716 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
6717 (libgold_a_SOURCES): $(DEFFILES)
6718 * Makefile.in: Regenerate.
6719 * arm-reloc-property.cc: New file.
6720 * arm-reloc-property.h: New file.
6721 * arm-reloc.def: New file.
6722 * arm.cc: Update comments.
6723 (arm-reloc-property.h): New included header.
6724 (arm_reloc_property_table): New global variable.
6725 (Target_arm::do_select_as_default_target): New method definition.
6726 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6727 arm-reloc-property to targ_extra_obj.
6728 * parameters.cc (set_parameters_target): Call
6729 Target::select_as_default_target().
6730 * target.h (Target::select_as_default_target): New method definition.
6731 (Target::do_select_as_default_target): Same.
6732
546c7457
DK
67332010-02-01 Doug Kwan <dougkwan@google.com>
6734
6735 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6736 first_output_text_section_.
6737 (Arm_exidx_fixup::first_output_text_section): New method definition.
6738 (Arm_exidx_fixup::first_output_text_section_): New data member.
6739 (Arm_exidx_fixup::process_exidx_section): Record the first text
6740 output section seen.
6741 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6742 and entsize in output section header.
6743
11b861d5
DK
67442010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6745
6746 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6747 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6748 (Arm_relocate_functions::thm_alu11): New Method.
6749 (Arm_relocate_functions::thm_pc8): New Method.
6750 (Arm_relocate_functions::thm_pc12): New Method.
6751 (Target_arm::Scan::local): Handle the relocations.
6752 (Target_arm::Scan::global): Likewise.
6753 (Target_arm::Relocate::relocate): Likewise.
6754 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6755
c9a2c125
DK
67562010-01-29 Doug Kwan <dougkwan@google.com>
6757
6758 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6759 of relocation types as ld.
6760
1521477a
DK
67612010-01-29 Doug Kwan <dougkwan@google.com>
6762
6763 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6764 to public.
6765 (Arm_relocate_functions::thumb_branch_common): Ditto.
6766 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6767 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6768 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6769 Arm_relocate_functions::jump24): Remove.
6770 (Target_arm::Relocate::relocate): Adjust code to call
6771 Arm_relocation_functions::arm_branch_common and
6772 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 6773 wrappers. Merge switch-cases together to reduce source code size.
1521477a 6774
e7eca48c
DK
67752010-01-29 Doug Kwan <dougkwan@google.com>
6776
6777 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6778 output_local_symbol_count_needs_update_.
6779 (Arm_relobj::output_local_symbol_count_needs_update,
6780 Arm_relobj::set_output_local_symbol_count_needs_update,
6781 Arm_relobj::update_output_local_symbol_count): New methods.
6782 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6783 member.
6784 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6785 of pointed function as in a R_ARM_PREL31 relocation.
6786 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6787 for output local symbol count updating.
6788 (Target_arm::do_relax): Update output local symbol counts in objects
6789 if necessary.
6790 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6791
02961d7e
ILT
67922010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6793
6794 * arm.cc: Added support for the ARM relocations:
6795 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6796 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6797 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6798 movw_prel_nc).
6799 (Arm_relocate_functions::movw_rel): New method.
6800 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6801 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6802 thm_movw_prel_nc).
6803 (Arm_relocate_functions::thm_movw_rel): New method.
6804 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6805 thm_movt_prel).
6806 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6807 relocations.
6808 (Target_arm::Scan::global): Likewise.
6809 (Target_arm::Relocate::relocate): Likewise.
6810 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6811 Likewise.
6812
b10d2873
ILT
68132010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6814
6815 * arm.cc: Added support for ARM group relocations.
6816 (Target_arm::reloc_needs_sym_origin): New method.
6817 (Arm_relocate_functions::calc_grp_kn): New method.
6818 (Arm_relocate_functions::calc_grp_residual): New method.
6819 (Arm_relocate_functions::calc_grp_gn): New method.
6820 (Arm_relocate_functions::arm_grp_alu): New Method.
6821 (Arm_relocate_functions::arm_grp_ldr): New Method.
6822 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6823 (Arm_relocate_functions::arm_grp_ldc): New Method.
6824 (Target_arm::Scan::local): Handle the ARM group relocations.
6825 (Target_arm::Scan::global): Likewise.
6826 (Target_arm::Relocate::relocate): Likewise.
6827 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6828 Likewise.
6829
2b328d4e
DK
68302010-01-26 Doug Kwan <dougkwan@google.com>
6831
6832 * arm.cc (set): Include.
6833 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6834 pointer type.
2e702c99 6835 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
6836 (Arm_output_section::append_text_sections_to_list): New method.
6837 (Arm_output_section::fix_exidx_coverage): Ditto.
6838 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 6839 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
6840 Relobj::set_section_offset() instead of
6841 Sized_relobj::invalidate_section_offset().
2e702c99 6842 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
6843 parameter for section headers. Ignore relocation sections for
6844 unallocated sections and EXIDX sections.
6845 (Target_arm::fix_exidx_coverage): New method.
6846 (Target_arm::output_section_address_less_than): New type.
6847 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6848 linked text section instead of the EXIDX section.
6849 (Arm_output_section::create_stub_group): Add an assertion to check
6850 that this is not an EXIDX output section.
6851 (Arm_output_section::append_text_sections_to_list): New method.
6852 (Arm_output_section::fix_exidx_coverage): Ditto.
6853 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 6854 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
6855 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6856 first pass.
6857 (Target_arm::fix_exidx_coverage): New method.
6858 * object.h (Relobj::set_output_section): New method.
6859 (Sized_relobj::invalidate_section_offset): Remove method.
6860 (Sized_relobj::do_invalidate_section_offset): Remove method.
6861 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6862
c7f3c371
DK
68632010-01-25 Doug Kwan <dougkwan@google.com>
6864
6865 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6866 Fix warning due to signed and unsigned comparison on a 32-bit host.
6867
8923b24c
DK
68682010-01-22 Doug Kwan <dougkwan@google.com>
6869
6870 * arm.cc (Target_arm::do_relax): Record an output section for section
6871 offset adjustment it contains any stub table that has changed.
6872 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6873 offsets in an output section if necessary.
6874 * output.cc (Output_section::Output_section): Initialize
6875 section_offsets_need_adjustments_.
6876 (Output_section::add_input_section_for_script): Renamed to
6877 Output_section::add_simple_input_section.
6878 (Output_section::save_states): Add a comment.
6879 (Output_section::discard_states): New method defintion.
6880 (Output_section::adjust_section_offsets): Same.
6881 * output.h (Output_section::add_input_section_for_script): Renamed to
6882 Output_section::add_simple_input_section.
6883 (Output_section::discard_states): New method declaration.
6884 (Output_section::adjust_section_offsets): Same.
6885 (Output_section::section_offsets_need_adjustment,
6886 Output_section::set_section_offsets_need_adjustment): New method
6887 definitions.
6888 (Output_section::section_offsets_need_adjustment_): New data member.
6889 * script-sections.cc
6890 (Output_section_element_input::set_section_address): Adjust code for
6891 renaming of Output_section::add_input_section_for_script.
6892 (Orphan_output_section::set_section_address): Same.
6893
9b2fd367
DK
68942010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6895
6896 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6897 Fix_v4bx enum values .
6898 * gold/options.h (General_options): New option definitions.
6899 (General_options::fix_v4bx): New method.
6900 (General_options::Fix_v4bx): New enum.
6901 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6902 (General_options::parse_fix_v4bx_interworking): New method.
6903
80d0d023
DK
69042010-01-22 Doug Kwan <dougkwan@google.com>
6905
6906 * arm.cc (Arm_exidx_fixup): New class.
6907
af2cdeae
DK
69082010-01-21 Doug Kwan <dougkwan@google.com>
6909
6910 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6911 classes.
6912 (Arm_exidx_section_offset_map): New type.
6913
993d07c1
DK
69142010-01-21 Doug Kwan <dougkwan@google.com>
6915
6916 * arm.cc (Arm_exidx_input_section): New class.
6917 (Arm_relobj::exidx_input_section_by_link,
6918 Arm_relobj::exidx_input_section_by_shndx,
6919 Arm_relobj::make_exidx_input_section): New methods.
6920 (read_arm_attributes_section): Remove.
6921 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6922 information about them.
6923 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6924 to here.
6925
5ac169d4
DK
69262010-01-20 Doug Kwan <dougkwan@google.com>
6927
6928 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6929 Input_section_specifier to Section_id.
6930 (Target_arm::new_arm_input_section: Adjust code for change of key
6931 type.
6932 (Target_arm::find_arm_input_section): Ditto.
6933 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6934 (Section_id): Remove.
6935 (Garbage_collection::Section_id_hash): Remove.
6936 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6937 (Section_id): Remove.
6938 (Icf::Section_id_hash): Remove.
6939 * object.h (Section_id, Const_section_id, Section_id_hash,
6940 Const_section_id_hash): New type definitions.
6941 * output.cc (Output_section::add_relaxed_input_section): Change to
6942 use Const_section_id instead of Input_section_specifier as key type.
6943 (Output_section::add_merge_input_section): Ditto.
6944 (Output_section::build_relaxation_map): Change to use Section_id
6945 instead of Input_section_specifier as key type.
2e702c99 6946 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
6947 Ditto.
6948 (Output_section::convert_input_sections_to_relaxed_sections): Change
6949 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 6950 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
6951 (Output_section::find_relaxed_input_section): Ditto.
6952 * output.h (Input_section_specifier): Remove class.
6953 (Output_section::Output_section_data_by_input_section_map): Change
6954 key type to Const_section_id.
6955 (Output_section::Output_relaxed_input_section_by_input_section_map):
6956 Ditto.
6957 (Output_section::Relaxation_map): Change key type to Section_id.
6958
a2162063
ILT
69592010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6960
6961 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6962 (class Arm_v4bx_stub): New class.
6963 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6964 (Stub_factory::make_arm_v4bx_stub): New method.
6965 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6966 (Stub_table::empty): Handle v4bx stubs.
6967 (Stub_table::add_arm_v4bx_stub): New method.
6968 (Stub_table::find_arm_v4bx_stub): New method.
6969 (Arm_relocate_functions::v4bx): New method.
6970 (Target_arm::fix_v4bx): New method.
6971 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6972 (Stub_table::relocate_stubs): Likewise.
6973 (Stub_table::do_write): Likewise.
6974 (Stub_table::update_data_size_and_addralign): Likewise.
6975 (Stub_table::finalize_stubs): Likewise.
6976 (Target_arm::Scan::local): Likewise.
6977 (Target_arm::Scan::global): Likewise.
6978 (Target_arm::do_finalize_sections): Likewise.
6979 (Target_arm::Relocate::relocate): Likewise.
6980 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6981 Likewise.
6982 (Target_arm::scan_reloc_for_stub): Likewise.
6983 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6984
5696ab0b
ILT
69852010-01-19 Ian Lance Taylor <iant@google.com>
6986
6987 * output.cc (Output_section_headers::do_sized_write): Write large
6988 segment count to sh_info field.
6989 (Output_file_header::do_sized_write): For large segment count,
6990 write PN_XNUM to e_phnum field.
6991
800d0f56
ILT
69922010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6993
6994 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6995 (Arm_relocate_functions::thm_jump8): New function.
6996 (Arm_relocate_functions::thm_jump11): New function.
6997 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6998 R_ARM_THM_JUMP11.
6999 (Target_arm::Scan::global): Likewise.
7000 (Target_arm::Relocate::relocate): Likewise.
7001 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7002 Likewise.
7003
41263c05
DK
70042010-01-14 Doug Kwan <dougkwan@google.com>
7005
7006 * arm.cc (map, utility): Include headers.
7007 (Target_arm::apply_cortex_a8_workaround): New method.
7008 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
7009 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
7010 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
7011 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
7012 the --[no-]fix-cortex-a8 command line options.
7013 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
7014 (Target_arm::relocate_stub): Use addend in instruction template.
7015 * options.h (DEFINE_bool): Set the user-set flag.
7016 (General_options): Add --[no-]-fix-cortex options.
7017 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 7018 : Update fast look-up map after conversion.
41263c05 7019
459e9b03
ST
70202010-01-14 Sriraman Tallam <tmsriram@google.com>
7021
7022 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
7023 in the first pass of do_layout.
7024
b521dfe4
DK
70252010-01-13 Doug Kwan <dougkwan@google.com>
7026
7027 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7028 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
7029 apparent compiler problem of not folding static constant integral
7030 data members of elfcpp::Elf_sizes<32>.
7031
44272192
DK
70322010-01-13 Doug Kwan <dougkwan@google.com>
7033
7034 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7035 Arm_relobj::section_needs_cortex_a8_stub_scanning,
7036 Arm_relobj::scan_section_for_cortex_a8_erratum,
7037 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7038 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7039 sections to scan for relocation stubs into a new method
7040 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7041 relocation and Cortex-A8 stub scanning.
7042 (Target_arm::do_relax): Force stubs to be after stubbed sections
7043 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 7044 the beginning of a new relaxation pass. Update a comment.
44272192
DK
7045 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7046
44b71ece
ILT
70472010-01-12 Ian Lance Taylor <iant@google.com>
7048
7049 * target-reloc.h (visibility_error): New inline function.
7050 (relocate_section): Call visibility_error.
7051 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7052 (MOSTLYCLEANFILES): Likewise.
7053 (protected_4_pic.o, protected_3.err): New targets.
7054 * testsuite/protected_4.cc: New file.
7055
a120bc7f
DK
70562010-01-12 Doug Kwan <dougkwan@google.com>
7057
7058 * arm.cc (Cortex_a8_reloc): New class.
7059 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7060 and cortex_a8_relocs_info_.
7061 (Target_arm::fix_cortex_a8): New method definition.
7062 (Target_arm::Cortex_a8_relocs_info): New type.
7063 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7064 New data member declarations.
7065 (Target_arm::scan_reloc_for_stub): Record information about
7066 relocations for THUMB branches that might be exempted from the
7067 Cortex-A8 workaround.
7068 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7069 at the beginning of a relaxation pass.
7070
20138696
DK
70712010-01-12 Doug Kwan <dougkwan@google.com>
7072
7073 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7074 (Arm_relobj::Mapping_symbol_position,
7075 Arm_reloj::Mapping_symbol_position_less,
7076 Arm_relobj::Mapping_symbols_info): New types.
7077 (Target_arm::is_mapping_symbol_name): New method definition.
7078 (Arm_relobj::do_count_local_symbols): Save information about mapping
7079 symbols.
7080
089d69dc
DK
70812010-01-11 Doug Kwan <dougkwan@google.com>
7082
7083 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7084 Arm_relocate_functions::thumb32_branch_upper,
7085 Arm_relocate_functions::thumb32_branch_lower,
7086 Arm_relocate_functions::thumb32_cond_branch_offset,
7087 Arm_relocate_functions::thumb32_cond_branch_upper,
7088 Arm_relocate_functions::thumb32_cond_branch_lower,
7089 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7090 branch offset encoding.
7091 (Arm_relocate_functions::thumb_branch_common): Use new branch
7092 offset encoding methods to avoid code duplication.
7093 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7094 (Stub_addend_reader::operator()): Use new branch encoding method
7095 to avoid code duplication.
7096
99e5bff2
DK
70972010-01-11 Doug Kwan <dougkwan@google.com>
7098
7099 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7100 (Target_arm::do_finalize_sections): Define special EXIDX section
7101 symbols only if referenced.
7102 * gc.h (Garbage_collection::add_reference): New method.
7103 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7104 code duplication.
7105
98e090bd
ILT
71062010-01-11 Ian Lance Taylor <iant@google.com>
7107
d0a91bd8
ILT
7108 * script.cc (Version_script_info::build_expression_list_lookup):
7109 Change complaing about duplicate wildcard match from error to
7110 warning.
7111
98e090bd
ILT
7112 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7113 of 2009-12-30.
7114 (Version_script_info::Version_script_info): Initialize globs_,
7115 default_version_, default_is_global_, and exact_. Don't
7116 initialize globals_ or locals_.
7117 (Version_script_info::build_lookup_tables): Build local symbols
7118 first.
7119 (Version_script_info::unquote): New function.
7120 (Version_script_info::add_exact_match): New function.
7121 (Version_script_info::build_expression_list_lookup): Remove lookup
7122 parameter. Add is_global parameter. Change all callers. Handle
7123 wildcard pattern specially. Unquote pattern. Call
7124 add_exact_match.
7125 (Version_script_info::get_name_to_match): New function.
7126 (Version_script_info::get_symbol_version): New function.
7127 (Version_script_info::get_symbol_version_helper): Remove.
7128 (Version_script_info::check_unmatched_names): Call unquote.
7129 * script.h (class Version_script_info): Change get_symbol_version
7130 to be non-inline and add is_global parameter; change all callers.
7131 Rewrite symbol_is_local. Update declarations. Define struct
7132 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7133 Remove globals_ and locals_ members. Add exact_, globs_,
7134 default_version_, is_global_.
7135 (Version_script_info::Glob): Remove pattern, add expression and
7136 is_global. Update constructor. Change all callers.
7137 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7138 default version.
7139 (Versions::symbol_section_contents): If a symbol is undefined, or
7140 defined in a dynamic object, set the version index to
7141 VER_NDX_LOCAL.
7142 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7143 symbol_is_local.
7144 (Symbol_table::add_from_pluginobj): Likewise.
7145 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7146
d56962d3
DK
71472010-01-11 Doug Kwan <dougkwan@google.com>
7148
7149 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7150 (incremental_dump_LDADD): Add linking option for libintl.
7151 * Makefile.in: Regenerate.
7152
94e6ee91
L
71532010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7154
7155 PR gold/11144
7156 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7157 instead of -Ds.
7158 * testsuite/Makefile.in: Regenerated.
7159
e96c574b
DK
71602010-01-10 Doug Kwan <dougkwan@google.com>
7161
7162 * options.h (DEFINE_var): Use parentheses around argument varname__
7163 in macro body to avoid any unintended subsequent substitutions.
7164
7198066b
ILT
71652010-01-10 Ian Lance Taylor <iant@google.com>
7166
ba4d53bf
ILT
7167 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7168 candidates before doing symbol resolution.
7169
7198066b
ILT
7170 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7171 ODR candidates if only one is weak.
7172
a2beed37
ILT
71732010-01-08 Ian Lance Taylor <iant@google.com>
7174
7175 * script.cc (Version_script_info::build_expression_list_lookup):
7176 Don't warn about ambiguous version, just record the ambiguity.
7177 (Version_script_info::get_symbol_version_helper): Give error if
7178 version is ambiguous.
7179
2fb7225c
DK
71802010-01-08 Doug Kwan <dougkwan@google.com>
7181
7182 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7183 prev_data_size_ and prev_addralign_. Remove initializer for
7184 deleted data member has_been_changed_.
7185 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7186 to determine if the table is empty.
7187 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7188 Remove.
7189 (Stub_table::add_reloc_stub): Define method in class definition
7190 instead of just declaring it there.
7191 (Stub_table::add_cortex_a8_stub): New method definition.
7192 (Stub_table::update_data_size_and_addralign): Ditto.
7193 (Stub_table::finalize_stubs): Ditto.
7194 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7195 (Stub_table::do_addralign_): Return address alignment in the
7196 (Stub_table::do_reset_address_and_file_offset): Define method in
7197 class definition instead of declaring it there. Set current data
7198 size to be the data size of the previous pass.
7199 (Stub_table::set_final_data_size): Use current data size as the
7200 final data size.
7201 (Stub_table::relocate_stub): Change parameter type of stub from
7202 Reloc_stub pointer to Stub pointer.
7203 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7204 (Stub_table::Cortex_a8_stub_list): New typedef.
7205 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7206 Stub_table::prev_addralign_): New data member.
7207 (Arm_relobj::Arm_relobj): Initialize data member
7208 section_has_cortex_a8_workaround_.
7209 (Arm_relobj::section_has_cortex_a8_workaround,
7210 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7211 definitions.
7212 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7213 declarations.
7214 (Target_arm::relocate_stub): Change parameter type of stub from
7215 Reloc_stub pointer to Stub pointer.
7216 (Insn_template::size, Insn_template::alignment): Handle
7217 THUMB16_SPECIAL_TYPE.
7218 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7219 Stub_table::update_data_size_and_addralign,
7220 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7221 definitions.
2e702c99 7222 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
2fb7225c
DK
7223 (Stub_table::do_write): Ditto.
7224 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7225
880cd20d
ILT
72262010-01-08 Ian Lance Taylor <iant@google.com>
7227
7228 PR 11108
7229 * symtab.h (class Symbol): Remove fields is_target_special_ and
7230 has_plt_offset_. Add field is_defined_in_discarded_section_.
7231 (Symbol::is_defined_in_discarded_section): New function.
7232 (Symbol::set_is_defined_in_discarded_section): New function.
7233 (Symbol::has_plt_offset): Rewrite.
7234 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7235 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7236 Don't initialize is_target_special_ or has_plt_offset_.
7237 Initialize is_defined_in_discarded_section_.
7238 (Symbol_table::add_from_relobj): If appropriate, set
7239 is_defined_in_discarded_section.
7240 * resolve.cc (Symbol::override_base_with_special): Don't test
7241 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7242 * target-reloc.h (relocate_section): Do special handling for
7243 symbols defined in discarded sections for global symbols as well
7244 as local symbols.
7245
2703e3eb
ILT
72462010-01-08 Ian Lance Taylor <iant@google.com>
7247
7248 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7249 the SHT_SYMTAB case.
7250
339d40a3
ILT
72512010-01-08 Ian Lance Taylor <iant@google.com>
7252
7253 * object.cc (Sized_relobj::do_layout): Don't get confused if
7254 layout_eh_frame returns NULL.
7255
abecea76
ILT
72562010-01-08 Ian Lance Taylor <iant@google.com>
7257
7258 PR 11084
7259 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7260 dynamic symbol table, use the normal symbol table.
7261 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7262 symbol table.
7263
6b7dd3f3
ILT
72642010-01-08 Ian Lance Taylor <iant@google.com>
7265
7266 PR 11072
7267 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7268 sections.
7269
36c50e63
L
72702010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7271
7272 * version.cc (print_version): Change to "Copyright 2010".
7273
e291e7b9
ILT
72742010-01-08 Ian Lance Taylor <iant@google.com>
7275
7276 PR 10287
7277 PR 11063
7278 * i386.cc (class Target_i386): Change return type of plt_section
7279 to be non-const.
7280 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7281 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7282 tls_desc_rel_ field.
7283 (Output_data_plt_i386::rel_tls_desc): New function.
7284 (Target_i386::rel_tls_desc_section): New function.
7285 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7286 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7287 R_386_TLS_DESC reloc in rel_tls_desc_section.
7288 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7289 Define struct Tlsdesc_info.
7290 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7291 (Target_x86_64::do_reloc_symbol_index): New function.
7292 (Target_x86_64::add_tlsdesc_info): New function.
7293 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7294 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7295 tlsdesc_rel_ field.
7296 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7297 all callers.
7298 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7299 (Target_x86_64::rela_tlsdesc_section): New function.
7300 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7301 handling.
7302 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7303 (Target_x86_64::do_reloc_addend): New function.
7304 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7305 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7306 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7307 (Output_reloc::type): New function.
7308 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7309 (Output_reloc::is_target_specific): New function.
7310 (Output_reloc::target_arg): New function.
7311 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7312 absolute relocs and target specific relocs.
7313 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7314 add_target_specific.
7315 (class Output_data_reloc) [SHT_RELA]: Likewise.
7316 * output.cc (Output_reloc::Output_reloc): Add four new versions
7317 for absolute relocs and target specific relocs.
7318 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7319 (Output_reloc::get_symbol_index): Likewise.
7320 (Output_reloc::local_section_offset): Check that local_sym_index_
7321 is not TARGET_CODE or 0.
7322 (Output_reloc::symbol_value): Likewise.
7323 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7324 reloc.
7325 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7326 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7327 functions.
7328 * layout.cc (add_target_dynamic_tags): Use output section for
7329 DT_PLTRELSZ and DT_JMPREL.
7330
3a44184e
ILT
73312010-01-07 Ian Lance Taylor <iant@google.com>
7332
7333 PR 11061
7334 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7335 function.
7336 (class Output_data_reloc_generic): Define.
7337 (class Output_data_reloc_base): Change base class to
7338 Output_data_reloc_generic. Change add() method to call
7339 bump_relative_reloc_count for a relative reloc. Remove
7340 sort_relocs_ field.
7341 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7342 to sort_relocs().
7343 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7344 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7345 appropriate.
7346 * layout.h (class Layout): Update declaration.
7347
ea715a34
ILT
73482010-01-07 Ian Lance Taylor <iant@google.com>
7349
7350 * output.h (class Output_data): Add const version of
7351 output_section and do_output_section.
7352 (class Output_section_data): Add const version of
7353 do_output_section.
7354 (class Output_section): Likewise.
7355 * layout.cc (Layout::add_target_dynamic_tags): New function.
7356 * layout.h (class Layout): Update declarations.
7357 * arm.cc (Target_arm::do_finalize_sections): Use
7358 add_target_dynamic_tags.
7359 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7360 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7361 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7362 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7363
659948a4
ILT
73642010-01-07 Ian Lance Taylor <iant@google.com>
7365
7366 PR 11042
7367 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7368 object as needed.
7369
9d3b86f6
ILT
73702010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7371 Ian Lance Taylor <iant@google.com>
7372
7373 PR 11019
7374 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7375 Xindex::read_symtab_xindex.
7376
bb0d3eb0
DK
73772010-01-07 Doug Kwan <dougkwan@google.com>
7378
7379 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7380 (Insn_template::thumb16_bcond_insn): New method declaration.
7381 (Insn_template): Fix spelling.
7382 (Stub::thumb16_special): New method declaration.
7383 (Stub::do_write): Define virtual method which was previously pure
7384 virtual.
7385 (Stub::do_thumb16_special): New method declaration.
7386 (Stub::do_fixed_endian_write): New template member.
7387 (Reloc_stub::do_write): Remove.
7388 (Reloc_stub::do_fixed_endian_write): Remove.
7389 (Cortex_a8_stub): New class definition.
7390 (Stub_factory::make_cortex_a8_stub): New method definition.
7391 (Stub_factory::Stub_factory): Add missing static storage class
7392 qualifier for elf32_arm_stub_a8_veneer_blx.
7393
ffeef7df
ILT
73942010-01-07 Ian Lance Taylor <iant@google.com>
7395
dc3f80fe
ILT
7396 PR 10980
7397 * options.h (class General_options): Add --warn-unresolved-symbols
7398 and --error-unresolved-symbols.
7399 * errors.cc (Errors::undefined_symbol): Implement
7400 --warn-unresolved-symbols.
7401
ffeef7df
ILT
7402 * options.h (class General_options): Add -z text and -z textoff.
7403 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7404
f1ec9ded
ST
74052010-01-06 Sriraman Tallam <tmsriram@google.com>
7406
7407 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7408 (Garbage_collection::cident_sections): New function.
7409 (Garbage_collection::add_cident_section): New function.
7410 (Garbage_collection::cident_sections_): New member.
7411 (gc_process_relocs): Add references to sections whose names are C
7412 identifiers.
7413 * gold.h (cident_section_start_prefix): New constant.
7414 (cident_section_stop_prefix): New constant.
7415 (is_cident): New function.
7416 * layout.cc (Layout::define_section_symbols): Replace string constants
7417 with the newly defined constants.
7418 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7419 C identifiers.
7420 * testsuite/Makefile.am: Add gc_orphan_section_test.
7421 * testsuite/Makefile.in: Regenerate.
7422 * testsuite/gc_orphan_section_test.cc: New file.
7423 * testsuite/gc_orphan_section_test.sh: New file.
7424
6eda8c29
ILT
74252010-01-06 Ian Lance Taylor <iant@google.com>
7426
b9674e17
ILT
7427 PR 10980
7428 * options.h (class General_options): Add --warn-shared-textrel.
7429 * layout.cc (Layout::finish_dynamic_section): Implement
7430 --warn-shared-textrel.
7431
6eda8c29
ILT
7432 PR 10980
7433 * options.h (class General_options): Add --warn-multiple-gp.
7434
32dcd44e
ILT
74352010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7436
7437 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7438 $(THREADSLIB) and $(LIBDL).
7439 * Makefile.in: Rebuild.
7440
a192ba05
ILT
74412010-01-06 Ian Lance Taylor <iant@google.com>
7442
7443 PR 10980
7444 * options.cc (General_options::parse_section_start): New function.
7445 (General_options::section_start): New function.
7446 (General_options::General_options): Initialize all members.
7447 * options.h: Include <map>
7448 (class General_options): Add --section-start. Add section_starts_
7449 member.
7450 * layout.cc (Layout::attach_allocated_section_to_segment): If
7451 --section-start was used, set the address of the segment. Remove
7452 local sort_sections.
7453 (Layout::relaxation_loop_body): If the address of the load segment
7454 has been set by --section-start, don't use it.
7455 * output.h (Output_segment::update_flags_for_output_section): New
7456 function.
7457 * output.cc (Output_segment::add_output_section): Call
7458 update_flags_for_output_section.
7459
dde3f402
ILT
74602010-01-05 Ian Lance Taylor <iant@google.com>
7461
62dfdd4d
ILT
7462 PR 10980
7463 * options.h (class General_options): Add --undefined-version.
7464 * script.cc (struct Version_expression): Add was_matched_by_symbol
7465 field.
7466 (Version_script_info::matched_symbol): New function.
7467 (Version_script_info::get_symbol_version_helper): Call
7468 matched_symbol.
7469 (Version_script_info::check_unmatched_names): New function.
7470 * script.h (class Version_script_info): Update declarations.
7471 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7472
9c4ae156
ILT
7473 * options.h (class General_options): Use DEFINE_bool_alias for
7474 allow_multiple_definition.
7475 * resolve.cc (Symbol_table::should_override): Don't test
7476 allow_multiple_definition.
7477
dde3f402
ILT
7478 PR 10980
7479 * options.h (class General_options): Add --cref.
7480 * main.cc (main): Print cref table if --cref. Don't close mapfile
7481 until after printing cref table.
7482 * cref.cc: Include "symtab.h".
7483 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7484 (Cref_table_compare::operator()): New function.
7485 (Cref_inputs::gather_cref): New function.
7486 (filecol): New static const.
7487 (Cref_inputs::print_cref): New function.
7488 (Cref::print_cref): New function.
7489 * cref.h: Include <cstdio>.
7490 (class Cref): Update declarations.
7491 * mapfile.h (Mapfile::file): New function.
7492 * object.h (class Object): Define Symbols. Declare virtual
7493 do_get_global_symbols.
7494 (Object::get_global_symbols): New function.
7495 * object.cc (Input_objects::add_object): Pass object to cref_ if
7496 --cref.
7497 (Input_objects::archive_start): Likewise.
7498 (Input_objects::archive_stop): Likewise.
7499 (Input_objects::print_cref): New function.
7500 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7501 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7502 --cref.
7503 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7504 function.
7505 * plugin.h (class Sized_pluginobj): Update declarations.
7506
8781f709
ILT
75072010-01-05 Ian Lance Taylor <iant@google.com>
7508
7509 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7510 to is_default_version. Rename insdef to insdefault.
7511 (Symbol_table::add_from_relobj): Rename def to is_default_version
7512 and local to is_forced_local.
7513 (Symbol_table::add_from_pluginobj): Likewise.
7514 (Symbol_table::add_from_dynobj): Likewise.
7515 (Symbol_table::define_special_symbol): Rename insdef to
7516 insdefault.
7517
fe35d28d
ILT
75182010-01-04 Ian Lance Taylor <iant@google.com>
7519
30bc8c46
ILT
7520 PR 10980
7521 * options.h (class General_options): Add
7522 --allow-multiple-definition and -z muldefs.
7523 * resolve.cc (Symbol_table::should_override): Don't warn about a
7524 multiple symbol definition if --allow-multiple-definition or -z
7525 muldefs.
7526
7eaea549
ILT
7527 PR 10980
7528 * options.h (class General_options): Add --add-needed and
7529 --copy-dt-needed-entries. Tweak --as-needed help entry.
7530 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7531 error if --copy-dt-needed-entries aka --add-needed is used and
7532 would cause a change in behaviour.
7533
fe35d28d
ILT
7534 PR 10980
7535 * options.h (class General_options): Add -G as a short version of
7536 --shared. Add no-op options -assert, -g, and -i.
7537
55a2bb35
ST
75382010-01-04 Sriraman Tallam <tmsriram@google.com>
7539
7540 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7541 check for .text or .gnu.linkonce.t sections.
7542 * icf.cc (Icf::find_identical_sections): Ditto.
7543 Change the detection for mangled function name within the section
7544 name.
7545 * icf.h (is_section_foldable_candidate): New function.
7546
719328e1
ILT
75472009-12-30 Ian Lance Taylor <iant@google.com>
7548
7549 PR 10980
7550 * options.h (class General_options): Permit two dashes with
7551 --retain-symbols-file.
7552
d7bb5745
ILT
75532009-12-30 Ian Lance Taylor <iant@google.com>
7554
403a15dd
ILT
7555 PR 10979
7556 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7557 don't put the file header and segment headers in the text
7558 segment.
7559
eda294df
ILT
7560 PR 10979
7561 * common.cc (Sort_commons::operator()): Stabilize sort when both
7562 entries are NULL.
7563 (Symbol_table::do_allocate_commons_list): When allocating common
7564 symbols, skip a symbol which is no longer common.
7565 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7566 an object before checking its type.
7567 * testsuite/common_test_2.c: New file.
7568 * testsuite/common_test_3.c: New file.
7569 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7570 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7571 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7572 (common_test_2_pic.o, common_test_2.so): New targets.
7573 (common_test_3_pic.o, common_test_3.so): New targets.
7574 * testsuite/Makefile.in: Rebuild.
7575
d7bb5745
ILT
7576 PR 10979
7577 * script.cc (read_input_script): If we see a new SECTIONS clause,
7578 and we have added an input section, give an error.
7579 * layout.h (class Layout): Add have_added_input_section function.
7580 Add have_added_input_section_ field.
7581 * layout.cc (Layout::Layout): Initialize
7582 have_added_input_section_.
7583 (Layout::layout): Set have_added_input_section_.
7584 (Layout::layout_eh_frame): Likewise.
7585
fc59c572
ILT
75862009-12-30 Ian Lance Taylor <iant@google.com>
7587
7588 PR 10931
7589 * options.h (class General_options): Add --sort-common option.
7590 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7591 * common.cc (Sort_common): Add sort_order parameter to
7592 constructor. Add sort_order_ field.
7593 (Sort_commons::operator): Check sort_order_.
7594 (Symbol_table::allocate_commons): Determine the sort order.
7595 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7596 Change all callers.
7597 (Symbol_table::do_allocate_commons_list): Likewise.
7598
1c74fab0
ILT
75992009-12-30 Ian Lance Taylor <iant@google.com>
7600
7601 PR 10916
7602 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7603 symbols from this object, don't change the visibility of an
7604 undefined symbol.
7605 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7606
6affe781
ILT
76072009-12-30 Ian Lance Taylor <iant@google.com>
7608
7609 PR 10861
7610 * script.h (class Version_script_info): Define Language enum.
7611 Update declarations. Define Glob, Exact, and Lookup types. Add
7612 new fields globals_, locals_, and is_finalized_.
7613 * script.cc: Various formatting fixes.
7614 (class Parser_closure): Change language_stack_ from a vector of
7615 std::string to one of Version_script_info::Language. Adjust all
7616 uses accordingly.
7617 (class Lazy_demangler): Remove.
7618 (struct Version_expression): Change language from std::string to
7619 Version_script_info::Language.
7620 (Version_script_info::Version_script_info): New function.
7621 (Version_script_info::~Version_script_info): Don't call clear.
7622 (Version_script_info::finalize): New function.
7623 (Version_script_info::build_lookup_tables): New function.
7624 (Version_script_info::build_expression_list_lookup): New
7625 function.
7626 (Version_script_info::get_symbol_version_helper): Rewrite to use
7627 lookup tables.
7628 (Version_script_info::print_expression_list): Adjust to use
7629 Version_script_info::Language.
7630 (script_push_lex_into_version_mode): Check that the version script
7631 has not been finalized.
7632 (version_script_push_lang): Change language string to
7633 Version_script_info::Language.
7634 * options.cc (Command_line::version_script): New function.
7635 * options.h (class General_options): Add finalize_dynamic_list
7636 function. Change version_script from declaration to definition.
7637 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7638 * testsuite/version_script.map: Remove duplicate def of foo.
7639 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7640 version_script.map.
7641 * testsuite/Makefile.in: Rebuild.
7642
818bf354
ILT
76432009-12-30 Ian Lance Taylor <iant@google.com>
7644
7645 PR 10843
7646 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7647 if the input symbol index is 0, make the output symbol index 0.
7648
ebcc8304
ILT
76492009-12-30 Ian Lance Taylor <iant@google.com>
7650
7651 PR 10670
7652 * options.h (class General_options): Add -x/--discard-all.
7653 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7654 --discard-all. If the local symbol needs a dynamic entry, check
7655 that before handling --discard-locals.
7656
176fe33f
ILT
76572009-12-30 Ian Lance Taylor <iant@google.com>
7658
bb321bb1
ILT
7659 PR 10450
7660 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7661 flags to PF_R.
7662 (Output_segment::add_output_section): Don't change the flags if
7663 the type is PT_TLS.
7664
176fe33f
ILT
7665 PR 10450
7666 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7667 GNU hash table if they need a dynamic value. Otherwise, don't add
7668 them if they are defined in a dynamic object or are forced local.
7669
e8cd95c7
ILT
76702009-12-29 Ian Lance Taylor <iant@google.com>
7671
1b81fb71
ILT
7672 PR 10450
7673 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7674 .gnu.hash table for a 32-bit target.
7675
8d6d383d
ILT
7676 PR 10450
7677 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7678 regular and a dynamic object only needs a dynamic symbol table
7679 entry if it is externally visible.
7680
e785ec03
ILT
7681 PR 10450
7682 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7683 constructor. Add global_offset_table_ field.
7684 (Target_i386::got_section): Set global_offset_table_.
7685 (Target_i386::do_finalize_sections): Set global_offset_table_
7686 size.
7687 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7688 in constructor. Add global_offset_table_ field.
7689 (Target_x86_64::got_section): Set global_offset_table_.
7690 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7691 size.
7692
1a2dff53
ILT
7693 * layout.cc (Layout::Layout): Initialize increase_relro_.
7694 (Layout::get_output_section): Add is_relro, is_last_relro, and
7695 is_first_non_relro parameters. Change all callers.
7696 (Layout::choose_output_section): Likewise.
7697 (Layout::add_output_section_data): Likewise.
7698 (Layout::make_output_section): Likewise.
7699 (Layout::set_segment_offsets): Clear increase_relro when using a
7700 linker script.
7701 * layout.h (class Layout): Add increase_relro method. Add
7702 increase_relro_ field. Update declarations.
7703 * output.cc (Output_section::Output_section): Initialize
7704 is_last_relro_ and is_first_non_relro_.
7705 (Output_segment::add_output_section): Group relro sections is
7706 do_sort is true. Handle is_last_relro and is_first_non_relro.
7707 (Output_segment::maximum_alignment): Remove relro handling.
7708 (Output_segment::set_section_addresses): Add increase_relro
7709 parameter. Change all callers. Add initial alignment to align
7710 relro sections on separate page. Remove old relro handling.
7711 (Output_segment::set_section_list_addresses): Remove in_relro
7712 parameter. Change all callers.
7713 (Output_segment::set_offset): Add increase parameter. Change all
7714 callers. Remove old relro handling.
7715 * output.h (class Output_section): Add new methods: is_last_relro,
7716 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7717 Add is_last_relro_ and is_first_non_relro_ fields.
7718 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7719 Create separate .got.plt section. Call increase_relro.
7720 * x86_64.cc (Target_x86_64::got_section): Likewise.
7721 * testsuite/relro_script_test.t: Add .got.plt.
7722
f0ba79e2
ILT
7723 PR 10450
7724 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7725 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7726 (Layout::finalize): Call set_dynamic_symbol_size.
7727 (Layout::set_dynamic_symbol_size): New function.
7728 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7729 set_dynamic_symbol_size.
7730
e8cd95c7
ILT
7731 PR 10450
7732 * output.h (class Output_section): Add is_entsize_zero_ field.
7733 * output.cc (Output_section::Output_section): Initialize
7734 is_entsize_zero_.
7735 (Output_section::set_entsize): If two different entsizes are
7736 requested, force it to zero.
7737 (Output_section::add_input_section): Set flags for .debug_str
7738 before updating section flags. Set entsize.
7739 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7740 and SHF_STRING if all input sections have those flags.
7741
3e1b9a8a
RÁE
77422009-12-29 Rafael Espindola <espindola@google.com>
7743
7744 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
7745 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7746 reporting.
3e1b9a8a 7747
3dcad376
ST
77482009-12-29 Sriraman Tallam <tmsriram@google.com>
7749
7750 * options.cc (General_options::parse_version): Allow -v to exit
7751 without an error if there is nothing to link.
7752
084e2665
ILT
77532009-12-29 Ian Lance Taylor <iant@google.com>
7754
7755 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7756 using a version of gcc before 4.1.
7757 * configure: Rebuild.
7758
250acde3
CD
77592009-12-28 Chris Demetriou <cgd@google.com>
7760
7761 * attributes.cc (Output_attributes_section_data::do_write): Use
7762 std::vector::front rather than std::vector::data.
7763
99fff23b
ILT
77642009-12-28 Ian Lance Taylor <iant@google.com>
7765
7766 * symtab.h (class Symbol_table): Add enum Defined.
7767 * resolve.cc (Symbol_table::should_override): Add defined
7768 parameter. Change all callers. Test whether object is NULL
7769 before calling a method on it.
7770 (Symbol_table::report_resolve_problem): Add defined parameter.
7771 Change all callers.
7772 (Symbol_table::should_override_with_special): Likewise.
7773 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7774 parameter. Change all callers.
7775 (Symbol_table::do_define_in_output_data): Likewise.
7776 (Symbol_table::define_in_output_segment): Likewise.
7777 (Symbol_table::do_define_in_output_segment): Likewise.
7778 (Symbol_table::define_as_constant): Likewise.
7779 (Symbol_table::do_define_as_constant): Likewise.
7780 * script.h (class Symbol_assignment): Add is_defsym parameter to
7781 constructor; change all callers.
7782 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7783 parameter. Change all callers. Add is_defsym_ field.
7784 (class Parser_closure): Add parsing_defsym parameter to
7785 constructor; change all callers. Add parsing_defsym accessor
7786 function. Add parsing_defsym_ field.
7787
556bd683
ILT
77882009-12-28 Ian Lance Taylor <iant@google.com>
7789
7790 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 7791 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 7792
1782c879
ILT
77932009-12-23 Ian Lance Taylor <iant@google.com>
7794
7795 * i386.cc (Target_i386::do_calls_non_split): Recognize
7796 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
7797 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7798 -fsplit-stack prologue when using %r11.
1782c879 7799
329ca2b1
ST
78002009-12-21 Sriraman Tallam <tmsriram@google.com>
7801
7802 * options.cc (General_options::parse_version): Make -v continue and do
7803 the link like GNU ld does.
7804
d675ff46
RÁE
78052009-12-17 Rafael Avila de Espindola <espindola@google.com>
7806
7807 * Makefile.am (CCFILES): Add timer.cc.
7808 (HFILES): Add timer.h.
7809 * configure.ac: Check for sysconf and times.
7810 * main.cc: include timer.h.
7811 (main): Use Timer instead of get_run_time.
7812 * timer.cc: New.
7813 * timer.h: New.
7814 * workqueue.cc: include timer.h.
7815 (Workqueue::find_and_run_task):
7816 Report user, sys and wall time.
7817 * Makefile.in: Regenerate.
7818 * config.in: Regenerate.
7819 * configure: Regenerate.
7820
d6344fb5
DK
78212009-12-16 Doug Kwan <dougkwan@google.com>
7822
7823 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7824 sections.
7825 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7826 relaxed input sections.
7827 * output.cc (Output_section::find_relaxed_input_section): Change
7828 return type to Output_relaxed_input_section pointer. Adjust code
7829 for new type of relaxed_input_section_map_.
7830 * output.h (Output_section::find_relaxed_input_section): Change
7831 return type to Output_relaxed_input_section pointer.
7832 (Output_section::Output_relaxed_input_section_by_input_section_map):
7833 New type.
7834 (Output_section::relaxed_input_section_map_): Change type to
7835 Output_section::Output_relaxed_input_section_by_input_section_map.
7836 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7837 input section.
7838
0e0d5469
ILT
78392009-12-15 Ian Lance Taylor <iant@google.com>
7840
7841 * layout.cc (Layout::create_shstrtab): Only write out after input
7842 sections if we are compressing debug sections.
7843
0649a889
ILT
78442009-12-15 Ian Lance Taylor <iant@google.com>
7845
7846 * archive.cc (Archive::add_symbols): Only look up a symbol without
7847 a version if there is, in fact, a version.
7848
2ea97941
ILT
78492009-12-14 Ian Lance Taylor <iant@google.com>
7850
7851 Revert -Wshadow changes, all changes from:
7852 2009-12-11 Doug Kwan <dougkwan@google.com>
7853 2009-12-11 Nick Clifton <nickc@redhat.com>
7854 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7855
b0eec2cc
DK
78562009-12-11 Doug Kwan <dougkwan@google.com>
7857
7858 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7859 due to -Wshadow.
7860 * attributes.cc (Object_attribute::size): Ditto.
7861 (Attributes_section_data::size): Ditto.
7862 (Attributes_section_data::Attributes_section_data): Ditto.
7863 (Output_attributes_section_data::do_write): Ditto.
7864 * attributes.h (Object_attribute::set_type): Ditto.
7865 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7866
91d6fa6a
NC
78672009-12-11 Nick Clifton <nickc@redhat.com>
7868
7869 * archive.cc: Fix shadowed variable warnings.
7870 * arm.cc: Likewise.
7871 * compressed_output.cc: Likewise.
7872 * compressed_output.h: Likewise.
7873 * configure: Likewise.
7874 * dwarf_reader.cc: Likewise.
7875 * dynobj.cc: Likewise.
7876 * dynobj.h: Likewise.
7877 * ehframe.cc: Likewise.
7878 * ehframe.h: Likewise.
7879 * errors.cc: Likewise.
7880 * expression.cc: Likewise.
7881 * fileread.cc: Likewise.
7882 * fileread.h: Likewise.
7883 * freebsd.h: Likewise.
7884 * i386.cc: Likewise.
7885 * icf.cc: Likewise.
7886 * incremental.h: Likewise.
7887 * layout.cc: Likewise.
7888 * layout.h: Likewise.
7889 * mapfile.cc: Likewise.
7890 * merge.cc: Likewise.
7891 * merge.h: Likewise.
7892 * object.cc: Likewise.
7893 * object.h: Likewise.
7894 * options.h: Likewise.
7895 * output.cc: Likewise.
7896 * output.h: Likewise.
7897 * parameters.cc: Likewise.
7898 * plugin.cc: Likewise.
7899 * powerpc.cc: Likewise.
7900 * reduced_debug_output.cc: Likewise.
7901 * reduced_debug_output.h: Likewise.
7902 * reloc.cc: Likewise.
7903 * reloc.h: Likewise.
7904 * resolve.cc: Likewise.
7905 * script-sections.cc: Likewise.
7906 * script.cc: Likewise.
7907 * script.h: Likewise.
7908 * sparc.cc: Likewise.
7909 * symtab.cc: Likewise.
7910 * symtab.h: Likewise.
7911 * target-select.cc: Likewise.
7912 * target-select.h: Likewise.
7913 * token.h: Likewise.
7914 * workqueue.cc: Likewise.
7915 * workqueue.h: Likewise.
7916 * x86_64.cc: Likewise.
7917
a0351a69
DK
79182009-12-10 Doug Kwan <dougkwan@google.com>
7919
7920 * arm.cc (attributes.h): New include.
7921 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7922 (Arm_relobj::~Arm_relobj): Delete object pointed by
7923 attributes_section_data_.
7924 (Arm_relobj::attributes_section_data): New method definition.
7925 (Arm_relobj::attributes_section_data_): New data member declaration.
7926 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7927 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7928 attributes_section_data_.
7929 (Arm_dynobj::attributes_section_data): New method definition.
7930 (Arm_dynobj::attributes_section_data_): New data member declaration.
7931 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7932 initialization value of may_use_blx_ to false.
2e702c99 7933 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
7934 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7935 object attributes to compute results instead of hard-coding.
7936 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7937 Target_arm::get_secondary_compatible_arch,
7938 Target_arm::set_secondary_compatible_arch
7939 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7940 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7941 New method declarations.
7942 (Target_arm::get_aeabi_object_attribute): New method definition.
7943 (Target_arm::attributes_section_data_): New data member declaration.
7944 (read_arm_attributes_section): New template definition.
7945 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7946 (Arm_dynobj::do_read_symbols): Ditto.
7947 (Target_arm::do_finalize_sections): Merge attributes sections from
7948 input. Check for BLX use after attributes section merging.
7949 Fix __exidx_start and __exidx_end visibility. Create an
7950 .ARM.attributes section if necessary.
7951 (Target_arm::get_secondary_compatible_arch,
7952 Target_arm::set_secondary_compatible_arch,
7953 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7954 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 7955 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
7956 New method definitions.
7957
b59befec
ILT
79582009-12-09 Ian Lance Taylor <iant@google.com>
7959
7960 * plugin.cc (Plugin::load): Don't cast from void* to a function
7961 pointer.
7962
1276bc89
ILT
79632009-12-09 Ian Lance Taylor <iant@google.com>
7964
7965 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7966 information fields.
7967
2f2de248
L
79682009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7969
7970 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7971 Replace two_file_shared_1.so with two_file_shared_2.so.
7972 * testsuite/Makefile.in: Regenerated.
7973
4f787271
DK
79742009-12-08 Doug Kwan <dougkwan@google.com>
7975
7976 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7977 (HFILES): Add attributes.h and int_encoding.h.
7978 * Makefile.in: Regenerate.
7979 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7980 function definitions to int_encoding.cc
7981 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7982 prototypes to int_encoding.h
7983 * reduced_debug_output.cc (int_encoding.h): New include.
7984 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7985 function definitions to int_encoding.cc
7986 (insert_into_vector, read_from_pointer): Move template definitions to
7987 int_encoding.h
7988 * attributes.cc: New file.
7989 * attributes.h: New file.
7990 * int_encoding.cc: New file.
7991 * int_encoding.h: New file.
7992
20b52f1a
RÁE
79932009-12-07 Rafael Avila de Espindola <espindola@google.com>
7994
7995 PR gold/11055
7996 * incremental-dump.cc (dump_incremental_inputs): New.
7997 (main): Use dump_incremental_inputs.
7998
53d7974c
L
79992009-12-07 H.J. Lu <hongjiu.lu@intel.com>
8000
8001 PR gold/10893
8002 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
8003 checking elfcpp::STT_FUNC.
8004 (Target_i386::Relocate::relocate): Likewise.
8005 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8006
8007 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
8008 symbols from shared libraries into normal FUNC symbols.
8009
8010 * symtab.h (Symbol): Add is_func and use it.
8011
05a352e6
DK
80122009-12-05 Doug Kwan <dougkwan@google.com>
8013
8014 * arm.cc (Target_arm::arm_info): Initialize new fields
8015 attributes_section and attributes_vendor.
8016 * i386.cc (Target_i386::i386_info): Same.
8017 * object.cc (Sized_relobj::do_layout): Skip attribute section.
8018 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
8019 fields attributes_section and attributes_vendor.
53d7974c 8020 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
8021 * target.h (Target::attributes_section, Target::attributes_vendor,
8022 Target::is_attributes_section, Target::attribute_arg_type,
8023 Target::attributes_order): New method definitions.
8024 (Target::Target_info::attributes_section,
8025 Target::Target_info::attributes_vendor): New fields.
8026 (Target::do_attribute_arg_type, Target::do_attributes_order): New
8027 virtual method definitions.
8028 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
8029 attributes_section and attributes_vendor.
8030 * testsuite/testfile.cc (Target_test::test_target_info): Same.
8031
f4e5969c
DK
80322009-12-05 Doug Kwan <dougkwan@google.com>
8033
8034 * arm.cc: Update comments about interworking and stub generation.
8035 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
8036 considered as non-PIC.
8037 (Arm_relocate_functions::base_abs): Fix formatting.
8038 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8039 of function to use GOT entry address instead of offset.
8040 (Target_arm::Scan::global): Issue an error if a symbol would need a
8041 PLT does not get one because it is untyped. Remove code to create
8042 dynamic symbols for relative branches.
8043 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8044 takes unsigned integer instead of boolean.
8045
1abce4a6
L
80462009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8047
8048 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8049 (two_file_test_LDADD): Likewise.
8050 (common_test_1_LDADD): Likewise.
8051 (exception_test_LDADD) Likewise.
8052 (weak_test_LDADD): Likewise.
8053 (many_sections_test_LDADD): Likewise.
8054 (initpri1_LDADD): Likewise.
8055 (script_test_1_LDADD): Likewise.
8056 (script_test_2_LDADD): Likewise.
8057 (justsyms_LDADD): Likewise.
8058 (binary_test_LDADD): Likewise.
8059 (large_LDADD): Likewise.
8060 * testsuite/Makefile.in: Regenerated.
8061
adcf2816 80622009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 8063
adcf2816
L
8064 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8065 (Symbol_table::override_with_special): Likewise.
8066 (Symbol_table::add_from_object): Likewise.
8067
28e67f5d
RÁE
80682009-12-04 Rafael Avila de Espindola <espindola@google.com>
8069
8070 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8071 Don't set the data_offset twice.
8072
ae10a101
RÁE
80732009-12-04 Rafael Avila de Espindola <espindola@google.com>
8074
8075 * testsuite/Makefile.in: Regenerate.
8076
f59f41f3
DK
80772009-12-03 Doug Kwan <dougkwan@google.com>
8078
8079 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8080 (Target_arm::do_finalize_sections): Add parameter for symbol table
8081 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8082 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8083 parameter for symbol table pointer.
8084 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8085 an additional parameter for a pointer to symbol table.
8086 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8087 parameter for a symbol table pointer.
8088 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8089 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8090 Ditto.
8091 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8092 parameter for a symbol table pointer.
8093
ca55d848
RÁE
80942009-12-03 Rafael Avila de Espindola <espindola@google.com>
8095
8096 * incremental.cc (Incremental_inputs_header)
8097 (Incremental_inputs_header_write, Incremental_inputs_entry)
8098 (Incremental_inputs_entry_write): Move ...
8099 * incremental.h (Incremental_inputs_header)
8100 (Incremental_inputs_header_write, Incremental_inputs_entry)
8101 (Incremental_inputs_entry_write): here.
8102
3aec4f9c
RÁE
81032009-12-02 Rafael Avila de Espindola <espindola@google.com>
8104
8105 * incremental.cc (make_sized_incremental_binary): Set the target.
8106 Error if it is incompatible.
8107 * output.h (Output_file): Add filename method.
8108
9c0ae74d
RÁE
81092009-12-02 Rafael Avila de Espindola <espindola@google.com>
8110
8111 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8112 from the get_* methods.
8113
a45500ae
RÁE
81142009-12-02 Rafael Avila de Espindola <espindola@google.com>
8115
8116 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8117 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8118 Write 0 for the data_offset of scripts.
8119
325e6408
RÁE
81202009-12-02 Rafael Avila de Espindola <espindola@google.com>
8121
8122 * testsuite/Makefile.am: Add the incremental_test.sh test.
8123 * testsuite/incremental_test.sh: New.
8124 * testsuite/incremental_test_1.c: New.
8125 * testsuite/incremental_test_2.c: New.
8126
954c3e2e
RÁE
81272009-12-01 Rafael Avila de Espindola <espindola@google.com>
8128
8129 * incremental-dump.cc (main): Fix typos.
8130
f8086623
RÁE
81312009-11-27 Rafael Avila de Espindola <espindola@google.com>
8132
8133 PR gold/11025
8134 * incremental-dump.cc (main): Use llu to print 64 bit values.
8135
3b0dd6ac
L
81362009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8137 H.J. Lu <hongjiu.lu@intel.com>
8138
8139 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8140 $(LIBDL).
8141 (incremental_dump_LDADD): Likewise.
8142 * Makefile.in: Regenerated.
8143
a6d1ef57 81442009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 8145
a6d1ef57
DK
8146 Revert:
8147
8148 2009-11-25 Doug Kwan <dougkwan@google.com>
8149
8150 * arm.cc (Target_arm::Target_arm): Move method definition
8151 outside of class definition. Add code to handle
8152 --target1-rel, --target1-abs and --target2= options.
8153 (Target_arm::get_reloc_reloc_type): Change method to be
8154 non-static and const.
8155 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8156 New data member declaration.
8157 (Target_arm::Scan::local, Target_arm::Scan::global,
8158 Target_arm::Relocate::relocate,
8159 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8160 Adjust call to Target_arm::get_real_reloc_type.
8161 (Target_arm::get_real_reloc_type): Use command line options
8162 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8163 * options.h (--target1-rel, --target1-abs, --target2): New
8164 ARM-only options.
8165
50aeb7d4
DK
81662009-11-25 Doug Kwan <dougkwan@google.com>
8167
8168 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8169 class definition. Add code to handle --target1-rel, --target1-abs
8170 and --target2= options.
8171 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8172 and const.
8173 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8174 member declaration.
8175 (Target_arm::Scan::local, Target_arm::Scan::global,
8176 Target_arm::Relocate::relocate,
8177 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8178 call to Target_arm::get_real_reloc_type.
8179 (Target_arm::get_real_reloc_type): Use command line options to
8180 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8181 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8182 options.
8183
51938283
DK
81842009-11-25 Doug Kwan <dougkwan@google.com>
8185
8186 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8187 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8188 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8189 formatting.
8190 (Arm_relocate_functions::thm_call): Replace body with a call to
8191 Arm_relocate_functions::thumb_branch_common.
8192 (Arm_relocate_functions::thm_jump24,
8193 Arm_relocate_functions::thm_xpc22): New method definitions.
8194 (Arm_relocate_functions::thumb_branch_common): New method definition.
8195 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8196 operator.
8197 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8198 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8199
e2b8f3c4
RÁE
82002009-11-24 Rafael Avila de Espindola <espindola@google.com>
8201
8202 * Makefile.am: Build incremental-dump
8203 * Makefile.in: Regenerate.
8204 * incremental-dump.cc: New.
8205 * incremental.cc (Incremental_inputs_header_data,
8206 Incremental_inputs_entry_data): Move to incremental.h
8207 * incremental.h: (Incremental_inputs_header_data,
8208 Incremental_inputs_entry_data): Move from incremental.cc
8209
bcba9aec
RÁE
82102009-11-24 Rafael Avila de Espindola <espindola@google.com>
8211
8212 * incremental.cc (Incremental_inputs_header,
8213 Incremental_inputs_header_write, Incremental_inputs_entry,
8214 Incremental_inputs_entry_write): Add a typedef with the data type.
8215
7c3afe08
RÁE
82162009-11-24 Rafael Avila de Espindola <espindola@google.com>
8217
8218 * incremental.cc (Incremental_inputs_header,
8219 Incremental_inputs_header_write, Incremental_inputs_entry,
8220 Incremental_inputs_entry_write): Update comment about which
8221 type has the filed descriptions.
8222
d204b6e9
DK
82232009-11-15 Doug Kwan <dougkwan@google.com>
8224
8225 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8226 (Arm_relocate_functions::arm_branch_common): Change method defintion
8227 in class definition to a method declaration and update list of formal
8228 parameters.
8229 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8230 Arm_relocation_functions::jump24): Adjust call to
8231 Arm_relocate_functions::arm_branch_common. Update list of formal
8232 parameters.
8233 (Arm_relocate_functions::xpc25): New method definition.
8234 (Arm_relocate_functions::arm_branch_common): Move method defintion
8235 out from class definition. Use stubs for mode-switching and extending
8236 branch ranges.
8237 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8238 specially. Change code to enable use of stubs in ARM branches.
8239
43d12afe
DK
82402009-11-10 Doug Kwan <dougkwan@google.com>
8241
8242 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8243 in method declaration.
8244 (Target_arm::relocate_stub): New method declaration.
8245 (Target_arm::default_target): Change to return a pointer instead of
8246 a const reference.
8247 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8248 Target_arm::default_target.
8249 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8250 method definition.
8251 (Target_arm::relocate_section): Adjust view.
8252 (Target_arm::relocate_stub): New method definition.
8253
ac33a407
DK
82542009-11-10 Doug Kwan <dougkwan@google.com>
8255
8256 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8257 a format warning.
8258 * incremental.cc (open_incremental_binary): Initialized local
8259 variables to avoid warnings.
8260 * object.cc (make_elf_object): Ditto.
8261 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8262 a format warning.
e1df38aa 8263
88ee28e9
L
8264009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8265
8266 PR gold/10930
8267 * testsuite/plugin_test.c: Include "config.h".
8268
2daedcd6
DK
82692009-11-09 Doug Kwan <dougkwan@google.com>
8270
8271 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8272 (arm_symbol_value): Remove.
8273 (Arm_relocate_functions::arm_branch_common,
8274 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8275 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8276 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8277 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8278 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8279 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8280 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8281 Arm_relocate_functions::thm_mobw_abs_nc,
8282 Arm_relocate_functions::thm_mov_abs,
8283 Arm_relocate_functions::movw_prel_nc,
8284 Arm_relocate_functions::thm_movt_abs,
8285 Arm_relocate_functions::movt_prel,
8286 Arm_relocate_functions::thm_movw_prel_nc,
8287 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8288 (Target_arm::Relocate::relocate): Only decompose address into two
8289 parts if relocation type uses the thumb-bit and pass the actual
8290 bit instead of a flag indicating that the thumb-bit is used. Adjust
8291 calls to methods in Arm_relocate_functions for this change.
8292
1276bc89 82932009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
8294
8295 PR 10925
8296 * reloc.cc: Instantiate
8297 Sized_relobj::initialize_input_to_output_maps and
8298 Sized_relobj:free_input_to_output_maps.
8299
e53ad1b5
ILT
83002009-11-06 Ian Lance Taylor <iant@google.com>
8301
8302 PR 10876
8303 * defstd.cc (in_segment): Set only_if_ref true for "end".
8304
eb44217c
DK
83052009-11-06 Doug Kwan <dougkwan@google.com>
8306
8307 * arm.cc (class Reloc_stub): Correct a comment.
8308 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8309 (Target_arm::scan_section_for_stubs): New method declaration.
8310 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8311 Change methods from private to protected.
8312 (Target_arm::do_may_relax): New method definition.
8313 (Target_arm::do_relax, Target_arm::group_sections,
8314 Target_arm::scan_reloc_for_stub,
8315 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8316 (Target_arm::arm_input_section_map_): New data member declaration.
8317 (Target_arm::scan_reloc_for_stub,
8318 Target_arm::scan_reloc_section_for_stubs,
8319 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8320 Target_arm::do_relax): New method definitions.
8321
5d329b7d
ILT
83222009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8323
8324 * configure.ac: Check for (struct stat)::st_mtim
8325 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8326 * config.in: Regenerate.
8327 * configure: Regenerate.
8328
96a0d71b
ILT
83292009-11-05 Ian Lance Taylor <iant@google.com>
8330
8331 PR 10910
8332 * output.cc (Output_segment::add_output_section): Add missing
8333 return statement.
8334
594c8e5e
ILT
83352009-11-04 Ian Lance Taylor <iant@google.com>
8336
8337 PR 10880
8338 * object.h (class Object): Add is_needed and set_is_needed
8339 methods. Add is_needed_ field. Make bool fields into bitfields.
8340 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8341 defined in a dynamic object and referenced by a regular object,
8342 set is_needed for the dynamic object.
8343 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8344 if the file is marked with as_needed and it is not needed.
8345
22b127cc
ILT
83462009-11-04 Ian Lance Taylor <iant@google.com>
8347
8348 PR 10887
8349 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8350 tags if data is discarded by linker script.
8351 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8352 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8353 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8354 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8355
f5c870d2
ILT
83562009-11-04 Ian Lance Taylor <iant@google.com>
8357
8358 * layout.cc (Layout::get_output_section): Add is_interp and
8359 is_dynamic_linker_section parameters. Change all callers.
8360 (Layout::choose_output_section): Likewise.
8361 (Layout::make_output_section): Likewise.
8362 (Layout::add_output_section_data): Add is_dynamic_linker_section
8363 parameter. Change all callers.
8364 * layout.h (class Layout): Update declarations.
8365 * output.h (class Output_section): Add is_interp, set_is_interp,
8366 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8367 Add is_interp_, is_dynamic_linker_section_ fields. Change
8368 generate_code_fills_at_write_ to a bitfield.
8369 * output.cc (Output_section::Output_sections): Initialize new
8370 fields.
8371 (Output_segment::add_output_section): Add do_sort parameter.
8372 Change all callers.
8373
1ae4d23b
ILT
83742009-11-03 Ian Lance Taylor <iant@google.com>
8375
8376 PR 10860
8377 * options.h (class General_options): Add --warn-common.
8378 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8379 merging two common symbols.
8380 (Symbol_table::should_override): Handle --warn-common when merging
8381 a common symbol with a defined symbol. Use report_resolve_problem
8382 for multiple definitions.
8383 (Symbol_table::report_resolve_problem): New function.
8384 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8385
55da9579
DK
83862009-11-03 Doug Kwan <dougkwan@google.com>
8387
8388 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8389 stub_factory_.
8390 (Target_arm::stub_factory): New method definition.
8391 (Target_arm::new_arm_input_section,
8392 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8393 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 8394 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
8395 New type definitions.
8396 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8397 member declarations.
8398 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8399 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8400 New method definitions.
8401
37a9ac43
ILT
84022009-11-03 Ian Lance Taylor <iant@google.com>
8403
8404 * options.h (class General_options): Add --warn_constructors.
8405
b3d6a3d4
ILT
84062009-11-03 Ian Lance Taylor <iant@google.com>
8407
8408 PR 10893
8409 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8410 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8411
934b01dd
ILT
84122009-11-03 Ian Lance Taylor <iant@google.com>
8413
8414 PR 10895
8415 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8416 --msgid-bugs-address.
8417 (install-pdf): New target.
8418 (install-data_yes): Look up one directory to find mkinstalldirs.
8419
03c1939b
L
84202009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8421
8422 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8423 tree.
8424
ebd95253
DK
84252009-10-30 Doug Kwan <dougkwan@google.com>
8426
8427 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8428
e9bbb538
DK
84292009-10-30 Doug Kwan <dougkwan@google.com>
8430
8431 * arm.cc (Stub_addend_reader): New struct template definition
8432 and partial specializations.
8433 (Stub_addend_reader::operator()): New method definition for a
8434 partially specialized template.
8435
d5b40221
DK
84362009-10-30 Doug Kwan <dougkwan@google.com>
8437
8438 * arm.cc (Arm_relobj::processor_specific_flags): New method
8439 definition.
8440 (Arm_relobj::do_read_symbols): New method declaration.
8441 (Arm_relobj::processor_specific_flags_): New data member declaration.
8442 (Arm_dynobj): New class definition.
8443 (Target_arm::do_finalize_sections): Add input_objects parameter.
8444 (Target_arm::do_adjust_elf_header): New method declaration.
8445 (Target_arm::are_eabi_versions_compatible,
8446 (Target_arm::merge_processor_specific_flags): New method declaration.
8447 (Target_arm::do_make_elf_object): New overloaded method definitions
8448 and declaration.
8449 (Arm_relobj::do_read_symbols): New method definition.
8450 (Arm_dynobj::do_read_symbols): Ditto.
8451 (Target_arm::do_finalize_sections): Add input_objects parameters.
8452 Merge processor-specific flags from all input objects.
8453 (Target_arm::are_eabi_versions_compatible,
8454 Target_arm::merge_processor_specific_flags,
8455 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8456 New method definitions.
8457 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8458 Input_objects pointer type parameter.
8459 * layout.cc (Layout::finalize): Pass input objects to target's.
8460 finalize_sections function.
8461 * output.cc (Output_file_header::do_sized_write): Set ELF file
8462 header's processor-specific flags.
8463 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8464 Input_objects pointer type parameter.
8465 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8466 * target.h (Input_objects): New forward class declaration.
8467 (Target::processor_specific_flags,
8468 Target::are_processor_specific_flags_sect): New method definitions.
8469 (Target::finalize_sections): Add input_objects parameter.
8470 (Target::Target): Initialize processor_specific_flags_ and
8471 are_processor_specific_flags_set_.
8472 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8473 parameter.
8474 (Target::set_processor_specific_flags): New method definition.
8475 (Target::processor_specific_flags_,
8476 Target::are_processor_specific_flags_set_): New data member
8477 declarations.
8478 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8479 Input_objects pointer type parameter.
8480
ebabffbd
DK
84812009-10-30 Doug Kwan <dougkwan@google.com>
8482
8483 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8484
ad0f2072
ILT
84852009-10-28 Ian Lance Taylor <iant@google.com>
8486
8487 * object.h (class Relobj): Drop options parameter from
8488 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8489 do_scan_relocs, do_relocate. Change all callers.
8490 (class Sized_relobj): Drop options parameters from
8491 do_gc_process_relocs, do_scan_relocs, do_relocate,
8492 do_relocate_sections, relocate_sections, emit_relocs_scan,
8493 emit_relocs_scan_reltype. Change all callers.
8494 (struct Relocate_info): Remove options field and all references to
8495 it.
8496 * reloc.h (class Read_relocs): Remove options constructor
8497 parameter and options_ field. Change all callers.
8498 (class Gc_process_relocs, class Scan_relocs): Likewise.
8499 (class Relocate_task): Likewise.
8500 * target-reloc.h (scan_relocs): Remove options parameter. Change
8501 all callers.
8502 (scan_relocatable_relocs): Likewise.
8503 * target.h (class Sized_target): Remove options parameter from
8504 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8505 all callers.
8506 * gc.h (gc_process_relocs): Remove options parameter. Change all
8507 callers.
8508 * arm.cc: Update functions to remove options parameters.
8509 * i386.cc: Likewise.
8510 * powerpc.cc: Likewise.
8511 * sparc.cc: Likewise.
8512 * x86_64.cc: Likewise.
8513 * testsuite/testfile.cc: Likewise.
8514
8ffa3667
DK
85152009-10-28 Doug Kwan <dougkwan@google.com>
8516
8517 * arm.cc (Arm_relobj): New class definition.
e1df38aa 8518 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
8519 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8520 New method definitions.
8521
40f36857
CC
85222009-10-28 Cary Coutant <ccoutant@google.com>
8523
8524 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8525 (Plugin::cleanup_done_): New member.
8526 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8527 (Plugin_manager::cleanup_done_): Remove.
8528 (Plugin_manager::add_input_file): Edit error message.
8529 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8530 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8531
2c849493
ILT
85322009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8533
8534 * fileread.cc: (File_read::View::~View): Use the new
8535 data_ownership_ filed.
8536 (File_read::~File_read): Dispose the new whole_file_view_.
8537 (File_read::open): Mmap the whole file if needed.
8538 (File_read::open): Use whole_file_view_ instead of contents_.
8539 (File_read::find_view): Use whole_file_view_ if applicable.
8540 (File_read::do_read): Use whole_file_view_ instead of contents_.
8541 (File_read::make_view): Use whole_file_view_ instead of contents_,
8542 update File_read::View::View call.
8543 (File_read::find_or_make_view): Update File_read::View::View
8544 call.
8545 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8546 remove contents_
8547 (File_read::View::Data_ownership): New enum.
8548 (File_read::View::View): Replace bool mapped_ with Data_ownership
8549 argument.
8550 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8551 (File_read::View::data_ownership_): New field.
8552 (File_read::contents_): Remove (replaced by whole_file_view_).
8553 (File_read::whole_file_view_): New field.
8554 * options.h (class General_options): Add --keep-files-mapped.
8555
24998053
CC
85562009-10-27 Cary Coutant <ccoutant@google.com>
8557
8558 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8559 * testsuite/Makefile.am (plugin_test_5): New test case.
8560 * testsuite/Makefile.in: Regenerate.
8561
72adc4fa
DK
85622009-10-25 Doug Kwan <dougkwan@google.com>
8563
8564 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8565 from private to protected to allow access by child class.
8566 (Sized_relobj::do_relocate_sections): New method declaration.
8567 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 8568 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
8569 Sized_relobj::relocate_sections. Instantiate template explicitly
8570 for different target sizes and endianity.
8571
07f508a2
DK
85722009-10-24 Doug Kwan <dougkwan@google.com>
8573
8574 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8575 (Arm_input_section::as_arm_input_section): New method.
8576 (Arm_output_section): New class definition.
8577 (Arm_output_section::create_stub_group,
8578 Arm_output_section::group_sections): New method definitions.
8579
10ad9fe5
DK
85802009-10-22 Doug Kwan <dougkwan@google.com>
8581
8582 * arm.cc (Arm_input_section): New class definition.
8583 (Arm_input_section::init, Arm_input_section:do_write,
8584 Arm_input_section::set_final_data_size,
8585 Arm_input_section::do_reset_address_and_file_offset): New method
8586 definitions.
8587
56ee5e00
DK
85882009-10-21 Doug Kwan <dougkwan@google.com>
8589
8590 * arm.cc (Stub_table, Arm_input_section): New forward class
8591 declarations.
8592 (Stub_table): New class defintion.
8593 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8594 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8595 New method definition.
8596
b569affa
DK
85972009-10-21 Doug Kwan <dougkwan@google.com>
8598
8599 * arm.cc: Update copyright comments.
8600 (Target_arm): New forward class template declaration.
8601 (Arm_address): New type.
8602 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8603 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8604 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8605 constants.
8606 (Insn_template): Same.
8607 (DEF_STUBS): New macro.
8608 (Stub_type): New enum type.
8609 (Stub_template): New class definition.
8610 (Stub): Same.
8611 (Reloc_stub): Same.
8612 (Stub_factory): Same.
8613 (Target_arm::Target_arm): Initialize may_use_blx_ and
8614 should_force_pic_veneer_.
8615 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8616 Target_arm::should_force_pic_veneer,
8617 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8618 Target_arm::using_thumb_only, Target_arm:;default_target): New
8619 method defintions.
8620 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8621 New data member declarations.
8622 (Insn_template::size, Insn_template::alignment): New method defintions.
8623 (Stub_template::Stub_template): New method definition.
8624 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8625 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8626 (Stub_factory::Stub_factory): New method definition.
8627 * gold.h (string_hash): New template.
8628 * output.h (Input_section_specifier::hash_value): Use
8629 gold::string_hash.
8630 (Input_section_specifier::string_hash): Remove.
8631 * stringpool.cc (Stringpool_template::string_hash): Use
8632 gold::string_hash.
8633
6c172549
DK
86342009-10-20 Doug Kwan <dougkwan@google.com>
8635
8636 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8637 symbols of relaxed input sections.
8638 * output.h (Output_section::find_relaxed_input_section): Make
8639 method public.
8640
c5617f2f
DK
86412009-10-16 Doug Kwan <dougkwan@google.com>
8642
8643 * dynobj.cc (Versions::Versions): Initialize version_script_.
8644 Only insert base version symbol definition for a shared object
8645 if version script defines any version versions.
8646 (Versions::define_base_version): New method definition.
8647 (Versions::add_def): Check that base version is not needed.
8648 (Versions::add_need): Define base version lazily.
8649 * dynobj.h (Versions::define_base_version): New method declaration.
8650 (Versions::needs_base_version_): New data member declaration.
8651 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8652 (check_DATA): Add no_version_test.stdout.
8653 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8654 New make rules.
8655 * testsuite/Makefile.in: Regenerate.
8656 * testsuite/no_version_test.c: New file.
8657 * testsuite/no_version_test.sh: Ditto.
8658
3c12dcdb
DK
86592009-10-16 Doug Kwan <dougkwan@google.com>
8660
8661 * expression.cc (class Segment_start_expression): New class definition.
8662 (Segment_start_expression::value): New method definition.
8663 (script_exp_function_segment_start): Return a new
8664 Segment_start_expression.
8665 * gold/script-c.h (script_saw_segment_start_expression): New function
8666 prototype.
8667 * script-sections.cc (Script_sections::Script_sections): Initialize
8668 SAW_SEGMENT_START_EXPRESSION_ to false.
8669 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8670 and -Tbbs options to specify section addresses if given in
8671 command line and no SEGMENT_START expression is seen in a script.
8672 * script-sections.h (Script_sections::saw_segment_start_expression,
8673 Script_sections::set_saw_segment_start_expression): New method
8674 definition.
8675 (Script_sections::saw_segment_start_expression_): New data member
8676 declaration.
8677 * script.cc (script_saw_segment_start_expression): New function.
8678 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8679 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8680 script_test_7.sh and script_test_8.sh.
8681 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8682 script_test_8.stdout.
8683 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8684 (script_test_6, script_test_6.stdout, script_test_7,
8685 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8686 * Makefile.in: Regenerate.
8687 * testsuite/script_test_6.sh: New file.
8688 * testsuite/script_test_6.t: Same.
8689 * testsuite/script_test_7.sh: Same.
8690 * testsuite/script_test_7.t: Same.
8691 * testsuite/script_test_8.sh: Same.
8692
64b1ae37
DK
86932009-10-16 Doug Kwan <dougkwan@google.com>
8694
8695 * output.cc (Output_segment::set_section_list_address): Cast
8696 expressions to unsigned long long type to avoid format warnings.
8697
661be1e2
ILT
86982009-10-15 Ian Lance Taylor <iant@google.com>
8699
12edd763 8700 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 8701 dot assignment to script_sections_.
12edd763
ILT
8702 * script-sections.cc (Script_sections::add_dot_assignment):
8703 Initialize if necessary.
8704
68b6574b
ILT
8705 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8706 program headers with no load segment if there is a linker script.
8707
661be1e2
ILT
8708 * layout.cc (Layout::set_segment_offsets): Align the file offset
8709 to the segment aligment for -N or -n with no load segment.
8710 * output.cc (Output_segment::add_output_section): Don't crash if
8711 the first section is a TLS section.
8712 (Output_segment::set_section_list_addresses): Print an error
8713 message if the address moves backward in a linker script.
8714 * script-sections.cc
8715 (Output_section_element_input::set_section_addresses): Don't
8716 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8717 (Orphan_output_section::set_section_addresses): Likewise.
8718
f15f61a7
DK
87192009-10-15 Doug Kwan <dougkwan@google.com>
8720
8721 * layout.cc (Layout::finish_dynamic_section): Generate tags
8722 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8723 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8724 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8725
82bb573a
ILT
87262009-10-14 Ian Lance Taylor <iant@google.com>
8727
8728 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8729 fields.
8730 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8731 data_shdr fields of relinfo.
8732 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8733 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8734 R_386_TLS_LDO_32, adjust based on section flags.
8735 (Target_i386::Relocate::fix_up_ldo): Remove.
8736
374ad285
ILT
87372009-10-13 Ian Lance Taylor <iant@google.com>
8738
8739 Add support for -pie.
8740 * options.h (class General_options): Add -pie and
8741 --pic-executable.
8742 (General_options::output_is_position_independent): Test -pie.
8743 (General_options::output_is_executable): Return true if not shared
8744 and not relocatable.
8745 (General_options::output_is_pie): Remove.
8746 * options.cc (General_options::finalize): Reject incompatible uses
8747 of -pie.
8748 * gold.cc (queue_middle_tasks): A -pie link is not static.
8749 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8750 * symtab.cc (Symbol::final_value_is_known): Return false if
8751 output_is_position_independent.
8752 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8753 output_is_position_independent.
8754 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8755 output_is_position_independent.
8756 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8757 output_is_position_independent.
8758 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8759 two_file_pie_test.
8760 (basic_pie_test.o, basic_pie_test): New targets.
8761 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8762 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8763 (two_file_pie_test): New target.
8764 * testsuite/Makefile.in: Rebuild.
8765 * README: Remove note saying that -pie is not supported.
8766
c6585162
ILT
87672009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8768
8769 * options.h (class General_options): Add -init and -fini.
8770 * layout.cc (Layout::finish_dynamic_section): Emit
8771 given init and fini functions.
8772
032ce4e9
ST
87732009-10-13 Sriraman Tallam <tmsriram@google.com>
8774
8775 * gc.h (gc_process_relocs): Check if icf is enabled using new
8776 function.
8777 * gold.cc (queue_initial_tasks): Likewise.
8778 (queue_middle_tasks): Likewise.
8779 * object.cc (do_layout): Likewise.
8780 * symtab.cc (is_section_folded): Likewise.
8781 * main.cc (main): Likewise.
8782 * reloc.cc (Read_relocs::run): Likewise.
8783 (Sized_relobj::do_scan_relocs): Likewise.
8784 * icf.cc (is_function_ctor_or_dtor): New function.
8785 (Icf::find_identical_sections): Check if function is ctor or dtor when
8786 safe icf is chosen.
8787 * options.h (General_options::icf): Change option to be an enum.
8788 (Icf_status): New enum.
8789 (icf_enabled): New method.
8790 (icf_safe_folding): New method.
8791 (set_icf_status): New method.
8792 (icf_status_): New variable.
8793 * (options.cc) (General_options::finalize): Set icf_status_.
8794 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8795 icf_test and icf_keep_unique_test to use the --icf enum flag.
8796 * testsuite/icf_safe_test.sh: New file.
e1df38aa 8797 * testsuite/icf_safe_test.cc: New file.
032ce4e9 8798
f345227a
ST
87992009-10-12 Sriraman Tallam <tmsriram@google.com>
8800
8801 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8802 includes to gc.h and icf.h.
8803 * arm.cc: Include gc.h.
8804 * gold.cc: Likewise.
8805 * i386.cc: Likewise.
8806 * powerpc.cc: Likewise.
8807 * sparc.cc: Likewise.
8808 * x86_64.cc: Likewise.
8809 * gc.h: Include icf.h.
8810
1c7814ed
ILT
88112009-10-11 Ian Lance Taylor <iant@google.com>
8812
8813 * plugin.cc: Include "gold.h" before other header files.
8814
ae3b5189
CD
88152009-10-10 Chris Demetriou <cgd@google.com>
8816
8817 * options.h (Input_file_argument::Input_file_type): New enum.
8818 (Input_file_argument::is_lib_): Replace with...
8819 (Input_file_argument::type_): New member.
8820 (Input_file_argument::Input_file_argument): Take Input_file_type
8821 'type' rather than boolean 'is_lib' as second argument.
8822 (Input_file_argument::is_lib): Use type_.
8823 (Input_file_argument::is_searched_file): New function.
8824 (Input_file_argument::may_need_search): Handle is_searched_file.
8825 * options.cc (General_options::parse_library): Support -l:filename.
8826 (General_options::parse_just_symbols): Update for Input_file_argument
8827 changes.
8828 (Command_line::process): Likewise.
8829 * archive.cc (Archive::get_file_and_offset): Likewise.
8830 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8831 * script.cc (read_script_file, script_add_file): Likewise.
8832 * fileread.cc (Input_file::Input_file): Likewise.
8833 (Input_file::will_search_for): Handle is_searched_file.
8834 (Input_file::open): Likewise.
8835 * readsyms.cc (Read_symbols::get_name): Likewise.
8836 * testsuite/Makefile.am (searched_file_test): New test.
8837 * testsuite/Makefile.in: Regenerate.
8838 * testsuite/searched_file_test.cc: New file.
8839 * testsuite/searched_file_test_lib.cc: New file.
8840
f3048a1d
ILT
88412009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8842 Ian Lance Taylor <iant@google.com>
8843
8844 * descriptor.cc: Include <cstdio> and "binary-io.h".
8845 (Descriptors::open): Open the files in binary mode always.
8846 * script.cc (Lex::get_token): Treat \r as whitespace.
8847
d4780e57
ILT
88482009-10-09 Ian Lance Taylor <iant@google.com>
8849
8850 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8851
d9a893b8
ILT
88522009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8853 Ian Lance Taylor <iant@google.com>
8854
8855 * configure.ac: Check for readv function also.
8856 * fileread.cc (readv): Define if not HAVE_READV.
8857 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8858 does not exist.
8859 * config.in: Regenerate.
8860 * configure: Regenerate.
8861
c0a62865
DK
88622009-10-09 Doug Kwan <dougkwan@google.com>
8863
8864 * layout.cc (Layout::make_output_section): Call target hook to make
8865 ordinary output section.
8866 (Layout::finalize): Adjust parameter list of call the
8867 Target::may_relax().
8868 * layout.h (class Layout::section_list): New method.
8869 * merge.h (Output_merge_base::entsize): Change visibility to public.
8870 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8871 New methods.
8872 (Output_merge_string::do_is_string): New method.
8873 * object.cc (Sized_relobj::do_setup): renamed from
8874 Sized_relobj::set_up.
8875 * object.h (Sized_relobj::adjust_shndx,
8876 Sized_relobj::initializ_input_to_output_maps,
8877 Sized_relobj::free_input_to_output_maps): Change visibilities to
8878 protected.
8879 (Sized_relobj::setup): Virtualize.
8880 (Sized_relobj::do_setup): New method declaration.
8881 (Sized_relobj::invalidate_section_offset,
8882 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8883 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8884 * options.cc (parse_int): New function.
8885 * options.h (parse_int): New declaration.
8886 (DEFINE_int): New macro.
8887 (stub_group_size): New option.
8888 * output.cc (Output_section::Output_section): Initialize memebers
8889 merge_section_map_, merge_section_by_properties_map_,
8890 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8891 (Output_section::add_input_section): Handled deferred code-fill
8892 generation and remove an old comment.
8893 (Output_section::add_relaxed_input_section): New method definition.
8894 (Output_section::add_merge_input_section): Use merge section by
8895 properties map to speed to search. Update merge section maps
8896 as appropriate.
8897 (Output_section::build_relaxation_map): New method definition.
8898 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8899 Same.
8900 (Output_section::relax_input_section): Renamed to
8901 Output_section::convert_input_sections_to_relaxed_sections and change
8902 interface to take a vector of pointers to relaxed sections.
8903 (Output_section::find_merge_section,
8904 Output_section::find_relaxed_input_section): New method definitions.
8905 (Output_section::is_input_address_mapped,
8906 Output_section::output_offset, Output_section::output_address):
8907 Use output section data maps to speed up searching.
8908 (Output_section::find_starting_output_address): Add comments.
8909 (Output_section::do_write,
8910 Output_section::write_to_postprocessing_buffer): Do code-fill
8911 generation as appropriate.
8912 (Output_section::get_input_sections): Invalidate relaxed input section
8913 map.
8914 (Output_section::restore_states): Adjust type of checkpoint .
8915 Invalidate relaxed input section map.
8916 * output.h (Output_merge_base): New class declaration.
8917 (Input_section_specifier): New class defintion.
8918 (class Output_relaxed_input_section) Change base class to
8919 Output_section_data_build.
8920 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8921 base class initializer.
8922 (Output_section::add_relaxed_input_section): New method declaration.
8923 (Output_section::Input_section): Change visibility to protected.
2e702c99 8924 (Output_section::Input_section::relobj,
c0a62865
DK
8925 Output_section::Input_section::shndx): Handle relaxed input sections.
8926 Output_section::input_sections) Change visibility to protected. Also
8927 define overload to return a non-const pointer.
8928 (Output_section::Merge_section_properties): New class defintion.
8929 (Output_section::Merge_section_by_properties_map,
8930 Output_section::Output_section_data_by_input_section_map,
8931 Output_section::Relaxation_map): New types.
8932 (Output_section::relax_input_section): Rename method to
8933 Output_section::convert_input_sections_to_relaxed_sections and change
8934 interface to take a vector of relaxed section pointers.
8935 (Output_section::find_merge_section,
8936 Output_section::find_relaxed_input_section,
8937 Output_section::build_relaxation_map,
8938 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8939 New method declarations.
8940 (Output_section::merge_section_map_
8941 Output_section::merge_section_by_properties_map_,
8942 Output_section::relaxed_input_section_map_,
8943 Output_section::is_relaxed_input_section_map_valid_,
8944 Output_section::generate_code_fills_at_write_): New data members.
8945 * script-sections.cc
8946 (Output_section_element_input::set_section_addresses): Call
8947 current_data_size and addralign methods of relaxed input sections.
8948 (Orphan_output_section::set_section_addresses): Call current_data_size
8949 and addralign methods of relaxed input sections.
8950 * symtab.cc (Symbol_table::compute_final_value): Extract template
8951 from the body of Symbol_table::sized_finalize_symbol.
8952 (Symbol_table::sized_finalized_symbol): Call
8953 Symbol_table::compute_final_value.
8954 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8955 (Symbol_table::compute_final_value): New templated method declaration.
8956 * target.cc (Target::do_make_output_section): New method defintion.
8957 * target.h (Target::make_output_section): New method declaration.
8958 (Target::relax): Add more parameters for input objects, symbol table
8959 and layout. Adjust call to do_relax.
8960 (Target::do_make_output_section): New method declaration.
8961 (Target::do_relax): Add parameters for input objects, symbol table
8962 and layout.
8963
d446d6c4
ILT
89642009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8965
8966 * pread.c: Include stdio.h.
8967
bc06c745
ILT
89682009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8969
8970 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8971 defined.
8972
75aea3d0
ILT
89732009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8974
8975 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8976 Change read_shndx type to unsigned int.
8977 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8978 int.
8979 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8980 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8981 Change read_shndx type to unsigned int.
8982 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8983 int.
8984 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8985 * layout.cc (Layout::create_symtab_sections): Cast the result of
8986 local_symcount * symsize to off_t in the gold_assert.
8987
be8fcb75
ILT
89882009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8989
8990 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8991 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8992 R_ARM_BASE_ABS.
8993 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8994 (Arm_relocate_functions::thm_abs5): New function.
8995 (Arm_relocate_functions::abs12): New function.
8996 (Arm_relocate_functions::abs16): New function.
8997 (Arm_relocate_functions::base_abs): New function.
8998 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8999 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
9000 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
9001 R_ARM_BASE_ABS.
9002 (Scan::global): Likewise.
9003 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
9004 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
9005 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
9006 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9007 R_ARM_BASE_ABS.
9008
c2a122b6
ILT
90092009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9010
9011 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
9012 (Arm_relocate_functions::movt_prel): New function.
9013 (Arm_relocate_functions::thm_movw_prel_nc): New function.
9014 (Arm_relocate_functions::thm_movt_prel): New function.
9015 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
9016 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
9017 (Scan::global, Relocate::relocate): Likewise.
9018 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9019
c4aa1e2d
ILT
90202009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9021
9022 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
9023 Incremental_checker.
9024 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
9025 unsigned int.
9026 (class Incremental_inputs_header): New class.
9027 (Incremental_inputs_header_writer): Edit comment.
9028 (Incremental_inputs_entry): New class.
9029 (Incremental_inputs_entry_writer): Edit comment.
9030 (Sized_incremental_binary::do_find_incremental_inputs_section):
9031 Add *strtab_shndx parameter, fill it.
9032 (Sized_incremental_binary::do_check_inputs): New method.
9033 (Incremental_checker::can_incrementally_link_output_file): Use
9034 Sized_incremental_binary::check_inputs.
9035 (Incremental_inputs::report_command_line): Save command line in
9036 command_line_.
9037 * incremental.h:
9038 (Incremental_binary::find_incremental_inputs_section): New
9039 method.
9040 (Incremental_binary::do_find_incremental_inputs_section): Add
9041 strtab_shndx parameter.
9042 (Incremental_binary::do_check_inputs): New pure virtual method.
9043 (Sized_incremental_binary::do_check_inputs): Declare.
9044 (Incremental_checker::Incremental_checker): Add incremental_inputs
9045 parameter, use it to initialize incremental_inputs_.
9046 (Incremental_checker::incremental_inputs_): New field.
9047 (Incremental_checker::command_line): New method.
9048 (Incremental_checker::inputs): New method.
9049 (Incremental_checker::command_line_): New field.
9050
c549a694
ILT
90512009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9052
9053 * incremental.cc: Include <cstdarg> and "target-select.h".
9054 (vexplain_no_incremental): New function.
9055 (explain_no_incremental): New function.
9056 (Incremental_binary::error): New method.
9057 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9058 method.
9059 (make_sized_incremental_binary): New function.
9060 (open_incremental_binary): New function.
9061 (can_incrementally_link_file): Add checks if output is ELF and has
9062 inputs section.
9063 * incremental.h: Include "elfcpp_file.h" and "output.h".
9064 (Incremental_binary): New class.
9065 (Sized_incremental_binary): New class.
9066 (open_incremental_binary): Declare.
9067 * object.cc (is_elf_object): Use
9068 elfcpp::Elf_recognizer::is_elf_file.
9069 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9070 * output.h (Output_file::filesize): New method.
9071
fd3c5f0b
ILT
90722009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9073
9074 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9075 New function.
9076 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9077 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9078 function.
9079 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9080 function.
9081 (Arm_relocate_functions::movw_abs_nc): New function.
9082 (Arm_relocate_functions::movt_abs): New function.
9083 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9084 (Arm_relocate_functions::thm_movt_abs): New function.
9085 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9086 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9087 (Scan::global): Likewise.
9088 (Relocate::relocate): Likewise.
9089 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9090
7f5309a5
ILT
90912009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9092
9093 * arm.cc (Arm_relocate_functions::got_prel) New function.
9094 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9095 (Relocate::relocate): Likewise.
9096 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9097
364c7fa5
ILT
90982009-10-06 Ian Lance Taylor <iant@google.com>
9099
9100 * options.h (class General_options): Define
9101 split_stack_adjust_size parameter.
9102 * object.h (class Object): Add uses_split_stack_ and
9103 has_no_split_stack_ fields. Add uses_split_stack and
9104 has_no_split_stack accessor functions. Declare
9105 handle_split_stack_section.
9106 (class Reloc_symbol_changes): Define.
9107 (class Sized_relobj): Define Function_offsets. Declare
9108 split_stack_adjust, split_stack_adjust_reltype, and
9109 find_functions.
9110 * object.cc (Object::handle_split_stack_section): New function.
9111 (Sized_relobj::do_layout): Call handle_split_stack_section.
9112 * dynobj.cc (Sized_dynobj::do_layout): Call
9113 handle_split_stack_section.
9114 * reloc.cc (Sized_relobj::relocate_sections): Call
9115 split_stack_adjust for executable sections in split_stack
9116 objects. Pass reloc_map to relocate_section.
9117 (Sized_relobj::split_stack_adjust): New function.
9118 (Sized_relobj::split_stack_adjust_reltype): New function.
9119 (Sized_relobj::find_functions): New function.
9120 * target-reloc.h: Include "object.h".
9121 (relocate_section): Add reloc_symbol_changes parameter. Change
9122 all callers.
9123 * target.h (class Target): Add calls_non_split method. Declare
9124 do_calls_non_split virtual method. Declare match_view and
9125 set_view_to_nop.
9126 * target.cc: Include "elfcpp.h".
9127 (Target::do_calls_non_split): New function.
9128 (Target::match_view): New function.
9129 (Target::set_view_to_nop): New function.
9130 * gold.cc (queue_middle_tasks): Give an error if mixing
9131 split-stack and non-split-stack objects with -r.
9132 * i386.cc (Target_i386::relocate_section): Add
9133 reloc_symbol_changes parameter.
9134 (Target_i386::do_calls_non_split): New function.
9135 * x86_64.cc (Target_x86_64::relocate_section): Add
9136 reloc_symbol_changes parameter.
9137 (Target_x86_64::do_calls_non_split): New function.
9138 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9139 parameter.
9140 * powerpc.cc (Target_powerpc::relocate_section): Add
9141 reloc_symbol_changes parameter.
9142 * sparc.cc (Target_sparc::relocate_section): Add
9143 reloc_symbol_changes parameter.
9144 * configure.ac: Call AM_CONDITIONAL for the default target.
9145 * configure: Rebuild.
9146 * testsuite/Makefile.am (TEST_AS): New variable.
9147 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9148 (check_DATA): Add split_i386 and split_x86_64 files.
9149 (SPLIT_DEFSYMS): Define.
9150 (split_i386_[1234n].o): New targets.
9151 (split_i386_[124]): New targets.
9152 (split_i386_[1234r].stdout): New targets.
9153 (split_x86_64_[1234n].o): New targets.
9154 (split_x86_64_[124]): New targets.
9155 (split_x86_64_[1234r].stdout): New targets.
9156 (MOSTLYCLEANFILES): Add new executables.
9157 * testsuite/split_i386.sh: New file.
9158 * testsuite/split_x86_64.sh: New file.
9159 * testsuite/split_i386_1.s: New file.
9160 * testsuite/split_i386_2.s: New file.
9161 * testsuite/split_i386_3.s: New file.
9162 * testsuite/split_i386_4.s: New file.
9163 * testsuite/split_i386_n.s: New file.
9164 * testsuite/split_x86_64_1.s: New file.
9165 * testsuite/split_x86_64_2.s: New file.
9166 * testsuite/split_x86_64_3.s: New file.
9167 * testsuite/split_x86_64_4.s: New file.
9168 * testsuite/split_x86_64_n.s: New file.
9169 * testsuite/testfile.cc (Target_test): Update relocation_section
9170 function.
9171 * testsuite/Makefile.in: Rebuild.
9172
e8a9fcda
ILT
91732009-10-06 Ian Lance Taylor <iant@google.com>
9174
9175 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9176 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9177 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9178 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9179 the address on ldo_addrs_.
9180 (Target_i386::Relocate::fix_up_ldo): New function.
9181
e99daf92
ILT
91822009-10-06 Rafael Espindola <espindola@google.com>
9183
9184 * plugin.cc (add_input_library): New.
9185 (Plugin::load): Add add_input_library to tv.
9186 (Plugin_manager::add_input_file): Add the is_lib argument.
9187 (add_input_file): Update call to Plugin_manager::add_input_file.
9188 (add_input_library): New.
9189 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9190
966d4097
DK
91912009-09-30 Doug Kwan <dougkwan@google.com>
9192
9193 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9194 symbol and call Symbol::may_need_copy_reloc to determine if
9195 a copy reloc is needed.
9196 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9197 nocopyreloc is given in command line.
9198 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9199 given in command line.
9200 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9201 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9202 of the removed Target_i386::may_need_copy_reloc.
9203 * options.h (copyreloc): New option with default value false.
9204 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9205 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9206 instead of the removed Target_powerpc::may_need_copy_reloc.
9207 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9208 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9209 instead of the removed Target_sparc::may_need_copy_reloc.
9210 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9211 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9212 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9213 instead of the removed Target_x86_64::may_need_copy_reloc.
9214
029ba973
ILT
92152009-09-30 Ian Lance Taylor <iant@google.com>
9216
9217 * object.h (class Object): Remove target_ field, and target,
9218 sized_target, and set_target methods.
9219 (Object::sized_target): Remove.
9220 (class Sized_relobj): Update declarations. Remove sized_target.
9221 * object.cc (Sized_relobj::setup): Remove target parameter.
9222 Change all callers.
9223 (Input_objects::add_object): Don't do anything with the target.
9224 (make_elf_sized_object): Add punconfigured parameter. Change all
9225 callers. Set or test parameter target.
9226 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9227 Change all callers.
9228 * parameters.cc (Parameters::set_target): Change parameter type to
9229 be non-const.
9230 (Parameters::default_target): Remove.
9231 (set_parameters_target): Change parameter type to be non-const.
9232 (parameters_force_valid_target): New function.
9233 (parameters_clear_target): New function.
9234 * parameters.h (class Parameters): Update declarations. Remove
9235 default_target method. Add sized_target and clear_target
9236 methods. Change target_ to be non-const.
9237 (set_parameters_target): Update declaration.
9238 (parameters_force_valid_target): Declare.
9239 (parameters_clear_target): Declare.
9240 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9241 as NULL if we aren't searching.
9242 (Add_symbols::run): Don't check for compatible target.
9243 * fileread.cc (Input_file::open_binary): Call
9244 parameters_force_valid_target.
9245 * gold.cc (queue_middle_tasks): Likewise.
9246 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9247 set_target on object.
9248 * dynobj.h (class Sized_dynobj): Update declarations.
9249 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9250 make_elf_object returns NULL.
9251 (Archive::include_member): Don't check whether object target is
9252 compatible.
9253 * output.cc (Output_section::add_input_section): Get target from
9254 parameters.
9255 (Output_section::relax_input_section): Likewise.
9256 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9257 parameters.
9258 (Sized_relobj::do_scan_relocs): Likewise.
9259 (Sized_relobj::relocate_sections): Likewise.
9260 * resolve.cc (Symbol_table::resolve): Likewise.
9261 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9262 parameter. Change all callers.
9263 (Symbol_table::add_from_object): Get target from parameters.
9264 (Symbol_table::add_from_relobj): Don't check object target.
9265 (Symbol_table::add_from_dynobj): Likewise.
9266 (Symbol_table::define_special_symbol): Get target from
9267 parameters.
9268 * symtab.h (class Symbol_table): Update declaration.
9269 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9270 parameter. Change all callers. Clear parameter target.
9271 (Binary_test): Test target here.
9272 * testsuite/object_unittest.cc (gold_testsuite): Remove
9273 target_test_pointer parameter. Change all callers.
9274 (Object_test): Test target here.
9275
a6a22b83
ILT
92762009-09-26 Ian Lance Taylor <iant@google.com>
9277
9278 * testsuite/initpri1.c: Don't try to use constructor priorities if
9279 compiling with gcc before 4.3.
9280
6a8f49fe
ILT
92812009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9282
9283 * testsuite/retain_symbols_file_test.sh (check_present): Change
9284 output file name to retain_symbols_file_test.stdout.
9285 (check_absent): Likewise.
9286
8c604651
CS
92872009-09-18 Craig Silverstein <csilvers@google.com>
9288
9289 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9290 * options.cc: Include <cerrno> and <fstream>.
9291 (General_options::finalize): Parse -retain-symbols-file tag.
9292 * options.h: New flag.
9293 (General_options): New method should_retain_symbol, new
9294 variable symbols_to_retain.
9295 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9296 should_retain_symbol map.
9297 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9298 * testsuite/Makefile.in: Regenerate.
9299 * testsuite/retain_symbols_file_test.sh: New file.
9300
ca58b19f
NC
93012009-09-18 Nick Clifton <nickc@redhat.com>
9302
9303 * po/es.po: Updated Spanish translation.
9304
20e6d0d6
DK
93052009-09-17 Doug Kwan <dougkwan@google.com>
9306
9307 * debug.h (DEBUG_RELAXATION): New constant.
9308 (DEBUG_ALL): Add DEBUG_RELAXATION.
9309 (debug_string_to_enum): Add relaxation debug option.
9310 * layout.cc
9311 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9312 Layout::Relaxation_debug_check::read_sections,
9313 Layout::Relaxation_debug_check::read_sections): New method definitions.
9314 (Layout::Layout): Initialize data members
9315 record_output_section_data_from_scrips_,
9316 script_output_section_data_list_ and relaxation_debug_check_.
9317 (Layout::save_segments, Layout::restore_segments,
9318 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9319 Layout::relaxation_loop_body): New method definitions.
9320 (Layout::finalize): Support relaxation. Move section layout code to
9321 Layout::relaxation_loop_body.
9322 (Layout::set_asection_address_from_script): Move code for orphan
9323 section placement out.
9324 (Layout::place_orphan_sections_in_script): New method definition.
9325 * layout.h (Output_segment_headers, Output_file_header):
9326 New forward class declarations.
9327 (Layout::~Layout): Define.
9328 (Layout::new_output_section_data_from_script): New method definition.
9329 (Layout::place_orphan_sections_in_script): New method declaration.
9330 (Layout::Segment_states): New type declaration.
9331 (Layout::save_segments, Layout::restore_segments,
9332 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9333 Layout::relaxation_loop_body): New method declarations.
9334 (Layout::Output_section_data_list): New type declaration.
9335 (Layout::Relaxation_debug_check): New class definition.
9336 (Layout::record_output_section_data_from_script_,
9337 Layout::script_output_section_data_list_, Layout::segment_states_,
9338 Layout::relaxation_debug_check_): New data members.
9339 * output.cc: (Output_section_headers::do_size): New method definition.
9340 (Output_section_headers::Output_section_headers): Move size
9341 computation to Output_section_headers::do_size.
9342 (Output_segment_headers::do_size): New method definition.
e1df38aa 9343 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
9344 Output_file_header::do_size and call it.
9345 (Output_file_header::do_size): New method definition.
9346 (Output_data_group::Output_data_group): Adjust call to
9347 Output_section_data.
9348 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9349 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 9350 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
9351 RELAXED_INPUT_SECTION_CODE.
9352 (Output_section::Output_section): Initialize data member checkpoint_.
9353 (Output_section::~Output_section): Delete checkpoint object pointed
9354 by checkpoint_.
9355 (Output_section::add_input_section): Always add an Input_section if
9356 relaxing.
9357 (Output_section::add_merge_input_section): Add assert.
9358 (Output_section::relax_input_section): New method definition.
9359 (Output_section::set_final_data_size): Set load address to zero for
9360 an unallocated section.
9361 (Output_section::do_address_and_file_offset_have_reset_values):
9362 New method definition.
9363 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9364 Handle relaxed input section.
9365 (Output_section::sort_attached_input_sections): Checkpoint input
9366 section list lazily.
9367 (Output_section::get_input_sections): Change type of input_sections to
9368 list of Simple_input_section pointers. Checkpoint input section list
9369 lazily. Also handle relaxed input sections.
9370 (Output_section::add_input_section_for_script): Take a reference to
9371 a Simple_input_section object instead of Relobj pointer and section
9372 index as parameter. Handle relaxed input sections.
9373 (Output_section::save_states, Output_section::restore_states): New
9374 method definitions.
9375 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9376 (Output_data::is_data_size_fixed): New method definition.
9377 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9378 if it is fixed.
9379 (Output_data::address_and_file_offset_have_reset_values): New method
9380 definition.
9381 (Output_data::do_address_and_file_offset_have_reset_values): New method
9382 definition.
9383 (Output_data::set_data_size): Check that data size is not fixed.
9384 (Output_data::fix_data_size): New method definition.
9385 (Output_data::is_data_size_fixed_): New data member.
9386 (Output_section_headers::set_final_data_size): New method definition.
9387 (Output_section_headers::do_size): New method declaration.
9388 (Output_segment_headers::set_final_data_size): New method definition.
9389 (Output_segment_headers::do_size): New method declaration.
9390 (Output_file_header::set_final_data_size)::New method definition.
9391 (Output_file_header::do_size)::New method declaration.
9392 (Output_section_data::Output_section_data): Add new parameter
9393 is_data_size_fixed and use it to fix data size.
9394 (Output_data_const::Output_data_const): Adjust call to base class
9395 constructor and fix data size.
9396 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9397 base class constructor and fix data size.
9398 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9399 base class constructor and fix data size.
9400 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9401 class constructor and fix data size.
9402 (Output_data_group::set_final_data_size): New method definition.
9403 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9404 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9405 class constructor and fix data size.
9406 (Output_relaxed_input_section): New class definition.
9407 (Output_section::Simple_input_section): New class definition.
9408 (Output_section::get_input_sections): Adjust parameter list.
9409 (Output_section::add_input_section_for_script): Same.
9410 (Output_section::save_states, Output_section::restore_states,
9411 Output_section::do_address_and_file_offset_have_reset_values,
9412 (Output_section::Input_section::Input_section): Handle
9413 RELAXED_INPUT_SECTION_CODE. Add new overload for
9414 Output_relaxed_input_section.
9415 (Output_section::Input_section::is_input_section,
9416 Output_section::Input_section::set_output_section): Handle relaxed
9417 input section.
9418 (Output_section::Input_section::is_relaxed_input_section,
9419 Output_section::Input_section::output_section_data,
9420 Output_section::Input_section::relaxed_input_section): New method
9421 definitions.
9422 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9423 value.
9424 (Output_section::Input_section::u1_): Update comments.
9425 (Output_section::Input_section::u2_): Add new union member poris.
9426 (Output_section::Checkpoint_output_section): New classs definition.
9427 (Output_section::relax_input_section): New method declaration.
9428 (Output_section::checkpoint_): New data member.
9429 (Output_segment): Update comments.
9430 (Output_segment::Output_segment): Un-privatize copy constructor.
9431 (Output_segment::operator=): Un-privatize.
9432 * script-sections.cc (Output_section_element::Input_section_list):
9433 Change element type to Output_section::Simple_input_section.
9434 (Output_section_element_dot_assignment::set_section_addresses):
9435 Register output section data for relaxation clean up.
9436 (Output_data_exression::Output_data_expression): Adjust call to base
9437 constructor to fix data size.
9438 (Output_section_element_data::set_section_addresses): Register
9439 Output_data_expression object for relaxation clean up.
9440 (struct Input_section_info): Replace Relobj pointer and section index
9441 pair with Output_section::Simple_input_section and Convert struct to a
9442 class.
9443 (Input_section_sorter::operator()): Adjust access to
e1df38aa 9444 Input_section_info data member to use accessors.
20e6d0d6
DK
9445 (Output_section_element_input::set_section_addresses): Use layout
9446 parameter. Adjust code to use Output_section::Simple_input_section
9447 and Input_secction_info classes. Register filler for relaxation
9448 clean up.
9449 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9450 and section index pair with Output_section::Simple_input_section
9451 class. Adjust code accordingly.
9452 (Phdrs_element::release_segment): New method definition.
9453 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9454 segment list.
9455 (Script_sections::release_segments): New method definition.
9456 * gold/script-sections.h (Script_sections::release_segments): New
9457 method declaration.
9458 * gold/target.h (Target::may_relax, Target::relax,
9459 Target::do_may_relax, Target::do_relax): New method definitions.
9460
5e445df6
ILT
94612009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9462
9463 * arm.cc (has_signed_unsigned_overflow): New function.
9464 (Arm_relocate_functions::abs8): New function.
9465 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9466 (Target_arm::Scan::global): Likewise.
9467 (Target_arm::relocate::relocate): Likewise.
9468 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9469 Likewise.
9470
8c604651 94712009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
9472
9473 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9474 * testsuite/Makefile.in: Regenerate.
9475
1e9cc1c2
NC
94762009-09-11 Nick Clifton <nickc@redhat.com>
9477
9478 * po/gold.pot: Updated by the Translation project.
9479
6a89f575
CC
94802009-09-08 Cary Coutant <ccoutant@google.com>
9481
9482 * output.cc (Output_file::open): Add execute permission to empty file.
9483 * testsuite/Makefile.am (permission_test): New test.
9484 * testsuite/Makefile.in: Regenerate.
9485
fdcac5af
ILT
94862009-09-02 Ian Lance Taylor <iant@google.com>
9487
9488 * output.cc (Output_file::resize): Call map_no_anonymous rather
9489 than map.
9490
44453f85
ILT
94912009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9492
9493 * gold.cc: Include "incremental.h".
9494 (queue_initial_tasks): Call Incremental_checker methods.
9495 * incremental.cc: Include "output.h".
9496 (Incremental_checker::can_incrementally_link_output_file): New
9497 method.
9498 * incremental.h (Incremental_checker): New class.
9499
9500 * output.cc (Output_file::open_for_modification): New method.
9501 (Output_file::map_anonymous): Changed return type to bool. Record
9502 map in base_ field.
9503 (Output_file::map_no_anonymous): New method, broken out of map.
9504 (Output_file::map): Use map_no_anonymous and map_anonymous.
9505 * output.h (class Output_file): Update declarations.
9506
293c1386
CC
95072009-08-24 Cary Coutant <ccoutant@google.com>
9508
9509 * options.h (Command_line::Pre_options): New class.
9510 (Command_line::pre_options): New member.
9511 * options.cc (gold::options::ready_to_register): New variable.
9512 (One_option::register_option): Do nothing if not registering options.
9513 Assert if same short option registered twice.
9514 (General_options::General_options): Turn off option registration when
9515 done constructing.
9516 (Command_line::Pre_options::Pre_options): New constructor.
9517
f773f3d2
CC
95182009-08-24 Cary Coutant <ccoutant@google.com>
9519
06a73cfe
CC
9520 * options.h (General_options::no_keep_memory): Remove incorrect
9521 short option.
f773f3d2 9522
a15af8e2
RW
95232009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9524
9525 * Makefile.am (am__skiplex, am__skipyacc): New.
9526 * Makefile.in: Regenerate.
9527
c462b41b
RW
95282009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9529
14ec8efd
RW
9530 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9531 (INCLUDES): ... this.
9532 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9533 (AM_CPPFLAGS): Renamed from ...
9534 (INCLUDE): ... this.
9535 * Makefile.in, testsuite/Makefile.in: Regenerate.
9536
81ecdfbb
RW
9537 * Makefile.in: Regenerate.
9538 * aclocal.m4: Likewise.
9539 * config.in: Likewise.
9540 * configure: Likewise.
9541 * testsuite/Makefile.in: Likewise.
9542
c462b41b
RW
9543 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9544 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9545 * Makefile.in: Regenerate.
9546 * testsuite/Makefile.in: Regenerate.
9547
2da73f13
CC
95482009-08-19 Cary Coutant <ccoutant@google.com>
9549
9550 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9551 symbols in shared libraries overridden by hidden or internal symbols
9552 in the main program.
9553
2db70501
CD
95542009-08-19 Chris Demetriou <cgd@google.com>
9555
9556 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9557 checking source file names in error messages.
9558
f733487b
DK
95592009-08-18 Doug Kwan <dougkwan@google.com>
9560
9561 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9562 an elcpp::Ehdr as parameter. Adjust call to set_target.
9563 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9564 an elfcpp::Ehdr as parameter.
9565 * object.cc (Object::set_target): Remove the version that looks up
9566 a target and sets it.
9567 (Sized_relobj::setup): Take a Target object instead of
9568 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9569 (make_elf_sized_object): Find target and ask target to
9570 make an ELF object.
9571 * object.h: (Object::set_target): Remove the version that looks up
9572 a target and sets it.
9573 (Sized_relobj::setup): Take a Target object instead of
9574 an elfcpp:Ehdr as parameter.
9575 * target.cc: Include dynobj.h.
9576 (Target::do_make_elf_object_implementation): New.
2e702c99 9577 (Target::do_make_elf_object): New.
f733487b
DK
9578 * target.h (Target::make_elf_object): New template declaration.
9579 (Target::do_make_elf_object): New method declarations.
9580 (Target::do_make_elf_object_implementation): New template declaration.
9581
cc70f101
ILT
95822009-08-14 Ian Lance Taylor <iant@google.com>
9583
9584 * gold.h (FUNCTION_NAME): Define.
9585 (gold_unreachable): Use FUNCTION_NAME.
9586
ef5e0cb1
ST
95872009-08-12 Sriraman Tallam <tmsriram@google.com>
9588
9589 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9590 symbol in the --keep-unique list is not found.
9591
48c187ce
ST
95922009-08-12 Sriraman Tallam <tmsriram@google.com>
9593
9594 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9595 been maked as --keep-unique.
9596 (Icf::unfold_section): New function.
9597 * icf.h (Icf::unfold_section): New function.
9598 * options.h (General_options::keep_unique): New option.
9599 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9600 * testsuite/Makefile.in: Regenerate.
9601 * testsuite/icf_keep_unique_test.sh: New file.
9602 * testsuite/icf_keep_unique_test.cc: New file.
9603
645afe0c
CC
96042009-08-12 Cary Coutant <ccoutant@google.com>
9605
9606 PR 10471
9607 * resolve.cc (Symbol_table::resolve): Check for references from
9608 dynamic objects to hidden and internal symbols.
9609 * testsuite/Makefile.am (hidden_test.sh): New test.
9610 * testsuite/Makefile.in: Regenerate.
9611 * testsuite/hidden_test.sh: New script.
9612 * testsuite/hidden_test_1.c: New test source.
9613 * testsuite/hidden_test_main.c: New test source.
9614
11af873f
DK
96152009-08-11 Doug Kwan <dougkwan@google.com>
9616
9617 * arm.cc: Update comments.
9618 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9619 segment to locate the .ARM.exidx section if present.
9620
b9f7d72d
DK
96212009-08-09 Doug Kwan <dougkwan@google.com>
9622
9623 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9624 patch.
9625
ddd3c53c
ST
96262009-08-07 Sriraman Tallam <tmsriram@google.com>
9627 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9628 compiler warnings.
9629
27721062
ST
96302009-08-06 Sriraman Tallam <tmsriram@google.com>
9631
9632 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9633 valid tls_segment only for non-debug-section relocations.
9634 * testsuite/Makefile.am: Add gc_tls_test.
9635 * testsuite/Makefile.in: Regenerate.
9636 * testsuite/gc_tls_test.cc: New file.
9637 * testsuite/gc_tls_test.sh: New file.
9638
ef15dade 96392009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 9640
ef15dade
ST
9641 * icf.cc: New file.
9642 * icf.h: New file.
9643 * Makefile.am (CCFILES): Add icf.cc.
9644 (HFILES): Add icf.h
9645 * Makefile.in: Regenerate.
9646 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9647 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9648 section, symbol and addend information for the relocs.
9649 * gold.cc (queue_middle_tasks): Call identical code folding.
9650 * gold.h: Add defines for multimap.
9651 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9652 to the call of finalize_local_symbols.
9653 * main.cc (main): Create object of class Icf.
9654 * object.cc (Sized_relobj::do_layout): Allow this function to be
9655 called twice during icf.
9656 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9657 to sections marked as identical by icf.
9658 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9659 when available.
9660 (Sized_relobj::do_section_entsize): New function.
9661 * object.h (Object::section_entsize): New function.
9662 (Object::do_section_entsize): New pure virtual function.
9663 (Relobj::finalize_local_symbols): Add new parameter.
9664 (Relobj::do_section_entsize): New function.
9665 * options.h (General_options::icf): New option.
9666 (General_options::icf_iterations): New option.
9667 (General_options::print_icf_sections): New option.
9668 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9669 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9670 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9671 icf.
9672 * symtab.cc (Symbol_table::is_section_folded): New function.
9673 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9674 to sections marked as identical by icf.
9675 * symtab.h (Symbol_table::set_icf): New function.
9676 (Symbol_table::icf): New function.
9677 (Symbol_table::is_section_folded): New function.
9678 (Symbol_table::icf_): New data member.
9679 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9680 * testsuite/Makefile.am: Add commands to build icf_test.
9681 * testsuite/Makefile.in: Regenerate.
9682 * testsuite/icf_test.sh: New file.
9683 * testsuite/icf_test.cc: New file.
9684
c3b65ac4
CD
96852009-07-24 Chris Demetriou <cgd@google.com>
9686
9687 * layout.cc (is_compressible_debug_section): Fix incorrect
9688 comment about compressed section names.
9689
1caf2c51
ILT
96902009-07-20 Ian Lance Taylor <ian@airs.com>
9691
9692 PR 10419
9693 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9694
1ef4d87f
ILT
96952009-07-16 Ian Lance Taylor <iant@google.com>
9696
9697 PR 10400
9698 * layout.h: #include <map>.
9699 (class Kept_section): Change from struct to class. Add accessors
9700 and setters. Add section size to Comdat_group mapping. Change
9701 Comdat_group to std::map. Add is_comdat_ field. Add
9702 linkonce_size field in union.
9703 (class Layout): Update declaration of find_or_add_kept_section.
9704 Don't declare find_kept_object.
9705 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9706 parameter. Add object, shndx, is_comdat, and is_group_name
9707 parameters. Change all callers. Adjust for new Kept_section.
9708 (Layout::find_kept_object): Remove.
9709 * object.cc (Sized_relobj::include_section_group): Update use of
9710 Kept_section. Rename secnum to shndx. Only record
9711 Kept_comdat_section if sections are the same size.
9712 (Sized_relobj::include_linkonce_section): Update use of
9713 Kept_section. Only record Kept_comdat_section if sections are the
9714 same size. Set size of linkonce section.
9715 (Sized_relobj::map_to_kept_section): Update call to
9716 get_kept_comdat_section.
9717 * object.h (class Sized_relobj): Rename fields in
9718 Kept_comdat_section to drop trailing underscores; change object
9719 field to Relobj*. Change Kept_comdat_section_table to store
9720 struct rather than pointer.
9721 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9722 Add kept_object and kept_shndx parameters. Change all callers.
9723 (Sized_relobj::get_kept_comdat_section): Change return type to
9724 bool. Add kept_object and kept_shndx parameters. Change all
9725 callers.
9726 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9727 Layout::find_or_add_kept_section.
9728
37c3b7b0
ILT
97292009-07-09 Ian Lance Taylor <iant@google.com>
9730
9731 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9732 Reserve space in the hash table.
9733
98fa85cb
ILT
97342009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9735
9736 * fileread.cc (File_read::get_mtime): New method.
9737 * fileread.h (Timespec): New structure.
9738 (File_read::get_mtime): New method.
9739 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9740 Renamed from timestamp_nsec.
9741 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9742 Elf_Xword.
e1df38aa 9743 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 9744 timestamp_nsec.
e1df38aa 9745 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
9746 (Incremental_inputs::report_obejct): Save mtime; style fix.
9747 (Incremental_inputs::report_script): Save mtime; style fix.
9748 (Incremental_inputs::finalize_inputs): Style fix.
9749 (Incremental_inputs::finalize): Style fix.
9750 (Incremental_inputs::create_input_section_data): Store inputs
9751 mtime.
9752 * incremental.h (Incremental_inputs::report_script): Add mtime
9753 argument.
9754 (Incremental_inputs::Input_info::Input_info): Intialize only one
9755 union member.
9756 (Incremental_inputs::Input_info::archive): Move to nameless
9757 union.
9758 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9759 (Incremental_inputs::Input_info::script): Move to nameless union.
9760 (Incremental_inputs::mtime): New field.
9761 * script.cc (read_input_script): Pass file mtime to
9762 Incremental_input.
9763 * script.h (Script_info::inputs): Style fix.
9764
c9d70757
ILT
97652009-07-01 Ian Lance Taylor <ian@airs.com>
9766
9767 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9768 instead of 32.
9769
9c547ec3
ILT
97702009-06-24 Ian Lance Taylor <iant@google.com>
9771
9772 PR 10156
9773 * layout.cc (Layout::choose_output_section): If we find an
9774 existing section, update the flags.
9775 (Layout::create_notes): New function, broken out of
9776 Layout::finalize.
9777 (Layout::finalize): Don't create note sections.
9778 (Layout::create_note): Don't crash if linker script discards
9779 section.
9780 (Layout::create_gold_note): Likewise.
9781 (Layout::create_build_id): Likewise. Don't set
9782 after_input_sections on the section.
9783 (Layout::create_executable_stack_info): Remove target parameter.
9784 Change caller.
9785 * layout.h (class Layout): Declare create_notes. Update
9786 declaration of create_executable_stack_info.
9787 * gold.cc (queue_middle_tasks): Call create_notes.
9788 * output.cc (Output_section::update_flags_for_input_section): Move
9789 here from output.h. If SHF_ALLOC flag is newly set, mark address
9790 invalid.
9791 * output.h (Output_data::mark_address_invalid): New function.
9792 (class Output_section): Only declare, not define,
9793 update_flags_for_input_section. Remove set_flags.
9794
55458500
ILT
97952009-06-24 Ian Lance Taylor <iant@google.com>
9796
9797 * script-sections.cc (Output_section_definition::
9798 set_section_addresses): Rename shadowing local load_address to
9799 laddr.
9800
1307d6cd
ILT
98012009-06-24 Ian Lance Taylor <iant@google.com>
9802
9803 PR 10244
9804 * reloc.cc (relocate_sections): Skip empty relocation sections.
9805
ec3f783e
ILT
98062009-06-23 Ian Lance Taylor <iant@google.com>
9807
9808 PR 10156
9809 * layout.cc (Layout::create_note): Use choose_output_section
9810 rather than make_output_section.
9811
459c9f1c
ILT
98122009-06-23 Ian Lance Taylor <iant@google.com>
9813
9814 PR 10237
9815 * options.cc (General_options::parse_V): Set printed_version_.
9816 (General_options::General_options): Initialize printed_version_.
9817 * options.h (class General_options): Add printed_version_ field.
9818 * gold.cc (queue_initial_tasks): If there are no input files,
9819 don't give a fatal error if we printed the version information.
9820 (queue_middle_tasks): If using -r with a shared object, give a
9821 fatal error rather than an ordinary error.
9822
1518dc8f
ILT
98232009-06-23 Ian Lance Taylor <iant@google.com>
9824
9825 PR 10219
9826 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9827 (Layout::make_output_section): Set have_stabstr_section_ if we see
9828 a .stab*str section.
9829 (Layout::finalize): Call link_stabs_sections.
9830 (Layout::link_stabs_sections): New file.
9831 * layout.h (class Layout): Add have_stabstr_section_ field.
9832 Declare link_stabs_sections.
9833
3d857b98
DK
98342009-06-23 Doug Kwan <dougkwan@google.com>
9835
9836 * Makefile.am (libgold_a_LIBADD): New.
9837 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 9838 * Makefile.in: Regenerate.
3d857b98
DK
9839 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9840 * configure: Regenerate.
9841 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9842 * fileread.cc: Include sys/state.h
9843 * gold.h: Declare memmem and strndup if found missing.
9844 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9845
0639a6f6
ILT
98462009-06-23 Ian Lance Taylor <iant@google.com>
9847
9848 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9849 * configure: Rebuild.
9850
8d63875c
ILT
98512009-06-23 Ian Lance Taylor <iant@google.com>
9852
9853 PR 10147
9854 * object.cc (Object::section_contents): Don't try to get a view if
9855 the section has length zero.
9856 (Object::handle_gnu_warning_section): If the section is empty, use
9857 the name of the section as the warning.
9858
f7c8a183
ILT
98592009-06-23 Ian Lance Taylor <iant@google.com>
9860
9861 PR 10133
9862 * stringpool.h (class Stringpool_template): Add optimize_ field.
9863 (Stringpool_template::set_optimize): New function.
9864 * stringpool.cc (Stringpool_template::Stringpool_template):
9865 Initialize optimize_ field.
9866 (Stringpool_template::set_string_offsets): Test local optimize
9867 fild rather than parameter.
9868 * layout.cc (Layout::Layout): Call set_optimize on the section
9869 name stringpool.
9870
e6a307ba
ILT
98712009-06-22 Ian Lance Taylor <iant@google.com>
9872
9873 PR 10030
9874 * yyscript.y: Parse TARGET.
9875 * script.cc (script_set_target): New function.
9876 * script-c.h (script_set_target): Declare.
9877 * options.cc (General_options::string_to_object_format): Rename
9878 from string_to_object_format in anonymous namespace. Change
9879 callers.
9880 * options.h (class General_options): Declare
9881 string_to_object_format.
9882
3ee173de
ILT
98832009-06-22 Ian Lance Taylor <iant@google.com>
9884
9885 * script-sections.cc (Script_sections::create_segments): Don't put
9886 program headers in a PT_LOAD segment if -n or -N.
9887
98882009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
9889
9890 PR 10141
9891 * options.h (class General_options): Add -z lazy and -z now. Sort
9892 -z options into alphabetical order.
9893 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9894
cd6739a1 98952009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
9896
9897 * layout.cc (Layout::make_output_section): Call
9898 Target::new_output_section.
9899 (Layout::attach_allocated_section_to_segment): Put large section
9900 sections in a separate load segment with the large segment flag
9901 set.
9902 (Layout::segment_precedes): Sort large data segments after other
9903 load segments.
9904 (align_file_offset): New static function.
9905 (Layout::set_segment_offsets): Use align_file_offset.
9906 * output.h (class Output_section): Add is_small_section_ and
9907 is_large_section_ fields.
9908 (Output_section::is_small_section): New function.
9909 (Output_section::set_is_small_section): New function.
9910 (Output_section::is_large_section): New function.
9911 (Output_section::set_is_large_section): New function.
9912 (Output_section::is_large_data_section): New function.
9913 (class Output_segment): Add is_large_data_segment_ field.
9914 (Output_segment::is_large_data_segment): New function.
9915 (Output_segment::set_is_large_data_segment): New function.
9916 * output.cc (Output_section::Output_section): Initialize new
9917 fields.
9918 (Output_segment::Output_segment): Likewise.
9919 (Output_segment::add_output_section): Add assertion that large
9920 data sections always go in large data segments. Force small data
9921 sections to the end of the list of data sections. Force small BSS
9922 sections to the start of the list of BSS sections. For large BSS
9923 sections to the end of the list of BSS sections.
9924 * symtab.h (class Symbol): Declare is_common_shndx.
9925 (Symbol::is_defined): Check Symbol::is_common_shndx.
9926 (Symbol::is_common): Likewise.
9927 (class Symbol_table): Define enum Commons_section_type. Update
9928 declarations. Add small_commons_ and large_commons_ fields.
9929 * symtab.cc (Symbol::is_common_shndx): New function.
9930 (Symbol_table::Symbol_table): Initialize new fields.
9931 (Symbol_table::add_from_object): Put small and large common
9932 symbols in the right list.
9933 (Symbol_table::sized_finalized_symbol): Check
9934 Symbol::is_common_shndx.
9935 (Symbol_table::sized_write_globals): Likewise.
9936 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9937 common symbol lists. Don't call do_allocate_commons_list if the
9938 list is empty.
9939 (Symbol_table::do_allocate_commons_list): Remove is_tls
9940 parameter. Add comons_section_type parameter. Change all
9941 callers. Handle small and large common symbols.
9942 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9943 Symbol::is_common_shndx.
9944 * resolve.cc (symbol_to_bits): Likewise.
9945 * target.h (Target::small_common_shndx): New function.
9946 (Target::small_common_section_flags): New function.
9947 (Target::large_common_shndx): New function.
9948 (Target::large_common_section_flags): New function.
9949 (Target::new_output_section): New function.
9950 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9951 small_common_section_flags, and large_common_section_flags
9952 fields.
9953 (Target::do_new_output_section): New virtual function.
9954 * arm.cc (Target_arm::arm_info): Initialize new fields.
9955 * i386.cc (Target_i386::i386_info): Likewise.
9956 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9957 Likewise.
9958 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9959 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9960 (Target_x86_64::do_new_output_section): New function.
9961 * configure.ac: Define conditional MCMODEL_MEDIUM.
9962 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9963 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9964 (large_LDFLAGS): Define.
9965 * testsuite/large.c: New file.
9966 * testsuite/testfile.cc (Target_test::test_target_info):
9967 Initialize new fields.
9968 * configure, testsuite/Makefile.in: Rebuild.
9969
bb04269c
DK
99702009-06-05 Doug Kwan <dougkwan@google.com>
9971
9972 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 9973 * Makefile.in: Regenerate.
bb04269c
DK
9974 * i386.cc (class Target_i386): Define new virtual method to
9975 override do_is_local_label_name in parent.
9976 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9977 local symbols if --discard-locals or -X is given.
9978 * options.h (class General_options): Declare new options
9979 '--discard-locals' and '-X' for discarding locals.
9980 * target.h (class Target): Define new methods is_local_label_name.
9981 Declare new virtual method do_is_local_label_name.
9982 * target.cc: New file.
9983 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9984 (check_SCRIPTS): Add discard_locals_test.sh.
9985 (check_DATA): Add discard_local_tests.syms.
9986 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9987 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9988 * testsuite/Makefile.in: Regenerate.
9989 * testsuite/discard_locals_test.c: New file.
9990 * testsuite/discard_locals_test.sh: Same.
9991
805bb01c
DK
99922009-06-05 Doug Kwan <dougkwan@google.com>
9993
9994 * object.cc (Sized_relobj::Sized_relobj): Initialize
9995 discarded_eh_frame_shndx_ to -1U.
9996 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9997 section.
9998 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9999 a discarded .eh_frame section.
10000 (Sized_relobj::do_finalize_local_symbols): Ditto.
10001 * object.h (class Sized_relobj): Declare new member
10002 discarded_eh_frame_shndx_.
10003 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
10004 (local_labels_test.o, local_labels_test): New rules.
10005 * testsuite/Makefile.in: Regenerate.
10006
1dcd334d
DK
100072009-06-04 Doug Kwan <dougkwan@google.com>
10008
10009 * layout.cc (Layout::section_name_mapping): Add mapping for
10010 special ARM sections.
10011
96d49306
DK
100122009-06-03 Doug Kwan <dougkwan@google.com>
10013
10014 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
10015 (utils::has_overflow): Same.
10016
dff16297
ILT
100172009-06-03 Ian Lance Taylor <iant@google.com>
10018
10019 * layout.cc (Layout::section_name_mapping): New array, replacing
10020 Layout::linkonce_mapping.
10021 (Layout::section_name_mapping_count): New variable, replacing
10022 Layout::linkonce_mapping_count.
10023 (Layout::linkonce_output_name): Remove.
10024 (Layout::output_section_name): Rewrite.
10025 * layout.h (class Layout): Rename Linkonce_mapping to
10026 Section_name_mapping, linkonce_mapping to section_name_mapping,
10027 linkonce_mapping_count to section_name_mapping_count. Don't
10028 declare linkonce_output_name.
10029
c121c671
DK
100302009-06-03 Doug Kwan <dougkwan@google.com>
10031
10032 * gold/arm.cc (namespace utils): New.
10033 (Target_arm::reloc_is_non_pic): Define new method.
10034 (class Arm_relocate_functions): New.
10035 (Target_arm::Relocate::relocate): Handle relocation types used by
10036 Android.
10037
07800fab
ILT
100382009-06-03 Ian Lance Taylor <iant@google.com>
10039
10040 * arm.cc (Target_arm::scan::global): Use || instead of |.
10041
c121c671
DK
100422009-06-02 Doug Kwan <dougkwan@google.com>
10043
10044 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10045 issued_non_pic_error_.
10046 (class Target_arm::Scan): Declare new method check_non_pic.
10047 Define new method symbol_needs_plt_entry.
10048 Declare new data member issued_non_pic_error_.
10049 (class Target_arm::Relocate): Declare new method
10050 should_apply_static_reloc.
10051 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10052 (Target_arm::Scan::check_non_pic): Define new method.
10053 (Target_arm::Scan::local): Handle a small subset of reloc types used
10054 by Android.
10055 (Target_arm::Scan::local): Same.
10056 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10057
b19b0c6d
ILT
100582009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10059
10060 * incremental.cc (Incremental_inputs::report_command_line): Filter
10061 out --incremental-* options.
10062
94cdfcff
DK
100632009-05-29 Doug Kwan <dougkwan@google.com>
10064
10065 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10066 template class.
10067 (class Target_arm): Update comment.
10068 (Target_arm::Target_arm): Initialize new data members GOT_,
10069 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10070 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10071 and Target_arm::rel_dyn_section.
10072 Declare new_enum Target_arm::Got_type.
10073 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10074 and DYNBSS_.
10075 Update commments for member do_dynsym_value.
10076 (Target_arm::got_size, Target_arm::plt_section,
10077 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10078 new methods inside class defintion.
10079 (Target_arm::got_section): Define new method.
10080 (Target_arm::rel_dyn_section): Same.
10081 (Output_data_plt_arm): New template class.
10082 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10083 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10084 (Output_data_plt_arm::add_entry): Same.
10085 (Output_data_plt_arm::first_plt_entry): Define new
10086 static data member for PLT instruction template.
10087 (Output_data_plt_arm::plt_entry): Same.
10088 (Output_data_plt_arm::do_write): Define new method.
10089 (Target_arm::make_plt_entry): Same.
10090 (Target_arm::do_finalize_sections): Same.
10091 (Target_arm::do_dynsym_value): Same.
10092
4a657b0d
DK
100932009-05-28 Doug Kwan <dougkwan@google.com>
10094
10095 * Makefile.am (TARGETSOURCES): Add arm.cc.
10096 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10097 * Makefile.in: Regenerate.
10098 * arm.cc: New file.
10099 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10100
e7ae8c36
DK
101012009-05-26 Doug Kwan <dougkwan@google.com>
10102
10103 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10104 (General_options::check_excluded_libs): Strip off directories in
10105 archive name before matching like GNU ld does.
10106 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10107 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10108 (exclude_libs_test_LDFLAGS): Add linker option
10109 -Wl,--exclude-libs,libexclude_libs_test_3
10110 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10111 an explicit archive without using -l.
10112 (alt/libexclude_libs_test_3.a): New make rule.
10113 * testsuite/Makefile.in: Regenerate.
10114 * testsuite/exclude_libs_test.c : Declare lib3_default().
10115 (main): Call it.
10116 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10117 * exclude_libs_test_3.c: New file.
10118
f12e7348
NC
101192009-05-26 Nick Clifton <nickc@redhat.com>
10120
10121 * po/id.po: New Indonesian translation.
10122 * po/gold.pot: Updated template file.
10123
4daadc0d
ST
101242009-05-22 Sriraman Tallam <tmsriram@google.com>
10125
e1df38aa 10126 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
10127 gc_comdat_test files. Add -Wl,--gc-sections to build
10128 gc_comdat_test.
10129 * testsuite/Makefile.in: Regenerate.
10130 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10131
531813ad
ST
101322009-05-21 Sriraman Tallam <tmsriram@google.com>
10133
10134 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10135 kept comdat section was garbage collected.
10136 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10137 * testsuite/Makefile.in: Regenerate.
10138 * testsuite/gc_comdat_test.sh: New file.
10139 * testsuite/gc_comdat_test_1.cc: New file.
10140 * testsuite/gc_comdat_test_2.cc: New file.
10141
65514900
CC
101422009-05-19 Doug Kwan <dougkwan@google.com>
10143
10144 * archive.cc (Archive::Archive): Move constructor from archive.h
10145 to here. Initialize no_export_.
10146 (Archive::get_elf_object_for_member): Set no_export flag of object.
10147 * archive.h (Archive::Archive): Move constructor body to
10148 archive.cc.
10149 (Archive::no_export): New method.
10150 (Archive::no_export_): New field.
10151 * object.h (Object::Object): Initialize no_export_ to false.
10152 (Object::no_export, Object::set_no_export): New methods.
10153 (Object::no_export_): New field.
10154 * options.cc (General_options::parse_exclude_libs): New method.
10155 (General_options::check_excluded_libs) Same.
10156 * options.h (exclude_libs): New option.
10157 (General_options::check_excluded_libs): New method declaration.
10158 (General_options::excluded_libs_): New field.
10159 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10160 default or protected visibility if an object has no-export flag set.
10161 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10162 (check_SCRIPTS): Add exclude_libs_test.sh.
10163 (check_DATA): Add exclude_libs_test.syms.
10164 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10165 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10166 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10167 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10168 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10169 libexclude_libs_test_2.a): New rules.
10170 * testsuite/Makefile.in: Regenerate.
10171 * testsuite/exclude_libs_test.c: New file.
10172 * testsuite/exclude_libs_test.sh: Ditto.
10173 * testsuite/exclude_libs_test_1.c: Ditto.
10174 * testsuite/exclude_libs_test_2.c: Ditto.
10175
1b77ea50
ILT
101762009-05-15 Ian Lance Taylor <iant@google.com>
10177
10178 * configure.ac: Check for declarations for cases where libiberty.h
10179 checks HAVE_DECL_xxx.
10180 * configure, config.in: Rebuild.
10181
072fe7ce
ILT
101822009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10183
10184 * gold.h (Incremental_argument_list): Remove (invalid) forward
10185 declaration.
10186 * incremental.cc (Incremental_inputs::report_achive): New method.
10187 (Incremental_inputs::report_object): New method.
10188 (Incremental_inputs::report_script): New method.
10189 (Incremental_inputs::finalize_inputs): New method.
10190 (Incremental_inputs::finalize): Call finalize_inputs().
10191 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10192 Create inputs entries.
10193 * incremental.h (Incremental_input_type): New enum.
10194 (Incremental_inputs::Incremental_input): Initialize new fields.
10195 (Incremental_inputs::report_inputs): New method.
10196 (Incremental_inputs::report_achive): New method.
10197 (Incremental_inputs::report_object): New method.
10198 (Incremental_inputs::report_script): New method.
10199 (Incremental_inputs::finalize_inputs): New method.
10200 (Incremental_inputs::Input_info): New struct.
10201 (Incremental_inputs::Input_info_map): New typedef.
10202 (Incremental_inputs::lock_): New field.
10203 (Incremental_inputs::Inputs_): New field.
10204 (Incremental_inputs::Inputs_map): New field.
10205 * main.cc (main): Call Incremental_input::report_inputs.
10206 * options.h (Input_argument_list): Typedef moved from
10207 Input_arguments.
10208 (Input_file_group::Files): Remove, use ::Input_argument_list.
10209 (Input_file_group::Input_argument_list): Remove, use
10210 ::Input_argument_list.
10211 * plugin.cc (Plugin_manager::add_input_file): Add error in
10212 incremental build.
10213 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10214 functions.
10215 * script.cc (read_input_script): Call
10216 Incremental_input::report_script.
10217 * script.h (Script_info): New class.
10218
b0481b0b
ILT
102192009-04-27 Ian Lance Taylor <iant@google.com>
10220
10221 * x86_64.cc (do_adjust_output_section): Set entsize to
10222 plt_entry_size.
10223
b22a5a41 102242009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
10225
10226 * output.cc (Output_file::close): After short writes, continue
10227 writing from the correct offset in the buffer being written.
10228
40fde488
CD
102292009-04-23 Chris Demetriou <cgd@google.com>
10230
10231 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10232 * configure: Regenerate.
10233 * config.in: Regenerate.
10234 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10235 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10236
3ce2c28e
ILT
102372009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10238
10239 * incremental.cc (Incremental_inputs_header_data): Renamed from
10240 Incremental_input_header_data.
10241 (Incremental_inputs_header_data::data_size): New field.
10242 (Incremental_inputs_header_data::put_input_file_count): Renamed
10243 from input_file_count.
10244 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10245 from command_line_offset.
10246 (Incremental_inputs_header_data::put_reserved): Renamed from
10247 put_reserved.
10248 (Incremental_inputs_entry_data): Renamed from
10249 Incremental_input_entry_data.
10250 (Incremental_inputs_entry_data::data_size): New field.
10251 (Incremental_inputs::report_command_line): New method.
10252 (Incremental_inputs::finalize): New method.
10253 (Incremental_inputs::create_incremental_inputs_data): New method.
10254 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10255 * incremental.h: New file.
10256 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10257 (Layout::finalize): Create incremental inputs section in
10258 incremental builds.
10259 (Layout::create_incremental_info_sections): New method.
10260 * layout.h (Layout::incremental_inputs): New method.
10261 (Layout::create_incremental_info_sections): New method.
10262 (Layout::incremental_inputs_): New field.
10263 * main.cc (main): Notify Incremental_input of the command line.
10264
e55bde5e
ILT
102652009-04-01 Ian Lance Taylor <iant@google.com>
10266 Mikolaj Zalewski <mikolajz@google.com>
10267
10268 * gold.h (reserve_unordered_map): Define, three versions, one for
10269 each version of Unordered_map.
10270 * layout.cc (Layout::Layout): Remove options parameter. Add
10271 number_of_input_files parameter. Don't initialize options_.
10272 Initialize number_of_input_files_ and resized_signatures_. Move
10273 sections_are_attached_.
10274 (Layout::layout_group): Reserve space for group_signatures_.
10275 (Layout::find_or_add_kept_section): Change name parameter to be a
10276 reference. Resize signatures_ map when it gets large enough.
10277 (Layout::layout_eh_frame): Use parameters->options() instead of
10278 this->options_.
10279 (Layout::make_output_section): Likewise.
10280 (Layout::attach_allocated_section_to_segment): Likewise.
10281 (Layout::finalize, Layout::create_executable_stack): Likewise.
10282 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10283 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10284 * layout.h (class Layout): Update declarations. Remove options_
10285 field. Add number_of_input_files_ and resized_signatures_
10286 fields. Move sections_are_attached_ field.
10287 * main.cc (main): Pass number of input files to Layout
10288 constructor. Don't pass options.
10289
154b857c
ILT
102902009-03-30 Ian Lance Taylor <iant@google.com>
10291
10292 * ffsll.c (ffsll): Correct implementation.
10293
2f35ab9b
ILT
102942009-03-27 Ian Lance Taylor <iant@google.com>
10295
fd03461a
ILT
10296 * ffsll.c: New file.
10297 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10298 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10299 * ftruncate.c (ftruncate): Declare before definition.
10300 * mremap.c (mremap): Likewise.
10301 * pread.c (pread): Likewise.
10302 * configure, Makefile.in, config.in: Rebuild.
10303
2f35ab9b
ILT
10304 * mremap.c: New file.
10305 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10306 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10307 (mremap): Declare if HAVE_MREMAP is not defined.
10308 * configure, Makefile.in, config.in: Rebuild.
10309
33aea2fd
CC
103102009-03-27 Cary Coutant <ccoutant@google.com>
10311
10312 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10313 position independent.
10314 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10315 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10316
6d479619
CC
103172009-03-24 Cary Coutant <ccoutant@google.com>
10318
10319 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10320 an executable.
10321 (needs_dynamic_reloc): Likewise.
10322
afc06bb8
ILT
103232009-03-24 Ian Lance Taylor <iant@google.com>
10324
10325 * yyscript.y (file_cmd): Recognize EXTERN.
10326 (extern_name_list, extern_name_list_body): New nonterminals.
10327 * script.cc (script_add_extern): Define.
10328 * script-c.h (script_add_extern): Declare.
10329
f6060a4d
ILT
103302009-03-24 Rafael Avila de Espindola <espindola@google.com>
10331
10332 * object.cc (is_elf_object): Define.
10333 * object.h (is_elf_object): Declare.
10334 * archive.cc (Archive::get_elf_object_for_member): Call
10335 is_elf_object.
33aea2fd 10336 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 10337
26736d8e
ILT
103382009-03-24 Elliott Hughes <enh@google.com>
10339
10340 * output.cc (Output_file::map_anonymous): Define.
10341 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10342 try an anonymous one. Report the size if the mmap fails.
10343 * output.h (class Output_file): Declare map_anonymous.
10344
22fd9730
ILT
103452009-03-24 Ian Lance Taylor <iant@google.com>
10346
10347 * target-select.cc (instantiate_target): Don't acquire the lock if
10348 the instantiated_target_ field has already been set.
10349
cb010894
ILT
103502009-03-23 Ian Lance Taylor <iant@google.com>
10351
7f055c20
ILT
10352 * gold-threads.h (class Initialize_lock): Define.
10353 * gold-threads.cc (class Initialize_lock_once): Define.
10354 (initialize_lock_control): New static variable.
10355 (initialize_lock_pointer): New static variable.
10356 (initialize_lock_once): New static function.
10357 (Initialize_lock::Initialize_lock): Define.
10358 (Initialize_lock::initialize): Define.
10359 * target-select.h: Include "gold-threads.h".
10360 (class Target_selector): Add lock_ and initialize_lock_ fields.
10361 Don't define instantiate_target, just declare it.
10362 * target-select.cc (Target_selector::Target_selector): Initialize
10363 new fields.
10364 (Target_selector::instantiate_target): Define.
10365 * descriptors.h: Include "gold-threads.h".
10366 (class Descriptors): Add initialize_lock_ field.
10367 * descriptors.cc (Descriptors::Descriptors): Initialize new
10368 field.
10369 (Descriptors::open): Use initialize_lock_ field
10370 * errors.h (class Errors): Add initialize_lock_ field.
10371 * errors.cc (Errors::Errors): Initialize new field.
10372 (Errors::initialize_lock): Use initialize_lock_ field.
10373 * powerpc.cc (class Target_selector_powerpc): Remove
10374 instantiated_target_ field. In do_recognize call
10375 instantiate_target rather than do_instantiate_target. In
10376 do_instantiate_target just allocate a new target.
10377 * sparc.cc (class Target_selector_sparc): Likewise.
10378
36959681
ILT
10379 * freebsd.h: New file.
10380 * i386.cc: Include "freebsd.h".
10381 (Target_i386): Derive from Target_freebsd rather than
10382 Sized_target.
10383 (Target_selector_i386): Derive from Target_selector_freebsd rather
10384 than Target_selector.
10385 * x86_64.cc: Include "freebsd.h".
10386 (Target_x86_64): Derive from Target_freebsd rather than
10387 Sized_target.
10388 (Target_selector_x86_64): Derive from Target_selector_freebsd
10389 rather than Target_selector.
10390 * target.h (class Target): Add adjust_elf_header and
10391 do_adjust_elf_header.
10392 * output.cc (Output_file_header:: do_sized_write): Call target
10393 adjust_elf_header routine.
10394 * configure.tgt: Set targ_osabi.
10395 * configure.ac: Define GOLD_DEFAULT_OSABI.
10396 * parameters.cc (Parameters::default_target): Pass
10397 GOLD_DEFAULT_OSABI to select_target.
10398 * target-select.h (class Target_selector): Make instantiate_target
10399 protected rather than private.
10400 * Makefile.am (HFILES): Add freebsd.h.
10401 * configure, Makefile.in, config.in: Rebuild.
10402
cb010894
ILT
10403 * merge.cc (do_add_input_section): Correct pend value. Change
10404 message about last entry not being null terminated from error to
10405 warning.
10406
0e879927
ILT
104072009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10408
10409 * incremental.cc: New file.
10410 * Makefile.am (CCFILES): Add incremental.cc.
10411 * Makefile.in: Rebuild.
10412
41105937
PP
104132009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10414
10415 * layout.cc (Layout::output_section_name): Preserve names
10416 of '.note.' sections.
e1df38aa 10417
60439920
ILT
104182009-03-19 Ian Lance Taylor <iant@google.com>
10419
10420 * descriptors.cc (Descriptors::open): Check that the options are
10421 valid before using them.
10422
0d371ad3
ILT
104232009-03-18 Ian Lance Taylor <iant@google.com>
10424
10425 * script-sections.h: Include <list>.
10426 (class Script_sections): Change Sections_elements from std::vector
10427 to std::list. Typedef public Elements_iterator. Add
10428 orphan_section_placement_, data_segment_align_start_, and
10429 saw_data_segment_align_ fields. Remove data_segment_align_index_
10430 field.
10431 * script-sections.cc (class Orphan_section_placement): New class.
10432 (class Sections_element): Add virtual functions is_relro and
10433 orphan_section_init. Remove virtual function place_orphan_here.
10434 (class Output_section_definition): Add is_relro and
10435 orphan_section_init. Remove place_orphan_here.
10436 (class Orphan_output_section): Likewise.
10437 (Script_sections::Script_sections): Update for field changes.
10438 (Script_sections::data_segment_align): Set saw_data_segment_align_
10439 and data_segment_align_start_, not data_segment_align_index.
10440 (Script_sections::data_segment_relro_end): Check
10441 saw_data_segment_align_. Use data_segment_align_start_ rather
10442 than data_segment_align_index_.
10443 (Script_sections::place_orphan): Rewrite to use
10444 Orphan_section_placement.
10445
9201d894
ILT
104462009-03-17 Ian Lance Taylor <iant@google.com>
10447
9c5b8369
ILT
10448 * archive.cc (Archive::add_symbols): Check for a version attached
10449 to the symbol name in the archive map.
10450 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10451 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10452 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10453 (ver_test_11.a): New target.
10454 * testsuite/Makefile.in: Rebuild.
10455
9201d894
ILT
10456 * configure.ac: Check for chsize and posix_fallocate. Replace
10457 ftruncate.
10458 * ftruncate.c: New file, from gnulib.
10459 * output.cc (posix_fallocate): Define dummy version if not
10460 HAVE_POSIX_FALLOCATE.
10461 (Output_file::map): Call posix_fallocate rather than lseek and
10462 write.
10463 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10464 * configure, Makefile.in, config.in: Rebuild.
10465
ef4ab7a8 104662009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 10467
ef4ab7a8
PP
10468 * layout.h (Layout::create_note): Add section_name parameter.
10469 * layout.cc (Layout::create_note): Likewise.
10470 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 10471
8c500701
ILT
104722009-03-17 Ian Lance Taylor <iant@google.com>
10473
e85b18e1
ILT
10474 * descriptors.cc: Include "options.h".
10475 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10476 (Descriptors::open): Always use O_CLOEXEC when opening a new
10477 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10478 then set FD_CLOEXEC.
10479
9efe6174
ILT
10480 * sparc.cc (class Target_sparc): Add has_got_section.
10481 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10482 make sure we have a GOT section.
10483
10484 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10485 (Target_sparc::Scan::local): Likewise.
10486 (Target_sparc::Scan::global): Likewise.
10487 (Target_sparc::Relocate::relocate): Likewise.
10488 (Target_sparc::Relocate::relocate_tls): Likewise.
10489
8c500701
ILT
10490 * symtab.cc (Symbol_table::define_default_version): New function,
10491 broken out of add_from_object.
10492 (Symbol_table::add_from_object): Call define_default_version.
10493 (Symbol_table::define_special_symbol): Add resolve_oldsym
10494 parameter. Change all callers. If the version for a symbol comes
10495 from a version script, resolve it with the symbol with the same
10496 name with no version. Also add the symbol without a version if
10497 appropriate.
10498 (do_define_in_output_data): If resolving with oldsym, don't delete
10499 sym.
10500 (do_define_in_output_segment): Likewise.
10501 (do_define_as_constant): Likewise.
10502 * symtab.h (class Symbol_table): Update declarations.
10503
f1ed28fb
ILT
105042009-03-13 Ian Lance Taylor <iant@google.com>
10505
15f8229b
ILT
10506 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10507 (Read_symbols::requeue): New function.
10508 (Read_symbols::do_read_symbols): If make_elf_object fails because
10509 the target type is not configured, and the file was searched for,
10510 issue a warning and retry with the next directory.
10511 (Add_symbols::run): If the file has an incompatible format, and
10512 it was searched for, requeue the Read_symbols task. On error,
10513 release the object.
10514 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10515 dirindex parameter to constructor. Change all callers. Declare
10516 incompatible_warning and requeue.
10517 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10518 input_argument_ and input_group_ fields. Add them to
10519 constructor. Change all callers.
10520 (class Read_script): Add dirindex_ field. Add it to constructor.
10521 Change all callers.
10522 * archive.cc (Archive::setup): Remove input_objects parameter.
10523 Change all callers.
10524 (Archive::get_file_and_offset): Likewise.
10525 (Archive::read_all_symbols): Likewise.
10526 (Archive::read_symbols): Likewise.
10527 (Archive::get_elf_object_for_member): Remove input_objects
10528 parameter. Add punconfigured parameter. Change all callers.
10529 (Archive::add_symbols): Change return type to bool. Check return
10530 value of include_member.
10531 (Archive::include_all_members): Likewise.
10532 (Archive::include_member): Change return type to bool. Return
10533 false if first included object has incompatible target. Set
10534 included_member_ field.
10535 (Add_archive_symbols::run): If add_symbols returns false, requeue
10536 Read_symbols task.
10537 * archive.h (class Archive): Add included_member_ field.
10538 Initialize it in constructor. Add input_file and searched_for
10539 methods. Update declarations.
10540 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10541 input_argument_ fields. Add them to constructor. Change all
10542 callers.
10543 * script.cc: Include "target-select.h".
10544 (class Parser_closure): Add skip_on_incompatible_target_ and
10545 found_incompatible_target_ fields. Add
10546 skip_on_incompatible_target parameter to constructor. Change all
10547 callers. Add methods skip_on_incompatible_target,
10548 clear_skip_on_incompatible_target, found_incompatible_target, and
10549 set_found_incompatible_target.
10550 (read_input_script): Add dirindex parameter. Change all callers.
10551 If parser finds an incompatible target, requeue Read_symbols
10552 task.
10553 (script_set_symbol): Clear skip_on_incompatible_target in
10554 closure.
10555 (script_add_assertion, script_parse_option): Likewise.
10556 (script_start_sections, script_add_phdr): Likewise.
10557 (script_check_output_format): New function.
10558 * script.h (read_input_script): Update declaration.
10559 * script-c.h (script_check_output_format): Declare.
10560 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10561 (ignore_cmd): Remove OUTPUT_FORMAT.
10562 * fileread.cc (Input_file::Input_file): Add explicit this.
10563 (Input_file::will_search_for): New function.
10564 (Input_file::open): Add pindex parameter. Change all callers.
10565 * fileread.h (class Input_file): Add input_file_argument method.
10566 Declare will_search_for. Update declarations.
10567 * object.cc (make_elf_object): Add punconfigured parameter.
10568 Change all callers.
10569 * object.h (class Object): Make input_file public. Add
10570 searched_for method.
10571 (make_elf_object): Update declaration.
10572 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10573 restart search.
10574 * dirsearch.h (class Dirsearch): Update declaration.
10575 * options.h (class General_options): Add --warn-search-mismatch.
10576 * parameters.cc (Parameters::is_compatible_target): New function.
10577 * parameters.h (class Parameters): Declare is_compatible_target.
10578 * workqueue.cc (Workqueue::add_blocker): New function.
10579 * workqueue.h (class Workqueue): Declare add_blocker.
10580
f1ed28fb
ILT
10581 * fileread.cc (Input_file::open): Remove options parameter.
10582 Change all callers.
10583 (Input_file::open_binary): Likewise.
10584 * script.cc (read_input_script): Likewise.
10585 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10586 options parameter from constructor. Change all callers.
10587 (class Read_script): Likewise.
10588 * fileread.h (class Input_file): Update declarations.
10589 * script.h (read_input_script): Update declaration.
10590
34dd024a
NC
105912009-03-10 Nick Clifton <nickc@redhat.com>
10592
10593 * po/es.po: New Spanish translation.
10594
6d71b17c
CC
105952009-03-06 Cary Coutant <ccoutant@google.com>
10596
10597 * options.cc (parse_short_option): Keep dash_z from registering itself.
10598
031cdbed
ILT
105992009-03-03 Ian Lance Taylor <iant@google.com>
10600
10601 PR 9918
10602 * target-reloc.h (relocate_section): Pass output_section to
10603 relocate.
10604 * i386.cc (Target_i386::should_apply_static_reloc): Add
10605 output_section parameter. Change all callers.
10606 (Target_i386::Relocate::relocate): Add output_section parameter.
10607 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10608 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10609 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10610 * testsuite/two_file_shared.sh: New script.
10611 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10612 (check_DATA): Add two_file_shared.dbg.
10613 (two_file_shared.dbg): New target.
10614 * testsuite/Makefile.in: Rebuild.
10615
15d5fa16
ILT
106162009-03-01 Ian Lance Taylor <iant@google.com>
10617
10618 * configure.ac: Check for byteswap.h.
10619 * configure: Rebuild.
10620 * config.in: Rebuild.
10621
8a4c0b0d
ILT
106222009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10623
10624 * layout.cc (Layout::find_or_add_kept_section): New function.
10625 (Layout::add_comdat): Removed.
10626 * layout.h (struct Kept_section): Move out of class Layout.
10627 Remove trailing underscores from field names. Add group_sections
10628 field. Rename group_ field to is_group. Change all uses.
10629 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10630 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10631 comdat_groups_ field.
10632 (Sized_relobj::include_section_group): Use
10633 find_or_add_kept_section and Kept_section::group_sections.
10634 (Sized_relobj::include_linkonce_section): Likewise.
10635 * object.cc (class Sized_relobj): Don't define Comdat_group or
10636 Comdat_group_table. Remove find_comdat_group and
10637 add_comdat_group. Remove comdat_groups_ field.
10638 * plugin.cc (include_comdat_group): Use
10639 Layout::find_or_add_kept_section.
10640
b4ecf66b
ILT
106412009-02-28 Ian Lance Taylor <iant@google.com>
10642
14359ca0
ILT
10643 * README: --gc-sections and map files are now supported. Document
10644 some build requirements.
10645
b4ecf66b
ILT
10646 PR 6992
10647 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10648 relocatable link set the value of the section symbol to zero.
10649 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10650 relocatable link don't include the section address in the local
10651 symbol value.
10652
0602e05a
ILT
106532009-02-27 Ian Lance Taylor <iant@google.com>
10654
fd9d194f
ILT
10655 PR 6811
10656 * options.h (class Search_directory): Add is_system_directory.
10657 (class General_options): Declare is_in_system_directory.
10658 * options.cc (get_relative_sysroot): Make static.
10659 (get_default_sysroot): Make static.
10660 (General_optoins::is_in_system_directory): New function.
10661 * fileread.cc (Input_file::is_in_system_directory): New function.
10662 * fileread.h (class Input_file): Declare is_in_system_directory.
10663 * object.h (class Object): Add is_in_system_directory.
10664 (class Input_objects): Remove system_library_directory_ field.
10665 * object.cc (Input_objects::add_object): Don't set
10666 system_library_directory_.
10667 (input_objects::found_in_system_library_directory): Remove.
10668 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10669 parameter. Change all callers.
10670 (Symbol_table::sized_write_globals): Likewise.
10671 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10672 Call Object::is_in_system_directory.
10673 * symtab.h (class Symbol_table): Update declarations.
10674
61edd21f
ILT
10675 PR 5990
10676 * descriptors.h (Open_descriptor): Add is_on_stack field.
10677 * descriptors.cc (Descriptors::open): If the descriptor is on the
10678 top of the stack, remove it. Initialize is_on_stack field.
10679 (Descriptors::release): Only add pod to stack if it is not on the
10680 stack already.
10681 (Descriptors::close_some_descriptor): Clear stack_next and
10682 is_on_stack fields.
10683
e29e076a
ILT
10684 PR 7091
10685 * output.cc (Output_section::find_starting_output_address): Rename
10686 from starting_output_address; add PADDR parameter; change return
10687 type.
10688 * output.h (class Output_section): Declare
10689 find_starting_output_address instead of starting_output_address.
10690 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10691 section symbol for which we can't find a merge section.
10692
0602e05a
ILT
10693 PR 9836
10694 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10695 hidden or internal, force the symbol to be local.
10696 * resolve.cc (Symbol::override_visibility): Define.
10697 (Symbol::override_base): Use override_visibility.
10698 (Symbol_table::resolve): Likewise.
10699 (Symbol::override_base_with_special): Likewise.
10700 (Symbol_table::override_with_special): If the visibility is hidden
10701 or internal, force the symbol to be local.
10702 * symtab.h (class Symbol): Add set_visibility and
10703 override_visibility.
10704 * testsuite/ver_test_1.sh: New file.
10705 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10706 (check_DATA): Add ver_test_1.syms.
10707 (ver_test_1.syms): New target.
10708 * testsuite/Makefile.in: Rebuild.
10709
401a9a73
CC
107102009-02-25 Cary Coutant <ccoutant@google.com>
10711
10712 * layout.cc (Layout::choose_output_section): Don't rename sections
10713 when using a linker script that has a SECTIONS clause.
10714 * Makefile.in: Regenerate.
10715
10716 * testsuite/Makefile.am (script_test_5.sh): New test case.
10717 * testsuite/Makefile.in: Regenerate.
10718 * testsuite/script_test_5.cc: New file.
10719 * testsuite/script_test_5.sh: New file.
10720 * testsuite/script_test_5.t: New file.
10721
f488e4b0
CC
107222009-02-13 Rafael Avila de Espindola <espindola@google.com>
10723
10724 * archive.cc (Archive::include_member): Update calls to add_symbols.
10725 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10726 the Layout argument.
10727 * dynobj.h (do_add_symbols): Add the Layout argument.
10728 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10729 Layout argument.
10730 * object.h (Object::add_symbols): Add the Layout argument.
10731 (Object::do_add_symbols): Add the Layout argument.
10732 (Sized_relobj::do_add_symbols): Add the Layout argument.
10733 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10734 Unify the two versions.
10735 (Add_plugin_symbols): Remove.
10736 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10737 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10738 (Add_plugin_symbols): Remove.
10739 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10740 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10741 (Add_symbols::run): Make it work with Pulginobj.
10742
89dd1680
ILT
107432009-02-06 Ian Lance Taylor <iant@google.com>
10744
10745 * object.cc (Sized_relobj::do_layout): Make info message start
10746 with lower case letter.
10747
266d0a74
ILT
107482009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10749
602b464e
ILT
10750 * binary.cc: Fix file comment.
10751
266d0a74
ILT
10752 * options.h (enum Incremental_disposition): Define.
10753 (class General_options): Add new options: --incremental,
10754 --incremental_changed, --incremental_unchanged,
10755 --incremental_unknown. Add incremental_disposition_ and
10756 implicit_incremental_ fields.
10757 (General_options::incremental_disposition): New function.
10758 (class Position_dependent_options): Add incremental_disposition
10759 option.
10760 (Position_dependent_options::copy_from_options): Set incremental
10761 dispositions.
10762 * options.cc (General_options::parse_incremental_changed): New
10763 function.
2e702c99
RM
10764 (General_options::parse_incremental_unchanged): New function.
10765 (General_options::parse_incremental_unknown): New function.
10766 (General_options::General_options): Initialize new fields
266d0a74 10767 incremental_disposition_ and implicit_incremental_.
2e702c99 10768 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
10769 without --incremental.
10770
f073bbf7
CD
107712009-02-06 Chris Demetriou <cgd@google.com>
10772
10773 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10774 pointer and to report location as the file name associated with
10775 the symbol.
10776 (gold_undefined_symbol_at_location): New function to replace the
10777 old gold_undefined_symbol functionality.
10778 * target-reloc.h (relocate_section): Update to use
10779 gold_undefined_symbol_at_location.
10780 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10781 Call gold_undefined_symbol function rather than gold_error.
10782 * errors.h (Errors::undefined_symbol): Take location as a
10783 string, rather than calculating it from a relocation.
10784 * errors.cc (Errors::fatal): Print "fatal error:" before the
10785 formatted message.
10786 (Errors::error, Errors::error_at_location): Print "error: "
10787 before the formatted message.
10788 (Errors::undefined_symbol): Take location as a string, rather
10789 than calculating it from a relocation.
10790 (gold_undefined_symbol_at_location): New function akin to
10791 old gold_undefined_symbol, calculates location from relocation.
10792 (gold_undefined_symbol): Change to take only a Symbol pointer
10793 and to report location as the file name associated with the symbol.
10794 * testsuite/debug_msg.sh: Update for changed error messages.
10795 * testsuite/undef_symbol.sh: Likewise.
10796
8e94a90c
ILT
107972009-02-04 Duncan Sands <baldrick@free.fr>
10798
10799 PR 9812
10800 * reduced_debug_output.h
10801 (Output_reduced_debug_abbrev_section::failed): Use format for
10802 gold_warning.
10803 (Output_reduced_debug_info_section::faild): Likewise.
10804
88a0e15b
ILT
108052009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10806
10807 * script.cc (Lazy_demangler): New class.
2e702c99 10808 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
10809 symbol only once.
10810
5efc7cd2
CC
108112009-01-29 Cary Coutant <ccoutant@google.com>
10812
10813 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10814 to __tls_get_addr.
10815 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10816
e0ebcf42
ILT
108172009-01-28 Ian Lance Taylor <iant@google.com>
10818
5efc7cd2 10819 * version.cc (version_string): Bump to 1.9.
75fe7426 10820
e0ebcf42
ILT
10821 * gold.h: Include <cstring> and <stdint.h>.
10822 * version.cc: Include <cstdio>.
10823 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10824 warning.
10825 * reduced_debug_output.cc (insert_into_vector): Rename from
10826 Insert_into_vector; change all callers. Use Swap_unaligned to
10827 avoid aliasing issue; remove union since it is unnecessary.
10828
8e2813be 108292009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
10830
10831 * Makefile.am (CCFILES): Add gc.cc.
10832 (HFILES): Add gc.h.
10833 * Makefile.in: Regenerate.
10834 * gold.cc (Gc_runner): New class.
10835 (queue_initial_tasks): Call garbage collection related tasks
10836 when corresponding options are invoked.
10837 (queue_middle_gc_tasks): New function.
10838 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10839 processed early before laying out sections during garbage collection.
10840 * gold.h (queue_middle_gc_tasks): New function.
10841 (is_prefix_of): Move from "layout.cc".
10842 * i386.cc (Target_i386::gc_process_relocs): New function.
10843 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10844 * main.cc (main): Create object of class "Garbage_collection".
10845 * object.cc (Relobj::copy_symbols_data): New function.
10846 (Relobj::is_section_name_included): New function.
e1df38aa
NC
10847 (Sized_relobj::do_layout): Allow this function to be called twice
10848 during garbage collection and defer layout of section during the
6d03d481
ST
10849 first call.
10850 * object.h (Relobj::get_symbols_data): New function.
10851 (Relobj::is_section_name_included): New function.
10852 (Relobj::copy_symbols_data): New function.
10853 (Relobj::set_symbols_data): New function.
10854 (Relobj::get_relocs_data): New function.
10855 (Relobj::set_relocs_data): New function.
10856 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10857 (Relobj::gc_process_relocs): New function.
10858 (Relobj::do_gc_process_relocs): New pure virtual function.
10859 (Relobj::sd_): New data member.
10860 (Sized_relobj::is_output_section_offset_invalid): New function.
10861 (Sized_relobj::do_gc_process_relocs): New function.
10862 * options.h (General_options::gc_sections): Modify to not be a no-op.
10863 (General_options::print_gc_sections): New option.
10864 * plugin.cc (Plugin_finish::run): Remove function call to
10865 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10866 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10867 * reloc.cc (Read_relocs::run): Add task to process relocs and
10868 determine unreferenced sections when doing garbage collection.
10869 (Gc_process_relocs): New class.
10870 (Sized_relobj::do_gc_process_relocs): New function.
10871 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10872 sections that are garbage collected.
10873 * reloc.h (Gc_process_relocs): New class.
10874 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10875 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10876 symbols whose corresponding sections are garbage collected.
10877 (Symbol_table::Symbol_table): Add new parameter for the garbage
10878 collection object.
10879 (Symbol_table::gc_mark_undef_symbols): New function.
10880 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10881 (Symbol_table::gc_mark_dyn_syms): New function.
10882 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10883 as garbage.
10884 (Symbol_table::add_from_object): Likewise.
10885 (Symbol_table::add_from_relobj): When building shared objects, do not
10886 treat externally visible symbols as garbage.
10887 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10888 table information for static and relocatable links.
10889 * symtab.h (Symbol_table::set_gc): New function.
10890 (Symbol_table::gc): New function.
10891 (Symbol_table::gc_mark_undef_symbols): New function.
10892 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10893 (Symbol_table::gc_mark_dyn_syms): New function.
10894 (Symbol_table::gc_): New data member.
e1df38aa 10895 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
10896 function.
10897 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10898 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10899
3b293544
CF
109002009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10901
10902 * options.h (General_options::gc_sections): Define as a no-op for now.
10903 (General_options::no_keep_memory): Ditto.
10904 (General_options::Bshareable): Define.
10905 * options.cc (General_options::finalize): Honor -Bshareable.
10906
83d22aa8
AS
109072009-01-20 Andreas Schwab <schwab@suse.de>
10908
10909 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10910 read the value in the contents, since we don't use it. Use the
10911 template endianness when writing.
10912 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10913
cd536b21
AS
109142009-01-19 Andreas Schwab <schwab@suse.de>
10915
10916 * configure.tgt (powerpc64-*): Fix targ_obj.
10917
99e9a495
ILT
109182009-01-15 Ian Lance Taylor <iant@google.com>
10919
10920 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10921 local symbols when stripping all symbols.
10922
bbbfea06
CC
109232009-01-14 Cary Coutant <ccoutant@google.com>
10924
99e9a495 10925 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 10926
0f7c0701
CC
109272009-01-14 Cary Coutant <ccoutant@google.com>
10928
10929 * archive.cc (Archive::get_elf_object_for_member): Remove call
10930 to File_read::claim_for_plugin.
10931 * descriptors.cc (Descriptors::open): Remove reference to
10932 is_claimed.
10933 (Descriptors::claim_for_plugin): Remove.
10934 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10935 (Descriptors::is_claimed): Remove.
10936 (claim_descriptor_for_plugin): Remove.
10937 * fileread.cc (File_read::claim_for_plugin): Remove.
10938 * fileread.h (File_read::claim_for_plugin): Remove.
10939 (File_read::descriptor): Reopen descriptor if necessary.
10940 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10941 (Plugin_manager::all_symbols_read): Add task parameter. Change
10942 all callers.
10943 (Plugin_manager::get_input_file): New function.
10944 (Plugin_manager::release_input_file): New function.
10945 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10946 corresponding data member.
10947 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10948 and pass to base constructor. Change all callers.
10949 (get_input_file, release_input_file): New functions.
10950 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10951 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10952 (Plugin_manager::all_symbols_read): Add task parameter.
10953 (Plugin_manager::get_input_file): New function.
10954 (Plugin_manager::release_input_file): New function.
10955 (Plugin_manager::task_): New data member.
10956 (Pluginobj::Pluginobj): Add filesize parameter.
10957 (Pluginobj::filename): New function.
10958 (Pluginobj::descriptor): New function.
10959 (Pluginobj::filesize): New function.
10960 (Pluginobj::filesize_): New data member.
10961 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10962 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10963 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10964
10965 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10966 with archive libraries.
10967 * testsuite/Makefile.in: Regenerate.
10968 * testsuite/plugin_test.c (struct sym_info): New type.
10969 (get_input_file, release_input_file): New static variables.
10970 (onload): Capture new transfer vector entries.
10971 (claim_file_hook): Stop reading at end of file according to filesize.
10972 Factor out parsing of readelf output into separate function.
10973 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10974 APIs and get the source file name from the symbol table. Convert
10975 source file name to corresponding object file name. Print info
10976 message when adding new input files.
10977 (parse_readelf_line): New function.
10978 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10979 * testsuite/plugin_test_2.sh: Likewise.
10980 * testsuite/plugin_test_3.sh: Likewise.
10981 * testsuite/plugin_test_4.sh: New test case.
10982
62a6d109
ILT
109832009-01-07 Ian Lance Taylor <iant@google.com>
10984
10985 * version.cc (version_string): Bump to 1.8.
10986
483620e8
CC
109872008-12-23 Cary Coutant <ccoutant@google.com>
10988
10989 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10990 * plugin.cc (Plugin_manager::finish): Rename as
10991 layout_deferred_objects. Move cleanup to separate function.
10992 (Plugin_manager::cleanup): New function.
10993 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10994 separately.
10995 * plugin.h (Plugin_manager::finish): Rename as
10996 layout_deferred_objects.
10997 (Plugin_manager::cleanup): New function.
10998 (Plugin_manager::cleanup_done): New field.
10999
d66a9eb3
CC
110002008-12-23 Cary Coutant <ccoutant@google.com>
11001
11002 * plugin.cc (is_visible_from_outside): New function.
11003 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
11004 so we don't return "IR only" status for exported symbols or -r links.
11005
11006 * testsuite/Makefile.am (plugin_test_3): New test case.
11007 * testsuite/Makefile.in: Regenerate.
11008 * testsuite/plugin_test_3.sh: New file.
11009
5995b570
CC
110102008-12-22 Cary Coutant <ccoutant@google.com>
11011
11012 * object.cc (Sized_relobj::layout_section): New function.
11013 (Sized_relobj::do_layout): Defer layout of input sections until after
11014 plugin has provided replacement files.
11015 (Sized_relobj::do_layout_deferred_sections): New function.
11016 * object.h (Relobj::set_section_offset): Remove virtual keyword.
11017 (Relobj::layout_deferred_sections): New function.
11018 (Relobj::do_layout_deferred_sections): New function.
11019 (Sized_relobj::do_layout_deferred_sections): New function.
11020 (Sized_relobj::layout_section): New function.
11021 (Sized_relobj::Deferred_layout): New structure.
11022 (Sized_relobj::deferred_layout_): New field.
11023 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
11024 Change all callers. Layout deferred sections.
11025 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
11026 references.
11027 (Plugin_hook::run): Move code from do_plugin_hook inline.
11028 (Plugin_hook::do_plugin_hook): Remove.
11029 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
11030 (Plugin_manager::finish): Renamed, was cleanup.
11031 (Plugin_manager::should_defer_layout): New function.
11032 (Plugin_manager::add_deferred_layout_object): New function.
11033 (Plugin_manager::Deferred_layout_list): New type.
11034 (Plugin_manager::deferred_layout_objects_): New field.
11035 (Plugin_hook::do_plugin_hook): Remove.
11036
ee769c88
ILT
110372008-12-17 Ian Lance Taylor <iant@google.com>
11038
11039 * options.h (class General_options): Add --no case for
11040 --export-dynamic.
11041
abc8dcba
CC
110422008-12-16 Cary Coutant <ccoutant@google.com>
11043
11044 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11045 vector.
11046 (Plugin_manager::claim_file): Create plugin object even if
11047 plugin did not call the add_symbols callback.
11048 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11049 asking for more symbols than were added.
11050 * testsuite/Makefile.am (plugin_test_1): Add test case with
11051 no global symbols.
11052 (empty.syms): New target.
11053 * testsuite/Makefile.in: Regenerate.
11054 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11055 message. Don't call add_symbols if no globals.
11056 (all_symbols_read_hook): Don't provide replacement for empty
11057 claimed file.
11058
b0074644
ILT
110592008-12-12 Ian Lance Taylor <iant@google.com>
11060
68943102
ILT
11061 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11062 r_type == 0 for a local symbol with r_sym == 0.
11063 (scan_relocatable_relocs): Pass r_sym to
11064 local_non_section_strategy.
11065 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11066 r_sym parameter.
11067
b0074644
ILT
11068 * configure.ac: Update test for TLS descriptors: they are
11069 supported as of glibc 2.9.
11070 * configure: Rebuild.
11071
c2508178
ILT
110722008-12-11 Ian Lance Taylor <iant@google.com>
11073
11074 PR 7091
11075 * target-reloc.h (Default_scan_relocatable_relocs): For each
11076 function, map r_type == 0 to RELOC_DISCARD.
11077
2756a258
CC
110782008-12-10 Cary Coutant <ccoutant@google.com>
11079
11080 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11081 object to override a kept COMDAT group from a plugin object.
11082
bb6f53d3
ILT
110832008-12-09 Ian Lance Taylor <iant@google.com>
11084
fbc558e1
ILT
11085 PR 7088
11086 * yyscript.y (file_cmd): Handle INPUT.
11087
bb6f53d3
ILT
11088 * testsuite/initpri1.c: Change all declarations to be full
11089 prototypes by adding void, to avoid compiler warnings.
11090
4674ecfc
CC
110912008-12-05 Rafael Avila de Espindola <espindola@google.com>
11092
11093 * options.cc (General_options::parse_plugin_opt): New.
11094 (General_options::add_plugin): The argument now is just the filename.
11095 (General_options::add_plugin_option): New.
11096 * options.h (plugin_opt): New.
11097 (add_plugin): Change argument name.
11098 (add_plugin_option): New.
11099 * plugin.cc (Plugin::load): Don't parse the plugin option.
11100 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11101 (Plugin::add_option): New.
11102 (Plugin::args_): Change type.
11103 (Plugin::filename_): New.
11104 (Plugin_manager::add_plugin_option): New.
11105 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11106 * testsuite/Makefile.in: Regenerate.
11107
fd06b4aa
CC
111082008-12-05 Cary Coutant <ccoutant@google.com>
11109
11110 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11111 Handle --strip-lto-sections option.
11112 * options.h (strip_lto_sections): New option.
11113
6c52134c
CC
111142008-12-01 Cary Coutant <ccoutant@google.com>
11115
11116 * plugin.cc (ld_plugin_message): Change format parameter to const.
11117 Fix mismatch between new[] and delete.
11118
a45248e0
CC
111192008-11-14 Cary Coutant <ccoutant@google.com>
11120
11121 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11122 instead of -1U.
11123
c82fbeee
CS
111242008-11-05 Craig Silverstein <csilvers@google.com>
11125
11126 * options.cc (General_options::parse_dynamic_list): New function.
11127 * options.h (General_options): New flags dynamic_list,
11128 dynamic_list_data, dynamic_list_cpp_new, and
11129 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11130 (General_options::in_dynamic_list): New function.
11131 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11132 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11133 (Lex::can_continue_name): Likewise.
11134 (yylex): Likewise.
11135 (read_script_file): New parameter script_options.
11136 (read_dynamic_list): New function.
11137 (Script_options::define_dynamic_list): New function.
11138 (dynamic_list_keyword_parsecodes): New variable.
11139 (dynamic_list_keywords): New variable.
11140 * script.h (Script_options::define_dynamic_list): New function
11141 prototype.
11142 (read_dynamic_list): New function prototype.
11143 * symtab.cc (strprefix): New macro.
11144 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11145 dynamic_list_data, dynamic_list_cpp_new, and
11146 dynamic_list_cpp_typeinfo.
11147 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11148 (dynamic_list_expr): New rule.
11149 (dynamic_list_nodes): Likewise.
11150 (dynamic_list_node): Likewise.
11151 * testsuite/Makefile.am (dynamic_list): New test.
11152 * testsuite/Makefile.in: Regenerated.
11153 * testsuite/dynamic_list.t: New file.
11154 * testsuite/dynamic_list.sh: New file.
11155
e0bb29a5
CS
111562008-11-05 Craig Silverstein <csilvers@google.com>
11157
11158 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11159 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11160 (t11_last): Likewise.
11161 * testsuite/ver_test_6.c (main): Likewise.
11162
4e1e25e0
CC
111632008-10-07 Cary Coutant <ccoutant@google.com>
11164
11165 * options.c (General_options::finalize): Add check for -static and
11166 -shared.
11167 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11168 is not empty.
11169
92f03fcb
CC
111702008-10-02 Cary Coutant <ccoutant@google.com>
11171
11172 * plugin.cc (make_sized_plugin_object): Fix conditional
11173 compilation to work when not all targets are enabled.
11174
fbd8a257
CC
111752008-09-29 Cary Coutant <ccoutant@google.com>
11176
11177 * archive.cc (Archive::get_file_and_offset): Use filename instead
11178 of name to get library path.
11179 (Archive::include_member): Unlock external member of a thin archive.
11180
11181 * testsuite/Makefile.am (TEST_AR): New variable.
11182 (thin_archive_test_1): New test.
11183 (thin_archive_test_2): New test.
81636b3f
CC
11184 * testsuite/Makefile.in: Regenerate.
11185 * testsuite/thin_archive_main.cc: New file.
11186 * testsuite/thin_archive_test_1.cc: New file.
11187 * testsuite/thin_archive_test_2.cc: New file.
11188 * testsuite/thin_archive_test_3.cc: New file.
11189 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 11190
eff45813
CC
111912008-09-29 Cary Coutant <ccoutant@google.com>
11192
11193 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11194 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11195 instead of -1U.
11196 (Sized_relobj::do_finalize_local_symbols): Likewise.
11197 (Sized_relobj::map_to_kept_section): Likewise.
11198 * object.h (Sized_relobj::invalid_address): New constant.
11199 (Sized_relobj::do_output_section_offset): Check for invalid_address
11200 and return -1ULL.
11201 * output.cc (Output_reloc::local_section_offset): Use constant
11202 invalid_address instead of -1U.
11203 (Output_reloc::get_address): Likewise.
11204 (Output_section::output_address): Change -1U to -1ULL.
11205 * output.h (Output_reloc::invalid_address): New constant.
11206 * reloc.cc (Sized_relobj::write_sections): Use constant
11207 invalid_address instead of -1U.
11208 (Sized_relobj::relocate_sections): Likewise.
11209 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11210 values for merge sections.
11211 * target-reloc.h (relocate_for_relocatable): Use constant
11212 invalid_address instead of -1U.
11213
89fc3421
CC
112142008-09-19 Cary Coutant <ccoutant@google.com>
11215
11216 Add plugin functionality for link-time optimization (LTO).
11217 * configure.ac (plugins): Add --enable-plugins option.
11218 * configure: Regenerate.
11219 * config.in: Regenerate.
11220 * Makefile.am (LIBDL): New variable.
11221 (CCFILES): Add plugin.cc.
11222 (HFILES): Add plugin.h.
11223 (ldadd_var): Add LIBDL.
11224 * Makefile.in: Regenerate.
11225
11226 * archive.cc: Include "plugin.h".
11227 (Archive::setup): Don't preread archive symbols when using a plugin.
11228 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11229 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11230 files.
11231 (Archive::include_member): Add symbols from plugin objects.
11232 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11233 * descriptors.cc (Descriptors::open): Check for file descriptors
11234 abandoned by plugins.
11235 (Descriptors::claim_for_plugin): New function.
11236 * descriptors.h (Descriptors::claim_for_plugin): New function.
11237 (Open_descriptor::is_claimed): New field.
11238 (claim_descriptor_for_plugin): New function.
11239 * fileread.cc (File_read::claim_for_plugin): New function.
11240 * fileread.h (File_read::claim_for_plugin): New function.
11241 (File_read::descriptor): New function.
11242 * gold.cc: Include "plugin.h".
11243 (queue_initial_tasks): Add task to call plugin hooks for generating
11244 new object files.
11245 * main.cc: Include "plugin.h".
11246 (main): Load plugin libraries.
11247 * object.h (Pluginobj): Declare.
11248 (Object::pluginobj): New function.
11249 (Object::do_pluginobj): New function.
11250 (Object::set_target): New function.
11251 * options.cc: Include "plugin.h".
11252 (General_options::parse_plugin): New function.
11253 (General_options::General_options): Initialize plugins_ field.
11254 (General_options::add_plugin): New function.
11255 * options.h (Plugin_manager): Declare.
11256 (General_options): Add --plugin option.
11257 (General_options::has_plugins): New function.
11258 (General_options::plugins): New function.
11259 (General_options::add_plugin): New function.
11260 (General_options::plugins_): New field.
11261 * plugin.cc: New file.
11262 * plugin.h: New file.
11263 * readsyms.cc: Include "plugin.h".
11264 (Read_symbols::do_read_symbols): Check for archive before checking
11265 for ELF file. Call plugin hooks to claim files.
11266 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11267 from a real object file; force override when processing replacement
11268 files.
11269 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11270 (Symbol::init_base_object): Likewise.
11271 (Symbol::init_base_output_data): Likewise.
11272 (Symbol::init_base_output_segment): Likewise.
11273 (Symbol::init_base_constant): Likewise.
11274 (Symbol::init_base_undefined): Likewise.
11275 (Symbol::output_section): Assert that object is not a plugin.
11276 (Symbol_table::add_from_pluginobj): New function.
11277 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11278 undefined.
11279 (Symbol_table::sized_write_globals): Likewise.
11280 (Symbol_table::add_from_pluginobj): Instantiate template.
11281 * symtab.h (Sized_pluginobj): Declare.
11282 (Symbol::in_real_elf): New function.
11283 (Symbol::set_in_real_elf): New function.
11284 (Symbol::in_real_elf_): New field.
11285 (Symbol_table::add_from_pluginobj): New function.
11286
11287 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11288 (LIBDL): New variable.
11289 (LDADD): Add LIBDL.
11290 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11291 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11292 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11293 (MOSTLYCLEANFILES): Likewise.
11294 * testsuite/Makefile.in: Regenerate.
11295 * testsuite/plugin_test.c: New file.
11296 * testsuite/plugin_test_1.sh: New file.
11297 * testsuite/plugin_test_2.sh: New file.
11298
de31bda5
ILT
112992008-09-16 Ian Lance Taylor <iant@google.com>
11300
9c2d0ef9
ILT
11301 * target-reloc.h (relocate_section): Check whether a symbol is
11302 defined by the ABI before reporting an undefined symbol error.
11303 * target.h (Target::is_defined_by_abi): Make parameter const.
11304 (Target::do_is_defined_by_abi): Likewise.
11305 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11306 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11307 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11308 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11309 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11310 * testsuite/Makefile.in: Rebuild.
11311
de31bda5
ILT
11312 * fileread.cc (make_view): Add casts to avoid warning.
11313
9fa33bee
AO
113142008-09-16 Alexandre Oliva <aoliva@redhat.com>
11315
11316 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11317 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11318
183fd0e3
AO
113192008-09-16 Alexandre Oliva <aoliva@redhat.com>
11320
11321 * options.h (General_options::output_is_executable): New.
11322 (General_options::output_is_pie): New.
11323 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11324 for shared libraries.
11325 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11326
7be8330a
CD
113272008-09-11 Chris Demetriou <cgd@google.com>
11328
11329 * options.h (origin): New -z option.
11330 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11331 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11332 in DT_FLAGS_1.
11333
a9caad02
CC
113342008-09-05 Cary Coutant <ccoutant@google.com>
11335
11336 * fileread.cc (File_read::make_view): Add check for attempt to map
11337 beyond end of file.
11338
ae6dce4d
CC
113392008-09-05 Cary Coutant <ccoutant@google.com>
11340
11341 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11342 explicit instantiations.
11343
d7ab2a47
KVH
113442008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11345
11346 PR gold/6858
11347 * options.cc (General_options::finalize): Allow undefined symbols
11348 in shlibs if linking -shared.
11349
11350 PR gold/6859
11351 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11352 symbols as not needing a dynsym entry.
11353
1e52a9c1
CS
113542008-08-20 Craig Silverstein <csilvers@google.com>
11355
11356 * fileread.cc (File_read::open): Do not lock the file unless it
11357 was successfully opened.
11358
d85c80a3
CC
113592008-08-14 Cary Coutant <ccoutant@google.com>
11360
11361 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11362 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11363 * testsuite/tls_test.cc (struct int128): 128-bit struct
11364 for testing TLS relocs with non-zero addend.
11365 (v12): New TLS variable.
11366 (t12): New test.
11367 (t_last): Add check for v12.
11368 * testsuite/tls_test.h (t12): New function.
11369 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11370
2d924fd9
ILT
113712008-08-13 Ian Lance Taylor <iant@google.com>
11372
11373 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11374 set tls_segment_ or relro_segment_.
11375 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11376 when appropriate.
11377 * output.h (Output_section::clear_is_relro): New function.
11378 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11379 sections specially even when output_data_ is empty.
11380 (Output_segment::maximum_alignment): When first section is relro,
11381 only force alignment for PT_LOAD segments.
11382 * script.cc (script_data_segment_align): New function.
11383 (script_data_segment_relro_end): New function.
11384 * script-c.h (script_data_segment_align): Declare.
11385 (script_data_segment_relro_end): Declare.
11386 * script-sections.h (class Script_sections): Declare
11387 data_segment_align and data_segment_relro_end. Add fields
11388 segment_align_index_ and saw_relro_end_.
11389 * script-sections.cc (class Sections_element): Add set_is_relro
11390 virtual function. Add new bool* parameter to place_orphan_here.
11391 Add get_output_section virtual function.
11392 (class Output_section_definition): Add set_is_relro. Add new
11393 bool* parameter to place_orphan_here. Add get_output_section.
11394 Add is_relro_ field.
11395 (Output_section_definition::Output_section_definition): Initialize
11396 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11397 and is_relro_ fields.
11398 (Output_section_definition::place_orphan_here): Add is_relro
11399 parameter.
11400 (Output_section_definition::set_section_addresses): Set relro for
11401 output section.
11402 (Output_section_definition::alternate_constraint): Likewise.
11403 (class Orphan_output_section): Add new bool* parameter to
11404 place_orphan_here. Add get_output_section.
11405 (Orphan_output_section::place_orphan_here): Add is_relro
11406 parameter.
11407 (Script_sections::Script_sections): Initialize
11408 data_segment_align_index_ and saw_relro_end_.
11409 (Script_sections::data_segment_align): New function.
11410 (Script_sections::data_segment_relro_end): New function.
11411 (Script_sections::place_orphan): Set or clear is_relro.
11412 (Script_sections::set_section_addresses): Force alignment of first
11413 TLS section.
11414 * yyscript.y (exp): Call script_data_segment_align and
11415 script_data_segment_relro_end.
11416 * testsuite/relro_script_test.t: New file.
11417 * testsuite/relro_test.cc (using_script): Declare.
11418 (t1, t2): Test using_script.
11419 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11420 (relro_script_test_SOURCES): Define.
11421 (relro_script_test_DEPENDENCIES): Define.
11422 (relro_script_test_LDFLAGS): Define.
11423 (relro_script_test_LDADD): Define.
11424 (relro_script_test.so): New target.
11425 * testsuite/Makefile.in: Rebuild.
11426
f827c9a9
CC
114272008-08-06 Cary Coutant <ccoutant@google.com>
11428
11429 * archive.cc (Archive::total_archives, Archive::total_members)
11430 (Archive::total_members_loaded): New variables.
11431 (Archive::setup): Add parameter. Add option to preread
11432 archive symbols.
11433 (Archive::read_armap): Add counter.
11434 (Archive::get_file_and_offset): New function.
11435 (Archive::get_elf_object_for_member): New function.
11436 (Archive::read_all_symbols): New function.
11437 (Archive::read_symbols): New function.
11438 (Archive::add_symbols): Add counters.
11439 (Archive::include_all_members): Use armap to find members if it's
11440 already built.
11441 (Archive::include_member): Skip reading symbols if already read.
11442 Factored code into Archive::get_file_and_offset and
11443 Archive::get_elf_object_for_member. Changed call to
11444 Mapfile::report_include_archive_member.
11445 (Archive::print_stats): New function.
11446 * archive.h: Declare Object and Read_symbols_data classes.
11447 (Archive::Archive): Add initializers for new members.
11448 (Archive::setup): Add parameter.
11449 (Archive::print_stats): New function.
11450 (Archive::total_archives, Archive::total_members)
11451 (Archive::total_members_loaded): New variables.
11452 (Archive::get_file_and_offset): New function.
11453 (Archive::get_elf_object_for_member): New function.
11454 (Archive::read_all_symbols): New function.
11455 (Archive::read_symbols): New function.
11456 (Archive::Archive_member): New class.
11457 (Archive::members_): New member.
11458 (Archive::num_members_): New member.
11459 * main.cc: Include archive.h.
11460 (main): Call Archive::print_stats.
11461 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11462 archive parameter; member_name is now the fully-decorated name.
11463 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11464 * options.h: (General_options): Add --preread-archive-symbols option.
11465 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11466 Archive::setup.
11467
de4c45bd
ILT
114682008-08-04 Ian Lance Taylor <iant@google.com>
11469
11470 * symtab.h (Symbol::use_plt_offset): New function.
11471 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11472 * powerpc.cc (Relocate::relocate): Likewise.
11473 * sparc.cc (Relocate::relocate): Likewise.
11474 * x86_64.cc (Relocate::relocate): Likewise.
11475 * testsuite/weak_plt.sh: New test.
11476 * testsuite/weak_plt_main.cc: New test.
11477 * testsuite/weak_plt_shared.cc: New test.
11478 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11479 (check_PROGRAMS): Add weak_plt.
11480 (check_DATA): Add weak_plt_shared.so.
11481 (weak_plt_main_pic.o, weak_plt): New targets.
11482 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11483 * testsuite/Makefile.in: Rebuild.
11484
11485 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11486 gcctestdir/ld.
11487 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11488 * testsuite/Makefile.in: Rebuild.
11489
323ee3f4
AM
114902008-08-04 Alan Modra <amodra@bigpond.net.au>
11491
11492 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11493 * Makefile.in: Regenerate.
11494 * po/POTFILES.in: Regenerate.
11495
7c07ecec
ILT
114962008-07-29 Ian Lance Taylor <iant@google.com>
11497
11498 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11499 symbols before other symbols.
11500 * testsuite/script_test_2.cc (test_addr): Declare.
11501 (test_addr_alias): Declare.
11502 (main): Check that test_addr and test_addr_alias have the right
cd536b21 11503 values.
7c07ecec
ILT
11504 * testsuite/script_test_2.t: Define test_addr_alias and
11505 test_addr.
11506
5778530e
ILT
115072008-07-24 Ian Lance Taylor <iant@google.com>
11508
2a00e4fb
ILT
11509 PR 5990
11510 * descriptors.cc: New file.
11511 * descriptors.h: New file.
11512 * gold-threads.h (class Hold_optional_lock): New class.
11513 * fileread.cc: Include "descriptors.h".
11514 (File_read::~File_read): Release descriptor rather than closing
11515 it.
11516 (File_read::open) [file]: Call open_descriptor rather than open.
11517 Set is_descriptor_opened_.
11518 (File_read::open) [memory]: Assert that descriptor is not open.
11519 (File_read::reopen_descriptor): New function.
11520 (File_read::release): Release descriptor.
11521 (File_read::do_read): Make non-const. Reopen descriptor.
11522 (File_read::read): Make non-const.
11523 (File_read::make_view): Reopen descriptor.
11524 (File_read::do_readv): Likewise.
11525 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11526 Update declarations.
11527 * layout.cc: Include "descriptors.h".
11528 (Layout::create_build_id): Use open_descriptor rather than open.
11529 * output.cc: Include "descriptors.h".
11530 (Output_file::open): Use open_descriptor rather than open.
11531 * archive.cc (Archive::const_iterator): Change Archive to be
11532 non-const.
11533 (Archive::begin, Archive::end): Make non-const.
11534 (Archive::count_members): Likewise.
11535 * archive.h (class Archive): Update declarations.
11536 * object.h (Object::read): Make non-const.
11537 * Makefile.am (CCFILES): Add descriptors.cc.
11538 (HFILES): Add descriptors.h.
11539 * Makefile.in: Rebuild.
11540
801647d1
ILT
11541 PR 6716
11542 * gold.h: Always include <clocale>. Add Solaris workarounds
11543 following code in binutils/sysdep.h.
11544
5edd166e
ILT
11545 PR 6048
11546 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11547 this->eh_frame_hdr_ is NULL before using it.
11548
c89ad728
ILT
11549 * dynobj.cc (Versions::Versions): Update comment.
11550
aa86f06b
ILT
11551 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11552 the base version name.
11553
5778530e
ILT
11554 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11555 array size plus one.
11556 (Stringpool_template::set_string_offsets): Subtract one from key
11557 before using it as an array index.
11558 (Stringpool_template::get_offset_with_length): Likewise.
11559 (Stringpool_template::write_to_buffer): Likewise.
11560 * stringpool.h (Stringpool_template::get_offset_from_key):
11561 Likewise.
11562
057ead22
ILT
115632008-07-23 Ian Lance Taylor <iant@google.com>
11564
7f649c59
ILT
11565 PR 6658
11566 * object.h (Merged_symbol_value::value): Do our best to handle a
11567 negative addend.
11568
057ead22
ILT
11569 PR 6647
11570 * script.cc (Version_script_info::get_versions): Don't add empty
11571 version tag to return value.
11572 (Version_script_info::get_symbol_version_helper): Change return
11573 type to bool. Add pversion parameter. Change all callers.
11574 (script_register_vers_node): Don't require a non-NULL tag.
11575 * script.h (class Version_script_info): Update declarations.
11576 (Version_script_info::get_symbol_version): Change return type to
11577 bool. Add version parameter. Change all callers.
11578 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11579 handling. Handle an empty version from a version script.
11580 (Symbol_table::define_special_symbol): Likewise.
11581 * testsuite/ver_test_10.script: New file.
11582 * testsuite/ver_test_10.sh: New file.
11583 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11584 (check_DATA): Add ver_test_10.syms.
11585 (ver_test_10.syms, ver_test_10.so): New target.
11586 * testsuite/Makefile.in: Rebuild.
11587
58e54ac2
CD
115882008-07-23 Simon Baldwin <simonb@google.com>
11589
11590 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11591 to zero for undefined symbols from dynamic libraries.
11592
95d14cd3
ILT
115932008-07-23 Ian Lance Taylor <iant@google.com>
11594
11595 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11596 Change all callers.
11597 * symtab.h (class Symbol_table): Update declaration.
11598 * testsuite/ver_test_9.cc: New file.
11599 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11600 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11601 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11602 (ver_test_9.so, ver_test_9.o): New targets.
11603 * testsuite/Makefile.in: Rebuild.
11604
92de84a6
ILT
116052008-07-22 Ian Lance Taylor <iant@google.com>
11606
34810851
ILT
11607 * options.h (class General_options): Define --check-sections.
11608 * layout.cc (Layout::set_segment_offsets): Handle
11609 --check-sections.
11610
af6156ef
ILT
11611 * options.h (class General_options): Define -n/--nmagic and
11612 -N/--omagic.
11613 * options.cc (General_options::finalize): For -n/--nmagic or
11614 -N/--omagic, set -static.
11615 * layout.cc (Layout::attach_allocated_section_to_segment): If
11616 -N/--omagic, don't put read-only and read-write sections in
11617 different segments.
11618 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11619 finding a read-only segment.
11620 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11621 don't set the minimum segment alignment to the common page size,
11622 and don't set the file offset to the address modulo the page size.
11623 * script-sections.cc (Script_sections::create_segments): If
11624 -n/--omagic, don't put read-only and read-write sections in
11625 different segments.
11626
92de84a6
ILT
11627 * cref.cc: New file.
11628 * cref.h: New file.
11629 * options.h (class General_options): Add --print-symbol-counts.
11630 * main.cc (main): Issue defined symbol report if requested.
11631 * archive.cc (Archive::interpret_header): Make into a const member
11632 function.
11633 (Archive::add_symbols): Call Input_objects::archive_start and
11634 archive_stop.
11635 (Archive::const_iterator): Define new class.
11636 (Archive::begin, Archive::end): New functions.
11637 (Archive::include_all_members): Rewrite to use iterator.
11638 (Archive::count_members): New function.
11639 * archive.h (class Archive): Update declarations.
11640 (Archive::filename): New function.
11641 * object.cc: Include "cref.h".
11642 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11643 (Sized_relobj::do_get_global_symbol_counts): New function.
11644 (Input_objects::add_object): Add object to cross-referencer.
11645 (Input_objects::archive_start): New function.
11646 (Input_objects::archive_stop): New function.
11647 (Input_objects::print_symbol_counts): New function.
11648 * object.h: Declare Cref and Archive.
11649 (Object::get_global_symbol_counts): New function.
11650 (Object::do_get_global_symbol_counts): New pure virtual function.
11651 (class Sized_relobj): Add defined_count_ field. Update
11652 declarations.
11653 (class Input_objects): Add cref_ field. Update constructor.
11654 Update declarations.
11655 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11656 defined_count_.
11657 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11658 symbol counts.
11659 (Sized_dynobj::do_get_global_symbol_counts): New function.
11660 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11661 defined_count_. Update declarations. Define Symbols typedef.
11662 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11663 parameter. Change all callers.
11664 (Symbol_table::add_from_dynobj): Add sympointers and defined
11665 parameters. Change all callers.
11666 * symtab.h (class Symbol_table): Update declarations.
11667 * Makefile.am (CCFILES): Add cref.cc.
11668 (HFILES): Add cref.h.
11669 * Makefile.in: Rebuild.
11670
3f7c5e1d
CD
116712008-07-22 Simon Baldwin <simonb@google.com>
11672
11673 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11674 to zero when writing undefined symbols.
11675
e0b64032
ILT
116762008-07-22 Ian Lance Taylor <iant@google.com>
11677
11678 * output.cc (Output_section::add_input_section): Don't try to
11679 merge empty merge sections.
11680
096b02cf
CS
116812008-07-21 Craig Silverstein <csilvers@google.com>
11682
11683 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11684 Include symbol version in error message.
cd536b21 11685
1d1f116d
CD
116862008-07-20 Chris Demetriou <cgd@google.com>
11687
cd536b21 11688 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
11689 (RANDOM_SEED_CFLAGS): New substituted variable.
11690 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11691 * configure: Rebuild.
11692 * Makefile.in: Likewise.
11693 * testsuite/Makefile.in: Likewise.
11694
a18f591e
ILT
116952008-07-18 Ian Lance Taylor <iant@google.com>
11696
11697 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11698 where we see NAME/NULL and NAME/VERSION as separate symbols.
11699 * testsuite/ver_test_main.cc (main): Call t4.
11700 (t4, t4_2a): Define.
11701 * testsuite/ver_test_2.cc (t4_2): Define.
11702 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11703 * testsuite/ver_test_4.cc (t4_2a): Define.
11704 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11705 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11706
c6e3f6ed
ILT
117072008-07-17 Ian Lance Taylor <iant@google.com>
11708
11709 * dynobj.cc (Versions::add_def): If we give an error about a
11710 missing version, go ahead and create the version anyhow.
11711
ef9beddf
ILT
117122008-07-10 Ian Lance Taylor <iant@google.com>
11713
11714 Handle output sections with more than 0x7fffffff bytes.
11715 * object.h (class Relobj): Change map_to_output_ to
11716 output_sections_, and just keep a section pointer. Change all
11717 uses. Move comdat group support to Sized_relobj.
11718 (Relobj::is_section_specially_mapped): Remove.
11719 (Relobj::output_section): Remove poff parameter. Change all
11720 callers.
11721 (Relobj::output_section_offset): New function.
11722 (Relobj::set_section_offset): Rewrite.
11723 (Relobj::map_to_output): Remove.
11724 (Relobj::output_sections): New function.
11725 (Relobj::do_output_section_offset): New pure virtual function.
11726 (Relobj::do_set_section_offset): Likewise.
11727 (class Sized_relobj): Add section_offsets_ field. Add comdat
11728 group support from Relobj. Update declarations.
11729 (Sized_relobj::get_output_section_offset): New function.
11730 (Sized_relobj::do_output_section_offset): New function.
11731 (Sized_relobj::do_set_section_offset): New function.
11732 * object.cc (Relobj::output_section_address): Remove.
11733 (Sized_relobj::Sized_relobj): Initialize new fields.
11734 (Sized_relobj::include_section_group): Cast find_kept_object to
11735 Sized_relobj.
11736 (Sized_relobj::include_linkonce_section): Likewise.
11737 (Sized_relobj::do_layout): Use separate arrays for output section
11738 and output offset.
11739 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11740 output_sections.
11741 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11742 output_sections and section_offsets.
11743 (Sized_relobj::write_local_symbols): Likewise.
11744 (map_to_kept_section): Compute output address directly.
11745 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11746 output_sections and section_offsets.
11747 (Sized_relobj::write_sections): Likewise.
11748 (Sized_relobj::relocate_sections): Likewise.
11749 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11750 * output.h (class Output_reloc): Update declarations. Change
11751 u2_.relobj to Sized_relobj*.
11752 (class Output_data_reloc): Change add functions to use
11753 Sized_relobj*.
11754 * output.cc (Output_reloc::Output_reloc): Change relobj to
11755 Sized_relobj*.
11756 (Output_reloc::local_section_offset): Change return type to
11757 Elf_Addr. Use get_output_section_offset.
11758 (Output_reloc::get_address): Likewise.
11759 (Output_section::is_input_address_mapped): Don't call
11760 is_section_specially_mapped.
11761 (Output_section::output_offset): Likewise.
11762 (Output_section::output_address): Likewise.
11763 (Output_section::starting_output_address): Likewise.
11764 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11765 parameter to Sized_relobj*.
11766 (Copy_relocs::need_copy_reloc): Likewise.
11767 (Copy_relocs::save): Likewise.
11768 * copy-relocs.h (class Copy_relocs): Update declarations.
11769 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11770 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11771 * target-reloc.h (relocate_for_relocatable): Change
11772 offset_in_output_section type to Elf_Addr. Change code that uses
11773 it as well.
11774 * layout.cc (Layout::layout): Always set *off.
11775 * mapfile.cc (Mapfile::print_input_section): Use
11776 output_section_offset.
11777 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11778 Sized_relobj*.
11779 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11780 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11781 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11782
5cb66f97
ILT
117832008-07-03 Ian Lance Taylor <iant@google.com>
11784
11785 * layout.cc (Layout::include_section): Do not discard unrecognized
11786 SHT_STRTAB sections.
11787
afe47622
CS
117882008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11789
11790 * script.cc (Lex::can_continue_name): Make '?' allowable in
11791 version-script names.
11792 * testsuite/version_script.map: Change glob pattern to use '?'
11793
5adf9721
ILT
117942008-06-30 Manish Singh <yosh@gimp.org>
11795
11796 PR 6585
11797 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11798 Correct typo.
11799
e6fde208
ILT
118002008-06-30 Ian Lance Taylor <iant@google.com>
11801
11802 PR 6660
11803 PR 6682
11804 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11805 versions]: Don't try to read the value in the contents, since we
11806 don't use it. Use the template endianness when writing.
11807
3f2e6a2d
CC
118082008-06-25 Cary Coutant <ccoutant@google.com>
11809
11810 * fileread.cc (File_read::make_view): Assert on zero-length view.
11811 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11812 symbol table when there are no symbols to read.
11813
c43d3a48
CS
118142008-06-23 Craig Silverstein <csilvers@google.com>
11815
11816 * version.cc (version_string): Bump to 1.7
11817
5f494ea0
CS
118182008-06-18 Craig Silverstein <csilvers@google.com>
11819
11820 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11821 constant 0xFFFF to type Valtype.
11822 (Powerpc_relocate_functions::rel16_ha): Likewise.
11823
c42e122e
ILT
118242008-06-17 Ian Lance Taylor <iant@google.com>
11825
f34787f8
ILT
11826 * output.h (Output_section::Input_section): Initialize p2align_ to
11827 zero for Output_section_data constructors.
11828 (Output_section::Input_section::addralign): If not an input
11829 section, return the alignment of the Output_section_data.
11830 * testsuite/copy_test.cc: New file.
11831 * testsuite/copy_test_1.cc: New file.
11832 * testsuite/copy_test_2.cc: New file.
11833 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11834 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11835 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11836 (copy_test_1_pic.o, copy_test_1.so): New targets.
11837 (copy_test_2_pic.o, copy_test_2.so): New targets.
11838 * testsuite/Makefile.in: Rebuild.
11839
c42e122e
ILT
11840 * script-sections.cc (Script_sections::place_orphan): Initialize
11841 local variable exact.
11842
ce3ac18a
DE
118432008-06-13 David Edelsohn <edelsohn@gnu.org>
11844
11845 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11846
42cacb20
DE
118472008-06-12 David Edelsohn <edelsohn@gnu.org>
11848 David S. Miller <davem@davemloft.net>
11849
11850 * powerpc.cc: New file.
11851 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11852 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11853 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11854 * Makefile.in: Rebuild.
11855
7b308235
ILT
118562008-06-09 Ian Lance Taylor <iant@google.com>
11857
11858 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11859 <exception>.
11860 (throwing, orig_terminate): New static variables.
11861 (terminate_handler): New static function.
11862 (t2): Set terminate handler.
11863
f0b886e3
ILT
118642008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11865
11866 PR 6584
cd536b21 11867 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
11868 alignment.
11869
3e90f135
CC
118702008-05-30 Cary Coutant <ccoutant@google.com>
11871
11872 * archive.cc (Archive::include_all_members) Correct to step
11873 over symbol table and extended name table in thin archives.
11874
e09ad04a
ILT
118752008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11876
11877 PR 6407
11878 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11879 calculation.
11880
62b01cb5
ILT
118812008-05-28 Caleb Howe <cshowe@google.com>
11882
11883 * reduced_debug_output.cc: New file.
11884 * reduced_debug_output.h: New file.
92de84a6 11885 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
11886 * options.cc (General_options::finalize): Add strip_debug_non_line
11887 to the strip heirarchy.
11888 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11889 fields.
11890 * layout.cc: Include "reduced_debug_output.h".
11891 (Layout::Layout): Initialize new fields.
11892 (line_only_debug_sections): New static array.
11893 (is_lines_only_debug_sections): New static inline function.
11894 (Layout::include_section): Handle --strip-debug-non-line.
11895 (Layout::make_output_section): If --strip-debug-non-line, build
11896 new output sections for .debug_abbrev and .debug_info.
11897 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11898 gold. Warn about possible overflow.
11899 (read_signed_LEB_128): Likewise.
11900 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11901 (read_signed_LEB_128): Declare.
11902 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11903 (HFILES): Add reduced_debug_output.h.
11904 * Makefile.in: Rebuild.
11905
7d9e3d98
ILT
119062008-05-21 Ian Lance Taylor <iant@google.com>
11907
11908 * mapfile.cc: New file.
11909 * mapfile.h: New file.
11910 * options.h (class General_options): Add -M/--print-map and -Map.
11911 * options.cc (General_options::finalize): Make -M equivalent to
11912 -Map -.
11913 * main.cc: Include <cstdio> and "mapfile.h".
11914 (main): Open mapfile if requested.
11915 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11916 constructor. Change caller.
11917 (queue_initial_tasks): Add mapfile parameter. Change caller.
11918 (queue_middle_tasks): Likewise.
11919 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11920 declarations.
11921 * archive.cc: Include "mapfile.h".
11922 (Archive::add_symbols): Add mapfile parameter. Change all
11923 callers. Pass mapfile, symbol, and reason to include_member.
11924 (Archive::include_all_members): Add mapfile parameter. Change all
11925 callers.
11926 (Archive::include_member): Add mapfile, sym, and why parameters.
11927 Change all callers. Report inclusion to map file.
11928 * archive.h: Include "fileread.h".
11929 (class Archive): Update declarations.
11930 (Archive::file): New const method.
11931 (class Add_archive_symbols): Add mapfile_ field. Update
11932 constructor. Change all callers.
11933 * readsyms.h (class Read_symbols): Likewise.
11934 (class Finish_group): Likewise.
11935 (class Read_script): Likewise.
11936 * common.cc: Include "mapfile.h".
11937 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11938 all callers.
11939 (Symbol_table::do_allocate_commons): Likewise.
11940 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11941 symbol allocation to mapfile.
11942 * common.h (class Allocate_commons_task): Add mapfile_ field.
11943 Update constructor. Change all callers.
11944 * symtab.h (class Symbol_table): Update declarations.
11945 * layout.cc: Include "mapfile.h".
11946 (Layout_task_runner::run): Print information to mapfile.
11947 (Layout::create_gold_note): Change Output_data_fixed_space to
11948 Output_data_zero_fill.
11949 (Layout::create_build_id): Likewise.
11950 (Layout::print_to_mapfile): New function.
11951 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11952 constructor. Change caller.
11953 (class Layout): Declare print_to_mapfile.
11954 * output.cc (Output_section::Input_section::print_to_mapfile): New
11955 function.
11956 (Output_section::add_input_section): If producing a map, always
11957 add to input_sections_ list.
11958 (Output_section::do_print_to_mapfile): New function.
11959 (Output_segment::print_sections_to_mapfile): New function.
11960 (Output_segment::print_section_list_to_mapfile): New function.
11961 * output.h: Include "mapfile.h".
11962 (Output_data::print_to_mapfile): New function.
11963 (Output_data::do_print_to_mapfile): New virtual function.
11964 (Output_segment_headers::do_print_to_mapfile): New function.
11965 (Output_file_header::do_print_to_mapfile): New function.
11966 (Output_data_const::do_print_to_mapfile): New function.
11967 (class Output_data_const_buffer): Add map_name_ field. Update
11968 constructor. Change all callers. Add do_print_to_mapfile
11969 function.
11970 (class Output_data_fixed_space): Likewise.
11971 (class Output_data_space): Likewise.
11972 (class Output_data_zero_fill): New class.
11973 (Output_data_strtab::do_print_to_mapfile): New function.
11974 (Output_data_reloc_base::do_print_to_mapfile): New function.
11975 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11976 (Output_data_group::do_print_to_mapfile): New function.
11977 (Output_data_got::do_print_to_mapfile): New function.
11978 (Output_data_dynamic::do_print_to_mapfile): New function.
11979 (Output_symtab_xindex::do_print_to_mapfile): New function.
11980 (class Output_section): Declare do_print_to_mapflie. Declare
11981 print_to_mapfile in Input_section.
11982 (class Output_segment): Declare new functions.
11983 * object.h (Sized_relobj::symbol_count): New function.
11984 * script-sections.cc
11985 (Output_section_element_dot_assignment::set_section_addresses):
11986 Change Output_data_fixed_space to Output_data_zero_fill.
11987 (Output_data_expression::do_print_to_mapfile): New function.
11988 * script.cc (read_input_script): Add mapfile parameter. Change
11989 all callers.
11990 * script.h (read_input_script): Update declaration.
11991 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11992 (Eh_frame::do_print_to_mapfile): New function.
11993 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11994 (Output_merge_string::do_print_to_mapfile): New function.
11995 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11996 function.
11997 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11998 function.
11999 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
12000 function.
12001 * Makefile.am (CCFILES): Add mapfile.cc.
12002 (HFILES): Add mapfile.h.
12003 * Makefile.in: Rebuild.
12004
9f1d377b
ILT
120052008-05-19 Ian Lance Taylor <iant@google.com>
12006
12007 * options.h (class General_options): Add -z relro.
12008 * layout.cc (Layout::Layout): Initialize relro_segment_.
12009 (Layout::add_output_section_data): Return the output section.
12010 (Layout::make_output_section): Rcognize relro sections and mark
12011 them appropriately.
12012 (Layout::attach_allocated_section_to_segment): Put relro sections
12013 in a PT_GNU_RELRO segment.
12014 (Layout::create_initial_dynamic_sections): Mark the .dynamic
12015 section as relro.
12016 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
12017 PT_TLS segments.
12018 (Layout::linkonce_mapping): Map d.rel.ro.local to
12019 .data.rel.ro.local.
12020 (Layout::output_section_name): Us .data.rel.ro.local for any
12021 section which begins with that.
12022 * layout.h (class Layout): Update add_output_section_data
12023 declaration. Add relro_segment_ field.
12024 * output.cc (Output_section::Output_section): Initialize is_relro_
12025 and is_relro_local_ fields.
12026 (Output_segment::add_output_section): Group relro sections.
12027 (Output_segment::is_first_section_relro): New function.
12028 (Output_segment::maximum_alignment): If there is a relro section,
12029 align the segment to the common page size.
12030 (Output_segment::set_section_addresses): Track whether we are
12031 looking at relro sections. If the last section is a relro
12032 section, align to the common page size.
12033 (Output_segment::set_section_list_addresses): Add in_relro
12034 parameter. Change all callers. Align to the page size when
12035 moving from relro to non-relro section.
12036 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
12037 segment.
12038 * output.h (class Output_section): Add is_relro_ and
12039 is_relro_local_ fields.
12040 (Output_section::is_relro): New function.
12041 (Output_section::set_is_relro): New function.
12042 (Output_section::is_relro_local): New function.
12043 (Output_section::set_is_relro_local): New function.
12044 (class Output_segment): Update declarations.
12045 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12046 * sparc.cc (Target_sparc::got_section): Likewise.
12047 * x86_64.cc (Target_x86_64::got_section): Likewise.
12048 * testsuite/relro_test_main.cc: New file.
12049 * testsuite/relro_test.cc: New file.
12050 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12051 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12052 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12053 (relro_test.so, relro_test_pic.o): New targets.
12054 * testsuite/Makefile.in: Rebuild.
12055
a984ee1d
ILT
120562008-05-16 Ian Lance Taylor <iant@google.com>
12057
01676dcd
ILT
12058 * output.cc (Output_segment::add_output_section): Remove front
12059 parameter.
12060 * output.h (class Output_segment): Remove
12061 add_initial_output_section and overloaded add_output_section.
12062 Update declaration of remaining add_output_section.
12063 * layout.cc (Layout::create_interp): Call add_output_section
12064 rather than add_initial_output_section.
12065 (Layout::finish_dynamic_section): Likewise.
12066
497897f9
ILT
12067 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12068 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12069 know the dynamic type.
12070 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12071 field. Initialize it in constructor.
12072 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12073 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12074 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12075 reloc.
12076
a984ee1d
ILT
12077 * output.cc (Output_reloc::get_address): Change return type to
12078 Elf_Addr.
12079 * output.h (class Output_reloc): Update get_address declaration.
12080 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12081 for section addresses.
12082
55ba0940
ILT
120832008-05-09 Ian Lance Taylor <iant@google.com>
12084
12085 PR 6493
12086 * gold.cc (gold_nomem): Use return value of write.
12087
75517b77
ILT
120882008-05-08 Ian Lance Taylor <iant@google.com>
12089
12090 * symtab.c (Symbol::init_base_output_data): Add version
12091 parameter. Change all callers.
12092 (Symbol::init_base_output_segment): Likewise.
12093 (Symbol::init_base_constant): Likewise.
12094 (Symbol::init_base_undefined): Likewise.
12095 (Sized_symbol::init_output_data): Likewise.
12096 (Sized_symbol::init_output_segment): Likewise.
12097 (Sized_symbol::init_constant): Likewise.
12098 (Sized_symbol::init_undefined): Likewise.
12099 (Symbol_table::do_define_in_output_data): If the new symbol has a
12100 version, mark it as the default.
12101 (Symbol_table::do_define_in_output_segment): Likewise.
12102 (Symbol_table::do_define_as_constant): Likewise.
12103 * symtab.h (class Symbol): Update declarations.
12104 (class Sized_symbol): Likewise.
12105 * resolve.cc (Symbol::override_version): New function.
c42e122e 12106 (Symbol::override_base): Call override_version.
75517b77
ILT
12107 (Symbol::override_base_with_special): Likewise.
12108 * testsuite/ver_script_8.script: New file.
12109 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12110 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12111 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12112 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12113
f1f70eae
ILT
121142008-05-06 Ian Lance Taylor <iant@google.com>
12115
f3e9c5c5
ILT
12116 PR 6049
12117 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12118 functions.
12119 (class General_options): Remove existing --undefined, and add
12120 --no-undefined instead. Add new --undefined as synonym for -u.
12121 * archive.cc (Archive::add_symbols): Check whether symbol was
12122 named with -u.
12123 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12124 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12125 all uses. Add IS_UNDEFINED. Update declarations to split
12126 different versions of init_base. Declare init_base_undefined.
12127 (Symbol::is_defined): Handle IS_UNDEFINED.
12128 (Symbol::is_undefined): Likewise.
12129 (Symbol::is_weak_undefined): Call is_undefined.
12130 (Symbol::is_absolute): Handle IS_CONSTANT.
12131 (class Sized_symbol): Update declarations to split different
12132 versions of init. Declare init_undefined.
12133 (class Symbol_table): Declare new functions.
12134 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12135 Change all callers.
12136 (Symbol::init_base_output_data): Likewise.
12137 (Symbol::init_base_output_segment): Likewise.
12138 (Symbol::init_base_constant): Likewise.
12139 (Symbol::init_base_undefined): New function.
12140 (Sized_symbol::init_object): Rename from init. Change all
12141 callers.
12142 (Sized_symbol::init_output_data): Likewise.
12143 (Sized_symbol::init_output_segment): Likewise.
12144 (Sized_symbol::init_constant): Likewise.
12145 (Sized_symbol::init_undefined): New function.
12146 (Symbol_table::add_undefined_symbols_from_command_line): New
12147 function.
12148 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12149 function.
12150 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12151 (Symbol::output_section): Likewise.
12152 (Symbol::set_output_section): Likewise.
12153 (Symbol_table::sized_finalize_symbol): Likewise.
12154 (Symbol_table::sized_write_globals): Likewise.
12155 * resolve.cc (Symbol_table::should_override): Likewise.
12156 (Symbol::override_base_with_special): Likewise.
12157
8bdcdf2c
ILT
12158 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12159 symbol, change it to have default visibility.
12160 * testsuite/protected_1.cc: New file.
12161 * testsuite/protected_2.cc: New file.
12162 * testsuite/protected_3.cc: New file.
12163 * testsuite/protected_main_1.cc: New file.
12164 * testsuite/protected_main_2.cc: New file.
12165 * testsuite/protected_main_3.cc: New file.
12166 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12167 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12168 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12169 (protected_1.so): New target.
12170 (protected_1_pic.o, protected_2_pic.o): New targets.
12171 (protected_3_pic.o): New target.
12172 (check_PROGRAMS): Add protected_2.
12173 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12174 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12175 * testsuite/Makefile.in: Rebuild.
12176
2b706932
ILT
12177 * options.h (DEFINE_var): Add set_user_set_##varname__.
12178 (DEFINE_bool_alias): New macro.
12179 (class General_options): Define -Bstatic using DEFINE_bool_alias
12180 rather than DEFINE_special. Add --undefined as an alias for -z
12181 defs.
12182 * options.cc (General_options::parse_Bstatic): Remove.
12183
d82a5bcc
ILT
12184 * options.h (class General_options): Add --fatal-warnings.
12185 * main.cc (main): Implement --fatal-warnings.
12186 * errors.h (Errors::warning_count): New function.
12187
f1f70eae
ILT
12188 * options.h (class General_options): Add -Bsymbolic-functions.
12189 * symtab.h (Symbol::is_preemptible): Check for
12190 -Bsymbolic-functions.
12191
8825ac63
ILT
121922008-05-05 Ian Lance Taylor <iant@google.com>
12193
d98bc257
ILT
12194 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12195 as noVARNAME rather than no-VARNAME.
12196 (class General_options): Add option -z combreloc.
12197 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12198 get_address.
12199 (Output_reloc::sort_before) [SHT_REL]: New function.
12200 (Output_reloc::sort_before) [SHT_RELA]: New function.
12201 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12202 Sort_relocs_comparison.
12203 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12204 parameter. Change all callers.
12205 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12206 sort_relocs parameter. Change all callers.
12207 * output.cc (Output_reloc::get_address): New function, broken out
12208 of write_rel.
12209 (Output_reloc::write_rel): Call it.
12210 (Output_reloc::compare): New function.
12211 (Output_data_reloc_base::do_write): Optionally sort relocs.
12212
60b2b4e7
ILT
12213 * configure.ac: If targ_extra_obj is set, link it in.
12214 * configure.tgt: Initialize all variables.
12215 (x86_64*): Set targ_extra_obj and targ_extra_size.
12216 * configure: Rebuild.
12217
8825ac63
ILT
12218 * object.cc (Sized_relobj::include_section_group): Adjust section
12219 indexes read from group data. Build vector to pass to
12220 layout_group.
12221 * layout.cc (Layout::layout_group): Add flags and shndxes
12222 parameters. Remove contents parameter. Change caller. Update
12223 explicit instantiations.
12224 * layout.h (class Layout): Update layout_group declaration.
12225 * output.cc (Output_data_group::Output_data_group): Add flags and
12226 input_shndxes parameters. Remove contents parameter. Change
12227 caller.
12228 (Output_data_group::do_write): Change input_sections_ to
12229 input_shndxes_.
12230 * output.h (class Output_data_group): Update constructor
12231 declaration. Rename input_sections_ to input_shndxes_.
12232 * testsuite/many_sections_test.cc: Add template.
12233
e94cf127
CC
122342008-04-30 Cary Coutant <ccoutant@google.com>
12235
4418b2d5
CC
12236 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12237
e94cf127
CC
12238 * layout.cc (Layout::include_section): Refactored check for debug
12239 info section.
12240 (Layout::add_comdat): Add new parameters. Change type
12241 of signature parameter. Add object and shndx to signatures table.
12242 (Layout::find_kept_object): New function.
12243 * layout.h: Include <cstring>.
12244 (Layout::is_debug_info_section): New function.
12245 (Layout::add_comdat): Add new parameters.
12246 (Layout::find_kept_object): New function.
12247 (Layout::Kept_section): New struct.
12248 (Layout::Signatures): Change type of map range.
12249 * object.cc (Relobj::output_section_address): New function.
12250 (Sized_relobj::include_section_group): Add new parameters. Change
12251 calls to Layout::add_comdat. Change to build table of kept comdat
12252 groups and table mapping discarded sections to kept sections.
12253 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12254 (Sized_relobj::do_layout): Change calls to include_section_group and
12255 include_linkonce_section.
12256 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12257 value to zero when section is discarded.
12258 (Sized_relobj::map_to_kept_section): New function.
12259 * object.h (Relobj::output_section_address): New function.
12260 (Relobj::Comdat_group): New type.
12261 (Relobj::find_comdat_group): New function.
12262 (Relobj::Comdat_group_table): New type.
12263 (Relobj::Kept_comdat_section): New type.
12264 (Relobj::Kept_comdat_section_table): New type.
12265 (Relobj::add_comdat_group): New function.
12266 (Relobj::set_kept_comdat_section): New function.
12267 (Relobj::get_kept_comdat_section): New function.
12268 (Relobj::comdat_groups_): New field.
12269 (Relobj::kept_comdat_sections_): New field.
12270 (Symbol_value::input_value): Update comment.
12271 (Sized_relobj::map_to_kept_section) New function.
12272 (Sized_relobj::include_linkonce_section): Add new parameter.
12273 * target-reloc.h (Comdat_behavior): New type.
12274 (get_comdat_behavior): New function.
12275 (relocate_section): Add code to map a discarded section to the
12276 corresponding kept section when applying a relocation.
12277
e4e5049b
CS
122782008-04-30 Craig Silverstein <csilvers@google.com>
12279
12280 * dwarf_reader.cc (next_generation_count): New static var.
12281 (Addr2line_cache_entry): New struct.
12282 (addr2line_cache): New static var.
12283 (Dwarf_line_info::one_addr2line): Added caching.
12284 (Dwarf_line_info::clear_addr2line_cache): New function.
12285 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12286 cache-size parameter.
12287 (Dwarf_line_info::one_addr2line_cache): New function.
12288 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12289 new cache-size argument to one_addr2line(), and clear cache.
12290
d09e9154
CC
122912008-04-28 Cary Coutant <ccoutant@google.com>
12292
12293 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12294 R_386_PC8 relocations.
12295
7ef73768
ILT
122962008-04-23 Ian Lance Taylor <iant@google.com>
12297
55438702
ILT
12298 * object.cc (Sized_relobj::include_section_group): Check for
12299 invalid section group.
12300
c165fb93
ILT
12301 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12302 header size.
12303
7ef73768
ILT
12304 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12305 than read for file header.
12306 * archive.cc (Archive::include_member): Likewise.
12307
6194aaab
L
123082008-04-23 Paolo Bonzini <bonzini@gnu.org>
12309
12310 * aclocal.m4: Regenerate.
12311 * configure: Regenerate.
12312
d491d34e
ILT
123132008-04-19 Ian Lance Taylor <iant@google.com>
12314
5ea2bac6
ILT
12315 * version.cc (version_string): Bump to 1.6.
12316
7bc3e21a
ILT
12317 * testsuite/Makefile.am (many_sections_r_test): New target.
12318 (many_sections_r_test_SOURCES): Remove.
12319 (many_sections_r_test_DEPENDENCIES): Remove.
12320 (many_sections_r_test_LDFLAGS): Remove.
12321 (many_sections_r_test_LDADD): Remove.
12322
7fcd3aa9
ILT
12323 * object.cc (Sized_relobj::do_add_symbols): Always pass
12324 local_symbol_count_ to add_from_relobj.
12325
4c94d6ae
ILT
12326 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12327 every thousand variables.
12328 * testsuite/Makefile.in: Rebuild.
12329
d491d34e
ILT
12330 * object.cc (Xindex::initialize_symtab_xindex): New function.
12331 (Xindex::read_symtab_xindex): New function.
12332 (Xindex::sym_xindex_to_shndx): New function.
12333 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12334 available.
12335 (Sized_relobj::do_initialize_xindex): New function.
12336 (Sized_relobj::do_read_symbols): Adjust section links.
12337 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12338 parameter. Change all callers.
12339 (Sized_relobj::include_section_group): Adjust section links and
12340 symbol section indexes.
12341 (Sized_relobj::do_layout): Adjust section links.
12342 (Sized_relobj::do_count_local_symbols): Adjust section links and
12343 symbol section indexes.
12344 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12345 ordinary and special symbols.
12346 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12347 dynsym_xindex parameters. Change all callers. Adjust section
12348 links. Use SHN_XINDEX when needed.
12349 (Sized_relobj::get_symbol_location_info): Adjust section links.
12350 Don't get fooled by special symbols.
12351 * object.h (class Xindex): Define.
12352 (class Object): Add xindex_ parameter. Declare virtual functoin
12353 do_initialize_xindex.
12354 (Object::adjust_sym_shndx): New function.
12355 (Object::set_xindex): New protected function.
12356 (class Symbol_value): Add is_ordinary_shndx_ field.
12357 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12358 (Symbol_value::value): Assert ordinary section.
12359 (Symbol_value::initialize_input_to_output_map): Likewise.
12360 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12361 Change all callers.
12362 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12363 all callers.
12364 (class Sized_relobj): Update declarations.
12365 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12366 parameter. Change all callers.
12367 (Sized_relobj::adjust_shndx): New function.
12368 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12369 field.
12370 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12371 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12372 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12373 (Sized_dynobj::read_dynsym_section): Adjust section links.
12374 (Sized_dynobj::read_dynamic): Likewise.
12375 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12376 section links.
12377 (Sized_dynobj::do_initialize_xindex): New function.
12378 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12379 do_initialize_xindex.
12380 (Sized_dynobj::adjust_shndx): New function.
12381 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12382 dynsym_xindex_ fields.
12383 (Layout::finalize): Add a call to set_section_indexes before
12384 creating the symtab sections.
12385 (Layout::set_section_indexes): Don't do anything if the section
12386 already has a section index.
12387 (Layout::create_symtab_sections): Add shnum parameter. Change
12388 caller. Create .symtab_shndx section if needed.
12389 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12390 caller.
12391 (Layout::allocated_output_section_count): New function.
12392 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12393 needed.
12394 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12395 fields. Update declarations.
12396 (Layout::symtab_xindex): New function.
12397 (Layout::dynsym_xindex): New function.
12398 (class Write_symbols_task): Add layout_ field.
12399 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12400 Change caller.
12401 * output.cc (Output_section_headers::Output_section_headers): Add
12402 shstrtab_section parameter. Change all callers.
12403 (Output_section_headers::do_sized_write): Store overflow values
12404 for section count and section string table section index in
12405 section header zero.
12406 (Output_file_header::do_sized_write): Check for overflow of
12407 section count and section string table section index.
12408 (Output_symtab_xindex::do_write): New function.
12409 (Output_symtab_xindex::endian_do_write): New function.
12410 * output.h (class Output_section_headers): Add shstrtab_section_.
12411 Update declarations.
12412 (class Output_symtab_xindex): Define.
12413 (Output_section::has_out_shndx): New function.
12414 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12415 field.
12416 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12417 Change all callers.
12418 (Sized_symbol::init): Likewise.
12419 (Symbol::output_section): Check for ordinary symbol.
12420 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12421 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12422 callers.
12423 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12424 Change all callers. Simplify handling of symbols from sections
12425 not included in the link.
12426 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12427 distinction.
12428 (Weak_alias_sorter::operator()): Assert that symbols are
12429 ordinary.
12430 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12431 distinction.
12432 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12433 parameters. Change all callers.
12434 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12435 symbol distinction. Use SHN_XINDEX when needed.
12436 (Symbol_table::write_section_symbol): Add symtab_xindex
12437 parameter. Change all callers.
12438 (Symbol_table::sized_write_section_symbol): Likewise. Use
12439 SHN_XINDEX when needed.
12440 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12441 declarations.
12442 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12443 (Symbol::is_defined): Check is_ordinary.
12444 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12445 (Symbol::is_absolute, Symbol::is_common): Likewise.
12446 (class Sized_symbol): Update declarations.
12447 (class Symbol_table): Update declarations.
12448 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12449 parameters. Change all callers.
12450 (Sized_symbol::override): Likewise.
12451 (Symbol_table::override): Likewise.
12452 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12453 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12454 is_ordinary, and orig_st_shndx parameters. Change all callers.
12455 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12456 to be in an ordinary section.
12457 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12458 object and is_ordinary parameters. Change all callers.
12459 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12460 Change all callers. Don't add undefined or non-ordinary symbols
12461 to reloc_map_.
12462 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12463 Change all callers.
12464 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12465 declarations.
12466 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12467 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12468 (Sized_relobj::relocate_sections): Likewise.
12469 * target-reloc.h (scan_relocs): Adjust section symbol index.
12470 (scan_relocatable_relocs): Likewise.
12471 * i386.cc (Scan::local): Check for ordinary symbols.
12472 * sparc.cc (Scan::local): Likewise.
12473 * x86_64.cc (Scan::local): Likewise.
12474 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12475 to symbol_section_and_value.
12476 * testsuite/many_sections_test.cc: New file.
12477 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12478 (check_PROGRAMS): Add many_sections_test.
12479 (many_sections_test_SOURCES): Define.
12480 (many_sections_test_DEPENDENCIES): Define.
12481 (many_sections_test_LDFLAGS): Define.
12482 (BUILT_SOURCES): Add many_sections_define.h.
12483 (many_sections_define.h): New target.
12484 (BUILT_SOURCES): Add many_sections_check.h.
12485 (many_sections_check.h): New target.
12486 (check_PROGRAMS): Add many_sections_r_test.
12487 (many_sections_r_test_SOURCES): Define.
12488 (many_sections_r_test_DEPENDENCIES): Define.
12489 (many_sections_r_test_LDFLAGS): Define.
12490 (many_sections_r_test_LDADD): Define.
12491 (many_sections_r_test.o): New target.
12492 * testsuite/Makefile.in: Rebuild.
12493
c5818ff1
CC
124942008-04-17 Cary Coutant <ccoutant@google.com>
12495
12496 * errors.cc (Errors::info): New function.
12497 (gold_info): New function.
12498 * errors.h (Errors::info): New function.
12499 * gold.h (gold_info): New function.
12500 * object.cc (Input_objects::add_object): Print trace output.
12501 * options.cc (options::parse_set): New function.
12502 (General_options::parse_wrap): Deleted.
12503 (General_options::General_options): Deleted initializer.
12504 * options.h (options::String_set): New typedef.
12505 (options::parse_set): New function.
12506 (DEFINE_set): New macro.
12507 (General_options::wrap): Changed to use DEFINE_set. Changed
12508 callers of any_wrap_symbols and is_wrap_symbol.
12509 (General_options::trace, General_options::trace_symbol):
12510 New options.
12511 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12512 (General_options::wrap_symbols_): Deleted.
12513 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12514
b5be4a7c
DM
125152008-04-17 David S. Miller <davem@davemloft.net>
12516
12517 * options.cc (General_options::parse_V): New function.
12518 * options.h: Add entries for -V and -Qy.
12519
155a0dd7
ILT
125202008-04-17 Ian Lance Taylor <iant@google.com>
12521
12522 * common.cc (Symbol_table::allocate_commons): Remove options
12523 parameter. Change caller.
12524 (Symbol_table::do_allocate_commons): Remove options parameter.
12525 Change caller. Just call do_allocate_commons_list twice.
12526 (Symbol_table::do_allocate_commons_list): New function, broken out
12527 of do_allocate_commons.
12528 * common.h (class Allocate_commons_task): Remove options_ field.
12529 Update constructor.
12530 * symtab.cc (Symbol_table::Symbol_table): Initialize
12531 tls_commons_.
12532 (Symbol_table::add_from_object): Put TLS common symbols on
12533 tls_commons_ list.
12534 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12535 which are IN_OUTPUT_DATA.
12536 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12537 allocate_commons and do_allocate_commons declarations. Declare
12538 do_allocate_commons_list.
12539 * gold.cc (queue_middle_tasks): Update creation of
12540 Allocate_commons_task to not pass options.
12541 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12542 (TLS_TEST_C_FLAGS): New variable.
12543 (tls_test_c_pic.o): New target.
12544 (tls_test_shared.so): Link in tls_test_c_pic.o.
12545 (tls_test_c_pic_ie.o): New target.
12546 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12547 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12548 (tls_test_c.o): New target.
12549 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12550 (tls_pic_test_LDADD): Likewise.
12551 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12552 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12553 (tls_test_c_gnu2.o): New target.
12554 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12555 tls_test_c_gnu2.o.
12556 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12557 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12558 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12559 * testsuite/tls_test.cc: Include "config.h".
12560 (t_last): Call t11_last.
12561 * testsuite/tls_test.h (t11, t11_last): Declare.
12562 * testsuite/tls_test_c.c: New file.
12563 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12564 * configure.ac: Check for OpenMP support.
12565 * configure, config.in, Makefile.in: Rebuild.
12566 * testsuite/Makefile.in: Rebuild.
12567
edfbb029
CC
125682008-04-16 Cary Coutant <ccoutant@google.com>
12569
12570 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12571 (Target_i386::tls_base_symbol_defined_): New field.
12572 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12573 (Target_i386::Scan::global): Likewise.
12574 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12575 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12576 (Target_x86_64::tls_base_symbol_defined_): New field.
12577 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12578 (Target_x86_64::Scan::global): Likewise.
12579
f3c69fca
CC
125802008-04-16 Cary Coutant <ccoutant@google.com>
12581
12582 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12583 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12584 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12585 building shared libraries.
12586 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12587 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12588 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12589 * testsuite/Makefile.in: Rebuild.
12590 * testsuite/weak_undef.h: New file.
12591 * testsuite/weak_undef_file1.cc: Add extra test cases.
12592 * testsuite/weak_undef_file2.cc: Likewise.
12593 * testsuite/weak_undef_test.cc: Likewise.
12594
7c414435
DM
125952008-04-16 David S. Miller <davem@davemloft.net>
12596
32b769e1
DM
12597 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12598 Add issued_non_pic_error_ field. Declare check_non_pic.
12599 (Target_sparc::Scan::check_non_pic): New function.
12600 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12601 (Target_sparc::Scan::global): Likewise.
12602
11936fb1
DM
12603 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12604 * configure: Rebuild.
12605
7c414435
DM
12606 * options.h (DEFINE_enable): New macro.
12607 (new_dtags): New enable option.
12608 (initfirst, interpose, loadfltr, nodefaultlib,
12609 nodelete, nodlopen, nodump): New -z options.
12610 * layout.cc (Layout:finish_dynamic_section): If new
12611 dtags enabled, emit DT_RUNPATH. Also, emit a
12612 DT_FLAGS_1 containing any specified -z flags.
12613
85c7bf8b
ILT
126142008-04-16 Ian Lance Taylor <iant@google.com>
12615
12c0daef
ILT
12616 * copy-relocs.cc: New file.
12617 * copy-relocs.h: New file.
12618 * reloc.cc: Remove Copy_relocs code.
12619 * reloc.h: Likewise.
12620 * reloc-types.h (struct Reloc_types) [both versions]: Add
12621 get_reloc_addend_noerror.
12622 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12623 variants of add_global which take an addend which must be zero.
12624 * i386.cc: Include "copy-relocs.h".
12625 (class Target_i386): Change type of copy_relocs_ to variable,
12626 update initializer.
12627 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12628 Change all callers.
12629 (Target_i386::do_finalize_sections): Change handling of
12630 copy_relocs_.
12631 * sparc.cc: Include "copy-relocs.h".
12632 (class Target_sparc): Change type of copy_relocs_ to variable,
12633 update initializer.
12634 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12635 Change all callers.
12636 (Target_sparc::do_finalize_sections): Change handling of
12637 copy_relocs_.
12638 * x86_64.cc: Include "copy-relocs.h".
12639 (class Target_x86_64): Change type of copy_relocs_ to variable,
12640 update initializer.
12641 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12642 class. Change all callers.
12643 (Target_x86_64::do_finalize_sections): Change handling of
12644 copy_relocs_.
12645 * Makefile.am (CCFILES): Add copy-relocs.cc.
12646 (HFILES): Add copy-relocs.h.
12647
4f4995b6
ILT
12648 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12649
85c7bf8b
ILT
12650 * testsuite/script_test_4.sh: Permit leading zeroes.
12651
4f2a9edd
ILT
126522008-04-15 Ian Lance Taylor <iant@google.com>
12653
e6188289
ILT
12654 * script-sections.cc (Script_sections::create_segments): Use
12655 header_size_adjustment even when there is enough room for the
12656 headers.
12657 * testsuite/script_test_4.sh: New file.
12658 * testsuite/script_test_4.t: New file.
12659 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12660 (check_DATA): Add script_test_4.stdout.
12661 (MOSTLYCLEANFILES): Likewise.
12662 (script_test_4): New target.
12663 (script_test_4.stdout): New target.
12664 * testsuite/Makefile.in: Rebuild.
12665
4f2a9edd
ILT
12666 * sparc.cc: Add definitions for Output_data_plt_sparc class
12667 constants.
12668
f5314dd5
DM
126692008-04-14 David S. Miller <davem@davemloft.net>
12670
12671 * sparc.cc: New file.
12672 * Makefile.am (TARGETSOURCES): Add sparc.cc
12673 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12674 * configure.tgt: Document targ_extra_size and
12675 targ_extra_big_endian. Add entries for sparc-* and
12676 sparc64-*.
12677 * configure.ac: Handle targ_extra_size and
12678 targ_extra_big_endian.
12679 * Makefile.in: Rebuild.
12680 * configure: Likewise.
12681 * po/POTFILES.in: Likewise.
12682 * po/gold.pot: Likewise.
12683
154e0e9a
ILT
126842008-04-14 Ian Lance Taylor <iant@google.com>
12685
12686 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12687 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12688 in the name/type/flags to section mapping. Don't call
12689 allocate_output_section.
12690 (Layout::choose_output_section): Change parameter from adjust_name
12691 to is_input_section. Don't permit input sections after sections
12692 are attached to segments. Don't call allocate_output_section.
12693 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12694 not write_enable_output_section.
12695 (Layout::make_output_section): Don't push to
12696 unattached_section_list_ nor call attach_to_segment. Call
12697 attach_section_to_segment if sections are attached.
12698 (Layout::attach_sections_to_segments): New function.
12699 (Layout::attach_section_to_segment): New function.
12700 (Layout::attach_allocated_section_to_segment): Rename from
12701 attach_to_segment. Remove flags parameter.
12702 (Layout::allocate_output_section): Remove function.
12703 (Layout::write_enable_output_section): Remove function.
12704 * layout.h (class Layout): Update for above changes. Add new
12705 field sections_are_attached_.
12706 * output.h (Output_section::update_flags_for_input_section): New
12707 function.
12708 * output.cc (Output_section::add_input_section): Call
12709 update_flags_for_input_section.
12710 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12711
009a67a2
CC
127122008-04-11 Cary Coutant <ccoutant@google.com>
12713
12714 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12715 thought unnecessary.
12716 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12717
759b1a24
ILT
127182008-04-11 Ian Lance Taylor <iant@google.com>
12719
12720 * output.h (class Output_section_data): Remove inline definition
12721 of set_addralign.
12722 * output.cc (Output_section_data::set_addralign): New function.
12723
c2b45e22
CC
127242008-04-11 Cary Coutant <ccoutant@google.com>
12725
12726 Add support for TLS descriptors for i386 and x86_64.
12727 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12728 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12729 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12730 GOT_TYPE_TLS_DESC.
12731 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12732 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12733 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12734 relocations.
12735 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12736 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12737 Fix problem with initial-exec relocations.
12738 (Target_i386::Relocate::relocate_tls): Likewise.
12739 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12740 relaxation.
12741 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12742 support for section-plus-offset dynamic table entries.
12743 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12744 (Output_data_dynamic::Dynamic_entry): Add support for
12745 section-plus-offset dynamic table entries.
12746 (Output_data_dynamic::Classification): Likewise.
12747 (Output_data_dynamic::classification_): Renamed offset_.
12748 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12749 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12750 (Target_x86_64::make_plt_section): New function.
12751 (Target_x86_64::reserve_tlsdesc_entries): New function.
12752 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12753 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12754 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12755 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12756 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12757 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12758 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12759 add extra PLT entry for TLS descriptors.
12760 (Output_data_plt_x86_64::got_): New field.
12761 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12762 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12763 fields.
12764 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12765 descriptors.
12766 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12767 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12768 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12769 R_386_TLS_DESC_CALL relocations.
12770 (Target_x86_64::Scan::global): Likewise.
12771 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12772 for TLS descriptors.
12773 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12774 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12775 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12776 GD-to-IE relaxation.
12777 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12778 and TLS_DESCRIPTORS.
12779 * Makefile.in: Rebuild.
12780 * configure: Rebuild.
12781 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12782 (tls_test_shared2.so): New target.
12783 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12784 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12785 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12786 (tls_shared_gd_to_ie_test_LDADD): New variable.
12787 (tls_shared_gnu2_gd_to_ie_test): New target.
12788 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12789 New targets.
12790 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12791 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12792 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12793 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12794 (tls_shared_gnu2_test): New target.
12795 (tls_test_gnu2_shared.so): New target.
12796 (tls_shared_gnu2_test_SOURCES): New variable.
12797 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12798 (tls_shared_gnu2_test_LDFLAGS): New variable.
12799 (tls_shared_gnu2_test_LDADD): New variable.
12800 * testsuite/Makefile.in: Rebuild.
12801 * testsuite/Makefile.
12802
83bfb6b7
ILT
128032008-04-11 Ian Lance Taylor <iant@google.com>
12804
12805 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12806 justsyms.t.
12807 * testsuite/Makefile.in: Rebuild.
12808
12809 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12810 long.
12811 * testsuite/script_test_2.cc (main): Adjust test.
12812
706e1f5e
ILT
128132008-04-11 David S. Miller <davem@davemloft.net>
12814 Ian Lance Taylor <iant@google.com>
12815
12816 * options.h (General_options): Add entries for '-Y' and
12817 '-relax'.
12818 * options.cc (General_options:finalize): If -Y was used, add those
12819 entries to the library path instead of the default "/lib" and
12820 "/usr/lib".
12821
7c98e6bb
DM
128222008-04-11 David S. Miller <davem@davemloft.net>
12823
12824 * testsuite/justsyms.t: Start at 0x100.
12825 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
12826 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12827 long.
12828 * testsuite/script_test_2.cc: Adjust string and section length
12829 checks.
7c98e6bb 12830
99a37bfd
ILT
128312008-04-09 Ian Lance Taylor <iant@google.com>
12832
2cefc357
ILT
12833 PR gold/5996
12834 * script-sections.cc (Sections_element::allocate_to_segment): Add
12835 orphan parameter.
12836 (Output_section_definition::allocate_to_segment): Likewise.
12837 (Orphan_output_section::allocate_to_segment): Likewise.
12838 (Script_sections::attach_sections_using_phdrs_clause): Don't
12839 propagate non-PT_LOAD segments to orphan sections.
12840 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12841 readelf rather than objdump.
12842 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12843 .interp section and PT_INTERP segment are the same size.
12844 * testsuite/Makefile.in: Rebuild.
12845
99a37bfd
ILT
12846 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12847 aliases for symbols defined in the same object.
12848 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12849 (weak_alias_test_SOURCES): New variable.
12850 (weak_alias_test_DEPENDENCIES): New variable.
12851 (weak_alias_test_LDFLAGS): New variable.
12852 (weak_alias_test_LDADD): New variable.
12853 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12854 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12855 (weak_alias_test_3.o): New target.
12856 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12857 * testsuite/weak_alias_test_main.cc: New file.
12858 * testsuite/weak_alias_test_1.cc: New file.
12859 * testsuite/weak_alias_test_2.cc: New file.
12860 * testsuite/weak_alias_test_3.cc: New file.
12861
780e49c5
ILT
128622008-04-08 Ian Lance Taylor <iant@google.com>
12863
cdb0b8f5
ILT
12864 * options.h (class General_options): Add --noinhibit-exec option.
12865 * main.cc (main): Check --noinhibit-exec.
12866
0864d551
ILT
12867 * options.h (class General_options): Define --wrap as a special
12868 option. Add wrap_symbols_ field.
12869 (General_options::any_wrap_symbols): New function.
12870 (General_options::is_wrap_symbol): New function.
12871 * options.cc (General_options::parse_wrap): New function.
12872 (General_options::General_options): Initialize wrap_symbols_.
12873 * symtab.cc (Symbol_table::wrap_symbol): New function.
12874 (Symbol_table::add_from_object): Handle --wrap.
12875 * symtab.h (class Symbol_table): Declare wrap_symbol.
12876 * target.h (Target::wrap_char): New function.
12877 (Target::Target_info): Add wrap_char field.
12878 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12879 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12880 * testsuite/testfile.cc (Target_test::test_target_info):
12881 Likewise.
12882
789aa6de
ILT
12883 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12884 there is one.
12885
2c38906f
ILT
12886 * layout.h (class Layout): Add added_eh_frame_data_ field.
12887 * layout.cc (Layout::Layout): Initialize new field.
12888 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12889 output section until we find a section we merged successfully.
12890 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12891 that the size be non-zero.
12892
780e49c5
ILT
12893 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12894 qualifier.
12895
7fcd0256
ILT
128962008-04-08 Craig Silverstein <csilvers@google.com>
12897
12898 * configure.ac: Export new conditional variable HAVE_ZLIB.
12899 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12900 on HAVE_ZLIB.
12901 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12902 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12903
6835af53
ILT
129042008-04-07 Ian Lance Taylor <iant@google.com>
12905
e24f324c
ILT
12906 * version.cc (version_string): Set to "1.5".
12907
a036edd8
ILT
12908 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12909 Add issued_non_pic_error_ field. Declare check_non_pic.
12910 (Target_x86_64::Scan::check_non_pic): New function.
12911 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12912 (Target_x86_64::Scan::global): Likewise.
12913
624f8810
ILT
12914 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12915 addend parameter. Change caller. Handle merge sections.
12916 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12917 Address to Addend. Don't add in the result of
12918 local_section_offset, pass down the addend and use the returned
12919 value.
12920 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12921 Update declarations of local_section_offset and symbol_value.
12922 * testsuite/two_file_test_1.cc (t18): New function.
12923 * testsuite/two_file_test_2.cc (f18): New function.
12924 * testsuite/two_file_test_main.cc (main): Call t18.
12925 * testsuite/two_file_test.h (t18, f18): Declare.
12926
6835af53
ILT
12927 * configure.ac: Don't test for objdump, c++filt, or readelf.
12928 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12929 conditionals.
12930 (TEST_READELF): New variable.
12931 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12932 (check_PROGRAMS): Add two_file_strip_test.
12933 (two_file_strip_test): New target.
12934 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12935 (two_file_same_shared_strip_test_SOURCES): New variable.
12936 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12937 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12938 (two_file_same_shared_strip_test_LDADD): New variable.
12939 (two_file_shared_strip.so): New target.
12940 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12941 (ver_test_5.syms, ver_test_7.syms): Likewise.
12942 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12943 (strip_test_3.stdout): Use TEST_OBJDUMP.
12944 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12945
86925eef
CC
129462008-04-04 Cary Coutant <ccoutant@google.com>
12947
12948 * symtab.h (Symbol::is_weak_undefined): New function.
12949 (Symbol::is_strong_undefined): New function.
12950 (Symbol::is_absolute): New function.
12951 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12952 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12953 absolute symbols.
12954 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12955 (weak_undef_test): New target.
12956 * testsuite/Makefile.in: Rebuild.
12957 * testsuite/weak_undef_file1.cc: New file.
12958 * testsuite/weak_undef_file2.cc: New file.
12959 * testsuite/weak_undef_test.cc: New file.
12960
126f3ece
ILT
129612008-04-03 Craig Silverstein <csilvers@google.com>
12962
12963 * compressed_output.h (class Output_compressed_section): Use
12964 unsigned buffer.
12965 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12966 add zlib header.
12967 (zlib_compressed_suffix): Removed.
12968 (Output_compressed_section::set_final_data_size): Use unsigned
12969 buffers.
12970 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12971 Fix linker invocation.
12972 (flagstest_o_specialfile_and_compress_debug_sections):
12973 Likewise.
12974 * testsuite/Makefile.in: Regenerated.
12975
deae2a14
DM
129762008-04-02 David S. Miller <davem@davemloft.net>
12977
12978 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12979 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12980
70752818
ILT
129812008-04-02 Craig Silverstein <csilvers@google.com>
12982
12983 * TODO: New file.
12984
39d0cb0e
ILT
129852008-04-02 Ian Lance Taylor <iant@google.com>
12986
12987 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12988 parameters. Update for new key type to views_. Change all
12989 callers.
12990 (File_read::read): Adjust for byteshift in returned view.
12991 (File_read::add_view): New function, broken out of
12992 find_and_make_view.
12993 (File_read::make_view): New function, broken out of
12994 find_and_make_view.
12995 (File_read::find_or_make_view): Add offset and aligned
12996 parameters. Rewrite accordingly. Change all callers.
12997 (File_read::get_view): Add offset and aligned parameters. Adjust
12998 for byteshift in return value.
12999 (File_read::get_lasting_view): Likewise.
13000 * fileread.h (class File_read): Update declarations.
13001 (class File_read::View): Add byteshift_ field. Add byteshift to
13002 constructor. Add byteshift method.
13003 * archive.h (Archive::clear_uncached_views): New function.
13004 (Archive::get_view): Add aligned parameter. Change all callers.
13005 * object.h (Object::get_view): Add aligned parameter. Change all
13006 callers.
13007 (Object::get_lasting_view): Likewise.
13008
13009 * fileread.cc (File_read::release): Don't call clear_views if
13010 there are multiple objects.
13011 * fileread.h (File_read::clear_uncached_views): New function.
13012 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
13013 on the archive.
13014
a1207466
CC
130152008-03-31 Cary Coutant <ccoutant@google.com>
13016
13017 Add thin archive support.
13018 * archive.cc (Archive::armagt): New const.
13019 (Archive::setup): Remove task parameter and calls to unlock.
13020 (Archive::unlock_nested_archives): New function.
13021 (Archive::read_header): Add nested_off parameter. Change
13022 all callers.
13023 (Archive::interpret_header): Likewise.
13024 (Archive::include_all_members): Change to handle thin
13025 archives.
13026 (Archive::include_member): Likewise.
13027 * archive.h (Archive::Archive): Add new parameters and
13028 initializers.
13029 (Archive::armagt): New const.
13030 (Archive::setup): Remove task parameter.
13031 (Archive::unlock_nested_archives): New function.
13032 (Archive::read_header): Add nested_off parameter.
13033 (Archive::interpret_header): Likewise.
13034 (Archive::Nested_archive_table): New typedef.
13035 (Archive::is_thin_archive_): New field.
13036 (Archive::nested_archives_): New field.
13037 (Archive::options_): New field.
13038 (Archive::dirpath_): New field.
13039 (Archive::task_): New field.
13040 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13041 for thin archives. Pass additional parameters to
13042 Archive::Archive. Unlock the archive file after calling
13043 Archive::setup.
cd536b21 13044
479f6503
ILT
130452008-03-29 Ian Lance Taylor <iant@google.com>
13046
686c8caf
ILT
13047 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13048 version symbol to be local.
13049 * testsuite/ver_test_4.sh: New file.
13050 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13051 (check_DATA): Add ver_test_4.syms.
13052 (ver_test_4.syms): New target.
13053 * testsuite/Makefile.in: Rebuild.
13054
ab794b6b
ILT
13055 * output.cc
13056 (Output_section::Input_section_sort_entry::has_priority): New
13057 function.
13058 (Output_section::Input_section_sort_entry::match_file_name): New
13059 function.
13060 (Output_section::Input_section_sort_entry::match_section_name):
13061 Remove.
13062 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13063 Remove.
13064 (Output_section::Input_section_sort_entry::match_section_file):
13065 Remove.
13066 (Output_section::Input_section_sort_compare::operator()): Rewrite
13067 using new Input_section_sort_entry functions. Sort crtbegin and
13068 crtend first. Sort sections with no priority before sections with
13069 a priority.
13070 * testsuite/initpri1.c (d3): Check j != 4.
13071 (cd5): New constructor/destructor function.
13072 (main): Check j != 2.
13073
479f6503
ILT
13074 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13075 new symbol when resolving, don't call set_is_default.
13076 * testsuite/ver_test_7.cc: New file.
13077 * testsuite/ver_test_7.sh: New file.
13078 * testsuite/Makefile.am (ver_test_7.so): New target.
13079 (ver_test_7.o): New target.
13080 (check_SCRIPTS): Add ver_test_7.sh.
13081 (check_DATA): Add ver_test_7.syms.
13082 (ver_test_7.syms): New target.
13083
2fd32231
ILT
130842008-03-28 Ian Lance Taylor <iant@google.com>
13085
13086 * layout.cc (Layout::layout): If we see an input section with a
13087 name that needs sorting, set the must_sort flag for the output
13088 section.
13089 (Layout::make_output_section): If the name of the output section
13090 indicates that it might require sorting, set the may_sort flag.
13091 * output.h (Output_section::may_sort_attached_input_sections): New
13092 function.
13093 (Output_section::set_may_sort_attached_input_sections): New
13094 function.
13095 (Output_section::must_sort_attached_input_sections): New
13096 function.
13097 (Output_section::set_must_sort_attached_input_sections): New
13098 function.
13099 (class Output_section): Declare Input_section_sort_entry. Define
13100 Input_section_sort_compare. Declare
13101 sort_attached_input_sections. Add new fields:
13102 may_sort_attached_input_sections_,
13103 must_sort_attached_input_sections_,
13104 attached_input_sections_are_sorted_.
13105 * output.cc (Output_section::Output_section): Initialize new
13106 fields.
13107 (Output_section::add_input_section): Add an entry to
13108 input_sections_ if may_sort or must_sort are true.
13109 (Output_section::set_final_data_size): Call
13110 sort_attached_input_sections if necessary.
13111 (Output_section::Input_section_sort_entry): Define new class.
13112 (Output_section::Input_section_sort_compare::operator()): New
13113 function.
13114 (Output_section::sort_attached_input_sections): New function.
13115 * configure.ac: Check whether the compiler supports constructor
13116 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13117 * testsuite/initpri1.c: New file.
13118 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13119 CONSTRUCTOR_PRIORITY.
13120 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13121 (initpri1_LDFLAGS): New variable.
13122 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13123
18e6b24e
ILT
131242008-03-27 Ian Lance Taylor <iant@google.com>
13125
49bdd526
ILT
13126 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13127 * testsuite/common_test_1.c: New file.
13128 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13129 (common_test_1_SOURCES): New variable.
13130 (common_test_1_DEPENDENCIES): New variable.
13131 (common_test_1_LDFLAGS): New variable.
13132
18e6b24e
ILT
13133 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13134 and commons_ correctly when NAME/VERSION does not override
13135 NAME/NULL.
13136 * testsuite/ver_test_6.c: New file.
13137 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13138 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13139 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13140
04bf7072
ILT
131412008-03-26 Ian Lance Taylor <iant@google.com>
13142
5871526f
ILT
13143 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13144 of an undefined symbol from a version script.
13145 * testsuite/Makefile.am (ver_test_5.so): New target.
13146 (ver_test_5.o): New target.
13147 (check_SCRIPTS): Add ver_test_5.sh.
13148 (check_DATA): Add ver_test_5.syms.
13149 (ver_test_5.syms): New target.
13150 * testsuite/ver_test_5.cc: New file.
13151 * testsuite/ver_test_5.script: New file.
13152 * testsuite/ver_test_5.sh: New file.
13153 * Makefile.in, testsuite/Makefile.in: Rebuild.
13154
04bf7072
ILT
13155 PR gold/5986
13156 Fix problems building gold with gcc 4.3.0.
13157 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13158 (gold_error_at_location, gold_warning_at_location): Use it.
13159 * configure.ac: Check whether we can compile and use a template
13160 function with a printf attribute.
13161 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13162 when jumping over bytes.
13163 * object.cc: Instantiate Object::read_section_data.
13164 * debug.h: Include <cstring>
13165 * dwarf_reader.cc: Include <algorithm>
13166 * main.cc: Include <cstring>.
13167 * options.cc: Include <cstring>.
13168 * output.cc: Include <cstring>.
13169 * script.cc: Include <cstring>.
13170 * script.h: Include <string>.
13171 * symtab.cc: Include <cstring> and <algorithm>.
13172 * target-select.cc: Include <cstring>.
13173 * version.cc: Include <string>.
13174 * testsuite/testmain.cc: Include <cstdlib>.
13175 * configure, config.in: Rebuild.
13176
874c5b28
ILT
131772008-03-25 Ian Lance Taylor <iant@google.com>
13178
819d6c3a
ILT
13179 * options.cc: Include "../bfd/bfdver.h".
13180 (options::help): Print bug reporting address.
13181
f4b2c6f5
ILT
13182 * version.cc (print_version): Adjust output for current value of
13183 BFD_VERSION_STRING.
13184
13185 * NEWS: New file.
13186
e96caa79
ILT
13187 * options.cc (options::help): Print list of supported targets.
13188 * target-select.h: Include <vector>.
13189 (class Target_selector): Make machine_, size_, and is_big_endian_
13190 fields const. Add bfd_name_ and instantiated_target_ fields.
13191 (Target_selector::Target_selector): Add bfd_name parameter.
13192 (Target_selector::recognize): Make non-virtual, call
13193 do_recognize.
13194 (Target_selector::recognize_by_name): Make non-virtual, call
13195 do_recognize_by_name.
13196 (Target_selector::supported_names): New function.
13197 (Target_selector::bfd_name): New function.
13198 (Target_selector::do_instantiate_target): New pure virtual
13199 function.
13200 (Target_selector::do_recognize): New virtual function.
13201 (Target_selector::do_recognize_by_name): New virtual function.
13202 (Target_selector::instantiate_target): New private function.
13203 (supported_target_names): Declare.
13204 * target-select.cc (Target_selector::Target_selector): Update for
13205 new parameter and fields.
13206 (select_target_by_name): Check that the name matches before
13207 calling recognize_by_name.
13208 (supported_target_names): New function.
13209 * i386.cc (class Target_selector_i386): Update Target_selector
13210 constructor call. Remove recognize and recognize_by_name. Add
13211 do_instantiate_target.
13212 * x86_64.cc (class Target_selector_x86_64): Likewise.
13213 * testsuite/testfile.cc (class Target_selector_test): Update for
13214 changes to Target_selector.
13215
874c5b28
ILT
13216 * README: Rewrite, with some notes on unsupported features.
13217
0a65a3a7
CC
132182008-03-24 Cary Coutant <ccoutant@google.com>
13219
13220 * i386.cc (Target_i386::Got_type): New enum declaration.
13221 (Target_i386::Scan::local): Updated callers of Output_data_got
13222 member functions.
13223 (Target_i386::Scan::global): Likewise.
13224 (Target_i386::Relocate::relocate): Likewise.
13225 (Target_i386::Relocate::relocate_tls): Likewise.
13226 * object.h (Got_offset_list): New class.
13227 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13228 (Sized_relobj::local_got_offset): Likewise.
13229 (Sized_relobj::set_local_got_offset): Likewise.
13230 (Sized_relobj::local_has_tls_got_offset): Removed.
13231 (Sized_relobj::local_tls_got_offset): Removed.
13232 (Sized_relobj::set_local_tls_got_offset): Removed.
13233 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13234 * output.cc (Output_data_got::add_global): Added got_type parameter.
13235 (Output_data_got::add_global_with_rel): Likewise.
13236 (Output_data_got::add_global_with_rela): Likewise.
13237 (Output_data_got::add_global_pair_with_rel): New function.
13238 (Output_data_got::add_global_pair_with_rela): New function.
13239 (Output_data_got::add_local): Added got_type parameter.
13240 (Output_data_got::add_local_with_rel): Likewise.
13241 (Output_data_got::add_local_with_rela): Likewise.
13242 (Output_data_got::add_local_pair_with_rel): New function.
13243 (Output_data_got::add_local_pair_with_rela): New function.
13244 (Output_data_got::add_global_tls): Removed.
13245 (Output_data_got::add_global_tls_with_rel): Removed.
13246 (Output_data_got::add_global_tls_with_rela): Removed.
13247 (Output_data_got::add_local_tls): Removed.
13248 (Output_data_got::add_local_tls_with_rel): Removed.
13249 (Output_data_got::add_local_tls_with_rela): Removed.
13250 * output.h (Output_data_got::add_global): Added got_type parameter.
13251 (Output_data_got::add_global_with_rel): Likewise.
13252 (Output_data_got::add_global_with_rela): Likewise.
13253 (Output_data_got::add_global_pair_with_rel): New function.
13254 (Output_data_got::add_global_pair_with_rela): New function.
13255 (Output_data_got::add_local): Added got_type parameter.
13256 (Output_data_got::add_local_with_rel): Likewise.
13257 (Output_data_got::add_local_with_rela): Likewise.
13258 (Output_data_got::add_local_pair_with_rel): New function.
13259 (Output_data_got::add_local_pair_with_rela): New function.
13260 (Output_data_got::add_global_tls): Removed.
13261 (Output_data_got::add_global_tls_with_rel): Removed.
13262 (Output_data_got::add_global_tls_with_rela): Removed.
13263 (Output_data_got::add_local_tls): Removed.
13264 (Output_data_got::add_local_tls_with_rel): Removed.
13265 (Output_data_got::add_local_tls_with_rela): Removed.
13266 * resolve.cc (Symbol::override_base_with_special): Removed
13267 reference to has_got_offset_ field.
13268 * symtab.cc (Symbol::init_fields): Replaced initialization
13269 of got_offset_ with got_offsets_. Removed initialization
13270 of has_got_offset_
53fcba31 13271 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
13272 (Symbol::got_offset): Likewise.
13273 (Symbol::set_got_offset): Likewise.
13274 (Symbol::has_tls_got_offset): Removed.
13275 (Symbol::tls_got_offset): Removed.
13276 (Symbol::set_tls_got_offset): Removed.
13277 (Symbol::got_offset_): Removed.
13278 (Symbol::tls_mod_got_offset_): Removed.
13279 (Symbol::tls_pair_got_offset_): Removed.
13280 (Symbol::got_offsets_): New field.
13281 (Symbol::has_got_offset): Removed.
13282 (Symbol::has_tls_mod_got_offset): Removed.
13283 (Symbol::has_tls_pair_got_offset): Removed.
13284 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13285 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13286 member functions.
13287 (Target_x86_64::Scan::global): Likewise.
13288 (Target_x86_64::Relocate::relocate): Likewise.
13289 (Target_x86_64::Relocate::relocate_tls): Likewise.
13290
bd52eafb
BE
132912008-03-25 Ben Elliston <bje@au.ibm.com>
13292
13293 * yyscript.y: Fix spelling error in comment.
13294
8b105e34
ILT
132952008-03-24 Ian Lance Taylor <iant@google.com>
13296
8ed814a9
ILT
13297 * options.h (class General_options): Define build_id option.
13298 * layout.h (class Layout): Declare write_build_id, create_note,
13299 create_build_id. Add build_id_note_ member.
13300 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13301 "libiberty.h", "md5.h", "sha1.h".
13302 (Layout::Layout): Initialize eh_frame_data_,
13303 eh_frame_hdr_section_, and build_id_note_.
13304 (Layout::finalize): Call create_build_id.
13305 (Layout::create_note): New function, broken out of
13306 Layout::create_gold_note.
13307 (Layout::create_gold_note): Call create_note.
13308 (Layout::create_build_id): New function.
13309 (Layout::write_build_id): New function.
13310 (Close_task_runner::run): Call write_build_id.
13311
8b105e34
ILT
13312 * x86_64.cc: Correct license to GPLv3.
13313
086a1841
ILT
133142008-03-23 Ian Lance Taylor <iant@google.com>
13315
13316 * options.cc: Include "demangle.h".
13317 (parse_optional_string): New function.
13318 (parse_long_option): Handle takes_optional_argument.
13319 (parse_short_option): Update dash_z initializer. Handle
13320 takes_optional_argument.
13321 (General_options::General_options): Initialize do_demangle_.
13322 (General_options::finalize): Set do_demangle_. Handle demangling
13323 style.
13324 * options.h (parse_optional_string): Declare.
13325 (struct One_option): Add optional_arg field. Update constructor.
13326 Update call constructor calls. Add takes_optional_argument
13327 function.
13328 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13329 (DEFINE_optional_string): Define.
13330 (General_options::demangle): Change from DEFINE_bool to
13331 DEFINE_optional_string.
13332 (General_options::no_demangle): New function.
13333 (General_options::do_demangle): New function.
13334 (General_options::set_do_demangle): New function.
13335 (General_options::execstack_status_): Move definition to end of
13336 class definition.
13337 (General_options::static_): Likewise.
13338 (General_options::do_demangle_): New field.
13339 * object.cc (big_endian>::get_symbol_location_info): Call
13340 Options::do_demangle, not Options::demangle.
13341 * symtab.cc (demangle): Likewise.
13342
cbb93e63
ILT
133432008-03-22 Ian Lance Taylor <iant@google.com>
13344
13345 * gold.h: Include <cstddef> and <sys/types.h>
13346 * options.h: Include <cstring>.
13347
ec531623
ILT
133482008-03-21 Ian Lance Taylor <iant@google.com>
13349
13350 * Added source code to GNU binutils.
This page took 0.823425 seconds and 4 git commands to generate.