daily update
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
c0c71592
RÁE
12014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
2
3 * testsuite/Makefile.am (plugin_test_10): New test.
4 * testsuite/Makefile.in: Regenerate
5 * testsuite/plugin_common_test_2.c (c1): Align to 8.
6 * testsuite/plugin_test_10.sh: New file.
7
6168c2a1
RÁE
82014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
9
10 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
11 * resolve.cc (Symbol_table::resolve): Don't override common symbols
12 during the replacement phase.
13
3a531937
JY
142014-09-17 Han Shen <shenhan@google.com>
15 Jing Yu <jingyu@google.com>
16
17 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
18 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
19 * aarch64.cc (Target_aarch64): Add data members
20 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
21 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
22 constructor.
23 (Target_aarch64::do_reloc_symbol_index): New method.
24 (Target_aarch64::do_reloc_addend): New method.
25 (Target_aarch64::add_tlsdesc_info): New method.
26 (Target_aarch64::do_dynsym_value): New method.
27 (Target_aarch64::do_make_data_plt): Add new parameters: got,
28 got_irelative. Pass them to Output_data_plt_aarch64_standard.
29 (Target_aarch64::make_data_plt): Add new parameters: got,
30 got_irelative. Pass them to do_make_data_plt.
31 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
32 (Target_aarch64::Relocate:tls_gd_to_le): New method.
33 (Target_aarch64::Relocate:tls_ie_to_le): New method.
34 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
35 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
36 (Target_aarch64::got_tlsdesc_section): New method.
37 (Target_aarch64::make_local_ifunc_plt_entry): New method.
38 (Target_aarch64::define_tls_base_symbol): New method.
39 (Target_aarch64::reserve_tlsdesc_entries): New method.
40 (Target_aarch64::got_mod_index_entry): New method.
41 (Target_aarch64::rela_tlsdesc_section): New method.
42 (Target_aarch64::rela_irelative_section): New method.
43 (Target_aarch64::Tlsdesc_info): New struct.
44 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
45 relocations and tlsdesc relocations.
46 (Target_aarch64::optimize_tls_reloc): Implement method.
47 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
48 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
49 in constructor.
50 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
51 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
52 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
53 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
54 (Output_data_plt_aarch64::rela_tlsdesc): New method.
55 (Output_data_plt_aarch64::rela_irelative): New method.
56 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
57 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
58 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
59 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
60 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
61 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
62 (Output_data_plt_aarch64_standard): New member variables:
63 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
64 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
65 New parameter: got, got_irelative.
66 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
67 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
68 (Output_data_plt_aarch64::do_write): Replace got_address with
69 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
70 (AArch64_relocate_functions::update_movnz): New method.
71 (AArch64_relocate_functions): Correct format.
72 (AArch64_relocate_functions::movnz): New method.
73 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
74 before the switch. Add new cases to switch.
75 Check ie_to_le relaxation on tlsie relocations. Add code handling
76 tlsgd tlsdesc cases.
77 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
78 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
79 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
80 Call reloc_name_in_error_message to print unsupported reloc.
81 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
82 make_data_plt.
83 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
84 relocs. Fill in some more dynamic tags.
85 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
86 Skip call tls_get_addr when tlsgd is relaxed.
87 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
88 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
89 tlsdesc->ie relaxation.
90
62661c93
SS
912014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
92
93 * mips.cc (Target_mips_nacl): New class.
94 (Target_selector_mips_nacl): New class.
95 (target_selector_mips32): Rename from target_selector_mips32be and use
96 Target_selector_mips_nacl instead of Target_selector_mips.
97 (target_selector_mips32el): Rename from target_selector_mips32 and use
98 Target_selector_mips_nacl instead of Target_selector_mips.
99 (target_selector_mips64): Rename from target_selector_mips64be and use
100 Target_selector_mips_nacl instead of Target_selector_mips.
101 (target_selector_mips64el): Rename from target_selector_mips64 and use
102 Target_selector_mips_nacl instead of Target_selector_mips.
103 (Target_mips::mips_info): Add const attribute.
104
54674d38
CC
1052014-09-02 Cary Coutant <ccoutant@google.com>
106
107 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
108 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
109 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
110 (Sized_incr_dynobj::do_section_name): Likewise.
111 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
112 (Sized_incr_dynobj::do_section_name): Likewise.
113 * object.h (Object::section_name): Likewise.
114 (Object::do_section_name): Likewise.
115 (Sized_relobj_file::do_section_name): Likewise.
116 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
117 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
118
9860cbcf
CC
1192014-09-02 Cary Coutant <ccoutant@google.com>
120
121 PR gold/17005
122 * ehframe.cc (Fde::write): Add output_offset parameter.
123 (Cie::write): Likewise.
124 (Eh_frame::set_final_data_size): Account for offset within output
125 section.
126 (Eh_frame::do_sized_write): Likewise.
127 * ehframe.h (Fde::write): Add output_offset parameter.
128 (Cie::write): Likewise.
129 * output.cc (Output_section::Input_section_sort_entry): Remove
130 section_has_name_; add output_section_name parameter. Use
131 output section name for non-input sections.
132 (Output_section::Input_section_sort_entry::section_has_name): Remove.
133 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
134 (Output_section::Input_section_sort_compare): Remove logic for
135 sections without names.
136 (Output_section::Input_section_sort_init_fini_compare): Likewise.
137 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
138 Likewise.
139 (Output_section::Input_section_sort_section_name_compare): Likewise.
140
8e33481e
HS
1412014-08-29 Han Shen <shenhan@google.com>
142 Jing Yu <jingyu@google.com>
143
144 * aarch64-reloc-property.cc
145 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
146 reference reloc property in the table.
147 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
148 3 other entries.
149 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
150 2 new overloaded methods.
151 (Output_data_got_aarch64::do_write): Add code to write out
152 static relocs.
153 (class Output_data_got_aarch64::Static_reloc): New class to wrap
154 static relocs.
155 (Output_data_got_aarch64::static_relocs): New vector to
156 hold static relocs.
157 (Target_aarch64::TCB_SIZE): New const static memeber.
158 (Target_aarch64::tcb_size): New method.
159 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
160 (Target_aarch64::Relocate::relocate_tls): New method.
161 (Target_aarch64::Scan::local): Add code handling new reloc types.
162 (Target_aarch64::Scan::global): Add code handling new reloc types.
163
81233653
ST
1642014-08-13 Sriraman Tallam <tmsriram@google.com>
165
166 * options.h (-no-pie): Add option.
167
9363c7c3
JY
1682014-08-08 Jing Yu <jingyu@google.com>
169 Han Shen <shenhan@google.com>
170
171 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
172 (DEFFILES): add aarch64-reloc.def.
173 (TARGETSOURCES): Add aarch64-reloc-property.cc.
174 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
175 * Makefile.in: Regenerate.
176 * aarch64-reloc-property.cc: New file.
177 * aarch64-reloc-property.h: New file.
178 * aarch64-reloc.def: New file.
179 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
180 with tab to make the format consistent.
181 (Output_data_got_aarch64::symbol_table_): New method.
182 (Target_aarch64::do_plt_address_for_global): New method.
183 (Target_aarch64::do_plt_address_for_local): New method.
184 (Target_aarch64::do_select_as_default_target): New method.
185 (Target_aarch64::do_make_data_plt): New method.
186 (Target_aarch64::make_data_plt): New method.
187 (Output_data_plt_aarch64::has_irelative_section): New method.
188 (Output_data_plt_aarch64::address_for_global): New method.
189 (Output_data_plt_aarch64::address_for_local): New method.
190 (Output_data_plt_aarch64::irelative_rel_): New parameter.
191 (Output_data_plt_aarch64::add_entry): Implement contents.
192 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
193 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
194 the got_pov entry to plt0.
195 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
196 Implement contents.
197 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
198 (AArch64_howto): New struct.
199 (aarch64_howto[]): New static const array.
200 (AArch64_relocate_functions): New class.
201 (Target_aarch64::Scan::get_reference_flags): Remove method.
202 (Target_aarch64::Scan::local): Implement to support a few relocations.
203 (Target_aarch64::Scan::global): Implement to support a few relocations.
204 (Target_aarch64::make_plt_section): Implement contents.
205 (Target_aarch64::make_plt_entry): Implement contents.
206 (Target_aarch64::do_finalize_sections): Implement contents.
207 (Target_aarch64::Relocate::relocate): Implement a few relocations.
208 (Target_aarch64::relocate_section): Implement contents.
209
ad9fe6c1
AM
2102014-08-06 Alan Modra <amodra@gmail.com>
211
212 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
213
7cd4e5b7
AM
2142014-08-06 Alan Modra <amodra@gmail.com>
215
216 PR 13227
217 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
218
5ad9b0a7
ST
2192014-07-21 Sriraman Tallam <tmsriram@google.com>
220
221 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 222 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 223
e051745c
CC
2242014-07-08 Cary Coutant <ccoutant@google.com>
225
226 * expression.cc (struct Expression::Expression_eval_info): Add
227 new fields type_pointer, vis_pointer, and nonvis_pointer.
228 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
229 nonvis_pointer parameters. Adjust all calls.
230 (Symbol_expression::value): Update type, visibility, and nonvis bits
231 in caller.
232 * script.cc (Symbol_assignment::sized_finalize): Update type,
233 visibility, and remaining st_other bits for new symbol.
234 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
235 vis_pointer, and nonvis_pointer parameters.
236 * symtab.h (Symbol::set_type): New method.
237
238 * testsuite/Makefile.am (defsym_test): New test.
239 * testsuite/Makefile.in: Regenerate.
240 * testsuite/defsym_test.c: New file.
241 * testsuite/defsym_test.sh: New file.
242
f35c4853
CC
2432014-07-08 Cary Coutant <ccoutant@google.com>
244
245 PR gold/15639
246 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
247 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
248 (Sized_dynobj::base_read_symbols): ...new method.
249 * object.h (Sized_relobj_file::base_read_symbols): New method.
250 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
251 (Sized_relobj_file::base_read_symbols): ...new method.
252 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
253 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
254 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
255
2900af2d
AM
2562014-07-04 Alan Modra <amodra@gmail.com>
257
258 * po/POTFILES.in: Regenerate.
259
053a4d68
JY
2602014-07-02 Jing Yu <jingyu@google.com>
261
262 * aarch64.cc: New file
263 * Makefile.am (TARGETSOURCES): Add aarch64.cc
264 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
265 * Makefile.in: Regenerate.
266 * configure.tgt: Add entries for aarch64*.
267 * configure.ac: Likewise.
268 * configure: Likewise.
269
7b549045
AM
2702014-06-27 Alan Modra <amodra@gmail.com>
271
272 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
273
cb818dbf
CC
2742014-06-24 Cary Coutant <ccoutant@google.com>
275
276 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
277 sections.
278 (Dwo_file::sized_read_unit_index): Likewise.
279
9810d34d
SS
2802014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
281
282 * mips.cc: New file.
283 * Makefile.am (TARGETSOURCES): Add mips.cc
284 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
285 * configure.tgt: Add entries for mips*.
286 * configure.ac: Likewise.
287 * Makefile.in: Regenerate.
288 * configure: Likewise.
289
9baa787b
CC
2902014-06-09 Cary Coutant <ccoutant@google.com>
291
292 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
293 unit_length is within section bounds.
294
8f89af0a
CC
2952014-06-09 Cary Coutant <ccoutant@google.com>
296
297 PR gold/16980
298 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
299 map.
300
a47622ac
AM
3012014-06-07 Alan Modra <amodra@gmail.com>
302
303 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
304
4320c691
CC
3052014-06-06 Cary Coutant <ccoutant@google.com>
306
307 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
308 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
309 (Dwarf_pubnames_table::read_header): Likewise.
310 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
311 .debug_gnu_pubtypes.
312
270c9937
JB
3132014-06-05 Joel Brobecker <brobecker@adacore.com>
314
315 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
316 * Makefile.in, configure: Regenerate.
317
397998fc
AM
3182014-06-03 Alan Modra <amodra@gmail.com>
319
320 * powerpc.cc (addis_12_2): Define.
321 (Stub_table::do_write): Support fusion on ELFv2 stubs.
322
61f5c66f
AM
3232014-06-03 Alan Modra <amodra@gmail.com>
324
325 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
326 st_other output.
327
f6971787
AM
3282014-06-02 Alan Modra <amodra@gmail.com>
329
330 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
331 Only ignore relocs on ELFv1.
332 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
333
f6fb8322
CC
3342014-05-30 Cary Coutant <ccoutant@google.com>
335
336 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
337 * testsuite/Makefile.in: Regenerate.
338 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
339
c23dd342
L
3402014-05-27 H.J. Lu <hongjiu.lu@intel.com>
341
342 PR gold/16945
343 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
344 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
345
5fe7ffdc
AM
3462014-05-15 Alan Modra <amodra@gmail.com>
347
348 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
349 Compare FDE contents with DW_CFA_nop rather than 0.
350
a82bef93
ST
3512014-05-13 Sriraman Tallam <tmsriram@google.com>
352
353 * symtab.h (may_need_copy_reloc): Remove check for position independent
354 code.
355 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
356 position independence before pc absolute may_need_copy_reloc call.
357 Add check for executable output befor pc relative may_need_copy_reloc
358 call.
359 * i386.cc: Ditto.
360 * arm.cc: Ditto.
361 * sparc.cc: Ditto.
362 * tilegx.cc: Ditto.
363 * powerpc.cc: Add check for no position independence before
364 may_need_copy_reloc calls.
365 * testsuite/pie_copyrelocs_test.cc: New file.
366 * testsuite/pie_copyrelocs_shared_test.cc: New file.
367 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 368 * Makefile.in: Regenerate.
a82bef93 369
53c66605
ML
3702014-05-08 Martin Liška <mliska@suse.cz>
371
372 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
373
57b2284c
CC
3742014-05-06 Cary Coutant <ccoutant@google.com>
375
376 PR gold/16900
377 * i386.cc (Output_data_got_plt_i386): New class.
378 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
379 parameter. Change all callers.
380 (Output_data_plt_i386::layout_): Remove.
381 (Output_data_plt_i386::got_plt_): Change type.
382 (Target_i386::got_plt_): Change type. Change all references.
383 (Target_i386::got_section): Create instance of new class.
384 (Output_data_got_plt_i386::do_write): New function.
385 * x86_64.cc (Output_data_got_plt_x86_64): New class.
386 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
387 parameter. Change all callers.
388 (Output_data_plt_x86_64::layout_): Remove.
389 (Output_data_plt_x86_64::got_plt_): Change type.
390 (Target_x86_64::got_plt_): Change type. Change all references.
391 (Target_x86_64::got_section): Create instance of new class.
392 (Output_data_got_plt_x86_64::do_write): New function.
393 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
394 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
395 class.
396
6b97515d 3972014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 398
6b97515d
CC
399 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
400 if we have pubnames/pubtypes.
401
d1bddd3c
CC
4022014-05-02 Cary Coutant <ccoutant@google.com>
403
5fe7ffdc
AM
404 * defstd.cc (in_segment): Define __ehdr_start here...
405 * layout.cc (Layout::finalize): ...Instead of here. Set the
406 output segment when known.
407 * resolve.cc (Symbol::override_base_with_special): Remember
408 the original binding.
409 * symtab.cc (Symbol::set_output_segment): New function.
410 (Symbol::set_undefined): New function.
411 * symtab.h (Symbol::is_weak_undefined): Check original undef
412 binding.
413 (Symbol::is_strong_undefined): New function.
414 (Symbol::set_output_segment): New function.
415 (Symbol::set_undefined): New function.
416 * target-reloc.h (is_strong_undefined): Remove.
417 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
418 Check for hidden undefs.
419 (relocate_section): Call Symbol::is_strong_undefined.
420
421 * testsuite/Makefile.am (ehdr_start_test_1)
422 (ehdr_start_test_2, ehdr_start_test_3)
423 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
424 * testsuite/Makefile.in: Regenerate.
425 * testsuite/ehdr_start_def.cc: New source file.
426 * testsuite/ehdr_start_test.cc: New source file.
427 * testsuite/ehdr_start_test.t: New linker script.
428 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 429
7849f6d8
CC
4302014-04-23 Cary Coutant <ccoutant@google.com>
431
bf2cc635 432 PR gold/16870
7849f6d8
CC
433 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
434
99fd8cff
CC
4352014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
436
437 * layout.cc (Layout::include_section): Allow a target to decide
438 whether to include a section.
439 * target.h (Target::should_include_section): New function.
440 (Target::do_should_include_section): New function.
441
91f43acd
CC
4422014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
443
444 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
445 inline into ...
446 (Copy_relocs::emit): ... here.
447 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
448 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
449 (Copy_reloc_entry::entries_): Change from private to protected.
450
c4eb27e1
ST
4512014-04-02 Sriraman Tallam <tmsriram@google.com>
452
453 * icf.cc (get_section_contents): Replace copies of reloc
454 vectors with const references.
455
ae447ddd
CC
4562014-04-02 Cary Coutant <ccoutant@google.com>
457
458 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
459 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
460 * configure: Regenerate.
461 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
462 -fno-use-linker-plugin.
463 (LINK1, CXXLINK1): Add it to the link command.
464 * testsuite/Makefile.in: Regenerate.
465
fa47fa92
AM
4662014-03-12 Alan Modra <amodra@gmail.com>
467
468 * Makefile.in: Regenerate.
469
9b12c500
CC
4702014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
471
472 * symtab.h (Symbol::set_nonvis): New function.
473
beacaa96
CC
4742014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
475
476 * symtab.cc (Sized_symbol<32>::init_output_data):
477 Instantiate the template.
478 (Sized_symbol<64>::init_output_data): Likewise.
479
800d9823
CC
4802014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
481
482 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
483 adjust dynamic symbol value.
484 * target.h (Target::adjust_dyn_symbol): New function.
485 (Target::do_adjust_dyn_symbol): New function.
486
918fc1f8 4872014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 488
918fc1f8
CC
489 * output.cc (Output_data_dynamic::Dynamic_entry::write):
490 Get the value of DYNAMIC_CUSTOM dynamic entry.
491 * output.h (Output_data_dynamic::add_custom): New function.
492 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
493 dynamic entry.
494 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
495 * target.h (Target::dynamic_tag_custom_value): New function.
496 (Target::do_dynamic_tag_custom_value): New function.
497
98ff9231
CC
4982014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
499
500 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
501 dynsym indexes.
502 * target.h (Target::has_custom_set_dynsym_indexes): New function.
503 (Target::do_has_custom_set_dynsym_indexes): New function.
504 (Target::set_dynsym_indexes): New function.
505 (Target::do_set_dynsym_indexes): New function.
506
b80eed39
AM
5072014-03-07 Alan Modra <amodra@gmail.com>
508
509 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
510 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
511 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
512 (Powerpc_relocate_functions::has_overflow_bitfield,
513 overflowed): Use the above.
514 (Target_powerpc::Relocate::relocate): Correct overflow checking
515 for a number of relocations. Modify overflow test for 16-bit
516 fields in instructions to signed/unsigned according to whether
517 the field takes a signed or unsigned value.
518
4b95cf5c
AM
5192014-03-05 Alan Modra <amodra@gmail.com>
520
521 Update copyright years.
522
45965137
AM
5232014-03-05 Alan Modra <amodra@gmail.com>
524
525 * powerpc.cc (Target_powerpc::Scan::local, global): Support
526 R_PPC64_ADDR64_LOCAL.
527 (Target_powerpc::Relocate::relocate): Likewise.
528
2c80b753
AM
5292014-03-03 Alan Modra <amodra@gmail.com>
530
531 * dwp.cc (print_version): Update copyright year to current.
532
c1c69e83
AM
5332014-02-10 Alan Modra <amodra@gmail.com>
534
535 * po/gold.pot: Regenerate.
536
dd0c4e70
CC
5372014-02-06 Cary Coutant <ccoutant@google.com>
538
539 Fix problem where -u is ignored when a weak undef is seen.
540
541 * archive.cc (Library_base::should_include_member): Reorder
542 code to check for -u option if a weak undef has already been seen.
543 * testsuite/Makefile.am (weak_undef_test_2): New test case.
544 * testsuite/Makefile.in: Regenerate.
545 * testsuite/weak_undef_file3.cc: New file.
546 * testsuite/weak_undef_file4.cc: New file.
547 * testsuite/weak_undef_test_2.cc: New file.
548
1a221d3d
CC
5492014-02-05 Cary Coutant <ccoutant@google.com>
550
551 Fix issues with gold undefined symbol diagnostics.
552
553 PR binutils/15435
554 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
555 check to here.
556 * target-reloc.h (is_strong_undefined): New function.
557 (relocate_section): Move undef vtable symbol check from here.
558 Check for is_strong_undefined.
559
e889f0a4 5602014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 561
e889f0a4
CC
562 Fix problems with the --dynamic-list option.
563
564 PR gold/13577
565 * options.cc (General_options::parse_dynamic_list):
566 Set have_dynamic_list_.
567 (General_options::General_options): Initialize have_dynamic_list_.
568 (General_options::finalize): Turn off -Bsymbolic and
569 -Bsymbolic-functions if --dynamic-list provided.
570 * options.h (General_options::have_dynamic_list): New function.
571 (General_options::have_dynamic_list_): New data member.
572 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
573 correctly.
5fe7ffdc 574
e889f0a4
CC
575 PR gold/16530
576 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
577 in --dynamic-list, mark it.
5fe7ffdc 578
e889f0a4
CC
579 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
580 (dynamic_list_2): New test case.
581 * testsuite/Makefile.in: Regenerate.
582 * testsuite/dynamic_list_2.cc: New file.
583 * testsuite/dynamic_list_2.t: New file.
584 * testsuite/dynamic_list_lib1.cc: New file.
585 * testsuite/dynamic_list_lib2.cc: New file.
586 * testsuite/gc_dynamic_list_test.c: New file.
587 * testsuite/gc_dynamic_list_test.sh: New file.
588 * testsuite/gc_dynamic_list_test.t: New file.
589
ec673e64
CC
5902014-01-28 Cary Coutant <ccoutant@google.com>
591
592 Add .gdb_index version 7 support.
593
594 * gold/dwarf_reader.cc: include <utility> (for make_pair).
595 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
596 debug sections.
597 (Dwarf_ranges_table::read_ranges_table): Likewise.
598 (Dwarf_pubnames_table::read_section): Check for GNU-style
599 sections, and for compressed debug sections.
600 (Dwarf_pubnames_table::read_header): Compute end address of table.
601 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
602 for end of list by offset, not by offset == 0.
603 (Dwarf_info_reader::do_read_string_table): Check for compressed
604 debug sections.
605 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
606 Initialize new data members.
607 (Dwarf_pubnames_table::next_name): return flag_byte.
608 (Dwarf_pubnames_table::end_of_table_): New data member.
609 (Dwarf_pubnames_table::is_gnu_style_): New data member.
610 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
611 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
612 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
613 read skeleton type unit DIEs.
614 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
615 (Gdb_index::do_write): Write flag_byte.
616 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
617 (Gdb_index::Cu_vector): Store flags along with cu indexes.
618 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
619 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
620
221fd5d5
L
6212014-01-08 H.J. Lu <hongjiu.lu@intel.com>
622
623 * version.cc (print_version): Update copyright year to 2014.
624
6c09fb0b
ILT
6252013-12-19 Dimitry Andric <dimitry@andric.com>
626
627 * stringpool.cc (Stringpool_template::reserve): Add
628 HAVE_UNORDERED_MAP case.
629 * stringpool.cc (Stringpool_template::print_stats): Likewise.
630
8356f2d0
CC
6312013-12-18 Cary Coutant <ccoutant@google.com>
632
633 * configure.ac: Check for <unordered_set> and <unordered_map>.
634 * config.in: Regenerate.
635 * configure: Regenerate.
636 * system.h: Use <unordered_set> and <unordered_map> if available.
637
f2c7d7ee
RM
6382013-12-10 Roland McGrath <mcgrathr@google.com>
639
640 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
641 with $(INSTALL_PROGRAM_ENV).
642 * Makefile.in: Regenerate.
643
6632e8cc
CC
6442013-11-22 Cary Coutant <ccoutant@google.com>
645
646 * configure.ac: Add check for which library is needed for
647 dlopen.
648 * configure: Regenerate.
649
0c075858
CC
6502013-11-22 Cary Coutant <ccoutant@google.com>
651
652 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
653 assembler.
654 * testsuite/Makefile.in: Regenerate.
655
f49fe902
L
6562013-11-17 H.J. Lu <hongjiu.lu@intel.com>
657
658 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
659 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
660 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
661 (Target_x86_64<size>::Scan::local): Likewise.
662 (Target_x86_64<size>::Scan::global): Likewise.
663 (Target_x86_64<size>::Relocate::relocate): Likewise.
664 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
665 Likewise.
666 (Target_x86_64<size>::Scan::check_non_pic(): Handle
667 R_X86_64_PC32_BND.
668
669 * testsuite/Makefile.am (check_PROGRAMS): Add
670 exception_x86_64_bnd_test.
671 (exception_x86_64_bnd_test_SOURCES): New macro.
672 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
673 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
674 (exception_x86_64_bnd_test_LDADD): Likewise.
675 (exception_x86_64_bnd_1.o): New rule.
676 (exception_x86_64_bnd_2.o): Likewise.
677 * testsuite/Makefile.in: Regenerated.
678
9055360d
AM
6792013-11-15 Alan Modra <amodra@gmail.com>
680
681 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
682 accessor.
683 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
684 Only call ppc64_local_entry_offset for 64-bit. Restrict
685 symval_for_branch lookup to ELFv1.
686 (Stub_table::add_plt_call_entry): Use unsigned int off.
687 (Output_data_glink::Address, invalid_address): New.
688 (Output_data_glink::add_eh_frame): Move out of line. Add
689 support for ELFv2.
690 (Output_data_glink::add_global_entry, find_global_entry,
691 global_entry_address): New functions.
692 (Output_data_glink::global_entry_stubs_, end_branch_table_,
693 ge_size): New variables.
694 (Output_data_glink::set_final_data_size): Add global entry
695 stub sizing.
696 (Output_data_glink::do_write): Write global entry stubs.
697 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
698 parameter. Return true for ELFv2. Adjust callers.
699 (Target_powerpc::Scan::local, global): Restrict opd lookup to
700 ELFv1. Similarly for ifunc and dynamic relocation processing
701 specific to ELFv1. Recognize that symbols are defined on
702 their plt entries for ELFv2.
703 (Target_powerpc::symval_for_branch): Assert if called for
704 ELFv2 or ppc32.
705 (Target_powerpc::Relocate::relocate): Use global entry plt
706 stub for symbol value if such exists on ELFv2.
707 (Target_powerpc::Relocate::relocate): Don't call
708 symval_for_branch when ELFv2. Do adjust for local entry
709 offset when ELFv2.
710 (Target_powerpc::do_dynsym_value): Set symbols to global entry
711 plt stub for ELFv2.
712 (Target_powerpc::do_plt_address_for_global): Similarly.
713
cafdd569
CC
7142013-11-14 Cary Coutant <ccoutant@google.com>
715
716 Revert patch -- this did not fix the problem, and there is
717 no race there.
718
719 2013-11-14 Cary Coutant <ccoutant@google.com>
720
721 PR gold/14860
722 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
723 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
724 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
725 updating fde_offsets_.
726 (Eh_frame_hdr::lock_): New data member.
727
94e49e16
CC
7282013-11-14 Cary Coutant <ccoutant@google.com>
729
730 * dwp.cc (Dwo_file_entry): New type.
731 (File_list): Use Dwo_file_entry.
732 (Dwo_file::verify): New function.
733 (Dwo_file::verify_dwo_list): New function.
734 (Dwo_file::sized_verify_dwo_list): New function.
735 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
736 list.
737 (Dwp_options): New enum type.
738 (dwp_options): Add --verify-only.
739 (usage): Likewise.
740 (main): Likewise.
741 * dwp.h (gold_info): Add declaration.
742
7cdd7d57
CC
7432013-11-14 Cary Coutant <ccoutant@google.com>
744
745 PR gold/14860
746 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
747 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
748 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
749 updating fde_offsets_.
750 (Eh_frame_hdr::lock_): New data member.
751
1d946cb3
CC
7522013-11-06 Cary Coutant <ccoutant@google.com>
753
754 PR gold/15758
755 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
756 before reloc sections.
757
4f65b40e
AM
7582013-11-04 Alan Modra <amodra@gmail.com>
759
760 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
761 (Symbol::needs_dynamic_reloc): Test new flag.
762 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
763 (Target_powerpc::Scan::get_reference_flags): Add target param.
764 Return FUNC_DESC_ABI for 64-bit ELFv1.
765 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
766 call.
767 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
768 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
769
908794a9
CC
7702013-10-31 Cary Coutant <ccoutant@google.com>
771
772 Restore support for dwp v2 DWARF package file format.
773
774 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
775 tu_length parameter. Adjust all callers.
776 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
777 * dwp.cc: Include dwarf.h.
778 (Section_bounds): New struct type.
779 (Unit_set): New struct type.
780 (Dwo_file::Dwo_file): Initialize new data member.
781 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
782 Combine and rename to...
783 (Dwo_file::read_unit_index): ...this.
784 (Dwo_file::sized_read_compunit_index)
785 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
786 (Dwo_file::sized_read_unit_index): ...this.
787 (Dwo_file::copy_section): Remove section_name, is_str_offsets
788 parameters; add section_id parameter.
789 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
790 (Dwo_file::add_unit_set): ...this.
791 (Dwo_file::shndx_map_): Remove.
792 (Dwo_file::sect_offsets_): New data member.
793 (Dwp_output_file::Dwp_output_file): Initialize new data members.
794 (Dwp_output_file::add_section): Rename to...
795 (Dwp_output_file::add_contribution): ...this.
796 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
797 (Dwp_output_file::add_tu_set): Likewise.
798 (Dwp_output_file::Contribution): New type.
799 (Dwp_output_file::Section::contributions): New data member.
800 (Dwp_output_file::Cu_or_tu_set): Remove.
801 (Dwp_output_file::Section::Section): New ctor.
802 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
803 (Dwp_output_file::Dwp_index::Section_table): New type.
804 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
805 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
806 parameter.
807 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
808 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
809 (Dwp_output_file::Dwp_index::section_table): New member function.
810 (Dwp_output_file::Dwp_index::section_table_end): New member function.
811 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
812 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
813 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
814 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
815 (Dwp_output_file::Dwp_index::section_table_): New data member.
816 (Dwp_output_file::Dwp_index::section_mask_): New data member.
817 (Dwp_output_file::add_output_section): New member function.
818 (Dwp_output_file::write_new_section): New member function.
819 (Dwp_output_file::write_contributions): New member function.
820 (Dwp_output_file::section_id_map_): New data member.
821 (class Dwo_id_info_reader): Remove.
822 (class Unit_reader): New class.
823 (get_dwarf_section_name): New function.
824 (Dwo_file::read_executable): Adjust initializations of class data.
825 (Dwo_file::read): Add support for v2 package file format.
826 (Dwo_file::read_unit_index): Likewise.
827 (Dwo_file::sized_read_unit_index): Likewise.
828 (Dwo_file::copy_section): Likewise.
829 (Dwo_file::add_unit_set): Likewise.
830 (Dwp_output_file::add_output_section): Likewise.
831 (Dwp_output_file::add_contribution): Likewise.
832 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
833 for empty slot.
834 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
835 file format.
836 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
837 slot.
838 (Dwp_output_file::initialize): Remove unused function.
839 (Dwp_output_file::finalize): Add support for v2 package file format.
840 (Dwp_output_file::write_index): Likewise.
841 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
842 function prototype.
843
2500c017
CC
8442013-10-31 Cary Coutant <ccoutant@google.com>
845
846 * configure.ac: Fix check for -fmerge-constants.
847 * configure.ac: Regenerate.
848
dd0845d7
RM
8492013-10-30 Roland McGrath <mcgrathr@google.com>
850
851 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
852 Correct 9-byte nop sequence to match what the assembler generates.
853
b4f7960d
AM
8542013-10-30 Alan Modra <amodra@gmail.com>
855
856 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
857 ppc64_local_entry_offset, ppc64_local_entry_offset,
858 do_read_symbols): New functions.
859 (Powerpc_relobj::e_flags_, st_other_): New vars.
860 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
861 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
862 (Powerpc_relobj::e_flags_): New var.
863 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
864 and adjust for ELFv2.
865 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
866 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
867 (Powerpc_dynobj::do_find_special_sections): Likewise.
868 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
869 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
870 to ELFv2 local entry.
871 (Target_powerpc::do_relax): No thread safe barriers needed for
872 ELFv2.
873 (Output_data_plt_powerpc::initial_plt_entry_size_,
874 plt_entry_size): Delete. Replace all uses with
875 first_plt_entry_offset() and plt_entry_size().
876 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
877 reserved_size parm. Update callers.
878 (Output_data_plt_powerpc::entry_count): Update.
879 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
880 and use Target_powerpc::first_plt_entry_offset().
881 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
882 rename to plt_entry_size.
883 (Output_data_plt_powerpc::add_ifunc_entry,
884 add_local_ifunc_entry): Adjust reloc for ELFv2.
885 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
886 (glink_eh_frame_fde_64v2): New.
887 (Stub_table::plt_call_size): Support ELFv2 sizing.
888 (Output_data_glink::add_eh_frame): Use the new FDE.
889 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
890 (Stub_table::do_write): Write ELFv2 stubs and glink.
891 (Target_powerpc::Relocate::relocate): Replaces nop after call
892 with ld 2,24(1) and adjust local offset destination for ELFv2.
893
f9c6b907
AM
8942013-10-30 Alan Modra <amodra@gmail.com>
895
896 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
897 (Target_powerpc::Scan::global, local): Likewise.
898 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
899 on all ppc64 @h and @ha relocs.
900
e84fe78f
AM
9012013-10-14 Alan Modra <amodra@gmail.com>
902
903 * output.h (Output_data_got::add_constant): Tidy.
904 (Output_data_got::add_constant_pair): New function.
905 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
906 methods used so as to first call reserve_ent().
907
679e4abf
RM
9082013-10-11 Roland McGrath <mcgrathr@google.com>
909
44dcb735
RM
910 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
911 add_got_entry and add_got_entry_pair.
912
13323c49
RM
913 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
914 (HAVE_PUBNAMES): Likewise.
915 * configure: Regenerate.
916
1496b446
RM
917 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
918 * testsuite/Makefile.in: Regenerate.
919
cc84c10b
RM
920 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
921 Remove const from declaration.
922 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
923 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
924 * output.h (Output_file_header): Remove const from member target_
925 and corresponding constructor argument.
926 * output.cc (Output_file_header::Output_file_header): Update prototype.
927 (Output_file_header::do_sized_write): Use this->target_ in place
928 of parameters()->target().
929
52f66a2c
RM
930 * testsuite/undef_symbol.cc (Foo::get_a): New method.
931
2b64b551
RM
932 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
933 * configure: Regenerate.
934 * Makefile.in: Regenerate.
935 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
936 * testsuite/merge_string_literals_2.c: Likewise.
937 * testsuite/Makefile.am
938 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
939 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
940 literal -fmerge-constants.
941 * testsuite/Makefile.in: Regenerate.
942
43819297
RM
943 * i386.cc (Target_i386): Remove unused member dynbss_.
944 * arm.cc (Target_arm): Likewise.
945 * powerpc.cc (Target_powerpc): Likewise.
946 * sparc.cc (Target_sparc): Likewise.
947 * tilegx.cc (Target_tilegx): Likewise.
948 * x86_64.cc (Target_x86_64): Likewise.
949 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
950 type_signature_, type_offset_.
951 * plugin.h (Plugin_hook): Remove unused member layout_.
952 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
953 mapfile_.
954 (Read_member): Remove unused members input_objects_, symtab_,
955 mapfile_, layout_.
956 (Check_library): Remove unused member symtab_.
957 * archive.h (Lib_group): Remove unused member lib_.
958 * archive.cc (Lib_group::Lib_group): Update initializer.
959 * incremental.h (Incremental_binary): Remove unused member target_.
960 (Incremental_script_entry): Removed unused member script_.
961 * layout.h (Write_symbols_task): Remove unused member input_objects_.
962 * icf.h (Icf): Remove unused member num_tracked_relocs.
963
39d9ead7
RM
964 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
965 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
966 its only use.
967 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
968
679e4abf
RM
969 * archive.h: Use struct rather than class for forward declaration
970 of Read_symbols_data.
971
54de2ea6
CC
9722013-10-07 Cary Coutant <ccoutant@google.com>
973
974 PR gold/16010
975 * testsuite/Makefile.am (icf_test): Fix dependencies.
976 (icf_safe_test): Likewise.
977 (icf_safe_so_test): Likewise.
978 (large_symbol_alignment): Add empty _LDADD rule.
979 * testsuite/Makefile.in: Regenerate.
980
b14016f0
L
9812013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
982
983 PR gold/15927
984 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
985 relocation for R_X86_64_32 on x32.
986
eb426534
RM
9872013-08-27 Roland McGrath <mcgrathr@google.com>
988
989 * output.cc (Output_segment::set_section_addresses): Take new
990 Target* argument. If target->isolate_execinstr() and the segment
991 is executable and starts at a target->abi_pagesize() boundary,
992 pad its end out to a target->abi_pagesize() boundary with code fill.
993 * output.h (Output_segment::set_section_addresses): Update decl.
994 * layout.h (Layout::check_output_data_for_reset_values): Take new
995 argument RELAX_OUTPUTS.
996 (Layout): New member relax_output_list_.
997 (Layout::add_relax_output): New method.
998 * layout.cc (Layout::Layout): Update constructor.
999 (Layout::reset_relax_output): New method.
1000 (Layout::clean_up_after_relaxation): Call it.
1001 (Layout::prepare_for_relaxation): Update caller.
1002 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1003 Call reset_relax_output before re-processing segments for
1004 isolate_execinstr case.
1005 (Layout::write_data): Handle relax_output_list_.
1006 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1007 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1008
9aff4b7a
NC
10092013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1010
1011 PR binutils/15834
1012 * object.h: Fix typos.
1013
93f8221c
RM
10142013-08-16 Roland McGrath <mcgrathr@google.com>
1015
1016 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1017 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1018
e44c3715
CC
10192013-08-07 Cary Coutant <ccoutant@google.com>
1020
1021 Revert support for v2 DWP files:
1022
1023 2013-03-01 Cary Coutant <ccoutant@google.com>
1024
1025 Add dwp support for v2 DWARF package file format.
1026 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1027 tu_length parameter. Adjust all callers.
1028 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1029 * dwp.cc: Include dwarf.h.
1030 (Section_bounds): New struct type.
1031 (Unit_set): New struct type.
1032 (Dwo_file::Dwo_file): Initialize new data member.
1033 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1034 Combine and rename to...
1035 (Dwo_file::read_unit_index): ...this.
1036 (Dwo_file::sized_read_compunit_index)
1037 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1038 (Dwo_file::sized_read_unit_index): ...this.
1039 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1040 parameters; add section_id parameter.
1041 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1042 (Dwo_file::add_unit_set): ...this.
1043 (Dwo_file::shndx_map_): Remove.
1044 (Dwo_file::sect_offsets_): New data member.
1045 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1046 (Dwp_output_file::add_section): Rename to...
1047 (Dwp_output_file::add_contribution): ...this.
1048 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1049 (Dwp_output_file::add_tu_set): Likewise.
1050 (Dwp_output_file::Contribution): New type.
1051 (Dwp_output_file::Section::contributions): New data member.
1052 (Dwp_output_file::Cu_or_tu_set): Remove.
1053 (Dwp_output_file::Section::Section): New ctor.
1054 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1055 (Dwp_output_file::Dwp_index::Section_table): New type.
1056 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1057 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1058 parameter.
1059 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1060 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1061 (Dwp_output_file::Dwp_index::section_table): New member function.
1062 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1063 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1064 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1065 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1066 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1067 (Dwp_output_file::Dwp_index::section_table_): New data member.
1068 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1069 (Dwp_output_file::add_output_section): New member function.
1070 (Dwp_output_file::write_new_section): New member function.
1071 (Dwp_output_file::write_contributions): New member function.
1072 (Dwp_output_file::section_id_map_): New data member.
1073 (class Dwo_id_info_reader): Remove.
1074 (class Unit_reader): New class.
1075 (get_dwarf_section_name): New function.
1076 (Dwo_file::read_executable): Adjust initializations of class data.
1077 (Dwo_file::read): Add support for v2 package file format.
1078 (Dwo_file::read_unit_index): Likewise.
1079 (Dwo_file::sized_read_unit_index): Likewise.
1080 (Dwo_file::copy_section): Likewise.
1081 (Dwo_file::add_unit_set): Likewise.
1082 (Dwp_output_file::add_output_section): Likewise.
1083 (Dwp_output_file::add_contribution): Likewise.
1084 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1085 for empty slot.
1086 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1087 file format.
1088 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1089 slot.
1090 (Dwp_output_file::initialize): Remove unused function.
1091 (Dwp_output_file::finalize): Add support for v2 package file format.
1092 (Dwp_output_file::write_index): Likewise.
1093 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1094 function prototype.
1095
c6905c28
CC
10962013-07-31 Cary Coutant <ccoutant@google.com>
1097
1098 * object.cc (Sized_relobj::do_output_section_address): New function.
1099 (Sized_relobj): Instantiate explicitly.
1100 * object.h (Object::output_section_address): New function.
1101 (Object::do_output_section_address): New function.
1102 (Sized_relobj::do_output_section_address): New function.
1103 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1104
11052013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1106 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1107
1108 * parameters.cc (Parameters::entry): Return target-specific entry
1109 symbol name.
1110 * target.h (Target::entry_symbol_name): New function.
1111 (Target_info::entry_symbol_name): New data member.
1112
1113 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1114 * i386.cc (Target_i386::i386_info): Likewise.
1115 (Target_i386_nacl::i386_nacl_info): Likewise.
1116 * sparc.cc (Target_sparc::sparc_info): Likewise.
1117 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1118 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1119 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1120 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1121
234d4ab8
SA
11222013-07-22 Sterling Augustine <saugustine@google.com>
1123
1124 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1125 Convert parameter shndx to local variable. Add parameters symtab
1126 and symtab_size. Scan over section names. Find relocation
1127 section corresponding to current section. Create and initialize
1128 reloc_mapper_ and reloc_type_.
1129 (Dwarf_pubnames_table::read_header): Add assertion. Change
1130 unit_length to off_t. Initialize member unit_length_. Fill in field
1131 cu_offset_.
1132 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1133 Initialize new fields unit_length_ and cu_offset_.
1134 (Dwarf_pubnames_table::read_section): Update prototype.
1135 (Dwarf_pubnames_table::cu_offset): New member function.
1136 (Dwarf_pubnames_table::subsection_size): Likewise.
1137 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1138 New fields.
1139 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1140 member functions public.
1141 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1142 Update comment. Rework logic. Move repeated parts to...
1143 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1144 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1145 pubtypes_table_, and stmt_list_offset.
1146 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1147 Gdb_index::find_pubtype_offset,
1148 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1149 (Gdb_index::pubnames_read): Update prototype and rework logic.
1150 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1151 Forward declare.
1152 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1153 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1154 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1155 Gdb_index::map_pubtable_to_dies):
1156 Declare functions.
1157 (Gdb_index::pubnames_read): Update declaration.
1158 (Gdb_index::Pubname_offset_map): New type.
1159 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1160 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1161 Gdb_index::stmt_list_offset): Declare.
1162 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1163 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1164 Gdb_index::pubtypes_offset_): Remove.
1165
a3ed37d8
RM
11662013-07-19 Roland McGrath <mcgrathr@google.com>
1167
1168 * options.h (General_options): Add -Trodata-segment option.
1169 * parameters.cc (Parameters::check_rodata_segment): New function.
1170 (Parameters::set_target_once): Call it.
1171 * parameters.h (Parameters): Declare it (private member function).
1172 * layout.cc (load_seg_unusable_for_headers): New function, broken
1173 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1174 then validate rodata segment rather than text segment.
1175 (relaxation_loop_body): Call that.
1176 (is_text_segment): New function. Don't admit a non-executable
1177 segment if TARGET->isolate_execinstr().
1178 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1179
eb5b4ded
CC
11802013-07-15 Shawn Landden <shawnlandden@gmail.com>
1181
1182 PR gold/15070
1183 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1184 * nacl.h (Sniff_file::View::View): Request aligned view.
1185
4d5effb9
CC
11862013-07-11 Cary Coutant <ccoutant@google.com>
1187
1188 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1189 correct BRLT entry size.
1190
ba8ca3e7
AM
11912013-07-03 Alan Modra <amodra@gmail.com>
1192
1193 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1194 comment.
1195
267257d2
CC
11962013-07-01 Cary Coutant <ccoutant@google.com>
1197
1198 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1199 reloc_type_.
1200 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1201 (Dwarf_ranges_table::lookup_reloc): New function.
1202 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1203 reloc_type_.
1204 (Dwarf_ranges_table::lookup_reloc): New function.
1205 (Dwarf_ranges_table::reloc_type_): New data member.
1206
06f30c9d
CC
12072013-06-27 Jing Yu <jingyu@google.com>
1208
1209 PR gold/15662
1210 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1211 function.
1212 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1213 (Target_powerpc::do_relax): Call the above.
1214
a2d7bf59
AM
12152013-06-27 Cary Coutant <ccoutant@google.com>
1216
1217 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1218 on garbage collected .opd section.
1219
12202013-06-27 Alan Modra <amodra@gmail.com>
1221
1222 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1223 is non-zero.
1224 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1225 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1226
32364e50
CC
12272013-06-14 Cary Coutant <ccoutant@google.com>
1228
1229 * resolve.cc (Symbol::override_base): Don't override st_type
1230 from plugin placeholder symbols.
1231 (Symbol_table::resolve): Likewise.
1232 (Symbol_table::should_override): Don't complain about TLS mismatch
1233 if the TO symbol is a plugin placeholder.
1234 * testsuite/Makefile.am (plugin_test_tls): New test.
1235 * testsuite/Makefile.in: Regenerate.
1236 * testsuite/plugin_test_tls.sh: New test script.
1237 * testsuite/two_file_test_2_tls.cc: New test source.
1238 * testsuite/two_file_test_tls.cc: New test source.
1239
7fb47cc9
CC
12402013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1241
1242 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1243 the maximum segment alignment is larger than the page size.
1244 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1245 correctly aligns the symbols with large alignemnt.
1246 * testsuite/Makefile.in: Regenerate.
1247 * testsuite/large_symbol_alignment.cc: New file.
1248
6934001a
CC
12492013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1250 Sriraman Tallam <tmsriram@google.com>
1251
1252 * options.h (sort_section): New option.
1253 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1254 Rename from Input_section_sort_section_name_special_ordering_compare.
1255 (Input_section_sort_section_name_compare): New struct.
1256 * output.cc (Output_section::Input_section_sort_section_name_compare::
1257 operator()): New function.
1258 (Output_section::sort_attached_input_sections): Use new sort function
1259 for .text if --sort-section=name is specified.
1260 * layout.cc (Layout::make_output_section):
1261 Add sorting by name when --sort-section=name is specified.
1262 * testsuite/Makefile.am (text_section_grouping): Test option
1263 --sort-section=name.
1264 * testsuite/Makefile.in: Regenerate.
1265 * testsuite/section_sorting_name.cc: New file.
1266 * testsuite/section_sorting_name.sh: New file.
1267
93acabad
CC
12682013-05-21 Cary Coutant <ccoutant@google.com>
1269
1270 * symtab.h (Symbol::is_cxx_vtable): New function.
1271 * target-reloc.h (relocate_section): Check for vtable symbol.
1272 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1273 * testsuite/Makefile.in: Regenerate.
1274 * testsuite/missing_key_func.cc: New test source.
1275 * testsuite/missing_key_func.sh: New test script.
1276
60e8b3fc
CC
12772013-05-21 Cary Coutant <ccoutant@google.com>
1278
2b64b551
RM
1279 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1280 type of enclosing symbol.
1281 (Relocate_info::location): Check symbol type when describing symbol.
1282 * object.h (Symbol_location_info): Remove unused line_number;
1283 add enclosing_symbol_type.
1284 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1285
9df9de2c
CC
12862013-05-13 Cary Coutant <ccoutant@google.com>
1287
2b64b551
RM
1288 * configure.ac: Export DEFAULT_TARGET.
1289 * configure: Regenerate.
1290 * Makefile.in: Regenerate.
1291 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1292 * testsuite/Makefile.in: Regenerate.
1293 * testsuite/debug_msg.sh: Delete duplicate tests.
1294 Don't check undef_int error message match for powerpc where the
1295 source file and line number aren't available.
9df9de2c 1296
bbc5ae17
RM
12972013-05-10 Roland McGrath <mcgrathr@google.com>
1298
1299 * options.h (General_options): Add --rosegment-gap option.
1300 * options.cc (finalize): --rosegment-gap implies --rosegment.
1301 * layout.cc (set_segment_offsets): Let user option override
1302 target->rosegment_gap().
1303
0c6e6c39
RM
13042013-05-10 Roland McGrath <mcgrathr@google.com>
1305
1306 * options.h (General_options): Remove leading space from help
1307 messages for -nostdlib and --rosegment.
1308
cde7cb01
MR
13092013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1310
1311 PR ld/15365
1312 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1313
f31ae5b8
AM
13142013-05-03 Alan Modra <amodra@gmail.com>
1315
1316 * merge.cc (Output_merge_string::do_add_input_section): Correct
1317 scan for number of strings. Rename vars to avoid shadowing.
1318 Include missing terminator in input_size_.
1319
d3a7cd45
L
13202013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1321
1322 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1323 Restore empty string handling.
1324
6ad3daba
CC
13252013-05-01 Cary Coutant <ccoutant@google.com>
1326
1327 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1328 uninitialized warning.
1329
e31908b6
CC
13302013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1331
1332 * output.cc (Output_section::add_merge_input_section): Allow
1333 to merge sections if the alignment is more than character size.
1334 * merge.h (Output_merge_string::Output_merge_string): Remove
1335 assert.
1336 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1337 only not-null strings. Check the alignment of strings.
1338 * stringpool.h
1339 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1340 alignment as the argument.
1341 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1342 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1343 Align non-zero length strings according to the addralign_.
1344 (Stringpool_template<Stringpool_char>::set_string_offsets):
1345 Updating offsets according to the given alignment.
1346 * testsuite/Makefile.am (text_section_grouping): Test if string
1347 literals are getting merged.
1348 * testsuite/Makefile.in: Regenerate.
1349 * testsuite/merge_string_literals_1.c: New file.
1350 * testsuite/merge_string_literals_2.c: Ditto.
1351 * testsuite/merge_string_literals.sh: Ditto.
1352
0e804863
ILT
13532013-04-26 Ian Lance Taylor <iant@google.com>
1354
1355 * target-reloc.h (relocate_section): If the reloc offset is out of
1356 range, pass VIEW as NULL to relocate.relocate.
1357 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1358 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1359 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1360 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1361 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1362 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1363
e7c5ea40
CC
13642013-04-26 Geoff Pike <gpike@chromium.org>
1365
1366 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1367 * layout.cc (Hash_task): New class.
1368 (Layout::queue_build_id_tasks): New function.
1369 (Layout::write_build_id): Handle single-thread portion of build ID
1370 computation. (In some cases, all of it is single-threaded.) Replace
1371 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1372 functionality in fewer lines of code.
1373 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1374 * options.h (General_options): make "--build-id" default to tree
1375 rather than sha1. Add two new options related to --build-id=tree:
1376 --build-id-chunk-size-for-treehash and
1377 --build-id-min-file-size-for-treehash.
1378 * Makefile.am: add testing of --build-id=tree and related new options
1379 (these tests will be invoked by "make check").
1380 * Makefile.in: Regenerate.
1381
49926cd0
AM
13822013-04-25 Alan Modra <amodra@gmail.com>
1383
1384 * configure.tgt: Add powerpcle and powerpc64le.
1385
a4034750
AM
13862013-04-22 Alan Modra <amodra@gmail.com>
1387
1388 PR gold/15355
1389 * layout.cc (Layout::segment_precedes): Allow more than one
1390 segment with the same type and flags.
1391
e79c84aa
CC
13922013-04-15 Cary Coutant <ccoutant@google.com>
1393
1394 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1395 allocate space in file for BSS sections.
1396
2199fbe7
CC
13972013-04-15 Cary Coutant <ccoutant@google.com>
1398
1399 * script-sections.cc (Orphan_output_section): Reset address
1400 to zero after each orphaned section for relocatable links.
1401
502e8a84
CC
14022013-04-15 Cary Coutant <ccoutant@google.com>
1403
a4034750
AM
1404 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1405 section starting address for relocatable link.
1406 * testsuite/Makefile.am (script_test_11): New test.
1407 * testsuite/Makefile.in: Regenerate.
1408 * testsuite/script_test_11.c: New source file.
1409 * testsuite/script_test_11.t: New linker script.
502e8a84 1410
0cfdc767
AM
14112013-04-13 Alan Modra <amodra@gmail.com>
1412
1413 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1414 owner when sections are not adjacent and exceed group size.
1415 (Target_powerpc::group_sections): Handle corner case.
1416 (Target_powerpc::Branch_info::make_stub): Handle case where
1417 stub table doesn't exist due to branches in non-exec sections.
1418 (Target_powerpc::Relocate::relocate): Likewise.
1419
6830ee24
AM
14202013-04-11 Alan Modra <amodra@gmail.com>
1421
1422 PR gold/15354
1423 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1424 .branch_lt to match bfd ld. Adjust comments throughout file.
1425
54a3d865
ILT
14262013-04-04 Ian Lance Taylor <iant@google.com>
1427
1428 GCC PR c++/56840
1429 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1430 sections before checking whether they are included in the link.
1431
9993ba11
ST
14322013-03-29 Sriraman Tallam <tmsriram@google.com>
1433
1434 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1435 object before calling the plugin claim_file handler. Pass the elf
1436 object of the archive to the plugin. Delete the elf object if the
1437 plugin claims the file.
1438
ebacd51e
AM
14392013-03-21 Alan Modra <amodra@gmail.com>
1440
1441 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1442 segment when omagic.
1443
117be58f
AM
14442013-03-21 Alan Modra <amodra@gmail.com>
1445
1446 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1447 comparison warning.
1448 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1449 uninitialized" warning.
1450
32e2b61d
AM
14512013-03-20 Alan Modra <amodra@gmail.com>
1452
1453 * symtab.h (Symbol::clear_version): New function.
1454 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1455 is_needed by weak references. Clear version for symbols defined
1456 in as-needed objects that are not needed.
1457
b3ccdeb5
AM
14582013-03-15 Alan Modra <amodra@gmail.com>
1459
1460 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1461 static and public. Add report_err param. Return false for data refs.
1462 (Target_powerpc::rela_dyn_section): New overloaded function.
1463 (Target_powerpc::plt_, iplt_): Elucidate.
1464 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1465 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1466 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1467 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1468 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1469 push_branch and make_plt_entry for ifunc syms when
1470 reloc_needs_plt_for_ifunc.
1471 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1472 for ifunc unless reloc_needs_plt_for_ifunc.
1473
ad3d8a2f
AM
14742013-03-15 Alan Modra <amodra@gmail.com>
1475
1476 * gc.h (gc_process_relocs): Don't look through function descriptors.
1477 * icf.cc (get_section_contents): Do so here instead.
1478
4d9aa155
AM
14792013-03-13 Alan Modra <amodra@gmail.com>
1480
1481 * powerpc.cc (is_branch_reloc): Forward declare.
1482 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1483 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1484 false for 64-bit, true for 32-bit non-branch relocs.
1485 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1486 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1487 nm output.
1488 (icf_safe_test): Generate linker map file as well as nm output.
1489 (icf_safe_so_test): Likewise.
1490 * testsuite/Makefile.in: Regenerate.
1491 * testsuite/icf_test.sh: Parse linker map file to determine
1492 section folding.
1493 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1494 * testsuite/icf_safe_so_test.sh: Likewise.
1495 (X86_32_or_ARM_specific_safe_fold): Merge into..
1496 (arch_specific_safe_fold): ..this.
1497 (X86_64_specific_safe_fold): Delete unused function.
1498
57420c20
AM
14992013-03-12 Alan Modra <amodra@gmail.com>
1500
1501 * gc.h (gc_process_relocs): Look through function descriptors
1502 to determine shndx, symvalue and addend used by ICF. Tidy
1503 variable duplication.
1504
dc3714f3
AM
15052013-03-11 Alan Modra <amodra@gmail.com>
1506
1507 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1508 * layout.cc (Layout_task_runner::run): ..to here.
1509 * symtab.h (struct Symbol_location): Extract from..
1510 (class Symbol_table): ..here.
1511 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1512 * target.h (class Target): Add function_location and
1513 do_function_location functions.
1514 (class Sized_target): Add do_function_location.
1515 * object.h (class Sized_relobj_file): Move find_shdr..
1516 (class Object): ..to here.
1517 * object.cc: Likewise. Update to suit. Instantiate.
1518 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1519 * powerpc.cc (class Powerpc_dynobj): New.
1520 (Target_powerpc::do_function_location): New function.
1521 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1522 (Powerpc_dynobj::do_read_symbols): New function.
1523 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1524
956b03bb
ILT
15252013-03-08 Ian Lance Taylor <iant@google.com>
1526
1527 * options.cc (General_options::string_to_object_format): Accept
1528 "default".
1529
4bead2d5
AM
15302013-03-08 Alan Modra <amodra@gmail.com>
1531
1532 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1533 pointer to Post_fde.
1534 (struct Post_fde): Move definition to here..
1535 * ehframe.cc (struct Post_fde): ..from here.
1536 (Cie::write): Don't alloc Post_fde.
1537 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1538
02e60bf7
AM
15392013-03-07 Alan Modra <amodra@gmail.com>
1540
1541 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1542 relocation referencing .LC0.
1543 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1544
8343f03a
AM
15452013-03-07 Alan Modra <amodra@gmail.com>
1546
1547 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1548 always_inline. Add assembly for powerpc to avoid GOT.
1549
3366d57c
AM
15502013-03-07 Alan Modra <amodra@gmail.com>
1551
1552 * testsuite/script_test_10.sh: Don't test .bss section
1553 header number.
1554
6c77229c
AM
15552013-03-06 Alan Modra <amodra@gmail.com>
1556
1557 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1558 (Target_powerpc::symval_for_branch): Add symtab param. Update
1559 all callers. Handle folded sections.
1560 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1561 to Powerpc_relobj.
1562 (Global_symbol_visitor_opd::operator()): Likewise.
1563
a39e4af6
AM
15642013-03-04 Alan Modra <amodra@gmail.com>
1565
1566 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1567 * testsuite/Makefile.in: Regenerate.
1568
d5834edb
CC
15692013-03-01 Cary Coutant <ccoutant@google.com>
1570
1571 Add dwp support for v2 DWARF package file format.
1572 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1573 tu_length parameter. Adjust all callers.
1574 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1575 * dwp.cc: Include dwarf.h.
1576 (Section_bounds): New struct type.
1577 (Unit_set): New struct type.
1578 (Dwo_file::Dwo_file): Initialize new data member.
1579 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1580 Combine and rename to...
1581 (Dwo_file::read_unit_index): ...this.
1582 (Dwo_file::sized_read_compunit_index)
1583 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1584 (Dwo_file::sized_read_unit_index): ...this.
1585 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1586 parameters; add section_id parameter.
1587 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1588 (Dwo_file::add_unit_set): ...this.
1589 (Dwo_file::shndx_map_): Remove.
1590 (Dwo_file::sect_offsets_): New data member.
1591 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1592 (Dwp_output_file::add_section): Rename to...
1593 (Dwp_output_file::add_contribution): ...this.
1594 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1595 (Dwp_output_file::add_tu_set): Likewise.
1596 (Dwp_output_file::Contribution): New type.
1597 (Dwp_output_file::Section::contributions): New data member.
1598 (Dwp_output_file::Cu_or_tu_set): Remove.
1599 (Dwp_output_file::Section::Section): New ctor.
1600 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1601 (Dwp_output_file::Dwp_index::Section_table): New type.
1602 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1603 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1604 parameter.
1605 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1606 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1607 (Dwp_output_file::Dwp_index::section_table): New member function.
1608 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1609 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1610 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1611 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1612 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1613 (Dwp_output_file::Dwp_index::section_table_): New data member.
1614 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1615 (Dwp_output_file::add_output_section): New member function.
1616 (Dwp_output_file::write_new_section): New member function.
1617 (Dwp_output_file::write_contributions): New member function.
1618 (Dwp_output_file::section_id_map_): New data member.
1619 (class Dwo_id_info_reader): Remove.
1620 (class Unit_reader): New class.
1621 (get_dwarf_section_name): New function.
1622 (Dwo_file::read_executable): Adjust initializations of class data.
1623 (Dwo_file::read): Add support for v2 package file format.
1624 (Dwo_file::read_unit_index): Likewise.
1625 (Dwo_file::sized_read_unit_index): Likewise.
1626 (Dwo_file::copy_section): Likewise.
1627 (Dwo_file::add_unit_set): Likewise.
1628 (Dwp_output_file::add_output_section): Likewise.
1629 (Dwp_output_file::add_contribution): Likewise.
1630 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1631 for empty slot.
1632 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1633 file format.
1634 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1635 slot.
1636 (Dwp_output_file::initialize): Remove unused function.
1637 (Dwp_output_file::finalize): Add support for v2 package file format.
1638 (Dwp_output_file::write_index): Likewise.
1639 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1640 function prototype.
1641
a68a081d
CC
16422013-03-01 Cary Coutant <ccoutant@google.com>
1643
1644 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1645 function into class definition in header file.
1646 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1647 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1648 New function.
1649 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1650
9d5781f8
AM
16512013-02-28 Alan Modra <amodra@gmail.com>
1652
1653 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1654 * target.cc (Target::do_plt_fde_location): New function.
1655 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1656 accessor function, and constructor param.
1657 (struct Post_fde, Post_fdes): Declare.
1658 (Cie::write): Add post_fdes param.
1659 * ehframe.cc (Fde::write): Use plt_fde_location.
1660 (struct Post_fde): Define.
1661 (Cie::write): Stash FDEs added post merge mapping.
1662 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1663 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1664 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1665 other FDEs.
1666 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1667 (Target_powerpc::has_glink): New function.
1668 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1669 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1670 glink_eh_frame_fde_32, default_fde): New data.
1671 (Stub_table::eh_frame_added_): New var.
1672 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1673 Make const.
1674 (Stub_table::add_eh_frame): New function.
1675 (Output_data_glink::add_eh_frame): New function.
1676 (Target_powerpc::make_glink_section): Call add_eh_frame.
1677
214383dd
ILT
16782013-02-15 Ian Lance Taylor <iant@google.com>
1679
1680 * options.h (DEFINE_uint64_alias): Define.
1681 (class General_options): Add -Ttext-segment as an alias for
1682 -Ttext.
1683
91c2b899
AM
16842013-02-15 Alan Modra <amodra@gmail.com>
1685
1686 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1687 (Stub_table::do_write): ..here, two places.
1688 (Stub_table::plt_call_size): Use it here too.
1689
20e2a8aa
ILT
16902013-02-11 Ian Lance Taylor <iant@google.com>
1691
1692 * descriptors.cc (Descriptors::close_all): New function.
1693 * descriptors.h (class Descriptors): Declare close_all.
1694 (close_all_descriptors): New inline function.
1695 * plugin.cc: Include "descriptors.h".
1696 (Plugin_manager::cleanup): Call close_all_descriptors.
1697
8952bc69
AM
16982013-02-06 Alan Modra <amodra@gmail.com>
1699
1700 * README: Update coding style link.
1701
29bd8b6b
CC
17022013-01-28 Cary Coutant <ccoutant@google.com>
1703
a4034750
AM
1704 * dwp.cc (File_list): New typedef.
1705 (Dwo_name_info_reader): New class.
1706 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1707 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1708 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1709 (Dwo_file::read_executable): New function.
1710 (Dwo_file::read): Move common setup code to ...
1711 (Dwo_file::make_object): ... here.
1712 (dwp_options): Add --exec/-e.
1713 (usage): Likewise.
1714 (main): Likewise.
29bd8b6b 1715
c6ac678d
ST
17162013-01-24 Sriraman Tallam <tmsriram@google.com>
1717
1718 * layout.cc (Layout::layout): Check for option text_reorder.
1719 (Layout::make_output_section): Ditto.
1720 * options.h (text_reorder): New option.
1721 * output.cc (Input_section_sort_compare): Remove special ordering
1722 of section names.
1723 (Output_section::
1724 Input_section_sort_section_name_special_ordering_compare::
1725 operator()): New function.
1726 (Output_section::sort_attached_input_sections): Use new sort function
1727 for .text.
1728 * output.h (Input_section_sort_section_name_special_ordering_compare):
1729 New struct.
1730 * testsuite/Makefile.am (text_section_grouping): Test option
1731 --no-text-reorder
1732 * testsuite/Makefile.in: Regenerate.
1733 * testsuite/text_section_grouping.sh: Check order of functions without
1734 default text reordering.
1735
50701cc1
MF
17362013-01-18 Mike Frysinger <vapier@gentoo.org>
1737
1738 * options.h (General_options): Change default to true for new_dtags.
1739
b1b00fcc
MF
17402013-01-18 Mike Frysinger <vapier@gentoo.org>
1741
1742 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1743 when enable_new_dtags is false. Only add DT_RUNPATH when
1744 enable_new_dtags is true.
1745
ec5b8187
AM
17462013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1747
1748 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1749 used in declaration and definition consistent.
1750 (Target_powerpc::symval_for_branch): Ditto.
1751
a880d4c4
ST
17522013-01-16 Sriraman Tallam <tmsriram@google.com>
1753
1754 * testsuite/plugin_final_layout.cc: Fix comment.
1755
7c381248
ST
17562013-01-16 Sriraman Tallam <tmsriram@google.com>
1757
1758 * layout.cc (Layout::layout): Do not do default sorting for
1759 text sections when section ordering is specified.
1760 (make_output_section): Ditto.
1761 * testsuite/plugin_final_layout.cc: Name the function sections
1762 to catch reordering issues.
1763
e2458743
AM
17642013-01-15 Alan Modra <amodra@gmail.com>
1765
1766 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1767 plt-thread-safe.
1768
431ed302
AM
17692013-01-15 Alan Modra <amodra@gmail.com>
1770
1771 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1772 * testsuite/Makefile.in: Regenerate.
1773
0ec6429b
AM
17742013-01-14 Alan Modra <amodra@gmail.com>
1775
1776 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1777 * testsuite/Makefile.in: Regenerate.
1778
0bf402d5
ILT
17792013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1780
36af3926 1781 PR bfd/14430
0bf402d5
ILT
1782 Fix mingw gold build with plugins enabled
1783 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1784 * configure.ac: Export DLOPEN_LIBS and add headers check.
1785 * plugin.cc: Handle non-dlfcn case.
1786 * Makefile.in: Regenerate.
1787 * config.in: Regenerate.
1788 * configure: Regenerate.
1789 * testsuite/Makefile.in: Regenerate.
1790
9e9143bc
ST
17912013-01-09 Sriraman Tallam <tmsriram@google.com>
1792
1793 * output.h (sort_attached_input_sections): Change to be public.
1794 * script-sections.cc
1795 (Output_section_definition::set_section_addresses): Sort
1796 attached input sections according to section order before linker
1797 script assigns section addresses.
1798 (Orphan_output_section::set_section_addresses): Sort
1799 attached input sections according to section order before linker
1800 script assigns section addresses.
1801 * Makefile.am (final_layout.sh): Use a simple linker script to
1802 check if section ordering still works.
1803 * Makefile.in: Regenerate.
1804
679af368
ILT
18052013-01-09 Ben Cheng <bccheng@google.com>
1806
1807 * arm.cc (Target_arm::attributes_accept_div): New function.
1808 (Target_arm::attributes_forbid_div): New function.
1809 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
1810 attribute using the same new functions as what bfd/elf32_arm.c
1811 does.
1812
3136a00e
CC
18132013-01-07 Cary Coutant <ccoutant@google.com>
1814
1815 PR gold/14993
1816 * output.cc (Output_section::add_input_section): For incremental
1817 updates, don't track input sections that are allocated from patch
1818 space.
1819
f2a6224b
L
18202013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1821 Ian Lance Taylor <iant@google.com>
1822
1823 PR gold/14897
1824 * configure.ac (--enable-ld): Removed.
1825 (install_as_default): Set to yes only for --enable-gold=default
1826 or --disable-ld.
1827 * configure: Regenerated.
1828
4f46f626
L
18292013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1830
1831 * options.h (General_options): Add -fuse-ld= for GCC linker
1832 option compatibility.
1833
26e4ef59
CC
18342013-01-04 Cary Coutant <ccoutant@google.com>
1835
1836 * configure.ac: Fix typo restoring CXXFLAGS.
1837 * configure: Regenerate.
1838
3d587466
CC
18392013-01-04 Cary Coutant <ccoutant@google.com>
1840
4f46f626
L
1841 * testsuite/Makefile.am (CXXLINK_S): New macro.
1842 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
1843 * testsuite/Makefile.in: Regenerate.
3d587466 1844
44db6695
L
18452013-01-02 H.J. Lu <hongjiu.lu@intel.com>
1846
1847 * version.cc (print_version): Update copyright year to 2013.
1848
edcac0c1
ILT
18492012-12-20 Ian Lance Taylor <iant@google.com>
1850
1851 * layout.cc (Layout::special_ordering_of_input_section): New
1852 function.
1853 (Layout::layout): If input section requires special ordering, must
1854 sort input sections.
1855 (Layout::make_output_section): May sort .text input sections.
1856 (Layout::is_section_name_prefix_grouped): Remove.
1857 * layout.h (class Layout): Declare
1858 special_ordering_of_input_section. Don't declare
1859 is_section_name_prefix_grouped.
1860 * output.cc (Output_section::add_input_section): Revert last
1861 change.
1862 (Output_section::Input_section_sort::match_file_name): Don't crash
1863 if called on output section data.
1864 (Output_section::Input_section_sort_compare): Sort based on
1865 special ordering.
1866 (Output_section::Input_section_sort_section_order_index_compare):
1867 Revert last patch.
1868 (Output_section::sort_attached_input_sections): Likewise.
1869
28f2a4ac
ST
18702012-12-18 Sriraman Tallam <tmsriram@google.com>
1871
edcac0c1 1872 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
1873 * layout.h (Layout::is_section_name_prefix_grouped): New function.
1874 * output.cc (Output_section::add_input_section): Check if section
1875 name contains special prefix. Keep input sections to sort such
1876 sections.
1877 (Output_section::Input_section_sort_section_order_index_compare
1878 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
1879 (Output_section::sort_attached_input_sections): Add condition to
1880 Input_section_entry constructor call.
28f2a4ac
ST
1881 * testsuite/Makefile.am (text_section_grouping): New test.
1882 * testsuite/Makefile.in: Regenerate.
1883 * testsuite/text_section_grouping.cc: New file.
1884 * testsuite/text_section_grouping.sh: New file.
1885
5bf135a7
NC
18862012-12-17 Nick Clifton <nickc@redhat.com>
1887
1888 * Makefile.am: Add copyright notice.
1889 * NEWS: Likewise.
1890 * README: Likewise.
1891 * configure.ac: Likewise.
1892 * ftruncate.c: Likewise.
1893 * Makefile.in: Regenerate.
1894
59965708
CC
18952012-12-14 Cary Coutant <ccoutant@google.com>
1896
a4034750
AM
1897 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
1898 --no-as-needed flag.
1899 (exception_separate_shared_12_test): Likewise.
1900 (incremental_copy_test): Likewise.
1901 * testsuite/Makefile.in: Regenerate.
59965708 1902
2a77e2ab
CC
19032012-12-14 Cary Coutant <ccoutant@google.com>
1904
1905 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
1906 (Dwp_output_file::Dwp_index::enter_set): Add assert.
1907
e3deeb9c
AM
19082012-12-12 Alan Modra <amodra@gmail.com>
1909
1910 * powerpc.cc (class Track_tls): New.
1911 (class Relocate, class Scan): Inherit Track_tls.
1912 (Target_powerpc::Scan::local, global): Track tls optimization
1913 and avoid creating plt entry for __tls_get_addr if all uses
1914 are optimized away.
1915 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
1916
d8f5a274
AM
19172012-12-12 Alan Modra <amodra@gmail.com>
1918
1919 * options.h (General_options): Add --toc-sort/--no-toc-sort.
1920 Replace no_toc_optimize with toc_optimize.
1921 * output.h (Output_section::input_sections): Provide non-const variant.
1922 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
1923 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
1924 accessors.
1925 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
1926 (class Sort_toc_sections): New.
1927 (Target_powerpc::do_finalize_sections): Sort toc sections.
1928 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
1929
4c8a1de1
RM
19302012-12-10 Roland McGrath <mcgrathr@google.com>
1931
1932 * testsuite/binary_unittest.cc (read_all): New function.
1933 (Sized_binary_test): Use it instead of ::read.
1934 * fileread.cc (do_read): Don't assume pread always reads the whole
1935 amount in a single call.
1936
edc27beb
AM
19372012-12-10 Alan Modra <amodra@gmail.com>
1938
1939 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
1940 Set EM_PPC64 or EM_PPC here.
1941 (Target_selector_powerpc::do_recognize): Delete.
1942
906b9150
AM
19432012-12-10 Alan Modra <amodra@gmail.com>
1944
1945 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
1946 stub_table_.
1947 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
1948
418c15ae
RM
19492012-12-07 Roland McGrath <mcgrathr@google.com>
1950
1951 * testsuite/binary_unittest.cc (Sized_binary_test):
1952 Use open_descriptor rather than ::open.
1953
decdd3bc
AM
19542012-12-07 Alan Modra <amodra@gmail.com>
1955
1956 * powerpc.cc (Stub_table::do_write): Delete redundant Address
1957 typedef and invalid_address constant.
1958 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
1959 instantiate constants.
1960
db399005
ILT
19612012-12-06 Roland McGrath <mcgrathr@google.com>
1962
1963 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
1964 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
1965 * aclocal.m4: Regenerate.
1966 * configure: Regenerate.
1967 * Makefile.in: Regenerate.
1968 * testsuite/Makefile.in: Regenerate.
1969
aba6bc71
AM
19702012-12-07 Alan Modra <amodra@gmail.com>
1971
1972 * options.h (General_options): Add no_toc_optimize.
1973 * powerpc.cc (ok_lo_toc_insn): New function.
1974 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
1975
9e69ed50
AM
19762012-12-06 Alan Modra <amodra@gmail.com>
1977
1978 * options.h (General_options): Add plt_align, plt_static_chain,
1979 plt_thread_safe. Update stub_group_size help text.
1980 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
1981 for new plt_thread_safe_ var.
1982 (use_plt_offset): Correct comments.
1983 (Target_powerpc::do_relax): Look for thread creation symbols to
1984 determine default plt_thread_safe value. Clear plt call stubs
1985 as well as branch stubs each iteration.
1986 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
1987 insn constants.
1988 (l, hi, ha, write_insn): Move earlier.
1989 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
1990 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
1991 plt stubs too.
1992 (Stub_table::update_size): Adjust.
1993 (Stub_table::prev_size, set_prev_size): Delete.
1994 (Stub_table::stub_align): Let --plt-align affect result.
1995 (Stub_table::plt_call_size): Calculate sizes for various stubs.
1996 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
1997 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
1998 (Stub_table::do_write): Support more stub variants.
1999
f43ba157
AM
20002012-12-04 Alan Modra <amodra@gmail.com>
2001
2002 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2003 (Target_powerpc::do_define_standard_symbols): New function.
2004
34171bc5
AM
20052012-12-03 Alan Modra <amodra@gmail.com>
2006
2007 * output.h: Formatting, whitespace.
2008
dc9589e9 20092012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2010
2011 * layout.h (Layout::get_executable_sections): Declare.
2012 * layout.cc (Layout::get_executable_sections): New function.
2013 * arm.cc (Target_arm::group_sections): Use it.
2014 (Arm_output_section::group_sections): Delete now redundant test.
2015 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2016 param to handle relative relocs.
2017 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2018 (Output_data_reloc::add_absolute): Adjust.
2019 (Output_data_reloc::add_relative): New function.
2020 (Output_data::reset_data_size): New function.
2021 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2022 (Output_section::set_addralign): New function.
2023 (Output_section::checkpoint_set_addralign): New function.
2024 (Output_section::clear_section_offsets_need_adjustment): New function.
2025 (Output_section::input_sections): Make public.
2026 * powerpc.cc (class Output_data_brlt_powerpc): New.
2027 (class Stub_table, class Stub_control): New.
2028 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2029 stub_table_, set_stub_table, stub_table): New vectors and accessor
2030 functions.
2031 (Target_powerpc::do_may_relax, do_relax, push_branch,
2032 new_stub_table, stub_tables, brlt_section, group_sections,
2033 add_branch_lookup_table, find_branch_lookup_table,
2034 write_branch_lookup_table, make_brlt_section): New functions.
2035 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2036 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2037 branch_info_): New vars.
2038 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2039 make call stubs here.
2040 (Output_data_glink): Remove all call stub handling from this class.
2041 (Target_powerpc::Scan::local, global): Save interesting branch
2042 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2043 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2044 functions on final link.
2045 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2046 Handle long branch destinations too.
2047 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2048 do_plt_address_for_local): Adjust lookup of plt call stubs.
2049
627b30b7
AM
20502012-11-30 Alan Modra <amodra@gmail.com>
2051
2052 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2053 relocs against protected symbols when building 32-bit shared libs.
2054
40b469d7
AM
20552012-11-30 Alan Modra <amodra@gmail.com>
2056
2057 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2058 param. Call got_section() to make .got. Update all callers
2059 and their callers and so on.
2060
bb66a627
AM
20612012-11-30 Alan Modra <amodra@gmail.com>
2062
2063 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2064 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2065 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2066 value if it already exists.
2067
d2cf1c6c
L
20682012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2069
2070 PR gold/14858
2071 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2072
edccdf7c
RM
20732012-11-14 Roland McGrath <mcgrathr@google.com>
2074
2075 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2076 than bfc instruction for data sandboxing.
2077
6febeb74
AM
20782012-11-08 Alan Modra <amodra@gmail.com>
2079
2080 * po/POTFILES.in: Regenerate.
2081
0a6f1bf2
AM
20822012-11-05 Alan Modra <amodra@gmail.com>
2083
2084 * configure.ac: Apply 2012-09-10 change to config.in here.
2085 * configure: Regenerate.
2086
26a4e9cb
AM
20872012-11-05 Alan Modra <amodra@gmail.com>
2088
2089 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2090 (struct Opd_ent): Use "Address" rather than "Offset".
2091 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2092 (Target_powerpc::got_section): Make public.
2093 (Target_powerpc::scan_relocs): Move code setting symbols..
2094 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2095 Create _SDA_BASE_ only when referenced.
2096
cc928013
RM
20972012-11-02 Roland McGrath <mcgrathr@google.com>
2098
2099 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2100 from last change.
2101
50ed5eb1
RM
21022012-11-01 Roland McGrath <mcgrathr@google.com>
2103
62fe925a
RM
2104 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2105 for offset_in_output_section parameter.
2106 (Sized_target::relocate_special_relocatable): Likewise.
2107 * arm.cc (Target_arm::relocate_relocs): Likewise.
2108 (Target_arm::relocate_special_relocatable): Likewise.
2109 * i386.cc (Target_i386::relocate_relocs): Likewise.
2110 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2111 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2112 * target-reloc.h (relocate_relocs): Likewise.
2113 * testsuite/testfile.cc (Target_test): Likewise.
2114 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2115 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2116
2117 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2118 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2119
2120 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2121 parameter, which is unused in the [!F_SETFD] case.
2122
50ed5eb1
RM
2123 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2124 SYMNDX to off_t before comparing it to this->data_size().
2125 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2126 * incremental.cc (Output_section_incremental_inputs::do_write):
2127 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2128
2cadc0bf
RM
2129 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2130
3bfcb652
NC
21312012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2132
2133 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2134 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2135 in EABI_VER5.
2136
c1a8d56e
CC
21372012-10-29 Cary Coutant <ccoutant@google.com>
2138
2139 * dwp.cc (usage): Add file and exit status parameters;
2140 add --help and --version options.
2141 (print_version): New function.
2142 (main): Add --help and --version options.
2143
b2490a7b
L
21442012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2145
2146 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2147 final_layout_sequence.txt.
2148 * testsuite/Makefile.in: Regenerated.
2149
aa543512
L
21502012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2151
2152 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2153 COMPILE generated by automake.
2154 (LINK1): Likewise.
2155 (CXXCOMPILE1): Likewise.
2156 (CXXLINK1): Likewise.
2157 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2158 (LINK): Likewise.
2159 (CXXCOMPILE): Likewise.
2160 (CXXLINK): Likewise.
2161 * testsuite/Makefile.in: Regenerated.
2162
d361fafb
L
21632012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2164
2165 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2166 on bad fwrite return.
2167
598c7410
L
21682012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2169
2170 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2171 on val.
2172
35c813e2
CC
21732012-10-23 Cary Coutant <ccoutant@google.com>
2174
2175 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2176 * testsuite/Makefile.in: Regenerate.
2177 * testsuite/dwp_test.h: New source file.
2178 * testsuite/dwp_test_1.cc: New source file.
2179 * testsuite/dwp_test_1.s: New source file.
2180 * testsuite/dwp_test_1.sh: New source file.
2181 * testsuite/dwp_test_1b.cc: New source file.
2182 * testsuite/dwp_test_1b.s: New source file.
2183 * testsuite/dwp_test_2.cc: New source file.
2184 * testsuite/dwp_test_2.s: New source file.
2185 * testsuite/dwp_test_2.sh: New source file.
2186 * testsuite/dwp_test_main.cc: New source file.
2187 * testsuite/dwp_test_main.s: New source file.
2188
77429909
CC
21892012-10-23 Cary Coutant <ccoutant@google.com>
2190
2191 * dwp.h: New header file.
2192 * dwp.cc: New source file.
2193 * gold.h: Move shared declarations to system.h.
2194 * system.h: New header file.
2195 * Makefile.am: Add dwp.
2196 * Makefile.in: Regenerate.
2197
ed5d6712
CC
21982012-10-23 Cary Coutant <ccoutant@google.com>
2199
2200 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2201 Dwarf_info_reader::read_from_pointer.
2202 (Dwarf_pubnames_table::read_header): Likewise.
2203 (Dwarf_pubnames_table::next_name): Likewise.
2204 (Dwarf_die::read_attributes): Likewise.
2205 (Dwarf_die::skip_attributes): Likewise.
2206 (Dwarf_info_reader::read_from_pointer): New function template.
2207 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2208 (Dwarf_pubnames_table): Likewise.
2209 (Dwarf_info_reader::read_from_pointer): New function template.
2210 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2211 Dwarf_pubnames_table ctor.
2212
8787852d
CC
22132012-10-23 Cary Coutant <ccoutant@google.com>
2214
2215 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2216 abbrev_shndx.
2217 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2218 abbrev_shndx_.
2219 (Dwarf_info_reader::set_abbrev_shndx): New method.
2220 (Dwarf_info_reader::abbrev_shndx_): New data member.
2221
9fc236f3
CC
22222012-10-23 Cary Coutant <ccoutant@google.com>
2223
2224 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2225 from object, not parameters.
2226 (Dwarf_info_reader::parse): Likewise.
2227 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2228 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2229 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2230 methods.
2231
effe8365
CC
22322012-10-23 Cary Coutant <ccoutant@google.com>
2233
2234 * fileread.cc (Input_file::Input_file): New constructor.
2235 * fileread.h (class Input_file): Add new constructor.
2236
1698990d
AM
22372012-10-18 Alan Modra <amodra@gmail.com>
2238
2239 PR gold/14727
2240 * object.cc (Relobj::is_section_name_included): Also match
2241 .sdata personality section.
2242
168a4726
AM
22432012-10-18 Alan Modra <amodra@gmail.com>
2244
2245 * target-reloc.h (class Default_comdat_behavior): New, package up..
2246 (get_comdat_behaviour): ..this.
2247 (relocate_section): Add Relocate_comdat_behavior template arg,
2248 adjust code to suit.
2249 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2250 (Target_arm::scan_reloc_section): Likewise.
2251 * i386.cc (Target_i386::relocate_section): Likewise.
2252 * sparc.cc (Target_sparc::relocate_section): Likewise.
2253 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2254 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2255 * powerpc.cc (class Relocate_comdat_behavior): New.
2256 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2257 gold::relocate_section with new template arg.
2258
acc276d8
AM
22592012-10-18 Alan Modra <amodra@gmail.com>
2260
2261 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2262 dynamic relocs for GOT_TPREL got entries, without symbol if
2263 resolving locally.
2264 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2265 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2266 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2267
e10f9870
AM
22682012-10-17 Alan Modra <amodra@gmail.com>
2269
2270 PR gold/14726
2271 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2272
ae034989
ST
22732012-10-16 Sriraman Tallam <tmsriram@google.com>
2274
2275 * layout.cc (Layout::include_section): Keep sections marked
2276 SHF_EXCLUDE when doing relocatable links.
2277
f3a0ed29
AM
22782012-10-16 Alan Modra <amodra@gmail.com>
2279
2280 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2281 (Target_powerpc::do_finalize_sections): Call it.
2282 (Output_data_save_res): New class and supporting functions.
2283 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2284 normal symbols defined in object files.
2285
c6de8ed4
AM
22862012-10-12 Alan Modra <amodra@gmail.com>
2287
2288 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2289 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2290 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2291 section if scan_opd_relocs not yet called.
2292 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2293
03e25981
AM
22942012-10-12 Alan Modra <amodra@gmail.com>
2295
2296 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2297 add_local_ifunc_entry): Revert last change.
2298 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2299
c9824451
AM
23002012-10-05 Alan Modra <amodra@gmail.com>
2301
2302 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2303 do_plt_address_for_global): New functions.
2304 (Output_data_got_powerpc::do_write): Don't segfault when linking
2305 statically.
2306 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2307 add_local_ifunc_entry): Return true on adding entry..
2308 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2309 glink->add_entry call. Remove unused symtab param. Adjust calls.
2310 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2311 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2312 set up symbols here.
2313 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2314 syms here. Do so even when no .iplt. Don't segfault when linking
2315 statically.
2316 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2317 new variants without reloc param.
2318 (Glink_sym_ent::Glink_sym_ent): Likewise.
2319 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2320 reloc when refs will resolve to plt call stub.
2321 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2322 R_PPC_PLTREL24 to resolve locally.
2323 (Target_powerpc::Scan::global): Correct ifunc handling.
2324 (Target_powerpc::Relocate::relocate): Correct local sym glink
2325 lookup. Don't destroy "value" when we have a plt call stub,
2326 and when checking plt call validity.
2327 (Target_powerpc::do_dynsym_value): Simplify.
2328
19fec8c1
AM
23292012-10-05 Alan Modra <amodra@gmail.com>
2330
2331 * i386.cc (Output_data_plt_i386::address_for_global,
2332 address_for_local): Add plt offset to returned value. Adjust uses.
2333 * sparc.cc (Output_data_plt_sparc::address_for_global,
2334 address_for_local): Likewise.
2335 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2336 address_for_local): Likewise.
2337 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2338 address_for_local): Likewise.
2339 * target.h (Target::plt_address_for_global, plt_address_for_local):
2340 Update comment.
2341 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2342 (Output_data_got::Got_entry::write): Nor here.
2343 * output.h: Comment fix.
2344
e867b647
WL
23452012-10-02 Jiong Wang <jiwang@tilera.com>
2346
2347 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2348 global_offset_table_ value for larget got.
2349 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2350
e5d5f5ed
AM
23512012-09-29 Alan Modra <amodra@gmail.com>
2352
2353 * powerpc.cc (Target_powerpc::iplt_): New output section.
2354 (Target_powerpc::iplt_section, make_iplt_section,
2355 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2356 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2357 Target_powerpc::plt_entry_count): Count iplt entries too.
2358 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2359 reloc section in constructor. New params.
2360 (Target_powerpc::make_plt_section): Create reloc section here instead.
2361 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2362 functions.
2363 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2364 (Output_data_glink::add_entry, find_entry): New functions to
2365 deal with local syms.
2366 (Glink_sym_ent): Add support for local syms.
2367 (Output_data_glink::do_write): Handle ifunc plt entries.
2368 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2369 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2370 (Target_powerpc::Relocate::relocate): Likewise.
2371 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2372
ec4dbad3
AM
23732012-09-25 Alan Modra <amodra@gmail.com>
2374
2375 * object.h (Sized_relobj_file::adjust_local_symbol,
2376 do_adjust_local_symbol): New functions.
2377 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2378 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2379 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2380 and irregular opd entry spacing.
2381 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2382 (Global_symbol_visitor_opd): New functor.
2383 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2384 on deleted opd entries.
2385
5c0b3823
WL
23862012-09-15 Jiong Wang <jiwang@tilera.com>
2387
2388 * tilegx.cc: New file.
2389 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2390 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2391 * configure.tgt: Add entries for tilegx*.
2392 * configure.ac: Likewise.
2393 * Makefile.in: Rebuild.
2394 * configure: Likewise.
2395 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2396 tilegx.
2397
bfdfa4cd
AM
23982012-09-13 Alan Modra <amodra@gmail.com>
2399
2400 * target-reloc.h (scan_relocs): Call scan.local for relocs
2401 against symbols in discarded sections. Pass is_discarded
2402 param.
2403 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2404 Add is_discarded param.
2405 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2406 is_discarded to flag opd entry as discarded. Don't emit dyn
2407 relocs on such entries.
2408 (Target_powerpc::Scan::global): Similarly detect and handle
2409 such opd entries.
2410 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2411 opd_ent_. Update all uses.
2412 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2413 (Target_powerpc::relocate_section): Zero out discarded opd
2414 entry relocs.
2415
d77a0555
ILT
24162012-09-12 Ian Lance Taylor <iant@google.com>
2417
2418 PR gold/14570
2419 * output.cc: Rename Output_data_got template parameter from size
2420 to got_size for all functions. Compile all variants of
2421 Output_data_got.
2422 (Output_data_got::Got_entry::write): Correct use of size for
2423 symbol value. Use local_is_tls rather than casting to
2424 Sized_relobj_file.
2425 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2426 (class Sized_relobj_file): Add do_local_is_tls.
2427 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2428
815a1205
AM
24292012-09-11 Alan Modra <amodra@gmail.com>
2430
2431 PR gold/14566
2432 * layout.cc (Layout::set_segment_offsets): When using
2433 common-page-size alignment, ensure we are on a new max-page-size
2434 page.
2435 * output.cc (Output_segment::set_section_addresses): Use
2436 abi_pagesize, not common_pagesize for relro boundary.
2437 (Output_segment::set_offset): Likewise.
2438
bd73a62d
AM
24392012-09-11 Alan Modra <amodra@gmail.com>
2440
2441 * output.h (Output_data_got::add_global_tls, add_local_tls,
2442 add_local_tls_pair): New functions.
2443 (Output_data_got::add_local_pair_with_rel): Remove second
2444 reloc param. Expand comment.
2445 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2446 use_plt_or_tls_offset_, similarly for constructor param.
2447 (Output_data_got::Got_entry::write): Add got_index param.
2448 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2449 add_local_tls_pair): New functions.
2450 (Output_data_got::Got_entry::write): Handle tls symbols
2451 with use_plt_or_tls_offset_ set specially.
2452 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2453 (Output_data_got::do_write): Replace iterator with index, pass
2454 index to entry write function.
2455 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2456 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2457 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2458 call.
2459 * i386.cc (Target_i386::Scan::local): Likewise.
2460 * sparc.cc (Target_sparc::Scan::local): Likewise.
2461 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2462 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2463 do_tls_offset_for_global): New functions.
2464 (Target_powerpc::Scan::local): Correct TLS relocations and got
2465 entry values.
2466 (Target_powerpc::Scan::global): Don't emit unnecessary
2467 dynamic relocations on TLS GOT entries.
2468
00716ab1
AM
24692012-09-10 Matthias Klose <doko@ubuntu.com>
2470
2471 * config.in: Disable sanity check for kfreebsd.
2472
c891b3f9
SA
24732012-09-10 Sterling Augustine <saugustine@google.com>
2474
2475 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2476 (Gdb_index::pubtypes_read): New parameter.
2477 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2478 to calls.
2479 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2480 pubtypes_object_.
2481
e81fea4d
AM
24822012-09-09 Alan Modra <amodra@gmail.com>
2483
2484 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2485 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2486 * gc.h (gc_process_relocs): Call target gc_add_reference.
2487 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2488 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2489 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2490 unnecessary cast.
2491 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2492 to cater for when we don't need code offset. Update use.
2493 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2494 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2495 set_opd_valid): New functions.
2496 (Target_powerpc::do_gc_add_reference): New function.
2497 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2498 stashed refs.
2499 (Target_powerpc::do_gc_mark_symbol): New function.
2500
d2d60eef
CC
25012012-09-06 Cary Coutant <ccoutant@google.com>
2502
2503 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2504 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2505 (Dwarf_die::skip_attributes): Likewise.
2506 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2507 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2508 (main): Call it.
2509 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2510
32ed4573
L
25112012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2512
2513 * testsuite/script_test_3.t: Add .got.plt output section
2514 statement.
2515 * testsuite/script_test_4.t: Likewise.
2516
f4baf0d4
AM
25172012-09-05 Alan Modra <amodra@gmail.com>
2518
2519 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2520 update all uses and lose "enum" when using type.
2521
864a1b56
AM
25222012-09-05 Alan Modra <amodra@gmail.com>
2523
2524 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2525 * configure: Regenerate.
2526 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2527 (plugin_final_layout.stdout): Likewise.
2528 (memory_test): Set page sizes to 0x1000.
2529 * testsuite/Makefile.in: Regenerate.
2530 * testsuite/discard_locals_test.sh: Add FIXME comment.
2531 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2532 * testsuite/pr14265.t: Add .got output section statement.
2533 * testsuite/script_test_2.t: Likewise.
2534 * testsuite/script_test_3.t: Likewise.
2535 * testsuite/script_test_4.t: Likewise.
2536 * testsuite/script_test_5.t: Likewise.
2537 * testsuite/script_test_6.t: Likewise.
2538 * testsuite/script_test_7.t: Likewise.
2539 * testsuite/script_test_9.t: Likewise.
2540
3ea0a085
AM
25412012-09-05 Alan Modra <amodra@gmail.com>
2542
2543 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2544 (Powerpc_relocate_functions::Status): New typedef.
2545 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2546 (Target_powerpc::Scan::local): Handle REL64.
2547 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2548 for REL32 and REL64.
2549 (Target_powerpc::symval_for_branch): New function, extracted from..
2550 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2551 checks. Report overflow errors.
2552
7404fe1b
AM
25532012-09-05 Alan Modra <amodra@gmail.com>
2554
2555 * object.h (Sized_relobj_file::emit_relocs): Delete.
2556 (Sized_relobj_file::emit_relocs_reltype): Delete.
2557 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2558 relocate_relocs for --emit-relocs.
2559 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2560 * output.h: Update comment.
2561 (Output_segment::first_section): New function.
2562 (Output_segment::first_section_load_address): Use first_section.
2563 * output.cc (Output_segment::first_section): New function extracted..
2564 (Output_segment::first_section_load_address): ..from here. Delete.
2565 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2566 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2567 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2568 adjust call to target.h function.
2569 * i386.cc (Target_i386): Likewise.
2570 * sparc.cc (Target_sparc): Likewise.
2571 * x86_64.cc (Target_x86_64): Likewise.
2572 * powerpc.cc (Target_powerpc): Likewise.
2573 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2574 first tls section has section symbol for optimised local dynamic
2575 output relocs.
2576 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2577 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2578 optimised tls code.
2579 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2580 Rename to relocate_relocs. Update error message.
2581
957564c9
AS
25822012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2583
2584 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2585 --just-symbols.
2586
dd93cd0a
AM
25872012-08-31 Alan Modra <amodra@gmail.com>
2588
2589 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2590 (Powerpc_relobj::toc_base_offset): New stub function.
2591 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2592 got_mod_index_offset to tlsld_got_offset. Update all refs.
2593 (Target_powerpc::Relocate::enum skip_tls): New.
2594 (Target_powerpc::call_tls_get_addr_): New var.
2595 (Target_powerpc::is_branch_reloc): Move to file scope.
2596 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2597 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2598 New functions.
2599 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2600 (powerpc_info): Correct common_pagesize for ppc64.
2601 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2602 (Powerpc_relocate_functions): Add overflow check enums and functions.
2603 Add non-shift version of rela, rela_ua. Delete all rel public
2604 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2605 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2606 addr16_ha3, addr14 functions.
2607 (Output_data_got_powerpc::add_constant_pair): New function.
2608 (Output_data_got_powerpc::got_base_offset): Likewise.
2609 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2610 (instruction constants): Sort, add some more.
2611 (Output_data_glink::do_write): Add and use Address typedef. Use
2612 object->toc_base_offset() stub for 64-bit.
2613 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2614 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2615 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2616 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2617 Always treat .opd relocs as against locally defined symbol.
2618 Correct condition for RELATIVE relocs.
2619 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2620 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2621 for 32-bit syms with a plt entry. Correct ppc64 toc base
2622 calculations. Handle TLS relocs, and more. Add overflow
2623 checking and adjust for Powerpc_relocate_functions changes.
2624 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2625 Reinstate --emit-relocs code with FIXME.
2626
a1373b60
AM
26272012-08-30 Alan Modra <amodra@gmail.com>
2628
2629 * layout.cc (Layout::set_segment_offsets): Set p_align to
2630 abi_pagesize, not common_pagesize.
2631 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2632 to determine whether file header can go in segment.
2633
703d02da
AM
26342012-08-30 Alan Modra <amodra@gmail.com>
2635
2636 * output.h (Output_reloc::Output_reloc <output section>): Add
2637 is_relative param. Adjust calls.
2638 (Output_reloc::add_output_section_relative): New functions.
2639 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2640 is_relative.
2641 (Output_reloc::symbol_value): Handle SECTION_CODE.
2642
16164a6b
ST
26432012-08-24 Sriraman Tallam <tmsriram@google.com>
2644
2645 * gold.cc (queue_middle_tasks): Call layout again when unique
2646 segments for sections is desired.
2647 * layout.cc (Layout::Layout): Initialize new members.
2648 (Layout::get_output_section_flags): New function.
2649 (Layout::choose_output_section): Call get_output_section_flags.
2650 (Layout::layout): Make output section for mapping to a unique segment.
2651 (Layout::insert_section_segment_map): New function.
2652 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 2653 output sections marked so.
16164a6b
ST
2654 (Layout::segment_precedes): Check for unique segments when sorting.
2655 * layout.h (Layout::Unique_segment_info): New struct.
2656 (Layout::Section_segment_map): New typedef.
2657 (Layout::insert_section_segment_map): New function.
2658 (Layout::get_output_section_flags): New function.
2659 (Layout::is_unique_segment_for_sections_specified): New function.
2660 (Layout::set_unique_segment_for_sections_specified): New function.
2661 (Layout::unique_segment_for_sections_specified_): New member.
2662 (Layout::section_segment_map_): New member.
2663 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2664 Rename is_gc_pass_one to is_pass_one.
2665 Rename is_gc_pass_two to is_pass_two.
2666 Rename is_gc_or_icf to is_two_pass.
2667 Check for which pass based on whether symbols data is present.
2668 Make it two pass when unique segments for sections is desired.
2669 * output.cc (Output_section::Output_section): Initialize new
2670 members.
2671 * output.h (Output_section::is_unique_segment): New function.
2672 (Output_section::set_is_unique_segment): New function.
2673 (Output_section::is_unique_segment_): New member.
2674 (Output_section::extra_segment_flags): New function.
2675 (Output_section::set_extra_segment_flags): New function.
2676 (Output_section::extra_segment_flags_): New member.
2677 (Output_section::segment_alignment): New function.
2678 (Output_section::set_segment_alignment): New function.
2679 (Output_section::segment_alignment_): New member.
2680 (Output_segment::Output_segment): Initialize is_unique_segment_.
2681 (Output_segment::is_unique_segment): New function.
2682 (Output_segment::set_is_unique_segment): New function.
2683 (Output_segment::is_unique_segment_): New member.
2684 * plugin.cc (allow_unique_segment_for_sections): New function.
2685 (unique_segment_for_sections): New function.
2686 (Plugin::load): Add new functions to transfer vector.
2687 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2688 * Makefile.in: Regenerate.
2689 * testsuite/plugin_final_layout.sh: Check if unique segment
2690 functionality works.
2691 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2692 are available.
2693 (allow_unique_segment_for_sections): New global.
2694 (unique_segment_for_sections): New global.
2695 (claim_file_hook): Call allow_unique_segment_for_sections.
2696 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 2697
1e2bee4f
CC
26982012-08-22 Cary Coutant <ccoutant@google.com>
2699
2700 * layout.cc (Layout::include_section): Don't assert on GROUP
2701 sections with --emit-relocs.
2702
1d5dfe78
CC
27032012-08-21 Cary Coutant <ccoutant@google.com>
2704
2705 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2706 if --export-dynamic-symbol names an undef symbol.
2707
c9269dff
AM
27082012-08-18 Alan Modra <amodra@gmail.com>
2709
2710 * powerpc.cc: Formatting and white space.
2711 (Powerpc_relobj): Rename got2_section_ to special_.
2712 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2713 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2714 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2715 (Target_powerpc): Add Address typedef and invalid_address. Use
2716 throughout.
2717 (Target_powerpc::is_branch_reloc): New function.
2718 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2719 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2720 for dst_mask, value and addend.
2721 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2722 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2723 (Output_data_glink::do_write): Correct toc base. Don't try to use
2724 uint16_t for 24-bit offset. Use get_output_section_offset and
2725 check return.
2726 (Target_powerpc::Scan::local): Handle more relocs.
2727 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2728 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2729 Plug in toc restoring insn after plt calls. Translate branches
2730 to function descriptor symbols to corresponding entry point.
2731 (Target_powerpc::relocate_for_relocatable): Check return from
2732 get_output_section_offset.
2733 * symtab.h: Comment typo.
2734
b1759dce
ILT
27352012-08-14 Ian Lance Taylor <iant@google.com>
2736
2737 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2738 unsupported_relocal_local to call unsupported_reloc_global.
2739
b9b2ae8b
NC
27402012-08-14 Nick Clifton <nickc@redhat.com>
2741
2742 PR ld/14265
2743 * script-sections.cc (Sections_element::output_section_name): Add
2744 keep return parameter.
2745 (Output_section_element::match_name): Add keep return parameter.
2746 Return the value of the keep_ member.
2747 * script-sections.h (class Output_section): Update
2748 output_section_name prototype.
2749 * layout.cc (Layout::keep_input_section): New public member
2750 function.
2751 (Layout::choose_output_section): Pass keep parameter to
2752 output_section_name.
2753 * layout.h (class Layout): Add keep_input_section.
2754 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2755 sections.
2756 * testsuite/Makefile.am: Add a test.
2757 * testsuite/Makefile.in: Regenerate.
2758 * testsuite/pr14265.c: Source file for the test.
2759 * testsuite/pr14265.t: Linker script for the test.
2760 * testsuite/pr14265.sh: Shell script for the test.
2761
921b5322
AM
27622012-08-14 Alan Modra <amodra@gmail.com>
2763
2764 * target.h (Target::output_section_name): New function.
2765 (Target::do_output_section_name): New function.
2766 * layout.cc (Layout::choose_output_section): Call the above.
2767 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2768
6ce78956
AM
27692012-08-14 Alan Modra <amodra@gmail.com>
2770
2771 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2772 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2773 for replace_constant call.
2774 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2775 (Output_data_glink::do_print_to_mapfile): New function.
2776 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2777 (Target_powerpc::Relocate::relocate): Likewise.
2778
d1a8cabd
AM
27792012-08-14 Alan Modra <amodra@gmail.com>
2780
2781 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2782 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2783 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2784 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2785 all references to shndx_. Handle special case for R_PPC_PLTREL24
2786 here.
2787 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2788 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2789 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2790 here.
2791 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2792 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2793
d83ce4e3
AM
27942012-08-12 Alan Modra <amodra@gmail.com>
2795
2796 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2797 (glink insn constants): Use uint32_t.
2798 (Output_data_glink::add_entry): Use insert, not [] operator.
2799
cf43a2fe
AM
28002012-08-11 Alan Modra <amodra@gmail.com>
2801
2802 * object.h (Sized_relobj_file::find_shdr): New function.
2803 (Sized_relobj_file::find_special_sections): New function.
2804 * object.cc (Sized_relobj_file::find_shdr): New function.
2805 (Sized_relobj_file::find_eh_frame): Use find_shdr.
2806 (Sized_relobj_file::find_special_sections): New function, split out..
2807 (Sized_relobj_file::do_read_symbols): ..from here.
2808 * output.h (Output_data_got::replace_constant): New function.
2809 (Output_data_got::num_entries): New function.
2810 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
2811 (Output_data_got::got_offset): Protected rather than private.
2812 (Output_data_got::replace_got_entry): New function.
2813 * output.cc (Output_data_got::replace_got_entry): New function.
2814 * powerpc.cc (class Powerpc_relobj): New.
2815 (class Powerpc_relocate_functions): Delete all psymval variants or
2816 convert to value,addend type. Delete pcrela, pcrela_unaligned.
2817 Implement _ha functions using corresponding _hi function.
2818 (Powerpc_relobj::find_special_sections): New function.
2819 (Target_powerpc::do_make_elf_object): New function.
2820 (class Output_data_got_powerpc): New.
2821 (class Output_data_glink): New.
2822 (class Powerpc_scan_relocatable_reloc): New.
2823 Many more changes througout file.
2824
3c892704
NC
28252012-08-09 Nick Clifton <nickc@redhat.com>
2826
2827 * po/vi.po: Updated Vietnamese translation.
2828
82435b3b
ILT
28292012-08-07 Ian Lance Taylor <iant@google.com>
2830
2831 * layout.cc (Layout::add_target_dynamic_tags): If
2832 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
2833 plt_rel.
2834
a6dc81d2
NC
28352012-07-30 Nick Clifton <nickc@redhat.com>
2836
2837 * po/gold.pot: Updated template.
2838 * po/es.po: Updated Spanish translation.
2839
f1415016
CC
28402012-07-18 Cary Coutant <ccoutant@google.com>
2841
2842 PR gold/14344
2843 * configure.ac: Add check for -gpubnames support.
2844 * configure: Regenerate.
2845 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
2846 support; force -gno-pubnames.
2847 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
2848 support.
2849 (gdb_index_test_4): New test.
2850 * testsuite/Makefile.in: Regenerate.
2851 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
2852 * testsuite/gdb_index_test_2.sh: Likewise.
2853 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
2854 * testsuite/gdb_index_test_4.sh: New script.
2855 * testsuite/gdb_index_test_comm.sh: New script with common code;
2856 don't look for space after colon.
2857
b7fd7c37
ST
28582012-07-16 Sriraman Tallam <tmsriram@google.com>
2859
2860 * gold.cc (queue_middle_tasks): Update function order only after
2861 deferred objects due to plugins are processed.
2862
1f3212db
ILT
28632012-07-11 Ian Lance Taylor <iant@google.com>
2864
2865 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
2866 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
2867 (Target_arm::scan_reloc_for_stub): Likewise.
2868 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
2869 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
2870 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
2871 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
2872 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
2873
81c82a68
ILT
28742012-07-10 Dodji Seketeli <dodji@redhat.com>
2875 Ian Lance Taylor <iant@google.com>
2876
2877 PR gold/14309
2878 * configure.ac: Test whether std::tr1::hash<off_t> works.
2879 * gold.h: Add a specialization for std::tr1::hash<off_t> if
2880 needed.
2881 * output.h (class Output_fill): Add virtual destructor.
2882 * configure, config.in: Rebuild.
2883
eabc84f4
RM
28842012-06-22 Roland McGrath <mcgrathr@google.com>
2885
2886 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
2887
370e30b6
RÁE
28882012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
2889
2890 * plugin.cc (Plugin::load): Handle position independent executables.
2891
fb1b895d
CC
28922012-06-06 Cary Coutant <ccoutant@google.com>
2893
2894 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
2895 add .debug_macro.
2896 (lines_only_debug_sections): Likewise.
2897 (gdb_fast_lookup_sections): New static array.
2898 (is_gdb_debug_section): Rename formal parameter.
2899 (is_lines_only_debug_section): Likewise.
2900 (is_gdb_fast_lookup_section): New function.
2901 (Layout::include_section): Check for ".zdebug_" prefix; pass
2902 section name suffix to is_gdb_debug_section, et al.; check for
2903 fast-lookup sections when building .gdb_index.
2904 * options.h (--strip-debug-gdb): Update GDB version number.
2905
7c0640fa
CC
29062012-06-06 Cary Coutant <ccoutant@google.com>
2907
2908 * configure.ac: Add check for fallocate.
2909 * configure: Regenerate.
2910 * config.in: Regenerate.
2911
2912 * options.h (class General_options): Add --mmap-output-file and
2913 --posix-fallocate options.
2914 * output.cc: (posix_fallocate): Remove; replace with...
2915 (gold_fallocate): New function.
2916 (Output_file::map_no_anonymous): Call gold_fallocate.
2917 (Output_file::map): Check --mmap-output-file option.
2918
2a49eb69
DK
29192012-06-05 Jing Yu <jingyu@google.com>
2920
2921 * gold.h (textdomain): Add do {} to empty while(0).
2922 (bindtextdomain): Likewise.
2923
fad072ac
CC
29242012-06-04 Cary Coutant <ccoutant@google.com>
2925
2926 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
2927 has_dynsym_index.
2928
8cc69fb6
ST
29292012-05-25 Sriraman Tallam <tmsriram@google.com>
2930
2931 * symtab.cc (Symbol_table::define_special_symbol):
2932 Initialize *poldsym to prevent uninitialized variable errors.
2933
1be75daa
CC
29342012-05-23 Cary Coutant <ccoutant@google.com>
2935
2936 * layout.cc (Layout::section_name_mapping): Add rules to handle
2937 exact match on .data.rel.ro.local or .data.rel.ro.
2938 (Layout::output_section_name): Check for exact matches.
2939
9b689de0
CC
29402012-05-23 Cary Coutant <ccoutant@google.com>
2941
2942 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
2943 more carefully.
2944
b24fdbf5
CC
29452012-05-22 Cary Coutant <ccoutant@google.com>
2946
2947 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
2948 object before exporting symbol.
2949
e550e1a2
L
29502012-05-21 H.J. Lu <hongjiu.lu@intel.com>
2951
2952 * testsuite/tls_test.cc: Include "config.h" first.
2953 * testsuite/tls_test_c.c: Likewise.
2954
df7b86aa
NC
29552012-05-17 Daniel Richard G. <skunk@iskunk.org>
2956 Nick Clifton <nickc@redhat.com>
2957
2958 PR 14072
2959 * configure.in: Add check that sysdep.h has been included before
2960 any system header files.
2961 * configure: Regenerate.
2962 * config.in: Regenerate.
2963
1007b503
CC
29642012-05-14 Cary Coutant <ccoutant@google.com>
2965
2966 * layout.cc (Layout::make_output_section): Mark .tdata section
2967 as RELRO.
2968 * testsuite/relro_test.cc: Add a TLS variable.
2969
fd885f3a
L
29702012-05-10 H.J. Lu <hongjiu.lu@intel.com>
2971
2972 PR gold/14091
2973 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
2974 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
2975 R_X86_64_64.
2976
80f5885c
CC
29772012-05-08 Cary Coutant <ccoutant@google.com>
2978
2979 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
2980 (lines_only_debug_sections): Likewise.
2981
2e702c99
RM
29822012-05-02 Roland McGrath <mcgrathr@google.com>
2983
2984 * nacl.cc: New file.
2985 * nacl.h: New file.
2986 * Makefile.am (CCFILES, HFILES): Add them.
2987 * Makefile.in: Regenerate.
2988 * i386.cc (Output_data_plt_i386_nacl): New class.
2989 (Output_data_plt_i386_nacl_exec): New class.
2990 (Output_data_plt_i386_nacl_dyn): New class.
2991 (Target_i386_nacl): New class.
2992 (Target_selector_i386_nacl): New class.
2993 (target_selector_i386): Use it instead of Target_selector_i386.
2994 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
2995 (Target_x86_64_nacl): New class.
2996 (Target_selector_x86_64_nacl): New class.
2997 (target_selector_x86_64, target_selector_x32): Use it instead of
2998 Target_selector_x86_64.
2999 * arm.cc (Output_data_plt_arm_nacl): New class.
3000 (Target_arm_nacl): New class.
3001 (Target_selector_arm_nacl): New class.
3002 (target_selector_arm, target_selector_armbe): Use it instead of
3003 Target_selector_arm.
3004
3005 * target-select.cc (select_target): Take new Input_file* and off_t
3006 arguments, pass them on to recognize method of selector.
3007 * object.cc (make_elf_sized_object): Update caller.
3008 * parameters.cc (parameters_force_valid_target): Likewise.
3009 * incremental.cc (make_sized_incremental_binary): Likewise.
3010 * target-select.h: Update decl.
3011 (Target_selector::recognize): Take new Input_file* argument,
3012 pass it on to do_recognize.
3013 (Target_selector::do_recognize): Take new Input_file* argument.
3014 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3015 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3016 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3017 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3018
3019 * target.h (Target::Target_info): New members isolate_execinstr
3020 and rosegment_gap.
3021 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3022 * arm.cc (Target_arm::arm_info): Update initializer.
3023 * i386.cc (Target_i386::i386_info): Likewise.
3024 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3025 * sparc.cc (Target_sparc::sparc_info): Likewise.
3026 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3027 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3028 * layout.cc (Layout::attach_allocated_section_to_segment):
3029 Take new const Target* argument. If target->isolate_execinstr(), act
3030 like --rosegment.
3031 (Layout::find_first_load_seg): Take new const Target* argument;
3032 if target->isolate_execinstr(), reject PF_X segments.
3033 (Layout::relaxation_loop_body): Update caller.
3034 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3035 reset file offset to zero when we hit LOAD_SEG, and then do a second
3036 loop over the segments before LOAD_SEG to reassign offsets after
3037 addresses have been determined. Handle target->rosegment_gap().
3038 (Layout::attach_section_to_segment): Take new const Target* argument;
3039 pass it to attach_allocated_section_to_segment.
3040 (Layout::make_output_section): Update caller.
3041 (Layout::attach_sections_to_segments): Take new const Target* argument;
3042 pass it to attach_section_to_segment.
3043 * gold.cc (queue_middle_tasks): Update caller.
3044 * layout.h (Layout): Update method decls with new arguments.
3045
3046 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3047 Target_info pointer to use.
3048 (Target_arm::do_make_data_plt): New virtual method.
3049 (Target_arm::make_data_plt): New method that calls it.
3050 (Target_arm::make_plt_entry): Use it.
3051 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3052 for the section alignment.
3053 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3054 method.
3055 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3056 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3057 method.
3058 (Output_data_plt_arm::get_plt_entry_size): Call it.
3059 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3060 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3061 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3062 method.
3063 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3064 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3065 method instead of sizeof(plt_entry).
3066 (Output_data_plt_arm::add_entry): Likewise.
3067 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3068 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3069 than static method.
3070 (Target_arm::plt_entry_size): Likewise.
3071 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3072 Move to ...
3073 (Output_data_plt_arm_standard): ... here, new class.
3074 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3075 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3076 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3077
3078 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3079 Take additional argument for the PLT entry size.
3080 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3081 Use get_plt_entry_size method rather than plt_entry_size variable.
3082 (Output_data_plt_x86_64::reserve_slot): Likewise.
3083 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3084 (Output_data_plt_x86_64::add_entry): Likewise.
3085 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3086 (Output_data_plt_x86_64::address_for_global): Likewise.
3087 (Output_data_plt_x86_64::address_for_local): Likewise.
3088 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3089 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3090 Make method non-static.
3091 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3092 method.
3093 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3094 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3095 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3096 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3097 virtual method.
3098 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3099 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3100 virtual method.
3101 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3102 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3103 virtual method.
3104 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3105 (Output_data_plt_x86_64::plt_entry_size)
3106 (Output_data_plt_x86_64::first_plt_entry)
3107 (Output_data_plt_x86_64::plt_entry)
3108 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3109 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3110 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3111 (Output_data_plt_x86_64_standard): ... here, new class.
3112 (Target_x86_64::Target_x86_64): Take optional argument for the
3113 Target_info pointer to use.
3114 (Target_x86_64::do_make_data_plt): New virtual method.
3115 (Target_x86_64::make_data_plt): New method to call it.
3116 (Target_x86_64::init_got_plt_for_update): Use that.
3117 Call this->plt_->add_eh_frame method here.
3118 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3119 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3120 rather than static method.
3121 (Target_x86_64::plt_entry_size): Likewise.
3122 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3123 rather than plt_entry_size variable. Move guts of PLT filling to...
3124 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3125 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3126 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3127
3128 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3129 additional argument for the section alignment.
3130 Don't do add_eh_frame_for_plt here.
3131 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3132 non-static. Use get_plt_entry_size method rather than plt_entry_size
3133 variable.
3134 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3135 method.
3136 (Output_data_plt_i386::get_plt_entry_size): Call it.
3137 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3138 (Output_data_plt_i386::add_eh_frame): New method to call it.
3139 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3140 method.
3141 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3142 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3143 method.
3144 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3145 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3146 method instead of plt_entry_size.
3147 (Output_data_plt_i386::plt_entry_size)
3148 (Output_data_plt_i386::plt_eh_frame_fde_size)
3149 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3150 (Output_data_plt_i386_standard): ... here, new class.
3151 (Output_data_plt_i386_exec): New class.
3152 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3153 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3154 (Output_data_plt_i386::exec_plt_entry): Move to ...
3155 (Output_data_plt_i386_exec::plt_entry): ... here.
3156 (Output_data_plt_i386_dyn): New class.
3157 (Output_data_plt_i386::first_plt_entry): Move to ...
3158 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3159 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3160 (Output_data_plt_i386_dyn::plt_entry): ... here.
3161 (Target_i386::Target_i386): Take optional argument for the Target_info
3162 pointer to use.
3163 (Target_i386::do_make_data_plt): New virtual method.
3164 (Target_i386::make_data_plt): New method to call it.
3165 (Target_i386::make_plt_section): Use that.
3166 Call this->plt_->add_eh_frame method here.
3167 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3168 rather than plt_entry_size variable.
3169 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3170 (Output_data_plt_i386::address_for_local): Likewise.
3171 (Output_data_plt_i386::do_write): Likewise.
3172 Move guts of PLT filling to...
3173 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3174 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3175 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3176 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3177
b9b9f2ee
CC
31782012-05-01 Cary Coutant <ccoutant@google.com>
3179
3180 * dwarf_reader.cc (Dwarf_die::read_attributes)
3181 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3182 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3183 * reduced_debug_output.cc
3184 (Output_reduced_debug_info_section::get_die_end): Remove
3185 DW_FORM_GNU_ref_index. Add default case.
3186
57923f48
MW
31872012-04-26 Mark Wielaard <mjw@redhat.com>
3188
3189 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3190 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3191 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3192 DW_AT_high_pc as offset from DW_AT_low_pc.
3193
3194 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3195 * testsuite/Makefile.in: Regenerate.
3196 * testsuite/gdb_index_test_3.c: New test source file.
3197 * testsuite/gdb_index_test_3.sh: New test source file.
3198
2c54b4f4
ILT
31992012-04-25 Ian Lance Taylor <iant@google.com>
3200
3201 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3202 pointer.
3203 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3204 as a class, not a struct.
3205 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3206 (Target_arm::apply_cortex_a8_workaround): Likewise.
3207 * gc.h: Declare Reloc_types as a struct, not a class.
3208 * object.h: Declare Symbols_data as a struct.
3209 * reloc.h: Declare Read_relocs_data as a struct.
3210 * target.h: Declare Relocate_info as a struct.
3211
a5a5f7a3
DM
32122012-04-24 David S. Miller <davem@davemloft.net>
3213
3214 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3215 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3216 and R_SPARC_WPLT30.
3217
f038d496
CC
32182012-04-24 Cary Coutant <ccoutant@google.com>
3219
3220 * incremental-dump.cc (find_input_containing_global): Replace
3221 magic number with symbolic constant.
3222 (dump_incremental_inputs): Update version number.
3223 * incremental.cc (Output_section_incremental_inputs): Update version
3224 number; import symbolic constants from Incremental_inputs_reader.
3225 (Incremental_inputs::create_data_sections): Align relocations
3226 section correctly for 64-bit targets.
3227 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3228 constants; add padding.
3229 (Output_section_incremental_inputs::write_header): Add assert for
3230 header_size.
3231 (Output_section_incremental_inputs::write_input_files): Add assert
3232 for input_entry_size.
3233 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3234 add assert for object_info_size, input_section_entry_size,
3235 global_sym_entry_size.
3236 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3237 for data structure sizes; use them.
3238 (Incremental_input_entry_reader): Import symbolic constants from
3239 Incremental_inputs_reader; use them.
3240
a4d85145
DM
32412012-04-23 David S. Miller <davem@davemloft.net>
3242
3243 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3244 and elf_flags_set_.
3245 (Target_sparc::Target_sparc): Initialize new fields.
3246 (Target_sparc::do_make_elf_object): New function.
3247 (Target_sparc::do_adjust_elf_header): New function.
3248
1d509098
CC
32492012-04-23 Cary Coutant <ccoutant@google.com>
3250
3251 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3252 CU range table of gdb index.
3253
7ebeff7f
DM
32542012-04-20 David S. Miller <davem@davemloft.net>
3255
3256 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3257 instead of false.
3258
13cf9988
DM
32592012-04-16 David S. Miller <davem@davemloft.net>
3260
2a1079e8
DM
3261 * sparc.cc (Target_sparc::got_address): New function.
3262 (Sparc_relocate_functions::gdop_hix22): New function.
3263 (Sparc_relocate_functions::gdop_lox10): New function.
3264 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3265 relocs.
3266 (Target_sparc::Scan::local): Likewise if the global symbol is not
3267 preemptible and is not IFUNC.
3268 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3269 transformations for local and non-preemptible non-IFUNC global
3270 symbols.
3271
0bc964fc
DM
3272 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3273 writing out 64-bit part of ranges.
3274
661d7a80
DM
3275 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3276 -fpic and -fpie respectively.
3277 * Makefile.in: Regenerate.
3278
8c2bf391
DM
3279 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3280 (Target_sparc::Target_sparc): Initialize new field.
3281 (Target_sparc::do_plt_section_for_global): New function.
3282 (Target_sparc::do_plt_section_for_local): New function.
3283 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3284 (Target_sparc::make_plt_section): New function, broken out of
3285 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3286 (Target_sparc::make_plt_entry): Call make_plt_section.
3287 (Target_sparc::make_local_ifunc_plt_entry): New function.
3288 (Target_sparc::rela_ifunc_section): New function.
3289 (Target_sparc::plt_section): Remove const.
3290 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3291 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3292 and ifunc_count_ fields.
3293 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3294 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3295 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3296 (Output_data_plt_sparc::rela_ifunc): New function.
3297 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3298 (Output_data_plt_sparc::has_ifunc_section): New function.
3299 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3300 (Output_data_plt_sparc::address_for_global): New function.
3301 (Output_data_plt_sparc::address_for_local): New function.
3302 (Output_data_plt_sparc::plt_index_to_offset): New function.
3303 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3304 and entry_count.
3305 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3306 entry_count.
3307 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3308 R_SPARC_JMP_IREL to switch.
3309 (Target_sparc::Scan::check_non_pic): Likewise.
3310 (Target_sparc::Scan::local): Handle IFUNC symbols.
3311 (Target_sparc::Scan::local): Likewise.
3312 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3313 and plt_address_for_local.
3314 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3315 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3316
13cf9988
DM
3317 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3318 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3319 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3320 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3321 global relocs too.
3322 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3323 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3324 calls.
3325 * sparc.cc (Target_sparc::Scan::global): Likewise.
3326 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3327
31821be0
CC
33282012-04-16 Cary Coutant <ccoutant@google.com>
3329
3330 * archive.cc (Library_base::should_include_member): Check for
3331 --export-dynamic-symbol.
3332 * options.h (class General_options): Add --export-dynamic-symbol.
3333 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3334 --export-dynamic-symbol.
3335 (Symbol_table::gc_mark_undef_symbols): Likewise.
3336 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3337
2615994e
DM
33382012-04-12 David S. Miller <davem@davemloft.net>
3339
3340 * sparc.cc (Reloc::wdisp10): New relocation method.
3341 (Reloc::h34): Likewise.
3342 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3343 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3344 R_SPARC_WDISP10.
3345 (Target_sparc::Scan::local): Likewise.
3346 (Target_sparc::Scan::global): Likewise.
3347 (Target_sparc::Relocate::relocate): Likewise.
3348
6782735d
CC
33492012-04-09 Cary Coutant <ccoutant@google.com>
3350
3351 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3352 low_pc == 0.
3353
8c7a0b00
ILT
33542012-04-06 Ian Lance Taylor <iant@google.com>
3355
3356 * timer.cc: #include <unistd.h>.
3357
58797674
RM
33582012-04-06 Roland McGrath <mcgrathr@google.com>
3359
3360 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3361 * config.in: Regenerate.
3362 * configure: Regenerate.
3363
44350750
NC
33642012-04-05 Nick Clifton <nickc@redhat.com>
3365
3366 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3367 (AM_LC_MESSAGES): Add.
3368 * aclocal.m4: Regenerate.
3369 * config.in: Regenerate.
3370 * configure: Regenerate.
3371
c1027032
CC
33722012-03-21 Cary Coutant <ccoutant@google.com>
3373
3374 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3375 * Makefile.in: Regenerate.
3376 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3377 (Sized_elf_reloc_mapper::symbol_section): New function.
3378 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3379 (make_elf_reloc_mapper): New function.
3380 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3381 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3382 (Dwarf_abbrev_table::do_get_abbrev): New function.
3383 (Dwarf_ranges_table::read_ranges_table): New function.
3384 (Dwarf_ranges_table::read_range_list): New function.
3385 (Dwarf_pubnames_table::read_section): New function.
3386 (Dwarf_pubnames_table::read_header): New function.
3387 (Dwarf_pubnames_table::next_name): New function.
3388 (Dwarf_die::Dwarf_die): New function.
3389 (Dwarf_die::read_attributes): New function.
3390 (Dwarf_die::skip_attributes): New function.
3391 (Dwarf_die::set_name): New function.
3392 (Dwarf_die::set_linkage_name): New function.
3393 (Dwarf_die::attribute): New function.
3394 (Dwarf_die::string_attribute): New function.
3395 (Dwarf_die::int_attribute): New function.
3396 (Dwarf_die::uint_attribute): New function.
3397 (Dwarf_die::ref_attribute): New function.
3398 (Dwarf_die::child_offset): New function.
3399 (Dwarf_die::sibling_offset): New function.
3400 (Dwarf_info_reader::check_buffer): New function.
3401 (Dwarf_info_reader::parse): New function.
3402 (Dwarf_info_reader::do_parse): New function.
3403 (Dwarf_info_reader::do_read_string_table): New function.
3404 (Dwarf_info_reader::lookup_reloc): New function.
3405 (Dwarf_info_reader::get_string): New function.
3406 (Dwarf_info_reader::visit_compilation_unit): New function.
3407 (Dwarf_info_reader::visit_type_unit): New function.
3408 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3409 Sized_elf_reloc_mapper.
3410 (Sized_dwarf_line_info::symbol_section): Remove function.
3411 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3412 (Sized_dwarf_line_info::read_line_mappings): Remove object
3413 parameter, adjust callers.
3414 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3415 * dwarf_reader.h: Include <sys/types.h>.
3416 (class Track_relocs): Remove forward declaration.
3417 (class Elf_reloc_mapper): New class.
3418 (class Sized_elf_reloc_mapper): New class.
3419 (class Dwarf_abbrev_table): New class.
3420 (class Dwarf_range_list): New class.
3421 (class Dwarf_ranges_table): New class.
3422 (class Dwarf_pubnames_table): New class.
3423 (class Dwarf_die): New class.
3424 (class Dwarf_info_reader): New class.
3425 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3426 (Sized_dwarf_line_info::symbol_section): Remove member function.
3427 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3428 base class.
3429 * gdb-index.cc: New source file.
3430 * gdb-index.h: New source file.
3431 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3432 and .debug_types sections, call Layout::add_to_gdb_index.
3433 (Sized_relobj_incr::do_section_name): Implement.
3434 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3435 return type; Implement.
3436 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3437 return type.
3438 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3439 parameter list and return type.
3440 (Sized_incr_dynobj::do_section_contents): Likewise.
3441 * layout.cc: Include gdb-index.h.
3442 (Layout::Layout): Initialize gdb_index_data_.
3443 (Layout::init_fixed_output_section): Check for .gdb_index section.
3444 (Layout::add_to_gdb_index): New function. Instantiate.
3445 * layout.h: Add forward declaration for class Gdb_index.
3446 (Layout::add_to_gdb_index): New member function.
3447 (Layout::gdb_index_data_): New data member.
3448 * main.cc: Include gdb-index.h.
3449 (main): Print statistics for gdb index.
3450 * object.cc (Object::section_contents): Move code into
3451 do_section_contents.
3452 (need_decompressed_section): Check for sections needed when building
3453 gdb index.
3454 (build_compressed_section_map): Likewise.
3455 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3456 gdb index.
3457 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3458 sections; call Layout::add_to_gdb_index.
3459 (Sized_relobj_file::do_decompressed_section_contents): Call
3460 do_section_contents directly.
3461 * object.h (Object::do_section_contents): Adjust parameter list and
3462 return type.
3463 (Object::do_decompressed_section_contents): Call do_section_contents
3464 directly.
3465 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3466 return type.
3467 * options.h (class General_options): Add --gdb-index option.
3468 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3469 list and return type.
3470 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3471 * reloc.h (Track_relocs::checkpoint): New function.
3472 (Track_relocs::reset): New function.
3473
3474 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3475 New test cases.
3476 * testsuite/Makefile.in: Regenerate.
3477 * testsuite/gdb_index_test.cc: New test source file.
3478 * testsuite/gdb_index_test_1.sh: New test source file.
3479 * testsuite/gdb_index_test_2.sh: New test source file.
3480
647f1574
DK
34812012-03-19 Doug Kwan <dougkwan@google.com>
3482
3483 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3484 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3485 __exidx_start and __exidx_end. Make symbol table parameter
3486 anonymous as it is not used.
3487 * gold.cc (queue_middle_tasks): Call target hook to define any
3488 target-specific symbols.
3489 * target.h (Target::define_standard_symbols): New method.
3490 (Target::do_define_standard_symbols): Same.
3491 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3492 * testsuite/Makefile.in: Regenerate.
3493 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3494 and __exidx_end.
3495 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3496 relocations are generated for __exidx_start and __exidx_end.
3497
7c6109da
DK
34982012-03-16 Doug Kwan <dougkwan@google.com>
3499
3500 * testsuite/Makefile.am: Disable test initpri3b.
3501 * testsuite/Makefile.in: Regenerate.
3502
7b8957f8
DK
35032012-03-15 Doug Kwan <dougkwan@google.com>
3504
3505 * arm.cc (Target_arm::got_section): Make .got section read-only
3506 if -z now is given.
3507
14dc9ef7
ILT
35082012-03-15 Ian Lance Taylor <iant@google.com>
3509
3510 PR gold/13850
3511 * layout.cc (Layout::make_output_section): Correctly mark
3512 SHT_INIT_ARRAY, et. al., as relro.
3513
fa40b62a
DK
35142012-03-14 Doug Kwan <dougkwan@google.com>
3515
3516 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3517 dynamic relocations for protected symbols in shared objects.
3518
fd325007
ILT
35192012-03-13 Ian Lance Taylor <iant@google.com>
3520
3521 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3522 keep the larger alignment.
3523
e8dd54e1
CC
35242012-03-12 Cary Coutant <ccoutant@google.com>
3525
3526 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3527 handling of DW_LNE_define_file.
3528
feb5f3b0
CC
35292012-03-12 Cary Coutant <ccoutant@google.com>
3530
3531 * reduced_debug_output.cc
3532 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3533 codes to switch.
3534
a1fb4256
CC
35352012-02-29 Cary Coutant <ccoutant@google.com>
3536
3537 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3538
5dd8762a
CC
35392012-02-29 Cary Coutant <ccoutant@google.com>
3540
3541 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3542 Call Object::decompressed_section_contents.
3543 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3544 New dtor.
3545 (Sized_dwarf_line_info::buffer_start_): New data member.
3546 * merge.cc (Output_merge_data::do_add_input_section): Call
3547 Object::decompressed_section_contents.
3548 (Output_merge_string::do_add_input_section): Likewise.
3549 * object.cc (need_decompressed_section): New function.
3550 (build_compressed_section_map): Decompress sections needed later.
3551 (Sized_relobj_file::do_decompressed_section_contents): New function.
3552 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3553 * object.h (Object::decompressed_section_contents): New function.
3554 (Object::discard_decompressed_sections): New function.
3555 (Object::do_decompressed_section_contents): New function.
3556 (Object::do_discard_decompressed_sections): New function.
3557 (Compressed_section_info): New type.
3558 (Compressed_section_map): Include decompressed section contents.
3559 (Sized_relobj_file::do_decompressed_section_contents): New function.
3560 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3561
7b5de7ee
CC
35622012-02-16 Cary Coutant <ccoutant@google.com>
3563
3564 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3565 * testsuite/Makefile.in: Regenerate.
3566
f9fa4a63
CC
35672012-02-14 Cary Coutant <ccoutant@google.com>
3568
3569 * options.cc (General_options::finalize): Disallow -pie and -static.
3570
2c175ebc
DK
35712012-02-03 Doug Kwan <dougkwan@google.com>
3572
3573 * arm.cc (Arm_relocate_functions::abs8,
3574 Arm_relocate_functions::abs16): Use
3575 Bits::has_signed_unsigned_overflow32.
3576 (Arm_relocate_functions::thm_abs8): Correct range of
3577 overflow check.
3578 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3579 in assertions.
3580
90cff06f
DK
35812012-02-02 Doug Kwan <dougkwan@google.com>
3582
3583 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3584 position independent outputs, not just shared objects.
3585
63887f3d
L
35862012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3587
3588 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3589 * configure: Regenerated.
3590
bef2b434
ILT
35912012-01-27 Ian Lance Taylor <iant@google.com>
3592
3593 * reloc.h (Bits): New class with static functions, copied from
3594 namespace utils in arm.cc.
3595 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3596 instead.
3597
c335b55d
L
35982012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3599
3600 * incremental.cc (write_info_blocks): Correct relocation offset.
3601
41194d9f
L
36022012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3603
3604 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3605 (Relocate::tls_gd_to_le): Likewise.
3606
1bae613c
L
36072012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3608
3609 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3610
24482ca0
L
36112012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3612
3613 * configure.ac: Check if -mcmodel=medium works.
3614 * configure: Regenerated.
3615
c2c7840a
CC
36162012-01-24 Cary Coutant <ccoutant@google.com>
3617
3618 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3619 definition and ...
3620 (read_unsigned_LEB_128_x): ... this new function.
3621 (read_signed_LEB_128): Replaced with inline definition and ...
3622 (read_signed_LEB_128_x): ... this new function.
3623 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3624 (read_unsigned_LEB_128): Add inline definition.
3625 (read_signed_LEB_128_x): New function.
3626 (read_signed_LEB_128): Add inline definition.
3627 * testsuite/Makefile.am (leb128_unittest): New unit test.
3628 * testsuite/Makefile.in: Regenerate.
3629 * testsuite/leb128_unittest.cc: New unit test.
3630
833de760 36312012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3632
3633 PR gold/13617
3634 * i386.cc (Target_i386::do_code_fill): When using a jmp
3635 instruction, pad with nop instructions.
3636 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3637
618d6666
L
36382012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3639
3640 * x86_64.cc (gc_process_relocs): Add typename on types used in
3641 template.
3642 (scan_relocs): Likewise.
3643 (relocate_section): Likewise.
3644 (apply_relocation): Likewise.
3645
3660ff06
L
36462012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3647
3648 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3649 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3650 under x32.
3651
fc51264f
L
36522012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3653
3654 * x86_64.cc: Initial support for x32.
3655
dd74ae06
CC
36562012-01-03 Cary Coutant <ccoutant@google.com>
3657
3658 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3659 Use abstract base class for GOT.
3660 * gold/output.h (class Output_data_got_base): New abstract base class.
3661 (class Output_data_got): Derive from new base class, adjust ctors.
3662 (Output_data_got::reserve_slot): Make virtual; rename to
3663 do_reserve_slot; Adjust callers.
3664 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3665 pointer to abstract base class.
3666 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3667
83896202
ILT
36682011-12-18 Ian Lance Taylor <iant@google.com>
3669
3670 * object.h (Relobj::local_symbol_value): New function.
3671 (Relobj::local_plt_offset): New function.
3672 (Relobj::local_has_got_offset): New function.
3673 (Relobj::local_got_offset): New function.
3674 (Relobj::set_local_got_offset): New function.
3675 (Relobj::do_local_symbol_value): New pure virtual function.
3676 (Relobj::do_local_plt_offset): Likewise.
3677 (Relobj::do_local_has_got_offset): Likewise.
3678 (Relobj::do_local_got_offset): Likewise.
3679 (Relobj::do_set_local_got_offset): Likewise.
3680 (Sized_relobj::do_local_has_got_offset): Rename from
3681 local_has_got_offset.
3682 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3683 (Sized_relobj::do_set_local_got_offset): Rename from
3684 set_local_got_offset.
3685 (Sized_relobj_file::do_local_plt_offset): Rename from
3686 local_plt_offset.
3687 (Sized_relobj_file::do_local_symbol_value): New function.
3688 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3689 local_plt_offset.
3690 * output.cc (Output_data_got::Got_entry::write): Change object to
3691 Relobj. Use local_symbol_value.
3692 (Output_data_got::add_global_with_rel): Change rel_dyn to
3693 Output_data_reloc_generic*. Use add_global_generic.
3694 (Output_data_got::add_global_with_rela): Remove. Change all
3695 callers to use add_global_with_rel.
3696 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3697 Output_data_reloc_generic*. Use add_global_generic.
3698 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3699 callers to use add_global_pair_with_rel.
3700 (Output_data_got::add_local): Change object to Relobj*.
3701 (Output_data_got::add_local_plt): Likewise.
3702 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3703 change rel_dyn to Output_data_reloc_generic*. Use
3704 add_local_generic.
3705 (Output_data_got::add_local_with_rela): Remove. Change all
3706 callers to use all_local_with_rel.
3707 (Output_data_got::add_local_pair_with_rel): Change object to
3708 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3709 add_output_section_generic.
3710 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3711 callers to use add_local_pair_with_rel.
3712 (Output_data_got::reserve_local): Change object to Relobj*.
3713 * output.h: (class Output_data_reloc_generic): Add pure virtual
3714 declarations for add_global_generic, add_local_generic,
3715 add_output_section_generic.
3716 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3717 functions for Output_data_reloc_generic. Update declarations for
3718 changes listed in output.cc.
3719 (class Output_data_got): Change template parameter to got_size.
3720 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3721 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3722 function.
3723 (Sized_relobj_incr::do_local_plt_offset): New function.
3724 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3725 add_global_generic.
3726
76677ad0
CC
37272011-12-17 Cary Coutant <ccoutant@google.com>
3728
3729 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3730 * resolve.cc (Symbol_table::resolve): Likewise.
3731 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3732 arrays.
3733 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3734
8b8dd8d5
ILT
37352011-12-16 Ian Lance Taylor <iant@google.com>
3736
3737 * output.h (Output_data_reloc_generic::add): Only call
3738 add_dynamic_reloc if this is a dynamic reloc section.
3739
d55525b9
L
37402011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3741
3742 PR gold/13505
3743 * target-reloc.h (apply_relocation): Replace <64, false> with
3744 <size, big_endian>.
3745
ff81c7c1
NC
37462011-11-25 Nick Clifton <nickc@redhat.com>
3747
3748 * po/it.po: New Italian translation.
3749
628f39be
SA
37502011-11-17 Sterling Augustine <saugustine@google.com>
3751
3752 * script.cc (script_include_directive): Implement.
3753 (read_script_file): New local variables name and search_path. Update
3754 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3755 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3756 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3757
98ef3ea4
SA
37582011-11-11 Sterling Augustine <saugustine@google.com>
3759
3760 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3761 (file_or_sections_cmd): Likewise.
3762
f4a8b6d7
DK
37632011-11-11 Doug Kwan <dougkwan@google.com>
3764
3765 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3766 if --just-symbols is given.
3767
29ab395d
DK
37682011-11-10 Doug Kwan <dougkwan@google.com>
3769
3770 PR gold/13362
3771 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3772 when processing data relocs.
3773 * reloc.h (Relocate_functions::rel_unaligned): New method.
3774 (Relocate_functions::pcrel_unaligned): Ditto.
3775 (Relocate_functions::rel32_unaligned): Ditto.
3776 (Relocate_functions::pcrel32_unaligned): Ditto.
3777
2c339f71
DK
37782011-11-09 Doug Kwan <dougkwan@google.com>
3779
3780 PR gold/13362
3781 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3782 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3783 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3784 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3785 (Relocate_functions::rel_unaligned): New.
3786 (Relocate_functions::rel32_unaligned): New.
3787 * target-reloc.h (relocate_for_relocatable): Add code to handle
3788 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3789 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3790 arm_unaligned_reloc_r): New targets.
3791 * testsuite/Makefile.in: Regenerate.
3792 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3793 linking.
3794
3f3cddf1
ILT
37952011-11-02 Ian Lance Taylor <iant@google.com>
3796
3797 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3798 NATIVE_LINKER.
3799 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
3800 * options.cc (General_options::finalize): Use library search path
3801 from configure script if specified. If not native and no sysroot,
3802 only search TOOLLIBDIR.
3803 * options.h (Search_directory::Search_directory): Change name to
3804 const std::string&.
3805 (General_options::add_to_library_path_with_sysroot): Change arg to
3806 const std::string&.
3807 * configure, Makefile.in, config.in: Rebuild.
3808
a8e2273b
ILT
38092011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3810
3811 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
3812 we are working around the ARM1176 Erratum.
3813 * options.h (General_options::fix_arm1176): Add option.
3814 * testsuite/Makefile.am: Add testcases, and keep current ones
3815 working.
3816 * testsuite/Makefile.in: Regenerate.
3817 * testsuite/arm_fix_1176.s: New file.
3818 * testsuite/arm_fix_1176.sh: Likewise.
3819
cd6eab1c
ILT
38202011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3821
3822 * arm.cc (Target_arm::Target_arm): Remove initialisation of
3823 may_use_blx_.
3824 (Target_arm::may_use_blx): Remove method.
3825 (Target_arm::set_may_use_blx): Likewise.
3826 (Target_arm::may_use_v4t_interworking): New method.
3827 (Target_arm::may_use_v5t_interworking): Likewise.
3828 (Target_arm::may_use_blx_): Remove member variable.
3829 (Arm_relocate_functions::arm_branch_common): Check for v5T
3830 interworking.
3831 (Arm_relocate_functions::thumb_branch_common): Likewise.
3832 (Reloc_stub::stub_type_for_reloc): Likewise.
3833 (Target_arm::do_finalize_sections): Correct interworking checks.
3834 * testsuite/Makefile.am: Add new tests.
3835 * testsuite/Makefile.in: Regenerate.
3836 * testsuite/arm_farcall_arm_arm.s: New test.
3837 * testsuite/arm_farcall_arm_arm.sh: Likewise.
3838 * testsuite/arm_farcall_arm_thumb.s: Likewise.
3839 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
3840 * testsuite/arm_farcall_thumb_arm.s: Likewise.
3841 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
3842 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
3843 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
3844
286adcf4
CC
38452011-10-31 Cary Coutant <ccoutant@google.com>
3846
3847 PR gold/13023
3848 * expression.cc (Expression::eval_with_dot): Add
3849 is_section_dot_assignment parameter.
3850 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
3851 absolute and assigning to dot within a section.
3852 * script-sections.cc
3853 (Output_section_element_assignment::set_section_addresses): Pass
3854 dot_section to set_if_absolute.
3855 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
3856 as is_section_dot_assignment flag to eval_with_dot.
3857 (Output_section_element_dot_assignment::set_section_addresses):
3858 Likewise.
3859 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
3860 parameter. Also set value if relative to dot_section; set the
3861 symbol's output_section.
3862 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
3863 parameter. Adjust all callers.
3864 (Expression::eval_maybe_dot): Likewise.
3865 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
3866 Adjust all callers.
3867 * testsuite/script_test_2.t: Test assignment of an absolute value
3868 to dot within an output section element.
3869
9634ed06
CC
38702011-10-31 Cary Coutant <ccoutant@google.com>
3871
3872 * options.h (class General_options): Add --[no-]gnu-unique options.
3873 * symtab.cc (Symbol_table::sized_write_globals): Convert
3874 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
3875
de4101c7
CC
38762011-10-31 Cary Coutant <ccoutant@google.com>
3877
3878 PR gold/13359
3879 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
3880 unnecessary assertion.
3881 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
3882
7257cc92
ST
38832011-10-31 Sriraman Tallam <tmsriram@google.com>
3884
3885 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3886 gc_mark_symbol.
3887 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3888 gc_mark_symbol.
3889 Change to just keep the section associated with symbol.
3890 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
3891 they are externally visible and --export-dynamic is turned on.
3892 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
3893
bfc34b3f
ILT
38942011-10-19 Ian Lance Taylor <iant@google.com>
3895
3896 PR gold/13163
3897 * script-sections.cc
3898 (Output_section_element_dot_assignment::needs_output_section): New
3899 function.
3900
ea0d8c47
ILT
39012011-10-19 Ian Lance Taylor <iant@google.com>
3902
3903 PR gold/13204
3904 * layout.cc (Layout::segment_precedes): Don't assert failure if a
3905 --section-start option was seen.
3906 * options.h (General_options::any_section_start): New function.
3907
abd242a9
DM
39082011-10-18 David S. Miller <davem@davemloft.net>
3909
3910 PR binutils/13301
3911 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
3912 member to track relocation locations that have moved during TLS
3913 reloc optimizations.
3914 (Target_sparc::Relocate::Relocate): Initialize to NULL.
3915 (Target_sparc::Relocate::relocate): Adjust view down by 4
3916 bytes if it matches reloc_adjust_addr_.
3917 (Target_sparc::Relocate::relocate_tls): Always move the
3918 __tls_get_addr call delay slot instruction forward 4 bytes when
3919 performing relaxation.
3920
bab9090f
CC
39212011-10-18 Cary Coutant <ccoutant@google.com>
3922
3923 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
3924 (Output_file::map_no_anonymous): Check for non-zero
3925 return code from posix_fallocate.
3926
f7c5b166
CC
39272011-10-17 Cary Coutant <ccoutant@google.com>
3928
3929 PR gold/13245
3930 * plugin.cc (is_visible_from_outside): Check for symbols
3931 referenced from dynamic objects.
3932 * resolve.cc (Symbol_table::resolve): Don't count references
3933 from dynamic objects as references from real ELF files.
3934 * testsuite/plugin_test_2.sh: Adjust expected result.
3935
b490c0bb
CC
39362011-10-17 Cary Coutant <ccoutant@google.com>
3937
3938 * gold.cc: Include timer.h.
3939 (queue_middle_tasks): Stamp time.
3940 (queue_final_tasks): Likewise.
3941 * main.cc (main): Store timer in parameters. Print timers
3942 for each pass.
3943 * parameters.cc (Parameters::Parameters): Initialize timer_.
3944 (Parameters::set_timer): New function.
3945 (set_parameters_timer): New function.
3946 * parameters.h (Parameters::set_timer): New function.
3947 (Parameters::timer): New function.
3948 (Parameters::timer_): New data member.
3949 (set_parameters_timer): New function.
3950 * timer.cc (Timer::stamp): New function.
3951 (Timer::get_pass_time): New function.
3952 * timer.h (Timer::stamp): New function.
3953 (Timer::get_pass_time): New function.
3954 (Timer::pass_times_): New data member.
3955
f475cf7b
CC
39562011-10-17 Cary Coutant <ccoutant@google.com>
3957
3958 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
3959 task for members of lib groups.
3960
cdd7e244
CC
39612011-10-17 Cary Coutant <ccoutant@google.com>
3962
3963 PR gold/13288
4f95c8b4 3964 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
3965 (File_read::make_view): Move bounds check (replace with assert)...
3966 (File_read::find_or_make_view): ... to here.
3967
dfb45471
CC
39682011-10-12 Cary Coutant <ccoutant@google.com>
3969
4f95c8b4 3970 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
3971 ::read returns less than requested size.
3972
53bbcc1b
CC
39732011-10-10 Cary Coutant <ccoutant@google.com>
3974
4f95c8b4 3975 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
3976 Initialize defined_count_.
3977 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
3978 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
3979 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
3980 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
3981 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 3982 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
3983 member.
3984 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 3985 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
3986 Return zeroes instead of internal error.
3987
397b129b
CC
39882011-10-10 Cary Coutant <ccoutant@google.com>
3989
3990 PR gold/13249
4f95c8b4 3991 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 3992 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 3993 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
3994 (Output_reloc::type_): Adjust size of bit field.
3995 (Output_reloc::use_plt_offset_): New bit field.
3996 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
3997 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
3998 flag. Adjust all callers.
4f95c8b4 3999 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4000 creating RELATIVE relocations.
4001
d5698657
NC
40022011-10-10 Nick Clifton <nickc@redhat.com>
4003
4004 * po/es.po: Updated Spanish translation.
4005 * po/fi.po: Updated Finnish translation.
4006
6a59a5c2
DN
40072011-10-03 Diego Novillo <dnovillo@google.com>
4008
4009 * options.cc (parse_uint): Fix dereference of RETVAL.
4010
f0558624
ST
40112011-09-29 Sriraman Tallam <tmsriram@google.com>
4012
4013 * layout.h (section_order_map_): New member.
4014 (get_section_order_map): New member function.
4015 * output.cc (Output_section::add_input_section): Check for patterns
4016 only when --section-ordering-file is specified.
4017 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4018 output_sections have been formed.
4019 * layout.cc (Layout_Layout): Initialize section_order_map_.
4020 * plugin.cc (update_section_order): Store order in order_map. Do not
4021 update the order.
4022 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4023 * testsuite/Makefile.in: Regenerate.
4024 * testsuite/plugin_section_order.c: New file.
4025 * testsuite/plugin_final_layout.cc: New file.
4026 * testsuite/plugin_final_layout.sh: New file.
4027
a7dac153
CC
40282011-09-29 Cary Coutant <ccoutant@google.com>
4029
4f95c8b4 4030 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4031 Check for NULL.
4f95c8b4 4032 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4033 symbols during incremental update.
4034 (Symbol_table::add_from_dynobj): Likewise.
4035
eebd87a5
ILT
40362011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4037 Ian Lance Taylor <iant@google.com>
4038
4039 * symtab.cc (Symbol_table::define_special_symbol): Always
4040 canonicalize version string.
4041
403a3331
CC
40422011-09-26 Cary Coutant <ccoutant@google.com>
4043
4f95c8b4
CC
4044 * gold.cc (queue_initial_tasks): Move option checks ...
4045 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4046 some options; make others fatal.
4047
235061c2
CC
40482011-09-26 Cary Coutant <ccoutant@google.com>
4049
4050 gcc PR lto/47247
4051 * plugin.cc (get_symbols_v2): New function.
4052 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4053 (is_referenced_from_outside): New function.
4054 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4055 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4056 (get_symbols): Pass version parameter.
4057 (get_symbols_v2): New function.
4058 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4059 parameter.
4060 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4061 (onload): Add LDPT_GET_SYMBOLS_V2.
4062 (all_symbols_read_hook): Use get_symbols_v2; check for
4063 LDPR_PREVAILING_DEF_IRONLY_EXP.
4064 * testsuite/plugin_test_3.sh: Update expected results.
4065
dc87f620
ILT
40662011-09-23 Simon Baldwin <simonb@google.com>
4067
4068 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4069 configuration options.
4070 * configure: Regenerate.
4071 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4072 * Makefile.in: Regenerate.
4073 * testsuite/Makefile.in: Regenerate.
4074
a8279f82
ST
40752011-09-19 Sriraman Tallam <tmsriram@google.com>
4076
4077 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4078
0c9350c8
CC
40792011-09-19 Cary Coutant <ccoutant@google.com>
4080
4081 * incremental.cc (can_incremental_update): Fix typo in comment.
4082 * incremental.h (can_incremental_update): Likewise.
4083
aa06ae28
CC
40842011-09-18 Cary Coutant <ccoutant@google.com>
4085
4086 * incremental.cc (can_incremental_update): New function.
4087 * incremental.h (can_incremental_update): New function.
4088 * layout.cc (Layout::init_fixed_output_section): Call it.
4089 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4090 * object.cc (Sized_relobj_file::do_layout): Call
4091 can_incremental_update.
4092
ebb300b2
CC
40932011-09-13 Cary Coutant <ccoutant@google.com>
4094
4095 * configure.ac: Check for glibc support for gnu_indirect_function
4096 support with static linking, setting automake conditional
4097 IFUNC_STATIC.
4098 * Makefile.in: Regenerate.
4099 * configure: Regenerate.
4100
4101 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4102 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4103 for IFUNC_STATIC.
4104 * testsuite/Makefile.in: Regenerate.
4105
1206d0d5
CC
41062011-09-13 Cary Coutant <ccoutant@google.com>
4107
4108 * incremental.cc (Sized_relobj_incr::do_layout): Call
4109 report_comdat_group for kept comdat sections.
4110 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4111 * testsuite/Makefile.in: Regenerate.
4112 * testsuite/incr_comdat_test_1.cc: New source file.
4113 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4114 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4115 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4116
40b29874
ILT
41172011-09-13 Ian Lance Taylor <iant@google.com>
4118
4119 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4120 variable external_symbols_offset.
4121
1b045aac
ILT
41222011-09-12 Ian Lance Taylor <iant@google.com>
4123
4124 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4125 triggered if object has no symbols.
4126
24c6c55a
DM
41272011-09-09 David S. Miller <davem@davemloft.net>
4128
4129 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4130 (Output_fill_debug_line::do_write): Likewise.
4131
66570254
CC
41322011-08-29 Cary Coutant <ccoutant@google.com>
4133
4134 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4135 casts to match formatting specs.
4136 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4137
8ea8cd50
CC
41382011-08-26 Cary Coutant <ccoutant@google.com>
4139
4140 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4141 remaining hole size when allocating.
4142 (Layout::make_output_section): Set fill methods for debug sections.
4143 * layout.h (Free_list::Free_list_node): Move from private to
4144 public.
4145 (Free_list::set_min_hole_size): New function.
4146 (Free_list::begin, Free_list::end): New functions.
4147 (Free_list::min_hole_): New data member.
4148 * output.cc: Include dwarf.h.
4149 (Output_fill_debug_info::do_minimum_hole_size): New function.
4150 (Output_fill_debug_info::do_write): New function.
4151 (Output_fill_debug_line::do_minimum_hole_size): New function.
4152 (Output_fill_debug_line::do_write): New function.
4153 (Output_section::Output_section): Initialize new data member.
4154 (Output_section::set_final_data_size): Ensure patch space is larger
4155 than minimum hole size.
4156 (Output_section::do_write): Fill holes in debug sections.
4157 * output.h (Output_fill): New class.
4158 (Output_fill_debug_info): New class.
4159 (Output_fill_debug_line): New class.
4160 (Output_section::set_free_space_fill): New function.
4161 (Output_section::free_space_fill_): New data member.
4162 * testsuite/Makefile.am (incremental_test_3): Add
4163 --incremental-patch option.
4164 (incremental_test_4): Likewise.
4165 (incremental_test_5): Likewise.
4166 (incremental_test_6): Likewise.
4167 (incremental_copy_test): Likewise.
4168 (incremental_common_test_1): Likewise.
4169 * testsuite/Makefile.in: Regenerate.
4170
7cf80422
NC
41712011-08-26 Nick Clifton <nickc@redhat.com>
4172
4173 * po/es.po: Updated Spanish translation.
4174
c3f7b0e5
CC
41752011-08-01 Cary Coutant <ccoutant@google.com>
4176
4177 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4178 * gold/testsuite/Makefile.in: Regenerate.
4179 * gold/testsuite/justsyms_exec.c: New source file.
4180 * gold/testsuite/justsyms_lib.c: New source file.
4181
9590bf25
CC
41822011-08-01 Cary Coutant <ccoutant@google.com>
4183
4184 * layout.cc (Layout::set_segment_offsets): Don't realign text
4185 segment if -Ttext was specified.
4186 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4187 file type.
4188 * object.h (Sized_relobj_file::e_type): New function.
4189 (Sized_relobj_file::e_type_): New data member.
4190 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4191 base address for ET_EXEC files.
4192 * target.cc (Target::do_make_elf_object_implementation): Allow
4193 ET_EXEC files with --just-symbols option.
4194
dcd8d12e
CC
41952011-07-28 Cary Coutant <ccoutant@google.com>
4196
4197 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4198 Add thread_number parameter.
4199 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4200 * workqueue-threads.cc
4201 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4202 current thread if its thread number is greater than desired thread
4203 count.
4204 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4205 Add thread_number parameter.
4206 (Workqueue::should_cancel_thread): Likewise.
4207 (Workqueue::find_runnable_or_wait): Pass thread_number to
4208 should_cancel_thread.
4209 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4210 parameter.
4211
804eb480
ST
42122011-07-22 Sriraman Tallam <tmsriram@google.com>
4213
4214 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4215 only after checking if it cannot be forced local.
4216 * symtab.h (is_externally_visible): Check if the symbol is not forced
4217 local.
4218
f1ddb600
ILT
42192011-07-15 Ian Lance Taylor <iant@google.com>
4220
4221 * options.h (class General_options): Add --print-output-format.
4222 Move -EL next to -EB, for better --help output.
4223 * target-select.cc: Include <cstdio>, "options.h", and
4224 "parameters.h".
4225 (Target_selector::do_target_bfd_name): New function.
4226 (print_output_format): New function.
4227 * target-select.h (class Target_selector): Update declarations.
4228 (Target_selector::target_bfd_name): New function.
4229 (print_output_format): Declare.
4230 * main.cc: Include "target-select.h".
4231 (main): Handle --print-output-format.
4232 * gold.cc: Include "target-select.h".
4233 (queue_initial_tasks): Handle --print-output-format when there are
4234 no input files.
4235 * parameters.cc (parameters_force_valid_target): Give a better
4236 error message if -EB/-EL does not match target.
4237 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4238 function.
4239
7d172687
ILT
42402011-07-15 Ian Lance Taylor <iant@google.com>
4241
4242 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4243 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4244 (Output_data_plt_i386::do_write): Write address of .dynamic
4245 section to first entry in .got.plt section.
4246 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4247 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4248 Initialize layout_.
4249 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4250 section to first entry in .got.plt section.
4251 * layout.h (Layout::dynamic_section): New function.
4252
e9552f7e
ST
42532011-07-13 Sriraman Tallam <tmsriram@google.com>
4254
4255 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4256 to claim_file call.
4257 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4258 input_section_position_, and input_section_glob_.
4259 (read_layout_from_file): Call function section_ordering_specified.
4260 * layout.h (is_section_ordering_specified): New function.
4261 (section_ordering_specified): New function.
4262 (section_ordering_specified_): New boolean member.
4263 * main.cc(main): Call load_plugins after layout object is defined.
4264 * output.cc (Output_section::add_input_section): Use
4265 function section_ordering_specified to check if section ordering is
4266 needed.
4267 * output.cc (Output_section::add_relaxed_input_section): Use
4268 function section_ordering_specified to check if section ordering is
4269 needed.
4270 (Output_section::update_section_layout): New function.
4271 (Output_section::sort_attached_input_sections): Check if input section
4272 must be reordered.
4273 * output.h (Output_section::update_section_layout): New function.
4274 * plugin.cc (get_section_count): New function.
4275 (get_section_type): New function.
4276 (get_section_name): New function.
4277 (get_section_contents): New function.
4278 (update_section_order): New function.
58797674 4279 (allow_section_ordering): New function.
e9552f7e
ST
4280 (Plugin::load): Add the new interfaces to the transfer vector.
4281 (Plugin_manager::load_plugins): New parameter.
4282 (Plugin_manager::all_symbols_read): New parameter.
4283 (Plugin_manager::claim_file): New parameter. Save the elf object for
4284 unclaimed objects.
4285 (Plugin_manager::get_elf_object): New function.
4286 (Plugin_manager::get_view): Change to directly use the bool to check
4287 if get_view is called from claim_file_hook.
4288 * plugin.h (input_objects): New function
4289 (Plugin__manager::load_plugins): New parameter.
4290 (Plugin_manager::claim_file): New parameter.
4291 (Plugin_manager::get_elf_object): New function.
4292 (Plugin_manager::in_claim_file_handler): New function.
4293 (Plugin_manager::in_claim_file_handler_): New member.
4294 (layout): New function.
4295 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4296 handler with an extra parameter. Make the elf object before calling
4297 claim_file handler.
4298 * testsuite/plugin_test.c (get_section_count): New function pointer.
4299 (get_section_type): New function pointer.
4300 (get_section_name): New function pointer.
4301 (get_section_contents): New function pointer.
4302 (update_section_order): New function pointer.
4303 (allow_section_ordering): New function pointer.
4304 (onload): Check if the new interfaces exist.
4305
9446efde
ILT
43062011-07-13 Ian Lance Taylor <iant@google.com>
4307
4308 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4309 relro section.
4310 * x86_64.cc (Target_x86_64::got_section): Likewise.
4311 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4312 (relro_now_test_SOURCES): New variable.
4313 (relro_now_test_DEPENDENCIES): New variable.
4314 (relro_now_test_LDFLAGS): New variable.
4315 (relro_now_test_LDADD): New variable.
4316 (relro_now_test.so): New target.
4317 * testsuite/Makefile.in: Rebuild.
4318
07aa62f2
ILT
43192011-07-12 Ian Lance Taylor <iant@google.com>
4320
4321 PR gold/12980
4322 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4323 GLOB_DAT relocation rather than a RELATIVE relocation for a
4324 protected symbol when creating a shared library.
4325 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4326 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4327 * testsuite/protected_main_1.cc (main): Test that protected
4328 function has same address.
4329
e2153196
ILT
43302011-07-11 Ian Lance Taylor <iant@google.com>
4331
4332 PR gold/12979
4333 * options.h (class General_options): Add -Bgroup.
4334 * options.cc (General_options::finalize): If -Bgroup is set,
4335 default to --unresolved-symbols=report-all.
4336 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4337 * target-reloc.h (issue_undefined_symbol_error): Handle
4338 --unresolved-symbols=report-all.
4339
6daf5215
ILT
43402011-07-08 Ian Lance Taylor <iant@google.com>
4341
4342 PR gold/11985
4343 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4344 if linker script discards key sections.
4345 (Layout::create_dynamic_symtab): Likewise.
4346 (Layout::assign_local_dynsym_offsets): Likewise.
4347 (Layout::sized_create_version_sections): Likewise.
4348 (Layout::create_interp): Likewise.
4349 (Layout::finish_dynamic_section): Likewise.
4350 (Layout::set_dynamic_symbol_size): Likewise.
4351
beabb2c6
ILT
43522011-07-08 Ian Lance Taylor <iant@google.com>
4353
4354 PR gold/12386
4355 * options.h (class General_options): Add --unresolved-symbols.
4356 * target-reloc.h (issue_undefined_symbol_error): Check
4357 --unresolved-symbols. Add comments.
4358
9c16daf1
ILT
43592011-07-08 Ian Lance Taylor <iant@google.com>
4360
4361 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4362 expression more complex.
4363
191f1a2d
ILT
43642011-07-08 Ian Lance Taylor <iant@google.com>
4365
4366 PR gold/11317
4367 * target-reloc.h (issue_undefined_symbol_error): New inline
4368 function, broken out of relocate_section.
4369 (relocate_section): Call issue_undefined_symbol_error.
4370 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4371 there is no TLS segment if we are about to issue an undefined
4372 symbol error.
4373 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4374
62855347
ILT
43752011-07-08 Ian Lance Taylor <iant@google.com>
4376
4377 PR gold/12279
4378 * resolve.cc (Symbol_table::should_override): Add fromtype
4379 parameter. Change all callers. Give error when linking together
4380 TLS and non-TLS symbol.
4381 (Symbol_table::should_override_with_special): Add fromtype
4382 parameter. Change all callers.
4383 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4384 there is no TLS segment if we have reported some errors.
4385 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4386
67181c72
ILT
43872011-07-08 Ian Lance Taylor <iant@google.com>
4388
4389 PR gold/12372
4390 * target.h (Target::plt_address_for_global): New function.
4391 (Target::plt_address_for_local): New function.
4392 (Target::plt_section_for_global): Remove.
4393 (Target::plt_section_for_local): Remove.
4394 (Target::do_plt_address_for_global): New virtual function.
4395 (Target::do_plt_address_for_local): New virtual function.
4396 (Target::do_plt_section_for_global): Remove.
4397 (Target::do_plt_section_for_local): Remove.
4398 (Target::register_global_plt_entry): Add Symbol_table and Layout
4399 parameters.
4400 * output.cc (Output_data_got::Got_entry::write): Use
4401 plt_address_for_global and plt_address_for_local.
4402 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4403 address of output section.
4404 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4405 got_irelative_, and irelative_count_ fields. Update
4406 declarations.
4407 (Output_data_plt_i386::has_irelative_section): New function.
4408 (Output_data_plt_i386::entry_count): Add irelative_count_.
4409 (Output_data_plt_i386::set_final_data_size): Likewise.
4410 (class Target_i386): Add got_irelative_ and rel_irelative_
4411 fields. Update declarations.
4412 (Target_i386::Target_i386): Initialize new fields.
4413 (Target_i386::do_plt_address_for_global): New function replacing
4414 do_plt_section_for_global.
4415 (Target_i386::do_plt_address_for_local): New function replacing
4416 do_plt_section_for_local.
4417 (Target_i386::got_section): Create got_irelative_.
4418 (Target_i386::rel_irelative_section): New function.
4419 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4420 fields. Don't define __rel_iplt_{start,end}.
4421 (Output_data_plt_i386::add_entry): Add symtab and layout
4422 parameters. Change all callers. Use different PLT and GOT for
4423 IFUNC symbols.
4424 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4425 layout parameters. Change all callers. Use different PLT and
4426 GOT.
4427 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4428 (Output_data_plt_i386::rel_irelative): New function.
4429 (Output_data_plt_i386::address_for_global): New function.
4430 (Output_data_plt_i386::address_for_local): New function.
4431 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4432 IRELATIVE GOT when changing IFUNC GOT entries.
4433 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4434 reloc.
4435 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4436 if we didn't create an IRELATIVE GOT.
4437 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4438 plt_address_for_local.
4439 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4440 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4441 got_irelative_, and irelative_count_ fields. Update
4442 declarations.
4443 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4444 Initialize new fields. Remove symtab parameter. Change all
4445 callers.
4446 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4447 irelative_count_.
4448 (Output_data_plt_x86_64::has_irelative_section): New function.
4449 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4450 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4451 fields. Update declarations.
4452 (Target_x86_64::Target_x86_64): Initialize new fields.
4453 (Target_x86_64::do_plt_address_for_global): New function replacing
4454 do_plt_section_for_global.
4455 (Target_x86_64::do_plt_address_for_local): New function replacing
4456 do_plt_section_for_local.
4457 (Target_x86_64::got_section): Create got_irelative_.
4458 (Target_x86_64::rela_irelative_section): New function.
4459 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4460 all callers. Don't create __rel_iplt_{start,end}.
4461 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4462 parameters. Change all callers. Use different PLT and GOT for
4463 IFUNC symbols.
4464 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4465 layout parameters. Change all callers. Use different PLT and
4466 GOT.
4467 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4468 parameters. Change all callers. Use different PLT and GOT for
4469 IFUNC symbols.
4470 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4471 (Output_data_plt_x86_64::rela_irelative): New function.
4472 (Output_data_plt_x86_64::address_for_global): New function.
4473 (Output_data_plt_x86_64::address_for_local): New function.
4474 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4475 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4476 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4477 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4478 parameters.
4479 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4480 reloc.
4481 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4482 symbols if we didn't create an IRELATIVE GOT.
4483 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4484 plt_address_for_local.
4485 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4486 * testsuite/ifuncvar1.c: New test file.
4487 * testsuite/ifuncvar2.c: New test file.
4488 * testsuite/ifuncvar3.c: New test file.
4489 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4490 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4491 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4492 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4493 * testsuite/Makefile.in: Rebuild.
4494
33c15b45
CC
44952011-07-07 Cary Coutant <ccoutant@google.com>
4496
4497 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4498 (two_file_test_1_ndebug.o): Likewise.
4499 (two_file_test_1b_ndebug.o): Likewise.
4500 (two_file_test_2_ndebug.o): Likewise.
4501 (two_file_test_main_ndebug.o): Likewise.
4502 (incremental_test_2): Link with no-debug versions.
4503
f48b5fb7
CC
45042011-07-06 Cary Coutant <ccoutant@google.com>
4505
4506 * gold/incremental.cc
4507 (Output_section_incremental_inputs::write_info_blocks): Check for
4508 hidden and internal symbols.
4509
221597a5
CC
45102011-07-06 Cary Coutant <ccoutant@google.com>
4511
4512 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4513 Check disposition for startup file.
4514 (Incremental_inputs::report_command_line): Ignore
4515 --incremental-startup-unchanged option.
4516 * options.cc (General_options::parse_incremental_startup_unchanged):
4517 New function.
4518 (General_options::General_options): Initialize new data member.
4519 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4520 (General_options): Add --incremental-startup-unchanged option.
4521 (General_options::incremental_startup_disposition): New function.
4522 (General_options::incremental_startup_disposition_): New data member.
4523
e24719f6
CC
45242011-07-06 Cary Coutant <ccoutant@google.com>
4525
4526 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4527 input file index to Script_info ctor.
4528 (Sized_incremental_binary::do_file_has_changed): Find the
4529 command-line argument for files named in scripts.
4530 * incremental.h (Script_info::Script_info): New ctor
4531 with input file index.
4532 (Script_info::input_file_index): New function.
4533 (Script_info::input_file_index_): New data member.
4534 (Incremental_binary::get_library): Add const.
4535 (Incremental_binary::get_script_info): Add const.
4536 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4537 * testsuite/Makefile.am (incremental_test_5): New test case.
4538 (incremental_test_6): New test case.
4539 * testsuite/Makefile.in: Regenerate.
4540
8f7c81e8
CC
45412011-07-06 Cary Coutant <ccoutant@google.com>
4542
4543 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4544 debug output when command lines differ.
4545
9fbd3822
CC
45462011-07-06 Cary Coutant <ccoutant@google.com>
4547
4548 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4549 --incremental-patch option.
4550 * layout.cc (Free_list::allocate): Extend allocation beyond original
4551 end if enabled.
4552 (Layout::make_output_section): Mark sections that should get
4553 patch space.
4554 * options.cc (parse_percent): New function.
4555 * options.h (parse_percent): New function.
4556 (DEFINE_percent): New macro.
4557 (General_options): Add --incremental-patch option.
4558 * output.cc (Output_section::Output_section): Initialize new data
4559 members.
4560 (Output_section::add_input_section): Print section name when out
4561 of patch space.
4562 (Output_section::add_output_section_data): Likewise.
4563 (Output_section::set_final_data_size): Add patch space when
4564 doing --incremental-full.
4565 (Output_section::do_reset_address_and_file_offset): Remove patch
4566 space.
4567 (Output_segment::set_section_list_addresses): Print debug output
4568 only if --incremental-update.
4569 * output.h (Output_section::set_is_patch_space_allowed): New function.
4570 (Output_section::is_patch_space_allowed_): New data member.
4571 (Output_section::patch_space_): New data member.
4572 * parameters.cc (Parameters::incremental_full): New function.
4573 * parameters.h (Parameters::incremental_full): New function
4574 * testsuite/Makefile.am (incremental_test_2): Add test for
4575 --incremental-patch option.
4576 * testsuite/Makefile.in: Regenerate.
4577 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4578 (t18): Remove function body.
4579
f6cccc2c
DK
45802011-07-05 Doug Kwan <dougkwan@google.com>
4581
4582 PR gold/12771
4583 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4584 Arm_Address type for relocation result.
4585 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4586 overflow check.
4587 (Arm_relocate_functions::abs32): Use unaligned access.
4588 (Arm_relocate_functions::rel32): Ditto.
4589 (Arm_relocate_functions::prel31): Ditto.
4590 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4591 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4592 static data relocations.
4593 * testsuite/Makefile.in: Regnerate.
4594 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4595
28a13fec
ILT
45962011-07-05 Ian Lance Taylor <iant@google.com>
4597
4598 PR gold/12392
4599 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4600 symbols if necessary.
4601 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4602
24d47b34
ILT
46032011-07-05 Ian Lance Taylor <iant@google.com>
4604
4605 PR gold/12952
4606 * resolve.cc (Symbol::override_base_with_special): Simply override
4607 version with special symbol version, ignoring previous version.
4608
41f9cbbe
ILT
46092011-07-05 Ian Lance Taylor <iant@google.com>
4610
4611 * object.cc (Sized_relobj_file::include_section_group): Add
4612 information to comment about signature location.
4613
886288f1
ILT
46142011-07-02 Ian Lance Taylor <iant@google.com>
4615
4616 PR gold/12957
4617 * options.h (class General_options): Add -f and -F.
4618 * options.cc (General_options::finalize): Fatal error if -f/-F
4619 are used without -shared.
4620 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4621
ae3a6d4f
ILT
46222011-07-02 Ian Lance Taylor <iant@google.com>
4623
4624 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4625
21131061
ILT
46262011-07-01 Ian Lance Taylor <iant@google.com>
4627
4628 PR gold/12525
4629 PR gold/12952
4630 * resolve.cc (Symbol::override_base_with_special): Don't override
4631 the version if the overriding symbol has a different name.
4632 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4633 all callers. If we give an error about an undefined version,
4634 define the base version if necessary.
4635 * dynobj.h (class Versions): Update declaration.
4636 * testsuite/weak_alias_test_5.cc: New file.
4637 * testsuite/weak_alias_test.script: New file.
4638 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4639 and versioned_alias have the right value, and call t2.
4640 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4641 weak_alias_test_5.so.
4642 (weak_alias_test_LDADD): Likewise.
4643 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4644 * testsuite/Makefile.in: Rebuild.
4645
611062c0
ILT
46462011-07-01 Ian Lance Taylor <iant@google.com>
4647
4648 PR gold/12525
4649 * options.h (class General_options): Support -z notext.
4650 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4651 -Wl,-z,notext.
4652 (two_file_shared_nonpic.so): Likewise.
4653 (two_file_shared_mixed.so): Likewise.
4654 (two_file_shared_mixed_1.so): Likewise.
4655 (weak_undef_lib_nonpic.so): Likewise.
4656 (alt/weak_undef_lib_nonpic.so): Likewise.
4657 (tls_test_shared_nonpic.so): Likewise.
4658 * testsuite/Makefile.in: Rebuild.
4659
328c7c2f
ILT
46602011-07-01 Ian Lance Taylor <iant@google.com>
4661
4662 PR gold/12525
4663 * configure.ac: Test whether static linking works, setting
4664 the automake conditional HAVE_STATIC.
4665 * testsuite/Makefile.am: Disable tests using -static if
4666 HAVE_STATIC is not true.
4667 * configure, testsuite/Makefile.in: Rebuild.
4668
02d7cd44
ILT
46692011-07-01 Ian Lance Taylor <iant@google.com>
4670
4671 PR gold/12525
4672 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4673 Assert if we see DW_EH_PE_indirect.
4674 * target.h (Target::ehframe_datarel_base): New function.
4675 (Target::do_ehframe_datarel_base): New target function.
4676 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4677 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4678 function.
4679
07a60597
ILT
46802011-07-01 Ian Lance Taylor <iant@google.com>
4681
4682 PR gold/12571
4683 * options.h (class General_options): Add
4684 --ld-generated-unwind-info.
4685 * ehframe.cc (Fde::write): Add address parameter. Change all
4686 callers. If associated with PLT, fill in address and size.
4687 (Cie::set_output_offset): Only add merge mapping if there is an
4688 object.
4689 (Cie::write): Add address parameter. Change all callers.
4690 (Eh_frame::add_ehframe_for_plt): New function.
4691 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4692 input_offset_ fields into union u_, with new plt field.
4693 (Fde::Fde): Adjust for new union field.
4694 (Fde::Fde) [Output_data version]: New constructor.
4695 (Fde::add_mapping): Only add merge mapping if there is an object.
4696 (class Cie): Update declarations.
4697 (class Eh_frame): Declare add_ehframe_for_plt.
4698 * layout.cc (Layout::layout_eh_frame): Break out code into
4699 make_eh_frame_section, and call it.
4700 (Layout::make_eh_frame_section): New function.
4701 (Layout::add_eh_frame_for_plt): New function.
4702 * layout.h (class Layout): Update declarations.
4703 * merge.cc (Merge_map::add_mapping): Add assertion.
4704 * i386.cc: Include "dwarf.h".
4705 (class Output_data_plt_i386): Make first_plt_entry,
4706 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4707 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4708 and plt_eh_frame_fde.
4709 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4710 boundary. Call add_eh_frame_for_plt if appropriate.
4711 * x86_64.cc: Include "dwarf.h".
4712 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4713 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4714 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4715 and plt_eh_frame_fde.
4716 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4717 appropriate.
4718
14788a3f
ILT
47192011-06-29 Ian Lance Taylor <iant@google.com>
4720
4721 PR gold/12629
4722 * object.cc (Sized_relobj_file::layout_section): Change shdr
4723 parameter to be const.
4724 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4725 out of do_layout.
4726 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4727 appropriate. Call layout_eh_frame_section.
4728 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4729 sections.
4730 * object.h (class Sized_relobj_file): Update declarations.
4731
6c21fce1
ILT
47322011-06-29 Ian Lance Taylor <iant@google.com>
4733
37e41b03 4734 PR gold/12652
6c21fce1
ILT
4735 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4736 modifier.
4737 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4738
4d5e4e62
ILT
47392011-06-29 Ian Lance Taylor <iant@google.com>
4740
4741 PR gold/12675
4742 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4743 SHT_X86_64_UNWIND.
4744 * layout.cc (Layout::layout_eh_frame): Likewise.
4745
886f533a
ILT
47462011-06-29 Ian Lance Taylor <iant@google.com>
4747
4748 PR gold/12695
4749 * layout.cc (Layout::symtab_section_shndx): New function.
4750 * layout.h (class Layout): Declare symtab_section_shndx.
4751 * output.cc (Output_section::write_header): Call it.
4752
f3ae1b28
ILT
47532011-06-29 Ian Lance Taylor <iant@google.com>
4754
4755 PR gold/12818
4756 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4757 symbols which are not used in a relocation.
4758
aecf301f
ILT
47592011-06-28 Ian Lance Taylor <iant@google.com>
4760
4761 PR gold/12898
4762 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4763 script create indistinguishable segments.
4764 (Layout::set_segment_offsets): Use stable_sort when sorting
4765 segments. Pass this to Compare_segments constructor.
4766 * layout.h (class Layout): Make segment_precedes non-static.
4767 (class Compare_segments): Change from struct to class. Add
4768 layout_ field. Add constructor.
4769 * script-sections.cc
4770 (Script_sections::attach_sections_using_phdrs_clause): Rename
4771 local orphan to is_orphan. Don't report failure to put empty
4772 section in segment. On attachment failure, report name of
4773 section, and attach to first PT_LOAD segment.
4774
03ef7571
ILT
47752011-06-28 Ian Lance Taylor <iant@google.com>
4776
4777 PR gold/12934
4778 * target-select.cc (Target_selector::Target_selector): Add
4779 emulation parameter. Change all callers.
4780 (select_target_by_bfd_name): Rename from select_target_by_name.
4781 Change all callers.
4782 (select_target_by_emulation): New function.
4783 (supported_emulation_names): New function.
4784 * target-select.h (class Target_selector): Add emulation_ field.
4785 Update declarations.
4786 (Target_selector::recognize_by_bfd_name): Rename from
4787 recognize_by_name. Change all callers.
4788 (Target_selector::supported_bfd_names): Rename from
4789 supported_names. Change all callers.
4790 (Target_selector::recognize_by_emulation): New function.
4791 (Target_selector::supported_emulations): New function.
4792 (Target_selector::emulation): New function.
4793 (Target_selector::do_recognize_by_bfd_name): Rename from
4794 do_recognize_by_name. Change all callers.
4795 (Target_selector::do_supported_bfd_names): Rename from
4796 do_supported_names. Change all callers.
4797 (Target_selector::do_recognize_by_emulation): New function.
4798 (Target_selector::do_supported_emulations): New function.
4799 (select_target_by_bfd_name): Change name in declaration.
4800 (select_target_by_emulation): Declare.
4801 (supported_emulation_names): Declare.
4802 * parameters.cc (parameters_force_valid_target): Try to find
4803 target based on emulation from -m option.
4804 * options.h (class General_options): Change doc string for -m.
4805 * options.cc (help): Print emulations.
4806 (General_options::parse_V): Likewise.
4807 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
4808 Add emulation parameter. Change all callers.
4809
200b2bb9
ILT
48102011-06-28 Ian Lance Taylor <iant@google.com>
4811
4812 * target.h (class Target): Add osabi_ field.
4813 (Target::osabi): New function.
4814 (Target::set_osabi): New function.
4815 (Target::Target): Initialize osabi_.
4816 (Target::do_adjust_elf_header): Make pure virtual.
4817 (Sized_target::do_adjust_elf_header): Declare.
4818 * target.cc (Sized_target::do_adjust_elf_header): New function.
4819 (class Sized_target): Instantiate all versions.
4820 * freebsd.h (class Target_freebsd): Remove.
4821 (Target_selector_freebsd::do_recognize): Call set_osabi on
4822 Target.
4823 (Target_selector_freebsd::do_recognize_by_name): Likewise.
4824 (Target_selector_freebsd::set_osabi): Remove.
4825 * i386.cc (class Target_i386): Inherit from Sized_target rather
4826 than Target_freebsd.
4827 * x86_64.cc (class Target_x86_64): Likewise.
4828
b3ce541e
ILT
48292011-06-28 Ian Lance Taylor <iant@google.com>
4830
4831 * target.h (Target::can_check_for_function_pointers): Rewrite.
4832 Make non-virtual.
4833 (Target::can_icf_inline_merge_sections): Likewise.
4834 (Target::section_may_have_icf_unsafe_poineters): Likewise.
4835 (Target::Target_info): Add can_icf_inline_merge_sections field.
4836 (Target::do_can_check_for_function_pointers): New virtual
4837 function.
4838 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
4839 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
4840 from can_check_for_function_pointers, move in file.
4841 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
4842 section_may_have_icf_unsafe_poineters, move in file.
4843 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
4844 * i386.cc (Target_i386::do_can_check_for_function_pointers):
4845 Rename from can_check_for_function_pointers, move in file.
4846 (Target_i386::can_icf_inline_merge_sections): Remove.
4847 (Target_i386::i386_info): Initialize
4848 can_icf_inline_merge_sections.
4849 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
4850 Initialize can_icf_inline_merge_sections.
4851 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
4852 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
4853 Rename from can_check_for_function_pointers, move in file.
4854 (Target_x86_64::can_icf_inline_merge_sections): Remove.
4855 (Target_x86_64::x86_64_info): Initialize
4856 can_icf_inline_merge_sections.
4857 * testsuite/testfile.cc (Target_test::test_target_info):
4858 Likewise.
4859 * icf.cc (get_section_contents): Correct formatting.
4860
6d1c4efb
ILT
48612011-06-27 Ian Lance Taylor <iant@google.com>
4862
4863 * symtab.cc (Symbol::versioned_name): New function.
4864 (Symbol_table::add_to_final_symtab): Use versioned_name when
4865 appropriate.
4866 (Symbol_table::sized_write_symbol): Likewise.
4867 * symtab.h (class Symbol): Declare versioned_name.
4868 * stringpool.h (class Stringpool_template): Add variant of add
4869 which takes a std::basic_string.
4870 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
4871 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
4872 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
4873 (ver_test_12.o): New target.
4874 * testsuite/Makefile.in: Rebuild.
4875
57eb9b50
DK
48762011-06-27 Doug Kwan <dougkwan@google.com>
4877
4878 * arm.cc (Arm_relocate_functions::thm_jump8,
4879 Arm_relocate_functions::thm_jump11): Use a wider signed
4880 type to compute offset.
4881 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
4882 arm_thm_jump8.
4883 * testsuite/Makefile.in: Regenerate.
4884 * testsuite/arm_branch_in_range.sh: Check test results of
4885 arm_thm_jump11 and arm_thm_jump8.
4886 * testsuite/arm_thm_jump11.s: New test source file.
4887 * testsuite/arm_thm_jump11.t: New linker script.
4888 * testsuite/arm_thm_jump8.s: New test source file.
4889 * testsuite/arm_thm_jump8.t: New linker script.
4890
487b39df
ILT
48912011-06-24 Ian Lance Taylor <iant@google.com>
4892
4893 * layout.cc: Include "object.h".
4894 (ctors_sections_in_init_array): New static variable.
4895 (Layout::is_ctors_in_init_array): New function.
4896 (Layout::layout): Add entry to ctors_sections_in_init_array if
4897 appropriate.
4898 * layout.h (class Layout): Declare is_ctors_in_init_array.
4899 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
4900 is_ctors_reverse_view is set.
4901 (Sized_relobj_file::write_sections): Add layout parameter. Change
4902 all callers. Set is_ctors_reverse_view field of View_size.
4903 (Sized_relobj_file::reverse_words): New function.
4904 * object.h (Sized_relobj_file::View_size): Add
4905 is_ctors_reverse_view field.
4906 (class Sized_relobj_file): Update declarations.
4907 * testsuite/initpri3.c: New test.
4908 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
4909 initpri3b.
4910 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
4911 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
4912 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
4913 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
4914 * testsuite/Makefile.in: Rebuild.
4915
472076e4
CC
49162011-06-24 Cary Coutant <ccoutant@google.com>
4917
4918 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
4919 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
4920 (debug_msg_cdebug.err): New targets.
4921 * testsuite/Makefile.in: Regenerate.
4922 * testsuite/debug_msg.sh: Check output of link with compressed debug.
4923 Fix checks for link with shared library.
4924
a60af0db
DK
49252011-06-24 Doug Kwan <dougkwan@google.com>
4926
4927 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
4928 skip empty text sections.
4929 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
4930
5393d741
ILT
49312011-06-22 Ian Lance Taylor <iant@google.com>
4932
4933 PR gold/12910
4934 * options.h (class General_options): Add --ctors-in-init-array.
4935 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
4936 friends as SHT_PROGBITS for merging sections.
4937 (Layout::layout): Remove special handling of .init_array and
4938 friends. Don't sort if doing relocatable link. Sort for .ctors
4939 and .dtors if ctors_in_init_array.
4940 (Layout::make_output_section): Force correct section types for
4941 .init_array and friends. Don't sort if doing relocatable link,
4942 Don't sort .ctors and .dtors if ctors_in_init_array.
4943 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
4944 (Layout::output_section_name): Add relobj parameter. Change all
4945 callers. Handle .ctors. and .dtors. in code rather than table.
4946 Handle .ctors and .dtors if ctors_in_init_array.
4947 (Layout::match_file_name): New function, moved from output.cc.
4948 * layout.h (class Layout): Update declarations.
4949 * output.cc: Include "layout.h".
4950 (Input_section_sort_entry::get_priority): New function.
4951 (Input_section_sort_entry::match_file_name): Just call
4952 Layout::match_file_name.
4953 (Output_section::Input_section_sort_init_fini_compare::operator()):
4954 Handle .ctors and .dtors. Sort by explicit priority rather than
4955 by name.
4956 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
4957 * testsuite/initpri2.c: New test.
4958 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
4959 (check_PROGRAMS): Add initpri2.
4960 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
4961 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
4962 * configure, testsuite/Makefile.in: Rebuild.
4963
e1f74f98
ILT
49642011-06-19 Ian Lance Taylor <iant@google.com>
4965
4966 PR gold/12880
4967 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
4968 .interp section to a PT_INTERP segment even if we have seen a
4969 --dynamic-linker option. Don't do it if we have seen a PHDRS
4970 clause in a linker script.
4971 (Layout::finalize): Don't create a .interp section if we've
4972 already create a PT_INTERP segment.
4973 (Layout::create_interp): Always call choose_output_section (revert
4974 patch of 2011-06-17). Don't create PT_INTERP segment.
4975 * script-sections.cc
4976 (Script_sections::create_note_and_tls_segments): Add a .interp
4977 section to a PT_INTERP segment even if we have seen a
4978 --dynamic-linker option.
4979
766f91bb
ILT
49802011-06-18 Ian Lance Taylor <iant@google.com>
4981
4982 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
4983 merely because a non-PT_LOAD segment has a dynamic reloc.
4984
0d212c3a
ILT
49852011-06-18 Ian Lance Taylor <iant@google.com>
4986
4987 * layout.cc (Layout::finish_dynamic_section): Don't create
4988 DT_FLAGS entry if not needed.
4989
911a5072
ILT
49902011-06-18 Ian Lance Taylor <iant@google.com>
4991
4992 PR gold/12745
4993 * layout.cc (Layout::layout_eh_frame): Correct handling of
4994 writable .eh_frame section.
4995
534b4e5f
ILT
49962011-06-17 Ian Lance Taylor <iant@google.com>
4997
4998 PR gold/12893
4999 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5000 symbol is redefined with the exact same object and value.
5001
10b4f102
ILT
50022011-06-17 Ian Lance Taylor <iant@google.com>
5003
5004 PR gold/12880
5005 * layout.h (class Layout): Add interp_segment_ field.
5006 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5007 (Layout::attach_allocated_section_to_segment): If making shared
5008 library, put .interp section in PT_INTERP segment.
5009 (Layout::finalize): Also call create_interp if -dynamic-linker
5010 option was used.
5011 (Layout::create_interp): Assert that there is no PT_INTERP
5012 segment. If not using a SECTIONS clause, use make_output_section.
5013 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5014 * script-sections.cc
5015 (Script_sections::create_note_and_tls_segments): If making shared
5016 library, put .interp section in PT_INTERP segment.
5017
a29b0dad
ILT
50182011-06-17 Ian Lance Taylor <iant@google.com>
5019
e588ea8d
ILT
5020 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5021 when making a shared library.
5022
50232011-06-17 Ian Lance Taylor <iant@google.com>
5024
5025 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5026 parameter. Change all callers. Don't issue warning about PC32
5027 against locally defined symbol.
a29b0dad 5028
9d3b0698
ILT
50292011-06-16 Ian Lance Taylor <iant@google.com>
5030
5031 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5032 occurs in same object.
5033
85b0f90c
AM
50342011-06-14 Alan Modra <amodra@gmail.com>
5035
5036 * po/POTFILES.in: Regenerate.
5037
a94907d9
ILT
50382011-06-09 Ian Lance Taylor <iant@google.com>
5039
5040 * script-sections.cc
5041 (Orphan_output_section::set_section_addresses): For a relocatable
5042 link set address to 0.
5043
4fb3a1c3
CC
50442011-06-09 Cary Coutant <ccoutant@google.com>
5045
5046 PR gold/12804
5047 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5048 used with --compress-debug-sections.
5049 * gold/object.cc (Sized_relobj_file::do_layout): Report
5050 uncompressed size of compressed input sections.
5051
61220854
CC
50522011-06-08 Cary Coutant <ccoutant@google.com>
5053
5054 PR gold/12804
5055 * testsuite/two_file_test_2_v1.cc: Change initialization of
5056 v2 to keep it in .data.
5057
e6455dfb
CC
50582011-06-07 Cary Coutant <ccoutant@google.com>
5059
5060 * common.cc (Symbol_table::do_allocate_commons_list): Call
5061 gold_fallback.
5062 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5063 (Errors::fallback): New function.
5064 (gold_fallback): New function.
5065 * errors.h (Errors::fallback): New function.
5066 * gold.cc (gold_exit): Change status parameter to enum; adjust
5067 all callers.
5068 (queue_initial_tasks): Call gold_fallback.
5069 * gold.h: Include cstdlib.
5070 (Exit_status): New enum type.
5071 (gold_exit): Change status parameter to enum.
5072 (gold_fallback): New function.
5073 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5074 (Layout::create_symtab_sections): Likewise.
5075 (Layout::create_shdrs): Likewise.
5076 * main.cc (main): Adjust call to gold_exit.
5077 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5078 (Output_data_got::add_got_entry_pair): Likewise.
5079 (Output_section::add_input_section): Likewise.
5080 (Output_section::add_output_section_data): Likewise.
5081 (Output_segment::set_section_list_addresses): Likewise.
5082 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5083
fb0e076f
CC
50842011-06-07 Cary Coutant <ccoutant@google.com>
5085
5086 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5087 for incremental links.
5088 * output.cc (Output_segment::set_section_list_addresses): Remove
5089 FIXME and test for TLS or BSS.
5090
a5ee4d5d
CC
50912011-06-07 Cary Coutant <ccoutant@google.com>
5092
5093 * testsuite/Makefile.am: Add incremental_copy_test,
5094 incremental_common_test_1.
5095 * testsuite/Makefile.in: Regenerate.
5096 * testsuite/common_test_1_v1.c: New source file.
5097 * testsuite/common_test_1_v2.c: New source file.
5098 * testsuite/copy_test_v1.cc: New source file.
5099
5146f448
CC
51002011-06-07 Cary Coutant <ccoutant@google.com>
5101
5102 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5103 update, allocate common from bss section's free list.
5104 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5105 linker-defined symbols.
5106 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5107 Skip GOT and PLT entries that are no longer referenced.
5108 (Output_section_incremental_inputs::write_info_blocks): Mark
5109 linker-defined symbols.
5110 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5111 * output.cc (Output_section::allocate): New function.
5112 * output.h (Output_section::allocate): New function.
5113 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5114 linker-defined symbols.
5115 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5116 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5117 (Symbol::init_base_output_data): Likewise.
5118 (Symbol::init_base_output_segment): Likewise.
5119 (Symbol::init_base_constant): Likewise.
5120 (Sized_symbol::init_output_data): Likewise.
5121 (Sized_symbol::init_output_segment): Likewise.
5122 (Sized_symbol::init_constant): Likewise.
5123 (Symbol_table::do_define_in_output_data): Likewise.
5124 (Symbol_table::do_define_in_output_segment): Likewise.
5125 (Symbol_table::do_define_as_constant): Likewise.
5126 * symtab.h (Symbol::is_predefined): New function.
5127 (Symbol::init_base_output_data): Add is_predefined parameter.
5128 (Symbol::init_base_output_segment): Likewise.
5129 (Symbol::init_base_constant): Likewise.
5130 (Symbol::is_predefined_): New data member.
5131 (Sized_symbol::init_output_data): Add is_predefined parameter.
5132 (Sized_symbol::init_output_segment): Likewise.
5133 (Sized_symbol::init_constant): Likewise.
5134 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5135
26d3c67d
CC
51362011-06-07 Cary Coutant <ccoutant@google.com>
5137
5138 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5139 instead of emit_copy_reloc.
5140 (Copy_relocs::emit_copy_reloc): Refactor.
5141 (Copy_relocs::make_copy_reloc): New function.
5142 (Copy_relocs::add_copy_reloc): Remove.
5143 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5144 section.
5145 (Copy_relocs::make_copy_reloc): New function.
5146 (Copy_relocs::add_copy_reloc): Remove.
5147 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5148 unchanged input files.
5149 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5150 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5151 Reserve BSS space for COPY relocations.
5152 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5153 (Output_section_incremental_inputs::write_info_blocks): Record
5154 whether a symbol is copied from a shared object.
5155 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5156 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5157 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5158 (Incremental_input_entry_reader::get_output_symbol_index): Add
5159 is_copy parameter.
5160 (Incremental_binary::emit_copy_relocs): New function.
5161 (Incremental_binary::do_emit_copy_relocs): New function.
5162 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5163 new data member.
5164 (Sized_incremental_binary::add_copy_reloc): New function.
5165 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5166 (Sized_incremental_binary::Copy_reloc): New struct.
5167 (Sized_incremental_binary::Copy_relocs): New typedef.
5168 (Sized_incremental_binary::copy_relocs_): New data member.
5169 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5170 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5171 * target.h (Sized_target::emit_copy_reloc): New function.
5172 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5173
7cdb37d9
CC
51742011-06-02 Cary Coutant <ccoutant@google.com>
5175
5176 PR gold/12163
5177 * gold/archive.cc (Archive::Archive): Initialize new data member.
5178 (Archive::include_all_members): Return if archive has already been
5179 included.
5180 * gold/archive.h (Archive::include_all_members_): New data member.
5181
cc643b88
NC
51822011-06-02 Nick Clifton <nickc@redhat.com>
5183
5184 * dynobj.h: Fix spelling mistake in comment.
5185 * output.cc: Likewise.
5186
f62a3ca7 51872011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5188 Asier Llano
f62a3ca7
DK
5189
5190 PR gold/12826
cc643b88 5191 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5192 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5193 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5194 redundant arm_exidx_test.so.
5195 * testsuite/Makefile.in: Regenerate.
5196 (check_SCRIPTS): Add pr12826.sh
5197 (check_DATA): Add pr12826.stdout
5198 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5199 * testsuite/pr12826.sh: New file.
5200 * testsuite/pr12826_1.s: Ditto.
5201 * testsuite/pr12826_1.s: Ditto.
5202
8dbe1edc
ILT
52032011-05-30 Ian Lance Taylor <iant@google.com>
5204
5205 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5206 sections.
5207
c49875be
ILT
52082011-05-29 Ian Lance Taylor <iant@google.com>
5209
5210 PR gold/12804
5211 * testsuite/Makefile.am: Use different file name for two_file_test
5212 temporary file for each incremental test.
5213 * testsuite/Makefile.in: Rebuild.
5214
69d53f7a
ILT
52152011-05-29 Ian Lance Taylor <iant@google.com>
5216
5217 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5218 binary input file is empty.
5219
41d0ab5f
ILT
52202011-05-27 Ian Lance Taylor <iant@google.com>
5221
5222 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5223 (ver_test_9.so): Likewise.
5224 * testsuite/Makefile.in: Rebuild.
5225
89d8a36b
CC
52262011-05-26 Cary Coutant <ccoutant@google.com>
5227
5228 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5229 * incremental.cc (Incremental_inputs::report_input_section): Fix
5230 comment, indentation.
5231 (Incremental_inputs::report_comdat_group): New function.
5232 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5233 of data for incremental input file entry.
5234 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5235 group count, COMDAT group signatures.
5236 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5237 an unchanged input file.
5238 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5239 Initialize new data member.
5240 (Incremental_object_entry::add_comdat_group): New function.
5241 (Incremental_object_entry::get_comdat_group_count): New function.
5242 (Incremental_object_entry::get_comdat_signature_key): New function.
5243 (Incremental_object_entry::groups_): New data member.
5244 (Incremental_inputs::report_comdat_group): New function.
5245 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5246 data for incremental input file entry.
5247 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5248 (Incremental_input_entry_reader::get_input_section): Adjust size of
5249 data for incremental input file entry.
5250 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5251 (Incremental_input_entry_reader::get_comdat_group_signature): New
5252 function.
5253 * object.cc (Sized_relobj::include_section_group): Report kept
5254 COMDAT groups for incremental links.
5255
1706a06f
ILT
52562011-05-24 David Meyer <pdox@google.com>
5257
5258 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5259 with name parameter. Add found_name parameter.
5260 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5261 * dirsearch.h (class Dirsearch): Update declaration.
5262
a10ae760
ILT
52632011-05-24 Ian Lance Taylor <iant@google.com>
5264
5265 * archive.cc (Library_base::should_include_member): Pull in object
5266 from archive if it defines the entry symbol.
5267 * parameters.cc (Parameters::entry): New function.
5268 * parameters.h (class Parameters): Declare entry.
5269 * output.h (class Output_file_header): Remove entry_ field.
5270 * output.cc (Output_file_header::Output_file_header): Remove entry
5271 parameter. Change all callers.
5272 (Output_file_header::entry): Use parameters->entry.
5273 * gold.cc (queue_middle_tasks): Likewise.
5274 * plugin.cc (Plugin_hook::run): Likewise.
5275
aa92d6ed
CC
52762011-05-24 Cary Coutant <ccoutant@google.com>
5277
5278 * gold.cc (queue_initial_tasks): Pass incremental base filename
5279 to Output_file::open_base_file; don't print error message.
5280 * incremental-dump.cc (main): Adjust call to
5281 Output_file::open_for_modification.
5282 * incremental-dump.cc (main): Likewise.
5283 * incremental.cc (Incremental_inputs::report_command_line):
5284 Ignore --incremental-base option when comparing command lines.
5285 Ignore parameter when given as separate argument.
5286 * options.h (class General_options): Add --incremental-base.
5287 * output.cc (Output_file::Output_file):
5288 (Output_file::open_base_file): Add base_name and writable parameters;
5289 read base file into new file; print error message here.
5290 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5291 callers.
5292 * output.h (Output_file::open_for_modification): Rename to...
5293 (Output_file::open_base_file): ...this; add base_name and
5294 writable parameters; adjust all callers.
5295 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5296 callers.
5297 * testsuite/Makefile.am (incremental_test_4): Test
5298 --incremental-base.
5299 * testsuite/Makefile.in: Regenerate.
5300
2eedd706
CC
53012011-05-24 Cary Coutant <ccoutant@google.com>
5302
5303 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5304 incremental_test_4.
5305 * testsuite/Makefile.in: Regenerate.
5306 * testsuite/two_file_test_1_v1.cc: New test source file.
5307 * testsuite/two_file_test_1b_v1.cc: New test source file.
5308 * testsuite/two_file_test_2_v1.cc: New test source file.
5309
0f1c85a6
CC
53102011-05-24 Cary Coutant <ccoutant@google.com>
5311
5312 * dynobj.h (Dynobj::do_dynobj): New function.
5313 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5314 flag and soname for shared objects.
5315 * incremental.cc (Incremental_inputs::report_object): Make
5316 either Incremental_object_entry or Incremental_dynobj_entry; add
5317 soname to string table.
5318 (Incremental_inputs::report_input_section): Add assertion.
5319 (Output_section_incremental_inputs::set_final_data_size): Adjust
5320 type of input file entry for shared libraries; adjust size of
5321 shared library info entry.
5322 (Output_section_incremental_inputs::write_input_files): Write
5323 as_needed flag for shared libraries.
5324 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5325 of input file entry for shared libraries; write soname.
5326 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5327 soname from incremental info.
5328 * incremental.h (enum Incremental_input_flags): Add
5329 INCREMENTAL_INPUT_AS_NEEDED.
5330 (Incremental_input_entry::Incremental_input_entry): Initialize new
5331 data member.
5332 (Incremental_input_entry::set_as_needed): New function.
5333 (Incremental_input_entry::as_needed): New function.
5334 (Incremental_input_entry::do_dynobj_entry): New function.
5335 (Incremental_input_entry::as_needed_): New data member.
5336 (Incremental_object_entry::Incremental_object_entry): Don't check
5337 for shared library.
5338 (Incremental_object_entry::do_type): Likewise.
5339 (class Incremental_dynobj_entry): New class.
5340 (Incremental_input_entry_reader::as_needed): New function.
5341 (Incremental_input_entry_reader::get_soname): New function.
5342 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5343 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5344 size of shared library info entry.
58797674 5345 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5346 incremental link when adding DT_NEEDED entries.
5347 * object.h (Object::Object): Initialize new data member.
5348 (Object::dynobj): New function.
5349 (Object::set_as_needed): New function.
5350 (Object::as_needed): New function.
5351 (Object::do_dynobj): New function.
5352 (Object::as_needed_): New data member.
5353
6fa2a40b
CC
53542011-05-24 Cary Coutant <ccoutant@google.com>
5355
5356 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5357 info; adjust display of GOT entries.
5358 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5359 vector of input objects; remove file_status_.
5360 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5361 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5362 got_plt reader; call target hooks to reserve GOT entries.
5363 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5364 of input file info header and GOT info entry.
5365 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5366 relocation info.
5367 (Got_plt_view_info::got_descriptor): Remove.
5368 (Got_plt_view_info::sym_index): New data member.
5369 (Got_plt_view_info::input_index): New data member.
5370 (Local_got_offset_visitor::visit): Write input file index.
5371 (Global_got_offset_visitor::visit): Write 0 for input file index.
5372 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5373 with sym_index and input_index.
5374 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5375 incremental info GOT entry; replace got_descriptor with input_index.
5376 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5377 map from input file index to object.
5378 (Sized_relobj_incr::do_layout): Replace direct data member reference
5379 with accessor function.
5380 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5381 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5382 Adjust size of input file info header.
5383 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5384 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5385 (Incremental_input_entry_reader::get_input_section): Adjust size of
5386 input file info header.
5387 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5388 of incremental info GOT entry.
5389 (Incremental_got_plt_reader::get_got_desc): Remove.
5390 (Incremental_got_plt_reader::get_got_symndx): New function.
5391 (Incremental_got_plt_reader::get_got_input_index): New function.
5392 (Sized_incremental_binary::Sized_incremental_binary): Remove
5393 file_status_; add input_objects_.
5394 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5395 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5396 (Sized_incremental_binary::file_is_unchanged): Remove.
5397 (Sized_incremental_binary::set_input_object): New function.
5398 (Sized_incremental_binary::input_object): New function.
5399 (Sized_incremental_binary::file_status_): Remove.
5400 (Sized_incremental_binary::input_objects_): New data member.
5401 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5402 references.
5403 (Sized_relobj_incr::invalid_address): Move to base class.
5404 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5405 class.
5406 (Sized_relobj_incr::do_output_section_offset): Likewise.
5407 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5408 (Sized_relobj_incr::section_offsets_): Likewise.
5409 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5410 function.
5411 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5412 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5413 with accessor function.
5414 (Sized_relobj_file::do_layout): Likewise.
5415 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5416 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5417 (Sized_relobj_file::compute_final_local_value): Replace refs to
5418 section_offsets_ with accessor function.
5419 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5420 * object.h (Relobj::Relobj): Initialize new data members.
5421 (Relobj::add_dyn_reloc): New function.
5422 (Relobj::first_dyn_reloc): New function.
5423 (Relobj::dyn_reloc_count): New function.
5424 (Relobj::first_dyn_reloc_): New data member.
5425 (Relobj::dyn_reloc_count_): New data member.
5426 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5427 references.
5428 (Sized_relobj::Address): New typedef.
5429 (Sized_relobj::invalid_address): Move here from child class.
5430 (Sized_relobj::Sized_relobj): Initialize new data members.
5431 (Sized_relobj::sized_relobj): New function.
5432 (Sized_relobj::is_output_section_offset_invalid): Move here from
5433 child class.
5434 (Sized_relobj::get_output_section_offset): Likewise.
5435 (Sized_relobj::local_has_got_offset): Likewise.
5436 (Sized_relobj::local_got_offset): Likewise.
5437 (Sized_relobj::set_local_got_offset): Likewise.
5438 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5439 (Sized_relobj::clear_got_offsets): New function.
5440 (Sized_relobj::section_offsets): Move here from child class.
5441 (Sized_relobj::do_output_section_offset): Likewise.
5442 (Sized_relobj::do_set_section_offset): Likewise.
5443 (Sized_relobj::Local_got_offsets): Likewise.
5444 (Sized_relobj::local_got_offsets_): Likewise.
5445 (Sized_relobj::section_offsets_): Likewise.
5446 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5447 references.
5448 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5449 class.
5450 (Sized_relobj_file::sized_relobj): New function
5451 (Sized_relobj_file::local_has_got_offset): Move to base class.
5452 (Sized_relobj_file::local_got_offset): Likewise.
5453 (Sized_relobj_file::set_local_got_offset): Likewise.
5454 (Sized_relobj_file::get_output_section_offset): Likewise.
5455 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5456 (Sized_relobj_file::do_output_section_offset): Likewise.
5457 (Sized_relobj_file::do_set_section_offset): Likewise.
5458 (Sized_relobj_file::Local_got_offsets): Likewise.
5459 (Sized_relobj_file::local_got_offsets_): Likewise.
5460 (Sized_relobj_file::section_offsets_): Likewise.
5461 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5462 (all constructors).
5463 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5464 (Output_reloc::get_symbol_index): Likewise.
5465 (Output_reloc::local_section_offset): Likewise.
5466 (Output_reloc::get_address): Likewise.
5467 (Output_reloc::symbol_value): Likewise.
5468 (Output_data_got::reserve_slot): Move to class definition.
5469 (Output_data_got::reserve_local): New function.
5470 (Output_data_got::reserve_slot_for_global): Remove.
5471 (Output_data_got::reserve_global): New function.
5472 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5473 (all constructors, two instantiations).
5474 (Output_reloc::get_relobj): New function (two instantiations).
5475 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5476 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5477 (Output_data_reloc::add_global): Adjust type of relobj.
5478 (Output_data_reloc::add_global_relative): Likewise.
5479 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5480 (Output_data_reloc::add_local): Likewise.
5481 (Output_data_reloc::add_local_relative): Likewise.
5482 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5483 (Output_data_reloc::add_local_section): Likewise.
5484 (Output_data_reloc::add_output_section): Likewise.
5485 (Output_data_reloc::add_absolute): Likewise.
5486 (Output_data_reloc::add_target_specific): Likewise.
5487 (Output_data_got::reserve_slot): Move definition here.
5488 (Output_data_got::reserve_local): New function.
5489 (Output_data_got::reserve_global): New function.
5490 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5491 section_offsets_ with accessor function.
5492 (Sized_relobj_file::write_sections): Likewise.
5493 (Sized_relobj_file::do_relocate_sections): Likewise.
5494 * target.h (Sized_target::reserve_local_got_entry): New function.
5495 (Sized_target::reserve_global_got_entry): New function.
5496 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5497 (Target_x86_64::reserve_global_got_entry): New function.
5498 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5499
4829d394
CC
55002011-05-23 Cary Coutant <ccoutant@google.com>
5501
5502 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5503 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5504 bit when checking got_type.
5505 * incremental.cc (Sized_incremental_binary::setup_readers):
5506 Store symbol table and string table locations; initialize bit vector
5507 of file status flags.
5508 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5509 unchanged files.
5510 (Sized_incremental_binary::do_process_got_plt): New function.
5511 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5512 (Output_section_incremental_inputs::set_final_data_size): Record
5513 file index for each input file.
5514 (Output_section_incremental_inputs::write_got_plt): Store file index
5515 instead of input entry offset for each GOT entry.
5516 * incremental.h
5517 (Incremental_input_entry::Incremental_input_entry): Initialize new
5518 data member.
5519 (Incremental_input_entry::set_offset): Store file index.
5520 (Incremental_input_entry::get_file_index): New function.
5521 (Incremental_input_entry::file_index_): New data member.
5522 (Incremental_binary::process_got_plt): New function.
5523 (Incremental_binary::do_process_got_plt): New function.
5524 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5525 data members.
5526 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5527 (Sized_incremental_binary::set_file_is_unchanged): New function.
5528 (Sized_incremental_binary::file_is_unchanged): New function.
5529 (Sized_incremental_binary::do_process_got_plt): New function.
5530 (Sized_incremental_binary::file_status_): New data member.
5531 (Sized_incremental_binary::main_symtab_loc_): New data member.
5532 (Sized_incremental_binary::main_strtab_loc_): New data member.
5533 * output.cc (Output_data_got::Got_entry::write): Add case
5534 RESERVED_CODE.
5535 (Output_data_got::add_global): Call add_got_entry.
5536 (Output_data_got::add_global_plt): Likewise.
5537 (Output_data_got::add_global_with_rel): Likewise.
5538 (Output_data_got::add_global_with_rela): Likewise.
5539 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5540 (Output_data_got::add_global_pair_with_rela): Likewise.
5541 (Output_data_got::add_local): Call add_got_entry.
5542 (Output_data_got::add_local_plt): Likewise.
5543 (Output_data_got::add_local_with_rel): Likewise.
5544 (Output_data_got::add_local_with_rela): Likewise.
5545 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5546 (Output_data_got::add_local_pair_with_rela): Likewise.
5547 (Output_data_got::reserve_slot): New function.
5548 (Output_data_got::reserve_slot_for_global): New function.
5549 (Output_data_got::add_got_entry): New function.
5550 (Output_data_got::add_got_entry_pair): New function.
5551 (Output_section::add_output_section_data): Edit FIXME.
5552 * output.h
5553 (Output_section_data_build::Output_section_data_build): New
5554 constructor with size parameter.
5555 (Output_data_space::Output_data_space): Likewise.
5556 (Output_data_got::Output_data_got): Initialize new data member; new
5557 constructor with size parameter.
5558 (Output_data_got::add_constant): Call add_got_entry.
5559 (Output_data_got::reserve_slot): New function.
5560 (Output_data_got::reserve_slot_for_global): New function.
5561 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5562 (Output_data_got::add_got_entry): New function.
5563 (Output_data_got::add_got_entry_pair): New function.
5564 (Output_data_got::free_list_): New data member.
5565 * target.h (Sized_target::init_got_plt_for_update): New function.
5566 (Sized_target::register_global_plt_entry): New function.
5567 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5568 Initialize new data member; call init; add constructor with PLT count.
5569 (Output_data_plt_x86_64::init): New function.
5570 (Output_data_plt_x86_64::add_relocation): New function.
5571 (Output_data_plt_x86_64::reserve_slot): New function.
5572 (Output_data_plt_x86_64::free_list_): New data member.
5573 (Target_x86_64::init_got_plt_for_update): New function.
5574 (Target_x86_64::register_global_plt_entry): New function.
5575 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5576 incremental updates.
5577 (Output_data_plt_x86_64::add_relocation): New function.
5578 * testsuite/object_unittest.cc (Object_test): Set default options.
5579
ec69d6da
ILT
55802011-05-16 Ian Lance Taylor <iant@google.com>
5581
5582 * options.h (class General_options): Make -i a synonym for -r.
5583
732e31de
ILT
55842011-05-16 Ian Lance Taylor <iant@google.com>
5585
5586 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5587
403676b5
CC
55882011-05-10 Cary Coutant <ccoutant@google.com>
5589
5590 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5591 strip_all (-s).
5592
5b7b7d6e
ILT
55932011-05-06 Ian Lance Taylor <iant@google.com>
5594
5595 * layout.cc (Layout::layout): If the output section flags change,
5596 update the ordering.
5597
f0f9babf
CC
55982011-04-25 Cary Coutant <ccoutant@google.com>
5599
5600 * incremental-dump.cc (dump_incremental_inputs): Print local
5601 symbol info for each input file.
5602 * incremental.cc
5603 (Output_section_incremental_inputs::set_final_data_size): Add local
5604 symbol info to input file entries in incremental info.
5605 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5606 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5607 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5608 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5609 implementation.
5610 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5611 (Sized_incr_relobj::do_relocate): Write the local symbols.
5612 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5613 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5614 Adjust size of input file header.
5615 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5616 (Incremental_inputs_reader::get_local_symbol_count): New function.
5617 (Incremental_inputs_reader::get_input_section): Adjust size of input
5618 file header.
5619 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5620 (Sized_incr_relobj::This): New typedef.
5621 (Sized_incr_relobj::sym_size): New const data member.
5622 (Sized_incr_relobj::Local_symbol): New struct.
5623 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5624 (Sized_incr_relobj::do_local_symbol_offset): New function.
5625 (Sized_incr_relobj::local_symbol_count_): New data member.
5626 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5627 (Sized_incr_relobj::local_symbol_index_): New data member.
5628 (Sized_incr_relobj::local_symbol_offset_): New data member.
5629 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5630 (Sized_incr_relobj::local_symbols_): New data member.
5631 * object.h (Relobj::output_local_symbol_count): New function.
5632 (Relobj::local_symbol_offset): New function.
5633 (Relobj::do_output_local_symbol_count): New function.
5634 (Relobj::do_local_symbol_offset): New function.
5635 (Sized_relobj::do_output_local_symbol_count): New function.
5636 (Sized_relobj::do_local_symbol_offset): New function.
5637
d0a9ace3
ILT
56382011-04-22 Vladimir Simonov <sv@sw.ru>
5639
5640 * descriptors.cc (set_close_on_exec): New function.
5641 (Descriptors::open): Use set_close_on_exec.
5642 * output.cc (S_ISLNK): Define if not defined.
5643
94a3fc8b
CC
56442011-04-22 Cary Coutant <ccoutant@google.com>
5645
5646 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5647 global symbol map.
5648 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5649 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5650 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5651 relocations.
5652 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5653 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5654 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5655 * incremental.h
5656 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5657 function.
5658 (Incremental_binary::apply_incremental_relocs): New function.
5659 (Incremental_binary::do_apply_incremental_relocs): New function.
5660 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5661 data member.
5662 (Sized_incremental_binary::add_global_symbol): New function.
5663 (Sized_incremental_binary::global_symbol): New function.
5664 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5665 (Sized_incremental_binary::symbol_map_): New data member.
5666 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5667 * target.h (Sized_target::apply_relocation): New function.
5668 * target-reloc.h (apply_relocation): New function.
5669 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5670
c87e4302
DK
56712011-04-22 Doug Kwan <dougkwan@google.com>
5672
5673 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5674 flag of a SHT_ARM_EXIDX section.
2e702c99 5675 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
5676 * testsuite/Makefile.in: Regenerate.
5677 * testsuite/arm_exidx_test.s: New file.
5678 * testsuite/arm_exidx_test.sh: Same.
5679
e7782cf6
CC
56802011-04-20 Cary Coutant <ccoutant@google.com>
5681
5682 PR gold/12689
5683 * archive.h (Incremental_archive_entry::Archive_member):
5684 Initialize arg_serial_ (second constructor).
5685
308ecdc7
ILT
56862011-04-17 Ian Lance Taylor <iant@google.com>
5687
5688 * object.cc (Relocate_info::location): Simplify location string.
5689 * errors.cc (Errors::error_at_location): Don't print program
5690 name.
5691 (Errors::warning_at_location): Likewise.
5692 (Errors::undefined_symbol): Likewise.
5693 * testsuite/debug_msg.sh: Update accordingly.
5694
bec5b579
CC
56952011-04-14 Cary Coutant <ccoutant@google.com>
5696
5697 * gold/layout.cc (Layout::symtab_section_offset): New function.
5698 * gold/layout.h (Layout::symtab_section_offset): New function.
5699 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5700
88597d34
ILT
57012011-04-12 Ian Lance Taylor <iant@google.com>
5702
5703 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5704 with MREMAP_MAYMOVE.
5705 * output.h (class Output_file): Add map_is_allocated_ field.
5706 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5707 not available, provide stubs. If mremap is not available, #define
5708 it to gold_mremap.
5709 (MREMAP_MAYMOVE): Define if not defined.
5710 (Output_file::Output_file): Initialize map_is_allocated_.
5711 (Output_file::resize): Check map_is_allocated_.
5712 (Output_file::map_anonymous): If mmap fails, use malloc.
5713 (Output_file::unmap): Don't do anything for an anonymous map.
5714 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5715 is not available, provide stubs.
5716 (File_read::View::~View): Use free rather than delete[].
5717 (File_read::make_view): Use malloc rather than new[]. If mmap
5718 fails, use malloc.
5719 (File_read::find_or_make_view): Use malloc rather than new[].
5720 * gold.h: Remove HAVE_REMAP code.
5721 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5722 exists. Rename mremap to gold_mremap. If mmap is not available
5723 don't do anything.
5724 * configure, config.in: Rebuild.
5725
11e361bc
ILT
57262011-04-11 Ian Lance Taylor <iant@google.com>
5727
5728 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5729 initialize local variable v.
5730
cdc29364
CC
57312011-04-11 Cary Coutant <ccoutant@google.com>
5732
5733 * archive.cc (Archive::include_member): Adjust call to
5734 report_object.
5735 (Add_archive_symbols::run): Track argument serial numbers.
5736 (Lib_group::include_member): Likewise.
5737 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5738 * archive.h (Incremental_archive_entry::Archive_member):
5739 Initialize arg_serial_.
5740 (Archive_member::arg_serial_): New data member.
5741 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5742 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5743 incremental link.
5744 (Sized_dynobj::do_for_all_local_got_entries): New function.
5745 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5746 function.
5747 * fileread.cc (get_mtime): New function.
5748 * fileread.h (get_mtime): New function.
5749 * gold.cc (queue_initial_tasks): Check for incremental update.
5750 (process_incremental_input): New function.
5751 (queue_middle_tasks): Don't force valid target for incremental
5752 update.
5753 * incremental-dump.cc (find_input_containing_global): Adjust
5754 size of symbol info entry.
5755 (dump_incremental_inputs): Dump argument serial number and
5756 in_system_directory flag; bias shndx by 1; print symbol names
5757 when dumping per-file symbol lists; use new symbol info readers.
5758 * incremental.cc
5759 (Output_section_incremental_inputs:update_data_size): New function.
5760 (Sized_incremental_binary::setup_readers): Setup input readers
5761 for each input file; build maps for files added from libraries
5762 and scripts.
5763 (Sized_incremental_binary::check_input_args): New function.
5764 (Sized_incremental_binary::do_check_inputs): Build map of argument
5765 serial numbers to input arguments.
5766 (Sized_incremental_binary::do_file_has_changed): Rename
5767 do_file_is_unchanged to this; compare file modification times.
5768 (Sized_incremental_binary::do_init_layout): New function.
5769 (Sized_incremental_binary::do_reserve_layout): New function.
5770 (Sized_incremental_binary::do_get_input_reader): Remove.
5771 (Sized_incremental_binary::get_symtab_view): New function.
5772 (Incremental_checker::can_incrementally_link_output_file): Remove.
5773 (Incremental_inputs::report_command_line): Exclude --debug options.
5774 (Incremental_inputs::report_archive_begin): Add parameter; track
5775 argument serial numbers; don't put input file entry for archive
5776 before archive members.
5777 (Incremental_inputs::report_archive_end): Put input file entry
5778 for archive after archive members.
5779 (Incremental_inputs::report_object): Add parameter; track argument
5780 serial numbers and in_system_directory flag.
5781 (Incremental_inputs::report_script): Add parameter; track argument
5782 serial numbers.
5783 (Output_section_incremental_inputs::set_final_data_size): Adjust
5784 size of symbol info entry; check for forwarding symbols.
5785 (Output_section_incremental_inputs::write_input_files): Write
5786 in_system_directory flag and argument serial number.
5787 (Output_section_incremental_inputs::write_info_blocks): Map section
5788 indices between incremental info and original input file; store
5789 input section index for each symbol.
5790 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5791 change operator() to visit().
5792 (class Global_got_offset_visitor): Likewise.
5793 (class Global_symbol_visitor_got_plt):
5794 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5795 classes.
5796 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5797 (Sized_incr_relobj::do_read_symbols): New function.
5798 (Sized_incr_relobj::do_layout): New function.
5799 (Sized_incr_relobj::do_layout_deferred_sections): New function.
5800 (Sized_incr_relobj::do_add_symbols): New function.
5801 (Sized_incr_relobj::do_should_include_member): New function.
5802 (Sized_incr_relobj::do_for_all_global_symbols): New function.
5803 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
5804 (Sized_incr_relobj::do_section_size): New function.
5805 (Sized_incr_relobj::do_section_name): New function.
5806 (Sized_incr_relobj::do_section_contents): New function.
5807 (Sized_incr_relobj::do_section_flags): New function.
5808 (Sized_incr_relobj::do_section_entsize): New function.
5809 (Sized_incr_relobj::do_section_address): New function.
5810 (Sized_incr_relobj::do_section_type): New function.
5811 (Sized_incr_relobj::do_section_link): New function.
5812 (Sized_incr_relobj::do_section_info): New function.
5813 (Sized_incr_relobj::do_section_addralign): New function.
5814 (Sized_incr_relobj::do_initialize_xindex): New function.
5815 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
5816 (Sized_incr_relobj::do_read_relocs): New function.
5817 (Sized_incr_relobj::do_gc_process_relocs): New function.
5818 (Sized_incr_relobj::do_scan_relocs): New function.
5819 (Sized_incr_relobj::do_count_local_symbols): New function.
5820 (Sized_incr_relobj::do_finalize_local_symbols): New function.
5821 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
5822 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
5823 (Sized_incr_relobj::do_relocate): New function.
5824 (Sized_incr_relobj::do_set_section_offset): New function.
5825 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
5826 (Sized_incr_dynobj::do_read_symbols): New function.
5827 (Sized_incr_dynobj::do_layout): New function.
5828 (Sized_incr_dynobj::do_add_symbols): New function.
5829 (Sized_incr_dynobj::do_should_include_member): New function.
5830 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
5831 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
5832 (Sized_incr_dynobj::do_section_size): New function.
5833 (Sized_incr_dynobj::do_section_name): New function.
5834 (Sized_incr_dynobj::do_section_contents): New function.
5835 (Sized_incr_dynobj::do_section_flags): New function.
5836 (Sized_incr_dynobj::do_section_entsize): New function.
5837 (Sized_incr_dynobj::do_section_address): New function.
5838 (Sized_incr_dynobj::do_section_type): New function.
5839 (Sized_incr_dynobj::do_section_link): New function.
5840 (Sized_incr_dynobj::do_section_info): New function.
5841 (Sized_incr_dynobj::do_section_addralign): New function.
5842 (Sized_incr_dynobj::do_initialize_xindex): New function.
5843 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
5844 (make_sized_incremental_object): New function.
5845 (Incremental_library::copy_unused_symbols): New function.
5846 (Incremental_library::do_for_all_unused_symbols): New function.
5847 * incremental.h (enum Incremental_input_flags): New type.
5848 (class Incremental_checker): Remove.
5849 (Incremental_input_entry::Incremental_input_entry): Add argument
5850 serial number.
5851 (Incremental_input_entry::arg_serial): New function.
5852 (Incremental_input_entry::set_is_in_system_directory): New function.
5853 (Incremental_input_entry::is_in_system_directory): New function.
5854 (Incremental_input_entry::arg_serial_): New data member.
5855 (Incremental_input_entry::is_in_system_directory_): New data member.
5856 (class Script_info): Move here from script.h.
5857 (Script_info::Script_info): Add filename parameter.
5858 (Script_info::filename): New function.
5859 (Script_info::filename_): New data member.
5860 (Incremental_script_entry::Incremental_script_entry): Add argument
5861 serial number.
5862 (Incremental_object_entry::Incremental_object_entry): Likewise.
5863 (Incremental_object_entry::add_input_section): Build list of input
5864 sections with map to original shndx.
5865 (Incremental_object_entry::get_input_section_index): New function.
5866 (Incremental_object_entry::shndx_): New data member.
5867 (Incremental_object_entry::name_key_): Rename; adjust all refs.
5868 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
5869 (Incremental_archive_entry::Incremental_archive_entry): Add argument
5870 serial number.
5871 (Incremental_inputs::report_archive_begin): Likewise.
5872 (Incremental_inputs::report_object): Likewise.
5873 (Incremental_inputs::report_script): Likewise.
5874 (class Incremental_global_symbol_reader): New class.
5875 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
5876 and store flags and input file type.
5877 (Incremental_input_entry_reader::arg_serial): New function.
5878 (Incremental_input_entry_reader::type): Extract type from flags.
5879 (Incremental_input_entry_reader::is_in_system_directory): New function.
5880 (Incremental_input_entry_reader::get_input_section_count): Call
5881 accessor function for type.
5882 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
5883 function for type; adjust size of global symbol entry.
5884 (Incremental_input_entry_reader::get_global_symbol_count): Call
5885 accessor function for type.
5886 (Incremental_input_entry_reader::get_object_count): Likewise.
5887 (Incremental_input_entry_reader::get_object_offset): Likewise.
5888 (Incremental_input_entry_reader::get_member_count): Likewise.
5889 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
5890 (Incremental_input_entry_reader::get_member_offset): Likewise.
5891 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
5892 (Incremental_input_entry_reader::Global_symbol_info): Remove.
5893 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
5894 (Incremental_input_entry_reader::get_global_symbol_reader): New
5895 function.
5896 (Incremental_input_entry_reader::get_output_symbol_index): New
5897 function.
5898 (Incremental_input_entry_reader::type_): Remove.
5899 (Incremental_input_entry_reader::flags_): New data member.
5900 (Incremental_inputs_reader::input_file_offset): New function.
5901 (Incremental_inputs_reader::input_file_index): New function.
5902 (Incremental_inputs_reader::input_file): Call input_file_offset.
5903 (Incremental_inputs_reader::input_file_at_offset): New function.
5904 (Incremental_relocs_reader::get_r_type): Reformat.
5905 (Incremental_relocs_reader::get_r_shndx): Reformat.
5906 (Incremental_relocs_reader::get_r_offset): Reformat.
5907 (Incremental_relocs_reader::data): New function.
5908 (Incremental_binary::Incremental_binary): Initialize new data members.
5909 (Incremental_binary::check_inputs): Add cmdline parameter.
5910 (Incremental_binary::file_is_unchanged): Remove.
5911 (Input_reader::arg_serial): New function.
5912 (Input_reader::get_unused_symbol_count): New function.
5913 (Input_reader::get_unused_symbol): New function.
5914 (Input_reader::do_arg_serial): New function.
5915 (Input_reader::do_get_unused_symbol_count): New function.
5916 (Input_reader::do_get_unused_symbol): New function.
5917 (Incremental_binary::input_file_count): New function.
5918 (Incremental_binary::get_input_reader): Change signature to use
5919 index instead of filename.
5920 (Incremental_binary::file_has_changed): New function.
5921 (Incremental_binary::get_input_argument): New function.
5922 (Incremental_binary::get_library): New function.
5923 (Incremental_binary::get_script_info): New function.
5924 (Incremental_binary::init_layout): New function.
5925 (Incremental_binary::reserve_layout): New function.
5926 (Incremental_binary::output_file): New function.
5927 (Incremental_binary::do_check_inputs): New function.
5928 (Incremental_binary::do_file_is_unchanged): Remove.
5929 (Incremental_binary::do_file_has_changed): New function.
5930 (Incremental_binary::do_init_layout): New function.
5931 (Incremental_binary::do_reserve_layout): New function.
5932 (Incremental_binary::do_input_file_count): New function.
5933 (Incremental_binary::do_get_input_reader): Change signature.
5934 (Incremental_binary::input_args_map_): New data member.
5935 (Incremental_binary::library_map_): New data member.
5936 (Incremental_binary::script_map_): New data member.
5937 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5938 new data members.
5939 (Sized_incremental_binary::output_section): New function.
5940 (Sized_incremental_binary::inputs_reader): Add const.
5941 (Sized_incremental_binary::symtab_reader): Add const.
5942 (Sized_incremental_binary::relocs_reader): Add const.
5943 (Sized_incremental_binary::got_plt_reader): Add const.
5944 (Sized_incremental_binary::get_symtab_view): New function.
5945 (Sized_incremental_binary::Inputs_reader): New typedef.
5946 (Sized_incremental_binary::Input_entry_reader): New typedef.
5947 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
5948 (Sized_incremental_binary::do_file_is_unchanged): Remove.
5949 (Sized_incremental_binary::do_file_has_changed): New function.
5950 (Sized_incremental_binary::do_init_layout): New function.
5951 (Sized_incremental_binary::do_reserve_layout): New function.
5952 (Sized_input_reader::Inputs_reader): Remove.
5953 (Sized_input_reader::Input_entry_reader): Remove.
5954 (Sized_input_reader::do_arg_serial): New function.
5955 (Sized_input_reader::do_get_unused_symbol_count): New function.
5956 (Sized_input_reader::do_get_unused_symbol): New function.
5957 (Sized_incremental_binary::do_input_file_count): New function.
5958 (Sized_incremental_binary::do_get_input_reader): Change signature;
5959 use index instead of filename.
5960 (Sized_incremental_binary::section_map_): New data member.
5961 (Sized_incremental_binary::input_entry_readers_): New data member.
5962 (class Sized_incr_relobj): New class.
5963 (class Sized_incr_dynobj): New class.
5964 (make_sized_incremental_object): New function.
5965 (class Incremental_library): New class.
5966 * layout.cc (Free_list::num_lists): New static data member.
5967 (Free_list::num_nodes): New static data member.
5968 (Free_list::num_removes): New static data member.
5969 (Free_list::num_remove_visits): New static data member.
5970 (Free_list::num_allocates): New static data member.
5971 (Free_list::num_allocate_visits): New static data member.
5972 (Free_list::init): New function.
5973 (Free_list::remove): New function.
5974 (Free_list::allocate): New function.
5975 (Free_list::dump): New function.
5976 (Free_list::print_stats): New function.
5977 (Layout_task_runner::run): Resize output file for incremental updates.
5978 (Layout::Layout): Initialize new data members.
5979 (Layout::set_incremental_base): New function.
5980 (Layout::init_fixed_output_section): New function.
5981 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
5982 incremental updates.
5983 (Layout::create_gold_note): Do not create gold note section for
5984 incremental updates.
5985 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
5986 for incremental updates.
5987 (Layout::set_section_offsets): For incremental updates, allocate space
5988 from free list.
5989 (Layout::create_symtab_sections): Layout with offsets relative to
5990 start of section; for incremental updates, allocate space from free
5991 list.
5992 (Layout::create_shdrs): For incremental updates, allocate space from
5993 free list.
5994 (Layout::finish_dynamic_section): For incremental updates, do not
5995 check --as-needed (fixed in subsequent patch).
5996 * layout.h (class Free_list): New class.
5997 (Layout::set_incremental_base): New function.
5998 (Layout::incremental_base): New function.
5999 (Layout::init_fixed_output_section): New function.
6000 (Layout::allocate): New function.
6001 (Layout::incremental_base_): New data member.
6002 (Layout::free_list_): New data member.
6003 * main.cc (main): Print Free_list statistics.
6004 * object.cc (Relobj::finalize_incremental_relocs): Add
6005 clear_counts parameter; clear counts only when clear_counts is set.
6006 (Sized_relobj::Sized_relobj): Initialize new base class.
6007 (Sized_relobj::do_layout): Don't report special sections.
6008 (Sized_relobj::do_for_all_local_got_entries): New function.
6009 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6010 symtab_off to all symbol table offsets.
6011 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6012 * object.h (class Got_offset_list): Move to top of file.
6013 (Object::Object): Allow case where input_file == NULL.
6014 (Object::~Object): Likewise.
6015 (Object::input_file): Assert that input_file != NULL.
6016 (Object::lock): Allow case where input_file == NULL.
6017 (Object::unlock): Likewise.
6018 (Object::is_locked): Likewise.
6019 (Object::token): Likewise.
6020 (Object::release): Likewise.
6021 (Object::is_incremental): New function.
6022 (Object::get_mtime): New function.
6023 (Object::for_all_local_got_entries): New function.
6024 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6025 (Object::set_is_in_system_directory): New function.
6026 (Object::is_in_system_directory): New function.
6027 (Object::do_is_incremental): New function.
6028 (Object::do_get_mtime): New function.
6029 (Object::do_for_all_local_got_entries): New function.
6030 (Object::is_in_system_directory_): New data member.
6031 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6032 (class Sized_relobj_base): New class.
6033 (class Sized_relobj): Derive from Sized_relobj_base.
6034 (class Sized_relobj::Symbols): Redeclare from base class.
6035 (class Sized_relobj::local_got_offset_list): Remove.
6036 (class Sized_relobj::Output_sections): Redeclare from base class.
6037 (class Sized_relobj::do_for_all_local_got_entries): New function.
6038 (class Sized_relobj::write_local_symbols): Add offset parameter.
6039 (class Sized_relobj::local_symbol_offset_): Update comment.
6040 (class Sized_relobj::local_dynsym_offset_): Update comment.
6041 * options.cc (Input_arguments::add_file): Remove const.
6042 * options.h (Input_file_argument::Input_file_argument):
6043 Initialize arg_serial_ (all constructors).
6044 (Input_file_argument::set_arg_serial): New function.
6045 (Input_file_argument::arg_serial): New function.
6046 (Input_file_argument::arg_serial_): New data member.
6047 (Input_arguments::Input_arguments): Initialize file_count_.
6048 (Input_arguments::add_file): Remove const.
6049 (Input_arguments::number_of_input_files): New function.
6050 (Input_arguments::file_count_): New data member.
6051 (Command_line::number_of_input_files): Call
6052 Input_arguments::number_of_input_files.
6053 * output.cc (Output_segment_headers::Output_segment_headers):
6054 Set current size.
6055 (Output_section::Input_section::current_data_size): New function.
6056 (Output_section::Output_section): Initialize new data members.
6057 (Output_section::add_input_section): Don't do merge sections for
6058 an incremental link; allocate space from free list for an
6059 incremental update.
6060 (Output_section::add_output_section_data): Allocate space from
6061 free list for an incremental update.
6062 (Output_section::update_data_size): New function.
6063 (Output_section::set_fixed_layout): New function.
6064 (Output_section::reserve): New function.
6065 (Output_segment::set_section_addresses): Remove const.
6066 (Output_segment::set_section_list_addresses): Remove const; allocate
6067 space from free list for an incremental update.
6068 (Output_segment::set_offset): Adjust size of RELRO segment for an
6069 incremental update.
6070 * output.h (Output_data::current_data_size): Move here from
6071 child classes.
6072 (Output_data::pre_finalize_data_size): New function.
6073 (Output_data::update_data_size): New function.
6074 (Output_section_headers::update_data_size): new function.
6075 (Output_section_data_build::current_data_size): Move to Output_data.
6076 (Output_data_strtab::update_data_size): New function.
6077 (Output_section::current_data_size): Move to Output_data.
6078 (Output_section::set_fixed_layout): New function.
6079 (Output_section::has_fixed_layout): New function.
6080 (Output_section::reserve): New function.
6081 (Output_section::update_data_size): New function.
6082 (Output_section::has_fixed_layout_): New data member.
6083 (Output_section::free_list_): New data member.
6084 (Output_segment::set_section_addresses): Remove const.
6085 (Output_segment::set_section_list_addresses): Remove const.
6086 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6087 New function.
6088 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6089 New function.
6090 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6091 parameter when calling Add_symbols constructor; store argument
6092 serial number for members of a lib group.
6093 (Add_symbols::locks): Allow case where token == NULL.
6094 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6095 (Read_member::~Read_member): New function.
6096 (Read_member::is_runnable): New function.
6097 (Read_member::locks): New function.
6098 (Read_member::run): New function.
6099 (Check_script::~Check_script): New function.
6100 (Check_script::is_runnable): New function.
6101 (Check_script::locks): New function.
6102 (Check_script::run): New function.
6103 (Check_library::~Check_library): New function.
6104 (Check_library::is_runnable): New function.
6105 (Check_library::locks): New function.
6106 (Check_library::run): New function.
6107 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6108 (Add_symbols::library_): New data member.
6109 (class Read_member): New class.
6110 (class Check_script): New class.
6111 (class Check_library): New class.
6112 * reloc.cc (Read_relocs::is_runnable): Allow case where
6113 token == NULL.
6114 (Read_relocs::locks): Likewise.
6115 (Scan_relocs::locks): Likewise.
6116 (Relocate_task::locks): Likewise.
6117 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6118 to clear counters.
6119 (Sized_relobj::incremental_relocs_scan): Fix comment.
6120 (Sized_relobj::do_relocate): Pass output file offset to
6121 write_local_symbols.
6122 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6123 from class declaration.
6124 * script.cc (read_input_script): Allocate Script_info; pass
6125 argument serial number to report_script.
6126 * script.h (class Script_info): Move to incremental.h.
6127 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6128 * symtab.h (Symbol_table::add_from_incrobj): New function.
6129 (Symbol_table::set_file_offset): New function.
6130
b961d0d7
CC
61312011-04-05 Cary Coutant <ccoutant@google.com>
6132
6133 * incremental-dump.cc (dump_incremental_inputs): Change signature
6134 to take a Sized_incremental_binary; change caller. Use readers
6135 in Sized_incremental_binary.
6136 * incremental.cc
6137 (Sized_incremental_binary::find_incremental_inputs_sections):
6138 Rename do_find_incremental_inputs_sections to this.
6139 (Sized_incremental_binary::setup_readers): New function.
6140 (Sized_incremental_binary::do_check_inputs): Check
6141 has_incremental_info_ flag; move setup code to setup_readers;
6142 use input readers.
6143 (Sized_incremental_binary::do_file_is_unchanged): New function.
6144 (Sized_incremental_binary::do_get_input_reader): New function.
6145 * incremental.h (class Incremental_binary): Move to end of file.
6146 (Incremental_binary::file_is_unchanged): New function.
6147 (Incremental_binary::do_file_is_unchanged): New function.
6148 (Incremental_binary::Input_reader): New class.
6149 (Incremental_binary::get_input_reader): New function.
6150 (class Sized_incremental_binary): Move to end of file.
6151 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6152 input section reader classes.
6153 (Sized_incremental_binary::has_incremental_info): New function.
6154 (Sized_incremental_binary::inputs_reader): New function.
6155 (Sized_incremental_binary::symtab_reader): New function.
6156 (Sized_incremental_binary::relocs_reader): New function.
6157 (Sized_incremental_binary::got_plt_reader): New function.
6158 (Sized_incremental_binary::do_file_is_unchanged): New function.
6159 (Sized_incremental_binary::Sized_input_reader): New class.
6160 (Sized_incremental_binary::get_input_reader): New function.
6161 (Sized_incremental_binary::find_incremental_inputs_sections):
6162 Rename do_find_incremental_inputs_sections to this.
6163 (Sized_incremental_binary::setup_readers): New function.
6164 (Sized_incremental_binary::has_incremental_info_): New data member.
6165 (Sized_incremental_binary::inputs_reader_): New data member.
6166 (Sized_incremental_binary::symtab_reader_): New data member.
6167 (Sized_incremental_binary::relocs_reader_): New data member.
6168 (Sized_incremental_binary::got_plt_reader_): New data member.
6169 (Sized_incremental_binary::current_input_file_): New data member.
6170
a869183f
PP
61712011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6172
6173 PR gold/12640
6174 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6175 violation.
6176
61772011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6178
6179 * archive.cc (Archive::include_member): Adjust call to report_object.
6180 (Add_archive_symbols::run): Add script_info to call to
6181 report_archive_begin.
6182 (Lib_group::include_member): Adjust call to report_object.
6183 (Add_lib_group_symbols::run): Adjust call to report_object.
6184 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6185 blocks. Add object count for script input files.
6186 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6187 script_info parameter; change all callers.
6188 (Incremental_inputs::report_object): Add script_info parameter;
6189 change all callers.
6190 (Incremental_inputs::report_script): Store backpointer to
6191 incremental info entry.
6192 (Output_section_incremental_inputs::set_final_data_size): Record
6193 additional information for scripts.
6194 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6195 * incremental.h (Incremental_script_entry::add_object): New function.
6196 (Incremental_script_entry::get_object_count): New function.
6197 (Incremental_script_entry::get_object): New function.
6198 (Incremental_script_entry::objects_): New data member; adjust
6199 constructor.
6200 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6201 (Incremental_inputs::report_object): Add script_info parameter.
6202 (Incremental_inputs_reader::get_object_count): New function.
6203 (Incremental_inputs_reader::get_object_offset): New function.
6204 * options.cc (Input_arguments::add_file): Return reference to
6205 new input argument.
6206 * options.h (Input_argument::set_script_info): New function.
6207 (Input_argument::script_info): New function.
6208 (Input_argument::script_info_): New data member; adjust all
6209 constructors.
6210 (Input_file_group::add_file): Return reference to new input argument.
6211 (Input_file_lib::add_file): Likewise.
6212 (Input_arguments::add_file): Likewise.
6213 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6214 * script.cc (Parser_closure::Parser_closure): Add script_info
6215 parameter; adjust all callers.
6216 (Parser_closure::script_info): New function.
6217 (Parser_closure::script_info_): New data member.
6218 (read_input_script): Report scripts earlier to incremental info.
6219 (script_add_file): Set script_info in Input_argument.
6220 (script_add_library): Likewise.
6221 * script.h (Script_options::Script_info): Rewrite class.
6222
a869183f 62232011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6224
6225 * archive.cc (Library_base::should_include_member): Move
6226 method here from class Archive.
6227 (Archive::Archive): Initialize base class.
6228 (Archive::should_include_member): Move to base class.
6229 (Archive::do_for_all_unused_symbols): New function.
6230 (Add_archive_symbols::run): Remove redundant access to
6231 incremental_inputs.
6232 (Lib_group::Lib_group): Initialize base class.
6233 (Lib_group::do_filename): New function.
6234 (Lib_group::include_member): Pass pointer to Lib_group to
6235 report_object.
6236 (Lib_group::do_for_all_unused_symbols): New function.
6237 (Add_lib_group_symbols::run): Report archive information for
6238 incremental links.
6239 * archive.h (class Library_base): New base class.
6240 (class Archive): Derive from Library_base.
6241 (Archive::filename): Move to base class.
6242 (Archive::set_incremental_info): Likewise.
6243 (Archive::incremental_info): Likewise.
6244 (Archive::Should_include): Likewise.
6245 (Archive::should_include_member): Likewise.
6246 (Archive::Armap_entry): Remove.
6247 (Archive::Unused_symbol_iterator): Remove.
6248 (Archive::unused_symbols_begin): Remove.
6249 (Archive::unused_symbols_end): Remove.
6250 (Archive::do_filename): New function.
6251 (Archive::do_get_mtime): New function.
6252 (Archive::do_for_all_unused_symbols): New function.
6253 (Archive::task_): Move to base class.
6254 (Archive::incremental_info_): Likewise.
6255 (class Lib_group): Derive from Library_base.
6256 (Lib_group::do_filename): New function.
6257 (Lib_group::do_get_mtime): New function.
6258 (Lib_group::do_for_all_unused_symbols): New function.
6259 (Lib_group::task_): Move to base class.
6260 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6261 function.
6262 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6263 function.
6264 * incremental.cc (Incremental_inputs::report_archive_begin):
6265 Use Library_base; call library's get_mtime; add incremental inputs
6266 entry before members.
6267 (class Unused_symbol_visitor): New class.
6268 (Incremental_inputs::report_archive_end): Use Library_base; use
6269 visitor class to record unused symbols; don't add incremental inputs
6270 entry after members.
6271 (Incremental_inputs::report_object): Use Library_base.
6272 * incremental.h
6273 (Incremental_archive_entry::Incremental_archive_entry): Remove
6274 unused Archive parameter.
6275 (Incremental_inputs::report_archive_begin): Use Library_base.
6276 (Incremental_inputs::report_archive_end): Likewise.
6277 (Incremental_inputs::report_object): Likewise.
6278 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6279 function.
6280 * object.h (Object::for_all_global_symbols): New function.
6281 (Object::do_for_all_global_symbols): New function.
6282 (Sized_relobj::do_for_all_global_symbols): New function.
6283 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6284 function.
6285 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6286 function.
6287
61ab3e40
ILT
62882011-03-27 Ian Lance Taylor <iant@google.com>
6289
6290 * archive.cc (Archive::interpret_header): Return -1 if something
6291 goes wrong. Change callers accordingly.
6292
30e1f9e6
CC
62932011-03-25 Cary Coutant <ccoutant@google.com>
6294
6295 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6296 * testsuite/Makefile.in: Regenerate.
6297
9370ce59 62982011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6299
6300 * plugin.cc (get_view): New.
6301 (Plugin::load): Pass get_view to the plugin.
6302 (Plugin_manager::get_view): New.
6303
9312bb0a
ILT
63042011-03-21 Ian Lance Taylor <iant@google.com>
6305
6306 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6307 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6308
7e12ba9e
ST
63092011-03-21 Sriraman Tallam <tmsriram@google.com>
6310
6311 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6312 Change == to -eq.
6313 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6314 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6315 Change == to -eq.
6316 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6317 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6318
fd7a005d
ILT
63192011-03-14 Ian Lance Taylor <iant@google.com>
6320
6321 * script-sections.cc (Sort_output_sections::script_compare):
6322 Rename from is_before, change return type.
6323 (Sort_output_sections::operator()): Adjust accordingly.
6324
ed16fd1b
ILT
63252011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6326
6327 PR gold/12572
6328 * testsuite/odr_violation2.cc: Add comment to make all error line
6329 numbers double digits.
6330 * testsuite/debug_msg.sh: Adjust expected errors.
6331
71ff8986
ILT
63322011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6333
6334 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6335 but mark earlier ones as non-canonical
6336 (offset_to_iterator): Update search target and example
6337 (do_addr2line): Return extra lines in a vector*
6338 (format_file_lineno): Extract from do_addr2line
6339 (one_addr2line): Add vector* out-param
6340 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6341 when a lineno entry appeared last for its instruction
6342 (Dwarf_line_info): Add vector* out-param
6343 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6344 * symtab.cc (Odr_violation_compare): Include the lineno in the
6345 comparison again.
6346 (linenos_from_loc): New. Combine the canonical line for an
6347 address with its other lines.
6348 (True_if_intersect): New. Helper functor to make
6349 std::set_intersection a query.
6350 (detect_odr_violations): Compare sets of lines instead of just
6351 one line for each function. This became less deterministic, but
6352 has fewer false positives.
6353 * symtab.h: Declarations.
6354 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6355 mix an optimized and non-optimized object in the same binary
6356 (odr_violation2.so): Same.
6357 * testsuite/Makefile.in: Regenerate from Makefile.am.
6358 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6359 * testsuite/debug_msg.sh: Update line numbers and add
6360 assertions.
6361 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6362 non-optimized context.
6363 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6364 isn't inlined, and use OdrDerived in an optimized context.
6365 * testsuite/odr_header1.h: Defines OdrDerived, where
6366 optimization will change the
6367 first-instruction-in-the-destructor's file and line number.
6368 * testsuite/odr_header2.h: Defines OdrBase.
6369
a19fefdc
ILT
63702011-03-09 Ian Lance Taylor <iant@google.com>
6371
6372 * fileread.cc (File_read::clear_views): Don't delete the whole
6373 file view.
6374
ecb351e9
ILT
63752011-03-08 Ian Lance Taylor <iant@google.com>
6376
6377 PR gold/12525
6378 * fileread.cc: #include <climits>.
6379 (GOLD_IOV_MAX): Define.
6380 (File_read::read_multiple): Limit number of entries by iov_max.
6381 * fileread.h (class File_read): Always set max_readv_entries to
6382 128.
6383
b821d13c
ILT
63842011-03-07 Ian Lance Taylor <iant@google.com>
6385
6386 PR gold/12525
6387 * options.h (class General_options): Add -dy and -dn.
6388
89243142
CC
63892011-03-02 Cary Coutant <ccoutant@google.com>
6390
6391 * testsuite/script_test_9.t: Add TLS segment.
6392
d0773f31
ILT
63932011-03-02 Simon Baldwin <simonb@google.com>
6394
6395 * configure.ac: Add check for gnu_indirect_function support in
6396 the toolchain building binutils.
6397 * configure: Rebuild.
6398
9370ce59 63992011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6400
6401 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6402 plugin only symbols.
6403 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6404 in plugin files as not needed in the symbol table.
6405
4cf7a849
ST
64062011-02-11 Sriraman Tallam <tmsriram@google.com>
6407
6408 * output.cc (Output_section::add_input_section): Delay fill
6409 generation for section ordering.
6410
b578bd7d
ILT
64112011-02-09 Ian Lance Taylor <iant@google.com>
6412
6413 PR gold/12316
6414 * object.h (class Sized_relobj): Remove clear_local_symbols.
6415 * reloc.cc (Sized_relobj::do_relocate): Don't call
6416 clear_local_symbols.
6417
9370ce59 64182011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6419
6420 * plugin.cc (is_visible_from_outside): Return true for symbols
6421 in the -u option.
6422
55382fb7
ILT
64232011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6424
6425 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6426 filename.
6427
4e271fff
ST
64282011-02-02 Sriraman Tallam <tmsriram@google.com>
6429
6430 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6431 to std::string.
4e271fff 6432 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6433 section_name to be std::string.
4e271fff
ST
6434 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6435
d433c3ac
ILT
64362011-01-25 Ian Lance Taylor <iant@google.com>
6437
6438 * script.cc (script_add_extern): Rewrite to use
6439 add_symbol_reference.
6440
880473a6
DK
64412011-01-25 Doug Kwan <dougkwan@google.com>
6442
d433c3ac 6443 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6444
f30f86fa
ILT
64452011-01-24 Ian Lance Taylor <iant@google.com>
6446
6447 * options.h (class General_options): Accept
6448 --no-detect-odr-violations.
6449
8e51a0b9
ILT
64502011-01-24 Ian Lance Taylor <iant@google.com>
6451
6452 * version.cc (version_string): Bump to 1.11.
6453
0f3b89d8
ILT
64542011-01-24 Ian Lance Taylor <iant@google.com>
6455
6456 * plugin.cc (class Plugin_rescan): Define new class.
6457 (Plugin_manager::claim_file): Set any_claimed_.
6458 (Plugin_manager::save_archive): New function.
6459 (Plugin_manager::save_input_group): New function.
6460 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6461 necessary.
6462 (Plugin_manager::new_undefined_symbol): New function.
6463 (Plugin_manager::rescan): New function.
6464 (Plugin_manager::rescannable_defines): New function.
6465 (Plugin_manager::add_input_file): Set any_added_.
6466 * plugin.h (class Plugin_manager): define new fields rescannable_,
6467 undefined_symbols_, any_claimed_, and any_added_. Declare
6468 Plugin_rescan as friend. Declare new functions.
6469 (Plugin_manager::Rescannable): Define type.
6470 (Plugin_manager::Rescannable_list): Define type.
6471 (Plugin_manager::Undefined_symbol_list): Define type.
6472 (Plugin_manager::Plugin_manager): Initialize new fields.
6473 * archive.cc (Archive::defines_symbol): New function.
6474 (Add_archive_symbols::run): Pass archive to plugins if any.
6475 * archive.h (class Archive): Declare defines_symbol.
6476 * readsyms.cc (Input_group::~Input_group): New function.
6477 (Finish_group::run): Pass input_group to plugins if any.
6478 * readsyms.h (class Input_group): Declare destructor.
6479 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6480 any.
6481
3bb951e5
ILT
64822011-01-10 Ian Lance Taylor <iant@google.com>
6483
6484 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6485 section as relro.
6486 (Layout::set_segment_offsets): Reset increase_relro before calling
6487 set_section_addresses a second time.
6488
0aa45fac
CC
64892011-01-04 Cary Coutant <ccoutant@google.com>
6490
6491 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6492 sections before NOBITS sections.
6493
0db46eb4
L
64942011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6495
6496 * version.cc (print_version): Update copyright to 2011.
6497
829c9745
CC
64982010-12-23 Cary Coutant <ccoutant@google.com>
6499
6500 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6501 of OS to this->add. Add OD parameter to second form of the function.
6502
7500420b
ILT
65032010-12-20 Ian Lance Taylor <iant@google.com>
6504
6505 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6506 second of two consecutive entries with same offset.
6507
f8e9a930
RW
65082010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6509
6510 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6511 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6512 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6513 to avoid unneeded links against $(LDADD).
6514 * testsuite/Makefile.in: Regenerate.
6515
2fbb4320
ILT
65162010-12-15 Ian Lance Taylor <iant@google.com>
6517
6518 PR gold/12324
6519 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6520 for R_X86_64_32 and R_X86_64_PC32.
6521 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6522 ver_matching_def_pic.o.
6523 (ver_matching_def_pic.o): New target.
6524
fedb228d
RW
65252010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6526
6527 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6528 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6529 Move definition before File_read::View member definitions.
6530 (File_read::View::~View): Initialize and hold lock before
6531 updating current_mapped_bytes.
6532
9b547ce6
RW
65332010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6534
6535 * dwarf_reader.cc: Remove outdated comment.
6536 * gold-threads.cc: Fix typo in error message.
6537 * archive.cc: Fix typos in comments.
6538 * archive.h: Likewise.
6539 * arm-reloc-property.cc: Likewise.
6540 * arm-reloc-property.h: Likewise.
6541 * arm-reloc.def: Likewise.
6542 * arm.cc: Likewise.
6543 * attributes.h: Likewise.
6544 * cref.cc: Likewise.
6545 * ehframe.cc: Likewise.
6546 * fileread.h: Likewise.
6547 * gold.h: Likewise.
6548 * i386.cc: Likewise.
6549 * icf.cc: Likewise.
6550 * incremental.h: Likewise.
6551 * int_encoding.cc: Likewise.
6552 * layout.h: Likewise.
6553 * main.cc: Likewise.
6554 * merge.h: Likewise.
6555 * object.cc: Likewise.
6556 * object.h: Likewise.
6557 * options.cc: Likewise.
6558 * readsyms.cc: Likewise.
6559 * reduced_debug_output.cc: Likewise.
6560 * reloc.cc: Likewise.
6561 * script-sections.cc: Likewise.
6562 * sparc.cc: Likewise.
6563 * symtab.h: Likewise.
6564 * target-reloc.h: Likewise.
6565 * target.cc: Likewise.
6566 * target.h: Likewise.
6567 * timer.cc: Likewise.
6568 * timer.h: Likewise.
6569 * x86_64.cc: Likewise.
6570
83e17bd5
CC
65712010-12-09 Cary Coutant <ccoutant@google.com>
6572
6573 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6574 stack.
6575 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6576 parameter; change all callers.
6577 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6578 * options.h (warn_execstack): New option.
6579
017257f8
DK
65802010-12-07 Doug Kwan <dougkwan@google.com>
6581
6582 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6583 like function call relocations.
6584
c20cbc06
ILT
65852010-12-07 Ian Lance Taylor <iant@google.com>
6586
6587 * archive.cc (Archive::get_elf_object_for_member): Permit
6588 punconfigured to be NULL.
6589 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6590 (Archive::include_member): Pass NULL to get_elf_object_for_member
6591 if we searched for the archive and this is the first included
6592 object.
6593
4dbfafcc
ILT
65942010-12-01 Ian Lance Taylor <iant@google.com>
6595
6596 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6597 track_relocs_type_ field.
6598 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6599 Set track_relocs_type_.
6600 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6601 contents when using RELA relocs.
6602 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6603 reloc_map_.
6604 * reloc.cc (Track_relocs::next_addend): New function.
6605 * reloc.h (class Track_relocs): Declare next_addend.
6606
e5e19edd
ILT
66072010-12-01 Ian Lance Taylor <iant@google.com>
6608
6609 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6610 virtual destructor.
6611
9a5ce24c
ILT
66122010-12-01 Ian Lance Taylor <iant@google.com>
6613
6614 * README: Update compilers known to work and fail.
6615
c7791212
NC
66162010-11-23 Matthias Klose <doko@ubuntu.com>
6617
6618 * configure.in: For --enable-gold, handle value `default' instead of
6619 `both*'. Always install ld as ld.bfd, install as ld if gold is
6620 not the default.
6621 * configure: Regenerate.
6622
0ad220c9
DK
66232010-11-18 Doug Kwan <dougkwan@google.com>
6624
6625 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6626 and right_alignment to be zero. Store result alignment only if it is
6627 greater than existing alignment.
6628
ab8056e0
CC
66292010-11-16 Cary Coutant <ccoutant@google.com>
6630
6631 PR gold/12220
6632 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6633 Check for ".zdebug_line".
6634
fd064a5b
CC
66352010-11-16 Doug Kwan <dougkwan@google.com>
6636 Cary Coutant <ccoutant@google.com>
6637
6638 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6639 by reference; adjust all callers.
6640 * output.cc (Output_segment::set_section_addresses): Adjust references
6641 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6642 list is empty.
6643 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6644 end at page boundary.
6645
6fc6ea19
CC
66462010-11-16 Cary Coutant <ccoutant@google.com>
6647
6648 PR gold/12220
6649 * layout.cc (Layout::choose_output_section): Transform names of
6650 compressed sections even when using a script with a SECTIONS clause.
6651 (Layout::output_section_name): Remove code to transform
6652 compressed debug section names.
6653 * output.cc (Output_section::add_input_section): Use uncompressed
6654 section size when tracking input sections.
6655
95a2c8d6
RS
66562010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6657
6658 * symtab.h (Symbol::NON_PIC_REF): Remove.
6659 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6660 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6661 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6662 (Symbol::use_plt_offset): Take a flags argument and pass it
6663 directly to needs_dynamic_reloc. Restrict check for undefined
6664 weak symbols to function calls.
6665 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6666 (Target_arm::Scan::global): Use it.
6667 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6668 (Target_arm::Relocate::relocate): Likewise.
6669 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6670 parameter with an r_type parameter. Use get_reference_flags
6671 to get the flags.
6672 (Target_arm::Relocate::relocate): Update accordingly.
6673 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6674 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6675 (Target_i386::Scan::global): Likewise.
6676 (Target_i386::Relocate::relocate): Likewise.
6677 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6678 parameter with an r_type parameter. Use get_reference_flags
6679 to get the flags.
6680 (Target_i386::Relocate::relocate): Update accordingly.
6681 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6682 (Target_powerpc::Scan::global): Use it.
6683 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6684 (Target_powerpc::Relocate::relocate): Likewise.
6685 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6686 (Target_sparc::Scan::global): Use it.
6687 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6688 (Target_sparc::Relocate::relocate): Likewise.
6689 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6690 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6691 (Target_x86_64::Scan::global): Likewise.
6692 (Target_x86_64::Relocate::relocate): Likewise.
6693
f625ae50
DK
66942010-11-08 Doug Kwan <dougkwan@google.com>
6695 Cary Coutant <ccoutant@google.com>
6696
6697 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6698 (Arm_exidx_merge_section::section_contents_): New data member.
6699 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6700 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 6701 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
6702 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6703 in parameters instead of calling Object::section_contents without
6704 locking.
6705 (Arm_output_section::group_section): New parameter TASK. Pass it
6706 to callees that need locking objects.
6707 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6708 to lock EXIDX input sections. Fix a formatting issue. Call
6709 Arm_exidx_merged_section::build_contents to create merged section
6710 contents.
6711 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6712 to lock object of stub table owner.
6713 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6714 TEXT_SIZE to initialize data member TEXT_SIZE_.
6715 (Arm_exidx_input_section::addralign): Fix typo in comment.
6716 (Arm_exidx_input_section::text_size): New method.
6717 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6718 that require locking objects. Lock objects before scanning for stubs
6719 and updating local symbols.
6720 (Arm_input_section<big_endian>::init): Copy contents of original
6721 input section.
2e702c99 6722 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
6723 original input section instead of calling Object::section_contents
6724 without locking.
6725 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6726 size without calling Object::section_size().
6727 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6728 for size. Allocate a buffer for merged EXIDX entries.
6729 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 6730 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
6731 building code to Arm_exidx_merged_section::build_contetns. Write
6732 out contetns in buffer instead of building it on the fly.
6733 (Arm_relobj::make_exidx_input_section): Also pass text section size
6734 to Arm_exidx_input_section constructor.
6735 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6736 (Arm_dynobj::do_read_symbols): Fix memory leak.
6737 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6738 * target.h: (class Task): Add forward declaration.
6739 (Target::relax): Add new parameter TASK and pass it to
6740 Target::do_relax().
6741 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6742
5f9bcf58
CC
67432010-11-05 Cary Coutant <ccoutant@google.com>
6744
6745 PR gold/10708
6746 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6747 object when reading from the file.
6748 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6749 second layout pass.
6750 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6751 when reading section contents.
6752 (get_section_contents): Likewise.
6753 (icf::find_identical_sections): Likewise.
6754 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6755 object when reading from the file.
6756 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6757 the object when doing deferred section layout.
6758
e597fa08
NC
67592010-11-03 Nick Clifton <nickc@redhat.com>
6760
6761 PR gold/12001
6762 * script.h (class Symbol_assignment: name): New member. Returns
6763 the name of the symbol.
6764 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6765 Returns true if the given symbol name is on the list of
6766 assignments wating to be processed.
6767 * archive.cc (should_incldue_member): If the symbol is undefined,
6768 check to see if it is on the list of symbols pending assignment.
6769
3f9a3278
ILT
67702010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6771
6772 * script-sections.cc (Script_sections::find_memory_region): Check
6773 for a NULL output section pointer.
6774
d06fb4d1
DK
67752010-10-29 Doug Kwan <dougkwan@google.com>
6776
6777 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6778 Output_section::add_relaxed_input_section.
6779 * output.cc (Output_section::add_relaxed_input_section): Add new
6780 arguments LAYOUT and NAME. Set section order index.
6781 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6782 Copy section order index.
6783 * output.h (Output_section::add_relaxed_input_section): Add new
6784 arguments LAYOUT and NAME.
6785
90e24de5
ILT
67862010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6787
6788 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 6789 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
6790 * testsuite/Makefile.in: Regenerate.
6791
c9484ea5
DK
67922010-10-20 Doug Kwan <dougkwan@google.com>
6793
6794 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6795 without SHF_LINK_ORDER flags.
6796 * layout.cc (Layout::choose_output_section): Do not filter
6797 SHF_LINK_ORDER flag in a relocatable link.
6798
5bc2f5be
CC
67992010-10-17 Cary Coutant <ccoutant@google.com>
6800
6801 * output.h (Output_segment::set_section_addresses): Change function
6802 signature. Update all callers.
6803 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
6804 sections.
6805 (Output_segment::set_section_addresses): Align after last TLS
6806 section. Add padding before last relro section instead of after.
6807
0c91cf04
DK
68082010-10-17 Doug Kwan <dougkwan@google.com>
6809
6810 * gold/arm.cc (Target_arm::got_section): Use correct order and set
6811 GOT output section to be writable.
6812
8c21d9d3
CC
68132010-10-14 Cary Coutant <ccoutant@google.com>
6814
6815 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
6816 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
6817 * gold.cc (queue_initial_tasks): Check parameters for incremental link
6818 mode.
6819 * incremental.cc (report_command_line): Ignore all forms of
6820 --incremental.
6821 * layout.cc (Layout::Layout): Check parameters for incremental link
6822 mode.
6823 * options.cc (General_options::parse_incremental): New function.
6824 (General_options::parse_no_incremental): New function.
6825 (General_options::parse_incremental_full): New function.
6826 (General_options::parse_incremental_update): New function.
6827 (General_options::incremental_mode_): New data member.
6828 (General_options::finalize): Check incremental_mode_.
6829 * options.h (General_options): Update help text for --incremental.
6830 Add --no-incremental, --incremental-full, --incremental-update.
6831 (General_options::Incremental_mode): New enum type.
6832 (General_options::incremental_mode): New function.
6833 (General_options::incremental_mode_): New data member.
6834 * parameters.cc (Parameters::incremental_mode_): New data member.
6835 (Parameters::set_options): Set incremental_mode_.
6836 (Parameters::set_incremental_full): New function.
6837 (Parameters::incremental): New function.
6838 (Parameters::incremental_update): New function.
6839 (set_parameters_incremental_full): New function.
6840 * parameters.h (Parameters::set_incremental_full): New function.
6841 (Parameters::incremental): New function.
6842 (Parameters::incremental_update): New function.
6843 (Parameters::incremental_mode_): New data member.
6844 (set_parameters_incremental_full): New function.
6845 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
6846 incremental link mode.
6847 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
6848 (Sized_relobj::do_relocate_sections): Likewise.
6849 * testsuite/Makefile.am (incremental_test): Use --incremental-full
6850 option.
6851 * testsuite/Makefile.in: Regenerate.
6852 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 6853
bb32aa18 68542010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
6855
6856 * script-sections.h (class Script_sections): Make
6857 Sections_elements typedef public.
6858 * script-sections.cc (class Sort_output_sections): Add elements_
6859 field. Add constructor which sets it; change all callers.
6860 (Sort_output_sections::is_before): New function.
6861 (Sort_output_sections::operator()): Call is_before.
6862 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
6863 conditional.
6864 * testsuite/script_test_10.sh: New test. Test script section
6865 order.
6866 * testsuite/script_test_10.t: Likewise.
6867 * testsuite/script_test_10.s: Likewise.
6868 * testsuite/Makefile.am: Wrap the cross linker tests and the
6869 common tests into NATIVE_OR_CROSS_LINKER.
6870 (check_SCRIPTS): Add script_test_10.sh.
6871 (check_DATA): Add script_test_10.stdout.
6872 (script_test_10.o, script_test_10): New targets.
6873 (script_test_10.stdout): New target.
6874 * configure, testsuite/Makefile.in: Regenerate.
6875
3cef7179
ILT
68762010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6877
6878 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
6879 error for the deprecated relocations.
6880 (Target_arm::Scan::global): Likewise.
6881 (Target_arm::Relocate::relocate): Likewise.
6882
7411e9a8
RS
68832010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
6884
6885 * fileread.cc (Input_file::find_file): Initialize *found_name
6886 and *namep when using the fallback search for case 4.
6887
6a9da32a
CC
68882010-10-11 Cary Coutant <ccoutant@google.com>
6889
6890 * options.h (class General_options): Redefine -z lazy as an alias for
6891 the negation of -z now.
6892
ac897c20
ILT
68932010-10-11 Ian Lance Taylor <iant@google.com>
6894
6895 * resolve.cc (symbol_to_bits): Report the value of the unsupported
6896 binding.
6897
ea5cae92
NC
68982010-10-06 Nick Clifton <nickc@redhat.com>
6899
6900 * script-sections.cc(class Memory_region): Remove
6901 current_lma_offset_ field. Rename current_vma_offset_ to
6902 current_offset_. Add last_section_ field.
6903 (Memory_region::get_current_vma_address): Rename to
6904 get_current_address.
6905 (Memory_region::get_current_lma_address): Delete.
6906 (Memory_region::increment_vma_offset): Rename to
6907 increment_offset.
6908 (Memory_region::increment_lma_offset): Delete.
6909 (Memory_region::attributes_compatible): New method. Returns
6910 true if the provided section is compatible with the region.
6911 (Memory_region::get_last_section): New method. Returns the last
6912 section to use the region.
6913 (Memory_region::set_last_section): New method. Stores the last
6914 section to use the region.
6915 (Script_sections::block_in_region): New method. Returns true if
6916 a block of memory is contained within a region.
6917 (Script_sections::find_memory_region): New method. Locates a
6918 memory region to be used to set a VMA or LMA address.
6919 (Output_section_definition::set_section_addresses): Add code to
6920 check for addresses set by memory regions.
6921 (Output_segment::set_section_addresses): Remove memory region
6922 walking code.
6923 (Script_sections::create_segment): Add a warning if a header
6924 segment is created outside of any region.
6925 * script-sections.h (class Script_sections): Add prototypes for
6926 find_memory_region and block_in_region methods.
6927 * testsuite/memory_test.s: Use .long instead of .word.
6928 * testsuite/memory_test.t: Add some more output sections.
6929 * testsuite/memory_test.sh: Update expected output.
6930
a9bfd952
DK
69312010-10-02 Doug Kwan <dougkwan@google.com>
6932
6933 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
6934 defintion to symtab.h
6935 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
6936 declaration to defintion.
6937
bacff3ab
NC
69382010-10-01 Nick Clifton <nickc@redhat.com>
6939
6940 * expression.cc (eval): Replace dummy argument with NULL.
6941 (eval_maybe_dot): Check for a NULL result section pointer.
6942 (Symbol_expression::value): Likewise.
6943 (Dot_expression::value): Likewise.
6944 (BINARY_EXPRESSION): Likewise.
6945 (Max_expression::value): Likewise.
6946 (Min_expression::value): Likewise.
6947 (Absolute_expression::value): Likewise.
6948 (Addr_expression::value_from_output_section): Likewise.
6949 (Loaddddr_expression::value_from_output_section): Likewise.
6950 (Segment_start_expression::value): Likewise.
6951 * script-sections.cc
6952 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
6953 argument with NULL.
6954 (Sections_elememt_dot_assignment::set_section_addresses):
6955 Likewise.
6956 (Output_data_expression::do_write_to_buffer): Likewise.
6957 (Output_section_definition::finalize_symbols): Likewise.
6958 (Output_section_definition::set_section_addresses): Likewise.
6959
f81bc8b5
DK
69602010-09-30 Doug Kwan <dougkwan@google.com>
6961
6962 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
6963
c95e9f27
ST
69642010-09-28 Sriraman Tallam <tmsriram@google.com>
6965
6966 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 6967 function.
c95e9f27
ST
6968 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
6969 virtual function.
6970 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
6971 virtual function.
6972 * icf.cc (get_section_contents): Inline merge sections only when
6973 target allows it.
6974
3cac54d2
RW
69752010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6976
6977 * configure: Regenerate.
6978
2904037a
ILT
69792010-09-17 Ian Lance Taylor <iant@google.com>
6980
6981 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
6982 * testsuite/Makefile.am (memory_test.o): New target.
6983 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
6984 memory_test.t.
6985 * testsuite/Makefile.in: Rebuild.
2904037a 6986
bca7fb63
DK
69872010-09-17 Doug Kwan <dougkwan@google.com>
6988
6989 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
6990 defintion if relocation uses GOT entries of the symbol.
6991 * testsuite/icf_safe_test.sh: Fix test.
6992 * testsuite/icf_safe_so_test.sh: Fix test.
6993
4ef28648
CC
69942010-09-16 Cary Coutant <ccoutant@google.com>
6995
6996 * script_sections.cc (class Memory_region): Remove "NULL" from
6997 vector initializations.
6998
793990de
CC
69992010-09-15 Cary Coutant <ccoutant@google.com>
7000
7001 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7002 Resolve forwarding symbols.
7003
81e015e2
DK
70042010-09-15 Doug Kwan <dougkwan@google.com>
7005
7006 * gold/testsuite/script_test_3.t: Add ARM special sections.
7007 * gold/testsuite/script_test_4.t: Same.
7008 * gold/testsuite/script_test_5.t: Same.
7009 * gold/testsuite/script_test_6.t: Same.
7010 * gold/testsuite/script_test_7.t: Same.
7011 * gold/testsuite/script_test_7.t: Same.
7012 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7013
36171d64
CC
70142010-09-14 Cary Coutant <ccoutant@google.com>
7015
7016 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7017 (Target_x86_64::Relocate::relocate_tls): Replace check for
7018 saw_tls_block_reloc_ with test for executable section.
7019
d89051bd
CC
70202010-09-12 Cary Coutant <ccoutant@google.com>
7021
7022 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7023 position-independent executables to shared libraries need dynamic
7024 relocations.
7025 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7026 position-independent executables.
7027 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7028 * testsuite/Makefile.in: Regenerate.
7029
fca41f0f
NC
70302010-09-10 Nick Clifton <nickc@redhat.com>
7031
7032 PR gold/11997
7033 * testsuite/memory_test.t: Discard any sections that are not
7034 needed.
7035
6695e4b3
L
70362010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7037
7038 PR gold/11996
7039 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7040 "This::" to work around a bug in gcc 4.2.
7041
7042 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7043
0f72bf6f
RÁE
70442010-09-09 Rafael Espindola <espindola@google.com>
7045
7046 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7047 sections with different PF_X flags in the same segment.
7048 (Layout::find_first_load_seg): Search all segments to find the first
7049 one.
7050 * options.h (rosegment): New.
7051
70522010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7053
05a79166 7054 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7055
aa98ff75
DK
70562010-09-08 Doug Kwan <dougkwan@google.com>
7057
7058 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7059 (Arm_relobj::do_relocate_sections): Add new parameter for output
7060 file to match the parent.
7061 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7062 of local symbols instead of input values. Update code to track
7063 changes in gold::relocate_section.
7064 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7065 (Sized_relobj::compute_final_local_value_internal): New methods.
7066 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7067 body into private version of Sized_relobj::compute_final_local_value.
7068 Call the inline method.
7069 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7070 merged symbol value if there is one.
7071 (Symbol_value::has_output_value): New method defintiion.
7072 (Sized_relobj::Compute_final_local_value_status): New enum type.
7073 (Sized_relobj::compute_final_local_value): New methods.
7074 (Sized_relobj::compute_final_local_value_internal): New methods.
7075 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7076 and arm_cortex_a8.sh.
7077 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7078 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7079 New tests.
7080 * Makefile.in: Regenerate.
7081 * testsuite/arm_bl_out_of_range.s: Update test.
7082 * testsuite/thumb_bl_out_of_range.s: Ditto.
7083 * testsuite/thumb_blx_out_of_range.s: Ditto.
7084 * testsuite/arm_branch_out_of_range.sh: New file.
7085 * testsuite/arm_cortex_a8.sh: Ditto.
7086 * testsuite/arm_cortex_a8_b.s: Ditto.
7087 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7088 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7089 * testsuite/arm_cortex_a8_bl.s: Ditto.
7090 * testsuite/arm_cortex_a8_blx.s: Ditto.
7091 * testsuite/arm_cortex_a8_local.s: Ditto.
7092 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7093 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7094
05a79166
L
70952010-09-08 Rafael Espindola <espindola@google.com>
7096
7097 * Makefile.am (memory_test.stdout): Run readelf with -W.
7098 * Makefile.in: Regenerate.
7099 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7100 64 bit output.
7101
33dbc701
RÁE
71022010-09-08 Rafael Espindola <espindola@google.com>
7103
7104 * script-sections.cc (Script_sections::add_memory_region): Convert
7105 field precision to int.
7106 * script.cc (script_set_section_region, script_set_section_region):
7107 Convert field precision to int.
7108
731ca54a
RÁE
71092010-09-08 Rafael Espindola <espindola@google.com>
7110
7111 * arm.cc (do_finalize_sections): Create the __exidx_start and
7112 __exdix_end symbols even when the section is missing.
7113
7f8cd844
NC
71142010-09-08 Nick Clifton <nickc@redhat.com>
7115
7116 * README: Remove claim that MEMORY is not supported.
7117 * expression.cc (script_exp_function_origin)
7118 (script_exp_function_length): Move from here to ...
7119 * script.cc: ... here.
7120 (script_set_section_region, script_add_memory)
7121 (script_parse_memory_attr, script_include_directive): New
7122 functions.
7123 * script-sections.cc
7124 (class Memory_region): New class.
7125 (class Output_section_definition): Add set_memory_region,
7126 set_section_vma, set_section_lma and get_section_name methods.
7127 (class Script_Sections): Add add_memory_region,
7128 find_memory_region, find_memory_region_origin,
7129 find_memory_region_length and set_memory_region methods.
7130 Have set_section_addresses method walk the list of set memory
7131 regions.
7132 Extend the print methos to display memory regions.
7133 * script-sections.h: Add prototypes for new methods.
7134 Add enum for MEMORY region attributes.
7135 * yyscript.y: Add support for parsing MEMORY regions.
7136 * script-c.h: Add prototypes for new functions.
7137 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7138 * testsuite/Makefile.in: Regenerate.
7139 * testsuite/memory_test.sh: New script.
7140 * testsuite/memory_test.s: New assembler source file.
7141 * testsuite/memory_test.t: New linker script.
7142
a4649286
DK
71432010-08-27 Doug Kwan <dougkwan@google.com>
7144
7145 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7146 reference override an existing dynamic weak reference.
7147 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7148 * testsuite/Makefile.in: Regenerate.
7149 * testsuite/dyn_weak_ref.sh: New file.
7150 * testsuite/dyn_weak_ref_1.c: Ditto.
7151 * testsuite/dyn_weak_ref_2.c: Ditto.
7152
b56648ad
ILT
71532010-08-27 Ian Lance Taylor <iant@google.com>
7154
7155 * incremental.h (class Incremental_input_entry): Add virtual
7156 destructor.
7157
809313cb
ILT
71582010-08-27 Ian Lance Taylor <iant@google.com>
7159
7160 * testsuite/start_lib_test_3.c: Mark t3 as used.
7161
11e32464
NC
71622010-08-27 Nick Clifton <nickc@redhat.com>
7163
7164 * options.cc (version_script): Fix small typo in previous
7165 whitespace tidyup.
7166
ca09d69a
NC
71672010-08-25 Nick Clifton <nickc@redhat.com>
7168
7169 * archive.cc: Formatting fixes: Remove whitespace between
7170 typename and following asterisk. Remove whitespace between
7171 function name and opening parenthesis.
7172 * archive.h: Likewise.
7173 * arm.cc: Likewise.
7174 * attributes.cc: Likewise.
7175 * attributes.h: Likewise.
7176 * common.cc: Likewise.
7177 * copy-relocs.cc: Likewise.
7178 * dirsearch.h: Likewise.
7179 * dynobj.cc: Likewise.
7180 * ehframe.cc: Likewise.
7181 * ehframe.h: Likewise.
7182 * expression.cc: Likewise.
7183 * fileread.cc: Likewise.
7184 * fileread.h: Likewise.
7185 * gc.h: Likewise.
7186 * gold-threads.cc: Likewise.
7187 * gold.cc: Likewise.
7188 * i386.cc: Likewise.
7189 * icf.h: Likewise.
7190 * incremental-dump.cc: Likewise.
7191 * incremental.cc: Likewise.
7192 * layout.cc: Likewise.
7193 * layout.h: Likewise.
7194 * main.cc: Likewise.
7195 * merge.cc: Likewise.
7196 * merge.h: Likewise.
7197 * object.cc: Likewise.
7198 * object.h: Likewise.
7199 * options.cc: Likewise.
7200 * options.h: Likewise.
7201 * output.cc: Likewise.
7202 * output.h: Likewise.
7203 * plugin.cc: Likewise.
7204 * plugin.h: Likewise.
7205 * powerpc.cc: Likewise.
7206 * reloc.cc: Likewise.
7207 * script-c.h: Likewise.
7208 * script-sections.cc: Likewise.
7209 * script.cc: Likewise.
7210 * stringpool.cc: Likewise.
7211 * symtab.cc: Likewise.
7212 * symtab.h: Likewise.
7213 * target.cc: Likewise.
7214 * timer.cc: Likewise.
7215 * timer.h: Likewise.
7216 * version.cc: Likewise.
7217 * x86_64.cc: Likewise.
7218
b8fa8750
NC
72192010-08-24 Nick Clifton <nickc@redhat.com>
7220
7221 PR 11899
7222 * layout.cc (segment_precedes): Sort segments by their physical
7223 addresses, if they have been set.
7224
9919d93b
CC
72252010-08-23 Cary Coutant <ccoutant@google.com>
7226
7227 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7228 symbols data.
7229 (Lib_group::include_member): Unlock object after deleting its
7230 symbols data.
7231 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7232 the bug fixed here.
7233
97b4be1c
CC
72342010-08-19 Neil Vachharajani <nvachhar@google.com>
7235 Cary Coutant <ccoutant@google.com>
7236
7237 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7238 constructor, and set_blocker.
7239 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7240 readsyms_blocker_.
7241 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7242 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7243 * testsuite/Makefile.am (start_lib_test): New test case.
7244 * testsuite/Makefile.in: Regenerate.
7245 * testsuite/start_lib_test_main.c: New file.
7246 * testsuite/start_lib_test_1.c: New file.
7247 * testsuite/start_lib_test_2.c: New file.
7248 * testsuite/start_lib_test_3.c: New file.
7249
dd0b1884
ILT
72502010-08-19 Ian Lance Taylor <iant@google.com>
7251
7252 * Makefile.in: Rebuild with automake 1.11.1.
7253 * aclocal.m4: Likewise.
7254 * testsuite/Makefile.in: Likewise.
7255
7223e9ca
ILT
72562010-08-19 Ian Lance Taylor <iant@google.com>
7257
7258 PR 10893
7259 * i386.cc (class Output_data_plt_i386): Update declarations.
7260 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7261 local_ifuncs_ fields.
7262 (Target_i386::do_plt_section_for_global): New function.
7263 (Target_i386::do_plt_section_for_local): New function.
7264 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7265 parameter; change all callers. Initialize global_ifuncs_ and
7266 local_ifuncs_. If doing a static link define __rel_iplt_start and
7267 __rel_iplt_end.
7268 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7269 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7270 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7271 symbols.
7272 (Target_i386::make_plt_section): New function, broken out of
7273 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7274 (Target_i386::make_plt_entry): Call make_plt_section.
7275 (Target_i386::make_local_ifunc_plt_entry): New function.
7276 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7277 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7278 R_386_IRELATIVE to switch.
7279 (Target_i386::Scan::global): Likewise.
7280 (Target_i386::Relocate::relocate): Likewise.
7281 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7282 switch.
7283 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7284 (Target_x86_64::do_plt_section_for_global): New function.
7285 (Target_x86_64::do_plt_section_for_local): New function.
7286 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7287 parameter; change all callers. If doing a static link define
7288 __rela_iplt_start and __rela_iplt_end.
7289 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7290 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7291 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7292 to point to .plt.
7293 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7294 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7295 switch.
7296 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7297 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7298 R_X86_64_IRELATIVE to switch.
7299 (Target_x86_64::Scan::global): Likewise.
7300 (Target_x86_64::Relocate::relocate): Likewise.
7301 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7302 switch.
7303 * target.h (class Target): Add plt_section_for_global and
7304 plt_section_for_local functions. Add do_plt_section_for_global
7305 and do_plt_section_for_local virtual functions.
7306 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7307 clarifying comments.
7308 (Symbol::use_plt_offset): Handle IFUNC symbol.
7309 * object.cc (Sized_relobj::Sized_relobj): Initialize
7310 local_plt_offsets_.
7311 (Sized_relobj::local_has_plt_offset): New function.
7312 (Sized_relobj::local_plt_offset): New function.
7313 (Sized_relobj::set_local_plt_offset): New function.
7314 (Sized_relobj::do_count): Handle IFUNC symbol.
7315 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7316 a bit away from input_shndx_ field. Add set_is_func_symbol and
7317 is_ifunc_symbol functions.
7318 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7319 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7320 local_plt_offsets_ field.
7321 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7322 * output.h (class Output_section_data): Add non-const
7323 output_section function.
7324 (class Output_data_got): Update declarations.
7325 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7326 Add use_plt_offset parameter to global and local constructors.
7327 Change all callers. Change local_sym_index_ field to 31 bits.
7328 Change GSYM_CODE and CONSTANT_CODE accordingly.
7329 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7330 doing a static link don't set sh_link field.
7331 (Output_data_got::Got_entry::write): Use PLT offset if
7332 appropriate.
7333 (Output_data_got::add_global_plt): New function.
7334 (Output_data_got::add_local_plt): New function.
7335 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7336 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7337 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7338 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7339 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7340 IFUNC conditional.
7341 * testsuite/ifunc-sel.h: New file.
7342 * testsuite/ifuncmain1.c: New file.
7343 * testsuite/ifuncmain1vis.c: New file.
7344 * testsuite/ifuncmod1.c: New file.
7345 * testsuite/ifuncdep2.c: New file.
7346 * testsuite/ifuncmain2.c: New file.
7347 * testsuite/ifuncmain3.c: New file.
7348 * testsuite/ifuncmod3.c: New file.
7349 * testsuite/ifuncmain4.c: New file.
7350 * testsuite/ifuncmain5.c: New file.
7351 * testsuite/ifuncmod5.c: New file.
7352 * testsuite/ifuncmain6pie.c: New file.
7353 * testsuite/ifuncmod6.c: New file.
7354 * testsuite/ifuncmain7.c: New file.
7355 * configure, testsuite/Makefile.in: Rebuild.
7356
56f75c03
ILT
73572010-08-18 Ian Lance Taylor <iant@google.com>
7358
7359 * incremental.cc
7360 (Output_section_incremental_inputs::write_input_files): Add cast
7361 to avoid signed/unsigned comparison warning.
7362 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7363
55455f89
CC
73642010-08-12 Cary Coutant <ccoutant@google.com>
7365
7366 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7367
e2054bcb
ILT
73682010-08-13 Ian Lance Taylor <iant@google.com>
7369
7370 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7371
74f67560
DK
73722010-08-12 Cary Coutant <ccoutant@google.com>
7373 Doug Kwan <dougkwan@google.com>
7374
7375 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7376 defintion overrides non-weak undef, remember that the original undef
7377 is not weak.
7378 * symtab.cc (Symbol_table::sized_write_global): For undef without
7379 an original weak binding, set binding to global in output.
7380 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7381 * testsuite/Makefile.in: Regenerate.
7382 * testsuite/strong_ref_weak_def.sh: New file.
7383 * testsuite/strong_ref_weak_def_1.c: Ditto.
7384 * testsuite/strong_ref_weak_def_2.c: Ditto.
7385
d1238d12
CC
73862010-08-12 Cary Coutant <ccoutant@google.com>
7387
7388 * testsuite/incremental_test.sh: Rewrite.
7389 * testsuite/incremental_test_1.c: Rewrite.
7390 * testsuite/incremental_test_2.c: Rewrite.
7391
0e70b911
CC
73922010-08-12 Cary Coutant <ccoutant@google.com>
7393
7394 * arm.cc (Target_arm::got_size): Add const.
7395 (Target_arm::got_entry_count): New function.
7396 (Target_arm::plt_entry_count): New function.
7397 (Target_arm::first_plt_entry_offset): New function.
7398 (Target_arm::plt_entry_size): New function.
7399 (Output_data_plt_arm::entry_count): New function.
7400 (Output_data_plt_arm::first_plt_entry_offset): New function.
7401 (Output_data_plt_arm::get_plt_entry_size): New function.
7402 * i386.cc (Target_i386::got_size): Add const.
7403 (Target_i386::got_entry_count): New function.
7404 (Target_i386::plt_entry_count): New function.
7405 (Target_i386::first_plt_entry_offset): New function.
7406 (Target_i386::plt_entry_size): New function.
7407 (Output_data_plt_i386::entry_count): New function.
7408 (Output_data_plt_i386::first_plt_entry_offset): New function.
7409 (Output_data_plt_i386::get_plt_entry_size): New function.
7410 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7411 find_incremental_inputs_sections. Dump incremental_got_plt section.
7412 * incremental.cc: Include target.h.
7413 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7414 parameter. Adjust all callers. Find incremental_got_plt section.
7415 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7416 section.
7417 (Output_section_incremental_inputs::set_final_data_size): Calculate
7418 size of incremental_got_plt section.
7419 (Output_section_incremental_inputs::do_write): Write the
7420 incremental_got_plt section.
7421 (Got_plt_view_info): New struct.
7422 (Local_got_offset_visitor): New class.
7423 (Global_got_offset_visitor): New class.
7424 (Global_symbol_visitor_got_plt): New class.
7425 (Output_section_incremental_inputs::write_got_plt): New function.
7426 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7427 Add parameter. Adjust all callers.
7428 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7429 (Incremental_inputs::got_plt_section): New function.
7430 (Incremental_inputs::got_plt_section_): New data member.
7431 (Incremental_got_plt_reader): New class.
7432 * layout.cc (Layout::create_incremental_info_sections): Add the
7433 incremental_got_plt section.
7434 * object.h (Got_offset_list::get_list): New function.
7435 (Got offset_list::for_all_got_offsets): New function.
7436 (Sized_relobj::local_got_offset_list): New function.
7437 * powerpc.cc (Target_powerpc::got_size): Add const.
7438 (Target_powerpc::got_entry_count): New function.
7439 (Target_powerpc::plt_entry_count): New function.
7440 (Target_powerpc::first_plt_entry_offset): New function.
7441 (Target_powerpc::plt_entry_size): New function.
7442 (Output_data_plt_powerpc::entry_count): New function.
7443 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7444 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7445 * sparc.cc (Target_sparc::got_size): Add const.
7446 (Target_sparc::got_entry_count): New function.
7447 (Target_sparc::plt_entry_count): New function.
7448 (Target_sparc::first_plt_entry_offset): New function.
7449 (Target_sparc::plt_entry_size): New function.
7450 (Output_data_plt_sparc::entry_count): New function.
7451 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7452 (Output_data_plt_sparc::get_plt_entry_size): New function.
7453 * symtab.h (Symbol::got_offset_list): New function.
7454 (Symbol_table::for_all_symbols): New function.
7455 * target.h (Sized_target::got_entry_count): New function.
7456 (Sized_target::plt_entry_count): New function.
7457 (Sized_target::plt_entry_size): New function.
7458 * x86_64.cc (Target_x86_64::got_size): Add const.
7459 (Target_x86_64::got_entry_count): New function.
7460 (Target_x86_64::plt_entry_count): New function.
7461 (Target_x86_64::first_plt_entry_offset): New function.
7462 (Target_x86_64::plt_entry_size): New function.
7463 (Output_data_plt_x86_64::entry_count): New function.
7464 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7465 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7466
09ec0418
CC
74672010-08-12 Cary Coutant <ccoutant@google.com>
7468
7469 * archive.cc: Include incremental.h.
7470 (Archive::Archive): Initialize incremental_info_.
7471 (Archive::include_member): Record archive members in incremental info.
7472 (Add_archive_symbols::run): Record begin and end of an archive in
7473 incremental info.
7474 (Lib_group::include_member): Record objects in incremental info.
7475 * archive.h (Incremental_archive_entry): Forward declaration.
7476 (Archive::set_incremental_info): New member function.
7477 (Archive::incremental_info): New member function.
7478 (Archive::Unused_symbol_iterator): New class.
7479 (Archive::unused_symbols_begin): New member function.
7480 (Archive::unused_symbols_end): New member function.
7481 (Archive::incremental_info_): New data member.
7482 * incremental-dump.cc (find_input_containing_global): New function.
7483 (dump_incremental_inputs): Dump new incremental info sections.
7484 * incremental.cc: Include symtab.h.
7485 (Output_section_incremental_inputs): New class.
7486 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7487 new incremental info sections.
7488 (Sized_incremental_binary::do_check_inputs): Likewise.
7489 (Incremental_inputs::report_archive): Remove.
7490 (Incremental_inputs::report_archive_begin): New function.
7491 (Incremental_inputs::report_archive_end): New function.
7492 (Incremental_inputs::report_object): New function.
7493 (Incremental_inputs::finalize_inputs): Remove.
7494 (Incremental_inputs::report_input_section): New function.
7495 (Incremental_inputs::report_script): Rewrite.
7496 (Incremental_inputs::finalize): Do nothing but finalize string table.
7497 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7498 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7499 (Incremental_inputs::create_data_sections): New function.
7500 (Incremental_inputs::relocs_entsize): New function.
7501 (Output_section_incremental_inputs::set_final_data_size): New function.
7502 (Output_section_incremental_inputs::do_write): New function.
7503 (Output_section_incremental_inputs::write_header): New function.
7504 (Output_section_incremental_inputs::write_input_files): New function.
7505 (Output_section_incremental_inputs::write_info_blocks): New function.
7506 (Output_section_incremental_inputs::write_symtab): New function.
7507 * incremental.h (Incremental_script_entry): Forward declaration.
7508 (Incremental_object_entry): Forward declaration.
7509 (Incremental_archive_entry): Forward declaration.
7510 (Incremental_inputs): Forward declaration.
7511 (Incremental_inputs_header_data): Remove.
7512 (Incremental_inputs_header): Remove.
7513 (Incremental_inputs_header_write): Remove.
7514 (Incremental_inputs_entry_data): Remove.
7515 (Incremental_inputs_entry): Remove.
7516 (Incremental_inputs_entry_write): Remove.
7517 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7518 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7519 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7520 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7521 Likewise.
7522 (Incremental_input_entry): New class.
7523 (Incremental_script_entry): New class.
7524 (Incremental_object_entry): New class.
7525 (Incremental_archive_entry): New class.
7526 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7527 (Incremental_inputs::report_inputs): Remove.
7528 (Incremental_inputs::report_archive): Remove.
7529 (Incremental_inputs::report_archive_begin): New function.
7530 (Incremental_inputs::report_archive_end): New function.
7531 (Incremental_inputs::report_object): Change prototype.
7532 (Incremental_inputs::report_input_section): New function.
7533 (Incremental_inputs::report_script): Change prototype.
7534 (Incremental_inputs::get_reloc_count): New function.
7535 (Incremental_inputs::set_reloc_count): New function.
7536 (Incremental_inputs::create_data_sections): New function.
7537 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7538 (Incremental_inputs::inputs_section): New function.
7539 (Incremental_inputs::symtab_section): New function.
7540 (Incremental_inputs::relocs_section): New function.
7541 (Incremental_inputs::get_stringpool): Add const.
7542 (Incremental_inputs::command_line): Add const.
7543 (Incremental_inputs::inputs): Remove.
7544 (Incremental_inputs::command_line_key): New function.
7545 (Incremental_inputs::input_file_count): New function.
7546 (Incremental_inputs::input_files): New function.
7547 (Incremental_inputs::relocs_entsize): New function.
7548 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7549 (Incremental_inputs::finalize_inputs): Remove.
7550 (Incremental_inputs::Input_info): Remove.
7551 (Incremental_inputs::lock_): Remove.
7552 (Incremental_inputs::inputs_): Change type.
7553 (Incremental_inputs::inputs_map_): Remove.
7554 (Incremental_inputs::current_object_entry_): New data member.
7555 (Incremental_inputs::inputs_section_): New data member.
7556 (Incremental_inputs::symtab_section_): New data member.
7557 (Incremental_inputs::relocs_section_): New data member.
7558 (Incremental_inputs::reloc_count_): New data member.
7559 (Incremental_inputs_reader): New class.
7560 (Incremental_symtab_reader): New class.
7561 (Incremental_relocs_reader): New class.
7562 * layout.cc (Layout::finalize): Move finalization of incremental info
7563 and creation of incremental info sections to follow finalization of
7564 symbol table. Set offsets for postprocessing sections.
7565 (Layout::create_incremental_info_sections): Call
7566 Incremental_inputs::create_data_sections. Add incremental symtab
7567 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7568 sections to layout after input sections.
7569 * layout.h (struct Timespec): Forward declaration.
7570 (Layout::incremental_inputs): Add const.
7571 (Layout::create_incremental_info_sections): Add parameter.
7572 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7573 * object.cc: Include incremental.h.
7574 (Relobj::finalize_incremental_relocs): New function.
7575 (Sized_relobj::do_layout): Record input sections in incremental info.
7576 * object.h (Object::output_section): New function.
7577 (Object::output_section_offset): Moved from Relobj.
7578 (Object::get_incremental_reloc_base): New function.
7579 (Object::get_incremental_reloc_count): New function.
7580 (Object::do_output_section): New function.
7581 (Object::do_output_section_offset): Moved from Relobj.
7582 (Object::do_get_incremental_reloc_base): New function.
7583 (Object::do_get_incremental_reloc_count): New function.
7584 (Object::Object): Initialize new data members.
7585 (Relobj::output_section): Renamed do_output_section and moved to
7586 protected.
7587 (Relobj::output_section_offset): Moved to Object.
7588 (Relobj::do_get_incremental_reloc_base): New function.
7589 (Relobj::do_get_incremental_reloc_count): New function.
7590 (Relobj::allocate_incremental_reloc_counts): New function.
7591 (Relobj::count_incremental_reloc): New function.
7592 (Relobj::finalize_incremental_relocs): New function.
7593 (Relobj::next_incremental_reloc_index): New function.
7594 (Relobj::reloc_counts_): New data member.
7595 (Relobj::reloc_bases_): New data member.
7596 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7597 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7598 (Sized_relobj::incremental_relocs_scan): New function.
7599 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7600 (Sized_relobj::incremental_relocs_write): New function.
7601 (Sized_relobj::incremental_relocs_write_reltype): New function.
7602 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7603 incremental link.
7604 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7605 archives and object files elsewhere.
7606 (Add_symbols::run): Report object files here.
7607 (Finish_group::run): Report end of archive at end of group.
7608 * reloc.cc: Include layout.h, incremental.h.
7609 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7610 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7611 (Sized_relobj::incremental_relocs_scan): New function.
7612 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7613 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7614 (Sized_relobj::incremental_relocs_write): New function.
7615 (Sized_relobj::incremental_relocs_write_reltype): New function.
7616 * script.cc (read_input_script): Rewrite test for incremental link.
7617 Change call to Incremental_inputs::report_script.
7618 * symtab.h (Symbol_table::first_global_index): New function.
7619 (Symbol_table::output_count): New function.
7620
ce0d1972
DK
76212010-08-12 Doug Kwan <dougkwan@google.com>
7622
7623 * arm.cc (Target_arm::merge_object_attributes): Check command line
7624 options --no-wchar-size-warning and --no-enum-size-warning.
7625 * options.h (General_options): Add ld-compatible options
7626 --no-enum-size-warning and --no-wchar-size-warning.
7627
6e5710ce
ILT
76282010-08-04 Ian Lance Taylor <iant@google.com>
7629
7630 * x86_64.cc (Target_x86_64::Scan::local): Use
7631 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7632 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7633 (Target_x86_64::Scan::global): Likewise.
7634 (Target_x86_64::Relocate::relocate): Likewise.
7635 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7636 Likewise.
7637
fef830db
CC
76382010-08-03 Cary Coutant <ccoutant@google.com>
7639
7640 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7641 to reserve space in merged_strings vector. Keep total input size
7642 for stats.
7643 (Output_merge_string::do_print_merge_stats): Print total input size.
7644 * merge.h (Output_merge_string): Add input_size_ field.
7645 * stringpool.cc (Stringpool_template::string_length): Move
7646 implementations out of Stringpool_template class and place in
7647 stringpool.h.
7648 * stringpool.h (string_length): Move out of Stringpool_template.
7649
1e3811b0
ILT
76502010-08-03 Ian Lance Taylor <iant@google.com>
7651
7652 PR 11712
7653 * layout.cc (relaxation_loop_body): If address of load segment is
7654 set, adjust address to include headers if possible.
7655
7af0c620
ILT
76562010-08-03 Ian Lance Taylor <iant@google.com>
7657
7658 * version.cc (version_string): Bump to 1.10.
7659
22f0da72
ILT
76602010-08-03 Ian Lance Taylor <iant@google.com>
7661
7662 PR 11805
7663 * layout.h (enum Output_section_order): Define.
7664 (class Layout): Update declarations.
7665 * layout.cc (Layout::get_output_section): Add order parameter.
7666 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7667 is_first_non_relro parameters. Change all callers.
7668 (Layout::choose_output_section): Likewise.
7669 (Layout::add_output_section_data): Likewise.
7670 (Layout::make_output_section): Likewise. Set order.
7671 (Layout::default_section_order): New function.
7672 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7673 * output.cc (Output_section::Output_section): Initialize order_.
7674 Don't initialize deleted fields.
7675 (Output_segment::Output_segment): Don't initialize deleted
7676 fields.
7677 (Output_segment::add_output_section_to_load): New function
7678 replacing add_output_section. Change all callers to call this or
7679 add_output_section_to_nonload.
7680 (Output_segment::add_output_section_to_nonload): New function.
7681 (Output_segment::remove_output_section): Rewrite.
7682 (Output_segment::add_initial_output_data): Likewise.
7683 (Output_segment::has_any_data_sections): Likewise.
7684 (Output_segment::is_first_section_relro): Likewise.
7685 (Output_segment::maximum_alignment): Likewise.
7686 (Output_segment::has_dynamic_reloc): New function replacing
7687 dynamic_reloc_count. Change all callers.
7688 (Output_segment::has_dynamic_reloc_list): New function replacing
7689 dynamic_reloc_count_list. Change all callers.
7690 (Output_segment::set_section_addresses): Rewrite.
7691 (Output_segment::set_offset): Rewrite.
7692 (Output_segment::find_first_and_last_list): Remove.
7693 (Output_segment::set_tls_offsets): Rewrite.
7694 (Output_segment::first_section_load_address): Likewise.
7695 (Output_segment::output_section_count): Likewise.
7696 (Output_segment::section_with_lowest_load_address): Likewise.
7697 (Output_segment::write_section_headers): Likewise.
7698 (Output_segment::print_sections_to_map): Likewise.
7699 * output.h (class Output_data): Remove dynamic_reloc_count_
7700 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7701 (Output_data::add_dynamic_reloc): Rewrite.
7702 (Output_data::has_dynamic_reloc): New function.
7703 (Output_data::dynamic_reloc_count): Remove.
7704 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7705 is_last_relro_, is_first_non_relro_, is_interp_,
7706 is_dynamic_linker_section_ fields. Add order and set_order
7707 functions. Remove is_relro_local, set_is_relro_local,
7708 is_last_relro, set_is_last_relro, is_first_non_relro,
7709 set_is_first_non_relro functions, is_interp, set_is_interp,
7710 is_dynamic_linker_section, and set_is_dynamic_linker_section
7711 functions.
7712 (class Output_segment): Change Output_data_list from std::list to
7713 std:;vector. Add output_lists_ field. Remove output_data_ and
7714 output_bss_ fields. Update declarations.
7715
3ff2ccb0
ILT
77162010-08-02 Ian Lance Taylor <iant@google.com>
7717
7718 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7719 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7720 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7721
88a4108b
ILT
77222010-08-02 Ian Lance Taylor <iant@google.com>
7723
7724 PR 11855
7725 * script.cc (Script_options::Script_options): Initialize
7726 symbol_definitions_ and symbol_references_.
7727 (Script_options::add_symbol_assignment): Update
7728 symbol_definitions_ and symbol_references_.
7729 (Script_options::add_symbol_reference): New function.
7730 (script_symbol): New function.
7731 * script.h (class Script_options): Add symbol_definitions_ and
7732 symbol_references_ fields.
7733 (Script_options::referenced_const_iterator): New type.
7734 (Script_options::referenced_begin): New function.
7735 (Script_options::referenced_end): New function.
7736 (Script_options::is_referenced): New function.
7737 (Script_options::any_unreferenced): New function.
7738 * script-c.h (script_symbol): Declare.
7739 * yyscript.y (exp): Call script_symbol.
7740 * symtab.cc: Include "script.h".
7741 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7742 Change all callers. Check symbols referenced by scripts.
7743 (Symbol_table::add_undefined_symbols_from_command_line): Add
7744 layout parameter. Change all callers.
7745 (Symbol_table::do_add_undefined_symbols_from_command_line):
7746 Likewise. Break out loop body. Check symbols referenced by
7747 scripts.
7748 (Symbol_table::add_undefined_symbol_from_command_line): New
7749 function broken out of
7750 do_add_undefined_symbols_from_command_line.
7751 * symtab.h (class Symbol_table): Update declarations.
7752 * archive.cc: Include "layout.h".
7753 (Archive::should_include_member): Add layout parameter. Change
7754 all callers. Check for symbol mentioned in expression.
7755 * archive.h (class Archive): Update declaration.
7756 * object.cc (Sized_relobj::do_should_include_member): Add layout
7757 parameter.
7758 * object.h (Object::should_include_member): Add layout parameter.
7759 Change all callers.
7760 (Object::do_should_include_member): Add layout parameter.
7761 (class Sized_relobj): Update declaration.
7762 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7763 parameter.
7764 * dynobj.h (class Sized_dynobj): Update declaration.
7765 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7766 layout parameter.
7767 * plugin.h (class Sized_pluginobj): Update declaration.
7768
5f1ab67a
ILT
77692010-08-02 Ian Lance Taylor <iant@google.com>
7770
7771 PR 11866
7772 * output.cc (Output_segment::set_offset): Search for the first and
7773 last sections rather than assuming that the list is in order.
7774 (Output_segment::find_first_and_last_list): New function.
7775 * output.h (class Output_segment): Update declarations.
7776 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7777 (relro_strip_test_SOURCES): New variable.
7778 (relro_strip_test_DEPENDENCIES): New variable.
7779 (relro_strip_test_LDFLAGS): New variable.
7780 (relro_strip_test_LDADD): New variable.
7781 (relro_strip_test.so): New target.
7782
a8df5856
ILT
77832010-08-02 Ian Lance Taylor <iant@google.com>
7784
7785 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7786 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7787 (Target_i386::got_tlsdesc_section): New function.
7788 (Target_i386::got_section): Create space for GOT entries for
7789 TLSDESC relocations.
7790 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7791 R_386_TLS_GOTDESC.
7792 (Target_i386::Scan::global): Likewise.
7793 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7794 using TLSDESC GOT.
7795 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7796 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7797 (Target_x86_64::got_tlsdesc_section): New function.
7798 (Target_x86_64::got_section): Create space for GOT entries for
7799 TLSDESC relocations.
7800 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
7801 R_386_TLS_GOTDESC.
7802 (Target_x86_64::Scan::global): Likewise.
7803 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
7804 using TLSDESC GOT.
7805
0c10a0a6
ILT
78062010-08-02 Ian Lance Taylor <iant@google.com>
7807
7808 * testsuite/final_layout.sh: Use dc to convert from hex to
7809 decimal.
7810
41cbeecc
ST
78112010-07-29 Sriraman Tallam <tmsriram@google.com>
7812
7813 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
7814 paramter to the call to gold::gc_process_relocs.
7815 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
7816 paramter to the call to gold::gc_process_relocs.
7817 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
7818 parameter to the call to gold::gc_process_relocs.
7819 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
7820 template parameter to the call to gold::gc_process_relocs.
7821 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
7822 paramter to the call to gold::gc_process_relocs.
7823 * gc.h (get_embedded_addend_size): New function.
7824 (gc_process_relocs): Save the size of the reloc for use by ICF.
7825 * icf.cc (get_section_contents): Get the addend from the text section
7826 for SHT_REL relocation sections.
7827 * icf.h (Icf::Reloc_addend_size_info): New typedef.
7828 (Icf::Reloc_info): Add new member reloc_addend_size_info.
7829 * int_encoding.h (read_from_pointer): New overloaded function.
7830 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
7831 * testsuite/icf_sht_rel_addend_test.sh: New file.
7832 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
7833 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
7834
6ea55b82
RW
78352010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7836
7837 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
7838 * Makefile.in: Regenerate.
7839 * testsuite/Makefile.in: Regenerate.
7840
9691462b
ILT
78412010-07-27 Jeffrey Yasskin <jyasskin@google.com>
7842
7843 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
7844 * gold/testsuite/debug_msg.cc: Likewise.
7845 * gold/testsuite/odr_violation1.cc
7846 * gold/testsuite/odr_violation2.cc
7847
76897331
CC
78482010-07-21 Cary Coutant <ccoutant@google.com>
7849
7850 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
7851 string, and length fields.
7852 (Output_merge_string::Merged_strings_list): New type.
7853 (Output_merge_string::Merged_strings_lists): New typedef.
7854 (Output_merge_string): Replace merged_strings_ with
7855 merged_strings_lists_.
7856 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
7857 Merged_strings_list per input object and section. Don't store pointer
7858 to the string. Don't store length with each merged string entry.
7859 (Output_merge_string::finalize_merged_data): Loop over list of merged
7860 strings lists. Recompute length of each merged string.
7861
78384e8f
CC
78622010-07-15 Cary Coutant <ccoutant@google.com>
7863
7864 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
7865 here.
7866
783659f9
ILT
78672010-07-14 Ian Lance Taylor <iant@google.com>
7868
7869 * descriptors.cc (Descriptors::open): Report correct name in error
7870 message.
7871
131687b4
DK
78722010-07-13 Doug Kwan <dougkwan@google.com>
7873
7874 * arm.cc (Arm_input_section::Arm_input_section): For a
7875 SHT_ARM_EXIDX section, always keeps the input sections.
7876 (Arm_input_section::set_exidx_section_link): New method.
7877 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
7878 has_errors_ to false.
7879 (Arm_exidx_input_section::has_errors,
7880 Arm_exidx_input_section::set_has_errors): New methods.
7881 (Arm_exidx_input_section::has_errors_): New data member.
7882 (Arm_relobj::get_exidx_shndx_list): New method.
7883 (Arm_output_section::append_text_sections_to_list): Do not skip
7884 section without SHF_EXECINSTR.
7885 (Arm_output_section::fix_exidx_coverage): Skip input sections with
7886 errors.
2e702c99 7887 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
7888 section header. Make error messages more verbose. Check for
7889 a non-executable section linked to an EXIDX section.
7890 (Arm_relobj::do_read_symbols): Remove error checking, which has been
7891 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
7892 check that there is no deferred EXIDX section if we exit early.
7893 Instead of not making an EXIDX section in case of an error, make one
7894 and set the has_errors flag of it.
7895 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
7896 in a relocatable link.
7897 (Target_arm::do_relax): Look for the EXIDX output section instead of
7898 assuming that it is called .ARM.exidx.
2e702c99 7899 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
7900 section list. Do not check for SHF_EXECINSTR section flags but
7901 skip any input section with errors.
7902 * output.cc (Output_section::Output_section): Initialize
7903 always_keeps_input_sections_ to false.
7904 (Output_section::add_input_section): Check for
7905 always_keeps_input_sections_.
7906 * output.h (Output_section::always_keeps_input_sections,
7907 Output_section::set_always_keeps_input_sections): New methods.
7908 (Output_section::always_keeps_input_sections): New data member.
7909
69517287
RÁE
79102010-07-13 Rafael Espindola <espindola@google.com>
7911
7912 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
7913 * fileread.h (Input_file): Add try_extra_search_path and find_file.
7914
82742395
ILT
79152010-07-13 Philip Herron <herron.philip@googlemail.com>
7916 Ian Lance Taylor <iant@google.com>
7917
7918 * output.h (Output_section_lookup_maps::add_merge_section):
7919 Correct check of whether value was inserted.
7920 (Output_section_lookup_maps::add_merge_input_section): Likewise.
7921 (Output_section_lookup_maps::add_relaxed_input_section):
7922 Likewise.
7923 * arm.cc (Target_arm::got_section): Remove used local os.
7924 * i386.cc (Target_i386::got_section): Likewise.
7925 * x86_64.cc (Target_x86_64::got_section): Likewise.
7926 * sparc.cc (Target_sparc::got_section): Likewise.
7927 (Target_sparc::relocate): Remove unused local have_got_offset.
7928 * powerpc.cc (Target_powerpc::relocate): Likewise.
7929
f2d707b5
ILT
79302010-07-13 Ian Lance Taylor <iant@google.com>
7931
241531d6
ILT
7932 * compressed_output.cc (zlib_decompress): Fix signature in
7933 !HAVE_ZLIB_H case.
7934
f2d707b5
ILT
7935 * archive.cc (Archive::include_member): Unlock an external member
7936 of a thin archive. Don't bother to delete an object we know is
7937 NULL.
7938
a2e47362
CC
79392010-07-12 Cary Coutant <ccoutant@google.com>
7940
7941 * compressed_output.cc (zlib_decompress): New function.
7942 (get_uncompressed_size): New function.
7943 (decompress_input_section): New function.
7944 * compressed_output.h (get_uncompressed_size): New function.
7945 (decompress_input_section): New function.
7946 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
7947 Handle compressed debug sections.
7948 * layout.cc (is_compressed_debug_section): New function.
7949 (Layout::output_section_name): Map compressed section names to
7950 canonical names.
7951 * layout.h (is_compressed_debug_section): New function.
7952 (is_debug_info_section): Recognize compressed debug sections.
7953 * merge.cc: Include compressed_output.h.
7954 (Output_merge_data::do_add_input_section): Handle compressed
7955 debug sections.
7956 (Output_merge_string::do_add_input_section): Handle compressed
7957 debug sections.
7958 * object.cc: Include compressed_output.h.
7959 (Sized_relobj::Sized_relobj): Initialize new data members.
7960 (build_compressed_section_map): New function.
7961 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
7962 * object.h (Object::section_is_compressed): New method.
7963 (Object::do_section_is_compressed): New method.
7964 (Sized_relobj::Compressed_section_map): New type.
7965 (Sized_relobj::do_section_is_compressed): New method.
7966 (Sized_relobj::compressed_sections_): New data member.
7967 * output.cc (Output_section::add_input_section): Handle compressed
7968 debug sections.
7969 * reloc.cc: Include compressed_output.h.
7970 (Sized_relobj::write_sections): Handle compressed debug sections.
7971
ce279a62
CC
79722010-07-08 Cary Coutant <ccoutant@google.com>
7973
7974 * resolve.cc (Symbol_table::resolve): Remember whether undef was
7975 weak when resolving to a dynamic def.
7976 (Symbol_table::should_override): Add adjust_dyndef flag; set it
7977 for weak undef/dynamic def cases. Adjust callers.
7978 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
7979 undef_binding_weak_.
7980 (Symbol_table::sized_write_globals): Adjust symbol binding.
7981 (Symbol_table::sized_write_symbol): Add binding parameter.
7982 * symtab.h (Symbol::set_undef_binding): New method.
7983 (Symbol::is_undef_binding_weak): New method.
7984 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
7985 (Symbol_table::should_override): Add new parameter.
7986 (Symbol_table::sized_write_symbol): Add new parameter.
7987
7988 * testsuite/weak_undef_file1.cc: Add new test case.
7989 * testsuite/weak_undef_file2.cc: Fix header comment.
7990 * testsuite/weak_undef_test.cc: Add new test case.
7991
b2286c10
DK
79922010-06-29 Doug Kwan <dougkwan@google.com>
7993
7994 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
7995 Initialize USE_SYMBOL_.
7996 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
7997 definition.
7998 (Arm_reloc_property::uses_symbol_): New data member declaration.
7999 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8000 uses symbol value and symbol is undefined but not weakly undefined.
8001
4802450a
RÁE
80022010-06-28 Rafael Espindola <espindola@google.com>
8003
8004 * plugin.cc (Plugin::load): Use dlerror.
8005
e5ca47ba
ILT
80062010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8007
8008 * symtab.cc (detect_odr_violations): When reporting an ODR
8009 violation, report an object where the symbol is defined.
8010
8a75a161
DK
80112010-06-25 Doug Kwan <dougkwan@google.com>
8012
8013 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8014 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8015 definition.
8016 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8017 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8018 target hook to detect function points.
8019 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8020 * icf.h (Icf::check_section_for_function_pointers): Change type of
8021 parameter SECTION_NAME to const reference to std::string. Use
8022 target hook to determine if section may have unsafe pointers.
8023 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8024 method definition.
8025
42218b9f
RÁE
80262010-06-21 Rafael Espindola <espindola@google.com>
8027
8028 * fileread.cc (Input_file::find_fie): New
8029 (Input_file::open): Use Input_file::find_fie.
8030 * fileread.h (Input_file::find_fie): New
8031 * plugin.cc (set_extra_library_path): New.
8032 (Plugin::load): Add set_extra_library_path to the transfer vector.
8033 (Plugin_manager::set_extra_library_path): New.
8034 (Plugin_manager::add_input_file): Use the extra search path if set.
8035 (set_extra_library_path(): New.
8036 * plugin.h (Plugin_manager): Add set_extra_library_path and
8037 extra_search_path_.
8038
a0506cca
CC
80392010-06-19 Cary Coutant <ccoutant@google.com>
8040
8041 * layout.cc (gdb_sections): Add .debug_types.
8042 (lines_only_debug_sections): Likewise.
8043
6508b958
RÁE
80442010-06-18 Rafael Espindola <espindola@google.com>
8045
8046 * plugin.cc (add_input_file,add_input_library)
8047 (Plugin_manager::add_input_file): Make filename arguments const.
8048 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8049 const.
8050
3e235302
DK
80512010-06-16 Doug Kwan <dougkwan@google.com>
8052
8053 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8054 .ARM.attributes section if we have not merged any input
8055 attributes sections.
8056
106e8a6c
DK
80572010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8058
8059 * arm.cc: Allow combining objects with no EABI version
8060 information.
8061
91ff43fe
RÁE
80622010-06-15 Rafael Espindola <espindola@google.com>
8063
8064 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8065
68ed838c
ILT
80662010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8067
8068 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8069 (struct iovec): Correct !HAVE_READV definition.
8070
f3a2388f
CC
80712010-06-10 Cary Coutant <ccoutant@google.com>
8072
8073 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8074 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8075 reloc sections.
8076 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8077
8078 PR 11683
8079 * symtab.h (Symbol::is_placeholder): New member function.
8080 * target-reloc.h (relocate_section): Check for placeholder symbols.
8081
8082 * testsuite/Makefile.am (plugin_test_8): New test.
8083 (plugin_test_9): New test.
8084 * testsuite/Makefile.in: Regenerate.
8085
e1df38aa
NC
80862010-06-09 Nick Clifton <nickc@redhat.com>
8087
8088 * yyscript.y (input_list_element): Allow strings prefixed with
8089 the '-' character. Treat these as libraries.
8090 * script.cc (script_add_library): New function. Adds a library
8091 specified by "-l<name>" found in an input script.
8092 * script-c.h: Add prototype for script_add_library.
8093
25bbe950
DK
80942010-06-07 Doug Kwan <dougkwan@google.com>
8095
8096 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8097 Restrict stub-group size to be within long conditional branch
8098 range when working around cortex-A8 erratum.
8099
0f32ea4c
ILT
81002010-06-07 Damien Diederen <dd@crosstwine.com>
8101
8102 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8103 #ifdef typo.
8104
8fe2a369
ST
81052010-06-03 Sriraman Tallam <tmsriram@google.com>
8106
8107 PR gold/11658
8108 * output.cc
8109 (Output_section::Input_section_sort_entry::compare_section_ordering):
8110 Change to return non-zero correctly.
8111 (Output_section::Input_section_sort_section_order_index_compare
8112 ::operator()): Change to fix ambiguity in comparisons.
8113
6e9ba2ca
ST
81142010-06-01 Sriraman Tallam <tmsriram@google.com>
8115
8116 * gold.h (is_wildcard_string): New function.
8117 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8118 (Layout::layout_eh_frame): Ditto.
8119 (Layout::find_section_order_index): New method.
8120 (Layout::read_layout_from_file): New method.
8121 * layout.h (Layout::find_section_order_index): New method.
8122 (Layout::read_layout_from_file): New method.
8123 (Layout::input_section_position_): New private member.
8124 (Layout::input_section_glob_): New private member.
8125 * main.cc (main): Call read_layout_from_file here.
8126 * options.h (--section-ordering-file): New option.
8127 * output.cc (Output_section::input_section_order_specified_): New
8128 member.
8129 (Output_section::Output_section): Initialize new member.
8130 (Output_section::add_input_section): Add new parameter.
8131 Keep input sections when --section-ordering-file is used.
8132 (Output_section::set_final_data_size): Sort input sections when
8133 section ordering file is specified.
8134 (Output_section::Input_section_sort_entry): Add new parameter.
8135 Check sorting type.
8136 (Output_section::Input_section_sort_entry::compare_section_ordering):
8137 New method.
8138 (Output_section::Input_section_sort_compare::operator()): Change to
8139 consider section_order_index.
8140 (Output_section::Input_section_sort_init_fini_compare::operator()):
8141 Change to consider section_order_index.
8142 (Output_section::Input_section_sort_section_order_index_compare
8143 ::operator()): New method.
8144 (Output_section::sort_attached_input_sections): Change to sort
8145 according to section order when specified.
e1df38aa
NC
8146 (Output_section::add_input_section<32, true>): Add new parameter.
8147 (Output_section::add_input_section<64, true>): Add new parameter.
8148 (Output_section::add_input_section<32, false>): Add new parameter.
8149 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8150 * output.h (Output_section::add_input_section): Add new parameter.
8151 (Output_section::input_section_order_specified): New
8152 method.
8153 (Output_section::set_input_section_order_specified): New method.
8154 (Input_section::Input_section): Initialize section_order_index_.
8155 (Input_section::section_order_index): New method.
8156 (Input_section::set_section_order_index): New method.
8157 (Input_section::section_order_index_): New member.
8158 (Input_section::Input_section_sort_section_order_index_compare): New
8159 struct.
8160 (Output_section::input_section_order_specified_): New member.
8161 * script-sections.cc (is_wildcard_string): Delete and move modified
8162 method to gold.h.
8163 (Output_section_element_input::Output_section_element_input): Modify
8164 call to is_wildcard_string.
8165 (Output_section_element_input::Input_section_pattern
8166 ::Input_section_pattern): Ditto.
8167 (Output_section_element_input::Output_section_element_input): Ditto.
8168 * testsuite/Makefile.am (final_layout): New test case.
8169 * testsuite/Makefile.in: Regenerate.
8170 * testsuite/final_layout.cc: New file.
8171 * testsuite/final_layout.sh: New file.
8172
3537c84b
RÁE
81732010-06-01 Rafael Espindola <espindola@google.com>
8174
8175 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8176
105b6afd
RÁE
81772010-06-01 Rafael Espindola <espindola@google.com>
8178
8179 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8180 visibility of symbols.
8181
29e11421
DK
81822010-05-27 Doug Kwan <dougkwan@google.com>
8183
8184 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8185 from start of output section instead of address for a local symbol
8186 in a merged or relaxed section when doing a relocatable link.
8187
5e0f337e
RÁE
81882010-05-26 Rafael Espindola <espindola@google.com>
8189
703d02da 8190 PR 11604
5e0f337e
RÁE
8191 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8192 adding sections the garbage collector removed.
8193 * gold/testsuite/Makefile.am: Add test.
8194 * gold/testsuite/Makefile.in: Regenerate.
8195 * gold/testsuite/plugin_test_7.sh: New.
8196 * gold/testsuite/plugin_test_7_1.c: New.
8197 * gold/testsuite/plugin_test_7_2.c: New.
8198
f4187277
RÁE
81992010-05-26 Rafael Espindola <espindola@google.com>
8200
8201 * script-sections.cc (Output_section_definition::set_section_addresses):
8202 Check for --section-start.
8203
5c388529
DK
82042010-05-26 Doug Kwan <dougkwan@google.com>
8205
8206 * arm.cc (Arm_scan_relocatable_relocs): New class.
8207 (Target_arm::relocate_special_relocatable): New method.
8208 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8209 (Arm_relocate_functions::thumb_branch_common): Same.
8210 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8211 instead of Default_scan_relocatable_relocs.
8212 * target-reloc.h (relocate_for_relocatable): Let target handle
8213 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8214 * target.h (Sized_target::relocate_special_relocatable): New method.
8215
bca1c3ae
ILT
82162010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8217
8218 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8219
0439c796
DK
82202010-05-23 Doug Kwan <dougkwan@google.com>
8221
8222 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8223 instead of a cast.
8224 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8225 with a direct branch, not a conditional branch, to a stub.
8226 * merge.cc (Output_merge_base::record_input_section): New method
8227 defintion.
8228 (Output_merge_data::do_add_input_section): Record input section if
8229 keeps-input-sections flag is set.
8230 (Output_merge_string::do_add_input_section): Ditto.
8231 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8232 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8233 INPUT_SECTIONS_.
8234 (Output_merge_base::keeps_input_sections,
8235 Output_merge_base::set_keeps_input_sections,
8236 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8237 method definitions.
8238 (Output_merge_base::Input_sections): New type declaration.
8239 (Output_merge_base::input_sections_begin,
8240 Output_merge_base::input_sections_end,
8241 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8242 (Output_merge_base::bool keeps_input_sections_,
8243 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8244 Output_merge_base::input_sections_): New data members.
8245 (Output_merge_data::do_set_keeps_input_sections): New method
8246 defintion.
8247 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8248 * output.cc (Output_section::Input_section::relobj): Move method
8249 defintion from class declaration to here and handle merge sections.
8250 (Output_section::Input_section::shndx): Ditto.
8251 (Output_section::Output_section): Remove initializations of removed
8252 data members and initialize new data member LOOKUP_MAPS_.
8253 (Output_section::add_input_section): Set keeps-input-sections flag
8254 for a newly created merge output section as appropriate. Adjust code
8255 to use Output_section_lookup_maps class.
8256 (Output_section::add_relaxed_input_section): Adjst code for lookup
8257 maps code refactoring.
2e702c99 8258 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8259 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8260 class. If adding input section to a newly created merge output
8261 section fails, remove the new merge section.
8262 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8263 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8264 (Output_section::find_merge_section): Ditto.
0439c796 8265 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8266 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8267 Output_section_lookup_maps class.
8268 (Output_section::get_input_sections): Export merge sections. Adjust
8269 code to use Output_section_lookup_maps class.
8270 (Output_section:::add_script_input_section): Adjust code to use
8271 Output_section_lookup_maps class. Update lookup maps for merge
8272 sections also.
8273 (Output_section::discard_states): Use Output_section_lookup_maps.
8274 (Output_section::restore_states): Same.
8275 * output.h (Merge_section_properties): Move class defintion out of
8276 Output_section.
8277 (Output_section_lookup_maps): New class.
8278 (Output_section::Input_section::is_merge_section): New method
8279 defintion.
8280 (Output_section::Input_section::relobj): Move defintion out of class
8281 defintion. Declare method only.
8282 (Output_section::Input_section::shndx): Ditto.
8283 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8284 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8285 (Output_section::Merge_section_by_properties_map,
8286 Output_section::Output_section_data_by_input_section_map,
8287 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8288 Remove types.
2e702c99 8289 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8290 KEEPS_INPUT_SECTIONS.
8291 (Output_section::build_lookup_maps): New method declaration.
8292 (Output_section::merge_section_map_,
8293 Output_section::merge_section_by_properties_map_,
8294 Output_section::relaxed_input_section_map_,
8295 Output_section::is_relaxed_input_section_map_valid_): Remove data
8296 members.
8297 (Output_section::lookup_maps_): New data member.
8298
76295588
L
82992010-05-21 Doug Kwan <dougkwan@google.com>
8300
8301 PR gold/11619
8302 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8303 avoid a compilation error.
8304
d103a984
RÁE
83052010-05-19 Rafael Espindola <espindola@google.com>
8306
8307 * script-sections.cc (Output_section_definition::allocate_to_segment):
8308 Update the phdrs_list even when the output section is NULL.
8309 * testsuite/Makefile.am: Add test.
8310 * testsuite/Makefile.in: Regenerate.
8311 * testsuite/script_test_9.cc: New.
8312 * testsuite/script_test_9.sh: New.
8313 * testsuite/script_test_9.t: New.
8314
6625d24e
DK
83152010-05-19 Doug Kwan <dougkwan@google.com>
8316
8317 * arm.cc (Arm_input_section::original_size): New method.
8318 (Arm_input_section::do_addralign): Add a cast.
8319 (Arm_input_section::do_output_offset): Remove static cast.
8320 (Arm_input_section::original_addralign,
8321 Arm_input_section::original_size_): Change type to uint32_t.
8322 (Arm_input_section::init): Add safe casts for section alignment
8323 and size.
8324 (Arm_input_section::set_final_data_size): Do not set address and
8325 offset of stub table.
8326 (Arm_output_section::fix_exidx_coverage): Change use of of
8327 Output_section::Simple_input_section to that of
8328 Output_section::Input_section.
8329 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8330 except for the first pass.
8331 * output.cc (Output_section::get_input_sections): Change type of
8332 input_sections to std::list<Input_section>.
8333 (Output_section::add_script_input_section): Rename from
8334 Output_section::add_simple_input_section. Change type of SIS
8335 parameter from Simple_input_section to Input_section.
8336 * output.h (Output_section::Simple_input_section): Remove class.
8337 (Output_section::Input_section): Change class visibility to public.
8338 (Output_section::Input_section::addralign): Use stored alignments
8339 for special input sections if set.
8340 (Output_section::Input_section::set_addralign): New method.
8341 (Output_section::get_input_sections): Change parameter type from
8342 list of Simple_input_section to list of Input_section.
8343 (Output_section::add_script_input_section): Rename from
8344 Output_section::add_simple_input_section. Change first parameter's
8345 type from Simple_input_section to Input_section and remove the
8346 second and third parameters.
8347 * script-sections.cc (Input_section::Input_section_list): Change
8348 type to list of Output_section::Input_section/
8349 (Input_section_info::Input_section_info): Change parameter type of
8350 INPUT_SECTION to Output_section::Input_section.
8351 (Input_section_info::input_section): Change return type.
8352 (Input_section_info::input_section_): Change type to
8353 Output_section::Input_section.
8354 (Output_section_element_input::set_section_addresses): Adjust code
8355 to use Output_section::Input_section instead of
8356 Output_section::Simple_input_section. Adjust code for renaming
8357 of Output_section::add_simple_input_section.
8358 (Orphan_output_section::set_section_addresses): Ditto.
8359
e1e82ea4
RW
83602010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8361
8362 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8363 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8364
91e75c8a
RÁE
83652010-05-18 Rafael Espindola <espindola@google.com>
8366
8367 * options.cc (General_options::finalize): Handle -nostdlib.
8368 * options.h (nostdlib): New option.
8369 * script.cc (script_add_search_dir): Handle -nostdlib.
8370
da59ad79
DK
83712010-05-12 Doug Kwan <dougkwan@google.com>
8372
8373 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8374 attributes section only if there no attributes section after merging.
8375 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8376 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8377 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8378 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8379 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8380 and arm_attr_merge_7.stdout.
8381 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8382 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8383 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8384 arm_attr_merge_7b.o): New rules.
8385 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8386 arm_attr_merge_7
8387 * testsuite/Makefile.in: Regenerate.
8388 * testsuite/arm_attr_merge.sh: New file.
8389 * testsuite/arm_attr_merge_[67][ab].s: Same.
8390
3e01a7fd
NC
83912010-05-05 Nick Clifton <nickc@redhat.com>
8392
8393 * po/es.po: Updated Spanish translation.
8394
7ad2014a
L
83952010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8396
8397 * Makefile.am (install-exec-local): Properly install gold as
8398 default cross linker.
8399 * Makefile.in: Regenerated.
8400
4fda8867
NC
84012010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8402 Nick Clifton <nickc@redhat.com>
8403
8404 * configure.ac (install_as_default): Define and set to false
8405 unless --enable-gold or --enable-gold=both/gold has been
8406 specified.
8407 * configure: Regenerate.
8408
8409 * Makefile.am (install-exec-local): Install the executable as
8410 'ld.gold'. If install_as_default is true then also install it as
8411 'ld'.
8412 * Makefile.in: Regenerated.
8413
bd288ea2
ILT
84142010-04-24 Ian Lance Taylor <iant@google.com>
8415
8416 * layout.cc (Layout::layout_reloc): In relocatable link don't
8417 combine reloc sections for grouped sections.
8418
ef38fd8a
ST
84192010-04-23 Sriraman Tallam <tmsriram@google.com>
8420
8421 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8422 sections that are not ordinary to icf.
8423 * icf.cc (get_section_contents): Handle relocation pointing to section
8424 with no object or shndx information.
8425 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8426 * testsuite/Makefile.in: Regenerate.
8427 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8428 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8429
f6973bdc
ILT
84302010-04-22 Ian Lance Taylor <iant@google.com>
8431
8432 * expression.cc (Expression::Expression_eval_info): Add
8433 result_alignment_pointer field.
8434 (Expression::eval_with_dot): Add result_alignment_pointer
8435 parameter. Change all callers.
8436 (Expression::eval_maybe_dot): Likewise.
8437 (class Binary_expression): Add alignment_pointer parameter to
8438 left_value and right_value. Change all callers.
8439 (BINARY_EXPRESSION): Set result alignment.
8440 (class Trinary_expression): Add alignment_pointer parameter to
8441 arg2_value and arg3_value. Change all callers.
8442 (Trinary_cond::value): Set result alignment.
8443 (Max_expression::value, Min_expression::value): Likewise.
8444 (Align_expression::value): Likewise.
8445 * script-sections.cc (class Sections_element): Add dot_alignment
8446 parameter to set_section_addresses virtual function. Update
8447 instantiations.
8448 (class Output_section_element): Likewise.
8449 (Script_sections::create_segments): Add dot_alignment parameter.
8450 Change all callers.
8451 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8452 (Script_sections::set_phdrs_clause_addresses): Likewise.
8453 * script-sections.h: Update declarations.
8454 * script.h: Update declarations.
8455 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8456 min_p_align.
8457 * testsuite/script_test_3.t: Set large alignment.
8458 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8459 segment has expected alignment.
8460
9c9c98a5
NC
84612010-04-22 Nick Clifton <nickc@redhat.com>
8462
8463 * po/gold.pot: Updated by the Translation project.
8464 * po/vi.po: Updated Vietnamese translation.
8465
2253bfba
L
84662010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8467
8468 * testsuite/Makefile.am (check_PROGRAMS): Add
8469 icf_virtual_function_folding_test.
8470 * testsuite/Makefile.in: Regenerated.
8471
85fdf906
AH
84722010-04-15 Andrew Haley <aph@redhat.com>
8473
8474 * options.h (merge_exidx_entries): New option.
8475 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8476 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8477 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8478 (Target_arm::merge_exidx_entries): New function.
8479 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8480 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8481 to Arm_exidx_fixup constructor.
8482 Add new arg, merge_exidx_entries.
8483 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8484 Arm_output_section::fix_exidx_coverage.
8485
ce97fa81
ST
84862010-04-18 Sriraman Tallam <tmsriram@google.com>
8487
8488 * icf.cc (get_section_contents): Check for preemptible functions.
8489 Ignore addend when appropriate.
8490 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8491 section folded.
8492 (add_from_relobj): Check for section folded.
8493 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8494 * symtab.h (should_add_dynsym_entry): Add new parameter.
8495 * target-reloc.h (scan_relocs): Check for section folded.
8496 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8497 Check reloc types for function pointers in shared objects.
8498 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8499 case.
8500 (icf_preemptible_functions_test): New test case.
8501 (icf_string_merge_test): New test case.
8502 * testsuite.Makefile.in: Regenerate.
8503 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8504 bar_glob. Refactor code.
8505 * testsuite/icf_preemptible_functions_test.cc: New file.
8506 * testsuite/icf_preemptible_functions_test.sh: New file.
8507 * testsuite/icf_string_merge_test.cc: New file.
8508 * testsuite/icf_string_merge_test.sh: New file.
8509 * testsuite/icf_virtual_function_folding_test.cc: New file.
8510 * testsuite/icf_virtual_function_folding_test.sh: New file.
8511
04ceb17c
DK
85122010-04-14 Doug Kwan <dougkwan@google.com>
8513
8514 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8515 for local symbol recounting if we remove a section due to ICF.
8516 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8517 there are no regular objects in input.
8518
153e7da4
DK
85192010-04-13 Doug Kwan <dougkwan@google.com>
8520
8521 * arm.cc (Arm_input_section::set_final_data_size): Compute
8522 accurate final data size instead of using current data size.
8523
4dbd9faf
DK
85242010-04-09 Doug Kwan <dougkwan@google.com>
8525
8526 * layout.cc (Layout::choose_output_section): Handle script section
8527 types.
8528 (Layout::make_output_section_for_script): Add section type parameter.
8529 Handle script section types.
8530 * layout.h (Layout::make_output_section_for_script): Add section
8531 type parameter.
8532 * output.cc (Output_section::Output_section): Initialize data member
8533 is_noload_.
8534 (Output_section::do_reset_address_and_file_offset): Do not set address
8535 to 0 if section is a NOLOAD section.
8536 * output.h (Output_section::is_noload): New method.
8537 (Output_section::set_is_noload): Ditto.
8538 (Output_section::is_noload_): New data member.
8539 * script-c.h (Script_section_type): New enum type.
8540 (struct Parser_output_section_header): Add new file section_type.
8541 * script-sections.cc (Sections_element::output_section_name): Add
8542 parameter for returning script section type.
8543 (Output_section_definition::output_section_name): Ditto.
8544 (Output_section_definition::section_type)P; New method.
8545 (Output_section_definiton::script_section_type_name): Ditto.
8546 (Output_section_definition::script_section_type_): New data member.
8547 (Output_section_definition::Output_section_definition): Initialize
8548 data member Output_section_definition::script_section_type_.
8549 (Output_section_definition::create_sections): Pass script section type
8550 to Layout::make_output_section_for_script.
8551 (Output_section_definition::output_section_name): Return script
8552 section type to caller.
8553 (Output_section_definition::set_section_address): Do not advance
8554 dot value and load address if section type is NOLOAD. Set address
8555 of NOLOAD sections regardless of section flags.
8556 (Output_section_definition::print): Print section type if it is
8557 not SCRIPT_SECTION_TYPE_NONE.
8558 (Output_section_definition::section_type): New method.
8559 (Output_section_definition::script_section_type_name): Ditto.
8560 (Script_sections::output_section_name): Add new parameter
8561 PSECTION_TYPE for returning script section type. Pass it to
8562 section elements. Handle discard sections.
8563 (Sort_output_sections::operator()): Handle NOLOAD sections.
8564 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8565 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8566 returning script section type.
8567 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8568 INFO and NOLOAD.
8569 * yyscript.y (union): Add new field SECTION_TYPE.
8570 (COPY, DSECT, INFO, NOLOAD): New tokens.
8571 (opt_address_and_section_type): Change type to output_section_header.
8572 (section_type): New non-terminal
8573 (section_header): Handle section type.
2253bfba 8574 (opt_address_and_section_type): Return section type value.
4dbd9faf 8575
721ea635
L
85762010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8577
8578 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8579 * testsuite/plugin_common_test_2.c (foo): Likewise.
8580
6bf924b0
DK
85812010-04-08 Doug Kwan <dougkwan@google.com>
8582
8583 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8584 Output_merge_data.
8585 * output.cc (Output_section::add_merge_input_section): Simplify
8586 code and return status of Output_merge_base::add_input_section.
e1df38aa 8587 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8588 returns true.
8589
24af6f92
DK
85902010-04-07 Doug Kwan <dougkwan@google.com>
8591
8592 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8593 if section is marked as containing instructions but has no mapping
8594 symbols.
8595 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8596 correct section index.
8597 (Arm_relobj::find_linked_text_section): Ditto.
8598
00698fc5
CC
85992010-04-07 Cary Coutant <ccoutant@google.com>
8600
8601 * archive.cc (include_member): Destroy Read_symbols_data object before
8602 releasing file.
8603 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8604 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8605 (Read_symbols_data::~Read_symbols_data) New destructor.
8606 (Section_relocs::Section_relocs) New constructor.
8607 (Section_relocs::~Section_relocs) New destructor.
8608 (Read_relocs_data::Read_relocs_data) New constructor.
8609 (Read_relocs_data::~Read_relocs_data) New destructor.
8610 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8611 pointers to NULL after deleting.
8612
7296d933
DK
86132010-04-07 Doug Kwan <dougkwan@google.com>
8614
8615 * arm.cc: Replace "endianity" with "endianness" in comments.
8616 (Arm_exidx_cantunwind): Ditto.
8617 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8618 (Arm_relobj::merge_flags_and_attributes): New method.
8619 (Arm_relobj::merge_flags_and_attributes_): New data member.
8620 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8621 (Arm_relobj::scan_sections_for_stubs): Ditto.
8622 (Arm_relobj::do_read_symbols): Check to see if we really want to
8623 merge processor-specific flags and attributes. Exit early if
8624 an object is empty except for section names and the undefined symbol.
8625 (Target_arm::do_finalize_sections): Move check for ELF format to
8626 Arm_relobj::do_read_symbols. Merge processor specific flags and
8627 attributes from a regular object only when we have determined that
8628 it is aapropriate. Do not create an .ARM.attributes section in
8629 output if there is no regular input object.
8630 (Target_arm::merge_processor_specific_flags): Check
8631 --warn-mismatch before printing any error.
8632 (Target_arm::merge_object_attributes): Ditto.
8633 * gold.cc (queue_middle_tasks): Handle the case in which there is
8634 no regular object in input.
8635 * options.cc (General_options::parse_EB): New method.
8636 (General_options::parse_EL): Same.
8637 (General_options::General_options): Initialize endianness_.
8638 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8639 New options.
8640 (General_options::Endianness): New enum.
8641 (General_options::endianness): New method.
8642 (General_options::endianness_): New data member.
8643 * parameters.cc (Parameters::set_options): Check target endianness.
8644 (Parameters::set_target_once): Ditto.
8645 (Parameters::check_target_endianness): New method.
8646 (parameters_force_valid_target): If either -EL or -EB is specified,
8647 use it to define endianness of default target.
8648 * parameters.h (Parameters::check_target_endianness): New method
8649 declaration.
8650 * target.h (class Target): Change "endianity" to "endianness"
8651 in comments.
8652
efc8d4f2
RW
86532010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8654
8655 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8656 * configure: Regenerate.
8657 * Makefile.in: Regenerate.
8658 * testsuite/Makefile.in: Regenerate.
8659
be234d88
CC
86602010-04-06 Cary Coutant <ccoutant@google.com>
8661
8662 gcc PR lto/42757
8663 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8664 prevailing definitions of common symbols.
8665 * testsuite/plugin_test_6.sh: New test case.
8666 * testsuite/plugin_common_test_1.c: New test case.
8667 * testsuite/plugin_common_test_2.c: New test case.
8668 * testsuite/Makefile.am (plugin_test_6): New test case.
8669 * testsuite/Makefile.in: Regenerate.
8670
bd32c6bd
NC
86712010-04-06 Nick Clifton <nickc@redhat.com>
8672
8673 * po/vi.po: New Vietnamese translation.
8674
323c532f
DK
86752010-03-30 Doug Kwan <dougkwan@google.com>
8676
8677 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8678
4fcd97eb
DK
86792010-03-25 Doug Kwan <dougkwan@google.com>
8680
8681 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8682 to avoid a conversion warning on a 32-bit host.
8683
4ebf39db
ILT
86842010-03-24 Ian Lance Taylor <iant@google.com>
8685
8686 * testsuite/script_test_3.t: Add a TLS segment.
8687 * testsuite/Makefile.am (check_PROGRAMS): Add
8688 tls_phdrs_script_test.
8689 (tls_phdrs_script_test_SOURCES): Define.
8690 (tls_phdrs_script_test_DEPENDENCIES): Define.
8691 (tls_phdrs_script_test_LDFLAGS): Define.
8692 (tls_phdrs_script_test_LDADD): Define.
8693 * testsuite/Makefile.in: Rebuild.
8694
4a599bdd
CC
86952010-03-23 Cary Coutant <ccoutant@google.com>
8696
8697 * fileread.cc (find_or_make_view): Fix comment.
8698
6c93b22c
ILT
86992010-03-23 Ian Lance Taylor <iant@google.com>
8700
8701 * script-sections.cc (class Orphan_section_placement): Define
8702 PLACE_TLS and PLACE_TLS_BSS.
8703 (Orphan_section_placement::Orphan_section_placement): Initialize
8704 new places.
8705 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8706 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8707 (tls_script_test_SOURCES): Define.
8708 (tls_script_test_DEPENDENCIES): Define.
8709 (tls_script_test_LDFLAGS): Define.
8710 (tls_script_test_LDADD): Define.
8711 * testsuite/Makefile.in: Rebuild.
8712
a2c7281b
DK
87132010-03-22 Doug Kwan <dougkwan@google.com>
8714
8715 * arm.cc (Arm_relocate_functions::abs8,
8716 Arm_relocate_functions::abs16): Use correct check for overflow
8717 specified in the ARM ELF specs.
8718 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8719 target of a BLX instruction specially.
8720 (Reloc_stub::stub_type_for_reloc): Ditto.
8721 (Relocate::relocate): Use symbolic names instead of numeric relocation
8722 codes to report error.
8723 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8724 workaround.
8725 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8726 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8727 thumb2_blx_out_of_range.stdout
8728 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8729 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8730 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8731 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8732 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8733 thumb2_blx_in_range, thumb2_blx_in_range.o,
8734 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8735 thumb2_blx_out_of_range.o): New rules.
2e702c99 8736 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
8737 thumb2_blx_in_range and thumb2_blx_out_of_range.
8738 * testsuite/Makefile.in: Regenerate.
8739 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8740 * testsuite/thumb_blx_in_range.s: New file.
8741 * testsuite/thumb_blx_out_of_range.s: New file.
8742
b0193076
RÁE
87432010-03-22 Rafael Espindola <espindola@google.com>
8744
8745 * archive.cc (Should_include): Move to archive.h.
8746 (should_include_member): Make it a member of Archive.
8747 (Lib_group): New.
8748 (Add_lib_group_symbols): New.
8749 * archive.h: Include options.h.
8750 (Archive_member): Moved from Archive.
8751 (Should_include): Moved from archive.cc.
8752 (Lib_group): New.
8753 (Add_lib_group_symbols): New.
8754 * dynobj.cc (do_should_include_member): New.
8755 * dynobj.h (do_should_include_member): New.
8756 * gold.cc (queue_initial_tasks): Update call to queue.
8757 * main.cc (main): Print lib group stats.
8758 * object.cc (do_should_include_member): New.
8759 * object.h: Include archive.h.
8760 (Object::should_include_member): New.
8761 (Object::do_should_include_member): New.
8762 (Sized_relobj::do_should_include_member): New.
8763 * options.cc (General_options::parse_start_lib): New.
8764 (General_options::parse_end_lib): New.
8765 (Input_arguments::add_file): Handle lib groups.
8766 (Input_arguments::start_group): Check we are not in a lib.
8767 (Input_arguments::start_lib): New.
8768 (Input_arguments::end_lib): New.
8769 * options.h (General_options): Add start_lib and end_lib.
8770 (Input_argument::lib_): New.
8771 (Input_argument::lib): New.
8772 (Input_argument::is_lib): New.
8773 (Input_file_lib): New.
8774 (Input_arguments::in_lib_): New.
8775 (Input_arguments::in_lib): New.
8776 (Input_arguments::start_lib): New.
8777 (Input_arguments::end_lib_): New.
8778 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8779 in unused members as preempted.
8780 (Sized_pluginobj::do_should_include_member): New.
8781 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8782 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8783 return the blocker.
8784 (Read_symbols::do_whole_lib_group): New.
8785 (Read_symbols::do_lib_group): New.
8786 (Read_symbols::do_read_symbols): Handle lib groups.
8787 (Read_symbols::get_name): Handle lib groups.
8788 * readsyms.h (Read_symbols): Add an archive member pointer.
8789 (Read_symbols::do_whole_lib_group): New.
8790 (Read_symbols::do_lib_group): New.
8791 (Read_symbols::member_): New.
8792 * script.cc (read_input_script): Update call to queue_soon.
8793
d099120c
DK
87942010-03-19 Doug Kwan <dougkwan@google.com>
8795
8796 * arm.cc (Stub_table::Stub_table): Initialize new data members
8797 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8798 (Stub_table::add_reloc_stub): Assign stub offset and update
8799 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8800 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
8801 New data members.
2e702c99 8802 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
8803 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
8804 instead of going over all reloc stubs.
2e702c99 8805 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
8806 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8807 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 8808 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
8809 Stringpool_template::offset_.
8810 * stringpool.h (Stringpool_template::set_no_zero_null): Set
8811 Stringpool_template::offset_ to zero.
8812
1aa37384
DK
88132010-03-15 Doug Kwan <dougkwan@google.com>
8814
8815 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8816 offset_.
8817 (Stringpool_template::new_key_offset): New method.
8818 (Stringpool_template::add_string): Assign offsets when adding new
8819 strings.
8820 (Stringpool_template::set_string_offsets): Do not set string offsets
8821 when not optimizing.
8822 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
8823 member size_.
2e702c99
RM
8824 (Chunked_vector::clear): Clear size_.
8825 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
8826 (Chunked_vector::size): Return size_.
8827 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 8828 (Chunked_vector::size_): New data member.
1aa37384
DK
8829 (Stringpool_template::set_no_zero_null): Assert string set is empty.
8830 (Stringpool_template::new_key_offset): New method declaration.
8831 (Stringpool_template::offset_): New data member.
8832
b672b057
RÁE
88332010-03-15 Rafael Espindola <espindola@google.com>
8834
8835 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
8836 Add_symbols' constructor.
8837 * readsyms.h (Add_symbols): Remove the input_group member.
8838
b6848d3c
ILT
88392010-03-10 Ian Lance Taylor <iant@google.com>
8840
8841 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
8842 target to ask whether a reference to a symbol requires a stack
8843 split.
8844 * target.h (Target::is_call_to_non_split): New function.
8845 (Target::do_is_call_to_non_split): Declare virtual function.
8846 * target.cc: Include "symtab.h".
8847 (Target::do_is_call_to_non_split): New function.
8848 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
8849
a2a5469e
CC
88502010-03-10 Cary Coutant <ccoutant@google.com>
8851
8852 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
8853 (File_read::open[1]): Remove initial mapping of whole_file_view_.
8854 (File_read::open[2]): Add whole_file_view_ to list of views.
8855 (File_read::make_view): Remove test of whole_file_view_.
8856 (File_read::find_or_make_view): Create whole_file_view_ if
8857 necessary.
8858 (File_read::clear_views): Replace bool parameter with enum;
8859 adjust all callers. Don't delete views with permanent data;
8860 do delete cached views and views from archives if
8861 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
8862 if clearing the corresponding view.
8863 * fileread.h (File_read::Clear_views_mode): New enum.
8864 (File_read::View::is_permanent_view): New method.
8865 (File_read::clear_views): Replace bool parameter
8866 with enum; adjust all callers.
8867 * options.h (General_options): Change keep_files_mapped option;
8868 add map_whole_files.
8869 * readsyms.cc (Add_symbols::run): Delete sd_ object before
8870 releasing the file.
8871 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
8872 the file.
8873
8861f32b
DM
88742010-03-10 David S. Miller <davem@davemloft.net>
8875
8876 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
8877
d62d0f5f
ST
88782010-03-09 Sriraman Tallam <tmsriram@google.com>
8879
8880 * icf.cc (get_section_contents): Add '@' marker after processing the
8881 merge reloc.
8882
9177756d
DK
88832010-03-08 Doug Kwan <dougkwan@google.com>
8884
8885 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
8886 due to a conversion warning.
8887 (Arm_relobj::update_output_local_symbol_count): Check for local
8888 symbol with unset output index.
8889
9e9e071b
ILT
88902010-03-05 Ian Lance Taylor <iant@google.com>
8891
8892 * options.h (class General_options): Add --spare-dynamic-tags.
8893 * output.cc (Output_data_dynamic::set_final_data_size): Implement
8894 --spare-dynamic-tags.
8895
a81ee015
ILT
88962010-03-05 Ian Lance Taylor <iant@google.com>
8897
8898 * incremental.cc: Include "libiberty.h".
8899
44ec90b9
RO
89002010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
8901
8902 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
8903 function, is_info_ member.
8904 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
8905 (Versions::Versions): Update caller.
8906 (Versions::define_base_version): Likewise.
8907 (Versions::add_def): Likewise.
8908
0897ed3b
ST
89092010-03-03 Sriraman Tallam <tmsriram@google.com>
8910
8911 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
8912 (Scan::possible_function_pointer_reloc): New function.
8913 (Scan::local_reloc_may_be_function_pointer): Change to call
8914 possible_function_pointer_reloc.
8915 (Scan::global_reloc_may_be_function_pointer): Ditto.
8916 * icf.h (Icf::check_section_for_function_pointers): Change to reject
8917 relocations in ".data.rel.ro._ZTV" section.
8918 * testsuite/icf_safe_so_test.sh: Change to pass i386.
8919 * testsuite/icf_safe_so_test.cc: Ditto.
8920 * testsuite/icf_safe_test.cc: Ditto.
8921 * testsuite/icf_safe_test.sh: Ditto.
8922
d3bbad62
ILT
89232010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8924 Ian Lance Taylor <iant@google.com>
8925
8926 * target-reloc.h (relocate_section): Check the symbol table index
8927 for -1U before setting the local symbol index.
8928 (scan_relocatable_relocs): If copying the relocation, record that
8929 the local symbol is required.
8930 * object.h (Symbol_value::is_output_symtab_index_set): New
8931 function.
8932 (Symbol_value::may_be_discarded_from_output_symtab): New
8933 function.
8934 (Symbol_value::has_output_symtab_entry): New function.
8935 (Symbol_value::needs_output_symtab_entry): Remove.
8936 (Symbol_value::output_symtab_index): Make sure the symbol index is
8937 set.
8938 (Symbol_value::set_output_symtab_index): Make sure the symbol
8939 index is not set. Make sure the new index is valid.
8940 (Symbol_value::set_must_have_output_symtab_entry): New function.
8941 (Symbol_value::has_output_dynsym_entry): New function.
8942 (Symbol_value::set_output_dynsym_index): Make sure the new index
8943 is valid.
8944 (Sized_relobj::set_must_have_output_symtab_entry): New function.
8945 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
8946 local symbol if permitted.
8947 (Sized_relobj::do_finalize_local_symbols): Call
8948 is_output_symtab_index_set rather than needs_output_symtab_entry.
8949 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
8950 rather than needs_output_symtab_entry. Call
8951 has_output_dynsym_entry rather than needs_output_dynsym_entry.
8952 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
8953 is_output_symtab_index_set rather than needs_output_symtab_entry.
8954 * testsuite/discard_locals_relocatable_test.c: New file.
8955 * testsuite/discard_locals_test.sh: Test -r.
8956 * testsuite/Makefile.am (check_DATA): Add
8957 discard_locals_relocatable_test1.syms,
8958 discard_local_relocatable_test2.syms.
8959 (MOSTLYCLEANFILES): Likewise. Also add
8960 discard_locals_relocatable_test1.lout and
8961 discard_locals_relocatable_test2.out.
8962 (discard_locals_relocatable_test1.syms): New target.
8963 (discard_locals_relocatable_test.o): New target.
8964 (discard_locals_relocatable_test1.out): New target.
8965 (discard_locals_relocatable_test2.syms): New target.
8966 (discard_locals_relocatable_test2.out): New target.
8967 (various): Add missing ../ld-new dependencies.
8968 * testsuite/Makefile.in: Rebuild.
8969
7e8ccf26
NC
89702010-03-03 Nick Clifton <nickc@redhat.com>
8971
8972 * po/fi.po: New Finnish translation.
8973
2a0ff005
DK
89742010-03-01 Doug Kwan <dougkwan@google.com>
8975
8976 * layout.cc (Layout::Layout): Force section types of .init_array*,
8977 .preinit_array* and .fini_array* sections.
8978 * output.cc (Output_section::Input_section_sort_entry::has_priority):
8979 Fix check of return value of std::string::find.().
8980 (Output_section::Input_section_sort_compare::operator()): Remove
8981 comment about .init_array.
8982 (Output_section::Input_section_sort_init_fini_compare::operator()):
8983 New method.
8984 (Output_section::sort_attached_input_sections): Handle .init_array
8985 and .fini_array specially.
8986 * output.h (Output_section::Inut_section_sort_compare): Update
8987 comment.
8988 (Output_section::Input_section_sort_init_fini_compare): New struct.
8989
c3e4ae29
DK
89902010-02-26 Doug Kwan <dougkwan@google.com>
8991
8992 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
8993 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
8994 * testsuite/debug_msg.sh: Avoid matching source line number for
8995 use of global variable undef_int.
8996
2fd9ae7a
DK
89972010-02-26 Doug Kwan <dougkwan@google.com>
8998
8999 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9000 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9001 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9002 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9003 * options.cc (General_options::General_options): Initialize member
9004 fix_v4bx_.
9005 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9006 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9007 and rm_no_fix_v4bx.stdout
9008 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9009 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9010 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9011 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9012 and arm_no_fix_v4bx.
9013 * Makefile.in: Regenerate.
9014 * testsuite/arm_fix_v4bx.s: New file.
9015 * testsuite/arm_fix_v4bx.sh: Ditto.
9016
67ec7d0b
DK
90172010-02-24 Doug Kwan <dougkwan@google.com>
9018
9019 * arm.cc (Target_arm::got_section): Make the .got section the first
9020 non RELRO section in the data segment.
9021 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9022 suffixes of section names.
9023
10165461
DK
90242010-02-24 Doug Kwan <dougkwan@google.com>
9025
9026 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9027 flags and attributes merging if an input file is a binary file.
9028 * fileread.cc (Input_file::open): Record format of original file.
9029 * fileread.h (Input_file::Format): New enum type.
2e702c99 9030 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9031 (Input_file::format): New method definition.
9032 (Input_file::format_):: New data member.
9033
4a54abbb
DK
90342010-02-24 Doug Kwan <dougkwan@google.com>
9035
9036 * arm.cc (Arm_output_data_got): New class.
9037 (ARM_TCB_SIZE): New constant
9038 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9039 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9040 If user uses a script with a SECTIONS clause, issue only a warning
9041 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9042 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9043 garbage collection.
9044 (Target_arm::got_mode_index_entry): Handle static linking.
9045 (Target_arm::Scan::local): Ditto.
9046 (Target_arm::Scan::global): Ditto.
9047 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9048 all incorrectly implemented relocations.
e1df38aa 9049 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9050 Arm_output_section::fix_exidx_coverage.
9051 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9052 from ".ARM.exidx." and ".ARM.extab.".
9053
ca419a6f
ILT
90542010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9055
9056 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9057 section if it does not already exist.
9058 * attributes.cc (Attributes_section_data::Attributes_section_data):
9059 Don't crash if size is zero.
9060
135b9c78
ILT
90612010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9062 Ian Lance Taylor <iant@google.com>
9063
9064 * gold.cc (queue_middle_tasks): If no input files were opened,
9065 exit.
9066 * workqueue.h (Task_function::Task_function): Assert that there is
9067 a blocker.
9068
bb0bfe4f
DK
90692010-02-22 Doug Kwan <dougkwan@google.com>
9070
9071 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9072 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9073 types to avoid warnings due to different uint64_t implementations
9074 on different hosts.
9075
2a2b6d42
DK
90762010-02-21 Doug Kwan <dougkwan@google.com>
9077
9078 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9079 handling of the maximum backward branch offset.
2e702c99 9080 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9081 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9082 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9083 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9084 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9085 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9086 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9087 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9088 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9089 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9090 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9091 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9092 thumb2_bl_out_of_range.o): New rules.
9093 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9094 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9095 thumb2_bl_out_of_range
9096 * testsuite/Makefile.in: Regenerate.
9097 * testsuite/arm_bl_in_range.s: New file.
9098 * testsuite/arm_bl_out_of_range.s: Ditto.
9099 * testsuite/arm_branch_in_range.sh: Ditto.
9100 * testsuite/arm_branch_range.t: Ditto.
9101 * testsuite/thumb2_branch_range.t: Ditto.
9102 * testsuite/thumb_bl_in_range.s: Ditto.
9103 * testsuite/thumb_bl_out_of_range.s: Ditto.
9104 * testsuite/thumb_branch_range.t: Ditto.
9105
b487ad64
ST
91062010-02-20 Sriraman Tallam <tmsriram@google.com>
9107
9108 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9109 Add reloc offset information.
9110 * icf.cc (get_section_contents): Change iterators to point to the new
9111 vectors. Add reloc offset information to the contents.
9112 * icf.h (Icf::Sections_reachable_info): New typedef.
9113 (Icf::Sections_reachable_list): New typedef.
9114 (Icf::Offset_info): New typedef.
9115 (Icf::Reloc_info): New struct typedef.
9116 (Icf::Reloc_info_list): New typedef.
9117 (Icf::symbol_reloc_list): Delete method.
9118 (Icf::addend_reloc_list): Delete method.
9119 (Icf::section_reloc_list): Delete method.
9120 (Icf::reloc_info_list): New method.
9121 (Icf::reloc_info_list_): New member.
9122
f96accdf
DK
91232010-02-19 Doug Kwan <dougkwan@google.com>
9124
9125 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9126 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9127 * arm.cc (Arm_relocation_functions): New forward declaration.
9128 (Target_arm::Target_arm): Initialize new data members
9129 got_mod_index_offset_ and tls_base_symbol_defined_.
9130 (Target_arm::Relocate::relocate_tls): New method.
9131 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9132 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9133 New methods.
2e702c99 9134 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9135 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9136 (Target_arm::got_mod_index_offset_,
9137 Target_arm::tls_base_symbol_defined_): New data members.
9138 (Target_arm::Scan::local, Target::Scan::global,
9139 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9140 relocations.
9141
c8761b9a
DK
91422010-02-18 Doug Kwan <dougkwan@google.com>
9143
9144 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9145 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9146 text section as a parameter becuase some broken tools may not set
9147 the link in section header.
9148 (Target_arm::has_got_section): New method.
9149 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9150 without any mapping symbol as data only. Remove warning.
9151 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9152 link in its section header, try to discover the link by inspecting the
9153 REL31 relocation at the beginning of the section.
9154 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9155 in error message.
9156 (Target_arm::Scan::global): Treat any reference to the symbol
9157 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9158
21bb3914
ST
91592010-02-12 Sriraman Tallam <tmsriram@google.com>
9160
9161 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9162 (Scan::global_reloc_may_be_function_pointer): New function.
9163 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9164 (Scan::global_reloc_may_be_function_pointer): New function.
9165 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9166 (Scan::global_reloc_may_be_function_pointer): New function.
9167 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9168 (Scan::global_reloc_may_be_function_pointer): New function.
9169 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9170 (Scan::global_reloc_may_be_function_pointer): New function.
9171 (Scan::possible_function_pointer_reloc): New function.
9172 (Target_x86_64::can_check_for_function_pointers): New function.
9173 * gc.h (gc_process_relocs): Scan relocation types to determine if
9174 function pointers were taken for targets that support it.
9175 * icf.cc (Icf::find_identical_sections): Include functions for
9176 folding in safe ICF whose pointer is not taken.
9177 * icf.h (Secn_fptr_taken_set): New typedef.
9178 (fptr_section_id_): New member.
9179 (section_has_function_pointers): New function.
9180 (set_section_has_function_pointers): New function.
9181 (check_section_for_function_pointers): New function.
9182 * options.h: Fix comment for safe ICF option.
9183 * target.h (can_check_for_function_pointers): New function.
9184 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9185 Modify icf_safe_test for X86-64.
9186 * testsuite/Makefile.in: Regenerate.
9187 * testsuite/icf_safe_so_test.cc: New file.
9188 * testsuite/icf_safe_so_test.sh: New file.
9189 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9190 (main): Change to take pointer to function kept_func_3.
9191 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9192 folding is done correctly for X86-64.
9193
0da6fa6c
DM
91942010-02-12 David S. Miller <davem@davemloft.net>
9195
9196 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9197 is_symbolless parameter.
9198 (Output_reloc<SHT_REL>::is_symbolless): New.
9199 (Output_reloc<SHT_REL>::is_symbolless_): New.
9200 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9201 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9202 (Output_reloc<SHT_RELA>::is_symbolless): New.
9203 (Output_data_reloc::add_global): Handle is_symbolless.
9204 (Output_data_reloc::add_global_relative): Likewise.
9205 (Output_data_reloc::add_local): Likewise.
9206 (Output_data_reloc::add_local_relative): Likewise.
9207 (Output_data_reloc::add_symbolless_global_addend): New.
9208 (Output_data_reloc::add_symbolless_local_addend): New.
9209 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9210 is_symbolless.
9211 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9212 instead of ->is_relative_
9213 (Output_reloc::write): Likewise.
9214 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9215 (Output_reloc::write_rel): Simplify.
9216
9217 * sparc.cc (Target_sparc::Scan::local): Use
9218 ->add_symbolless_local_addend as needed.
9219 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9220 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9221 based upon relocation offset.
9222
e4782e83
DK
92232010-02-11 Doug Kwan <dougkwan@google.com>
9224
9225 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9226 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9227 beginning of function.
9228 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9229 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9230 parameter is_32bit in calls to should_apply_static_reloc.
9231 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9232 (check_DATA): Add arm_abs_global.stdout.
9233 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9234 arm_abs_global.stdout): New rules.
9235 (MOSTLLYCLEANFILES): Add arm_abs_global
9236 * Makefile.in: Regenerate.
9237 * testsuite/arm_abs_global.s: New file.
9238 * testsuite/arm_abs_global.sh: Ditto.
9239 * testsuite/arm_abs_lib.s: Ditto.
9240
93ceb764
ILT
92412010-02-11 Ian Lance Taylor <iant@google.com>
9242
9243 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9244 Read_relocs task.
9245 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9246 Allocate_commons_task first.
9247 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9248 task, rather than symtab_lock_.
9249 (Gc_process_relocs::~Gc_process_relocs): New function.
9250 (Gc_process_relocs::is_runnable): Check this_blocker_.
9251 (Gc_process_relocs::locks): Use next_blocker_ rather than
9252 blocker_.
9253 (Scan_relocs::~Scan_relocs): New function.
9254 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9255 symtab_lock_.
9256 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9257 next_blocker_.
9258 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9259 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9260 constructor accordingly.
9261 (class Gc_process_relocs): Likewise.
9262 (class Scan_relocs): Likewise.
9263 * common.h (class Allocate_commons_task): Remove symtab_lock_
9264 field, and corresponding constructor parameter.
9265 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9266 symtab_lock_.
9267 (Allocate_commons_task::locks): Likewise.
9268
114dfbe1
ILT
92692010-02-11 Ian Lance Taylor <iant@google.com>
9270
9271 * gold-threads.h (class Once): Define.
9272 (class Initialize_lock): Rewrite as child of Once.
9273 * gold-threads.cc (class Once_initialize): Define.
9274 (once_pointer_control): New static variable.
9275 (once_pointer, once_arg): New static variables.
9276 (c_run_once): New static function.
9277 (Once::Once, Once::run_once, Once::internal_run): New functions.
9278 (class Initialize_lock_once): Remove.
9279 (initialize_lock_control): Remove.
9280 (initialize_lock_pointer): Remove.
9281 (initialize_lock_once): Remove.
9282 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9283 (Initialize_lock::initialize): Rewrite.
9284 (Initialize_lock::do_run_once): New function.
9285 * archive.cc (Archive::interpret_header): Only clear name if it is
9286 not already empty.
9287 * fileread.cc: Include "gold-threads.h"
9288 (file_counts_lock): New static variable.
9289 (file_counts_initialize_lock): Likewise.
9290 (File_read::release): Only increment counts when using --stats.
9291 Use a lock around the increment.
9292 * parameters.cc (class Set_parameters_target_once): Define.
9293 (set_parameters_target_once): New static variable.
9294 (Parameters::Parameters): Move here from parameters.h.
9295 (Parameters::set_target): Rewrite.
9296 (Parameters::set_target_once): New function.
9297 (Parameters::clear_target): Move here and rewrite.
9298 * parameters.h (class Parameters): Update declarations. Add
9299 set_parameters_target_once_ field.
9300 (Parameters::Parameters): Move to parameters.cc.
9301 (Parameters::clear_target): Likewise.
9302 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9303 task.
9304 (Start_group::~Start_group): New function.
9305 (Start_group::is_runnable): New function.
9306 (Start_group::locks, Start_group::run): New functions.
9307 (Finish_group::run): Change saw_undefined to size_t.
9308 * readsyms.h (class Start_group): Define.
9309 (class Finish_group): Change saw_undefined_ field to size_t.
9310 (Finish_group::Finish_group): Remove saw_undefined and
9311 this_blocker parameters. Change all callers.
9312 (Finish_group::set_saw_undefined): New function.
9313 (Finish_group::set_blocker): New function.
9314 * symtab.h (class Symbol_table): Change saw_undefined to return
9315 size_t. Change saw_undefined_ field to size_t.
9316 * target-select.cc (Set_target_once::do_run_once): New function.
9317 (Target_selector::Target_selector): Initialize set_target_once_
9318 field. Don't initialize lock_ and initialize_lock_ fields.
9319 (Target_selector::instantiate_target): Rewrite.
9320 (Target_selector::set_target): New function.
9321 * target-select.h (class Set_target_once): Define.
9322 (class Target_selector): Update declarations. Make
9323 Set_target_once a friend. Remove lock_ and initialize_lock_
9324 fields. Add set_target_once_ field.
9325
fa17a3f4
ILT
93262010-02-10 Ian Lance Taylor <iant@google.com>
9327
9328 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9329 queueing any tasks.
9330 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9331 (queue_middle_tasks): Add all blockers before queueing any tasks.
9332 (queue_final_tasks): Likewise.
9333 * token.h (Task_token::add_blockers): New function.
9334 * object.h (Input_objects::number_of_relobjs): New function.
9335
c7177d31
ILT
93362010-02-10 Ian Lance Taylor <iant@google.com>
9337
5de0e392
ILT
9338 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9339 shared, not if not position independent.
9340 * x86_64.cc (Relocate::relocate_tls): Likewise.
9341 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9342 (tls_pie_pic_test): New target.
9343 * testsuite/Makefile.in: Rebuild.
9344
c7177d31
ILT
9345 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9346 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9347 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9348 * testsuite/Makefile.in: Rebuild.
9349
684b268a
DM
93502010-02-09 David S. Miller <davem@davemloft.net>
9351
9352 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9353 R_SPARC_RELATIVE using ->add_local_relative().
9354 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9355
612a8d3d
DM
9356 * output.h (Output_data_dynamic::add_section_size): New method
9357 that takes two Output_data objects.
9358 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9359 entry param. Handle it in initializers.
9360 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9361 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9362 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9363 arg.
9364 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9365 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9366 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9367 for dynrel_includes_plt.
9368 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9369 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9370 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9371 before .rela.plt
9372 (Target_sparc::do_finalize_sections): Update to pass true for
9373 dynrel_includes_plt.
9374 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9375 output before .rela.plt
9376 (Target_powerpc::do_finalize_sections): Update to pass true for
9377 dynrel_includes_plt when 32-bit.
9378
cb1be87e
DK
93792010-02-08 Doug Kwan <dougkwan@google.com>
9380
9381 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9382 method.
9383 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9384 Arm_relobj::scan_section_for_cortex_a8_stubs,
9385 Arm_relobj::do_relocation_section): Instead of calling
9386 Output_section::output_address, use faster
9387 Arm_relobj::simple_input_section_output_address.
9388
705b5121
DM
93892010-02-08 David S. Miller <davem@davemloft.net>
9390
9391 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9392 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9393 relocation helper function.
9394
024c4466
DM
9395 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9396 just like R_SPARC_GOT{10,13,22}.
9397 (Target_sparc::Scan::local): Likewise.
9398 (Target_sparc::Relocate:relocate): Likewise.
9399
9109c078
ILT
94002010-02-06 Ian Lance Taylor <iant@google.com>
9401
9402 * configure.ac: Rewrite targetobjs duplicate removal code to use
9403 only shell constructs.
9404 * configure: Rebuild.
9405
cf846138
DK
94062010-02-05 Doug Kwan <dougkwan@google.com>
9407
9408 PR 11247
9409 * arm.cc (Arm_relobj::section_is_scannable): New method.
9410 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9411 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9412
6cfaf60b
DK
94132010-02-04 Doug Kwan <dougkwan@google.com>
9414
9415 PR 11247
9416 * arm-reloc-property.cc (cstdio): Include.
9417 * configure.ac (targetobjs): Remove duplicates.
9418 * configure: Regenerate.
9419 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9420 big and little endian version for a given address size.
9421
5c57f1be
DK
94222010-02-03 Doug Kwan <dougkwan@google.com>
9423
9424 * arm-reloc-property.cc
9425 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9426 definition.
9427 * arm-reloc-property.h
9428 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9429 New method definition.
9430 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9431 declaration.
9432 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9433 overflow to N.
9434 (GOT_PREL): Change implemented to Y.
9435 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9436 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9437 (Arm_relocate_functions::movw_abs_nc): Remove method.
9438 (Arm_relocate_functions::movt_abs): Ditto.
9439 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9440 (Arm_relocate_functions::thm_movt_abs): Ditto.
9441 (Arm_relocate_functions::movw_rel_nc): Ditto.
9442 (Arm_relocate_functions::movw_rel): Ditto.
9443 (Arm_relocate_functions::movt_rel): Ditto.
9444 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9445 (Arm_relocate_functions:thm_movw_rel): Ditto.
9446 (Arm_relocate_functions:thm_movt_rel): Ditto.
9447 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9448 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9449 New method definitions.
9450 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9451 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9452 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9453 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9454 (Target_arm::Relocate::relocate): Check for non-static or
9455 unimplemented relocation code and exit early. Change calls to
9456 Target_arm::reloc_uses_thumb_bit and
9457 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9458 instead. Refactor code to handle similar relocations to increase
9459 code sharing. Remove check for unsupported relocation code in switch
9460 statement.
9461 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9462 relocation property table to find out size. Change error message to
9463 print out the name of a relocation code instead of the numeric value.
9464 (Target_arm::scan_reloc_for_stub): Use relocation property table
9465 instead of calling Target_arm::reloc_uses_thumb_bit().
9466
218c5831
DK
94672010-02-02 Doug Kwan <dougkwan@google.com>
9468
9469 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9470 types of relaxed input section.
9471
0d31c79d
DK
94722010-02-02 Doug Kwan <dougkwan@google.com>
9473
9474 * Makefile.am (HFILES): Add arm-reloc-property.h.
9475 (DEFFILES): New.
2e702c99
RM
9476 (TARGETSOURCES): Add arm-reloc-property.cc
9477 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9478 (libgold_a_SOURCES): $(DEFFILES)
9479 * Makefile.in: Regenerate.
9480 * arm-reloc-property.cc: New file.
9481 * arm-reloc-property.h: New file.
9482 * arm-reloc.def: New file.
9483 * arm.cc: Update comments.
9484 (arm-reloc-property.h): New included header.
9485 (arm_reloc_property_table): New global variable.
9486 (Target_arm::do_select_as_default_target): New method definition.
9487 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9488 arm-reloc-property to targ_extra_obj.
9489 * parameters.cc (set_parameters_target): Call
9490 Target::select_as_default_target().
9491 * target.h (Target::select_as_default_target): New method definition.
9492 (Target::do_select_as_default_target): Same.
9493
546c7457
DK
94942010-02-01 Doug Kwan <dougkwan@google.com>
9495
9496 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9497 first_output_text_section_.
9498 (Arm_exidx_fixup::first_output_text_section): New method definition.
9499 (Arm_exidx_fixup::first_output_text_section_): New data member.
9500 (Arm_exidx_fixup::process_exidx_section): Record the first text
9501 output section seen.
9502 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9503 and entsize in output section header.
9504
11b861d5
DK
95052010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9506
9507 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9508 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9509 (Arm_relocate_functions::thm_alu11): New Method.
9510 (Arm_relocate_functions::thm_pc8): New Method.
9511 (Arm_relocate_functions::thm_pc12): New Method.
9512 (Target_arm::Scan::local): Handle the relocations.
9513 (Target_arm::Scan::global): Likewise.
9514 (Target_arm::Relocate::relocate): Likewise.
9515 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9516
c9a2c125
DK
95172010-01-29 Doug Kwan <dougkwan@google.com>
9518
9519 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9520 of relocation types as ld.
9521
1521477a
DK
95222010-01-29 Doug Kwan <dougkwan@google.com>
9523
9524 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9525 to public.
9526 (Arm_relocate_functions::thumb_branch_common): Ditto.
9527 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9528 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9529 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9530 Arm_relocate_functions::jump24): Remove.
9531 (Target_arm::Relocate::relocate): Adjust code to call
9532 Arm_relocation_functions::arm_branch_common and
9533 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9534 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9535
e7eca48c
DK
95362010-01-29 Doug Kwan <dougkwan@google.com>
9537
9538 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9539 output_local_symbol_count_needs_update_.
9540 (Arm_relobj::output_local_symbol_count_needs_update,
9541 Arm_relobj::set_output_local_symbol_count_needs_update,
9542 Arm_relobj::update_output_local_symbol_count): New methods.
9543 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9544 member.
9545 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9546 of pointed function as in a R_ARM_PREL31 relocation.
9547 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9548 for output local symbol count updating.
9549 (Target_arm::do_relax): Update output local symbol counts in objects
9550 if necessary.
9551 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9552
02961d7e
ILT
95532010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9554
9555 * arm.cc: Added support for the ARM relocations:
9556 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9557 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9558 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9559 movw_prel_nc).
9560 (Arm_relocate_functions::movw_rel): New method.
9561 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9562 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9563 thm_movw_prel_nc).
9564 (Arm_relocate_functions::thm_movw_rel): New method.
9565 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9566 thm_movt_prel).
9567 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9568 relocations.
9569 (Target_arm::Scan::global): Likewise.
9570 (Target_arm::Relocate::relocate): Likewise.
9571 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9572 Likewise.
9573
b10d2873
ILT
95742010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9575
9576 * arm.cc: Added support for ARM group relocations.
9577 (Target_arm::reloc_needs_sym_origin): New method.
9578 (Arm_relocate_functions::calc_grp_kn): New method.
9579 (Arm_relocate_functions::calc_grp_residual): New method.
9580 (Arm_relocate_functions::calc_grp_gn): New method.
9581 (Arm_relocate_functions::arm_grp_alu): New Method.
9582 (Arm_relocate_functions::arm_grp_ldr): New Method.
9583 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9584 (Arm_relocate_functions::arm_grp_ldc): New Method.
9585 (Target_arm::Scan::local): Handle the ARM group relocations.
9586 (Target_arm::Scan::global): Likewise.
9587 (Target_arm::Relocate::relocate): Likewise.
9588 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9589 Likewise.
9590
2b328d4e
DK
95912010-01-26 Doug Kwan <dougkwan@google.com>
9592
9593 * arm.cc (set): Include.
9594 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9595 pointer type.
2e702c99 9596 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9597 (Arm_output_section::append_text_sections_to_list): New method.
9598 (Arm_output_section::fix_exidx_coverage): Ditto.
9599 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9600 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9601 Relobj::set_section_offset() instead of
9602 Sized_relobj::invalidate_section_offset().
2e702c99 9603 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9604 parameter for section headers. Ignore relocation sections for
9605 unallocated sections and EXIDX sections.
9606 (Target_arm::fix_exidx_coverage): New method.
9607 (Target_arm::output_section_address_less_than): New type.
9608 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9609 linked text section instead of the EXIDX section.
9610 (Arm_output_section::create_stub_group): Add an assertion to check
9611 that this is not an EXIDX output section.
9612 (Arm_output_section::append_text_sections_to_list): New method.
9613 (Arm_output_section::fix_exidx_coverage): Ditto.
9614 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9615 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9616 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9617 first pass.
9618 (Target_arm::fix_exidx_coverage): New method.
9619 * object.h (Relobj::set_output_section): New method.
9620 (Sized_relobj::invalidate_section_offset): Remove method.
9621 (Sized_relobj::do_invalidate_section_offset): Remove method.
9622 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9623
c7f3c371
DK
96242010-01-25 Doug Kwan <dougkwan@google.com>
9625
9626 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9627 Fix warning due to signed and unsigned comparison on a 32-bit host.
9628
8923b24c
DK
96292010-01-22 Doug Kwan <dougkwan@google.com>
9630
9631 * arm.cc (Target_arm::do_relax): Record an output section for section
9632 offset adjustment it contains any stub table that has changed.
9633 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9634 offsets in an output section if necessary.
9635 * output.cc (Output_section::Output_section): Initialize
9636 section_offsets_need_adjustments_.
9637 (Output_section::add_input_section_for_script): Renamed to
9638 Output_section::add_simple_input_section.
9639 (Output_section::save_states): Add a comment.
9640 (Output_section::discard_states): New method defintion.
9641 (Output_section::adjust_section_offsets): Same.
9642 * output.h (Output_section::add_input_section_for_script): Renamed to
9643 Output_section::add_simple_input_section.
9644 (Output_section::discard_states): New method declaration.
9645 (Output_section::adjust_section_offsets): Same.
9646 (Output_section::section_offsets_need_adjustment,
9647 Output_section::set_section_offsets_need_adjustment): New method
9648 definitions.
9649 (Output_section::section_offsets_need_adjustment_): New data member.
9650 * script-sections.cc
9651 (Output_section_element_input::set_section_address): Adjust code for
9652 renaming of Output_section::add_input_section_for_script.
9653 (Orphan_output_section::set_section_address): Same.
9654
9b2fd367
DK
96552010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9656
9657 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9658 Fix_v4bx enum values .
9659 * gold/options.h (General_options): New option definitions.
9660 (General_options::fix_v4bx): New method.
9661 (General_options::Fix_v4bx): New enum.
9662 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9663 (General_options::parse_fix_v4bx_interworking): New method.
9664
80d0d023
DK
96652010-01-22 Doug Kwan <dougkwan@google.com>
9666
9667 * arm.cc (Arm_exidx_fixup): New class.
9668
af2cdeae
DK
96692010-01-21 Doug Kwan <dougkwan@google.com>
9670
9671 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9672 classes.
9673 (Arm_exidx_section_offset_map): New type.
9674
993d07c1
DK
96752010-01-21 Doug Kwan <dougkwan@google.com>
9676
9677 * arm.cc (Arm_exidx_input_section): New class.
9678 (Arm_relobj::exidx_input_section_by_link,
9679 Arm_relobj::exidx_input_section_by_shndx,
9680 Arm_relobj::make_exidx_input_section): New methods.
9681 (read_arm_attributes_section): Remove.
9682 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9683 information about them.
9684 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9685 to here.
9686
5ac169d4
DK
96872010-01-20 Doug Kwan <dougkwan@google.com>
9688
9689 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9690 Input_section_specifier to Section_id.
9691 (Target_arm::new_arm_input_section: Adjust code for change of key
9692 type.
9693 (Target_arm::find_arm_input_section): Ditto.
9694 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9695 (Section_id): Remove.
9696 (Garbage_collection::Section_id_hash): Remove.
9697 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9698 (Section_id): Remove.
9699 (Icf::Section_id_hash): Remove.
9700 * object.h (Section_id, Const_section_id, Section_id_hash,
9701 Const_section_id_hash): New type definitions.
9702 * output.cc (Output_section::add_relaxed_input_section): Change to
9703 use Const_section_id instead of Input_section_specifier as key type.
9704 (Output_section::add_merge_input_section): Ditto.
9705 (Output_section::build_relaxation_map): Change to use Section_id
9706 instead of Input_section_specifier as key type.
2e702c99 9707 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
9708 Ditto.
9709 (Output_section::convert_input_sections_to_relaxed_sections): Change
9710 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 9711 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
9712 (Output_section::find_relaxed_input_section): Ditto.
9713 * output.h (Input_section_specifier): Remove class.
9714 (Output_section::Output_section_data_by_input_section_map): Change
9715 key type to Const_section_id.
9716 (Output_section::Output_relaxed_input_section_by_input_section_map):
9717 Ditto.
9718 (Output_section::Relaxation_map): Change key type to Section_id.
9719
a2162063
ILT
97202010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9721
9722 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9723 (class Arm_v4bx_stub): New class.
9724 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9725 (Stub_factory::make_arm_v4bx_stub): New method.
9726 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9727 (Stub_table::empty): Handle v4bx stubs.
9728 (Stub_table::add_arm_v4bx_stub): New method.
9729 (Stub_table::find_arm_v4bx_stub): New method.
9730 (Arm_relocate_functions::v4bx): New method.
9731 (Target_arm::fix_v4bx): New method.
9732 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9733 (Stub_table::relocate_stubs): Likewise.
9734 (Stub_table::do_write): Likewise.
9735 (Stub_table::update_data_size_and_addralign): Likewise.
9736 (Stub_table::finalize_stubs): Likewise.
9737 (Target_arm::Scan::local): Likewise.
9738 (Target_arm::Scan::global): Likewise.
9739 (Target_arm::do_finalize_sections): Likewise.
9740 (Target_arm::Relocate::relocate): Likewise.
9741 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9742 Likewise.
9743 (Target_arm::scan_reloc_for_stub): Likewise.
9744 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9745
5696ab0b
ILT
97462010-01-19 Ian Lance Taylor <iant@google.com>
9747
9748 * output.cc (Output_section_headers::do_sized_write): Write large
9749 segment count to sh_info field.
9750 (Output_file_header::do_sized_write): For large segment count,
9751 write PN_XNUM to e_phnum field.
9752
800d0f56
ILT
97532010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9754
9755 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9756 (Arm_relocate_functions::thm_jump8): New function.
9757 (Arm_relocate_functions::thm_jump11): New function.
9758 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9759 R_ARM_THM_JUMP11.
9760 (Target_arm::Scan::global): Likewise.
9761 (Target_arm::Relocate::relocate): Likewise.
9762 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9763 Likewise.
9764
41263c05
DK
97652010-01-14 Doug Kwan <dougkwan@google.com>
9766
9767 * arm.cc (map, utility): Include headers.
9768 (Target_arm::apply_cortex_a8_workaround): New method.
9769 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9770 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9771 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9772 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9773 the --[no-]fix-cortex-a8 command line options.
9774 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9775 (Target_arm::relocate_stub): Use addend in instruction template.
9776 * options.h (DEFINE_bool): Set the user-set flag.
9777 (General_options): Add --[no-]-fix-cortex options.
9778 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 9779 : Update fast look-up map after conversion.
41263c05 9780
459e9b03
ST
97812010-01-14 Sriraman Tallam <tmsriram@google.com>
9782
9783 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9784 in the first pass of do_layout.
9785
b521dfe4
DK
97862010-01-13 Doug Kwan <dougkwan@google.com>
9787
9788 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9789 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9790 apparent compiler problem of not folding static constant integral
9791 data members of elfcpp::Elf_sizes<32>.
9792
44272192
DK
97932010-01-13 Doug Kwan <dougkwan@google.com>
9794
9795 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9796 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9797 Arm_relobj::scan_section_for_cortex_a8_erratum,
9798 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
9799 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
9800 sections to scan for relocation stubs into a new method
9801 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
9802 relocation and Cortex-A8 stub scanning.
9803 (Target_arm::do_relax): Force stubs to be after stubbed sections
9804 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 9805 the beginning of a new relaxation pass. Update a comment.
44272192
DK
9806 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
9807
44b71ece
ILT
98082010-01-12 Ian Lance Taylor <iant@google.com>
9809
9810 * target-reloc.h (visibility_error): New inline function.
9811 (relocate_section): Call visibility_error.
9812 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
9813 (MOSTLYCLEANFILES): Likewise.
9814 (protected_4_pic.o, protected_3.err): New targets.
9815 * testsuite/protected_4.cc: New file.
9816
a120bc7f
DK
98172010-01-12 Doug Kwan <dougkwan@google.com>
9818
9819 * arm.cc (Cortex_a8_reloc): New class.
9820 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
9821 and cortex_a8_relocs_info_.
9822 (Target_arm::fix_cortex_a8): New method definition.
9823 (Target_arm::Cortex_a8_relocs_info): New type.
9824 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
9825 New data member declarations.
9826 (Target_arm::scan_reloc_for_stub): Record information about
9827 relocations for THUMB branches that might be exempted from the
9828 Cortex-A8 workaround.
9829 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
9830 at the beginning of a relaxation pass.
9831
20138696
DK
98322010-01-12 Doug Kwan <dougkwan@google.com>
9833
9834 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
9835 (Arm_relobj::Mapping_symbol_position,
9836 Arm_reloj::Mapping_symbol_position_less,
9837 Arm_relobj::Mapping_symbols_info): New types.
9838 (Target_arm::is_mapping_symbol_name): New method definition.
9839 (Arm_relobj::do_count_local_symbols): Save information about mapping
9840 symbols.
9841
089d69dc
DK
98422010-01-11 Doug Kwan <dougkwan@google.com>
9843
9844 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
9845 Arm_relocate_functions::thumb32_branch_upper,
9846 Arm_relocate_functions::thumb32_branch_lower,
9847 Arm_relocate_functions::thumb32_cond_branch_offset,
9848 Arm_relocate_functions::thumb32_cond_branch_upper,
9849 Arm_relocate_functions::thumb32_cond_branch_lower,
9850 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
9851 branch offset encoding.
9852 (Arm_relocate_functions::thumb_branch_common): Use new branch
9853 offset encoding methods to avoid code duplication.
9854 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
9855 (Stub_addend_reader::operator()): Use new branch encoding method
9856 to avoid code duplication.
9857
99e5bff2
DK
98582010-01-11 Doug Kwan <dougkwan@google.com>
9859
9860 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
9861 (Target_arm::do_finalize_sections): Define special EXIDX section
9862 symbols only if referenced.
9863 * gc.h (Garbage_collection::add_reference): New method.
9864 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
9865 code duplication.
9866
98e090bd
ILT
98672010-01-11 Ian Lance Taylor <iant@google.com>
9868
d0a91bd8
ILT
9869 * script.cc (Version_script_info::build_expression_list_lookup):
9870 Change complaing about duplicate wildcard match from error to
9871 warning.
9872
98e090bd
ILT
9873 * script.cc (class Lazy_demangler): Recreate--revert part of patch
9874 of 2009-12-30.
9875 (Version_script_info::Version_script_info): Initialize globs_,
9876 default_version_, default_is_global_, and exact_. Don't
9877 initialize globals_ or locals_.
9878 (Version_script_info::build_lookup_tables): Build local symbols
9879 first.
9880 (Version_script_info::unquote): New function.
9881 (Version_script_info::add_exact_match): New function.
9882 (Version_script_info::build_expression_list_lookup): Remove lookup
9883 parameter. Add is_global parameter. Change all callers. Handle
9884 wildcard pattern specially. Unquote pattern. Call
9885 add_exact_match.
9886 (Version_script_info::get_name_to_match): New function.
9887 (Version_script_info::get_symbol_version): New function.
9888 (Version_script_info::get_symbol_version_helper): Remove.
9889 (Version_script_info::check_unmatched_names): Call unquote.
9890 * script.h (class Version_script_info): Change get_symbol_version
9891 to be non-inline and add is_global parameter; change all callers.
9892 Rewrite symbol_is_local. Update declarations. Define struct
9893 Version_tree_match, Exact, Globs. Don't define struct Lookup.
9894 Remove globals_ and locals_ members. Add exact_, globs_,
9895 default_version_, is_global_.
9896 (Version_script_info::Glob): Remove pattern, add expression and
9897 is_global. Update constructor. Change all callers.
9898 * dynobj.cc (Versions::finalize): Mark the version symbol as the
9899 default version.
9900 (Versions::symbol_section_contents): If a symbol is undefined, or
9901 defined in a dynamic object, set the version index to
9902 VER_NDX_LOCAL.
9903 * symtab.cc (Symbol_table::add_from_relobj): Don't call
9904 symbol_is_local.
9905 (Symbol_table::add_from_pluginobj): Likewise.
9906 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
9907
d56962d3
DK
99082010-01-11 Doug Kwan <dougkwan@google.com>
9909
9910 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
9911 (incremental_dump_LDADD): Add linking option for libintl.
9912 * Makefile.in: Regenerate.
9913
94e6ee91
L
99142010-01-11 H.J. Lu <hongjiu.lu@intel.com>
9915
9916 PR gold/11144
9917 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
9918 instead of -Ds.
9919 * testsuite/Makefile.in: Regenerated.
9920
e96c574b
DK
99212010-01-10 Doug Kwan <dougkwan@google.com>
9922
9923 * options.h (DEFINE_var): Use parentheses around argument varname__
9924 in macro body to avoid any unintended subsequent substitutions.
9925
7198066b
ILT
99262010-01-10 Ian Lance Taylor <iant@google.com>
9927
ba4d53bf
ILT
9928 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
9929 candidates before doing symbol resolution.
9930
7198066b
ILT
9931 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
9932 ODR candidates if only one is weak.
9933
a2beed37
ILT
99342010-01-08 Ian Lance Taylor <iant@google.com>
9935
9936 * script.cc (Version_script_info::build_expression_list_lookup):
9937 Don't warn about ambiguous version, just record the ambiguity.
9938 (Version_script_info::get_symbol_version_helper): Give error if
9939 version is ambiguous.
9940
2fb7225c
DK
99412010-01-08 Doug Kwan <dougkwan@google.com>
9942
9943 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
9944 prev_data_size_ and prev_addralign_. Remove initializer for
9945 deleted data member has_been_changed_.
9946 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
9947 to determine if the table is empty.
9948 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
9949 Remove.
9950 (Stub_table::add_reloc_stub): Define method in class definition
9951 instead of just declaring it there.
9952 (Stub_table::add_cortex_a8_stub): New method definition.
9953 (Stub_table::update_data_size_and_addralign): Ditto.
9954 (Stub_table::finalize_stubs): Ditto.
9955 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
9956 (Stub_table::do_addralign_): Return address alignment in the
9957 (Stub_table::do_reset_address_and_file_offset): Define method in
9958 class definition instead of declaring it there. Set current data
9959 size to be the data size of the previous pass.
9960 (Stub_table::set_final_data_size): Use current data size as the
9961 final data size.
9962 (Stub_table::relocate_stub): Change parameter type of stub from
9963 Reloc_stub pointer to Stub pointer.
9964 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
9965 (Stub_table::Cortex_a8_stub_list): New typedef.
9966 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
9967 Stub_table::prev_addralign_): New data member.
9968 (Arm_relobj::Arm_relobj): Initialize data member
9969 section_has_cortex_a8_workaround_.
9970 (Arm_relobj::section_has_cortex_a8_workaround,
9971 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
9972 definitions.
9973 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
9974 declarations.
9975 (Target_arm::relocate_stub): Change parameter type of stub from
9976 Reloc_stub pointer to Stub pointer.
9977 (Insn_template::size, Insn_template::alignment): Handle
9978 THUMB16_SPECIAL_TYPE.
9979 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
9980 Stub_table::update_data_size_and_addralign,
9981 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
9982 definitions.
9983 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
9984 (Stub_table::do_write): Ditto.
9985 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 9986
880cd20d
ILT
99872010-01-08 Ian Lance Taylor <iant@google.com>
9988
9989 PR 11108
9990 * symtab.h (class Symbol): Remove fields is_target_special_ and
9991 has_plt_offset_. Add field is_defined_in_discarded_section_.
9992 (Symbol::is_defined_in_discarded_section): New function.
9993 (Symbol::set_is_defined_in_discarded_section): New function.
9994 (Symbol::has_plt_offset): Rewrite.
9995 (Symbol::set_plt_offset): Verify that new offset is not -1U.
9996 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
9997 Don't initialize is_target_special_ or has_plt_offset_.
9998 Initialize is_defined_in_discarded_section_.
9999 (Symbol_table::add_from_relobj): If appropriate, set
10000 is_defined_in_discarded_section.
10001 * resolve.cc (Symbol::override_base_with_special): Don't test
10002 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10003 * target-reloc.h (relocate_section): Do special handling for
10004 symbols defined in discarded sections for global symbols as well
10005 as local symbols.
10006
2703e3eb
ILT
100072010-01-08 Ian Lance Taylor <iant@google.com>
10008
10009 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10010 the SHT_SYMTAB case.
10011
339d40a3
ILT
100122010-01-08 Ian Lance Taylor <iant@google.com>
10013
10014 * object.cc (Sized_relobj::do_layout): Don't get confused if
10015 layout_eh_frame returns NULL.
10016
abecea76
ILT
100172010-01-08 Ian Lance Taylor <iant@google.com>
10018
10019 PR 11084
10020 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10021 dynamic symbol table, use the normal symbol table.
10022 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10023 symbol table.
10024
6b7dd3f3
ILT
100252010-01-08 Ian Lance Taylor <iant@google.com>
10026
10027 PR 11072
10028 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10029 sections.
10030
36c50e63
L
100312010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10032
10033 * version.cc (print_version): Change to "Copyright 2010".
10034
e291e7b9
ILT
100352010-01-08 Ian Lance Taylor <iant@google.com>
10036
10037 PR 10287
10038 PR 11063
10039 * i386.cc (class Target_i386): Change return type of plt_section
10040 to be non-const.
10041 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10042 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10043 tls_desc_rel_ field.
10044 (Output_data_plt_i386::rel_tls_desc): New function.
10045 (Target_i386::rel_tls_desc_section): New function.
10046 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10047 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10048 R_386_TLS_DESC reloc in rel_tls_desc_section.
10049 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10050 Define struct Tlsdesc_info.
10051 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10052 (Target_x86_64::do_reloc_symbol_index): New function.
10053 (Target_x86_64::add_tlsdesc_info): New function.
10054 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10055 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10056 tlsdesc_rel_ field.
10057 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10058 all callers.
10059 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10060 (Target_x86_64::rela_tlsdesc_section): New function.
10061 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10062 handling.
10063 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10064 (Target_x86_64::do_reloc_addend): New function.
10065 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10066 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10067 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10068 (Output_reloc::type): New function.
10069 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10070 (Output_reloc::is_target_specific): New function.
10071 (Output_reloc::target_arg): New function.
10072 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10073 absolute relocs and target specific relocs.
10074 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10075 add_target_specific.
10076 (class Output_data_reloc) [SHT_RELA]: Likewise.
10077 * output.cc (Output_reloc::Output_reloc): Add four new versions
10078 for absolute relocs and target specific relocs.
10079 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10080 (Output_reloc::get_symbol_index): Likewise.
10081 (Output_reloc::local_section_offset): Check that local_sym_index_
10082 is not TARGET_CODE or 0.
10083 (Output_reloc::symbol_value): Likewise.
10084 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10085 reloc.
10086 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10087 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10088 functions.
10089 * layout.cc (add_target_dynamic_tags): Use output section for
10090 DT_PLTRELSZ and DT_JMPREL.
10091
3a44184e
ILT
100922010-01-07 Ian Lance Taylor <iant@google.com>
10093
10094 PR 11061
10095 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10096 function.
10097 (class Output_data_reloc_generic): Define.
10098 (class Output_data_reloc_base): Change base class to
10099 Output_data_reloc_generic. Change add() method to call
10100 bump_relative_reloc_count for a relative reloc. Remove
10101 sort_relocs_ field.
10102 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10103 to sort_relocs().
10104 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10105 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10106 appropriate.
10107 * layout.h (class Layout): Update declaration.
10108
ea715a34
ILT
101092010-01-07 Ian Lance Taylor <iant@google.com>
10110
10111 * output.h (class Output_data): Add const version of
10112 output_section and do_output_section.
10113 (class Output_section_data): Add const version of
10114 do_output_section.
10115 (class Output_section): Likewise.
10116 * layout.cc (Layout::add_target_dynamic_tags): New function.
10117 * layout.h (class Layout): Update declarations.
10118 * arm.cc (Target_arm::do_finalize_sections): Use
10119 add_target_dynamic_tags.
10120 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10121 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10122 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10123 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10124
659948a4
ILT
101252010-01-07 Ian Lance Taylor <iant@google.com>
10126
10127 PR 11042
10128 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10129 object as needed.
10130
9d3b86f6
ILT
101312010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10132 Ian Lance Taylor <iant@google.com>
10133
10134 PR 11019
10135 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10136 Xindex::read_symtab_xindex.
10137
bb0d3eb0
DK
101382010-01-07 Doug Kwan <dougkwan@google.com>
10139
10140 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10141 (Insn_template::thumb16_bcond_insn): New method declaration.
10142 (Insn_template): Fix spelling.
10143 (Stub::thumb16_special): New method declaration.
10144 (Stub::do_write): Define virtual method which was previously pure
10145 virtual.
10146 (Stub::do_thumb16_special): New method declaration.
10147 (Stub::do_fixed_endian_write): New template member.
10148 (Reloc_stub::do_write): Remove.
10149 (Reloc_stub::do_fixed_endian_write): Remove.
10150 (Cortex_a8_stub): New class definition.
10151 (Stub_factory::make_cortex_a8_stub): New method definition.
10152 (Stub_factory::Stub_factory): Add missing static storage class
10153 qualifier for elf32_arm_stub_a8_veneer_blx.
10154
ffeef7df
ILT
101552010-01-07 Ian Lance Taylor <iant@google.com>
10156
dc3f80fe
ILT
10157 PR 10980
10158 * options.h (class General_options): Add --warn-unresolved-symbols
10159 and --error-unresolved-symbols.
10160 * errors.cc (Errors::undefined_symbol): Implement
10161 --warn-unresolved-symbols.
10162
ffeef7df
ILT
10163 * options.h (class General_options): Add -z text and -z textoff.
10164 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10165
f1ec9ded
ST
101662010-01-06 Sriraman Tallam <tmsriram@google.com>
10167
10168 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10169 (Garbage_collection::cident_sections): New function.
10170 (Garbage_collection::add_cident_section): New function.
10171 (Garbage_collection::cident_sections_): New member.
10172 (gc_process_relocs): Add references to sections whose names are C
10173 identifiers.
10174 * gold.h (cident_section_start_prefix): New constant.
10175 (cident_section_stop_prefix): New constant.
10176 (is_cident): New function.
10177 * layout.cc (Layout::define_section_symbols): Replace string constants
10178 with the newly defined constants.
10179 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10180 C identifiers.
10181 * testsuite/Makefile.am: Add gc_orphan_section_test.
10182 * testsuite/Makefile.in: Regenerate.
10183 * testsuite/gc_orphan_section_test.cc: New file.
10184 * testsuite/gc_orphan_section_test.sh: New file.
10185
6eda8c29
ILT
101862010-01-06 Ian Lance Taylor <iant@google.com>
10187
b9674e17
ILT
10188 PR 10980
10189 * options.h (class General_options): Add --warn-shared-textrel.
10190 * layout.cc (Layout::finish_dynamic_section): Implement
10191 --warn-shared-textrel.
10192
6eda8c29
ILT
10193 PR 10980
10194 * options.h (class General_options): Add --warn-multiple-gp.
10195
32dcd44e
ILT
101962010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10197
10198 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10199 $(THREADSLIB) and $(LIBDL).
10200 * Makefile.in: Rebuild.
10201
a192ba05
ILT
102022010-01-06 Ian Lance Taylor <iant@google.com>
10203
10204 PR 10980
10205 * options.cc (General_options::parse_section_start): New function.
10206 (General_options::section_start): New function.
10207 (General_options::General_options): Initialize all members.
10208 * options.h: Include <map>
10209 (class General_options): Add --section-start. Add section_starts_
10210 member.
10211 * layout.cc (Layout::attach_allocated_section_to_segment): If
10212 --section-start was used, set the address of the segment. Remove
10213 local sort_sections.
10214 (Layout::relaxation_loop_body): If the address of the load segment
10215 has been set by --section-start, don't use it.
10216 * output.h (Output_segment::update_flags_for_output_section): New
10217 function.
10218 * output.cc (Output_segment::add_output_section): Call
10219 update_flags_for_output_section.
10220
dde3f402
ILT
102212010-01-05 Ian Lance Taylor <iant@google.com>
10222
62dfdd4d
ILT
10223 PR 10980
10224 * options.h (class General_options): Add --undefined-version.
10225 * script.cc (struct Version_expression): Add was_matched_by_symbol
10226 field.
10227 (Version_script_info::matched_symbol): New function.
10228 (Version_script_info::get_symbol_version_helper): Call
10229 matched_symbol.
10230 (Version_script_info::check_unmatched_names): New function.
10231 * script.h (class Version_script_info): Update declarations.
10232 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10233
9c4ae156
ILT
10234 * options.h (class General_options): Use DEFINE_bool_alias for
10235 allow_multiple_definition.
10236 * resolve.cc (Symbol_table::should_override): Don't test
10237 allow_multiple_definition.
10238
dde3f402
ILT
10239 PR 10980
10240 * options.h (class General_options): Add --cref.
10241 * main.cc (main): Print cref table if --cref. Don't close mapfile
10242 until after printing cref table.
10243 * cref.cc: Include "symtab.h".
10244 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10245 (Cref_table_compare::operator()): New function.
10246 (Cref_inputs::gather_cref): New function.
10247 (filecol): New static const.
10248 (Cref_inputs::print_cref): New function.
10249 (Cref::print_cref): New function.
10250 * cref.h: Include <cstdio>.
10251 (class Cref): Update declarations.
10252 * mapfile.h (Mapfile::file): New function.
10253 * object.h (class Object): Define Symbols. Declare virtual
10254 do_get_global_symbols.
10255 (Object::get_global_symbols): New function.
10256 * object.cc (Input_objects::add_object): Pass object to cref_ if
10257 --cref.
10258 (Input_objects::archive_start): Likewise.
10259 (Input_objects::archive_stop): Likewise.
10260 (Input_objects::print_cref): New function.
10261 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10262 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10263 --cref.
10264 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10265 function.
10266 * plugin.h (class Sized_pluginobj): Update declarations.
10267
8781f709
ILT
102682010-01-05 Ian Lance Taylor <iant@google.com>
10269
10270 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10271 to is_default_version. Rename insdef to insdefault.
10272 (Symbol_table::add_from_relobj): Rename def to is_default_version
10273 and local to is_forced_local.
10274 (Symbol_table::add_from_pluginobj): Likewise.
10275 (Symbol_table::add_from_dynobj): Likewise.
10276 (Symbol_table::define_special_symbol): Rename insdef to
10277 insdefault.
10278
fe35d28d
ILT
102792010-01-04 Ian Lance Taylor <iant@google.com>
10280
30bc8c46
ILT
10281 PR 10980
10282 * options.h (class General_options): Add
10283 --allow-multiple-definition and -z muldefs.
10284 * resolve.cc (Symbol_table::should_override): Don't warn about a
10285 multiple symbol definition if --allow-multiple-definition or -z
10286 muldefs.
10287
7eaea549
ILT
10288 PR 10980
10289 * options.h (class General_options): Add --add-needed and
10290 --copy-dt-needed-entries. Tweak --as-needed help entry.
10291 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10292 error if --copy-dt-needed-entries aka --add-needed is used and
10293 would cause a change in behaviour.
10294
fe35d28d
ILT
10295 PR 10980
10296 * options.h (class General_options): Add -G as a short version of
10297 --shared. Add no-op options -assert, -g, and -i.
10298
55a2bb35
ST
102992010-01-04 Sriraman Tallam <tmsriram@google.com>
10300
10301 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10302 check for .text or .gnu.linkonce.t sections.
10303 * icf.cc (Icf::find_identical_sections): Ditto.
10304 Change the detection for mangled function name within the section
10305 name.
10306 * icf.h (is_section_foldable_candidate): New function.
10307
719328e1
ILT
103082009-12-30 Ian Lance Taylor <iant@google.com>
10309
10310 PR 10980
10311 * options.h (class General_options): Permit two dashes with
10312 --retain-symbols-file.
10313
d7bb5745
ILT
103142009-12-30 Ian Lance Taylor <iant@google.com>
10315
403a15dd
ILT
10316 PR 10979
10317 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10318 don't put the file header and segment headers in the text
10319 segment.
10320
eda294df
ILT
10321 PR 10979
10322 * common.cc (Sort_commons::operator()): Stabilize sort when both
10323 entries are NULL.
10324 (Symbol_table::do_allocate_commons_list): When allocating common
10325 symbols, skip a symbol which is no longer common.
10326 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10327 an object before checking its type.
10328 * testsuite/common_test_2.c: New file.
10329 * testsuite/common_test_3.c: New file.
10330 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10331 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10332 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10333 (common_test_2_pic.o, common_test_2.so): New targets.
10334 (common_test_3_pic.o, common_test_3.so): New targets.
10335 * testsuite/Makefile.in: Rebuild.
10336
d7bb5745
ILT
10337 PR 10979
10338 * script.cc (read_input_script): If we see a new SECTIONS clause,
10339 and we have added an input section, give an error.
10340 * layout.h (class Layout): Add have_added_input_section function.
10341 Add have_added_input_section_ field.
10342 * layout.cc (Layout::Layout): Initialize
10343 have_added_input_section_.
10344 (Layout::layout): Set have_added_input_section_.
10345 (Layout::layout_eh_frame): Likewise.
10346
fc59c572
ILT
103472009-12-30 Ian Lance Taylor <iant@google.com>
10348
10349 PR 10931
10350 * options.h (class General_options): Add --sort-common option.
10351 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10352 * common.cc (Sort_common): Add sort_order parameter to
10353 constructor. Add sort_order_ field.
10354 (Sort_commons::operator): Check sort_order_.
10355 (Symbol_table::allocate_commons): Determine the sort order.
10356 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10357 Change all callers.
10358 (Symbol_table::do_allocate_commons_list): Likewise.
10359
1c74fab0
ILT
103602009-12-30 Ian Lance Taylor <iant@google.com>
10361
10362 PR 10916
10363 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10364 symbols from this object, don't change the visibility of an
10365 undefined symbol.
10366 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10367
6affe781
ILT
103682009-12-30 Ian Lance Taylor <iant@google.com>
10369
10370 PR 10861
10371 * script.h (class Version_script_info): Define Language enum.
10372 Update declarations. Define Glob, Exact, and Lookup types. Add
10373 new fields globals_, locals_, and is_finalized_.
10374 * script.cc: Various formatting fixes.
10375 (class Parser_closure): Change language_stack_ from a vector of
10376 std::string to one of Version_script_info::Language. Adjust all
10377 uses accordingly.
10378 (class Lazy_demangler): Remove.
10379 (struct Version_expression): Change language from std::string to
10380 Version_script_info::Language.
10381 (Version_script_info::Version_script_info): New function.
10382 (Version_script_info::~Version_script_info): Don't call clear.
10383 (Version_script_info::finalize): New function.
10384 (Version_script_info::build_lookup_tables): New function.
10385 (Version_script_info::build_expression_list_lookup): New
10386 function.
10387 (Version_script_info::get_symbol_version_helper): Rewrite to use
10388 lookup tables.
10389 (Version_script_info::print_expression_list): Adjust to use
10390 Version_script_info::Language.
10391 (script_push_lex_into_version_mode): Check that the version script
10392 has not been finalized.
10393 (version_script_push_lang): Change language string to
10394 Version_script_info::Language.
10395 * options.cc (Command_line::version_script): New function.
10396 * options.h (class General_options): Add finalize_dynamic_list
10397 function. Change version_script from declaration to definition.
10398 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10399 * testsuite/version_script.map: Remove duplicate def of foo.
10400 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10401 version_script.map.
10402 * testsuite/Makefile.in: Rebuild.
10403
818bf354
ILT
104042009-12-30 Ian Lance Taylor <iant@google.com>
10405
10406 PR 10843
10407 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10408 if the input symbol index is 0, make the output symbol index 0.
10409
ebcc8304
ILT
104102009-12-30 Ian Lance Taylor <iant@google.com>
10411
10412 PR 10670
10413 * options.h (class General_options): Add -x/--discard-all.
10414 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10415 --discard-all. If the local symbol needs a dynamic entry, check
10416 that before handling --discard-locals.
10417
176fe33f
ILT
104182009-12-30 Ian Lance Taylor <iant@google.com>
10419
bb321bb1
ILT
10420 PR 10450
10421 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10422 flags to PF_R.
10423 (Output_segment::add_output_section): Don't change the flags if
10424 the type is PT_TLS.
10425
176fe33f
ILT
10426 PR 10450
10427 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10428 GNU hash table if they need a dynamic value. Otherwise, don't add
10429 them if they are defined in a dynamic object or are forced local.
10430
e8cd95c7
ILT
104312009-12-29 Ian Lance Taylor <iant@google.com>
10432
1b81fb71
ILT
10433 PR 10450
10434 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10435 .gnu.hash table for a 32-bit target.
10436
8d6d383d
ILT
10437 PR 10450
10438 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10439 regular and a dynamic object only needs a dynamic symbol table
10440 entry if it is externally visible.
10441
e785ec03
ILT
10442 PR 10450
10443 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10444 constructor. Add global_offset_table_ field.
10445 (Target_i386::got_section): Set global_offset_table_.
10446 (Target_i386::do_finalize_sections): Set global_offset_table_
10447 size.
10448 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10449 in constructor. Add global_offset_table_ field.
10450 (Target_x86_64::got_section): Set global_offset_table_.
10451 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10452 size.
10453
1a2dff53
ILT
10454 * layout.cc (Layout::Layout): Initialize increase_relro_.
10455 (Layout::get_output_section): Add is_relro, is_last_relro, and
10456 is_first_non_relro parameters. Change all callers.
10457 (Layout::choose_output_section): Likewise.
10458 (Layout::add_output_section_data): Likewise.
10459 (Layout::make_output_section): Likewise.
10460 (Layout::set_segment_offsets): Clear increase_relro when using a
10461 linker script.
10462 * layout.h (class Layout): Add increase_relro method. Add
10463 increase_relro_ field. Update declarations.
10464 * output.cc (Output_section::Output_section): Initialize
10465 is_last_relro_ and is_first_non_relro_.
10466 (Output_segment::add_output_section): Group relro sections is
10467 do_sort is true. Handle is_last_relro and is_first_non_relro.
10468 (Output_segment::maximum_alignment): Remove relro handling.
10469 (Output_segment::set_section_addresses): Add increase_relro
10470 parameter. Change all callers. Add initial alignment to align
10471 relro sections on separate page. Remove old relro handling.
10472 (Output_segment::set_section_list_addresses): Remove in_relro
10473 parameter. Change all callers.
10474 (Output_segment::set_offset): Add increase parameter. Change all
10475 callers. Remove old relro handling.
10476 * output.h (class Output_section): Add new methods: is_last_relro,
10477 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10478 Add is_last_relro_ and is_first_non_relro_ fields.
10479 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10480 Create separate .got.plt section. Call increase_relro.
10481 * x86_64.cc (Target_x86_64::got_section): Likewise.
10482 * testsuite/relro_script_test.t: Add .got.plt.
10483
f0ba79e2
ILT
10484 PR 10450
10485 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10486 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10487 (Layout::finalize): Call set_dynamic_symbol_size.
10488 (Layout::set_dynamic_symbol_size): New function.
10489 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10490 set_dynamic_symbol_size.
10491
e8cd95c7
ILT
10492 PR 10450
10493 * output.h (class Output_section): Add is_entsize_zero_ field.
10494 * output.cc (Output_section::Output_section): Initialize
10495 is_entsize_zero_.
10496 (Output_section::set_entsize): If two different entsizes are
10497 requested, force it to zero.
10498 (Output_section::add_input_section): Set flags for .debug_str
10499 before updating section flags. Set entsize.
10500 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10501 and SHF_STRING if all input sections have those flags.
10502
3e1b9a8a
RÁE
105032009-12-29 Rafael Espindola <espindola@google.com>
10504
10505 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10506 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10507 reporting.
3e1b9a8a 10508
3dcad376
ST
105092009-12-29 Sriraman Tallam <tmsriram@google.com>
10510
10511 * options.cc (General_options::parse_version): Allow -v to exit
10512 without an error if there is nothing to link.
10513
084e2665
ILT
105142009-12-29 Ian Lance Taylor <iant@google.com>
10515
10516 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10517 using a version of gcc before 4.1.
10518 * configure: Rebuild.
10519
250acde3
CD
105202009-12-28 Chris Demetriou <cgd@google.com>
10521
10522 * attributes.cc (Output_attributes_section_data::do_write): Use
10523 std::vector::front rather than std::vector::data.
10524
99fff23b
ILT
105252009-12-28 Ian Lance Taylor <iant@google.com>
10526
10527 * symtab.h (class Symbol_table): Add enum Defined.
10528 * resolve.cc (Symbol_table::should_override): Add defined
10529 parameter. Change all callers. Test whether object is NULL
10530 before calling a method on it.
10531 (Symbol_table::report_resolve_problem): Add defined parameter.
10532 Change all callers.
10533 (Symbol_table::should_override_with_special): Likewise.
10534 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10535 parameter. Change all callers.
10536 (Symbol_table::do_define_in_output_data): Likewise.
10537 (Symbol_table::define_in_output_segment): Likewise.
10538 (Symbol_table::do_define_in_output_segment): Likewise.
10539 (Symbol_table::define_as_constant): Likewise.
10540 (Symbol_table::do_define_as_constant): Likewise.
10541 * script.h (class Symbol_assignment): Add is_defsym parameter to
10542 constructor; change all callers.
10543 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10544 parameter. Change all callers. Add is_defsym_ field.
10545 (class Parser_closure): Add parsing_defsym parameter to
10546 constructor; change all callers. Add parsing_defsym accessor
10547 function. Add parsing_defsym_ field.
10548
556bd683
ILT
105492009-12-28 Ian Lance Taylor <iant@google.com>
10550
10551 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10552 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10553
1782c879
ILT
105542009-12-23 Ian Lance Taylor <iant@google.com>
10555
10556 * i386.cc (Target_i386::do_calls_non_split): Recognize
10557 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10558 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10559 -fsplit-stack prologue when using %r11.
1782c879 10560
329ca2b1
ST
105612009-12-21 Sriraman Tallam <tmsriram@google.com>
10562
10563 * options.cc (General_options::parse_version): Make -v continue and do
10564 the link like GNU ld does.
10565
d675ff46
RÁE
105662009-12-17 Rafael Avila de Espindola <espindola@google.com>
10567
10568 * Makefile.am (CCFILES): Add timer.cc.
10569 (HFILES): Add timer.h.
10570 * configure.ac: Check for sysconf and times.
10571 * main.cc: include timer.h.
10572 (main): Use Timer instead of get_run_time.
10573 * timer.cc: New.
10574 * timer.h: New.
10575 * workqueue.cc: include timer.h.
10576 (Workqueue::find_and_run_task):
10577 Report user, sys and wall time.
10578 * Makefile.in: Regenerate.
10579 * config.in: Regenerate.
10580 * configure: Regenerate.
10581
d6344fb5
DK
105822009-12-16 Doug Kwan <dougkwan@google.com>
10583
10584 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10585 sections.
10586 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10587 relaxed input sections.
10588 * output.cc (Output_section::find_relaxed_input_section): Change
10589 return type to Output_relaxed_input_section pointer. Adjust code
10590 for new type of relaxed_input_section_map_.
10591 * output.h (Output_section::find_relaxed_input_section): Change
10592 return type to Output_relaxed_input_section pointer.
10593 (Output_section::Output_relaxed_input_section_by_input_section_map):
10594 New type.
10595 (Output_section::relaxed_input_section_map_): Change type to
10596 Output_section::Output_relaxed_input_section_by_input_section_map.
10597 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10598 input section.
10599
0e0d5469
ILT
106002009-12-15 Ian Lance Taylor <iant@google.com>
10601
10602 * layout.cc (Layout::create_shstrtab): Only write out after input
10603 sections if we are compressing debug sections.
10604
0649a889
ILT
106052009-12-15 Ian Lance Taylor <iant@google.com>
10606
10607 * archive.cc (Archive::add_symbols): Only look up a symbol without
10608 a version if there is, in fact, a version.
10609
2ea97941
ILT
106102009-12-14 Ian Lance Taylor <iant@google.com>
10611
10612 Revert -Wshadow changes, all changes from:
10613 2009-12-11 Doug Kwan <dougkwan@google.com>
10614 2009-12-11 Nick Clifton <nickc@redhat.com>
10615 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10616
b0eec2cc
DK
106172009-12-11 Doug Kwan <dougkwan@google.com>
10618
10619 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10620 due to -Wshadow.
10621 * attributes.cc (Object_attribute::size): Ditto.
10622 (Attributes_section_data::size): Ditto.
10623 (Attributes_section_data::Attributes_section_data): Ditto.
10624 (Output_attributes_section_data::do_write): Ditto.
10625 * attributes.h (Object_attribute::set_type): Ditto.
10626 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10627
91d6fa6a
NC
106282009-12-11 Nick Clifton <nickc@redhat.com>
10629
10630 * archive.cc: Fix shadowed variable warnings.
10631 * arm.cc: Likewise.
10632 * compressed_output.cc: Likewise.
10633 * compressed_output.h: Likewise.
10634 * configure: Likewise.
10635 * dwarf_reader.cc: Likewise.
10636 * dynobj.cc: Likewise.
10637 * dynobj.h: Likewise.
10638 * ehframe.cc: Likewise.
10639 * ehframe.h: Likewise.
10640 * errors.cc: Likewise.
10641 * expression.cc: Likewise.
10642 * fileread.cc: Likewise.
10643 * fileread.h: Likewise.
10644 * freebsd.h: Likewise.
10645 * i386.cc: Likewise.
10646 * icf.cc: Likewise.
10647 * incremental.h: Likewise.
10648 * layout.cc: Likewise.
10649 * layout.h: Likewise.
10650 * mapfile.cc: Likewise.
10651 * merge.cc: Likewise.
10652 * merge.h: Likewise.
10653 * object.cc: Likewise.
10654 * object.h: Likewise.
10655 * options.h: Likewise.
10656 * output.cc: Likewise.
10657 * output.h: Likewise.
10658 * parameters.cc: Likewise.
10659 * plugin.cc: Likewise.
10660 * powerpc.cc: Likewise.
10661 * reduced_debug_output.cc: Likewise.
10662 * reduced_debug_output.h: Likewise.
10663 * reloc.cc: Likewise.
10664 * reloc.h: Likewise.
10665 * resolve.cc: Likewise.
10666 * script-sections.cc: Likewise.
10667 * script.cc: Likewise.
10668 * script.h: Likewise.
10669 * sparc.cc: Likewise.
10670 * symtab.cc: Likewise.
10671 * symtab.h: Likewise.
10672 * target-select.cc: Likewise.
10673 * target-select.h: Likewise.
10674 * token.h: Likewise.
10675 * workqueue.cc: Likewise.
10676 * workqueue.h: Likewise.
10677 * x86_64.cc: Likewise.
10678
a0351a69
DK
106792009-12-10 Doug Kwan <dougkwan@google.com>
10680
10681 * arm.cc (attributes.h): New include.
10682 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10683 (Arm_relobj::~Arm_relobj): Delete object pointed by
10684 attributes_section_data_.
10685 (Arm_relobj::attributes_section_data): New method definition.
10686 (Arm_relobj::attributes_section_data_): New data member declaration.
10687 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10688 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10689 attributes_section_data_.
10690 (Arm_dynobj::attributes_section_data): New method definition.
10691 (Arm_dynobj::attributes_section_data_): New data member declaration.
10692 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10693 initialization value of may_use_blx_ to false.
2e702c99 10694 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
10695 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10696 object attributes to compute results instead of hard-coding.
10697 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10698 Target_arm::get_secondary_compatible_arch,
10699 Target_arm::set_secondary_compatible_arch
10700 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10701 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10702 New method declarations.
10703 (Target_arm::get_aeabi_object_attribute): New method definition.
10704 (Target_arm::attributes_section_data_): New data member declaration.
10705 (read_arm_attributes_section): New template definition.
10706 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10707 (Arm_dynobj::do_read_symbols): Ditto.
10708 (Target_arm::do_finalize_sections): Merge attributes sections from
10709 input. Check for BLX use after attributes section merging.
10710 Fix __exidx_start and __exidx_end visibility. Create an
10711 .ARM.attributes section if necessary.
10712 (Target_arm::get_secondary_compatible_arch,
10713 Target_arm::set_secondary_compatible_arch,
10714 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10715 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 10716 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
10717 New method definitions.
10718
b59befec
ILT
107192009-12-09 Ian Lance Taylor <iant@google.com>
10720
10721 * plugin.cc (Plugin::load): Don't cast from void* to a function
10722 pointer.
10723
1276bc89
ILT
107242009-12-09 Ian Lance Taylor <iant@google.com>
10725
10726 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10727 information fields.
10728
2f2de248
L
107292009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10730
10731 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10732 Replace two_file_shared_1.so with two_file_shared_2.so.
10733 * testsuite/Makefile.in: Regenerated.
10734
4f787271
DK
107352009-12-08 Doug Kwan <dougkwan@google.com>
10736
10737 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10738 (HFILES): Add attributes.h and int_encoding.h.
10739 * Makefile.in: Regenerate.
10740 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10741 function definitions to int_encoding.cc
10742 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10743 prototypes to int_encoding.h
10744 * reduced_debug_output.cc (int_encoding.h): New include.
10745 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10746 function definitions to int_encoding.cc
10747 (insert_into_vector, read_from_pointer): Move template definitions to
10748 int_encoding.h
10749 * attributes.cc: New file.
10750 * attributes.h: New file.
10751 * int_encoding.cc: New file.
10752 * int_encoding.h: New file.
10753
20b52f1a
RÁE
107542009-12-07 Rafael Avila de Espindola <espindola@google.com>
10755
10756 PR gold/11055
10757 * incremental-dump.cc (dump_incremental_inputs): New.
10758 (main): Use dump_incremental_inputs.
10759
53d7974c
L
107602009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10761
10762 PR gold/10893
10763 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10764 checking elfcpp::STT_FUNC.
10765 (Target_i386::Relocate::relocate): Likewise.
10766 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10767
10768 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10769 symbols from shared libraries into normal FUNC symbols.
10770
10771 * symtab.h (Symbol): Add is_func and use it.
10772
05a352e6
DK
107732009-12-05 Doug Kwan <dougkwan@google.com>
10774
10775 * arm.cc (Target_arm::arm_info): Initialize new fields
10776 attributes_section and attributes_vendor.
10777 * i386.cc (Target_i386::i386_info): Same.
10778 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10779 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10780 fields attributes_section and attributes_vendor.
53d7974c 10781 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
10782 * target.h (Target::attributes_section, Target::attributes_vendor,
10783 Target::is_attributes_section, Target::attribute_arg_type,
10784 Target::attributes_order): New method definitions.
10785 (Target::Target_info::attributes_section,
10786 Target::Target_info::attributes_vendor): New fields.
10787 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10788 virtual method definitions.
10789 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10790 attributes_section and attributes_vendor.
10791 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10792
f4e5969c
DK
107932009-12-05 Doug Kwan <dougkwan@google.com>
10794
10795 * arm.cc: Update comments about interworking and stub generation.
10796 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10797 considered as non-PIC.
10798 (Arm_relocate_functions::base_abs): Fix formatting.
10799 (Arm_relocate_functions::got_prel): Fix comment. Change interface
10800 of function to use GOT entry address instead of offset.
10801 (Target_arm::Scan::global): Issue an error if a symbol would need a
10802 PLT does not get one because it is untyped. Remove code to create
10803 dynamic symbols for relative branches.
10804 (Target_arm::Relocate::relocate: Use 0 instead of false since function
10805 takes unsigned integer instead of boolean.
10806
1abce4a6
L
108072009-12-05 H.J. Lu <hongjiu.lu@intel.com>
10808
10809 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
10810 (two_file_test_LDADD): Likewise.
10811 (common_test_1_LDADD): Likewise.
10812 (exception_test_LDADD) Likewise.
10813 (weak_test_LDADD): Likewise.
10814 (many_sections_test_LDADD): Likewise.
10815 (initpri1_LDADD): Likewise.
10816 (script_test_1_LDADD): Likewise.
10817 (script_test_2_LDADD): Likewise.
10818 (justsyms_LDADD): Likewise.
10819 (binary_test_LDADD): Likewise.
10820 (large_LDADD): Likewise.
10821 * testsuite/Makefile.in: Regenerated.
10822
adcf2816 108232009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 10824
adcf2816
L
10825 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
10826 (Symbol_table::override_with_special): Likewise.
10827 (Symbol_table::add_from_object): Likewise.
10828
28e67f5d
RÁE
108292009-12-04 Rafael Avila de Espindola <espindola@google.com>
10830
10831 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10832 Don't set the data_offset twice.
10833
ae10a101
RÁE
108342009-12-04 Rafael Avila de Espindola <espindola@google.com>
10835
10836 * testsuite/Makefile.in: Regenerate.
10837
f59f41f3
DK
108382009-12-03 Doug Kwan <dougkwan@google.com>
10839
10840 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
10841 (Target_arm::do_finalize_sections): Add parameter for symbol table
10842 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
10843 * i386.cc (Target_i386::do_finalize_sections): Add an additional
10844 parameter for symbol table pointer.
10845 * layout.cc (Layout::finalize): Call Target::finalize_sections with
10846 an additional parameter for a pointer to symbol table.
10847 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
10848 parameter for a symbol table pointer.
10849 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
10850 * target.h (Target::finalize_sections, Target::do_finalize_sections):
10851 Ditto.
10852 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
10853 parameter for a symbol table pointer.
10854
ca55d848
RÁE
108552009-12-03 Rafael Avila de Espindola <espindola@google.com>
10856
10857 * incremental.cc (Incremental_inputs_header)
10858 (Incremental_inputs_header_write, Incremental_inputs_entry)
10859 (Incremental_inputs_entry_write): Move ...
10860 * incremental.h (Incremental_inputs_header)
10861 (Incremental_inputs_header_write, Incremental_inputs_entry)
10862 (Incremental_inputs_entry_write): here.
10863
3aec4f9c
RÁE
108642009-12-02 Rafael Avila de Espindola <espindola@google.com>
10865
10866 * incremental.cc (make_sized_incremental_binary): Set the target.
10867 Error if it is incompatible.
10868 * output.h (Output_file): Add filename method.
10869
9c0ae74d
RÁE
108702009-12-02 Rafael Avila de Espindola <espindola@google.com>
10871
10872 * incremental.cc (Incremental_inputs_entry): Remove unused argument
10873 from the get_* methods.
10874
a45500ae
RÁE
108752009-12-02 Rafael Avila de Espindola <espindola@google.com>
10876
10877 * incremental-dump.cc (main): Check that the offeset of a script is 0.
10878 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10879 Write 0 for the data_offset of scripts.
10880
325e6408
RÁE
108812009-12-02 Rafael Avila de Espindola <espindola@google.com>
10882
10883 * testsuite/Makefile.am: Add the incremental_test.sh test.
10884 * testsuite/incremental_test.sh: New.
10885 * testsuite/incremental_test_1.c: New.
10886 * testsuite/incremental_test_2.c: New.
10887
954c3e2e
RÁE
108882009-12-01 Rafael Avila de Espindola <espindola@google.com>
10889
703d02da 10890 * incremental-dump.cc (main): Fix typos.
954c3e2e 10891
f8086623
RÁE
108922009-11-27 Rafael Avila de Espindola <espindola@google.com>
10893
10894 PR gold/11025
10895 * incremental-dump.cc (main): Use llu to print 64 bit values.
10896
3b0dd6ac
L
108972009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
10898 H.J. Lu <hongjiu.lu@intel.com>
10899
10900 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
10901 $(LIBDL).
10902 (incremental_dump_LDADD): Likewise.
10903 * Makefile.in: Regenerated.
10904
a6d1ef57 109052009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 10906
a6d1ef57
DK
10907 Revert:
10908
10909 2009-11-25 Doug Kwan <dougkwan@google.com>
10910
10911 * arm.cc (Target_arm::Target_arm): Move method definition
10912 outside of class definition. Add code to handle
10913 --target1-rel, --target1-abs and --target2= options.
10914 (Target_arm::get_reloc_reloc_type): Change method to be
10915 non-static and const.
10916 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
10917 New data member declaration.
10918 (Target_arm::Scan::local, Target_arm::Scan::global,
10919 Target_arm::Relocate::relocate,
10920 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10921 Adjust call to Target_arm::get_real_reloc_type.
10922 (Target_arm::get_real_reloc_type): Use command line options
10923 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10924 * options.h (--target1-rel, --target1-abs, --target2): New
10925 ARM-only options.
10926
50aeb7d4
DK
109272009-11-25 Doug Kwan <dougkwan@google.com>
10928
10929 * arm.cc (Target_arm::Target_arm): Move method definition outside of
10930 class definition. Add code to handle --target1-rel, --target1-abs
10931 and --target2= options.
10932 (Target_arm::get_reloc_reloc_type): Change method to be non-static
10933 and const.
10934 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
10935 member declaration.
10936 (Target_arm::Scan::local, Target_arm::Scan::global,
10937 Target_arm::Relocate::relocate,
10938 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
10939 call to Target_arm::get_real_reloc_type.
10940 (Target_arm::get_real_reloc_type): Use command line options to
10941 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10942 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
10943 options.
10944
51938283
DK
109452009-11-25 Doug Kwan <dougkwan@google.com>
10946
10947 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
10948 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
10949 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
10950 formatting.
10951 (Arm_relocate_functions::thm_call): Replace body with a call to
10952 Arm_relocate_functions::thumb_branch_common.
10953 (Arm_relocate_functions::thm_jump24,
10954 Arm_relocate_functions::thm_xpc22): New method definitions.
10955 (Arm_relocate_functions::thumb_branch_common): New method definition.
10956 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
10957 operator.
10958 (Target_arm::Relocate::relocate): Adjust call to thm_call.
10959 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
10960
e2b8f3c4
RÁE
109612009-11-24 Rafael Avila de Espindola <espindola@google.com>
10962
10963 * Makefile.am: Build incremental-dump
10964 * Makefile.in: Regenerate.
10965 * incremental-dump.cc: New.
10966 * incremental.cc (Incremental_inputs_header_data,
10967 Incremental_inputs_entry_data): Move to incremental.h
10968 * incremental.h: (Incremental_inputs_header_data,
10969 Incremental_inputs_entry_data): Move from incremental.cc
10970
bcba9aec
RÁE
109712009-11-24 Rafael Avila de Espindola <espindola@google.com>
10972
10973 * incremental.cc (Incremental_inputs_header,
10974 Incremental_inputs_header_write, Incremental_inputs_entry,
10975 Incremental_inputs_entry_write): Add a typedef with the data type.
10976
7c3afe08
RÁE
109772009-11-24 Rafael Avila de Espindola <espindola@google.com>
10978
10979 * incremental.cc (Incremental_inputs_header,
10980 Incremental_inputs_header_write, Incremental_inputs_entry,
10981 Incremental_inputs_entry_write): Update comment about which
10982 type has the filed descriptions.
10983
d204b6e9
DK
109842009-11-15 Doug Kwan <dougkwan@google.com>
10985
10986 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
10987 (Arm_relocate_functions::arm_branch_common): Change method defintion
10988 in class definition to a method declaration and update list of formal
10989 parameters.
10990 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
10991 Arm_relocation_functions::jump24): Adjust call to
10992 Arm_relocate_functions::arm_branch_common. Update list of formal
10993 parameters.
10994 (Arm_relocate_functions::xpc25): New method definition.
10995 (Arm_relocate_functions::arm_branch_common): Move method defintion
10996 out from class definition. Use stubs for mode-switching and extending
10997 branch ranges.
10998 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
10999 specially. Change code to enable use of stubs in ARM branches.
11000
43d12afe
DK
110012009-11-10 Doug Kwan <dougkwan@google.com>
11002
11003 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11004 in method declaration.
11005 (Target_arm::relocate_stub): New method declaration.
11006 (Target_arm::default_target): Change to return a pointer instead of
11007 a const reference.
11008 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11009 Target_arm::default_target.
11010 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11011 method definition.
11012 (Target_arm::relocate_section): Adjust view.
11013 (Target_arm::relocate_stub): New method definition.
11014
ac33a407
DK
110152009-11-10 Doug Kwan <dougkwan@google.com>
11016
11017 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11018 a format warning.
11019 * incremental.cc (open_incremental_binary): Initialized local
11020 variables to avoid warnings.
11021 * object.cc (make_elf_object): Ditto.
11022 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11023 a format warning.
e1df38aa 11024
88ee28e9
L
11025009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11026
11027 PR gold/10930
11028 * testsuite/plugin_test.c: Include "config.h".
11029
2daedcd6
DK
110302009-11-09 Doug Kwan <dougkwan@google.com>
11031
11032 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11033 (arm_symbol_value): Remove.
11034 (Arm_relocate_functions::arm_branch_common,
11035 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11036 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11037 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11038 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11039 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11040 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11041 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11042 Arm_relocate_functions::thm_mobw_abs_nc,
11043 Arm_relocate_functions::thm_mov_abs,
11044 Arm_relocate_functions::movw_prel_nc,
11045 Arm_relocate_functions::thm_movt_abs,
11046 Arm_relocate_functions::movt_prel,
11047 Arm_relocate_functions::thm_movw_prel_nc,
11048 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11049 (Target_arm::Relocate::relocate): Only decompose address into two
11050 parts if relocation type uses the thumb-bit and pass the actual
11051 bit instead of a flag indicating that the thumb-bit is used. Adjust
11052 calls to methods in Arm_relocate_functions for this change.
11053
1276bc89 110542009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11055
11056 PR 10925
11057 * reloc.cc: Instantiate
11058 Sized_relobj::initialize_input_to_output_maps and
11059 Sized_relobj:free_input_to_output_maps.
11060
e53ad1b5
ILT
110612009-11-06 Ian Lance Taylor <iant@google.com>
11062
11063 PR 10876
11064 * defstd.cc (in_segment): Set only_if_ref true for "end".
11065
eb44217c
DK
110662009-11-06 Doug Kwan <dougkwan@google.com>
11067
11068 * arm.cc (class Reloc_stub): Correct a comment.
11069 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11070 (Target_arm::scan_section_for_stubs): New method declaration.
11071 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11072 Change methods from private to protected.
11073 (Target_arm::do_may_relax): New method definition.
11074 (Target_arm::do_relax, Target_arm::group_sections,
11075 Target_arm::scan_reloc_for_stub,
11076 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11077 (Target_arm::arm_input_section_map_): New data member declaration.
11078 (Target_arm::scan_reloc_for_stub,
11079 Target_arm::scan_reloc_section_for_stubs,
11080 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11081 Target_arm::do_relax): New method definitions.
11082
5d329b7d
ILT
110832009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11084
11085 * configure.ac: Check for (struct stat)::st_mtim
11086 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11087 * config.in: Regenerate.
11088 * configure: Regenerate.
11089
96a0d71b
ILT
110902009-11-05 Ian Lance Taylor <iant@google.com>
11091
11092 PR 10910
11093 * output.cc (Output_segment::add_output_section): Add missing
11094 return statement.
11095
594c8e5e
ILT
110962009-11-04 Ian Lance Taylor <iant@google.com>
11097
11098 PR 10880
11099 * object.h (class Object): Add is_needed and set_is_needed
11100 methods. Add is_needed_ field. Make bool fields into bitfields.
11101 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11102 defined in a dynamic object and referenced by a regular object,
11103 set is_needed for the dynamic object.
11104 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11105 if the file is marked with as_needed and it is not needed.
11106
22b127cc
ILT
111072009-11-04 Ian Lance Taylor <iant@google.com>
11108
11109 PR 10887
11110 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11111 tags if data is discarded by linker script.
11112 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11113 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11114 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11115 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11116
f5c870d2
ILT
111172009-11-04 Ian Lance Taylor <iant@google.com>
11118
11119 * layout.cc (Layout::get_output_section): Add is_interp and
11120 is_dynamic_linker_section parameters. Change all callers.
11121 (Layout::choose_output_section): Likewise.
11122 (Layout::make_output_section): Likewise.
11123 (Layout::add_output_section_data): Add is_dynamic_linker_section
11124 parameter. Change all callers.
11125 * layout.h (class Layout): Update declarations.
11126 * output.h (class Output_section): Add is_interp, set_is_interp,
11127 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11128 Add is_interp_, is_dynamic_linker_section_ fields. Change
11129 generate_code_fills_at_write_ to a bitfield.
11130 * output.cc (Output_section::Output_sections): Initialize new
11131 fields.
11132 (Output_segment::add_output_section): Add do_sort parameter.
11133 Change all callers.
11134
1ae4d23b
ILT
111352009-11-03 Ian Lance Taylor <iant@google.com>
11136
11137 PR 10860
11138 * options.h (class General_options): Add --warn-common.
11139 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11140 merging two common symbols.
11141 (Symbol_table::should_override): Handle --warn-common when merging
11142 a common symbol with a defined symbol. Use report_resolve_problem
11143 for multiple definitions.
11144 (Symbol_table::report_resolve_problem): New function.
11145 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11146
55da9579
DK
111472009-11-03 Doug Kwan <dougkwan@google.com>
11148
11149 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11150 stub_factory_.
11151 (Target_arm::stub_factory): New method definition.
11152 (Target_arm::new_arm_input_section,
11153 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11154 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11155 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11156 New type definitions.
11157 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11158 member declarations.
11159 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11160 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11161 New method definitions.
11162
37a9ac43
ILT
111632009-11-03 Ian Lance Taylor <iant@google.com>
11164
11165 * options.h (class General_options): Add --warn_constructors.
11166
b3d6a3d4
ILT
111672009-11-03 Ian Lance Taylor <iant@google.com>
11168
11169 PR 10893
11170 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11171 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11172
934b01dd
ILT
111732009-11-03 Ian Lance Taylor <iant@google.com>
11174
11175 PR 10895
11176 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11177 --msgid-bugs-address.
11178 (install-pdf): New target.
11179 (install-data_yes): Look up one directory to find mkinstalldirs.
11180
03c1939b
L
111812009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11182
11183 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11184 tree.
11185
ebd95253
DK
111862009-10-30 Doug Kwan <dougkwan@google.com>
11187
11188 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11189
e9bbb538
DK
111902009-10-30 Doug Kwan <dougkwan@google.com>
11191
11192 * arm.cc (Stub_addend_reader): New struct template definition
11193 and partial specializations.
11194 (Stub_addend_reader::operator()): New method definition for a
11195 partially specialized template.
11196
d5b40221
DK
111972009-10-30 Doug Kwan <dougkwan@google.com>
11198
11199 * arm.cc (Arm_relobj::processor_specific_flags): New method
11200 definition.
11201 (Arm_relobj::do_read_symbols): New method declaration.
11202 (Arm_relobj::processor_specific_flags_): New data member declaration.
11203 (Arm_dynobj): New class definition.
11204 (Target_arm::do_finalize_sections): Add input_objects parameter.
11205 (Target_arm::do_adjust_elf_header): New method declaration.
11206 (Target_arm::are_eabi_versions_compatible,
11207 (Target_arm::merge_processor_specific_flags): New method declaration.
11208 (Target_arm::do_make_elf_object): New overloaded method definitions
11209 and declaration.
11210 (Arm_relobj::do_read_symbols): New method definition.
11211 (Arm_dynobj::do_read_symbols): Ditto.
11212 (Target_arm::do_finalize_sections): Add input_objects parameters.
11213 Merge processor-specific flags from all input objects.
11214 (Target_arm::are_eabi_versions_compatible,
11215 Target_arm::merge_processor_specific_flags,
11216 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11217 New method definitions.
11218 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11219 Input_objects pointer type parameter.
11220 * layout.cc (Layout::finalize): Pass input objects to target's.
11221 finalize_sections function.
11222 * output.cc (Output_file_header::do_sized_write): Set ELF file
11223 header's processor-specific flags.
11224 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11225 Input_objects pointer type parameter.
11226 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11227 * target.h (Input_objects): New forward class declaration.
11228 (Target::processor_specific_flags,
11229 Target::are_processor_specific_flags_sect): New method definitions.
11230 (Target::finalize_sections): Add input_objects parameter.
11231 (Target::Target): Initialize processor_specific_flags_ and
11232 are_processor_specific_flags_set_.
11233 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11234 parameter.
11235 (Target::set_processor_specific_flags): New method definition.
11236 (Target::processor_specific_flags_,
11237 Target::are_processor_specific_flags_set_): New data member
11238 declarations.
11239 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11240 Input_objects pointer type parameter.
11241
ebabffbd
DK
112422009-10-30 Doug Kwan <dougkwan@google.com>
11243
11244 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11245
ad0f2072
ILT
112462009-10-28 Ian Lance Taylor <iant@google.com>
11247
11248 * object.h (class Relobj): Drop options parameter from
11249 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11250 do_scan_relocs, do_relocate. Change all callers.
11251 (class Sized_relobj): Drop options parameters from
11252 do_gc_process_relocs, do_scan_relocs, do_relocate,
11253 do_relocate_sections, relocate_sections, emit_relocs_scan,
11254 emit_relocs_scan_reltype. Change all callers.
11255 (struct Relocate_info): Remove options field and all references to
11256 it.
11257 * reloc.h (class Read_relocs): Remove options constructor
11258 parameter and options_ field. Change all callers.
11259 (class Gc_process_relocs, class Scan_relocs): Likewise.
11260 (class Relocate_task): Likewise.
11261 * target-reloc.h (scan_relocs): Remove options parameter. Change
11262 all callers.
11263 (scan_relocatable_relocs): Likewise.
11264 * target.h (class Sized_target): Remove options parameter from
11265 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11266 all callers.
11267 * gc.h (gc_process_relocs): Remove options parameter. Change all
11268 callers.
11269 * arm.cc: Update functions to remove options parameters.
11270 * i386.cc: Likewise.
11271 * powerpc.cc: Likewise.
11272 * sparc.cc: Likewise.
11273 * x86_64.cc: Likewise.
11274 * testsuite/testfile.cc: Likewise.
11275
8ffa3667
DK
112762009-10-28 Doug Kwan <dougkwan@google.com>
11277
11278 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11279 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11280 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11281 New method definitions.
11282
40f36857
CC
112832009-10-28 Cary Coutant <ccoutant@google.com>
11284
11285 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11286 (Plugin::cleanup_done_): New member.
11287 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11288 (Plugin_manager::cleanup_done_): Remove.
11289 (Plugin_manager::add_input_file): Edit error message.
11290 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11291 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11292
2c849493
ILT
112932009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11294
11295 * fileread.cc: (File_read::View::~View): Use the new
11296 data_ownership_ filed.
11297 (File_read::~File_read): Dispose the new whole_file_view_.
11298 (File_read::open): Mmap the whole file if needed.
11299 (File_read::open): Use whole_file_view_ instead of contents_.
11300 (File_read::find_view): Use whole_file_view_ if applicable.
11301 (File_read::do_read): Use whole_file_view_ instead of contents_.
11302 (File_read::make_view): Use whole_file_view_ instead of contents_,
11303 update File_read::View::View call.
11304 (File_read::find_or_make_view): Update File_read::View::View
11305 call.
11306 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11307 remove contents_
11308 (File_read::View::Data_ownership): New enum.
11309 (File_read::View::View): Replace bool mapped_ with Data_ownership
11310 argument.
11311 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11312 (File_read::View::data_ownership_): New field.
11313 (File_read::contents_): Remove (replaced by whole_file_view_).
11314 (File_read::whole_file_view_): New field.
11315 * options.h (class General_options): Add --keep-files-mapped.
11316
24998053
CC
113172009-10-27 Cary Coutant <ccoutant@google.com>
11318
11319 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11320 * testsuite/Makefile.am (plugin_test_5): New test case.
11321 * testsuite/Makefile.in: Regenerate.
11322
72adc4fa
DK
113232009-10-25 Doug Kwan <dougkwan@google.com>
11324
11325 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11326 from private to protected to allow access by child class.
11327 (Sized_relobj::do_relocate_sections): New method declaration.
11328 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11329 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11330 Sized_relobj::relocate_sections. Instantiate template explicitly
11331 for different target sizes and endianity.
11332
07f508a2
DK
113332009-10-24 Doug Kwan <dougkwan@google.com>
11334
11335 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11336 (Arm_input_section::as_arm_input_section): New method.
11337 (Arm_output_section): New class definition.
11338 (Arm_output_section::create_stub_group,
11339 Arm_output_section::group_sections): New method definitions.
11340
10ad9fe5
DK
113412009-10-22 Doug Kwan <dougkwan@google.com>
11342
11343 * arm.cc (Arm_input_section): New class definition.
11344 (Arm_input_section::init, Arm_input_section:do_write,
11345 Arm_input_section::set_final_data_size,
11346 Arm_input_section::do_reset_address_and_file_offset): New method
11347 definitions.
11348
56ee5e00
DK
113492009-10-21 Doug Kwan <dougkwan@google.com>
11350
11351 * arm.cc (Stub_table, Arm_input_section): New forward class
11352 declarations.
11353 (Stub_table): New class defintion.
11354 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11355 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11356 New method definition.
11357
b569affa
DK
113582009-10-21 Doug Kwan <dougkwan@google.com>
11359
11360 * arm.cc: Update copyright comments.
11361 (Target_arm): New forward class template declaration.
11362 (Arm_address): New type.
11363 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11364 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11365 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11366 constants.
11367 (Insn_template): Same.
11368 (DEF_STUBS): New macro.
11369 (Stub_type): New enum type.
11370 (Stub_template): New class definition.
11371 (Stub): Same.
11372 (Reloc_stub): Same.
11373 (Stub_factory): Same.
11374 (Target_arm::Target_arm): Initialize may_use_blx_ and
11375 should_force_pic_veneer_.
11376 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11377 Target_arm::should_force_pic_veneer,
11378 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11379 Target_arm::using_thumb_only, Target_arm:;default_target): New
11380 method defintions.
11381 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11382 New data member declarations.
11383 (Insn_template::size, Insn_template::alignment): New method defintions.
11384 (Stub_template::Stub_template): New method definition.
11385 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11386 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11387 (Stub_factory::Stub_factory): New method definition.
11388 * gold.h (string_hash): New template.
11389 * output.h (Input_section_specifier::hash_value): Use
11390 gold::string_hash.
11391 (Input_section_specifier::string_hash): Remove.
11392 * stringpool.cc (Stringpool_template::string_hash): Use
11393 gold::string_hash.
11394
6c172549
DK
113952009-10-20 Doug Kwan <dougkwan@google.com>
11396
11397 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11398 symbols of relaxed input sections.
11399 * output.h (Output_section::find_relaxed_input_section): Make
11400 method public.
11401
c5617f2f
DK
114022009-10-16 Doug Kwan <dougkwan@google.com>
11403
11404 * dynobj.cc (Versions::Versions): Initialize version_script_.
11405 Only insert base version symbol definition for a shared object
11406 if version script defines any version versions.
11407 (Versions::define_base_version): New method definition.
11408 (Versions::add_def): Check that base version is not needed.
11409 (Versions::add_need): Define base version lazily.
11410 * dynobj.h (Versions::define_base_version): New method declaration.
11411 (Versions::needs_base_version_): New data member declaration.
11412 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11413 (check_DATA): Add no_version_test.stdout.
11414 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11415 New make rules.
11416 * testsuite/Makefile.in: Regenerate.
11417 * testsuite/no_version_test.c: New file.
11418 * testsuite/no_version_test.sh: Ditto.
11419
3c12dcdb
DK
114202009-10-16 Doug Kwan <dougkwan@google.com>
11421
11422 * expression.cc (class Segment_start_expression): New class definition.
11423 (Segment_start_expression::value): New method definition.
11424 (script_exp_function_segment_start): Return a new
11425 Segment_start_expression.
11426 * gold/script-c.h (script_saw_segment_start_expression): New function
11427 prototype.
11428 * script-sections.cc (Script_sections::Script_sections): Initialize
11429 SAW_SEGMENT_START_EXPRESSION_ to false.
11430 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11431 and -Tbbs options to specify section addresses if given in
11432 command line and no SEGMENT_START expression is seen in a script.
11433 * script-sections.h (Script_sections::saw_segment_start_expression,
11434 Script_sections::set_saw_segment_start_expression): New method
11435 definition.
11436 (Script_sections::saw_segment_start_expression_): New data member
11437 declaration.
11438 * script.cc (script_saw_segment_start_expression): New function.
11439 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11440 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11441 script_test_7.sh and script_test_8.sh.
11442 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11443 script_test_8.stdout.
11444 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11445 (script_test_6, script_test_6.stdout, script_test_7,
11446 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11447 * Makefile.in: Regenerate.
11448 * testsuite/script_test_6.sh: New file.
11449 * testsuite/script_test_6.t: Same.
11450 * testsuite/script_test_7.sh: Same.
11451 * testsuite/script_test_7.t: Same.
11452 * testsuite/script_test_8.sh: Same.
11453
64b1ae37
DK
114542009-10-16 Doug Kwan <dougkwan@google.com>
11455
11456 * output.cc (Output_segment::set_section_list_address): Cast
11457 expressions to unsigned long long type to avoid format warnings.
11458
661be1e2
ILT
114592009-10-15 Ian Lance Taylor <iant@google.com>
11460
12edd763 11461 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11462 dot assignment to script_sections_.
12edd763
ILT
11463 * script-sections.cc (Script_sections::add_dot_assignment):
11464 Initialize if necessary.
11465
68b6574b
ILT
11466 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11467 program headers with no load segment if there is a linker script.
11468
661be1e2
ILT
11469 * layout.cc (Layout::set_segment_offsets): Align the file offset
11470 to the segment aligment for -N or -n with no load segment.
11471 * output.cc (Output_segment::add_output_section): Don't crash if
11472 the first section is a TLS section.
11473 (Output_segment::set_section_list_addresses): Print an error
11474 message if the address moves backward in a linker script.
11475 * script-sections.cc
11476 (Output_section_element_input::set_section_addresses): Don't
11477 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11478 (Orphan_output_section::set_section_addresses): Likewise.
11479
f15f61a7
DK
114802009-10-15 Doug Kwan <dougkwan@google.com>
11481
11482 * layout.cc (Layout::finish_dynamic_section): Generate tags
11483 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11484 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11485 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11486
82bb573a
ILT
114872009-10-14 Ian Lance Taylor <iant@google.com>
11488
11489 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11490 fields.
11491 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11492 data_shdr fields of relinfo.
11493 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11494 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11495 R_386_TLS_LDO_32, adjust based on section flags.
11496 (Target_i386::Relocate::fix_up_ldo): Remove.
11497
374ad285
ILT
114982009-10-13 Ian Lance Taylor <iant@google.com>
11499
11500 Add support for -pie.
11501 * options.h (class General_options): Add -pie and
11502 --pic-executable.
11503 (General_options::output_is_position_independent): Test -pie.
11504 (General_options::output_is_executable): Return true if not shared
11505 and not relocatable.
11506 (General_options::output_is_pie): Remove.
11507 * options.cc (General_options::finalize): Reject incompatible uses
11508 of -pie.
11509 * gold.cc (queue_middle_tasks): A -pie link is not static.
11510 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11511 * symtab.cc (Symbol::final_value_is_known): Return false if
11512 output_is_position_independent.
11513 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11514 output_is_position_independent.
11515 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11516 output_is_position_independent.
11517 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11518 output_is_position_independent.
11519 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11520 two_file_pie_test.
11521 (basic_pie_test.o, basic_pie_test): New targets.
11522 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11523 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11524 (two_file_pie_test): New target.
11525 * testsuite/Makefile.in: Rebuild.
11526 * README: Remove note saying that -pie is not supported.
11527
c6585162
ILT
115282009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11529
11530 * options.h (class General_options): Add -init and -fini.
11531 * layout.cc (Layout::finish_dynamic_section): Emit
11532 given init and fini functions.
11533
032ce4e9
ST
115342009-10-13 Sriraman Tallam <tmsriram@google.com>
11535
11536 * gc.h (gc_process_relocs): Check if icf is enabled using new
11537 function.
11538 * gold.cc (queue_initial_tasks): Likewise.
11539 (queue_middle_tasks): Likewise.
11540 * object.cc (do_layout): Likewise.
11541 * symtab.cc (is_section_folded): Likewise.
11542 * main.cc (main): Likewise.
11543 * reloc.cc (Read_relocs::run): Likewise.
11544 (Sized_relobj::do_scan_relocs): Likewise.
11545 * icf.cc (is_function_ctor_or_dtor): New function.
11546 (Icf::find_identical_sections): Check if function is ctor or dtor when
11547 safe icf is chosen.
11548 * options.h (General_options::icf): Change option to be an enum.
11549 (Icf_status): New enum.
11550 (icf_enabled): New method.
11551 (icf_safe_folding): New method.
11552 (set_icf_status): New method.
11553 (icf_status_): New variable.
11554 * (options.cc) (General_options::finalize): Set icf_status_.
11555 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11556 icf_test and icf_keep_unique_test to use the --icf enum flag.
11557 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11558 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11559
f345227a
ST
115602009-10-12 Sriraman Tallam <tmsriram@google.com>
11561
11562 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11563 includes to gc.h and icf.h.
11564 * arm.cc: Include gc.h.
11565 * gold.cc: Likewise.
11566 * i386.cc: Likewise.
11567 * powerpc.cc: Likewise.
11568 * sparc.cc: Likewise.
11569 * x86_64.cc: Likewise.
11570 * gc.h: Include icf.h.
11571
1c7814ed
ILT
115722009-10-11 Ian Lance Taylor <iant@google.com>
11573
11574 * plugin.cc: Include "gold.h" before other header files.
11575
ae3b5189
CD
115762009-10-10 Chris Demetriou <cgd@google.com>
11577
11578 * options.h (Input_file_argument::Input_file_type): New enum.
11579 (Input_file_argument::is_lib_): Replace with...
11580 (Input_file_argument::type_): New member.
11581 (Input_file_argument::Input_file_argument): Take Input_file_type
11582 'type' rather than boolean 'is_lib' as second argument.
11583 (Input_file_argument::is_lib): Use type_.
11584 (Input_file_argument::is_searched_file): New function.
11585 (Input_file_argument::may_need_search): Handle is_searched_file.
11586 * options.cc (General_options::parse_library): Support -l:filename.
11587 (General_options::parse_just_symbols): Update for Input_file_argument
11588 changes.
11589 (Command_line::process): Likewise.
11590 * archive.cc (Archive::get_file_and_offset): Likewise.
11591 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11592 * script.cc (read_script_file, script_add_file): Likewise.
11593 * fileread.cc (Input_file::Input_file): Likewise.
11594 (Input_file::will_search_for): Handle is_searched_file.
11595 (Input_file::open): Likewise.
11596 * readsyms.cc (Read_symbols::get_name): Likewise.
11597 * testsuite/Makefile.am (searched_file_test): New test.
11598 * testsuite/Makefile.in: Regenerate.
11599 * testsuite/searched_file_test.cc: New file.
11600 * testsuite/searched_file_test_lib.cc: New file.
11601
f3048a1d
ILT
116022009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11603 Ian Lance Taylor <iant@google.com>
11604
11605 * descriptor.cc: Include <cstdio> and "binary-io.h".
11606 (Descriptors::open): Open the files in binary mode always.
11607 * script.cc (Lex::get_token): Treat \r as whitespace.
11608
d4780e57
ILT
116092009-10-09 Ian Lance Taylor <iant@google.com>
11610
11611 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11612
d9a893b8
ILT
116132009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11614 Ian Lance Taylor <iant@google.com>
11615
11616 * configure.ac: Check for readv function also.
11617 * fileread.cc (readv): Define if not HAVE_READV.
11618 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11619 does not exist.
11620 * config.in: Regenerate.
11621 * configure: Regenerate.
11622
c0a62865
DK
116232009-10-09 Doug Kwan <dougkwan@google.com>
11624
11625 * layout.cc (Layout::make_output_section): Call target hook to make
11626 ordinary output section.
11627 (Layout::finalize): Adjust parameter list of call the
11628 Target::may_relax().
11629 * layout.h (class Layout::section_list): New method.
11630 * merge.h (Output_merge_base::entsize): Change visibility to public.
11631 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11632 New methods.
11633 (Output_merge_string::do_is_string): New method.
11634 * object.cc (Sized_relobj::do_setup): renamed from
11635 Sized_relobj::set_up.
11636 * object.h (Sized_relobj::adjust_shndx,
11637 Sized_relobj::initializ_input_to_output_maps,
11638 Sized_relobj::free_input_to_output_maps): Change visibilities to
11639 protected.
11640 (Sized_relobj::setup): Virtualize.
11641 (Sized_relobj::do_setup): New method declaration.
11642 (Sized_relobj::invalidate_section_offset,
11643 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11644 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11645 * options.cc (parse_int): New function.
11646 * options.h (parse_int): New declaration.
11647 (DEFINE_int): New macro.
11648 (stub_group_size): New option.
11649 * output.cc (Output_section::Output_section): Initialize memebers
11650 merge_section_map_, merge_section_by_properties_map_,
11651 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11652 (Output_section::add_input_section): Handled deferred code-fill
11653 generation and remove an old comment.
11654 (Output_section::add_relaxed_input_section): New method definition.
11655 (Output_section::add_merge_input_section): Use merge section by
11656 properties map to speed to search. Update merge section maps
11657 as appropriate.
11658 (Output_section::build_relaxation_map): New method definition.
11659 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11660 Same.
11661 (Output_section::relax_input_section): Renamed to
11662 Output_section::convert_input_sections_to_relaxed_sections and change
11663 interface to take a vector of pointers to relaxed sections.
11664 (Output_section::find_merge_section,
11665 Output_section::find_relaxed_input_section): New method definitions.
11666 (Output_section::is_input_address_mapped,
11667 Output_section::output_offset, Output_section::output_address):
11668 Use output section data maps to speed up searching.
11669 (Output_section::find_starting_output_address): Add comments.
11670 (Output_section::do_write,
11671 Output_section::write_to_postprocessing_buffer): Do code-fill
11672 generation as appropriate.
11673 (Output_section::get_input_sections): Invalidate relaxed input section
11674 map.
11675 (Output_section::restore_states): Adjust type of checkpoint .
11676 Invalidate relaxed input section map.
11677 * output.h (Output_merge_base): New class declaration.
11678 (Input_section_specifier): New class defintion.
11679 (class Output_relaxed_input_section) Change base class to
11680 Output_section_data_build.
11681 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11682 base class initializer.
11683 (Output_section::add_relaxed_input_section): New method declaration.
11684 (Output_section::Input_section): Change visibility to protected.
2e702c99 11685 (Output_section::Input_section::relobj,
c0a62865
DK
11686 Output_section::Input_section::shndx): Handle relaxed input sections.
11687 Output_section::input_sections) Change visibility to protected. Also
11688 define overload to return a non-const pointer.
11689 (Output_section::Merge_section_properties): New class defintion.
11690 (Output_section::Merge_section_by_properties_map,
11691 Output_section::Output_section_data_by_input_section_map,
11692 Output_section::Relaxation_map): New types.
11693 (Output_section::relax_input_section): Rename method to
11694 Output_section::convert_input_sections_to_relaxed_sections and change
11695 interface to take a vector of relaxed section pointers.
11696 (Output_section::find_merge_section,
11697 Output_section::find_relaxed_input_section,
11698 Output_section::build_relaxation_map,
11699 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11700 New method declarations.
11701 (Output_section::merge_section_map_
11702 Output_section::merge_section_by_properties_map_,
11703 Output_section::relaxed_input_section_map_,
11704 Output_section::is_relaxed_input_section_map_valid_,
11705 Output_section::generate_code_fills_at_write_): New data members.
11706 * script-sections.cc
11707 (Output_section_element_input::set_section_addresses): Call
11708 current_data_size and addralign methods of relaxed input sections.
11709 (Orphan_output_section::set_section_addresses): Call current_data_size
11710 and addralign methods of relaxed input sections.
11711 * symtab.cc (Symbol_table::compute_final_value): Extract template
11712 from the body of Symbol_table::sized_finalize_symbol.
11713 (Symbol_table::sized_finalized_symbol): Call
11714 Symbol_table::compute_final_value.
11715 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11716 (Symbol_table::compute_final_value): New templated method declaration.
11717 * target.cc (Target::do_make_output_section): New method defintion.
11718 * target.h (Target::make_output_section): New method declaration.
11719 (Target::relax): Add more parameters for input objects, symbol table
11720 and layout. Adjust call to do_relax.
11721 (Target::do_make_output_section): New method declaration.
11722 (Target::do_relax): Add parameters for input objects, symbol table
11723 and layout.
11724
d446d6c4
ILT
117252009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11726
11727 * pread.c: Include stdio.h.
11728
bc06c745
ILT
117292009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11730
11731 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11732 defined.
11733
75aea3d0
ILT
117342009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11735
11736 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11737 Change read_shndx type to unsigned int.
11738 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11739 int.
11740 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11741 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11742 Change read_shndx type to unsigned int.
11743 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11744 int.
11745 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11746 * layout.cc (Layout::create_symtab_sections): Cast the result of
11747 local_symcount * symsize to off_t in the gold_assert.
11748
be8fcb75
ILT
117492009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11750
11751 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11752 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11753 R_ARM_BASE_ABS.
11754 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11755 (Arm_relocate_functions::thm_abs5): New function.
11756 (Arm_relocate_functions::abs12): New function.
11757 (Arm_relocate_functions::abs16): New function.
11758 (Arm_relocate_functions::base_abs): New function.
11759 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11760 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11761 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11762 R_ARM_BASE_ABS.
11763 (Scan::global): Likewise.
11764 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11765 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11766 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11767 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11768 R_ARM_BASE_ABS.
11769
c2a122b6
ILT
117702009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11771
11772 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11773 (Arm_relocate_functions::movt_prel): New function.
11774 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11775 (Arm_relocate_functions::thm_movt_prel): New function.
11776 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11777 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11778 (Scan::global, Relocate::relocate): Likewise.
11779 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11780
c4aa1e2d
ILT
117812009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11782
11783 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11784 Incremental_checker.
11785 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11786 unsigned int.
11787 (class Incremental_inputs_header): New class.
11788 (Incremental_inputs_header_writer): Edit comment.
11789 (Incremental_inputs_entry): New class.
11790 (Incremental_inputs_entry_writer): Edit comment.
11791 (Sized_incremental_binary::do_find_incremental_inputs_section):
11792 Add *strtab_shndx parameter, fill it.
11793 (Sized_incremental_binary::do_check_inputs): New method.
11794 (Incremental_checker::can_incrementally_link_output_file): Use
11795 Sized_incremental_binary::check_inputs.
11796 (Incremental_inputs::report_command_line): Save command line in
11797 command_line_.
11798 * incremental.h:
11799 (Incremental_binary::find_incremental_inputs_section): New
11800 method.
11801 (Incremental_binary::do_find_incremental_inputs_section): Add
11802 strtab_shndx parameter.
11803 (Incremental_binary::do_check_inputs): New pure virtual method.
11804 (Sized_incremental_binary::do_check_inputs): Declare.
11805 (Incremental_checker::Incremental_checker): Add incremental_inputs
11806 parameter, use it to initialize incremental_inputs_.
11807 (Incremental_checker::incremental_inputs_): New field.
11808 (Incremental_checker::command_line): New method.
11809 (Incremental_checker::inputs): New method.
11810 (Incremental_checker::command_line_): New field.
11811
c549a694
ILT
118122009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11813
11814 * incremental.cc: Include <cstdarg> and "target-select.h".
11815 (vexplain_no_incremental): New function.
11816 (explain_no_incremental): New function.
11817 (Incremental_binary::error): New method.
11818 (Sized_incremental_binary::do_find_incremental_inputs_section): New
11819 method.
11820 (make_sized_incremental_binary): New function.
11821 (open_incremental_binary): New function.
11822 (can_incrementally_link_file): Add checks if output is ELF and has
11823 inputs section.
11824 * incremental.h: Include "elfcpp_file.h" and "output.h".
11825 (Incremental_binary): New class.
11826 (Sized_incremental_binary): New class.
11827 (open_incremental_binary): Declare.
11828 * object.cc (is_elf_object): Use
11829 elfcpp::Elf_recognizer::is_elf_file.
11830 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
11831 * output.h (Output_file::filesize): New method.
11832
fd3c5f0b
ILT
118332009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11834
11835 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
11836 New function.
11837 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
11838 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
11839 function.
11840 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
11841 function.
11842 (Arm_relocate_functions::movw_abs_nc): New function.
11843 (Arm_relocate_functions::movt_abs): New function.
11844 (Arm_relocate_functions::thm_movw_abs_nc): New function.
11845 (Arm_relocate_functions::thm_movt_abs): New function.
11846 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
11847 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
11848 (Scan::global): Likewise.
11849 (Relocate::relocate): Likewise.
11850 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11851
7f5309a5
ILT
118522009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11853
11854 * arm.cc (Arm_relocate_functions::got_prel) New function.
11855 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
11856 (Relocate::relocate): Likewise.
11857 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11858
364c7fa5
ILT
118592009-10-06 Ian Lance Taylor <iant@google.com>
11860
11861 * options.h (class General_options): Define
11862 split_stack_adjust_size parameter.
11863 * object.h (class Object): Add uses_split_stack_ and
11864 has_no_split_stack_ fields. Add uses_split_stack and
11865 has_no_split_stack accessor functions. Declare
11866 handle_split_stack_section.
11867 (class Reloc_symbol_changes): Define.
11868 (class Sized_relobj): Define Function_offsets. Declare
11869 split_stack_adjust, split_stack_adjust_reltype, and
11870 find_functions.
11871 * object.cc (Object::handle_split_stack_section): New function.
11872 (Sized_relobj::do_layout): Call handle_split_stack_section.
11873 * dynobj.cc (Sized_dynobj::do_layout): Call
11874 handle_split_stack_section.
11875 * reloc.cc (Sized_relobj::relocate_sections): Call
11876 split_stack_adjust for executable sections in split_stack
11877 objects. Pass reloc_map to relocate_section.
11878 (Sized_relobj::split_stack_adjust): New function.
11879 (Sized_relobj::split_stack_adjust_reltype): New function.
11880 (Sized_relobj::find_functions): New function.
11881 * target-reloc.h: Include "object.h".
11882 (relocate_section): Add reloc_symbol_changes parameter. Change
11883 all callers.
11884 * target.h (class Target): Add calls_non_split method. Declare
11885 do_calls_non_split virtual method. Declare match_view and
11886 set_view_to_nop.
11887 * target.cc: Include "elfcpp.h".
11888 (Target::do_calls_non_split): New function.
11889 (Target::match_view): New function.
11890 (Target::set_view_to_nop): New function.
11891 * gold.cc (queue_middle_tasks): Give an error if mixing
11892 split-stack and non-split-stack objects with -r.
11893 * i386.cc (Target_i386::relocate_section): Add
11894 reloc_symbol_changes parameter.
11895 (Target_i386::do_calls_non_split): New function.
11896 * x86_64.cc (Target_x86_64::relocate_section): Add
11897 reloc_symbol_changes parameter.
11898 (Target_x86_64::do_calls_non_split): New function.
11899 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
11900 parameter.
11901 * powerpc.cc (Target_powerpc::relocate_section): Add
11902 reloc_symbol_changes parameter.
11903 * sparc.cc (Target_sparc::relocate_section): Add
11904 reloc_symbol_changes parameter.
11905 * configure.ac: Call AM_CONDITIONAL for the default target.
11906 * configure: Rebuild.
11907 * testsuite/Makefile.am (TEST_AS): New variable.
11908 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
11909 (check_DATA): Add split_i386 and split_x86_64 files.
11910 (SPLIT_DEFSYMS): Define.
11911 (split_i386_[1234n].o): New targets.
11912 (split_i386_[124]): New targets.
11913 (split_i386_[1234r].stdout): New targets.
11914 (split_x86_64_[1234n].o): New targets.
11915 (split_x86_64_[124]): New targets.
11916 (split_x86_64_[1234r].stdout): New targets.
11917 (MOSTLYCLEANFILES): Add new executables.
11918 * testsuite/split_i386.sh: New file.
11919 * testsuite/split_x86_64.sh: New file.
11920 * testsuite/split_i386_1.s: New file.
11921 * testsuite/split_i386_2.s: New file.
11922 * testsuite/split_i386_3.s: New file.
11923 * testsuite/split_i386_4.s: New file.
11924 * testsuite/split_i386_n.s: New file.
11925 * testsuite/split_x86_64_1.s: New file.
11926 * testsuite/split_x86_64_2.s: New file.
11927 * testsuite/split_x86_64_3.s: New file.
11928 * testsuite/split_x86_64_4.s: New file.
11929 * testsuite/split_x86_64_n.s: New file.
11930 * testsuite/testfile.cc (Target_test): Update relocation_section
11931 function.
11932 * testsuite/Makefile.in: Rebuild.
11933
e8a9fcda
ILT
119342009-10-06 Ian Lance Taylor <iant@google.com>
11935
11936 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
11937 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
11938 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
11939 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
11940 the address on ldo_addrs_.
11941 (Target_i386::Relocate::fix_up_ldo): New function.
11942
e99daf92
ILT
119432009-10-06 Rafael Espindola <espindola@google.com>
11944
11945 * plugin.cc (add_input_library): New.
11946 (Plugin::load): Add add_input_library to tv.
11947 (Plugin_manager::add_input_file): Add the is_lib argument.
11948 (add_input_file): Update call to Plugin_manager::add_input_file.
11949 (add_input_library): New.
11950 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
11951
966d4097
DK
119522009-09-30 Doug Kwan <dougkwan@google.com>
11953
11954 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
11955 symbol and call Symbol::may_need_copy_reloc to determine if
11956 a copy reloc is needed.
11957 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
11958 nocopyreloc is given in command line.
11959 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
11960 given in command line.
11961 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
11962 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
11963 of the removed Target_i386::may_need_copy_reloc.
11964 * options.h (copyreloc): New option with default value false.
11965 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11966 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
11967 instead of the removed Target_powerpc::may_need_copy_reloc.
11968 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11969 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
11970 instead of the removed Target_sparc::may_need_copy_reloc.
11971 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
11972 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
11973 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
11974 instead of the removed Target_x86_64::may_need_copy_reloc.
11975
029ba973
ILT
119762009-09-30 Ian Lance Taylor <iant@google.com>
11977
11978 * object.h (class Object): Remove target_ field, and target,
11979 sized_target, and set_target methods.
11980 (Object::sized_target): Remove.
11981 (class Sized_relobj): Update declarations. Remove sized_target.
11982 * object.cc (Sized_relobj::setup): Remove target parameter.
11983 Change all callers.
11984 (Input_objects::add_object): Don't do anything with the target.
11985 (make_elf_sized_object): Add punconfigured parameter. Change all
11986 callers. Set or test parameter target.
11987 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
11988 Change all callers.
11989 * parameters.cc (Parameters::set_target): Change parameter type to
11990 be non-const.
11991 (Parameters::default_target): Remove.
11992 (set_parameters_target): Change parameter type to be non-const.
11993 (parameters_force_valid_target): New function.
11994 (parameters_clear_target): New function.
11995 * parameters.h (class Parameters): Update declarations. Remove
11996 default_target method. Add sized_target and clear_target
11997 methods. Change target_ to be non-const.
11998 (set_parameters_target): Update declaration.
11999 (parameters_force_valid_target): Declare.
12000 (parameters_clear_target): Declare.
12001 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12002 as NULL if we aren't searching.
12003 (Add_symbols::run): Don't check for compatible target.
12004 * fileread.cc (Input_file::open_binary): Call
12005 parameters_force_valid_target.
12006 * gold.cc (queue_middle_tasks): Likewise.
12007 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12008 set_target on object.
12009 * dynobj.h (class Sized_dynobj): Update declarations.
12010 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12011 make_elf_object returns NULL.
12012 (Archive::include_member): Don't check whether object target is
12013 compatible.
12014 * output.cc (Output_section::add_input_section): Get target from
12015 parameters.
12016 (Output_section::relax_input_section): Likewise.
12017 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12018 parameters.
12019 (Sized_relobj::do_scan_relocs): Likewise.
12020 (Sized_relobj::relocate_sections): Likewise.
12021 * resolve.cc (Symbol_table::resolve): Likewise.
12022 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12023 parameter. Change all callers.
12024 (Symbol_table::add_from_object): Get target from parameters.
12025 (Symbol_table::add_from_relobj): Don't check object target.
12026 (Symbol_table::add_from_dynobj): Likewise.
12027 (Symbol_table::define_special_symbol): Get target from
12028 parameters.
12029 * symtab.h (class Symbol_table): Update declaration.
12030 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12031 parameter. Change all callers. Clear parameter target.
12032 (Binary_test): Test target here.
12033 * testsuite/object_unittest.cc (gold_testsuite): Remove
12034 target_test_pointer parameter. Change all callers.
12035 (Object_test): Test target here.
12036
a6a22b83
ILT
120372009-09-26 Ian Lance Taylor <iant@google.com>
12038
12039 * testsuite/initpri1.c: Don't try to use constructor priorities if
12040 compiling with gcc before 4.3.
12041
6a8f49fe
ILT
120422009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12043
12044 * testsuite/retain_symbols_file_test.sh (check_present): Change
12045 output file name to retain_symbols_file_test.stdout.
12046 (check_absent): Likewise.
12047
8c604651
CS
120482009-09-18 Craig Silverstein <csilvers@google.com>
12049
12050 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12051 * options.cc: Include <cerrno> and <fstream>.
12052 (General_options::finalize): Parse -retain-symbols-file tag.
12053 * options.h: New flag.
12054 (General_options): New method should_retain_symbol, new
12055 variable symbols_to_retain.
12056 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12057 should_retain_symbol map.
12058 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12059 * testsuite/Makefile.in: Regenerate.
12060 * testsuite/retain_symbols_file_test.sh: New file.
12061
ca58b19f
NC
120622009-09-18 Nick Clifton <nickc@redhat.com>
12063
12064 * po/es.po: Updated Spanish translation.
12065
20e6d0d6
DK
120662009-09-17 Doug Kwan <dougkwan@google.com>
12067
12068 * debug.h (DEBUG_RELAXATION): New constant.
12069 (DEBUG_ALL): Add DEBUG_RELAXATION.
12070 (debug_string_to_enum): Add relaxation debug option.
12071 * layout.cc
12072 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12073 Layout::Relaxation_debug_check::read_sections,
12074 Layout::Relaxation_debug_check::read_sections): New method definitions.
12075 (Layout::Layout): Initialize data members
12076 record_output_section_data_from_scrips_,
12077 script_output_section_data_list_ and relaxation_debug_check_.
12078 (Layout::save_segments, Layout::restore_segments,
12079 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12080 Layout::relaxation_loop_body): New method definitions.
12081 (Layout::finalize): Support relaxation. Move section layout code to
12082 Layout::relaxation_loop_body.
12083 (Layout::set_asection_address_from_script): Move code for orphan
12084 section placement out.
12085 (Layout::place_orphan_sections_in_script): New method definition.
12086 * layout.h (Output_segment_headers, Output_file_header):
12087 New forward class declarations.
12088 (Layout::~Layout): Define.
12089 (Layout::new_output_section_data_from_script): New method definition.
12090 (Layout::place_orphan_sections_in_script): New method declaration.
12091 (Layout::Segment_states): New type declaration.
12092 (Layout::save_segments, Layout::restore_segments,
12093 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12094 Layout::relaxation_loop_body): New method declarations.
12095 (Layout::Output_section_data_list): New type declaration.
12096 (Layout::Relaxation_debug_check): New class definition.
12097 (Layout::record_output_section_data_from_script_,
12098 Layout::script_output_section_data_list_, Layout::segment_states_,
12099 Layout::relaxation_debug_check_): New data members.
12100 * output.cc: (Output_section_headers::do_size): New method definition.
12101 (Output_section_headers::Output_section_headers): Move size
12102 computation to Output_section_headers::do_size.
12103 (Output_segment_headers::do_size): New method definition.
e1df38aa 12104 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12105 Output_file_header::do_size and call it.
12106 (Output_file_header::do_size): New method definition.
12107 (Output_data_group::Output_data_group): Adjust call to
12108 Output_section_data.
12109 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12110 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12111 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12112 RELAXED_INPUT_SECTION_CODE.
12113 (Output_section::Output_section): Initialize data member checkpoint_.
12114 (Output_section::~Output_section): Delete checkpoint object pointed
12115 by checkpoint_.
12116 (Output_section::add_input_section): Always add an Input_section if
12117 relaxing.
12118 (Output_section::add_merge_input_section): Add assert.
12119 (Output_section::relax_input_section): New method definition.
12120 (Output_section::set_final_data_size): Set load address to zero for
12121 an unallocated section.
12122 (Output_section::do_address_and_file_offset_have_reset_values):
12123 New method definition.
12124 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12125 Handle relaxed input section.
12126 (Output_section::sort_attached_input_sections): Checkpoint input
12127 section list lazily.
12128 (Output_section::get_input_sections): Change type of input_sections to
12129 list of Simple_input_section pointers. Checkpoint input section list
12130 lazily. Also handle relaxed input sections.
12131 (Output_section::add_input_section_for_script): Take a reference to
12132 a Simple_input_section object instead of Relobj pointer and section
12133 index as parameter. Handle relaxed input sections.
12134 (Output_section::save_states, Output_section::restore_states): New
12135 method definitions.
12136 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12137 (Output_data::is_data_size_fixed): New method definition.
12138 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12139 if it is fixed.
12140 (Output_data::address_and_file_offset_have_reset_values): New method
12141 definition.
12142 (Output_data::do_address_and_file_offset_have_reset_values): New method
12143 definition.
12144 (Output_data::set_data_size): Check that data size is not fixed.
12145 (Output_data::fix_data_size): New method definition.
12146 (Output_data::is_data_size_fixed_): New data member.
12147 (Output_section_headers::set_final_data_size): New method definition.
12148 (Output_section_headers::do_size): New method declaration.
12149 (Output_segment_headers::set_final_data_size): New method definition.
12150 (Output_segment_headers::do_size): New method declaration.
12151 (Output_file_header::set_final_data_size)::New method definition.
12152 (Output_file_header::do_size)::New method declaration.
12153 (Output_section_data::Output_section_data): Add new parameter
12154 is_data_size_fixed and use it to fix data size.
12155 (Output_data_const::Output_data_const): Adjust call to base class
12156 constructor and fix data size.
12157 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12158 base class constructor and fix data size.
12159 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12160 base class constructor and fix data size.
12161 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12162 class constructor and fix data size.
12163 (Output_data_group::set_final_data_size): New method definition.
12164 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12165 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12166 class constructor and fix data size.
12167 (Output_relaxed_input_section): New class definition.
12168 (Output_section::Simple_input_section): New class definition.
12169 (Output_section::get_input_sections): Adjust parameter list.
12170 (Output_section::add_input_section_for_script): Same.
12171 (Output_section::save_states, Output_section::restore_states,
12172 Output_section::do_address_and_file_offset_have_reset_values,
12173 (Output_section::Input_section::Input_section): Handle
12174 RELAXED_INPUT_SECTION_CODE. Add new overload for
12175 Output_relaxed_input_section.
12176 (Output_section::Input_section::is_input_section,
12177 Output_section::Input_section::set_output_section): Handle relaxed
12178 input section.
12179 (Output_section::Input_section::is_relaxed_input_section,
12180 Output_section::Input_section::output_section_data,
12181 Output_section::Input_section::relaxed_input_section): New method
12182 definitions.
12183 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12184 value.
12185 (Output_section::Input_section::u1_): Update comments.
12186 (Output_section::Input_section::u2_): Add new union member poris.
12187 (Output_section::Checkpoint_output_section): New classs definition.
12188 (Output_section::relax_input_section): New method declaration.
12189 (Output_section::checkpoint_): New data member.
12190 (Output_segment): Update comments.
12191 (Output_segment::Output_segment): Un-privatize copy constructor.
12192 (Output_segment::operator=): Un-privatize.
12193 * script-sections.cc (Output_section_element::Input_section_list):
12194 Change element type to Output_section::Simple_input_section.
12195 (Output_section_element_dot_assignment::set_section_addresses):
12196 Register output section data for relaxation clean up.
12197 (Output_data_exression::Output_data_expression): Adjust call to base
12198 constructor to fix data size.
12199 (Output_section_element_data::set_section_addresses): Register
12200 Output_data_expression object for relaxation clean up.
12201 (struct Input_section_info): Replace Relobj pointer and section index
12202 pair with Output_section::Simple_input_section and Convert struct to a
12203 class.
12204 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12205 Input_section_info data member to use accessors.
20e6d0d6
DK
12206 (Output_section_element_input::set_section_addresses): Use layout
12207 parameter. Adjust code to use Output_section::Simple_input_section
12208 and Input_secction_info classes. Register filler for relaxation
12209 clean up.
12210 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12211 and section index pair with Output_section::Simple_input_section
12212 class. Adjust code accordingly.
12213 (Phdrs_element::release_segment): New method definition.
12214 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12215 segment list.
12216 (Script_sections::release_segments): New method definition.
12217 * gold/script-sections.h (Script_sections::release_segments): New
12218 method declaration.
12219 * gold/target.h (Target::may_relax, Target::relax,
12220 Target::do_may_relax, Target::do_relax): New method definitions.
12221
5e445df6
ILT
122222009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12223
12224 * arm.cc (has_signed_unsigned_overflow): New function.
12225 (Arm_relocate_functions::abs8): New function.
12226 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12227 (Target_arm::Scan::global): Likewise.
12228 (Target_arm::relocate::relocate): Likewise.
12229 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12230 Likewise.
12231
8c604651 122322009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12233
12234 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12235 * testsuite/Makefile.in: Regenerate.
12236
1e9cc1c2
NC
122372009-09-11 Nick Clifton <nickc@redhat.com>
12238
12239 * po/gold.pot: Updated by the Translation project.
12240
6a89f575
CC
122412009-09-08 Cary Coutant <ccoutant@google.com>
12242
12243 * output.cc (Output_file::open): Add execute permission to empty file.
12244 * testsuite/Makefile.am (permission_test): New test.
12245 * testsuite/Makefile.in: Regenerate.
12246
fdcac5af
ILT
122472009-09-02 Ian Lance Taylor <iant@google.com>
12248
12249 * output.cc (Output_file::resize): Call map_no_anonymous rather
12250 than map.
12251
44453f85
ILT
122522009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12253
12254 * gold.cc: Include "incremental.h".
12255 (queue_initial_tasks): Call Incremental_checker methods.
12256 * incremental.cc: Include "output.h".
12257 (Incremental_checker::can_incrementally_link_output_file): New
12258 method.
12259 * incremental.h (Incremental_checker): New class.
12260
12261 * output.cc (Output_file::open_for_modification): New method.
12262 (Output_file::map_anonymous): Changed return type to bool. Record
12263 map in base_ field.
12264 (Output_file::map_no_anonymous): New method, broken out of map.
12265 (Output_file::map): Use map_no_anonymous and map_anonymous.
12266 * output.h (class Output_file): Update declarations.
12267
293c1386
CC
122682009-08-24 Cary Coutant <ccoutant@google.com>
12269
12270 * options.h (Command_line::Pre_options): New class.
12271 (Command_line::pre_options): New member.
12272 * options.cc (gold::options::ready_to_register): New variable.
12273 (One_option::register_option): Do nothing if not registering options.
12274 Assert if same short option registered twice.
12275 (General_options::General_options): Turn off option registration when
12276 done constructing.
12277 (Command_line::Pre_options::Pre_options): New constructor.
12278
f773f3d2
CC
122792009-08-24 Cary Coutant <ccoutant@google.com>
12280
06a73cfe
CC
12281 * options.h (General_options::no_keep_memory): Remove incorrect
12282 short option.
f773f3d2 12283
a15af8e2
RW
122842009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12285
12286 * Makefile.am (am__skiplex, am__skipyacc): New.
12287 * Makefile.in: Regenerate.
12288
c462b41b
RW
122892009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12290
14ec8efd
RW
12291 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12292 (INCLUDES): ... this.
12293 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12294 (AM_CPPFLAGS): Renamed from ...
12295 (INCLUDE): ... this.
12296 * Makefile.in, testsuite/Makefile.in: Regenerate.
12297
81ecdfbb
RW
12298 * Makefile.in: Regenerate.
12299 * aclocal.m4: Likewise.
12300 * config.in: Likewise.
12301 * configure: Likewise.
12302 * testsuite/Makefile.in: Likewise.
12303
c462b41b
RW
12304 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12305 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12306 * Makefile.in: Regenerate.
12307 * testsuite/Makefile.in: Regenerate.
12308
2da73f13
CC
123092009-08-19 Cary Coutant <ccoutant@google.com>
12310
12311 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12312 symbols in shared libraries overridden by hidden or internal symbols
12313 in the main program.
12314
2db70501
CD
123152009-08-19 Chris Demetriou <cgd@google.com>
12316
12317 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12318 checking source file names in error messages.
12319
f733487b
DK
123202009-08-18 Doug Kwan <dougkwan@google.com>
12321
12322 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12323 an elcpp::Ehdr as parameter. Adjust call to set_target.
12324 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12325 an elfcpp::Ehdr as parameter.
12326 * object.cc (Object::set_target): Remove the version that looks up
12327 a target and sets it.
12328 (Sized_relobj::setup): Take a Target object instead of
12329 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12330 (make_elf_sized_object): Find target and ask target to
12331 make an ELF object.
12332 * object.h: (Object::set_target): Remove the version that looks up
12333 a target and sets it.
12334 (Sized_relobj::setup): Take a Target object instead of
12335 an elfcpp:Ehdr as parameter.
12336 * target.cc: Include dynobj.h.
12337 (Target::do_make_elf_object_implementation): New.
2e702c99 12338 (Target::do_make_elf_object): New.
f733487b
DK
12339 * target.h (Target::make_elf_object): New template declaration.
12340 (Target::do_make_elf_object): New method declarations.
12341 (Target::do_make_elf_object_implementation): New template declaration.
12342
cc70f101
ILT
123432009-08-14 Ian Lance Taylor <iant@google.com>
12344
12345 * gold.h (FUNCTION_NAME): Define.
12346 (gold_unreachable): Use FUNCTION_NAME.
12347
ef5e0cb1
ST
123482009-08-12 Sriraman Tallam <tmsriram@google.com>
12349
12350 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12351 symbol in the --keep-unique list is not found.
12352
48c187ce
ST
123532009-08-12 Sriraman Tallam <tmsriram@google.com>
12354
12355 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12356 been maked as --keep-unique.
12357 (Icf::unfold_section): New function.
12358 * icf.h (Icf::unfold_section): New function.
12359 * options.h (General_options::keep_unique): New option.
12360 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12361 * testsuite/Makefile.in: Regenerate.
12362 * testsuite/icf_keep_unique_test.sh: New file.
12363 * testsuite/icf_keep_unique_test.cc: New file.
12364
645afe0c
CC
123652009-08-12 Cary Coutant <ccoutant@google.com>
12366
12367 PR 10471
12368 * resolve.cc (Symbol_table::resolve): Check for references from
12369 dynamic objects to hidden and internal symbols.
12370 * testsuite/Makefile.am (hidden_test.sh): New test.
12371 * testsuite/Makefile.in: Regenerate.
12372 * testsuite/hidden_test.sh: New script.
12373 * testsuite/hidden_test_1.c: New test source.
12374 * testsuite/hidden_test_main.c: New test source.
12375
11af873f
DK
123762009-08-11 Doug Kwan <dougkwan@google.com>
12377
12378 * arm.cc: Update comments.
12379 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12380 segment to locate the .ARM.exidx section if present.
12381
b9f7d72d
DK
123822009-08-09 Doug Kwan <dougkwan@google.com>
12383
12384 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12385 patch.
12386
ddd3c53c
ST
123872009-08-07 Sriraman Tallam <tmsriram@google.com>
12388 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12389 compiler warnings.
12390
27721062
ST
123912009-08-06 Sriraman Tallam <tmsriram@google.com>
12392
12393 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12394 valid tls_segment only for non-debug-section relocations.
12395 * testsuite/Makefile.am: Add gc_tls_test.
12396 * testsuite/Makefile.in: Regenerate.
12397 * testsuite/gc_tls_test.cc: New file.
12398 * testsuite/gc_tls_test.sh: New file.
12399
ef15dade 124002009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12401
ef15dade
ST
12402 * icf.cc: New file.
12403 * icf.h: New file.
12404 * Makefile.am (CCFILES): Add icf.cc.
12405 (HFILES): Add icf.h
12406 * Makefile.in: Regenerate.
12407 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12408 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12409 section, symbol and addend information for the relocs.
12410 * gold.cc (queue_middle_tasks): Call identical code folding.
12411 * gold.h: Add defines for multimap.
12412 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12413 to the call of finalize_local_symbols.
12414 * main.cc (main): Create object of class Icf.
12415 * object.cc (Sized_relobj::do_layout): Allow this function to be
12416 called twice during icf.
12417 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12418 to sections marked as identical by icf.
12419 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12420 when available.
12421 (Sized_relobj::do_section_entsize): New function.
12422 * object.h (Object::section_entsize): New function.
12423 (Object::do_section_entsize): New pure virtual function.
12424 (Relobj::finalize_local_symbols): Add new parameter.
12425 (Relobj::do_section_entsize): New function.
12426 * options.h (General_options::icf): New option.
12427 (General_options::icf_iterations): New option.
12428 (General_options::print_icf_sections): New option.
12429 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12430 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12431 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12432 icf.
12433 * symtab.cc (Symbol_table::is_section_folded): New function.
12434 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12435 to sections marked as identical by icf.
12436 * symtab.h (Symbol_table::set_icf): New function.
12437 (Symbol_table::icf): New function.
12438 (Symbol_table::is_section_folded): New function.
12439 (Symbol_table::icf_): New data member.
12440 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12441 * testsuite/Makefile.am: Add commands to build icf_test.
12442 * testsuite/Makefile.in: Regenerate.
12443 * testsuite/icf_test.sh: New file.
12444 * testsuite/icf_test.cc: New file.
12445
c3b65ac4
CD
124462009-07-24 Chris Demetriou <cgd@google.com>
12447
12448 * layout.cc (is_compressible_debug_section): Fix incorrect
12449 comment about compressed section names.
12450
1caf2c51
ILT
124512009-07-20 Ian Lance Taylor <ian@airs.com>
12452
12453 PR 10419
12454 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12455
1ef4d87f
ILT
124562009-07-16 Ian Lance Taylor <iant@google.com>
12457
12458 PR 10400
12459 * layout.h: #include <map>.
12460 (class Kept_section): Change from struct to class. Add accessors
12461 and setters. Add section size to Comdat_group mapping. Change
12462 Comdat_group to std::map. Add is_comdat_ field. Add
12463 linkonce_size field in union.
12464 (class Layout): Update declaration of find_or_add_kept_section.
12465 Don't declare find_kept_object.
12466 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12467 parameter. Add object, shndx, is_comdat, and is_group_name
12468 parameters. Change all callers. Adjust for new Kept_section.
12469 (Layout::find_kept_object): Remove.
12470 * object.cc (Sized_relobj::include_section_group): Update use of
12471 Kept_section. Rename secnum to shndx. Only record
12472 Kept_comdat_section if sections are the same size.
12473 (Sized_relobj::include_linkonce_section): Update use of
12474 Kept_section. Only record Kept_comdat_section if sections are the
12475 same size. Set size of linkonce section.
12476 (Sized_relobj::map_to_kept_section): Update call to
12477 get_kept_comdat_section.
12478 * object.h (class Sized_relobj): Rename fields in
12479 Kept_comdat_section to drop trailing underscores; change object
12480 field to Relobj*. Change Kept_comdat_section_table to store
12481 struct rather than pointer.
12482 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12483 Add kept_object and kept_shndx parameters. Change all callers.
12484 (Sized_relobj::get_kept_comdat_section): Change return type to
12485 bool. Add kept_object and kept_shndx parameters. Change all
12486 callers.
12487 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12488 Layout::find_or_add_kept_section.
12489
37c3b7b0
ILT
124902009-07-09 Ian Lance Taylor <iant@google.com>
12491
12492 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12493 Reserve space in the hash table.
12494
98fa85cb
ILT
124952009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12496
12497 * fileread.cc (File_read::get_mtime): New method.
12498 * fileread.h (Timespec): New structure.
12499 (File_read::get_mtime): New method.
12500 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12501 Renamed from timestamp_nsec.
12502 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12503 Elf_Xword.
e1df38aa 12504 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12505 timestamp_nsec.
e1df38aa 12506 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12507 (Incremental_inputs::report_obejct): Save mtime; style fix.
12508 (Incremental_inputs::report_script): Save mtime; style fix.
12509 (Incremental_inputs::finalize_inputs): Style fix.
12510 (Incremental_inputs::finalize): Style fix.
12511 (Incremental_inputs::create_input_section_data): Store inputs
12512 mtime.
12513 * incremental.h (Incremental_inputs::report_script): Add mtime
12514 argument.
12515 (Incremental_inputs::Input_info::Input_info): Intialize only one
12516 union member.
12517 (Incremental_inputs::Input_info::archive): Move to nameless
12518 union.
12519 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12520 (Incremental_inputs::Input_info::script): Move to nameless union.
12521 (Incremental_inputs::mtime): New field.
12522 * script.cc (read_input_script): Pass file mtime to
12523 Incremental_input.
12524 * script.h (Script_info::inputs): Style fix.
12525
c9d70757
ILT
125262009-07-01 Ian Lance Taylor <ian@airs.com>
12527
12528 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12529 instead of 32.
12530
9c547ec3
ILT
125312009-06-24 Ian Lance Taylor <iant@google.com>
12532
12533 PR 10156
12534 * layout.cc (Layout::choose_output_section): If we find an
12535 existing section, update the flags.
12536 (Layout::create_notes): New function, broken out of
12537 Layout::finalize.
12538 (Layout::finalize): Don't create note sections.
12539 (Layout::create_note): Don't crash if linker script discards
12540 section.
12541 (Layout::create_gold_note): Likewise.
12542 (Layout::create_build_id): Likewise. Don't set
12543 after_input_sections on the section.
12544 (Layout::create_executable_stack_info): Remove target parameter.
12545 Change caller.
12546 * layout.h (class Layout): Declare create_notes. Update
12547 declaration of create_executable_stack_info.
12548 * gold.cc (queue_middle_tasks): Call create_notes.
12549 * output.cc (Output_section::update_flags_for_input_section): Move
12550 here from output.h. If SHF_ALLOC flag is newly set, mark address
12551 invalid.
12552 * output.h (Output_data::mark_address_invalid): New function.
12553 (class Output_section): Only declare, not define,
12554 update_flags_for_input_section. Remove set_flags.
12555
55458500
ILT
125562009-06-24 Ian Lance Taylor <iant@google.com>
12557
12558 * script-sections.cc (Output_section_definition::
12559 set_section_addresses): Rename shadowing local load_address to
12560 laddr.
12561
1307d6cd
ILT
125622009-06-24 Ian Lance Taylor <iant@google.com>
12563
12564 PR 10244
12565 * reloc.cc (relocate_sections): Skip empty relocation sections.
12566
ec3f783e
ILT
125672009-06-23 Ian Lance Taylor <iant@google.com>
12568
12569 PR 10156
12570 * layout.cc (Layout::create_note): Use choose_output_section
12571 rather than make_output_section.
12572
459c9f1c
ILT
125732009-06-23 Ian Lance Taylor <iant@google.com>
12574
12575 PR 10237
12576 * options.cc (General_options::parse_V): Set printed_version_.
12577 (General_options::General_options): Initialize printed_version_.
12578 * options.h (class General_options): Add printed_version_ field.
12579 * gold.cc (queue_initial_tasks): If there are no input files,
12580 don't give a fatal error if we printed the version information.
12581 (queue_middle_tasks): If using -r with a shared object, give a
12582 fatal error rather than an ordinary error.
12583
1518dc8f
ILT
125842009-06-23 Ian Lance Taylor <iant@google.com>
12585
12586 PR 10219
12587 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12588 (Layout::make_output_section): Set have_stabstr_section_ if we see
12589 a .stab*str section.
12590 (Layout::finalize): Call link_stabs_sections.
12591 (Layout::link_stabs_sections): New file.
12592 * layout.h (class Layout): Add have_stabstr_section_ field.
12593 Declare link_stabs_sections.
12594
3d857b98
DK
125952009-06-23 Doug Kwan <dougkwan@google.com>
12596
12597 * Makefile.am (libgold_a_LIBADD): New.
12598 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12599 * Makefile.in: Regenerate.
3d857b98
DK
12600 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12601 * configure: Regenerate.
12602 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12603 * fileread.cc: Include sys/state.h
12604 * gold.h: Declare memmem and strndup if found missing.
12605 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12606
0639a6f6
ILT
126072009-06-23 Ian Lance Taylor <iant@google.com>
12608
12609 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12610 * configure: Rebuild.
12611
8d63875c
ILT
126122009-06-23 Ian Lance Taylor <iant@google.com>
12613
12614 PR 10147
12615 * object.cc (Object::section_contents): Don't try to get a view if
12616 the section has length zero.
12617 (Object::handle_gnu_warning_section): If the section is empty, use
12618 the name of the section as the warning.
12619
f7c8a183
ILT
126202009-06-23 Ian Lance Taylor <iant@google.com>
12621
12622 PR 10133
12623 * stringpool.h (class Stringpool_template): Add optimize_ field.
12624 (Stringpool_template::set_optimize): New function.
12625 * stringpool.cc (Stringpool_template::Stringpool_template):
12626 Initialize optimize_ field.
12627 (Stringpool_template::set_string_offsets): Test local optimize
12628 fild rather than parameter.
12629 * layout.cc (Layout::Layout): Call set_optimize on the section
12630 name stringpool.
12631
e6a307ba
ILT
126322009-06-22 Ian Lance Taylor <iant@google.com>
12633
12634 PR 10030
12635 * yyscript.y: Parse TARGET.
12636 * script.cc (script_set_target): New function.
12637 * script-c.h (script_set_target): Declare.
12638 * options.cc (General_options::string_to_object_format): Rename
12639 from string_to_object_format in anonymous namespace. Change
12640 callers.
12641 * options.h (class General_options): Declare
12642 string_to_object_format.
12643
3ee173de
ILT
126442009-06-22 Ian Lance Taylor <iant@google.com>
12645
12646 * script-sections.cc (Script_sections::create_segments): Don't put
12647 program headers in a PT_LOAD segment if -n or -N.
12648
126492009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
12650
12651 PR 10141
12652 * options.h (class General_options): Add -z lazy and -z now. Sort
12653 -z options into alphabetical order.
12654 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12655
cd6739a1 126562009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
12657
12658 * layout.cc (Layout::make_output_section): Call
12659 Target::new_output_section.
12660 (Layout::attach_allocated_section_to_segment): Put large section
12661 sections in a separate load segment with the large segment flag
12662 set.
12663 (Layout::segment_precedes): Sort large data segments after other
12664 load segments.
12665 (align_file_offset): New static function.
12666 (Layout::set_segment_offsets): Use align_file_offset.
12667 * output.h (class Output_section): Add is_small_section_ and
12668 is_large_section_ fields.
12669 (Output_section::is_small_section): New function.
12670 (Output_section::set_is_small_section): New function.
12671 (Output_section::is_large_section): New function.
12672 (Output_section::set_is_large_section): New function.
12673 (Output_section::is_large_data_section): New function.
12674 (class Output_segment): Add is_large_data_segment_ field.
12675 (Output_segment::is_large_data_segment): New function.
12676 (Output_segment::set_is_large_data_segment): New function.
12677 * output.cc (Output_section::Output_section): Initialize new
12678 fields.
12679 (Output_segment::Output_segment): Likewise.
12680 (Output_segment::add_output_section): Add assertion that large
12681 data sections always go in large data segments. Force small data
12682 sections to the end of the list of data sections. Force small BSS
12683 sections to the start of the list of BSS sections. For large BSS
12684 sections to the end of the list of BSS sections.
12685 * symtab.h (class Symbol): Declare is_common_shndx.
12686 (Symbol::is_defined): Check Symbol::is_common_shndx.
12687 (Symbol::is_common): Likewise.
12688 (class Symbol_table): Define enum Commons_section_type. Update
12689 declarations. Add small_commons_ and large_commons_ fields.
12690 * symtab.cc (Symbol::is_common_shndx): New function.
12691 (Symbol_table::Symbol_table): Initialize new fields.
12692 (Symbol_table::add_from_object): Put small and large common
12693 symbols in the right list.
12694 (Symbol_table::sized_finalized_symbol): Check
12695 Symbol::is_common_shndx.
12696 (Symbol_table::sized_write_globals): Likewise.
12697 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12698 common symbol lists. Don't call do_allocate_commons_list if the
12699 list is empty.
12700 (Symbol_table::do_allocate_commons_list): Remove is_tls
12701 parameter. Add comons_section_type parameter. Change all
12702 callers. Handle small and large common symbols.
12703 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12704 Symbol::is_common_shndx.
12705 * resolve.cc (symbol_to_bits): Likewise.
12706 * target.h (Target::small_common_shndx): New function.
12707 (Target::small_common_section_flags): New function.
12708 (Target::large_common_shndx): New function.
12709 (Target::large_common_section_flags): New function.
12710 (Target::new_output_section): New function.
12711 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12712 small_common_section_flags, and large_common_section_flags
12713 fields.
12714 (Target::do_new_output_section): New virtual function.
12715 * arm.cc (Target_arm::arm_info): Initialize new fields.
12716 * i386.cc (Target_i386::i386_info): Likewise.
12717 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12718 Likewise.
12719 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12720 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12721 (Target_x86_64::do_new_output_section): New function.
12722 * configure.ac: Define conditional MCMODEL_MEDIUM.
12723 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12724 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12725 (large_LDFLAGS): Define.
12726 * testsuite/large.c: New file.
12727 * testsuite/testfile.cc (Target_test::test_target_info):
12728 Initialize new fields.
12729 * configure, testsuite/Makefile.in: Rebuild.
12730
bb04269c
DK
127312009-06-05 Doug Kwan <dougkwan@google.com>
12732
12733 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 12734 * Makefile.in: Regenerate.
bb04269c
DK
12735 * i386.cc (class Target_i386): Define new virtual method to
12736 override do_is_local_label_name in parent.
12737 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12738 local symbols if --discard-locals or -X is given.
12739 * options.h (class General_options): Declare new options
12740 '--discard-locals' and '-X' for discarding locals.
12741 * target.h (class Target): Define new methods is_local_label_name.
12742 Declare new virtual method do_is_local_label_name.
12743 * target.cc: New file.
12744 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12745 (check_SCRIPTS): Add discard_locals_test.sh.
12746 (check_DATA): Add discard_local_tests.syms.
12747 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12748 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12749 * testsuite/Makefile.in: Regenerate.
12750 * testsuite/discard_locals_test.c: New file.
12751 * testsuite/discard_locals_test.sh: Same.
12752
805bb01c
DK
127532009-06-05 Doug Kwan <dougkwan@google.com>
12754
12755 * object.cc (Sized_relobj::Sized_relobj): Initialize
12756 discarded_eh_frame_shndx_ to -1U.
12757 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12758 section.
12759 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12760 a discarded .eh_frame section.
12761 (Sized_relobj::do_finalize_local_symbols): Ditto.
12762 * object.h (class Sized_relobj): Declare new member
12763 discarded_eh_frame_shndx_.
12764 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12765 (local_labels_test.o, local_labels_test): New rules.
12766 * testsuite/Makefile.in: Regenerate.
12767
1dcd334d
DK
127682009-06-04 Doug Kwan <dougkwan@google.com>
12769
12770 * layout.cc (Layout::section_name_mapping): Add mapping for
12771 special ARM sections.
12772
96d49306
DK
127732009-06-03 Doug Kwan <dougkwan@google.com>
12774
12775 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12776 (utils::has_overflow): Same.
12777
dff16297
ILT
127782009-06-03 Ian Lance Taylor <iant@google.com>
12779
12780 * layout.cc (Layout::section_name_mapping): New array, replacing
12781 Layout::linkonce_mapping.
12782 (Layout::section_name_mapping_count): New variable, replacing
12783 Layout::linkonce_mapping_count.
12784 (Layout::linkonce_output_name): Remove.
12785 (Layout::output_section_name): Rewrite.
12786 * layout.h (class Layout): Rename Linkonce_mapping to
12787 Section_name_mapping, linkonce_mapping to section_name_mapping,
12788 linkonce_mapping_count to section_name_mapping_count. Don't
12789 declare linkonce_output_name.
12790
c121c671
DK
127912009-06-03 Doug Kwan <dougkwan@google.com>
12792
12793 * gold/arm.cc (namespace utils): New.
12794 (Target_arm::reloc_is_non_pic): Define new method.
12795 (class Arm_relocate_functions): New.
12796 (Target_arm::Relocate::relocate): Handle relocation types used by
12797 Android.
12798
07800fab
ILT
127992009-06-03 Ian Lance Taylor <iant@google.com>
12800
12801 * arm.cc (Target_arm::scan::global): Use || instead of |.
12802
c121c671
DK
128032009-06-02 Doug Kwan <dougkwan@google.com>
12804
12805 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
12806 issued_non_pic_error_.
12807 (class Target_arm::Scan): Declare new method check_non_pic.
12808 Define new method symbol_needs_plt_entry.
12809 Declare new data member issued_non_pic_error_.
12810 (class Target_arm::Relocate): Declare new method
12811 should_apply_static_reloc.
12812 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
12813 (Target_arm::Scan::check_non_pic): Define new method.
12814 (Target_arm::Scan::local): Handle a small subset of reloc types used
12815 by Android.
12816 (Target_arm::Scan::local): Same.
12817 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
12818
b19b0c6d
ILT
128192009-05-31 Mikolaj Zalewski <mikolajz@google.com>
12820
12821 * incremental.cc (Incremental_inputs::report_command_line): Filter
12822 out --incremental-* options.
12823
94cdfcff
DK
128242009-05-29 Doug Kwan <dougkwan@google.com>
12825
12826 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
12827 template class.
12828 (class Target_arm): Update comment.
12829 (Target_arm::Target_arm): Initialize new data members GOT_,
12830 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
12831 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
12832 and Target_arm::rel_dyn_section.
12833 Declare new_enum Target_arm::Got_type.
12834 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
12835 and DYNBSS_.
12836 Update commments for member do_dynsym_value.
12837 (Target_arm::got_size, Target_arm::plt_section,
12838 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
12839 new methods inside class defintion.
12840 (Target_arm::got_section): Define new method.
12841 (Target_arm::rel_dyn_section): Same.
12842 (Output_data_plt_arm): New template class.
12843 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
12844 (Output_data_plt_arm:do_adjust_output_section): Define new method.
12845 (Output_data_plt_arm::add_entry): Same.
12846 (Output_data_plt_arm::first_plt_entry): Define new
12847 static data member for PLT instruction template.
12848 (Output_data_plt_arm::plt_entry): Same.
12849 (Output_data_plt_arm::do_write): Define new method.
12850 (Target_arm::make_plt_entry): Same.
12851 (Target_arm::do_finalize_sections): Same.
12852 (Target_arm::do_dynsym_value): Same.
12853
4a657b0d
DK
128542009-05-28 Doug Kwan <dougkwan@google.com>
12855
12856 * Makefile.am (TARGETSOURCES): Add arm.cc.
12857 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
12858 * Makefile.in: Regenerate.
12859 * arm.cc: New file.
12860 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
12861
e7ae8c36
DK
128622009-05-26 Doug Kwan <dougkwan@google.com>
12863
12864 * options.cc (General_options::parse_exclude_libs). Fix a comment.
12865 (General_options::check_excluded_libs): Strip off directories in
12866 archive name before matching like GNU ld does.
12867 * testsuite/Makefile.am (MOSTLYCLEANFILES,
12868 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
12869 (exclude_libs_test_LDFLAGS): Add linker option
12870 -Wl,--exclude-libs,libexclude_libs_test_3
12871 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
12872 an explicit archive without using -l.
12873 (alt/libexclude_libs_test_3.a): New make rule.
12874 * testsuite/Makefile.in: Regenerate.
12875 * testsuite/exclude_libs_test.c : Declare lib3_default().
12876 (main): Call it.
12877 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
12878 * exclude_libs_test_3.c: New file.
12879
f12e7348
NC
128802009-05-26 Nick Clifton <nickc@redhat.com>
12881
12882 * po/id.po: New Indonesian translation.
12883 * po/gold.pot: Updated template file.
12884
4daadc0d
ST
128852009-05-22 Sriraman Tallam <tmsriram@google.com>
12886
e1df38aa 12887 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
12888 gc_comdat_test files. Add -Wl,--gc-sections to build
12889 gc_comdat_test.
12890 * testsuite/Makefile.in: Regenerate.
12891 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
12892
531813ad
ST
128932009-05-21 Sriraman Tallam <tmsriram@google.com>
12894
12895 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
12896 kept comdat section was garbage collected.
12897 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
12898 * testsuite/Makefile.in: Regenerate.
12899 * testsuite/gc_comdat_test.sh: New file.
12900 * testsuite/gc_comdat_test_1.cc: New file.
12901 * testsuite/gc_comdat_test_2.cc: New file.
12902
65514900
CC
129032009-05-19 Doug Kwan <dougkwan@google.com>
12904
12905 * archive.cc (Archive::Archive): Move constructor from archive.h
12906 to here. Initialize no_export_.
12907 (Archive::get_elf_object_for_member): Set no_export flag of object.
12908 * archive.h (Archive::Archive): Move constructor body to
12909 archive.cc.
12910 (Archive::no_export): New method.
12911 (Archive::no_export_): New field.
12912 * object.h (Object::Object): Initialize no_export_ to false.
12913 (Object::no_export, Object::set_no_export): New methods.
12914 (Object::no_export_): New field.
12915 * options.cc (General_options::parse_exclude_libs): New method.
12916 (General_options::check_excluded_libs) Same.
12917 * options.h (exclude_libs): New option.
12918 (General_options::check_excluded_libs): New method declaration.
12919 (General_options::excluded_libs_): New field.
12920 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
12921 default or protected visibility if an object has no-export flag set.
12922 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
12923 (check_SCRIPTS): Add exclude_libs_test.sh.
12924 (check_DATA): Add exclude_libs_test.syms.
12925 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
12926 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
12927 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
12928 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
12929 (exclude_libs_test.syms, libexclude_libs_test_1.a,
12930 libexclude_libs_test_2.a): New rules.
12931 * testsuite/Makefile.in: Regenerate.
12932 * testsuite/exclude_libs_test.c: New file.
12933 * testsuite/exclude_libs_test.sh: Ditto.
12934 * testsuite/exclude_libs_test_1.c: Ditto.
12935 * testsuite/exclude_libs_test_2.c: Ditto.
12936
1b77ea50
ILT
129372009-05-15 Ian Lance Taylor <iant@google.com>
12938
12939 * configure.ac: Check for declarations for cases where libiberty.h
12940 checks HAVE_DECL_xxx.
12941 * configure, config.in: Rebuild.
12942
072fe7ce
ILT
129432009-05-15 Mikolaj Zalewski <mikolajz@google.com>
12944
12945 * gold.h (Incremental_argument_list): Remove (invalid) forward
12946 declaration.
12947 * incremental.cc (Incremental_inputs::report_achive): New method.
12948 (Incremental_inputs::report_object): New method.
12949 (Incremental_inputs::report_script): New method.
12950 (Incremental_inputs::finalize_inputs): New method.
12951 (Incremental_inputs::finalize): Call finalize_inputs().
12952 (Incremental_inputs::sized_create_incremental_inputs_section_data):
12953 Create inputs entries.
12954 * incremental.h (Incremental_input_type): New enum.
12955 (Incremental_inputs::Incremental_input): Initialize new fields.
12956 (Incremental_inputs::report_inputs): New method.
12957 (Incremental_inputs::report_achive): New method.
12958 (Incremental_inputs::report_object): New method.
12959 (Incremental_inputs::report_script): New method.
12960 (Incremental_inputs::finalize_inputs): New method.
12961 (Incremental_inputs::Input_info): New struct.
12962 (Incremental_inputs::Input_info_map): New typedef.
12963 (Incremental_inputs::lock_): New field.
12964 (Incremental_inputs::Inputs_): New field.
12965 (Incremental_inputs::Inputs_map): New field.
12966 * main.cc (main): Call Incremental_input::report_inputs.
12967 * options.h (Input_argument_list): Typedef moved from
12968 Input_arguments.
12969 (Input_file_group::Files): Remove, use ::Input_argument_list.
12970 (Input_file_group::Input_argument_list): Remove, use
12971 ::Input_argument_list.
12972 * plugin.cc (Plugin_manager::add_input_file): Add error in
12973 incremental build.
12974 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
12975 functions.
12976 * script.cc (read_input_script): Call
12977 Incremental_input::report_script.
12978 * script.h (Script_info): New class.
12979
b0481b0b
ILT
129802009-04-27 Ian Lance Taylor <iant@google.com>
12981
12982 * x86_64.cc (do_adjust_output_section): Set entsize to
12983 plt_entry_size.
12984
b22a5a41 129852009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
12986
12987 * output.cc (Output_file::close): After short writes, continue
12988 writing from the correct offset in the buffer being written.
12989
40fde488
CD
129902009-04-23 Chris Demetriou <cgd@google.com>
12991
12992 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
12993 * configure: Regenerate.
12994 * config.in: Regenerate.
12995 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
12996 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
12997
3ce2c28e
ILT
129982009-04-21 Mikolaj Zalewski <mikolajz@google.com>
12999
13000 * incremental.cc (Incremental_inputs_header_data): Renamed from
13001 Incremental_input_header_data.
13002 (Incremental_inputs_header_data::data_size): New field.
13003 (Incremental_inputs_header_data::put_input_file_count): Renamed
13004 from input_file_count.
13005 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13006 from command_line_offset.
13007 (Incremental_inputs_header_data::put_reserved): Renamed from
13008 put_reserved.
13009 (Incremental_inputs_entry_data): Renamed from
13010 Incremental_input_entry_data.
13011 (Incremental_inputs_entry_data::data_size): New field.
13012 (Incremental_inputs::report_command_line): New method.
13013 (Incremental_inputs::finalize): New method.
13014 (Incremental_inputs::create_incremental_inputs_data): New method.
13015 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13016 * incremental.h: New file.
13017 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13018 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13019 incremental builds.
703d02da 13020 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13021 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13022 (Layout::create_incremental_info_sections): New method.
13023 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13024 * main.cc (main): Notify Incremental_input of the command line.
13025
e55bde5e
ILT
130262009-04-01 Ian Lance Taylor <iant@google.com>
13027 Mikolaj Zalewski <mikolajz@google.com>
13028
13029 * gold.h (reserve_unordered_map): Define, three versions, one for
13030 each version of Unordered_map.
13031 * layout.cc (Layout::Layout): Remove options parameter. Add
13032 number_of_input_files parameter. Don't initialize options_.
13033 Initialize number_of_input_files_ and resized_signatures_. Move
13034 sections_are_attached_.
13035 (Layout::layout_group): Reserve space for group_signatures_.
13036 (Layout::find_or_add_kept_section): Change name parameter to be a
13037 reference. Resize signatures_ map when it gets large enough.
13038 (Layout::layout_eh_frame): Use parameters->options() instead of
13039 this->options_.
13040 (Layout::make_output_section): Likewise.
13041 (Layout::attach_allocated_section_to_segment): Likewise.
13042 (Layout::finalize, Layout::create_executable_stack): Likewise.
13043 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13044 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13045 * layout.h (class Layout): Update declarations. Remove options_
13046 field. Add number_of_input_files_ and resized_signatures_
13047 fields. Move sections_are_attached_ field.
13048 * main.cc (main): Pass number of input files to Layout
13049 constructor. Don't pass options.
13050
154b857c
ILT
130512009-03-30 Ian Lance Taylor <iant@google.com>
13052
13053 * ffsll.c (ffsll): Correct implementation.
13054
2f35ab9b
ILT
130552009-03-27 Ian Lance Taylor <iant@google.com>
13056
fd03461a
ILT
13057 * ffsll.c: New file.
13058 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13059 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13060 * ftruncate.c (ftruncate): Declare before definition.
13061 * mremap.c (mremap): Likewise.
13062 * pread.c (pread): Likewise.
13063 * configure, Makefile.in, config.in: Rebuild.
13064
2f35ab9b
ILT
13065 * mremap.c: New file.
13066 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13067 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13068 (mremap): Declare if HAVE_MREMAP is not defined.
13069 * configure, Makefile.in, config.in: Rebuild.
13070
33aea2fd
CC
130712009-03-27 Cary Coutant <ccoutant@google.com>
13072
13073 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13074 position independent.
13075 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13076 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13077
6d479619
CC
130782009-03-24 Cary Coutant <ccoutant@google.com>
13079
13080 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13081 an executable.
13082 (needs_dynamic_reloc): Likewise.
13083
afc06bb8
ILT
130842009-03-24 Ian Lance Taylor <iant@google.com>
13085
13086 * yyscript.y (file_cmd): Recognize EXTERN.
13087 (extern_name_list, extern_name_list_body): New nonterminals.
13088 * script.cc (script_add_extern): Define.
13089 * script-c.h (script_add_extern): Declare.
13090
f6060a4d
ILT
130912009-03-24 Rafael Avila de Espindola <espindola@google.com>
13092
13093 * object.cc (is_elf_object): Define.
13094 * object.h (is_elf_object): Declare.
13095 * archive.cc (Archive::get_elf_object_for_member): Call
13096 is_elf_object.
33aea2fd 13097 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13098
26736d8e
ILT
130992009-03-24 Elliott Hughes <enh@google.com>
13100
13101 * output.cc (Output_file::map_anonymous): Define.
13102 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13103 try an anonymous one. Report the size if the mmap fails.
13104 * output.h (class Output_file): Declare map_anonymous.
13105
22fd9730
ILT
131062009-03-24 Ian Lance Taylor <iant@google.com>
13107
13108 * target-select.cc (instantiate_target): Don't acquire the lock if
13109 the instantiated_target_ field has already been set.
13110
cb010894
ILT
131112009-03-23 Ian Lance Taylor <iant@google.com>
13112
7f055c20
ILT
13113 * gold-threads.h (class Initialize_lock): Define.
13114 * gold-threads.cc (class Initialize_lock_once): Define.
13115 (initialize_lock_control): New static variable.
13116 (initialize_lock_pointer): New static variable.
13117 (initialize_lock_once): New static function.
13118 (Initialize_lock::Initialize_lock): Define.
13119 (Initialize_lock::initialize): Define.
13120 * target-select.h: Include "gold-threads.h".
13121 (class Target_selector): Add lock_ and initialize_lock_ fields.
13122 Don't define instantiate_target, just declare it.
13123 * target-select.cc (Target_selector::Target_selector): Initialize
13124 new fields.
13125 (Target_selector::instantiate_target): Define.
13126 * descriptors.h: Include "gold-threads.h".
13127 (class Descriptors): Add initialize_lock_ field.
13128 * descriptors.cc (Descriptors::Descriptors): Initialize new
13129 field.
13130 (Descriptors::open): Use initialize_lock_ field
13131 * errors.h (class Errors): Add initialize_lock_ field.
13132 * errors.cc (Errors::Errors): Initialize new field.
13133 (Errors::initialize_lock): Use initialize_lock_ field.
13134 * powerpc.cc (class Target_selector_powerpc): Remove
13135 instantiated_target_ field. In do_recognize call
13136 instantiate_target rather than do_instantiate_target. In
13137 do_instantiate_target just allocate a new target.
13138 * sparc.cc (class Target_selector_sparc): Likewise.
13139
36959681
ILT
13140 * freebsd.h: New file.
13141 * i386.cc: Include "freebsd.h".
13142 (Target_i386): Derive from Target_freebsd rather than
13143 Sized_target.
13144 (Target_selector_i386): Derive from Target_selector_freebsd rather
13145 than Target_selector.
13146 * x86_64.cc: Include "freebsd.h".
13147 (Target_x86_64): Derive from Target_freebsd rather than
13148 Sized_target.
13149 (Target_selector_x86_64): Derive from Target_selector_freebsd
13150 rather than Target_selector.
13151 * target.h (class Target): Add adjust_elf_header and
13152 do_adjust_elf_header.
13153 * output.cc (Output_file_header:: do_sized_write): Call target
13154 adjust_elf_header routine.
13155 * configure.tgt: Set targ_osabi.
13156 * configure.ac: Define GOLD_DEFAULT_OSABI.
13157 * parameters.cc (Parameters::default_target): Pass
13158 GOLD_DEFAULT_OSABI to select_target.
13159 * target-select.h (class Target_selector): Make instantiate_target
13160 protected rather than private.
13161 * Makefile.am (HFILES): Add freebsd.h.
13162 * configure, Makefile.in, config.in: Rebuild.
13163
cb010894
ILT
13164 * merge.cc (do_add_input_section): Correct pend value. Change
13165 message about last entry not being null terminated from error to
13166 warning.
13167
0e879927
ILT
131682009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13169
13170 * incremental.cc: New file.
13171 * Makefile.am (CCFILES): Add incremental.cc.
13172 * Makefile.in: Rebuild.
13173
41105937
PP
131742009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13175
13176 * layout.cc (Layout::output_section_name): Preserve names
13177 of '.note.' sections.
e1df38aa 13178
60439920
ILT
131792009-03-19 Ian Lance Taylor <iant@google.com>
13180
13181 * descriptors.cc (Descriptors::open): Check that the options are
13182 valid before using them.
13183
0d371ad3
ILT
131842009-03-18 Ian Lance Taylor <iant@google.com>
13185
13186 * script-sections.h: Include <list>.
13187 (class Script_sections): Change Sections_elements from std::vector
13188 to std::list. Typedef public Elements_iterator. Add
13189 orphan_section_placement_, data_segment_align_start_, and
13190 saw_data_segment_align_ fields. Remove data_segment_align_index_
13191 field.
13192 * script-sections.cc (class Orphan_section_placement): New class.
13193 (class Sections_element): Add virtual functions is_relro and
13194 orphan_section_init. Remove virtual function place_orphan_here.
13195 (class Output_section_definition): Add is_relro and
13196 orphan_section_init. Remove place_orphan_here.
13197 (class Orphan_output_section): Likewise.
13198 (Script_sections::Script_sections): Update for field changes.
13199 (Script_sections::data_segment_align): Set saw_data_segment_align_
13200 and data_segment_align_start_, not data_segment_align_index.
13201 (Script_sections::data_segment_relro_end): Check
13202 saw_data_segment_align_. Use data_segment_align_start_ rather
13203 than data_segment_align_index_.
13204 (Script_sections::place_orphan): Rewrite to use
13205 Orphan_section_placement.
13206
9201d894
ILT
132072009-03-17 Ian Lance Taylor <iant@google.com>
13208
9c5b8369
ILT
13209 * archive.cc (Archive::add_symbols): Check for a version attached
13210 to the symbol name in the archive map.
13211 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13212 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13213 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13214 (ver_test_11.a): New target.
13215 * testsuite/Makefile.in: Rebuild.
13216
9201d894
ILT
13217 * configure.ac: Check for chsize and posix_fallocate. Replace
13218 ftruncate.
13219 * ftruncate.c: New file, from gnulib.
13220 * output.cc (posix_fallocate): Define dummy version if not
13221 HAVE_POSIX_FALLOCATE.
13222 (Output_file::map): Call posix_fallocate rather than lseek and
13223 write.
13224 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13225 * configure, Makefile.in, config.in: Rebuild.
13226
ef4ab7a8 132272009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13228
ef4ab7a8
PP
13229 * layout.h (Layout::create_note): Add section_name parameter.
13230 * layout.cc (Layout::create_note): Likewise.
13231 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13232
8c500701
ILT
132332009-03-17 Ian Lance Taylor <iant@google.com>
13234
e85b18e1
ILT
13235 * descriptors.cc: Include "options.h".
13236 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13237 (Descriptors::open): Always use O_CLOEXEC when opening a new
13238 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13239 then set FD_CLOEXEC.
13240
9efe6174
ILT
13241 * sparc.cc (class Target_sparc): Add has_got_section.
13242 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13243 make sure we have a GOT section.
13244
13245 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13246 (Target_sparc::Scan::local): Likewise.
13247 (Target_sparc::Scan::global): Likewise.
13248 (Target_sparc::Relocate::relocate): Likewise.
13249 (Target_sparc::Relocate::relocate_tls): Likewise.
13250
8c500701
ILT
13251 * symtab.cc (Symbol_table::define_default_version): New function,
13252 broken out of add_from_object.
13253 (Symbol_table::add_from_object): Call define_default_version.
13254 (Symbol_table::define_special_symbol): Add resolve_oldsym
13255 parameter. Change all callers. If the version for a symbol comes
13256 from a version script, resolve it with the symbol with the same
13257 name with no version. Also add the symbol without a version if
13258 appropriate.
13259 (do_define_in_output_data): If resolving with oldsym, don't delete
13260 sym.
13261 (do_define_in_output_segment): Likewise.
13262 (do_define_as_constant): Likewise.
13263 * symtab.h (class Symbol_table): Update declarations.
13264
f1ed28fb
ILT
132652009-03-13 Ian Lance Taylor <iant@google.com>
13266
15f8229b
ILT
13267 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13268 (Read_symbols::requeue): New function.
13269 (Read_symbols::do_read_symbols): If make_elf_object fails because
13270 the target type is not configured, and the file was searched for,
13271 issue a warning and retry with the next directory.
13272 (Add_symbols::run): If the file has an incompatible format, and
13273 it was searched for, requeue the Read_symbols task. On error,
13274 release the object.
13275 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13276 dirindex parameter to constructor. Change all callers. Declare
13277 incompatible_warning and requeue.
13278 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13279 input_argument_ and input_group_ fields. Add them to
13280 constructor. Change all callers.
13281 (class Read_script): Add dirindex_ field. Add it to constructor.
13282 Change all callers.
13283 * archive.cc (Archive::setup): Remove input_objects parameter.
13284 Change all callers.
13285 (Archive::get_file_and_offset): Likewise.
13286 (Archive::read_all_symbols): Likewise.
13287 (Archive::read_symbols): Likewise.
13288 (Archive::get_elf_object_for_member): Remove input_objects
13289 parameter. Add punconfigured parameter. Change all callers.
13290 (Archive::add_symbols): Change return type to bool. Check return
13291 value of include_member.
13292 (Archive::include_all_members): Likewise.
13293 (Archive::include_member): Change return type to bool. Return
13294 false if first included object has incompatible target. Set
13295 included_member_ field.
13296 (Add_archive_symbols::run): If add_symbols returns false, requeue
13297 Read_symbols task.
13298 * archive.h (class Archive): Add included_member_ field.
13299 Initialize it in constructor. Add input_file and searched_for
13300 methods. Update declarations.
13301 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13302 input_argument_ fields. Add them to constructor. Change all
13303 callers.
13304 * script.cc: Include "target-select.h".
13305 (class Parser_closure): Add skip_on_incompatible_target_ and
13306 found_incompatible_target_ fields. Add
13307 skip_on_incompatible_target parameter to constructor. Change all
13308 callers. Add methods skip_on_incompatible_target,
13309 clear_skip_on_incompatible_target, found_incompatible_target, and
13310 set_found_incompatible_target.
13311 (read_input_script): Add dirindex parameter. Change all callers.
13312 If parser finds an incompatible target, requeue Read_symbols
13313 task.
13314 (script_set_symbol): Clear skip_on_incompatible_target in
13315 closure.
13316 (script_add_assertion, script_parse_option): Likewise.
13317 (script_start_sections, script_add_phdr): Likewise.
13318 (script_check_output_format): New function.
13319 * script.h (read_input_script): Update declaration.
13320 * script-c.h (script_check_output_format): Declare.
13321 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13322 (ignore_cmd): Remove OUTPUT_FORMAT.
13323 * fileread.cc (Input_file::Input_file): Add explicit this.
13324 (Input_file::will_search_for): New function.
13325 (Input_file::open): Add pindex parameter. Change all callers.
13326 * fileread.h (class Input_file): Add input_file_argument method.
13327 Declare will_search_for. Update declarations.
13328 * object.cc (make_elf_object): Add punconfigured parameter.
13329 Change all callers.
13330 * object.h (class Object): Make input_file public. Add
13331 searched_for method.
13332 (make_elf_object): Update declaration.
13333 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13334 restart search.
13335 * dirsearch.h (class Dirsearch): Update declaration.
13336 * options.h (class General_options): Add --warn-search-mismatch.
13337 * parameters.cc (Parameters::is_compatible_target): New function.
13338 * parameters.h (class Parameters): Declare is_compatible_target.
13339 * workqueue.cc (Workqueue::add_blocker): New function.
13340 * workqueue.h (class Workqueue): Declare add_blocker.
13341
f1ed28fb
ILT
13342 * fileread.cc (Input_file::open): Remove options parameter.
13343 Change all callers.
13344 (Input_file::open_binary): Likewise.
13345 * script.cc (read_input_script): Likewise.
13346 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13347 options parameter from constructor. Change all callers.
13348 (class Read_script): Likewise.
13349 * fileread.h (class Input_file): Update declarations.
13350 * script.h (read_input_script): Update declaration.
13351
34dd024a
NC
133522009-03-10 Nick Clifton <nickc@redhat.com>
13353
13354 * po/es.po: New Spanish translation.
13355
6d71b17c
CC
133562009-03-06 Cary Coutant <ccoutant@google.com>
13357
13358 * options.cc (parse_short_option): Keep dash_z from registering itself.
13359
031cdbed
ILT
133602009-03-03 Ian Lance Taylor <iant@google.com>
13361
13362 PR 9918
13363 * target-reloc.h (relocate_section): Pass output_section to
13364 relocate.
13365 * i386.cc (Target_i386::should_apply_static_reloc): Add
13366 output_section parameter. Change all callers.
13367 (Target_i386::Relocate::relocate): Add output_section parameter.
13368 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13369 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13370 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13371 * testsuite/two_file_shared.sh: New script.
13372 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13373 (check_DATA): Add two_file_shared.dbg.
13374 (two_file_shared.dbg): New target.
13375 * testsuite/Makefile.in: Rebuild.
13376
15d5fa16
ILT
133772009-03-01 Ian Lance Taylor <iant@google.com>
13378
13379 * configure.ac: Check for byteswap.h.
13380 * configure: Rebuild.
13381 * config.in: Rebuild.
13382
8a4c0b0d
ILT
133832009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13384
13385 * layout.cc (Layout::find_or_add_kept_section): New function.
13386 (Layout::add_comdat): Removed.
13387 * layout.h (struct Kept_section): Move out of class Layout.
13388 Remove trailing underscores from field names. Add group_sections
13389 field. Rename group_ field to is_group. Change all uses.
13390 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13391 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13392 comdat_groups_ field.
13393 (Sized_relobj::include_section_group): Use
13394 find_or_add_kept_section and Kept_section::group_sections.
13395 (Sized_relobj::include_linkonce_section): Likewise.
13396 * object.cc (class Sized_relobj): Don't define Comdat_group or
13397 Comdat_group_table. Remove find_comdat_group and
13398 add_comdat_group. Remove comdat_groups_ field.
13399 * plugin.cc (include_comdat_group): Use
13400 Layout::find_or_add_kept_section.
13401
b4ecf66b
ILT
134022009-02-28 Ian Lance Taylor <iant@google.com>
13403
14359ca0
ILT
13404 * README: --gc-sections and map files are now supported. Document
13405 some build requirements.
13406
b4ecf66b
ILT
13407 PR 6992
13408 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13409 relocatable link set the value of the section symbol to zero.
13410 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13411 relocatable link don't include the section address in the local
13412 symbol value.
13413
0602e05a
ILT
134142009-02-27 Ian Lance Taylor <iant@google.com>
13415
fd9d194f
ILT
13416 PR 6811
13417 * options.h (class Search_directory): Add is_system_directory.
13418 (class General_options): Declare is_in_system_directory.
13419 * options.cc (get_relative_sysroot): Make static.
13420 (get_default_sysroot): Make static.
13421 (General_optoins::is_in_system_directory): New function.
13422 * fileread.cc (Input_file::is_in_system_directory): New function.
13423 * fileread.h (class Input_file): Declare is_in_system_directory.
13424 * object.h (class Object): Add is_in_system_directory.
13425 (class Input_objects): Remove system_library_directory_ field.
13426 * object.cc (Input_objects::add_object): Don't set
13427 system_library_directory_.
13428 (input_objects::found_in_system_library_directory): Remove.
13429 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13430 parameter. Change all callers.
13431 (Symbol_table::sized_write_globals): Likewise.
13432 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13433 Call Object::is_in_system_directory.
13434 * symtab.h (class Symbol_table): Update declarations.
13435
61edd21f
ILT
13436 PR 5990
13437 * descriptors.h (Open_descriptor): Add is_on_stack field.
13438 * descriptors.cc (Descriptors::open): If the descriptor is on the
13439 top of the stack, remove it. Initialize is_on_stack field.
13440 (Descriptors::release): Only add pod to stack if it is not on the
13441 stack already.
13442 (Descriptors::close_some_descriptor): Clear stack_next and
13443 is_on_stack fields.
13444
e29e076a
ILT
13445 PR 7091
13446 * output.cc (Output_section::find_starting_output_address): Rename
13447 from starting_output_address; add PADDR parameter; change return
13448 type.
13449 * output.h (class Output_section): Declare
13450 find_starting_output_address instead of starting_output_address.
13451 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13452 section symbol for which we can't find a merge section.
13453
0602e05a
ILT
13454 PR 9836
13455 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13456 hidden or internal, force the symbol to be local.
13457 * resolve.cc (Symbol::override_visibility): Define.
13458 (Symbol::override_base): Use override_visibility.
13459 (Symbol_table::resolve): Likewise.
13460 (Symbol::override_base_with_special): Likewise.
13461 (Symbol_table::override_with_special): If the visibility is hidden
13462 or internal, force the symbol to be local.
13463 * symtab.h (class Symbol): Add set_visibility and
13464 override_visibility.
13465 * testsuite/ver_test_1.sh: New file.
13466 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13467 (check_DATA): Add ver_test_1.syms.
13468 (ver_test_1.syms): New target.
13469 * testsuite/Makefile.in: Rebuild.
13470
401a9a73
CC
134712009-02-25 Cary Coutant <ccoutant@google.com>
13472
13473 * layout.cc (Layout::choose_output_section): Don't rename sections
13474 when using a linker script that has a SECTIONS clause.
13475 * Makefile.in: Regenerate.
13476
13477 * testsuite/Makefile.am (script_test_5.sh): New test case.
13478 * testsuite/Makefile.in: Regenerate.
13479 * testsuite/script_test_5.cc: New file.
13480 * testsuite/script_test_5.sh: New file.
13481 * testsuite/script_test_5.t: New file.
13482
f488e4b0
CC
134832009-02-13 Rafael Avila de Espindola <espindola@google.com>
13484
13485 * archive.cc (Archive::include_member): Update calls to add_symbols.
13486 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13487 the Layout argument.
13488 * dynobj.h (do_add_symbols): Add the Layout argument.
13489 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13490 Layout argument.
13491 * object.h (Object::add_symbols): Add the Layout argument.
13492 (Object::do_add_symbols): Add the Layout argument.
13493 (Sized_relobj::do_add_symbols): Add the Layout argument.
13494 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13495 Unify the two versions.
13496 (Add_plugin_symbols): Remove.
13497 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13498 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13499 (Add_plugin_symbols): Remove.
13500 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13501 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13502 (Add_symbols::run): Make it work with Pulginobj.
13503
89dd1680
ILT
135042009-02-06 Ian Lance Taylor <iant@google.com>
13505
13506 * object.cc (Sized_relobj::do_layout): Make info message start
13507 with lower case letter.
13508
266d0a74
ILT
135092009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13510
602b464e
ILT
13511 * binary.cc: Fix file comment.
13512
266d0a74
ILT
13513 * options.h (enum Incremental_disposition): Define.
13514 (class General_options): Add new options: --incremental,
13515 --incremental_changed, --incremental_unchanged,
13516 --incremental_unknown. Add incremental_disposition_ and
13517 implicit_incremental_ fields.
13518 (General_options::incremental_disposition): New function.
13519 (class Position_dependent_options): Add incremental_disposition
13520 option.
13521 (Position_dependent_options::copy_from_options): Set incremental
13522 dispositions.
13523 * options.cc (General_options::parse_incremental_changed): New
13524 function.
2e702c99
RM
13525 (General_options::parse_incremental_unchanged): New function.
13526 (General_options::parse_incremental_unknown): New function.
13527 (General_options::General_options): Initialize new fields
266d0a74 13528 incremental_disposition_ and implicit_incremental_.
2e702c99 13529 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13530 without --incremental.
13531
f073bbf7
CD
135322009-02-06 Chris Demetriou <cgd@google.com>
13533
13534 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13535 pointer and to report location as the file name associated with
13536 the symbol.
13537 (gold_undefined_symbol_at_location): New function to replace the
13538 old gold_undefined_symbol functionality.
13539 * target-reloc.h (relocate_section): Update to use
13540 gold_undefined_symbol_at_location.
13541 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13542 Call gold_undefined_symbol function rather than gold_error.
13543 * errors.h (Errors::undefined_symbol): Take location as a
13544 string, rather than calculating it from a relocation.
13545 * errors.cc (Errors::fatal): Print "fatal error:" before the
13546 formatted message.
13547 (Errors::error, Errors::error_at_location): Print "error: "
13548 before the formatted message.
13549 (Errors::undefined_symbol): Take location as a string, rather
13550 than calculating it from a relocation.
13551 (gold_undefined_symbol_at_location): New function akin to
13552 old gold_undefined_symbol, calculates location from relocation.
13553 (gold_undefined_symbol): Change to take only a Symbol pointer
13554 and to report location as the file name associated with the symbol.
13555 * testsuite/debug_msg.sh: Update for changed error messages.
13556 * testsuite/undef_symbol.sh: Likewise.
13557
8e94a90c
ILT
135582009-02-04 Duncan Sands <baldrick@free.fr>
13559
13560 PR 9812
13561 * reduced_debug_output.h
13562 (Output_reduced_debug_abbrev_section::failed): Use format for
13563 gold_warning.
13564 (Output_reduced_debug_info_section::faild): Likewise.
13565
88a0e15b
ILT
135662009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13567
13568 * script.cc (Lazy_demangler): New class.
2e702c99 13569 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13570 symbol only once.
13571
5efc7cd2
CC
135722009-01-29 Cary Coutant <ccoutant@google.com>
13573
13574 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13575 to __tls_get_addr.
13576 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13577
e0ebcf42
ILT
135782009-01-28 Ian Lance Taylor <iant@google.com>
13579
5efc7cd2 13580 * version.cc (version_string): Bump to 1.9.
75fe7426 13581
e0ebcf42
ILT
13582 * gold.h: Include <cstring> and <stdint.h>.
13583 * version.cc: Include <cstdio>.
13584 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13585 warning.
13586 * reduced_debug_output.cc (insert_into_vector): Rename from
13587 Insert_into_vector; change all callers. Use Swap_unaligned to
13588 avoid aliasing issue; remove union since it is unnecessary.
13589
8e2813be 135902009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13591
13592 * Makefile.am (CCFILES): Add gc.cc.
13593 (HFILES): Add gc.h.
13594 * Makefile.in: Regenerate.
13595 * gold.cc (Gc_runner): New class.
13596 (queue_initial_tasks): Call garbage collection related tasks
13597 when corresponding options are invoked.
13598 (queue_middle_gc_tasks): New function.
13599 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13600 processed early before laying out sections during garbage collection.
13601 * gold.h (queue_middle_gc_tasks): New function.
13602 (is_prefix_of): Move from "layout.cc".
13603 * i386.cc (Target_i386::gc_process_relocs): New function.
13604 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13605 * main.cc (main): Create object of class "Garbage_collection".
13606 * object.cc (Relobj::copy_symbols_data): New function.
13607 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13608 (Sized_relobj::do_layout): Allow this function to be called twice
13609 during garbage collection and defer layout of section during the
6d03d481
ST
13610 first call.
13611 * object.h (Relobj::get_symbols_data): New function.
13612 (Relobj::is_section_name_included): New function.
13613 (Relobj::copy_symbols_data): New function.
13614 (Relobj::set_symbols_data): New function.
13615 (Relobj::get_relocs_data): New function.
13616 (Relobj::set_relocs_data): New function.
13617 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13618 (Relobj::gc_process_relocs): New function.
13619 (Relobj::do_gc_process_relocs): New pure virtual function.
13620 (Relobj::sd_): New data member.
13621 (Sized_relobj::is_output_section_offset_invalid): New function.
13622 (Sized_relobj::do_gc_process_relocs): New function.
13623 * options.h (General_options::gc_sections): Modify to not be a no-op.
13624 (General_options::print_gc_sections): New option.
13625 * plugin.cc (Plugin_finish::run): Remove function call to
13626 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13627 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13628 * reloc.cc (Read_relocs::run): Add task to process relocs and
13629 determine unreferenced sections when doing garbage collection.
13630 (Gc_process_relocs): New class.
13631 (Sized_relobj::do_gc_process_relocs): New function.
13632 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13633 sections that are garbage collected.
13634 * reloc.h (Gc_process_relocs): New class.
13635 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13636 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13637 symbols whose corresponding sections are garbage collected.
13638 (Symbol_table::Symbol_table): Add new parameter for the garbage
13639 collection object.
13640 (Symbol_table::gc_mark_undef_symbols): New function.
13641 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13642 (Symbol_table::gc_mark_dyn_syms): New function.
13643 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13644 as garbage.
13645 (Symbol_table::add_from_object): Likewise.
13646 (Symbol_table::add_from_relobj): When building shared objects, do not
13647 treat externally visible symbols as garbage.
13648 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13649 table information for static and relocatable links.
13650 * symtab.h (Symbol_table::set_gc): New function.
13651 (Symbol_table::gc): New function.
13652 (Symbol_table::gc_mark_undef_symbols): New function.
13653 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13654 (Symbol_table::gc_mark_dyn_syms): New function.
13655 (Symbol_table::gc_): New data member.
e1df38aa 13656 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
13657 function.
13658 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13659 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13660
3b293544
CF
136612009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13662
13663 * options.h (General_options::gc_sections): Define as a no-op for now.
13664 (General_options::no_keep_memory): Ditto.
13665 (General_options::Bshareable): Define.
13666 * options.cc (General_options::finalize): Honor -Bshareable.
13667
83d22aa8
AS
136682009-01-20 Andreas Schwab <schwab@suse.de>
13669
13670 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13671 read the value in the contents, since we don't use it. Use the
13672 template endianness when writing.
13673 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13674
cd536b21
AS
136752009-01-19 Andreas Schwab <schwab@suse.de>
13676
13677 * configure.tgt (powerpc64-*): Fix targ_obj.
13678
99e9a495
ILT
136792009-01-15 Ian Lance Taylor <iant@google.com>
13680
13681 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13682 local symbols when stripping all symbols.
13683
bbbfea06
CC
136842009-01-14 Cary Coutant <ccoutant@google.com>
13685
99e9a495 13686 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 13687
0f7c0701
CC
136882009-01-14 Cary Coutant <ccoutant@google.com>
13689
13690 * archive.cc (Archive::get_elf_object_for_member): Remove call
13691 to File_read::claim_for_plugin.
13692 * descriptors.cc (Descriptors::open): Remove reference to
13693 is_claimed.
13694 (Descriptors::claim_for_plugin): Remove.
13695 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13696 (Descriptors::is_claimed): Remove.
13697 (claim_descriptor_for_plugin): Remove.
13698 * fileread.cc (File_read::claim_for_plugin): Remove.
13699 * fileread.h (File_read::claim_for_plugin): Remove.
13700 (File_read::descriptor): Reopen descriptor if necessary.
13701 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13702 (Plugin_manager::all_symbols_read): Add task parameter. Change
13703 all callers.
13704 (Plugin_manager::get_input_file): New function.
13705 (Plugin_manager::release_input_file): New function.
13706 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13707 corresponding data member.
13708 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13709 and pass to base constructor. Change all callers.
13710 (get_input_file, release_input_file): New functions.
13711 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13712 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13713 (Plugin_manager::all_symbols_read): Add task parameter.
13714 (Plugin_manager::get_input_file): New function.
13715 (Plugin_manager::release_input_file): New function.
13716 (Plugin_manager::task_): New data member.
13717 (Pluginobj::Pluginobj): Add filesize parameter.
13718 (Pluginobj::filename): New function.
13719 (Pluginobj::descriptor): New function.
13720 (Pluginobj::filesize): New function.
13721 (Pluginobj::filesize_): New data member.
13722 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13723 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13724 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13725
13726 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13727 with archive libraries.
13728 * testsuite/Makefile.in: Regenerate.
13729 * testsuite/plugin_test.c (struct sym_info): New type.
13730 (get_input_file, release_input_file): New static variables.
13731 (onload): Capture new transfer vector entries.
13732 (claim_file_hook): Stop reading at end of file according to filesize.
13733 Factor out parsing of readelf output into separate function.
13734 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13735 APIs and get the source file name from the symbol table. Convert
13736 source file name to corresponding object file name. Print info
13737 message when adding new input files.
13738 (parse_readelf_line): New function.
13739 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13740 * testsuite/plugin_test_2.sh: Likewise.
13741 * testsuite/plugin_test_3.sh: Likewise.
13742 * testsuite/plugin_test_4.sh: New test case.
13743
62a6d109
ILT
137442009-01-07 Ian Lance Taylor <iant@google.com>
13745
13746 * version.cc (version_string): Bump to 1.8.
13747
483620e8
CC
137482008-12-23 Cary Coutant <ccoutant@google.com>
13749
13750 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13751 * plugin.cc (Plugin_manager::finish): Rename as
13752 layout_deferred_objects. Move cleanup to separate function.
13753 (Plugin_manager::cleanup): New function.
13754 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13755 separately.
13756 * plugin.h (Plugin_manager::finish): Rename as
13757 layout_deferred_objects.
13758 (Plugin_manager::cleanup): New function.
13759 (Plugin_manager::cleanup_done): New field.
13760
d66a9eb3
CC
137612008-12-23 Cary Coutant <ccoutant@google.com>
13762
13763 * plugin.cc (is_visible_from_outside): New function.
13764 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13765 so we don't return "IR only" status for exported symbols or -r links.
13766
13767 * testsuite/Makefile.am (plugin_test_3): New test case.
13768 * testsuite/Makefile.in: Regenerate.
13769 * testsuite/plugin_test_3.sh: New file.
13770
5995b570
CC
137712008-12-22 Cary Coutant <ccoutant@google.com>
13772
13773 * object.cc (Sized_relobj::layout_section): New function.
13774 (Sized_relobj::do_layout): Defer layout of input sections until after
13775 plugin has provided replacement files.
13776 (Sized_relobj::do_layout_deferred_sections): New function.
13777 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13778 (Relobj::layout_deferred_sections): New function.
13779 (Relobj::do_layout_deferred_sections): New function.
13780 (Sized_relobj::do_layout_deferred_sections): New function.
13781 (Sized_relobj::layout_section): New function.
13782 (Sized_relobj::Deferred_layout): New structure.
13783 (Sized_relobj::deferred_layout_): New field.
13784 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13785 Change all callers. Layout deferred sections.
13786 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13787 references.
13788 (Plugin_hook::run): Move code from do_plugin_hook inline.
13789 (Plugin_hook::do_plugin_hook): Remove.
13790 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13791 (Plugin_manager::finish): Renamed, was cleanup.
13792 (Plugin_manager::should_defer_layout): New function.
13793 (Plugin_manager::add_deferred_layout_object): New function.
13794 (Plugin_manager::Deferred_layout_list): New type.
13795 (Plugin_manager::deferred_layout_objects_): New field.
13796 (Plugin_hook::do_plugin_hook): Remove.
13797
ee769c88
ILT
137982008-12-17 Ian Lance Taylor <iant@google.com>
13799
13800 * options.h (class General_options): Add --no case for
13801 --export-dynamic.
13802
abc8dcba
CC
138032008-12-16 Cary Coutant <ccoutant@google.com>
13804
13805 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
13806 vector.
13807 (Plugin_manager::claim_file): Create plugin object even if
13808 plugin did not call the add_symbols callback.
13809 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
13810 asking for more symbols than were added.
13811 * testsuite/Makefile.am (plugin_test_1): Add test case with
13812 no global symbols.
13813 (empty.syms): New target.
13814 * testsuite/Makefile.in: Regenerate.
13815 * testsuite/plugin_test.c (claim_file_hook): Add new debug
13816 message. Don't call add_symbols if no globals.
13817 (all_symbols_read_hook): Don't provide replacement for empty
13818 claimed file.
13819
b0074644
ILT
138202008-12-12 Ian Lance Taylor <iant@google.com>
13821
68943102
ILT
13822 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
13823 r_type == 0 for a local symbol with r_sym == 0.
13824 (scan_relocatable_relocs): Pass r_sym to
13825 local_non_section_strategy.
13826 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
13827 r_sym parameter.
13828
b0074644
ILT
13829 * configure.ac: Update test for TLS descriptors: they are
13830 supported as of glibc 2.9.
13831 * configure: Rebuild.
13832
c2508178
ILT
138332008-12-11 Ian Lance Taylor <iant@google.com>
13834
13835 PR 7091
13836 * target-reloc.h (Default_scan_relocatable_relocs): For each
13837 function, map r_type == 0 to RELOC_DISCARD.
13838
2756a258
CC
138392008-12-10 Cary Coutant <ccoutant@google.com>
13840
13841 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
13842 object to override a kept COMDAT group from a plugin object.
13843
bb6f53d3
ILT
138442008-12-09 Ian Lance Taylor <iant@google.com>
13845
fbc558e1
ILT
13846 PR 7088
13847 * yyscript.y (file_cmd): Handle INPUT.
13848
bb6f53d3
ILT
13849 * testsuite/initpri1.c: Change all declarations to be full
13850 prototypes by adding void, to avoid compiler warnings.
13851
4674ecfc
CC
138522008-12-05 Rafael Avila de Espindola <espindola@google.com>
13853
13854 * options.cc (General_options::parse_plugin_opt): New.
13855 (General_options::add_plugin): The argument now is just the filename.
13856 (General_options::add_plugin_option): New.
13857 * options.h (plugin_opt): New.
13858 (add_plugin): Change argument name.
13859 (add_plugin_option): New.
13860 * plugin.cc (Plugin::load): Don't parse the plugin option.
13861 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
13862 (Plugin::add_option): New.
13863 (Plugin::args_): Change type.
13864 (Plugin::filename_): New.
13865 (Plugin_manager::add_plugin_option): New.
13866 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
13867 * testsuite/Makefile.in: Regenerate.
13868
fd06b4aa
CC
138692008-12-05 Cary Coutant <ccoutant@google.com>
13870
13871 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
13872 Handle --strip-lto-sections option.
13873 * options.h (strip_lto_sections): New option.
13874
6c52134c
CC
138752008-12-01 Cary Coutant <ccoutant@google.com>
13876
13877 * plugin.cc (ld_plugin_message): Change format parameter to const.
13878 Fix mismatch between new[] and delete.
13879
a45248e0
CC
138802008-11-14 Cary Coutant <ccoutant@google.com>
13881
13882 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
13883 instead of -1U.
13884
c82fbeee
CS
138852008-11-05 Craig Silverstein <csilvers@google.com>
13886
13887 * options.cc (General_options::parse_dynamic_list): New function.
13888 * options.h (General_options): New flags dynamic_list,
13889 dynamic_list_data, dynamic_list_cpp_new, and
13890 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
13891 (General_options::in_dynamic_list): New function.
13892 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
13893 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
13894 (Lex::can_continue_name): Likewise.
13895 (yylex): Likewise.
13896 (read_script_file): New parameter script_options.
13897 (read_dynamic_list): New function.
13898 (Script_options::define_dynamic_list): New function.
13899 (dynamic_list_keyword_parsecodes): New variable.
13900 (dynamic_list_keywords): New variable.
13901 * script.h (Script_options::define_dynamic_list): New function
13902 prototype.
13903 (read_dynamic_list): New function prototype.
13904 * symtab.cc (strprefix): New macro.
13905 (Symbol::should_add_dynsym_entry): Support dynamic_list,
13906 dynamic_list_data, dynamic_list_cpp_new, and
13907 dynamic_list_cpp_typeinfo.
13908 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
13909 (dynamic_list_expr): New rule.
13910 (dynamic_list_nodes): Likewise.
13911 (dynamic_list_node): Likewise.
13912 * testsuite/Makefile.am (dynamic_list): New test.
13913 * testsuite/Makefile.in: Regenerated.
13914 * testsuite/dynamic_list.t: New file.
13915 * testsuite/dynamic_list.sh: New file.
13916
e0bb29a5
CS
139172008-11-05 Craig Silverstein <csilvers@google.com>
13918
13919 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
13920 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
13921 (t11_last): Likewise.
13922 * testsuite/ver_test_6.c (main): Likewise.
13923
4e1e25e0
CC
139242008-10-07 Cary Coutant <ccoutant@google.com>
13925
13926 * options.c (General_options::finalize): Add check for -static and
13927 -shared.
13928 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
13929 is not empty.
13930
92f03fcb
CC
139312008-10-02 Cary Coutant <ccoutant@google.com>
13932
13933 * plugin.cc (make_sized_plugin_object): Fix conditional
13934 compilation to work when not all targets are enabled.
13935
fbd8a257
CC
139362008-09-29 Cary Coutant <ccoutant@google.com>
13937
13938 * archive.cc (Archive::get_file_and_offset): Use filename instead
13939 of name to get library path.
13940 (Archive::include_member): Unlock external member of a thin archive.
13941
13942 * testsuite/Makefile.am (TEST_AR): New variable.
13943 (thin_archive_test_1): New test.
13944 (thin_archive_test_2): New test.
81636b3f
CC
13945 * testsuite/Makefile.in: Regenerate.
13946 * testsuite/thin_archive_main.cc: New file.
13947 * testsuite/thin_archive_test_1.cc: New file.
13948 * testsuite/thin_archive_test_2.cc: New file.
13949 * testsuite/thin_archive_test_3.cc: New file.
13950 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 13951
eff45813
CC
139522008-09-29 Cary Coutant <ccoutant@google.com>
13953
13954 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
13955 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
13956 instead of -1U.
13957 (Sized_relobj::do_finalize_local_symbols): Likewise.
13958 (Sized_relobj::map_to_kept_section): Likewise.
13959 * object.h (Sized_relobj::invalid_address): New constant.
13960 (Sized_relobj::do_output_section_offset): Check for invalid_address
13961 and return -1ULL.
13962 * output.cc (Output_reloc::local_section_offset): Use constant
13963 invalid_address instead of -1U.
13964 (Output_reloc::get_address): Likewise.
13965 (Output_section::output_address): Change -1U to -1ULL.
13966 * output.h (Output_reloc::invalid_address): New constant.
13967 * reloc.cc (Sized_relobj::write_sections): Use constant
13968 invalid_address instead of -1U.
13969 (Sized_relobj::relocate_sections): Likewise.
13970 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
13971 values for merge sections.
13972 * target-reloc.h (relocate_for_relocatable): Use constant
13973 invalid_address instead of -1U.
13974
89fc3421
CC
139752008-09-19 Cary Coutant <ccoutant@google.com>
13976
13977 Add plugin functionality for link-time optimization (LTO).
13978 * configure.ac (plugins): Add --enable-plugins option.
13979 * configure: Regenerate.
13980 * config.in: Regenerate.
13981 * Makefile.am (LIBDL): New variable.
13982 (CCFILES): Add plugin.cc.
13983 (HFILES): Add plugin.h.
13984 (ldadd_var): Add LIBDL.
13985 * Makefile.in: Regenerate.
13986
13987 * archive.cc: Include "plugin.h".
13988 (Archive::setup): Don't preread archive symbols when using a plugin.
13989 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
13990 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
13991 files.
13992 (Archive::include_member): Add symbols from plugin objects.
13993 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
13994 * descriptors.cc (Descriptors::open): Check for file descriptors
13995 abandoned by plugins.
13996 (Descriptors::claim_for_plugin): New function.
13997 * descriptors.h (Descriptors::claim_for_plugin): New function.
13998 (Open_descriptor::is_claimed): New field.
13999 (claim_descriptor_for_plugin): New function.
14000 * fileread.cc (File_read::claim_for_plugin): New function.
14001 * fileread.h (File_read::claim_for_plugin): New function.
14002 (File_read::descriptor): New function.
14003 * gold.cc: Include "plugin.h".
14004 (queue_initial_tasks): Add task to call plugin hooks for generating
14005 new object files.
14006 * main.cc: Include "plugin.h".
14007 (main): Load plugin libraries.
14008 * object.h (Pluginobj): Declare.
14009 (Object::pluginobj): New function.
14010 (Object::do_pluginobj): New function.
14011 (Object::set_target): New function.
14012 * options.cc: Include "plugin.h".
14013 (General_options::parse_plugin): New function.
14014 (General_options::General_options): Initialize plugins_ field.
14015 (General_options::add_plugin): New function.
14016 * options.h (Plugin_manager): Declare.
14017 (General_options): Add --plugin option.
14018 (General_options::has_plugins): New function.
14019 (General_options::plugins): New function.
14020 (General_options::add_plugin): New function.
14021 (General_options::plugins_): New field.
14022 * plugin.cc: New file.
14023 * plugin.h: New file.
14024 * readsyms.cc: Include "plugin.h".
14025 (Read_symbols::do_read_symbols): Check for archive before checking
14026 for ELF file. Call plugin hooks to claim files.
14027 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14028 from a real object file; force override when processing replacement
14029 files.
14030 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14031 (Symbol::init_base_object): Likewise.
14032 (Symbol::init_base_output_data): Likewise.
14033 (Symbol::init_base_output_segment): Likewise.
14034 (Symbol::init_base_constant): Likewise.
14035 (Symbol::init_base_undefined): Likewise.
14036 (Symbol::output_section): Assert that object is not a plugin.
14037 (Symbol_table::add_from_pluginobj): New function.
14038 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14039 undefined.
14040 (Symbol_table::sized_write_globals): Likewise.
14041 (Symbol_table::add_from_pluginobj): Instantiate template.
14042 * symtab.h (Sized_pluginobj): Declare.
14043 (Symbol::in_real_elf): New function.
14044 (Symbol::set_in_real_elf): New function.
14045 (Symbol::in_real_elf_): New field.
14046 (Symbol_table::add_from_pluginobj): New function.
14047
14048 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14049 (LIBDL): New variable.
14050 (LDADD): Add LIBDL.
14051 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14052 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14053 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14054 (MOSTLYCLEANFILES): Likewise.
14055 * testsuite/Makefile.in: Regenerate.
14056 * testsuite/plugin_test.c: New file.
14057 * testsuite/plugin_test_1.sh: New file.
14058 * testsuite/plugin_test_2.sh: New file.
14059
de31bda5
ILT
140602008-09-16 Ian Lance Taylor <iant@google.com>
14061
9c2d0ef9
ILT
14062 * target-reloc.h (relocate_section): Check whether a symbol is
14063 defined by the ABI before reporting an undefined symbol error.
14064 * target.h (Target::is_defined_by_abi): Make parameter const.
14065 (Target::do_is_defined_by_abi): Likewise.
14066 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14067 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14068 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14069 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14070 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14071 * testsuite/Makefile.in: Rebuild.
14072
de31bda5
ILT
14073 * fileread.cc (make_view): Add casts to avoid warning.
14074
9fa33bee
AO
140752008-09-16 Alexandre Oliva <aoliva@redhat.com>
14076
14077 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14078 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14079
183fd0e3
AO
140802008-09-16 Alexandre Oliva <aoliva@redhat.com>
14081
14082 * options.h (General_options::output_is_executable): New.
14083 (General_options::output_is_pie): New.
14084 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14085 for shared libraries.
14086 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14087
7be8330a
CD
140882008-09-11 Chris Demetriou <cgd@google.com>
14089
14090 * options.h (origin): New -z option.
14091 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14092 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14093 in DT_FLAGS_1.
14094
a9caad02
CC
140952008-09-05 Cary Coutant <ccoutant@google.com>
14096
14097 * fileread.cc (File_read::make_view): Add check for attempt to map
14098 beyond end of file.
14099
ae6dce4d
CC
141002008-09-05 Cary Coutant <ccoutant@google.com>
14101
14102 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14103 explicit instantiations.
14104
d7ab2a47
KVH
141052008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14106
14107 PR gold/6858
14108 * options.cc (General_options::finalize): Allow undefined symbols
14109 in shlibs if linking -shared.
14110
14111 PR gold/6859
14112 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14113 symbols as not needing a dynsym entry.
14114
1e52a9c1
CS
141152008-08-20 Craig Silverstein <csilvers@google.com>
14116
14117 * fileread.cc (File_read::open): Do not lock the file unless it
14118 was successfully opened.
14119
d85c80a3
CC
141202008-08-14 Cary Coutant <ccoutant@google.com>
14121
14122 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14123 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14124 * testsuite/tls_test.cc (struct int128): 128-bit struct
14125 for testing TLS relocs with non-zero addend.
14126 (v12): New TLS variable.
14127 (t12): New test.
14128 (t_last): Add check for v12.
14129 * testsuite/tls_test.h (t12): New function.
14130 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14131
2d924fd9
ILT
141322008-08-13 Ian Lance Taylor <iant@google.com>
14133
14134 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14135 set tls_segment_ or relro_segment_.
14136 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14137 when appropriate.
14138 * output.h (Output_section::clear_is_relro): New function.
14139 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14140 sections specially even when output_data_ is empty.
14141 (Output_segment::maximum_alignment): When first section is relro,
14142 only force alignment for PT_LOAD segments.
14143 * script.cc (script_data_segment_align): New function.
14144 (script_data_segment_relro_end): New function.
14145 * script-c.h (script_data_segment_align): Declare.
14146 (script_data_segment_relro_end): Declare.
14147 * script-sections.h (class Script_sections): Declare
14148 data_segment_align and data_segment_relro_end. Add fields
14149 segment_align_index_ and saw_relro_end_.
14150 * script-sections.cc (class Sections_element): Add set_is_relro
14151 virtual function. Add new bool* parameter to place_orphan_here.
14152 Add get_output_section virtual function.
14153 (class Output_section_definition): Add set_is_relro. Add new
14154 bool* parameter to place_orphan_here. Add get_output_section.
14155 Add is_relro_ field.
14156 (Output_section_definition::Output_section_definition): Initialize
14157 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14158 and is_relro_ fields.
14159 (Output_section_definition::place_orphan_here): Add is_relro
14160 parameter.
14161 (Output_section_definition::set_section_addresses): Set relro for
14162 output section.
14163 (Output_section_definition::alternate_constraint): Likewise.
14164 (class Orphan_output_section): Add new bool* parameter to
14165 place_orphan_here. Add get_output_section.
14166 (Orphan_output_section::place_orphan_here): Add is_relro
14167 parameter.
14168 (Script_sections::Script_sections): Initialize
14169 data_segment_align_index_ and saw_relro_end_.
14170 (Script_sections::data_segment_align): New function.
14171 (Script_sections::data_segment_relro_end): New function.
14172 (Script_sections::place_orphan): Set or clear is_relro.
14173 (Script_sections::set_section_addresses): Force alignment of first
14174 TLS section.
14175 * yyscript.y (exp): Call script_data_segment_align and
14176 script_data_segment_relro_end.
14177 * testsuite/relro_script_test.t: New file.
14178 * testsuite/relro_test.cc (using_script): Declare.
14179 (t1, t2): Test using_script.
14180 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14181 (relro_script_test_SOURCES): Define.
14182 (relro_script_test_DEPENDENCIES): Define.
14183 (relro_script_test_LDFLAGS): Define.
14184 (relro_script_test_LDADD): Define.
14185 (relro_script_test.so): New target.
14186 * testsuite/Makefile.in: Rebuild.
14187
f827c9a9
CC
141882008-08-06 Cary Coutant <ccoutant@google.com>
14189
14190 * archive.cc (Archive::total_archives, Archive::total_members)
14191 (Archive::total_members_loaded): New variables.
14192 (Archive::setup): Add parameter. Add option to preread
14193 archive symbols.
14194 (Archive::read_armap): Add counter.
14195 (Archive::get_file_and_offset): New function.
14196 (Archive::get_elf_object_for_member): New function.
14197 (Archive::read_all_symbols): New function.
14198 (Archive::read_symbols): New function.
14199 (Archive::add_symbols): Add counters.
14200 (Archive::include_all_members): Use armap to find members if it's
14201 already built.
14202 (Archive::include_member): Skip reading symbols if already read.
14203 Factored code into Archive::get_file_and_offset and
14204 Archive::get_elf_object_for_member. Changed call to
14205 Mapfile::report_include_archive_member.
14206 (Archive::print_stats): New function.
14207 * archive.h: Declare Object and Read_symbols_data classes.
14208 (Archive::Archive): Add initializers for new members.
14209 (Archive::setup): Add parameter.
14210 (Archive::print_stats): New function.
14211 (Archive::total_archives, Archive::total_members)
14212 (Archive::total_members_loaded): New variables.
14213 (Archive::get_file_and_offset): New function.
14214 (Archive::get_elf_object_for_member): New function.
14215 (Archive::read_all_symbols): New function.
14216 (Archive::read_symbols): New function.
14217 (Archive::Archive_member): New class.
14218 (Archive::members_): New member.
14219 (Archive::num_members_): New member.
14220 * main.cc: Include archive.h.
14221 (main): Call Archive::print_stats.
14222 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14223 archive parameter; member_name is now the fully-decorated name.
14224 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14225 * options.h: (General_options): Add --preread-archive-symbols option.
14226 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14227 Archive::setup.
14228
de4c45bd
ILT
142292008-08-04 Ian Lance Taylor <iant@google.com>
14230
14231 * symtab.h (Symbol::use_plt_offset): New function.
14232 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14233 * powerpc.cc (Relocate::relocate): Likewise.
14234 * sparc.cc (Relocate::relocate): Likewise.
14235 * x86_64.cc (Relocate::relocate): Likewise.
14236 * testsuite/weak_plt.sh: New test.
14237 * testsuite/weak_plt_main.cc: New test.
14238 * testsuite/weak_plt_shared.cc: New test.
14239 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14240 (check_PROGRAMS): Add weak_plt.
14241 (check_DATA): Add weak_plt_shared.so.
14242 (weak_plt_main_pic.o, weak_plt): New targets.
14243 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14244 * testsuite/Makefile.in: Rebuild.
14245
14246 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14247 gcctestdir/ld.
14248 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14249 * testsuite/Makefile.in: Rebuild.
14250
323ee3f4
AM
142512008-08-04 Alan Modra <amodra@bigpond.net.au>
14252
14253 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14254 * Makefile.in: Regenerate.
14255 * po/POTFILES.in: Regenerate.
14256
7c07ecec
ILT
142572008-07-29 Ian Lance Taylor <iant@google.com>
14258
14259 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14260 symbols before other symbols.
14261 * testsuite/script_test_2.cc (test_addr): Declare.
14262 (test_addr_alias): Declare.
14263 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14264 values.
7c07ecec
ILT
14265 * testsuite/script_test_2.t: Define test_addr_alias and
14266 test_addr.
14267
5778530e
ILT
142682008-07-24 Ian Lance Taylor <iant@google.com>
14269
2a00e4fb
ILT
14270 PR 5990
14271 * descriptors.cc: New file.
14272 * descriptors.h: New file.
14273 * gold-threads.h (class Hold_optional_lock): New class.
14274 * fileread.cc: Include "descriptors.h".
14275 (File_read::~File_read): Release descriptor rather than closing
14276 it.
14277 (File_read::open) [file]: Call open_descriptor rather than open.
14278 Set is_descriptor_opened_.
14279 (File_read::open) [memory]: Assert that descriptor is not open.
14280 (File_read::reopen_descriptor): New function.
14281 (File_read::release): Release descriptor.
14282 (File_read::do_read): Make non-const. Reopen descriptor.
14283 (File_read::read): Make non-const.
14284 (File_read::make_view): Reopen descriptor.
14285 (File_read::do_readv): Likewise.
14286 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14287 Update declarations.
14288 * layout.cc: Include "descriptors.h".
14289 (Layout::create_build_id): Use open_descriptor rather than open.
14290 * output.cc: Include "descriptors.h".
14291 (Output_file::open): Use open_descriptor rather than open.
14292 * archive.cc (Archive::const_iterator): Change Archive to be
14293 non-const.
14294 (Archive::begin, Archive::end): Make non-const.
14295 (Archive::count_members): Likewise.
14296 * archive.h (class Archive): Update declarations.
14297 * object.h (Object::read): Make non-const.
14298 * Makefile.am (CCFILES): Add descriptors.cc.
14299 (HFILES): Add descriptors.h.
14300 * Makefile.in: Rebuild.
14301
801647d1
ILT
14302 PR 6716
14303 * gold.h: Always include <clocale>. Add Solaris workarounds
14304 following code in binutils/sysdep.h.
14305
5edd166e
ILT
14306 PR 6048
14307 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14308 this->eh_frame_hdr_ is NULL before using it.
14309
c89ad728
ILT
14310 * dynobj.cc (Versions::Versions): Update comment.
14311
aa86f06b
ILT
14312 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14313 the base version name.
14314
5778530e
ILT
14315 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14316 array size plus one.
14317 (Stringpool_template::set_string_offsets): Subtract one from key
14318 before using it as an array index.
14319 (Stringpool_template::get_offset_with_length): Likewise.
14320 (Stringpool_template::write_to_buffer): Likewise.
14321 * stringpool.h (Stringpool_template::get_offset_from_key):
14322 Likewise.
14323
057ead22
ILT
143242008-07-23 Ian Lance Taylor <iant@google.com>
14325
7f649c59
ILT
14326 PR 6658
14327 * object.h (Merged_symbol_value::value): Do our best to handle a
14328 negative addend.
14329
057ead22
ILT
14330 PR 6647
14331 * script.cc (Version_script_info::get_versions): Don't add empty
14332 version tag to return value.
14333 (Version_script_info::get_symbol_version_helper): Change return
14334 type to bool. Add pversion parameter. Change all callers.
14335 (script_register_vers_node): Don't require a non-NULL tag.
14336 * script.h (class Version_script_info): Update declarations.
14337 (Version_script_info::get_symbol_version): Change return type to
14338 bool. Add version parameter. Change all callers.
14339 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14340 handling. Handle an empty version from a version script.
14341 (Symbol_table::define_special_symbol): Likewise.
14342 * testsuite/ver_test_10.script: New file.
14343 * testsuite/ver_test_10.sh: New file.
14344 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14345 (check_DATA): Add ver_test_10.syms.
14346 (ver_test_10.syms, ver_test_10.so): New target.
14347 * testsuite/Makefile.in: Rebuild.
14348
58e54ac2
CD
143492008-07-23 Simon Baldwin <simonb@google.com>
14350
14351 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14352 to zero for undefined symbols from dynamic libraries.
14353
95d14cd3
ILT
143542008-07-23 Ian Lance Taylor <iant@google.com>
14355
14356 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14357 Change all callers.
14358 * symtab.h (class Symbol_table): Update declaration.
14359 * testsuite/ver_test_9.cc: New file.
14360 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14361 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14362 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14363 (ver_test_9.so, ver_test_9.o): New targets.
14364 * testsuite/Makefile.in: Rebuild.
14365
92de84a6
ILT
143662008-07-22 Ian Lance Taylor <iant@google.com>
14367
34810851
ILT
14368 * options.h (class General_options): Define --check-sections.
14369 * layout.cc (Layout::set_segment_offsets): Handle
14370 --check-sections.
14371
af6156ef
ILT
14372 * options.h (class General_options): Define -n/--nmagic and
14373 -N/--omagic.
14374 * options.cc (General_options::finalize): For -n/--nmagic or
14375 -N/--omagic, set -static.
14376 * layout.cc (Layout::attach_allocated_section_to_segment): If
14377 -N/--omagic, don't put read-only and read-write sections in
14378 different segments.
14379 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14380 finding a read-only segment.
14381 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14382 don't set the minimum segment alignment to the common page size,
14383 and don't set the file offset to the address modulo the page size.
14384 * script-sections.cc (Script_sections::create_segments): If
14385 -n/--omagic, don't put read-only and read-write sections in
14386 different segments.
14387
92de84a6
ILT
14388 * cref.cc: New file.
14389 * cref.h: New file.
14390 * options.h (class General_options): Add --print-symbol-counts.
14391 * main.cc (main): Issue defined symbol report if requested.
14392 * archive.cc (Archive::interpret_header): Make into a const member
14393 function.
14394 (Archive::add_symbols): Call Input_objects::archive_start and
14395 archive_stop.
14396 (Archive::const_iterator): Define new class.
14397 (Archive::begin, Archive::end): New functions.
14398 (Archive::include_all_members): Rewrite to use iterator.
14399 (Archive::count_members): New function.
14400 * archive.h (class Archive): Update declarations.
14401 (Archive::filename): New function.
14402 * object.cc: Include "cref.h".
14403 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14404 (Sized_relobj::do_get_global_symbol_counts): New function.
14405 (Input_objects::add_object): Add object to cross-referencer.
14406 (Input_objects::archive_start): New function.
14407 (Input_objects::archive_stop): New function.
14408 (Input_objects::print_symbol_counts): New function.
14409 * object.h: Declare Cref and Archive.
14410 (Object::get_global_symbol_counts): New function.
14411 (Object::do_get_global_symbol_counts): New pure virtual function.
14412 (class Sized_relobj): Add defined_count_ field. Update
14413 declarations.
14414 (class Input_objects): Add cref_ field. Update constructor.
14415 Update declarations.
14416 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14417 defined_count_.
14418 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14419 symbol counts.
14420 (Sized_dynobj::do_get_global_symbol_counts): New function.
14421 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14422 defined_count_. Update declarations. Define Symbols typedef.
14423 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14424 parameter. Change all callers.
14425 (Symbol_table::add_from_dynobj): Add sympointers and defined
14426 parameters. Change all callers.
14427 * symtab.h (class Symbol_table): Update declarations.
14428 * Makefile.am (CCFILES): Add cref.cc.
14429 (HFILES): Add cref.h.
14430 * Makefile.in: Rebuild.
14431
3f7c5e1d
CD
144322008-07-22 Simon Baldwin <simonb@google.com>
14433
14434 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14435 to zero when writing undefined symbols.
14436
e0b64032
ILT
144372008-07-22 Ian Lance Taylor <iant@google.com>
14438
14439 * output.cc (Output_section::add_input_section): Don't try to
14440 merge empty merge sections.
14441
096b02cf
CS
144422008-07-21 Craig Silverstein <csilvers@google.com>
14443
14444 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14445 Include symbol version in error message.
cd536b21 14446
1d1f116d
CD
144472008-07-20 Chris Demetriou <cgd@google.com>
14448
cd536b21 14449 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14450 (RANDOM_SEED_CFLAGS): New substituted variable.
14451 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14452 * configure: Rebuild.
14453 * Makefile.in: Likewise.
14454 * testsuite/Makefile.in: Likewise.
14455
a18f591e
ILT
144562008-07-18 Ian Lance Taylor <iant@google.com>
14457
14458 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14459 where we see NAME/NULL and NAME/VERSION as separate symbols.
14460 * testsuite/ver_test_main.cc (main): Call t4.
14461 (t4, t4_2a): Define.
14462 * testsuite/ver_test_2.cc (t4_2): Define.
14463 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14464 * testsuite/ver_test_4.cc (t4_2a): Define.
14465 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14466 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14467
c6e3f6ed
ILT
144682008-07-17 Ian Lance Taylor <iant@google.com>
14469
14470 * dynobj.cc (Versions::add_def): If we give an error about a
14471 missing version, go ahead and create the version anyhow.
14472
ef9beddf
ILT
144732008-07-10 Ian Lance Taylor <iant@google.com>
14474
14475 Handle output sections with more than 0x7fffffff bytes.
14476 * object.h (class Relobj): Change map_to_output_ to
14477 output_sections_, and just keep a section pointer. Change all
14478 uses. Move comdat group support to Sized_relobj.
14479 (Relobj::is_section_specially_mapped): Remove.
14480 (Relobj::output_section): Remove poff parameter. Change all
14481 callers.
14482 (Relobj::output_section_offset): New function.
14483 (Relobj::set_section_offset): Rewrite.
14484 (Relobj::map_to_output): Remove.
14485 (Relobj::output_sections): New function.
14486 (Relobj::do_output_section_offset): New pure virtual function.
14487 (Relobj::do_set_section_offset): Likewise.
14488 (class Sized_relobj): Add section_offsets_ field. Add comdat
14489 group support from Relobj. Update declarations.
14490 (Sized_relobj::get_output_section_offset): New function.
14491 (Sized_relobj::do_output_section_offset): New function.
14492 (Sized_relobj::do_set_section_offset): New function.
14493 * object.cc (Relobj::output_section_address): Remove.
14494 (Sized_relobj::Sized_relobj): Initialize new fields.
14495 (Sized_relobj::include_section_group): Cast find_kept_object to
14496 Sized_relobj.
14497 (Sized_relobj::include_linkonce_section): Likewise.
14498 (Sized_relobj::do_layout): Use separate arrays for output section
14499 and output offset.
14500 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14501 output_sections.
14502 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14503 output_sections and section_offsets.
14504 (Sized_relobj::write_local_symbols): Likewise.
14505 (map_to_kept_section): Compute output address directly.
14506 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14507 output_sections and section_offsets.
14508 (Sized_relobj::write_sections): Likewise.
14509 (Sized_relobj::relocate_sections): Likewise.
14510 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14511 * output.h (class Output_reloc): Update declarations. Change
14512 u2_.relobj to Sized_relobj*.
14513 (class Output_data_reloc): Change add functions to use
14514 Sized_relobj*.
14515 * output.cc (Output_reloc::Output_reloc): Change relobj to
14516 Sized_relobj*.
14517 (Output_reloc::local_section_offset): Change return type to
14518 Elf_Addr. Use get_output_section_offset.
14519 (Output_reloc::get_address): Likewise.
14520 (Output_section::is_input_address_mapped): Don't call
14521 is_section_specially_mapped.
14522 (Output_section::output_offset): Likewise.
14523 (Output_section::output_address): Likewise.
14524 (Output_section::starting_output_address): Likewise.
14525 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14526 parameter to Sized_relobj*.
14527 (Copy_relocs::need_copy_reloc): Likewise.
14528 (Copy_relocs::save): Likewise.
14529 * copy-relocs.h (class Copy_relocs): Update declarations.
14530 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14531 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14532 * target-reloc.h (relocate_for_relocatable): Change
14533 offset_in_output_section type to Elf_Addr. Change code that uses
14534 it as well.
14535 * layout.cc (Layout::layout): Always set *off.
14536 * mapfile.cc (Mapfile::print_input_section): Use
14537 output_section_offset.
14538 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14539 Sized_relobj*.
14540 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14541 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14542 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14543
5cb66f97
ILT
145442008-07-03 Ian Lance Taylor <iant@google.com>
14545
14546 * layout.cc (Layout::include_section): Do not discard unrecognized
14547 SHT_STRTAB sections.
14548
afe47622
CS
145492008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14550
14551 * script.cc (Lex::can_continue_name): Make '?' allowable in
14552 version-script names.
14553 * testsuite/version_script.map: Change glob pattern to use '?'
14554
5adf9721
ILT
145552008-06-30 Manish Singh <yosh@gimp.org>
14556
14557 PR 6585
14558 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14559 Correct typo.
14560
e6fde208
ILT
145612008-06-30 Ian Lance Taylor <iant@google.com>
14562
14563 PR 6660
14564 PR 6682
14565 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14566 versions]: Don't try to read the value in the contents, since we
14567 don't use it. Use the template endianness when writing.
14568
3f2e6a2d
CC
145692008-06-25 Cary Coutant <ccoutant@google.com>
14570
14571 * fileread.cc (File_read::make_view): Assert on zero-length view.
14572 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14573 symbol table when there are no symbols to read.
14574
c43d3a48
CS
145752008-06-23 Craig Silverstein <csilvers@google.com>
14576
14577 * version.cc (version_string): Bump to 1.7
14578
5f494ea0
CS
145792008-06-18 Craig Silverstein <csilvers@google.com>
14580
14581 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14582 constant 0xFFFF to type Valtype.
14583 (Powerpc_relocate_functions::rel16_ha): Likewise.
14584
c42e122e
ILT
145852008-06-17 Ian Lance Taylor <iant@google.com>
14586
f34787f8
ILT
14587 * output.h (Output_section::Input_section): Initialize p2align_ to
14588 zero for Output_section_data constructors.
14589 (Output_section::Input_section::addralign): If not an input
14590 section, return the alignment of the Output_section_data.
14591 * testsuite/copy_test.cc: New file.
14592 * testsuite/copy_test_1.cc: New file.
14593 * testsuite/copy_test_2.cc: New file.
14594 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14595 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14596 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14597 (copy_test_1_pic.o, copy_test_1.so): New targets.
14598 (copy_test_2_pic.o, copy_test_2.so): New targets.
14599 * testsuite/Makefile.in: Rebuild.
14600
c42e122e
ILT
14601 * script-sections.cc (Script_sections::place_orphan): Initialize
14602 local variable exact.
14603
ce3ac18a
DE
146042008-06-13 David Edelsohn <edelsohn@gnu.org>
14605
14606 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14607
42cacb20
DE
146082008-06-12 David Edelsohn <edelsohn@gnu.org>
14609 David S. Miller <davem@davemloft.net>
14610
14611 * powerpc.cc: New file.
14612 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14613 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14614 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14615 * Makefile.in: Rebuild.
14616
7b308235
ILT
146172008-06-09 Ian Lance Taylor <iant@google.com>
14618
14619 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14620 <exception>.
14621 (throwing, orig_terminate): New static variables.
14622 (terminate_handler): New static function.
14623 (t2): Set terminate handler.
14624
f0b886e3
ILT
146252008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14626
14627 PR 6584
cd536b21 14628 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14629 alignment.
14630
3e90f135
CC
146312008-05-30 Cary Coutant <ccoutant@google.com>
14632
14633 * archive.cc (Archive::include_all_members) Correct to step
14634 over symbol table and extended name table in thin archives.
14635
e09ad04a
ILT
146362008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14637
14638 PR 6407
14639 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14640 calculation.
14641
62b01cb5
ILT
146422008-05-28 Caleb Howe <cshowe@google.com>
14643
14644 * reduced_debug_output.cc: New file.
14645 * reduced_debug_output.h: New file.
92de84a6 14646 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
14647 * options.cc (General_options::finalize): Add strip_debug_non_line
14648 to the strip heirarchy.
14649 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14650 fields.
14651 * layout.cc: Include "reduced_debug_output.h".
14652 (Layout::Layout): Initialize new fields.
14653 (line_only_debug_sections): New static array.
14654 (is_lines_only_debug_sections): New static inline function.
14655 (Layout::include_section): Handle --strip-debug-non-line.
14656 (Layout::make_output_section): If --strip-debug-non-line, build
14657 new output sections for .debug_abbrev and .debug_info.
14658 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14659 gold. Warn about possible overflow.
14660 (read_signed_LEB_128): Likewise.
14661 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14662 (read_signed_LEB_128): Declare.
14663 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14664 (HFILES): Add reduced_debug_output.h.
14665 * Makefile.in: Rebuild.
14666
7d9e3d98
ILT
146672008-05-21 Ian Lance Taylor <iant@google.com>
14668
14669 * mapfile.cc: New file.
14670 * mapfile.h: New file.
14671 * options.h (class General_options): Add -M/--print-map and -Map.
14672 * options.cc (General_options::finalize): Make -M equivalent to
14673 -Map -.
14674 * main.cc: Include <cstdio> and "mapfile.h".
14675 (main): Open mapfile if requested.
14676 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14677 constructor. Change caller.
14678 (queue_initial_tasks): Add mapfile parameter. Change caller.
14679 (queue_middle_tasks): Likewise.
14680 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14681 declarations.
14682 * archive.cc: Include "mapfile.h".
14683 (Archive::add_symbols): Add mapfile parameter. Change all
14684 callers. Pass mapfile, symbol, and reason to include_member.
14685 (Archive::include_all_members): Add mapfile parameter. Change all
14686 callers.
14687 (Archive::include_member): Add mapfile, sym, and why parameters.
14688 Change all callers. Report inclusion to map file.
14689 * archive.h: Include "fileread.h".
14690 (class Archive): Update declarations.
14691 (Archive::file): New const method.
14692 (class Add_archive_symbols): Add mapfile_ field. Update
14693 constructor. Change all callers.
14694 * readsyms.h (class Read_symbols): Likewise.
14695 (class Finish_group): Likewise.
14696 (class Read_script): Likewise.
14697 * common.cc: Include "mapfile.h".
14698 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14699 all callers.
14700 (Symbol_table::do_allocate_commons): Likewise.
14701 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14702 symbol allocation to mapfile.
14703 * common.h (class Allocate_commons_task): Add mapfile_ field.
14704 Update constructor. Change all callers.
14705 * symtab.h (class Symbol_table): Update declarations.
14706 * layout.cc: Include "mapfile.h".
14707 (Layout_task_runner::run): Print information to mapfile.
14708 (Layout::create_gold_note): Change Output_data_fixed_space to
14709 Output_data_zero_fill.
14710 (Layout::create_build_id): Likewise.
14711 (Layout::print_to_mapfile): New function.
14712 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14713 constructor. Change caller.
14714 (class Layout): Declare print_to_mapfile.
14715 * output.cc (Output_section::Input_section::print_to_mapfile): New
14716 function.
14717 (Output_section::add_input_section): If producing a map, always
14718 add to input_sections_ list.
14719 (Output_section::do_print_to_mapfile): New function.
14720 (Output_segment::print_sections_to_mapfile): New function.
14721 (Output_segment::print_section_list_to_mapfile): New function.
14722 * output.h: Include "mapfile.h".
14723 (Output_data::print_to_mapfile): New function.
14724 (Output_data::do_print_to_mapfile): New virtual function.
14725 (Output_segment_headers::do_print_to_mapfile): New function.
14726 (Output_file_header::do_print_to_mapfile): New function.
14727 (Output_data_const::do_print_to_mapfile): New function.
14728 (class Output_data_const_buffer): Add map_name_ field. Update
14729 constructor. Change all callers. Add do_print_to_mapfile
14730 function.
14731 (class Output_data_fixed_space): Likewise.
14732 (class Output_data_space): Likewise.
14733 (class Output_data_zero_fill): New class.
14734 (Output_data_strtab::do_print_to_mapfile): New function.
14735 (Output_data_reloc_base::do_print_to_mapfile): New function.
14736 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14737 (Output_data_group::do_print_to_mapfile): New function.
14738 (Output_data_got::do_print_to_mapfile): New function.
14739 (Output_data_dynamic::do_print_to_mapfile): New function.
14740 (Output_symtab_xindex::do_print_to_mapfile): New function.
14741 (class Output_section): Declare do_print_to_mapflie. Declare
14742 print_to_mapfile in Input_section.
14743 (class Output_segment): Declare new functions.
14744 * object.h (Sized_relobj::symbol_count): New function.
14745 * script-sections.cc
14746 (Output_section_element_dot_assignment::set_section_addresses):
14747 Change Output_data_fixed_space to Output_data_zero_fill.
14748 (Output_data_expression::do_print_to_mapfile): New function.
14749 * script.cc (read_input_script): Add mapfile parameter. Change
14750 all callers.
14751 * script.h (read_input_script): Update declaration.
14752 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14753 (Eh_frame::do_print_to_mapfile): New function.
14754 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14755 (Output_merge_string::do_print_to_mapfile): New function.
14756 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14757 function.
14758 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14759 function.
14760 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14761 function.
14762 * Makefile.am (CCFILES): Add mapfile.cc.
14763 (HFILES): Add mapfile.h.
14764 * Makefile.in: Rebuild.
14765
9f1d377b
ILT
147662008-05-19 Ian Lance Taylor <iant@google.com>
14767
14768 * options.h (class General_options): Add -z relro.
14769 * layout.cc (Layout::Layout): Initialize relro_segment_.
14770 (Layout::add_output_section_data): Return the output section.
14771 (Layout::make_output_section): Rcognize relro sections and mark
14772 them appropriately.
14773 (Layout::attach_allocated_section_to_segment): Put relro sections
14774 in a PT_GNU_RELRO segment.
14775 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14776 section as relro.
14777 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14778 PT_TLS segments.
14779 (Layout::linkonce_mapping): Map d.rel.ro.local to
14780 .data.rel.ro.local.
14781 (Layout::output_section_name): Us .data.rel.ro.local for any
14782 section which begins with that.
14783 * layout.h (class Layout): Update add_output_section_data
14784 declaration. Add relro_segment_ field.
14785 * output.cc (Output_section::Output_section): Initialize is_relro_
14786 and is_relro_local_ fields.
14787 (Output_segment::add_output_section): Group relro sections.
14788 (Output_segment::is_first_section_relro): New function.
14789 (Output_segment::maximum_alignment): If there is a relro section,
14790 align the segment to the common page size.
14791 (Output_segment::set_section_addresses): Track whether we are
14792 looking at relro sections. If the last section is a relro
14793 section, align to the common page size.
14794 (Output_segment::set_section_list_addresses): Add in_relro
14795 parameter. Change all callers. Align to the page size when
14796 moving from relro to non-relro section.
14797 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14798 segment.
14799 * output.h (class Output_section): Add is_relro_ and
14800 is_relro_local_ fields.
14801 (Output_section::is_relro): New function.
14802 (Output_section::set_is_relro): New function.
14803 (Output_section::is_relro_local): New function.
14804 (Output_section::set_is_relro_local): New function.
14805 (class Output_segment): Update declarations.
14806 * i386.cc (Target_i386::got_section): Mark .got section as relro.
14807 * sparc.cc (Target_sparc::got_section): Likewise.
14808 * x86_64.cc (Target_x86_64::got_section): Likewise.
14809 * testsuite/relro_test_main.cc: New file.
14810 * testsuite/relro_test.cc: New file.
14811 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
14812 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
14813 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
14814 (relro_test.so, relro_test_pic.o): New targets.
14815 * testsuite/Makefile.in: Rebuild.
14816
a984ee1d
ILT
148172008-05-16 Ian Lance Taylor <iant@google.com>
14818
01676dcd
ILT
14819 * output.cc (Output_segment::add_output_section): Remove front
14820 parameter.
14821 * output.h (class Output_segment): Remove
14822 add_initial_output_section and overloaded add_output_section.
14823 Update declaration of remaining add_output_section.
14824 * layout.cc (Layout::create_interp): Call add_output_section
14825 rather than add_initial_output_section.
14826 (Layout::finish_dynamic_section): Likewise.
14827
497897f9
ILT
14828 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
14829 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
14830 know the dynamic type.
14831 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
14832 field. Initialize it in constructor.
14833 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
14834 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
14835 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
14836 reloc.
14837
a984ee1d
ILT
14838 * output.cc (Output_reloc::get_address): Change return type to
14839 Elf_Addr.
14840 * output.h (class Output_reloc): Update get_address declaration.
14841 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
14842 for section addresses.
14843
55ba0940
ILT
148442008-05-09 Ian Lance Taylor <iant@google.com>
14845
14846 PR 6493
14847 * gold.cc (gold_nomem): Use return value of write.
14848
75517b77
ILT
148492008-05-08 Ian Lance Taylor <iant@google.com>
14850
14851 * symtab.c (Symbol::init_base_output_data): Add version
14852 parameter. Change all callers.
14853 (Symbol::init_base_output_segment): Likewise.
14854 (Symbol::init_base_constant): Likewise.
14855 (Symbol::init_base_undefined): Likewise.
14856 (Sized_symbol::init_output_data): Likewise.
14857 (Sized_symbol::init_output_segment): Likewise.
14858 (Sized_symbol::init_constant): Likewise.
14859 (Sized_symbol::init_undefined): Likewise.
14860 (Symbol_table::do_define_in_output_data): If the new symbol has a
14861 version, mark it as the default.
14862 (Symbol_table::do_define_in_output_segment): Likewise.
14863 (Symbol_table::do_define_as_constant): Likewise.
14864 * symtab.h (class Symbol): Update declarations.
14865 (class Sized_symbol): Likewise.
14866 * resolve.cc (Symbol::override_version): New function.
c42e122e 14867 (Symbol::override_base): Call override_version.
75517b77
ILT
14868 (Symbol::override_base_with_special): Likewise.
14869 * testsuite/ver_script_8.script: New file.
14870 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
14871 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
14872 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
14873 (ver_test_8_1.so, ver_test_8_2.so): New targets.
14874
f1f70eae
ILT
148752008-05-06 Ian Lance Taylor <iant@google.com>
14876
f3e9c5c5
ILT
14877 PR 6049
14878 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
14879 functions.
14880 (class General_options): Remove existing --undefined, and add
14881 --no-undefined instead. Add new --undefined as synonym for -u.
14882 * archive.cc (Archive::add_symbols): Check whether symbol was
14883 named with -u.
14884 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
14885 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
14886 all uses. Add IS_UNDEFINED. Update declarations to split
14887 different versions of init_base. Declare init_base_undefined.
14888 (Symbol::is_defined): Handle IS_UNDEFINED.
14889 (Symbol::is_undefined): Likewise.
14890 (Symbol::is_weak_undefined): Call is_undefined.
14891 (Symbol::is_absolute): Handle IS_CONSTANT.
14892 (class Sized_symbol): Update declarations to split different
14893 versions of init. Declare init_undefined.
14894 (class Symbol_table): Declare new functions.
14895 * symtab.cc (Symbol::init_base_object): Rename from init_base.
14896 Change all callers.
14897 (Symbol::init_base_output_data): Likewise.
14898 (Symbol::init_base_output_segment): Likewise.
14899 (Symbol::init_base_constant): Likewise.
14900 (Symbol::init_base_undefined): New function.
14901 (Sized_symbol::init_object): Rename from init. Change all
14902 callers.
14903 (Sized_symbol::init_output_data): Likewise.
14904 (Sized_symbol::init_output_segment): Likewise.
14905 (Sized_symbol::init_constant): Likewise.
14906 (Sized_symbol::init_undefined): New function.
14907 (Symbol_table::add_undefined_symbols_from_command_line): New
14908 function.
14909 (Symbol_table::do_add_undefined_symbols_from_command_line): New
14910 function.
14911 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
14912 (Symbol::output_section): Likewise.
14913 (Symbol::set_output_section): Likewise.
14914 (Symbol_table::sized_finalize_symbol): Likewise.
14915 (Symbol_table::sized_write_globals): Likewise.
14916 * resolve.cc (Symbol_table::should_override): Likewise.
14917 (Symbol::override_base_with_special): Likewise.
14918
8bdcdf2c
ILT
14919 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
14920 symbol, change it to have default visibility.
14921 * testsuite/protected_1.cc: New file.
14922 * testsuite/protected_2.cc: New file.
14923 * testsuite/protected_3.cc: New file.
14924 * testsuite/protected_main_1.cc: New file.
14925 * testsuite/protected_main_2.cc: New file.
14926 * testsuite/protected_main_3.cc: New file.
14927 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
14928 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
14929 (protected_1_LDFLAGS, protected_1_LDADD): Define.
14930 (protected_1.so): New target.
14931 (protected_1_pic.o, protected_2_pic.o): New targets.
14932 (protected_3_pic.o): New target.
14933 (check_PROGRAMS): Add protected_2.
14934 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
14935 (protected_2_LDFLAGS, protected_2_LDADD): Define.
14936 * testsuite/Makefile.in: Rebuild.
14937
2b706932
ILT
14938 * options.h (DEFINE_var): Add set_user_set_##varname__.
14939 (DEFINE_bool_alias): New macro.
14940 (class General_options): Define -Bstatic using DEFINE_bool_alias
14941 rather than DEFINE_special. Add --undefined as an alias for -z
14942 defs.
14943 * options.cc (General_options::parse_Bstatic): Remove.
14944
d82a5bcc
ILT
14945 * options.h (class General_options): Add --fatal-warnings.
14946 * main.cc (main): Implement --fatal-warnings.
14947 * errors.h (Errors::warning_count): New function.
14948
f1f70eae
ILT
14949 * options.h (class General_options): Add -Bsymbolic-functions.
14950 * symtab.h (Symbol::is_preemptible): Check for
14951 -Bsymbolic-functions.
14952
8825ac63
ILT
149532008-05-05 Ian Lance Taylor <iant@google.com>
14954
d98bc257
ILT
14955 * options.h (DEFINE_bool): For DASH_Z, create the negative option
14956 as noVARNAME rather than no-VARNAME.
14957 (class General_options): Add option -z combreloc.
14958 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
14959 get_address.
14960 (Output_reloc::sort_before) [SHT_REL]: New function.
14961 (Output_reloc::sort_before) [SHT_RELA]: New function.
14962 (class Output_data_reloc_base): Add sort_relocs_ field. Define
14963 Sort_relocs_comparison.
14964 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
14965 parameter. Change all callers.
14966 (Output_data_reloc::Output_data_reloc) [both versions]: Add
14967 sort_relocs parameter. Change all callers.
14968 * output.cc (Output_reloc::get_address): New function, broken out
14969 of write_rel.
14970 (Output_reloc::write_rel): Call it.
14971 (Output_reloc::compare): New function.
14972 (Output_data_reloc_base::do_write): Optionally sort relocs.
14973
60b2b4e7
ILT
14974 * configure.ac: If targ_extra_obj is set, link it in.
14975 * configure.tgt: Initialize all variables.
14976 (x86_64*): Set targ_extra_obj and targ_extra_size.
14977 * configure: Rebuild.
14978
8825ac63
ILT
14979 * object.cc (Sized_relobj::include_section_group): Adjust section
14980 indexes read from group data. Build vector to pass to
14981 layout_group.
14982 * layout.cc (Layout::layout_group): Add flags and shndxes
14983 parameters. Remove contents parameter. Change caller. Update
14984 explicit instantiations.
14985 * layout.h (class Layout): Update layout_group declaration.
14986 * output.cc (Output_data_group::Output_data_group): Add flags and
14987 input_shndxes parameters. Remove contents parameter. Change
14988 caller.
14989 (Output_data_group::do_write): Change input_sections_ to
14990 input_shndxes_.
14991 * output.h (class Output_data_group): Update constructor
14992 declaration. Rename input_sections_ to input_shndxes_.
14993 * testsuite/many_sections_test.cc: Add template.
14994
e94cf127
CC
149952008-04-30 Cary Coutant <ccoutant@google.com>
14996
4418b2d5
CC
14997 * target-reloc.h (relocate_section): Fix dead-pointer bug.
14998
e94cf127
CC
14999 * layout.cc (Layout::include_section): Refactored check for debug
15000 info section.
15001 (Layout::add_comdat): Add new parameters. Change type
15002 of signature parameter. Add object and shndx to signatures table.
15003 (Layout::find_kept_object): New function.
15004 * layout.h: Include <cstring>.
15005 (Layout::is_debug_info_section): New function.
15006 (Layout::add_comdat): Add new parameters.
15007 (Layout::find_kept_object): New function.
15008 (Layout::Kept_section): New struct.
15009 (Layout::Signatures): Change type of map range.
15010 * object.cc (Relobj::output_section_address): New function.
15011 (Sized_relobj::include_section_group): Add new parameters. Change
15012 calls to Layout::add_comdat. Change to build table of kept comdat
15013 groups and table mapping discarded sections to kept sections.
15014 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15015 (Sized_relobj::do_layout): Change calls to include_section_group and
15016 include_linkonce_section.
15017 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15018 value to zero when section is discarded.
15019 (Sized_relobj::map_to_kept_section): New function.
15020 * object.h (Relobj::output_section_address): New function.
15021 (Relobj::Comdat_group): New type.
15022 (Relobj::find_comdat_group): New function.
15023 (Relobj::Comdat_group_table): New type.
15024 (Relobj::Kept_comdat_section): New type.
15025 (Relobj::Kept_comdat_section_table): New type.
15026 (Relobj::add_comdat_group): New function.
15027 (Relobj::set_kept_comdat_section): New function.
15028 (Relobj::get_kept_comdat_section): New function.
15029 (Relobj::comdat_groups_): New field.
15030 (Relobj::kept_comdat_sections_): New field.
15031 (Symbol_value::input_value): Update comment.
15032 (Sized_relobj::map_to_kept_section) New function.
15033 (Sized_relobj::include_linkonce_section): Add new parameter.
15034 * target-reloc.h (Comdat_behavior): New type.
15035 (get_comdat_behavior): New function.
15036 (relocate_section): Add code to map a discarded section to the
15037 corresponding kept section when applying a relocation.
15038
e4e5049b
CS
150392008-04-30 Craig Silverstein <csilvers@google.com>
15040
15041 * dwarf_reader.cc (next_generation_count): New static var.
15042 (Addr2line_cache_entry): New struct.
15043 (addr2line_cache): New static var.
15044 (Dwarf_line_info::one_addr2line): Added caching.
15045 (Dwarf_line_info::clear_addr2line_cache): New function.
15046 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15047 cache-size parameter.
15048 (Dwarf_line_info::one_addr2line_cache): New function.
15049 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15050 new cache-size argument to one_addr2line(), and clear cache.
15051
d09e9154
CC
150522008-04-28 Cary Coutant <ccoutant@google.com>
15053
15054 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15055 R_386_PC8 relocations.
15056
7ef73768
ILT
150572008-04-23 Ian Lance Taylor <iant@google.com>
15058
55438702
ILT
15059 * object.cc (Sized_relobj::include_section_group): Check for
15060 invalid section group.
15061
c165fb93
ILT
15062 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15063 header size.
15064
7ef73768
ILT
15065 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15066 than read for file header.
15067 * archive.cc (Archive::include_member): Likewise.
15068
6194aaab
L
150692008-04-23 Paolo Bonzini <bonzini@gnu.org>
15070
15071 * aclocal.m4: Regenerate.
15072 * configure: Regenerate.
15073
d491d34e
ILT
150742008-04-19 Ian Lance Taylor <iant@google.com>
15075
5ea2bac6
ILT
15076 * version.cc (version_string): Bump to 1.6.
15077
7bc3e21a
ILT
15078 * testsuite/Makefile.am (many_sections_r_test): New target.
15079 (many_sections_r_test_SOURCES): Remove.
15080 (many_sections_r_test_DEPENDENCIES): Remove.
15081 (many_sections_r_test_LDFLAGS): Remove.
15082 (many_sections_r_test_LDADD): Remove.
15083
7fcd3aa9
ILT
15084 * object.cc (Sized_relobj::do_add_symbols): Always pass
15085 local_symbol_count_ to add_from_relobj.
15086
4c94d6ae
ILT
15087 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15088 every thousand variables.
15089 * testsuite/Makefile.in: Rebuild.
15090
d491d34e
ILT
15091 * object.cc (Xindex::initialize_symtab_xindex): New function.
15092 (Xindex::read_symtab_xindex): New function.
15093 (Xindex::sym_xindex_to_shndx): New function.
15094 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15095 available.
15096 (Sized_relobj::do_initialize_xindex): New function.
15097 (Sized_relobj::do_read_symbols): Adjust section links.
15098 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15099 parameter. Change all callers.
15100 (Sized_relobj::include_section_group): Adjust section links and
15101 symbol section indexes.
15102 (Sized_relobj::do_layout): Adjust section links.
15103 (Sized_relobj::do_count_local_symbols): Adjust section links and
15104 symbol section indexes.
15105 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15106 ordinary and special symbols.
15107 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15108 dynsym_xindex parameters. Change all callers. Adjust section
15109 links. Use SHN_XINDEX when needed.
15110 (Sized_relobj::get_symbol_location_info): Adjust section links.
15111 Don't get fooled by special symbols.
15112 * object.h (class Xindex): Define.
15113 (class Object): Add xindex_ parameter. Declare virtual functoin
15114 do_initialize_xindex.
15115 (Object::adjust_sym_shndx): New function.
15116 (Object::set_xindex): New protected function.
15117 (class Symbol_value): Add is_ordinary_shndx_ field.
15118 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15119 (Symbol_value::value): Assert ordinary section.
15120 (Symbol_value::initialize_input_to_output_map): Likewise.
15121 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15122 Change all callers.
15123 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15124 all callers.
15125 (class Sized_relobj): Update declarations.
15126 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15127 parameter. Change all callers.
15128 (Sized_relobj::adjust_shndx): New function.
15129 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15130 field.
15131 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15132 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15133 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15134 (Sized_dynobj::read_dynsym_section): Adjust section links.
15135 (Sized_dynobj::read_dynamic): Likewise.
15136 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15137 section links.
15138 (Sized_dynobj::do_initialize_xindex): New function.
15139 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15140 do_initialize_xindex.
15141 (Sized_dynobj::adjust_shndx): New function.
15142 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15143 dynsym_xindex_ fields.
15144 (Layout::finalize): Add a call to set_section_indexes before
15145 creating the symtab sections.
15146 (Layout::set_section_indexes): Don't do anything if the section
15147 already has a section index.
15148 (Layout::create_symtab_sections): Add shnum parameter. Change
15149 caller. Create .symtab_shndx section if needed.
15150 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15151 caller.
15152 (Layout::allocated_output_section_count): New function.
15153 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15154 needed.
15155 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15156 fields. Update declarations.
15157 (Layout::symtab_xindex): New function.
15158 (Layout::dynsym_xindex): New function.
15159 (class Write_symbols_task): Add layout_ field.
15160 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15161 Change caller.
15162 * output.cc (Output_section_headers::Output_section_headers): Add
15163 shstrtab_section parameter. Change all callers.
15164 (Output_section_headers::do_sized_write): Store overflow values
15165 for section count and section string table section index in
15166 section header zero.
15167 (Output_file_header::do_sized_write): Check for overflow of
15168 section count and section string table section index.
15169 (Output_symtab_xindex::do_write): New function.
15170 (Output_symtab_xindex::endian_do_write): New function.
15171 * output.h (class Output_section_headers): Add shstrtab_section_.
15172 Update declarations.
15173 (class Output_symtab_xindex): Define.
15174 (Output_section::has_out_shndx): New function.
15175 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15176 field.
15177 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15178 Change all callers.
15179 (Sized_symbol::init): Likewise.
15180 (Symbol::output_section): Check for ordinary symbol.
15181 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15182 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15183 callers.
15184 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15185 Change all callers. Simplify handling of symbols from sections
15186 not included in the link.
15187 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15188 distinction.
15189 (Weak_alias_sorter::operator()): Assert that symbols are
15190 ordinary.
15191 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15192 distinction.
15193 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15194 parameters. Change all callers.
15195 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15196 symbol distinction. Use SHN_XINDEX when needed.
15197 (Symbol_table::write_section_symbol): Add symtab_xindex
15198 parameter. Change all callers.
15199 (Symbol_table::sized_write_section_symbol): Likewise. Use
15200 SHN_XINDEX when needed.
15201 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15202 declarations.
15203 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15204 (Symbol::is_defined): Check is_ordinary.
15205 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15206 (Symbol::is_absolute, Symbol::is_common): Likewise.
15207 (class Sized_symbol): Update declarations.
15208 (class Symbol_table): Update declarations.
15209 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15210 parameters. Change all callers.
15211 (Sized_symbol::override): Likewise.
15212 (Symbol_table::override): Likewise.
15213 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15214 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15215 is_ordinary, and orig_st_shndx parameters. Change all callers.
15216 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15217 to be in an ordinary section.
15218 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15219 object and is_ordinary parameters. Change all callers.
15220 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15221 Change all callers. Don't add undefined or non-ordinary symbols
15222 to reloc_map_.
15223 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15224 Change all callers.
15225 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15226 declarations.
15227 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15228 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15229 (Sized_relobj::relocate_sections): Likewise.
15230 * target-reloc.h (scan_relocs): Adjust section symbol index.
15231 (scan_relocatable_relocs): Likewise.
15232 * i386.cc (Scan::local): Check for ordinary symbols.
15233 * sparc.cc (Scan::local): Likewise.
15234 * x86_64.cc (Scan::local): Likewise.
15235 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15236 to symbol_section_and_value.
15237 * testsuite/many_sections_test.cc: New file.
15238 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15239 (check_PROGRAMS): Add many_sections_test.
15240 (many_sections_test_SOURCES): Define.
15241 (many_sections_test_DEPENDENCIES): Define.
15242 (many_sections_test_LDFLAGS): Define.
15243 (BUILT_SOURCES): Add many_sections_define.h.
15244 (many_sections_define.h): New target.
15245 (BUILT_SOURCES): Add many_sections_check.h.
15246 (many_sections_check.h): New target.
15247 (check_PROGRAMS): Add many_sections_r_test.
15248 (many_sections_r_test_SOURCES): Define.
15249 (many_sections_r_test_DEPENDENCIES): Define.
15250 (many_sections_r_test_LDFLAGS): Define.
15251 (many_sections_r_test_LDADD): Define.
15252 (many_sections_r_test.o): New target.
15253 * testsuite/Makefile.in: Rebuild.
15254
c5818ff1
CC
152552008-04-17 Cary Coutant <ccoutant@google.com>
15256
15257 * errors.cc (Errors::info): New function.
15258 (gold_info): New function.
15259 * errors.h (Errors::info): New function.
15260 * gold.h (gold_info): New function.
15261 * object.cc (Input_objects::add_object): Print trace output.
15262 * options.cc (options::parse_set): New function.
15263 (General_options::parse_wrap): Deleted.
15264 (General_options::General_options): Deleted initializer.
15265 * options.h (options::String_set): New typedef.
15266 (options::parse_set): New function.
15267 (DEFINE_set): New macro.
15268 (General_options::wrap): Changed to use DEFINE_set. Changed
15269 callers of any_wrap_symbols and is_wrap_symbol.
15270 (General_options::trace, General_options::trace_symbol):
15271 New options.
15272 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15273 (General_options::wrap_symbols_): Deleted.
15274 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15275
b5be4a7c
DM
152762008-04-17 David S. Miller <davem@davemloft.net>
15277
15278 * options.cc (General_options::parse_V): New function.
15279 * options.h: Add entries for -V and -Qy.
15280
155a0dd7
ILT
152812008-04-17 Ian Lance Taylor <iant@google.com>
15282
15283 * common.cc (Symbol_table::allocate_commons): Remove options
15284 parameter. Change caller.
15285 (Symbol_table::do_allocate_commons): Remove options parameter.
15286 Change caller. Just call do_allocate_commons_list twice.
15287 (Symbol_table::do_allocate_commons_list): New function, broken out
15288 of do_allocate_commons.
15289 * common.h (class Allocate_commons_task): Remove options_ field.
15290 Update constructor.
15291 * symtab.cc (Symbol_table::Symbol_table): Initialize
15292 tls_commons_.
15293 (Symbol_table::add_from_object): Put TLS common symbols on
15294 tls_commons_ list.
15295 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15296 which are IN_OUTPUT_DATA.
15297 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15298 allocate_commons and do_allocate_commons declarations. Declare
15299 do_allocate_commons_list.
15300 * gold.cc (queue_middle_tasks): Update creation of
15301 Allocate_commons_task to not pass options.
15302 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15303 (TLS_TEST_C_FLAGS): New variable.
15304 (tls_test_c_pic.o): New target.
15305 (tls_test_shared.so): Link in tls_test_c_pic.o.
15306 (tls_test_c_pic_ie.o): New target.
15307 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15308 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15309 (tls_test_c.o): New target.
15310 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15311 (tls_pic_test_LDADD): Likewise.
15312 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15313 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15314 (tls_test_c_gnu2.o): New target.
15315 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15316 tls_test_c_gnu2.o.
15317 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15318 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15319 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15320 * testsuite/tls_test.cc: Include "config.h".
15321 (t_last): Call t11_last.
15322 * testsuite/tls_test.h (t11, t11_last): Declare.
15323 * testsuite/tls_test_c.c: New file.
15324 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15325 * configure.ac: Check for OpenMP support.
15326 * configure, config.in, Makefile.in: Rebuild.
15327 * testsuite/Makefile.in: Rebuild.
15328
edfbb029
CC
153292008-04-16 Cary Coutant <ccoutant@google.com>
15330
15331 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15332 (Target_i386::tls_base_symbol_defined_): New field.
15333 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15334 (Target_i386::Scan::global): Likewise.
15335 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15336 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15337 (Target_x86_64::tls_base_symbol_defined_): New field.
15338 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15339 (Target_x86_64::Scan::global): Likewise.
15340
f3c69fca
CC
153412008-04-16 Cary Coutant <ccoutant@google.com>
15342
15343 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15344 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15345 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15346 building shared libraries.
15347 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15348 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15349 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15350 * testsuite/Makefile.in: Rebuild.
15351 * testsuite/weak_undef.h: New file.
15352 * testsuite/weak_undef_file1.cc: Add extra test cases.
15353 * testsuite/weak_undef_file2.cc: Likewise.
15354 * testsuite/weak_undef_test.cc: Likewise.
15355
7c414435
DM
153562008-04-16 David S. Miller <davem@davemloft.net>
15357
32b769e1
DM
15358 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15359 Add issued_non_pic_error_ field. Declare check_non_pic.
15360 (Target_sparc::Scan::check_non_pic): New function.
15361 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15362 (Target_sparc::Scan::global): Likewise.
15363
11936fb1
DM
15364 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15365 * configure: Rebuild.
15366
7c414435
DM
15367 * options.h (DEFINE_enable): New macro.
15368 (new_dtags): New enable option.
15369 (initfirst, interpose, loadfltr, nodefaultlib,
15370 nodelete, nodlopen, nodump): New -z options.
15371 * layout.cc (Layout:finish_dynamic_section): If new
15372 dtags enabled, emit DT_RUNPATH. Also, emit a
15373 DT_FLAGS_1 containing any specified -z flags.
15374
85c7bf8b
ILT
153752008-04-16 Ian Lance Taylor <iant@google.com>
15376
12c0daef
ILT
15377 * copy-relocs.cc: New file.
15378 * copy-relocs.h: New file.
15379 * reloc.cc: Remove Copy_relocs code.
15380 * reloc.h: Likewise.
15381 * reloc-types.h (struct Reloc_types) [both versions]: Add
15382 get_reloc_addend_noerror.
15383 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15384 variants of add_global which take an addend which must be zero.
15385 * i386.cc: Include "copy-relocs.h".
15386 (class Target_i386): Change type of copy_relocs_ to variable,
15387 update initializer.
15388 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15389 Change all callers.
15390 (Target_i386::do_finalize_sections): Change handling of
15391 copy_relocs_.
15392 * sparc.cc: Include "copy-relocs.h".
15393 (class Target_sparc): Change type of copy_relocs_ to variable,
15394 update initializer.
15395 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15396 Change all callers.
15397 (Target_sparc::do_finalize_sections): Change handling of
15398 copy_relocs_.
15399 * x86_64.cc: Include "copy-relocs.h".
15400 (class Target_x86_64): Change type of copy_relocs_ to variable,
15401 update initializer.
15402 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15403 class. Change all callers.
15404 (Target_x86_64::do_finalize_sections): Change handling of
15405 copy_relocs_.
15406 * Makefile.am (CCFILES): Add copy-relocs.cc.
15407 (HFILES): Add copy-relocs.h.
15408
4f4995b6
ILT
15409 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15410
85c7bf8b
ILT
15411 * testsuite/script_test_4.sh: Permit leading zeroes.
15412
4f2a9edd
ILT
154132008-04-15 Ian Lance Taylor <iant@google.com>
15414
e6188289
ILT
15415 * script-sections.cc (Script_sections::create_segments): Use
15416 header_size_adjustment even when there is enough room for the
15417 headers.
15418 * testsuite/script_test_4.sh: New file.
15419 * testsuite/script_test_4.t: New file.
15420 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15421 (check_DATA): Add script_test_4.stdout.
15422 (MOSTLYCLEANFILES): Likewise.
15423 (script_test_4): New target.
15424 (script_test_4.stdout): New target.
15425 * testsuite/Makefile.in: Rebuild.
15426
4f2a9edd
ILT
15427 * sparc.cc: Add definitions for Output_data_plt_sparc class
15428 constants.
15429
f5314dd5
DM
154302008-04-14 David S. Miller <davem@davemloft.net>
15431
15432 * sparc.cc: New file.
15433 * Makefile.am (TARGETSOURCES): Add sparc.cc
15434 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15435 * configure.tgt: Document targ_extra_size and
15436 targ_extra_big_endian. Add entries for sparc-* and
15437 sparc64-*.
15438 * configure.ac: Handle targ_extra_size and
15439 targ_extra_big_endian.
15440 * Makefile.in: Rebuild.
15441 * configure: Likewise.
15442 * po/POTFILES.in: Likewise.
15443 * po/gold.pot: Likewise.
15444
154e0e9a
ILT
154452008-04-14 Ian Lance Taylor <iant@google.com>
15446
15447 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15448 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15449 in the name/type/flags to section mapping. Don't call
15450 allocate_output_section.
15451 (Layout::choose_output_section): Change parameter from adjust_name
15452 to is_input_section. Don't permit input sections after sections
15453 are attached to segments. Don't call allocate_output_section.
15454 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15455 not write_enable_output_section.
15456 (Layout::make_output_section): Don't push to
15457 unattached_section_list_ nor call attach_to_segment. Call
15458 attach_section_to_segment if sections are attached.
15459 (Layout::attach_sections_to_segments): New function.
15460 (Layout::attach_section_to_segment): New function.
15461 (Layout::attach_allocated_section_to_segment): Rename from
15462 attach_to_segment. Remove flags parameter.
15463 (Layout::allocate_output_section): Remove function.
15464 (Layout::write_enable_output_section): Remove function.
15465 * layout.h (class Layout): Update for above changes. Add new
15466 field sections_are_attached_.
15467 * output.h (Output_section::update_flags_for_input_section): New
15468 function.
15469 * output.cc (Output_section::add_input_section): Call
15470 update_flags_for_input_section.
15471 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15472
009a67a2
CC
154732008-04-11 Cary Coutant <ccoutant@google.com>
15474
15475 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15476 thought unnecessary.
15477 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15478
759b1a24
ILT
154792008-04-11 Ian Lance Taylor <iant@google.com>
15480
15481 * output.h (class Output_section_data): Remove inline definition
15482 of set_addralign.
15483 * output.cc (Output_section_data::set_addralign): New function.
15484
c2b45e22
CC
154852008-04-11 Cary Coutant <ccoutant@google.com>
15486
15487 Add support for TLS descriptors for i386 and x86_64.
15488 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15489 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15490 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15491 GOT_TYPE_TLS_DESC.
15492 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15493 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15494 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15495 relocations.
15496 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15497 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15498 Fix problem with initial-exec relocations.
15499 (Target_i386::Relocate::relocate_tls): Likewise.
15500 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15501 relaxation.
15502 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15503 support for section-plus-offset dynamic table entries.
15504 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15505 (Output_data_dynamic::Dynamic_entry): Add support for
15506 section-plus-offset dynamic table entries.
15507 (Output_data_dynamic::Classification): Likewise.
15508 (Output_data_dynamic::classification_): Renamed offset_.
15509 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15510 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15511 (Target_x86_64::make_plt_section): New function.
15512 (Target_x86_64::reserve_tlsdesc_entries): New function.
15513 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15514 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15515 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15516 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15517 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15518 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15519 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15520 add extra PLT entry for TLS descriptors.
15521 (Output_data_plt_x86_64::got_): New field.
15522 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15523 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15524 fields.
15525 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15526 descriptors.
15527 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15528 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15529 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15530 R_386_TLS_DESC_CALL relocations.
15531 (Target_x86_64::Scan::global): Likewise.
15532 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15533 for TLS descriptors.
15534 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15535 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15536 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15537 GD-to-IE relaxation.
15538 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15539 and TLS_DESCRIPTORS.
15540 * Makefile.in: Rebuild.
15541 * configure: Rebuild.
15542 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15543 (tls_test_shared2.so): New target.
15544 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15545 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15546 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15547 (tls_shared_gd_to_ie_test_LDADD): New variable.
15548 (tls_shared_gnu2_gd_to_ie_test): New target.
15549 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15550 New targets.
15551 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15552 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15553 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15554 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15555 (tls_shared_gnu2_test): New target.
15556 (tls_test_gnu2_shared.so): New target.
15557 (tls_shared_gnu2_test_SOURCES): New variable.
15558 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15559 (tls_shared_gnu2_test_LDFLAGS): New variable.
15560 (tls_shared_gnu2_test_LDADD): New variable.
15561 * testsuite/Makefile.in: Rebuild.
15562 * testsuite/Makefile.
15563
83bfb6b7
ILT
155642008-04-11 Ian Lance Taylor <iant@google.com>
15565
15566 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15567 justsyms.t.
15568 * testsuite/Makefile.in: Rebuild.
15569
15570 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15571 long.
15572 * testsuite/script_test_2.cc (main): Adjust test.
15573
706e1f5e
ILT
155742008-04-11 David S. Miller <davem@davemloft.net>
15575 Ian Lance Taylor <iant@google.com>
15576
15577 * options.h (General_options): Add entries for '-Y' and
15578 '-relax'.
15579 * options.cc (General_options:finalize): If -Y was used, add those
15580 entries to the library path instead of the default "/lib" and
15581 "/usr/lib".
15582
7c98e6bb
DM
155832008-04-11 David S. Miller <davem@davemloft.net>
15584
15585 * testsuite/justsyms.t: Start at 0x100.
15586 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15587 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15588 long.
15589 * testsuite/script_test_2.cc: Adjust string and section length
15590 checks.
7c98e6bb 15591
99a37bfd
ILT
155922008-04-09 Ian Lance Taylor <iant@google.com>
15593
2cefc357
ILT
15594 PR gold/5996
15595 * script-sections.cc (Sections_element::allocate_to_segment): Add
15596 orphan parameter.
15597 (Output_section_definition::allocate_to_segment): Likewise.
15598 (Orphan_output_section::allocate_to_segment): Likewise.
15599 (Script_sections::attach_sections_using_phdrs_clause): Don't
15600 propagate non-PT_LOAD segments to orphan sections.
15601 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15602 readelf rather than objdump.
15603 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15604 .interp section and PT_INTERP segment are the same size.
15605 * testsuite/Makefile.in: Rebuild.
15606
99a37bfd
ILT
15607 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15608 aliases for symbols defined in the same object.
15609 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15610 (weak_alias_test_SOURCES): New variable.
15611 (weak_alias_test_DEPENDENCIES): New variable.
15612 (weak_alias_test_LDFLAGS): New variable.
15613 (weak_alias_test_LDADD): New variable.
15614 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15615 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15616 (weak_alias_test_3.o): New target.
15617 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15618 * testsuite/weak_alias_test_main.cc: New file.
15619 * testsuite/weak_alias_test_1.cc: New file.
15620 * testsuite/weak_alias_test_2.cc: New file.
15621 * testsuite/weak_alias_test_3.cc: New file.
15622
780e49c5
ILT
156232008-04-08 Ian Lance Taylor <iant@google.com>
15624
cdb0b8f5
ILT
15625 * options.h (class General_options): Add --noinhibit-exec option.
15626 * main.cc (main): Check --noinhibit-exec.
15627
0864d551
ILT
15628 * options.h (class General_options): Define --wrap as a special
15629 option. Add wrap_symbols_ field.
15630 (General_options::any_wrap_symbols): New function.
15631 (General_options::is_wrap_symbol): New function.
15632 * options.cc (General_options::parse_wrap): New function.
15633 (General_options::General_options): Initialize wrap_symbols_.
15634 * symtab.cc (Symbol_table::wrap_symbol): New function.
15635 (Symbol_table::add_from_object): Handle --wrap.
15636 * symtab.h (class Symbol_table): Declare wrap_symbol.
15637 * target.h (Target::wrap_char): New function.
15638 (Target::Target_info): Add wrap_char field.
15639 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15640 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15641 * testsuite/testfile.cc (Target_test::test_target_info):
15642 Likewise.
15643
789aa6de
ILT
15644 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15645 there is one.
15646
2c38906f
ILT
15647 * layout.h (class Layout): Add added_eh_frame_data_ field.
15648 * layout.cc (Layout::Layout): Initialize new field.
15649 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15650 output section until we find a section we merged successfully.
15651 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15652 that the size be non-zero.
15653
780e49c5
ILT
15654 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15655 qualifier.
15656
7fcd0256
ILT
156572008-04-08 Craig Silverstein <csilvers@google.com>
15658
15659 * configure.ac: Export new conditional variable HAVE_ZLIB.
15660 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15661 on HAVE_ZLIB.
15662 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15663 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15664
6835af53
ILT
156652008-04-07 Ian Lance Taylor <iant@google.com>
15666
e24f324c
ILT
15667 * version.cc (version_string): Set to "1.5".
15668
a036edd8
ILT
15669 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15670 Add issued_non_pic_error_ field. Declare check_non_pic.
15671 (Target_x86_64::Scan::check_non_pic): New function.
15672 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15673 (Target_x86_64::Scan::global): Likewise.
15674
624f8810
ILT
15675 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15676 addend parameter. Change caller. Handle merge sections.
15677 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15678 Address to Addend. Don't add in the result of
15679 local_section_offset, pass down the addend and use the returned
15680 value.
15681 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15682 Update declarations of local_section_offset and symbol_value.
15683 * testsuite/two_file_test_1.cc (t18): New function.
15684 * testsuite/two_file_test_2.cc (f18): New function.
15685 * testsuite/two_file_test_main.cc (main): Call t18.
15686 * testsuite/two_file_test.h (t18, f18): Declare.
15687
6835af53
ILT
15688 * configure.ac: Don't test for objdump, c++filt, or readelf.
15689 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15690 conditionals.
15691 (TEST_READELF): New variable.
15692 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15693 (check_PROGRAMS): Add two_file_strip_test.
15694 (two_file_strip_test): New target.
15695 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15696 (two_file_same_shared_strip_test_SOURCES): New variable.
15697 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15698 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15699 (two_file_same_shared_strip_test_LDADD): New variable.
15700 (two_file_shared_strip.so): New target.
15701 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15702 (ver_test_5.syms, ver_test_7.syms): Likewise.
15703 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15704 (strip_test_3.stdout): Use TEST_OBJDUMP.
15705 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15706
86925eef
CC
157072008-04-04 Cary Coutant <ccoutant@google.com>
15708
15709 * symtab.h (Symbol::is_weak_undefined): New function.
15710 (Symbol::is_strong_undefined): New function.
15711 (Symbol::is_absolute): New function.
15712 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15713 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15714 absolute symbols.
15715 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15716 (weak_undef_test): New target.
15717 * testsuite/Makefile.in: Rebuild.
15718 * testsuite/weak_undef_file1.cc: New file.
15719 * testsuite/weak_undef_file2.cc: New file.
15720 * testsuite/weak_undef_test.cc: New file.
15721
126f3ece
ILT
157222008-04-03 Craig Silverstein <csilvers@google.com>
15723
15724 * compressed_output.h (class Output_compressed_section): Use
15725 unsigned buffer.
15726 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15727 add zlib header.
15728 (zlib_compressed_suffix): Removed.
15729 (Output_compressed_section::set_final_data_size): Use unsigned
15730 buffers.
15731 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15732 Fix linker invocation.
15733 (flagstest_o_specialfile_and_compress_debug_sections):
15734 Likewise.
15735 * testsuite/Makefile.in: Regenerated.
15736
deae2a14
DM
157372008-04-02 David S. Miller <davem@davemloft.net>
15738
15739 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15740 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15741
70752818
ILT
157422008-04-02 Craig Silverstein <csilvers@google.com>
15743
15744 * TODO: New file.
15745
39d0cb0e
ILT
157462008-04-02 Ian Lance Taylor <iant@google.com>
15747
15748 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15749 parameters. Update for new key type to views_. Change all
15750 callers.
15751 (File_read::read): Adjust for byteshift in returned view.
15752 (File_read::add_view): New function, broken out of
15753 find_and_make_view.
15754 (File_read::make_view): New function, broken out of
15755 find_and_make_view.
15756 (File_read::find_or_make_view): Add offset and aligned
15757 parameters. Rewrite accordingly. Change all callers.
15758 (File_read::get_view): Add offset and aligned parameters. Adjust
15759 for byteshift in return value.
15760 (File_read::get_lasting_view): Likewise.
15761 * fileread.h (class File_read): Update declarations.
15762 (class File_read::View): Add byteshift_ field. Add byteshift to
15763 constructor. Add byteshift method.
15764 * archive.h (Archive::clear_uncached_views): New function.
15765 (Archive::get_view): Add aligned parameter. Change all callers.
15766 * object.h (Object::get_view): Add aligned parameter. Change all
15767 callers.
15768 (Object::get_lasting_view): Likewise.
15769
15770 * fileread.cc (File_read::release): Don't call clear_views if
15771 there are multiple objects.
15772 * fileread.h (File_read::clear_uncached_views): New function.
15773 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15774 on the archive.
15775
a1207466
CC
157762008-03-31 Cary Coutant <ccoutant@google.com>
15777
15778 Add thin archive support.
15779 * archive.cc (Archive::armagt): New const.
15780 (Archive::setup): Remove task parameter and calls to unlock.
15781 (Archive::unlock_nested_archives): New function.
15782 (Archive::read_header): Add nested_off parameter. Change
15783 all callers.
15784 (Archive::interpret_header): Likewise.
15785 (Archive::include_all_members): Change to handle thin
15786 archives.
15787 (Archive::include_member): Likewise.
15788 * archive.h (Archive::Archive): Add new parameters and
15789 initializers.
15790 (Archive::armagt): New const.
15791 (Archive::setup): Remove task parameter.
15792 (Archive::unlock_nested_archives): New function.
15793 (Archive::read_header): Add nested_off parameter.
15794 (Archive::interpret_header): Likewise.
15795 (Archive::Nested_archive_table): New typedef.
15796 (Archive::is_thin_archive_): New field.
15797 (Archive::nested_archives_): New field.
15798 (Archive::options_): New field.
15799 (Archive::dirpath_): New field.
15800 (Archive::task_): New field.
15801 * readsyms.cc (Read_symbols::do_read_symbols): Add check
15802 for thin archives. Pass additional parameters to
15803 Archive::Archive. Unlock the archive file after calling
15804 Archive::setup.
cd536b21 15805
479f6503
ILT
158062008-03-29 Ian Lance Taylor <iant@google.com>
15807
686c8caf
ILT
15808 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
15809 version symbol to be local.
15810 * testsuite/ver_test_4.sh: New file.
15811 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
15812 (check_DATA): Add ver_test_4.syms.
15813 (ver_test_4.syms): New target.
15814 * testsuite/Makefile.in: Rebuild.
15815
ab794b6b
ILT
15816 * output.cc
15817 (Output_section::Input_section_sort_entry::has_priority): New
15818 function.
15819 (Output_section::Input_section_sort_entry::match_file_name): New
15820 function.
15821 (Output_section::Input_section_sort_entry::match_section_name):
15822 Remove.
15823 (Output_section::Input_section_sort_entry::match_section_name_prefix):
15824 Remove.
15825 (Output_section::Input_section_sort_entry::match_section_file):
15826 Remove.
15827 (Output_section::Input_section_sort_compare::operator()): Rewrite
15828 using new Input_section_sort_entry functions. Sort crtbegin and
15829 crtend first. Sort sections with no priority before sections with
15830 a priority.
15831 * testsuite/initpri1.c (d3): Check j != 4.
15832 (cd5): New constructor/destructor function.
15833 (main): Check j != 2.
15834
479f6503
ILT
15835 * symtab.cc (Symbol_table::add_from_object): If we don't use the
15836 new symbol when resolving, don't call set_is_default.
15837 * testsuite/ver_test_7.cc: New file.
15838 * testsuite/ver_test_7.sh: New file.
15839 * testsuite/Makefile.am (ver_test_7.so): New target.
15840 (ver_test_7.o): New target.
15841 (check_SCRIPTS): Add ver_test_7.sh.
15842 (check_DATA): Add ver_test_7.syms.
15843 (ver_test_7.syms): New target.
15844
2fd32231
ILT
158452008-03-28 Ian Lance Taylor <iant@google.com>
15846
15847 * layout.cc (Layout::layout): If we see an input section with a
15848 name that needs sorting, set the must_sort flag for the output
15849 section.
15850 (Layout::make_output_section): If the name of the output section
15851 indicates that it might require sorting, set the may_sort flag.
15852 * output.h (Output_section::may_sort_attached_input_sections): New
15853 function.
15854 (Output_section::set_may_sort_attached_input_sections): New
15855 function.
15856 (Output_section::must_sort_attached_input_sections): New
15857 function.
15858 (Output_section::set_must_sort_attached_input_sections): New
15859 function.
15860 (class Output_section): Declare Input_section_sort_entry. Define
15861 Input_section_sort_compare. Declare
15862 sort_attached_input_sections. Add new fields:
15863 may_sort_attached_input_sections_,
15864 must_sort_attached_input_sections_,
15865 attached_input_sections_are_sorted_.
15866 * output.cc (Output_section::Output_section): Initialize new
15867 fields.
15868 (Output_section::add_input_section): Add an entry to
15869 input_sections_ if may_sort or must_sort are true.
15870 (Output_section::set_final_data_size): Call
15871 sort_attached_input_sections if necessary.
15872 (Output_section::Input_section_sort_entry): Define new class.
15873 (Output_section::Input_section_sort_compare::operator()): New
15874 function.
15875 (Output_section::sort_attached_input_sections): New function.
15876 * configure.ac: Check whether the compiler supports constructor
15877 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
15878 * testsuite/initpri1.c: New file.
15879 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
15880 CONSTRUCTOR_PRIORITY.
15881 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
15882 (initpri1_LDFLAGS): New variable.
15883 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15884
18e6b24e
ILT
158852008-03-27 Ian Lance Taylor <iant@google.com>
15886
49bdd526
ILT
15887 * common.cc (Sort_commons::operator): Correct sorting algorithm.
15888 * testsuite/common_test_1.c: New file.
15889 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
15890 (common_test_1_SOURCES): New variable.
15891 (common_test_1_DEPENDENCIES): New variable.
15892 (common_test_1_LDFLAGS): New variable.
15893
18e6b24e
ILT
15894 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
15895 and commons_ correctly when NAME/VERSION does not override
15896 NAME/NULL.
15897 * testsuite/ver_test_6.c: New file.
15898 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
15899 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
15900 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
15901
04bf7072
ILT
159022008-03-26 Ian Lance Taylor <iant@google.com>
15903
5871526f
ILT
15904 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
15905 of an undefined symbol from a version script.
15906 * testsuite/Makefile.am (ver_test_5.so): New target.
15907 (ver_test_5.o): New target.
15908 (check_SCRIPTS): Add ver_test_5.sh.
15909 (check_DATA): Add ver_test_5.syms.
15910 (ver_test_5.syms): New target.
15911 * testsuite/ver_test_5.cc: New file.
15912 * testsuite/ver_test_5.script: New file.
15913 * testsuite/ver_test_5.sh: New file.
15914 * Makefile.in, testsuite/Makefile.in: Rebuild.
15915
04bf7072
ILT
15916 PR gold/5986
15917 Fix problems building gold with gcc 4.3.0.
15918 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
15919 (gold_error_at_location, gold_warning_at_location): Use it.
15920 * configure.ac: Check whether we can compile and use a template
15921 function with a printf attribute.
15922 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
15923 when jumping over bytes.
15924 * object.cc: Instantiate Object::read_section_data.
15925 * debug.h: Include <cstring>
15926 * dwarf_reader.cc: Include <algorithm>
15927 * main.cc: Include <cstring>.
15928 * options.cc: Include <cstring>.
15929 * output.cc: Include <cstring>.
15930 * script.cc: Include <cstring>.
15931 * script.h: Include <string>.
15932 * symtab.cc: Include <cstring> and <algorithm>.
15933 * target-select.cc: Include <cstring>.
15934 * version.cc: Include <string>.
15935 * testsuite/testmain.cc: Include <cstdlib>.
15936 * configure, config.in: Rebuild.
15937
874c5b28
ILT
159382008-03-25 Ian Lance Taylor <iant@google.com>
15939
819d6c3a
ILT
15940 * options.cc: Include "../bfd/bfdver.h".
15941 (options::help): Print bug reporting address.
15942
f4b2c6f5
ILT
15943 * version.cc (print_version): Adjust output for current value of
15944 BFD_VERSION_STRING.
15945
15946 * NEWS: New file.
15947
e96caa79
ILT
15948 * options.cc (options::help): Print list of supported targets.
15949 * target-select.h: Include <vector>.
15950 (class Target_selector): Make machine_, size_, and is_big_endian_
15951 fields const. Add bfd_name_ and instantiated_target_ fields.
15952 (Target_selector::Target_selector): Add bfd_name parameter.
15953 (Target_selector::recognize): Make non-virtual, call
15954 do_recognize.
15955 (Target_selector::recognize_by_name): Make non-virtual, call
15956 do_recognize_by_name.
15957 (Target_selector::supported_names): New function.
15958 (Target_selector::bfd_name): New function.
15959 (Target_selector::do_instantiate_target): New pure virtual
15960 function.
15961 (Target_selector::do_recognize): New virtual function.
15962 (Target_selector::do_recognize_by_name): New virtual function.
15963 (Target_selector::instantiate_target): New private function.
15964 (supported_target_names): Declare.
15965 * target-select.cc (Target_selector::Target_selector): Update for
15966 new parameter and fields.
15967 (select_target_by_name): Check that the name matches before
15968 calling recognize_by_name.
15969 (supported_target_names): New function.
15970 * i386.cc (class Target_selector_i386): Update Target_selector
15971 constructor call. Remove recognize and recognize_by_name. Add
15972 do_instantiate_target.
15973 * x86_64.cc (class Target_selector_x86_64): Likewise.
15974 * testsuite/testfile.cc (class Target_selector_test): Update for
15975 changes to Target_selector.
15976
874c5b28
ILT
15977 * README: Rewrite, with some notes on unsupported features.
15978
0a65a3a7
CC
159792008-03-24 Cary Coutant <ccoutant@google.com>
15980
15981 * i386.cc (Target_i386::Got_type): New enum declaration.
15982 (Target_i386::Scan::local): Updated callers of Output_data_got
15983 member functions.
15984 (Target_i386::Scan::global): Likewise.
15985 (Target_i386::Relocate::relocate): Likewise.
15986 (Target_i386::Relocate::relocate_tls): Likewise.
15987 * object.h (Got_offset_list): New class.
15988 (Sized_relobj::local_has_got_offset): Added got_type parameter.
15989 (Sized_relobj::local_got_offset): Likewise.
15990 (Sized_relobj::set_local_got_offset): Likewise.
15991 (Sized_relobj::local_has_tls_got_offset): Removed.
15992 (Sized_relobj::local_tls_got_offset): Removed.
15993 (Sized_relobj::set_local_tls_got_offset): Removed.
15994 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
15995 * output.cc (Output_data_got::add_global): Added got_type parameter.
15996 (Output_data_got::add_global_with_rel): Likewise.
15997 (Output_data_got::add_global_with_rela): Likewise.
15998 (Output_data_got::add_global_pair_with_rel): New function.
15999 (Output_data_got::add_global_pair_with_rela): New function.
16000 (Output_data_got::add_local): Added got_type parameter.
16001 (Output_data_got::add_local_with_rel): Likewise.
16002 (Output_data_got::add_local_with_rela): Likewise.
16003 (Output_data_got::add_local_pair_with_rel): New function.
16004 (Output_data_got::add_local_pair_with_rela): New function.
16005 (Output_data_got::add_global_tls): Removed.
16006 (Output_data_got::add_global_tls_with_rel): Removed.
16007 (Output_data_got::add_global_tls_with_rela): Removed.
16008 (Output_data_got::add_local_tls): Removed.
16009 (Output_data_got::add_local_tls_with_rel): Removed.
16010 (Output_data_got::add_local_tls_with_rela): Removed.
16011 * output.h (Output_data_got::add_global): Added got_type parameter.
16012 (Output_data_got::add_global_with_rel): Likewise.
16013 (Output_data_got::add_global_with_rela): Likewise.
16014 (Output_data_got::add_global_pair_with_rel): New function.
16015 (Output_data_got::add_global_pair_with_rela): New function.
16016 (Output_data_got::add_local): Added got_type parameter.
16017 (Output_data_got::add_local_with_rel): Likewise.
16018 (Output_data_got::add_local_with_rela): Likewise.
16019 (Output_data_got::add_local_pair_with_rel): New function.
16020 (Output_data_got::add_local_pair_with_rela): New function.
16021 (Output_data_got::add_global_tls): Removed.
16022 (Output_data_got::add_global_tls_with_rel): Removed.
16023 (Output_data_got::add_global_tls_with_rela): Removed.
16024 (Output_data_got::add_local_tls): Removed.
16025 (Output_data_got::add_local_tls_with_rel): Removed.
16026 (Output_data_got::add_local_tls_with_rela): Removed.
16027 * resolve.cc (Symbol::override_base_with_special): Removed
16028 reference to has_got_offset_ field.
16029 * symtab.cc (Symbol::init_fields): Replaced initialization
16030 of got_offset_ with got_offsets_. Removed initialization
16031 of has_got_offset_
53fcba31 16032 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16033 (Symbol::got_offset): Likewise.
16034 (Symbol::set_got_offset): Likewise.
16035 (Symbol::has_tls_got_offset): Removed.
16036 (Symbol::tls_got_offset): Removed.
16037 (Symbol::set_tls_got_offset): Removed.
16038 (Symbol::got_offset_): Removed.
16039 (Symbol::tls_mod_got_offset_): Removed.
16040 (Symbol::tls_pair_got_offset_): Removed.
16041 (Symbol::got_offsets_): New field.
16042 (Symbol::has_got_offset): Removed.
16043 (Symbol::has_tls_mod_got_offset): Removed.
16044 (Symbol::has_tls_pair_got_offset): Removed.
16045 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16046 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16047 member functions.
16048 (Target_x86_64::Scan::global): Likewise.
16049 (Target_x86_64::Relocate::relocate): Likewise.
16050 (Target_x86_64::Relocate::relocate_tls): Likewise.
16051
bd52eafb
BE
160522008-03-25 Ben Elliston <bje@au.ibm.com>
16053
16054 * yyscript.y: Fix spelling error in comment.
16055
8b105e34
ILT
160562008-03-24 Ian Lance Taylor <iant@google.com>
16057
8ed814a9
ILT
16058 * options.h (class General_options): Define build_id option.
16059 * layout.h (class Layout): Declare write_build_id, create_note,
16060 create_build_id. Add build_id_note_ member.
16061 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16062 "libiberty.h", "md5.h", "sha1.h".
16063 (Layout::Layout): Initialize eh_frame_data_,
16064 eh_frame_hdr_section_, and build_id_note_.
16065 (Layout::finalize): Call create_build_id.
16066 (Layout::create_note): New function, broken out of
16067 Layout::create_gold_note.
16068 (Layout::create_gold_note): Call create_note.
16069 (Layout::create_build_id): New function.
16070 (Layout::write_build_id): New function.
16071 (Close_task_runner::run): Call write_build_id.
16072
8b105e34
ILT
16073 * x86_64.cc: Correct license to GPLv3.
16074
086a1841
ILT
160752008-03-23 Ian Lance Taylor <iant@google.com>
16076
16077 * options.cc: Include "demangle.h".
16078 (parse_optional_string): New function.
16079 (parse_long_option): Handle takes_optional_argument.
16080 (parse_short_option): Update dash_z initializer. Handle
16081 takes_optional_argument.
16082 (General_options::General_options): Initialize do_demangle_.
16083 (General_options::finalize): Set do_demangle_. Handle demangling
16084 style.
16085 * options.h (parse_optional_string): Declare.
16086 (struct One_option): Add optional_arg field. Update constructor.
16087 Update call constructor calls. Add takes_optional_argument
16088 function.
16089 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16090 (DEFINE_optional_string): Define.
16091 (General_options::demangle): Change from DEFINE_bool to
16092 DEFINE_optional_string.
16093 (General_options::no_demangle): New function.
16094 (General_options::do_demangle): New function.
16095 (General_options::set_do_demangle): New function.
16096 (General_options::execstack_status_): Move definition to end of
16097 class definition.
16098 (General_options::static_): Likewise.
16099 (General_options::do_demangle_): New field.
16100 * object.cc (big_endian>::get_symbol_location_info): Call
16101 Options::do_demangle, not Options::demangle.
16102 * symtab.cc (demangle): Likewise.
16103
cbb93e63
ILT
161042008-03-22 Ian Lance Taylor <iant@google.com>
16105
16106 * gold.h: Include <cstddef> and <sys/types.h>
16107 * options.h: Include <cstring>.
16108
ec531623
ILT
161092008-03-21 Ian Lance Taylor <iant@google.com>
16110
16111 * Added source code to GNU binutils.
752937aa 16112\f
4b95cf5c 16113Copyright (C) 2008-2014 Free Software Foundation, Inc.
752937aa
NC
16114
16115Copying and distribution of this file, with or without modification,
16116are permitted in any medium without royalty provided the copyright
16117notice and this notice are preserved.
16118
16119Local Variables:
16120mode: change-log
16121left-margin: 8
16122fill-column: 74
16123version-control: never
16124End:
This page took 1.030787 seconds and 4 git commands to generate.