Fix a typo that prevented "make TAGS" from working.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
b1759dce
ILT
12012-08-14 Ian Lance Taylor <iant@google.com>
2
3 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4 unsupported_relocal_local to call unsupported_reloc_global.
5
b9b2ae8b
NC
62012-08-14 Nick Clifton <nickc@redhat.com>
7
8 PR ld/14265
9 * script-sections.cc (Sections_element::output_section_name): Add
10 keep return parameter.
11 (Output_section_element::match_name): Add keep return parameter.
12 Return the value of the keep_ member.
13 * script-sections.h (class Output_section): Update
14 output_section_name prototype.
15 * layout.cc (Layout::keep_input_section): New public member
16 function.
17 (Layout::choose_output_section): Pass keep parameter to
18 output_section_name.
19 * layout.h (class Layout): Add keep_input_section.
20 * object.cc (Sized_relobj_file::do_layout): Check for kept input
21 sections.
22 * testsuite/Makefile.am: Add a test.
23 * testsuite/Makefile.in: Regenerate.
24 * testsuite/pr14265.c: Source file for the test.
25 * testsuite/pr14265.t: Linker script for the test.
26 * testsuite/pr14265.sh: Shell script for the test.
27
921b5322
AM
282012-08-14 Alan Modra <amodra@gmail.com>
29
30 * target.h (Target::output_section_name): New function.
31 (Target::do_output_section_name): New function.
32 * layout.cc (Layout::choose_output_section): Call the above.
33 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
34
6ce78956
AM
352012-08-14 Alan Modra <amodra@gmail.com>
36
37 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
38 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
39 for replace_constant call.
40 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
41 (Output_data_glink::do_print_to_mapfile): New function.
42 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
43 (Target_powerpc::Relocate::relocate): Likewise.
44
d1a8cabd
AM
452012-08-14 Alan Modra <amodra@gmail.com>
46
47 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
48 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
49 (Output_data_glink::add_entry,find_entry): Remove shndx param.
50 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
51 all references to shndx_. Handle special case for R_PPC_PLTREL24
52 here.
53 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
54 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
55 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
56 here.
57 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
58 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
59
d83ce4e3
AM
602012-08-12 Alan Modra <amodra@gmail.com>
61
62 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
63 (glink insn constants): Use uint32_t.
64 (Output_data_glink::add_entry): Use insert, not [] operator.
65
cf43a2fe
AM
662012-08-11 Alan Modra <amodra@gmail.com>
67
68 * object.h (Sized_relobj_file::find_shdr): New function.
69 (Sized_relobj_file::find_special_sections): New function.
70 * object.cc (Sized_relobj_file::find_shdr): New function.
71 (Sized_relobj_file::find_eh_frame): Use find_shdr.
72 (Sized_relobj_file::find_special_sections): New function, split out..
73 (Sized_relobj_file::do_read_symbols): ..from here.
74 * output.h (Output_data_got::replace_constant): New function.
75 (Output_data_got::num_entries): New function.
76 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
77 (Output_data_got::got_offset): Protected rather than private.
78 (Output_data_got::replace_got_entry): New function.
79 * output.cc (Output_data_got::replace_got_entry): New function.
80 * powerpc.cc (class Powerpc_relobj): New.
81 (class Powerpc_relocate_functions): Delete all psymval variants or
82 convert to value,addend type. Delete pcrela, pcrela_unaligned.
83 Implement _ha functions using corresponding _hi function.
84 (Powerpc_relobj::find_special_sections): New function.
85 (Target_powerpc::do_make_elf_object): New function.
86 (class Output_data_got_powerpc): New.
87 (class Output_data_glink): New.
88 (class Powerpc_scan_relocatable_reloc): New.
89 Many more changes througout file.
90
3c892704
NC
912012-08-09 Nick Clifton <nickc@redhat.com>
92
93 * po/vi.po: Updated Vietnamese translation.
94
82435b3b
ILT
952012-08-07 Ian Lance Taylor <iant@google.com>
96
97 * layout.cc (Layout::add_target_dynamic_tags): If
98 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
99 plt_rel.
100
a6dc81d2
NC
1012012-07-30 Nick Clifton <nickc@redhat.com>
102
103 * po/gold.pot: Updated template.
104 * po/es.po: Updated Spanish translation.
105
f1415016
CC
1062012-07-18 Cary Coutant <ccoutant@google.com>
107
108 PR gold/14344
109 * configure.ac: Add check for -gpubnames support.
110 * configure: Regenerate.
111 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
112 support; force -gno-pubnames.
113 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
114 support.
115 (gdb_index_test_4): New test.
116 * testsuite/Makefile.in: Regenerate.
117 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
118 * testsuite/gdb_index_test_2.sh: Likewise.
119 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
120 * testsuite/gdb_index_test_4.sh: New script.
121 * testsuite/gdb_index_test_comm.sh: New script with common code;
122 don't look for space after colon.
123
b7fd7c37
ST
1242012-07-16 Sriraman Tallam <tmsriram@google.com>
125
126 * gold.cc (queue_middle_tasks): Update function order only after
127 deferred objects due to plugins are processed.
128
1f3212db
ILT
1292012-07-11 Ian Lance Taylor <iant@google.com>
130
131 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
132 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
133 (Target_arm::scan_reloc_for_stub): Likewise.
134 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
135 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
136 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
137 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
138 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
139
81c82a68
ILT
1402012-07-10 Dodji Seketeli <dodji@redhat.com>
141 Ian Lance Taylor <iant@google.com>
142
143 PR gold/14309
144 * configure.ac: Test whether std::tr1::hash<off_t> works.
145 * gold.h: Add a specialization for std::tr1::hash<off_t> if
146 needed.
147 * output.h (class Output_fill): Add virtual destructor.
148 * configure, config.in: Rebuild.
149
eabc84f4
RM
1502012-06-22 Roland McGrath <mcgrathr@google.com>
151
152 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
153
370e30b6
RÁE
1542012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
155
156 * plugin.cc (Plugin::load): Handle position independent executables.
157
fb1b895d
CC
1582012-06-06 Cary Coutant <ccoutant@google.com>
159
160 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
161 add .debug_macro.
162 (lines_only_debug_sections): Likewise.
163 (gdb_fast_lookup_sections): New static array.
164 (is_gdb_debug_section): Rename formal parameter.
165 (is_lines_only_debug_section): Likewise.
166 (is_gdb_fast_lookup_section): New function.
167 (Layout::include_section): Check for ".zdebug_" prefix; pass
168 section name suffix to is_gdb_debug_section, et al.; check for
169 fast-lookup sections when building .gdb_index.
170 * options.h (--strip-debug-gdb): Update GDB version number.
171
7c0640fa
CC
1722012-06-06 Cary Coutant <ccoutant@google.com>
173
174 * configure.ac: Add check for fallocate.
175 * configure: Regenerate.
176 * config.in: Regenerate.
177
178 * options.h (class General_options): Add --mmap-output-file and
179 --posix-fallocate options.
180 * output.cc: (posix_fallocate): Remove; replace with...
181 (gold_fallocate): New function.
182 (Output_file::map_no_anonymous): Call gold_fallocate.
183 (Output_file::map): Check --mmap-output-file option.
184
2a49eb69
DK
1852012-06-05 Jing Yu <jingyu@google.com>
186
187 * gold.h (textdomain): Add do {} to empty while(0).
188 (bindtextdomain): Likewise.
189
fad072ac
CC
1902012-06-04 Cary Coutant <ccoutant@google.com>
191
192 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
193 has_dynsym_index.
194
8cc69fb6
ST
1952012-05-25 Sriraman Tallam <tmsriram@google.com>
196
197 * symtab.cc (Symbol_table::define_special_symbol):
198 Initialize *poldsym to prevent uninitialized variable errors.
199
1be75daa
CC
2002012-05-23 Cary Coutant <ccoutant@google.com>
201
202 * layout.cc (Layout::section_name_mapping): Add rules to handle
203 exact match on .data.rel.ro.local or .data.rel.ro.
204 (Layout::output_section_name): Check for exact matches.
205
9b689de0
CC
2062012-05-23 Cary Coutant <ccoutant@google.com>
207
208 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
209 more carefully.
210
b24fdbf5
CC
2112012-05-22 Cary Coutant <ccoutant@google.com>
212
213 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
214 object before exporting symbol.
215
e550e1a2
L
2162012-05-21 H.J. Lu <hongjiu.lu@intel.com>
217
218 * testsuite/tls_test.cc: Include "config.h" first.
219 * testsuite/tls_test_c.c: Likewise.
220
df7b86aa
NC
2212012-05-17 Daniel Richard G. <skunk@iskunk.org>
222 Nick Clifton <nickc@redhat.com>
223
224 PR 14072
225 * configure.in: Add check that sysdep.h has been included before
226 any system header files.
227 * configure: Regenerate.
228 * config.in: Regenerate.
229
1007b503
CC
2302012-05-14 Cary Coutant <ccoutant@google.com>
231
232 * layout.cc (Layout::make_output_section): Mark .tdata section
233 as RELRO.
234 * testsuite/relro_test.cc: Add a TLS variable.
235
fd885f3a
L
2362012-05-10 H.J. Lu <hongjiu.lu@intel.com>
237
238 PR gold/14091
239 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
240 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
241 R_X86_64_64.
242
80f5885c
CC
2432012-05-08 Cary Coutant <ccoutant@google.com>
244
245 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
246 (lines_only_debug_sections): Likewise.
247
2e702c99
RM
2482012-05-02 Roland McGrath <mcgrathr@google.com>
249
250 * nacl.cc: New file.
251 * nacl.h: New file.
252 * Makefile.am (CCFILES, HFILES): Add them.
253 * Makefile.in: Regenerate.
254 * i386.cc (Output_data_plt_i386_nacl): New class.
255 (Output_data_plt_i386_nacl_exec): New class.
256 (Output_data_plt_i386_nacl_dyn): New class.
257 (Target_i386_nacl): New class.
258 (Target_selector_i386_nacl): New class.
259 (target_selector_i386): Use it instead of Target_selector_i386.
260 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
261 (Target_x86_64_nacl): New class.
262 (Target_selector_x86_64_nacl): New class.
263 (target_selector_x86_64, target_selector_x32): Use it instead of
264 Target_selector_x86_64.
265 * arm.cc (Output_data_plt_arm_nacl): New class.
266 (Target_arm_nacl): New class.
267 (Target_selector_arm_nacl): New class.
268 (target_selector_arm, target_selector_armbe): Use it instead of
269 Target_selector_arm.
270
271 * target-select.cc (select_target): Take new Input_file* and off_t
272 arguments, pass them on to recognize method of selector.
273 * object.cc (make_elf_sized_object): Update caller.
274 * parameters.cc (parameters_force_valid_target): Likewise.
275 * incremental.cc (make_sized_incremental_binary): Likewise.
276 * target-select.h: Update decl.
277 (Target_selector::recognize): Take new Input_file* argument,
278 pass it on to do_recognize.
279 (Target_selector::do_recognize): Take new Input_file* argument.
280 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
281 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
282 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
283 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
284
285 * target.h (Target::Target_info): New members isolate_execinstr
286 and rosegment_gap.
287 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
288 * arm.cc (Target_arm::arm_info): Update initializer.
289 * i386.cc (Target_i386::i386_info): Likewise.
290 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
291 * sparc.cc (Target_sparc::sparc_info): Likewise.
292 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
293 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
294 * layout.cc (Layout::attach_allocated_section_to_segment):
295 Take new const Target* argument. If target->isolate_execinstr(), act
296 like --rosegment.
297 (Layout::find_first_load_seg): Take new const Target* argument;
298 if target->isolate_execinstr(), reject PF_X segments.
299 (Layout::relaxation_loop_body): Update caller.
300 (Layout::set_segment_offsets): If target->isolate_execinstr(),
301 reset file offset to zero when we hit LOAD_SEG, and then do a second
302 loop over the segments before LOAD_SEG to reassign offsets after
303 addresses have been determined. Handle target->rosegment_gap().
304 (Layout::attach_section_to_segment): Take new const Target* argument;
305 pass it to attach_allocated_section_to_segment.
306 (Layout::make_output_section): Update caller.
307 (Layout::attach_sections_to_segments): Take new const Target* argument;
308 pass it to attach_section_to_segment.
309 * gold.cc (queue_middle_tasks): Update caller.
310 * layout.h (Layout): Update method decls with new arguments.
311
312 * arm.cc (Target_arm::Target_arm): Take optional argument for the
313 Target_info pointer to use.
314 (Target_arm::do_make_data_plt): New virtual method.
315 (Target_arm::make_data_plt): New method that calls it.
316 (Target_arm::make_plt_entry): Use it.
317 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
318 for the section alignment.
319 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
320 method.
321 (Output_data_plt_arm::first_plt_entry_offset): Call it.
322 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
323 method.
324 (Output_data_plt_arm::get_plt_entry_size): Call it.
325 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
326 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
327 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
328 method.
329 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
330 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
331 method instead of sizeof(plt_entry).
332 (Output_data_plt_arm::add_entry): Likewise.
333 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
334 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
335 than static method.
336 (Target_arm::plt_entry_size): Likewise.
337 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
338 Move to ...
339 (Output_data_plt_arm_standard): ... here, new class.
340 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
341 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
342 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
343
344 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
345 Take additional argument for the PLT entry size.
346 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
347 Use get_plt_entry_size method rather than plt_entry_size variable.
348 (Output_data_plt_x86_64::reserve_slot): Likewise.
349 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
350 (Output_data_plt_x86_64::add_entry): Likewise.
351 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
352 (Output_data_plt_x86_64::address_for_global): Likewise.
353 (Output_data_plt_x86_64::address_for_local): Likewise.
354 (Output_data_plt_x86_64::set_final_data_size): Likewise.
355 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
356 Make method non-static.
357 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
358 method.
359 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
360 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
361 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
362 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
363 virtual method.
364 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
365 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
366 virtual method.
367 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
368 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
369 virtual method.
370 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
371 (Output_data_plt_x86_64::plt_entry_size)
372 (Output_data_plt_x86_64::first_plt_entry)
373 (Output_data_plt_x86_64::plt_entry)
374 (Output_data_plt_x86_64::tlsdesc_plt_entry)
375 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
376 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
377 (Output_data_plt_x86_64_standard): ... here, new class.
378 (Target_x86_64::Target_x86_64): Take optional argument for the
379 Target_info pointer to use.
380 (Target_x86_64::do_make_data_plt): New virtual method.
381 (Target_x86_64::make_data_plt): New method to call it.
382 (Target_x86_64::init_got_plt_for_update): Use that.
383 Call this->plt_->add_eh_frame method here.
384 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
385 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
386 rather than static method.
387 (Target_x86_64::plt_entry_size): Likewise.
388 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
389 rather than plt_entry_size variable. Move guts of PLT filling to...
390 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
391 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
392 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
393
394 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
395 additional argument for the section alignment.
396 Don't do add_eh_frame_for_plt here.
397 (Output_data_plt_i386::first_plt_entry_offset): Make the method
398 non-static. Use get_plt_entry_size method rather than plt_entry_size
399 variable.
400 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
401 method.
402 (Output_data_plt_i386::get_plt_entry_size): Call it.
403 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
404 (Output_data_plt_i386::add_eh_frame): New method to call it.
405 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
406 method.
407 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
408 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
409 method.
410 (Output_data_plt_i386::fill_plt_entry): New method to call it.
411 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
412 method instead of plt_entry_size.
413 (Output_data_plt_i386::plt_entry_size)
414 (Output_data_plt_i386::plt_eh_frame_fde_size)
415 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
416 (Output_data_plt_i386_standard): ... here, new class.
417 (Output_data_plt_i386_exec): New class.
418 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
419 (Output_data_plt_i386_exec::first_plt_entry): ... here.
420 (Output_data_plt_i386::exec_plt_entry): Move to ...
421 (Output_data_plt_i386_exec::plt_entry): ... here.
422 (Output_data_plt_i386_dyn): New class.
423 (Output_data_plt_i386::first_plt_entry): Move to ...
424 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
425 (Output_data_plt_i386::dyn_plt_entry): Move to ...
426 (Output_data_plt_i386_dyn::plt_entry): ... here.
427 (Target_i386::Target_i386): Take optional argument for the Target_info
428 pointer to use.
429 (Target_i386::do_make_data_plt): New virtual method.
430 (Target_i386::make_data_plt): New method to call it.
431 (Target_i386::make_plt_section): Use that.
432 Call this->plt_->add_eh_frame method here.
433 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
434 rather than plt_entry_size variable.
435 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
436 (Output_data_plt_i386::address_for_local): Likewise.
437 (Output_data_plt_i386::do_write): Likewise.
438 Move guts of PLT filling to...
439 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
440 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
441 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
442 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
443
b9b9f2ee
CC
4442012-05-01 Cary Coutant <ccoutant@google.com>
445
446 * dwarf_reader.cc (Dwarf_die::read_attributes)
447 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
448 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
449 * reduced_debug_output.cc
450 (Output_reduced_debug_info_section::get_die_end): Remove
451 DW_FORM_GNU_ref_index. Add default case.
452
57923f48
MW
4532012-04-26 Mark Wielaard <mjw@redhat.com>
454
455 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
456 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
457 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
458 DW_AT_high_pc as offset from DW_AT_low_pc.
459
460 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
461 * testsuite/Makefile.in: Regenerate.
462 * testsuite/gdb_index_test_3.c: New test source file.
463 * testsuite/gdb_index_test_3.sh: New test source file.
464
2c54b4f4
ILT
4652012-04-25 Ian Lance Taylor <iant@google.com>
466
467 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
468 pointer.
469 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
470 as a class, not a struct.
471 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
472 (Target_arm::apply_cortex_a8_workaround): Likewise.
473 * gc.h: Declare Reloc_types as a struct, not a class.
474 * object.h: Declare Symbols_data as a struct.
475 * reloc.h: Declare Read_relocs_data as a struct.
476 * target.h: Declare Relocate_info as a struct.
477
a5a5f7a3
DM
4782012-04-24 David S. Miller <davem@davemloft.net>
479
480 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
481 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
482 and R_SPARC_WPLT30.
483
f038d496
CC
4842012-04-24 Cary Coutant <ccoutant@google.com>
485
486 * incremental-dump.cc (find_input_containing_global): Replace
487 magic number with symbolic constant.
488 (dump_incremental_inputs): Update version number.
489 * incremental.cc (Output_section_incremental_inputs): Update version
490 number; import symbolic constants from Incremental_inputs_reader.
491 (Incremental_inputs::create_data_sections): Align relocations
492 section correctly for 64-bit targets.
493 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
494 constants; add padding.
495 (Output_section_incremental_inputs::write_header): Add assert for
496 header_size.
497 (Output_section_incremental_inputs::write_input_files): Add assert
498 for input_entry_size.
499 (Output_section_incremental_inputs::write_info_blocks): Add padding;
500 add assert for object_info_size, input_section_entry_size,
501 global_sym_entry_size.
502 * incremental.h (Incremental_inputs_reader): Add symbolic constants
503 for data structure sizes; use them.
504 (Incremental_input_entry_reader): Import symbolic constants from
505 Incremental_inputs_reader; use them.
506
a4d85145
DM
5072012-04-23 David S. Miller <davem@davemloft.net>
508
509 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
510 and elf_flags_set_.
511 (Target_sparc::Target_sparc): Initialize new fields.
512 (Target_sparc::do_make_elf_object): New function.
513 (Target_sparc::do_adjust_elf_header): New function.
514
1d509098
CC
5152012-04-23 Cary Coutant <ccoutant@google.com>
516
517 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
518 CU range table of gdb index.
519
7ebeff7f
DM
5202012-04-20 David S. Miller <davem@davemloft.net>
521
522 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
523 instead of false.
524
13cf9988
DM
5252012-04-16 David S. Miller <davem@davemloft.net>
526
2a1079e8
DM
527 * sparc.cc (Target_sparc::got_address): New function.
528 (Sparc_relocate_functions::gdop_hix22): New function.
529 (Sparc_relocate_functions::gdop_lox10): New function.
530 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
531 relocs.
532 (Target_sparc::Scan::local): Likewise if the global symbol is not
533 preemptible and is not IFUNC.
534 (Target_sparc::Relocate::relocate): Perform GOTDATA code
535 transformations for local and non-preemptible non-IFUNC global
536 symbols.
537
0bc964fc
DM
538 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
539 writing out 64-bit part of ranges.
540
661d7a80
DM
541 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
542 -fpic and -fpie respectively.
543 * Makefile.in: Regenerate.
544
8c2bf391
DM
545 * sparc.cc (class Target_sparc): Add rela_ifunc_.
546 (Target_sparc::Target_sparc): Initialize new field.
547 (Target_sparc::do_plt_section_for_global): New function.
548 (Target_sparc::do_plt_section_for_local): New function.
549 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
550 (Target_sparc::make_plt_section): New function, broken out of
551 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
552 (Target_sparc::make_plt_entry): Call make_plt_section.
553 (Target_sparc::make_local_ifunc_plt_entry): New function.
554 (Target_sparc::rela_ifunc_section): New function.
555 (Target_sparc::plt_section): Remove const.
556 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
557 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
558 and ifunc_count_ fields.
559 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
560 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
561 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
562 (Output_data_plt_sparc::rela_ifunc): New function.
563 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
564 (Output_data_plt_sparc::has_ifunc_section): New function.
565 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
566 (Output_data_plt_sparc::address_for_global): New function.
567 (Output_data_plt_sparc::address_for_local): New function.
568 (Output_data_plt_sparc::plt_index_to_offset): New function.
569 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
570 and entry_count.
571 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
572 entry_count.
573 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
574 R_SPARC_JMP_IREL to switch.
575 (Target_sparc::Scan::check_non_pic): Likewise.
576 (Target_sparc::Scan::local): Handle IFUNC symbols.
577 (Target_sparc::Scan::local): Likewise.
578 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
579 and plt_address_for_local.
580 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
581 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
582
13cf9988
DM
583 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
584 (class Output_data_reloc): Adjust calls to Output_reloc_type.
585 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
586 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
587 global relocs too.
588 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
589 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
590 calls.
591 * sparc.cc (Target_sparc::Scan::global): Likewise.
592 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
593
31821be0
CC
5942012-04-16 Cary Coutant <ccoutant@google.com>
595
596 * archive.cc (Library_base::should_include_member): Check for
597 --export-dynamic-symbol.
598 * options.h (class General_options): Add --export-dynamic-symbol.
599 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
600 --export-dynamic-symbol.
601 (Symbol_table::gc_mark_undef_symbols): Likewise.
602 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
603
2615994e
DM
6042012-04-12 David S. Miller <davem@davemloft.net>
605
606 * sparc.cc (Reloc::wdisp10): New relocation method.
607 (Reloc::h34): Likewise.
608 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
609 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
610 R_SPARC_WDISP10.
611 (Target_sparc::Scan::local): Likewise.
612 (Target_sparc::Scan::global): Likewise.
613 (Target_sparc::Relocate::relocate): Likewise.
614
6782735d
CC
6152012-04-09 Cary Coutant <ccoutant@google.com>
616
617 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
618 low_pc == 0.
619
8c7a0b00
ILT
6202012-04-06 Ian Lance Taylor <iant@google.com>
621
622 * timer.cc: #include <unistd.h>.
623
58797674
RM
6242012-04-06 Roland McGrath <mcgrathr@google.com>
625
626 * configure.in (AC_CHECK_HEADERS): Add locale.h.
627 * config.in: Regenerate.
628 * configure: Regenerate.
629
44350750
NC
6302012-04-05 Nick Clifton <nickc@redhat.com>
631
632 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
633 (AM_LC_MESSAGES): Add.
634 * aclocal.m4: Regenerate.
635 * config.in: Regenerate.
636 * configure: Regenerate.
637
c1027032
CC
6382012-03-21 Cary Coutant <ccoutant@google.com>
639
640 * Makefile.am: Add gdb-index.cc, gdb-index.h.
641 * Makefile.in: Regenerate.
642 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
643 (Sized_elf_reloc_mapper::symbol_section): New function.
644 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
645 (make_elf_reloc_mapper): New function.
646 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
647 (Dwarf_abbrev_table::do_read_abbrevs): New function.
648 (Dwarf_abbrev_table::do_get_abbrev): New function.
649 (Dwarf_ranges_table::read_ranges_table): New function.
650 (Dwarf_ranges_table::read_range_list): New function.
651 (Dwarf_pubnames_table::read_section): New function.
652 (Dwarf_pubnames_table::read_header): New function.
653 (Dwarf_pubnames_table::next_name): New function.
654 (Dwarf_die::Dwarf_die): New function.
655 (Dwarf_die::read_attributes): New function.
656 (Dwarf_die::skip_attributes): New function.
657 (Dwarf_die::set_name): New function.
658 (Dwarf_die::set_linkage_name): New function.
659 (Dwarf_die::attribute): New function.
660 (Dwarf_die::string_attribute): New function.
661 (Dwarf_die::int_attribute): New function.
662 (Dwarf_die::uint_attribute): New function.
663 (Dwarf_die::ref_attribute): New function.
664 (Dwarf_die::child_offset): New function.
665 (Dwarf_die::sibling_offset): New function.
666 (Dwarf_info_reader::check_buffer): New function.
667 (Dwarf_info_reader::parse): New function.
668 (Dwarf_info_reader::do_parse): New function.
669 (Dwarf_info_reader::do_read_string_table): New function.
670 (Dwarf_info_reader::lookup_reloc): New function.
671 (Dwarf_info_reader::get_string): New function.
672 (Dwarf_info_reader::visit_compilation_unit): New function.
673 (Dwarf_info_reader::visit_type_unit): New function.
674 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
675 Sized_elf_reloc_mapper.
676 (Sized_dwarf_line_info::symbol_section): Remove function.
677 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
678 (Sized_dwarf_line_info::read_line_mappings): Remove object
679 parameter, adjust callers.
680 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
681 * dwarf_reader.h: Include <sys/types.h>.
682 (class Track_relocs): Remove forward declaration.
683 (class Elf_reloc_mapper): New class.
684 (class Sized_elf_reloc_mapper): New class.
685 (class Dwarf_abbrev_table): New class.
686 (class Dwarf_range_list): New class.
687 (class Dwarf_ranges_table): New class.
688 (class Dwarf_pubnames_table): New class.
689 (class Dwarf_die): New class.
690 (class Dwarf_info_reader): New class.
691 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
692 (Sized_dwarf_line_info::symbol_section): Remove member function.
693 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
694 base class.
695 * gdb-index.cc: New source file.
696 * gdb-index.h: New source file.
697 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
698 and .debug_types sections, call Layout::add_to_gdb_index.
699 (Sized_relobj_incr::do_section_name): Implement.
700 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
701 return type; Implement.
702 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
703 return type.
704 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
705 parameter list and return type.
706 (Sized_incr_dynobj::do_section_contents): Likewise.
707 * layout.cc: Include gdb-index.h.
708 (Layout::Layout): Initialize gdb_index_data_.
709 (Layout::init_fixed_output_section): Check for .gdb_index section.
710 (Layout::add_to_gdb_index): New function. Instantiate.
711 * layout.h: Add forward declaration for class Gdb_index.
712 (Layout::add_to_gdb_index): New member function.
713 (Layout::gdb_index_data_): New data member.
714 * main.cc: Include gdb-index.h.
715 (main): Print statistics for gdb index.
716 * object.cc (Object::section_contents): Move code into
717 do_section_contents.
718 (need_decompressed_section): Check for sections needed when building
719 gdb index.
720 (build_compressed_section_map): Likewise.
721 (Sized_relobj_file::do_read_symbols): Need local symbols when building
722 gdb index.
723 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
724 sections; call Layout::add_to_gdb_index.
725 (Sized_relobj_file::do_decompressed_section_contents): Call
726 do_section_contents directly.
727 * object.h (Object::do_section_contents): Adjust parameter list and
728 return type.
729 (Object::do_decompressed_section_contents): Call do_section_contents
730 directly.
731 (Sized_relobj_file::do_section_contents): Adjust parameter list and
732 return type.
733 * options.h (class General_options): Add --gdb-index option.
734 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
735 list and return type.
736 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
737 * reloc.h (Track_relocs::checkpoint): New function.
738 (Track_relocs::reset): New function.
739
740 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
741 New test cases.
742 * testsuite/Makefile.in: Regenerate.
743 * testsuite/gdb_index_test.cc: New test source file.
744 * testsuite/gdb_index_test_1.sh: New test source file.
745 * testsuite/gdb_index_test_2.sh: New test source file.
746
647f1574
DK
7472012-03-19 Doug Kwan <dougkwan@google.com>
748
749 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 750 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
751 __exidx_start and __exidx_end. Make symbol table parameter
752 anonymous as it is not used.
753 * gold.cc (queue_middle_tasks): Call target hook to define any
754 target-specific symbols.
755 * target.h (Target::define_standard_symbols): New method.
756 (Target::do_define_standard_symbols): Same.
757 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
758 * testsuite/Makefile.in: Regenerate.
759 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
760 and __exidx_end.
761 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
762 relocations are generated for __exidx_start and __exidx_end.
763
7c6109da
DK
7642012-03-16 Doug Kwan <dougkwan@google.com>
765
766 * testsuite/Makefile.am: Disable test initpri3b.
767 * testsuite/Makefile.in: Regenerate.
768
7b8957f8
DK
7692012-03-15 Doug Kwan <dougkwan@google.com>
770
771 * arm.cc (Target_arm::got_section): Make .got section read-only
772 if -z now is given.
773
14dc9ef7
ILT
7742012-03-15 Ian Lance Taylor <iant@google.com>
775
776 PR gold/13850
777 * layout.cc (Layout::make_output_section): Correctly mark
778 SHT_INIT_ARRAY, et. al., as relro.
779
fa40b62a
DK
7802012-03-14 Doug Kwan <dougkwan@google.com>
781
782 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
783 dynamic relocations for protected symbols in shared objects.
784
fd325007
ILT
7852012-03-13 Ian Lance Taylor <iant@google.com>
786
787 * resolve.cc (Symbol_table::resolve): When merging common symbols,
788 keep the larger alignment.
789
e8dd54e1
CC
7902012-03-12 Cary Coutant <ccoutant@google.com>
791
792 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
793 handling of DW_LNE_define_file.
794
feb5f3b0
CC
7952012-03-12 Cary Coutant <ccoutant@google.com>
796
797 * reduced_debug_output.cc
798 (Output_reduced_debug_info_section::get_die_end): Add new FORM
799 codes to switch.
800
a1fb4256
CC
8012012-02-29 Cary Coutant <ccoutant@google.com>
802
803 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
804
5dd8762a
CC
8052012-02-29 Cary Coutant <ccoutant@google.com>
806
807 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
808 Call Object::decompressed_section_contents.
809 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
810 New dtor.
811 (Sized_dwarf_line_info::buffer_start_): New data member.
812 * merge.cc (Output_merge_data::do_add_input_section): Call
813 Object::decompressed_section_contents.
814 (Output_merge_string::do_add_input_section): Likewise.
815 * object.cc (need_decompressed_section): New function.
816 (build_compressed_section_map): Decompress sections needed later.
817 (Sized_relobj_file::do_decompressed_section_contents): New function.
818 (Sized_relobj_file::do_discard_decompressed_sections): New function.
819 * object.h (Object::decompressed_section_contents): New function.
820 (Object::discard_decompressed_sections): New function.
821 (Object::do_decompressed_section_contents): New function.
822 (Object::do_discard_decompressed_sections): New function.
823 (Compressed_section_info): New type.
824 (Compressed_section_map): Include decompressed section contents.
825 (Sized_relobj_file::do_decompressed_section_contents): New function.
826 (Sized_relobj_file::do_discard_decompressed_sections): New function.
827
7b5de7ee
CC
8282012-02-16 Cary Coutant <ccoutant@google.com>
829
830 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
831 * testsuite/Makefile.in: Regenerate.
832
f9fa4a63
CC
8332012-02-14 Cary Coutant <ccoutant@google.com>
834
835 * options.cc (General_options::finalize): Disallow -pie and -static.
836
2c175ebc
DK
8372012-02-03 Doug Kwan <dougkwan@google.com>
838
839 * arm.cc (Arm_relocate_functions::abs8,
840 Arm_relocate_functions::abs16): Use
841 Bits::has_signed_unsigned_overflow32.
842 (Arm_relocate_functions::thm_abs8): Correct range of
843 overflow check.
844 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
845 in assertions.
846
90cff06f
DK
8472012-02-02 Doug Kwan <dougkwan@google.com>
848
849 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
850 position independent outputs, not just shared objects.
851
63887f3d
L
8522012-01-30 H.J. Lu <hongjiu.lu@intel.com>
853
854 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
855 * configure: Regenerated.
856
bef2b434
ILT
8572012-01-27 Ian Lance Taylor <iant@google.com>
858
859 * reloc.h (Bits): New class with static functions, copied from
860 namespace utils in arm.cc.
861 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
862 instead.
863
c335b55d
L
8642012-01-27 H.J. Lu <hongjiu.lu@intel.com>
865
866 * incremental.cc (write_info_blocks): Correct relocation offset.
867
41194d9f
L
8682012-01-27 H.J. Lu <hongjiu.lu@intel.com>
869
870 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
871 (Relocate::tls_gd_to_le): Likewise.
872
1bae613c
L
8732012-01-27 H.J. Lu <hongjiu.lu@intel.com>
874
875 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
876
24482ca0
L
8772012-01-27 H.J. Lu <hongjiu.lu@intel.com>
878
879 * configure.ac: Check if -mcmodel=medium works.
880 * configure: Regenerated.
881
c2c7840a
CC
8822012-01-24 Cary Coutant <ccoutant@google.com>
883
884 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
885 definition and ...
886 (read_unsigned_LEB_128_x): ... this new function.
887 (read_signed_LEB_128): Replaced with inline definition and ...
888 (read_signed_LEB_128_x): ... this new function.
889 * int_encoding.h (read_unsigned_LEB_128_x): New function.
890 (read_unsigned_LEB_128): Add inline definition.
891 (read_signed_LEB_128_x): New function.
892 (read_signed_LEB_128): Add inline definition.
893 * testsuite/Makefile.am (leb128_unittest): New unit test.
894 * testsuite/Makefile.in: Regenerate.
895 * testsuite/leb128_unittest.cc: New unit test.
896
833de760 8972012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
898
899 PR gold/13617
900 * i386.cc (Target_i386::do_code_fill): When using a jmp
901 instruction, pad with nop instructions.
902 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
903
618d6666
L
9042012-01-22 H.J. Lu <hongjiu.lu@intel.com>
905
906 * x86_64.cc (gc_process_relocs): Add typename on types used in
907 template.
908 (scan_relocs): Likewise.
909 (relocate_section): Likewise.
910 (apply_relocation): Likewise.
911
3660ff06
L
9122012-01-10 H.J. Lu <hongjiu.lu@intel.com>
913
914 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
915 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
916 under x32.
917
fc51264f
L
9182012-01-09 H.J. Lu <hongjiu.lu@intel.com>
919
920 * x86_64.cc: Initial support for x32.
921
dd74ae06
CC
9222012-01-03 Cary Coutant <ccoutant@google.com>
923
924 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
925 Use abstract base class for GOT.
926 * gold/output.h (class Output_data_got_base): New abstract base class.
927 (class Output_data_got): Derive from new base class, adjust ctors.
928 (Output_data_got::reserve_slot): Make virtual; rename to
929 do_reserve_slot; Adjust callers.
930 * gold/target.h (Sized_target::init_got_plt_for_update): Return
931 pointer to abstract base class.
932 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
933
83896202
ILT
9342011-12-18 Ian Lance Taylor <iant@google.com>
935
936 * object.h (Relobj::local_symbol_value): New function.
937 (Relobj::local_plt_offset): New function.
938 (Relobj::local_has_got_offset): New function.
939 (Relobj::local_got_offset): New function.
940 (Relobj::set_local_got_offset): New function.
941 (Relobj::do_local_symbol_value): New pure virtual function.
942 (Relobj::do_local_plt_offset): Likewise.
943 (Relobj::do_local_has_got_offset): Likewise.
944 (Relobj::do_local_got_offset): Likewise.
945 (Relobj::do_set_local_got_offset): Likewise.
946 (Sized_relobj::do_local_has_got_offset): Rename from
947 local_has_got_offset.
948 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
949 (Sized_relobj::do_set_local_got_offset): Rename from
950 set_local_got_offset.
951 (Sized_relobj_file::do_local_plt_offset): Rename from
952 local_plt_offset.
953 (Sized_relobj_file::do_local_symbol_value): New function.
954 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
955 local_plt_offset.
956 * output.cc (Output_data_got::Got_entry::write): Change object to
957 Relobj. Use local_symbol_value.
958 (Output_data_got::add_global_with_rel): Change rel_dyn to
959 Output_data_reloc_generic*. Use add_global_generic.
960 (Output_data_got::add_global_with_rela): Remove. Change all
961 callers to use add_global_with_rel.
962 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
963 Output_data_reloc_generic*. Use add_global_generic.
964 (Output_data_got::add_global_pair_with_rela): Remove. Change all
965 callers to use add_global_pair_with_rel.
966 (Output_data_got::add_local): Change object to Relobj*.
967 (Output_data_got::add_local_plt): Likewise.
968 (Output_data_got::add_local_with_rel): Change object to Relobj*,
969 change rel_dyn to Output_data_reloc_generic*. Use
970 add_local_generic.
971 (Output_data_got::add_local_with_rela): Remove. Change all
972 callers to use all_local_with_rel.
973 (Output_data_got::add_local_pair_with_rel): Change object to
974 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
975 add_output_section_generic.
976 (Output_data_got::add_local_pair_with_rela): Remove. Change all
977 callers to use add_local_pair_with_rel.
978 (Output_data_got::reserve_local): Change object to Relobj*.
979 * output.h: (class Output_data_reloc_generic): Add pure virtual
980 declarations for add_global_generic, add_local_generic,
981 add_output_section_generic.
982 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
983 functions for Output_data_reloc_generic. Update declarations for
984 changes listed in output.cc.
985 (class Output_data_got): Change template parameter to got_size.
986 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
987 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
988 function.
989 (Sized_relobj_incr::do_local_plt_offset): New function.
990 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
991 add_global_generic.
992
76677ad0
CC
9932011-12-17 Cary Coutant <ccoutant@google.com>
994
995 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
996 * resolve.cc (Symbol_table::resolve): Likewise.
997 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
998 arrays.
999 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1000
8b8dd8d5
ILT
10012011-12-16 Ian Lance Taylor <iant@google.com>
1002
1003 * output.h (Output_data_reloc_generic::add): Only call
1004 add_dynamic_reloc if this is a dynamic reloc section.
1005
d55525b9
L
10062011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1007
1008 PR gold/13505
1009 * target-reloc.h (apply_relocation): Replace <64, false> with
1010 <size, big_endian>.
1011
ff81c7c1
NC
10122011-11-25 Nick Clifton <nickc@redhat.com>
1013
1014 * po/it.po: New Italian translation.
1015
628f39be
SA
10162011-11-17 Sterling Augustine <saugustine@google.com>
1017
1018 * script.cc (script_include_directive): Implement.
1019 (read_script_file): New local variables name and search_path. Update
1020 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
1021 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
1022 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
1023
98ef3ea4
SA
10242011-11-11 Sterling Augustine <saugustine@google.com>
1025
1026 * yyscript.y (section_cmd): Add support for INCLUDE directive.
1027 (file_or_sections_cmd): Likewise.
1028
f4a8b6d7
DK
10292011-11-11 Doug Kwan <dougkwan@google.com>
1030
1031 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
1032 if --just-symbols is given.
1033
29ab395d
DK
10342011-11-10 Doug Kwan <dougkwan@google.com>
1035
1036 PR gold/13362
1037 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
1038 when processing data relocs.
1039 * reloc.h (Relocate_functions::rel_unaligned): New method.
1040 (Relocate_functions::pcrel_unaligned): Ditto.
1041 (Relocate_functions::rel32_unaligned): Ditto.
1042 (Relocate_functions::pcrel32_unaligned): Ditto.
1043
2c339f71
DK
10442011-11-09 Doug Kwan <dougkwan@google.com>
1045
1046 PR gold/13362
1047 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
1048 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
1049 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
1050 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1051 (Relocate_functions::rel_unaligned): New.
1052 (Relocate_functions::rel32_unaligned): New.
1053 * target-reloc.h (relocate_for_relocatable): Add code to handle
1054 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1055 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
1056 arm_unaligned_reloc_r): New targets.
1057 * testsuite/Makefile.in: Regenerate.
1058 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
1059 linking.
1060
3f3cddf1
ILT
10612011-11-02 Ian Lance Taylor <iant@google.com>
1062
1063 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
1064 NATIVE_LINKER.
1065 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1066 * options.cc (General_options::finalize): Use library search path
1067 from configure script if specified. If not native and no sysroot,
1068 only search TOOLLIBDIR.
1069 * options.h (Search_directory::Search_directory): Change name to
1070 const std::string&.
1071 (General_options::add_to_library_path_with_sysroot): Change arg to
1072 const std::string&.
1073 * configure, Makefile.in, config.in: Rebuild.
1074
a8e2273b
ILT
10752011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1076
1077 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1078 we are working around the ARM1176 Erratum.
1079 * options.h (General_options::fix_arm1176): Add option.
1080 * testsuite/Makefile.am: Add testcases, and keep current ones
1081 working.
1082 * testsuite/Makefile.in: Regenerate.
1083 * testsuite/arm_fix_1176.s: New file.
1084 * testsuite/arm_fix_1176.sh: Likewise.
1085
cd6eab1c
ILT
10862011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1087
1088 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1089 may_use_blx_.
1090 (Target_arm::may_use_blx): Remove method.
1091 (Target_arm::set_may_use_blx): Likewise.
1092 (Target_arm::may_use_v4t_interworking): New method.
1093 (Target_arm::may_use_v5t_interworking): Likewise.
1094 (Target_arm::may_use_blx_): Remove member variable.
1095 (Arm_relocate_functions::arm_branch_common): Check for v5T
1096 interworking.
1097 (Arm_relocate_functions::thumb_branch_common): Likewise.
1098 (Reloc_stub::stub_type_for_reloc): Likewise.
1099 (Target_arm::do_finalize_sections): Correct interworking checks.
1100 * testsuite/Makefile.am: Add new tests.
1101 * testsuite/Makefile.in: Regenerate.
1102 * testsuite/arm_farcall_arm_arm.s: New test.
1103 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1104 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1105 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1106 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1107 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1108 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1109 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1110
286adcf4
CC
11112011-10-31 Cary Coutant <ccoutant@google.com>
1112
1113 PR gold/13023
1114 * expression.cc (Expression::eval_with_dot): Add
1115 is_section_dot_assignment parameter.
1116 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1117 absolute and assigning to dot within a section.
1118 * script-sections.cc
1119 (Output_section_element_assignment::set_section_addresses): Pass
1120 dot_section to set_if_absolute.
1121 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1122 as is_section_dot_assignment flag to eval_with_dot.
1123 (Output_section_element_dot_assignment::set_section_addresses):
1124 Likewise.
1125 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1126 parameter. Also set value if relative to dot_section; set the
1127 symbol's output_section.
1128 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1129 parameter. Adjust all callers.
1130 (Expression::eval_maybe_dot): Likewise.
1131 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1132 Adjust all callers.
1133 * testsuite/script_test_2.t: Test assignment of an absolute value
1134 to dot within an output section element.
1135
9634ed06
CC
11362011-10-31 Cary Coutant <ccoutant@google.com>
1137
1138 * options.h (class General_options): Add --[no-]gnu-unique options.
1139 * symtab.cc (Symbol_table::sized_write_globals): Convert
1140 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1141
de4101c7
CC
11422011-10-31 Cary Coutant <ccoutant@google.com>
1143
1144 PR gold/13359
1145 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1146 unnecessary assertion.
1147 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1148
7257cc92
ST
11492011-10-31 Sriraman Tallam <tmsriram@google.com>
1150
1151 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1152 gc_mark_symbol.
1153 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1154 gc_mark_symbol.
1155 Change to just keep the section associated with symbol.
1156 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1157 they are externally visible and --export-dynamic is turned on.
1158 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1159
bfc34b3f
ILT
11602011-10-19 Ian Lance Taylor <iant@google.com>
1161
1162 PR gold/13163
1163 * script-sections.cc
1164 (Output_section_element_dot_assignment::needs_output_section): New
1165 function.
1166
ea0d8c47
ILT
11672011-10-19 Ian Lance Taylor <iant@google.com>
1168
1169 PR gold/13204
1170 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1171 --section-start option was seen.
1172 * options.h (General_options::any_section_start): New function.
1173
abd242a9
DM
11742011-10-18 David S. Miller <davem@davemloft.net>
1175
1176 PR binutils/13301
1177 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1178 member to track relocation locations that have moved during TLS
1179 reloc optimizations.
1180 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1181 (Target_sparc::Relocate::relocate): Adjust view down by 4
1182 bytes if it matches reloc_adjust_addr_.
1183 (Target_sparc::Relocate::relocate_tls): Always move the
1184 __tls_get_addr call delay slot instruction forward 4 bytes when
1185 performing relaxation.
1186
bab9090f
CC
11872011-10-18 Cary Coutant <ccoutant@google.com>
1188
1189 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1190 (Output_file::map_no_anonymous): Check for non-zero
1191 return code from posix_fallocate.
1192
f7c5b166
CC
11932011-10-17 Cary Coutant <ccoutant@google.com>
1194
1195 PR gold/13245
1196 * plugin.cc (is_visible_from_outside): Check for symbols
1197 referenced from dynamic objects.
1198 * resolve.cc (Symbol_table::resolve): Don't count references
1199 from dynamic objects as references from real ELF files.
1200 * testsuite/plugin_test_2.sh: Adjust expected result.
1201
b490c0bb
CC
12022011-10-17 Cary Coutant <ccoutant@google.com>
1203
1204 * gold.cc: Include timer.h.
1205 (queue_middle_tasks): Stamp time.
1206 (queue_final_tasks): Likewise.
1207 * main.cc (main): Store timer in parameters. Print timers
1208 for each pass.
1209 * parameters.cc (Parameters::Parameters): Initialize timer_.
1210 (Parameters::set_timer): New function.
1211 (set_parameters_timer): New function.
1212 * parameters.h (Parameters::set_timer): New function.
1213 (Parameters::timer): New function.
1214 (Parameters::timer_): New data member.
1215 (set_parameters_timer): New function.
1216 * timer.cc (Timer::stamp): New function.
1217 (Timer::get_pass_time): New function.
1218 * timer.h (Timer::stamp): New function.
1219 (Timer::get_pass_time): New function.
1220 (Timer::pass_times_): New data member.
1221
f475cf7b
CC
12222011-10-17 Cary Coutant <ccoutant@google.com>
1223
1224 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1225 task for members of lib groups.
1226
cdd7e244
CC
12272011-10-17 Cary Coutant <ccoutant@google.com>
1228
1229 PR gold/13288
4f95c8b4 1230 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
1231 (File_read::make_view): Move bounds check (replace with assert)...
1232 (File_read::find_or_make_view): ... to here.
1233
dfb45471
CC
12342011-10-12 Cary Coutant <ccoutant@google.com>
1235
4f95c8b4 1236 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
1237 ::read returns less than requested size.
1238
53bbcc1b
CC
12392011-10-10 Cary Coutant <ccoutant@google.com>
1240
4f95c8b4 1241 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
1242 Initialize defined_count_.
1243 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1244 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1245 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1246 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1247 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 1248 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
1249 member.
1250 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 1251 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
1252 Return zeroes instead of internal error.
1253
397b129b
CC
12542011-10-10 Cary Coutant <ccoutant@google.com>
1255
1256 PR gold/13249
4f95c8b4 1257 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 1258 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 1259 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
1260 (Output_reloc::type_): Adjust size of bit field.
1261 (Output_reloc::use_plt_offset_): New bit field.
1262 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1263 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1264 flag. Adjust all callers.
4f95c8b4 1265 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
1266 creating RELATIVE relocations.
1267
d5698657
NC
12682011-10-10 Nick Clifton <nickc@redhat.com>
1269
1270 * po/es.po: Updated Spanish translation.
1271 * po/fi.po: Updated Finnish translation.
1272
6a59a5c2
DN
12732011-10-03 Diego Novillo <dnovillo@google.com>
1274
1275 * options.cc (parse_uint): Fix dereference of RETVAL.
1276
f0558624
ST
12772011-09-29 Sriraman Tallam <tmsriram@google.com>
1278
1279 * layout.h (section_order_map_): New member.
1280 (get_section_order_map): New member function.
1281 * output.cc (Output_section::add_input_section): Check for patterns
1282 only when --section-ordering-file is specified.
1283 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1284 output_sections have been formed.
1285 * layout.cc (Layout_Layout): Initialize section_order_map_.
1286 * plugin.cc (update_section_order): Store order in order_map. Do not
1287 update the order.
1288 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1289 * testsuite/Makefile.in: Regenerate.
1290 * testsuite/plugin_section_order.c: New file.
1291 * testsuite/plugin_final_layout.cc: New file.
1292 * testsuite/plugin_final_layout.sh: New file.
1293
a7dac153
CC
12942011-09-29 Cary Coutant <ccoutant@google.com>
1295
4f95c8b4 1296 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 1297 Check for NULL.
4f95c8b4 1298 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
1299 symbols during incremental update.
1300 (Symbol_table::add_from_dynobj): Likewise.
1301
eebd87a5
ILT
13022011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1303 Ian Lance Taylor <iant@google.com>
1304
1305 * symtab.cc (Symbol_table::define_special_symbol): Always
1306 canonicalize version string.
1307
403a3331
CC
13082011-09-26 Cary Coutant <ccoutant@google.com>
1309
4f95c8b4
CC
1310 * gold.cc (queue_initial_tasks): Move option checks ...
1311 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
1312 some options; make others fatal.
1313
235061c2
CC
13142011-09-26 Cary Coutant <ccoutant@google.com>
1315
1316 gcc PR lto/47247
1317 * plugin.cc (get_symbols_v2): New function.
1318 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1319 (is_referenced_from_outside): New function.
1320 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1321 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1322 (get_symbols): Pass version parameter.
1323 (get_symbols_v2): New function.
1324 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1325 parameter.
1326 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1327 (onload): Add LDPT_GET_SYMBOLS_V2.
1328 (all_symbols_read_hook): Use get_symbols_v2; check for
1329 LDPR_PREVAILING_DEF_IRONLY_EXP.
1330 * testsuite/plugin_test_3.sh: Update expected results.
1331
dc87f620
ILT
13322011-09-23 Simon Baldwin <simonb@google.com>
1333
1334 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1335 configuration options.
1336 * configure: Regenerate.
1337 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1338 * Makefile.in: Regenerate.
1339 * testsuite/Makefile.in: Regenerate.
1340
a8279f82
ST
13412011-09-19 Sriraman Tallam <tmsriram@google.com>
1342
1343 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1344
0c9350c8
CC
13452011-09-19 Cary Coutant <ccoutant@google.com>
1346
1347 * incremental.cc (can_incremental_update): Fix typo in comment.
1348 * incremental.h (can_incremental_update): Likewise.
1349
aa06ae28
CC
13502011-09-18 Cary Coutant <ccoutant@google.com>
1351
1352 * incremental.cc (can_incremental_update): New function.
1353 * incremental.h (can_incremental_update): New function.
1354 * layout.cc (Layout::init_fixed_output_section): Call it.
1355 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1356 * object.cc (Sized_relobj_file::do_layout): Call
1357 can_incremental_update.
1358
ebb300b2
CC
13592011-09-13 Cary Coutant <ccoutant@google.com>
1360
1361 * configure.ac: Check for glibc support for gnu_indirect_function
1362 support with static linking, setting automake conditional
1363 IFUNC_STATIC.
1364 * Makefile.in: Regenerate.
1365 * configure: Regenerate.
1366
1367 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1368 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1369 for IFUNC_STATIC.
1370 * testsuite/Makefile.in: Regenerate.
1371
1206d0d5
CC
13722011-09-13 Cary Coutant <ccoutant@google.com>
1373
1374 * incremental.cc (Sized_relobj_incr::do_layout): Call
1375 report_comdat_group for kept comdat sections.
1376 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1377 * testsuite/Makefile.in: Regenerate.
1378 * testsuite/incr_comdat_test_1.cc: New source file.
1379 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1380 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1381 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1382
40b29874
ILT
13832011-09-13 Ian Lance Taylor <iant@google.com>
1384
1385 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1386 variable external_symbols_offset.
1387
1b045aac
ILT
13882011-09-12 Ian Lance Taylor <iant@google.com>
1389
1390 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1391 triggered if object has no symbols.
1392
24c6c55a
DM
13932011-09-09 David S. Miller <davem@davemloft.net>
1394
1395 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1396 (Output_fill_debug_line::do_write): Likewise.
1397
66570254
CC
13982011-08-29 Cary Coutant <ccoutant@google.com>
1399
1400 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1401 casts to match formatting specs.
1402 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1403
8ea8cd50
CC
14042011-08-26 Cary Coutant <ccoutant@google.com>
1405
1406 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1407 remaining hole size when allocating.
1408 (Layout::make_output_section): Set fill methods for debug sections.
1409 * layout.h (Free_list::Free_list_node): Move from private to
1410 public.
1411 (Free_list::set_min_hole_size): New function.
1412 (Free_list::begin, Free_list::end): New functions.
1413 (Free_list::min_hole_): New data member.
1414 * output.cc: Include dwarf.h.
1415 (Output_fill_debug_info::do_minimum_hole_size): New function.
1416 (Output_fill_debug_info::do_write): New function.
1417 (Output_fill_debug_line::do_minimum_hole_size): New function.
1418 (Output_fill_debug_line::do_write): New function.
1419 (Output_section::Output_section): Initialize new data member.
1420 (Output_section::set_final_data_size): Ensure patch space is larger
1421 than minimum hole size.
1422 (Output_section::do_write): Fill holes in debug sections.
1423 * output.h (Output_fill): New class.
1424 (Output_fill_debug_info): New class.
1425 (Output_fill_debug_line): New class.
1426 (Output_section::set_free_space_fill): New function.
1427 (Output_section::free_space_fill_): New data member.
1428 * testsuite/Makefile.am (incremental_test_3): Add
1429 --incremental-patch option.
1430 (incremental_test_4): Likewise.
1431 (incremental_test_5): Likewise.
1432 (incremental_test_6): Likewise.
1433 (incremental_copy_test): Likewise.
1434 (incremental_common_test_1): Likewise.
1435 * testsuite/Makefile.in: Regenerate.
1436
7cf80422
NC
14372011-08-26 Nick Clifton <nickc@redhat.com>
1438
1439 * po/es.po: Updated Spanish translation.
1440
c3f7b0e5
CC
14412011-08-01 Cary Coutant <ccoutant@google.com>
1442
1443 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1444 * gold/testsuite/Makefile.in: Regenerate.
1445 * gold/testsuite/justsyms_exec.c: New source file.
1446 * gold/testsuite/justsyms_lib.c: New source file.
1447
9590bf25
CC
14482011-08-01 Cary Coutant <ccoutant@google.com>
1449
1450 * layout.cc (Layout::set_segment_offsets): Don't realign text
1451 segment if -Ttext was specified.
1452 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1453 file type.
1454 * object.h (Sized_relobj_file::e_type): New function.
1455 (Sized_relobj_file::e_type_): New data member.
1456 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1457 base address for ET_EXEC files.
1458 * target.cc (Target::do_make_elf_object_implementation): Allow
1459 ET_EXEC files with --just-symbols option.
1460
dcd8d12e
CC
14612011-07-28 Cary Coutant <ccoutant@google.com>
1462
1463 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1464 Add thread_number parameter.
1465 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1466 * workqueue-threads.cc
1467 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1468 current thread if its thread number is greater than desired thread
1469 count.
1470 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1471 Add thread_number parameter.
1472 (Workqueue::should_cancel_thread): Likewise.
1473 (Workqueue::find_runnable_or_wait): Pass thread_number to
1474 should_cancel_thread.
1475 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1476 parameter.
1477
804eb480
ST
14782011-07-22 Sriraman Tallam <tmsriram@google.com>
1479
1480 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1481 only after checking if it cannot be forced local.
1482 * symtab.h (is_externally_visible): Check if the symbol is not forced
1483 local.
1484
f1ddb600
ILT
14852011-07-15 Ian Lance Taylor <iant@google.com>
1486
1487 * options.h (class General_options): Add --print-output-format.
1488 Move -EL next to -EB, for better --help output.
1489 * target-select.cc: Include <cstdio>, "options.h", and
1490 "parameters.h".
1491 (Target_selector::do_target_bfd_name): New function.
1492 (print_output_format): New function.
1493 * target-select.h (class Target_selector): Update declarations.
1494 (Target_selector::target_bfd_name): New function.
1495 (print_output_format): Declare.
1496 * main.cc: Include "target-select.h".
1497 (main): Handle --print-output-format.
1498 * gold.cc: Include "target-select.h".
1499 (queue_initial_tasks): Handle --print-output-format when there are
1500 no input files.
1501 * parameters.cc (parameters_force_valid_target): Give a better
1502 error message if -EB/-EL does not match target.
1503 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1504 function.
1505
7d172687
ILT
15062011-07-15 Ian Lance Taylor <iant@google.com>
1507
1508 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1509 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1510 (Output_data_plt_i386::do_write): Write address of .dynamic
1511 section to first entry in .got.plt section.
1512 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1513 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1514 Initialize layout_.
1515 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1516 section to first entry in .got.plt section.
1517 * layout.h (Layout::dynamic_section): New function.
1518
e9552f7e
ST
15192011-07-13 Sriraman Tallam <tmsriram@google.com>
1520
1521 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1522 to claim_file call.
1523 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1524 input_section_position_, and input_section_glob_.
1525 (read_layout_from_file): Call function section_ordering_specified.
1526 * layout.h (is_section_ordering_specified): New function.
1527 (section_ordering_specified): New function.
1528 (section_ordering_specified_): New boolean member.
1529 * main.cc(main): Call load_plugins after layout object is defined.
1530 * output.cc (Output_section::add_input_section): Use
1531 function section_ordering_specified to check if section ordering is
1532 needed.
1533 * output.cc (Output_section::add_relaxed_input_section): Use
1534 function section_ordering_specified to check if section ordering is
1535 needed.
1536 (Output_section::update_section_layout): New function.
1537 (Output_section::sort_attached_input_sections): Check if input section
1538 must be reordered.
1539 * output.h (Output_section::update_section_layout): New function.
1540 * plugin.cc (get_section_count): New function.
1541 (get_section_type): New function.
1542 (get_section_name): New function.
1543 (get_section_contents): New function.
1544 (update_section_order): New function.
58797674 1545 (allow_section_ordering): New function.
e9552f7e
ST
1546 (Plugin::load): Add the new interfaces to the transfer vector.
1547 (Plugin_manager::load_plugins): New parameter.
1548 (Plugin_manager::all_symbols_read): New parameter.
1549 (Plugin_manager::claim_file): New parameter. Save the elf object for
1550 unclaimed objects.
1551 (Plugin_manager::get_elf_object): New function.
1552 (Plugin_manager::get_view): Change to directly use the bool to check
1553 if get_view is called from claim_file_hook.
1554 * plugin.h (input_objects): New function
1555 (Plugin__manager::load_plugins): New parameter.
1556 (Plugin_manager::claim_file): New parameter.
1557 (Plugin_manager::get_elf_object): New function.
1558 (Plugin_manager::in_claim_file_handler): New function.
1559 (Plugin_manager::in_claim_file_handler_): New member.
1560 (layout): New function.
1561 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1562 handler with an extra parameter. Make the elf object before calling
1563 claim_file handler.
1564 * testsuite/plugin_test.c (get_section_count): New function pointer.
1565 (get_section_type): New function pointer.
1566 (get_section_name): New function pointer.
1567 (get_section_contents): New function pointer.
1568 (update_section_order): New function pointer.
1569 (allow_section_ordering): New function pointer.
1570 (onload): Check if the new interfaces exist.
1571
9446efde
ILT
15722011-07-13 Ian Lance Taylor <iant@google.com>
1573
1574 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1575 relro section.
1576 * x86_64.cc (Target_x86_64::got_section): Likewise.
1577 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1578 (relro_now_test_SOURCES): New variable.
1579 (relro_now_test_DEPENDENCIES): New variable.
1580 (relro_now_test_LDFLAGS): New variable.
1581 (relro_now_test_LDADD): New variable.
1582 (relro_now_test.so): New target.
1583 * testsuite/Makefile.in: Rebuild.
1584
07aa62f2
ILT
15852011-07-12 Ian Lance Taylor <iant@google.com>
1586
1587 PR gold/12980
1588 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1589 GLOB_DAT relocation rather than a RELATIVE relocation for a
1590 protected symbol when creating a shared library.
1591 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1592 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1593 * testsuite/protected_main_1.cc (main): Test that protected
1594 function has same address.
1595
e2153196
ILT
15962011-07-11 Ian Lance Taylor <iant@google.com>
1597
1598 PR gold/12979
1599 * options.h (class General_options): Add -Bgroup.
1600 * options.cc (General_options::finalize): If -Bgroup is set,
1601 default to --unresolved-symbols=report-all.
1602 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1603 * target-reloc.h (issue_undefined_symbol_error): Handle
1604 --unresolved-symbols=report-all.
1605
6daf5215
ILT
16062011-07-08 Ian Lance Taylor <iant@google.com>
1607
1608 PR gold/11985
1609 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1610 if linker script discards key sections.
1611 (Layout::create_dynamic_symtab): Likewise.
1612 (Layout::assign_local_dynsym_offsets): Likewise.
1613 (Layout::sized_create_version_sections): Likewise.
1614 (Layout::create_interp): Likewise.
1615 (Layout::finish_dynamic_section): Likewise.
1616 (Layout::set_dynamic_symbol_size): Likewise.
1617
beabb2c6
ILT
16182011-07-08 Ian Lance Taylor <iant@google.com>
1619
1620 PR gold/12386
1621 * options.h (class General_options): Add --unresolved-symbols.
1622 * target-reloc.h (issue_undefined_symbol_error): Check
1623 --unresolved-symbols. Add comments.
1624
9c16daf1
ILT
16252011-07-08 Ian Lance Taylor <iant@google.com>
1626
1627 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1628 expression more complex.
1629
191f1a2d
ILT
16302011-07-08 Ian Lance Taylor <iant@google.com>
1631
1632 PR gold/11317
1633 * target-reloc.h (issue_undefined_symbol_error): New inline
1634 function, broken out of relocate_section.
1635 (relocate_section): Call issue_undefined_symbol_error.
1636 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1637 there is no TLS segment if we are about to issue an undefined
1638 symbol error.
1639 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1640
62855347
ILT
16412011-07-08 Ian Lance Taylor <iant@google.com>
1642
1643 PR gold/12279
1644 * resolve.cc (Symbol_table::should_override): Add fromtype
1645 parameter. Change all callers. Give error when linking together
1646 TLS and non-TLS symbol.
1647 (Symbol_table::should_override_with_special): Add fromtype
1648 parameter. Change all callers.
1649 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1650 there is no TLS segment if we have reported some errors.
1651 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1652
67181c72
ILT
16532011-07-08 Ian Lance Taylor <iant@google.com>
1654
1655 PR gold/12372
1656 * target.h (Target::plt_address_for_global): New function.
1657 (Target::plt_address_for_local): New function.
1658 (Target::plt_section_for_global): Remove.
1659 (Target::plt_section_for_local): Remove.
1660 (Target::do_plt_address_for_global): New virtual function.
1661 (Target::do_plt_address_for_local): New virtual function.
1662 (Target::do_plt_section_for_global): Remove.
1663 (Target::do_plt_section_for_local): Remove.
1664 (Target::register_global_plt_entry): Add Symbol_table and Layout
1665 parameters.
1666 * output.cc (Output_data_got::Got_entry::write): Use
1667 plt_address_for_global and plt_address_for_local.
1668 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1669 address of output section.
1670 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1671 got_irelative_, and irelative_count_ fields. Update
1672 declarations.
1673 (Output_data_plt_i386::has_irelative_section): New function.
1674 (Output_data_plt_i386::entry_count): Add irelative_count_.
1675 (Output_data_plt_i386::set_final_data_size): Likewise.
1676 (class Target_i386): Add got_irelative_ and rel_irelative_
1677 fields. Update declarations.
1678 (Target_i386::Target_i386): Initialize new fields.
1679 (Target_i386::do_plt_address_for_global): New function replacing
1680 do_plt_section_for_global.
1681 (Target_i386::do_plt_address_for_local): New function replacing
1682 do_plt_section_for_local.
1683 (Target_i386::got_section): Create got_irelative_.
1684 (Target_i386::rel_irelative_section): New function.
1685 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1686 fields. Don't define __rel_iplt_{start,end}.
1687 (Output_data_plt_i386::add_entry): Add symtab and layout
1688 parameters. Change all callers. Use different PLT and GOT for
1689 IFUNC symbols.
1690 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1691 layout parameters. Change all callers. Use different PLT and
1692 GOT.
1693 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1694 (Output_data_plt_i386::rel_irelative): New function.
1695 (Output_data_plt_i386::address_for_global): New function.
1696 (Output_data_plt_i386::address_for_local): New function.
1697 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1698 IRELATIVE GOT when changing IFUNC GOT entries.
1699 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1700 reloc.
1701 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1702 if we didn't create an IRELATIVE GOT.
1703 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1704 plt_address_for_local.
1705 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1706 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1707 got_irelative_, and irelative_count_ fields. Update
1708 declarations.
1709 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1710 Initialize new fields. Remove symtab parameter. Change all
1711 callers.
1712 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1713 irelative_count_.
1714 (Output_data_plt_x86_64::has_irelative_section): New function.
1715 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1716 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1717 fields. Update declarations.
1718 (Target_x86_64::Target_x86_64): Initialize new fields.
1719 (Target_x86_64::do_plt_address_for_global): New function replacing
1720 do_plt_section_for_global.
1721 (Target_x86_64::do_plt_address_for_local): New function replacing
1722 do_plt_section_for_local.
1723 (Target_x86_64::got_section): Create got_irelative_.
1724 (Target_x86_64::rela_irelative_section): New function.
1725 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1726 all callers. Don't create __rel_iplt_{start,end}.
1727 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1728 parameters. Change all callers. Use different PLT and GOT for
1729 IFUNC symbols.
1730 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1731 layout parameters. Change all callers. Use different PLT and
1732 GOT.
1733 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1734 parameters. Change all callers. Use different PLT and GOT for
1735 IFUNC symbols.
1736 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1737 (Output_data_plt_x86_64::rela_irelative): New function.
1738 (Output_data_plt_x86_64::address_for_global): New function.
1739 (Output_data_plt_x86_64::address_for_local): New function.
1740 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1741 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1742 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1743 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1744 parameters.
1745 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1746 reloc.
1747 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1748 symbols if we didn't create an IRELATIVE GOT.
1749 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1750 plt_address_for_local.
1751 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1752 * testsuite/ifuncvar1.c: New test file.
1753 * testsuite/ifuncvar2.c: New test file.
1754 * testsuite/ifuncvar3.c: New test file.
1755 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1756 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1757 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1758 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1759 * testsuite/Makefile.in: Rebuild.
1760
33c15b45
CC
17612011-07-07 Cary Coutant <ccoutant@google.com>
1762
1763 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1764 (two_file_test_1_ndebug.o): Likewise.
1765 (two_file_test_1b_ndebug.o): Likewise.
1766 (two_file_test_2_ndebug.o): Likewise.
1767 (two_file_test_main_ndebug.o): Likewise.
1768 (incremental_test_2): Link with no-debug versions.
1769
f48b5fb7
CC
17702011-07-06 Cary Coutant <ccoutant@google.com>
1771
1772 * gold/incremental.cc
1773 (Output_section_incremental_inputs::write_info_blocks): Check for
1774 hidden and internal symbols.
1775
221597a5
CC
17762011-07-06 Cary Coutant <ccoutant@google.com>
1777
1778 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1779 Check disposition for startup file.
1780 (Incremental_inputs::report_command_line): Ignore
1781 --incremental-startup-unchanged option.
1782 * options.cc (General_options::parse_incremental_startup_unchanged):
1783 New function.
1784 (General_options::General_options): Initialize new data member.
1785 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1786 (General_options): Add --incremental-startup-unchanged option.
1787 (General_options::incremental_startup_disposition): New function.
1788 (General_options::incremental_startup_disposition_): New data member.
1789
e24719f6
CC
17902011-07-06 Cary Coutant <ccoutant@google.com>
1791
1792 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1793 input file index to Script_info ctor.
1794 (Sized_incremental_binary::do_file_has_changed): Find the
1795 command-line argument for files named in scripts.
1796 * incremental.h (Script_info::Script_info): New ctor
1797 with input file index.
1798 (Script_info::input_file_index): New function.
1799 (Script_info::input_file_index_): New data member.
1800 (Incremental_binary::get_library): Add const.
1801 (Incremental_binary::get_script_info): Add const.
1802 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1803 * testsuite/Makefile.am (incremental_test_5): New test case.
1804 (incremental_test_6): New test case.
1805 * testsuite/Makefile.in: Regenerate.
1806
8f7c81e8
CC
18072011-07-06 Cary Coutant <ccoutant@google.com>
1808
1809 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1810 debug output when command lines differ.
1811
9fbd3822
CC
18122011-07-06 Cary Coutant <ccoutant@google.com>
1813
1814 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1815 --incremental-patch option.
1816 * layout.cc (Free_list::allocate): Extend allocation beyond original
1817 end if enabled.
1818 (Layout::make_output_section): Mark sections that should get
1819 patch space.
1820 * options.cc (parse_percent): New function.
1821 * options.h (parse_percent): New function.
1822 (DEFINE_percent): New macro.
1823 (General_options): Add --incremental-patch option.
1824 * output.cc (Output_section::Output_section): Initialize new data
1825 members.
1826 (Output_section::add_input_section): Print section name when out
1827 of patch space.
1828 (Output_section::add_output_section_data): Likewise.
1829 (Output_section::set_final_data_size): Add patch space when
1830 doing --incremental-full.
1831 (Output_section::do_reset_address_and_file_offset): Remove patch
1832 space.
1833 (Output_segment::set_section_list_addresses): Print debug output
1834 only if --incremental-update.
1835 * output.h (Output_section::set_is_patch_space_allowed): New function.
1836 (Output_section::is_patch_space_allowed_): New data member.
1837 (Output_section::patch_space_): New data member.
1838 * parameters.cc (Parameters::incremental_full): New function.
1839 * parameters.h (Parameters::incremental_full): New function
1840 * testsuite/Makefile.am (incremental_test_2): Add test for
1841 --incremental-patch option.
1842 * testsuite/Makefile.in: Regenerate.
1843 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1844 (t18): Remove function body.
1845
f6cccc2c
DK
18462011-07-05 Doug Kwan <dougkwan@google.com>
1847
1848 PR gold/12771
1849 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1850 Arm_Address type for relocation result.
1851 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1852 overflow check.
1853 (Arm_relocate_functions::abs32): Use unaligned access.
1854 (Arm_relocate_functions::rel32): Ditto.
1855 (Arm_relocate_functions::prel31): Ditto.
1856 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1857 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1858 static data relocations.
1859 * testsuite/Makefile.in: Regnerate.
1860 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1861
28a13fec
ILT
18622011-07-05 Ian Lance Taylor <iant@google.com>
1863
1864 PR gold/12392
1865 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1866 symbols if necessary.
1867 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1868
24d47b34
ILT
18692011-07-05 Ian Lance Taylor <iant@google.com>
1870
1871 PR gold/12952
1872 * resolve.cc (Symbol::override_base_with_special): Simply override
1873 version with special symbol version, ignoring previous version.
1874
41f9cbbe
ILT
18752011-07-05 Ian Lance Taylor <iant@google.com>
1876
1877 * object.cc (Sized_relobj_file::include_section_group): Add
1878 information to comment about signature location.
1879
886288f1
ILT
18802011-07-02 Ian Lance Taylor <iant@google.com>
1881
1882 PR gold/12957
1883 * options.h (class General_options): Add -f and -F.
1884 * options.cc (General_options::finalize): Fatal error if -f/-F
1885 are used without -shared.
1886 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1887
ae3a6d4f
ILT
18882011-07-02 Ian Lance Taylor <iant@google.com>
1889
1890 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1891
21131061
ILT
18922011-07-01 Ian Lance Taylor <iant@google.com>
1893
1894 PR gold/12525
1895 PR gold/12952
1896 * resolve.cc (Symbol::override_base_with_special): Don't override
1897 the version if the overriding symbol has a different name.
1898 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1899 all callers. If we give an error about an undefined version,
1900 define the base version if necessary.
1901 * dynobj.h (class Versions): Update declaration.
1902 * testsuite/weak_alias_test_5.cc: New file.
1903 * testsuite/weak_alias_test.script: New file.
1904 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1905 and versioned_alias have the right value, and call t2.
1906 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1907 weak_alias_test_5.so.
1908 (weak_alias_test_LDADD): Likewise.
1909 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1910 * testsuite/Makefile.in: Rebuild.
1911
611062c0
ILT
19122011-07-01 Ian Lance Taylor <iant@google.com>
1913
1914 PR gold/12525
1915 * options.h (class General_options): Support -z notext.
1916 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1917 -Wl,-z,notext.
1918 (two_file_shared_nonpic.so): Likewise.
1919 (two_file_shared_mixed.so): Likewise.
1920 (two_file_shared_mixed_1.so): Likewise.
1921 (weak_undef_lib_nonpic.so): Likewise.
1922 (alt/weak_undef_lib_nonpic.so): Likewise.
1923 (tls_test_shared_nonpic.so): Likewise.
1924 * testsuite/Makefile.in: Rebuild.
1925
328c7c2f
ILT
19262011-07-01 Ian Lance Taylor <iant@google.com>
1927
1928 PR gold/12525
1929 * configure.ac: Test whether static linking works, setting
1930 the automake conditional HAVE_STATIC.
1931 * testsuite/Makefile.am: Disable tests using -static if
1932 HAVE_STATIC is not true.
1933 * configure, testsuite/Makefile.in: Rebuild.
1934
02d7cd44
ILT
19352011-07-01 Ian Lance Taylor <iant@google.com>
1936
1937 PR gold/12525
1938 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1939 Assert if we see DW_EH_PE_indirect.
1940 * target.h (Target::ehframe_datarel_base): New function.
1941 (Target::do_ehframe_datarel_base): New target function.
1942 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1943 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1944 function.
1945
07a60597
ILT
19462011-07-01 Ian Lance Taylor <iant@google.com>
1947
1948 PR gold/12571
1949 * options.h (class General_options): Add
1950 --ld-generated-unwind-info.
1951 * ehframe.cc (Fde::write): Add address parameter. Change all
1952 callers. If associated with PLT, fill in address and size.
1953 (Cie::set_output_offset): Only add merge mapping if there is an
1954 object.
1955 (Cie::write): Add address parameter. Change all callers.
1956 (Eh_frame::add_ehframe_for_plt): New function.
1957 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1958 input_offset_ fields into union u_, with new plt field.
1959 (Fde::Fde): Adjust for new union field.
1960 (Fde::Fde) [Output_data version]: New constructor.
1961 (Fde::add_mapping): Only add merge mapping if there is an object.
1962 (class Cie): Update declarations.
1963 (class Eh_frame): Declare add_ehframe_for_plt.
1964 * layout.cc (Layout::layout_eh_frame): Break out code into
1965 make_eh_frame_section, and call it.
1966 (Layout::make_eh_frame_section): New function.
1967 (Layout::add_eh_frame_for_plt): New function.
1968 * layout.h (class Layout): Update declarations.
1969 * merge.cc (Merge_map::add_mapping): Add assertion.
1970 * i386.cc: Include "dwarf.h".
1971 (class Output_data_plt_i386): Make first_plt_entry,
1972 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1973 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1974 and plt_eh_frame_fde.
1975 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1976 boundary. Call add_eh_frame_for_plt if appropriate.
1977 * x86_64.cc: Include "dwarf.h".
1978 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1979 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1980 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1981 and plt_eh_frame_fde.
1982 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1983 appropriate.
1984
14788a3f
ILT
19852011-06-29 Ian Lance Taylor <iant@google.com>
1986
1987 PR gold/12629
1988 * object.cc (Sized_relobj_file::layout_section): Change shdr
1989 parameter to be const.
1990 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1991 out of do_layout.
1992 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1993 appropriate. Call layout_eh_frame_section.
1994 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1995 sections.
1996 * object.h (class Sized_relobj_file): Update declarations.
1997
6c21fce1
ILT
19982011-06-29 Ian Lance Taylor <iant@google.com>
1999
37e41b03 2000 PR gold/12652
6c21fce1
ILT
2001 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2002 modifier.
2003 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2004
4d5e4e62
ILT
20052011-06-29 Ian Lance Taylor <iant@google.com>
2006
2007 PR gold/12675
2008 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2009 SHT_X86_64_UNWIND.
2010 * layout.cc (Layout::layout_eh_frame): Likewise.
2011
886f533a
ILT
20122011-06-29 Ian Lance Taylor <iant@google.com>
2013
2014 PR gold/12695
2015 * layout.cc (Layout::symtab_section_shndx): New function.
2016 * layout.h (class Layout): Declare symtab_section_shndx.
2017 * output.cc (Output_section::write_header): Call it.
2018
f3ae1b28
ILT
20192011-06-29 Ian Lance Taylor <iant@google.com>
2020
2021 PR gold/12818
2022 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
2023 symbols which are not used in a relocation.
2024
aecf301f
ILT
20252011-06-28 Ian Lance Taylor <iant@google.com>
2026
2027 PR gold/12898
2028 * layout.cc (Layout::segment_precedes): Don't crash if a linker
2029 script create indistinguishable segments.
2030 (Layout::set_segment_offsets): Use stable_sort when sorting
2031 segments. Pass this to Compare_segments constructor.
2032 * layout.h (class Layout): Make segment_precedes non-static.
2033 (class Compare_segments): Change from struct to class. Add
2034 layout_ field. Add constructor.
2035 * script-sections.cc
2036 (Script_sections::attach_sections_using_phdrs_clause): Rename
2037 local orphan to is_orphan. Don't report failure to put empty
2038 section in segment. On attachment failure, report name of
2039 section, and attach to first PT_LOAD segment.
2040
03ef7571
ILT
20412011-06-28 Ian Lance Taylor <iant@google.com>
2042
2043 PR gold/12934
2044 * target-select.cc (Target_selector::Target_selector): Add
2045 emulation parameter. Change all callers.
2046 (select_target_by_bfd_name): Rename from select_target_by_name.
2047 Change all callers.
2048 (select_target_by_emulation): New function.
2049 (supported_emulation_names): New function.
2050 * target-select.h (class Target_selector): Add emulation_ field.
2051 Update declarations.
2052 (Target_selector::recognize_by_bfd_name): Rename from
2053 recognize_by_name. Change all callers.
2054 (Target_selector::supported_bfd_names): Rename from
2055 supported_names. Change all callers.
2056 (Target_selector::recognize_by_emulation): New function.
2057 (Target_selector::supported_emulations): New function.
2058 (Target_selector::emulation): New function.
2059 (Target_selector::do_recognize_by_bfd_name): Rename from
2060 do_recognize_by_name. Change all callers.
2061 (Target_selector::do_supported_bfd_names): Rename from
2062 do_supported_names. Change all callers.
2063 (Target_selector::do_recognize_by_emulation): New function.
2064 (Target_selector::do_supported_emulations): New function.
2065 (select_target_by_bfd_name): Change name in declaration.
2066 (select_target_by_emulation): Declare.
2067 (supported_emulation_names): Declare.
2068 * parameters.cc (parameters_force_valid_target): Try to find
2069 target based on emulation from -m option.
2070 * options.h (class General_options): Change doc string for -m.
2071 * options.cc (help): Print emulations.
2072 (General_options::parse_V): Likewise.
2073 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2074 Add emulation parameter. Change all callers.
2075
200b2bb9
ILT
20762011-06-28 Ian Lance Taylor <iant@google.com>
2077
2078 * target.h (class Target): Add osabi_ field.
2079 (Target::osabi): New function.
2080 (Target::set_osabi): New function.
2081 (Target::Target): Initialize osabi_.
2082 (Target::do_adjust_elf_header): Make pure virtual.
2083 (Sized_target::do_adjust_elf_header): Declare.
2084 * target.cc (Sized_target::do_adjust_elf_header): New function.
2085 (class Sized_target): Instantiate all versions.
2086 * freebsd.h (class Target_freebsd): Remove.
2087 (Target_selector_freebsd::do_recognize): Call set_osabi on
2088 Target.
2089 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2090 (Target_selector_freebsd::set_osabi): Remove.
2091 * i386.cc (class Target_i386): Inherit from Sized_target rather
2092 than Target_freebsd.
2093 * x86_64.cc (class Target_x86_64): Likewise.
2094
b3ce541e
ILT
20952011-06-28 Ian Lance Taylor <iant@google.com>
2096
2097 * target.h (Target::can_check_for_function_pointers): Rewrite.
2098 Make non-virtual.
2099 (Target::can_icf_inline_merge_sections): Likewise.
2100 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2101 (Target::Target_info): Add can_icf_inline_merge_sections field.
2102 (Target::do_can_check_for_function_pointers): New virtual
2103 function.
2104 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2105 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2106 from can_check_for_function_pointers, move in file.
2107 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2108 section_may_have_icf_unsafe_poineters, move in file.
2109 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2110 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2111 Rename from can_check_for_function_pointers, move in file.
2112 (Target_i386::can_icf_inline_merge_sections): Remove.
2113 (Target_i386::i386_info): Initialize
2114 can_icf_inline_merge_sections.
2115 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2116 Initialize can_icf_inline_merge_sections.
2117 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2118 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2119 Rename from can_check_for_function_pointers, move in file.
2120 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2121 (Target_x86_64::x86_64_info): Initialize
2122 can_icf_inline_merge_sections.
2123 * testsuite/testfile.cc (Target_test::test_target_info):
2124 Likewise.
2125 * icf.cc (get_section_contents): Correct formatting.
2126
6d1c4efb
ILT
21272011-06-27 Ian Lance Taylor <iant@google.com>
2128
2129 * symtab.cc (Symbol::versioned_name): New function.
2130 (Symbol_table::add_to_final_symtab): Use versioned_name when
2131 appropriate.
2132 (Symbol_table::sized_write_symbol): Likewise.
2133 * symtab.h (class Symbol): Declare versioned_name.
2134 * stringpool.h (class Stringpool_template): Add variant of add
2135 which takes a std::basic_string.
2136 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2137 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2138 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2139 (ver_test_12.o): New target.
2140 * testsuite/Makefile.in: Rebuild.
2141
57eb9b50
DK
21422011-06-27 Doug Kwan <dougkwan@google.com>
2143
2144 * arm.cc (Arm_relocate_functions::thm_jump8,
2145 Arm_relocate_functions::thm_jump11): Use a wider signed
2146 type to compute offset.
2147 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2148 arm_thm_jump8.
2149 * testsuite/Makefile.in: Regenerate.
2150 * testsuite/arm_branch_in_range.sh: Check test results of
2151 arm_thm_jump11 and arm_thm_jump8.
2152 * testsuite/arm_thm_jump11.s: New test source file.
2153 * testsuite/arm_thm_jump11.t: New linker script.
2154 * testsuite/arm_thm_jump8.s: New test source file.
2155 * testsuite/arm_thm_jump8.t: New linker script.
2156
487b39df
ILT
21572011-06-24 Ian Lance Taylor <iant@google.com>
2158
2159 * layout.cc: Include "object.h".
2160 (ctors_sections_in_init_array): New static variable.
2161 (Layout::is_ctors_in_init_array): New function.
2162 (Layout::layout): Add entry to ctors_sections_in_init_array if
2163 appropriate.
2164 * layout.h (class Layout): Declare is_ctors_in_init_array.
2165 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2166 is_ctors_reverse_view is set.
2167 (Sized_relobj_file::write_sections): Add layout parameter. Change
2168 all callers. Set is_ctors_reverse_view field of View_size.
2169 (Sized_relobj_file::reverse_words): New function.
2170 * object.h (Sized_relobj_file::View_size): Add
2171 is_ctors_reverse_view field.
2172 (class Sized_relobj_file): Update declarations.
2173 * testsuite/initpri3.c: New test.
2174 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2175 initpri3b.
2176 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2177 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2178 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2179 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2180 * testsuite/Makefile.in: Rebuild.
2181
472076e4
CC
21822011-06-24 Cary Coutant <ccoutant@google.com>
2183
2184 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2185 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2186 (debug_msg_cdebug.err): New targets.
2187 * testsuite/Makefile.in: Regenerate.
2188 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2189 Fix checks for link with shared library.
2190
a60af0db
DK
21912011-06-24 Doug Kwan <dougkwan@google.com>
2192
2193 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2194 skip empty text sections.
2195 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2196
5393d741
ILT
21972011-06-22 Ian Lance Taylor <iant@google.com>
2198
2199 PR gold/12910
2200 * options.h (class General_options): Add --ctors-in-init-array.
2201 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2202 friends as SHT_PROGBITS for merging sections.
2203 (Layout::layout): Remove special handling of .init_array and
2204 friends. Don't sort if doing relocatable link. Sort for .ctors
2205 and .dtors if ctors_in_init_array.
2206 (Layout::make_output_section): Force correct section types for
2207 .init_array and friends. Don't sort if doing relocatable link,
2208 Don't sort .ctors and .dtors if ctors_in_init_array.
2209 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2210 (Layout::output_section_name): Add relobj parameter. Change all
2211 callers. Handle .ctors. and .dtors. in code rather than table.
2212 Handle .ctors and .dtors if ctors_in_init_array.
2213 (Layout::match_file_name): New function, moved from output.cc.
2214 * layout.h (class Layout): Update declarations.
2215 * output.cc: Include "layout.h".
2216 (Input_section_sort_entry::get_priority): New function.
2217 (Input_section_sort_entry::match_file_name): Just call
2218 Layout::match_file_name.
2219 (Output_section::Input_section_sort_init_fini_compare::operator()):
2220 Handle .ctors and .dtors. Sort by explicit priority rather than
2221 by name.
2222 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2223 * testsuite/initpri2.c: New test.
2224 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2225 (check_PROGRAMS): Add initpri2.
2226 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2227 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2228 * configure, testsuite/Makefile.in: Rebuild.
2229
e1f74f98
ILT
22302011-06-19 Ian Lance Taylor <iant@google.com>
2231
2232 PR gold/12880
2233 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2234 .interp section to a PT_INTERP segment even if we have seen a
2235 --dynamic-linker option. Don't do it if we have seen a PHDRS
2236 clause in a linker script.
2237 (Layout::finalize): Don't create a .interp section if we've
2238 already create a PT_INTERP segment.
2239 (Layout::create_interp): Always call choose_output_section (revert
2240 patch of 2011-06-17). Don't create PT_INTERP segment.
2241 * script-sections.cc
2242 (Script_sections::create_note_and_tls_segments): Add a .interp
2243 section to a PT_INTERP segment even if we have seen a
2244 --dynamic-linker option.
2245
766f91bb
ILT
22462011-06-18 Ian Lance Taylor <iant@google.com>
2247
2248 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2249 merely because a non-PT_LOAD segment has a dynamic reloc.
2250
0d212c3a
ILT
22512011-06-18 Ian Lance Taylor <iant@google.com>
2252
2253 * layout.cc (Layout::finish_dynamic_section): Don't create
2254 DT_FLAGS entry if not needed.
2255
911a5072
ILT
22562011-06-18 Ian Lance Taylor <iant@google.com>
2257
2258 PR gold/12745
2259 * layout.cc (Layout::layout_eh_frame): Correct handling of
2260 writable .eh_frame section.
2261
534b4e5f
ILT
22622011-06-17 Ian Lance Taylor <iant@google.com>
2263
2264 PR gold/12893
2265 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2266 symbol is redefined with the exact same object and value.
2267
10b4f102
ILT
22682011-06-17 Ian Lance Taylor <iant@google.com>
2269
2270 PR gold/12880
2271 * layout.h (class Layout): Add interp_segment_ field.
2272 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2273 (Layout::attach_allocated_section_to_segment): If making shared
2274 library, put .interp section in PT_INTERP segment.
2275 (Layout::finalize): Also call create_interp if -dynamic-linker
2276 option was used.
2277 (Layout::create_interp): Assert that there is no PT_INTERP
2278 segment. If not using a SECTIONS clause, use make_output_section.
2279 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2280 * script-sections.cc
2281 (Script_sections::create_note_and_tls_segments): If making shared
2282 library, put .interp section in PT_INTERP segment.
2283
a29b0dad
ILT
22842011-06-17 Ian Lance Taylor <iant@google.com>
2285
e588ea8d
ILT
2286 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2287 when making a shared library.
2288
22892011-06-17 Ian Lance Taylor <iant@google.com>
2290
2291 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2292 parameter. Change all callers. Don't issue warning about PC32
2293 against locally defined symbol.
a29b0dad 2294
9d3b0698
ILT
22952011-06-16 Ian Lance Taylor <iant@google.com>
2296
2297 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2298 occurs in same object.
2299
85b0f90c
AM
23002011-06-14 Alan Modra <amodra@gmail.com>
2301
2302 * po/POTFILES.in: Regenerate.
2303
a94907d9
ILT
23042011-06-09 Ian Lance Taylor <iant@google.com>
2305
2306 * script-sections.cc
2307 (Orphan_output_section::set_section_addresses): For a relocatable
2308 link set address to 0.
2309
4fb3a1c3
CC
23102011-06-09 Cary Coutant <ccoutant@google.com>
2311
2312 PR gold/12804
2313 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2314 used with --compress-debug-sections.
2315 * gold/object.cc (Sized_relobj_file::do_layout): Report
2316 uncompressed size of compressed input sections.
2317
61220854
CC
23182011-06-08 Cary Coutant <ccoutant@google.com>
2319
2320 PR gold/12804
2321 * testsuite/two_file_test_2_v1.cc: Change initialization of
2322 v2 to keep it in .data.
2323
e6455dfb
CC
23242011-06-07 Cary Coutant <ccoutant@google.com>
2325
2326 * common.cc (Symbol_table::do_allocate_commons_list): Call
2327 gold_fallback.
2328 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2329 (Errors::fallback): New function.
2330 (gold_fallback): New function.
2331 * errors.h (Errors::fallback): New function.
2332 * gold.cc (gold_exit): Change status parameter to enum; adjust
2333 all callers.
2334 (queue_initial_tasks): Call gold_fallback.
2335 * gold.h: Include cstdlib.
2336 (Exit_status): New enum type.
2337 (gold_exit): Change status parameter to enum.
2338 (gold_fallback): New function.
2339 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2340 (Layout::create_symtab_sections): Likewise.
2341 (Layout::create_shdrs): Likewise.
2342 * main.cc (main): Adjust call to gold_exit.
2343 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2344 (Output_data_got::add_got_entry_pair): Likewise.
2345 (Output_section::add_input_section): Likewise.
2346 (Output_section::add_output_section_data): Likewise.
2347 (Output_segment::set_section_list_addresses): Likewise.
2348 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2349
fb0e076f
CC
23502011-06-07 Cary Coutant <ccoutant@google.com>
2351
2352 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2353 for incremental links.
2354 * output.cc (Output_segment::set_section_list_addresses): Remove
2355 FIXME and test for TLS or BSS.
2356
a5ee4d5d
CC
23572011-06-07 Cary Coutant <ccoutant@google.com>
2358
2359 * testsuite/Makefile.am: Add incremental_copy_test,
2360 incremental_common_test_1.
2361 * testsuite/Makefile.in: Regenerate.
2362 * testsuite/common_test_1_v1.c: New source file.
2363 * testsuite/common_test_1_v2.c: New source file.
2364 * testsuite/copy_test_v1.cc: New source file.
2365
5146f448
CC
23662011-06-07 Cary Coutant <ccoutant@google.com>
2367
2368 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2369 update, allocate common from bss section's free list.
2370 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2371 linker-defined symbols.
2372 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2373 Skip GOT and PLT entries that are no longer referenced.
2374 (Output_section_incremental_inputs::write_info_blocks): Mark
2375 linker-defined symbols.
2376 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2377 * output.cc (Output_section::allocate): New function.
2378 * output.h (Output_section::allocate): New function.
2379 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2380 linker-defined symbols.
2381 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2382 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2383 (Symbol::init_base_output_data): Likewise.
2384 (Symbol::init_base_output_segment): Likewise.
2385 (Symbol::init_base_constant): Likewise.
2386 (Sized_symbol::init_output_data): Likewise.
2387 (Sized_symbol::init_output_segment): Likewise.
2388 (Sized_symbol::init_constant): Likewise.
2389 (Symbol_table::do_define_in_output_data): Likewise.
2390 (Symbol_table::do_define_in_output_segment): Likewise.
2391 (Symbol_table::do_define_as_constant): Likewise.
2392 * symtab.h (Symbol::is_predefined): New function.
2393 (Symbol::init_base_output_data): Add is_predefined parameter.
2394 (Symbol::init_base_output_segment): Likewise.
2395 (Symbol::init_base_constant): Likewise.
2396 (Symbol::is_predefined_): New data member.
2397 (Sized_symbol::init_output_data): Add is_predefined parameter.
2398 (Sized_symbol::init_output_segment): Likewise.
2399 (Sized_symbol::init_constant): Likewise.
2400 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2401
26d3c67d
CC
24022011-06-07 Cary Coutant <ccoutant@google.com>
2403
2404 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2405 instead of emit_copy_reloc.
2406 (Copy_relocs::emit_copy_reloc): Refactor.
2407 (Copy_relocs::make_copy_reloc): New function.
2408 (Copy_relocs::add_copy_reloc): Remove.
2409 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2410 section.
2411 (Copy_relocs::make_copy_reloc): New function.
2412 (Copy_relocs::add_copy_reloc): Remove.
2413 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2414 unchanged input files.
2415 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2416 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2417 Reserve BSS space for COPY relocations.
2418 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2419 (Output_section_incremental_inputs::write_info_blocks): Record
2420 whether a symbol is copied from a shared object.
2421 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2422 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2423 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2424 (Incremental_input_entry_reader::get_output_symbol_index): Add
2425 is_copy parameter.
2426 (Incremental_binary::emit_copy_relocs): New function.
2427 (Incremental_binary::do_emit_copy_relocs): New function.
2428 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2429 new data member.
2430 (Sized_incremental_binary::add_copy_reloc): New function.
2431 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2432 (Sized_incremental_binary::Copy_reloc): New struct.
2433 (Sized_incremental_binary::Copy_relocs): New typedef.
2434 (Sized_incremental_binary::copy_relocs_): New data member.
2435 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2436 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2437 * target.h (Sized_target::emit_copy_reloc): New function.
2438 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2439
7cdb37d9
CC
24402011-06-02 Cary Coutant <ccoutant@google.com>
2441
2442 PR gold/12163
2443 * gold/archive.cc (Archive::Archive): Initialize new data member.
2444 (Archive::include_all_members): Return if archive has already been
2445 included.
2446 * gold/archive.h (Archive::include_all_members_): New data member.
2447
cc643b88
NC
24482011-06-02 Nick Clifton <nickc@redhat.com>
2449
2450 * dynobj.h: Fix spelling mistake in comment.
2451 * output.cc: Likewise.
2452
f62a3ca7 24532011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 2454 Asier Llano
f62a3ca7
DK
2455
2456 PR gold/12826
cc643b88 2457 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
2458 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2459 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2460 redundant arm_exidx_test.so.
2461 * testsuite/Makefile.in: Regenerate.
2462 (check_SCRIPTS): Add pr12826.sh
2463 (check_DATA): Add pr12826.stdout
2464 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2465 * testsuite/pr12826.sh: New file.
2466 * testsuite/pr12826_1.s: Ditto.
2467 * testsuite/pr12826_1.s: Ditto.
2468
8dbe1edc
ILT
24692011-05-30 Ian Lance Taylor <iant@google.com>
2470
2471 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2472 sections.
2473
c49875be
ILT
24742011-05-29 Ian Lance Taylor <iant@google.com>
2475
2476 PR gold/12804
2477 * testsuite/Makefile.am: Use different file name for two_file_test
2478 temporary file for each incremental test.
2479 * testsuite/Makefile.in: Rebuild.
2480
69d53f7a
ILT
24812011-05-29 Ian Lance Taylor <iant@google.com>
2482
2483 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2484 binary input file is empty.
2485
41d0ab5f
ILT
24862011-05-27 Ian Lance Taylor <iant@google.com>
2487
2488 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2489 (ver_test_9.so): Likewise.
2490 * testsuite/Makefile.in: Rebuild.
2491
89d8a36b
CC
24922011-05-26 Cary Coutant <ccoutant@google.com>
2493
2494 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2495 * incremental.cc (Incremental_inputs::report_input_section): Fix
2496 comment, indentation.
2497 (Incremental_inputs::report_comdat_group): New function.
2498 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2499 of data for incremental input file entry.
2500 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2501 group count, COMDAT group signatures.
2502 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2503 an unchanged input file.
2504 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2505 Initialize new data member.
2506 (Incremental_object_entry::add_comdat_group): New function.
2507 (Incremental_object_entry::get_comdat_group_count): New function.
2508 (Incremental_object_entry::get_comdat_signature_key): New function.
2509 (Incremental_object_entry::groups_): New data member.
2510 (Incremental_inputs::report_comdat_group): New function.
2511 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2512 data for incremental input file entry.
2513 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2514 (Incremental_input_entry_reader::get_input_section): Adjust size of
2515 data for incremental input file entry.
2516 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2517 (Incremental_input_entry_reader::get_comdat_group_signature): New
2518 function.
2519 * object.cc (Sized_relobj::include_section_group): Report kept
2520 COMDAT groups for incremental links.
2521
1706a06f
ILT
25222011-05-24 David Meyer <pdox@google.com>
2523
2524 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2525 with name parameter. Add found_name parameter.
2526 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2527 * dirsearch.h (class Dirsearch): Update declaration.
2528
a10ae760
ILT
25292011-05-24 Ian Lance Taylor <iant@google.com>
2530
2531 * archive.cc (Library_base::should_include_member): Pull in object
2532 from archive if it defines the entry symbol.
2533 * parameters.cc (Parameters::entry): New function.
2534 * parameters.h (class Parameters): Declare entry.
2535 * output.h (class Output_file_header): Remove entry_ field.
2536 * output.cc (Output_file_header::Output_file_header): Remove entry
2537 parameter. Change all callers.
2538 (Output_file_header::entry): Use parameters->entry.
2539 * gold.cc (queue_middle_tasks): Likewise.
2540 * plugin.cc (Plugin_hook::run): Likewise.
2541
aa92d6ed
CC
25422011-05-24 Cary Coutant <ccoutant@google.com>
2543
2544 * gold.cc (queue_initial_tasks): Pass incremental base filename
2545 to Output_file::open_base_file; don't print error message.
2546 * incremental-dump.cc (main): Adjust call to
2547 Output_file::open_for_modification.
2548 * incremental-dump.cc (main): Likewise.
2549 * incremental.cc (Incremental_inputs::report_command_line):
2550 Ignore --incremental-base option when comparing command lines.
2551 Ignore parameter when given as separate argument.
2552 * options.h (class General_options): Add --incremental-base.
2553 * output.cc (Output_file::Output_file):
2554 (Output_file::open_base_file): Add base_name and writable parameters;
2555 read base file into new file; print error message here.
2556 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2557 callers.
2558 * output.h (Output_file::open_for_modification): Rename to...
2559 (Output_file::open_base_file): ...this; add base_name and
2560 writable parameters; adjust all callers.
2561 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2562 callers.
2563 * testsuite/Makefile.am (incremental_test_4): Test
2564 --incremental-base.
2565 * testsuite/Makefile.in: Regenerate.
2566
2eedd706
CC
25672011-05-24 Cary Coutant <ccoutant@google.com>
2568
2569 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2570 incremental_test_4.
2571 * testsuite/Makefile.in: Regenerate.
2572 * testsuite/two_file_test_1_v1.cc: New test source file.
2573 * testsuite/two_file_test_1b_v1.cc: New test source file.
2574 * testsuite/two_file_test_2_v1.cc: New test source file.
2575
0f1c85a6
CC
25762011-05-24 Cary Coutant <ccoutant@google.com>
2577
2578 * dynobj.h (Dynobj::do_dynobj): New function.
2579 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2580 flag and soname for shared objects.
2581 * incremental.cc (Incremental_inputs::report_object): Make
2582 either Incremental_object_entry or Incremental_dynobj_entry; add
2583 soname to string table.
2584 (Incremental_inputs::report_input_section): Add assertion.
2585 (Output_section_incremental_inputs::set_final_data_size): Adjust
2586 type of input file entry for shared libraries; adjust size of
2587 shared library info entry.
2588 (Output_section_incremental_inputs::write_input_files): Write
2589 as_needed flag for shared libraries.
2590 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2591 of input file entry for shared libraries; write soname.
2592 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2593 soname from incremental info.
2594 * incremental.h (enum Incremental_input_flags): Add
2595 INCREMENTAL_INPUT_AS_NEEDED.
2596 (Incremental_input_entry::Incremental_input_entry): Initialize new
2597 data member.
2598 (Incremental_input_entry::set_as_needed): New function.
2599 (Incremental_input_entry::as_needed): New function.
2600 (Incremental_input_entry::do_dynobj_entry): New function.
2601 (Incremental_input_entry::as_needed_): New data member.
2602 (Incremental_object_entry::Incremental_object_entry): Don't check
2603 for shared library.
2604 (Incremental_object_entry::do_type): Likewise.
2605 (class Incremental_dynobj_entry): New class.
2606 (Incremental_input_entry_reader::as_needed): New function.
2607 (Incremental_input_entry_reader::get_soname): New function.
2608 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2609 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2610 size of shared library info entry.
58797674 2611 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
2612 incremental link when adding DT_NEEDED entries.
2613 * object.h (Object::Object): Initialize new data member.
2614 (Object::dynobj): New function.
2615 (Object::set_as_needed): New function.
2616 (Object::as_needed): New function.
2617 (Object::do_dynobj): New function.
2618 (Object::as_needed_): New data member.
2619
6fa2a40b
CC
26202011-05-24 Cary Coutant <ccoutant@google.com>
2621
2622 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2623 info; adjust display of GOT entries.
2624 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2625 vector of input objects; remove file_status_.
2626 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2627 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2628 got_plt reader; call target hooks to reserve GOT entries.
2629 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2630 of input file info header and GOT info entry.
2631 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2632 relocation info.
2633 (Got_plt_view_info::got_descriptor): Remove.
2634 (Got_plt_view_info::sym_index): New data member.
2635 (Got_plt_view_info::input_index): New data member.
2636 (Local_got_offset_visitor::visit): Write input file index.
2637 (Global_got_offset_visitor::visit): Write 0 for input file index.
2638 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2639 with sym_index and input_index.
2640 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2641 incremental info GOT entry; replace got_descriptor with input_index.
2642 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2643 map from input file index to object.
2644 (Sized_relobj_incr::do_layout): Replace direct data member reference
2645 with accessor function.
2646 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2647 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2648 Adjust size of input file info header.
2649 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2650 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2651 (Incremental_input_entry_reader::get_input_section): Adjust size of
2652 input file info header.
2653 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2654 of incremental info GOT entry.
2655 (Incremental_got_plt_reader::get_got_desc): Remove.
2656 (Incremental_got_plt_reader::get_got_symndx): New function.
2657 (Incremental_got_plt_reader::get_got_input_index): New function.
2658 (Sized_incremental_binary::Sized_incremental_binary): Remove
2659 file_status_; add input_objects_.
2660 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2661 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2662 (Sized_incremental_binary::file_is_unchanged): Remove.
2663 (Sized_incremental_binary::set_input_object): New function.
2664 (Sized_incremental_binary::input_object): New function.
2665 (Sized_incremental_binary::file_status_): Remove.
2666 (Sized_incremental_binary::input_objects_): New data member.
2667 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2668 references.
2669 (Sized_relobj_incr::invalid_address): Move to base class.
2670 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2671 class.
2672 (Sized_relobj_incr::do_output_section_offset): Likewise.
2673 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2674 (Sized_relobj_incr::section_offsets_): Likewise.
2675 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2676 function.
2677 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2678 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2679 with accessor function.
2680 (Sized_relobj_file::do_layout): Likewise.
2681 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2682 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2683 (Sized_relobj_file::compute_final_local_value): Replace refs to
2684 section_offsets_ with accessor function.
2685 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2686 * object.h (Relobj::Relobj): Initialize new data members.
2687 (Relobj::add_dyn_reloc): New function.
2688 (Relobj::first_dyn_reloc): New function.
2689 (Relobj::dyn_reloc_count): New function.
2690 (Relobj::first_dyn_reloc_): New data member.
2691 (Relobj::dyn_reloc_count_): New data member.
2692 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2693 references.
2694 (Sized_relobj::Address): New typedef.
2695 (Sized_relobj::invalid_address): Move here from child class.
2696 (Sized_relobj::Sized_relobj): Initialize new data members.
2697 (Sized_relobj::sized_relobj): New function.
2698 (Sized_relobj::is_output_section_offset_invalid): Move here from
2699 child class.
2700 (Sized_relobj::get_output_section_offset): Likewise.
2701 (Sized_relobj::local_has_got_offset): Likewise.
2702 (Sized_relobj::local_got_offset): Likewise.
2703 (Sized_relobj::set_local_got_offset): Likewise.
2704 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2705 (Sized_relobj::clear_got_offsets): New function.
2706 (Sized_relobj::section_offsets): Move here from child class.
2707 (Sized_relobj::do_output_section_offset): Likewise.
2708 (Sized_relobj::do_set_section_offset): Likewise.
2709 (Sized_relobj::Local_got_offsets): Likewise.
2710 (Sized_relobj::local_got_offsets_): Likewise.
2711 (Sized_relobj::section_offsets_): Likewise.
2712 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2713 references.
2714 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2715 class.
2716 (Sized_relobj_file::sized_relobj): New function
2717 (Sized_relobj_file::local_has_got_offset): Move to base class.
2718 (Sized_relobj_file::local_got_offset): Likewise.
2719 (Sized_relobj_file::set_local_got_offset): Likewise.
2720 (Sized_relobj_file::get_output_section_offset): Likewise.
2721 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2722 (Sized_relobj_file::do_output_section_offset): Likewise.
2723 (Sized_relobj_file::do_set_section_offset): Likewise.
2724 (Sized_relobj_file::Local_got_offsets): Likewise.
2725 (Sized_relobj_file::local_got_offsets_): Likewise.
2726 (Sized_relobj_file::section_offsets_): Likewise.
2727 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2728 (all constructors).
2729 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2730 (Output_reloc::get_symbol_index): Likewise.
2731 (Output_reloc::local_section_offset): Likewise.
2732 (Output_reloc::get_address): Likewise.
2733 (Output_reloc::symbol_value): Likewise.
2734 (Output_data_got::reserve_slot): Move to class definition.
2735 (Output_data_got::reserve_local): New function.
2736 (Output_data_got::reserve_slot_for_global): Remove.
2737 (Output_data_got::reserve_global): New function.
2738 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2739 (all constructors, two instantiations).
2740 (Output_reloc::get_relobj): New function (two instantiations).
2741 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2742 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2743 (Output_data_reloc::add_global): Adjust type of relobj.
2744 (Output_data_reloc::add_global_relative): Likewise.
2745 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2746 (Output_data_reloc::add_local): Likewise.
2747 (Output_data_reloc::add_local_relative): Likewise.
2748 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2749 (Output_data_reloc::add_local_section): Likewise.
2750 (Output_data_reloc::add_output_section): Likewise.
2751 (Output_data_reloc::add_absolute): Likewise.
2752 (Output_data_reloc::add_target_specific): Likewise.
2753 (Output_data_got::reserve_slot): Move definition here.
2754 (Output_data_got::reserve_local): New function.
2755 (Output_data_got::reserve_global): New function.
2756 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2757 section_offsets_ with accessor function.
2758 (Sized_relobj_file::write_sections): Likewise.
2759 (Sized_relobj_file::do_relocate_sections): Likewise.
2760 * target.h (Sized_target::reserve_local_got_entry): New function.
2761 (Sized_target::reserve_global_got_entry): New function.
2762 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2763 (Target_x86_64::reserve_global_got_entry): New function.
2764 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2765
4829d394
CC
27662011-05-23 Cary Coutant <ccoutant@google.com>
2767
2768 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2769 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2770 bit when checking got_type.
2771 * incremental.cc (Sized_incremental_binary::setup_readers):
2772 Store symbol table and string table locations; initialize bit vector
2773 of file status flags.
2774 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2775 unchanged files.
2776 (Sized_incremental_binary::do_process_got_plt): New function.
2777 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2778 (Output_section_incremental_inputs::set_final_data_size): Record
2779 file index for each input file.
2780 (Output_section_incremental_inputs::write_got_plt): Store file index
2781 instead of input entry offset for each GOT entry.
2782 * incremental.h
2783 (Incremental_input_entry::Incremental_input_entry): Initialize new
2784 data member.
2785 (Incremental_input_entry::set_offset): Store file index.
2786 (Incremental_input_entry::get_file_index): New function.
2787 (Incremental_input_entry::file_index_): New data member.
2788 (Incremental_binary::process_got_plt): New function.
2789 (Incremental_binary::do_process_got_plt): New function.
2790 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2791 data members.
2792 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2793 (Sized_incremental_binary::set_file_is_unchanged): New function.
2794 (Sized_incremental_binary::file_is_unchanged): New function.
2795 (Sized_incremental_binary::do_process_got_plt): New function.
2796 (Sized_incremental_binary::file_status_): New data member.
2797 (Sized_incremental_binary::main_symtab_loc_): New data member.
2798 (Sized_incremental_binary::main_strtab_loc_): New data member.
2799 * output.cc (Output_data_got::Got_entry::write): Add case
2800 RESERVED_CODE.
2801 (Output_data_got::add_global): Call add_got_entry.
2802 (Output_data_got::add_global_plt): Likewise.
2803 (Output_data_got::add_global_with_rel): Likewise.
2804 (Output_data_got::add_global_with_rela): Likewise.
2805 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2806 (Output_data_got::add_global_pair_with_rela): Likewise.
2807 (Output_data_got::add_local): Call add_got_entry.
2808 (Output_data_got::add_local_plt): Likewise.
2809 (Output_data_got::add_local_with_rel): Likewise.
2810 (Output_data_got::add_local_with_rela): Likewise.
2811 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2812 (Output_data_got::add_local_pair_with_rela): Likewise.
2813 (Output_data_got::reserve_slot): New function.
2814 (Output_data_got::reserve_slot_for_global): New function.
2815 (Output_data_got::add_got_entry): New function.
2816 (Output_data_got::add_got_entry_pair): New function.
2817 (Output_section::add_output_section_data): Edit FIXME.
2818 * output.h
2819 (Output_section_data_build::Output_section_data_build): New
2820 constructor with size parameter.
2821 (Output_data_space::Output_data_space): Likewise.
2822 (Output_data_got::Output_data_got): Initialize new data member; new
2823 constructor with size parameter.
2824 (Output_data_got::add_constant): Call add_got_entry.
2825 (Output_data_got::reserve_slot): New function.
2826 (Output_data_got::reserve_slot_for_global): New function.
2827 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2828 (Output_data_got::add_got_entry): New function.
2829 (Output_data_got::add_got_entry_pair): New function.
2830 (Output_data_got::free_list_): New data member.
2831 * target.h (Sized_target::init_got_plt_for_update): New function.
2832 (Sized_target::register_global_plt_entry): New function.
2833 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2834 Initialize new data member; call init; add constructor with PLT count.
2835 (Output_data_plt_x86_64::init): New function.
2836 (Output_data_plt_x86_64::add_relocation): New function.
2837 (Output_data_plt_x86_64::reserve_slot): New function.
2838 (Output_data_plt_x86_64::free_list_): New data member.
2839 (Target_x86_64::init_got_plt_for_update): New function.
2840 (Target_x86_64::register_global_plt_entry): New function.
2841 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2842 incremental updates.
2843 (Output_data_plt_x86_64::add_relocation): New function.
2844 * testsuite/object_unittest.cc (Object_test): Set default options.
2845
ec69d6da
ILT
28462011-05-16 Ian Lance Taylor <iant@google.com>
2847
2848 * options.h (class General_options): Make -i a synonym for -r.
2849
732e31de
ILT
28502011-05-16 Ian Lance Taylor <iant@google.com>
2851
2852 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2853
403676b5
CC
28542011-05-10 Cary Coutant <ccoutant@google.com>
2855
2856 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2857 strip_all (-s).
2858
5b7b7d6e
ILT
28592011-05-06 Ian Lance Taylor <iant@google.com>
2860
2861 * layout.cc (Layout::layout): If the output section flags change,
2862 update the ordering.
2863
f0f9babf
CC
28642011-04-25 Cary Coutant <ccoutant@google.com>
2865
2866 * incremental-dump.cc (dump_incremental_inputs): Print local
2867 symbol info for each input file.
2868 * incremental.cc
2869 (Output_section_incremental_inputs::set_final_data_size): Add local
2870 symbol info to input file entries in incremental info.
2871 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2872 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2873 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2874 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2875 implementation.
2876 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2877 (Sized_incr_relobj::do_relocate): Write the local symbols.
2878 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2879 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2880 Adjust size of input file header.
2881 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2882 (Incremental_inputs_reader::get_local_symbol_count): New function.
2883 (Incremental_inputs_reader::get_input_section): Adjust size of input
2884 file header.
2885 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2886 (Sized_incr_relobj::This): New typedef.
2887 (Sized_incr_relobj::sym_size): New const data member.
2888 (Sized_incr_relobj::Local_symbol): New struct.
2889 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2890 (Sized_incr_relobj::do_local_symbol_offset): New function.
2891 (Sized_incr_relobj::local_symbol_count_): New data member.
2892 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2893 (Sized_incr_relobj::local_symbol_index_): New data member.
2894 (Sized_incr_relobj::local_symbol_offset_): New data member.
2895 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2896 (Sized_incr_relobj::local_symbols_): New data member.
2897 * object.h (Relobj::output_local_symbol_count): New function.
2898 (Relobj::local_symbol_offset): New function.
2899 (Relobj::do_output_local_symbol_count): New function.
2900 (Relobj::do_local_symbol_offset): New function.
2901 (Sized_relobj::do_output_local_symbol_count): New function.
2902 (Sized_relobj::do_local_symbol_offset): New function.
2903
d0a9ace3
ILT
29042011-04-22 Vladimir Simonov <sv@sw.ru>
2905
2906 * descriptors.cc (set_close_on_exec): New function.
2907 (Descriptors::open): Use set_close_on_exec.
2908 * output.cc (S_ISLNK): Define if not defined.
2909
94a3fc8b
CC
29102011-04-22 Cary Coutant <ccoutant@google.com>
2911
2912 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2913 global symbol map.
2914 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2915 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2916 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2917 relocations.
2918 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2919 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2920 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2921 * incremental.h
2922 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2923 function.
2924 (Incremental_binary::apply_incremental_relocs): New function.
2925 (Incremental_binary::do_apply_incremental_relocs): New function.
2926 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2927 data member.
2928 (Sized_incremental_binary::add_global_symbol): New function.
2929 (Sized_incremental_binary::global_symbol): New function.
2930 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2931 (Sized_incremental_binary::symbol_map_): New data member.
2932 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2933 * target.h (Sized_target::apply_relocation): New function.
2934 * target-reloc.h (apply_relocation): New function.
2935 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2936
c87e4302
DK
29372011-04-22 Doug Kwan <dougkwan@google.com>
2938
2939 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2940 flag of a SHT_ARM_EXIDX section.
2e702c99 2941 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
2942 * testsuite/Makefile.in: Regenerate.
2943 * testsuite/arm_exidx_test.s: New file.
2944 * testsuite/arm_exidx_test.sh: Same.
2945
e7782cf6
CC
29462011-04-20 Cary Coutant <ccoutant@google.com>
2947
2948 PR gold/12689
2949 * archive.h (Incremental_archive_entry::Archive_member):
2950 Initialize arg_serial_ (second constructor).
2951
308ecdc7
ILT
29522011-04-17 Ian Lance Taylor <iant@google.com>
2953
2954 * object.cc (Relocate_info::location): Simplify location string.
2955 * errors.cc (Errors::error_at_location): Don't print program
2956 name.
2957 (Errors::warning_at_location): Likewise.
2958 (Errors::undefined_symbol): Likewise.
2959 * testsuite/debug_msg.sh: Update accordingly.
2960
bec5b579
CC
29612011-04-14 Cary Coutant <ccoutant@google.com>
2962
2963 * gold/layout.cc (Layout::symtab_section_offset): New function.
2964 * gold/layout.h (Layout::symtab_section_offset): New function.
2965 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2966
88597d34
ILT
29672011-04-12 Ian Lance Taylor <iant@google.com>
2968
2969 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2970 with MREMAP_MAYMOVE.
2971 * output.h (class Output_file): Add map_is_allocated_ field.
2972 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2973 not available, provide stubs. If mremap is not available, #define
2974 it to gold_mremap.
2975 (MREMAP_MAYMOVE): Define if not defined.
2976 (Output_file::Output_file): Initialize map_is_allocated_.
2977 (Output_file::resize): Check map_is_allocated_.
2978 (Output_file::map_anonymous): If mmap fails, use malloc.
2979 (Output_file::unmap): Don't do anything for an anonymous map.
2980 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2981 is not available, provide stubs.
2982 (File_read::View::~View): Use free rather than delete[].
2983 (File_read::make_view): Use malloc rather than new[]. If mmap
2984 fails, use malloc.
2985 (File_read::find_or_make_view): Use malloc rather than new[].
2986 * gold.h: Remove HAVE_REMAP code.
2987 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2988 exists. Rename mremap to gold_mremap. If mmap is not available
2989 don't do anything.
2990 * configure, config.in: Rebuild.
2991
11e361bc
ILT
29922011-04-11 Ian Lance Taylor <iant@google.com>
2993
2994 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2995 initialize local variable v.
2996
cdc29364
CC
29972011-04-11 Cary Coutant <ccoutant@google.com>
2998
2999 * archive.cc (Archive::include_member): Adjust call to
3000 report_object.
3001 (Add_archive_symbols::run): Track argument serial numbers.
3002 (Lib_group::include_member): Likewise.
3003 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3004 * archive.h (Incremental_archive_entry::Archive_member):
3005 Initialize arg_serial_.
3006 (Archive_member::arg_serial_): New data member.
3007 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3008 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3009 incremental link.
3010 (Sized_dynobj::do_for_all_local_got_entries): New function.
3011 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
3012 function.
3013 * fileread.cc (get_mtime): New function.
3014 * fileread.h (get_mtime): New function.
3015 * gold.cc (queue_initial_tasks): Check for incremental update.
3016 (process_incremental_input): New function.
3017 (queue_middle_tasks): Don't force valid target for incremental
3018 update.
3019 * incremental-dump.cc (find_input_containing_global): Adjust
3020 size of symbol info entry.
3021 (dump_incremental_inputs): Dump argument serial number and
3022 in_system_directory flag; bias shndx by 1; print symbol names
3023 when dumping per-file symbol lists; use new symbol info readers.
3024 * incremental.cc
3025 (Output_section_incremental_inputs:update_data_size): New function.
3026 (Sized_incremental_binary::setup_readers): Setup input readers
3027 for each input file; build maps for files added from libraries
3028 and scripts.
3029 (Sized_incremental_binary::check_input_args): New function.
3030 (Sized_incremental_binary::do_check_inputs): Build map of argument
3031 serial numbers to input arguments.
3032 (Sized_incremental_binary::do_file_has_changed): Rename
3033 do_file_is_unchanged to this; compare file modification times.
3034 (Sized_incremental_binary::do_init_layout): New function.
3035 (Sized_incremental_binary::do_reserve_layout): New function.
3036 (Sized_incremental_binary::do_get_input_reader): Remove.
3037 (Sized_incremental_binary::get_symtab_view): New function.
3038 (Incremental_checker::can_incrementally_link_output_file): Remove.
3039 (Incremental_inputs::report_command_line): Exclude --debug options.
3040 (Incremental_inputs::report_archive_begin): Add parameter; track
3041 argument serial numbers; don't put input file entry for archive
3042 before archive members.
3043 (Incremental_inputs::report_archive_end): Put input file entry
3044 for archive after archive members.
3045 (Incremental_inputs::report_object): Add parameter; track argument
3046 serial numbers and in_system_directory flag.
3047 (Incremental_inputs::report_script): Add parameter; track argument
3048 serial numbers.
3049 (Output_section_incremental_inputs::set_final_data_size): Adjust
3050 size of symbol info entry; check for forwarding symbols.
3051 (Output_section_incremental_inputs::write_input_files): Write
3052 in_system_directory flag and argument serial number.
3053 (Output_section_incremental_inputs::write_info_blocks): Map section
3054 indices between incremental info and original input file; store
3055 input section index for each symbol.
3056 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
3057 change operator() to visit().
3058 (class Global_got_offset_visitor): Likewise.
3059 (class Global_symbol_visitor_got_plt):
3060 (Output_section_incremental_inputs::write_got_plt): Use new visitor
3061 classes.
3062 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
3063 (Sized_incr_relobj::do_read_symbols): New function.
3064 (Sized_incr_relobj::do_layout): New function.
3065 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3066 (Sized_incr_relobj::do_add_symbols): New function.
3067 (Sized_incr_relobj::do_should_include_member): New function.
3068 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3069 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3070 (Sized_incr_relobj::do_section_size): New function.
3071 (Sized_incr_relobj::do_section_name): New function.
3072 (Sized_incr_relobj::do_section_contents): New function.
3073 (Sized_incr_relobj::do_section_flags): New function.
3074 (Sized_incr_relobj::do_section_entsize): New function.
3075 (Sized_incr_relobj::do_section_address): New function.
3076 (Sized_incr_relobj::do_section_type): New function.
3077 (Sized_incr_relobj::do_section_link): New function.
3078 (Sized_incr_relobj::do_section_info): New function.
3079 (Sized_incr_relobj::do_section_addralign): New function.
3080 (Sized_incr_relobj::do_initialize_xindex): New function.
3081 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3082 (Sized_incr_relobj::do_read_relocs): New function.
3083 (Sized_incr_relobj::do_gc_process_relocs): New function.
3084 (Sized_incr_relobj::do_scan_relocs): New function.
3085 (Sized_incr_relobj::do_count_local_symbols): New function.
3086 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3087 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3088 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3089 (Sized_incr_relobj::do_relocate): New function.
3090 (Sized_incr_relobj::do_set_section_offset): New function.
3091 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3092 (Sized_incr_dynobj::do_read_symbols): New function.
3093 (Sized_incr_dynobj::do_layout): New function.
3094 (Sized_incr_dynobj::do_add_symbols): New function.
3095 (Sized_incr_dynobj::do_should_include_member): New function.
3096 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3097 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3098 (Sized_incr_dynobj::do_section_size): New function.
3099 (Sized_incr_dynobj::do_section_name): New function.
3100 (Sized_incr_dynobj::do_section_contents): New function.
3101 (Sized_incr_dynobj::do_section_flags): New function.
3102 (Sized_incr_dynobj::do_section_entsize): New function.
3103 (Sized_incr_dynobj::do_section_address): New function.
3104 (Sized_incr_dynobj::do_section_type): New function.
3105 (Sized_incr_dynobj::do_section_link): New function.
3106 (Sized_incr_dynobj::do_section_info): New function.
3107 (Sized_incr_dynobj::do_section_addralign): New function.
3108 (Sized_incr_dynobj::do_initialize_xindex): New function.
3109 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3110 (make_sized_incremental_object): New function.
3111 (Incremental_library::copy_unused_symbols): New function.
3112 (Incremental_library::do_for_all_unused_symbols): New function.
3113 * incremental.h (enum Incremental_input_flags): New type.
3114 (class Incremental_checker): Remove.
3115 (Incremental_input_entry::Incremental_input_entry): Add argument
3116 serial number.
3117 (Incremental_input_entry::arg_serial): New function.
3118 (Incremental_input_entry::set_is_in_system_directory): New function.
3119 (Incremental_input_entry::is_in_system_directory): New function.
3120 (Incremental_input_entry::arg_serial_): New data member.
3121 (Incremental_input_entry::is_in_system_directory_): New data member.
3122 (class Script_info): Move here from script.h.
3123 (Script_info::Script_info): Add filename parameter.
3124 (Script_info::filename): New function.
3125 (Script_info::filename_): New data member.
3126 (Incremental_script_entry::Incremental_script_entry): Add argument
3127 serial number.
3128 (Incremental_object_entry::Incremental_object_entry): Likewise.
3129 (Incremental_object_entry::add_input_section): Build list of input
3130 sections with map to original shndx.
3131 (Incremental_object_entry::get_input_section_index): New function.
3132 (Incremental_object_entry::shndx_): New data member.
3133 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3134 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3135 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3136 serial number.
3137 (Incremental_inputs::report_archive_begin): Likewise.
3138 (Incremental_inputs::report_object): Likewise.
3139 (Incremental_inputs::report_script): Likewise.
3140 (class Incremental_global_symbol_reader): New class.
3141 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3142 and store flags and input file type.
3143 (Incremental_input_entry_reader::arg_serial): New function.
3144 (Incremental_input_entry_reader::type): Extract type from flags.
3145 (Incremental_input_entry_reader::is_in_system_directory): New function.
3146 (Incremental_input_entry_reader::get_input_section_count): Call
3147 accessor function for type.
3148 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3149 function for type; adjust size of global symbol entry.
3150 (Incremental_input_entry_reader::get_global_symbol_count): Call
3151 accessor function for type.
3152 (Incremental_input_entry_reader::get_object_count): Likewise.
3153 (Incremental_input_entry_reader::get_object_offset): Likewise.
3154 (Incremental_input_entry_reader::get_member_count): Likewise.
3155 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3156 (Incremental_input_entry_reader::get_member_offset): Likewise.
3157 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3158 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3159 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3160 (Incremental_input_entry_reader::get_global_symbol_reader): New
3161 function.
3162 (Incremental_input_entry_reader::get_output_symbol_index): New
3163 function.
3164 (Incremental_input_entry_reader::type_): Remove.
3165 (Incremental_input_entry_reader::flags_): New data member.
3166 (Incremental_inputs_reader::input_file_offset): New function.
3167 (Incremental_inputs_reader::input_file_index): New function.
3168 (Incremental_inputs_reader::input_file): Call input_file_offset.
3169 (Incremental_inputs_reader::input_file_at_offset): New function.
3170 (Incremental_relocs_reader::get_r_type): Reformat.
3171 (Incremental_relocs_reader::get_r_shndx): Reformat.
3172 (Incremental_relocs_reader::get_r_offset): Reformat.
3173 (Incremental_relocs_reader::data): New function.
3174 (Incremental_binary::Incremental_binary): Initialize new data members.
3175 (Incremental_binary::check_inputs): Add cmdline parameter.
3176 (Incremental_binary::file_is_unchanged): Remove.
3177 (Input_reader::arg_serial): New function.
3178 (Input_reader::get_unused_symbol_count): New function.
3179 (Input_reader::get_unused_symbol): New function.
3180 (Input_reader::do_arg_serial): New function.
3181 (Input_reader::do_get_unused_symbol_count): New function.
3182 (Input_reader::do_get_unused_symbol): New function.
3183 (Incremental_binary::input_file_count): New function.
3184 (Incremental_binary::get_input_reader): Change signature to use
3185 index instead of filename.
3186 (Incremental_binary::file_has_changed): New function.
3187 (Incremental_binary::get_input_argument): New function.
3188 (Incremental_binary::get_library): New function.
3189 (Incremental_binary::get_script_info): New function.
3190 (Incremental_binary::init_layout): New function.
3191 (Incremental_binary::reserve_layout): New function.
3192 (Incremental_binary::output_file): New function.
3193 (Incremental_binary::do_check_inputs): New function.
3194 (Incremental_binary::do_file_is_unchanged): Remove.
3195 (Incremental_binary::do_file_has_changed): New function.
3196 (Incremental_binary::do_init_layout): New function.
3197 (Incremental_binary::do_reserve_layout): New function.
3198 (Incremental_binary::do_input_file_count): New function.
3199 (Incremental_binary::do_get_input_reader): Change signature.
3200 (Incremental_binary::input_args_map_): New data member.
3201 (Incremental_binary::library_map_): New data member.
3202 (Incremental_binary::script_map_): New data member.
3203 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3204 new data members.
3205 (Sized_incremental_binary::output_section): New function.
3206 (Sized_incremental_binary::inputs_reader): Add const.
3207 (Sized_incremental_binary::symtab_reader): Add const.
3208 (Sized_incremental_binary::relocs_reader): Add const.
3209 (Sized_incremental_binary::got_plt_reader): Add const.
3210 (Sized_incremental_binary::get_symtab_view): New function.
3211 (Sized_incremental_binary::Inputs_reader): New typedef.
3212 (Sized_incremental_binary::Input_entry_reader): New typedef.
3213 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3214 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3215 (Sized_incremental_binary::do_file_has_changed): New function.
3216 (Sized_incremental_binary::do_init_layout): New function.
3217 (Sized_incremental_binary::do_reserve_layout): New function.
3218 (Sized_input_reader::Inputs_reader): Remove.
3219 (Sized_input_reader::Input_entry_reader): Remove.
3220 (Sized_input_reader::do_arg_serial): New function.
3221 (Sized_input_reader::do_get_unused_symbol_count): New function.
3222 (Sized_input_reader::do_get_unused_symbol): New function.
3223 (Sized_incremental_binary::do_input_file_count): New function.
3224 (Sized_incremental_binary::do_get_input_reader): Change signature;
3225 use index instead of filename.
3226 (Sized_incremental_binary::section_map_): New data member.
3227 (Sized_incremental_binary::input_entry_readers_): New data member.
3228 (class Sized_incr_relobj): New class.
3229 (class Sized_incr_dynobj): New class.
3230 (make_sized_incremental_object): New function.
3231 (class Incremental_library): New class.
3232 * layout.cc (Free_list::num_lists): New static data member.
3233 (Free_list::num_nodes): New static data member.
3234 (Free_list::num_removes): New static data member.
3235 (Free_list::num_remove_visits): New static data member.
3236 (Free_list::num_allocates): New static data member.
3237 (Free_list::num_allocate_visits): New static data member.
3238 (Free_list::init): New function.
3239 (Free_list::remove): New function.
3240 (Free_list::allocate): New function.
3241 (Free_list::dump): New function.
3242 (Free_list::print_stats): New function.
3243 (Layout_task_runner::run): Resize output file for incremental updates.
3244 (Layout::Layout): Initialize new data members.
3245 (Layout::set_incremental_base): New function.
3246 (Layout::init_fixed_output_section): New function.
3247 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3248 incremental updates.
3249 (Layout::create_gold_note): Do not create gold note section for
3250 incremental updates.
3251 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3252 for incremental updates.
3253 (Layout::set_section_offsets): For incremental updates, allocate space
3254 from free list.
3255 (Layout::create_symtab_sections): Layout with offsets relative to
3256 start of section; for incremental updates, allocate space from free
3257 list.
3258 (Layout::create_shdrs): For incremental updates, allocate space from
3259 free list.
3260 (Layout::finish_dynamic_section): For incremental updates, do not
3261 check --as-needed (fixed in subsequent patch).
3262 * layout.h (class Free_list): New class.
3263 (Layout::set_incremental_base): New function.
3264 (Layout::incremental_base): New function.
3265 (Layout::init_fixed_output_section): New function.
3266 (Layout::allocate): New function.
3267 (Layout::incremental_base_): New data member.
3268 (Layout::free_list_): New data member.
3269 * main.cc (main): Print Free_list statistics.
3270 * object.cc (Relobj::finalize_incremental_relocs): Add
3271 clear_counts parameter; clear counts only when clear_counts is set.
3272 (Sized_relobj::Sized_relobj): Initialize new base class.
3273 (Sized_relobj::do_layout): Don't report special sections.
3274 (Sized_relobj::do_for_all_local_got_entries): New function.
3275 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3276 symtab_off to all symbol table offsets.
3277 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3278 * object.h (class Got_offset_list): Move to top of file.
3279 (Object::Object): Allow case where input_file == NULL.
3280 (Object::~Object): Likewise.
3281 (Object::input_file): Assert that input_file != NULL.
3282 (Object::lock): Allow case where input_file == NULL.
3283 (Object::unlock): Likewise.
3284 (Object::is_locked): Likewise.
3285 (Object::token): Likewise.
3286 (Object::release): Likewise.
3287 (Object::is_incremental): New function.
3288 (Object::get_mtime): New function.
3289 (Object::for_all_local_got_entries): New function.
3290 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3291 (Object::set_is_in_system_directory): New function.
3292 (Object::is_in_system_directory): New function.
3293 (Object::do_is_incremental): New function.
3294 (Object::do_get_mtime): New function.
3295 (Object::do_for_all_local_got_entries): New function.
3296 (Object::is_in_system_directory_): New data member.
3297 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3298 (class Sized_relobj_base): New class.
3299 (class Sized_relobj): Derive from Sized_relobj_base.
3300 (class Sized_relobj::Symbols): Redeclare from base class.
3301 (class Sized_relobj::local_got_offset_list): Remove.
3302 (class Sized_relobj::Output_sections): Redeclare from base class.
3303 (class Sized_relobj::do_for_all_local_got_entries): New function.
3304 (class Sized_relobj::write_local_symbols): Add offset parameter.
3305 (class Sized_relobj::local_symbol_offset_): Update comment.
3306 (class Sized_relobj::local_dynsym_offset_): Update comment.
3307 * options.cc (Input_arguments::add_file): Remove const.
3308 * options.h (Input_file_argument::Input_file_argument):
3309 Initialize arg_serial_ (all constructors).
3310 (Input_file_argument::set_arg_serial): New function.
3311 (Input_file_argument::arg_serial): New function.
3312 (Input_file_argument::arg_serial_): New data member.
3313 (Input_arguments::Input_arguments): Initialize file_count_.
3314 (Input_arguments::add_file): Remove const.
3315 (Input_arguments::number_of_input_files): New function.
3316 (Input_arguments::file_count_): New data member.
3317 (Command_line::number_of_input_files): Call
3318 Input_arguments::number_of_input_files.
3319 * output.cc (Output_segment_headers::Output_segment_headers):
3320 Set current size.
3321 (Output_section::Input_section::current_data_size): New function.
3322 (Output_section::Output_section): Initialize new data members.
3323 (Output_section::add_input_section): Don't do merge sections for
3324 an incremental link; allocate space from free list for an
3325 incremental update.
3326 (Output_section::add_output_section_data): Allocate space from
3327 free list for an incremental update.
3328 (Output_section::update_data_size): New function.
3329 (Output_section::set_fixed_layout): New function.
3330 (Output_section::reserve): New function.
3331 (Output_segment::set_section_addresses): Remove const.
3332 (Output_segment::set_section_list_addresses): Remove const; allocate
3333 space from free list for an incremental update.
3334 (Output_segment::set_offset): Adjust size of RELRO segment for an
3335 incremental update.
3336 * output.h (Output_data::current_data_size): Move here from
3337 child classes.
3338 (Output_data::pre_finalize_data_size): New function.
3339 (Output_data::update_data_size): New function.
3340 (Output_section_headers::update_data_size): new function.
3341 (Output_section_data_build::current_data_size): Move to Output_data.
3342 (Output_data_strtab::update_data_size): New function.
3343 (Output_section::current_data_size): Move to Output_data.
3344 (Output_section::set_fixed_layout): New function.
3345 (Output_section::has_fixed_layout): New function.
3346 (Output_section::reserve): New function.
3347 (Output_section::update_data_size): New function.
3348 (Output_section::has_fixed_layout_): New data member.
3349 (Output_section::free_list_): New data member.
3350 (Output_segment::set_section_addresses): Remove const.
3351 (Output_segment::set_section_list_addresses): Remove const.
3352 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3353 New function.
3354 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3355 New function.
3356 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3357 parameter when calling Add_symbols constructor; store argument
3358 serial number for members of a lib group.
3359 (Add_symbols::locks): Allow case where token == NULL.
3360 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3361 (Read_member::~Read_member): New function.
3362 (Read_member::is_runnable): New function.
3363 (Read_member::locks): New function.
3364 (Read_member::run): New function.
3365 (Check_script::~Check_script): New function.
3366 (Check_script::is_runnable): New function.
3367 (Check_script::locks): New function.
3368 (Check_script::run): New function.
3369 (Check_library::~Check_library): New function.
3370 (Check_library::is_runnable): New function.
3371 (Check_library::locks): New function.
3372 (Check_library::run): New function.
3373 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3374 (Add_symbols::library_): New data member.
3375 (class Read_member): New class.
3376 (class Check_script): New class.
3377 (class Check_library): New class.
3378 * reloc.cc (Read_relocs::is_runnable): Allow case where
3379 token == NULL.
3380 (Read_relocs::locks): Likewise.
3381 (Scan_relocs::locks): Likewise.
3382 (Relocate_task::locks): Likewise.
3383 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3384 to clear counters.
3385 (Sized_relobj::incremental_relocs_scan): Fix comment.
3386 (Sized_relobj::do_relocate): Pass output file offset to
3387 write_local_symbols.
3388 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3389 from class declaration.
3390 * script.cc (read_input_script): Allocate Script_info; pass
3391 argument serial number to report_script.
3392 * script.h (class Script_info): Move to incremental.h.
3393 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3394 * symtab.h (Symbol_table::add_from_incrobj): New function.
3395 (Symbol_table::set_file_offset): New function.
3396
b961d0d7
CC
33972011-04-05 Cary Coutant <ccoutant@google.com>
3398
3399 * incremental-dump.cc (dump_incremental_inputs): Change signature
3400 to take a Sized_incremental_binary; change caller. Use readers
3401 in Sized_incremental_binary.
3402 * incremental.cc
3403 (Sized_incremental_binary::find_incremental_inputs_sections):
3404 Rename do_find_incremental_inputs_sections to this.
3405 (Sized_incremental_binary::setup_readers): New function.
3406 (Sized_incremental_binary::do_check_inputs): Check
3407 has_incremental_info_ flag; move setup code to setup_readers;
3408 use input readers.
3409 (Sized_incremental_binary::do_file_is_unchanged): New function.
3410 (Sized_incremental_binary::do_get_input_reader): New function.
3411 * incremental.h (class Incremental_binary): Move to end of file.
3412 (Incremental_binary::file_is_unchanged): New function.
3413 (Incremental_binary::do_file_is_unchanged): New function.
3414 (Incremental_binary::Input_reader): New class.
3415 (Incremental_binary::get_input_reader): New function.
3416 (class Sized_incremental_binary): Move to end of file.
3417 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3418 input section reader classes.
3419 (Sized_incremental_binary::has_incremental_info): New function.
3420 (Sized_incremental_binary::inputs_reader): New function.
3421 (Sized_incremental_binary::symtab_reader): New function.
3422 (Sized_incremental_binary::relocs_reader): New function.
3423 (Sized_incremental_binary::got_plt_reader): New function.
3424 (Sized_incremental_binary::do_file_is_unchanged): New function.
3425 (Sized_incremental_binary::Sized_input_reader): New class.
3426 (Sized_incremental_binary::get_input_reader): New function.
3427 (Sized_incremental_binary::find_incremental_inputs_sections):
3428 Rename do_find_incremental_inputs_sections to this.
3429 (Sized_incremental_binary::setup_readers): New function.
3430 (Sized_incremental_binary::has_incremental_info_): New data member.
3431 (Sized_incremental_binary::inputs_reader_): New data member.
3432 (Sized_incremental_binary::symtab_reader_): New data member.
3433 (Sized_incremental_binary::relocs_reader_): New data member.
3434 (Sized_incremental_binary::got_plt_reader_): New data member.
3435 (Sized_incremental_binary::current_input_file_): New data member.
3436
a869183f
PP
34372011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3438
3439 PR gold/12640
3440 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3441 violation.
3442
34432011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
3444
3445 * archive.cc (Archive::include_member): Adjust call to report_object.
3446 (Add_archive_symbols::run): Add script_info to call to
3447 report_archive_begin.
3448 (Lib_group::include_member): Adjust call to report_object.
3449 (Add_lib_group_symbols::run): Adjust call to report_object.
3450 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3451 blocks. Add object count for script input files.
3452 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3453 script_info parameter; change all callers.
3454 (Incremental_inputs::report_object): Add script_info parameter;
3455 change all callers.
3456 (Incremental_inputs::report_script): Store backpointer to
3457 incremental info entry.
3458 (Output_section_incremental_inputs::set_final_data_size): Record
3459 additional information for scripts.
3460 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3461 * incremental.h (Incremental_script_entry::add_object): New function.
3462 (Incremental_script_entry::get_object_count): New function.
3463 (Incremental_script_entry::get_object): New function.
3464 (Incremental_script_entry::objects_): New data member; adjust
3465 constructor.
3466 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3467 (Incremental_inputs::report_object): Add script_info parameter.
3468 (Incremental_inputs_reader::get_object_count): New function.
3469 (Incremental_inputs_reader::get_object_offset): New function.
3470 * options.cc (Input_arguments::add_file): Return reference to
3471 new input argument.
3472 * options.h (Input_argument::set_script_info): New function.
3473 (Input_argument::script_info): New function.
3474 (Input_argument::script_info_): New data member; adjust all
3475 constructors.
3476 (Input_file_group::add_file): Return reference to new input argument.
3477 (Input_file_lib::add_file): Likewise.
3478 (Input_arguments::add_file): Likewise.
3479 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3480 * script.cc (Parser_closure::Parser_closure): Add script_info
3481 parameter; adjust all callers.
3482 (Parser_closure::script_info): New function.
3483 (Parser_closure::script_info_): New data member.
3484 (read_input_script): Report scripts earlier to incremental info.
3485 (script_add_file): Set script_info in Input_argument.
3486 (script_add_library): Likewise.
3487 * script.h (Script_options::Script_info): Rewrite class.
3488
a869183f 34892011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
3490
3491 * archive.cc (Library_base::should_include_member): Move
3492 method here from class Archive.
3493 (Archive::Archive): Initialize base class.
3494 (Archive::should_include_member): Move to base class.
3495 (Archive::do_for_all_unused_symbols): New function.
3496 (Add_archive_symbols::run): Remove redundant access to
3497 incremental_inputs.
3498 (Lib_group::Lib_group): Initialize base class.
3499 (Lib_group::do_filename): New function.
3500 (Lib_group::include_member): Pass pointer to Lib_group to
3501 report_object.
3502 (Lib_group::do_for_all_unused_symbols): New function.
3503 (Add_lib_group_symbols::run): Report archive information for
3504 incremental links.
3505 * archive.h (class Library_base): New base class.
3506 (class Archive): Derive from Library_base.
3507 (Archive::filename): Move to base class.
3508 (Archive::set_incremental_info): Likewise.
3509 (Archive::incremental_info): Likewise.
3510 (Archive::Should_include): Likewise.
3511 (Archive::should_include_member): Likewise.
3512 (Archive::Armap_entry): Remove.
3513 (Archive::Unused_symbol_iterator): Remove.
3514 (Archive::unused_symbols_begin): Remove.
3515 (Archive::unused_symbols_end): Remove.
3516 (Archive::do_filename): New function.
3517 (Archive::do_get_mtime): New function.
3518 (Archive::do_for_all_unused_symbols): New function.
3519 (Archive::task_): Move to base class.
3520 (Archive::incremental_info_): Likewise.
3521 (class Lib_group): Derive from Library_base.
3522 (Lib_group::do_filename): New function.
3523 (Lib_group::do_get_mtime): New function.
3524 (Lib_group::do_for_all_unused_symbols): New function.
3525 (Lib_group::task_): Move to base class.
3526 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3527 function.
3528 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3529 function.
3530 * incremental.cc (Incremental_inputs::report_archive_begin):
3531 Use Library_base; call library's get_mtime; add incremental inputs
3532 entry before members.
3533 (class Unused_symbol_visitor): New class.
3534 (Incremental_inputs::report_archive_end): Use Library_base; use
3535 visitor class to record unused symbols; don't add incremental inputs
3536 entry after members.
3537 (Incremental_inputs::report_object): Use Library_base.
3538 * incremental.h
3539 (Incremental_archive_entry::Incremental_archive_entry): Remove
3540 unused Archive parameter.
3541 (Incremental_inputs::report_archive_begin): Use Library_base.
3542 (Incremental_inputs::report_archive_end): Likewise.
3543 (Incremental_inputs::report_object): Likewise.
3544 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3545 function.
3546 * object.h (Object::for_all_global_symbols): New function.
3547 (Object::do_for_all_global_symbols): New function.
3548 (Sized_relobj::do_for_all_global_symbols): New function.
3549 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3550 function.
3551 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3552 function.
3553
61ab3e40
ILT
35542011-03-27 Ian Lance Taylor <iant@google.com>
3555
3556 * archive.cc (Archive::interpret_header): Return -1 if something
3557 goes wrong. Change callers accordingly.
3558
30e1f9e6
CC
35592011-03-25 Cary Coutant <ccoutant@google.com>
3560
3561 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3562 * testsuite/Makefile.in: Regenerate.
3563
9370ce59 35642011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
3565
3566 * plugin.cc (get_view): New.
3567 (Plugin::load): Pass get_view to the plugin.
3568 (Plugin_manager::get_view): New.
3569
9312bb0a
ILT
35702011-03-21 Ian Lance Taylor <iant@google.com>
3571
3572 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 3573 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 3574
7e12ba9e
ST
35752011-03-21 Sriraman Tallam <tmsriram@google.com>
3576
3577 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3578 Change == to -eq.
3579 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3580 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3581 Change == to -eq.
3582 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3583 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3584
fd7a005d
ILT
35852011-03-14 Ian Lance Taylor <iant@google.com>
3586
3587 * script-sections.cc (Sort_output_sections::script_compare):
3588 Rename from is_before, change return type.
3589 (Sort_output_sections::operator()): Adjust accordingly.
3590
ed16fd1b
ILT
35912011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3592
3593 PR gold/12572
3594 * testsuite/odr_violation2.cc: Add comment to make all error line
3595 numbers double digits.
3596 * testsuite/debug_msg.sh: Adjust expected errors.
3597
71ff8986
ILT
35982011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3599
3600 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3601 but mark earlier ones as non-canonical
3602 (offset_to_iterator): Update search target and example
3603 (do_addr2line): Return extra lines in a vector*
3604 (format_file_lineno): Extract from do_addr2line
3605 (one_addr2line): Add vector* out-param
3606 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3607 when a lineno entry appeared last for its instruction
3608 (Dwarf_line_info): Add vector* out-param
3609 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3610 * symtab.cc (Odr_violation_compare): Include the lineno in the
3611 comparison again.
3612 (linenos_from_loc): New. Combine the canonical line for an
3613 address with its other lines.
3614 (True_if_intersect): New. Helper functor to make
3615 std::set_intersection a query.
3616 (detect_odr_violations): Compare sets of lines instead of just
3617 one line for each function. This became less deterministic, but
3618 has fewer false positives.
3619 * symtab.h: Declarations.
3620 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3621 mix an optimized and non-optimized object in the same binary
3622 (odr_violation2.so): Same.
3623 * testsuite/Makefile.in: Regenerate from Makefile.am.
3624 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3625 * testsuite/debug_msg.sh: Update line numbers and add
3626 assertions.
3627 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3628 non-optimized context.
3629 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3630 isn't inlined, and use OdrDerived in an optimized context.
3631 * testsuite/odr_header1.h: Defines OdrDerived, where
3632 optimization will change the
3633 first-instruction-in-the-destructor's file and line number.
3634 * testsuite/odr_header2.h: Defines OdrBase.
3635
a19fefdc
ILT
36362011-03-09 Ian Lance Taylor <iant@google.com>
3637
3638 * fileread.cc (File_read::clear_views): Don't delete the whole
3639 file view.
3640
ecb351e9
ILT
36412011-03-08 Ian Lance Taylor <iant@google.com>
3642
3643 PR gold/12525
3644 * fileread.cc: #include <climits>.
3645 (GOLD_IOV_MAX): Define.
3646 (File_read::read_multiple): Limit number of entries by iov_max.
3647 * fileread.h (class File_read): Always set max_readv_entries to
3648 128.
3649
b821d13c
ILT
36502011-03-07 Ian Lance Taylor <iant@google.com>
3651
3652 PR gold/12525
3653 * options.h (class General_options): Add -dy and -dn.
3654
89243142
CC
36552011-03-02 Cary Coutant <ccoutant@google.com>
3656
3657 * testsuite/script_test_9.t: Add TLS segment.
3658
d0773f31
ILT
36592011-03-02 Simon Baldwin <simonb@google.com>
3660
3661 * configure.ac: Add check for gnu_indirect_function support in
3662 the toolchain building binutils.
3663 * configure: Rebuild.
3664
9370ce59 36652011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
3666
3667 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3668 plugin only symbols.
3669 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3670 in plugin files as not needed in the symbol table.
3671
4cf7a849
ST
36722011-02-11 Sriraman Tallam <tmsriram@google.com>
3673
3674 * output.cc (Output_section::add_input_section): Delay fill
3675 generation for section ordering.
3676
b578bd7d
ILT
36772011-02-09 Ian Lance Taylor <iant@google.com>
3678
3679 PR gold/12316
3680 * object.h (class Sized_relobj): Remove clear_local_symbols.
3681 * reloc.cc (Sized_relobj::do_relocate): Don't call
3682 clear_local_symbols.
3683
9370ce59 36842011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
3685
3686 * plugin.cc (is_visible_from_outside): Return true for symbols
3687 in the -u option.
3688
55382fb7
ILT
36892011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3690
3691 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3692 filename.
3693
4e271fff
ST
36942011-02-02 Sriraman Tallam <tmsriram@google.com>
3695
3696 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 3697 to std::string.
4e271fff 3698 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 3699 section_name to be std::string.
4e271fff
ST
3700 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3701
d433c3ac
ILT
37022011-01-25 Ian Lance Taylor <iant@google.com>
3703
3704 * script.cc (script_add_extern): Rewrite to use
3705 add_symbol_reference.
3706
880473a6
DK
37072011-01-25 Doug Kwan <dougkwan@google.com>
3708
d433c3ac 3709 * icf.cc (get_section_contents): Always lock section's object.
880473a6 3710
f30f86fa
ILT
37112011-01-24 Ian Lance Taylor <iant@google.com>
3712
3713 * options.h (class General_options): Accept
3714 --no-detect-odr-violations.
3715
8e51a0b9
ILT
37162011-01-24 Ian Lance Taylor <iant@google.com>
3717
3718 * version.cc (version_string): Bump to 1.11.
3719
0f3b89d8
ILT
37202011-01-24 Ian Lance Taylor <iant@google.com>
3721
3722 * plugin.cc (class Plugin_rescan): Define new class.
3723 (Plugin_manager::claim_file): Set any_claimed_.
3724 (Plugin_manager::save_archive): New function.
3725 (Plugin_manager::save_input_group): New function.
3726 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3727 necessary.
3728 (Plugin_manager::new_undefined_symbol): New function.
3729 (Plugin_manager::rescan): New function.
3730 (Plugin_manager::rescannable_defines): New function.
3731 (Plugin_manager::add_input_file): Set any_added_.
3732 * plugin.h (class Plugin_manager): define new fields rescannable_,
3733 undefined_symbols_, any_claimed_, and any_added_. Declare
3734 Plugin_rescan as friend. Declare new functions.
3735 (Plugin_manager::Rescannable): Define type.
3736 (Plugin_manager::Rescannable_list): Define type.
3737 (Plugin_manager::Undefined_symbol_list): Define type.
3738 (Plugin_manager::Plugin_manager): Initialize new fields.
3739 * archive.cc (Archive::defines_symbol): New function.
3740 (Add_archive_symbols::run): Pass archive to plugins if any.
3741 * archive.h (class Archive): Declare defines_symbol.
3742 * readsyms.cc (Input_group::~Input_group): New function.
3743 (Finish_group::run): Pass input_group to plugins if any.
3744 * readsyms.h (class Input_group): Declare destructor.
3745 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3746 any.
3747
3bb951e5
ILT
37482011-01-10 Ian Lance Taylor <iant@google.com>
3749
3750 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3751 section as relro.
3752 (Layout::set_segment_offsets): Reset increase_relro before calling
3753 set_section_addresses a second time.
3754
0aa45fac
CC
37552011-01-04 Cary Coutant <ccoutant@google.com>
3756
3757 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3758 sections before NOBITS sections.
3759
0db46eb4
L
37602011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3761
3762 * version.cc (print_version): Update copyright to 2011.
3763
829c9745
CC
37642010-12-23 Cary Coutant <ccoutant@google.com>
3765
3766 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3767 of OS to this->add. Add OD parameter to second form of the function.
3768
7500420b
ILT
37692010-12-20 Ian Lance Taylor <iant@google.com>
3770
3771 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3772 second of two consecutive entries with same offset.
3773
f8e9a930
RW
37742010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3775
3776 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3777 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3778 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3779 to avoid unneeded links against $(LDADD).
3780 * testsuite/Makefile.in: Regenerate.
3781
2fbb4320
ILT
37822010-12-15 Ian Lance Taylor <iant@google.com>
3783
3784 PR gold/12324
3785 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3786 for R_X86_64_32 and R_X86_64_PC32.
3787 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3788 ver_matching_def_pic.o.
3789 (ver_matching_def_pic.o): New target.
3790
fedb228d
RW
37912010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3792
3793 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3794 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3795 Move definition before File_read::View member definitions.
3796 (File_read::View::~View): Initialize and hold lock before
3797 updating current_mapped_bytes.
3798
9b547ce6
RW
37992010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3800
3801 * dwarf_reader.cc: Remove outdated comment.
3802 * gold-threads.cc: Fix typo in error message.
3803 * archive.cc: Fix typos in comments.
3804 * archive.h: Likewise.
3805 * arm-reloc-property.cc: Likewise.
3806 * arm-reloc-property.h: Likewise.
3807 * arm-reloc.def: Likewise.
3808 * arm.cc: Likewise.
3809 * attributes.h: Likewise.
3810 * cref.cc: Likewise.
3811 * ehframe.cc: Likewise.
3812 * fileread.h: Likewise.
3813 * gold.h: Likewise.
3814 * i386.cc: Likewise.
3815 * icf.cc: Likewise.
3816 * incremental.h: Likewise.
3817 * int_encoding.cc: Likewise.
3818 * layout.h: Likewise.
3819 * main.cc: Likewise.
3820 * merge.h: Likewise.
3821 * object.cc: Likewise.
3822 * object.h: Likewise.
3823 * options.cc: Likewise.
3824 * readsyms.cc: Likewise.
3825 * reduced_debug_output.cc: Likewise.
3826 * reloc.cc: Likewise.
3827 * script-sections.cc: Likewise.
3828 * sparc.cc: Likewise.
3829 * symtab.h: Likewise.
3830 * target-reloc.h: Likewise.
3831 * target.cc: Likewise.
3832 * target.h: Likewise.
3833 * timer.cc: Likewise.
3834 * timer.h: Likewise.
3835 * x86_64.cc: Likewise.
3836
83e17bd5
CC
38372010-12-09 Cary Coutant <ccoutant@google.com>
3838
3839 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3840 stack.
3841 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3842 parameter; change all callers.
3843 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3844 * options.h (warn_execstack): New option.
3845
017257f8
DK
38462010-12-07 Doug Kwan <dougkwan@google.com>
3847
3848 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3849 like function call relocations.
3850
c20cbc06
ILT
38512010-12-07 Ian Lance Taylor <iant@google.com>
3852
3853 * archive.cc (Archive::get_elf_object_for_member): Permit
3854 punconfigured to be NULL.
3855 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3856 (Archive::include_member): Pass NULL to get_elf_object_for_member
3857 if we searched for the archive and this is the first included
3858 object.
3859
4dbfafcc
ILT
38602010-12-01 Ian Lance Taylor <iant@google.com>
3861
3862 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3863 track_relocs_type_ field.
3864 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3865 Set track_relocs_type_.
3866 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3867 contents when using RELA relocs.
3868 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3869 reloc_map_.
3870 * reloc.cc (Track_relocs::next_addend): New function.
3871 * reloc.h (class Track_relocs): Declare next_addend.
3872
e5e19edd
ILT
38732010-12-01 Ian Lance Taylor <iant@google.com>
3874
3875 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3876 virtual destructor.
3877
9a5ce24c
ILT
38782010-12-01 Ian Lance Taylor <iant@google.com>
3879
3880 * README: Update compilers known to work and fail.
3881
c7791212
NC
38822010-11-23 Matthias Klose <doko@ubuntu.com>
3883
3884 * configure.in: For --enable-gold, handle value `default' instead of
3885 `both*'. Always install ld as ld.bfd, install as ld if gold is
3886 not the default.
3887 * configure: Regenerate.
3888
0ad220c9
DK
38892010-11-18 Doug Kwan <dougkwan@google.com>
3890
3891 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3892 and right_alignment to be zero. Store result alignment only if it is
3893 greater than existing alignment.
3894
ab8056e0
CC
38952010-11-16 Cary Coutant <ccoutant@google.com>
3896
3897 PR gold/12220
3898 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3899 Check for ".zdebug_line".
3900
fd064a5b
CC
39012010-11-16 Doug Kwan <dougkwan@google.com>
3902 Cary Coutant <ccoutant@google.com>
3903
3904 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3905 by reference; adjust all callers.
3906 * output.cc (Output_segment::set_section_addresses): Adjust references
3907 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3908 list is empty.
3909 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3910 end at page boundary.
3911
6fc6ea19
CC
39122010-11-16 Cary Coutant <ccoutant@google.com>
3913
3914 PR gold/12220
3915 * layout.cc (Layout::choose_output_section): Transform names of
3916 compressed sections even when using a script with a SECTIONS clause.
3917 (Layout::output_section_name): Remove code to transform
3918 compressed debug section names.
3919 * output.cc (Output_section::add_input_section): Use uncompressed
3920 section size when tracking input sections.
3921
95a2c8d6
RS
39222010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3923
3924 * symtab.h (Symbol::NON_PIC_REF): Remove.
3925 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3926 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3927 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3928 (Symbol::use_plt_offset): Take a flags argument and pass it
3929 directly to needs_dynamic_reloc. Restrict check for undefined
3930 weak symbols to function calls.
3931 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3932 (Target_arm::Scan::global): Use it.
3933 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3934 (Target_arm::Relocate::relocate): Likewise.
3935 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3936 parameter with an r_type parameter. Use get_reference_flags
3937 to get the flags.
3938 (Target_arm::Relocate::relocate): Update accordingly.
3939 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3940 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3941 (Target_i386::Scan::global): Likewise.
3942 (Target_i386::Relocate::relocate): Likewise.
3943 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3944 parameter with an r_type parameter. Use get_reference_flags
3945 to get the flags.
3946 (Target_i386::Relocate::relocate): Update accordingly.
3947 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3948 (Target_powerpc::Scan::global): Use it.
3949 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3950 (Target_powerpc::Relocate::relocate): Likewise.
3951 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3952 (Target_sparc::Scan::global): Use it.
3953 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3954 (Target_sparc::Relocate::relocate): Likewise.
3955 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3956 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3957 (Target_x86_64::Scan::global): Likewise.
3958 (Target_x86_64::Relocate::relocate): Likewise.
3959
f625ae50
DK
39602010-11-08 Doug Kwan <dougkwan@google.com>
3961 Cary Coutant <ccoutant@google.com>
3962
3963 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3964 (Arm_exidx_merge_section::section_contents_): New data member.
3965 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3966 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 3967 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
3968 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3969 in parameters instead of calling Object::section_contents without
3970 locking.
3971 (Arm_output_section::group_section): New parameter TASK. Pass it
3972 to callees that need locking objects.
3973 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3974 to lock EXIDX input sections. Fix a formatting issue. Call
3975 Arm_exidx_merged_section::build_contents to create merged section
3976 contents.
3977 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3978 to lock object of stub table owner.
3979 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3980 TEXT_SIZE to initialize data member TEXT_SIZE_.
3981 (Arm_exidx_input_section::addralign): Fix typo in comment.
3982 (Arm_exidx_input_section::text_size): New method.
3983 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3984 that require locking objects. Lock objects before scanning for stubs
3985 and updating local symbols.
3986 (Arm_input_section<big_endian>::init): Copy contents of original
3987 input section.
2e702c99 3988 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
3989 original input section instead of calling Object::section_contents
3990 without locking.
3991 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3992 size without calling Object::section_size().
3993 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3994 for size. Allocate a buffer for merged EXIDX entries.
3995 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 3996 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
3997 building code to Arm_exidx_merged_section::build_contetns. Write
3998 out contetns in buffer instead of building it on the fly.
3999 (Arm_relobj::make_exidx_input_section): Also pass text section size
4000 to Arm_exidx_input_section constructor.
4001 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4002 (Arm_dynobj::do_read_symbols): Fix memory leak.
4003 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4004 * target.h: (class Task): Add forward declaration.
4005 (Target::relax): Add new parameter TASK and pass it to
4006 Target::do_relax().
4007 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4008
5f9bcf58
CC
40092010-11-05 Cary Coutant <ccoutant@google.com>
4010
4011 PR gold/10708
4012 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
4013 object when reading from the file.
4014 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
4015 second layout pass.
4016 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
4017 when reading section contents.
4018 (get_section_contents): Likewise.
4019 (icf::find_identical_sections): Likewise.
4020 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
4021 object when reading from the file.
4022 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
4023 the object when doing deferred section layout.
4024
e597fa08
NC
40252010-11-03 Nick Clifton <nickc@redhat.com>
4026
4027 PR gold/12001
4028 * script.h (class Symbol_assignment: name): New member. Returns
4029 the name of the symbol.
4030 * scrfipt.cc (Script_options::is_pending_assignment): New member.
4031 Returns true if the given symbol name is on the list of
4032 assignments wating to be processed.
4033 * archive.cc (should_incldue_member): If the symbol is undefined,
4034 check to see if it is on the list of symbols pending assignment.
4035
3f9a3278
ILT
40362010-11-03 Ryan Mansfield <rmansfield@qnx.com>
4037
4038 * script-sections.cc (Script_sections::find_memory_region): Check
4039 for a NULL output section pointer.
4040
d06fb4d1
DK
40412010-10-29 Doug Kwan <dougkwan@google.com>
4042
4043 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
4044 Output_section::add_relaxed_input_section.
4045 * output.cc (Output_section::add_relaxed_input_section): Add new
4046 arguments LAYOUT and NAME. Set section order index.
4047 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4048 Copy section order index.
4049 * output.h (Output_section::add_relaxed_input_section): Add new
4050 arguments LAYOUT and NAME.
4051
90e24de5
ILT
40522010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4053
4054 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 4055 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
4056 * testsuite/Makefile.in: Regenerate.
4057
c9484ea5
DK
40582010-10-20 Doug Kwan <dougkwan@google.com>
4059
4060 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
4061 without SHF_LINK_ORDER flags.
4062 * layout.cc (Layout::choose_output_section): Do not filter
4063 SHF_LINK_ORDER flag in a relocatable link.
4064
5bc2f5be
CC
40652010-10-17 Cary Coutant <ccoutant@google.com>
4066
4067 * output.h (Output_segment::set_section_addresses): Change function
4068 signature. Update all callers.
4069 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4070 sections.
4071 (Output_segment::set_section_addresses): Align after last TLS
4072 section. Add padding before last relro section instead of after.
4073
0c91cf04
DK
40742010-10-17 Doug Kwan <dougkwan@google.com>
4075
4076 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4077 GOT output section to be writable.
4078
8c21d9d3
CC
40792010-10-14 Cary Coutant <ccoutant@google.com>
4080
4081 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
4082 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4083 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4084 mode.
4085 * incremental.cc (report_command_line): Ignore all forms of
4086 --incremental.
4087 * layout.cc (Layout::Layout): Check parameters for incremental link
4088 mode.
4089 * options.cc (General_options::parse_incremental): New function.
4090 (General_options::parse_no_incremental): New function.
4091 (General_options::parse_incremental_full): New function.
4092 (General_options::parse_incremental_update): New function.
4093 (General_options::incremental_mode_): New data member.
4094 (General_options::finalize): Check incremental_mode_.
4095 * options.h (General_options): Update help text for --incremental.
4096 Add --no-incremental, --incremental-full, --incremental-update.
4097 (General_options::Incremental_mode): New enum type.
4098 (General_options::incremental_mode): New function.
4099 (General_options::incremental_mode_): New data member.
4100 * parameters.cc (Parameters::incremental_mode_): New data member.
4101 (Parameters::set_options): Set incremental_mode_.
4102 (Parameters::set_incremental_full): New function.
4103 (Parameters::incremental): New function.
4104 (Parameters::incremental_update): New function.
4105 (set_parameters_incremental_full): New function.
4106 * parameters.h (Parameters::set_incremental_full): New function.
4107 (Parameters::incremental): New function.
4108 (Parameters::incremental_update): New function.
4109 (Parameters::incremental_mode_): New data member.
4110 (set_parameters_incremental_full): New function.
4111 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4112 incremental link mode.
4113 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4114 (Sized_relobj::do_relocate_sections): Likewise.
4115 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4116 option.
4117 * testsuite/Makefile.in: Regenerate.
4118 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 4119
bb32aa18 41202010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
4121
4122 * script-sections.h (class Script_sections): Make
4123 Sections_elements typedef public.
4124 * script-sections.cc (class Sort_output_sections): Add elements_
4125 field. Add constructor which sets it; change all callers.
4126 (Sort_output_sections::is_before): New function.
4127 (Sort_output_sections::operator()): Call is_before.
4128 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4129 conditional.
4130 * testsuite/script_test_10.sh: New test. Test script section
4131 order.
4132 * testsuite/script_test_10.t: Likewise.
4133 * testsuite/script_test_10.s: Likewise.
4134 * testsuite/Makefile.am: Wrap the cross linker tests and the
4135 common tests into NATIVE_OR_CROSS_LINKER.
4136 (check_SCRIPTS): Add script_test_10.sh.
4137 (check_DATA): Add script_test_10.stdout.
4138 (script_test_10.o, script_test_10): New targets.
4139 (script_test_10.stdout): New target.
4140 * configure, testsuite/Makefile.in: Regenerate.
4141
3cef7179
ILT
41422010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4143
4144 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4145 error for the deprecated relocations.
4146 (Target_arm::Scan::global): Likewise.
4147 (Target_arm::Relocate::relocate): Likewise.
4148
7411e9a8
RS
41492010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4150
4151 * fileread.cc (Input_file::find_file): Initialize *found_name
4152 and *namep when using the fallback search for case 4.
4153
6a9da32a
CC
41542010-10-11 Cary Coutant <ccoutant@google.com>
4155
4156 * options.h (class General_options): Redefine -z lazy as an alias for
4157 the negation of -z now.
4158
ac897c20
ILT
41592010-10-11 Ian Lance Taylor <iant@google.com>
4160
4161 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4162 binding.
4163
ea5cae92
NC
41642010-10-06 Nick Clifton <nickc@redhat.com>
4165
4166 * script-sections.cc(class Memory_region): Remove
4167 current_lma_offset_ field. Rename current_vma_offset_ to
4168 current_offset_. Add last_section_ field.
4169 (Memory_region::get_current_vma_address): Rename to
4170 get_current_address.
4171 (Memory_region::get_current_lma_address): Delete.
4172 (Memory_region::increment_vma_offset): Rename to
4173 increment_offset.
4174 (Memory_region::increment_lma_offset): Delete.
4175 (Memory_region::attributes_compatible): New method. Returns
4176 true if the provided section is compatible with the region.
4177 (Memory_region::get_last_section): New method. Returns the last
4178 section to use the region.
4179 (Memory_region::set_last_section): New method. Stores the last
4180 section to use the region.
4181 (Script_sections::block_in_region): New method. Returns true if
4182 a block of memory is contained within a region.
4183 (Script_sections::find_memory_region): New method. Locates a
4184 memory region to be used to set a VMA or LMA address.
4185 (Output_section_definition::set_section_addresses): Add code to
4186 check for addresses set by memory regions.
4187 (Output_segment::set_section_addresses): Remove memory region
4188 walking code.
4189 (Script_sections::create_segment): Add a warning if a header
4190 segment is created outside of any region.
4191 * script-sections.h (class Script_sections): Add prototypes for
4192 find_memory_region and block_in_region methods.
4193 * testsuite/memory_test.s: Use .long instead of .word.
4194 * testsuite/memory_test.t: Add some more output sections.
4195 * testsuite/memory_test.sh: Update expected output.
4196
a9bfd952
DK
41972010-10-02 Doug Kwan <dougkwan@google.com>
4198
4199 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4200 defintion to symtab.h
4201 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4202 declaration to defintion.
4203
bacff3ab
NC
42042010-10-01 Nick Clifton <nickc@redhat.com>
4205
4206 * expression.cc (eval): Replace dummy argument with NULL.
4207 (eval_maybe_dot): Check for a NULL result section pointer.
4208 (Symbol_expression::value): Likewise.
4209 (Dot_expression::value): Likewise.
4210 (BINARY_EXPRESSION): Likewise.
4211 (Max_expression::value): Likewise.
4212 (Min_expression::value): Likewise.
4213 (Absolute_expression::value): Likewise.
4214 (Addr_expression::value_from_output_section): Likewise.
4215 (Loaddddr_expression::value_from_output_section): Likewise.
4216 (Segment_start_expression::value): Likewise.
4217 * script-sections.cc
4218 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4219 argument with NULL.
4220 (Sections_elememt_dot_assignment::set_section_addresses):
4221 Likewise.
4222 (Output_data_expression::do_write_to_buffer): Likewise.
4223 (Output_section_definition::finalize_symbols): Likewise.
4224 (Output_section_definition::set_section_addresses): Likewise.
4225
f81bc8b5
DK
42262010-09-30 Doug Kwan <dougkwan@google.com>
4227
4228 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4229
c95e9f27
ST
42302010-09-28 Sriraman Tallam <tmsriram@google.com>
4231
4232 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 4233 function.
c95e9f27
ST
4234 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4235 virtual function.
4236 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4237 virtual function.
4238 * icf.cc (get_section_contents): Inline merge sections only when
4239 target allows it.
4240
3cac54d2
RW
42412010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4242
4243 * configure: Regenerate.
4244
2904037a
ILT
42452010-09-17 Ian Lance Taylor <iant@google.com>
4246
4247 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
4248 * testsuite/Makefile.am (memory_test.o): New target.
4249 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4250 memory_test.t.
4251 * testsuite/Makefile.in: Rebuild.
2904037a 4252
bca7fb63
DK
42532010-09-17 Doug Kwan <dougkwan@google.com>
4254
4255 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4256 defintion if relocation uses GOT entries of the symbol.
4257 * testsuite/icf_safe_test.sh: Fix test.
4258 * testsuite/icf_safe_so_test.sh: Fix test.
4259
4ef28648
CC
42602010-09-16 Cary Coutant <ccoutant@google.com>
4261
4262 * script_sections.cc (class Memory_region): Remove "NULL" from
4263 vector initializations.
4264
793990de
CC
42652010-09-15 Cary Coutant <ccoutant@google.com>
4266
4267 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4268 Resolve forwarding symbols.
4269
81e015e2
DK
42702010-09-15 Doug Kwan <dougkwan@google.com>
4271
4272 * gold/testsuite/script_test_3.t: Add ARM special sections.
4273 * gold/testsuite/script_test_4.t: Same.
4274 * gold/testsuite/script_test_5.t: Same.
4275 * gold/testsuite/script_test_6.t: Same.
4276 * gold/testsuite/script_test_7.t: Same.
4277 * gold/testsuite/script_test_7.t: Same.
4278 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4279
36171d64
CC
42802010-09-14 Cary Coutant <ccoutant@google.com>
4281
4282 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4283 (Target_x86_64::Relocate::relocate_tls): Replace check for
4284 saw_tls_block_reloc_ with test for executable section.
4285
d89051bd
CC
42862010-09-12 Cary Coutant <ccoutant@google.com>
4287
4288 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4289 position-independent executables to shared libraries need dynamic
4290 relocations.
4291 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4292 position-independent executables.
4293 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4294 * testsuite/Makefile.in: Regenerate.
4295
fca41f0f
NC
42962010-09-10 Nick Clifton <nickc@redhat.com>
4297
4298 PR gold/11997
4299 * testsuite/memory_test.t: Discard any sections that are not
4300 needed.
4301
6695e4b3
L
43022010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4303
4304 PR gold/11996
4305 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4306 "This::" to work around a bug in gcc 4.2.
4307
4308 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4309
0f72bf6f
RÁE
43102010-09-09 Rafael Espindola <espindola@google.com>
4311
4312 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4313 sections with different PF_X flags in the same segment.
4314 (Layout::find_first_load_seg): Search all segments to find the first
4315 one.
4316 * options.h (rosegment): New.
4317
43182010-09-08 Rafael Espindola <espindola@google.com>
a6577478 4319
05a79166 4320 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 4321
aa98ff75
DK
43222010-09-08 Doug Kwan <dougkwan@google.com>
4323
4324 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4325 (Arm_relobj::do_relocate_sections): Add new parameter for output
4326 file to match the parent.
4327 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4328 of local symbols instead of input values. Update code to track
4329 changes in gold::relocate_section.
4330 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4331 (Sized_relobj::compute_final_local_value_internal): New methods.
4332 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4333 body into private version of Sized_relobj::compute_final_local_value.
4334 Call the inline method.
4335 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4336 merged symbol value if there is one.
4337 (Symbol_value::has_output_value): New method defintiion.
4338 (Sized_relobj::Compute_final_local_value_status): New enum type.
4339 (Sized_relobj::compute_final_local_value): New methods.
4340 (Sized_relobj::compute_final_local_value_internal): New methods.
4341 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4342 and arm_cortex_a8.sh.
4343 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4344 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4345 New tests.
4346 * Makefile.in: Regenerate.
4347 * testsuite/arm_bl_out_of_range.s: Update test.
4348 * testsuite/thumb_bl_out_of_range.s: Ditto.
4349 * testsuite/thumb_blx_out_of_range.s: Ditto.
4350 * testsuite/arm_branch_out_of_range.sh: New file.
4351 * testsuite/arm_cortex_a8.sh: Ditto.
4352 * testsuite/arm_cortex_a8_b.s: Ditto.
4353 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4354 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4355 * testsuite/arm_cortex_a8_bl.s: Ditto.
4356 * testsuite/arm_cortex_a8_blx.s: Ditto.
4357 * testsuite/arm_cortex_a8_local.s: Ditto.
4358 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4359 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4360
05a79166
L
43612010-09-08 Rafael Espindola <espindola@google.com>
4362
4363 * Makefile.am (memory_test.stdout): Run readelf with -W.
4364 * Makefile.in: Regenerate.
4365 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4366 64 bit output.
4367
33dbc701
RÁE
43682010-09-08 Rafael Espindola <espindola@google.com>
4369
4370 * script-sections.cc (Script_sections::add_memory_region): Convert
4371 field precision to int.
4372 * script.cc (script_set_section_region, script_set_section_region):
4373 Convert field precision to int.
4374
731ca54a
RÁE
43752010-09-08 Rafael Espindola <espindola@google.com>
4376
4377 * arm.cc (do_finalize_sections): Create the __exidx_start and
4378 __exdix_end symbols even when the section is missing.
4379
7f8cd844
NC
43802010-09-08 Nick Clifton <nickc@redhat.com>
4381
4382 * README: Remove claim that MEMORY is not supported.
4383 * expression.cc (script_exp_function_origin)
4384 (script_exp_function_length): Move from here to ...
4385 * script.cc: ... here.
4386 (script_set_section_region, script_add_memory)
4387 (script_parse_memory_attr, script_include_directive): New
4388 functions.
4389 * script-sections.cc
4390 (class Memory_region): New class.
4391 (class Output_section_definition): Add set_memory_region,
4392 set_section_vma, set_section_lma and get_section_name methods.
4393 (class Script_Sections): Add add_memory_region,
4394 find_memory_region, find_memory_region_origin,
4395 find_memory_region_length and set_memory_region methods.
4396 Have set_section_addresses method walk the list of set memory
4397 regions.
4398 Extend the print methos to display memory regions.
4399 * script-sections.h: Add prototypes for new methods.
4400 Add enum for MEMORY region attributes.
4401 * yyscript.y: Add support for parsing MEMORY regions.
4402 * script-c.h: Add prototypes for new functions.
4403 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4404 * testsuite/Makefile.in: Regenerate.
4405 * testsuite/memory_test.sh: New script.
4406 * testsuite/memory_test.s: New assembler source file.
4407 * testsuite/memory_test.t: New linker script.
4408
a4649286
DK
44092010-08-27 Doug Kwan <dougkwan@google.com>
4410
4411 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4412 reference override an existing dynamic weak reference.
4413 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4414 * testsuite/Makefile.in: Regenerate.
4415 * testsuite/dyn_weak_ref.sh: New file.
4416 * testsuite/dyn_weak_ref_1.c: Ditto.
4417 * testsuite/dyn_weak_ref_2.c: Ditto.
4418
b56648ad
ILT
44192010-08-27 Ian Lance Taylor <iant@google.com>
4420
4421 * incremental.h (class Incremental_input_entry): Add virtual
4422 destructor.
4423
809313cb
ILT
44242010-08-27 Ian Lance Taylor <iant@google.com>
4425
4426 * testsuite/start_lib_test_3.c: Mark t3 as used.
4427
11e32464
NC
44282010-08-27 Nick Clifton <nickc@redhat.com>
4429
4430 * options.cc (version_script): Fix small typo in previous
4431 whitespace tidyup.
4432
ca09d69a
NC
44332010-08-25 Nick Clifton <nickc@redhat.com>
4434
4435 * archive.cc: Formatting fixes: Remove whitespace between
4436 typename and following asterisk. Remove whitespace between
4437 function name and opening parenthesis.
4438 * archive.h: Likewise.
4439 * arm.cc: Likewise.
4440 * attributes.cc: Likewise.
4441 * attributes.h: Likewise.
4442 * common.cc: Likewise.
4443 * copy-relocs.cc: Likewise.
4444 * dirsearch.h: Likewise.
4445 * dynobj.cc: Likewise.
4446 * ehframe.cc: Likewise.
4447 * ehframe.h: Likewise.
4448 * expression.cc: Likewise.
4449 * fileread.cc: Likewise.
4450 * fileread.h: Likewise.
4451 * gc.h: Likewise.
4452 * gold-threads.cc: Likewise.
4453 * gold.cc: Likewise.
4454 * i386.cc: Likewise.
4455 * icf.h: Likewise.
4456 * incremental-dump.cc: Likewise.
4457 * incremental.cc: Likewise.
4458 * layout.cc: Likewise.
4459 * layout.h: Likewise.
4460 * main.cc: Likewise.
4461 * merge.cc: Likewise.
4462 * merge.h: Likewise.
4463 * object.cc: Likewise.
4464 * object.h: Likewise.
4465 * options.cc: Likewise.
4466 * options.h: Likewise.
4467 * output.cc: Likewise.
4468 * output.h: Likewise.
4469 * plugin.cc: Likewise.
4470 * plugin.h: Likewise.
4471 * powerpc.cc: Likewise.
4472 * reloc.cc: Likewise.
4473 * script-c.h: Likewise.
4474 * script-sections.cc: Likewise.
4475 * script.cc: Likewise.
4476 * stringpool.cc: Likewise.
4477 * symtab.cc: Likewise.
4478 * symtab.h: Likewise.
4479 * target.cc: Likewise.
4480 * timer.cc: Likewise.
4481 * timer.h: Likewise.
4482 * version.cc: Likewise.
4483 * x86_64.cc: Likewise.
4484
b8fa8750
NC
44852010-08-24 Nick Clifton <nickc@redhat.com>
4486
4487 PR 11899
4488 * layout.cc (segment_precedes): Sort segments by their physical
4489 addresses, if they have been set.
4490
9919d93b
CC
44912010-08-23 Cary Coutant <ccoutant@google.com>
4492
4493 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4494 symbols data.
4495 (Lib_group::include_member): Unlock object after deleting its
4496 symbols data.
4497 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4498 the bug fixed here.
4499
97b4be1c
CC
45002010-08-19 Neil Vachharajani <nvachhar@google.com>
4501 Cary Coutant <ccoutant@google.com>
4502
4503 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4504 constructor, and set_blocker.
4505 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4506 readsyms_blocker_.
4507 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4508 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4509 * testsuite/Makefile.am (start_lib_test): New test case.
4510 * testsuite/Makefile.in: Regenerate.
4511 * testsuite/start_lib_test_main.c: New file.
4512 * testsuite/start_lib_test_1.c: New file.
4513 * testsuite/start_lib_test_2.c: New file.
4514 * testsuite/start_lib_test_3.c: New file.
4515
dd0b1884
ILT
45162010-08-19 Ian Lance Taylor <iant@google.com>
4517
4518 * Makefile.in: Rebuild with automake 1.11.1.
4519 * aclocal.m4: Likewise.
4520 * testsuite/Makefile.in: Likewise.
4521
7223e9ca
ILT
45222010-08-19 Ian Lance Taylor <iant@google.com>
4523
4524 PR 10893
4525 * i386.cc (class Output_data_plt_i386): Update declarations.
4526 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4527 local_ifuncs_ fields.
4528 (Target_i386::do_plt_section_for_global): New function.
4529 (Target_i386::do_plt_section_for_local): New function.
4530 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4531 parameter; change all callers. Initialize global_ifuncs_ and
4532 local_ifuncs_. If doing a static link define __rel_iplt_start and
4533 __rel_iplt_end.
4534 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4535 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4536 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4537 symbols.
4538 (Target_i386::make_plt_section): New function, broken out of
4539 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4540 (Target_i386::make_plt_entry): Call make_plt_section.
4541 (Target_i386::make_local_ifunc_plt_entry): New function.
4542 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4543 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4544 R_386_IRELATIVE to switch.
4545 (Target_i386::Scan::global): Likewise.
4546 (Target_i386::Relocate::relocate): Likewise.
4547 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4548 switch.
4549 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4550 (Target_x86_64::do_plt_section_for_global): New function.
4551 (Target_x86_64::do_plt_section_for_local): New function.
4552 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4553 parameter; change all callers. If doing a static link define
4554 __rela_iplt_start and __rela_iplt_end.
4555 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4556 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4557 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4558 to point to .plt.
4559 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4560 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4561 switch.
4562 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4563 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4564 R_X86_64_IRELATIVE to switch.
4565 (Target_x86_64::Scan::global): Likewise.
4566 (Target_x86_64::Relocate::relocate): Likewise.
4567 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4568 switch.
4569 * target.h (class Target): Add plt_section_for_global and
4570 plt_section_for_local functions. Add do_plt_section_for_global
4571 and do_plt_section_for_local virtual functions.
4572 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4573 clarifying comments.
4574 (Symbol::use_plt_offset): Handle IFUNC symbol.
4575 * object.cc (Sized_relobj::Sized_relobj): Initialize
4576 local_plt_offsets_.
4577 (Sized_relobj::local_has_plt_offset): New function.
4578 (Sized_relobj::local_plt_offset): New function.
4579 (Sized_relobj::set_local_plt_offset): New function.
4580 (Sized_relobj::do_count): Handle IFUNC symbol.
4581 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4582 a bit away from input_shndx_ field. Add set_is_func_symbol and
4583 is_ifunc_symbol functions.
4584 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4585 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4586 local_plt_offsets_ field.
4587 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4588 * output.h (class Output_section_data): Add non-const
4589 output_section function.
4590 (class Output_data_got): Update declarations.
4591 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4592 Add use_plt_offset parameter to global and local constructors.
4593 Change all callers. Change local_sym_index_ field to 31 bits.
4594 Change GSYM_CODE and CONSTANT_CODE accordingly.
4595 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4596 doing a static link don't set sh_link field.
4597 (Output_data_got::Got_entry::write): Use PLT offset if
4598 appropriate.
4599 (Output_data_got::add_global_plt): New function.
4600 (Output_data_got::add_local_plt): New function.
4601 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4602 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4603 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4604 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4605 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4606 IFUNC conditional.
4607 * testsuite/ifunc-sel.h: New file.
4608 * testsuite/ifuncmain1.c: New file.
4609 * testsuite/ifuncmain1vis.c: New file.
4610 * testsuite/ifuncmod1.c: New file.
4611 * testsuite/ifuncdep2.c: New file.
4612 * testsuite/ifuncmain2.c: New file.
4613 * testsuite/ifuncmain3.c: New file.
4614 * testsuite/ifuncmod3.c: New file.
4615 * testsuite/ifuncmain4.c: New file.
4616 * testsuite/ifuncmain5.c: New file.
4617 * testsuite/ifuncmod5.c: New file.
4618 * testsuite/ifuncmain6pie.c: New file.
4619 * testsuite/ifuncmod6.c: New file.
4620 * testsuite/ifuncmain7.c: New file.
4621 * configure, testsuite/Makefile.in: Rebuild.
4622
56f75c03
ILT
46232010-08-18 Ian Lance Taylor <iant@google.com>
4624
4625 * incremental.cc
4626 (Output_section_incremental_inputs::write_input_files): Add cast
4627 to avoid signed/unsigned comparison warning.
4628 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4629
55455f89
CC
46302010-08-12 Cary Coutant <ccoutant@google.com>
4631
4632 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4633
e2054bcb
ILT
46342010-08-13 Ian Lance Taylor <iant@google.com>
4635
4636 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4637
74f67560
DK
46382010-08-12 Cary Coutant <ccoutant@google.com>
4639 Doug Kwan <dougkwan@google.com>
4640
4641 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4642 defintion overrides non-weak undef, remember that the original undef
4643 is not weak.
4644 * symtab.cc (Symbol_table::sized_write_global): For undef without
4645 an original weak binding, set binding to global in output.
4646 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4647 * testsuite/Makefile.in: Regenerate.
4648 * testsuite/strong_ref_weak_def.sh: New file.
4649 * testsuite/strong_ref_weak_def_1.c: Ditto.
4650 * testsuite/strong_ref_weak_def_2.c: Ditto.
4651
d1238d12
CC
46522010-08-12 Cary Coutant <ccoutant@google.com>
4653
4654 * testsuite/incremental_test.sh: Rewrite.
4655 * testsuite/incremental_test_1.c: Rewrite.
4656 * testsuite/incremental_test_2.c: Rewrite.
4657
0e70b911
CC
46582010-08-12 Cary Coutant <ccoutant@google.com>
4659
4660 * arm.cc (Target_arm::got_size): Add const.
4661 (Target_arm::got_entry_count): New function.
4662 (Target_arm::plt_entry_count): New function.
4663 (Target_arm::first_plt_entry_offset): New function.
4664 (Target_arm::plt_entry_size): New function.
4665 (Output_data_plt_arm::entry_count): New function.
4666 (Output_data_plt_arm::first_plt_entry_offset): New function.
4667 (Output_data_plt_arm::get_plt_entry_size): New function.
4668 * i386.cc (Target_i386::got_size): Add const.
4669 (Target_i386::got_entry_count): New function.
4670 (Target_i386::plt_entry_count): New function.
4671 (Target_i386::first_plt_entry_offset): New function.
4672 (Target_i386::plt_entry_size): New function.
4673 (Output_data_plt_i386::entry_count): New function.
4674 (Output_data_plt_i386::first_plt_entry_offset): New function.
4675 (Output_data_plt_i386::get_plt_entry_size): New function.
4676 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4677 find_incremental_inputs_sections. Dump incremental_got_plt section.
4678 * incremental.cc: Include target.h.
4679 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4680 parameter. Adjust all callers. Find incremental_got_plt section.
4681 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4682 section.
4683 (Output_section_incremental_inputs::set_final_data_size): Calculate
4684 size of incremental_got_plt section.
4685 (Output_section_incremental_inputs::do_write): Write the
4686 incremental_got_plt section.
4687 (Got_plt_view_info): New struct.
4688 (Local_got_offset_visitor): New class.
4689 (Global_got_offset_visitor): New class.
4690 (Global_symbol_visitor_got_plt): New class.
4691 (Output_section_incremental_inputs::write_got_plt): New function.
4692 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4693 Add parameter. Adjust all callers.
4694 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4695 (Incremental_inputs::got_plt_section): New function.
4696 (Incremental_inputs::got_plt_section_): New data member.
4697 (Incremental_got_plt_reader): New class.
4698 * layout.cc (Layout::create_incremental_info_sections): Add the
4699 incremental_got_plt section.
4700 * object.h (Got_offset_list::get_list): New function.
4701 (Got offset_list::for_all_got_offsets): New function.
4702 (Sized_relobj::local_got_offset_list): New function.
4703 * powerpc.cc (Target_powerpc::got_size): Add const.
4704 (Target_powerpc::got_entry_count): New function.
4705 (Target_powerpc::plt_entry_count): New function.
4706 (Target_powerpc::first_plt_entry_offset): New function.
4707 (Target_powerpc::plt_entry_size): New function.
4708 (Output_data_plt_powerpc::entry_count): New function.
4709 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4710 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4711 * sparc.cc (Target_sparc::got_size): Add const.
4712 (Target_sparc::got_entry_count): New function.
4713 (Target_sparc::plt_entry_count): New function.
4714 (Target_sparc::first_plt_entry_offset): New function.
4715 (Target_sparc::plt_entry_size): New function.
4716 (Output_data_plt_sparc::entry_count): New function.
4717 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4718 (Output_data_plt_sparc::get_plt_entry_size): New function.
4719 * symtab.h (Symbol::got_offset_list): New function.
4720 (Symbol_table::for_all_symbols): New function.
4721 * target.h (Sized_target::got_entry_count): New function.
4722 (Sized_target::plt_entry_count): New function.
4723 (Sized_target::plt_entry_size): New function.
4724 * x86_64.cc (Target_x86_64::got_size): Add const.
4725 (Target_x86_64::got_entry_count): New function.
4726 (Target_x86_64::plt_entry_count): New function.
4727 (Target_x86_64::first_plt_entry_offset): New function.
4728 (Target_x86_64::plt_entry_size): New function.
4729 (Output_data_plt_x86_64::entry_count): New function.
4730 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4731 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4732
09ec0418
CC
47332010-08-12 Cary Coutant <ccoutant@google.com>
4734
4735 * archive.cc: Include incremental.h.
4736 (Archive::Archive): Initialize incremental_info_.
4737 (Archive::include_member): Record archive members in incremental info.
4738 (Add_archive_symbols::run): Record begin and end of an archive in
4739 incremental info.
4740 (Lib_group::include_member): Record objects in incremental info.
4741 * archive.h (Incremental_archive_entry): Forward declaration.
4742 (Archive::set_incremental_info): New member function.
4743 (Archive::incremental_info): New member function.
4744 (Archive::Unused_symbol_iterator): New class.
4745 (Archive::unused_symbols_begin): New member function.
4746 (Archive::unused_symbols_end): New member function.
4747 (Archive::incremental_info_): New data member.
4748 * incremental-dump.cc (find_input_containing_global): New function.
4749 (dump_incremental_inputs): Dump new incremental info sections.
4750 * incremental.cc: Include symtab.h.
4751 (Output_section_incremental_inputs): New class.
4752 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4753 new incremental info sections.
4754 (Sized_incremental_binary::do_check_inputs): Likewise.
4755 (Incremental_inputs::report_archive): Remove.
4756 (Incremental_inputs::report_archive_begin): New function.
4757 (Incremental_inputs::report_archive_end): New function.
4758 (Incremental_inputs::report_object): New function.
4759 (Incremental_inputs::finalize_inputs): Remove.
4760 (Incremental_inputs::report_input_section): New function.
4761 (Incremental_inputs::report_script): Rewrite.
4762 (Incremental_inputs::finalize): Do nothing but finalize string table.
4763 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4764 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4765 (Incremental_inputs::create_data_sections): New function.
4766 (Incremental_inputs::relocs_entsize): New function.
4767 (Output_section_incremental_inputs::set_final_data_size): New function.
4768 (Output_section_incremental_inputs::do_write): New function.
4769 (Output_section_incremental_inputs::write_header): New function.
4770 (Output_section_incremental_inputs::write_input_files): New function.
4771 (Output_section_incremental_inputs::write_info_blocks): New function.
4772 (Output_section_incremental_inputs::write_symtab): New function.
4773 * incremental.h (Incremental_script_entry): Forward declaration.
4774 (Incremental_object_entry): Forward declaration.
4775 (Incremental_archive_entry): Forward declaration.
4776 (Incremental_inputs): Forward declaration.
4777 (Incremental_inputs_header_data): Remove.
4778 (Incremental_inputs_header): Remove.
4779 (Incremental_inputs_header_write): Remove.
4780 (Incremental_inputs_entry_data): Remove.
4781 (Incremental_inputs_entry): Remove.
4782 (Incremental_inputs_entry_write): Remove.
4783 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4784 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4785 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4786 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4787 Likewise.
4788 (Incremental_input_entry): New class.
4789 (Incremental_script_entry): New class.
4790 (Incremental_object_entry): New class.
4791 (Incremental_archive_entry): New class.
4792 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4793 (Incremental_inputs::report_inputs): Remove.
4794 (Incremental_inputs::report_archive): Remove.
4795 (Incremental_inputs::report_archive_begin): New function.
4796 (Incremental_inputs::report_archive_end): New function.
4797 (Incremental_inputs::report_object): Change prototype.
4798 (Incremental_inputs::report_input_section): New function.
4799 (Incremental_inputs::report_script): Change prototype.
4800 (Incremental_inputs::get_reloc_count): New function.
4801 (Incremental_inputs::set_reloc_count): New function.
4802 (Incremental_inputs::create_data_sections): New function.
4803 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4804 (Incremental_inputs::inputs_section): New function.
4805 (Incremental_inputs::symtab_section): New function.
4806 (Incremental_inputs::relocs_section): New function.
4807 (Incremental_inputs::get_stringpool): Add const.
4808 (Incremental_inputs::command_line): Add const.
4809 (Incremental_inputs::inputs): Remove.
4810 (Incremental_inputs::command_line_key): New function.
4811 (Incremental_inputs::input_file_count): New function.
4812 (Incremental_inputs::input_files): New function.
4813 (Incremental_inputs::relocs_entsize): New function.
4814 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4815 (Incremental_inputs::finalize_inputs): Remove.
4816 (Incremental_inputs::Input_info): Remove.
4817 (Incremental_inputs::lock_): Remove.
4818 (Incremental_inputs::inputs_): Change type.
4819 (Incremental_inputs::inputs_map_): Remove.
4820 (Incremental_inputs::current_object_entry_): New data member.
4821 (Incremental_inputs::inputs_section_): New data member.
4822 (Incremental_inputs::symtab_section_): New data member.
4823 (Incremental_inputs::relocs_section_): New data member.
4824 (Incremental_inputs::reloc_count_): New data member.
4825 (Incremental_inputs_reader): New class.
4826 (Incremental_symtab_reader): New class.
4827 (Incremental_relocs_reader): New class.
4828 * layout.cc (Layout::finalize): Move finalization of incremental info
4829 and creation of incremental info sections to follow finalization of
4830 symbol table. Set offsets for postprocessing sections.
4831 (Layout::create_incremental_info_sections): Call
4832 Incremental_inputs::create_data_sections. Add incremental symtab
4833 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4834 sections to layout after input sections.
4835 * layout.h (struct Timespec): Forward declaration.
4836 (Layout::incremental_inputs): Add const.
4837 (Layout::create_incremental_info_sections): Add parameter.
4838 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4839 * object.cc: Include incremental.h.
4840 (Relobj::finalize_incremental_relocs): New function.
4841 (Sized_relobj::do_layout): Record input sections in incremental info.
4842 * object.h (Object::output_section): New function.
4843 (Object::output_section_offset): Moved from Relobj.
4844 (Object::get_incremental_reloc_base): New function.
4845 (Object::get_incremental_reloc_count): New function.
4846 (Object::do_output_section): New function.
4847 (Object::do_output_section_offset): Moved from Relobj.
4848 (Object::do_get_incremental_reloc_base): New function.
4849 (Object::do_get_incremental_reloc_count): New function.
4850 (Object::Object): Initialize new data members.
4851 (Relobj::output_section): Renamed do_output_section and moved to
4852 protected.
4853 (Relobj::output_section_offset): Moved to Object.
4854 (Relobj::do_get_incremental_reloc_base): New function.
4855 (Relobj::do_get_incremental_reloc_count): New function.
4856 (Relobj::allocate_incremental_reloc_counts): New function.
4857 (Relobj::count_incremental_reloc): New function.
4858 (Relobj::finalize_incremental_relocs): New function.
4859 (Relobj::next_incremental_reloc_index): New function.
4860 (Relobj::reloc_counts_): New data member.
4861 (Relobj::reloc_bases_): New data member.
4862 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4863 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4864 (Sized_relobj::incremental_relocs_scan): New function.
4865 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4866 (Sized_relobj::incremental_relocs_write): New function.
4867 (Sized_relobj::incremental_relocs_write_reltype): New function.
4868 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4869 incremental link.
4870 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4871 archives and object files elsewhere.
4872 (Add_symbols::run): Report object files here.
4873 (Finish_group::run): Report end of archive at end of group.
4874 * reloc.cc: Include layout.h, incremental.h.
4875 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4876 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4877 (Sized_relobj::incremental_relocs_scan): New function.
4878 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4879 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4880 (Sized_relobj::incremental_relocs_write): New function.
4881 (Sized_relobj::incremental_relocs_write_reltype): New function.
4882 * script.cc (read_input_script): Rewrite test for incremental link.
4883 Change call to Incremental_inputs::report_script.
4884 * symtab.h (Symbol_table::first_global_index): New function.
4885 (Symbol_table::output_count): New function.
4886
ce0d1972
DK
48872010-08-12 Doug Kwan <dougkwan@google.com>
4888
4889 * arm.cc (Target_arm::merge_object_attributes): Check command line
4890 options --no-wchar-size-warning and --no-enum-size-warning.
4891 * options.h (General_options): Add ld-compatible options
4892 --no-enum-size-warning and --no-wchar-size-warning.
4893
6e5710ce
ILT
48942010-08-04 Ian Lance Taylor <iant@google.com>
4895
4896 * x86_64.cc (Target_x86_64::Scan::local): Use
4897 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4898 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4899 (Target_x86_64::Scan::global): Likewise.
4900 (Target_x86_64::Relocate::relocate): Likewise.
4901 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4902 Likewise.
4903
fef830db
CC
49042010-08-03 Cary Coutant <ccoutant@google.com>
4905
4906 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4907 to reserve space in merged_strings vector. Keep total input size
4908 for stats.
4909 (Output_merge_string::do_print_merge_stats): Print total input size.
4910 * merge.h (Output_merge_string): Add input_size_ field.
4911 * stringpool.cc (Stringpool_template::string_length): Move
4912 implementations out of Stringpool_template class and place in
4913 stringpool.h.
4914 * stringpool.h (string_length): Move out of Stringpool_template.
4915
1e3811b0
ILT
49162010-08-03 Ian Lance Taylor <iant@google.com>
4917
4918 PR 11712
4919 * layout.cc (relaxation_loop_body): If address of load segment is
4920 set, adjust address to include headers if possible.
4921
7af0c620
ILT
49222010-08-03 Ian Lance Taylor <iant@google.com>
4923
4924 * version.cc (version_string): Bump to 1.10.
4925
22f0da72
ILT
49262010-08-03 Ian Lance Taylor <iant@google.com>
4927
4928 PR 11805
4929 * layout.h (enum Output_section_order): Define.
4930 (class Layout): Update declarations.
4931 * layout.cc (Layout::get_output_section): Add order parameter.
4932 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4933 is_first_non_relro parameters. Change all callers.
4934 (Layout::choose_output_section): Likewise.
4935 (Layout::add_output_section_data): Likewise.
4936 (Layout::make_output_section): Likewise. Set order.
4937 (Layout::default_section_order): New function.
4938 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4939 * output.cc (Output_section::Output_section): Initialize order_.
4940 Don't initialize deleted fields.
4941 (Output_segment::Output_segment): Don't initialize deleted
4942 fields.
4943 (Output_segment::add_output_section_to_load): New function
4944 replacing add_output_section. Change all callers to call this or
4945 add_output_section_to_nonload.
4946 (Output_segment::add_output_section_to_nonload): New function.
4947 (Output_segment::remove_output_section): Rewrite.
4948 (Output_segment::add_initial_output_data): Likewise.
4949 (Output_segment::has_any_data_sections): Likewise.
4950 (Output_segment::is_first_section_relro): Likewise.
4951 (Output_segment::maximum_alignment): Likewise.
4952 (Output_segment::has_dynamic_reloc): New function replacing
4953 dynamic_reloc_count. Change all callers.
4954 (Output_segment::has_dynamic_reloc_list): New function replacing
4955 dynamic_reloc_count_list. Change all callers.
4956 (Output_segment::set_section_addresses): Rewrite.
4957 (Output_segment::set_offset): Rewrite.
4958 (Output_segment::find_first_and_last_list): Remove.
4959 (Output_segment::set_tls_offsets): Rewrite.
4960 (Output_segment::first_section_load_address): Likewise.
4961 (Output_segment::output_section_count): Likewise.
4962 (Output_segment::section_with_lowest_load_address): Likewise.
4963 (Output_segment::write_section_headers): Likewise.
4964 (Output_segment::print_sections_to_map): Likewise.
4965 * output.h (class Output_data): Remove dynamic_reloc_count_
4966 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4967 (Output_data::add_dynamic_reloc): Rewrite.
4968 (Output_data::has_dynamic_reloc): New function.
4969 (Output_data::dynamic_reloc_count): Remove.
4970 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4971 is_last_relro_, is_first_non_relro_, is_interp_,
4972 is_dynamic_linker_section_ fields. Add order and set_order
4973 functions. Remove is_relro_local, set_is_relro_local,
4974 is_last_relro, set_is_last_relro, is_first_non_relro,
4975 set_is_first_non_relro functions, is_interp, set_is_interp,
4976 is_dynamic_linker_section, and set_is_dynamic_linker_section
4977 functions.
4978 (class Output_segment): Change Output_data_list from std::list to
4979 std:;vector. Add output_lists_ field. Remove output_data_ and
4980 output_bss_ fields. Update declarations.
4981
3ff2ccb0
ILT
49822010-08-02 Ian Lance Taylor <iant@google.com>
4983
4984 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4985 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4986 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4987
88a4108b
ILT
49882010-08-02 Ian Lance Taylor <iant@google.com>
4989
4990 PR 11855
4991 * script.cc (Script_options::Script_options): Initialize
4992 symbol_definitions_ and symbol_references_.
4993 (Script_options::add_symbol_assignment): Update
4994 symbol_definitions_ and symbol_references_.
4995 (Script_options::add_symbol_reference): New function.
4996 (script_symbol): New function.
4997 * script.h (class Script_options): Add symbol_definitions_ and
4998 symbol_references_ fields.
4999 (Script_options::referenced_const_iterator): New type.
5000 (Script_options::referenced_begin): New function.
5001 (Script_options::referenced_end): New function.
5002 (Script_options::is_referenced): New function.
5003 (Script_options::any_unreferenced): New function.
5004 * script-c.h (script_symbol): Declare.
5005 * yyscript.y (exp): Call script_symbol.
5006 * symtab.cc: Include "script.h".
5007 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5008 Change all callers. Check symbols referenced by scripts.
5009 (Symbol_table::add_undefined_symbols_from_command_line): Add
5010 layout parameter. Change all callers.
5011 (Symbol_table::do_add_undefined_symbols_from_command_line):
5012 Likewise. Break out loop body. Check symbols referenced by
5013 scripts.
5014 (Symbol_table::add_undefined_symbol_from_command_line): New
5015 function broken out of
5016 do_add_undefined_symbols_from_command_line.
5017 * symtab.h (class Symbol_table): Update declarations.
5018 * archive.cc: Include "layout.h".
5019 (Archive::should_include_member): Add layout parameter. Change
5020 all callers. Check for symbol mentioned in expression.
5021 * archive.h (class Archive): Update declaration.
5022 * object.cc (Sized_relobj::do_should_include_member): Add layout
5023 parameter.
5024 * object.h (Object::should_include_member): Add layout parameter.
5025 Change all callers.
5026 (Object::do_should_include_member): Add layout parameter.
5027 (class Sized_relobj): Update declaration.
5028 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
5029 parameter.
5030 * dynobj.h (class Sized_dynobj): Update declaration.
5031 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
5032 layout parameter.
5033 * plugin.h (class Sized_pluginobj): Update declaration.
5034
5f1ab67a
ILT
50352010-08-02 Ian Lance Taylor <iant@google.com>
5036
5037 PR 11866
5038 * output.cc (Output_segment::set_offset): Search for the first and
5039 last sections rather than assuming that the list is in order.
5040 (Output_segment::find_first_and_last_list): New function.
5041 * output.h (class Output_segment): Update declarations.
5042 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
5043 (relro_strip_test_SOURCES): New variable.
5044 (relro_strip_test_DEPENDENCIES): New variable.
5045 (relro_strip_test_LDFLAGS): New variable.
5046 (relro_strip_test_LDADD): New variable.
5047 (relro_strip_test.so): New target.
5048
a8df5856
ILT
50492010-08-02 Ian Lance Taylor <iant@google.com>
5050
5051 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
5052 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
5053 (Target_i386::got_tlsdesc_section): New function.
5054 (Target_i386::got_section): Create space for GOT entries for
5055 TLSDESC relocations.
5056 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
5057 R_386_TLS_GOTDESC.
5058 (Target_i386::Scan::global): Likewise.
5059 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
5060 using TLSDESC GOT.
5061 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
5062 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
5063 (Target_x86_64::got_tlsdesc_section): New function.
5064 (Target_x86_64::got_section): Create space for GOT entries for
5065 TLSDESC relocations.
5066 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5067 R_386_TLS_GOTDESC.
5068 (Target_x86_64::Scan::global): Likewise.
5069 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5070 using TLSDESC GOT.
5071
0c10a0a6
ILT
50722010-08-02 Ian Lance Taylor <iant@google.com>
5073
5074 * testsuite/final_layout.sh: Use dc to convert from hex to
5075 decimal.
5076
41cbeecc
ST
50772010-07-29 Sriraman Tallam <tmsriram@google.com>
5078
5079 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5080 paramter to the call to gold::gc_process_relocs.
5081 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5082 paramter to the call to gold::gc_process_relocs.
5083 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5084 parameter to the call to gold::gc_process_relocs.
5085 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5086 template parameter to the call to gold::gc_process_relocs.
5087 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5088 paramter to the call to gold::gc_process_relocs.
5089 * gc.h (get_embedded_addend_size): New function.
5090 (gc_process_relocs): Save the size of the reloc for use by ICF.
5091 * icf.cc (get_section_contents): Get the addend from the text section
5092 for SHT_REL relocation sections.
5093 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5094 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5095 * int_encoding.h (read_from_pointer): New overloaded function.
5096 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5097 * testsuite/icf_sht_rel_addend_test.sh: New file.
5098 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5099 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5100
6ea55b82
RW
51012010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5102
5103 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5104 * Makefile.in: Regenerate.
5105 * testsuite/Makefile.in: Regenerate.
5106
9691462b
ILT
51072010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5108
5109 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5110 * gold/testsuite/debug_msg.cc: Likewise.
5111 * gold/testsuite/odr_violation1.cc
5112 * gold/testsuite/odr_violation2.cc
5113
76897331
CC
51142010-07-21 Cary Coutant <ccoutant@google.com>
5115
5116 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5117 string, and length fields.
5118 (Output_merge_string::Merged_strings_list): New type.
5119 (Output_merge_string::Merged_strings_lists): New typedef.
5120 (Output_merge_string): Replace merged_strings_ with
5121 merged_strings_lists_.
5122 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5123 Merged_strings_list per input object and section. Don't store pointer
5124 to the string. Don't store length with each merged string entry.
5125 (Output_merge_string::finalize_merged_data): Loop over list of merged
5126 strings lists. Recompute length of each merged string.
5127
78384e8f
CC
51282010-07-15 Cary Coutant <ccoutant@google.com>
5129
5130 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5131 here.
5132
783659f9
ILT
51332010-07-14 Ian Lance Taylor <iant@google.com>
5134
5135 * descriptors.cc (Descriptors::open): Report correct name in error
5136 message.
5137
131687b4
DK
51382010-07-13 Doug Kwan <dougkwan@google.com>
5139
5140 * arm.cc (Arm_input_section::Arm_input_section): For a
5141 SHT_ARM_EXIDX section, always keeps the input sections.
5142 (Arm_input_section::set_exidx_section_link): New method.
5143 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5144 has_errors_ to false.
5145 (Arm_exidx_input_section::has_errors,
5146 Arm_exidx_input_section::set_has_errors): New methods.
5147 (Arm_exidx_input_section::has_errors_): New data member.
5148 (Arm_relobj::get_exidx_shndx_list): New method.
5149 (Arm_output_section::append_text_sections_to_list): Do not skip
5150 section without SHF_EXECINSTR.
5151 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5152 errors.
2e702c99 5153 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
5154 section header. Make error messages more verbose. Check for
5155 a non-executable section linked to an EXIDX section.
5156 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5157 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5158 check that there is no deferred EXIDX section if we exit early.
5159 Instead of not making an EXIDX section in case of an error, make one
5160 and set the has_errors flag of it.
5161 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5162 in a relocatable link.
5163 (Target_arm::do_relax): Look for the EXIDX output section instead of
5164 assuming that it is called .ARM.exidx.
2e702c99 5165 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
5166 section list. Do not check for SHF_EXECINSTR section flags but
5167 skip any input section with errors.
5168 * output.cc (Output_section::Output_section): Initialize
5169 always_keeps_input_sections_ to false.
5170 (Output_section::add_input_section): Check for
5171 always_keeps_input_sections_.
5172 * output.h (Output_section::always_keeps_input_sections,
5173 Output_section::set_always_keeps_input_sections): New methods.
5174 (Output_section::always_keeps_input_sections): New data member.
5175
69517287
RÁE
51762010-07-13 Rafael Espindola <espindola@google.com>
5177
5178 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5179 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5180
82742395
ILT
51812010-07-13 Philip Herron <herron.philip@googlemail.com>
5182 Ian Lance Taylor <iant@google.com>
5183
5184 * output.h (Output_section_lookup_maps::add_merge_section):
5185 Correct check of whether value was inserted.
5186 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5187 (Output_section_lookup_maps::add_relaxed_input_section):
5188 Likewise.
5189 * arm.cc (Target_arm::got_section): Remove used local os.
5190 * i386.cc (Target_i386::got_section): Likewise.
5191 * x86_64.cc (Target_x86_64::got_section): Likewise.
5192 * sparc.cc (Target_sparc::got_section): Likewise.
5193 (Target_sparc::relocate): Remove unused local have_got_offset.
5194 * powerpc.cc (Target_powerpc::relocate): Likewise.
5195
f2d707b5
ILT
51962010-07-13 Ian Lance Taylor <iant@google.com>
5197
241531d6
ILT
5198 * compressed_output.cc (zlib_decompress): Fix signature in
5199 !HAVE_ZLIB_H case.
5200
f2d707b5
ILT
5201 * archive.cc (Archive::include_member): Unlock an external member
5202 of a thin archive. Don't bother to delete an object we know is
5203 NULL.
5204
a2e47362
CC
52052010-07-12 Cary Coutant <ccoutant@google.com>
5206
5207 * compressed_output.cc (zlib_decompress): New function.
5208 (get_uncompressed_size): New function.
5209 (decompress_input_section): New function.
5210 * compressed_output.h (get_uncompressed_size): New function.
5211 (decompress_input_section): New function.
5212 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5213 Handle compressed debug sections.
5214 * layout.cc (is_compressed_debug_section): New function.
5215 (Layout::output_section_name): Map compressed section names to
5216 canonical names.
5217 * layout.h (is_compressed_debug_section): New function.
5218 (is_debug_info_section): Recognize compressed debug sections.
5219 * merge.cc: Include compressed_output.h.
5220 (Output_merge_data::do_add_input_section): Handle compressed
5221 debug sections.
5222 (Output_merge_string::do_add_input_section): Handle compressed
5223 debug sections.
5224 * object.cc: Include compressed_output.h.
5225 (Sized_relobj::Sized_relobj): Initialize new data members.
5226 (build_compressed_section_map): New function.
5227 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5228 * object.h (Object::section_is_compressed): New method.
5229 (Object::do_section_is_compressed): New method.
5230 (Sized_relobj::Compressed_section_map): New type.
5231 (Sized_relobj::do_section_is_compressed): New method.
5232 (Sized_relobj::compressed_sections_): New data member.
5233 * output.cc (Output_section::add_input_section): Handle compressed
5234 debug sections.
5235 * reloc.cc: Include compressed_output.h.
5236 (Sized_relobj::write_sections): Handle compressed debug sections.
5237
ce279a62
CC
52382010-07-08 Cary Coutant <ccoutant@google.com>
5239
5240 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5241 weak when resolving to a dynamic def.
5242 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5243 for weak undef/dynamic def cases. Adjust callers.
5244 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5245 undef_binding_weak_.
5246 (Symbol_table::sized_write_globals): Adjust symbol binding.
5247 (Symbol_table::sized_write_symbol): Add binding parameter.
5248 * symtab.h (Symbol::set_undef_binding): New method.
5249 (Symbol::is_undef_binding_weak): New method.
5250 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5251 (Symbol_table::should_override): Add new parameter.
5252 (Symbol_table::sized_write_symbol): Add new parameter.
5253
5254 * testsuite/weak_undef_file1.cc: Add new test case.
5255 * testsuite/weak_undef_file2.cc: Fix header comment.
5256 * testsuite/weak_undef_test.cc: Add new test case.
5257
b2286c10
DK
52582010-06-29 Doug Kwan <dougkwan@google.com>
5259
5260 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5261 Initialize USE_SYMBOL_.
5262 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5263 definition.
5264 (Arm_reloc_property::uses_symbol_): New data member declaration.
5265 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5266 uses symbol value and symbol is undefined but not weakly undefined.
5267
4802450a
RÁE
52682010-06-28 Rafael Espindola <espindola@google.com>
5269
5270 * plugin.cc (Plugin::load): Use dlerror.
5271
e5ca47ba
ILT
52722010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5273
5274 * symtab.cc (detect_odr_violations): When reporting an ODR
5275 violation, report an object where the symbol is defined.
5276
8a75a161
DK
52772010-06-25 Doug Kwan <dougkwan@google.com>
5278
5279 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5280 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5281 definition.
5282 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5283 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5284 target hook to detect function points.
5285 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5286 * icf.h (Icf::check_section_for_function_pointers): Change type of
5287 parameter SECTION_NAME to const reference to std::string. Use
5288 target hook to determine if section may have unsafe pointers.
5289 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5290 method definition.
5291
42218b9f
RÁE
52922010-06-21 Rafael Espindola <espindola@google.com>
5293
5294 * fileread.cc (Input_file::find_fie): New
5295 (Input_file::open): Use Input_file::find_fie.
5296 * fileread.h (Input_file::find_fie): New
5297 * plugin.cc (set_extra_library_path): New.
5298 (Plugin::load): Add set_extra_library_path to the transfer vector.
5299 (Plugin_manager::set_extra_library_path): New.
5300 (Plugin_manager::add_input_file): Use the extra search path if set.
5301 (set_extra_library_path(): New.
5302 * plugin.h (Plugin_manager): Add set_extra_library_path and
5303 extra_search_path_.
5304
a0506cca
CC
53052010-06-19 Cary Coutant <ccoutant@google.com>
5306
5307 * layout.cc (gdb_sections): Add .debug_types.
5308 (lines_only_debug_sections): Likewise.
5309
6508b958
RÁE
53102010-06-18 Rafael Espindola <espindola@google.com>
5311
5312 * plugin.cc (add_input_file,add_input_library)
5313 (Plugin_manager::add_input_file): Make filename arguments const.
5314 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5315 const.
5316
3e235302
DK
53172010-06-16 Doug Kwan <dougkwan@google.com>
5318
5319 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5320 .ARM.attributes section if we have not merged any input
5321 attributes sections.
5322
106e8a6c
DK
53232010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5324
5325 * arm.cc: Allow combining objects with no EABI version
5326 information.
5327
91ff43fe
RÁE
53282010-06-15 Rafael Espindola <espindola@google.com>
5329
5330 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5331
68ed838c
ILT
53322010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5333
5334 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5335 (struct iovec): Correct !HAVE_READV definition.
5336
f3a2388f
CC
53372010-06-10 Cary Coutant <ccoutant@google.com>
5338
5339 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5340 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5341 reloc sections.
5342 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5343
5344 PR 11683
5345 * symtab.h (Symbol::is_placeholder): New member function.
5346 * target-reloc.h (relocate_section): Check for placeholder symbols.
5347
5348 * testsuite/Makefile.am (plugin_test_8): New test.
5349 (plugin_test_9): New test.
5350 * testsuite/Makefile.in: Regenerate.
5351
e1df38aa
NC
53522010-06-09 Nick Clifton <nickc@redhat.com>
5353
5354 * yyscript.y (input_list_element): Allow strings prefixed with
5355 the '-' character. Treat these as libraries.
5356 * script.cc (script_add_library): New function. Adds a library
5357 specified by "-l<name>" found in an input script.
5358 * script-c.h: Add prototype for script_add_library.
5359
25bbe950
DK
53602010-06-07 Doug Kwan <dougkwan@google.com>
5361
5362 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5363 Restrict stub-group size to be within long conditional branch
5364 range when working around cortex-A8 erratum.
5365
0f32ea4c
ILT
53662010-06-07 Damien Diederen <dd@crosstwine.com>
5367
5368 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5369 #ifdef typo.
5370
8fe2a369
ST
53712010-06-03 Sriraman Tallam <tmsriram@google.com>
5372
5373 PR gold/11658
5374 * output.cc
5375 (Output_section::Input_section_sort_entry::compare_section_ordering):
5376 Change to return non-zero correctly.
5377 (Output_section::Input_section_sort_section_order_index_compare
5378 ::operator()): Change to fix ambiguity in comparisons.
5379
6e9ba2ca
ST
53802010-06-01 Sriraman Tallam <tmsriram@google.com>
5381
5382 * gold.h (is_wildcard_string): New function.
5383 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5384 (Layout::layout_eh_frame): Ditto.
5385 (Layout::find_section_order_index): New method.
5386 (Layout::read_layout_from_file): New method.
5387 * layout.h (Layout::find_section_order_index): New method.
5388 (Layout::read_layout_from_file): New method.
5389 (Layout::input_section_position_): New private member.
5390 (Layout::input_section_glob_): New private member.
5391 * main.cc (main): Call read_layout_from_file here.
5392 * options.h (--section-ordering-file): New option.
5393 * output.cc (Output_section::input_section_order_specified_): New
5394 member.
5395 (Output_section::Output_section): Initialize new member.
5396 (Output_section::add_input_section): Add new parameter.
5397 Keep input sections when --section-ordering-file is used.
5398 (Output_section::set_final_data_size): Sort input sections when
5399 section ordering file is specified.
5400 (Output_section::Input_section_sort_entry): Add new parameter.
5401 Check sorting type.
5402 (Output_section::Input_section_sort_entry::compare_section_ordering):
5403 New method.
5404 (Output_section::Input_section_sort_compare::operator()): Change to
5405 consider section_order_index.
5406 (Output_section::Input_section_sort_init_fini_compare::operator()):
5407 Change to consider section_order_index.
5408 (Output_section::Input_section_sort_section_order_index_compare
5409 ::operator()): New method.
5410 (Output_section::sort_attached_input_sections): Change to sort
5411 according to section order when specified.
e1df38aa
NC
5412 (Output_section::add_input_section<32, true>): Add new parameter.
5413 (Output_section::add_input_section<64, true>): Add new parameter.
5414 (Output_section::add_input_section<32, false>): Add new parameter.
5415 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
5416 * output.h (Output_section::add_input_section): Add new parameter.
5417 (Output_section::input_section_order_specified): New
5418 method.
5419 (Output_section::set_input_section_order_specified): New method.
5420 (Input_section::Input_section): Initialize section_order_index_.
5421 (Input_section::section_order_index): New method.
5422 (Input_section::set_section_order_index): New method.
5423 (Input_section::section_order_index_): New member.
5424 (Input_section::Input_section_sort_section_order_index_compare): New
5425 struct.
5426 (Output_section::input_section_order_specified_): New member.
5427 * script-sections.cc (is_wildcard_string): Delete and move modified
5428 method to gold.h.
5429 (Output_section_element_input::Output_section_element_input): Modify
5430 call to is_wildcard_string.
5431 (Output_section_element_input::Input_section_pattern
5432 ::Input_section_pattern): Ditto.
5433 (Output_section_element_input::Output_section_element_input): Ditto.
5434 * testsuite/Makefile.am (final_layout): New test case.
5435 * testsuite/Makefile.in: Regenerate.
5436 * testsuite/final_layout.cc: New file.
5437 * testsuite/final_layout.sh: New file.
5438
3537c84b
RÁE
54392010-06-01 Rafael Espindola <espindola@google.com>
5440
5441 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5442
105b6afd
RÁE
54432010-06-01 Rafael Espindola <espindola@google.com>
5444
5445 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5446 visibility of symbols.
5447
29e11421
DK
54482010-05-27 Doug Kwan <dougkwan@google.com>
5449
5450 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5451 from start of output section instead of address for a local symbol
5452 in a merged or relaxed section when doing a relocatable link.
5453
5e0f337e
RÁE
54542010-05-26 Rafael Espindola <espindola@google.com>
5455
5456 PR 11604
5457 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5458 adding sections the garbage collector removed.
5459 * gold/testsuite/Makefile.am: Add test.
5460 * gold/testsuite/Makefile.in: Regenerate.
5461 * gold/testsuite/plugin_test_7.sh: New.
5462 * gold/testsuite/plugin_test_7_1.c: New.
5463 * gold/testsuite/plugin_test_7_2.c: New.
5464
f4187277
RÁE
54652010-05-26 Rafael Espindola <espindola@google.com>
5466
5467 * script-sections.cc (Output_section_definition::set_section_addresses):
5468 Check for --section-start.
5469
5c388529
DK
54702010-05-26 Doug Kwan <dougkwan@google.com>
5471
5472 * arm.cc (Arm_scan_relocatable_relocs): New class.
5473 (Target_arm::relocate_special_relocatable): New method.
5474 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5475 (Arm_relocate_functions::thumb_branch_common): Same.
5476 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5477 instead of Default_scan_relocatable_relocs.
5478 * target-reloc.h (relocate_for_relocatable): Let target handle
5479 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5480 * target.h (Sized_target::relocate_special_relocatable): New method.
5481
bca1c3ae
ILT
54822010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5483
5484 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5485
0439c796
DK
54862010-05-23 Doug Kwan <dougkwan@google.com>
5487
5488 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5489 instead of a cast.
5490 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5491 with a direct branch, not a conditional branch, to a stub.
5492 * merge.cc (Output_merge_base::record_input_section): New method
5493 defintion.
5494 (Output_merge_data::do_add_input_section): Record input section if
5495 keeps-input-sections flag is set.
5496 (Output_merge_string::do_add_input_section): Ditto.
5497 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5498 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5499 INPUT_SECTIONS_.
5500 (Output_merge_base::keeps_input_sections,
5501 Output_merge_base::set_keeps_input_sections,
5502 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5503 method definitions.
5504 (Output_merge_base::Input_sections): New type declaration.
5505 (Output_merge_base::input_sections_begin,
5506 Output_merge_base::input_sections_end,
5507 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5508 (Output_merge_base::bool keeps_input_sections_,
5509 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5510 Output_merge_base::input_sections_): New data members.
5511 (Output_merge_data::do_set_keeps_input_sections): New method
5512 defintion.
5513 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5514 * output.cc (Output_section::Input_section::relobj): Move method
5515 defintion from class declaration to here and handle merge sections.
5516 (Output_section::Input_section::shndx): Ditto.
5517 (Output_section::Output_section): Remove initializations of removed
5518 data members and initialize new data member LOOKUP_MAPS_.
5519 (Output_section::add_input_section): Set keeps-input-sections flag
5520 for a newly created merge output section as appropriate. Adjust code
5521 to use Output_section_lookup_maps class.
5522 (Output_section::add_relaxed_input_section): Adjst code for lookup
5523 maps code refactoring.
2e702c99 5524 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
5525 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5526 class. If adding input section to a newly created merge output
5527 section fails, remove the new merge section.
5528 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 5529 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 5530 (Output_section::find_merge_section): Ditto.
0439c796 5531 (Output_section::build_lookup_maps): New method defintion.
2e702c99 5532 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
5533 Output_section_lookup_maps class.
5534 (Output_section::get_input_sections): Export merge sections. Adjust
5535 code to use Output_section_lookup_maps class.
5536 (Output_section:::add_script_input_section): Adjust code to use
5537 Output_section_lookup_maps class. Update lookup maps for merge
5538 sections also.
5539 (Output_section::discard_states): Use Output_section_lookup_maps.
5540 (Output_section::restore_states): Same.
5541 * output.h (Merge_section_properties): Move class defintion out of
5542 Output_section.
5543 (Output_section_lookup_maps): New class.
5544 (Output_section::Input_section::is_merge_section): New method
5545 defintion.
5546 (Output_section::Input_section::relobj): Move defintion out of class
5547 defintion. Declare method only.
5548 (Output_section::Input_section::shndx): Ditto.
5549 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 5550 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
5551 (Output_section::Merge_section_by_properties_map,
5552 Output_section::Output_section_data_by_input_section_map,
5553 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5554 Remove types.
2e702c99 5555 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
5556 KEEPS_INPUT_SECTIONS.
5557 (Output_section::build_lookup_maps): New method declaration.
5558 (Output_section::merge_section_map_,
5559 Output_section::merge_section_by_properties_map_,
5560 Output_section::relaxed_input_section_map_,
5561 Output_section::is_relaxed_input_section_map_valid_): Remove data
5562 members.
5563 (Output_section::lookup_maps_): New data member.
5564
76295588
L
55652010-05-21 Doug Kwan <dougkwan@google.com>
5566
5567 PR gold/11619
5568 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5569 avoid a compilation error.
5570
d103a984
RÁE
55712010-05-19 Rafael Espindola <espindola@google.com>
5572
5573 * script-sections.cc (Output_section_definition::allocate_to_segment):
5574 Update the phdrs_list even when the output section is NULL.
5575 * testsuite/Makefile.am: Add test.
5576 * testsuite/Makefile.in: Regenerate.
5577 * testsuite/script_test_9.cc: New.
5578 * testsuite/script_test_9.sh: New.
5579 * testsuite/script_test_9.t: New.
5580
6625d24e
DK
55812010-05-19 Doug Kwan <dougkwan@google.com>
5582
5583 * arm.cc (Arm_input_section::original_size): New method.
5584 (Arm_input_section::do_addralign): Add a cast.
5585 (Arm_input_section::do_output_offset): Remove static cast.
5586 (Arm_input_section::original_addralign,
5587 Arm_input_section::original_size_): Change type to uint32_t.
5588 (Arm_input_section::init): Add safe casts for section alignment
5589 and size.
5590 (Arm_input_section::set_final_data_size): Do not set address and
5591 offset of stub table.
5592 (Arm_output_section::fix_exidx_coverage): Change use of of
5593 Output_section::Simple_input_section to that of
5594 Output_section::Input_section.
5595 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5596 except for the first pass.
5597 * output.cc (Output_section::get_input_sections): Change type of
5598 input_sections to std::list<Input_section>.
5599 (Output_section::add_script_input_section): Rename from
5600 Output_section::add_simple_input_section. Change type of SIS
5601 parameter from Simple_input_section to Input_section.
5602 * output.h (Output_section::Simple_input_section): Remove class.
5603 (Output_section::Input_section): Change class visibility to public.
5604 (Output_section::Input_section::addralign): Use stored alignments
5605 for special input sections if set.
5606 (Output_section::Input_section::set_addralign): New method.
5607 (Output_section::get_input_sections): Change parameter type from
5608 list of Simple_input_section to list of Input_section.
5609 (Output_section::add_script_input_section): Rename from
5610 Output_section::add_simple_input_section. Change first parameter's
5611 type from Simple_input_section to Input_section and remove the
5612 second and third parameters.
5613 * script-sections.cc (Input_section::Input_section_list): Change
5614 type to list of Output_section::Input_section/
5615 (Input_section_info::Input_section_info): Change parameter type of
5616 INPUT_SECTION to Output_section::Input_section.
5617 (Input_section_info::input_section): Change return type.
5618 (Input_section_info::input_section_): Change type to
5619 Output_section::Input_section.
5620 (Output_section_element_input::set_section_addresses): Adjust code
5621 to use Output_section::Input_section instead of
5622 Output_section::Simple_input_section. Adjust code for renaming
5623 of Output_section::add_simple_input_section.
5624 (Orphan_output_section::set_section_addresses): Ditto.
5625
e1e82ea4
RW
56262010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5627
5628 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5629 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5630
91e75c8a
RÁE
56312010-05-18 Rafael Espindola <espindola@google.com>
5632
5633 * options.cc (General_options::finalize): Handle -nostdlib.
5634 * options.h (nostdlib): New option.
5635 * script.cc (script_add_search_dir): Handle -nostdlib.
5636
da59ad79
DK
56372010-05-12 Doug Kwan <dougkwan@google.com>
5638
5639 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5640 attributes section only if there no attributes section after merging.
5641 (Target_arm::merge_object_attributes): Move value of
e1df38aa 5642 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
5643 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5644 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5645 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5646 and arm_attr_merge_7.stdout.
5647 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5648 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5649 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5650 arm_attr_merge_7b.o): New rules.
5651 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5652 arm_attr_merge_7
5653 * testsuite/Makefile.in: Regenerate.
5654 * testsuite/arm_attr_merge.sh: New file.
5655 * testsuite/arm_attr_merge_[67][ab].s: Same.
5656
3e01a7fd
NC
56572010-05-05 Nick Clifton <nickc@redhat.com>
5658
5659 * po/es.po: Updated Spanish translation.
5660
7ad2014a
L
56612010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5662
5663 * Makefile.am (install-exec-local): Properly install gold as
5664 default cross linker.
5665 * Makefile.in: Regenerated.
5666
4fda8867
NC
56672010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5668 Nick Clifton <nickc@redhat.com>
5669
5670 * configure.ac (install_as_default): Define and set to false
5671 unless --enable-gold or --enable-gold=both/gold has been
5672 specified.
5673 * configure: Regenerate.
5674
5675 * Makefile.am (install-exec-local): Install the executable as
5676 'ld.gold'. If install_as_default is true then also install it as
5677 'ld'.
5678 * Makefile.in: Regenerated.
5679
bd288ea2
ILT
56802010-04-24 Ian Lance Taylor <iant@google.com>
5681
5682 * layout.cc (Layout::layout_reloc): In relocatable link don't
5683 combine reloc sections for grouped sections.
5684
ef38fd8a
ST
56852010-04-23 Sriraman Tallam <tmsriram@google.com>
5686
5687 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5688 sections that are not ordinary to icf.
5689 * icf.cc (get_section_contents): Handle relocation pointing to section
5690 with no object or shndx information.
5691 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5692 * testsuite/Makefile.in: Regenerate.
5693 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5694 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5695
f6973bdc
ILT
56962010-04-22 Ian Lance Taylor <iant@google.com>
5697
5698 * expression.cc (Expression::Expression_eval_info): Add
5699 result_alignment_pointer field.
5700 (Expression::eval_with_dot): Add result_alignment_pointer
5701 parameter. Change all callers.
5702 (Expression::eval_maybe_dot): Likewise.
5703 (class Binary_expression): Add alignment_pointer parameter to
5704 left_value and right_value. Change all callers.
5705 (BINARY_EXPRESSION): Set result alignment.
5706 (class Trinary_expression): Add alignment_pointer parameter to
5707 arg2_value and arg3_value. Change all callers.
5708 (Trinary_cond::value): Set result alignment.
5709 (Max_expression::value, Min_expression::value): Likewise.
5710 (Align_expression::value): Likewise.
5711 * script-sections.cc (class Sections_element): Add dot_alignment
5712 parameter to set_section_addresses virtual function. Update
5713 instantiations.
5714 (class Output_section_element): Likewise.
5715 (Script_sections::create_segments): Add dot_alignment parameter.
5716 Change all callers.
5717 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5718 (Script_sections::set_phdrs_clause_addresses): Likewise.
5719 * script-sections.h: Update declarations.
5720 * script.h: Update declarations.
5721 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5722 min_p_align.
5723 * testsuite/script_test_3.t: Set large alignment.
5724 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5725 segment has expected alignment.
5726
9c9c98a5
NC
57272010-04-22 Nick Clifton <nickc@redhat.com>
5728
5729 * po/gold.pot: Updated by the Translation project.
5730 * po/vi.po: Updated Vietnamese translation.
5731
2253bfba
L
57322010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5733
5734 * testsuite/Makefile.am (check_PROGRAMS): Add
5735 icf_virtual_function_folding_test.
5736 * testsuite/Makefile.in: Regenerated.
5737
85fdf906
AH
57382010-04-15 Andrew Haley <aph@redhat.com>
5739
5740 * options.h (merge_exidx_entries): New option.
5741 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5742 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5743 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5744 (Target_arm::merge_exidx_entries): New function.
5745 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5746 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5747 to Arm_exidx_fixup constructor.
5748 Add new arg, merge_exidx_entries.
5749 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5750 Arm_output_section::fix_exidx_coverage.
5751
ce97fa81
ST
57522010-04-18 Sriraman Tallam <tmsriram@google.com>
5753
5754 * icf.cc (get_section_contents): Check for preemptible functions.
5755 Ignore addend when appropriate.
5756 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5757 section folded.
5758 (add_from_relobj): Check for section folded.
5759 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5760 * symtab.h (should_add_dynsym_entry): Add new parameter.
5761 * target-reloc.h (scan_relocs): Check for section folded.
5762 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5763 Check reloc types for function pointers in shared objects.
5764 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5765 case.
5766 (icf_preemptible_functions_test): New test case.
5767 (icf_string_merge_test): New test case.
5768 * testsuite.Makefile.in: Regenerate.
5769 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5770 bar_glob. Refactor code.
5771 * testsuite/icf_preemptible_functions_test.cc: New file.
5772 * testsuite/icf_preemptible_functions_test.sh: New file.
5773 * testsuite/icf_string_merge_test.cc: New file.
5774 * testsuite/icf_string_merge_test.sh: New file.
5775 * testsuite/icf_virtual_function_folding_test.cc: New file.
5776 * testsuite/icf_virtual_function_folding_test.sh: New file.
5777
04ceb17c
DK
57782010-04-14 Doug Kwan <dougkwan@google.com>
5779
5780 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5781 for local symbol recounting if we remove a section due to ICF.
5782 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5783 there are no regular objects in input.
5784
153e7da4
DK
57852010-04-13 Doug Kwan <dougkwan@google.com>
5786
5787 * arm.cc (Arm_input_section::set_final_data_size): Compute
5788 accurate final data size instead of using current data size.
5789
4dbd9faf
DK
57902010-04-09 Doug Kwan <dougkwan@google.com>
5791
5792 * layout.cc (Layout::choose_output_section): Handle script section
5793 types.
5794 (Layout::make_output_section_for_script): Add section type parameter.
5795 Handle script section types.
5796 * layout.h (Layout::make_output_section_for_script): Add section
5797 type parameter.
5798 * output.cc (Output_section::Output_section): Initialize data member
5799 is_noload_.
5800 (Output_section::do_reset_address_and_file_offset): Do not set address
5801 to 0 if section is a NOLOAD section.
5802 * output.h (Output_section::is_noload): New method.
5803 (Output_section::set_is_noload): Ditto.
5804 (Output_section::is_noload_): New data member.
5805 * script-c.h (Script_section_type): New enum type.
5806 (struct Parser_output_section_header): Add new file section_type.
5807 * script-sections.cc (Sections_element::output_section_name): Add
5808 parameter for returning script section type.
5809 (Output_section_definition::output_section_name): Ditto.
5810 (Output_section_definition::section_type)P; New method.
5811 (Output_section_definiton::script_section_type_name): Ditto.
5812 (Output_section_definition::script_section_type_): New data member.
5813 (Output_section_definition::Output_section_definition): Initialize
5814 data member Output_section_definition::script_section_type_.
5815 (Output_section_definition::create_sections): Pass script section type
5816 to Layout::make_output_section_for_script.
5817 (Output_section_definition::output_section_name): Return script
5818 section type to caller.
5819 (Output_section_definition::set_section_address): Do not advance
5820 dot value and load address if section type is NOLOAD. Set address
5821 of NOLOAD sections regardless of section flags.
5822 (Output_section_definition::print): Print section type if it is
5823 not SCRIPT_SECTION_TYPE_NONE.
5824 (Output_section_definition::section_type): New method.
5825 (Output_section_definition::script_section_type_name): Ditto.
5826 (Script_sections::output_section_name): Add new parameter
5827 PSECTION_TYPE for returning script section type. Pass it to
5828 section elements. Handle discard sections.
5829 (Sort_output_sections::operator()): Handle NOLOAD sections.
5830 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 5831 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
5832 returning script section type.
5833 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5834 INFO and NOLOAD.
5835 * yyscript.y (union): Add new field SECTION_TYPE.
5836 (COPY, DSECT, INFO, NOLOAD): New tokens.
5837 (opt_address_and_section_type): Change type to output_section_header.
5838 (section_type): New non-terminal
5839 (section_header): Handle section type.
2253bfba 5840 (opt_address_and_section_type): Return section type value.
4dbd9faf 5841
721ea635
L
58422010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5843
5844 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5845 * testsuite/plugin_common_test_2.c (foo): Likewise.
5846
6bf924b0
DK
58472010-04-08 Doug Kwan <dougkwan@google.com>
5848
5849 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5850 Output_merge_data.
5851 * output.cc (Output_section::add_merge_input_section): Simplify
5852 code and return status of Output_merge_base::add_input_section.
e1df38aa 5853 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
5854 returns true.
5855
24af6f92
DK
58562010-04-07 Doug Kwan <dougkwan@google.com>
5857
5858 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5859 if section is marked as containing instructions but has no mapping
5860 symbols.
5861 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5862 correct section index.
5863 (Arm_relobj::find_linked_text_section): Ditto.
5864
00698fc5
CC
58652010-04-07 Cary Coutant <ccoutant@google.com>
5866
5867 * archive.cc (include_member): Destroy Read_symbols_data object before
5868 releasing file.
5869 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5870 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5871 (Read_symbols_data::~Read_symbols_data) New destructor.
5872 (Section_relocs::Section_relocs) New constructor.
5873 (Section_relocs::~Section_relocs) New destructor.
5874 (Read_relocs_data::Read_relocs_data) New constructor.
5875 (Read_relocs_data::~Read_relocs_data) New destructor.
5876 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5877 pointers to NULL after deleting.
5878
7296d933
DK
58792010-04-07 Doug Kwan <dougkwan@google.com>
5880
5881 * arm.cc: Replace "endianity" with "endianness" in comments.
5882 (Arm_exidx_cantunwind): Ditto.
5883 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5884 (Arm_relobj::merge_flags_and_attributes): New method.
5885 (Arm_relobj::merge_flags_and_attributes_): New data member.
5886 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5887 (Arm_relobj::scan_sections_for_stubs): Ditto.
5888 (Arm_relobj::do_read_symbols): Check to see if we really want to
5889 merge processor-specific flags and attributes. Exit early if
5890 an object is empty except for section names and the undefined symbol.
5891 (Target_arm::do_finalize_sections): Move check for ELF format to
5892 Arm_relobj::do_read_symbols. Merge processor specific flags and
5893 attributes from a regular object only when we have determined that
5894 it is aapropriate. Do not create an .ARM.attributes section in
5895 output if there is no regular input object.
5896 (Target_arm::merge_processor_specific_flags): Check
5897 --warn-mismatch before printing any error.
5898 (Target_arm::merge_object_attributes): Ditto.
5899 * gold.cc (queue_middle_tasks): Handle the case in which there is
5900 no regular object in input.
5901 * options.cc (General_options::parse_EB): New method.
5902 (General_options::parse_EL): Same.
5903 (General_options::General_options): Initialize endianness_.
5904 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5905 New options.
5906 (General_options::Endianness): New enum.
5907 (General_options::endianness): New method.
5908 (General_options::endianness_): New data member.
5909 * parameters.cc (Parameters::set_options): Check target endianness.
5910 (Parameters::set_target_once): Ditto.
5911 (Parameters::check_target_endianness): New method.
5912 (parameters_force_valid_target): If either -EL or -EB is specified,
5913 use it to define endianness of default target.
5914 * parameters.h (Parameters::check_target_endianness): New method
5915 declaration.
5916 * target.h (class Target): Change "endianity" to "endianness"
5917 in comments.
5918
efc8d4f2
RW
59192010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5920
5921 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5922 * configure: Regenerate.
5923 * Makefile.in: Regenerate.
5924 * testsuite/Makefile.in: Regenerate.
5925
be234d88
CC
59262010-04-06 Cary Coutant <ccoutant@google.com>
5927
5928 gcc PR lto/42757
5929 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5930 prevailing definitions of common symbols.
5931 * testsuite/plugin_test_6.sh: New test case.
5932 * testsuite/plugin_common_test_1.c: New test case.
5933 * testsuite/plugin_common_test_2.c: New test case.
5934 * testsuite/Makefile.am (plugin_test_6): New test case.
5935 * testsuite/Makefile.in: Regenerate.
5936
bd32c6bd
NC
59372010-04-06 Nick Clifton <nickc@redhat.com>
5938
5939 * po/vi.po: New Vietnamese translation.
5940
323c532f
DK
59412010-03-30 Doug Kwan <dougkwan@google.com>
5942
5943 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5944
4fcd97eb
DK
59452010-03-25 Doug Kwan <dougkwan@google.com>
5946
5947 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5948 to avoid a conversion warning on a 32-bit host.
5949
4ebf39db
ILT
59502010-03-24 Ian Lance Taylor <iant@google.com>
5951
5952 * testsuite/script_test_3.t: Add a TLS segment.
5953 * testsuite/Makefile.am (check_PROGRAMS): Add
5954 tls_phdrs_script_test.
5955 (tls_phdrs_script_test_SOURCES): Define.
5956 (tls_phdrs_script_test_DEPENDENCIES): Define.
5957 (tls_phdrs_script_test_LDFLAGS): Define.
5958 (tls_phdrs_script_test_LDADD): Define.
5959 * testsuite/Makefile.in: Rebuild.
5960
4a599bdd
CC
59612010-03-23 Cary Coutant <ccoutant@google.com>
5962
5963 * fileread.cc (find_or_make_view): Fix comment.
5964
6c93b22c
ILT
59652010-03-23 Ian Lance Taylor <iant@google.com>
5966
5967 * script-sections.cc (class Orphan_section_placement): Define
5968 PLACE_TLS and PLACE_TLS_BSS.
5969 (Orphan_section_placement::Orphan_section_placement): Initialize
5970 new places.
5971 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5972 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5973 (tls_script_test_SOURCES): Define.
5974 (tls_script_test_DEPENDENCIES): Define.
5975 (tls_script_test_LDFLAGS): Define.
5976 (tls_script_test_LDADD): Define.
5977 * testsuite/Makefile.in: Rebuild.
5978
a2c7281b
DK
59792010-03-22 Doug Kwan <dougkwan@google.com>
5980
5981 * arm.cc (Arm_relocate_functions::abs8,
5982 Arm_relocate_functions::abs16): Use correct check for overflow
5983 specified in the ARM ELF specs.
5984 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5985 target of a BLX instruction specially.
5986 (Reloc_stub::stub_type_for_reloc): Ditto.
5987 (Relocate::relocate): Use symbolic names instead of numeric relocation
5988 codes to report error.
5989 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5990 workaround.
5991 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5992 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5993 thumb2_blx_out_of_range.stdout
5994 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5995 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5996 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5997 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5998 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5999 thumb2_blx_in_range, thumb2_blx_in_range.o,
6000 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6001 thumb2_blx_out_of_range.o): New rules.
2e702c99 6002 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
6003 thumb2_blx_in_range and thumb2_blx_out_of_range.
6004 * testsuite/Makefile.in: Regenerate.
6005 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6006 * testsuite/thumb_blx_in_range.s: New file.
6007 * testsuite/thumb_blx_out_of_range.s: New file.
6008
b0193076
RÁE
60092010-03-22 Rafael Espindola <espindola@google.com>
6010
6011 * archive.cc (Should_include): Move to archive.h.
6012 (should_include_member): Make it a member of Archive.
6013 (Lib_group): New.
6014 (Add_lib_group_symbols): New.
6015 * archive.h: Include options.h.
6016 (Archive_member): Moved from Archive.
6017 (Should_include): Moved from archive.cc.
6018 (Lib_group): New.
6019 (Add_lib_group_symbols): New.
6020 * dynobj.cc (do_should_include_member): New.
6021 * dynobj.h (do_should_include_member): New.
6022 * gold.cc (queue_initial_tasks): Update call to queue.
6023 * main.cc (main): Print lib group stats.
6024 * object.cc (do_should_include_member): New.
6025 * object.h: Include archive.h.
6026 (Object::should_include_member): New.
6027 (Object::do_should_include_member): New.
6028 (Sized_relobj::do_should_include_member): New.
6029 * options.cc (General_options::parse_start_lib): New.
6030 (General_options::parse_end_lib): New.
6031 (Input_arguments::add_file): Handle lib groups.
6032 (Input_arguments::start_group): Check we are not in a lib.
6033 (Input_arguments::start_lib): New.
6034 (Input_arguments::end_lib): New.
6035 * options.h (General_options): Add start_lib and end_lib.
6036 (Input_argument::lib_): New.
6037 (Input_argument::lib): New.
6038 (Input_argument::is_lib): New.
6039 (Input_file_lib): New.
6040 (Input_arguments::in_lib_): New.
6041 (Input_arguments::in_lib): New.
6042 (Input_arguments::start_lib): New.
6043 (Input_arguments::end_lib_): New.
6044 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
6045 in unused members as preempted.
6046 (Sized_pluginobj::do_should_include_member): New.
6047 * plugin.h (Sized_pluginobj::do_should_include_member): New.
6048 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
6049 return the blocker.
6050 (Read_symbols::do_whole_lib_group): New.
6051 (Read_symbols::do_lib_group): New.
6052 (Read_symbols::do_read_symbols): Handle lib groups.
6053 (Read_symbols::get_name): Handle lib groups.
6054 * readsyms.h (Read_symbols): Add an archive member pointer.
6055 (Read_symbols::do_whole_lib_group): New.
6056 (Read_symbols::do_lib_group): New.
6057 (Read_symbols::member_): New.
6058 * script.cc (read_input_script): Update call to queue_soon.
6059
d099120c
DK
60602010-03-19 Doug Kwan <dougkwan@google.com>
6061
6062 * arm.cc (Stub_table::Stub_table): Initialize new data members
6063 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6064 (Stub_table::add_reloc_stub): Assign stub offset and update
6065 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6066 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6067 New data members.
2e702c99 6068 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
6069 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6070 instead of going over all reloc stubs.
2e702c99 6071 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
6072 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6073 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 6074 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
6075 Stringpool_template::offset_.
6076 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6077 Stringpool_template::offset_ to zero.
6078
1aa37384
DK
60792010-03-15 Doug Kwan <dougkwan@google.com>
6080
6081 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6082 offset_.
6083 (Stringpool_template::new_key_offset): New method.
6084 (Stringpool_template::add_string): Assign offsets when adding new
6085 strings.
6086 (Stringpool_template::set_string_offsets): Do not set string offsets
6087 when not optimizing.
6088 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6089 member size_.
2e702c99
RM
6090 (Chunked_vector::clear): Clear size_.
6091 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6092 (Chunked_vector::size): Return size_.
6093 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 6094 (Chunked_vector::size_): New data member.
1aa37384
DK
6095 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6096 (Stringpool_template::new_key_offset): New method declaration.
6097 (Stringpool_template::offset_): New data member.
6098
b672b057
RÁE
60992010-03-15 Rafael Espindola <espindola@google.com>
6100
6101 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6102 Add_symbols' constructor.
6103 * readsyms.h (Add_symbols): Remove the input_group member.
6104
b6848d3c
ILT
61052010-03-10 Ian Lance Taylor <iant@google.com>
6106
6107 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6108 target to ask whether a reference to a symbol requires a stack
6109 split.
6110 * target.h (Target::is_call_to_non_split): New function.
6111 (Target::do_is_call_to_non_split): Declare virtual function.
6112 * target.cc: Include "symtab.h".
6113 (Target::do_is_call_to_non_split): New function.
6114 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6115
a2a5469e
CC
61162010-03-10 Cary Coutant <ccoutant@google.com>
6117
6118 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6119 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6120 (File_read::open[2]): Add whole_file_view_ to list of views.
6121 (File_read::make_view): Remove test of whole_file_view_.
6122 (File_read::find_or_make_view): Create whole_file_view_ if
6123 necessary.
6124 (File_read::clear_views): Replace bool parameter with enum;
6125 adjust all callers. Don't delete views with permanent data;
6126 do delete cached views and views from archives if
6127 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6128 if clearing the corresponding view.
6129 * fileread.h (File_read::Clear_views_mode): New enum.
6130 (File_read::View::is_permanent_view): New method.
6131 (File_read::clear_views): Replace bool parameter
6132 with enum; adjust all callers.
6133 * options.h (General_options): Change keep_files_mapped option;
6134 add map_whole_files.
6135 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6136 releasing the file.
6137 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6138 the file.
6139
8861f32b
DM
61402010-03-10 David S. Miller <davem@davemloft.net>
6141
6142 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6143
d62d0f5f
ST
61442010-03-09 Sriraman Tallam <tmsriram@google.com>
6145
6146 * icf.cc (get_section_contents): Add '@' marker after processing the
6147 merge reloc.
6148
9177756d
DK
61492010-03-08 Doug Kwan <dougkwan@google.com>
6150
6151 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6152 due to a conversion warning.
6153 (Arm_relobj::update_output_local_symbol_count): Check for local
6154 symbol with unset output index.
6155
9e9e071b
ILT
61562010-03-05 Ian Lance Taylor <iant@google.com>
6157
6158 * options.h (class General_options): Add --spare-dynamic-tags.
6159 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6160 --spare-dynamic-tags.
6161
a81ee015
ILT
61622010-03-05 Ian Lance Taylor <iant@google.com>
6163
6164 * incremental.cc: Include "libiberty.h".
6165
44ec90b9
RO
61662010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6167
6168 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6169 function, is_info_ member.
6170 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6171 (Versions::Versions): Update caller.
6172 (Versions::define_base_version): Likewise.
6173 (Versions::add_def): Likewise.
6174
0897ed3b
ST
61752010-03-03 Sriraman Tallam <tmsriram@google.com>
6176
6177 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6178 (Scan::possible_function_pointer_reloc): New function.
6179 (Scan::local_reloc_may_be_function_pointer): Change to call
6180 possible_function_pointer_reloc.
6181 (Scan::global_reloc_may_be_function_pointer): Ditto.
6182 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6183 relocations in ".data.rel.ro._ZTV" section.
6184 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6185 * testsuite/icf_safe_so_test.cc: Ditto.
6186 * testsuite/icf_safe_test.cc: Ditto.
6187 * testsuite/icf_safe_test.sh: Ditto.
6188
d3bbad62
ILT
61892010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6190 Ian Lance Taylor <iant@google.com>
6191
6192 * target-reloc.h (relocate_section): Check the symbol table index
6193 for -1U before setting the local symbol index.
6194 (scan_relocatable_relocs): If copying the relocation, record that
6195 the local symbol is required.
6196 * object.h (Symbol_value::is_output_symtab_index_set): New
6197 function.
6198 (Symbol_value::may_be_discarded_from_output_symtab): New
6199 function.
6200 (Symbol_value::has_output_symtab_entry): New function.
6201 (Symbol_value::needs_output_symtab_entry): Remove.
6202 (Symbol_value::output_symtab_index): Make sure the symbol index is
6203 set.
6204 (Symbol_value::set_output_symtab_index): Make sure the symbol
6205 index is not set. Make sure the new index is valid.
6206 (Symbol_value::set_must_have_output_symtab_entry): New function.
6207 (Symbol_value::has_output_dynsym_entry): New function.
6208 (Symbol_value::set_output_dynsym_index): Make sure the new index
6209 is valid.
6210 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6211 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6212 local symbol if permitted.
6213 (Sized_relobj::do_finalize_local_symbols): Call
6214 is_output_symtab_index_set rather than needs_output_symtab_entry.
6215 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6216 rather than needs_output_symtab_entry. Call
6217 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6218 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6219 is_output_symtab_index_set rather than needs_output_symtab_entry.
6220 * testsuite/discard_locals_relocatable_test.c: New file.
6221 * testsuite/discard_locals_test.sh: Test -r.
6222 * testsuite/Makefile.am (check_DATA): Add
6223 discard_locals_relocatable_test1.syms,
6224 discard_local_relocatable_test2.syms.
6225 (MOSTLYCLEANFILES): Likewise. Also add
6226 discard_locals_relocatable_test1.lout and
6227 discard_locals_relocatable_test2.out.
6228 (discard_locals_relocatable_test1.syms): New target.
6229 (discard_locals_relocatable_test.o): New target.
6230 (discard_locals_relocatable_test1.out): New target.
6231 (discard_locals_relocatable_test2.syms): New target.
6232 (discard_locals_relocatable_test2.out): New target.
6233 (various): Add missing ../ld-new dependencies.
6234 * testsuite/Makefile.in: Rebuild.
6235
7e8ccf26
NC
62362010-03-03 Nick Clifton <nickc@redhat.com>
6237
6238 * po/fi.po: New Finnish translation.
6239
2a0ff005
DK
62402010-03-01 Doug Kwan <dougkwan@google.com>
6241
6242 * layout.cc (Layout::Layout): Force section types of .init_array*,
6243 .preinit_array* and .fini_array* sections.
6244 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6245 Fix check of return value of std::string::find.().
6246 (Output_section::Input_section_sort_compare::operator()): Remove
6247 comment about .init_array.
6248 (Output_section::Input_section_sort_init_fini_compare::operator()):
6249 New method.
6250 (Output_section::sort_attached_input_sections): Handle .init_array
6251 and .fini_array specially.
6252 * output.h (Output_section::Inut_section_sort_compare): Update
6253 comment.
6254 (Output_section::Input_section_sort_init_fini_compare): New struct.
6255
c3e4ae29
DK
62562010-02-26 Doug Kwan <dougkwan@google.com>
6257
6258 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6259 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6260 * testsuite/debug_msg.sh: Avoid matching source line number for
6261 use of global variable undef_int.
6262
2fd9ae7a
DK
62632010-02-26 Doug Kwan <dougkwan@google.com>
6264
6265 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6266 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6267 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6268 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6269 * options.cc (General_options::General_options): Initialize member
6270 fix_v4bx_.
6271 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6272 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6273 and rm_no_fix_v4bx.stdout
6274 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6275 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6276 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6277 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6278 and arm_no_fix_v4bx.
6279 * Makefile.in: Regenerate.
6280 * testsuite/arm_fix_v4bx.s: New file.
6281 * testsuite/arm_fix_v4bx.sh: Ditto.
6282
67ec7d0b
DK
62832010-02-24 Doug Kwan <dougkwan@google.com>
6284
6285 * arm.cc (Target_arm::got_section): Make the .got section the first
6286 non RELRO section in the data segment.
6287 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6288 suffixes of section names.
6289
10165461
DK
62902010-02-24 Doug Kwan <dougkwan@google.com>
6291
6292 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6293 flags and attributes merging if an input file is a binary file.
6294 * fileread.cc (Input_file::open): Record format of original file.
6295 * fileread.h (Input_file::Format): New enum type.
2e702c99 6296 (Input_file::Input_file): Initialize data member format_.
10165461
DK
6297 (Input_file::format): New method definition.
6298 (Input_file::format_):: New data member.
6299
4a54abbb
DK
63002010-02-24 Doug Kwan <dougkwan@google.com>
6301
6302 * arm.cc (Arm_output_data_got): New class.
6303 (ARM_TCB_SIZE): New constant
6304 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6305 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6306 If user uses a script with a SECTIONS clause, issue only a warning
6307 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 6308 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
6309 garbage collection.
6310 (Target_arm::got_mode_index_entry): Handle static linking.
6311 (Target_arm::Scan::local): Ditto.
6312 (Target_arm::Scan::global): Ditto.
6313 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6314 all incorrectly implemented relocations.
e1df38aa 6315 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
6316 Arm_output_section::fix_exidx_coverage.
6317 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6318 from ".ARM.exidx." and ".ARM.extab.".
6319
ca419a6f
ILT
63202010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6321
6322 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6323 section if it does not already exist.
6324 * attributes.cc (Attributes_section_data::Attributes_section_data):
6325 Don't crash if size is zero.
6326
135b9c78
ILT
63272010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6328 Ian Lance Taylor <iant@google.com>
6329
6330 * gold.cc (queue_middle_tasks): If no input files were opened,
6331 exit.
6332 * workqueue.h (Task_function::Task_function): Assert that there is
6333 a blocker.
6334
bb0bfe4f
DK
63352010-02-22 Doug Kwan <dougkwan@google.com>
6336
6337 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6338 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6339 types to avoid warnings due to different uint64_t implementations
6340 on different hosts.
6341
2a2b6d42
DK
63422010-02-21 Doug Kwan <dougkwan@google.com>
6343
6344 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6345 handling of the maximum backward branch offset.
2e702c99 6346 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
6347 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6348 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 6349 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
6350 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6351 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6352 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6353 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6354 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6355 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6356 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6357 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6358 thumb2_bl_out_of_range.o): New rules.
6359 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6360 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6361 thumb2_bl_out_of_range
6362 * testsuite/Makefile.in: Regenerate.
6363 * testsuite/arm_bl_in_range.s: New file.
6364 * testsuite/arm_bl_out_of_range.s: Ditto.
6365 * testsuite/arm_branch_in_range.sh: Ditto.
6366 * testsuite/arm_branch_range.t: Ditto.
6367 * testsuite/thumb2_branch_range.t: Ditto.
6368 * testsuite/thumb_bl_in_range.s: Ditto.
6369 * testsuite/thumb_bl_out_of_range.s: Ditto.
6370 * testsuite/thumb_branch_range.t: Ditto.
6371
b487ad64
ST
63722010-02-20 Sriraman Tallam <tmsriram@google.com>
6373
6374 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6375 Add reloc offset information.
6376 * icf.cc (get_section_contents): Change iterators to point to the new
6377 vectors. Add reloc offset information to the contents.
6378 * icf.h (Icf::Sections_reachable_info): New typedef.
6379 (Icf::Sections_reachable_list): New typedef.
6380 (Icf::Offset_info): New typedef.
6381 (Icf::Reloc_info): New struct typedef.
6382 (Icf::Reloc_info_list): New typedef.
6383 (Icf::symbol_reloc_list): Delete method.
6384 (Icf::addend_reloc_list): Delete method.
6385 (Icf::section_reloc_list): Delete method.
6386 (Icf::reloc_info_list): New method.
6387 (Icf::reloc_info_list_): New member.
6388
f96accdf
DK
63892010-02-19 Doug Kwan <dougkwan@google.com>
6390
6391 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6392 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6393 * arm.cc (Arm_relocation_functions): New forward declaration.
6394 (Target_arm::Target_arm): Initialize new data members
6395 got_mod_index_offset_ and tls_base_symbol_defined_.
6396 (Target_arm::Relocate::relocate_tls): New method.
6397 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6398 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6399 New methods.
2e702c99 6400 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
6401 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6402 (Target_arm::got_mod_index_offset_,
6403 Target_arm::tls_base_symbol_defined_): New data members.
6404 (Target_arm::Scan::local, Target::Scan::global,
6405 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6406 relocations.
6407
c8761b9a
DK
64082010-02-18 Doug Kwan <dougkwan@google.com>
6409
6410 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6411 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6412 text section as a parameter becuase some broken tools may not set
6413 the link in section header.
6414 (Target_arm::has_got_section): New method.
6415 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6416 without any mapping symbol as data only. Remove warning.
6417 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6418 link in its section header, try to discover the link by inspecting the
6419 REL31 relocation at the beginning of the section.
6420 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6421 in error message.
6422 (Target_arm::Scan::global): Treat any reference to the symbol
6423 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6424
21bb3914
ST
64252010-02-12 Sriraman Tallam <tmsriram@google.com>
6426
6427 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6428 (Scan::global_reloc_may_be_function_pointer): New function.
6429 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6430 (Scan::global_reloc_may_be_function_pointer): New function.
6431 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6432 (Scan::global_reloc_may_be_function_pointer): New function.
6433 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6434 (Scan::global_reloc_may_be_function_pointer): New function.
6435 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6436 (Scan::global_reloc_may_be_function_pointer): New function.
6437 (Scan::possible_function_pointer_reloc): New function.
6438 (Target_x86_64::can_check_for_function_pointers): New function.
6439 * gc.h (gc_process_relocs): Scan relocation types to determine if
6440 function pointers were taken for targets that support it.
6441 * icf.cc (Icf::find_identical_sections): Include functions for
6442 folding in safe ICF whose pointer is not taken.
6443 * icf.h (Secn_fptr_taken_set): New typedef.
6444 (fptr_section_id_): New member.
6445 (section_has_function_pointers): New function.
6446 (set_section_has_function_pointers): New function.
6447 (check_section_for_function_pointers): New function.
6448 * options.h: Fix comment for safe ICF option.
6449 * target.h (can_check_for_function_pointers): New function.
6450 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6451 Modify icf_safe_test for X86-64.
6452 * testsuite/Makefile.in: Regenerate.
6453 * testsuite/icf_safe_so_test.cc: New file.
6454 * testsuite/icf_safe_so_test.sh: New file.
6455 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6456 (main): Change to take pointer to function kept_func_3.
6457 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6458 folding is done correctly for X86-64.
6459
0da6fa6c
DM
64602010-02-12 David S. Miller <davem@davemloft.net>
6461
6462 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6463 is_symbolless parameter.
6464 (Output_reloc<SHT_REL>::is_symbolless): New.
6465 (Output_reloc<SHT_REL>::is_symbolless_): New.
6466 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6467 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6468 (Output_reloc<SHT_RELA>::is_symbolless): New.
6469 (Output_data_reloc::add_global): Handle is_symbolless.
6470 (Output_data_reloc::add_global_relative): Likewise.
6471 (Output_data_reloc::add_local): Likewise.
6472 (Output_data_reloc::add_local_relative): Likewise.
6473 (Output_data_reloc::add_symbolless_global_addend): New.
6474 (Output_data_reloc::add_symbolless_local_addend): New.
6475 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6476 is_symbolless.
6477 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6478 instead of ->is_relative_
6479 (Output_reloc::write): Likewise.
6480 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6481 (Output_reloc::write_rel): Simplify.
6482
6483 * sparc.cc (Target_sparc::Scan::local): Use
6484 ->add_symbolless_local_addend as needed.
6485 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6486 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6487 based upon relocation offset.
6488
e4782e83
DK
64892010-02-11 Doug Kwan <dougkwan@google.com>
6490
6491 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6492 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6493 beginning of function.
6494 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6495 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6496 parameter is_32bit in calls to should_apply_static_reloc.
6497 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6498 (check_DATA): Add arm_abs_global.stdout.
6499 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6500 arm_abs_global.stdout): New rules.
6501 (MOSTLLYCLEANFILES): Add arm_abs_global
6502 * Makefile.in: Regenerate.
6503 * testsuite/arm_abs_global.s: New file.
6504 * testsuite/arm_abs_global.sh: Ditto.
6505 * testsuite/arm_abs_lib.s: Ditto.
6506
93ceb764
ILT
65072010-02-11 Ian Lance Taylor <iant@google.com>
6508
6509 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6510 Read_relocs task.
6511 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6512 Allocate_commons_task first.
6513 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6514 task, rather than symtab_lock_.
6515 (Gc_process_relocs::~Gc_process_relocs): New function.
6516 (Gc_process_relocs::is_runnable): Check this_blocker_.
6517 (Gc_process_relocs::locks): Use next_blocker_ rather than
6518 blocker_.
6519 (Scan_relocs::~Scan_relocs): New function.
6520 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6521 symtab_lock_.
6522 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6523 next_blocker_.
6524 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6525 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6526 constructor accordingly.
6527 (class Gc_process_relocs): Likewise.
6528 (class Scan_relocs): Likewise.
6529 * common.h (class Allocate_commons_task): Remove symtab_lock_
6530 field, and corresponding constructor parameter.
6531 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6532 symtab_lock_.
6533 (Allocate_commons_task::locks): Likewise.
6534
114dfbe1
ILT
65352010-02-11 Ian Lance Taylor <iant@google.com>
6536
6537 * gold-threads.h (class Once): Define.
6538 (class Initialize_lock): Rewrite as child of Once.
6539 * gold-threads.cc (class Once_initialize): Define.
6540 (once_pointer_control): New static variable.
6541 (once_pointer, once_arg): New static variables.
6542 (c_run_once): New static function.
6543 (Once::Once, Once::run_once, Once::internal_run): New functions.
6544 (class Initialize_lock_once): Remove.
6545 (initialize_lock_control): Remove.
6546 (initialize_lock_pointer): Remove.
6547 (initialize_lock_once): Remove.
6548 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6549 (Initialize_lock::initialize): Rewrite.
6550 (Initialize_lock::do_run_once): New function.
6551 * archive.cc (Archive::interpret_header): Only clear name if it is
6552 not already empty.
6553 * fileread.cc: Include "gold-threads.h"
6554 (file_counts_lock): New static variable.
6555 (file_counts_initialize_lock): Likewise.
6556 (File_read::release): Only increment counts when using --stats.
6557 Use a lock around the increment.
6558 * parameters.cc (class Set_parameters_target_once): Define.
6559 (set_parameters_target_once): New static variable.
6560 (Parameters::Parameters): Move here from parameters.h.
6561 (Parameters::set_target): Rewrite.
6562 (Parameters::set_target_once): New function.
6563 (Parameters::clear_target): Move here and rewrite.
6564 * parameters.h (class Parameters): Update declarations. Add
6565 set_parameters_target_once_ field.
6566 (Parameters::Parameters): Move to parameters.cc.
6567 (Parameters::clear_target): Likewise.
6568 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6569 task.
6570 (Start_group::~Start_group): New function.
6571 (Start_group::is_runnable): New function.
6572 (Start_group::locks, Start_group::run): New functions.
6573 (Finish_group::run): Change saw_undefined to size_t.
6574 * readsyms.h (class Start_group): Define.
6575 (class Finish_group): Change saw_undefined_ field to size_t.
6576 (Finish_group::Finish_group): Remove saw_undefined and
6577 this_blocker parameters. Change all callers.
6578 (Finish_group::set_saw_undefined): New function.
6579 (Finish_group::set_blocker): New function.
6580 * symtab.h (class Symbol_table): Change saw_undefined to return
6581 size_t. Change saw_undefined_ field to size_t.
6582 * target-select.cc (Set_target_once::do_run_once): New function.
6583 (Target_selector::Target_selector): Initialize set_target_once_
6584 field. Don't initialize lock_ and initialize_lock_ fields.
6585 (Target_selector::instantiate_target): Rewrite.
6586 (Target_selector::set_target): New function.
6587 * target-select.h (class Set_target_once): Define.
6588 (class Target_selector): Update declarations. Make
6589 Set_target_once a friend. Remove lock_ and initialize_lock_
6590 fields. Add set_target_once_ field.
6591
fa17a3f4
ILT
65922010-02-10 Ian Lance Taylor <iant@google.com>
6593
6594 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6595 queueing any tasks.
6596 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6597 (queue_middle_tasks): Add all blockers before queueing any tasks.
6598 (queue_final_tasks): Likewise.
6599 * token.h (Task_token::add_blockers): New function.
6600 * object.h (Input_objects::number_of_relobjs): New function.
6601
c7177d31
ILT
66022010-02-10 Ian Lance Taylor <iant@google.com>
6603
5de0e392
ILT
6604 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6605 shared, not if not position independent.
6606 * x86_64.cc (Relocate::relocate_tls): Likewise.
6607 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6608 (tls_pie_pic_test): New target.
6609 * testsuite/Makefile.in: Rebuild.
6610
c7177d31
ILT
6611 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6612 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6613 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6614 * testsuite/Makefile.in: Rebuild.
6615
684b268a
DM
66162010-02-09 David S. Miller <davem@davemloft.net>
6617
6618 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6619 R_SPARC_RELATIVE using ->add_local_relative().
6620 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6621
612a8d3d
DM
6622 * output.h (Output_data_dynamic::add_section_size): New method
6623 that takes two Output_data objects.
6624 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6625 entry param. Handle it in initializers.
6626 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6627 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6628 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6629 arg.
6630 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6631 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6632 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6633 for dynrel_includes_plt.
6634 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6635 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6636 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6637 before .rela.plt
6638 (Target_sparc::do_finalize_sections): Update to pass true for
6639 dynrel_includes_plt.
6640 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6641 output before .rela.plt
6642 (Target_powerpc::do_finalize_sections): Update to pass true for
6643 dynrel_includes_plt when 32-bit.
6644
cb1be87e
DK
66452010-02-08 Doug Kwan <dougkwan@google.com>
6646
6647 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6648 method.
6649 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6650 Arm_relobj::scan_section_for_cortex_a8_stubs,
6651 Arm_relobj::do_relocation_section): Instead of calling
6652 Output_section::output_address, use faster
6653 Arm_relobj::simple_input_section_output_address.
6654
705b5121
DM
66552010-02-08 David S. Miller <davem@davemloft.net>
6656
6657 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6658 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6659 relocation helper function.
6660
024c4466
DM
6661 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6662 just like R_SPARC_GOT{10,13,22}.
6663 (Target_sparc::Scan::local): Likewise.
6664 (Target_sparc::Relocate:relocate): Likewise.
6665
9109c078
ILT
66662010-02-06 Ian Lance Taylor <iant@google.com>
6667
6668 * configure.ac: Rewrite targetobjs duplicate removal code to use
6669 only shell constructs.
6670 * configure: Rebuild.
6671
cf846138
DK
66722010-02-05 Doug Kwan <dougkwan@google.com>
6673
6674 PR 11247
6675 * arm.cc (Arm_relobj::section_is_scannable): New method.
6676 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6677 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6678
6cfaf60b
DK
66792010-02-04 Doug Kwan <dougkwan@google.com>
6680
6681 PR 11247
6682 * arm-reloc-property.cc (cstdio): Include.
6683 * configure.ac (targetobjs): Remove duplicates.
6684 * configure: Regenerate.
6685 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6686 big and little endian version for a given address size.
6687
5c57f1be
DK
66882010-02-03 Doug Kwan <dougkwan@google.com>
6689
6690 * arm-reloc-property.cc
6691 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6692 definition.
6693 * arm-reloc-property.h
6694 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6695 New method definition.
6696 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6697 declaration.
6698 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6699 overflow to N.
6700 (GOT_PREL): Change implemented to Y.
6701 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6702 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6703 (Arm_relocate_functions::movw_abs_nc): Remove method.
6704 (Arm_relocate_functions::movt_abs): Ditto.
6705 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6706 (Arm_relocate_functions::thm_movt_abs): Ditto.
6707 (Arm_relocate_functions::movw_rel_nc): Ditto.
6708 (Arm_relocate_functions::movw_rel): Ditto.
6709 (Arm_relocate_functions::movt_rel): Ditto.
6710 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6711 (Arm_relocate_functions:thm_movw_rel): Ditto.
6712 (Arm_relocate_functions:thm_movt_rel): Ditto.
6713 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6714 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6715 New method definitions.
6716 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6717 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6718 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6719 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6720 (Target_arm::Relocate::relocate): Check for non-static or
6721 unimplemented relocation code and exit early. Change calls to
6722 Target_arm::reloc_uses_thumb_bit and
6723 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6724 instead. Refactor code to handle similar relocations to increase
6725 code sharing. Remove check for unsupported relocation code in switch
6726 statement.
6727 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6728 relocation property table to find out size. Change error message to
6729 print out the name of a relocation code instead of the numeric value.
6730 (Target_arm::scan_reloc_for_stub): Use relocation property table
6731 instead of calling Target_arm::reloc_uses_thumb_bit().
6732
218c5831
DK
67332010-02-02 Doug Kwan <dougkwan@google.com>
6734
6735 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6736 types of relaxed input section.
6737
0d31c79d
DK
67382010-02-02 Doug Kwan <dougkwan@google.com>
6739
6740 * Makefile.am (HFILES): Add arm-reloc-property.h.
6741 (DEFFILES): New.
2e702c99
RM
6742 (TARGETSOURCES): Add arm-reloc-property.cc
6743 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
6744 (libgold_a_SOURCES): $(DEFFILES)
6745 * Makefile.in: Regenerate.
6746 * arm-reloc-property.cc: New file.
6747 * arm-reloc-property.h: New file.
6748 * arm-reloc.def: New file.
6749 * arm.cc: Update comments.
6750 (arm-reloc-property.h): New included header.
6751 (arm_reloc_property_table): New global variable.
6752 (Target_arm::do_select_as_default_target): New method definition.
6753 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6754 arm-reloc-property to targ_extra_obj.
6755 * parameters.cc (set_parameters_target): Call
6756 Target::select_as_default_target().
6757 * target.h (Target::select_as_default_target): New method definition.
6758 (Target::do_select_as_default_target): Same.
6759
546c7457
DK
67602010-02-01 Doug Kwan <dougkwan@google.com>
6761
6762 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6763 first_output_text_section_.
6764 (Arm_exidx_fixup::first_output_text_section): New method definition.
6765 (Arm_exidx_fixup::first_output_text_section_): New data member.
6766 (Arm_exidx_fixup::process_exidx_section): Record the first text
6767 output section seen.
6768 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6769 and entsize in output section header.
6770
11b861d5
DK
67712010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6772
6773 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6774 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6775 (Arm_relocate_functions::thm_alu11): New Method.
6776 (Arm_relocate_functions::thm_pc8): New Method.
6777 (Arm_relocate_functions::thm_pc12): New Method.
6778 (Target_arm::Scan::local): Handle the relocations.
6779 (Target_arm::Scan::global): Likewise.
6780 (Target_arm::Relocate::relocate): Likewise.
6781 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6782
c9a2c125
DK
67832010-01-29 Doug Kwan <dougkwan@google.com>
6784
6785 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6786 of relocation types as ld.
6787
1521477a
DK
67882010-01-29 Doug Kwan <dougkwan@google.com>
6789
6790 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6791 to public.
6792 (Arm_relocate_functions::thumb_branch_common): Ditto.
6793 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6794 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6795 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6796 Arm_relocate_functions::jump24): Remove.
6797 (Target_arm::Relocate::relocate): Adjust code to call
6798 Arm_relocation_functions::arm_branch_common and
6799 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 6800 wrappers. Merge switch-cases together to reduce source code size.
1521477a 6801
e7eca48c
DK
68022010-01-29 Doug Kwan <dougkwan@google.com>
6803
6804 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6805 output_local_symbol_count_needs_update_.
6806 (Arm_relobj::output_local_symbol_count_needs_update,
6807 Arm_relobj::set_output_local_symbol_count_needs_update,
6808 Arm_relobj::update_output_local_symbol_count): New methods.
6809 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6810 member.
6811 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6812 of pointed function as in a R_ARM_PREL31 relocation.
6813 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6814 for output local symbol count updating.
6815 (Target_arm::do_relax): Update output local symbol counts in objects
6816 if necessary.
6817 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6818
02961d7e
ILT
68192010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6820
6821 * arm.cc: Added support for the ARM relocations:
6822 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6823 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6824 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6825 movw_prel_nc).
6826 (Arm_relocate_functions::movw_rel): New method.
6827 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6828 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6829 thm_movw_prel_nc).
6830 (Arm_relocate_functions::thm_movw_rel): New method.
6831 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6832 thm_movt_prel).
6833 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6834 relocations.
6835 (Target_arm::Scan::global): Likewise.
6836 (Target_arm::Relocate::relocate): Likewise.
6837 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6838 Likewise.
6839
b10d2873
ILT
68402010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6841
6842 * arm.cc: Added support for ARM group relocations.
6843 (Target_arm::reloc_needs_sym_origin): New method.
6844 (Arm_relocate_functions::calc_grp_kn): New method.
6845 (Arm_relocate_functions::calc_grp_residual): New method.
6846 (Arm_relocate_functions::calc_grp_gn): New method.
6847 (Arm_relocate_functions::arm_grp_alu): New Method.
6848 (Arm_relocate_functions::arm_grp_ldr): New Method.
6849 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6850 (Arm_relocate_functions::arm_grp_ldc): New Method.
6851 (Target_arm::Scan::local): Handle the ARM group relocations.
6852 (Target_arm::Scan::global): Likewise.
6853 (Target_arm::Relocate::relocate): Likewise.
6854 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6855 Likewise.
6856
2b328d4e
DK
68572010-01-26 Doug Kwan <dougkwan@google.com>
6858
6859 * arm.cc (set): Include.
6860 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6861 pointer type.
2e702c99 6862 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
6863 (Arm_output_section::append_text_sections_to_list): New method.
6864 (Arm_output_section::fix_exidx_coverage): Ditto.
6865 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 6866 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
6867 Relobj::set_section_offset() instead of
6868 Sized_relobj::invalidate_section_offset().
2e702c99 6869 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
6870 parameter for section headers. Ignore relocation sections for
6871 unallocated sections and EXIDX sections.
6872 (Target_arm::fix_exidx_coverage): New method.
6873 (Target_arm::output_section_address_less_than): New type.
6874 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6875 linked text section instead of the EXIDX section.
6876 (Arm_output_section::create_stub_group): Add an assertion to check
6877 that this is not an EXIDX output section.
6878 (Arm_output_section::append_text_sections_to_list): New method.
6879 (Arm_output_section::fix_exidx_coverage): Ditto.
6880 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 6881 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
6882 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6883 first pass.
6884 (Target_arm::fix_exidx_coverage): New method.
6885 * object.h (Relobj::set_output_section): New method.
6886 (Sized_relobj::invalidate_section_offset): Remove method.
6887 (Sized_relobj::do_invalidate_section_offset): Remove method.
6888 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6889
c7f3c371
DK
68902010-01-25 Doug Kwan <dougkwan@google.com>
6891
6892 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6893 Fix warning due to signed and unsigned comparison on a 32-bit host.
6894
8923b24c
DK
68952010-01-22 Doug Kwan <dougkwan@google.com>
6896
6897 * arm.cc (Target_arm::do_relax): Record an output section for section
6898 offset adjustment it contains any stub table that has changed.
6899 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6900 offsets in an output section if necessary.
6901 * output.cc (Output_section::Output_section): Initialize
6902 section_offsets_need_adjustments_.
6903 (Output_section::add_input_section_for_script): Renamed to
6904 Output_section::add_simple_input_section.
6905 (Output_section::save_states): Add a comment.
6906 (Output_section::discard_states): New method defintion.
6907 (Output_section::adjust_section_offsets): Same.
6908 * output.h (Output_section::add_input_section_for_script): Renamed to
6909 Output_section::add_simple_input_section.
6910 (Output_section::discard_states): New method declaration.
6911 (Output_section::adjust_section_offsets): Same.
6912 (Output_section::section_offsets_need_adjustment,
6913 Output_section::set_section_offsets_need_adjustment): New method
6914 definitions.
6915 (Output_section::section_offsets_need_adjustment_): New data member.
6916 * script-sections.cc
6917 (Output_section_element_input::set_section_address): Adjust code for
6918 renaming of Output_section::add_input_section_for_script.
6919 (Orphan_output_section::set_section_address): Same.
6920
9b2fd367
DK
69212010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6922
6923 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6924 Fix_v4bx enum values .
6925 * gold/options.h (General_options): New option definitions.
6926 (General_options::fix_v4bx): New method.
6927 (General_options::Fix_v4bx): New enum.
6928 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6929 (General_options::parse_fix_v4bx_interworking): New method.
6930
80d0d023
DK
69312010-01-22 Doug Kwan <dougkwan@google.com>
6932
6933 * arm.cc (Arm_exidx_fixup): New class.
6934
af2cdeae
DK
69352010-01-21 Doug Kwan <dougkwan@google.com>
6936
6937 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6938 classes.
6939 (Arm_exidx_section_offset_map): New type.
6940
993d07c1
DK
69412010-01-21 Doug Kwan <dougkwan@google.com>
6942
6943 * arm.cc (Arm_exidx_input_section): New class.
6944 (Arm_relobj::exidx_input_section_by_link,
6945 Arm_relobj::exidx_input_section_by_shndx,
6946 Arm_relobj::make_exidx_input_section): New methods.
6947 (read_arm_attributes_section): Remove.
6948 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6949 information about them.
6950 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6951 to here.
6952
5ac169d4
DK
69532010-01-20 Doug Kwan <dougkwan@google.com>
6954
6955 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6956 Input_section_specifier to Section_id.
6957 (Target_arm::new_arm_input_section: Adjust code for change of key
6958 type.
6959 (Target_arm::find_arm_input_section): Ditto.
6960 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6961 (Section_id): Remove.
6962 (Garbage_collection::Section_id_hash): Remove.
6963 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6964 (Section_id): Remove.
6965 (Icf::Section_id_hash): Remove.
6966 * object.h (Section_id, Const_section_id, Section_id_hash,
6967 Const_section_id_hash): New type definitions.
6968 * output.cc (Output_section::add_relaxed_input_section): Change to
6969 use Const_section_id instead of Input_section_specifier as key type.
6970 (Output_section::add_merge_input_section): Ditto.
6971 (Output_section::build_relaxation_map): Change to use Section_id
6972 instead of Input_section_specifier as key type.
2e702c99 6973 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
6974 Ditto.
6975 (Output_section::convert_input_sections_to_relaxed_sections): Change
6976 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 6977 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
6978 (Output_section::find_relaxed_input_section): Ditto.
6979 * output.h (Input_section_specifier): Remove class.
6980 (Output_section::Output_section_data_by_input_section_map): Change
6981 key type to Const_section_id.
6982 (Output_section::Output_relaxed_input_section_by_input_section_map):
6983 Ditto.
6984 (Output_section::Relaxation_map): Change key type to Section_id.
6985
a2162063
ILT
69862010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6987
6988 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6989 (class Arm_v4bx_stub): New class.
6990 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6991 (Stub_factory::make_arm_v4bx_stub): New method.
6992 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6993 (Stub_table::empty): Handle v4bx stubs.
6994 (Stub_table::add_arm_v4bx_stub): New method.
6995 (Stub_table::find_arm_v4bx_stub): New method.
6996 (Arm_relocate_functions::v4bx): New method.
6997 (Target_arm::fix_v4bx): New method.
6998 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6999 (Stub_table::relocate_stubs): Likewise.
7000 (Stub_table::do_write): Likewise.
7001 (Stub_table::update_data_size_and_addralign): Likewise.
7002 (Stub_table::finalize_stubs): Likewise.
7003 (Target_arm::Scan::local): Likewise.
7004 (Target_arm::Scan::global): Likewise.
7005 (Target_arm::do_finalize_sections): Likewise.
7006 (Target_arm::Relocate::relocate): Likewise.
7007 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7008 Likewise.
7009 (Target_arm::scan_reloc_for_stub): Likewise.
7010 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7011
5696ab0b
ILT
70122010-01-19 Ian Lance Taylor <iant@google.com>
7013
7014 * output.cc (Output_section_headers::do_sized_write): Write large
7015 segment count to sh_info field.
7016 (Output_file_header::do_sized_write): For large segment count,
7017 write PN_XNUM to e_phnum field.
7018
800d0f56
ILT
70192010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7020
7021 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
7022 (Arm_relocate_functions::thm_jump8): New function.
7023 (Arm_relocate_functions::thm_jump11): New function.
7024 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
7025 R_ARM_THM_JUMP11.
7026 (Target_arm::Scan::global): Likewise.
7027 (Target_arm::Relocate::relocate): Likewise.
7028 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7029 Likewise.
7030
41263c05
DK
70312010-01-14 Doug Kwan <dougkwan@google.com>
7032
7033 * arm.cc (map, utility): Include headers.
7034 (Target_arm::apply_cortex_a8_workaround): New method.
7035 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
7036 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
7037 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
7038 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
7039 the --[no-]fix-cortex-a8 command line options.
7040 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
7041 (Target_arm::relocate_stub): Use addend in instruction template.
7042 * options.h (DEFINE_bool): Set the user-set flag.
7043 (General_options): Add --[no-]-fix-cortex options.
7044 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 7045 : Update fast look-up map after conversion.
41263c05 7046
459e9b03
ST
70472010-01-14 Sriraman Tallam <tmsriram@google.com>
7048
7049 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
7050 in the first pass of do_layout.
7051
b521dfe4
DK
70522010-01-13 Doug Kwan <dougkwan@google.com>
7053
7054 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7055 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
7056 apparent compiler problem of not folding static constant integral
7057 data members of elfcpp::Elf_sizes<32>.
7058
44272192
DK
70592010-01-13 Doug Kwan <dougkwan@google.com>
7060
7061 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7062 Arm_relobj::section_needs_cortex_a8_stub_scanning,
7063 Arm_relobj::scan_section_for_cortex_a8_erratum,
7064 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7065 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7066 sections to scan for relocation stubs into a new method
7067 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7068 relocation and Cortex-A8 stub scanning.
7069 (Target_arm::do_relax): Force stubs to be after stubbed sections
7070 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 7071 the beginning of a new relaxation pass. Update a comment.
44272192
DK
7072 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7073
44b71ece
ILT
70742010-01-12 Ian Lance Taylor <iant@google.com>
7075
7076 * target-reloc.h (visibility_error): New inline function.
7077 (relocate_section): Call visibility_error.
7078 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7079 (MOSTLYCLEANFILES): Likewise.
7080 (protected_4_pic.o, protected_3.err): New targets.
7081 * testsuite/protected_4.cc: New file.
7082
a120bc7f
DK
70832010-01-12 Doug Kwan <dougkwan@google.com>
7084
7085 * arm.cc (Cortex_a8_reloc): New class.
7086 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7087 and cortex_a8_relocs_info_.
7088 (Target_arm::fix_cortex_a8): New method definition.
7089 (Target_arm::Cortex_a8_relocs_info): New type.
7090 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7091 New data member declarations.
7092 (Target_arm::scan_reloc_for_stub): Record information about
7093 relocations for THUMB branches that might be exempted from the
7094 Cortex-A8 workaround.
7095 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7096 at the beginning of a relaxation pass.
7097
20138696
DK
70982010-01-12 Doug Kwan <dougkwan@google.com>
7099
7100 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7101 (Arm_relobj::Mapping_symbol_position,
7102 Arm_reloj::Mapping_symbol_position_less,
7103 Arm_relobj::Mapping_symbols_info): New types.
7104 (Target_arm::is_mapping_symbol_name): New method definition.
7105 (Arm_relobj::do_count_local_symbols): Save information about mapping
7106 symbols.
7107
089d69dc
DK
71082010-01-11 Doug Kwan <dougkwan@google.com>
7109
7110 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7111 Arm_relocate_functions::thumb32_branch_upper,
7112 Arm_relocate_functions::thumb32_branch_lower,
7113 Arm_relocate_functions::thumb32_cond_branch_offset,
7114 Arm_relocate_functions::thumb32_cond_branch_upper,
7115 Arm_relocate_functions::thumb32_cond_branch_lower,
7116 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7117 branch offset encoding.
7118 (Arm_relocate_functions::thumb_branch_common): Use new branch
7119 offset encoding methods to avoid code duplication.
7120 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7121 (Stub_addend_reader::operator()): Use new branch encoding method
7122 to avoid code duplication.
7123
99e5bff2
DK
71242010-01-11 Doug Kwan <dougkwan@google.com>
7125
7126 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7127 (Target_arm::do_finalize_sections): Define special EXIDX section
7128 symbols only if referenced.
7129 * gc.h (Garbage_collection::add_reference): New method.
7130 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7131 code duplication.
7132
98e090bd
ILT
71332010-01-11 Ian Lance Taylor <iant@google.com>
7134
d0a91bd8
ILT
7135 * script.cc (Version_script_info::build_expression_list_lookup):
7136 Change complaing about duplicate wildcard match from error to
7137 warning.
7138
98e090bd
ILT
7139 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7140 of 2009-12-30.
7141 (Version_script_info::Version_script_info): Initialize globs_,
7142 default_version_, default_is_global_, and exact_. Don't
7143 initialize globals_ or locals_.
7144 (Version_script_info::build_lookup_tables): Build local symbols
7145 first.
7146 (Version_script_info::unquote): New function.
7147 (Version_script_info::add_exact_match): New function.
7148 (Version_script_info::build_expression_list_lookup): Remove lookup
7149 parameter. Add is_global parameter. Change all callers. Handle
7150 wildcard pattern specially. Unquote pattern. Call
7151 add_exact_match.
7152 (Version_script_info::get_name_to_match): New function.
7153 (Version_script_info::get_symbol_version): New function.
7154 (Version_script_info::get_symbol_version_helper): Remove.
7155 (Version_script_info::check_unmatched_names): Call unquote.
7156 * script.h (class Version_script_info): Change get_symbol_version
7157 to be non-inline and add is_global parameter; change all callers.
7158 Rewrite symbol_is_local. Update declarations. Define struct
7159 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7160 Remove globals_ and locals_ members. Add exact_, globs_,
7161 default_version_, is_global_.
7162 (Version_script_info::Glob): Remove pattern, add expression and
7163 is_global. Update constructor. Change all callers.
7164 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7165 default version.
7166 (Versions::symbol_section_contents): If a symbol is undefined, or
7167 defined in a dynamic object, set the version index to
7168 VER_NDX_LOCAL.
7169 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7170 symbol_is_local.
7171 (Symbol_table::add_from_pluginobj): Likewise.
7172 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7173
d56962d3
DK
71742010-01-11 Doug Kwan <dougkwan@google.com>
7175
7176 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7177 (incremental_dump_LDADD): Add linking option for libintl.
7178 * Makefile.in: Regenerate.
7179
94e6ee91
L
71802010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7181
7182 PR gold/11144
7183 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7184 instead of -Ds.
7185 * testsuite/Makefile.in: Regenerated.
7186
e96c574b
DK
71872010-01-10 Doug Kwan <dougkwan@google.com>
7188
7189 * options.h (DEFINE_var): Use parentheses around argument varname__
7190 in macro body to avoid any unintended subsequent substitutions.
7191
7198066b
ILT
71922010-01-10 Ian Lance Taylor <iant@google.com>
7193
ba4d53bf
ILT
7194 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7195 candidates before doing symbol resolution.
7196
7198066b
ILT
7197 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7198 ODR candidates if only one is weak.
7199
a2beed37
ILT
72002010-01-08 Ian Lance Taylor <iant@google.com>
7201
7202 * script.cc (Version_script_info::build_expression_list_lookup):
7203 Don't warn about ambiguous version, just record the ambiguity.
7204 (Version_script_info::get_symbol_version_helper): Give error if
7205 version is ambiguous.
7206
2fb7225c
DK
72072010-01-08 Doug Kwan <dougkwan@google.com>
7208
7209 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7210 prev_data_size_ and prev_addralign_. Remove initializer for
7211 deleted data member has_been_changed_.
7212 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7213 to determine if the table is empty.
7214 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7215 Remove.
7216 (Stub_table::add_reloc_stub): Define method in class definition
7217 instead of just declaring it there.
7218 (Stub_table::add_cortex_a8_stub): New method definition.
7219 (Stub_table::update_data_size_and_addralign): Ditto.
7220 (Stub_table::finalize_stubs): Ditto.
7221 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7222 (Stub_table::do_addralign_): Return address alignment in the
7223 (Stub_table::do_reset_address_and_file_offset): Define method in
7224 class definition instead of declaring it there. Set current data
7225 size to be the data size of the previous pass.
7226 (Stub_table::set_final_data_size): Use current data size as the
7227 final data size.
7228 (Stub_table::relocate_stub): Change parameter type of stub from
7229 Reloc_stub pointer to Stub pointer.
7230 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7231 (Stub_table::Cortex_a8_stub_list): New typedef.
7232 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7233 Stub_table::prev_addralign_): New data member.
7234 (Arm_relobj::Arm_relobj): Initialize data member
7235 section_has_cortex_a8_workaround_.
7236 (Arm_relobj::section_has_cortex_a8_workaround,
7237 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7238 definitions.
7239 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7240 declarations.
7241 (Target_arm::relocate_stub): Change parameter type of stub from
7242 Reloc_stub pointer to Stub pointer.
7243 (Insn_template::size, Insn_template::alignment): Handle
7244 THUMB16_SPECIAL_TYPE.
7245 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7246 Stub_table::update_data_size_and_addralign,
7247 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7248 definitions.
2e702c99 7249 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
2fb7225c
DK
7250 (Stub_table::do_write): Ditto.
7251 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7252
880cd20d
ILT
72532010-01-08 Ian Lance Taylor <iant@google.com>
7254
7255 PR 11108
7256 * symtab.h (class Symbol): Remove fields is_target_special_ and
7257 has_plt_offset_. Add field is_defined_in_discarded_section_.
7258 (Symbol::is_defined_in_discarded_section): New function.
7259 (Symbol::set_is_defined_in_discarded_section): New function.
7260 (Symbol::has_plt_offset): Rewrite.
7261 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7262 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7263 Don't initialize is_target_special_ or has_plt_offset_.
7264 Initialize is_defined_in_discarded_section_.
7265 (Symbol_table::add_from_relobj): If appropriate, set
7266 is_defined_in_discarded_section.
7267 * resolve.cc (Symbol::override_base_with_special): Don't test
7268 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7269 * target-reloc.h (relocate_section): Do special handling for
7270 symbols defined in discarded sections for global symbols as well
7271 as local symbols.
7272
2703e3eb
ILT
72732010-01-08 Ian Lance Taylor <iant@google.com>
7274
7275 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7276 the SHT_SYMTAB case.
7277
339d40a3
ILT
72782010-01-08 Ian Lance Taylor <iant@google.com>
7279
7280 * object.cc (Sized_relobj::do_layout): Don't get confused if
7281 layout_eh_frame returns NULL.
7282
abecea76
ILT
72832010-01-08 Ian Lance Taylor <iant@google.com>
7284
7285 PR 11084
7286 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7287 dynamic symbol table, use the normal symbol table.
7288 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7289 symbol table.
7290
6b7dd3f3
ILT
72912010-01-08 Ian Lance Taylor <iant@google.com>
7292
7293 PR 11072
7294 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7295 sections.
7296
36c50e63
L
72972010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7298
7299 * version.cc (print_version): Change to "Copyright 2010".
7300
e291e7b9
ILT
73012010-01-08 Ian Lance Taylor <iant@google.com>
7302
7303 PR 10287
7304 PR 11063
7305 * i386.cc (class Target_i386): Change return type of plt_section
7306 to be non-const.
7307 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7308 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7309 tls_desc_rel_ field.
7310 (Output_data_plt_i386::rel_tls_desc): New function.
7311 (Target_i386::rel_tls_desc_section): New function.
7312 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7313 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7314 R_386_TLS_DESC reloc in rel_tls_desc_section.
7315 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7316 Define struct Tlsdesc_info.
7317 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7318 (Target_x86_64::do_reloc_symbol_index): New function.
7319 (Target_x86_64::add_tlsdesc_info): New function.
7320 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7321 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7322 tlsdesc_rel_ field.
7323 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7324 all callers.
7325 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7326 (Target_x86_64::rela_tlsdesc_section): New function.
7327 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7328 handling.
7329 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7330 (Target_x86_64::do_reloc_addend): New function.
7331 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7332 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7333 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7334 (Output_reloc::type): New function.
7335 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7336 (Output_reloc::is_target_specific): New function.
7337 (Output_reloc::target_arg): New function.
7338 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7339 absolute relocs and target specific relocs.
7340 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7341 add_target_specific.
7342 (class Output_data_reloc) [SHT_RELA]: Likewise.
7343 * output.cc (Output_reloc::Output_reloc): Add four new versions
7344 for absolute relocs and target specific relocs.
7345 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7346 (Output_reloc::get_symbol_index): Likewise.
7347 (Output_reloc::local_section_offset): Check that local_sym_index_
7348 is not TARGET_CODE or 0.
7349 (Output_reloc::symbol_value): Likewise.
7350 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7351 reloc.
7352 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7353 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7354 functions.
7355 * layout.cc (add_target_dynamic_tags): Use output section for
7356 DT_PLTRELSZ and DT_JMPREL.
7357
3a44184e
ILT
73582010-01-07 Ian Lance Taylor <iant@google.com>
7359
7360 PR 11061
7361 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7362 function.
7363 (class Output_data_reloc_generic): Define.
7364 (class Output_data_reloc_base): Change base class to
7365 Output_data_reloc_generic. Change add() method to call
7366 bump_relative_reloc_count for a relative reloc. Remove
7367 sort_relocs_ field.
7368 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7369 to sort_relocs().
7370 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7371 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7372 appropriate.
7373 * layout.h (class Layout): Update declaration.
7374
ea715a34
ILT
73752010-01-07 Ian Lance Taylor <iant@google.com>
7376
7377 * output.h (class Output_data): Add const version of
7378 output_section and do_output_section.
7379 (class Output_section_data): Add const version of
7380 do_output_section.
7381 (class Output_section): Likewise.
7382 * layout.cc (Layout::add_target_dynamic_tags): New function.
7383 * layout.h (class Layout): Update declarations.
7384 * arm.cc (Target_arm::do_finalize_sections): Use
7385 add_target_dynamic_tags.
7386 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7387 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7388 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7389 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7390
659948a4
ILT
73912010-01-07 Ian Lance Taylor <iant@google.com>
7392
7393 PR 11042
7394 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7395 object as needed.
7396
9d3b86f6
ILT
73972010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7398 Ian Lance Taylor <iant@google.com>
7399
7400 PR 11019
7401 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7402 Xindex::read_symtab_xindex.
7403
bb0d3eb0
DK
74042010-01-07 Doug Kwan <dougkwan@google.com>
7405
7406 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7407 (Insn_template::thumb16_bcond_insn): New method declaration.
7408 (Insn_template): Fix spelling.
7409 (Stub::thumb16_special): New method declaration.
7410 (Stub::do_write): Define virtual method which was previously pure
7411 virtual.
7412 (Stub::do_thumb16_special): New method declaration.
7413 (Stub::do_fixed_endian_write): New template member.
7414 (Reloc_stub::do_write): Remove.
7415 (Reloc_stub::do_fixed_endian_write): Remove.
7416 (Cortex_a8_stub): New class definition.
7417 (Stub_factory::make_cortex_a8_stub): New method definition.
7418 (Stub_factory::Stub_factory): Add missing static storage class
7419 qualifier for elf32_arm_stub_a8_veneer_blx.
7420
ffeef7df
ILT
74212010-01-07 Ian Lance Taylor <iant@google.com>
7422
dc3f80fe
ILT
7423 PR 10980
7424 * options.h (class General_options): Add --warn-unresolved-symbols
7425 and --error-unresolved-symbols.
7426 * errors.cc (Errors::undefined_symbol): Implement
7427 --warn-unresolved-symbols.
7428
ffeef7df
ILT
7429 * options.h (class General_options): Add -z text and -z textoff.
7430 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7431
f1ec9ded
ST
74322010-01-06 Sriraman Tallam <tmsriram@google.com>
7433
7434 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7435 (Garbage_collection::cident_sections): New function.
7436 (Garbage_collection::add_cident_section): New function.
7437 (Garbage_collection::cident_sections_): New member.
7438 (gc_process_relocs): Add references to sections whose names are C
7439 identifiers.
7440 * gold.h (cident_section_start_prefix): New constant.
7441 (cident_section_stop_prefix): New constant.
7442 (is_cident): New function.
7443 * layout.cc (Layout::define_section_symbols): Replace string constants
7444 with the newly defined constants.
7445 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7446 C identifiers.
7447 * testsuite/Makefile.am: Add gc_orphan_section_test.
7448 * testsuite/Makefile.in: Regenerate.
7449 * testsuite/gc_orphan_section_test.cc: New file.
7450 * testsuite/gc_orphan_section_test.sh: New file.
7451
6eda8c29
ILT
74522010-01-06 Ian Lance Taylor <iant@google.com>
7453
b9674e17
ILT
7454 PR 10980
7455 * options.h (class General_options): Add --warn-shared-textrel.
7456 * layout.cc (Layout::finish_dynamic_section): Implement
7457 --warn-shared-textrel.
7458
6eda8c29
ILT
7459 PR 10980
7460 * options.h (class General_options): Add --warn-multiple-gp.
7461
32dcd44e
ILT
74622010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7463
7464 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7465 $(THREADSLIB) and $(LIBDL).
7466 * Makefile.in: Rebuild.
7467
a192ba05
ILT
74682010-01-06 Ian Lance Taylor <iant@google.com>
7469
7470 PR 10980
7471 * options.cc (General_options::parse_section_start): New function.
7472 (General_options::section_start): New function.
7473 (General_options::General_options): Initialize all members.
7474 * options.h: Include <map>
7475 (class General_options): Add --section-start. Add section_starts_
7476 member.
7477 * layout.cc (Layout::attach_allocated_section_to_segment): If
7478 --section-start was used, set the address of the segment. Remove
7479 local sort_sections.
7480 (Layout::relaxation_loop_body): If the address of the load segment
7481 has been set by --section-start, don't use it.
7482 * output.h (Output_segment::update_flags_for_output_section): New
7483 function.
7484 * output.cc (Output_segment::add_output_section): Call
7485 update_flags_for_output_section.
7486
dde3f402
ILT
74872010-01-05 Ian Lance Taylor <iant@google.com>
7488
62dfdd4d
ILT
7489 PR 10980
7490 * options.h (class General_options): Add --undefined-version.
7491 * script.cc (struct Version_expression): Add was_matched_by_symbol
7492 field.
7493 (Version_script_info::matched_symbol): New function.
7494 (Version_script_info::get_symbol_version_helper): Call
7495 matched_symbol.
7496 (Version_script_info::check_unmatched_names): New function.
7497 * script.h (class Version_script_info): Update declarations.
7498 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7499
9c4ae156
ILT
7500 * options.h (class General_options): Use DEFINE_bool_alias for
7501 allow_multiple_definition.
7502 * resolve.cc (Symbol_table::should_override): Don't test
7503 allow_multiple_definition.
7504
dde3f402
ILT
7505 PR 10980
7506 * options.h (class General_options): Add --cref.
7507 * main.cc (main): Print cref table if --cref. Don't close mapfile
7508 until after printing cref table.
7509 * cref.cc: Include "symtab.h".
7510 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7511 (Cref_table_compare::operator()): New function.
7512 (Cref_inputs::gather_cref): New function.
7513 (filecol): New static const.
7514 (Cref_inputs::print_cref): New function.
7515 (Cref::print_cref): New function.
7516 * cref.h: Include <cstdio>.
7517 (class Cref): Update declarations.
7518 * mapfile.h (Mapfile::file): New function.
7519 * object.h (class Object): Define Symbols. Declare virtual
7520 do_get_global_symbols.
7521 (Object::get_global_symbols): New function.
7522 * object.cc (Input_objects::add_object): Pass object to cref_ if
7523 --cref.
7524 (Input_objects::archive_start): Likewise.
7525 (Input_objects::archive_stop): Likewise.
7526 (Input_objects::print_cref): New function.
7527 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7528 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7529 --cref.
7530 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7531 function.
7532 * plugin.h (class Sized_pluginobj): Update declarations.
7533
8781f709
ILT
75342010-01-05 Ian Lance Taylor <iant@google.com>
7535
7536 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7537 to is_default_version. Rename insdef to insdefault.
7538 (Symbol_table::add_from_relobj): Rename def to is_default_version
7539 and local to is_forced_local.
7540 (Symbol_table::add_from_pluginobj): Likewise.
7541 (Symbol_table::add_from_dynobj): Likewise.
7542 (Symbol_table::define_special_symbol): Rename insdef to
7543 insdefault.
7544
fe35d28d
ILT
75452010-01-04 Ian Lance Taylor <iant@google.com>
7546
30bc8c46
ILT
7547 PR 10980
7548 * options.h (class General_options): Add
7549 --allow-multiple-definition and -z muldefs.
7550 * resolve.cc (Symbol_table::should_override): Don't warn about a
7551 multiple symbol definition if --allow-multiple-definition or -z
7552 muldefs.
7553
7eaea549
ILT
7554 PR 10980
7555 * options.h (class General_options): Add --add-needed and
7556 --copy-dt-needed-entries. Tweak --as-needed help entry.
7557 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7558 error if --copy-dt-needed-entries aka --add-needed is used and
7559 would cause a change in behaviour.
7560
fe35d28d
ILT
7561 PR 10980
7562 * options.h (class General_options): Add -G as a short version of
7563 --shared. Add no-op options -assert, -g, and -i.
7564
55a2bb35
ST
75652010-01-04 Sriraman Tallam <tmsriram@google.com>
7566
7567 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7568 check for .text or .gnu.linkonce.t sections.
7569 * icf.cc (Icf::find_identical_sections): Ditto.
7570 Change the detection for mangled function name within the section
7571 name.
7572 * icf.h (is_section_foldable_candidate): New function.
7573
719328e1
ILT
75742009-12-30 Ian Lance Taylor <iant@google.com>
7575
7576 PR 10980
7577 * options.h (class General_options): Permit two dashes with
7578 --retain-symbols-file.
7579
d7bb5745
ILT
75802009-12-30 Ian Lance Taylor <iant@google.com>
7581
403a15dd
ILT
7582 PR 10979
7583 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7584 don't put the file header and segment headers in the text
7585 segment.
7586
eda294df
ILT
7587 PR 10979
7588 * common.cc (Sort_commons::operator()): Stabilize sort when both
7589 entries are NULL.
7590 (Symbol_table::do_allocate_commons_list): When allocating common
7591 symbols, skip a symbol which is no longer common.
7592 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7593 an object before checking its type.
7594 * testsuite/common_test_2.c: New file.
7595 * testsuite/common_test_3.c: New file.
7596 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7597 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7598 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7599 (common_test_2_pic.o, common_test_2.so): New targets.
7600 (common_test_3_pic.o, common_test_3.so): New targets.
7601 * testsuite/Makefile.in: Rebuild.
7602
d7bb5745
ILT
7603 PR 10979
7604 * script.cc (read_input_script): If we see a new SECTIONS clause,
7605 and we have added an input section, give an error.
7606 * layout.h (class Layout): Add have_added_input_section function.
7607 Add have_added_input_section_ field.
7608 * layout.cc (Layout::Layout): Initialize
7609 have_added_input_section_.
7610 (Layout::layout): Set have_added_input_section_.
7611 (Layout::layout_eh_frame): Likewise.
7612
fc59c572
ILT
76132009-12-30 Ian Lance Taylor <iant@google.com>
7614
7615 PR 10931
7616 * options.h (class General_options): Add --sort-common option.
7617 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7618 * common.cc (Sort_common): Add sort_order parameter to
7619 constructor. Add sort_order_ field.
7620 (Sort_commons::operator): Check sort_order_.
7621 (Symbol_table::allocate_commons): Determine the sort order.
7622 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7623 Change all callers.
7624 (Symbol_table::do_allocate_commons_list): Likewise.
7625
1c74fab0
ILT
76262009-12-30 Ian Lance Taylor <iant@google.com>
7627
7628 PR 10916
7629 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7630 symbols from this object, don't change the visibility of an
7631 undefined symbol.
7632 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7633
6affe781
ILT
76342009-12-30 Ian Lance Taylor <iant@google.com>
7635
7636 PR 10861
7637 * script.h (class Version_script_info): Define Language enum.
7638 Update declarations. Define Glob, Exact, and Lookup types. Add
7639 new fields globals_, locals_, and is_finalized_.
7640 * script.cc: Various formatting fixes.
7641 (class Parser_closure): Change language_stack_ from a vector of
7642 std::string to one of Version_script_info::Language. Adjust all
7643 uses accordingly.
7644 (class Lazy_demangler): Remove.
7645 (struct Version_expression): Change language from std::string to
7646 Version_script_info::Language.
7647 (Version_script_info::Version_script_info): New function.
7648 (Version_script_info::~Version_script_info): Don't call clear.
7649 (Version_script_info::finalize): New function.
7650 (Version_script_info::build_lookup_tables): New function.
7651 (Version_script_info::build_expression_list_lookup): New
7652 function.
7653 (Version_script_info::get_symbol_version_helper): Rewrite to use
7654 lookup tables.
7655 (Version_script_info::print_expression_list): Adjust to use
7656 Version_script_info::Language.
7657 (script_push_lex_into_version_mode): Check that the version script
7658 has not been finalized.
7659 (version_script_push_lang): Change language string to
7660 Version_script_info::Language.
7661 * options.cc (Command_line::version_script): New function.
7662 * options.h (class General_options): Add finalize_dynamic_list
7663 function. Change version_script from declaration to definition.
7664 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7665 * testsuite/version_script.map: Remove duplicate def of foo.
7666 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7667 version_script.map.
7668 * testsuite/Makefile.in: Rebuild.
7669
818bf354
ILT
76702009-12-30 Ian Lance Taylor <iant@google.com>
7671
7672 PR 10843
7673 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7674 if the input symbol index is 0, make the output symbol index 0.
7675
ebcc8304
ILT
76762009-12-30 Ian Lance Taylor <iant@google.com>
7677
7678 PR 10670
7679 * options.h (class General_options): Add -x/--discard-all.
7680 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7681 --discard-all. If the local symbol needs a dynamic entry, check
7682 that before handling --discard-locals.
7683
176fe33f
ILT
76842009-12-30 Ian Lance Taylor <iant@google.com>
7685
bb321bb1
ILT
7686 PR 10450
7687 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7688 flags to PF_R.
7689 (Output_segment::add_output_section): Don't change the flags if
7690 the type is PT_TLS.
7691
176fe33f
ILT
7692 PR 10450
7693 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7694 GNU hash table if they need a dynamic value. Otherwise, don't add
7695 them if they are defined in a dynamic object or are forced local.
7696
e8cd95c7
ILT
76972009-12-29 Ian Lance Taylor <iant@google.com>
7698
1b81fb71
ILT
7699 PR 10450
7700 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7701 .gnu.hash table for a 32-bit target.
7702
8d6d383d
ILT
7703 PR 10450
7704 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7705 regular and a dynamic object only needs a dynamic symbol table
7706 entry if it is externally visible.
7707
e785ec03
ILT
7708 PR 10450
7709 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7710 constructor. Add global_offset_table_ field.
7711 (Target_i386::got_section): Set global_offset_table_.
7712 (Target_i386::do_finalize_sections): Set global_offset_table_
7713 size.
7714 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7715 in constructor. Add global_offset_table_ field.
7716 (Target_x86_64::got_section): Set global_offset_table_.
7717 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7718 size.
7719
1a2dff53
ILT
7720 * layout.cc (Layout::Layout): Initialize increase_relro_.
7721 (Layout::get_output_section): Add is_relro, is_last_relro, and
7722 is_first_non_relro parameters. Change all callers.
7723 (Layout::choose_output_section): Likewise.
7724 (Layout::add_output_section_data): Likewise.
7725 (Layout::make_output_section): Likewise.
7726 (Layout::set_segment_offsets): Clear increase_relro when using a
7727 linker script.
7728 * layout.h (class Layout): Add increase_relro method. Add
7729 increase_relro_ field. Update declarations.
7730 * output.cc (Output_section::Output_section): Initialize
7731 is_last_relro_ and is_first_non_relro_.
7732 (Output_segment::add_output_section): Group relro sections is
7733 do_sort is true. Handle is_last_relro and is_first_non_relro.
7734 (Output_segment::maximum_alignment): Remove relro handling.
7735 (Output_segment::set_section_addresses): Add increase_relro
7736 parameter. Change all callers. Add initial alignment to align
7737 relro sections on separate page. Remove old relro handling.
7738 (Output_segment::set_section_list_addresses): Remove in_relro
7739 parameter. Change all callers.
7740 (Output_segment::set_offset): Add increase parameter. Change all
7741 callers. Remove old relro handling.
7742 * output.h (class Output_section): Add new methods: is_last_relro,
7743 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7744 Add is_last_relro_ and is_first_non_relro_ fields.
7745 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7746 Create separate .got.plt section. Call increase_relro.
7747 * x86_64.cc (Target_x86_64::got_section): Likewise.
7748 * testsuite/relro_script_test.t: Add .got.plt.
7749
f0ba79e2
ILT
7750 PR 10450
7751 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7752 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7753 (Layout::finalize): Call set_dynamic_symbol_size.
7754 (Layout::set_dynamic_symbol_size): New function.
7755 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7756 set_dynamic_symbol_size.
7757
e8cd95c7
ILT
7758 PR 10450
7759 * output.h (class Output_section): Add is_entsize_zero_ field.
7760 * output.cc (Output_section::Output_section): Initialize
7761 is_entsize_zero_.
7762 (Output_section::set_entsize): If two different entsizes are
7763 requested, force it to zero.
7764 (Output_section::add_input_section): Set flags for .debug_str
7765 before updating section flags. Set entsize.
7766 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7767 and SHF_STRING if all input sections have those flags.
7768
3e1b9a8a
RÁE
77692009-12-29 Rafael Espindola <espindola@google.com>
7770
7771 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
7772 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7773 reporting.
3e1b9a8a 7774
3dcad376
ST
77752009-12-29 Sriraman Tallam <tmsriram@google.com>
7776
7777 * options.cc (General_options::parse_version): Allow -v to exit
7778 without an error if there is nothing to link.
7779
084e2665
ILT
77802009-12-29 Ian Lance Taylor <iant@google.com>
7781
7782 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7783 using a version of gcc before 4.1.
7784 * configure: Rebuild.
7785
250acde3
CD
77862009-12-28 Chris Demetriou <cgd@google.com>
7787
7788 * attributes.cc (Output_attributes_section_data::do_write): Use
7789 std::vector::front rather than std::vector::data.
7790
99fff23b
ILT
77912009-12-28 Ian Lance Taylor <iant@google.com>
7792
7793 * symtab.h (class Symbol_table): Add enum Defined.
7794 * resolve.cc (Symbol_table::should_override): Add defined
7795 parameter. Change all callers. Test whether object is NULL
7796 before calling a method on it.
7797 (Symbol_table::report_resolve_problem): Add defined parameter.
7798 Change all callers.
7799 (Symbol_table::should_override_with_special): Likewise.
7800 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7801 parameter. Change all callers.
7802 (Symbol_table::do_define_in_output_data): Likewise.
7803 (Symbol_table::define_in_output_segment): Likewise.
7804 (Symbol_table::do_define_in_output_segment): Likewise.
7805 (Symbol_table::define_as_constant): Likewise.
7806 (Symbol_table::do_define_as_constant): Likewise.
7807 * script.h (class Symbol_assignment): Add is_defsym parameter to
7808 constructor; change all callers.
7809 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7810 parameter. Change all callers. Add is_defsym_ field.
7811 (class Parser_closure): Add parsing_defsym parameter to
7812 constructor; change all callers. Add parsing_defsym accessor
7813 function. Add parsing_defsym_ field.
7814
556bd683
ILT
78152009-12-28 Ian Lance Taylor <iant@google.com>
7816
7817 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 7818 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 7819
1782c879
ILT
78202009-12-23 Ian Lance Taylor <iant@google.com>
7821
7822 * i386.cc (Target_i386::do_calls_non_split): Recognize
7823 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
7824 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7825 -fsplit-stack prologue when using %r11.
1782c879 7826
329ca2b1
ST
78272009-12-21 Sriraman Tallam <tmsriram@google.com>
7828
7829 * options.cc (General_options::parse_version): Make -v continue and do
7830 the link like GNU ld does.
7831
d675ff46
RÁE
78322009-12-17 Rafael Avila de Espindola <espindola@google.com>
7833
7834 * Makefile.am (CCFILES): Add timer.cc.
7835 (HFILES): Add timer.h.
7836 * configure.ac: Check for sysconf and times.
7837 * main.cc: include timer.h.
7838 (main): Use Timer instead of get_run_time.
7839 * timer.cc: New.
7840 * timer.h: New.
7841 * workqueue.cc: include timer.h.
7842 (Workqueue::find_and_run_task):
7843 Report user, sys and wall time.
7844 * Makefile.in: Regenerate.
7845 * config.in: Regenerate.
7846 * configure: Regenerate.
7847
d6344fb5
DK
78482009-12-16 Doug Kwan <dougkwan@google.com>
7849
7850 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7851 sections.
7852 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7853 relaxed input sections.
7854 * output.cc (Output_section::find_relaxed_input_section): Change
7855 return type to Output_relaxed_input_section pointer. Adjust code
7856 for new type of relaxed_input_section_map_.
7857 * output.h (Output_section::find_relaxed_input_section): Change
7858 return type to Output_relaxed_input_section pointer.
7859 (Output_section::Output_relaxed_input_section_by_input_section_map):
7860 New type.
7861 (Output_section::relaxed_input_section_map_): Change type to
7862 Output_section::Output_relaxed_input_section_by_input_section_map.
7863 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7864 input section.
7865
0e0d5469
ILT
78662009-12-15 Ian Lance Taylor <iant@google.com>
7867
7868 * layout.cc (Layout::create_shstrtab): Only write out after input
7869 sections if we are compressing debug sections.
7870
0649a889
ILT
78712009-12-15 Ian Lance Taylor <iant@google.com>
7872
7873 * archive.cc (Archive::add_symbols): Only look up a symbol without
7874 a version if there is, in fact, a version.
7875
2ea97941
ILT
78762009-12-14 Ian Lance Taylor <iant@google.com>
7877
7878 Revert -Wshadow changes, all changes from:
7879 2009-12-11 Doug Kwan <dougkwan@google.com>
7880 2009-12-11 Nick Clifton <nickc@redhat.com>
7881 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7882
b0eec2cc
DK
78832009-12-11 Doug Kwan <dougkwan@google.com>
7884
7885 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7886 due to -Wshadow.
7887 * attributes.cc (Object_attribute::size): Ditto.
7888 (Attributes_section_data::size): Ditto.
7889 (Attributes_section_data::Attributes_section_data): Ditto.
7890 (Output_attributes_section_data::do_write): Ditto.
7891 * attributes.h (Object_attribute::set_type): Ditto.
7892 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7893
91d6fa6a
NC
78942009-12-11 Nick Clifton <nickc@redhat.com>
7895
7896 * archive.cc: Fix shadowed variable warnings.
7897 * arm.cc: Likewise.
7898 * compressed_output.cc: Likewise.
7899 * compressed_output.h: Likewise.
7900 * configure: Likewise.
7901 * dwarf_reader.cc: Likewise.
7902 * dynobj.cc: Likewise.
7903 * dynobj.h: Likewise.
7904 * ehframe.cc: Likewise.
7905 * ehframe.h: Likewise.
7906 * errors.cc: Likewise.
7907 * expression.cc: Likewise.
7908 * fileread.cc: Likewise.
7909 * fileread.h: Likewise.
7910 * freebsd.h: Likewise.
7911 * i386.cc: Likewise.
7912 * icf.cc: Likewise.
7913 * incremental.h: Likewise.
7914 * layout.cc: Likewise.
7915 * layout.h: Likewise.
7916 * mapfile.cc: Likewise.
7917 * merge.cc: Likewise.
7918 * merge.h: Likewise.
7919 * object.cc: Likewise.
7920 * object.h: Likewise.
7921 * options.h: Likewise.
7922 * output.cc: Likewise.
7923 * output.h: Likewise.
7924 * parameters.cc: Likewise.
7925 * plugin.cc: Likewise.
7926 * powerpc.cc: Likewise.
7927 * reduced_debug_output.cc: Likewise.
7928 * reduced_debug_output.h: Likewise.
7929 * reloc.cc: Likewise.
7930 * reloc.h: Likewise.
7931 * resolve.cc: Likewise.
7932 * script-sections.cc: Likewise.
7933 * script.cc: Likewise.
7934 * script.h: Likewise.
7935 * sparc.cc: Likewise.
7936 * symtab.cc: Likewise.
7937 * symtab.h: Likewise.
7938 * target-select.cc: Likewise.
7939 * target-select.h: Likewise.
7940 * token.h: Likewise.
7941 * workqueue.cc: Likewise.
7942 * workqueue.h: Likewise.
7943 * x86_64.cc: Likewise.
7944
a0351a69
DK
79452009-12-10 Doug Kwan <dougkwan@google.com>
7946
7947 * arm.cc (attributes.h): New include.
7948 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7949 (Arm_relobj::~Arm_relobj): Delete object pointed by
7950 attributes_section_data_.
7951 (Arm_relobj::attributes_section_data): New method definition.
7952 (Arm_relobj::attributes_section_data_): New data member declaration.
7953 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7954 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7955 attributes_section_data_.
7956 (Arm_dynobj::attributes_section_data): New method definition.
7957 (Arm_dynobj::attributes_section_data_): New data member declaration.
7958 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7959 initialization value of may_use_blx_ to false.
2e702c99 7960 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
7961 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7962 object attributes to compute results instead of hard-coding.
7963 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7964 Target_arm::get_secondary_compatible_arch,
7965 Target_arm::set_secondary_compatible_arch
7966 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7967 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7968 New method declarations.
7969 (Target_arm::get_aeabi_object_attribute): New method definition.
7970 (Target_arm::attributes_section_data_): New data member declaration.
7971 (read_arm_attributes_section): New template definition.
7972 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7973 (Arm_dynobj::do_read_symbols): Ditto.
7974 (Target_arm::do_finalize_sections): Merge attributes sections from
7975 input. Check for BLX use after attributes section merging.
7976 Fix __exidx_start and __exidx_end visibility. Create an
7977 .ARM.attributes section if necessary.
7978 (Target_arm::get_secondary_compatible_arch,
7979 Target_arm::set_secondary_compatible_arch,
7980 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7981 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 7982 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
7983 New method definitions.
7984
b59befec
ILT
79852009-12-09 Ian Lance Taylor <iant@google.com>
7986
7987 * plugin.cc (Plugin::load): Don't cast from void* to a function
7988 pointer.
7989
1276bc89
ILT
79902009-12-09 Ian Lance Taylor <iant@google.com>
7991
7992 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7993 information fields.
7994
2f2de248
L
79952009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7996
7997 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7998 Replace two_file_shared_1.so with two_file_shared_2.so.
7999 * testsuite/Makefile.in: Regenerated.
8000
4f787271
DK
80012009-12-08 Doug Kwan <dougkwan@google.com>
8002
8003 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8004 (HFILES): Add attributes.h and int_encoding.h.
8005 * Makefile.in: Regenerate.
8006 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8007 function definitions to int_encoding.cc
8008 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8009 prototypes to int_encoding.h
8010 * reduced_debug_output.cc (int_encoding.h): New include.
8011 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
8012 function definitions to int_encoding.cc
8013 (insert_into_vector, read_from_pointer): Move template definitions to
8014 int_encoding.h
8015 * attributes.cc: New file.
8016 * attributes.h: New file.
8017 * int_encoding.cc: New file.
8018 * int_encoding.h: New file.
8019
20b52f1a
RÁE
80202009-12-07 Rafael Avila de Espindola <espindola@google.com>
8021
8022 PR gold/11055
8023 * incremental-dump.cc (dump_incremental_inputs): New.
8024 (main): Use dump_incremental_inputs.
8025
53d7974c
L
80262009-12-07 H.J. Lu <hongjiu.lu@intel.com>
8027
8028 PR gold/10893
8029 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
8030 checking elfcpp::STT_FUNC.
8031 (Target_i386::Relocate::relocate): Likewise.
8032 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8033
8034 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
8035 symbols from shared libraries into normal FUNC symbols.
8036
8037 * symtab.h (Symbol): Add is_func and use it.
8038
05a352e6
DK
80392009-12-05 Doug Kwan <dougkwan@google.com>
8040
8041 * arm.cc (Target_arm::arm_info): Initialize new fields
8042 attributes_section and attributes_vendor.
8043 * i386.cc (Target_i386::i386_info): Same.
8044 * object.cc (Sized_relobj::do_layout): Skip attribute section.
8045 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
8046 fields attributes_section and attributes_vendor.
53d7974c 8047 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
8048 * target.h (Target::attributes_section, Target::attributes_vendor,
8049 Target::is_attributes_section, Target::attribute_arg_type,
8050 Target::attributes_order): New method definitions.
8051 (Target::Target_info::attributes_section,
8052 Target::Target_info::attributes_vendor): New fields.
8053 (Target::do_attribute_arg_type, Target::do_attributes_order): New
8054 virtual method definitions.
8055 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
8056 attributes_section and attributes_vendor.
8057 * testsuite/testfile.cc (Target_test::test_target_info): Same.
8058
f4e5969c
DK
80592009-12-05 Doug Kwan <dougkwan@google.com>
8060
8061 * arm.cc: Update comments about interworking and stub generation.
8062 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
8063 considered as non-PIC.
8064 (Arm_relocate_functions::base_abs): Fix formatting.
8065 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8066 of function to use GOT entry address instead of offset.
8067 (Target_arm::Scan::global): Issue an error if a symbol would need a
8068 PLT does not get one because it is untyped. Remove code to create
8069 dynamic symbols for relative branches.
8070 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8071 takes unsigned integer instead of boolean.
8072
1abce4a6
L
80732009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8074
8075 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8076 (two_file_test_LDADD): Likewise.
8077 (common_test_1_LDADD): Likewise.
8078 (exception_test_LDADD) Likewise.
8079 (weak_test_LDADD): Likewise.
8080 (many_sections_test_LDADD): Likewise.
8081 (initpri1_LDADD): Likewise.
8082 (script_test_1_LDADD): Likewise.
8083 (script_test_2_LDADD): Likewise.
8084 (justsyms_LDADD): Likewise.
8085 (binary_test_LDADD): Likewise.
8086 (large_LDADD): Likewise.
8087 * testsuite/Makefile.in: Regenerated.
8088
adcf2816 80892009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 8090
adcf2816
L
8091 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8092 (Symbol_table::override_with_special): Likewise.
8093 (Symbol_table::add_from_object): Likewise.
8094
28e67f5d
RÁE
80952009-12-04 Rafael Avila de Espindola <espindola@google.com>
8096
8097 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8098 Don't set the data_offset twice.
8099
ae10a101
RÁE
81002009-12-04 Rafael Avila de Espindola <espindola@google.com>
8101
8102 * testsuite/Makefile.in: Regenerate.
8103
f59f41f3
DK
81042009-12-03 Doug Kwan <dougkwan@google.com>
8105
8106 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8107 (Target_arm::do_finalize_sections): Add parameter for symbol table
8108 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8109 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8110 parameter for symbol table pointer.
8111 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8112 an additional parameter for a pointer to symbol table.
8113 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8114 parameter for a symbol table pointer.
8115 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8116 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8117 Ditto.
8118 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8119 parameter for a symbol table pointer.
8120
ca55d848
RÁE
81212009-12-03 Rafael Avila de Espindola <espindola@google.com>
8122
8123 * incremental.cc (Incremental_inputs_header)
8124 (Incremental_inputs_header_write, Incremental_inputs_entry)
8125 (Incremental_inputs_entry_write): Move ...
8126 * incremental.h (Incremental_inputs_header)
8127 (Incremental_inputs_header_write, Incremental_inputs_entry)
8128 (Incremental_inputs_entry_write): here.
8129
3aec4f9c
RÁE
81302009-12-02 Rafael Avila de Espindola <espindola@google.com>
8131
8132 * incremental.cc (make_sized_incremental_binary): Set the target.
8133 Error if it is incompatible.
8134 * output.h (Output_file): Add filename method.
8135
9c0ae74d
RÁE
81362009-12-02 Rafael Avila de Espindola <espindola@google.com>
8137
8138 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8139 from the get_* methods.
8140
a45500ae
RÁE
81412009-12-02 Rafael Avila de Espindola <espindola@google.com>
8142
8143 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8144 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8145 Write 0 for the data_offset of scripts.
8146
325e6408
RÁE
81472009-12-02 Rafael Avila de Espindola <espindola@google.com>
8148
8149 * testsuite/Makefile.am: Add the incremental_test.sh test.
8150 * testsuite/incremental_test.sh: New.
8151 * testsuite/incremental_test_1.c: New.
8152 * testsuite/incremental_test_2.c: New.
8153
954c3e2e
RÁE
81542009-12-01 Rafael Avila de Espindola <espindola@google.com>
8155
8156 * incremental-dump.cc (main): Fix typos.
8157
f8086623
RÁE
81582009-11-27 Rafael Avila de Espindola <espindola@google.com>
8159
8160 PR gold/11025
8161 * incremental-dump.cc (main): Use llu to print 64 bit values.
8162
3b0dd6ac
L
81632009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8164 H.J. Lu <hongjiu.lu@intel.com>
8165
8166 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8167 $(LIBDL).
8168 (incremental_dump_LDADD): Likewise.
8169 * Makefile.in: Regenerated.
8170
a6d1ef57 81712009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 8172
a6d1ef57
DK
8173 Revert:
8174
8175 2009-11-25 Doug Kwan <dougkwan@google.com>
8176
8177 * arm.cc (Target_arm::Target_arm): Move method definition
8178 outside of class definition. Add code to handle
8179 --target1-rel, --target1-abs and --target2= options.
8180 (Target_arm::get_reloc_reloc_type): Change method to be
8181 non-static and const.
8182 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8183 New data member declaration.
8184 (Target_arm::Scan::local, Target_arm::Scan::global,
8185 Target_arm::Relocate::relocate,
8186 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8187 Adjust call to Target_arm::get_real_reloc_type.
8188 (Target_arm::get_real_reloc_type): Use command line options
8189 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8190 * options.h (--target1-rel, --target1-abs, --target2): New
8191 ARM-only options.
8192
50aeb7d4
DK
81932009-11-25 Doug Kwan <dougkwan@google.com>
8194
8195 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8196 class definition. Add code to handle --target1-rel, --target1-abs
8197 and --target2= options.
8198 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8199 and const.
8200 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8201 member declaration.
8202 (Target_arm::Scan::local, Target_arm::Scan::global,
8203 Target_arm::Relocate::relocate,
8204 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8205 call to Target_arm::get_real_reloc_type.
8206 (Target_arm::get_real_reloc_type): Use command line options to
8207 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8208 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8209 options.
8210
51938283
DK
82112009-11-25 Doug Kwan <dougkwan@google.com>
8212
8213 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8214 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8215 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8216 formatting.
8217 (Arm_relocate_functions::thm_call): Replace body with a call to
8218 Arm_relocate_functions::thumb_branch_common.
8219 (Arm_relocate_functions::thm_jump24,
8220 Arm_relocate_functions::thm_xpc22): New method definitions.
8221 (Arm_relocate_functions::thumb_branch_common): New method definition.
8222 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8223 operator.
8224 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8225 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8226
e2b8f3c4
RÁE
82272009-11-24 Rafael Avila de Espindola <espindola@google.com>
8228
8229 * Makefile.am: Build incremental-dump
8230 * Makefile.in: Regenerate.
8231 * incremental-dump.cc: New.
8232 * incremental.cc (Incremental_inputs_header_data,
8233 Incremental_inputs_entry_data): Move to incremental.h
8234 * incremental.h: (Incremental_inputs_header_data,
8235 Incremental_inputs_entry_data): Move from incremental.cc
8236
bcba9aec
RÁE
82372009-11-24 Rafael Avila de Espindola <espindola@google.com>
8238
8239 * incremental.cc (Incremental_inputs_header,
8240 Incremental_inputs_header_write, Incremental_inputs_entry,
8241 Incremental_inputs_entry_write): Add a typedef with the data type.
8242
7c3afe08
RÁE
82432009-11-24 Rafael Avila de Espindola <espindola@google.com>
8244
8245 * incremental.cc (Incremental_inputs_header,
8246 Incremental_inputs_header_write, Incremental_inputs_entry,
8247 Incremental_inputs_entry_write): Update comment about which
8248 type has the filed descriptions.
8249
d204b6e9
DK
82502009-11-15 Doug Kwan <dougkwan@google.com>
8251
8252 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8253 (Arm_relocate_functions::arm_branch_common): Change method defintion
8254 in class definition to a method declaration and update list of formal
8255 parameters.
8256 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8257 Arm_relocation_functions::jump24): Adjust call to
8258 Arm_relocate_functions::arm_branch_common. Update list of formal
8259 parameters.
8260 (Arm_relocate_functions::xpc25): New method definition.
8261 (Arm_relocate_functions::arm_branch_common): Move method defintion
8262 out from class definition. Use stubs for mode-switching and extending
8263 branch ranges.
8264 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8265 specially. Change code to enable use of stubs in ARM branches.
8266
43d12afe
DK
82672009-11-10 Doug Kwan <dougkwan@google.com>
8268
8269 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8270 in method declaration.
8271 (Target_arm::relocate_stub): New method declaration.
8272 (Target_arm::default_target): Change to return a pointer instead of
8273 a const reference.
8274 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8275 Target_arm::default_target.
8276 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8277 method definition.
8278 (Target_arm::relocate_section): Adjust view.
8279 (Target_arm::relocate_stub): New method definition.
8280
ac33a407
DK
82812009-11-10 Doug Kwan <dougkwan@google.com>
8282
8283 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8284 a format warning.
8285 * incremental.cc (open_incremental_binary): Initialized local
8286 variables to avoid warnings.
8287 * object.cc (make_elf_object): Ditto.
8288 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8289 a format warning.
e1df38aa 8290
88ee28e9
L
8291009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8292
8293 PR gold/10930
8294 * testsuite/plugin_test.c: Include "config.h".
8295
2daedcd6
DK
82962009-11-09 Doug Kwan <dougkwan@google.com>
8297
8298 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8299 (arm_symbol_value): Remove.
8300 (Arm_relocate_functions::arm_branch_common,
8301 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8302 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8303 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8304 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8305 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8306 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8307 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8308 Arm_relocate_functions::thm_mobw_abs_nc,
8309 Arm_relocate_functions::thm_mov_abs,
8310 Arm_relocate_functions::movw_prel_nc,
8311 Arm_relocate_functions::thm_movt_abs,
8312 Arm_relocate_functions::movt_prel,
8313 Arm_relocate_functions::thm_movw_prel_nc,
8314 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8315 (Target_arm::Relocate::relocate): Only decompose address into two
8316 parts if relocation type uses the thumb-bit and pass the actual
8317 bit instead of a flag indicating that the thumb-bit is used. Adjust
8318 calls to methods in Arm_relocate_functions for this change.
8319
1276bc89 83202009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
8321
8322 PR 10925
8323 * reloc.cc: Instantiate
8324 Sized_relobj::initialize_input_to_output_maps and
8325 Sized_relobj:free_input_to_output_maps.
8326
e53ad1b5
ILT
83272009-11-06 Ian Lance Taylor <iant@google.com>
8328
8329 PR 10876
8330 * defstd.cc (in_segment): Set only_if_ref true for "end".
8331
eb44217c
DK
83322009-11-06 Doug Kwan <dougkwan@google.com>
8333
8334 * arm.cc (class Reloc_stub): Correct a comment.
8335 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8336 (Target_arm::scan_section_for_stubs): New method declaration.
8337 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8338 Change methods from private to protected.
8339 (Target_arm::do_may_relax): New method definition.
8340 (Target_arm::do_relax, Target_arm::group_sections,
8341 Target_arm::scan_reloc_for_stub,
8342 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8343 (Target_arm::arm_input_section_map_): New data member declaration.
8344 (Target_arm::scan_reloc_for_stub,
8345 Target_arm::scan_reloc_section_for_stubs,
8346 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8347 Target_arm::do_relax): New method definitions.
8348
5d329b7d
ILT
83492009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8350
8351 * configure.ac: Check for (struct stat)::st_mtim
8352 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8353 * config.in: Regenerate.
8354 * configure: Regenerate.
8355
96a0d71b
ILT
83562009-11-05 Ian Lance Taylor <iant@google.com>
8357
8358 PR 10910
8359 * output.cc (Output_segment::add_output_section): Add missing
8360 return statement.
8361
594c8e5e
ILT
83622009-11-04 Ian Lance Taylor <iant@google.com>
8363
8364 PR 10880
8365 * object.h (class Object): Add is_needed and set_is_needed
8366 methods. Add is_needed_ field. Make bool fields into bitfields.
8367 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8368 defined in a dynamic object and referenced by a regular object,
8369 set is_needed for the dynamic object.
8370 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8371 if the file is marked with as_needed and it is not needed.
8372
22b127cc
ILT
83732009-11-04 Ian Lance Taylor <iant@google.com>
8374
8375 PR 10887
8376 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8377 tags if data is discarded by linker script.
8378 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8379 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8380 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8381 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8382
f5c870d2
ILT
83832009-11-04 Ian Lance Taylor <iant@google.com>
8384
8385 * layout.cc (Layout::get_output_section): Add is_interp and
8386 is_dynamic_linker_section parameters. Change all callers.
8387 (Layout::choose_output_section): Likewise.
8388 (Layout::make_output_section): Likewise.
8389 (Layout::add_output_section_data): Add is_dynamic_linker_section
8390 parameter. Change all callers.
8391 * layout.h (class Layout): Update declarations.
8392 * output.h (class Output_section): Add is_interp, set_is_interp,
8393 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8394 Add is_interp_, is_dynamic_linker_section_ fields. Change
8395 generate_code_fills_at_write_ to a bitfield.
8396 * output.cc (Output_section::Output_sections): Initialize new
8397 fields.
8398 (Output_segment::add_output_section): Add do_sort parameter.
8399 Change all callers.
8400
1ae4d23b
ILT
84012009-11-03 Ian Lance Taylor <iant@google.com>
8402
8403 PR 10860
8404 * options.h (class General_options): Add --warn-common.
8405 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8406 merging two common symbols.
8407 (Symbol_table::should_override): Handle --warn-common when merging
8408 a common symbol with a defined symbol. Use report_resolve_problem
8409 for multiple definitions.
8410 (Symbol_table::report_resolve_problem): New function.
8411 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8412
55da9579
DK
84132009-11-03 Doug Kwan <dougkwan@google.com>
8414
8415 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8416 stub_factory_.
8417 (Target_arm::stub_factory): New method definition.
8418 (Target_arm::new_arm_input_section,
8419 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8420 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 8421 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
8422 New type definitions.
8423 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8424 member declarations.
8425 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8426 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8427 New method definitions.
8428
37a9ac43
ILT
84292009-11-03 Ian Lance Taylor <iant@google.com>
8430
8431 * options.h (class General_options): Add --warn_constructors.
8432
b3d6a3d4
ILT
84332009-11-03 Ian Lance Taylor <iant@google.com>
8434
8435 PR 10893
8436 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8437 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8438
934b01dd
ILT
84392009-11-03 Ian Lance Taylor <iant@google.com>
8440
8441 PR 10895
8442 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8443 --msgid-bugs-address.
8444 (install-pdf): New target.
8445 (install-data_yes): Look up one directory to find mkinstalldirs.
8446
03c1939b
L
84472009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8448
8449 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8450 tree.
8451
ebd95253
DK
84522009-10-30 Doug Kwan <dougkwan@google.com>
8453
8454 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8455
e9bbb538
DK
84562009-10-30 Doug Kwan <dougkwan@google.com>
8457
8458 * arm.cc (Stub_addend_reader): New struct template definition
8459 and partial specializations.
8460 (Stub_addend_reader::operator()): New method definition for a
8461 partially specialized template.
8462
d5b40221
DK
84632009-10-30 Doug Kwan <dougkwan@google.com>
8464
8465 * arm.cc (Arm_relobj::processor_specific_flags): New method
8466 definition.
8467 (Arm_relobj::do_read_symbols): New method declaration.
8468 (Arm_relobj::processor_specific_flags_): New data member declaration.
8469 (Arm_dynobj): New class definition.
8470 (Target_arm::do_finalize_sections): Add input_objects parameter.
8471 (Target_arm::do_adjust_elf_header): New method declaration.
8472 (Target_arm::are_eabi_versions_compatible,
8473 (Target_arm::merge_processor_specific_flags): New method declaration.
8474 (Target_arm::do_make_elf_object): New overloaded method definitions
8475 and declaration.
8476 (Arm_relobj::do_read_symbols): New method definition.
8477 (Arm_dynobj::do_read_symbols): Ditto.
8478 (Target_arm::do_finalize_sections): Add input_objects parameters.
8479 Merge processor-specific flags from all input objects.
8480 (Target_arm::are_eabi_versions_compatible,
8481 Target_arm::merge_processor_specific_flags,
8482 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8483 New method definitions.
8484 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8485 Input_objects pointer type parameter.
8486 * layout.cc (Layout::finalize): Pass input objects to target's.
8487 finalize_sections function.
8488 * output.cc (Output_file_header::do_sized_write): Set ELF file
8489 header's processor-specific flags.
8490 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8491 Input_objects pointer type parameter.
8492 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8493 * target.h (Input_objects): New forward class declaration.
8494 (Target::processor_specific_flags,
8495 Target::are_processor_specific_flags_sect): New method definitions.
8496 (Target::finalize_sections): Add input_objects parameter.
8497 (Target::Target): Initialize processor_specific_flags_ and
8498 are_processor_specific_flags_set_.
8499 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8500 parameter.
8501 (Target::set_processor_specific_flags): New method definition.
8502 (Target::processor_specific_flags_,
8503 Target::are_processor_specific_flags_set_): New data member
8504 declarations.
8505 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8506 Input_objects pointer type parameter.
8507
ebabffbd
DK
85082009-10-30 Doug Kwan <dougkwan@google.com>
8509
8510 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8511
ad0f2072
ILT
85122009-10-28 Ian Lance Taylor <iant@google.com>
8513
8514 * object.h (class Relobj): Drop options parameter from
8515 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8516 do_scan_relocs, do_relocate. Change all callers.
8517 (class Sized_relobj): Drop options parameters from
8518 do_gc_process_relocs, do_scan_relocs, do_relocate,
8519 do_relocate_sections, relocate_sections, emit_relocs_scan,
8520 emit_relocs_scan_reltype. Change all callers.
8521 (struct Relocate_info): Remove options field and all references to
8522 it.
8523 * reloc.h (class Read_relocs): Remove options constructor
8524 parameter and options_ field. Change all callers.
8525 (class Gc_process_relocs, class Scan_relocs): Likewise.
8526 (class Relocate_task): Likewise.
8527 * target-reloc.h (scan_relocs): Remove options parameter. Change
8528 all callers.
8529 (scan_relocatable_relocs): Likewise.
8530 * target.h (class Sized_target): Remove options parameter from
8531 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8532 all callers.
8533 * gc.h (gc_process_relocs): Remove options parameter. Change all
8534 callers.
8535 * arm.cc: Update functions to remove options parameters.
8536 * i386.cc: Likewise.
8537 * powerpc.cc: Likewise.
8538 * sparc.cc: Likewise.
8539 * x86_64.cc: Likewise.
8540 * testsuite/testfile.cc: Likewise.
8541
8ffa3667
DK
85422009-10-28 Doug Kwan <dougkwan@google.com>
8543
8544 * arm.cc (Arm_relobj): New class definition.
e1df38aa 8545 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
8546 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8547 New method definitions.
8548
40f36857
CC
85492009-10-28 Cary Coutant <ccoutant@google.com>
8550
8551 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8552 (Plugin::cleanup_done_): New member.
8553 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8554 (Plugin_manager::cleanup_done_): Remove.
8555 (Plugin_manager::add_input_file): Edit error message.
8556 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8557 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8558
2c849493
ILT
85592009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8560
8561 * fileread.cc: (File_read::View::~View): Use the new
8562 data_ownership_ filed.
8563 (File_read::~File_read): Dispose the new whole_file_view_.
8564 (File_read::open): Mmap the whole file if needed.
8565 (File_read::open): Use whole_file_view_ instead of contents_.
8566 (File_read::find_view): Use whole_file_view_ if applicable.
8567 (File_read::do_read): Use whole_file_view_ instead of contents_.
8568 (File_read::make_view): Use whole_file_view_ instead of contents_,
8569 update File_read::View::View call.
8570 (File_read::find_or_make_view): Update File_read::View::View
8571 call.
8572 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8573 remove contents_
8574 (File_read::View::Data_ownership): New enum.
8575 (File_read::View::View): Replace bool mapped_ with Data_ownership
8576 argument.
8577 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8578 (File_read::View::data_ownership_): New field.
8579 (File_read::contents_): Remove (replaced by whole_file_view_).
8580 (File_read::whole_file_view_): New field.
8581 * options.h (class General_options): Add --keep-files-mapped.
8582
24998053
CC
85832009-10-27 Cary Coutant <ccoutant@google.com>
8584
8585 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8586 * testsuite/Makefile.am (plugin_test_5): New test case.
8587 * testsuite/Makefile.in: Regenerate.
8588
72adc4fa
DK
85892009-10-25 Doug Kwan <dougkwan@google.com>
8590
8591 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8592 from private to protected to allow access by child class.
8593 (Sized_relobj::do_relocate_sections): New method declaration.
8594 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 8595 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
8596 Sized_relobj::relocate_sections. Instantiate template explicitly
8597 for different target sizes and endianity.
8598
07f508a2
DK
85992009-10-24 Doug Kwan <dougkwan@google.com>
8600
8601 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8602 (Arm_input_section::as_arm_input_section): New method.
8603 (Arm_output_section): New class definition.
8604 (Arm_output_section::create_stub_group,
8605 Arm_output_section::group_sections): New method definitions.
8606
10ad9fe5
DK
86072009-10-22 Doug Kwan <dougkwan@google.com>
8608
8609 * arm.cc (Arm_input_section): New class definition.
8610 (Arm_input_section::init, Arm_input_section:do_write,
8611 Arm_input_section::set_final_data_size,
8612 Arm_input_section::do_reset_address_and_file_offset): New method
8613 definitions.
8614
56ee5e00
DK
86152009-10-21 Doug Kwan <dougkwan@google.com>
8616
8617 * arm.cc (Stub_table, Arm_input_section): New forward class
8618 declarations.
8619 (Stub_table): New class defintion.
8620 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8621 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8622 New method definition.
8623
b569affa
DK
86242009-10-21 Doug Kwan <dougkwan@google.com>
8625
8626 * arm.cc: Update copyright comments.
8627 (Target_arm): New forward class template declaration.
8628 (Arm_address): New type.
8629 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8630 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8631 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8632 constants.
8633 (Insn_template): Same.
8634 (DEF_STUBS): New macro.
8635 (Stub_type): New enum type.
8636 (Stub_template): New class definition.
8637 (Stub): Same.
8638 (Reloc_stub): Same.
8639 (Stub_factory): Same.
8640 (Target_arm::Target_arm): Initialize may_use_blx_ and
8641 should_force_pic_veneer_.
8642 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8643 Target_arm::should_force_pic_veneer,
8644 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8645 Target_arm::using_thumb_only, Target_arm:;default_target): New
8646 method defintions.
8647 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8648 New data member declarations.
8649 (Insn_template::size, Insn_template::alignment): New method defintions.
8650 (Stub_template::Stub_template): New method definition.
8651 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8652 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8653 (Stub_factory::Stub_factory): New method definition.
8654 * gold.h (string_hash): New template.
8655 * output.h (Input_section_specifier::hash_value): Use
8656 gold::string_hash.
8657 (Input_section_specifier::string_hash): Remove.
8658 * stringpool.cc (Stringpool_template::string_hash): Use
8659 gold::string_hash.
8660
6c172549
DK
86612009-10-20 Doug Kwan <dougkwan@google.com>
8662
8663 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8664 symbols of relaxed input sections.
8665 * output.h (Output_section::find_relaxed_input_section): Make
8666 method public.
8667
c5617f2f
DK
86682009-10-16 Doug Kwan <dougkwan@google.com>
8669
8670 * dynobj.cc (Versions::Versions): Initialize version_script_.
8671 Only insert base version symbol definition for a shared object
8672 if version script defines any version versions.
8673 (Versions::define_base_version): New method definition.
8674 (Versions::add_def): Check that base version is not needed.
8675 (Versions::add_need): Define base version lazily.
8676 * dynobj.h (Versions::define_base_version): New method declaration.
8677 (Versions::needs_base_version_): New data member declaration.
8678 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8679 (check_DATA): Add no_version_test.stdout.
8680 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8681 New make rules.
8682 * testsuite/Makefile.in: Regenerate.
8683 * testsuite/no_version_test.c: New file.
8684 * testsuite/no_version_test.sh: Ditto.
8685
3c12dcdb
DK
86862009-10-16 Doug Kwan <dougkwan@google.com>
8687
8688 * expression.cc (class Segment_start_expression): New class definition.
8689 (Segment_start_expression::value): New method definition.
8690 (script_exp_function_segment_start): Return a new
8691 Segment_start_expression.
8692 * gold/script-c.h (script_saw_segment_start_expression): New function
8693 prototype.
8694 * script-sections.cc (Script_sections::Script_sections): Initialize
8695 SAW_SEGMENT_START_EXPRESSION_ to false.
8696 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8697 and -Tbbs options to specify section addresses if given in
8698 command line and no SEGMENT_START expression is seen in a script.
8699 * script-sections.h (Script_sections::saw_segment_start_expression,
8700 Script_sections::set_saw_segment_start_expression): New method
8701 definition.
8702 (Script_sections::saw_segment_start_expression_): New data member
8703 declaration.
8704 * script.cc (script_saw_segment_start_expression): New function.
8705 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8706 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8707 script_test_7.sh and script_test_8.sh.
8708 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8709 script_test_8.stdout.
8710 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8711 (script_test_6, script_test_6.stdout, script_test_7,
8712 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8713 * Makefile.in: Regenerate.
8714 * testsuite/script_test_6.sh: New file.
8715 * testsuite/script_test_6.t: Same.
8716 * testsuite/script_test_7.sh: Same.
8717 * testsuite/script_test_7.t: Same.
8718 * testsuite/script_test_8.sh: Same.
8719
64b1ae37
DK
87202009-10-16 Doug Kwan <dougkwan@google.com>
8721
8722 * output.cc (Output_segment::set_section_list_address): Cast
8723 expressions to unsigned long long type to avoid format warnings.
8724
661be1e2
ILT
87252009-10-15 Ian Lance Taylor <iant@google.com>
8726
12edd763 8727 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 8728 dot assignment to script_sections_.
12edd763
ILT
8729 * script-sections.cc (Script_sections::add_dot_assignment):
8730 Initialize if necessary.
8731
68b6574b
ILT
8732 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8733 program headers with no load segment if there is a linker script.
8734
661be1e2
ILT
8735 * layout.cc (Layout::set_segment_offsets): Align the file offset
8736 to the segment aligment for -N or -n with no load segment.
8737 * output.cc (Output_segment::add_output_section): Don't crash if
8738 the first section is a TLS section.
8739 (Output_segment::set_section_list_addresses): Print an error
8740 message if the address moves backward in a linker script.
8741 * script-sections.cc
8742 (Output_section_element_input::set_section_addresses): Don't
8743 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8744 (Orphan_output_section::set_section_addresses): Likewise.
8745
f15f61a7
DK
87462009-10-15 Doug Kwan <dougkwan@google.com>
8747
8748 * layout.cc (Layout::finish_dynamic_section): Generate tags
8749 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8750 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8751 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8752
82bb573a
ILT
87532009-10-14 Ian Lance Taylor <iant@google.com>
8754
8755 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8756 fields.
8757 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8758 data_shdr fields of relinfo.
8759 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8760 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8761 R_386_TLS_LDO_32, adjust based on section flags.
8762 (Target_i386::Relocate::fix_up_ldo): Remove.
8763
374ad285
ILT
87642009-10-13 Ian Lance Taylor <iant@google.com>
8765
8766 Add support for -pie.
8767 * options.h (class General_options): Add -pie and
8768 --pic-executable.
8769 (General_options::output_is_position_independent): Test -pie.
8770 (General_options::output_is_executable): Return true if not shared
8771 and not relocatable.
8772 (General_options::output_is_pie): Remove.
8773 * options.cc (General_options::finalize): Reject incompatible uses
8774 of -pie.
8775 * gold.cc (queue_middle_tasks): A -pie link is not static.
8776 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8777 * symtab.cc (Symbol::final_value_is_known): Return false if
8778 output_is_position_independent.
8779 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8780 output_is_position_independent.
8781 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8782 output_is_position_independent.
8783 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8784 output_is_position_independent.
8785 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8786 two_file_pie_test.
8787 (basic_pie_test.o, basic_pie_test): New targets.
8788 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8789 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8790 (two_file_pie_test): New target.
8791 * testsuite/Makefile.in: Rebuild.
8792 * README: Remove note saying that -pie is not supported.
8793
c6585162
ILT
87942009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8795
8796 * options.h (class General_options): Add -init and -fini.
8797 * layout.cc (Layout::finish_dynamic_section): Emit
8798 given init and fini functions.
8799
032ce4e9
ST
88002009-10-13 Sriraman Tallam <tmsriram@google.com>
8801
8802 * gc.h (gc_process_relocs): Check if icf is enabled using new
8803 function.
8804 * gold.cc (queue_initial_tasks): Likewise.
8805 (queue_middle_tasks): Likewise.
8806 * object.cc (do_layout): Likewise.
8807 * symtab.cc (is_section_folded): Likewise.
8808 * main.cc (main): Likewise.
8809 * reloc.cc (Read_relocs::run): Likewise.
8810 (Sized_relobj::do_scan_relocs): Likewise.
8811 * icf.cc (is_function_ctor_or_dtor): New function.
8812 (Icf::find_identical_sections): Check if function is ctor or dtor when
8813 safe icf is chosen.
8814 * options.h (General_options::icf): Change option to be an enum.
8815 (Icf_status): New enum.
8816 (icf_enabled): New method.
8817 (icf_safe_folding): New method.
8818 (set_icf_status): New method.
8819 (icf_status_): New variable.
8820 * (options.cc) (General_options::finalize): Set icf_status_.
8821 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8822 icf_test and icf_keep_unique_test to use the --icf enum flag.
8823 * testsuite/icf_safe_test.sh: New file.
e1df38aa 8824 * testsuite/icf_safe_test.cc: New file.
032ce4e9 8825
f345227a
ST
88262009-10-12 Sriraman Tallam <tmsriram@google.com>
8827
8828 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8829 includes to gc.h and icf.h.
8830 * arm.cc: Include gc.h.
8831 * gold.cc: Likewise.
8832 * i386.cc: Likewise.
8833 * powerpc.cc: Likewise.
8834 * sparc.cc: Likewise.
8835 * x86_64.cc: Likewise.
8836 * gc.h: Include icf.h.
8837
1c7814ed
ILT
88382009-10-11 Ian Lance Taylor <iant@google.com>
8839
8840 * plugin.cc: Include "gold.h" before other header files.
8841
ae3b5189
CD
88422009-10-10 Chris Demetriou <cgd@google.com>
8843
8844 * options.h (Input_file_argument::Input_file_type): New enum.
8845 (Input_file_argument::is_lib_): Replace with...
8846 (Input_file_argument::type_): New member.
8847 (Input_file_argument::Input_file_argument): Take Input_file_type
8848 'type' rather than boolean 'is_lib' as second argument.
8849 (Input_file_argument::is_lib): Use type_.
8850 (Input_file_argument::is_searched_file): New function.
8851 (Input_file_argument::may_need_search): Handle is_searched_file.
8852 * options.cc (General_options::parse_library): Support -l:filename.
8853 (General_options::parse_just_symbols): Update for Input_file_argument
8854 changes.
8855 (Command_line::process): Likewise.
8856 * archive.cc (Archive::get_file_and_offset): Likewise.
8857 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8858 * script.cc (read_script_file, script_add_file): Likewise.
8859 * fileread.cc (Input_file::Input_file): Likewise.
8860 (Input_file::will_search_for): Handle is_searched_file.
8861 (Input_file::open): Likewise.
8862 * readsyms.cc (Read_symbols::get_name): Likewise.
8863 * testsuite/Makefile.am (searched_file_test): New test.
8864 * testsuite/Makefile.in: Regenerate.
8865 * testsuite/searched_file_test.cc: New file.
8866 * testsuite/searched_file_test_lib.cc: New file.
8867
f3048a1d
ILT
88682009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8869 Ian Lance Taylor <iant@google.com>
8870
8871 * descriptor.cc: Include <cstdio> and "binary-io.h".
8872 (Descriptors::open): Open the files in binary mode always.
8873 * script.cc (Lex::get_token): Treat \r as whitespace.
8874
d4780e57
ILT
88752009-10-09 Ian Lance Taylor <iant@google.com>
8876
8877 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8878
d9a893b8
ILT
88792009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8880 Ian Lance Taylor <iant@google.com>
8881
8882 * configure.ac: Check for readv function also.
8883 * fileread.cc (readv): Define if not HAVE_READV.
8884 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8885 does not exist.
8886 * config.in: Regenerate.
8887 * configure: Regenerate.
8888
c0a62865
DK
88892009-10-09 Doug Kwan <dougkwan@google.com>
8890
8891 * layout.cc (Layout::make_output_section): Call target hook to make
8892 ordinary output section.
8893 (Layout::finalize): Adjust parameter list of call the
8894 Target::may_relax().
8895 * layout.h (class Layout::section_list): New method.
8896 * merge.h (Output_merge_base::entsize): Change visibility to public.
8897 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8898 New methods.
8899 (Output_merge_string::do_is_string): New method.
8900 * object.cc (Sized_relobj::do_setup): renamed from
8901 Sized_relobj::set_up.
8902 * object.h (Sized_relobj::adjust_shndx,
8903 Sized_relobj::initializ_input_to_output_maps,
8904 Sized_relobj::free_input_to_output_maps): Change visibilities to
8905 protected.
8906 (Sized_relobj::setup): Virtualize.
8907 (Sized_relobj::do_setup): New method declaration.
8908 (Sized_relobj::invalidate_section_offset,
8909 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8910 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8911 * options.cc (parse_int): New function.
8912 * options.h (parse_int): New declaration.
8913 (DEFINE_int): New macro.
8914 (stub_group_size): New option.
8915 * output.cc (Output_section::Output_section): Initialize memebers
8916 merge_section_map_, merge_section_by_properties_map_,
8917 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8918 (Output_section::add_input_section): Handled deferred code-fill
8919 generation and remove an old comment.
8920 (Output_section::add_relaxed_input_section): New method definition.
8921 (Output_section::add_merge_input_section): Use merge section by
8922 properties map to speed to search. Update merge section maps
8923 as appropriate.
8924 (Output_section::build_relaxation_map): New method definition.
8925 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8926 Same.
8927 (Output_section::relax_input_section): Renamed to
8928 Output_section::convert_input_sections_to_relaxed_sections and change
8929 interface to take a vector of pointers to relaxed sections.
8930 (Output_section::find_merge_section,
8931 Output_section::find_relaxed_input_section): New method definitions.
8932 (Output_section::is_input_address_mapped,
8933 Output_section::output_offset, Output_section::output_address):
8934 Use output section data maps to speed up searching.
8935 (Output_section::find_starting_output_address): Add comments.
8936 (Output_section::do_write,
8937 Output_section::write_to_postprocessing_buffer): Do code-fill
8938 generation as appropriate.
8939 (Output_section::get_input_sections): Invalidate relaxed input section
8940 map.
8941 (Output_section::restore_states): Adjust type of checkpoint .
8942 Invalidate relaxed input section map.
8943 * output.h (Output_merge_base): New class declaration.
8944 (Input_section_specifier): New class defintion.
8945 (class Output_relaxed_input_section) Change base class to
8946 Output_section_data_build.
8947 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8948 base class initializer.
8949 (Output_section::add_relaxed_input_section): New method declaration.
8950 (Output_section::Input_section): Change visibility to protected.
2e702c99 8951 (Output_section::Input_section::relobj,
c0a62865
DK
8952 Output_section::Input_section::shndx): Handle relaxed input sections.
8953 Output_section::input_sections) Change visibility to protected. Also
8954 define overload to return a non-const pointer.
8955 (Output_section::Merge_section_properties): New class defintion.
8956 (Output_section::Merge_section_by_properties_map,
8957 Output_section::Output_section_data_by_input_section_map,
8958 Output_section::Relaxation_map): New types.
8959 (Output_section::relax_input_section): Rename method to
8960 Output_section::convert_input_sections_to_relaxed_sections and change
8961 interface to take a vector of relaxed section pointers.
8962 (Output_section::find_merge_section,
8963 Output_section::find_relaxed_input_section,
8964 Output_section::build_relaxation_map,
8965 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8966 New method declarations.
8967 (Output_section::merge_section_map_
8968 Output_section::merge_section_by_properties_map_,
8969 Output_section::relaxed_input_section_map_,
8970 Output_section::is_relaxed_input_section_map_valid_,
8971 Output_section::generate_code_fills_at_write_): New data members.
8972 * script-sections.cc
8973 (Output_section_element_input::set_section_addresses): Call
8974 current_data_size and addralign methods of relaxed input sections.
8975 (Orphan_output_section::set_section_addresses): Call current_data_size
8976 and addralign methods of relaxed input sections.
8977 * symtab.cc (Symbol_table::compute_final_value): Extract template
8978 from the body of Symbol_table::sized_finalize_symbol.
8979 (Symbol_table::sized_finalized_symbol): Call
8980 Symbol_table::compute_final_value.
8981 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8982 (Symbol_table::compute_final_value): New templated method declaration.
8983 * target.cc (Target::do_make_output_section): New method defintion.
8984 * target.h (Target::make_output_section): New method declaration.
8985 (Target::relax): Add more parameters for input objects, symbol table
8986 and layout. Adjust call to do_relax.
8987 (Target::do_make_output_section): New method declaration.
8988 (Target::do_relax): Add parameters for input objects, symbol table
8989 and layout.
8990
d446d6c4
ILT
89912009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8992
8993 * pread.c: Include stdio.h.
8994
bc06c745
ILT
89952009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8996
8997 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8998 defined.
8999
75aea3d0
ILT
90002009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9001
9002 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9003 Change read_shndx type to unsigned int.
9004 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9005 int.
9006 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9007 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
9008 Change read_shndx type to unsigned int.
9009 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9010 int.
9011 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9012 * layout.cc (Layout::create_symtab_sections): Cast the result of
9013 local_symcount * symsize to off_t in the gold_assert.
9014
be8fcb75
ILT
90152009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9016
9017 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
9018 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
9019 R_ARM_BASE_ABS.
9020 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
9021 (Arm_relocate_functions::thm_abs5): New function.
9022 (Arm_relocate_functions::abs12): New function.
9023 (Arm_relocate_functions::abs16): New function.
9024 (Arm_relocate_functions::base_abs): New function.
9025 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
9026 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
9027 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
9028 R_ARM_BASE_ABS.
9029 (Scan::global): Likewise.
9030 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
9031 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
9032 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
9033 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9034 R_ARM_BASE_ABS.
9035
c2a122b6
ILT
90362009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9037
9038 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
9039 (Arm_relocate_functions::movt_prel): New function.
9040 (Arm_relocate_functions::thm_movw_prel_nc): New function.
9041 (Arm_relocate_functions::thm_movt_prel): New function.
9042 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
9043 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
9044 (Scan::global, Relocate::relocate): Likewise.
9045 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9046
c4aa1e2d
ILT
90472009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9048
9049 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
9050 Incremental_checker.
9051 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
9052 unsigned int.
9053 (class Incremental_inputs_header): New class.
9054 (Incremental_inputs_header_writer): Edit comment.
9055 (Incremental_inputs_entry): New class.
9056 (Incremental_inputs_entry_writer): Edit comment.
9057 (Sized_incremental_binary::do_find_incremental_inputs_section):
9058 Add *strtab_shndx parameter, fill it.
9059 (Sized_incremental_binary::do_check_inputs): New method.
9060 (Incremental_checker::can_incrementally_link_output_file): Use
9061 Sized_incremental_binary::check_inputs.
9062 (Incremental_inputs::report_command_line): Save command line in
9063 command_line_.
9064 * incremental.h:
9065 (Incremental_binary::find_incremental_inputs_section): New
9066 method.
9067 (Incremental_binary::do_find_incremental_inputs_section): Add
9068 strtab_shndx parameter.
9069 (Incremental_binary::do_check_inputs): New pure virtual method.
9070 (Sized_incremental_binary::do_check_inputs): Declare.
9071 (Incremental_checker::Incremental_checker): Add incremental_inputs
9072 parameter, use it to initialize incremental_inputs_.
9073 (Incremental_checker::incremental_inputs_): New field.
9074 (Incremental_checker::command_line): New method.
9075 (Incremental_checker::inputs): New method.
9076 (Incremental_checker::command_line_): New field.
9077
c549a694
ILT
90782009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9079
9080 * incremental.cc: Include <cstdarg> and "target-select.h".
9081 (vexplain_no_incremental): New function.
9082 (explain_no_incremental): New function.
9083 (Incremental_binary::error): New method.
9084 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9085 method.
9086 (make_sized_incremental_binary): New function.
9087 (open_incremental_binary): New function.
9088 (can_incrementally_link_file): Add checks if output is ELF and has
9089 inputs section.
9090 * incremental.h: Include "elfcpp_file.h" and "output.h".
9091 (Incremental_binary): New class.
9092 (Sized_incremental_binary): New class.
9093 (open_incremental_binary): Declare.
9094 * object.cc (is_elf_object): Use
9095 elfcpp::Elf_recognizer::is_elf_file.
9096 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9097 * output.h (Output_file::filesize): New method.
9098
fd3c5f0b
ILT
90992009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9100
9101 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9102 New function.
9103 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9104 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9105 function.
9106 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9107 function.
9108 (Arm_relocate_functions::movw_abs_nc): New function.
9109 (Arm_relocate_functions::movt_abs): New function.
9110 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9111 (Arm_relocate_functions::thm_movt_abs): New function.
9112 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9113 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9114 (Scan::global): Likewise.
9115 (Relocate::relocate): Likewise.
9116 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9117
7f5309a5
ILT
91182009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9119
9120 * arm.cc (Arm_relocate_functions::got_prel) New function.
9121 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9122 (Relocate::relocate): Likewise.
9123 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9124
364c7fa5
ILT
91252009-10-06 Ian Lance Taylor <iant@google.com>
9126
9127 * options.h (class General_options): Define
9128 split_stack_adjust_size parameter.
9129 * object.h (class Object): Add uses_split_stack_ and
9130 has_no_split_stack_ fields. Add uses_split_stack and
9131 has_no_split_stack accessor functions. Declare
9132 handle_split_stack_section.
9133 (class Reloc_symbol_changes): Define.
9134 (class Sized_relobj): Define Function_offsets. Declare
9135 split_stack_adjust, split_stack_adjust_reltype, and
9136 find_functions.
9137 * object.cc (Object::handle_split_stack_section): New function.
9138 (Sized_relobj::do_layout): Call handle_split_stack_section.
9139 * dynobj.cc (Sized_dynobj::do_layout): Call
9140 handle_split_stack_section.
9141 * reloc.cc (Sized_relobj::relocate_sections): Call
9142 split_stack_adjust for executable sections in split_stack
9143 objects. Pass reloc_map to relocate_section.
9144 (Sized_relobj::split_stack_adjust): New function.
9145 (Sized_relobj::split_stack_adjust_reltype): New function.
9146 (Sized_relobj::find_functions): New function.
9147 * target-reloc.h: Include "object.h".
9148 (relocate_section): Add reloc_symbol_changes parameter. Change
9149 all callers.
9150 * target.h (class Target): Add calls_non_split method. Declare
9151 do_calls_non_split virtual method. Declare match_view and
9152 set_view_to_nop.
9153 * target.cc: Include "elfcpp.h".
9154 (Target::do_calls_non_split): New function.
9155 (Target::match_view): New function.
9156 (Target::set_view_to_nop): New function.
9157 * gold.cc (queue_middle_tasks): Give an error if mixing
9158 split-stack and non-split-stack objects with -r.
9159 * i386.cc (Target_i386::relocate_section): Add
9160 reloc_symbol_changes parameter.
9161 (Target_i386::do_calls_non_split): New function.
9162 * x86_64.cc (Target_x86_64::relocate_section): Add
9163 reloc_symbol_changes parameter.
9164 (Target_x86_64::do_calls_non_split): New function.
9165 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9166 parameter.
9167 * powerpc.cc (Target_powerpc::relocate_section): Add
9168 reloc_symbol_changes parameter.
9169 * sparc.cc (Target_sparc::relocate_section): Add
9170 reloc_symbol_changes parameter.
9171 * configure.ac: Call AM_CONDITIONAL for the default target.
9172 * configure: Rebuild.
9173 * testsuite/Makefile.am (TEST_AS): New variable.
9174 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9175 (check_DATA): Add split_i386 and split_x86_64 files.
9176 (SPLIT_DEFSYMS): Define.
9177 (split_i386_[1234n].o): New targets.
9178 (split_i386_[124]): New targets.
9179 (split_i386_[1234r].stdout): New targets.
9180 (split_x86_64_[1234n].o): New targets.
9181 (split_x86_64_[124]): New targets.
9182 (split_x86_64_[1234r].stdout): New targets.
9183 (MOSTLYCLEANFILES): Add new executables.
9184 * testsuite/split_i386.sh: New file.
9185 * testsuite/split_x86_64.sh: New file.
9186 * testsuite/split_i386_1.s: New file.
9187 * testsuite/split_i386_2.s: New file.
9188 * testsuite/split_i386_3.s: New file.
9189 * testsuite/split_i386_4.s: New file.
9190 * testsuite/split_i386_n.s: New file.
9191 * testsuite/split_x86_64_1.s: New file.
9192 * testsuite/split_x86_64_2.s: New file.
9193 * testsuite/split_x86_64_3.s: New file.
9194 * testsuite/split_x86_64_4.s: New file.
9195 * testsuite/split_x86_64_n.s: New file.
9196 * testsuite/testfile.cc (Target_test): Update relocation_section
9197 function.
9198 * testsuite/Makefile.in: Rebuild.
9199
e8a9fcda
ILT
92002009-10-06 Ian Lance Taylor <iant@google.com>
9201
9202 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9203 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9204 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9205 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9206 the address on ldo_addrs_.
9207 (Target_i386::Relocate::fix_up_ldo): New function.
9208
e99daf92
ILT
92092009-10-06 Rafael Espindola <espindola@google.com>
9210
9211 * plugin.cc (add_input_library): New.
9212 (Plugin::load): Add add_input_library to tv.
9213 (Plugin_manager::add_input_file): Add the is_lib argument.
9214 (add_input_file): Update call to Plugin_manager::add_input_file.
9215 (add_input_library): New.
9216 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9217
966d4097
DK
92182009-09-30 Doug Kwan <dougkwan@google.com>
9219
9220 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9221 symbol and call Symbol::may_need_copy_reloc to determine if
9222 a copy reloc is needed.
9223 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9224 nocopyreloc is given in command line.
9225 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9226 given in command line.
9227 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9228 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9229 of the removed Target_i386::may_need_copy_reloc.
9230 * options.h (copyreloc): New option with default value false.
9231 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9232 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9233 instead of the removed Target_powerpc::may_need_copy_reloc.
9234 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9235 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9236 instead of the removed Target_sparc::may_need_copy_reloc.
9237 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9238 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9239 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9240 instead of the removed Target_x86_64::may_need_copy_reloc.
9241
029ba973
ILT
92422009-09-30 Ian Lance Taylor <iant@google.com>
9243
9244 * object.h (class Object): Remove target_ field, and target,
9245 sized_target, and set_target methods.
9246 (Object::sized_target): Remove.
9247 (class Sized_relobj): Update declarations. Remove sized_target.
9248 * object.cc (Sized_relobj::setup): Remove target parameter.
9249 Change all callers.
9250 (Input_objects::add_object): Don't do anything with the target.
9251 (make_elf_sized_object): Add punconfigured parameter. Change all
9252 callers. Set or test parameter target.
9253 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9254 Change all callers.
9255 * parameters.cc (Parameters::set_target): Change parameter type to
9256 be non-const.
9257 (Parameters::default_target): Remove.
9258 (set_parameters_target): Change parameter type to be non-const.
9259 (parameters_force_valid_target): New function.
9260 (parameters_clear_target): New function.
9261 * parameters.h (class Parameters): Update declarations. Remove
9262 default_target method. Add sized_target and clear_target
9263 methods. Change target_ to be non-const.
9264 (set_parameters_target): Update declaration.
9265 (parameters_force_valid_target): Declare.
9266 (parameters_clear_target): Declare.
9267 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9268 as NULL if we aren't searching.
9269 (Add_symbols::run): Don't check for compatible target.
9270 * fileread.cc (Input_file::open_binary): Call
9271 parameters_force_valid_target.
9272 * gold.cc (queue_middle_tasks): Likewise.
9273 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9274 set_target on object.
9275 * dynobj.h (class Sized_dynobj): Update declarations.
9276 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9277 make_elf_object returns NULL.
9278 (Archive::include_member): Don't check whether object target is
9279 compatible.
9280 * output.cc (Output_section::add_input_section): Get target from
9281 parameters.
9282 (Output_section::relax_input_section): Likewise.
9283 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9284 parameters.
9285 (Sized_relobj::do_scan_relocs): Likewise.
9286 (Sized_relobj::relocate_sections): Likewise.
9287 * resolve.cc (Symbol_table::resolve): Likewise.
9288 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9289 parameter. Change all callers.
9290 (Symbol_table::add_from_object): Get target from parameters.
9291 (Symbol_table::add_from_relobj): Don't check object target.
9292 (Symbol_table::add_from_dynobj): Likewise.
9293 (Symbol_table::define_special_symbol): Get target from
9294 parameters.
9295 * symtab.h (class Symbol_table): Update declaration.
9296 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9297 parameter. Change all callers. Clear parameter target.
9298 (Binary_test): Test target here.
9299 * testsuite/object_unittest.cc (gold_testsuite): Remove
9300 target_test_pointer parameter. Change all callers.
9301 (Object_test): Test target here.
9302
a6a22b83
ILT
93032009-09-26 Ian Lance Taylor <iant@google.com>
9304
9305 * testsuite/initpri1.c: Don't try to use constructor priorities if
9306 compiling with gcc before 4.3.
9307
6a8f49fe
ILT
93082009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9309
9310 * testsuite/retain_symbols_file_test.sh (check_present): Change
9311 output file name to retain_symbols_file_test.stdout.
9312 (check_absent): Likewise.
9313
8c604651
CS
93142009-09-18 Craig Silverstein <csilvers@google.com>
9315
9316 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9317 * options.cc: Include <cerrno> and <fstream>.
9318 (General_options::finalize): Parse -retain-symbols-file tag.
9319 * options.h: New flag.
9320 (General_options): New method should_retain_symbol, new
9321 variable symbols_to_retain.
9322 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9323 should_retain_symbol map.
9324 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9325 * testsuite/Makefile.in: Regenerate.
9326 * testsuite/retain_symbols_file_test.sh: New file.
9327
ca58b19f
NC
93282009-09-18 Nick Clifton <nickc@redhat.com>
9329
9330 * po/es.po: Updated Spanish translation.
9331
20e6d0d6
DK
93322009-09-17 Doug Kwan <dougkwan@google.com>
9333
9334 * debug.h (DEBUG_RELAXATION): New constant.
9335 (DEBUG_ALL): Add DEBUG_RELAXATION.
9336 (debug_string_to_enum): Add relaxation debug option.
9337 * layout.cc
9338 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9339 Layout::Relaxation_debug_check::read_sections,
9340 Layout::Relaxation_debug_check::read_sections): New method definitions.
9341 (Layout::Layout): Initialize data members
9342 record_output_section_data_from_scrips_,
9343 script_output_section_data_list_ and relaxation_debug_check_.
9344 (Layout::save_segments, Layout::restore_segments,
9345 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9346 Layout::relaxation_loop_body): New method definitions.
9347 (Layout::finalize): Support relaxation. Move section layout code to
9348 Layout::relaxation_loop_body.
9349 (Layout::set_asection_address_from_script): Move code for orphan
9350 section placement out.
9351 (Layout::place_orphan_sections_in_script): New method definition.
9352 * layout.h (Output_segment_headers, Output_file_header):
9353 New forward class declarations.
9354 (Layout::~Layout): Define.
9355 (Layout::new_output_section_data_from_script): New method definition.
9356 (Layout::place_orphan_sections_in_script): New method declaration.
9357 (Layout::Segment_states): New type declaration.
9358 (Layout::save_segments, Layout::restore_segments,
9359 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9360 Layout::relaxation_loop_body): New method declarations.
9361 (Layout::Output_section_data_list): New type declaration.
9362 (Layout::Relaxation_debug_check): New class definition.
9363 (Layout::record_output_section_data_from_script_,
9364 Layout::script_output_section_data_list_, Layout::segment_states_,
9365 Layout::relaxation_debug_check_): New data members.
9366 * output.cc: (Output_section_headers::do_size): New method definition.
9367 (Output_section_headers::Output_section_headers): Move size
9368 computation to Output_section_headers::do_size.
9369 (Output_segment_headers::do_size): New method definition.
e1df38aa 9370 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
9371 Output_file_header::do_size and call it.
9372 (Output_file_header::do_size): New method definition.
9373 (Output_data_group::Output_data_group): Adjust call to
9374 Output_section_data.
9375 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9376 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 9377 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
9378 RELAXED_INPUT_SECTION_CODE.
9379 (Output_section::Output_section): Initialize data member checkpoint_.
9380 (Output_section::~Output_section): Delete checkpoint object pointed
9381 by checkpoint_.
9382 (Output_section::add_input_section): Always add an Input_section if
9383 relaxing.
9384 (Output_section::add_merge_input_section): Add assert.
9385 (Output_section::relax_input_section): New method definition.
9386 (Output_section::set_final_data_size): Set load address to zero for
9387 an unallocated section.
9388 (Output_section::do_address_and_file_offset_have_reset_values):
9389 New method definition.
9390 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9391 Handle relaxed input section.
9392 (Output_section::sort_attached_input_sections): Checkpoint input
9393 section list lazily.
9394 (Output_section::get_input_sections): Change type of input_sections to
9395 list of Simple_input_section pointers. Checkpoint input section list
9396 lazily. Also handle relaxed input sections.
9397 (Output_section::add_input_section_for_script): Take a reference to
9398 a Simple_input_section object instead of Relobj pointer and section
9399 index as parameter. Handle relaxed input sections.
9400 (Output_section::save_states, Output_section::restore_states): New
9401 method definitions.
9402 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9403 (Output_data::is_data_size_fixed): New method definition.
9404 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9405 if it is fixed.
9406 (Output_data::address_and_file_offset_have_reset_values): New method
9407 definition.
9408 (Output_data::do_address_and_file_offset_have_reset_values): New method
9409 definition.
9410 (Output_data::set_data_size): Check that data size is not fixed.
9411 (Output_data::fix_data_size): New method definition.
9412 (Output_data::is_data_size_fixed_): New data member.
9413 (Output_section_headers::set_final_data_size): New method definition.
9414 (Output_section_headers::do_size): New method declaration.
9415 (Output_segment_headers::set_final_data_size): New method definition.
9416 (Output_segment_headers::do_size): New method declaration.
9417 (Output_file_header::set_final_data_size)::New method definition.
9418 (Output_file_header::do_size)::New method declaration.
9419 (Output_section_data::Output_section_data): Add new parameter
9420 is_data_size_fixed and use it to fix data size.
9421 (Output_data_const::Output_data_const): Adjust call to base class
9422 constructor and fix data size.
9423 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9424 base class constructor and fix data size.
9425 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9426 base class constructor and fix data size.
9427 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9428 class constructor and fix data size.
9429 (Output_data_group::set_final_data_size): New method definition.
9430 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9431 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9432 class constructor and fix data size.
9433 (Output_relaxed_input_section): New class definition.
9434 (Output_section::Simple_input_section): New class definition.
9435 (Output_section::get_input_sections): Adjust parameter list.
9436 (Output_section::add_input_section_for_script): Same.
9437 (Output_section::save_states, Output_section::restore_states,
9438 Output_section::do_address_and_file_offset_have_reset_values,
9439 (Output_section::Input_section::Input_section): Handle
9440 RELAXED_INPUT_SECTION_CODE. Add new overload for
9441 Output_relaxed_input_section.
9442 (Output_section::Input_section::is_input_section,
9443 Output_section::Input_section::set_output_section): Handle relaxed
9444 input section.
9445 (Output_section::Input_section::is_relaxed_input_section,
9446 Output_section::Input_section::output_section_data,
9447 Output_section::Input_section::relaxed_input_section): New method
9448 definitions.
9449 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9450 value.
9451 (Output_section::Input_section::u1_): Update comments.
9452 (Output_section::Input_section::u2_): Add new union member poris.
9453 (Output_section::Checkpoint_output_section): New classs definition.
9454 (Output_section::relax_input_section): New method declaration.
9455 (Output_section::checkpoint_): New data member.
9456 (Output_segment): Update comments.
9457 (Output_segment::Output_segment): Un-privatize copy constructor.
9458 (Output_segment::operator=): Un-privatize.
9459 * script-sections.cc (Output_section_element::Input_section_list):
9460 Change element type to Output_section::Simple_input_section.
9461 (Output_section_element_dot_assignment::set_section_addresses):
9462 Register output section data for relaxation clean up.
9463 (Output_data_exression::Output_data_expression): Adjust call to base
9464 constructor to fix data size.
9465 (Output_section_element_data::set_section_addresses): Register
9466 Output_data_expression object for relaxation clean up.
9467 (struct Input_section_info): Replace Relobj pointer and section index
9468 pair with Output_section::Simple_input_section and Convert struct to a
9469 class.
9470 (Input_section_sorter::operator()): Adjust access to
e1df38aa 9471 Input_section_info data member to use accessors.
20e6d0d6
DK
9472 (Output_section_element_input::set_section_addresses): Use layout
9473 parameter. Adjust code to use Output_section::Simple_input_section
9474 and Input_secction_info classes. Register filler for relaxation
9475 clean up.
9476 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9477 and section index pair with Output_section::Simple_input_section
9478 class. Adjust code accordingly.
9479 (Phdrs_element::release_segment): New method definition.
9480 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9481 segment list.
9482 (Script_sections::release_segments): New method definition.
9483 * gold/script-sections.h (Script_sections::release_segments): New
9484 method declaration.
9485 * gold/target.h (Target::may_relax, Target::relax,
9486 Target::do_may_relax, Target::do_relax): New method definitions.
9487
5e445df6
ILT
94882009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9489
9490 * arm.cc (has_signed_unsigned_overflow): New function.
9491 (Arm_relocate_functions::abs8): New function.
9492 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9493 (Target_arm::Scan::global): Likewise.
9494 (Target_arm::relocate::relocate): Likewise.
9495 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9496 Likewise.
9497
8c604651 94982009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
9499
9500 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9501 * testsuite/Makefile.in: Regenerate.
9502
1e9cc1c2
NC
95032009-09-11 Nick Clifton <nickc@redhat.com>
9504
9505 * po/gold.pot: Updated by the Translation project.
9506
6a89f575
CC
95072009-09-08 Cary Coutant <ccoutant@google.com>
9508
9509 * output.cc (Output_file::open): Add execute permission to empty file.
9510 * testsuite/Makefile.am (permission_test): New test.
9511 * testsuite/Makefile.in: Regenerate.
9512
fdcac5af
ILT
95132009-09-02 Ian Lance Taylor <iant@google.com>
9514
9515 * output.cc (Output_file::resize): Call map_no_anonymous rather
9516 than map.
9517
44453f85
ILT
95182009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9519
9520 * gold.cc: Include "incremental.h".
9521 (queue_initial_tasks): Call Incremental_checker methods.
9522 * incremental.cc: Include "output.h".
9523 (Incremental_checker::can_incrementally_link_output_file): New
9524 method.
9525 * incremental.h (Incremental_checker): New class.
9526
9527 * output.cc (Output_file::open_for_modification): New method.
9528 (Output_file::map_anonymous): Changed return type to bool. Record
9529 map in base_ field.
9530 (Output_file::map_no_anonymous): New method, broken out of map.
9531 (Output_file::map): Use map_no_anonymous and map_anonymous.
9532 * output.h (class Output_file): Update declarations.
9533
293c1386
CC
95342009-08-24 Cary Coutant <ccoutant@google.com>
9535
9536 * options.h (Command_line::Pre_options): New class.
9537 (Command_line::pre_options): New member.
9538 * options.cc (gold::options::ready_to_register): New variable.
9539 (One_option::register_option): Do nothing if not registering options.
9540 Assert if same short option registered twice.
9541 (General_options::General_options): Turn off option registration when
9542 done constructing.
9543 (Command_line::Pre_options::Pre_options): New constructor.
9544
f773f3d2
CC
95452009-08-24 Cary Coutant <ccoutant@google.com>
9546
06a73cfe
CC
9547 * options.h (General_options::no_keep_memory): Remove incorrect
9548 short option.
f773f3d2 9549
a15af8e2
RW
95502009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9551
9552 * Makefile.am (am__skiplex, am__skipyacc): New.
9553 * Makefile.in: Regenerate.
9554
c462b41b
RW
95552009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9556
14ec8efd
RW
9557 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9558 (INCLUDES): ... this.
9559 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9560 (AM_CPPFLAGS): Renamed from ...
9561 (INCLUDE): ... this.
9562 * Makefile.in, testsuite/Makefile.in: Regenerate.
9563
81ecdfbb
RW
9564 * Makefile.in: Regenerate.
9565 * aclocal.m4: Likewise.
9566 * config.in: Likewise.
9567 * configure: Likewise.
9568 * testsuite/Makefile.in: Likewise.
9569
c462b41b
RW
9570 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9571 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9572 * Makefile.in: Regenerate.
9573 * testsuite/Makefile.in: Regenerate.
9574
2da73f13
CC
95752009-08-19 Cary Coutant <ccoutant@google.com>
9576
9577 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9578 symbols in shared libraries overridden by hidden or internal symbols
9579 in the main program.
9580
2db70501
CD
95812009-08-19 Chris Demetriou <cgd@google.com>
9582
9583 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9584 checking source file names in error messages.
9585
f733487b
DK
95862009-08-18 Doug Kwan <dougkwan@google.com>
9587
9588 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9589 an elcpp::Ehdr as parameter. Adjust call to set_target.
9590 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9591 an elfcpp::Ehdr as parameter.
9592 * object.cc (Object::set_target): Remove the version that looks up
9593 a target and sets it.
9594 (Sized_relobj::setup): Take a Target object instead of
9595 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9596 (make_elf_sized_object): Find target and ask target to
9597 make an ELF object.
9598 * object.h: (Object::set_target): Remove the version that looks up
9599 a target and sets it.
9600 (Sized_relobj::setup): Take a Target object instead of
9601 an elfcpp:Ehdr as parameter.
9602 * target.cc: Include dynobj.h.
9603 (Target::do_make_elf_object_implementation): New.
2e702c99 9604 (Target::do_make_elf_object): New.
f733487b
DK
9605 * target.h (Target::make_elf_object): New template declaration.
9606 (Target::do_make_elf_object): New method declarations.
9607 (Target::do_make_elf_object_implementation): New template declaration.
9608
cc70f101
ILT
96092009-08-14 Ian Lance Taylor <iant@google.com>
9610
9611 * gold.h (FUNCTION_NAME): Define.
9612 (gold_unreachable): Use FUNCTION_NAME.
9613
ef5e0cb1
ST
96142009-08-12 Sriraman Tallam <tmsriram@google.com>
9615
9616 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9617 symbol in the --keep-unique list is not found.
9618
48c187ce
ST
96192009-08-12 Sriraman Tallam <tmsriram@google.com>
9620
9621 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9622 been maked as --keep-unique.
9623 (Icf::unfold_section): New function.
9624 * icf.h (Icf::unfold_section): New function.
9625 * options.h (General_options::keep_unique): New option.
9626 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9627 * testsuite/Makefile.in: Regenerate.
9628 * testsuite/icf_keep_unique_test.sh: New file.
9629 * testsuite/icf_keep_unique_test.cc: New file.
9630
645afe0c
CC
96312009-08-12 Cary Coutant <ccoutant@google.com>
9632
9633 PR 10471
9634 * resolve.cc (Symbol_table::resolve): Check for references from
9635 dynamic objects to hidden and internal symbols.
9636 * testsuite/Makefile.am (hidden_test.sh): New test.
9637 * testsuite/Makefile.in: Regenerate.
9638 * testsuite/hidden_test.sh: New script.
9639 * testsuite/hidden_test_1.c: New test source.
9640 * testsuite/hidden_test_main.c: New test source.
9641
11af873f
DK
96422009-08-11 Doug Kwan <dougkwan@google.com>
9643
9644 * arm.cc: Update comments.
9645 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9646 segment to locate the .ARM.exidx section if present.
9647
b9f7d72d
DK
96482009-08-09 Doug Kwan <dougkwan@google.com>
9649
9650 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9651 patch.
9652
ddd3c53c
ST
96532009-08-07 Sriraman Tallam <tmsriram@google.com>
9654 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9655 compiler warnings.
9656
27721062
ST
96572009-08-06 Sriraman Tallam <tmsriram@google.com>
9658
9659 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9660 valid tls_segment only for non-debug-section relocations.
9661 * testsuite/Makefile.am: Add gc_tls_test.
9662 * testsuite/Makefile.in: Regenerate.
9663 * testsuite/gc_tls_test.cc: New file.
9664 * testsuite/gc_tls_test.sh: New file.
9665
ef15dade 96662009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 9667
ef15dade
ST
9668 * icf.cc: New file.
9669 * icf.h: New file.
9670 * Makefile.am (CCFILES): Add icf.cc.
9671 (HFILES): Add icf.h
9672 * Makefile.in: Regenerate.
9673 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9674 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9675 section, symbol and addend information for the relocs.
9676 * gold.cc (queue_middle_tasks): Call identical code folding.
9677 * gold.h: Add defines for multimap.
9678 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9679 to the call of finalize_local_symbols.
9680 * main.cc (main): Create object of class Icf.
9681 * object.cc (Sized_relobj::do_layout): Allow this function to be
9682 called twice during icf.
9683 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9684 to sections marked as identical by icf.
9685 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9686 when available.
9687 (Sized_relobj::do_section_entsize): New function.
9688 * object.h (Object::section_entsize): New function.
9689 (Object::do_section_entsize): New pure virtual function.
9690 (Relobj::finalize_local_symbols): Add new parameter.
9691 (Relobj::do_section_entsize): New function.
9692 * options.h (General_options::icf): New option.
9693 (General_options::icf_iterations): New option.
9694 (General_options::print_icf_sections): New option.
9695 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9696 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9697 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9698 icf.
9699 * symtab.cc (Symbol_table::is_section_folded): New function.
9700 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9701 to sections marked as identical by icf.
9702 * symtab.h (Symbol_table::set_icf): New function.
9703 (Symbol_table::icf): New function.
9704 (Symbol_table::is_section_folded): New function.
9705 (Symbol_table::icf_): New data member.
9706 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9707 * testsuite/Makefile.am: Add commands to build icf_test.
9708 * testsuite/Makefile.in: Regenerate.
9709 * testsuite/icf_test.sh: New file.
9710 * testsuite/icf_test.cc: New file.
9711
c3b65ac4
CD
97122009-07-24 Chris Demetriou <cgd@google.com>
9713
9714 * layout.cc (is_compressible_debug_section): Fix incorrect
9715 comment about compressed section names.
9716
1caf2c51
ILT
97172009-07-20 Ian Lance Taylor <ian@airs.com>
9718
9719 PR 10419
9720 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9721
1ef4d87f
ILT
97222009-07-16 Ian Lance Taylor <iant@google.com>
9723
9724 PR 10400
9725 * layout.h: #include <map>.
9726 (class Kept_section): Change from struct to class. Add accessors
9727 and setters. Add section size to Comdat_group mapping. Change
9728 Comdat_group to std::map. Add is_comdat_ field. Add
9729 linkonce_size field in union.
9730 (class Layout): Update declaration of find_or_add_kept_section.
9731 Don't declare find_kept_object.
9732 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9733 parameter. Add object, shndx, is_comdat, and is_group_name
9734 parameters. Change all callers. Adjust for new Kept_section.
9735 (Layout::find_kept_object): Remove.
9736 * object.cc (Sized_relobj::include_section_group): Update use of
9737 Kept_section. Rename secnum to shndx. Only record
9738 Kept_comdat_section if sections are the same size.
9739 (Sized_relobj::include_linkonce_section): Update use of
9740 Kept_section. Only record Kept_comdat_section if sections are the
9741 same size. Set size of linkonce section.
9742 (Sized_relobj::map_to_kept_section): Update call to
9743 get_kept_comdat_section.
9744 * object.h (class Sized_relobj): Rename fields in
9745 Kept_comdat_section to drop trailing underscores; change object
9746 field to Relobj*. Change Kept_comdat_section_table to store
9747 struct rather than pointer.
9748 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9749 Add kept_object and kept_shndx parameters. Change all callers.
9750 (Sized_relobj::get_kept_comdat_section): Change return type to
9751 bool. Add kept_object and kept_shndx parameters. Change all
9752 callers.
9753 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9754 Layout::find_or_add_kept_section.
9755
37c3b7b0
ILT
97562009-07-09 Ian Lance Taylor <iant@google.com>
9757
9758 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9759 Reserve space in the hash table.
9760
98fa85cb
ILT
97612009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9762
9763 * fileread.cc (File_read::get_mtime): New method.
9764 * fileread.h (Timespec): New structure.
9765 (File_read::get_mtime): New method.
9766 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9767 Renamed from timestamp_nsec.
9768 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9769 Elf_Xword.
e1df38aa 9770 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 9771 timestamp_nsec.
e1df38aa 9772 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
9773 (Incremental_inputs::report_obejct): Save mtime; style fix.
9774 (Incremental_inputs::report_script): Save mtime; style fix.
9775 (Incremental_inputs::finalize_inputs): Style fix.
9776 (Incremental_inputs::finalize): Style fix.
9777 (Incremental_inputs::create_input_section_data): Store inputs
9778 mtime.
9779 * incremental.h (Incremental_inputs::report_script): Add mtime
9780 argument.
9781 (Incremental_inputs::Input_info::Input_info): Intialize only one
9782 union member.
9783 (Incremental_inputs::Input_info::archive): Move to nameless
9784 union.
9785 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9786 (Incremental_inputs::Input_info::script): Move to nameless union.
9787 (Incremental_inputs::mtime): New field.
9788 * script.cc (read_input_script): Pass file mtime to
9789 Incremental_input.
9790 * script.h (Script_info::inputs): Style fix.
9791
c9d70757
ILT
97922009-07-01 Ian Lance Taylor <ian@airs.com>
9793
9794 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9795 instead of 32.
9796
9c547ec3
ILT
97972009-06-24 Ian Lance Taylor <iant@google.com>
9798
9799 PR 10156
9800 * layout.cc (Layout::choose_output_section): If we find an
9801 existing section, update the flags.
9802 (Layout::create_notes): New function, broken out of
9803 Layout::finalize.
9804 (Layout::finalize): Don't create note sections.
9805 (Layout::create_note): Don't crash if linker script discards
9806 section.
9807 (Layout::create_gold_note): Likewise.
9808 (Layout::create_build_id): Likewise. Don't set
9809 after_input_sections on the section.
9810 (Layout::create_executable_stack_info): Remove target parameter.
9811 Change caller.
9812 * layout.h (class Layout): Declare create_notes. Update
9813 declaration of create_executable_stack_info.
9814 * gold.cc (queue_middle_tasks): Call create_notes.
9815 * output.cc (Output_section::update_flags_for_input_section): Move
9816 here from output.h. If SHF_ALLOC flag is newly set, mark address
9817 invalid.
9818 * output.h (Output_data::mark_address_invalid): New function.
9819 (class Output_section): Only declare, not define,
9820 update_flags_for_input_section. Remove set_flags.
9821
55458500
ILT
98222009-06-24 Ian Lance Taylor <iant@google.com>
9823
9824 * script-sections.cc (Output_section_definition::
9825 set_section_addresses): Rename shadowing local load_address to
9826 laddr.
9827
1307d6cd
ILT
98282009-06-24 Ian Lance Taylor <iant@google.com>
9829
9830 PR 10244
9831 * reloc.cc (relocate_sections): Skip empty relocation sections.
9832
ec3f783e
ILT
98332009-06-23 Ian Lance Taylor <iant@google.com>
9834
9835 PR 10156
9836 * layout.cc (Layout::create_note): Use choose_output_section
9837 rather than make_output_section.
9838
459c9f1c
ILT
98392009-06-23 Ian Lance Taylor <iant@google.com>
9840
9841 PR 10237
9842 * options.cc (General_options::parse_V): Set printed_version_.
9843 (General_options::General_options): Initialize printed_version_.
9844 * options.h (class General_options): Add printed_version_ field.
9845 * gold.cc (queue_initial_tasks): If there are no input files,
9846 don't give a fatal error if we printed the version information.
9847 (queue_middle_tasks): If using -r with a shared object, give a
9848 fatal error rather than an ordinary error.
9849
1518dc8f
ILT
98502009-06-23 Ian Lance Taylor <iant@google.com>
9851
9852 PR 10219
9853 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9854 (Layout::make_output_section): Set have_stabstr_section_ if we see
9855 a .stab*str section.
9856 (Layout::finalize): Call link_stabs_sections.
9857 (Layout::link_stabs_sections): New file.
9858 * layout.h (class Layout): Add have_stabstr_section_ field.
9859 Declare link_stabs_sections.
9860
3d857b98
DK
98612009-06-23 Doug Kwan <dougkwan@google.com>
9862
9863 * Makefile.am (libgold_a_LIBADD): New.
9864 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 9865 * Makefile.in: Regenerate.
3d857b98
DK
9866 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9867 * configure: Regenerate.
9868 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9869 * fileread.cc: Include sys/state.h
9870 * gold.h: Declare memmem and strndup if found missing.
9871 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9872
0639a6f6
ILT
98732009-06-23 Ian Lance Taylor <iant@google.com>
9874
9875 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9876 * configure: Rebuild.
9877
8d63875c
ILT
98782009-06-23 Ian Lance Taylor <iant@google.com>
9879
9880 PR 10147
9881 * object.cc (Object::section_contents): Don't try to get a view if
9882 the section has length zero.
9883 (Object::handle_gnu_warning_section): If the section is empty, use
9884 the name of the section as the warning.
9885
f7c8a183
ILT
98862009-06-23 Ian Lance Taylor <iant@google.com>
9887
9888 PR 10133
9889 * stringpool.h (class Stringpool_template): Add optimize_ field.
9890 (Stringpool_template::set_optimize): New function.
9891 * stringpool.cc (Stringpool_template::Stringpool_template):
9892 Initialize optimize_ field.
9893 (Stringpool_template::set_string_offsets): Test local optimize
9894 fild rather than parameter.
9895 * layout.cc (Layout::Layout): Call set_optimize on the section
9896 name stringpool.
9897
e6a307ba
ILT
98982009-06-22 Ian Lance Taylor <iant@google.com>
9899
9900 PR 10030
9901 * yyscript.y: Parse TARGET.
9902 * script.cc (script_set_target): New function.
9903 * script-c.h (script_set_target): Declare.
9904 * options.cc (General_options::string_to_object_format): Rename
9905 from string_to_object_format in anonymous namespace. Change
9906 callers.
9907 * options.h (class General_options): Declare
9908 string_to_object_format.
9909
3ee173de
ILT
99102009-06-22 Ian Lance Taylor <iant@google.com>
9911
9912 * script-sections.cc (Script_sections::create_segments): Don't put
9913 program headers in a PT_LOAD segment if -n or -N.
9914
99152009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
9916
9917 PR 10141
9918 * options.h (class General_options): Add -z lazy and -z now. Sort
9919 -z options into alphabetical order.
9920 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9921
cd6739a1 99222009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
9923
9924 * layout.cc (Layout::make_output_section): Call
9925 Target::new_output_section.
9926 (Layout::attach_allocated_section_to_segment): Put large section
9927 sections in a separate load segment with the large segment flag
9928 set.
9929 (Layout::segment_precedes): Sort large data segments after other
9930 load segments.
9931 (align_file_offset): New static function.
9932 (Layout::set_segment_offsets): Use align_file_offset.
9933 * output.h (class Output_section): Add is_small_section_ and
9934 is_large_section_ fields.
9935 (Output_section::is_small_section): New function.
9936 (Output_section::set_is_small_section): New function.
9937 (Output_section::is_large_section): New function.
9938 (Output_section::set_is_large_section): New function.
9939 (Output_section::is_large_data_section): New function.
9940 (class Output_segment): Add is_large_data_segment_ field.
9941 (Output_segment::is_large_data_segment): New function.
9942 (Output_segment::set_is_large_data_segment): New function.
9943 * output.cc (Output_section::Output_section): Initialize new
9944 fields.
9945 (Output_segment::Output_segment): Likewise.
9946 (Output_segment::add_output_section): Add assertion that large
9947 data sections always go in large data segments. Force small data
9948 sections to the end of the list of data sections. Force small BSS
9949 sections to the start of the list of BSS sections. For large BSS
9950 sections to the end of the list of BSS sections.
9951 * symtab.h (class Symbol): Declare is_common_shndx.
9952 (Symbol::is_defined): Check Symbol::is_common_shndx.
9953 (Symbol::is_common): Likewise.
9954 (class Symbol_table): Define enum Commons_section_type. Update
9955 declarations. Add small_commons_ and large_commons_ fields.
9956 * symtab.cc (Symbol::is_common_shndx): New function.
9957 (Symbol_table::Symbol_table): Initialize new fields.
9958 (Symbol_table::add_from_object): Put small and large common
9959 symbols in the right list.
9960 (Symbol_table::sized_finalized_symbol): Check
9961 Symbol::is_common_shndx.
9962 (Symbol_table::sized_write_globals): Likewise.
9963 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9964 common symbol lists. Don't call do_allocate_commons_list if the
9965 list is empty.
9966 (Symbol_table::do_allocate_commons_list): Remove is_tls
9967 parameter. Add comons_section_type parameter. Change all
9968 callers. Handle small and large common symbols.
9969 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9970 Symbol::is_common_shndx.
9971 * resolve.cc (symbol_to_bits): Likewise.
9972 * target.h (Target::small_common_shndx): New function.
9973 (Target::small_common_section_flags): New function.
9974 (Target::large_common_shndx): New function.
9975 (Target::large_common_section_flags): New function.
9976 (Target::new_output_section): New function.
9977 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9978 small_common_section_flags, and large_common_section_flags
9979 fields.
9980 (Target::do_new_output_section): New virtual function.
9981 * arm.cc (Target_arm::arm_info): Initialize new fields.
9982 * i386.cc (Target_i386::i386_info): Likewise.
9983 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9984 Likewise.
9985 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9986 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9987 (Target_x86_64::do_new_output_section): New function.
9988 * configure.ac: Define conditional MCMODEL_MEDIUM.
9989 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9990 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9991 (large_LDFLAGS): Define.
9992 * testsuite/large.c: New file.
9993 * testsuite/testfile.cc (Target_test::test_target_info):
9994 Initialize new fields.
9995 * configure, testsuite/Makefile.in: Rebuild.
9996
bb04269c
DK
99972009-06-05 Doug Kwan <dougkwan@google.com>
9998
9999 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 10000 * Makefile.in: Regenerate.
bb04269c
DK
10001 * i386.cc (class Target_i386): Define new virtual method to
10002 override do_is_local_label_name in parent.
10003 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10004 local symbols if --discard-locals or -X is given.
10005 * options.h (class General_options): Declare new options
10006 '--discard-locals' and '-X' for discarding locals.
10007 * target.h (class Target): Define new methods is_local_label_name.
10008 Declare new virtual method do_is_local_label_name.
10009 * target.cc: New file.
10010 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10011 (check_SCRIPTS): Add discard_locals_test.sh.
10012 (check_DATA): Add discard_local_tests.syms.
10013 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
10014 (discard_local_tests.syms, discard_locals_test.o): New make rules.
10015 * testsuite/Makefile.in: Regenerate.
10016 * testsuite/discard_locals_test.c: New file.
10017 * testsuite/discard_locals_test.sh: Same.
10018
805bb01c
DK
100192009-06-05 Doug Kwan <dougkwan@google.com>
10020
10021 * object.cc (Sized_relobj::Sized_relobj): Initialize
10022 discarded_eh_frame_shndx_ to -1U.
10023 (Sized_relobj::do_layout): Record index of a discard .eh_frame
10024 section.
10025 (Sized_relobj::do_count_local_symbols): Skip local symbols in
10026 a discarded .eh_frame section.
10027 (Sized_relobj::do_finalize_local_symbols): Ditto.
10028 * object.h (class Sized_relobj): Declare new member
10029 discarded_eh_frame_shndx_.
10030 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
10031 (local_labels_test.o, local_labels_test): New rules.
10032 * testsuite/Makefile.in: Regenerate.
10033
1dcd334d
DK
100342009-06-04 Doug Kwan <dougkwan@google.com>
10035
10036 * layout.cc (Layout::section_name_mapping): Add mapping for
10037 special ARM sections.
10038
96d49306
DK
100392009-06-03 Doug Kwan <dougkwan@google.com>
10040
10041 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
10042 (utils::has_overflow): Same.
10043
dff16297
ILT
100442009-06-03 Ian Lance Taylor <iant@google.com>
10045
10046 * layout.cc (Layout::section_name_mapping): New array, replacing
10047 Layout::linkonce_mapping.
10048 (Layout::section_name_mapping_count): New variable, replacing
10049 Layout::linkonce_mapping_count.
10050 (Layout::linkonce_output_name): Remove.
10051 (Layout::output_section_name): Rewrite.
10052 * layout.h (class Layout): Rename Linkonce_mapping to
10053 Section_name_mapping, linkonce_mapping to section_name_mapping,
10054 linkonce_mapping_count to section_name_mapping_count. Don't
10055 declare linkonce_output_name.
10056
c121c671
DK
100572009-06-03 Doug Kwan <dougkwan@google.com>
10058
10059 * gold/arm.cc (namespace utils): New.
10060 (Target_arm::reloc_is_non_pic): Define new method.
10061 (class Arm_relocate_functions): New.
10062 (Target_arm::Relocate::relocate): Handle relocation types used by
10063 Android.
10064
07800fab
ILT
100652009-06-03 Ian Lance Taylor <iant@google.com>
10066
10067 * arm.cc (Target_arm::scan::global): Use || instead of |.
10068
c121c671
DK
100692009-06-02 Doug Kwan <dougkwan@google.com>
10070
10071 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10072 issued_non_pic_error_.
10073 (class Target_arm::Scan): Declare new method check_non_pic.
10074 Define new method symbol_needs_plt_entry.
10075 Declare new data member issued_non_pic_error_.
10076 (class Target_arm::Relocate): Declare new method
10077 should_apply_static_reloc.
10078 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10079 (Target_arm::Scan::check_non_pic): Define new method.
10080 (Target_arm::Scan::local): Handle a small subset of reloc types used
10081 by Android.
10082 (Target_arm::Scan::local): Same.
10083 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10084
b19b0c6d
ILT
100852009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10086
10087 * incremental.cc (Incremental_inputs::report_command_line): Filter
10088 out --incremental-* options.
10089
94cdfcff
DK
100902009-05-29 Doug Kwan <dougkwan@google.com>
10091
10092 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10093 template class.
10094 (class Target_arm): Update comment.
10095 (Target_arm::Target_arm): Initialize new data members GOT_,
10096 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10097 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10098 and Target_arm::rel_dyn_section.
10099 Declare new_enum Target_arm::Got_type.
10100 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10101 and DYNBSS_.
10102 Update commments for member do_dynsym_value.
10103 (Target_arm::got_size, Target_arm::plt_section,
10104 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10105 new methods inside class defintion.
10106 (Target_arm::got_section): Define new method.
10107 (Target_arm::rel_dyn_section): Same.
10108 (Output_data_plt_arm): New template class.
10109 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10110 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10111 (Output_data_plt_arm::add_entry): Same.
10112 (Output_data_plt_arm::first_plt_entry): Define new
10113 static data member for PLT instruction template.
10114 (Output_data_plt_arm::plt_entry): Same.
10115 (Output_data_plt_arm::do_write): Define new method.
10116 (Target_arm::make_plt_entry): Same.
10117 (Target_arm::do_finalize_sections): Same.
10118 (Target_arm::do_dynsym_value): Same.
10119
4a657b0d
DK
101202009-05-28 Doug Kwan <dougkwan@google.com>
10121
10122 * Makefile.am (TARGETSOURCES): Add arm.cc.
10123 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10124 * Makefile.in: Regenerate.
10125 * arm.cc: New file.
10126 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10127
e7ae8c36
DK
101282009-05-26 Doug Kwan <dougkwan@google.com>
10129
10130 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10131 (General_options::check_excluded_libs): Strip off directories in
10132 archive name before matching like GNU ld does.
10133 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10134 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10135 (exclude_libs_test_LDFLAGS): Add linker option
10136 -Wl,--exclude-libs,libexclude_libs_test_3
10137 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10138 an explicit archive without using -l.
10139 (alt/libexclude_libs_test_3.a): New make rule.
10140 * testsuite/Makefile.in: Regenerate.
10141 * testsuite/exclude_libs_test.c : Declare lib3_default().
10142 (main): Call it.
10143 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10144 * exclude_libs_test_3.c: New file.
10145
f12e7348
NC
101462009-05-26 Nick Clifton <nickc@redhat.com>
10147
10148 * po/id.po: New Indonesian translation.
10149 * po/gold.pot: Updated template file.
10150
4daadc0d
ST
101512009-05-22 Sriraman Tallam <tmsriram@google.com>
10152
e1df38aa 10153 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
10154 gc_comdat_test files. Add -Wl,--gc-sections to build
10155 gc_comdat_test.
10156 * testsuite/Makefile.in: Regenerate.
10157 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10158
531813ad
ST
101592009-05-21 Sriraman Tallam <tmsriram@google.com>
10160
10161 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10162 kept comdat section was garbage collected.
10163 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10164 * testsuite/Makefile.in: Regenerate.
10165 * testsuite/gc_comdat_test.sh: New file.
10166 * testsuite/gc_comdat_test_1.cc: New file.
10167 * testsuite/gc_comdat_test_2.cc: New file.
10168
65514900
CC
101692009-05-19 Doug Kwan <dougkwan@google.com>
10170
10171 * archive.cc (Archive::Archive): Move constructor from archive.h
10172 to here. Initialize no_export_.
10173 (Archive::get_elf_object_for_member): Set no_export flag of object.
10174 * archive.h (Archive::Archive): Move constructor body to
10175 archive.cc.
10176 (Archive::no_export): New method.
10177 (Archive::no_export_): New field.
10178 * object.h (Object::Object): Initialize no_export_ to false.
10179 (Object::no_export, Object::set_no_export): New methods.
10180 (Object::no_export_): New field.
10181 * options.cc (General_options::parse_exclude_libs): New method.
10182 (General_options::check_excluded_libs) Same.
10183 * options.h (exclude_libs): New option.
10184 (General_options::check_excluded_libs): New method declaration.
10185 (General_options::excluded_libs_): New field.
10186 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10187 default or protected visibility if an object has no-export flag set.
10188 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10189 (check_SCRIPTS): Add exclude_libs_test.sh.
10190 (check_DATA): Add exclude_libs_test.syms.
10191 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10192 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10193 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10194 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10195 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10196 libexclude_libs_test_2.a): New rules.
10197 * testsuite/Makefile.in: Regenerate.
10198 * testsuite/exclude_libs_test.c: New file.
10199 * testsuite/exclude_libs_test.sh: Ditto.
10200 * testsuite/exclude_libs_test_1.c: Ditto.
10201 * testsuite/exclude_libs_test_2.c: Ditto.
10202
1b77ea50
ILT
102032009-05-15 Ian Lance Taylor <iant@google.com>
10204
10205 * configure.ac: Check for declarations for cases where libiberty.h
10206 checks HAVE_DECL_xxx.
10207 * configure, config.in: Rebuild.
10208
072fe7ce
ILT
102092009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10210
10211 * gold.h (Incremental_argument_list): Remove (invalid) forward
10212 declaration.
10213 * incremental.cc (Incremental_inputs::report_achive): New method.
10214 (Incremental_inputs::report_object): New method.
10215 (Incremental_inputs::report_script): New method.
10216 (Incremental_inputs::finalize_inputs): New method.
10217 (Incremental_inputs::finalize): Call finalize_inputs().
10218 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10219 Create inputs entries.
10220 * incremental.h (Incremental_input_type): New enum.
10221 (Incremental_inputs::Incremental_input): Initialize new fields.
10222 (Incremental_inputs::report_inputs): New method.
10223 (Incremental_inputs::report_achive): New method.
10224 (Incremental_inputs::report_object): New method.
10225 (Incremental_inputs::report_script): New method.
10226 (Incremental_inputs::finalize_inputs): New method.
10227 (Incremental_inputs::Input_info): New struct.
10228 (Incremental_inputs::Input_info_map): New typedef.
10229 (Incremental_inputs::lock_): New field.
10230 (Incremental_inputs::Inputs_): New field.
10231 (Incremental_inputs::Inputs_map): New field.
10232 * main.cc (main): Call Incremental_input::report_inputs.
10233 * options.h (Input_argument_list): Typedef moved from
10234 Input_arguments.
10235 (Input_file_group::Files): Remove, use ::Input_argument_list.
10236 (Input_file_group::Input_argument_list): Remove, use
10237 ::Input_argument_list.
10238 * plugin.cc (Plugin_manager::add_input_file): Add error in
10239 incremental build.
10240 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10241 functions.
10242 * script.cc (read_input_script): Call
10243 Incremental_input::report_script.
10244 * script.h (Script_info): New class.
10245
b0481b0b
ILT
102462009-04-27 Ian Lance Taylor <iant@google.com>
10247
10248 * x86_64.cc (do_adjust_output_section): Set entsize to
10249 plt_entry_size.
10250
b22a5a41 102512009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
10252
10253 * output.cc (Output_file::close): After short writes, continue
10254 writing from the correct offset in the buffer being written.
10255
40fde488
CD
102562009-04-23 Chris Demetriou <cgd@google.com>
10257
10258 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10259 * configure: Regenerate.
10260 * config.in: Regenerate.
10261 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10262 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10263
3ce2c28e
ILT
102642009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10265
10266 * incremental.cc (Incremental_inputs_header_data): Renamed from
10267 Incremental_input_header_data.
10268 (Incremental_inputs_header_data::data_size): New field.
10269 (Incremental_inputs_header_data::put_input_file_count): Renamed
10270 from input_file_count.
10271 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10272 from command_line_offset.
10273 (Incremental_inputs_header_data::put_reserved): Renamed from
10274 put_reserved.
10275 (Incremental_inputs_entry_data): Renamed from
10276 Incremental_input_entry_data.
10277 (Incremental_inputs_entry_data::data_size): New field.
10278 (Incremental_inputs::report_command_line): New method.
10279 (Incremental_inputs::finalize): New method.
10280 (Incremental_inputs::create_incremental_inputs_data): New method.
10281 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10282 * incremental.h: New file.
10283 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10284 (Layout::finalize): Create incremental inputs section in
10285 incremental builds.
10286 (Layout::create_incremental_info_sections): New method.
10287 * layout.h (Layout::incremental_inputs): New method.
10288 (Layout::create_incremental_info_sections): New method.
10289 (Layout::incremental_inputs_): New field.
10290 * main.cc (main): Notify Incremental_input of the command line.
10291
e55bde5e
ILT
102922009-04-01 Ian Lance Taylor <iant@google.com>
10293 Mikolaj Zalewski <mikolajz@google.com>
10294
10295 * gold.h (reserve_unordered_map): Define, three versions, one for
10296 each version of Unordered_map.
10297 * layout.cc (Layout::Layout): Remove options parameter. Add
10298 number_of_input_files parameter. Don't initialize options_.
10299 Initialize number_of_input_files_ and resized_signatures_. Move
10300 sections_are_attached_.
10301 (Layout::layout_group): Reserve space for group_signatures_.
10302 (Layout::find_or_add_kept_section): Change name parameter to be a
10303 reference. Resize signatures_ map when it gets large enough.
10304 (Layout::layout_eh_frame): Use parameters->options() instead of
10305 this->options_.
10306 (Layout::make_output_section): Likewise.
10307 (Layout::attach_allocated_section_to_segment): Likewise.
10308 (Layout::finalize, Layout::create_executable_stack): Likewise.
10309 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10310 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10311 * layout.h (class Layout): Update declarations. Remove options_
10312 field. Add number_of_input_files_ and resized_signatures_
10313 fields. Move sections_are_attached_ field.
10314 * main.cc (main): Pass number of input files to Layout
10315 constructor. Don't pass options.
10316
154b857c
ILT
103172009-03-30 Ian Lance Taylor <iant@google.com>
10318
10319 * ffsll.c (ffsll): Correct implementation.
10320
2f35ab9b
ILT
103212009-03-27 Ian Lance Taylor <iant@google.com>
10322
fd03461a
ILT
10323 * ffsll.c: New file.
10324 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10325 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10326 * ftruncate.c (ftruncate): Declare before definition.
10327 * mremap.c (mremap): Likewise.
10328 * pread.c (pread): Likewise.
10329 * configure, Makefile.in, config.in: Rebuild.
10330
2f35ab9b
ILT
10331 * mremap.c: New file.
10332 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10333 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10334 (mremap): Declare if HAVE_MREMAP is not defined.
10335 * configure, Makefile.in, config.in: Rebuild.
10336
33aea2fd
CC
103372009-03-27 Cary Coutant <ccoutant@google.com>
10338
10339 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10340 position independent.
10341 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10342 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10343
6d479619
CC
103442009-03-24 Cary Coutant <ccoutant@google.com>
10345
10346 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10347 an executable.
10348 (needs_dynamic_reloc): Likewise.
10349
afc06bb8
ILT
103502009-03-24 Ian Lance Taylor <iant@google.com>
10351
10352 * yyscript.y (file_cmd): Recognize EXTERN.
10353 (extern_name_list, extern_name_list_body): New nonterminals.
10354 * script.cc (script_add_extern): Define.
10355 * script-c.h (script_add_extern): Declare.
10356
f6060a4d
ILT
103572009-03-24 Rafael Avila de Espindola <espindola@google.com>
10358
10359 * object.cc (is_elf_object): Define.
10360 * object.h (is_elf_object): Declare.
10361 * archive.cc (Archive::get_elf_object_for_member): Call
10362 is_elf_object.
33aea2fd 10363 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 10364
26736d8e
ILT
103652009-03-24 Elliott Hughes <enh@google.com>
10366
10367 * output.cc (Output_file::map_anonymous): Define.
10368 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10369 try an anonymous one. Report the size if the mmap fails.
10370 * output.h (class Output_file): Declare map_anonymous.
10371
22fd9730
ILT
103722009-03-24 Ian Lance Taylor <iant@google.com>
10373
10374 * target-select.cc (instantiate_target): Don't acquire the lock if
10375 the instantiated_target_ field has already been set.
10376
cb010894
ILT
103772009-03-23 Ian Lance Taylor <iant@google.com>
10378
7f055c20
ILT
10379 * gold-threads.h (class Initialize_lock): Define.
10380 * gold-threads.cc (class Initialize_lock_once): Define.
10381 (initialize_lock_control): New static variable.
10382 (initialize_lock_pointer): New static variable.
10383 (initialize_lock_once): New static function.
10384 (Initialize_lock::Initialize_lock): Define.
10385 (Initialize_lock::initialize): Define.
10386 * target-select.h: Include "gold-threads.h".
10387 (class Target_selector): Add lock_ and initialize_lock_ fields.
10388 Don't define instantiate_target, just declare it.
10389 * target-select.cc (Target_selector::Target_selector): Initialize
10390 new fields.
10391 (Target_selector::instantiate_target): Define.
10392 * descriptors.h: Include "gold-threads.h".
10393 (class Descriptors): Add initialize_lock_ field.
10394 * descriptors.cc (Descriptors::Descriptors): Initialize new
10395 field.
10396 (Descriptors::open): Use initialize_lock_ field
10397 * errors.h (class Errors): Add initialize_lock_ field.
10398 * errors.cc (Errors::Errors): Initialize new field.
10399 (Errors::initialize_lock): Use initialize_lock_ field.
10400 * powerpc.cc (class Target_selector_powerpc): Remove
10401 instantiated_target_ field. In do_recognize call
10402 instantiate_target rather than do_instantiate_target. In
10403 do_instantiate_target just allocate a new target.
10404 * sparc.cc (class Target_selector_sparc): Likewise.
10405
36959681
ILT
10406 * freebsd.h: New file.
10407 * i386.cc: Include "freebsd.h".
10408 (Target_i386): Derive from Target_freebsd rather than
10409 Sized_target.
10410 (Target_selector_i386): Derive from Target_selector_freebsd rather
10411 than Target_selector.
10412 * x86_64.cc: Include "freebsd.h".
10413 (Target_x86_64): Derive from Target_freebsd rather than
10414 Sized_target.
10415 (Target_selector_x86_64): Derive from Target_selector_freebsd
10416 rather than Target_selector.
10417 * target.h (class Target): Add adjust_elf_header and
10418 do_adjust_elf_header.
10419 * output.cc (Output_file_header:: do_sized_write): Call target
10420 adjust_elf_header routine.
10421 * configure.tgt: Set targ_osabi.
10422 * configure.ac: Define GOLD_DEFAULT_OSABI.
10423 * parameters.cc (Parameters::default_target): Pass
10424 GOLD_DEFAULT_OSABI to select_target.
10425 * target-select.h (class Target_selector): Make instantiate_target
10426 protected rather than private.
10427 * Makefile.am (HFILES): Add freebsd.h.
10428 * configure, Makefile.in, config.in: Rebuild.
10429
cb010894
ILT
10430 * merge.cc (do_add_input_section): Correct pend value. Change
10431 message about last entry not being null terminated from error to
10432 warning.
10433
0e879927
ILT
104342009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10435
10436 * incremental.cc: New file.
10437 * Makefile.am (CCFILES): Add incremental.cc.
10438 * Makefile.in: Rebuild.
10439
41105937
PP
104402009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10441
10442 * layout.cc (Layout::output_section_name): Preserve names
10443 of '.note.' sections.
e1df38aa 10444
60439920
ILT
104452009-03-19 Ian Lance Taylor <iant@google.com>
10446
10447 * descriptors.cc (Descriptors::open): Check that the options are
10448 valid before using them.
10449
0d371ad3
ILT
104502009-03-18 Ian Lance Taylor <iant@google.com>
10451
10452 * script-sections.h: Include <list>.
10453 (class Script_sections): Change Sections_elements from std::vector
10454 to std::list. Typedef public Elements_iterator. Add
10455 orphan_section_placement_, data_segment_align_start_, and
10456 saw_data_segment_align_ fields. Remove data_segment_align_index_
10457 field.
10458 * script-sections.cc (class Orphan_section_placement): New class.
10459 (class Sections_element): Add virtual functions is_relro and
10460 orphan_section_init. Remove virtual function place_orphan_here.
10461 (class Output_section_definition): Add is_relro and
10462 orphan_section_init. Remove place_orphan_here.
10463 (class Orphan_output_section): Likewise.
10464 (Script_sections::Script_sections): Update for field changes.
10465 (Script_sections::data_segment_align): Set saw_data_segment_align_
10466 and data_segment_align_start_, not data_segment_align_index.
10467 (Script_sections::data_segment_relro_end): Check
10468 saw_data_segment_align_. Use data_segment_align_start_ rather
10469 than data_segment_align_index_.
10470 (Script_sections::place_orphan): Rewrite to use
10471 Orphan_section_placement.
10472
9201d894
ILT
104732009-03-17 Ian Lance Taylor <iant@google.com>
10474
9c5b8369
ILT
10475 * archive.cc (Archive::add_symbols): Check for a version attached
10476 to the symbol name in the archive map.
10477 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10478 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10479 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10480 (ver_test_11.a): New target.
10481 * testsuite/Makefile.in: Rebuild.
10482
9201d894
ILT
10483 * configure.ac: Check for chsize and posix_fallocate. Replace
10484 ftruncate.
10485 * ftruncate.c: New file, from gnulib.
10486 * output.cc (posix_fallocate): Define dummy version if not
10487 HAVE_POSIX_FALLOCATE.
10488 (Output_file::map): Call posix_fallocate rather than lseek and
10489 write.
10490 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10491 * configure, Makefile.in, config.in: Rebuild.
10492
ef4ab7a8 104932009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 10494
ef4ab7a8
PP
10495 * layout.h (Layout::create_note): Add section_name parameter.
10496 * layout.cc (Layout::create_note): Likewise.
10497 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 10498
8c500701
ILT
104992009-03-17 Ian Lance Taylor <iant@google.com>
10500
e85b18e1
ILT
10501 * descriptors.cc: Include "options.h".
10502 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10503 (Descriptors::open): Always use O_CLOEXEC when opening a new
10504 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10505 then set FD_CLOEXEC.
10506
9efe6174
ILT
10507 * sparc.cc (class Target_sparc): Add has_got_section.
10508 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10509 make sure we have a GOT section.
10510
10511 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10512 (Target_sparc::Scan::local): Likewise.
10513 (Target_sparc::Scan::global): Likewise.
10514 (Target_sparc::Relocate::relocate): Likewise.
10515 (Target_sparc::Relocate::relocate_tls): Likewise.
10516
8c500701
ILT
10517 * symtab.cc (Symbol_table::define_default_version): New function,
10518 broken out of add_from_object.
10519 (Symbol_table::add_from_object): Call define_default_version.
10520 (Symbol_table::define_special_symbol): Add resolve_oldsym
10521 parameter. Change all callers. If the version for a symbol comes
10522 from a version script, resolve it with the symbol with the same
10523 name with no version. Also add the symbol without a version if
10524 appropriate.
10525 (do_define_in_output_data): If resolving with oldsym, don't delete
10526 sym.
10527 (do_define_in_output_segment): Likewise.
10528 (do_define_as_constant): Likewise.
10529 * symtab.h (class Symbol_table): Update declarations.
10530
f1ed28fb
ILT
105312009-03-13 Ian Lance Taylor <iant@google.com>
10532
15f8229b
ILT
10533 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10534 (Read_symbols::requeue): New function.
10535 (Read_symbols::do_read_symbols): If make_elf_object fails because
10536 the target type is not configured, and the file was searched for,
10537 issue a warning and retry with the next directory.
10538 (Add_symbols::run): If the file has an incompatible format, and
10539 it was searched for, requeue the Read_symbols task. On error,
10540 release the object.
10541 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10542 dirindex parameter to constructor. Change all callers. Declare
10543 incompatible_warning and requeue.
10544 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10545 input_argument_ and input_group_ fields. Add them to
10546 constructor. Change all callers.
10547 (class Read_script): Add dirindex_ field. Add it to constructor.
10548 Change all callers.
10549 * archive.cc (Archive::setup): Remove input_objects parameter.
10550 Change all callers.
10551 (Archive::get_file_and_offset): Likewise.
10552 (Archive::read_all_symbols): Likewise.
10553 (Archive::read_symbols): Likewise.
10554 (Archive::get_elf_object_for_member): Remove input_objects
10555 parameter. Add punconfigured parameter. Change all callers.
10556 (Archive::add_symbols): Change return type to bool. Check return
10557 value of include_member.
10558 (Archive::include_all_members): Likewise.
10559 (Archive::include_member): Change return type to bool. Return
10560 false if first included object has incompatible target. Set
10561 included_member_ field.
10562 (Add_archive_symbols::run): If add_symbols returns false, requeue
10563 Read_symbols task.
10564 * archive.h (class Archive): Add included_member_ field.
10565 Initialize it in constructor. Add input_file and searched_for
10566 methods. Update declarations.
10567 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10568 input_argument_ fields. Add them to constructor. Change all
10569 callers.
10570 * script.cc: Include "target-select.h".
10571 (class Parser_closure): Add skip_on_incompatible_target_ and
10572 found_incompatible_target_ fields. Add
10573 skip_on_incompatible_target parameter to constructor. Change all
10574 callers. Add methods skip_on_incompatible_target,
10575 clear_skip_on_incompatible_target, found_incompatible_target, and
10576 set_found_incompatible_target.
10577 (read_input_script): Add dirindex parameter. Change all callers.
10578 If parser finds an incompatible target, requeue Read_symbols
10579 task.
10580 (script_set_symbol): Clear skip_on_incompatible_target in
10581 closure.
10582 (script_add_assertion, script_parse_option): Likewise.
10583 (script_start_sections, script_add_phdr): Likewise.
10584 (script_check_output_format): New function.
10585 * script.h (read_input_script): Update declaration.
10586 * script-c.h (script_check_output_format): Declare.
10587 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10588 (ignore_cmd): Remove OUTPUT_FORMAT.
10589 * fileread.cc (Input_file::Input_file): Add explicit this.
10590 (Input_file::will_search_for): New function.
10591 (Input_file::open): Add pindex parameter. Change all callers.
10592 * fileread.h (class Input_file): Add input_file_argument method.
10593 Declare will_search_for. Update declarations.
10594 * object.cc (make_elf_object): Add punconfigured parameter.
10595 Change all callers.
10596 * object.h (class Object): Make input_file public. Add
10597 searched_for method.
10598 (make_elf_object): Update declaration.
10599 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10600 restart search.
10601 * dirsearch.h (class Dirsearch): Update declaration.
10602 * options.h (class General_options): Add --warn-search-mismatch.
10603 * parameters.cc (Parameters::is_compatible_target): New function.
10604 * parameters.h (class Parameters): Declare is_compatible_target.
10605 * workqueue.cc (Workqueue::add_blocker): New function.
10606 * workqueue.h (class Workqueue): Declare add_blocker.
10607
f1ed28fb
ILT
10608 * fileread.cc (Input_file::open): Remove options parameter.
10609 Change all callers.
10610 (Input_file::open_binary): Likewise.
10611 * script.cc (read_input_script): Likewise.
10612 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10613 options parameter from constructor. Change all callers.
10614 (class Read_script): Likewise.
10615 * fileread.h (class Input_file): Update declarations.
10616 * script.h (read_input_script): Update declaration.
10617
34dd024a
NC
106182009-03-10 Nick Clifton <nickc@redhat.com>
10619
10620 * po/es.po: New Spanish translation.
10621
6d71b17c
CC
106222009-03-06 Cary Coutant <ccoutant@google.com>
10623
10624 * options.cc (parse_short_option): Keep dash_z from registering itself.
10625
031cdbed
ILT
106262009-03-03 Ian Lance Taylor <iant@google.com>
10627
10628 PR 9918
10629 * target-reloc.h (relocate_section): Pass output_section to
10630 relocate.
10631 * i386.cc (Target_i386::should_apply_static_reloc): Add
10632 output_section parameter. Change all callers.
10633 (Target_i386::Relocate::relocate): Add output_section parameter.
10634 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10635 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10636 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10637 * testsuite/two_file_shared.sh: New script.
10638 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10639 (check_DATA): Add two_file_shared.dbg.
10640 (two_file_shared.dbg): New target.
10641 * testsuite/Makefile.in: Rebuild.
10642
15d5fa16
ILT
106432009-03-01 Ian Lance Taylor <iant@google.com>
10644
10645 * configure.ac: Check for byteswap.h.
10646 * configure: Rebuild.
10647 * config.in: Rebuild.
10648
8a4c0b0d
ILT
106492009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10650
10651 * layout.cc (Layout::find_or_add_kept_section): New function.
10652 (Layout::add_comdat): Removed.
10653 * layout.h (struct Kept_section): Move out of class Layout.
10654 Remove trailing underscores from field names. Add group_sections
10655 field. Rename group_ field to is_group. Change all uses.
10656 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10657 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10658 comdat_groups_ field.
10659 (Sized_relobj::include_section_group): Use
10660 find_or_add_kept_section and Kept_section::group_sections.
10661 (Sized_relobj::include_linkonce_section): Likewise.
10662 * object.cc (class Sized_relobj): Don't define Comdat_group or
10663 Comdat_group_table. Remove find_comdat_group and
10664 add_comdat_group. Remove comdat_groups_ field.
10665 * plugin.cc (include_comdat_group): Use
10666 Layout::find_or_add_kept_section.
10667
b4ecf66b
ILT
106682009-02-28 Ian Lance Taylor <iant@google.com>
10669
14359ca0
ILT
10670 * README: --gc-sections and map files are now supported. Document
10671 some build requirements.
10672
b4ecf66b
ILT
10673 PR 6992
10674 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10675 relocatable link set the value of the section symbol to zero.
10676 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10677 relocatable link don't include the section address in the local
10678 symbol value.
10679
0602e05a
ILT
106802009-02-27 Ian Lance Taylor <iant@google.com>
10681
fd9d194f
ILT
10682 PR 6811
10683 * options.h (class Search_directory): Add is_system_directory.
10684 (class General_options): Declare is_in_system_directory.
10685 * options.cc (get_relative_sysroot): Make static.
10686 (get_default_sysroot): Make static.
10687 (General_optoins::is_in_system_directory): New function.
10688 * fileread.cc (Input_file::is_in_system_directory): New function.
10689 * fileread.h (class Input_file): Declare is_in_system_directory.
10690 * object.h (class Object): Add is_in_system_directory.
10691 (class Input_objects): Remove system_library_directory_ field.
10692 * object.cc (Input_objects::add_object): Don't set
10693 system_library_directory_.
10694 (input_objects::found_in_system_library_directory): Remove.
10695 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10696 parameter. Change all callers.
10697 (Symbol_table::sized_write_globals): Likewise.
10698 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10699 Call Object::is_in_system_directory.
10700 * symtab.h (class Symbol_table): Update declarations.
10701
61edd21f
ILT
10702 PR 5990
10703 * descriptors.h (Open_descriptor): Add is_on_stack field.
10704 * descriptors.cc (Descriptors::open): If the descriptor is on the
10705 top of the stack, remove it. Initialize is_on_stack field.
10706 (Descriptors::release): Only add pod to stack if it is not on the
10707 stack already.
10708 (Descriptors::close_some_descriptor): Clear stack_next and
10709 is_on_stack fields.
10710
e29e076a
ILT
10711 PR 7091
10712 * output.cc (Output_section::find_starting_output_address): Rename
10713 from starting_output_address; add PADDR parameter; change return
10714 type.
10715 * output.h (class Output_section): Declare
10716 find_starting_output_address instead of starting_output_address.
10717 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10718 section symbol for which we can't find a merge section.
10719
0602e05a
ILT
10720 PR 9836
10721 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10722 hidden or internal, force the symbol to be local.
10723 * resolve.cc (Symbol::override_visibility): Define.
10724 (Symbol::override_base): Use override_visibility.
10725 (Symbol_table::resolve): Likewise.
10726 (Symbol::override_base_with_special): Likewise.
10727 (Symbol_table::override_with_special): If the visibility is hidden
10728 or internal, force the symbol to be local.
10729 * symtab.h (class Symbol): Add set_visibility and
10730 override_visibility.
10731 * testsuite/ver_test_1.sh: New file.
10732 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10733 (check_DATA): Add ver_test_1.syms.
10734 (ver_test_1.syms): New target.
10735 * testsuite/Makefile.in: Rebuild.
10736
401a9a73
CC
107372009-02-25 Cary Coutant <ccoutant@google.com>
10738
10739 * layout.cc (Layout::choose_output_section): Don't rename sections
10740 when using a linker script that has a SECTIONS clause.
10741 * Makefile.in: Regenerate.
10742
10743 * testsuite/Makefile.am (script_test_5.sh): New test case.
10744 * testsuite/Makefile.in: Regenerate.
10745 * testsuite/script_test_5.cc: New file.
10746 * testsuite/script_test_5.sh: New file.
10747 * testsuite/script_test_5.t: New file.
10748
f488e4b0
CC
107492009-02-13 Rafael Avila de Espindola <espindola@google.com>
10750
10751 * archive.cc (Archive::include_member): Update calls to add_symbols.
10752 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10753 the Layout argument.
10754 * dynobj.h (do_add_symbols): Add the Layout argument.
10755 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10756 Layout argument.
10757 * object.h (Object::add_symbols): Add the Layout argument.
10758 (Object::do_add_symbols): Add the Layout argument.
10759 (Sized_relobj::do_add_symbols): Add the Layout argument.
10760 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10761 Unify the two versions.
10762 (Add_plugin_symbols): Remove.
10763 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10764 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10765 (Add_plugin_symbols): Remove.
10766 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10767 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10768 (Add_symbols::run): Make it work with Pulginobj.
10769
89dd1680
ILT
107702009-02-06 Ian Lance Taylor <iant@google.com>
10771
10772 * object.cc (Sized_relobj::do_layout): Make info message start
10773 with lower case letter.
10774
266d0a74
ILT
107752009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10776
602b464e
ILT
10777 * binary.cc: Fix file comment.
10778
266d0a74
ILT
10779 * options.h (enum Incremental_disposition): Define.
10780 (class General_options): Add new options: --incremental,
10781 --incremental_changed, --incremental_unchanged,
10782 --incremental_unknown. Add incremental_disposition_ and
10783 implicit_incremental_ fields.
10784 (General_options::incremental_disposition): New function.
10785 (class Position_dependent_options): Add incremental_disposition
10786 option.
10787 (Position_dependent_options::copy_from_options): Set incremental
10788 dispositions.
10789 * options.cc (General_options::parse_incremental_changed): New
10790 function.
2e702c99
RM
10791 (General_options::parse_incremental_unchanged): New function.
10792 (General_options::parse_incremental_unknown): New function.
10793 (General_options::General_options): Initialize new fields
266d0a74 10794 incremental_disposition_ and implicit_incremental_.
2e702c99 10795 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
10796 without --incremental.
10797
f073bbf7
CD
107982009-02-06 Chris Demetriou <cgd@google.com>
10799
10800 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10801 pointer and to report location as the file name associated with
10802 the symbol.
10803 (gold_undefined_symbol_at_location): New function to replace the
10804 old gold_undefined_symbol functionality.
10805 * target-reloc.h (relocate_section): Update to use
10806 gold_undefined_symbol_at_location.
10807 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10808 Call gold_undefined_symbol function rather than gold_error.
10809 * errors.h (Errors::undefined_symbol): Take location as a
10810 string, rather than calculating it from a relocation.
10811 * errors.cc (Errors::fatal): Print "fatal error:" before the
10812 formatted message.
10813 (Errors::error, Errors::error_at_location): Print "error: "
10814 before the formatted message.
10815 (Errors::undefined_symbol): Take location as a string, rather
10816 than calculating it from a relocation.
10817 (gold_undefined_symbol_at_location): New function akin to
10818 old gold_undefined_symbol, calculates location from relocation.
10819 (gold_undefined_symbol): Change to take only a Symbol pointer
10820 and to report location as the file name associated with the symbol.
10821 * testsuite/debug_msg.sh: Update for changed error messages.
10822 * testsuite/undef_symbol.sh: Likewise.
10823
8e94a90c
ILT
108242009-02-04 Duncan Sands <baldrick@free.fr>
10825
10826 PR 9812
10827 * reduced_debug_output.h
10828 (Output_reduced_debug_abbrev_section::failed): Use format for
10829 gold_warning.
10830 (Output_reduced_debug_info_section::faild): Likewise.
10831
88a0e15b
ILT
108322009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10833
10834 * script.cc (Lazy_demangler): New class.
2e702c99 10835 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
10836 symbol only once.
10837
5efc7cd2
CC
108382009-01-29 Cary Coutant <ccoutant@google.com>
10839
10840 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10841 to __tls_get_addr.
10842 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10843
e0ebcf42
ILT
108442009-01-28 Ian Lance Taylor <iant@google.com>
10845
5efc7cd2 10846 * version.cc (version_string): Bump to 1.9.
75fe7426 10847
e0ebcf42
ILT
10848 * gold.h: Include <cstring> and <stdint.h>.
10849 * version.cc: Include <cstdio>.
10850 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10851 warning.
10852 * reduced_debug_output.cc (insert_into_vector): Rename from
10853 Insert_into_vector; change all callers. Use Swap_unaligned to
10854 avoid aliasing issue; remove union since it is unnecessary.
10855
8e2813be 108562009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
10857
10858 * Makefile.am (CCFILES): Add gc.cc.
10859 (HFILES): Add gc.h.
10860 * Makefile.in: Regenerate.
10861 * gold.cc (Gc_runner): New class.
10862 (queue_initial_tasks): Call garbage collection related tasks
10863 when corresponding options are invoked.
10864 (queue_middle_gc_tasks): New function.
10865 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10866 processed early before laying out sections during garbage collection.
10867 * gold.h (queue_middle_gc_tasks): New function.
10868 (is_prefix_of): Move from "layout.cc".
10869 * i386.cc (Target_i386::gc_process_relocs): New function.
10870 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10871 * main.cc (main): Create object of class "Garbage_collection".
10872 * object.cc (Relobj::copy_symbols_data): New function.
10873 (Relobj::is_section_name_included): New function.
e1df38aa
NC
10874 (Sized_relobj::do_layout): Allow this function to be called twice
10875 during garbage collection and defer layout of section during the
6d03d481
ST
10876 first call.
10877 * object.h (Relobj::get_symbols_data): New function.
10878 (Relobj::is_section_name_included): New function.
10879 (Relobj::copy_symbols_data): New function.
10880 (Relobj::set_symbols_data): New function.
10881 (Relobj::get_relocs_data): New function.
10882 (Relobj::set_relocs_data): New function.
10883 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10884 (Relobj::gc_process_relocs): New function.
10885 (Relobj::do_gc_process_relocs): New pure virtual function.
10886 (Relobj::sd_): New data member.
10887 (Sized_relobj::is_output_section_offset_invalid): New function.
10888 (Sized_relobj::do_gc_process_relocs): New function.
10889 * options.h (General_options::gc_sections): Modify to not be a no-op.
10890 (General_options::print_gc_sections): New option.
10891 * plugin.cc (Plugin_finish::run): Remove function call to
10892 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10893 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10894 * reloc.cc (Read_relocs::run): Add task to process relocs and
10895 determine unreferenced sections when doing garbage collection.
10896 (Gc_process_relocs): New class.
10897 (Sized_relobj::do_gc_process_relocs): New function.
10898 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10899 sections that are garbage collected.
10900 * reloc.h (Gc_process_relocs): New class.
10901 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10902 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10903 symbols whose corresponding sections are garbage collected.
10904 (Symbol_table::Symbol_table): Add new parameter for the garbage
10905 collection object.
10906 (Symbol_table::gc_mark_undef_symbols): New function.
10907 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10908 (Symbol_table::gc_mark_dyn_syms): New function.
10909 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10910 as garbage.
10911 (Symbol_table::add_from_object): Likewise.
10912 (Symbol_table::add_from_relobj): When building shared objects, do not
10913 treat externally visible symbols as garbage.
10914 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10915 table information for static and relocatable links.
10916 * symtab.h (Symbol_table::set_gc): New function.
10917 (Symbol_table::gc): New function.
10918 (Symbol_table::gc_mark_undef_symbols): New function.
10919 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10920 (Symbol_table::gc_mark_dyn_syms): New function.
10921 (Symbol_table::gc_): New data member.
e1df38aa 10922 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
10923 function.
10924 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10925 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10926
3b293544
CF
109272009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10928
10929 * options.h (General_options::gc_sections): Define as a no-op for now.
10930 (General_options::no_keep_memory): Ditto.
10931 (General_options::Bshareable): Define.
10932 * options.cc (General_options::finalize): Honor -Bshareable.
10933
83d22aa8
AS
109342009-01-20 Andreas Schwab <schwab@suse.de>
10935
10936 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10937 read the value in the contents, since we don't use it. Use the
10938 template endianness when writing.
10939 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10940
cd536b21
AS
109412009-01-19 Andreas Schwab <schwab@suse.de>
10942
10943 * configure.tgt (powerpc64-*): Fix targ_obj.
10944
99e9a495
ILT
109452009-01-15 Ian Lance Taylor <iant@google.com>
10946
10947 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10948 local symbols when stripping all symbols.
10949
bbbfea06
CC
109502009-01-14 Cary Coutant <ccoutant@google.com>
10951
99e9a495 10952 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 10953
0f7c0701
CC
109542009-01-14 Cary Coutant <ccoutant@google.com>
10955
10956 * archive.cc (Archive::get_elf_object_for_member): Remove call
10957 to File_read::claim_for_plugin.
10958 * descriptors.cc (Descriptors::open): Remove reference to
10959 is_claimed.
10960 (Descriptors::claim_for_plugin): Remove.
10961 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10962 (Descriptors::is_claimed): Remove.
10963 (claim_descriptor_for_plugin): Remove.
10964 * fileread.cc (File_read::claim_for_plugin): Remove.
10965 * fileread.h (File_read::claim_for_plugin): Remove.
10966 (File_read::descriptor): Reopen descriptor if necessary.
10967 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10968 (Plugin_manager::all_symbols_read): Add task parameter. Change
10969 all callers.
10970 (Plugin_manager::get_input_file): New function.
10971 (Plugin_manager::release_input_file): New function.
10972 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10973 corresponding data member.
10974 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10975 and pass to base constructor. Change all callers.
10976 (get_input_file, release_input_file): New functions.
10977 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10978 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10979 (Plugin_manager::all_symbols_read): Add task parameter.
10980 (Plugin_manager::get_input_file): New function.
10981 (Plugin_manager::release_input_file): New function.
10982 (Plugin_manager::task_): New data member.
10983 (Pluginobj::Pluginobj): Add filesize parameter.
10984 (Pluginobj::filename): New function.
10985 (Pluginobj::descriptor): New function.
10986 (Pluginobj::filesize): New function.
10987 (Pluginobj::filesize_): New data member.
10988 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10989 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10990 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10991
10992 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10993 with archive libraries.
10994 * testsuite/Makefile.in: Regenerate.
10995 * testsuite/plugin_test.c (struct sym_info): New type.
10996 (get_input_file, release_input_file): New static variables.
10997 (onload): Capture new transfer vector entries.
10998 (claim_file_hook): Stop reading at end of file according to filesize.
10999 Factor out parsing of readelf output into separate function.
11000 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11001 APIs and get the source file name from the symbol table. Convert
11002 source file name to corresponding object file name. Print info
11003 message when adding new input files.
11004 (parse_readelf_line): New function.
11005 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11006 * testsuite/plugin_test_2.sh: Likewise.
11007 * testsuite/plugin_test_3.sh: Likewise.
11008 * testsuite/plugin_test_4.sh: New test case.
11009
62a6d109
ILT
110102009-01-07 Ian Lance Taylor <iant@google.com>
11011
11012 * version.cc (version_string): Bump to 1.8.
11013
483620e8
CC
110142008-12-23 Cary Coutant <ccoutant@google.com>
11015
11016 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
11017 * plugin.cc (Plugin_manager::finish): Rename as
11018 layout_deferred_objects. Move cleanup to separate function.
11019 (Plugin_manager::cleanup): New function.
11020 (Plugin_finish::run): Call layout_deferred_objects and cleanup
11021 separately.
11022 * plugin.h (Plugin_manager::finish): Rename as
11023 layout_deferred_objects.
11024 (Plugin_manager::cleanup): New function.
11025 (Plugin_manager::cleanup_done): New field.
11026
d66a9eb3
CC
110272008-12-23 Cary Coutant <ccoutant@google.com>
11028
11029 * plugin.cc (is_visible_from_outside): New function.
11030 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
11031 so we don't return "IR only" status for exported symbols or -r links.
11032
11033 * testsuite/Makefile.am (plugin_test_3): New test case.
11034 * testsuite/Makefile.in: Regenerate.
11035 * testsuite/plugin_test_3.sh: New file.
11036
5995b570
CC
110372008-12-22 Cary Coutant <ccoutant@google.com>
11038
11039 * object.cc (Sized_relobj::layout_section): New function.
11040 (Sized_relobj::do_layout): Defer layout of input sections until after
11041 plugin has provided replacement files.
11042 (Sized_relobj::do_layout_deferred_sections): New function.
11043 * object.h (Relobj::set_section_offset): Remove virtual keyword.
11044 (Relobj::layout_deferred_sections): New function.
11045 (Relobj::do_layout_deferred_sections): New function.
11046 (Sized_relobj::do_layout_deferred_sections): New function.
11047 (Sized_relobj::layout_section): New function.
11048 (Sized_relobj::Deferred_layout): New structure.
11049 (Sized_relobj::deferred_layout_): New field.
11050 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
11051 Change all callers. Layout deferred sections.
11052 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
11053 references.
11054 (Plugin_hook::run): Move code from do_plugin_hook inline.
11055 (Plugin_hook::do_plugin_hook): Remove.
11056 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
11057 (Plugin_manager::finish): Renamed, was cleanup.
11058 (Plugin_manager::should_defer_layout): New function.
11059 (Plugin_manager::add_deferred_layout_object): New function.
11060 (Plugin_manager::Deferred_layout_list): New type.
11061 (Plugin_manager::deferred_layout_objects_): New field.
11062 (Plugin_hook::do_plugin_hook): Remove.
11063
ee769c88
ILT
110642008-12-17 Ian Lance Taylor <iant@google.com>
11065
11066 * options.h (class General_options): Add --no case for
11067 --export-dynamic.
11068
abc8dcba
CC
110692008-12-16 Cary Coutant <ccoutant@google.com>
11070
11071 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11072 vector.
11073 (Plugin_manager::claim_file): Create plugin object even if
11074 plugin did not call the add_symbols callback.
11075 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11076 asking for more symbols than were added.
11077 * testsuite/Makefile.am (plugin_test_1): Add test case with
11078 no global symbols.
11079 (empty.syms): New target.
11080 * testsuite/Makefile.in: Regenerate.
11081 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11082 message. Don't call add_symbols if no globals.
11083 (all_symbols_read_hook): Don't provide replacement for empty
11084 claimed file.
11085
b0074644
ILT
110862008-12-12 Ian Lance Taylor <iant@google.com>
11087
68943102
ILT
11088 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11089 r_type == 0 for a local symbol with r_sym == 0.
11090 (scan_relocatable_relocs): Pass r_sym to
11091 local_non_section_strategy.
11092 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11093 r_sym parameter.
11094
b0074644
ILT
11095 * configure.ac: Update test for TLS descriptors: they are
11096 supported as of glibc 2.9.
11097 * configure: Rebuild.
11098
c2508178
ILT
110992008-12-11 Ian Lance Taylor <iant@google.com>
11100
11101 PR 7091
11102 * target-reloc.h (Default_scan_relocatable_relocs): For each
11103 function, map r_type == 0 to RELOC_DISCARD.
11104
2756a258
CC
111052008-12-10 Cary Coutant <ccoutant@google.com>
11106
11107 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11108 object to override a kept COMDAT group from a plugin object.
11109
bb6f53d3
ILT
111102008-12-09 Ian Lance Taylor <iant@google.com>
11111
fbc558e1
ILT
11112 PR 7088
11113 * yyscript.y (file_cmd): Handle INPUT.
11114
bb6f53d3
ILT
11115 * testsuite/initpri1.c: Change all declarations to be full
11116 prototypes by adding void, to avoid compiler warnings.
11117
4674ecfc
CC
111182008-12-05 Rafael Avila de Espindola <espindola@google.com>
11119
11120 * options.cc (General_options::parse_plugin_opt): New.
11121 (General_options::add_plugin): The argument now is just the filename.
11122 (General_options::add_plugin_option): New.
11123 * options.h (plugin_opt): New.
11124 (add_plugin): Change argument name.
11125 (add_plugin_option): New.
11126 * plugin.cc (Plugin::load): Don't parse the plugin option.
11127 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11128 (Plugin::add_option): New.
11129 (Plugin::args_): Change type.
11130 (Plugin::filename_): New.
11131 (Plugin_manager::add_plugin_option): New.
11132 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11133 * testsuite/Makefile.in: Regenerate.
11134
fd06b4aa
CC
111352008-12-05 Cary Coutant <ccoutant@google.com>
11136
11137 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11138 Handle --strip-lto-sections option.
11139 * options.h (strip_lto_sections): New option.
11140
6c52134c
CC
111412008-12-01 Cary Coutant <ccoutant@google.com>
11142
11143 * plugin.cc (ld_plugin_message): Change format parameter to const.
11144 Fix mismatch between new[] and delete.
11145
a45248e0
CC
111462008-11-14 Cary Coutant <ccoutant@google.com>
11147
11148 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11149 instead of -1U.
11150
c82fbeee
CS
111512008-11-05 Craig Silverstein <csilvers@google.com>
11152
11153 * options.cc (General_options::parse_dynamic_list): New function.
11154 * options.h (General_options): New flags dynamic_list,
11155 dynamic_list_data, dynamic_list_cpp_new, and
11156 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11157 (General_options::in_dynamic_list): New function.
11158 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11159 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11160 (Lex::can_continue_name): Likewise.
11161 (yylex): Likewise.
11162 (read_script_file): New parameter script_options.
11163 (read_dynamic_list): New function.
11164 (Script_options::define_dynamic_list): New function.
11165 (dynamic_list_keyword_parsecodes): New variable.
11166 (dynamic_list_keywords): New variable.
11167 * script.h (Script_options::define_dynamic_list): New function
11168 prototype.
11169 (read_dynamic_list): New function prototype.
11170 * symtab.cc (strprefix): New macro.
11171 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11172 dynamic_list_data, dynamic_list_cpp_new, and
11173 dynamic_list_cpp_typeinfo.
11174 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11175 (dynamic_list_expr): New rule.
11176 (dynamic_list_nodes): Likewise.
11177 (dynamic_list_node): Likewise.
11178 * testsuite/Makefile.am (dynamic_list): New test.
11179 * testsuite/Makefile.in: Regenerated.
11180 * testsuite/dynamic_list.t: New file.
11181 * testsuite/dynamic_list.sh: New file.
11182
e0bb29a5
CS
111832008-11-05 Craig Silverstein <csilvers@google.com>
11184
11185 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11186 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11187 (t11_last): Likewise.
11188 * testsuite/ver_test_6.c (main): Likewise.
11189
4e1e25e0
CC
111902008-10-07 Cary Coutant <ccoutant@google.com>
11191
11192 * options.c (General_options::finalize): Add check for -static and
11193 -shared.
11194 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11195 is not empty.
11196
92f03fcb
CC
111972008-10-02 Cary Coutant <ccoutant@google.com>
11198
11199 * plugin.cc (make_sized_plugin_object): Fix conditional
11200 compilation to work when not all targets are enabled.
11201
fbd8a257
CC
112022008-09-29 Cary Coutant <ccoutant@google.com>
11203
11204 * archive.cc (Archive::get_file_and_offset): Use filename instead
11205 of name to get library path.
11206 (Archive::include_member): Unlock external member of a thin archive.
11207
11208 * testsuite/Makefile.am (TEST_AR): New variable.
11209 (thin_archive_test_1): New test.
11210 (thin_archive_test_2): New test.
81636b3f
CC
11211 * testsuite/Makefile.in: Regenerate.
11212 * testsuite/thin_archive_main.cc: New file.
11213 * testsuite/thin_archive_test_1.cc: New file.
11214 * testsuite/thin_archive_test_2.cc: New file.
11215 * testsuite/thin_archive_test_3.cc: New file.
11216 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 11217
eff45813
CC
112182008-09-29 Cary Coutant <ccoutant@google.com>
11219
11220 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11221 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11222 instead of -1U.
11223 (Sized_relobj::do_finalize_local_symbols): Likewise.
11224 (Sized_relobj::map_to_kept_section): Likewise.
11225 * object.h (Sized_relobj::invalid_address): New constant.
11226 (Sized_relobj::do_output_section_offset): Check for invalid_address
11227 and return -1ULL.
11228 * output.cc (Output_reloc::local_section_offset): Use constant
11229 invalid_address instead of -1U.
11230 (Output_reloc::get_address): Likewise.
11231 (Output_section::output_address): Change -1U to -1ULL.
11232 * output.h (Output_reloc::invalid_address): New constant.
11233 * reloc.cc (Sized_relobj::write_sections): Use constant
11234 invalid_address instead of -1U.
11235 (Sized_relobj::relocate_sections): Likewise.
11236 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11237 values for merge sections.
11238 * target-reloc.h (relocate_for_relocatable): Use constant
11239 invalid_address instead of -1U.
11240
89fc3421
CC
112412008-09-19 Cary Coutant <ccoutant@google.com>
11242
11243 Add plugin functionality for link-time optimization (LTO).
11244 * configure.ac (plugins): Add --enable-plugins option.
11245 * configure: Regenerate.
11246 * config.in: Regenerate.
11247 * Makefile.am (LIBDL): New variable.
11248 (CCFILES): Add plugin.cc.
11249 (HFILES): Add plugin.h.
11250 (ldadd_var): Add LIBDL.
11251 * Makefile.in: Regenerate.
11252
11253 * archive.cc: Include "plugin.h".
11254 (Archive::setup): Don't preread archive symbols when using a plugin.
11255 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11256 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11257 files.
11258 (Archive::include_member): Add symbols from plugin objects.
11259 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11260 * descriptors.cc (Descriptors::open): Check for file descriptors
11261 abandoned by plugins.
11262 (Descriptors::claim_for_plugin): New function.
11263 * descriptors.h (Descriptors::claim_for_plugin): New function.
11264 (Open_descriptor::is_claimed): New field.
11265 (claim_descriptor_for_plugin): New function.
11266 * fileread.cc (File_read::claim_for_plugin): New function.
11267 * fileread.h (File_read::claim_for_plugin): New function.
11268 (File_read::descriptor): New function.
11269 * gold.cc: Include "plugin.h".
11270 (queue_initial_tasks): Add task to call plugin hooks for generating
11271 new object files.
11272 * main.cc: Include "plugin.h".
11273 (main): Load plugin libraries.
11274 * object.h (Pluginobj): Declare.
11275 (Object::pluginobj): New function.
11276 (Object::do_pluginobj): New function.
11277 (Object::set_target): New function.
11278 * options.cc: Include "plugin.h".
11279 (General_options::parse_plugin): New function.
11280 (General_options::General_options): Initialize plugins_ field.
11281 (General_options::add_plugin): New function.
11282 * options.h (Plugin_manager): Declare.
11283 (General_options): Add --plugin option.
11284 (General_options::has_plugins): New function.
11285 (General_options::plugins): New function.
11286 (General_options::add_plugin): New function.
11287 (General_options::plugins_): New field.
11288 * plugin.cc: New file.
11289 * plugin.h: New file.
11290 * readsyms.cc: Include "plugin.h".
11291 (Read_symbols::do_read_symbols): Check for archive before checking
11292 for ELF file. Call plugin hooks to claim files.
11293 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11294 from a real object file; force override when processing replacement
11295 files.
11296 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11297 (Symbol::init_base_object): Likewise.
11298 (Symbol::init_base_output_data): Likewise.
11299 (Symbol::init_base_output_segment): Likewise.
11300 (Symbol::init_base_constant): Likewise.
11301 (Symbol::init_base_undefined): Likewise.
11302 (Symbol::output_section): Assert that object is not a plugin.
11303 (Symbol_table::add_from_pluginobj): New function.
11304 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11305 undefined.
11306 (Symbol_table::sized_write_globals): Likewise.
11307 (Symbol_table::add_from_pluginobj): Instantiate template.
11308 * symtab.h (Sized_pluginobj): Declare.
11309 (Symbol::in_real_elf): New function.
11310 (Symbol::set_in_real_elf): New function.
11311 (Symbol::in_real_elf_): New field.
11312 (Symbol_table::add_from_pluginobj): New function.
11313
11314 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11315 (LIBDL): New variable.
11316 (LDADD): Add LIBDL.
11317 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11318 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11319 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11320 (MOSTLYCLEANFILES): Likewise.
11321 * testsuite/Makefile.in: Regenerate.
11322 * testsuite/plugin_test.c: New file.
11323 * testsuite/plugin_test_1.sh: New file.
11324 * testsuite/plugin_test_2.sh: New file.
11325
de31bda5
ILT
113262008-09-16 Ian Lance Taylor <iant@google.com>
11327
9c2d0ef9
ILT
11328 * target-reloc.h (relocate_section): Check whether a symbol is
11329 defined by the ABI before reporting an undefined symbol error.
11330 * target.h (Target::is_defined_by_abi): Make parameter const.
11331 (Target::do_is_defined_by_abi): Likewise.
11332 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11333 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11334 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11335 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11336 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11337 * testsuite/Makefile.in: Rebuild.
11338
de31bda5
ILT
11339 * fileread.cc (make_view): Add casts to avoid warning.
11340
9fa33bee
AO
113412008-09-16 Alexandre Oliva <aoliva@redhat.com>
11342
11343 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11344 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11345
183fd0e3
AO
113462008-09-16 Alexandre Oliva <aoliva@redhat.com>
11347
11348 * options.h (General_options::output_is_executable): New.
11349 (General_options::output_is_pie): New.
11350 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11351 for shared libraries.
11352 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11353
7be8330a
CD
113542008-09-11 Chris Demetriou <cgd@google.com>
11355
11356 * options.h (origin): New -z option.
11357 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11358 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11359 in DT_FLAGS_1.
11360
a9caad02
CC
113612008-09-05 Cary Coutant <ccoutant@google.com>
11362
11363 * fileread.cc (File_read::make_view): Add check for attempt to map
11364 beyond end of file.
11365
ae6dce4d
CC
113662008-09-05 Cary Coutant <ccoutant@google.com>
11367
11368 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11369 explicit instantiations.
11370
d7ab2a47
KVH
113712008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11372
11373 PR gold/6858
11374 * options.cc (General_options::finalize): Allow undefined symbols
11375 in shlibs if linking -shared.
11376
11377 PR gold/6859
11378 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11379 symbols as not needing a dynsym entry.
11380
1e52a9c1
CS
113812008-08-20 Craig Silverstein <csilvers@google.com>
11382
11383 * fileread.cc (File_read::open): Do not lock the file unless it
11384 was successfully opened.
11385
d85c80a3
CC
113862008-08-14 Cary Coutant <ccoutant@google.com>
11387
11388 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11389 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11390 * testsuite/tls_test.cc (struct int128): 128-bit struct
11391 for testing TLS relocs with non-zero addend.
11392 (v12): New TLS variable.
11393 (t12): New test.
11394 (t_last): Add check for v12.
11395 * testsuite/tls_test.h (t12): New function.
11396 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11397
2d924fd9
ILT
113982008-08-13 Ian Lance Taylor <iant@google.com>
11399
11400 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11401 set tls_segment_ or relro_segment_.
11402 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11403 when appropriate.
11404 * output.h (Output_section::clear_is_relro): New function.
11405 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11406 sections specially even when output_data_ is empty.
11407 (Output_segment::maximum_alignment): When first section is relro,
11408 only force alignment for PT_LOAD segments.
11409 * script.cc (script_data_segment_align): New function.
11410 (script_data_segment_relro_end): New function.
11411 * script-c.h (script_data_segment_align): Declare.
11412 (script_data_segment_relro_end): Declare.
11413 * script-sections.h (class Script_sections): Declare
11414 data_segment_align and data_segment_relro_end. Add fields
11415 segment_align_index_ and saw_relro_end_.
11416 * script-sections.cc (class Sections_element): Add set_is_relro
11417 virtual function. Add new bool* parameter to place_orphan_here.
11418 Add get_output_section virtual function.
11419 (class Output_section_definition): Add set_is_relro. Add new
11420 bool* parameter to place_orphan_here. Add get_output_section.
11421 Add is_relro_ field.
11422 (Output_section_definition::Output_section_definition): Initialize
11423 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11424 and is_relro_ fields.
11425 (Output_section_definition::place_orphan_here): Add is_relro
11426 parameter.
11427 (Output_section_definition::set_section_addresses): Set relro for
11428 output section.
11429 (Output_section_definition::alternate_constraint): Likewise.
11430 (class Orphan_output_section): Add new bool* parameter to
11431 place_orphan_here. Add get_output_section.
11432 (Orphan_output_section::place_orphan_here): Add is_relro
11433 parameter.
11434 (Script_sections::Script_sections): Initialize
11435 data_segment_align_index_ and saw_relro_end_.
11436 (Script_sections::data_segment_align): New function.
11437 (Script_sections::data_segment_relro_end): New function.
11438 (Script_sections::place_orphan): Set or clear is_relro.
11439 (Script_sections::set_section_addresses): Force alignment of first
11440 TLS section.
11441 * yyscript.y (exp): Call script_data_segment_align and
11442 script_data_segment_relro_end.
11443 * testsuite/relro_script_test.t: New file.
11444 * testsuite/relro_test.cc (using_script): Declare.
11445 (t1, t2): Test using_script.
11446 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11447 (relro_script_test_SOURCES): Define.
11448 (relro_script_test_DEPENDENCIES): Define.
11449 (relro_script_test_LDFLAGS): Define.
11450 (relro_script_test_LDADD): Define.
11451 (relro_script_test.so): New target.
11452 * testsuite/Makefile.in: Rebuild.
11453
f827c9a9
CC
114542008-08-06 Cary Coutant <ccoutant@google.com>
11455
11456 * archive.cc (Archive::total_archives, Archive::total_members)
11457 (Archive::total_members_loaded): New variables.
11458 (Archive::setup): Add parameter. Add option to preread
11459 archive symbols.
11460 (Archive::read_armap): Add counter.
11461 (Archive::get_file_and_offset): New function.
11462 (Archive::get_elf_object_for_member): New function.
11463 (Archive::read_all_symbols): New function.
11464 (Archive::read_symbols): New function.
11465 (Archive::add_symbols): Add counters.
11466 (Archive::include_all_members): Use armap to find members if it's
11467 already built.
11468 (Archive::include_member): Skip reading symbols if already read.
11469 Factored code into Archive::get_file_and_offset and
11470 Archive::get_elf_object_for_member. Changed call to
11471 Mapfile::report_include_archive_member.
11472 (Archive::print_stats): New function.
11473 * archive.h: Declare Object and Read_symbols_data classes.
11474 (Archive::Archive): Add initializers for new members.
11475 (Archive::setup): Add parameter.
11476 (Archive::print_stats): New function.
11477 (Archive::total_archives, Archive::total_members)
11478 (Archive::total_members_loaded): New variables.
11479 (Archive::get_file_and_offset): New function.
11480 (Archive::get_elf_object_for_member): New function.
11481 (Archive::read_all_symbols): New function.
11482 (Archive::read_symbols): New function.
11483 (Archive::Archive_member): New class.
11484 (Archive::members_): New member.
11485 (Archive::num_members_): New member.
11486 * main.cc: Include archive.h.
11487 (main): Call Archive::print_stats.
11488 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11489 archive parameter; member_name is now the fully-decorated name.
11490 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11491 * options.h: (General_options): Add --preread-archive-symbols option.
11492 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11493 Archive::setup.
11494
de4c45bd
ILT
114952008-08-04 Ian Lance Taylor <iant@google.com>
11496
11497 * symtab.h (Symbol::use_plt_offset): New function.
11498 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11499 * powerpc.cc (Relocate::relocate): Likewise.
11500 * sparc.cc (Relocate::relocate): Likewise.
11501 * x86_64.cc (Relocate::relocate): Likewise.
11502 * testsuite/weak_plt.sh: New test.
11503 * testsuite/weak_plt_main.cc: New test.
11504 * testsuite/weak_plt_shared.cc: New test.
11505 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11506 (check_PROGRAMS): Add weak_plt.
11507 (check_DATA): Add weak_plt_shared.so.
11508 (weak_plt_main_pic.o, weak_plt): New targets.
11509 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11510 * testsuite/Makefile.in: Rebuild.
11511
11512 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11513 gcctestdir/ld.
11514 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11515 * testsuite/Makefile.in: Rebuild.
11516
323ee3f4
AM
115172008-08-04 Alan Modra <amodra@bigpond.net.au>
11518
11519 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11520 * Makefile.in: Regenerate.
11521 * po/POTFILES.in: Regenerate.
11522
7c07ecec
ILT
115232008-07-29 Ian Lance Taylor <iant@google.com>
11524
11525 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11526 symbols before other symbols.
11527 * testsuite/script_test_2.cc (test_addr): Declare.
11528 (test_addr_alias): Declare.
11529 (main): Check that test_addr and test_addr_alias have the right
cd536b21 11530 values.
7c07ecec
ILT
11531 * testsuite/script_test_2.t: Define test_addr_alias and
11532 test_addr.
11533
5778530e
ILT
115342008-07-24 Ian Lance Taylor <iant@google.com>
11535
2a00e4fb
ILT
11536 PR 5990
11537 * descriptors.cc: New file.
11538 * descriptors.h: New file.
11539 * gold-threads.h (class Hold_optional_lock): New class.
11540 * fileread.cc: Include "descriptors.h".
11541 (File_read::~File_read): Release descriptor rather than closing
11542 it.
11543 (File_read::open) [file]: Call open_descriptor rather than open.
11544 Set is_descriptor_opened_.
11545 (File_read::open) [memory]: Assert that descriptor is not open.
11546 (File_read::reopen_descriptor): New function.
11547 (File_read::release): Release descriptor.
11548 (File_read::do_read): Make non-const. Reopen descriptor.
11549 (File_read::read): Make non-const.
11550 (File_read::make_view): Reopen descriptor.
11551 (File_read::do_readv): Likewise.
11552 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11553 Update declarations.
11554 * layout.cc: Include "descriptors.h".
11555 (Layout::create_build_id): Use open_descriptor rather than open.
11556 * output.cc: Include "descriptors.h".
11557 (Output_file::open): Use open_descriptor rather than open.
11558 * archive.cc (Archive::const_iterator): Change Archive to be
11559 non-const.
11560 (Archive::begin, Archive::end): Make non-const.
11561 (Archive::count_members): Likewise.
11562 * archive.h (class Archive): Update declarations.
11563 * object.h (Object::read): Make non-const.
11564 * Makefile.am (CCFILES): Add descriptors.cc.
11565 (HFILES): Add descriptors.h.
11566 * Makefile.in: Rebuild.
11567
801647d1
ILT
11568 PR 6716
11569 * gold.h: Always include <clocale>. Add Solaris workarounds
11570 following code in binutils/sysdep.h.
11571
5edd166e
ILT
11572 PR 6048
11573 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11574 this->eh_frame_hdr_ is NULL before using it.
11575
c89ad728
ILT
11576 * dynobj.cc (Versions::Versions): Update comment.
11577
aa86f06b
ILT
11578 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11579 the base version name.
11580
5778530e
ILT
11581 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11582 array size plus one.
11583 (Stringpool_template::set_string_offsets): Subtract one from key
11584 before using it as an array index.
11585 (Stringpool_template::get_offset_with_length): Likewise.
11586 (Stringpool_template::write_to_buffer): Likewise.
11587 * stringpool.h (Stringpool_template::get_offset_from_key):
11588 Likewise.
11589
057ead22
ILT
115902008-07-23 Ian Lance Taylor <iant@google.com>
11591
7f649c59
ILT
11592 PR 6658
11593 * object.h (Merged_symbol_value::value): Do our best to handle a
11594 negative addend.
11595
057ead22
ILT
11596 PR 6647
11597 * script.cc (Version_script_info::get_versions): Don't add empty
11598 version tag to return value.
11599 (Version_script_info::get_symbol_version_helper): Change return
11600 type to bool. Add pversion parameter. Change all callers.
11601 (script_register_vers_node): Don't require a non-NULL tag.
11602 * script.h (class Version_script_info): Update declarations.
11603 (Version_script_info::get_symbol_version): Change return type to
11604 bool. Add version parameter. Change all callers.
11605 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11606 handling. Handle an empty version from a version script.
11607 (Symbol_table::define_special_symbol): Likewise.
11608 * testsuite/ver_test_10.script: New file.
11609 * testsuite/ver_test_10.sh: New file.
11610 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11611 (check_DATA): Add ver_test_10.syms.
11612 (ver_test_10.syms, ver_test_10.so): New target.
11613 * testsuite/Makefile.in: Rebuild.
11614
58e54ac2
CD
116152008-07-23 Simon Baldwin <simonb@google.com>
11616
11617 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11618 to zero for undefined symbols from dynamic libraries.
11619
95d14cd3
ILT
116202008-07-23 Ian Lance Taylor <iant@google.com>
11621
11622 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11623 Change all callers.
11624 * symtab.h (class Symbol_table): Update declaration.
11625 * testsuite/ver_test_9.cc: New file.
11626 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11627 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11628 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11629 (ver_test_9.so, ver_test_9.o): New targets.
11630 * testsuite/Makefile.in: Rebuild.
11631
92de84a6
ILT
116322008-07-22 Ian Lance Taylor <iant@google.com>
11633
34810851
ILT
11634 * options.h (class General_options): Define --check-sections.
11635 * layout.cc (Layout::set_segment_offsets): Handle
11636 --check-sections.
11637
af6156ef
ILT
11638 * options.h (class General_options): Define -n/--nmagic and
11639 -N/--omagic.
11640 * options.cc (General_options::finalize): For -n/--nmagic or
11641 -N/--omagic, set -static.
11642 * layout.cc (Layout::attach_allocated_section_to_segment): If
11643 -N/--omagic, don't put read-only and read-write sections in
11644 different segments.
11645 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11646 finding a read-only segment.
11647 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11648 don't set the minimum segment alignment to the common page size,
11649 and don't set the file offset to the address modulo the page size.
11650 * script-sections.cc (Script_sections::create_segments): If
11651 -n/--omagic, don't put read-only and read-write sections in
11652 different segments.
11653
92de84a6
ILT
11654 * cref.cc: New file.
11655 * cref.h: New file.
11656 * options.h (class General_options): Add --print-symbol-counts.
11657 * main.cc (main): Issue defined symbol report if requested.
11658 * archive.cc (Archive::interpret_header): Make into a const member
11659 function.
11660 (Archive::add_symbols): Call Input_objects::archive_start and
11661 archive_stop.
11662 (Archive::const_iterator): Define new class.
11663 (Archive::begin, Archive::end): New functions.
11664 (Archive::include_all_members): Rewrite to use iterator.
11665 (Archive::count_members): New function.
11666 * archive.h (class Archive): Update declarations.
11667 (Archive::filename): New function.
11668 * object.cc: Include "cref.h".
11669 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11670 (Sized_relobj::do_get_global_symbol_counts): New function.
11671 (Input_objects::add_object): Add object to cross-referencer.
11672 (Input_objects::archive_start): New function.
11673 (Input_objects::archive_stop): New function.
11674 (Input_objects::print_symbol_counts): New function.
11675 * object.h: Declare Cref and Archive.
11676 (Object::get_global_symbol_counts): New function.
11677 (Object::do_get_global_symbol_counts): New pure virtual function.
11678 (class Sized_relobj): Add defined_count_ field. Update
11679 declarations.
11680 (class Input_objects): Add cref_ field. Update constructor.
11681 Update declarations.
11682 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11683 defined_count_.
11684 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11685 symbol counts.
11686 (Sized_dynobj::do_get_global_symbol_counts): New function.
11687 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11688 defined_count_. Update declarations. Define Symbols typedef.
11689 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11690 parameter. Change all callers.
11691 (Symbol_table::add_from_dynobj): Add sympointers and defined
11692 parameters. Change all callers.
11693 * symtab.h (class Symbol_table): Update declarations.
11694 * Makefile.am (CCFILES): Add cref.cc.
11695 (HFILES): Add cref.h.
11696 * Makefile.in: Rebuild.
11697
3f7c5e1d
CD
116982008-07-22 Simon Baldwin <simonb@google.com>
11699
11700 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11701 to zero when writing undefined symbols.
11702
e0b64032
ILT
117032008-07-22 Ian Lance Taylor <iant@google.com>
11704
11705 * output.cc (Output_section::add_input_section): Don't try to
11706 merge empty merge sections.
11707
096b02cf
CS
117082008-07-21 Craig Silverstein <csilvers@google.com>
11709
11710 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11711 Include symbol version in error message.
cd536b21 11712
1d1f116d
CD
117132008-07-20 Chris Demetriou <cgd@google.com>
11714
cd536b21 11715 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
11716 (RANDOM_SEED_CFLAGS): New substituted variable.
11717 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11718 * configure: Rebuild.
11719 * Makefile.in: Likewise.
11720 * testsuite/Makefile.in: Likewise.
11721
a18f591e
ILT
117222008-07-18 Ian Lance Taylor <iant@google.com>
11723
11724 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11725 where we see NAME/NULL and NAME/VERSION as separate symbols.
11726 * testsuite/ver_test_main.cc (main): Call t4.
11727 (t4, t4_2a): Define.
11728 * testsuite/ver_test_2.cc (t4_2): Define.
11729 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11730 * testsuite/ver_test_4.cc (t4_2a): Define.
11731 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11732 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11733
c6e3f6ed
ILT
117342008-07-17 Ian Lance Taylor <iant@google.com>
11735
11736 * dynobj.cc (Versions::add_def): If we give an error about a
11737 missing version, go ahead and create the version anyhow.
11738
ef9beddf
ILT
117392008-07-10 Ian Lance Taylor <iant@google.com>
11740
11741 Handle output sections with more than 0x7fffffff bytes.
11742 * object.h (class Relobj): Change map_to_output_ to
11743 output_sections_, and just keep a section pointer. Change all
11744 uses. Move comdat group support to Sized_relobj.
11745 (Relobj::is_section_specially_mapped): Remove.
11746 (Relobj::output_section): Remove poff parameter. Change all
11747 callers.
11748 (Relobj::output_section_offset): New function.
11749 (Relobj::set_section_offset): Rewrite.
11750 (Relobj::map_to_output): Remove.
11751 (Relobj::output_sections): New function.
11752 (Relobj::do_output_section_offset): New pure virtual function.
11753 (Relobj::do_set_section_offset): Likewise.
11754 (class Sized_relobj): Add section_offsets_ field. Add comdat
11755 group support from Relobj. Update declarations.
11756 (Sized_relobj::get_output_section_offset): New function.
11757 (Sized_relobj::do_output_section_offset): New function.
11758 (Sized_relobj::do_set_section_offset): New function.
11759 * object.cc (Relobj::output_section_address): Remove.
11760 (Sized_relobj::Sized_relobj): Initialize new fields.
11761 (Sized_relobj::include_section_group): Cast find_kept_object to
11762 Sized_relobj.
11763 (Sized_relobj::include_linkonce_section): Likewise.
11764 (Sized_relobj::do_layout): Use separate arrays for output section
11765 and output offset.
11766 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11767 output_sections.
11768 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11769 output_sections and section_offsets.
11770 (Sized_relobj::write_local_symbols): Likewise.
11771 (map_to_kept_section): Compute output address directly.
11772 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11773 output_sections and section_offsets.
11774 (Sized_relobj::write_sections): Likewise.
11775 (Sized_relobj::relocate_sections): Likewise.
11776 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11777 * output.h (class Output_reloc): Update declarations. Change
11778 u2_.relobj to Sized_relobj*.
11779 (class Output_data_reloc): Change add functions to use
11780 Sized_relobj*.
11781 * output.cc (Output_reloc::Output_reloc): Change relobj to
11782 Sized_relobj*.
11783 (Output_reloc::local_section_offset): Change return type to
11784 Elf_Addr. Use get_output_section_offset.
11785 (Output_reloc::get_address): Likewise.
11786 (Output_section::is_input_address_mapped): Don't call
11787 is_section_specially_mapped.
11788 (Output_section::output_offset): Likewise.
11789 (Output_section::output_address): Likewise.
11790 (Output_section::starting_output_address): Likewise.
11791 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11792 parameter to Sized_relobj*.
11793 (Copy_relocs::need_copy_reloc): Likewise.
11794 (Copy_relocs::save): Likewise.
11795 * copy-relocs.h (class Copy_relocs): Update declarations.
11796 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11797 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11798 * target-reloc.h (relocate_for_relocatable): Change
11799 offset_in_output_section type to Elf_Addr. Change code that uses
11800 it as well.
11801 * layout.cc (Layout::layout): Always set *off.
11802 * mapfile.cc (Mapfile::print_input_section): Use
11803 output_section_offset.
11804 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11805 Sized_relobj*.
11806 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11807 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11808 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11809
5cb66f97
ILT
118102008-07-03 Ian Lance Taylor <iant@google.com>
11811
11812 * layout.cc (Layout::include_section): Do not discard unrecognized
11813 SHT_STRTAB sections.
11814
afe47622
CS
118152008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11816
11817 * script.cc (Lex::can_continue_name): Make '?' allowable in
11818 version-script names.
11819 * testsuite/version_script.map: Change glob pattern to use '?'
11820
5adf9721
ILT
118212008-06-30 Manish Singh <yosh@gimp.org>
11822
11823 PR 6585
11824 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11825 Correct typo.
11826
e6fde208
ILT
118272008-06-30 Ian Lance Taylor <iant@google.com>
11828
11829 PR 6660
11830 PR 6682
11831 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11832 versions]: Don't try to read the value in the contents, since we
11833 don't use it. Use the template endianness when writing.
11834
3f2e6a2d
CC
118352008-06-25 Cary Coutant <ccoutant@google.com>
11836
11837 * fileread.cc (File_read::make_view): Assert on zero-length view.
11838 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11839 symbol table when there are no symbols to read.
11840
c43d3a48
CS
118412008-06-23 Craig Silverstein <csilvers@google.com>
11842
11843 * version.cc (version_string): Bump to 1.7
11844
5f494ea0
CS
118452008-06-18 Craig Silverstein <csilvers@google.com>
11846
11847 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11848 constant 0xFFFF to type Valtype.
11849 (Powerpc_relocate_functions::rel16_ha): Likewise.
11850
c42e122e
ILT
118512008-06-17 Ian Lance Taylor <iant@google.com>
11852
f34787f8
ILT
11853 * output.h (Output_section::Input_section): Initialize p2align_ to
11854 zero for Output_section_data constructors.
11855 (Output_section::Input_section::addralign): If not an input
11856 section, return the alignment of the Output_section_data.
11857 * testsuite/copy_test.cc: New file.
11858 * testsuite/copy_test_1.cc: New file.
11859 * testsuite/copy_test_2.cc: New file.
11860 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11861 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11862 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11863 (copy_test_1_pic.o, copy_test_1.so): New targets.
11864 (copy_test_2_pic.o, copy_test_2.so): New targets.
11865 * testsuite/Makefile.in: Rebuild.
11866
c42e122e
ILT
11867 * script-sections.cc (Script_sections::place_orphan): Initialize
11868 local variable exact.
11869
ce3ac18a
DE
118702008-06-13 David Edelsohn <edelsohn@gnu.org>
11871
11872 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11873
42cacb20
DE
118742008-06-12 David Edelsohn <edelsohn@gnu.org>
11875 David S. Miller <davem@davemloft.net>
11876
11877 * powerpc.cc: New file.
11878 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11879 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11880 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11881 * Makefile.in: Rebuild.
11882
7b308235
ILT
118832008-06-09 Ian Lance Taylor <iant@google.com>
11884
11885 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11886 <exception>.
11887 (throwing, orig_terminate): New static variables.
11888 (terminate_handler): New static function.
11889 (t2): Set terminate handler.
11890
f0b886e3
ILT
118912008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11892
11893 PR 6584
cd536b21 11894 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
11895 alignment.
11896
3e90f135
CC
118972008-05-30 Cary Coutant <ccoutant@google.com>
11898
11899 * archive.cc (Archive::include_all_members) Correct to step
11900 over symbol table and extended name table in thin archives.
11901
e09ad04a
ILT
119022008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11903
11904 PR 6407
11905 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11906 calculation.
11907
62b01cb5
ILT
119082008-05-28 Caleb Howe <cshowe@google.com>
11909
11910 * reduced_debug_output.cc: New file.
11911 * reduced_debug_output.h: New file.
92de84a6 11912 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
11913 * options.cc (General_options::finalize): Add strip_debug_non_line
11914 to the strip heirarchy.
11915 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11916 fields.
11917 * layout.cc: Include "reduced_debug_output.h".
11918 (Layout::Layout): Initialize new fields.
11919 (line_only_debug_sections): New static array.
11920 (is_lines_only_debug_sections): New static inline function.
11921 (Layout::include_section): Handle --strip-debug-non-line.
11922 (Layout::make_output_section): If --strip-debug-non-line, build
11923 new output sections for .debug_abbrev and .debug_info.
11924 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11925 gold. Warn about possible overflow.
11926 (read_signed_LEB_128): Likewise.
11927 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11928 (read_signed_LEB_128): Declare.
11929 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11930 (HFILES): Add reduced_debug_output.h.
11931 * Makefile.in: Rebuild.
11932
7d9e3d98
ILT
119332008-05-21 Ian Lance Taylor <iant@google.com>
11934
11935 * mapfile.cc: New file.
11936 * mapfile.h: New file.
11937 * options.h (class General_options): Add -M/--print-map and -Map.
11938 * options.cc (General_options::finalize): Make -M equivalent to
11939 -Map -.
11940 * main.cc: Include <cstdio> and "mapfile.h".
11941 (main): Open mapfile if requested.
11942 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11943 constructor. Change caller.
11944 (queue_initial_tasks): Add mapfile parameter. Change caller.
11945 (queue_middle_tasks): Likewise.
11946 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11947 declarations.
11948 * archive.cc: Include "mapfile.h".
11949 (Archive::add_symbols): Add mapfile parameter. Change all
11950 callers. Pass mapfile, symbol, and reason to include_member.
11951 (Archive::include_all_members): Add mapfile parameter. Change all
11952 callers.
11953 (Archive::include_member): Add mapfile, sym, and why parameters.
11954 Change all callers. Report inclusion to map file.
11955 * archive.h: Include "fileread.h".
11956 (class Archive): Update declarations.
11957 (Archive::file): New const method.
11958 (class Add_archive_symbols): Add mapfile_ field. Update
11959 constructor. Change all callers.
11960 * readsyms.h (class Read_symbols): Likewise.
11961 (class Finish_group): Likewise.
11962 (class Read_script): Likewise.
11963 * common.cc: Include "mapfile.h".
11964 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11965 all callers.
11966 (Symbol_table::do_allocate_commons): Likewise.
11967 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11968 symbol allocation to mapfile.
11969 * common.h (class Allocate_commons_task): Add mapfile_ field.
11970 Update constructor. Change all callers.
11971 * symtab.h (class Symbol_table): Update declarations.
11972 * layout.cc: Include "mapfile.h".
11973 (Layout_task_runner::run): Print information to mapfile.
11974 (Layout::create_gold_note): Change Output_data_fixed_space to
11975 Output_data_zero_fill.
11976 (Layout::create_build_id): Likewise.
11977 (Layout::print_to_mapfile): New function.
11978 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11979 constructor. Change caller.
11980 (class Layout): Declare print_to_mapfile.
11981 * output.cc (Output_section::Input_section::print_to_mapfile): New
11982 function.
11983 (Output_section::add_input_section): If producing a map, always
11984 add to input_sections_ list.
11985 (Output_section::do_print_to_mapfile): New function.
11986 (Output_segment::print_sections_to_mapfile): New function.
11987 (Output_segment::print_section_list_to_mapfile): New function.
11988 * output.h: Include "mapfile.h".
11989 (Output_data::print_to_mapfile): New function.
11990 (Output_data::do_print_to_mapfile): New virtual function.
11991 (Output_segment_headers::do_print_to_mapfile): New function.
11992 (Output_file_header::do_print_to_mapfile): New function.
11993 (Output_data_const::do_print_to_mapfile): New function.
11994 (class Output_data_const_buffer): Add map_name_ field. Update
11995 constructor. Change all callers. Add do_print_to_mapfile
11996 function.
11997 (class Output_data_fixed_space): Likewise.
11998 (class Output_data_space): Likewise.
11999 (class Output_data_zero_fill): New class.
12000 (Output_data_strtab::do_print_to_mapfile): New function.
12001 (Output_data_reloc_base::do_print_to_mapfile): New function.
12002 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12003 (Output_data_group::do_print_to_mapfile): New function.
12004 (Output_data_got::do_print_to_mapfile): New function.
12005 (Output_data_dynamic::do_print_to_mapfile): New function.
12006 (Output_symtab_xindex::do_print_to_mapfile): New function.
12007 (class Output_section): Declare do_print_to_mapflie. Declare
12008 print_to_mapfile in Input_section.
12009 (class Output_segment): Declare new functions.
12010 * object.h (Sized_relobj::symbol_count): New function.
12011 * script-sections.cc
12012 (Output_section_element_dot_assignment::set_section_addresses):
12013 Change Output_data_fixed_space to Output_data_zero_fill.
12014 (Output_data_expression::do_print_to_mapfile): New function.
12015 * script.cc (read_input_script): Add mapfile parameter. Change
12016 all callers.
12017 * script.h (read_input_script): Update declaration.
12018 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
12019 (Eh_frame::do_print_to_mapfile): New function.
12020 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
12021 (Output_merge_string::do_print_to_mapfile): New function.
12022 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
12023 function.
12024 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
12025 function.
12026 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
12027 function.
12028 * Makefile.am (CCFILES): Add mapfile.cc.
12029 (HFILES): Add mapfile.h.
12030 * Makefile.in: Rebuild.
12031
9f1d377b
ILT
120322008-05-19 Ian Lance Taylor <iant@google.com>
12033
12034 * options.h (class General_options): Add -z relro.
12035 * layout.cc (Layout::Layout): Initialize relro_segment_.
12036 (Layout::add_output_section_data): Return the output section.
12037 (Layout::make_output_section): Rcognize relro sections and mark
12038 them appropriately.
12039 (Layout::attach_allocated_section_to_segment): Put relro sections
12040 in a PT_GNU_RELRO segment.
12041 (Layout::create_initial_dynamic_sections): Mark the .dynamic
12042 section as relro.
12043 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
12044 PT_TLS segments.
12045 (Layout::linkonce_mapping): Map d.rel.ro.local to
12046 .data.rel.ro.local.
12047 (Layout::output_section_name): Us .data.rel.ro.local for any
12048 section which begins with that.
12049 * layout.h (class Layout): Update add_output_section_data
12050 declaration. Add relro_segment_ field.
12051 * output.cc (Output_section::Output_section): Initialize is_relro_
12052 and is_relro_local_ fields.
12053 (Output_segment::add_output_section): Group relro sections.
12054 (Output_segment::is_first_section_relro): New function.
12055 (Output_segment::maximum_alignment): If there is a relro section,
12056 align the segment to the common page size.
12057 (Output_segment::set_section_addresses): Track whether we are
12058 looking at relro sections. If the last section is a relro
12059 section, align to the common page size.
12060 (Output_segment::set_section_list_addresses): Add in_relro
12061 parameter. Change all callers. Align to the page size when
12062 moving from relro to non-relro section.
12063 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
12064 segment.
12065 * output.h (class Output_section): Add is_relro_ and
12066 is_relro_local_ fields.
12067 (Output_section::is_relro): New function.
12068 (Output_section::set_is_relro): New function.
12069 (Output_section::is_relro_local): New function.
12070 (Output_section::set_is_relro_local): New function.
12071 (class Output_segment): Update declarations.
12072 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12073 * sparc.cc (Target_sparc::got_section): Likewise.
12074 * x86_64.cc (Target_x86_64::got_section): Likewise.
12075 * testsuite/relro_test_main.cc: New file.
12076 * testsuite/relro_test.cc: New file.
12077 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12078 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12079 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12080 (relro_test.so, relro_test_pic.o): New targets.
12081 * testsuite/Makefile.in: Rebuild.
12082
a984ee1d
ILT
120832008-05-16 Ian Lance Taylor <iant@google.com>
12084
01676dcd
ILT
12085 * output.cc (Output_segment::add_output_section): Remove front
12086 parameter.
12087 * output.h (class Output_segment): Remove
12088 add_initial_output_section and overloaded add_output_section.
12089 Update declaration of remaining add_output_section.
12090 * layout.cc (Layout::create_interp): Call add_output_section
12091 rather than add_initial_output_section.
12092 (Layout::finish_dynamic_section): Likewise.
12093
497897f9
ILT
12094 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12095 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12096 know the dynamic type.
12097 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12098 field. Initialize it in constructor.
12099 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12100 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12101 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12102 reloc.
12103
a984ee1d
ILT
12104 * output.cc (Output_reloc::get_address): Change return type to
12105 Elf_Addr.
12106 * output.h (class Output_reloc): Update get_address declaration.
12107 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12108 for section addresses.
12109
55ba0940
ILT
121102008-05-09 Ian Lance Taylor <iant@google.com>
12111
12112 PR 6493
12113 * gold.cc (gold_nomem): Use return value of write.
12114
75517b77
ILT
121152008-05-08 Ian Lance Taylor <iant@google.com>
12116
12117 * symtab.c (Symbol::init_base_output_data): Add version
12118 parameter. Change all callers.
12119 (Symbol::init_base_output_segment): Likewise.
12120 (Symbol::init_base_constant): Likewise.
12121 (Symbol::init_base_undefined): Likewise.
12122 (Sized_symbol::init_output_data): Likewise.
12123 (Sized_symbol::init_output_segment): Likewise.
12124 (Sized_symbol::init_constant): Likewise.
12125 (Sized_symbol::init_undefined): Likewise.
12126 (Symbol_table::do_define_in_output_data): If the new symbol has a
12127 version, mark it as the default.
12128 (Symbol_table::do_define_in_output_segment): Likewise.
12129 (Symbol_table::do_define_as_constant): Likewise.
12130 * symtab.h (class Symbol): Update declarations.
12131 (class Sized_symbol): Likewise.
12132 * resolve.cc (Symbol::override_version): New function.
c42e122e 12133 (Symbol::override_base): Call override_version.
75517b77
ILT
12134 (Symbol::override_base_with_special): Likewise.
12135 * testsuite/ver_script_8.script: New file.
12136 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12137 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12138 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12139 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12140
f1f70eae
ILT
121412008-05-06 Ian Lance Taylor <iant@google.com>
12142
f3e9c5c5
ILT
12143 PR 6049
12144 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12145 functions.
12146 (class General_options): Remove existing --undefined, and add
12147 --no-undefined instead. Add new --undefined as synonym for -u.
12148 * archive.cc (Archive::add_symbols): Check whether symbol was
12149 named with -u.
12150 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12151 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12152 all uses. Add IS_UNDEFINED. Update declarations to split
12153 different versions of init_base. Declare init_base_undefined.
12154 (Symbol::is_defined): Handle IS_UNDEFINED.
12155 (Symbol::is_undefined): Likewise.
12156 (Symbol::is_weak_undefined): Call is_undefined.
12157 (Symbol::is_absolute): Handle IS_CONSTANT.
12158 (class Sized_symbol): Update declarations to split different
12159 versions of init. Declare init_undefined.
12160 (class Symbol_table): Declare new functions.
12161 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12162 Change all callers.
12163 (Symbol::init_base_output_data): Likewise.
12164 (Symbol::init_base_output_segment): Likewise.
12165 (Symbol::init_base_constant): Likewise.
12166 (Symbol::init_base_undefined): New function.
12167 (Sized_symbol::init_object): Rename from init. Change all
12168 callers.
12169 (Sized_symbol::init_output_data): Likewise.
12170 (Sized_symbol::init_output_segment): Likewise.
12171 (Sized_symbol::init_constant): Likewise.
12172 (Sized_symbol::init_undefined): New function.
12173 (Symbol_table::add_undefined_symbols_from_command_line): New
12174 function.
12175 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12176 function.
12177 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12178 (Symbol::output_section): Likewise.
12179 (Symbol::set_output_section): Likewise.
12180 (Symbol_table::sized_finalize_symbol): Likewise.
12181 (Symbol_table::sized_write_globals): Likewise.
12182 * resolve.cc (Symbol_table::should_override): Likewise.
12183 (Symbol::override_base_with_special): Likewise.
12184
8bdcdf2c
ILT
12185 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12186 symbol, change it to have default visibility.
12187 * testsuite/protected_1.cc: New file.
12188 * testsuite/protected_2.cc: New file.
12189 * testsuite/protected_3.cc: New file.
12190 * testsuite/protected_main_1.cc: New file.
12191 * testsuite/protected_main_2.cc: New file.
12192 * testsuite/protected_main_3.cc: New file.
12193 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12194 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12195 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12196 (protected_1.so): New target.
12197 (protected_1_pic.o, protected_2_pic.o): New targets.
12198 (protected_3_pic.o): New target.
12199 (check_PROGRAMS): Add protected_2.
12200 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12201 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12202 * testsuite/Makefile.in: Rebuild.
12203
2b706932
ILT
12204 * options.h (DEFINE_var): Add set_user_set_##varname__.
12205 (DEFINE_bool_alias): New macro.
12206 (class General_options): Define -Bstatic using DEFINE_bool_alias
12207 rather than DEFINE_special. Add --undefined as an alias for -z
12208 defs.
12209 * options.cc (General_options::parse_Bstatic): Remove.
12210
d82a5bcc
ILT
12211 * options.h (class General_options): Add --fatal-warnings.
12212 * main.cc (main): Implement --fatal-warnings.
12213 * errors.h (Errors::warning_count): New function.
12214
f1f70eae
ILT
12215 * options.h (class General_options): Add -Bsymbolic-functions.
12216 * symtab.h (Symbol::is_preemptible): Check for
12217 -Bsymbolic-functions.
12218
8825ac63
ILT
122192008-05-05 Ian Lance Taylor <iant@google.com>
12220
d98bc257
ILT
12221 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12222 as noVARNAME rather than no-VARNAME.
12223 (class General_options): Add option -z combreloc.
12224 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12225 get_address.
12226 (Output_reloc::sort_before) [SHT_REL]: New function.
12227 (Output_reloc::sort_before) [SHT_RELA]: New function.
12228 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12229 Sort_relocs_comparison.
12230 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12231 parameter. Change all callers.
12232 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12233 sort_relocs parameter. Change all callers.
12234 * output.cc (Output_reloc::get_address): New function, broken out
12235 of write_rel.
12236 (Output_reloc::write_rel): Call it.
12237 (Output_reloc::compare): New function.
12238 (Output_data_reloc_base::do_write): Optionally sort relocs.
12239
60b2b4e7
ILT
12240 * configure.ac: If targ_extra_obj is set, link it in.
12241 * configure.tgt: Initialize all variables.
12242 (x86_64*): Set targ_extra_obj and targ_extra_size.
12243 * configure: Rebuild.
12244
8825ac63
ILT
12245 * object.cc (Sized_relobj::include_section_group): Adjust section
12246 indexes read from group data. Build vector to pass to
12247 layout_group.
12248 * layout.cc (Layout::layout_group): Add flags and shndxes
12249 parameters. Remove contents parameter. Change caller. Update
12250 explicit instantiations.
12251 * layout.h (class Layout): Update layout_group declaration.
12252 * output.cc (Output_data_group::Output_data_group): Add flags and
12253 input_shndxes parameters. Remove contents parameter. Change
12254 caller.
12255 (Output_data_group::do_write): Change input_sections_ to
12256 input_shndxes_.
12257 * output.h (class Output_data_group): Update constructor
12258 declaration. Rename input_sections_ to input_shndxes_.
12259 * testsuite/many_sections_test.cc: Add template.
12260
e94cf127
CC
122612008-04-30 Cary Coutant <ccoutant@google.com>
12262
4418b2d5
CC
12263 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12264
e94cf127
CC
12265 * layout.cc (Layout::include_section): Refactored check for debug
12266 info section.
12267 (Layout::add_comdat): Add new parameters. Change type
12268 of signature parameter. Add object and shndx to signatures table.
12269 (Layout::find_kept_object): New function.
12270 * layout.h: Include <cstring>.
12271 (Layout::is_debug_info_section): New function.
12272 (Layout::add_comdat): Add new parameters.
12273 (Layout::find_kept_object): New function.
12274 (Layout::Kept_section): New struct.
12275 (Layout::Signatures): Change type of map range.
12276 * object.cc (Relobj::output_section_address): New function.
12277 (Sized_relobj::include_section_group): Add new parameters. Change
12278 calls to Layout::add_comdat. Change to build table of kept comdat
12279 groups and table mapping discarded sections to kept sections.
12280 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12281 (Sized_relobj::do_layout): Change calls to include_section_group and
12282 include_linkonce_section.
12283 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12284 value to zero when section is discarded.
12285 (Sized_relobj::map_to_kept_section): New function.
12286 * object.h (Relobj::output_section_address): New function.
12287 (Relobj::Comdat_group): New type.
12288 (Relobj::find_comdat_group): New function.
12289 (Relobj::Comdat_group_table): New type.
12290 (Relobj::Kept_comdat_section): New type.
12291 (Relobj::Kept_comdat_section_table): New type.
12292 (Relobj::add_comdat_group): New function.
12293 (Relobj::set_kept_comdat_section): New function.
12294 (Relobj::get_kept_comdat_section): New function.
12295 (Relobj::comdat_groups_): New field.
12296 (Relobj::kept_comdat_sections_): New field.
12297 (Symbol_value::input_value): Update comment.
12298 (Sized_relobj::map_to_kept_section) New function.
12299 (Sized_relobj::include_linkonce_section): Add new parameter.
12300 * target-reloc.h (Comdat_behavior): New type.
12301 (get_comdat_behavior): New function.
12302 (relocate_section): Add code to map a discarded section to the
12303 corresponding kept section when applying a relocation.
12304
e4e5049b
CS
123052008-04-30 Craig Silverstein <csilvers@google.com>
12306
12307 * dwarf_reader.cc (next_generation_count): New static var.
12308 (Addr2line_cache_entry): New struct.
12309 (addr2line_cache): New static var.
12310 (Dwarf_line_info::one_addr2line): Added caching.
12311 (Dwarf_line_info::clear_addr2line_cache): New function.
12312 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12313 cache-size parameter.
12314 (Dwarf_line_info::one_addr2line_cache): New function.
12315 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12316 new cache-size argument to one_addr2line(), and clear cache.
12317
d09e9154
CC
123182008-04-28 Cary Coutant <ccoutant@google.com>
12319
12320 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12321 R_386_PC8 relocations.
12322
7ef73768
ILT
123232008-04-23 Ian Lance Taylor <iant@google.com>
12324
55438702
ILT
12325 * object.cc (Sized_relobj::include_section_group): Check for
12326 invalid section group.
12327
c165fb93
ILT
12328 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12329 header size.
12330
7ef73768
ILT
12331 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12332 than read for file header.
12333 * archive.cc (Archive::include_member): Likewise.
12334
6194aaab
L
123352008-04-23 Paolo Bonzini <bonzini@gnu.org>
12336
12337 * aclocal.m4: Regenerate.
12338 * configure: Regenerate.
12339
d491d34e
ILT
123402008-04-19 Ian Lance Taylor <iant@google.com>
12341
5ea2bac6
ILT
12342 * version.cc (version_string): Bump to 1.6.
12343
7bc3e21a
ILT
12344 * testsuite/Makefile.am (many_sections_r_test): New target.
12345 (many_sections_r_test_SOURCES): Remove.
12346 (many_sections_r_test_DEPENDENCIES): Remove.
12347 (many_sections_r_test_LDFLAGS): Remove.
12348 (many_sections_r_test_LDADD): Remove.
12349
7fcd3aa9
ILT
12350 * object.cc (Sized_relobj::do_add_symbols): Always pass
12351 local_symbol_count_ to add_from_relobj.
12352
4c94d6ae
ILT
12353 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12354 every thousand variables.
12355 * testsuite/Makefile.in: Rebuild.
12356
d491d34e
ILT
12357 * object.cc (Xindex::initialize_symtab_xindex): New function.
12358 (Xindex::read_symtab_xindex): New function.
12359 (Xindex::sym_xindex_to_shndx): New function.
12360 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12361 available.
12362 (Sized_relobj::do_initialize_xindex): New function.
12363 (Sized_relobj::do_read_symbols): Adjust section links.
12364 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12365 parameter. Change all callers.
12366 (Sized_relobj::include_section_group): Adjust section links and
12367 symbol section indexes.
12368 (Sized_relobj::do_layout): Adjust section links.
12369 (Sized_relobj::do_count_local_symbols): Adjust section links and
12370 symbol section indexes.
12371 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12372 ordinary and special symbols.
12373 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12374 dynsym_xindex parameters. Change all callers. Adjust section
12375 links. Use SHN_XINDEX when needed.
12376 (Sized_relobj::get_symbol_location_info): Adjust section links.
12377 Don't get fooled by special symbols.
12378 * object.h (class Xindex): Define.
12379 (class Object): Add xindex_ parameter. Declare virtual functoin
12380 do_initialize_xindex.
12381 (Object::adjust_sym_shndx): New function.
12382 (Object::set_xindex): New protected function.
12383 (class Symbol_value): Add is_ordinary_shndx_ field.
12384 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12385 (Symbol_value::value): Assert ordinary section.
12386 (Symbol_value::initialize_input_to_output_map): Likewise.
12387 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12388 Change all callers.
12389 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12390 all callers.
12391 (class Sized_relobj): Update declarations.
12392 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12393 parameter. Change all callers.
12394 (Sized_relobj::adjust_shndx): New function.
12395 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12396 field.
12397 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12398 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12399 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12400 (Sized_dynobj::read_dynsym_section): Adjust section links.
12401 (Sized_dynobj::read_dynamic): Likewise.
12402 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12403 section links.
12404 (Sized_dynobj::do_initialize_xindex): New function.
12405 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12406 do_initialize_xindex.
12407 (Sized_dynobj::adjust_shndx): New function.
12408 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12409 dynsym_xindex_ fields.
12410 (Layout::finalize): Add a call to set_section_indexes before
12411 creating the symtab sections.
12412 (Layout::set_section_indexes): Don't do anything if the section
12413 already has a section index.
12414 (Layout::create_symtab_sections): Add shnum parameter. Change
12415 caller. Create .symtab_shndx section if needed.
12416 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12417 caller.
12418 (Layout::allocated_output_section_count): New function.
12419 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12420 needed.
12421 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12422 fields. Update declarations.
12423 (Layout::symtab_xindex): New function.
12424 (Layout::dynsym_xindex): New function.
12425 (class Write_symbols_task): Add layout_ field.
12426 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12427 Change caller.
12428 * output.cc (Output_section_headers::Output_section_headers): Add
12429 shstrtab_section parameter. Change all callers.
12430 (Output_section_headers::do_sized_write): Store overflow values
12431 for section count and section string table section index in
12432 section header zero.
12433 (Output_file_header::do_sized_write): Check for overflow of
12434 section count and section string table section index.
12435 (Output_symtab_xindex::do_write): New function.
12436 (Output_symtab_xindex::endian_do_write): New function.
12437 * output.h (class Output_section_headers): Add shstrtab_section_.
12438 Update declarations.
12439 (class Output_symtab_xindex): Define.
12440 (Output_section::has_out_shndx): New function.
12441 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12442 field.
12443 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12444 Change all callers.
12445 (Sized_symbol::init): Likewise.
12446 (Symbol::output_section): Check for ordinary symbol.
12447 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12448 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12449 callers.
12450 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12451 Change all callers. Simplify handling of symbols from sections
12452 not included in the link.
12453 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12454 distinction.
12455 (Weak_alias_sorter::operator()): Assert that symbols are
12456 ordinary.
12457 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12458 distinction.
12459 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12460 parameters. Change all callers.
12461 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12462 symbol distinction. Use SHN_XINDEX when needed.
12463 (Symbol_table::write_section_symbol): Add symtab_xindex
12464 parameter. Change all callers.
12465 (Symbol_table::sized_write_section_symbol): Likewise. Use
12466 SHN_XINDEX when needed.
12467 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12468 declarations.
12469 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12470 (Symbol::is_defined): Check is_ordinary.
12471 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12472 (Symbol::is_absolute, Symbol::is_common): Likewise.
12473 (class Sized_symbol): Update declarations.
12474 (class Symbol_table): Update declarations.
12475 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12476 parameters. Change all callers.
12477 (Sized_symbol::override): Likewise.
12478 (Symbol_table::override): Likewise.
12479 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12480 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12481 is_ordinary, and orig_st_shndx parameters. Change all callers.
12482 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12483 to be in an ordinary section.
12484 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12485 object and is_ordinary parameters. Change all callers.
12486 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12487 Change all callers. Don't add undefined or non-ordinary symbols
12488 to reloc_map_.
12489 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12490 Change all callers.
12491 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12492 declarations.
12493 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12494 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12495 (Sized_relobj::relocate_sections): Likewise.
12496 * target-reloc.h (scan_relocs): Adjust section symbol index.
12497 (scan_relocatable_relocs): Likewise.
12498 * i386.cc (Scan::local): Check for ordinary symbols.
12499 * sparc.cc (Scan::local): Likewise.
12500 * x86_64.cc (Scan::local): Likewise.
12501 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12502 to symbol_section_and_value.
12503 * testsuite/many_sections_test.cc: New file.
12504 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12505 (check_PROGRAMS): Add many_sections_test.
12506 (many_sections_test_SOURCES): Define.
12507 (many_sections_test_DEPENDENCIES): Define.
12508 (many_sections_test_LDFLAGS): Define.
12509 (BUILT_SOURCES): Add many_sections_define.h.
12510 (many_sections_define.h): New target.
12511 (BUILT_SOURCES): Add many_sections_check.h.
12512 (many_sections_check.h): New target.
12513 (check_PROGRAMS): Add many_sections_r_test.
12514 (many_sections_r_test_SOURCES): Define.
12515 (many_sections_r_test_DEPENDENCIES): Define.
12516 (many_sections_r_test_LDFLAGS): Define.
12517 (many_sections_r_test_LDADD): Define.
12518 (many_sections_r_test.o): New target.
12519 * testsuite/Makefile.in: Rebuild.
12520
c5818ff1
CC
125212008-04-17 Cary Coutant <ccoutant@google.com>
12522
12523 * errors.cc (Errors::info): New function.
12524 (gold_info): New function.
12525 * errors.h (Errors::info): New function.
12526 * gold.h (gold_info): New function.
12527 * object.cc (Input_objects::add_object): Print trace output.
12528 * options.cc (options::parse_set): New function.
12529 (General_options::parse_wrap): Deleted.
12530 (General_options::General_options): Deleted initializer.
12531 * options.h (options::String_set): New typedef.
12532 (options::parse_set): New function.
12533 (DEFINE_set): New macro.
12534 (General_options::wrap): Changed to use DEFINE_set. Changed
12535 callers of any_wrap_symbols and is_wrap_symbol.
12536 (General_options::trace, General_options::trace_symbol):
12537 New options.
12538 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12539 (General_options::wrap_symbols_): Deleted.
12540 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12541
b5be4a7c
DM
125422008-04-17 David S. Miller <davem@davemloft.net>
12543
12544 * options.cc (General_options::parse_V): New function.
12545 * options.h: Add entries for -V and -Qy.
12546
155a0dd7
ILT
125472008-04-17 Ian Lance Taylor <iant@google.com>
12548
12549 * common.cc (Symbol_table::allocate_commons): Remove options
12550 parameter. Change caller.
12551 (Symbol_table::do_allocate_commons): Remove options parameter.
12552 Change caller. Just call do_allocate_commons_list twice.
12553 (Symbol_table::do_allocate_commons_list): New function, broken out
12554 of do_allocate_commons.
12555 * common.h (class Allocate_commons_task): Remove options_ field.
12556 Update constructor.
12557 * symtab.cc (Symbol_table::Symbol_table): Initialize
12558 tls_commons_.
12559 (Symbol_table::add_from_object): Put TLS common symbols on
12560 tls_commons_ list.
12561 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12562 which are IN_OUTPUT_DATA.
12563 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12564 allocate_commons and do_allocate_commons declarations. Declare
12565 do_allocate_commons_list.
12566 * gold.cc (queue_middle_tasks): Update creation of
12567 Allocate_commons_task to not pass options.
12568 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12569 (TLS_TEST_C_FLAGS): New variable.
12570 (tls_test_c_pic.o): New target.
12571 (tls_test_shared.so): Link in tls_test_c_pic.o.
12572 (tls_test_c_pic_ie.o): New target.
12573 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12574 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12575 (tls_test_c.o): New target.
12576 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12577 (tls_pic_test_LDADD): Likewise.
12578 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12579 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12580 (tls_test_c_gnu2.o): New target.
12581 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12582 tls_test_c_gnu2.o.
12583 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12584 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12585 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12586 * testsuite/tls_test.cc: Include "config.h".
12587 (t_last): Call t11_last.
12588 * testsuite/tls_test.h (t11, t11_last): Declare.
12589 * testsuite/tls_test_c.c: New file.
12590 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12591 * configure.ac: Check for OpenMP support.
12592 * configure, config.in, Makefile.in: Rebuild.
12593 * testsuite/Makefile.in: Rebuild.
12594
edfbb029
CC
125952008-04-16 Cary Coutant <ccoutant@google.com>
12596
12597 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12598 (Target_i386::tls_base_symbol_defined_): New field.
12599 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12600 (Target_i386::Scan::global): Likewise.
12601 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12602 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12603 (Target_x86_64::tls_base_symbol_defined_): New field.
12604 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12605 (Target_x86_64::Scan::global): Likewise.
12606
f3c69fca
CC
126072008-04-16 Cary Coutant <ccoutant@google.com>
12608
12609 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12610 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12611 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12612 building shared libraries.
12613 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12614 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12615 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12616 * testsuite/Makefile.in: Rebuild.
12617 * testsuite/weak_undef.h: New file.
12618 * testsuite/weak_undef_file1.cc: Add extra test cases.
12619 * testsuite/weak_undef_file2.cc: Likewise.
12620 * testsuite/weak_undef_test.cc: Likewise.
12621
7c414435
DM
126222008-04-16 David S. Miller <davem@davemloft.net>
12623
32b769e1
DM
12624 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12625 Add issued_non_pic_error_ field. Declare check_non_pic.
12626 (Target_sparc::Scan::check_non_pic): New function.
12627 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12628 (Target_sparc::Scan::global): Likewise.
12629
11936fb1
DM
12630 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12631 * configure: Rebuild.
12632
7c414435
DM
12633 * options.h (DEFINE_enable): New macro.
12634 (new_dtags): New enable option.
12635 (initfirst, interpose, loadfltr, nodefaultlib,
12636 nodelete, nodlopen, nodump): New -z options.
12637 * layout.cc (Layout:finish_dynamic_section): If new
12638 dtags enabled, emit DT_RUNPATH. Also, emit a
12639 DT_FLAGS_1 containing any specified -z flags.
12640
85c7bf8b
ILT
126412008-04-16 Ian Lance Taylor <iant@google.com>
12642
12c0daef
ILT
12643 * copy-relocs.cc: New file.
12644 * copy-relocs.h: New file.
12645 * reloc.cc: Remove Copy_relocs code.
12646 * reloc.h: Likewise.
12647 * reloc-types.h (struct Reloc_types) [both versions]: Add
12648 get_reloc_addend_noerror.
12649 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12650 variants of add_global which take an addend which must be zero.
12651 * i386.cc: Include "copy-relocs.h".
12652 (class Target_i386): Change type of copy_relocs_ to variable,
12653 update initializer.
12654 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12655 Change all callers.
12656 (Target_i386::do_finalize_sections): Change handling of
12657 copy_relocs_.
12658 * sparc.cc: Include "copy-relocs.h".
12659 (class Target_sparc): Change type of copy_relocs_ to variable,
12660 update initializer.
12661 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12662 Change all callers.
12663 (Target_sparc::do_finalize_sections): Change handling of
12664 copy_relocs_.
12665 * x86_64.cc: Include "copy-relocs.h".
12666 (class Target_x86_64): Change type of copy_relocs_ to variable,
12667 update initializer.
12668 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12669 class. Change all callers.
12670 (Target_x86_64::do_finalize_sections): Change handling of
12671 copy_relocs_.
12672 * Makefile.am (CCFILES): Add copy-relocs.cc.
12673 (HFILES): Add copy-relocs.h.
12674
4f4995b6
ILT
12675 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12676
85c7bf8b
ILT
12677 * testsuite/script_test_4.sh: Permit leading zeroes.
12678
4f2a9edd
ILT
126792008-04-15 Ian Lance Taylor <iant@google.com>
12680
e6188289
ILT
12681 * script-sections.cc (Script_sections::create_segments): Use
12682 header_size_adjustment even when there is enough room for the
12683 headers.
12684 * testsuite/script_test_4.sh: New file.
12685 * testsuite/script_test_4.t: New file.
12686 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12687 (check_DATA): Add script_test_4.stdout.
12688 (MOSTLYCLEANFILES): Likewise.
12689 (script_test_4): New target.
12690 (script_test_4.stdout): New target.
12691 * testsuite/Makefile.in: Rebuild.
12692
4f2a9edd
ILT
12693 * sparc.cc: Add definitions for Output_data_plt_sparc class
12694 constants.
12695
f5314dd5
DM
126962008-04-14 David S. Miller <davem@davemloft.net>
12697
12698 * sparc.cc: New file.
12699 * Makefile.am (TARGETSOURCES): Add sparc.cc
12700 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12701 * configure.tgt: Document targ_extra_size and
12702 targ_extra_big_endian. Add entries for sparc-* and
12703 sparc64-*.
12704 * configure.ac: Handle targ_extra_size and
12705 targ_extra_big_endian.
12706 * Makefile.in: Rebuild.
12707 * configure: Likewise.
12708 * po/POTFILES.in: Likewise.
12709 * po/gold.pot: Likewise.
12710
154e0e9a
ILT
127112008-04-14 Ian Lance Taylor <iant@google.com>
12712
12713 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12714 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12715 in the name/type/flags to section mapping. Don't call
12716 allocate_output_section.
12717 (Layout::choose_output_section): Change parameter from adjust_name
12718 to is_input_section. Don't permit input sections after sections
12719 are attached to segments. Don't call allocate_output_section.
12720 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12721 not write_enable_output_section.
12722 (Layout::make_output_section): Don't push to
12723 unattached_section_list_ nor call attach_to_segment. Call
12724 attach_section_to_segment if sections are attached.
12725 (Layout::attach_sections_to_segments): New function.
12726 (Layout::attach_section_to_segment): New function.
12727 (Layout::attach_allocated_section_to_segment): Rename from
12728 attach_to_segment. Remove flags parameter.
12729 (Layout::allocate_output_section): Remove function.
12730 (Layout::write_enable_output_section): Remove function.
12731 * layout.h (class Layout): Update for above changes. Add new
12732 field sections_are_attached_.
12733 * output.h (Output_section::update_flags_for_input_section): New
12734 function.
12735 * output.cc (Output_section::add_input_section): Call
12736 update_flags_for_input_section.
12737 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12738
009a67a2
CC
127392008-04-11 Cary Coutant <ccoutant@google.com>
12740
12741 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12742 thought unnecessary.
12743 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12744
759b1a24
ILT
127452008-04-11 Ian Lance Taylor <iant@google.com>
12746
12747 * output.h (class Output_section_data): Remove inline definition
12748 of set_addralign.
12749 * output.cc (Output_section_data::set_addralign): New function.
12750
c2b45e22
CC
127512008-04-11 Cary Coutant <ccoutant@google.com>
12752
12753 Add support for TLS descriptors for i386 and x86_64.
12754 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12755 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12756 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12757 GOT_TYPE_TLS_DESC.
12758 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12759 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12760 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12761 relocations.
12762 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12763 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12764 Fix problem with initial-exec relocations.
12765 (Target_i386::Relocate::relocate_tls): Likewise.
12766 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12767 relaxation.
12768 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12769 support for section-plus-offset dynamic table entries.
12770 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12771 (Output_data_dynamic::Dynamic_entry): Add support for
12772 section-plus-offset dynamic table entries.
12773 (Output_data_dynamic::Classification): Likewise.
12774 (Output_data_dynamic::classification_): Renamed offset_.
12775 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12776 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12777 (Target_x86_64::make_plt_section): New function.
12778 (Target_x86_64::reserve_tlsdesc_entries): New function.
12779 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12780 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12781 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12782 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12783 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12784 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12785 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12786 add extra PLT entry for TLS descriptors.
12787 (Output_data_plt_x86_64::got_): New field.
12788 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12789 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12790 fields.
12791 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12792 descriptors.
12793 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12794 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12795 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12796 R_386_TLS_DESC_CALL relocations.
12797 (Target_x86_64::Scan::global): Likewise.
12798 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12799 for TLS descriptors.
12800 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12801 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12802 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12803 GD-to-IE relaxation.
12804 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12805 and TLS_DESCRIPTORS.
12806 * Makefile.in: Rebuild.
12807 * configure: Rebuild.
12808 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12809 (tls_test_shared2.so): New target.
12810 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12811 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12812 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12813 (tls_shared_gd_to_ie_test_LDADD): New variable.
12814 (tls_shared_gnu2_gd_to_ie_test): New target.
12815 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12816 New targets.
12817 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12818 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12819 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12820 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12821 (tls_shared_gnu2_test): New target.
12822 (tls_test_gnu2_shared.so): New target.
12823 (tls_shared_gnu2_test_SOURCES): New variable.
12824 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12825 (tls_shared_gnu2_test_LDFLAGS): New variable.
12826 (tls_shared_gnu2_test_LDADD): New variable.
12827 * testsuite/Makefile.in: Rebuild.
12828 * testsuite/Makefile.
12829
83bfb6b7
ILT
128302008-04-11 Ian Lance Taylor <iant@google.com>
12831
12832 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12833 justsyms.t.
12834 * testsuite/Makefile.in: Rebuild.
12835
12836 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12837 long.
12838 * testsuite/script_test_2.cc (main): Adjust test.
12839
706e1f5e
ILT
128402008-04-11 David S. Miller <davem@davemloft.net>
12841 Ian Lance Taylor <iant@google.com>
12842
12843 * options.h (General_options): Add entries for '-Y' and
12844 '-relax'.
12845 * options.cc (General_options:finalize): If -Y was used, add those
12846 entries to the library path instead of the default "/lib" and
12847 "/usr/lib".
12848
7c98e6bb
DM
128492008-04-11 David S. Miller <davem@davemloft.net>
12850
12851 * testsuite/justsyms.t: Start at 0x100.
12852 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
12853 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12854 long.
12855 * testsuite/script_test_2.cc: Adjust string and section length
12856 checks.
7c98e6bb 12857
99a37bfd
ILT
128582008-04-09 Ian Lance Taylor <iant@google.com>
12859
2cefc357
ILT
12860 PR gold/5996
12861 * script-sections.cc (Sections_element::allocate_to_segment): Add
12862 orphan parameter.
12863 (Output_section_definition::allocate_to_segment): Likewise.
12864 (Orphan_output_section::allocate_to_segment): Likewise.
12865 (Script_sections::attach_sections_using_phdrs_clause): Don't
12866 propagate non-PT_LOAD segments to orphan sections.
12867 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12868 readelf rather than objdump.
12869 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12870 .interp section and PT_INTERP segment are the same size.
12871 * testsuite/Makefile.in: Rebuild.
12872
99a37bfd
ILT
12873 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12874 aliases for symbols defined in the same object.
12875 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12876 (weak_alias_test_SOURCES): New variable.
12877 (weak_alias_test_DEPENDENCIES): New variable.
12878 (weak_alias_test_LDFLAGS): New variable.
12879 (weak_alias_test_LDADD): New variable.
12880 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12881 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12882 (weak_alias_test_3.o): New target.
12883 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12884 * testsuite/weak_alias_test_main.cc: New file.
12885 * testsuite/weak_alias_test_1.cc: New file.
12886 * testsuite/weak_alias_test_2.cc: New file.
12887 * testsuite/weak_alias_test_3.cc: New file.
12888
780e49c5
ILT
128892008-04-08 Ian Lance Taylor <iant@google.com>
12890
cdb0b8f5
ILT
12891 * options.h (class General_options): Add --noinhibit-exec option.
12892 * main.cc (main): Check --noinhibit-exec.
12893
0864d551
ILT
12894 * options.h (class General_options): Define --wrap as a special
12895 option. Add wrap_symbols_ field.
12896 (General_options::any_wrap_symbols): New function.
12897 (General_options::is_wrap_symbol): New function.
12898 * options.cc (General_options::parse_wrap): New function.
12899 (General_options::General_options): Initialize wrap_symbols_.
12900 * symtab.cc (Symbol_table::wrap_symbol): New function.
12901 (Symbol_table::add_from_object): Handle --wrap.
12902 * symtab.h (class Symbol_table): Declare wrap_symbol.
12903 * target.h (Target::wrap_char): New function.
12904 (Target::Target_info): Add wrap_char field.
12905 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12906 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12907 * testsuite/testfile.cc (Target_test::test_target_info):
12908 Likewise.
12909
789aa6de
ILT
12910 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12911 there is one.
12912
2c38906f
ILT
12913 * layout.h (class Layout): Add added_eh_frame_data_ field.
12914 * layout.cc (Layout::Layout): Initialize new field.
12915 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12916 output section until we find a section we merged successfully.
12917 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12918 that the size be non-zero.
12919
780e49c5
ILT
12920 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12921 qualifier.
12922
7fcd0256
ILT
129232008-04-08 Craig Silverstein <csilvers@google.com>
12924
12925 * configure.ac: Export new conditional variable HAVE_ZLIB.
12926 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12927 on HAVE_ZLIB.
12928 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12929 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12930
6835af53
ILT
129312008-04-07 Ian Lance Taylor <iant@google.com>
12932
e24f324c
ILT
12933 * version.cc (version_string): Set to "1.5".
12934
a036edd8
ILT
12935 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12936 Add issued_non_pic_error_ field. Declare check_non_pic.
12937 (Target_x86_64::Scan::check_non_pic): New function.
12938 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12939 (Target_x86_64::Scan::global): Likewise.
12940
624f8810
ILT
12941 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12942 addend parameter. Change caller. Handle merge sections.
12943 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12944 Address to Addend. Don't add in the result of
12945 local_section_offset, pass down the addend and use the returned
12946 value.
12947 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12948 Update declarations of local_section_offset and symbol_value.
12949 * testsuite/two_file_test_1.cc (t18): New function.
12950 * testsuite/two_file_test_2.cc (f18): New function.
12951 * testsuite/two_file_test_main.cc (main): Call t18.
12952 * testsuite/two_file_test.h (t18, f18): Declare.
12953
6835af53
ILT
12954 * configure.ac: Don't test for objdump, c++filt, or readelf.
12955 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12956 conditionals.
12957 (TEST_READELF): New variable.
12958 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12959 (check_PROGRAMS): Add two_file_strip_test.
12960 (two_file_strip_test): New target.
12961 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12962 (two_file_same_shared_strip_test_SOURCES): New variable.
12963 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12964 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12965 (two_file_same_shared_strip_test_LDADD): New variable.
12966 (two_file_shared_strip.so): New target.
12967 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12968 (ver_test_5.syms, ver_test_7.syms): Likewise.
12969 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12970 (strip_test_3.stdout): Use TEST_OBJDUMP.
12971 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12972
86925eef
CC
129732008-04-04 Cary Coutant <ccoutant@google.com>
12974
12975 * symtab.h (Symbol::is_weak_undefined): New function.
12976 (Symbol::is_strong_undefined): New function.
12977 (Symbol::is_absolute): New function.
12978 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12979 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12980 absolute symbols.
12981 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12982 (weak_undef_test): New target.
12983 * testsuite/Makefile.in: Rebuild.
12984 * testsuite/weak_undef_file1.cc: New file.
12985 * testsuite/weak_undef_file2.cc: New file.
12986 * testsuite/weak_undef_test.cc: New file.
12987
126f3ece
ILT
129882008-04-03 Craig Silverstein <csilvers@google.com>
12989
12990 * compressed_output.h (class Output_compressed_section): Use
12991 unsigned buffer.
12992 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12993 add zlib header.
12994 (zlib_compressed_suffix): Removed.
12995 (Output_compressed_section::set_final_data_size): Use unsigned
12996 buffers.
12997 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12998 Fix linker invocation.
12999 (flagstest_o_specialfile_and_compress_debug_sections):
13000 Likewise.
13001 * testsuite/Makefile.in: Regenerated.
13002
deae2a14
DM
130032008-04-02 David S. Miller <davem@davemloft.net>
13004
13005 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13006 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13007
70752818
ILT
130082008-04-02 Craig Silverstein <csilvers@google.com>
13009
13010 * TODO: New file.
13011
39d0cb0e
ILT
130122008-04-02 Ian Lance Taylor <iant@google.com>
13013
13014 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13015 parameters. Update for new key type to views_. Change all
13016 callers.
13017 (File_read::read): Adjust for byteshift in returned view.
13018 (File_read::add_view): New function, broken out of
13019 find_and_make_view.
13020 (File_read::make_view): New function, broken out of
13021 find_and_make_view.
13022 (File_read::find_or_make_view): Add offset and aligned
13023 parameters. Rewrite accordingly. Change all callers.
13024 (File_read::get_view): Add offset and aligned parameters. Adjust
13025 for byteshift in return value.
13026 (File_read::get_lasting_view): Likewise.
13027 * fileread.h (class File_read): Update declarations.
13028 (class File_read::View): Add byteshift_ field. Add byteshift to
13029 constructor. Add byteshift method.
13030 * archive.h (Archive::clear_uncached_views): New function.
13031 (Archive::get_view): Add aligned parameter. Change all callers.
13032 * object.h (Object::get_view): Add aligned parameter. Change all
13033 callers.
13034 (Object::get_lasting_view): Likewise.
13035
13036 * fileread.cc (File_read::release): Don't call clear_views if
13037 there are multiple objects.
13038 * fileread.h (File_read::clear_uncached_views): New function.
13039 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
13040 on the archive.
13041
a1207466
CC
130422008-03-31 Cary Coutant <ccoutant@google.com>
13043
13044 Add thin archive support.
13045 * archive.cc (Archive::armagt): New const.
13046 (Archive::setup): Remove task parameter and calls to unlock.
13047 (Archive::unlock_nested_archives): New function.
13048 (Archive::read_header): Add nested_off parameter. Change
13049 all callers.
13050 (Archive::interpret_header): Likewise.
13051 (Archive::include_all_members): Change to handle thin
13052 archives.
13053 (Archive::include_member): Likewise.
13054 * archive.h (Archive::Archive): Add new parameters and
13055 initializers.
13056 (Archive::armagt): New const.
13057 (Archive::setup): Remove task parameter.
13058 (Archive::unlock_nested_archives): New function.
13059 (Archive::read_header): Add nested_off parameter.
13060 (Archive::interpret_header): Likewise.
13061 (Archive::Nested_archive_table): New typedef.
13062 (Archive::is_thin_archive_): New field.
13063 (Archive::nested_archives_): New field.
13064 (Archive::options_): New field.
13065 (Archive::dirpath_): New field.
13066 (Archive::task_): New field.
13067 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13068 for thin archives. Pass additional parameters to
13069 Archive::Archive. Unlock the archive file after calling
13070 Archive::setup.
cd536b21 13071
479f6503
ILT
130722008-03-29 Ian Lance Taylor <iant@google.com>
13073
686c8caf
ILT
13074 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13075 version symbol to be local.
13076 * testsuite/ver_test_4.sh: New file.
13077 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13078 (check_DATA): Add ver_test_4.syms.
13079 (ver_test_4.syms): New target.
13080 * testsuite/Makefile.in: Rebuild.
13081
ab794b6b
ILT
13082 * output.cc
13083 (Output_section::Input_section_sort_entry::has_priority): New
13084 function.
13085 (Output_section::Input_section_sort_entry::match_file_name): New
13086 function.
13087 (Output_section::Input_section_sort_entry::match_section_name):
13088 Remove.
13089 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13090 Remove.
13091 (Output_section::Input_section_sort_entry::match_section_file):
13092 Remove.
13093 (Output_section::Input_section_sort_compare::operator()): Rewrite
13094 using new Input_section_sort_entry functions. Sort crtbegin and
13095 crtend first. Sort sections with no priority before sections with
13096 a priority.
13097 * testsuite/initpri1.c (d3): Check j != 4.
13098 (cd5): New constructor/destructor function.
13099 (main): Check j != 2.
13100
479f6503
ILT
13101 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13102 new symbol when resolving, don't call set_is_default.
13103 * testsuite/ver_test_7.cc: New file.
13104 * testsuite/ver_test_7.sh: New file.
13105 * testsuite/Makefile.am (ver_test_7.so): New target.
13106 (ver_test_7.o): New target.
13107 (check_SCRIPTS): Add ver_test_7.sh.
13108 (check_DATA): Add ver_test_7.syms.
13109 (ver_test_7.syms): New target.
13110
2fd32231
ILT
131112008-03-28 Ian Lance Taylor <iant@google.com>
13112
13113 * layout.cc (Layout::layout): If we see an input section with a
13114 name that needs sorting, set the must_sort flag for the output
13115 section.
13116 (Layout::make_output_section): If the name of the output section
13117 indicates that it might require sorting, set the may_sort flag.
13118 * output.h (Output_section::may_sort_attached_input_sections): New
13119 function.
13120 (Output_section::set_may_sort_attached_input_sections): New
13121 function.
13122 (Output_section::must_sort_attached_input_sections): New
13123 function.
13124 (Output_section::set_must_sort_attached_input_sections): New
13125 function.
13126 (class Output_section): Declare Input_section_sort_entry. Define
13127 Input_section_sort_compare. Declare
13128 sort_attached_input_sections. Add new fields:
13129 may_sort_attached_input_sections_,
13130 must_sort_attached_input_sections_,
13131 attached_input_sections_are_sorted_.
13132 * output.cc (Output_section::Output_section): Initialize new
13133 fields.
13134 (Output_section::add_input_section): Add an entry to
13135 input_sections_ if may_sort or must_sort are true.
13136 (Output_section::set_final_data_size): Call
13137 sort_attached_input_sections if necessary.
13138 (Output_section::Input_section_sort_entry): Define new class.
13139 (Output_section::Input_section_sort_compare::operator()): New
13140 function.
13141 (Output_section::sort_attached_input_sections): New function.
13142 * configure.ac: Check whether the compiler supports constructor
13143 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13144 * testsuite/initpri1.c: New file.
13145 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13146 CONSTRUCTOR_PRIORITY.
13147 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13148 (initpri1_LDFLAGS): New variable.
13149 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13150
18e6b24e
ILT
131512008-03-27 Ian Lance Taylor <iant@google.com>
13152
49bdd526
ILT
13153 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13154 * testsuite/common_test_1.c: New file.
13155 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13156 (common_test_1_SOURCES): New variable.
13157 (common_test_1_DEPENDENCIES): New variable.
13158 (common_test_1_LDFLAGS): New variable.
13159
18e6b24e
ILT
13160 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13161 and commons_ correctly when NAME/VERSION does not override
13162 NAME/NULL.
13163 * testsuite/ver_test_6.c: New file.
13164 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13165 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13166 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13167
04bf7072
ILT
131682008-03-26 Ian Lance Taylor <iant@google.com>
13169
5871526f
ILT
13170 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13171 of an undefined symbol from a version script.
13172 * testsuite/Makefile.am (ver_test_5.so): New target.
13173 (ver_test_5.o): New target.
13174 (check_SCRIPTS): Add ver_test_5.sh.
13175 (check_DATA): Add ver_test_5.syms.
13176 (ver_test_5.syms): New target.
13177 * testsuite/ver_test_5.cc: New file.
13178 * testsuite/ver_test_5.script: New file.
13179 * testsuite/ver_test_5.sh: New file.
13180 * Makefile.in, testsuite/Makefile.in: Rebuild.
13181
04bf7072
ILT
13182 PR gold/5986
13183 Fix problems building gold with gcc 4.3.0.
13184 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13185 (gold_error_at_location, gold_warning_at_location): Use it.
13186 * configure.ac: Check whether we can compile and use a template
13187 function with a printf attribute.
13188 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13189 when jumping over bytes.
13190 * object.cc: Instantiate Object::read_section_data.
13191 * debug.h: Include <cstring>
13192 * dwarf_reader.cc: Include <algorithm>
13193 * main.cc: Include <cstring>.
13194 * options.cc: Include <cstring>.
13195 * output.cc: Include <cstring>.
13196 * script.cc: Include <cstring>.
13197 * script.h: Include <string>.
13198 * symtab.cc: Include <cstring> and <algorithm>.
13199 * target-select.cc: Include <cstring>.
13200 * version.cc: Include <string>.
13201 * testsuite/testmain.cc: Include <cstdlib>.
13202 * configure, config.in: Rebuild.
13203
874c5b28
ILT
132042008-03-25 Ian Lance Taylor <iant@google.com>
13205
819d6c3a
ILT
13206 * options.cc: Include "../bfd/bfdver.h".
13207 (options::help): Print bug reporting address.
13208
f4b2c6f5
ILT
13209 * version.cc (print_version): Adjust output for current value of
13210 BFD_VERSION_STRING.
13211
13212 * NEWS: New file.
13213
e96caa79
ILT
13214 * options.cc (options::help): Print list of supported targets.
13215 * target-select.h: Include <vector>.
13216 (class Target_selector): Make machine_, size_, and is_big_endian_
13217 fields const. Add bfd_name_ and instantiated_target_ fields.
13218 (Target_selector::Target_selector): Add bfd_name parameter.
13219 (Target_selector::recognize): Make non-virtual, call
13220 do_recognize.
13221 (Target_selector::recognize_by_name): Make non-virtual, call
13222 do_recognize_by_name.
13223 (Target_selector::supported_names): New function.
13224 (Target_selector::bfd_name): New function.
13225 (Target_selector::do_instantiate_target): New pure virtual
13226 function.
13227 (Target_selector::do_recognize): New virtual function.
13228 (Target_selector::do_recognize_by_name): New virtual function.
13229 (Target_selector::instantiate_target): New private function.
13230 (supported_target_names): Declare.
13231 * target-select.cc (Target_selector::Target_selector): Update for
13232 new parameter and fields.
13233 (select_target_by_name): Check that the name matches before
13234 calling recognize_by_name.
13235 (supported_target_names): New function.
13236 * i386.cc (class Target_selector_i386): Update Target_selector
13237 constructor call. Remove recognize and recognize_by_name. Add
13238 do_instantiate_target.
13239 * x86_64.cc (class Target_selector_x86_64): Likewise.
13240 * testsuite/testfile.cc (class Target_selector_test): Update for
13241 changes to Target_selector.
13242
874c5b28
ILT
13243 * README: Rewrite, with some notes on unsupported features.
13244
0a65a3a7
CC
132452008-03-24 Cary Coutant <ccoutant@google.com>
13246
13247 * i386.cc (Target_i386::Got_type): New enum declaration.
13248 (Target_i386::Scan::local): Updated callers of Output_data_got
13249 member functions.
13250 (Target_i386::Scan::global): Likewise.
13251 (Target_i386::Relocate::relocate): Likewise.
13252 (Target_i386::Relocate::relocate_tls): Likewise.
13253 * object.h (Got_offset_list): New class.
13254 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13255 (Sized_relobj::local_got_offset): Likewise.
13256 (Sized_relobj::set_local_got_offset): Likewise.
13257 (Sized_relobj::local_has_tls_got_offset): Removed.
13258 (Sized_relobj::local_tls_got_offset): Removed.
13259 (Sized_relobj::set_local_tls_got_offset): Removed.
13260 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13261 * output.cc (Output_data_got::add_global): Added got_type parameter.
13262 (Output_data_got::add_global_with_rel): Likewise.
13263 (Output_data_got::add_global_with_rela): Likewise.
13264 (Output_data_got::add_global_pair_with_rel): New function.
13265 (Output_data_got::add_global_pair_with_rela): New function.
13266 (Output_data_got::add_local): Added got_type parameter.
13267 (Output_data_got::add_local_with_rel): Likewise.
13268 (Output_data_got::add_local_with_rela): Likewise.
13269 (Output_data_got::add_local_pair_with_rel): New function.
13270 (Output_data_got::add_local_pair_with_rela): New function.
13271 (Output_data_got::add_global_tls): Removed.
13272 (Output_data_got::add_global_tls_with_rel): Removed.
13273 (Output_data_got::add_global_tls_with_rela): Removed.
13274 (Output_data_got::add_local_tls): Removed.
13275 (Output_data_got::add_local_tls_with_rel): Removed.
13276 (Output_data_got::add_local_tls_with_rela): Removed.
13277 * output.h (Output_data_got::add_global): Added got_type parameter.
13278 (Output_data_got::add_global_with_rel): Likewise.
13279 (Output_data_got::add_global_with_rela): Likewise.
13280 (Output_data_got::add_global_pair_with_rel): New function.
13281 (Output_data_got::add_global_pair_with_rela): New function.
13282 (Output_data_got::add_local): Added got_type parameter.
13283 (Output_data_got::add_local_with_rel): Likewise.
13284 (Output_data_got::add_local_with_rela): Likewise.
13285 (Output_data_got::add_local_pair_with_rel): New function.
13286 (Output_data_got::add_local_pair_with_rela): New function.
13287 (Output_data_got::add_global_tls): Removed.
13288 (Output_data_got::add_global_tls_with_rel): Removed.
13289 (Output_data_got::add_global_tls_with_rela): Removed.
13290 (Output_data_got::add_local_tls): Removed.
13291 (Output_data_got::add_local_tls_with_rel): Removed.
13292 (Output_data_got::add_local_tls_with_rela): Removed.
13293 * resolve.cc (Symbol::override_base_with_special): Removed
13294 reference to has_got_offset_ field.
13295 * symtab.cc (Symbol::init_fields): Replaced initialization
13296 of got_offset_ with got_offsets_. Removed initialization
13297 of has_got_offset_
53fcba31 13298 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
13299 (Symbol::got_offset): Likewise.
13300 (Symbol::set_got_offset): Likewise.
13301 (Symbol::has_tls_got_offset): Removed.
13302 (Symbol::tls_got_offset): Removed.
13303 (Symbol::set_tls_got_offset): Removed.
13304 (Symbol::got_offset_): Removed.
13305 (Symbol::tls_mod_got_offset_): Removed.
13306 (Symbol::tls_pair_got_offset_): Removed.
13307 (Symbol::got_offsets_): New field.
13308 (Symbol::has_got_offset): Removed.
13309 (Symbol::has_tls_mod_got_offset): Removed.
13310 (Symbol::has_tls_pair_got_offset): Removed.
13311 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13312 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13313 member functions.
13314 (Target_x86_64::Scan::global): Likewise.
13315 (Target_x86_64::Relocate::relocate): Likewise.
13316 (Target_x86_64::Relocate::relocate_tls): Likewise.
13317
bd52eafb
BE
133182008-03-25 Ben Elliston <bje@au.ibm.com>
13319
13320 * yyscript.y: Fix spelling error in comment.
13321
8b105e34
ILT
133222008-03-24 Ian Lance Taylor <iant@google.com>
13323
8ed814a9
ILT
13324 * options.h (class General_options): Define build_id option.
13325 * layout.h (class Layout): Declare write_build_id, create_note,
13326 create_build_id. Add build_id_note_ member.
13327 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13328 "libiberty.h", "md5.h", "sha1.h".
13329 (Layout::Layout): Initialize eh_frame_data_,
13330 eh_frame_hdr_section_, and build_id_note_.
13331 (Layout::finalize): Call create_build_id.
13332 (Layout::create_note): New function, broken out of
13333 Layout::create_gold_note.
13334 (Layout::create_gold_note): Call create_note.
13335 (Layout::create_build_id): New function.
13336 (Layout::write_build_id): New function.
13337 (Close_task_runner::run): Call write_build_id.
13338
8b105e34
ILT
13339 * x86_64.cc: Correct license to GPLv3.
13340
086a1841
ILT
133412008-03-23 Ian Lance Taylor <iant@google.com>
13342
13343 * options.cc: Include "demangle.h".
13344 (parse_optional_string): New function.
13345 (parse_long_option): Handle takes_optional_argument.
13346 (parse_short_option): Update dash_z initializer. Handle
13347 takes_optional_argument.
13348 (General_options::General_options): Initialize do_demangle_.
13349 (General_options::finalize): Set do_demangle_. Handle demangling
13350 style.
13351 * options.h (parse_optional_string): Declare.
13352 (struct One_option): Add optional_arg field. Update constructor.
13353 Update call constructor calls. Add takes_optional_argument
13354 function.
13355 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13356 (DEFINE_optional_string): Define.
13357 (General_options::demangle): Change from DEFINE_bool to
13358 DEFINE_optional_string.
13359 (General_options::no_demangle): New function.
13360 (General_options::do_demangle): New function.
13361 (General_options::set_do_demangle): New function.
13362 (General_options::execstack_status_): Move definition to end of
13363 class definition.
13364 (General_options::static_): Likewise.
13365 (General_options::do_demangle_): New field.
13366 * object.cc (big_endian>::get_symbol_location_info): Call
13367 Options::do_demangle, not Options::demangle.
13368 * symtab.cc (demangle): Likewise.
13369
cbb93e63
ILT
133702008-03-22 Ian Lance Taylor <iant@google.com>
13371
13372 * gold.h: Include <cstddef> and <sys/types.h>
13373 * options.h: Include <cstring>.
13374
ec531623
ILT
133752008-03-21 Ian Lance Taylor <iant@google.com>
13376
13377 * Added source code to GNU binutils.
This page took 0.832216 seconds and 4 git commands to generate.