daily update
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
00cac886
AM
12014-09-24 Alan Modra <amodra@gmail.com>
2
3 * po/POTFILES.in: Regenerate.
4
635aa30e
CC
52014-09-23 Taiju Tsuiki <tzik@google.com>
6 Cary Coutant <ccoutant@google.com>
7
71b9b91b 8 PR gold/14860
635aa30e
CC
9 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
10 on input_sections_blocker.
11 * layout.cc (Write_sections_task::locks): Unblock
12 input_sections_blocker_.
13 * layout.h (Write_sections_task::Write_sections_task): Add
14 input_sections_blocker.
15 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
16 to DEPENDENCIES.
17 * testsuite/Makefile.in: Regenerate.
18
c0c71592
RÁE
192014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
20
21 * testsuite/Makefile.am (plugin_test_10): New test.
22 * testsuite/Makefile.in: Regenerate
23 * testsuite/plugin_common_test_2.c (c1): Align to 8.
24 * testsuite/plugin_test_10.sh: New file.
25
6168c2a1
RÁE
262014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
27
28 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
29 * resolve.cc (Symbol_table::resolve): Don't override common symbols
30 during the replacement phase.
31
3a531937
JY
322014-09-17 Han Shen <shenhan@google.com>
33 Jing Yu <jingyu@google.com>
34
35 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
36 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
37 * aarch64.cc (Target_aarch64): Add data members
38 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
39 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
40 constructor.
41 (Target_aarch64::do_reloc_symbol_index): New method.
42 (Target_aarch64::do_reloc_addend): New method.
43 (Target_aarch64::add_tlsdesc_info): New method.
44 (Target_aarch64::do_dynsym_value): New method.
45 (Target_aarch64::do_make_data_plt): Add new parameters: got,
46 got_irelative. Pass them to Output_data_plt_aarch64_standard.
47 (Target_aarch64::make_data_plt): Add new parameters: got,
48 got_irelative. Pass them to do_make_data_plt.
49 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
50 (Target_aarch64::Relocate:tls_gd_to_le): New method.
51 (Target_aarch64::Relocate:tls_ie_to_le): New method.
52 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
53 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
54 (Target_aarch64::got_tlsdesc_section): New method.
55 (Target_aarch64::make_local_ifunc_plt_entry): New method.
56 (Target_aarch64::define_tls_base_symbol): New method.
57 (Target_aarch64::reserve_tlsdesc_entries): New method.
58 (Target_aarch64::got_mod_index_entry): New method.
59 (Target_aarch64::rela_tlsdesc_section): New method.
60 (Target_aarch64::rela_irelative_section): New method.
61 (Target_aarch64::Tlsdesc_info): New struct.
62 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
63 relocations and tlsdesc relocations.
64 (Target_aarch64::optimize_tls_reloc): Implement method.
65 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
66 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
67 in constructor.
68 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
69 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
70 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
71 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
72 (Output_data_plt_aarch64::rela_tlsdesc): New method.
73 (Output_data_plt_aarch64::rela_irelative): New method.
74 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
75 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
76 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
77 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
78 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
79 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
80 (Output_data_plt_aarch64_standard): New member variables:
81 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
82 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
83 New parameter: got, got_irelative.
84 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
85 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
86 (Output_data_plt_aarch64::do_write): Replace got_address with
87 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
88 (AArch64_relocate_functions::update_movnz): New method.
89 (AArch64_relocate_functions): Correct format.
90 (AArch64_relocate_functions::movnz): New method.
91 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
92 before the switch. Add new cases to switch.
00cac886 93 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
94 tlsgd tlsdesc cases.
95 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
96 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
97 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
98 Call reloc_name_in_error_message to print unsupported reloc.
99 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
100 make_data_plt.
101 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
102 relocs. Fill in some more dynamic tags.
103 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
104 Skip call tls_get_addr when tlsgd is relaxed.
105 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
106 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
107 tlsdesc->ie relaxation.
108
62661c93
SS
1092014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
110
111 * mips.cc (Target_mips_nacl): New class.
112 (Target_selector_mips_nacl): New class.
113 (target_selector_mips32): Rename from target_selector_mips32be and use
114 Target_selector_mips_nacl instead of Target_selector_mips.
115 (target_selector_mips32el): Rename from target_selector_mips32 and use
116 Target_selector_mips_nacl instead of Target_selector_mips.
117 (target_selector_mips64): Rename from target_selector_mips64be and use
118 Target_selector_mips_nacl instead of Target_selector_mips.
119 (target_selector_mips64el): Rename from target_selector_mips64 and use
120 Target_selector_mips_nacl instead of Target_selector_mips.
121 (Target_mips::mips_info): Add const attribute.
122
54674d38
CC
1232014-09-02 Cary Coutant <ccoutant@google.com>
124
125 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
126 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
127 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
128 (Sized_incr_dynobj::do_section_name): Likewise.
129 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
130 (Sized_incr_dynobj::do_section_name): Likewise.
131 * object.h (Object::section_name): Likewise.
132 (Object::do_section_name): Likewise.
133 (Sized_relobj_file::do_section_name): Likewise.
134 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
135 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
136
9860cbcf
CC
1372014-09-02 Cary Coutant <ccoutant@google.com>
138
139 PR gold/17005
140 * ehframe.cc (Fde::write): Add output_offset parameter.
141 (Cie::write): Likewise.
142 (Eh_frame::set_final_data_size): Account for offset within output
143 section.
144 (Eh_frame::do_sized_write): Likewise.
145 * ehframe.h (Fde::write): Add output_offset parameter.
146 (Cie::write): Likewise.
147 * output.cc (Output_section::Input_section_sort_entry): Remove
148 section_has_name_; add output_section_name parameter. Use
149 output section name for non-input sections.
150 (Output_section::Input_section_sort_entry::section_has_name): Remove.
151 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
152 (Output_section::Input_section_sort_compare): Remove logic for
153 sections without names.
154 (Output_section::Input_section_sort_init_fini_compare): Likewise.
155 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
156 Likewise.
157 (Output_section::Input_section_sort_section_name_compare): Likewise.
158
8e33481e
HS
1592014-08-29 Han Shen <shenhan@google.com>
160 Jing Yu <jingyu@google.com>
161
162 * aarch64-reloc-property.cc
163 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
164 reference reloc property in the table.
165 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
166 3 other entries.
167 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
168 2 new overloaded methods.
169 (Output_data_got_aarch64::do_write): Add code to write out
170 static relocs.
171 (class Output_data_got_aarch64::Static_reloc): New class to wrap
172 static relocs.
173 (Output_data_got_aarch64::static_relocs): New vector to
174 hold static relocs.
175 (Target_aarch64::TCB_SIZE): New const static memeber.
176 (Target_aarch64::tcb_size): New method.
177 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
178 (Target_aarch64::Relocate::relocate_tls): New method.
179 (Target_aarch64::Scan::local): Add code handling new reloc types.
180 (Target_aarch64::Scan::global): Add code handling new reloc types.
181
81233653
ST
1822014-08-13 Sriraman Tallam <tmsriram@google.com>
183
184 * options.h (-no-pie): Add option.
185
9363c7c3
JY
1862014-08-08 Jing Yu <jingyu@google.com>
187 Han Shen <shenhan@google.com>
188
189 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
190 (DEFFILES): add aarch64-reloc.def.
191 (TARGETSOURCES): Add aarch64-reloc-property.cc.
192 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
193 * Makefile.in: Regenerate.
194 * aarch64-reloc-property.cc: New file.
195 * aarch64-reloc-property.h: New file.
196 * aarch64-reloc.def: New file.
197 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
198 with tab to make the format consistent.
199 (Output_data_got_aarch64::symbol_table_): New method.
200 (Target_aarch64::do_plt_address_for_global): New method.
201 (Target_aarch64::do_plt_address_for_local): New method.
202 (Target_aarch64::do_select_as_default_target): New method.
203 (Target_aarch64::do_make_data_plt): New method.
204 (Target_aarch64::make_data_plt): New method.
205 (Output_data_plt_aarch64::has_irelative_section): New method.
206 (Output_data_plt_aarch64::address_for_global): New method.
207 (Output_data_plt_aarch64::address_for_local): New method.
208 (Output_data_plt_aarch64::irelative_rel_): New parameter.
209 (Output_data_plt_aarch64::add_entry): Implement contents.
210 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
211 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
212 the got_pov entry to plt0.
213 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
214 Implement contents.
215 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
216 (AArch64_howto): New struct.
217 (aarch64_howto[]): New static const array.
218 (AArch64_relocate_functions): New class.
219 (Target_aarch64::Scan::get_reference_flags): Remove method.
220 (Target_aarch64::Scan::local): Implement to support a few relocations.
221 (Target_aarch64::Scan::global): Implement to support a few relocations.
222 (Target_aarch64::make_plt_section): Implement contents.
223 (Target_aarch64::make_plt_entry): Implement contents.
224 (Target_aarch64::do_finalize_sections): Implement contents.
225 (Target_aarch64::Relocate::relocate): Implement a few relocations.
226 (Target_aarch64::relocate_section): Implement contents.
227
ad9fe6c1
AM
2282014-08-06 Alan Modra <amodra@gmail.com>
229
230 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
231
7cd4e5b7
AM
2322014-08-06 Alan Modra <amodra@gmail.com>
233
234 PR 13227
235 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
236
5ad9b0a7
ST
2372014-07-21 Sriraman Tallam <tmsriram@google.com>
238
239 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 240 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 241
e051745c
CC
2422014-07-08 Cary Coutant <ccoutant@google.com>
243
244 * expression.cc (struct Expression::Expression_eval_info): Add
245 new fields type_pointer, vis_pointer, and nonvis_pointer.
246 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
247 nonvis_pointer parameters. Adjust all calls.
248 (Symbol_expression::value): Update type, visibility, and nonvis bits
249 in caller.
250 * script.cc (Symbol_assignment::sized_finalize): Update type,
251 visibility, and remaining st_other bits for new symbol.
252 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
253 vis_pointer, and nonvis_pointer parameters.
254 * symtab.h (Symbol::set_type): New method.
255
256 * testsuite/Makefile.am (defsym_test): New test.
257 * testsuite/Makefile.in: Regenerate.
258 * testsuite/defsym_test.c: New file.
259 * testsuite/defsym_test.sh: New file.
260
f35c4853
CC
2612014-07-08 Cary Coutant <ccoutant@google.com>
262
263 PR gold/15639
264 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
265 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
266 (Sized_dynobj::base_read_symbols): ...new method.
267 * object.h (Sized_relobj_file::base_read_symbols): New method.
268 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
269 (Sized_relobj_file::base_read_symbols): ...new method.
270 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
271 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
272 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
273
2900af2d
AM
2742014-07-04 Alan Modra <amodra@gmail.com>
275
276 * po/POTFILES.in: Regenerate.
277
053a4d68
JY
2782014-07-02 Jing Yu <jingyu@google.com>
279
280 * aarch64.cc: New file
281 * Makefile.am (TARGETSOURCES): Add aarch64.cc
282 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
283 * Makefile.in: Regenerate.
284 * configure.tgt: Add entries for aarch64*.
285 * configure.ac: Likewise.
286 * configure: Likewise.
287
7b549045
AM
2882014-06-27 Alan Modra <amodra@gmail.com>
289
290 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
291
cb818dbf
CC
2922014-06-24 Cary Coutant <ccoutant@google.com>
293
294 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
295 sections.
296 (Dwo_file::sized_read_unit_index): Likewise.
297
9810d34d
SS
2982014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
299
300 * mips.cc: New file.
301 * Makefile.am (TARGETSOURCES): Add mips.cc
302 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
303 * configure.tgt: Add entries for mips*.
304 * configure.ac: Likewise.
305 * Makefile.in: Regenerate.
306 * configure: Likewise.
307
9baa787b
CC
3082014-06-09 Cary Coutant <ccoutant@google.com>
309
310 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
311 unit_length is within section bounds.
312
8f89af0a
CC
3132014-06-09 Cary Coutant <ccoutant@google.com>
314
315 PR gold/16980
316 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
317 map.
318
a47622ac
AM
3192014-06-07 Alan Modra <amodra@gmail.com>
320
321 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
322
4320c691
CC
3232014-06-06 Cary Coutant <ccoutant@google.com>
324
325 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
326 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
327 (Dwarf_pubnames_table::read_header): Likewise.
328 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
329 .debug_gnu_pubtypes.
330
270c9937
JB
3312014-06-05 Joel Brobecker <brobecker@adacore.com>
332
333 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
334 * Makefile.in, configure: Regenerate.
335
397998fc
AM
3362014-06-03 Alan Modra <amodra@gmail.com>
337
338 * powerpc.cc (addis_12_2): Define.
339 (Stub_table::do_write): Support fusion on ELFv2 stubs.
340
61f5c66f
AM
3412014-06-03 Alan Modra <amodra@gmail.com>
342
343 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
344 st_other output.
345
f6971787
AM
3462014-06-02 Alan Modra <amodra@gmail.com>
347
348 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
349 Only ignore relocs on ELFv1.
350 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
351
f6fb8322
CC
3522014-05-30 Cary Coutant <ccoutant@google.com>
353
354 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
355 * testsuite/Makefile.in: Regenerate.
356 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
357
c23dd342
L
3582014-05-27 H.J. Lu <hongjiu.lu@intel.com>
359
360 PR gold/16945
361 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
362 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
363
5fe7ffdc
AM
3642014-05-15 Alan Modra <amodra@gmail.com>
365
366 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
367 Compare FDE contents with DW_CFA_nop rather than 0.
368
a82bef93
ST
3692014-05-13 Sriraman Tallam <tmsriram@google.com>
370
371 * symtab.h (may_need_copy_reloc): Remove check for position independent
372 code.
373 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
374 position independence before pc absolute may_need_copy_reloc call.
375 Add check for executable output befor pc relative may_need_copy_reloc
376 call.
377 * i386.cc: Ditto.
378 * arm.cc: Ditto.
379 * sparc.cc: Ditto.
380 * tilegx.cc: Ditto.
381 * powerpc.cc: Add check for no position independence before
382 may_need_copy_reloc calls.
383 * testsuite/pie_copyrelocs_test.cc: New file.
384 * testsuite/pie_copyrelocs_shared_test.cc: New file.
385 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 386 * Makefile.in: Regenerate.
a82bef93 387
53c66605
ML
3882014-05-08 Martin Liška <mliska@suse.cz>
389
390 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
391
57b2284c
CC
3922014-05-06 Cary Coutant <ccoutant@google.com>
393
394 PR gold/16900
395 * i386.cc (Output_data_got_plt_i386): New class.
396 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
397 parameter. Change all callers.
398 (Output_data_plt_i386::layout_): Remove.
399 (Output_data_plt_i386::got_plt_): Change type.
400 (Target_i386::got_plt_): Change type. Change all references.
401 (Target_i386::got_section): Create instance of new class.
402 (Output_data_got_plt_i386::do_write): New function.
403 * x86_64.cc (Output_data_got_plt_x86_64): New class.
404 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
405 parameter. Change all callers.
406 (Output_data_plt_x86_64::layout_): Remove.
407 (Output_data_plt_x86_64::got_plt_): Change type.
408 (Target_x86_64::got_plt_): Change type. Change all references.
409 (Target_x86_64::got_section): Create instance of new class.
410 (Output_data_got_plt_x86_64::do_write): New function.
411 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
412 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
413 class.
414
6b97515d 4152014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 416
6b97515d
CC
417 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
418 if we have pubnames/pubtypes.
419
d1bddd3c
CC
4202014-05-02 Cary Coutant <ccoutant@google.com>
421
5fe7ffdc
AM
422 * defstd.cc (in_segment): Define __ehdr_start here...
423 * layout.cc (Layout::finalize): ...Instead of here. Set the
424 output segment when known.
425 * resolve.cc (Symbol::override_base_with_special): Remember
426 the original binding.
427 * symtab.cc (Symbol::set_output_segment): New function.
428 (Symbol::set_undefined): New function.
429 * symtab.h (Symbol::is_weak_undefined): Check original undef
430 binding.
431 (Symbol::is_strong_undefined): New function.
432 (Symbol::set_output_segment): New function.
433 (Symbol::set_undefined): New function.
434 * target-reloc.h (is_strong_undefined): Remove.
435 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
436 Check for hidden undefs.
437 (relocate_section): Call Symbol::is_strong_undefined.
438
439 * testsuite/Makefile.am (ehdr_start_test_1)
440 (ehdr_start_test_2, ehdr_start_test_3)
441 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
442 * testsuite/Makefile.in: Regenerate.
443 * testsuite/ehdr_start_def.cc: New source file.
444 * testsuite/ehdr_start_test.cc: New source file.
445 * testsuite/ehdr_start_test.t: New linker script.
446 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 447
7849f6d8
CC
4482014-04-23 Cary Coutant <ccoutant@google.com>
449
bf2cc635 450 PR gold/16870
7849f6d8
CC
451 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
452
99fd8cff
CC
4532014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
454
455 * layout.cc (Layout::include_section): Allow a target to decide
456 whether to include a section.
457 * target.h (Target::should_include_section): New function.
458 (Target::do_should_include_section): New function.
459
91f43acd
CC
4602014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
461
462 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
463 inline into ...
464 (Copy_relocs::emit): ... here.
465 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
466 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
467 (Copy_reloc_entry::entries_): Change from private to protected.
468
c4eb27e1
ST
4692014-04-02 Sriraman Tallam <tmsriram@google.com>
470
471 * icf.cc (get_section_contents): Replace copies of reloc
472 vectors with const references.
473
ae447ddd
CC
4742014-04-02 Cary Coutant <ccoutant@google.com>
475
476 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
477 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
478 * configure: Regenerate.
479 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
480 -fno-use-linker-plugin.
481 (LINK1, CXXLINK1): Add it to the link command.
482 * testsuite/Makefile.in: Regenerate.
483
fa47fa92
AM
4842014-03-12 Alan Modra <amodra@gmail.com>
485
486 * Makefile.in: Regenerate.
487
9b12c500
CC
4882014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
489
490 * symtab.h (Symbol::set_nonvis): New function.
491
beacaa96
CC
4922014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
493
494 * symtab.cc (Sized_symbol<32>::init_output_data):
495 Instantiate the template.
496 (Sized_symbol<64>::init_output_data): Likewise.
497
800d9823
CC
4982014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
499
500 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
501 adjust dynamic symbol value.
502 * target.h (Target::adjust_dyn_symbol): New function.
503 (Target::do_adjust_dyn_symbol): New function.
504
918fc1f8 5052014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 506
918fc1f8
CC
507 * output.cc (Output_data_dynamic::Dynamic_entry::write):
508 Get the value of DYNAMIC_CUSTOM dynamic entry.
509 * output.h (Output_data_dynamic::add_custom): New function.
510 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
511 dynamic entry.
512 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
513 * target.h (Target::dynamic_tag_custom_value): New function.
514 (Target::do_dynamic_tag_custom_value): New function.
515
98ff9231
CC
5162014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
517
518 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
519 dynsym indexes.
520 * target.h (Target::has_custom_set_dynsym_indexes): New function.
521 (Target::do_has_custom_set_dynsym_indexes): New function.
522 (Target::set_dynsym_indexes): New function.
523 (Target::do_set_dynsym_indexes): New function.
524
b80eed39
AM
5252014-03-07 Alan Modra <amodra@gmail.com>
526
527 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
528 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
529 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
530 (Powerpc_relocate_functions::has_overflow_bitfield,
531 overflowed): Use the above.
532 (Target_powerpc::Relocate::relocate): Correct overflow checking
533 for a number of relocations. Modify overflow test for 16-bit
534 fields in instructions to signed/unsigned according to whether
535 the field takes a signed or unsigned value.
536
4b95cf5c
AM
5372014-03-05 Alan Modra <amodra@gmail.com>
538
539 Update copyright years.
540
45965137
AM
5412014-03-05 Alan Modra <amodra@gmail.com>
542
543 * powerpc.cc (Target_powerpc::Scan::local, global): Support
544 R_PPC64_ADDR64_LOCAL.
545 (Target_powerpc::Relocate::relocate): Likewise.
546
2c80b753
AM
5472014-03-03 Alan Modra <amodra@gmail.com>
548
549 * dwp.cc (print_version): Update copyright year to current.
550
c1c69e83
AM
5512014-02-10 Alan Modra <amodra@gmail.com>
552
553 * po/gold.pot: Regenerate.
554
dd0c4e70
CC
5552014-02-06 Cary Coutant <ccoutant@google.com>
556
557 Fix problem where -u is ignored when a weak undef is seen.
558
559 * archive.cc (Library_base::should_include_member): Reorder
560 code to check for -u option if a weak undef has already been seen.
561 * testsuite/Makefile.am (weak_undef_test_2): New test case.
562 * testsuite/Makefile.in: Regenerate.
563 * testsuite/weak_undef_file3.cc: New file.
564 * testsuite/weak_undef_file4.cc: New file.
565 * testsuite/weak_undef_test_2.cc: New file.
566
1a221d3d
CC
5672014-02-05 Cary Coutant <ccoutant@google.com>
568
569 Fix issues with gold undefined symbol diagnostics.
570
571 PR binutils/15435
572 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
573 check to here.
574 * target-reloc.h (is_strong_undefined): New function.
575 (relocate_section): Move undef vtable symbol check from here.
576 Check for is_strong_undefined.
577
e889f0a4 5782014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 579
e889f0a4
CC
580 Fix problems with the --dynamic-list option.
581
582 PR gold/13577
583 * options.cc (General_options::parse_dynamic_list):
584 Set have_dynamic_list_.
585 (General_options::General_options): Initialize have_dynamic_list_.
586 (General_options::finalize): Turn off -Bsymbolic and
587 -Bsymbolic-functions if --dynamic-list provided.
588 * options.h (General_options::have_dynamic_list): New function.
589 (General_options::have_dynamic_list_): New data member.
590 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
591 correctly.
5fe7ffdc 592
e889f0a4
CC
593 PR gold/16530
594 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
595 in --dynamic-list, mark it.
5fe7ffdc 596
e889f0a4
CC
597 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
598 (dynamic_list_2): New test case.
599 * testsuite/Makefile.in: Regenerate.
600 * testsuite/dynamic_list_2.cc: New file.
601 * testsuite/dynamic_list_2.t: New file.
602 * testsuite/dynamic_list_lib1.cc: New file.
603 * testsuite/dynamic_list_lib2.cc: New file.
604 * testsuite/gc_dynamic_list_test.c: New file.
605 * testsuite/gc_dynamic_list_test.sh: New file.
606 * testsuite/gc_dynamic_list_test.t: New file.
607
ec673e64
CC
6082014-01-28 Cary Coutant <ccoutant@google.com>
609
610 Add .gdb_index version 7 support.
611
612 * gold/dwarf_reader.cc: include <utility> (for make_pair).
613 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
614 debug sections.
615 (Dwarf_ranges_table::read_ranges_table): Likewise.
616 (Dwarf_pubnames_table::read_section): Check for GNU-style
617 sections, and for compressed debug sections.
618 (Dwarf_pubnames_table::read_header): Compute end address of table.
619 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
620 for end of list by offset, not by offset == 0.
621 (Dwarf_info_reader::do_read_string_table): Check for compressed
622 debug sections.
623 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
624 Initialize new data members.
625 (Dwarf_pubnames_table::next_name): return flag_byte.
626 (Dwarf_pubnames_table::end_of_table_): New data member.
627 (Dwarf_pubnames_table::is_gnu_style_): New data member.
628 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
629 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
630 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
631 read skeleton type unit DIEs.
632 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
633 (Gdb_index::do_write): Write flag_byte.
634 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
635 (Gdb_index::Cu_vector): Store flags along with cu indexes.
636 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
637 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
638
221fd5d5
L
6392014-01-08 H.J. Lu <hongjiu.lu@intel.com>
640
641 * version.cc (print_version): Update copyright year to 2014.
642
6c09fb0b
ILT
6432013-12-19 Dimitry Andric <dimitry@andric.com>
644
645 * stringpool.cc (Stringpool_template::reserve): Add
646 HAVE_UNORDERED_MAP case.
647 * stringpool.cc (Stringpool_template::print_stats): Likewise.
648
8356f2d0
CC
6492013-12-18 Cary Coutant <ccoutant@google.com>
650
651 * configure.ac: Check for <unordered_set> and <unordered_map>.
652 * config.in: Regenerate.
653 * configure: Regenerate.
654 * system.h: Use <unordered_set> and <unordered_map> if available.
655
f2c7d7ee
RM
6562013-12-10 Roland McGrath <mcgrathr@google.com>
657
658 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
659 with $(INSTALL_PROGRAM_ENV).
660 * Makefile.in: Regenerate.
661
6632e8cc
CC
6622013-11-22 Cary Coutant <ccoutant@google.com>
663
664 * configure.ac: Add check for which library is needed for
665 dlopen.
666 * configure: Regenerate.
667
0c075858
CC
6682013-11-22 Cary Coutant <ccoutant@google.com>
669
670 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
671 assembler.
672 * testsuite/Makefile.in: Regenerate.
673
f49fe902
L
6742013-11-17 H.J. Lu <hongjiu.lu@intel.com>
675
676 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
677 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
678 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
679 (Target_x86_64<size>::Scan::local): Likewise.
680 (Target_x86_64<size>::Scan::global): Likewise.
681 (Target_x86_64<size>::Relocate::relocate): Likewise.
682 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
683 Likewise.
684 (Target_x86_64<size>::Scan::check_non_pic(): Handle
685 R_X86_64_PC32_BND.
686
687 * testsuite/Makefile.am (check_PROGRAMS): Add
688 exception_x86_64_bnd_test.
689 (exception_x86_64_bnd_test_SOURCES): New macro.
690 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
691 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
692 (exception_x86_64_bnd_test_LDADD): Likewise.
693 (exception_x86_64_bnd_1.o): New rule.
694 (exception_x86_64_bnd_2.o): Likewise.
695 * testsuite/Makefile.in: Regenerated.
696
9055360d
AM
6972013-11-15 Alan Modra <amodra@gmail.com>
698
699 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
700 accessor.
701 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
702 Only call ppc64_local_entry_offset for 64-bit. Restrict
703 symval_for_branch lookup to ELFv1.
704 (Stub_table::add_plt_call_entry): Use unsigned int off.
705 (Output_data_glink::Address, invalid_address): New.
706 (Output_data_glink::add_eh_frame): Move out of line. Add
707 support for ELFv2.
708 (Output_data_glink::add_global_entry, find_global_entry,
709 global_entry_address): New functions.
710 (Output_data_glink::global_entry_stubs_, end_branch_table_,
711 ge_size): New variables.
712 (Output_data_glink::set_final_data_size): Add global entry
713 stub sizing.
714 (Output_data_glink::do_write): Write global entry stubs.
715 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
716 parameter. Return true for ELFv2. Adjust callers.
717 (Target_powerpc::Scan::local, global): Restrict opd lookup to
718 ELFv1. Similarly for ifunc and dynamic relocation processing
719 specific to ELFv1. Recognize that symbols are defined on
720 their plt entries for ELFv2.
721 (Target_powerpc::symval_for_branch): Assert if called for
722 ELFv2 or ppc32.
723 (Target_powerpc::Relocate::relocate): Use global entry plt
724 stub for symbol value if such exists on ELFv2.
725 (Target_powerpc::Relocate::relocate): Don't call
726 symval_for_branch when ELFv2. Do adjust for local entry
727 offset when ELFv2.
728 (Target_powerpc::do_dynsym_value): Set symbols to global entry
729 plt stub for ELFv2.
730 (Target_powerpc::do_plt_address_for_global): Similarly.
731
cafdd569
CC
7322013-11-14 Cary Coutant <ccoutant@google.com>
733
734 Revert patch -- this did not fix the problem, and there is
735 no race there.
736
737 2013-11-14 Cary Coutant <ccoutant@google.com>
738
739 PR gold/14860
740 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
741 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
742 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
743 updating fde_offsets_.
744 (Eh_frame_hdr::lock_): New data member.
745
94e49e16
CC
7462013-11-14 Cary Coutant <ccoutant@google.com>
747
748 * dwp.cc (Dwo_file_entry): New type.
749 (File_list): Use Dwo_file_entry.
750 (Dwo_file::verify): New function.
751 (Dwo_file::verify_dwo_list): New function.
752 (Dwo_file::sized_verify_dwo_list): New function.
753 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
754 list.
755 (Dwp_options): New enum type.
756 (dwp_options): Add --verify-only.
757 (usage): Likewise.
758 (main): Likewise.
759 * dwp.h (gold_info): Add declaration.
760
7cdd7d57
CC
7612013-11-14 Cary Coutant <ccoutant@google.com>
762
763 PR gold/14860
764 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
765 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
766 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
767 updating fde_offsets_.
768 (Eh_frame_hdr::lock_): New data member.
769
1d946cb3
CC
7702013-11-06 Cary Coutant <ccoutant@google.com>
771
772 PR gold/15758
773 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
774 before reloc sections.
775
4f65b40e
AM
7762013-11-04 Alan Modra <amodra@gmail.com>
777
778 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
779 (Symbol::needs_dynamic_reloc): Test new flag.
780 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
781 (Target_powerpc::Scan::get_reference_flags): Add target param.
782 Return FUNC_DESC_ABI for 64-bit ELFv1.
783 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
784 call.
785 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
786 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
787
908794a9
CC
7882013-10-31 Cary Coutant <ccoutant@google.com>
789
790 Restore support for dwp v2 DWARF package file format.
791
792 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
793 tu_length parameter. Adjust all callers.
794 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
795 * dwp.cc: Include dwarf.h.
796 (Section_bounds): New struct type.
797 (Unit_set): New struct type.
798 (Dwo_file::Dwo_file): Initialize new data member.
799 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
800 Combine and rename to...
801 (Dwo_file::read_unit_index): ...this.
802 (Dwo_file::sized_read_compunit_index)
803 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
804 (Dwo_file::sized_read_unit_index): ...this.
805 (Dwo_file::copy_section): Remove section_name, is_str_offsets
806 parameters; add section_id parameter.
807 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
808 (Dwo_file::add_unit_set): ...this.
809 (Dwo_file::shndx_map_): Remove.
810 (Dwo_file::sect_offsets_): New data member.
811 (Dwp_output_file::Dwp_output_file): Initialize new data members.
812 (Dwp_output_file::add_section): Rename to...
813 (Dwp_output_file::add_contribution): ...this.
814 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
815 (Dwp_output_file::add_tu_set): Likewise.
816 (Dwp_output_file::Contribution): New type.
817 (Dwp_output_file::Section::contributions): New data member.
818 (Dwp_output_file::Cu_or_tu_set): Remove.
819 (Dwp_output_file::Section::Section): New ctor.
820 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
821 (Dwp_output_file::Dwp_index::Section_table): New type.
822 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
823 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
824 parameter.
825 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
826 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
827 (Dwp_output_file::Dwp_index::section_table): New member function.
828 (Dwp_output_file::Dwp_index::section_table_end): New member function.
829 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
830 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
831 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
832 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
833 (Dwp_output_file::Dwp_index::section_table_): New data member.
834 (Dwp_output_file::Dwp_index::section_mask_): New data member.
835 (Dwp_output_file::add_output_section): New member function.
836 (Dwp_output_file::write_new_section): New member function.
837 (Dwp_output_file::write_contributions): New member function.
838 (Dwp_output_file::section_id_map_): New data member.
839 (class Dwo_id_info_reader): Remove.
840 (class Unit_reader): New class.
841 (get_dwarf_section_name): New function.
842 (Dwo_file::read_executable): Adjust initializations of class data.
843 (Dwo_file::read): Add support for v2 package file format.
844 (Dwo_file::read_unit_index): Likewise.
845 (Dwo_file::sized_read_unit_index): Likewise.
846 (Dwo_file::copy_section): Likewise.
847 (Dwo_file::add_unit_set): Likewise.
848 (Dwp_output_file::add_output_section): Likewise.
849 (Dwp_output_file::add_contribution): Likewise.
850 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
851 for empty slot.
852 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
853 file format.
854 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
855 slot.
856 (Dwp_output_file::initialize): Remove unused function.
857 (Dwp_output_file::finalize): Add support for v2 package file format.
858 (Dwp_output_file::write_index): Likewise.
859 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
860 function prototype.
861
2500c017
CC
8622013-10-31 Cary Coutant <ccoutant@google.com>
863
864 * configure.ac: Fix check for -fmerge-constants.
865 * configure.ac: Regenerate.
866
dd0845d7
RM
8672013-10-30 Roland McGrath <mcgrathr@google.com>
868
869 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
870 Correct 9-byte nop sequence to match what the assembler generates.
871
b4f7960d
AM
8722013-10-30 Alan Modra <amodra@gmail.com>
873
874 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
875 ppc64_local_entry_offset, ppc64_local_entry_offset,
876 do_read_symbols): New functions.
877 (Powerpc_relobj::e_flags_, st_other_): New vars.
878 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
879 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
880 (Powerpc_relobj::e_flags_): New var.
881 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
882 and adjust for ELFv2.
883 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
884 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
885 (Powerpc_dynobj::do_find_special_sections): Likewise.
886 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
887 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
888 to ELFv2 local entry.
889 (Target_powerpc::do_relax): No thread safe barriers needed for
890 ELFv2.
891 (Output_data_plt_powerpc::initial_plt_entry_size_,
892 plt_entry_size): Delete. Replace all uses with
893 first_plt_entry_offset() and plt_entry_size().
894 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
895 reserved_size parm. Update callers.
896 (Output_data_plt_powerpc::entry_count): Update.
897 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
898 and use Target_powerpc::first_plt_entry_offset().
899 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
900 rename to plt_entry_size.
901 (Output_data_plt_powerpc::add_ifunc_entry,
902 add_local_ifunc_entry): Adjust reloc for ELFv2.
903 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
904 (glink_eh_frame_fde_64v2): New.
905 (Stub_table::plt_call_size): Support ELFv2 sizing.
906 (Output_data_glink::add_eh_frame): Use the new FDE.
907 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
908 (Stub_table::do_write): Write ELFv2 stubs and glink.
909 (Target_powerpc::Relocate::relocate): Replaces nop after call
910 with ld 2,24(1) and adjust local offset destination for ELFv2.
911
f9c6b907
AM
9122013-10-30 Alan Modra <amodra@gmail.com>
913
914 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
915 (Target_powerpc::Scan::global, local): Likewise.
916 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
917 on all ppc64 @h and @ha relocs.
918
e84fe78f
AM
9192013-10-14 Alan Modra <amodra@gmail.com>
920
921 * output.h (Output_data_got::add_constant): Tidy.
922 (Output_data_got::add_constant_pair): New function.
923 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
924 methods used so as to first call reserve_ent().
925
679e4abf
RM
9262013-10-11 Roland McGrath <mcgrathr@google.com>
927
44dcb735
RM
928 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
929 add_got_entry and add_got_entry_pair.
930
13323c49
RM
931 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
932 (HAVE_PUBNAMES): Likewise.
933 * configure: Regenerate.
934
1496b446
RM
935 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
936 * testsuite/Makefile.in: Regenerate.
937
cc84c10b
RM
938 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
939 Remove const from declaration.
940 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
941 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
942 * output.h (Output_file_header): Remove const from member target_
943 and corresponding constructor argument.
944 * output.cc (Output_file_header::Output_file_header): Update prototype.
945 (Output_file_header::do_sized_write): Use this->target_ in place
946 of parameters()->target().
947
52f66a2c
RM
948 * testsuite/undef_symbol.cc (Foo::get_a): New method.
949
2b64b551
RM
950 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
951 * configure: Regenerate.
952 * Makefile.in: Regenerate.
953 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
954 * testsuite/merge_string_literals_2.c: Likewise.
955 * testsuite/Makefile.am
956 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
957 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
958 literal -fmerge-constants.
959 * testsuite/Makefile.in: Regenerate.
960
43819297
RM
961 * i386.cc (Target_i386): Remove unused member dynbss_.
962 * arm.cc (Target_arm): Likewise.
963 * powerpc.cc (Target_powerpc): Likewise.
964 * sparc.cc (Target_sparc): Likewise.
965 * tilegx.cc (Target_tilegx): Likewise.
966 * x86_64.cc (Target_x86_64): Likewise.
967 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
968 type_signature_, type_offset_.
969 * plugin.h (Plugin_hook): Remove unused member layout_.
970 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
971 mapfile_.
972 (Read_member): Remove unused members input_objects_, symtab_,
973 mapfile_, layout_.
974 (Check_library): Remove unused member symtab_.
975 * archive.h (Lib_group): Remove unused member lib_.
976 * archive.cc (Lib_group::Lib_group): Update initializer.
977 * incremental.h (Incremental_binary): Remove unused member target_.
978 (Incremental_script_entry): Removed unused member script_.
979 * layout.h (Write_symbols_task): Remove unused member input_objects_.
980 * icf.h (Icf): Remove unused member num_tracked_relocs.
981
39d9ead7
RM
982 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
983 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
984 its only use.
985 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
986
679e4abf
RM
987 * archive.h: Use struct rather than class for forward declaration
988 of Read_symbols_data.
989
54de2ea6
CC
9902013-10-07 Cary Coutant <ccoutant@google.com>
991
992 PR gold/16010
993 * testsuite/Makefile.am (icf_test): Fix dependencies.
994 (icf_safe_test): Likewise.
995 (icf_safe_so_test): Likewise.
996 (large_symbol_alignment): Add empty _LDADD rule.
997 * testsuite/Makefile.in: Regenerate.
998
b14016f0
L
9992013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1000
1001 PR gold/15927
1002 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1003 relocation for R_X86_64_32 on x32.
1004
eb426534
RM
10052013-08-27 Roland McGrath <mcgrathr@google.com>
1006
1007 * output.cc (Output_segment::set_section_addresses): Take new
1008 Target* argument. If target->isolate_execinstr() and the segment
1009 is executable and starts at a target->abi_pagesize() boundary,
1010 pad its end out to a target->abi_pagesize() boundary with code fill.
1011 * output.h (Output_segment::set_section_addresses): Update decl.
1012 * layout.h (Layout::check_output_data_for_reset_values): Take new
1013 argument RELAX_OUTPUTS.
1014 (Layout): New member relax_output_list_.
1015 (Layout::add_relax_output): New method.
1016 * layout.cc (Layout::Layout): Update constructor.
1017 (Layout::reset_relax_output): New method.
1018 (Layout::clean_up_after_relaxation): Call it.
1019 (Layout::prepare_for_relaxation): Update caller.
1020 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1021 Call reset_relax_output before re-processing segments for
1022 isolate_execinstr case.
1023 (Layout::write_data): Handle relax_output_list_.
1024 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1025 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1026
9aff4b7a
NC
10272013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1028
1029 PR binutils/15834
1030 * object.h: Fix typos.
1031
93f8221c
RM
10322013-08-16 Roland McGrath <mcgrathr@google.com>
1033
1034 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1035 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1036
e44c3715
CC
10372013-08-07 Cary Coutant <ccoutant@google.com>
1038
1039 Revert support for v2 DWP files:
1040
1041 2013-03-01 Cary Coutant <ccoutant@google.com>
1042
1043 Add dwp support for v2 DWARF package file format.
1044 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1045 tu_length parameter. Adjust all callers.
1046 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1047 * dwp.cc: Include dwarf.h.
1048 (Section_bounds): New struct type.
1049 (Unit_set): New struct type.
1050 (Dwo_file::Dwo_file): Initialize new data member.
1051 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1052 Combine and rename to...
1053 (Dwo_file::read_unit_index): ...this.
1054 (Dwo_file::sized_read_compunit_index)
1055 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1056 (Dwo_file::sized_read_unit_index): ...this.
1057 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1058 parameters; add section_id parameter.
1059 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1060 (Dwo_file::add_unit_set): ...this.
1061 (Dwo_file::shndx_map_): Remove.
1062 (Dwo_file::sect_offsets_): New data member.
1063 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1064 (Dwp_output_file::add_section): Rename to...
1065 (Dwp_output_file::add_contribution): ...this.
1066 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1067 (Dwp_output_file::add_tu_set): Likewise.
1068 (Dwp_output_file::Contribution): New type.
1069 (Dwp_output_file::Section::contributions): New data member.
1070 (Dwp_output_file::Cu_or_tu_set): Remove.
1071 (Dwp_output_file::Section::Section): New ctor.
1072 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1073 (Dwp_output_file::Dwp_index::Section_table): New type.
1074 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1075 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1076 parameter.
1077 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1078 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1079 (Dwp_output_file::Dwp_index::section_table): New member function.
1080 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1081 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1082 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1083 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1084 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1085 (Dwp_output_file::Dwp_index::section_table_): New data member.
1086 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1087 (Dwp_output_file::add_output_section): New member function.
1088 (Dwp_output_file::write_new_section): New member function.
1089 (Dwp_output_file::write_contributions): New member function.
1090 (Dwp_output_file::section_id_map_): New data member.
1091 (class Dwo_id_info_reader): Remove.
1092 (class Unit_reader): New class.
1093 (get_dwarf_section_name): New function.
1094 (Dwo_file::read_executable): Adjust initializations of class data.
1095 (Dwo_file::read): Add support for v2 package file format.
1096 (Dwo_file::read_unit_index): Likewise.
1097 (Dwo_file::sized_read_unit_index): Likewise.
1098 (Dwo_file::copy_section): Likewise.
1099 (Dwo_file::add_unit_set): Likewise.
1100 (Dwp_output_file::add_output_section): Likewise.
1101 (Dwp_output_file::add_contribution): Likewise.
1102 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1103 for empty slot.
1104 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1105 file format.
1106 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1107 slot.
1108 (Dwp_output_file::initialize): Remove unused function.
1109 (Dwp_output_file::finalize): Add support for v2 package file format.
1110 (Dwp_output_file::write_index): Likewise.
1111 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1112 function prototype.
1113
c6905c28
CC
11142013-07-31 Cary Coutant <ccoutant@google.com>
1115
1116 * object.cc (Sized_relobj::do_output_section_address): New function.
1117 (Sized_relobj): Instantiate explicitly.
1118 * object.h (Object::output_section_address): New function.
1119 (Object::do_output_section_address): New function.
1120 (Sized_relobj::do_output_section_address): New function.
1121 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1122
11232013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1124 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1125
1126 * parameters.cc (Parameters::entry): Return target-specific entry
1127 symbol name.
1128 * target.h (Target::entry_symbol_name): New function.
1129 (Target_info::entry_symbol_name): New data member.
1130
1131 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1132 * i386.cc (Target_i386::i386_info): Likewise.
1133 (Target_i386_nacl::i386_nacl_info): Likewise.
1134 * sparc.cc (Target_sparc::sparc_info): Likewise.
1135 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1136 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1137 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1138 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1139
234d4ab8
SA
11402013-07-22 Sterling Augustine <saugustine@google.com>
1141
1142 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1143 Convert parameter shndx to local variable. Add parameters symtab
1144 and symtab_size. Scan over section names. Find relocation
1145 section corresponding to current section. Create and initialize
1146 reloc_mapper_ and reloc_type_.
1147 (Dwarf_pubnames_table::read_header): Add assertion. Change
1148 unit_length to off_t. Initialize member unit_length_. Fill in field
1149 cu_offset_.
1150 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1151 Initialize new fields unit_length_ and cu_offset_.
1152 (Dwarf_pubnames_table::read_section): Update prototype.
1153 (Dwarf_pubnames_table::cu_offset): New member function.
1154 (Dwarf_pubnames_table::subsection_size): Likewise.
1155 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1156 New fields.
1157 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1158 member functions public.
1159 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1160 Update comment. Rework logic. Move repeated parts to...
1161 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1162 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1163 pubtypes_table_, and stmt_list_offset.
1164 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1165 Gdb_index::find_pubtype_offset,
1166 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1167 (Gdb_index::pubnames_read): Update prototype and rework logic.
1168 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1169 Forward declare.
1170 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1171 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1172 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1173 Gdb_index::map_pubtable_to_dies):
1174 Declare functions.
1175 (Gdb_index::pubnames_read): Update declaration.
1176 (Gdb_index::Pubname_offset_map): New type.
1177 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1178 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1179 Gdb_index::stmt_list_offset): Declare.
1180 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1181 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1182 Gdb_index::pubtypes_offset_): Remove.
1183
a3ed37d8
RM
11842013-07-19 Roland McGrath <mcgrathr@google.com>
1185
1186 * options.h (General_options): Add -Trodata-segment option.
1187 * parameters.cc (Parameters::check_rodata_segment): New function.
1188 (Parameters::set_target_once): Call it.
1189 * parameters.h (Parameters): Declare it (private member function).
1190 * layout.cc (load_seg_unusable_for_headers): New function, broken
1191 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1192 then validate rodata segment rather than text segment.
1193 (relaxation_loop_body): Call that.
1194 (is_text_segment): New function. Don't admit a non-executable
1195 segment if TARGET->isolate_execinstr().
1196 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1197
eb5b4ded
CC
11982013-07-15 Shawn Landden <shawnlandden@gmail.com>
1199
1200 PR gold/15070
1201 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1202 * nacl.h (Sniff_file::View::View): Request aligned view.
1203
4d5effb9
CC
12042013-07-11 Cary Coutant <ccoutant@google.com>
1205
1206 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1207 correct BRLT entry size.
1208
ba8ca3e7
AM
12092013-07-03 Alan Modra <amodra@gmail.com>
1210
1211 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1212 comment.
1213
267257d2
CC
12142013-07-01 Cary Coutant <ccoutant@google.com>
1215
1216 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1217 reloc_type_.
1218 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1219 (Dwarf_ranges_table::lookup_reloc): New function.
1220 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1221 reloc_type_.
1222 (Dwarf_ranges_table::lookup_reloc): New function.
1223 (Dwarf_ranges_table::reloc_type_): New data member.
1224
06f30c9d
CC
12252013-06-27 Jing Yu <jingyu@google.com>
1226
1227 PR gold/15662
1228 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1229 function.
1230 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1231 (Target_powerpc::do_relax): Call the above.
1232
a2d7bf59
AM
12332013-06-27 Cary Coutant <ccoutant@google.com>
1234
1235 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1236 on garbage collected .opd section.
1237
12382013-06-27 Alan Modra <amodra@gmail.com>
1239
1240 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1241 is non-zero.
1242 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1243 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1244
32364e50
CC
12452013-06-14 Cary Coutant <ccoutant@google.com>
1246
1247 * resolve.cc (Symbol::override_base): Don't override st_type
1248 from plugin placeholder symbols.
1249 (Symbol_table::resolve): Likewise.
1250 (Symbol_table::should_override): Don't complain about TLS mismatch
1251 if the TO symbol is a plugin placeholder.
1252 * testsuite/Makefile.am (plugin_test_tls): New test.
1253 * testsuite/Makefile.in: Regenerate.
1254 * testsuite/plugin_test_tls.sh: New test script.
1255 * testsuite/two_file_test_2_tls.cc: New test source.
1256 * testsuite/two_file_test_tls.cc: New test source.
1257
7fb47cc9
CC
12582013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1259
1260 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1261 the maximum segment alignment is larger than the page size.
1262 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1263 correctly aligns the symbols with large alignemnt.
1264 * testsuite/Makefile.in: Regenerate.
1265 * testsuite/large_symbol_alignment.cc: New file.
1266
6934001a
CC
12672013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1268 Sriraman Tallam <tmsriram@google.com>
1269
1270 * options.h (sort_section): New option.
1271 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1272 Rename from Input_section_sort_section_name_special_ordering_compare.
1273 (Input_section_sort_section_name_compare): New struct.
1274 * output.cc (Output_section::Input_section_sort_section_name_compare::
1275 operator()): New function.
1276 (Output_section::sort_attached_input_sections): Use new sort function
1277 for .text if --sort-section=name is specified.
1278 * layout.cc (Layout::make_output_section):
1279 Add sorting by name when --sort-section=name is specified.
1280 * testsuite/Makefile.am (text_section_grouping): Test option
1281 --sort-section=name.
1282 * testsuite/Makefile.in: Regenerate.
1283 * testsuite/section_sorting_name.cc: New file.
1284 * testsuite/section_sorting_name.sh: New file.
1285
93acabad
CC
12862013-05-21 Cary Coutant <ccoutant@google.com>
1287
1288 * symtab.h (Symbol::is_cxx_vtable): New function.
1289 * target-reloc.h (relocate_section): Check for vtable symbol.
1290 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1291 * testsuite/Makefile.in: Regenerate.
1292 * testsuite/missing_key_func.cc: New test source.
1293 * testsuite/missing_key_func.sh: New test script.
1294
60e8b3fc
CC
12952013-05-21 Cary Coutant <ccoutant@google.com>
1296
2b64b551
RM
1297 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1298 type of enclosing symbol.
1299 (Relocate_info::location): Check symbol type when describing symbol.
1300 * object.h (Symbol_location_info): Remove unused line_number;
1301 add enclosing_symbol_type.
1302 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1303
9df9de2c
CC
13042013-05-13 Cary Coutant <ccoutant@google.com>
1305
2b64b551
RM
1306 * configure.ac: Export DEFAULT_TARGET.
1307 * configure: Regenerate.
1308 * Makefile.in: Regenerate.
1309 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1310 * testsuite/Makefile.in: Regenerate.
1311 * testsuite/debug_msg.sh: Delete duplicate tests.
1312 Don't check undef_int error message match for powerpc where the
1313 source file and line number aren't available.
9df9de2c 1314
bbc5ae17
RM
13152013-05-10 Roland McGrath <mcgrathr@google.com>
1316
1317 * options.h (General_options): Add --rosegment-gap option.
1318 * options.cc (finalize): --rosegment-gap implies --rosegment.
1319 * layout.cc (set_segment_offsets): Let user option override
1320 target->rosegment_gap().
1321
0c6e6c39
RM
13222013-05-10 Roland McGrath <mcgrathr@google.com>
1323
1324 * options.h (General_options): Remove leading space from help
1325 messages for -nostdlib and --rosegment.
1326
cde7cb01
MR
13272013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1328
1329 PR ld/15365
1330 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1331
f31ae5b8
AM
13322013-05-03 Alan Modra <amodra@gmail.com>
1333
1334 * merge.cc (Output_merge_string::do_add_input_section): Correct
1335 scan for number of strings. Rename vars to avoid shadowing.
1336 Include missing terminator in input_size_.
1337
d3a7cd45
L
13382013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1339
1340 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1341 Restore empty string handling.
1342
6ad3daba
CC
13432013-05-01 Cary Coutant <ccoutant@google.com>
1344
1345 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1346 uninitialized warning.
1347
e31908b6
CC
13482013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1349
1350 * output.cc (Output_section::add_merge_input_section): Allow
1351 to merge sections if the alignment is more than character size.
1352 * merge.h (Output_merge_string::Output_merge_string): Remove
1353 assert.
1354 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1355 only not-null strings. Check the alignment of strings.
1356 * stringpool.h
1357 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1358 alignment as the argument.
1359 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1360 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1361 Align non-zero length strings according to the addralign_.
1362 (Stringpool_template<Stringpool_char>::set_string_offsets):
1363 Updating offsets according to the given alignment.
1364 * testsuite/Makefile.am (text_section_grouping): Test if string
1365 literals are getting merged.
1366 * testsuite/Makefile.in: Regenerate.
1367 * testsuite/merge_string_literals_1.c: New file.
1368 * testsuite/merge_string_literals_2.c: Ditto.
1369 * testsuite/merge_string_literals.sh: Ditto.
1370
0e804863
ILT
13712013-04-26 Ian Lance Taylor <iant@google.com>
1372
1373 * target-reloc.h (relocate_section): If the reloc offset is out of
1374 range, pass VIEW as NULL to relocate.relocate.
1375 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1376 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1377 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1378 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1379 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1380 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1381
e7c5ea40
CC
13822013-04-26 Geoff Pike <gpike@chromium.org>
1383
1384 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1385 * layout.cc (Hash_task): New class.
1386 (Layout::queue_build_id_tasks): New function.
1387 (Layout::write_build_id): Handle single-thread portion of build ID
1388 computation. (In some cases, all of it is single-threaded.) Replace
1389 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1390 functionality in fewer lines of code.
1391 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1392 * options.h (General_options): make "--build-id" default to tree
1393 rather than sha1. Add two new options related to --build-id=tree:
1394 --build-id-chunk-size-for-treehash and
1395 --build-id-min-file-size-for-treehash.
1396 * Makefile.am: add testing of --build-id=tree and related new options
1397 (these tests will be invoked by "make check").
1398 * Makefile.in: Regenerate.
1399
49926cd0
AM
14002013-04-25 Alan Modra <amodra@gmail.com>
1401
1402 * configure.tgt: Add powerpcle and powerpc64le.
1403
a4034750
AM
14042013-04-22 Alan Modra <amodra@gmail.com>
1405
1406 PR gold/15355
1407 * layout.cc (Layout::segment_precedes): Allow more than one
1408 segment with the same type and flags.
1409
e79c84aa
CC
14102013-04-15 Cary Coutant <ccoutant@google.com>
1411
1412 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1413 allocate space in file for BSS sections.
1414
2199fbe7
CC
14152013-04-15 Cary Coutant <ccoutant@google.com>
1416
1417 * script-sections.cc (Orphan_output_section): Reset address
1418 to zero after each orphaned section for relocatable links.
1419
502e8a84
CC
14202013-04-15 Cary Coutant <ccoutant@google.com>
1421
a4034750
AM
1422 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1423 section starting address for relocatable link.
1424 * testsuite/Makefile.am (script_test_11): New test.
1425 * testsuite/Makefile.in: Regenerate.
1426 * testsuite/script_test_11.c: New source file.
1427 * testsuite/script_test_11.t: New linker script.
502e8a84 1428
0cfdc767
AM
14292013-04-13 Alan Modra <amodra@gmail.com>
1430
1431 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1432 owner when sections are not adjacent and exceed group size.
1433 (Target_powerpc::group_sections): Handle corner case.
1434 (Target_powerpc::Branch_info::make_stub): Handle case where
1435 stub table doesn't exist due to branches in non-exec sections.
1436 (Target_powerpc::Relocate::relocate): Likewise.
1437
6830ee24
AM
14382013-04-11 Alan Modra <amodra@gmail.com>
1439
1440 PR gold/15354
1441 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1442 .branch_lt to match bfd ld. Adjust comments throughout file.
1443
54a3d865
ILT
14442013-04-04 Ian Lance Taylor <iant@google.com>
1445
1446 GCC PR c++/56840
1447 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1448 sections before checking whether they are included in the link.
1449
9993ba11
ST
14502013-03-29 Sriraman Tallam <tmsriram@google.com>
1451
1452 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1453 object before calling the plugin claim_file handler. Pass the elf
1454 object of the archive to the plugin. Delete the elf object if the
1455 plugin claims the file.
1456
ebacd51e
AM
14572013-03-21 Alan Modra <amodra@gmail.com>
1458
1459 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1460 segment when omagic.
1461
117be58f
AM
14622013-03-21 Alan Modra <amodra@gmail.com>
1463
1464 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1465 comparison warning.
1466 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1467 uninitialized" warning.
1468
32e2b61d
AM
14692013-03-20 Alan Modra <amodra@gmail.com>
1470
1471 * symtab.h (Symbol::clear_version): New function.
1472 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1473 is_needed by weak references. Clear version for symbols defined
1474 in as-needed objects that are not needed.
1475
b3ccdeb5
AM
14762013-03-15 Alan Modra <amodra@gmail.com>
1477
1478 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1479 static and public. Add report_err param. Return false for data refs.
1480 (Target_powerpc::rela_dyn_section): New overloaded function.
1481 (Target_powerpc::plt_, iplt_): Elucidate.
1482 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1483 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1484 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1485 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1486 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1487 push_branch and make_plt_entry for ifunc syms when
1488 reloc_needs_plt_for_ifunc.
1489 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1490 for ifunc unless reloc_needs_plt_for_ifunc.
1491
ad3d8a2f
AM
14922013-03-15 Alan Modra <amodra@gmail.com>
1493
1494 * gc.h (gc_process_relocs): Don't look through function descriptors.
1495 * icf.cc (get_section_contents): Do so here instead.
1496
4d9aa155
AM
14972013-03-13 Alan Modra <amodra@gmail.com>
1498
1499 * powerpc.cc (is_branch_reloc): Forward declare.
1500 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1501 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1502 false for 64-bit, true for 32-bit non-branch relocs.
1503 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1504 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1505 nm output.
1506 (icf_safe_test): Generate linker map file as well as nm output.
1507 (icf_safe_so_test): Likewise.
1508 * testsuite/Makefile.in: Regenerate.
1509 * testsuite/icf_test.sh: Parse linker map file to determine
1510 section folding.
1511 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1512 * testsuite/icf_safe_so_test.sh: Likewise.
1513 (X86_32_or_ARM_specific_safe_fold): Merge into..
1514 (arch_specific_safe_fold): ..this.
1515 (X86_64_specific_safe_fold): Delete unused function.
1516
57420c20
AM
15172013-03-12 Alan Modra <amodra@gmail.com>
1518
1519 * gc.h (gc_process_relocs): Look through function descriptors
1520 to determine shndx, symvalue and addend used by ICF. Tidy
1521 variable duplication.
1522
dc3714f3
AM
15232013-03-11 Alan Modra <amodra@gmail.com>
1524
1525 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1526 * layout.cc (Layout_task_runner::run): ..to here.
1527 * symtab.h (struct Symbol_location): Extract from..
1528 (class Symbol_table): ..here.
1529 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1530 * target.h (class Target): Add function_location and
1531 do_function_location functions.
1532 (class Sized_target): Add do_function_location.
1533 * object.h (class Sized_relobj_file): Move find_shdr..
1534 (class Object): ..to here.
1535 * object.cc: Likewise. Update to suit. Instantiate.
1536 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1537 * powerpc.cc (class Powerpc_dynobj): New.
1538 (Target_powerpc::do_function_location): New function.
1539 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1540 (Powerpc_dynobj::do_read_symbols): New function.
1541 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1542
956b03bb
ILT
15432013-03-08 Ian Lance Taylor <iant@google.com>
1544
1545 * options.cc (General_options::string_to_object_format): Accept
1546 "default".
1547
4bead2d5
AM
15482013-03-08 Alan Modra <amodra@gmail.com>
1549
1550 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1551 pointer to Post_fde.
1552 (struct Post_fde): Move definition to here..
1553 * ehframe.cc (struct Post_fde): ..from here.
1554 (Cie::write): Don't alloc Post_fde.
1555 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1556
02e60bf7
AM
15572013-03-07 Alan Modra <amodra@gmail.com>
1558
1559 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1560 relocation referencing .LC0.
1561 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1562
8343f03a
AM
15632013-03-07 Alan Modra <amodra@gmail.com>
1564
1565 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1566 always_inline. Add assembly for powerpc to avoid GOT.
1567
3366d57c
AM
15682013-03-07 Alan Modra <amodra@gmail.com>
1569
1570 * testsuite/script_test_10.sh: Don't test .bss section
1571 header number.
1572
6c77229c
AM
15732013-03-06 Alan Modra <amodra@gmail.com>
1574
1575 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1576 (Target_powerpc::symval_for_branch): Add symtab param. Update
1577 all callers. Handle folded sections.
1578 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1579 to Powerpc_relobj.
1580 (Global_symbol_visitor_opd::operator()): Likewise.
1581
a39e4af6
AM
15822013-03-04 Alan Modra <amodra@gmail.com>
1583
1584 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1585 * testsuite/Makefile.in: Regenerate.
1586
d5834edb
CC
15872013-03-01 Cary Coutant <ccoutant@google.com>
1588
1589 Add dwp support for v2 DWARF package file format.
1590 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1591 tu_length parameter. Adjust all callers.
1592 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1593 * dwp.cc: Include dwarf.h.
1594 (Section_bounds): New struct type.
1595 (Unit_set): New struct type.
1596 (Dwo_file::Dwo_file): Initialize new data member.
1597 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1598 Combine and rename to...
1599 (Dwo_file::read_unit_index): ...this.
1600 (Dwo_file::sized_read_compunit_index)
1601 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1602 (Dwo_file::sized_read_unit_index): ...this.
1603 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1604 parameters; add section_id parameter.
1605 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1606 (Dwo_file::add_unit_set): ...this.
1607 (Dwo_file::shndx_map_): Remove.
1608 (Dwo_file::sect_offsets_): New data member.
1609 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1610 (Dwp_output_file::add_section): Rename to...
1611 (Dwp_output_file::add_contribution): ...this.
1612 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1613 (Dwp_output_file::add_tu_set): Likewise.
1614 (Dwp_output_file::Contribution): New type.
1615 (Dwp_output_file::Section::contributions): New data member.
1616 (Dwp_output_file::Cu_or_tu_set): Remove.
1617 (Dwp_output_file::Section::Section): New ctor.
1618 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1619 (Dwp_output_file::Dwp_index::Section_table): New type.
1620 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1621 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1622 parameter.
1623 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1624 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1625 (Dwp_output_file::Dwp_index::section_table): New member function.
1626 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1627 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1628 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1629 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1630 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1631 (Dwp_output_file::Dwp_index::section_table_): New data member.
1632 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1633 (Dwp_output_file::add_output_section): New member function.
1634 (Dwp_output_file::write_new_section): New member function.
1635 (Dwp_output_file::write_contributions): New member function.
1636 (Dwp_output_file::section_id_map_): New data member.
1637 (class Dwo_id_info_reader): Remove.
1638 (class Unit_reader): New class.
1639 (get_dwarf_section_name): New function.
1640 (Dwo_file::read_executable): Adjust initializations of class data.
1641 (Dwo_file::read): Add support for v2 package file format.
1642 (Dwo_file::read_unit_index): Likewise.
1643 (Dwo_file::sized_read_unit_index): Likewise.
1644 (Dwo_file::copy_section): Likewise.
1645 (Dwo_file::add_unit_set): Likewise.
1646 (Dwp_output_file::add_output_section): Likewise.
1647 (Dwp_output_file::add_contribution): Likewise.
1648 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1649 for empty slot.
1650 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1651 file format.
1652 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1653 slot.
1654 (Dwp_output_file::initialize): Remove unused function.
1655 (Dwp_output_file::finalize): Add support for v2 package file format.
1656 (Dwp_output_file::write_index): Likewise.
1657 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1658 function prototype.
1659
a68a081d
CC
16602013-03-01 Cary Coutant <ccoutant@google.com>
1661
1662 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1663 function into class definition in header file.
1664 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1665 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1666 New function.
1667 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1668
9d5781f8
AM
16692013-02-28 Alan Modra <amodra@gmail.com>
1670
1671 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1672 * target.cc (Target::do_plt_fde_location): New function.
1673 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1674 accessor function, and constructor param.
1675 (struct Post_fde, Post_fdes): Declare.
1676 (Cie::write): Add post_fdes param.
1677 * ehframe.cc (Fde::write): Use plt_fde_location.
1678 (struct Post_fde): Define.
1679 (Cie::write): Stash FDEs added post merge mapping.
1680 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1681 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1682 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1683 other FDEs.
1684 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1685 (Target_powerpc::has_glink): New function.
1686 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1687 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1688 glink_eh_frame_fde_32, default_fde): New data.
1689 (Stub_table::eh_frame_added_): New var.
1690 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1691 Make const.
1692 (Stub_table::add_eh_frame): New function.
1693 (Output_data_glink::add_eh_frame): New function.
1694 (Target_powerpc::make_glink_section): Call add_eh_frame.
1695
214383dd
ILT
16962013-02-15 Ian Lance Taylor <iant@google.com>
1697
1698 * options.h (DEFINE_uint64_alias): Define.
1699 (class General_options): Add -Ttext-segment as an alias for
1700 -Ttext.
1701
91c2b899
AM
17022013-02-15 Alan Modra <amodra@gmail.com>
1703
1704 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1705 (Stub_table::do_write): ..here, two places.
1706 (Stub_table::plt_call_size): Use it here too.
1707
20e2a8aa
ILT
17082013-02-11 Ian Lance Taylor <iant@google.com>
1709
1710 * descriptors.cc (Descriptors::close_all): New function.
1711 * descriptors.h (class Descriptors): Declare close_all.
1712 (close_all_descriptors): New inline function.
1713 * plugin.cc: Include "descriptors.h".
1714 (Plugin_manager::cleanup): Call close_all_descriptors.
1715
8952bc69
AM
17162013-02-06 Alan Modra <amodra@gmail.com>
1717
1718 * README: Update coding style link.
1719
29bd8b6b
CC
17202013-01-28 Cary Coutant <ccoutant@google.com>
1721
a4034750
AM
1722 * dwp.cc (File_list): New typedef.
1723 (Dwo_name_info_reader): New class.
1724 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1725 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1726 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1727 (Dwo_file::read_executable): New function.
1728 (Dwo_file::read): Move common setup code to ...
1729 (Dwo_file::make_object): ... here.
1730 (dwp_options): Add --exec/-e.
1731 (usage): Likewise.
1732 (main): Likewise.
29bd8b6b 1733
c6ac678d
ST
17342013-01-24 Sriraman Tallam <tmsriram@google.com>
1735
1736 * layout.cc (Layout::layout): Check for option text_reorder.
1737 (Layout::make_output_section): Ditto.
1738 * options.h (text_reorder): New option.
1739 * output.cc (Input_section_sort_compare): Remove special ordering
1740 of section names.
1741 (Output_section::
1742 Input_section_sort_section_name_special_ordering_compare::
1743 operator()): New function.
1744 (Output_section::sort_attached_input_sections): Use new sort function
1745 for .text.
1746 * output.h (Input_section_sort_section_name_special_ordering_compare):
1747 New struct.
1748 * testsuite/Makefile.am (text_section_grouping): Test option
1749 --no-text-reorder
1750 * testsuite/Makefile.in: Regenerate.
1751 * testsuite/text_section_grouping.sh: Check order of functions without
1752 default text reordering.
1753
50701cc1
MF
17542013-01-18 Mike Frysinger <vapier@gentoo.org>
1755
1756 * options.h (General_options): Change default to true for new_dtags.
1757
b1b00fcc
MF
17582013-01-18 Mike Frysinger <vapier@gentoo.org>
1759
1760 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1761 when enable_new_dtags is false. Only add DT_RUNPATH when
1762 enable_new_dtags is true.
1763
ec5b8187
AM
17642013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1765
1766 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1767 used in declaration and definition consistent.
1768 (Target_powerpc::symval_for_branch): Ditto.
1769
a880d4c4
ST
17702013-01-16 Sriraman Tallam <tmsriram@google.com>
1771
1772 * testsuite/plugin_final_layout.cc: Fix comment.
1773
7c381248
ST
17742013-01-16 Sriraman Tallam <tmsriram@google.com>
1775
1776 * layout.cc (Layout::layout): Do not do default sorting for
1777 text sections when section ordering is specified.
1778 (make_output_section): Ditto.
1779 * testsuite/plugin_final_layout.cc: Name the function sections
1780 to catch reordering issues.
1781
e2458743
AM
17822013-01-15 Alan Modra <amodra@gmail.com>
1783
1784 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1785 plt-thread-safe.
1786
431ed302
AM
17872013-01-15 Alan Modra <amodra@gmail.com>
1788
1789 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1790 * testsuite/Makefile.in: Regenerate.
1791
0ec6429b
AM
17922013-01-14 Alan Modra <amodra@gmail.com>
1793
1794 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1795 * testsuite/Makefile.in: Regenerate.
1796
0bf402d5
ILT
17972013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1798
36af3926 1799 PR bfd/14430
0bf402d5
ILT
1800 Fix mingw gold build with plugins enabled
1801 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1802 * configure.ac: Export DLOPEN_LIBS and add headers check.
1803 * plugin.cc: Handle non-dlfcn case.
1804 * Makefile.in: Regenerate.
1805 * config.in: Regenerate.
1806 * configure: Regenerate.
1807 * testsuite/Makefile.in: Regenerate.
1808
9e9143bc
ST
18092013-01-09 Sriraman Tallam <tmsriram@google.com>
1810
1811 * output.h (sort_attached_input_sections): Change to be public.
1812 * script-sections.cc
1813 (Output_section_definition::set_section_addresses): Sort
1814 attached input sections according to section order before linker
1815 script assigns section addresses.
1816 (Orphan_output_section::set_section_addresses): Sort
1817 attached input sections according to section order before linker
1818 script assigns section addresses.
1819 * Makefile.am (final_layout.sh): Use a simple linker script to
1820 check if section ordering still works.
1821 * Makefile.in: Regenerate.
1822
679af368
ILT
18232013-01-09 Ben Cheng <bccheng@google.com>
1824
1825 * arm.cc (Target_arm::attributes_accept_div): New function.
1826 (Target_arm::attributes_forbid_div): New function.
1827 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
1828 attribute using the same new functions as what bfd/elf32_arm.c
1829 does.
1830
3136a00e
CC
18312013-01-07 Cary Coutant <ccoutant@google.com>
1832
1833 PR gold/14993
1834 * output.cc (Output_section::add_input_section): For incremental
1835 updates, don't track input sections that are allocated from patch
1836 space.
1837
f2a6224b
L
18382013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1839 Ian Lance Taylor <iant@google.com>
1840
1841 PR gold/14897
1842 * configure.ac (--enable-ld): Removed.
1843 (install_as_default): Set to yes only for --enable-gold=default
1844 or --disable-ld.
1845 * configure: Regenerated.
1846
4f46f626
L
18472013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1848
1849 * options.h (General_options): Add -fuse-ld= for GCC linker
1850 option compatibility.
1851
26e4ef59
CC
18522013-01-04 Cary Coutant <ccoutant@google.com>
1853
1854 * configure.ac: Fix typo restoring CXXFLAGS.
1855 * configure: Regenerate.
1856
3d587466
CC
18572013-01-04 Cary Coutant <ccoutant@google.com>
1858
4f46f626
L
1859 * testsuite/Makefile.am (CXXLINK_S): New macro.
1860 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
1861 * testsuite/Makefile.in: Regenerate.
3d587466 1862
44db6695
L
18632013-01-02 H.J. Lu <hongjiu.lu@intel.com>
1864
1865 * version.cc (print_version): Update copyright year to 2013.
1866
edcac0c1
ILT
18672012-12-20 Ian Lance Taylor <iant@google.com>
1868
1869 * layout.cc (Layout::special_ordering_of_input_section): New
1870 function.
1871 (Layout::layout): If input section requires special ordering, must
1872 sort input sections.
1873 (Layout::make_output_section): May sort .text input sections.
1874 (Layout::is_section_name_prefix_grouped): Remove.
1875 * layout.h (class Layout): Declare
1876 special_ordering_of_input_section. Don't declare
1877 is_section_name_prefix_grouped.
1878 * output.cc (Output_section::add_input_section): Revert last
1879 change.
1880 (Output_section::Input_section_sort::match_file_name): Don't crash
1881 if called on output section data.
1882 (Output_section::Input_section_sort_compare): Sort based on
1883 special ordering.
1884 (Output_section::Input_section_sort_section_order_index_compare):
1885 Revert last patch.
1886 (Output_section::sort_attached_input_sections): Likewise.
1887
28f2a4ac
ST
18882012-12-18 Sriraman Tallam <tmsriram@google.com>
1889
edcac0c1 1890 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
1891 * layout.h (Layout::is_section_name_prefix_grouped): New function.
1892 * output.cc (Output_section::add_input_section): Check if section
1893 name contains special prefix. Keep input sections to sort such
1894 sections.
1895 (Output_section::Input_section_sort_section_order_index_compare
1896 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
1897 (Output_section::sort_attached_input_sections): Add condition to
1898 Input_section_entry constructor call.
28f2a4ac
ST
1899 * testsuite/Makefile.am (text_section_grouping): New test.
1900 * testsuite/Makefile.in: Regenerate.
1901 * testsuite/text_section_grouping.cc: New file.
1902 * testsuite/text_section_grouping.sh: New file.
1903
5bf135a7
NC
19042012-12-17 Nick Clifton <nickc@redhat.com>
1905
1906 * Makefile.am: Add copyright notice.
1907 * NEWS: Likewise.
1908 * README: Likewise.
1909 * configure.ac: Likewise.
1910 * ftruncate.c: Likewise.
1911 * Makefile.in: Regenerate.
1912
59965708
CC
19132012-12-14 Cary Coutant <ccoutant@google.com>
1914
a4034750
AM
1915 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
1916 --no-as-needed flag.
1917 (exception_separate_shared_12_test): Likewise.
1918 (incremental_copy_test): Likewise.
1919 * testsuite/Makefile.in: Regenerate.
59965708 1920
2a77e2ab
CC
19212012-12-14 Cary Coutant <ccoutant@google.com>
1922
1923 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
1924 (Dwp_output_file::Dwp_index::enter_set): Add assert.
1925
e3deeb9c
AM
19262012-12-12 Alan Modra <amodra@gmail.com>
1927
1928 * powerpc.cc (class Track_tls): New.
1929 (class Relocate, class Scan): Inherit Track_tls.
1930 (Target_powerpc::Scan::local, global): Track tls optimization
1931 and avoid creating plt entry for __tls_get_addr if all uses
1932 are optimized away.
1933 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
1934
d8f5a274
AM
19352012-12-12 Alan Modra <amodra@gmail.com>
1936
1937 * options.h (General_options): Add --toc-sort/--no-toc-sort.
1938 Replace no_toc_optimize with toc_optimize.
1939 * output.h (Output_section::input_sections): Provide non-const variant.
1940 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
1941 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
1942 accessors.
1943 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
1944 (class Sort_toc_sections): New.
1945 (Target_powerpc::do_finalize_sections): Sort toc sections.
1946 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
1947
4c8a1de1
RM
19482012-12-10 Roland McGrath <mcgrathr@google.com>
1949
1950 * testsuite/binary_unittest.cc (read_all): New function.
1951 (Sized_binary_test): Use it instead of ::read.
1952 * fileread.cc (do_read): Don't assume pread always reads the whole
1953 amount in a single call.
1954
edc27beb
AM
19552012-12-10 Alan Modra <amodra@gmail.com>
1956
1957 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
1958 Set EM_PPC64 or EM_PPC here.
1959 (Target_selector_powerpc::do_recognize): Delete.
1960
906b9150
AM
19612012-12-10 Alan Modra <amodra@gmail.com>
1962
1963 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
1964 stub_table_.
1965 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
1966
418c15ae
RM
19672012-12-07 Roland McGrath <mcgrathr@google.com>
1968
1969 * testsuite/binary_unittest.cc (Sized_binary_test):
1970 Use open_descriptor rather than ::open.
1971
decdd3bc
AM
19722012-12-07 Alan Modra <amodra@gmail.com>
1973
1974 * powerpc.cc (Stub_table::do_write): Delete redundant Address
1975 typedef and invalid_address constant.
1976 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
1977 instantiate constants.
1978
db399005
ILT
19792012-12-06 Roland McGrath <mcgrathr@google.com>
1980
1981 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
1982 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
1983 * aclocal.m4: Regenerate.
1984 * configure: Regenerate.
1985 * Makefile.in: Regenerate.
1986 * testsuite/Makefile.in: Regenerate.
1987
aba6bc71
AM
19882012-12-07 Alan Modra <amodra@gmail.com>
1989
1990 * options.h (General_options): Add no_toc_optimize.
1991 * powerpc.cc (ok_lo_toc_insn): New function.
1992 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
1993
9e69ed50
AM
19942012-12-06 Alan Modra <amodra@gmail.com>
1995
1996 * options.h (General_options): Add plt_align, plt_static_chain,
1997 plt_thread_safe. Update stub_group_size help text.
1998 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
1999 for new plt_thread_safe_ var.
2000 (use_plt_offset): Correct comments.
2001 (Target_powerpc::do_relax): Look for thread creation symbols to
2002 determine default plt_thread_safe value. Clear plt call stubs
2003 as well as branch stubs each iteration.
2004 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2005 insn constants.
2006 (l, hi, ha, write_insn): Move earlier.
2007 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2008 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2009 plt stubs too.
2010 (Stub_table::update_size): Adjust.
2011 (Stub_table::prev_size, set_prev_size): Delete.
2012 (Stub_table::stub_align): Let --plt-align affect result.
2013 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2014 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2015 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2016 (Stub_table::do_write): Support more stub variants.
2017
f43ba157
AM
20182012-12-04 Alan Modra <amodra@gmail.com>
2019
2020 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2021 (Target_powerpc::do_define_standard_symbols): New function.
2022
34171bc5
AM
20232012-12-03 Alan Modra <amodra@gmail.com>
2024
2025 * output.h: Formatting, whitespace.
2026
dc9589e9 20272012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2028
2029 * layout.h (Layout::get_executable_sections): Declare.
2030 * layout.cc (Layout::get_executable_sections): New function.
2031 * arm.cc (Target_arm::group_sections): Use it.
2032 (Arm_output_section::group_sections): Delete now redundant test.
2033 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2034 param to handle relative relocs.
2035 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2036 (Output_data_reloc::add_absolute): Adjust.
2037 (Output_data_reloc::add_relative): New function.
2038 (Output_data::reset_data_size): New function.
2039 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2040 (Output_section::set_addralign): New function.
2041 (Output_section::checkpoint_set_addralign): New function.
2042 (Output_section::clear_section_offsets_need_adjustment): New function.
2043 (Output_section::input_sections): Make public.
2044 * powerpc.cc (class Output_data_brlt_powerpc): New.
2045 (class Stub_table, class Stub_control): New.
2046 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2047 stub_table_, set_stub_table, stub_table): New vectors and accessor
2048 functions.
2049 (Target_powerpc::do_may_relax, do_relax, push_branch,
2050 new_stub_table, stub_tables, brlt_section, group_sections,
2051 add_branch_lookup_table, find_branch_lookup_table,
2052 write_branch_lookup_table, make_brlt_section): New functions.
2053 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2054 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2055 branch_info_): New vars.
2056 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2057 make call stubs here.
2058 (Output_data_glink): Remove all call stub handling from this class.
2059 (Target_powerpc::Scan::local, global): Save interesting branch
2060 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2061 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2062 functions on final link.
2063 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2064 Handle long branch destinations too.
2065 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2066 do_plt_address_for_local): Adjust lookup of plt call stubs.
2067
627b30b7
AM
20682012-11-30 Alan Modra <amodra@gmail.com>
2069
2070 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2071 relocs against protected symbols when building 32-bit shared libs.
2072
40b469d7
AM
20732012-11-30 Alan Modra <amodra@gmail.com>
2074
2075 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2076 param. Call got_section() to make .got. Update all callers
2077 and their callers and so on.
2078
bb66a627
AM
20792012-11-30 Alan Modra <amodra@gmail.com>
2080
2081 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2082 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2083 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2084 value if it already exists.
2085
d2cf1c6c
L
20862012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2087
2088 PR gold/14858
2089 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2090
edccdf7c
RM
20912012-11-14 Roland McGrath <mcgrathr@google.com>
2092
2093 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2094 than bfc instruction for data sandboxing.
2095
6febeb74
AM
20962012-11-08 Alan Modra <amodra@gmail.com>
2097
2098 * po/POTFILES.in: Regenerate.
2099
0a6f1bf2
AM
21002012-11-05 Alan Modra <amodra@gmail.com>
2101
2102 * configure.ac: Apply 2012-09-10 change to config.in here.
2103 * configure: Regenerate.
2104
26a4e9cb
AM
21052012-11-05 Alan Modra <amodra@gmail.com>
2106
2107 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2108 (struct Opd_ent): Use "Address" rather than "Offset".
2109 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2110 (Target_powerpc::got_section): Make public.
2111 (Target_powerpc::scan_relocs): Move code setting symbols..
2112 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2113 Create _SDA_BASE_ only when referenced.
2114
cc928013
RM
21152012-11-02 Roland McGrath <mcgrathr@google.com>
2116
2117 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2118 from last change.
2119
50ed5eb1
RM
21202012-11-01 Roland McGrath <mcgrathr@google.com>
2121
62fe925a
RM
2122 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2123 for offset_in_output_section parameter.
2124 (Sized_target::relocate_special_relocatable): Likewise.
2125 * arm.cc (Target_arm::relocate_relocs): Likewise.
2126 (Target_arm::relocate_special_relocatable): Likewise.
2127 * i386.cc (Target_i386::relocate_relocs): Likewise.
2128 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2129 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2130 * target-reloc.h (relocate_relocs): Likewise.
2131 * testsuite/testfile.cc (Target_test): Likewise.
2132 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2133 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2134
2135 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2136 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2137
2138 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2139 parameter, which is unused in the [!F_SETFD] case.
2140
50ed5eb1
RM
2141 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2142 SYMNDX to off_t before comparing it to this->data_size().
2143 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2144 * incremental.cc (Output_section_incremental_inputs::do_write):
2145 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2146
2cadc0bf
RM
2147 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2148
3bfcb652
NC
21492012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2150
2151 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2152 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2153 in EABI_VER5.
2154
c1a8d56e
CC
21552012-10-29 Cary Coutant <ccoutant@google.com>
2156
2157 * dwp.cc (usage): Add file and exit status parameters;
2158 add --help and --version options.
2159 (print_version): New function.
2160 (main): Add --help and --version options.
2161
b2490a7b
L
21622012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2163
2164 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2165 final_layout_sequence.txt.
2166 * testsuite/Makefile.in: Regenerated.
2167
aa543512
L
21682012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2169
2170 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2171 COMPILE generated by automake.
2172 (LINK1): Likewise.
2173 (CXXCOMPILE1): Likewise.
2174 (CXXLINK1): Likewise.
2175 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2176 (LINK): Likewise.
2177 (CXXCOMPILE): Likewise.
2178 (CXXLINK): Likewise.
2179 * testsuite/Makefile.in: Regenerated.
2180
d361fafb
L
21812012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2182
2183 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2184 on bad fwrite return.
2185
598c7410
L
21862012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2187
2188 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2189 on val.
2190
35c813e2
CC
21912012-10-23 Cary Coutant <ccoutant@google.com>
2192
2193 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2194 * testsuite/Makefile.in: Regenerate.
2195 * testsuite/dwp_test.h: New source file.
2196 * testsuite/dwp_test_1.cc: New source file.
2197 * testsuite/dwp_test_1.s: New source file.
2198 * testsuite/dwp_test_1.sh: New source file.
2199 * testsuite/dwp_test_1b.cc: New source file.
2200 * testsuite/dwp_test_1b.s: New source file.
2201 * testsuite/dwp_test_2.cc: New source file.
2202 * testsuite/dwp_test_2.s: New source file.
2203 * testsuite/dwp_test_2.sh: New source file.
2204 * testsuite/dwp_test_main.cc: New source file.
2205 * testsuite/dwp_test_main.s: New source file.
2206
77429909
CC
22072012-10-23 Cary Coutant <ccoutant@google.com>
2208
2209 * dwp.h: New header file.
2210 * dwp.cc: New source file.
2211 * gold.h: Move shared declarations to system.h.
2212 * system.h: New header file.
2213 * Makefile.am: Add dwp.
2214 * Makefile.in: Regenerate.
2215
ed5d6712
CC
22162012-10-23 Cary Coutant <ccoutant@google.com>
2217
2218 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2219 Dwarf_info_reader::read_from_pointer.
2220 (Dwarf_pubnames_table::read_header): Likewise.
2221 (Dwarf_pubnames_table::next_name): Likewise.
2222 (Dwarf_die::read_attributes): Likewise.
2223 (Dwarf_die::skip_attributes): Likewise.
2224 (Dwarf_info_reader::read_from_pointer): New function template.
2225 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2226 (Dwarf_pubnames_table): Likewise.
2227 (Dwarf_info_reader::read_from_pointer): New function template.
2228 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2229 Dwarf_pubnames_table ctor.
2230
8787852d
CC
22312012-10-23 Cary Coutant <ccoutant@google.com>
2232
2233 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2234 abbrev_shndx.
2235 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2236 abbrev_shndx_.
2237 (Dwarf_info_reader::set_abbrev_shndx): New method.
2238 (Dwarf_info_reader::abbrev_shndx_): New data member.
2239
9fc236f3
CC
22402012-10-23 Cary Coutant <ccoutant@google.com>
2241
2242 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2243 from object, not parameters.
2244 (Dwarf_info_reader::parse): Likewise.
2245 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2246 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2247 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2248 methods.
2249
effe8365
CC
22502012-10-23 Cary Coutant <ccoutant@google.com>
2251
2252 * fileread.cc (Input_file::Input_file): New constructor.
2253 * fileread.h (class Input_file): Add new constructor.
2254
1698990d
AM
22552012-10-18 Alan Modra <amodra@gmail.com>
2256
2257 PR gold/14727
2258 * object.cc (Relobj::is_section_name_included): Also match
2259 .sdata personality section.
2260
168a4726
AM
22612012-10-18 Alan Modra <amodra@gmail.com>
2262
2263 * target-reloc.h (class Default_comdat_behavior): New, package up..
2264 (get_comdat_behaviour): ..this.
2265 (relocate_section): Add Relocate_comdat_behavior template arg,
2266 adjust code to suit.
2267 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2268 (Target_arm::scan_reloc_section): Likewise.
2269 * i386.cc (Target_i386::relocate_section): Likewise.
2270 * sparc.cc (Target_sparc::relocate_section): Likewise.
2271 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2272 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2273 * powerpc.cc (class Relocate_comdat_behavior): New.
2274 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2275 gold::relocate_section with new template arg.
2276
acc276d8
AM
22772012-10-18 Alan Modra <amodra@gmail.com>
2278
2279 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2280 dynamic relocs for GOT_TPREL got entries, without symbol if
2281 resolving locally.
2282 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2283 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2284 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2285
e10f9870
AM
22862012-10-17 Alan Modra <amodra@gmail.com>
2287
2288 PR gold/14726
2289 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2290
ae034989
ST
22912012-10-16 Sriraman Tallam <tmsriram@google.com>
2292
2293 * layout.cc (Layout::include_section): Keep sections marked
2294 SHF_EXCLUDE when doing relocatable links.
2295
f3a0ed29
AM
22962012-10-16 Alan Modra <amodra@gmail.com>
2297
2298 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2299 (Target_powerpc::do_finalize_sections): Call it.
2300 (Output_data_save_res): New class and supporting functions.
2301 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2302 normal symbols defined in object files.
2303
c6de8ed4
AM
23042012-10-12 Alan Modra <amodra@gmail.com>
2305
2306 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2307 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2308 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2309 section if scan_opd_relocs not yet called.
2310 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2311
03e25981
AM
23122012-10-12 Alan Modra <amodra@gmail.com>
2313
2314 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2315 add_local_ifunc_entry): Revert last change.
2316 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2317
c9824451
AM
23182012-10-05 Alan Modra <amodra@gmail.com>
2319
2320 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2321 do_plt_address_for_global): New functions.
2322 (Output_data_got_powerpc::do_write): Don't segfault when linking
2323 statically.
2324 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2325 add_local_ifunc_entry): Return true on adding entry..
2326 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2327 glink->add_entry call. Remove unused symtab param. Adjust calls.
2328 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2329 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2330 set up symbols here.
2331 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2332 syms here. Do so even when no .iplt. Don't segfault when linking
2333 statically.
2334 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2335 new variants without reloc param.
2336 (Glink_sym_ent::Glink_sym_ent): Likewise.
2337 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2338 reloc when refs will resolve to plt call stub.
2339 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2340 R_PPC_PLTREL24 to resolve locally.
2341 (Target_powerpc::Scan::global): Correct ifunc handling.
2342 (Target_powerpc::Relocate::relocate): Correct local sym glink
2343 lookup. Don't destroy "value" when we have a plt call stub,
2344 and when checking plt call validity.
2345 (Target_powerpc::do_dynsym_value): Simplify.
2346
19fec8c1
AM
23472012-10-05 Alan Modra <amodra@gmail.com>
2348
2349 * i386.cc (Output_data_plt_i386::address_for_global,
2350 address_for_local): Add plt offset to returned value. Adjust uses.
2351 * sparc.cc (Output_data_plt_sparc::address_for_global,
2352 address_for_local): Likewise.
2353 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2354 address_for_local): Likewise.
2355 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2356 address_for_local): Likewise.
2357 * target.h (Target::plt_address_for_global, plt_address_for_local):
2358 Update comment.
2359 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2360 (Output_data_got::Got_entry::write): Nor here.
2361 * output.h: Comment fix.
2362
e867b647
WL
23632012-10-02 Jiong Wang <jiwang@tilera.com>
2364
2365 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2366 global_offset_table_ value for larget got.
2367 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2368
e5d5f5ed
AM
23692012-09-29 Alan Modra <amodra@gmail.com>
2370
2371 * powerpc.cc (Target_powerpc::iplt_): New output section.
2372 (Target_powerpc::iplt_section, make_iplt_section,
2373 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2374 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2375 Target_powerpc::plt_entry_count): Count iplt entries too.
2376 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2377 reloc section in constructor. New params.
2378 (Target_powerpc::make_plt_section): Create reloc section here instead.
2379 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2380 functions.
2381 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2382 (Output_data_glink::add_entry, find_entry): New functions to
2383 deal with local syms.
2384 (Glink_sym_ent): Add support for local syms.
2385 (Output_data_glink::do_write): Handle ifunc plt entries.
2386 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2387 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2388 (Target_powerpc::Relocate::relocate): Likewise.
2389 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2390
ec4dbad3
AM
23912012-09-25 Alan Modra <amodra@gmail.com>
2392
2393 * object.h (Sized_relobj_file::adjust_local_symbol,
2394 do_adjust_local_symbol): New functions.
2395 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2396 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2397 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2398 and irregular opd entry spacing.
2399 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2400 (Global_symbol_visitor_opd): New functor.
2401 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2402 on deleted opd entries.
2403
5c0b3823
WL
24042012-09-15 Jiong Wang <jiwang@tilera.com>
2405
2406 * tilegx.cc: New file.
2407 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2408 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2409 * configure.tgt: Add entries for tilegx*.
2410 * configure.ac: Likewise.
2411 * Makefile.in: Rebuild.
2412 * configure: Likewise.
2413 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2414 tilegx.
2415
bfdfa4cd
AM
24162012-09-13 Alan Modra <amodra@gmail.com>
2417
2418 * target-reloc.h (scan_relocs): Call scan.local for relocs
2419 against symbols in discarded sections. Pass is_discarded
2420 param.
2421 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2422 Add is_discarded param.
2423 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2424 is_discarded to flag opd entry as discarded. Don't emit dyn
2425 relocs on such entries.
2426 (Target_powerpc::Scan::global): Similarly detect and handle
2427 such opd entries.
2428 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2429 opd_ent_. Update all uses.
2430 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2431 (Target_powerpc::relocate_section): Zero out discarded opd
2432 entry relocs.
2433
d77a0555
ILT
24342012-09-12 Ian Lance Taylor <iant@google.com>
2435
2436 PR gold/14570
2437 * output.cc: Rename Output_data_got template parameter from size
2438 to got_size for all functions. Compile all variants of
2439 Output_data_got.
2440 (Output_data_got::Got_entry::write): Correct use of size for
2441 symbol value. Use local_is_tls rather than casting to
2442 Sized_relobj_file.
2443 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2444 (class Sized_relobj_file): Add do_local_is_tls.
2445 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2446
815a1205
AM
24472012-09-11 Alan Modra <amodra@gmail.com>
2448
2449 PR gold/14566
2450 * layout.cc (Layout::set_segment_offsets): When using
2451 common-page-size alignment, ensure we are on a new max-page-size
2452 page.
2453 * output.cc (Output_segment::set_section_addresses): Use
2454 abi_pagesize, not common_pagesize for relro boundary.
2455 (Output_segment::set_offset): Likewise.
2456
bd73a62d
AM
24572012-09-11 Alan Modra <amodra@gmail.com>
2458
2459 * output.h (Output_data_got::add_global_tls, add_local_tls,
2460 add_local_tls_pair): New functions.
2461 (Output_data_got::add_local_pair_with_rel): Remove second
2462 reloc param. Expand comment.
2463 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2464 use_plt_or_tls_offset_, similarly for constructor param.
2465 (Output_data_got::Got_entry::write): Add got_index param.
2466 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2467 add_local_tls_pair): New functions.
2468 (Output_data_got::Got_entry::write): Handle tls symbols
2469 with use_plt_or_tls_offset_ set specially.
2470 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2471 (Output_data_got::do_write): Replace iterator with index, pass
2472 index to entry write function.
2473 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2474 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2475 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2476 call.
2477 * i386.cc (Target_i386::Scan::local): Likewise.
2478 * sparc.cc (Target_sparc::Scan::local): Likewise.
2479 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2480 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2481 do_tls_offset_for_global): New functions.
2482 (Target_powerpc::Scan::local): Correct TLS relocations and got
2483 entry values.
2484 (Target_powerpc::Scan::global): Don't emit unnecessary
2485 dynamic relocations on TLS GOT entries.
2486
00716ab1
AM
24872012-09-10 Matthias Klose <doko@ubuntu.com>
2488
2489 * config.in: Disable sanity check for kfreebsd.
2490
c891b3f9
SA
24912012-09-10 Sterling Augustine <saugustine@google.com>
2492
2493 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2494 (Gdb_index::pubtypes_read): New parameter.
2495 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2496 to calls.
2497 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2498 pubtypes_object_.
2499
e81fea4d
AM
25002012-09-09 Alan Modra <amodra@gmail.com>
2501
2502 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2503 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2504 * gc.h (gc_process_relocs): Call target gc_add_reference.
2505 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2506 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2507 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2508 unnecessary cast.
2509 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2510 to cater for when we don't need code offset. Update use.
2511 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2512 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2513 set_opd_valid): New functions.
2514 (Target_powerpc::do_gc_add_reference): New function.
2515 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2516 stashed refs.
2517 (Target_powerpc::do_gc_mark_symbol): New function.
2518
d2d60eef
CC
25192012-09-06 Cary Coutant <ccoutant@google.com>
2520
2521 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2522 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2523 (Dwarf_die::skip_attributes): Likewise.
2524 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2525 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2526 (main): Call it.
2527 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2528
32ed4573
L
25292012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2530
2531 * testsuite/script_test_3.t: Add .got.plt output section
2532 statement.
2533 * testsuite/script_test_4.t: Likewise.
2534
f4baf0d4
AM
25352012-09-05 Alan Modra <amodra@gmail.com>
2536
2537 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2538 update all uses and lose "enum" when using type.
2539
864a1b56
AM
25402012-09-05 Alan Modra <amodra@gmail.com>
2541
2542 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2543 * configure: Regenerate.
2544 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2545 (plugin_final_layout.stdout): Likewise.
2546 (memory_test): Set page sizes to 0x1000.
2547 * testsuite/Makefile.in: Regenerate.
2548 * testsuite/discard_locals_test.sh: Add FIXME comment.
2549 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2550 * testsuite/pr14265.t: Add .got output section statement.
2551 * testsuite/script_test_2.t: Likewise.
2552 * testsuite/script_test_3.t: Likewise.
2553 * testsuite/script_test_4.t: Likewise.
2554 * testsuite/script_test_5.t: Likewise.
2555 * testsuite/script_test_6.t: Likewise.
2556 * testsuite/script_test_7.t: Likewise.
2557 * testsuite/script_test_9.t: Likewise.
2558
3ea0a085
AM
25592012-09-05 Alan Modra <amodra@gmail.com>
2560
2561 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2562 (Powerpc_relocate_functions::Status): New typedef.
2563 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2564 (Target_powerpc::Scan::local): Handle REL64.
2565 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2566 for REL32 and REL64.
2567 (Target_powerpc::symval_for_branch): New function, extracted from..
2568 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2569 checks. Report overflow errors.
2570
7404fe1b
AM
25712012-09-05 Alan Modra <amodra@gmail.com>
2572
2573 * object.h (Sized_relobj_file::emit_relocs): Delete.
2574 (Sized_relobj_file::emit_relocs_reltype): Delete.
2575 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2576 relocate_relocs for --emit-relocs.
2577 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2578 * output.h: Update comment.
2579 (Output_segment::first_section): New function.
2580 (Output_segment::first_section_load_address): Use first_section.
2581 * output.cc (Output_segment::first_section): New function extracted..
2582 (Output_segment::first_section_load_address): ..from here. Delete.
2583 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2584 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2585 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2586 adjust call to target.h function.
2587 * i386.cc (Target_i386): Likewise.
2588 * sparc.cc (Target_sparc): Likewise.
2589 * x86_64.cc (Target_x86_64): Likewise.
2590 * powerpc.cc (Target_powerpc): Likewise.
2591 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2592 first tls section has section symbol for optimised local dynamic
2593 output relocs.
2594 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2595 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2596 optimised tls code.
2597 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2598 Rename to relocate_relocs. Update error message.
2599
957564c9
AS
26002012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2601
2602 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2603 --just-symbols.
2604
dd93cd0a
AM
26052012-08-31 Alan Modra <amodra@gmail.com>
2606
2607 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2608 (Powerpc_relobj::toc_base_offset): New stub function.
2609 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2610 got_mod_index_offset to tlsld_got_offset. Update all refs.
2611 (Target_powerpc::Relocate::enum skip_tls): New.
2612 (Target_powerpc::call_tls_get_addr_): New var.
2613 (Target_powerpc::is_branch_reloc): Move to file scope.
2614 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2615 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2616 New functions.
2617 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2618 (powerpc_info): Correct common_pagesize for ppc64.
2619 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2620 (Powerpc_relocate_functions): Add overflow check enums and functions.
2621 Add non-shift version of rela, rela_ua. Delete all rel public
2622 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2623 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2624 addr16_ha3, addr14 functions.
2625 (Output_data_got_powerpc::add_constant_pair): New function.
2626 (Output_data_got_powerpc::got_base_offset): Likewise.
2627 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2628 (instruction constants): Sort, add some more.
2629 (Output_data_glink::do_write): Add and use Address typedef. Use
2630 object->toc_base_offset() stub for 64-bit.
2631 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2632 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2633 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2634 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2635 Always treat .opd relocs as against locally defined symbol.
2636 Correct condition for RELATIVE relocs.
2637 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2638 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2639 for 32-bit syms with a plt entry. Correct ppc64 toc base
2640 calculations. Handle TLS relocs, and more. Add overflow
2641 checking and adjust for Powerpc_relocate_functions changes.
2642 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2643 Reinstate --emit-relocs code with FIXME.
2644
a1373b60
AM
26452012-08-30 Alan Modra <amodra@gmail.com>
2646
2647 * layout.cc (Layout::set_segment_offsets): Set p_align to
2648 abi_pagesize, not common_pagesize.
2649 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2650 to determine whether file header can go in segment.
2651
703d02da
AM
26522012-08-30 Alan Modra <amodra@gmail.com>
2653
2654 * output.h (Output_reloc::Output_reloc <output section>): Add
2655 is_relative param. Adjust calls.
2656 (Output_reloc::add_output_section_relative): New functions.
2657 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2658 is_relative.
2659 (Output_reloc::symbol_value): Handle SECTION_CODE.
2660
16164a6b
ST
26612012-08-24 Sriraman Tallam <tmsriram@google.com>
2662
2663 * gold.cc (queue_middle_tasks): Call layout again when unique
2664 segments for sections is desired.
2665 * layout.cc (Layout::Layout): Initialize new members.
2666 (Layout::get_output_section_flags): New function.
2667 (Layout::choose_output_section): Call get_output_section_flags.
2668 (Layout::layout): Make output section for mapping to a unique segment.
2669 (Layout::insert_section_segment_map): New function.
2670 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 2671 output sections marked so.
16164a6b
ST
2672 (Layout::segment_precedes): Check for unique segments when sorting.
2673 * layout.h (Layout::Unique_segment_info): New struct.
2674 (Layout::Section_segment_map): New typedef.
2675 (Layout::insert_section_segment_map): New function.
2676 (Layout::get_output_section_flags): New function.
2677 (Layout::is_unique_segment_for_sections_specified): New function.
2678 (Layout::set_unique_segment_for_sections_specified): New function.
2679 (Layout::unique_segment_for_sections_specified_): New member.
2680 (Layout::section_segment_map_): New member.
2681 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2682 Rename is_gc_pass_one to is_pass_one.
2683 Rename is_gc_pass_two to is_pass_two.
2684 Rename is_gc_or_icf to is_two_pass.
2685 Check for which pass based on whether symbols data is present.
2686 Make it two pass when unique segments for sections is desired.
2687 * output.cc (Output_section::Output_section): Initialize new
2688 members.
2689 * output.h (Output_section::is_unique_segment): New function.
2690 (Output_section::set_is_unique_segment): New function.
2691 (Output_section::is_unique_segment_): New member.
2692 (Output_section::extra_segment_flags): New function.
2693 (Output_section::set_extra_segment_flags): New function.
2694 (Output_section::extra_segment_flags_): New member.
2695 (Output_section::segment_alignment): New function.
2696 (Output_section::set_segment_alignment): New function.
2697 (Output_section::segment_alignment_): New member.
2698 (Output_segment::Output_segment): Initialize is_unique_segment_.
2699 (Output_segment::is_unique_segment): New function.
2700 (Output_segment::set_is_unique_segment): New function.
2701 (Output_segment::is_unique_segment_): New member.
2702 * plugin.cc (allow_unique_segment_for_sections): New function.
2703 (unique_segment_for_sections): New function.
2704 (Plugin::load): Add new functions to transfer vector.
2705 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2706 * Makefile.in: Regenerate.
2707 * testsuite/plugin_final_layout.sh: Check if unique segment
2708 functionality works.
2709 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2710 are available.
2711 (allow_unique_segment_for_sections): New global.
2712 (unique_segment_for_sections): New global.
2713 (claim_file_hook): Call allow_unique_segment_for_sections.
2714 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 2715
1e2bee4f
CC
27162012-08-22 Cary Coutant <ccoutant@google.com>
2717
2718 * layout.cc (Layout::include_section): Don't assert on GROUP
2719 sections with --emit-relocs.
2720
1d5dfe78
CC
27212012-08-21 Cary Coutant <ccoutant@google.com>
2722
2723 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2724 if --export-dynamic-symbol names an undef symbol.
2725
c9269dff
AM
27262012-08-18 Alan Modra <amodra@gmail.com>
2727
2728 * powerpc.cc: Formatting and white space.
2729 (Powerpc_relobj): Rename got2_section_ to special_.
2730 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2731 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2732 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2733 (Target_powerpc): Add Address typedef and invalid_address. Use
2734 throughout.
2735 (Target_powerpc::is_branch_reloc): New function.
2736 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2737 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2738 for dst_mask, value and addend.
2739 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2740 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2741 (Output_data_glink::do_write): Correct toc base. Don't try to use
2742 uint16_t for 24-bit offset. Use get_output_section_offset and
2743 check return.
2744 (Target_powerpc::Scan::local): Handle more relocs.
2745 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2746 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2747 Plug in toc restoring insn after plt calls. Translate branches
2748 to function descriptor symbols to corresponding entry point.
2749 (Target_powerpc::relocate_for_relocatable): Check return from
2750 get_output_section_offset.
2751 * symtab.h: Comment typo.
2752
b1759dce
ILT
27532012-08-14 Ian Lance Taylor <iant@google.com>
2754
2755 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2756 unsupported_relocal_local to call unsupported_reloc_global.
2757
b9b2ae8b
NC
27582012-08-14 Nick Clifton <nickc@redhat.com>
2759
2760 PR ld/14265
2761 * script-sections.cc (Sections_element::output_section_name): Add
2762 keep return parameter.
2763 (Output_section_element::match_name): Add keep return parameter.
2764 Return the value of the keep_ member.
2765 * script-sections.h (class Output_section): Update
2766 output_section_name prototype.
2767 * layout.cc (Layout::keep_input_section): New public member
2768 function.
2769 (Layout::choose_output_section): Pass keep parameter to
2770 output_section_name.
2771 * layout.h (class Layout): Add keep_input_section.
2772 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2773 sections.
2774 * testsuite/Makefile.am: Add a test.
2775 * testsuite/Makefile.in: Regenerate.
2776 * testsuite/pr14265.c: Source file for the test.
2777 * testsuite/pr14265.t: Linker script for the test.
2778 * testsuite/pr14265.sh: Shell script for the test.
2779
921b5322
AM
27802012-08-14 Alan Modra <amodra@gmail.com>
2781
2782 * target.h (Target::output_section_name): New function.
2783 (Target::do_output_section_name): New function.
2784 * layout.cc (Layout::choose_output_section): Call the above.
2785 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2786
6ce78956
AM
27872012-08-14 Alan Modra <amodra@gmail.com>
2788
2789 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2790 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2791 for replace_constant call.
2792 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2793 (Output_data_glink::do_print_to_mapfile): New function.
2794 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2795 (Target_powerpc::Relocate::relocate): Likewise.
2796
d1a8cabd
AM
27972012-08-14 Alan Modra <amodra@gmail.com>
2798
2799 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2800 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2801 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2802 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2803 all references to shndx_. Handle special case for R_PPC_PLTREL24
2804 here.
2805 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2806 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2807 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2808 here.
2809 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2810 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2811
d83ce4e3
AM
28122012-08-12 Alan Modra <amodra@gmail.com>
2813
2814 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2815 (glink insn constants): Use uint32_t.
2816 (Output_data_glink::add_entry): Use insert, not [] operator.
2817
cf43a2fe
AM
28182012-08-11 Alan Modra <amodra@gmail.com>
2819
2820 * object.h (Sized_relobj_file::find_shdr): New function.
2821 (Sized_relobj_file::find_special_sections): New function.
2822 * object.cc (Sized_relobj_file::find_shdr): New function.
2823 (Sized_relobj_file::find_eh_frame): Use find_shdr.
2824 (Sized_relobj_file::find_special_sections): New function, split out..
2825 (Sized_relobj_file::do_read_symbols): ..from here.
2826 * output.h (Output_data_got::replace_constant): New function.
2827 (Output_data_got::num_entries): New function.
2828 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
2829 (Output_data_got::got_offset): Protected rather than private.
2830 (Output_data_got::replace_got_entry): New function.
2831 * output.cc (Output_data_got::replace_got_entry): New function.
2832 * powerpc.cc (class Powerpc_relobj): New.
2833 (class Powerpc_relocate_functions): Delete all psymval variants or
2834 convert to value,addend type. Delete pcrela, pcrela_unaligned.
2835 Implement _ha functions using corresponding _hi function.
2836 (Powerpc_relobj::find_special_sections): New function.
2837 (Target_powerpc::do_make_elf_object): New function.
2838 (class Output_data_got_powerpc): New.
2839 (class Output_data_glink): New.
2840 (class Powerpc_scan_relocatable_reloc): New.
2841 Many more changes througout file.
2842
3c892704
NC
28432012-08-09 Nick Clifton <nickc@redhat.com>
2844
2845 * po/vi.po: Updated Vietnamese translation.
2846
82435b3b
ILT
28472012-08-07 Ian Lance Taylor <iant@google.com>
2848
2849 * layout.cc (Layout::add_target_dynamic_tags): If
2850 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
2851 plt_rel.
2852
a6dc81d2
NC
28532012-07-30 Nick Clifton <nickc@redhat.com>
2854
2855 * po/gold.pot: Updated template.
2856 * po/es.po: Updated Spanish translation.
2857
f1415016
CC
28582012-07-18 Cary Coutant <ccoutant@google.com>
2859
2860 PR gold/14344
2861 * configure.ac: Add check for -gpubnames support.
2862 * configure: Regenerate.
2863 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
2864 support; force -gno-pubnames.
2865 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
2866 support.
2867 (gdb_index_test_4): New test.
2868 * testsuite/Makefile.in: Regenerate.
2869 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
2870 * testsuite/gdb_index_test_2.sh: Likewise.
2871 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
2872 * testsuite/gdb_index_test_4.sh: New script.
2873 * testsuite/gdb_index_test_comm.sh: New script with common code;
2874 don't look for space after colon.
2875
b7fd7c37
ST
28762012-07-16 Sriraman Tallam <tmsriram@google.com>
2877
2878 * gold.cc (queue_middle_tasks): Update function order only after
2879 deferred objects due to plugins are processed.
2880
1f3212db
ILT
28812012-07-11 Ian Lance Taylor <iant@google.com>
2882
2883 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
2884 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
2885 (Target_arm::scan_reloc_for_stub): Likewise.
2886 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
2887 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
2888 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
2889 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
2890 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
2891
81c82a68
ILT
28922012-07-10 Dodji Seketeli <dodji@redhat.com>
2893 Ian Lance Taylor <iant@google.com>
2894
2895 PR gold/14309
2896 * configure.ac: Test whether std::tr1::hash<off_t> works.
2897 * gold.h: Add a specialization for std::tr1::hash<off_t> if
2898 needed.
2899 * output.h (class Output_fill): Add virtual destructor.
2900 * configure, config.in: Rebuild.
2901
eabc84f4
RM
29022012-06-22 Roland McGrath <mcgrathr@google.com>
2903
2904 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
2905
370e30b6
RÁE
29062012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
2907
2908 * plugin.cc (Plugin::load): Handle position independent executables.
2909
fb1b895d
CC
29102012-06-06 Cary Coutant <ccoutant@google.com>
2911
2912 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
2913 add .debug_macro.
2914 (lines_only_debug_sections): Likewise.
2915 (gdb_fast_lookup_sections): New static array.
2916 (is_gdb_debug_section): Rename formal parameter.
2917 (is_lines_only_debug_section): Likewise.
2918 (is_gdb_fast_lookup_section): New function.
2919 (Layout::include_section): Check for ".zdebug_" prefix; pass
2920 section name suffix to is_gdb_debug_section, et al.; check for
2921 fast-lookup sections when building .gdb_index.
2922 * options.h (--strip-debug-gdb): Update GDB version number.
2923
7c0640fa
CC
29242012-06-06 Cary Coutant <ccoutant@google.com>
2925
2926 * configure.ac: Add check for fallocate.
2927 * configure: Regenerate.
2928 * config.in: Regenerate.
2929
2930 * options.h (class General_options): Add --mmap-output-file and
2931 --posix-fallocate options.
2932 * output.cc: (posix_fallocate): Remove; replace with...
2933 (gold_fallocate): New function.
2934 (Output_file::map_no_anonymous): Call gold_fallocate.
2935 (Output_file::map): Check --mmap-output-file option.
2936
2a49eb69
DK
29372012-06-05 Jing Yu <jingyu@google.com>
2938
2939 * gold.h (textdomain): Add do {} to empty while(0).
2940 (bindtextdomain): Likewise.
2941
fad072ac
CC
29422012-06-04 Cary Coutant <ccoutant@google.com>
2943
2944 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
2945 has_dynsym_index.
2946
8cc69fb6
ST
29472012-05-25 Sriraman Tallam <tmsriram@google.com>
2948
2949 * symtab.cc (Symbol_table::define_special_symbol):
2950 Initialize *poldsym to prevent uninitialized variable errors.
2951
1be75daa
CC
29522012-05-23 Cary Coutant <ccoutant@google.com>
2953
2954 * layout.cc (Layout::section_name_mapping): Add rules to handle
2955 exact match on .data.rel.ro.local or .data.rel.ro.
2956 (Layout::output_section_name): Check for exact matches.
2957
9b689de0
CC
29582012-05-23 Cary Coutant <ccoutant@google.com>
2959
2960 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
2961 more carefully.
2962
b24fdbf5
CC
29632012-05-22 Cary Coutant <ccoutant@google.com>
2964
2965 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
2966 object before exporting symbol.
2967
e550e1a2
L
29682012-05-21 H.J. Lu <hongjiu.lu@intel.com>
2969
2970 * testsuite/tls_test.cc: Include "config.h" first.
2971 * testsuite/tls_test_c.c: Likewise.
2972
df7b86aa
NC
29732012-05-17 Daniel Richard G. <skunk@iskunk.org>
2974 Nick Clifton <nickc@redhat.com>
2975
2976 PR 14072
2977 * configure.in: Add check that sysdep.h has been included before
2978 any system header files.
2979 * configure: Regenerate.
2980 * config.in: Regenerate.
2981
1007b503
CC
29822012-05-14 Cary Coutant <ccoutant@google.com>
2983
2984 * layout.cc (Layout::make_output_section): Mark .tdata section
2985 as RELRO.
2986 * testsuite/relro_test.cc: Add a TLS variable.
2987
fd885f3a
L
29882012-05-10 H.J. Lu <hongjiu.lu@intel.com>
2989
2990 PR gold/14091
2991 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
2992 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
2993 R_X86_64_64.
2994
80f5885c
CC
29952012-05-08 Cary Coutant <ccoutant@google.com>
2996
2997 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
2998 (lines_only_debug_sections): Likewise.
2999
2e702c99
RM
30002012-05-02 Roland McGrath <mcgrathr@google.com>
3001
3002 * nacl.cc: New file.
3003 * nacl.h: New file.
3004 * Makefile.am (CCFILES, HFILES): Add them.
3005 * Makefile.in: Regenerate.
3006 * i386.cc (Output_data_plt_i386_nacl): New class.
3007 (Output_data_plt_i386_nacl_exec): New class.
3008 (Output_data_plt_i386_nacl_dyn): New class.
3009 (Target_i386_nacl): New class.
3010 (Target_selector_i386_nacl): New class.
3011 (target_selector_i386): Use it instead of Target_selector_i386.
3012 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3013 (Target_x86_64_nacl): New class.
3014 (Target_selector_x86_64_nacl): New class.
3015 (target_selector_x86_64, target_selector_x32): Use it instead of
3016 Target_selector_x86_64.
3017 * arm.cc (Output_data_plt_arm_nacl): New class.
3018 (Target_arm_nacl): New class.
3019 (Target_selector_arm_nacl): New class.
3020 (target_selector_arm, target_selector_armbe): Use it instead of
3021 Target_selector_arm.
3022
3023 * target-select.cc (select_target): Take new Input_file* and off_t
3024 arguments, pass them on to recognize method of selector.
3025 * object.cc (make_elf_sized_object): Update caller.
3026 * parameters.cc (parameters_force_valid_target): Likewise.
3027 * incremental.cc (make_sized_incremental_binary): Likewise.
3028 * target-select.h: Update decl.
3029 (Target_selector::recognize): Take new Input_file* argument,
3030 pass it on to do_recognize.
3031 (Target_selector::do_recognize): Take new Input_file* argument.
3032 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3033 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3034 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3035 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3036
3037 * target.h (Target::Target_info): New members isolate_execinstr
3038 and rosegment_gap.
3039 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3040 * arm.cc (Target_arm::arm_info): Update initializer.
3041 * i386.cc (Target_i386::i386_info): Likewise.
3042 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3043 * sparc.cc (Target_sparc::sparc_info): Likewise.
3044 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3045 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3046 * layout.cc (Layout::attach_allocated_section_to_segment):
3047 Take new const Target* argument. If target->isolate_execinstr(), act
3048 like --rosegment.
3049 (Layout::find_first_load_seg): Take new const Target* argument;
3050 if target->isolate_execinstr(), reject PF_X segments.
3051 (Layout::relaxation_loop_body): Update caller.
3052 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3053 reset file offset to zero when we hit LOAD_SEG, and then do a second
3054 loop over the segments before LOAD_SEG to reassign offsets after
3055 addresses have been determined. Handle target->rosegment_gap().
3056 (Layout::attach_section_to_segment): Take new const Target* argument;
3057 pass it to attach_allocated_section_to_segment.
3058 (Layout::make_output_section): Update caller.
3059 (Layout::attach_sections_to_segments): Take new const Target* argument;
3060 pass it to attach_section_to_segment.
3061 * gold.cc (queue_middle_tasks): Update caller.
3062 * layout.h (Layout): Update method decls with new arguments.
3063
3064 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3065 Target_info pointer to use.
3066 (Target_arm::do_make_data_plt): New virtual method.
3067 (Target_arm::make_data_plt): New method that calls it.
3068 (Target_arm::make_plt_entry): Use it.
3069 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3070 for the section alignment.
3071 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3072 method.
3073 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3074 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3075 method.
3076 (Output_data_plt_arm::get_plt_entry_size): Call it.
3077 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3078 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3079 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3080 method.
3081 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3082 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3083 method instead of sizeof(plt_entry).
3084 (Output_data_plt_arm::add_entry): Likewise.
3085 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3086 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3087 than static method.
3088 (Target_arm::plt_entry_size): Likewise.
3089 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3090 Move to ...
3091 (Output_data_plt_arm_standard): ... here, new class.
3092 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3093 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3094 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3095
3096 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3097 Take additional argument for the PLT entry size.
3098 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3099 Use get_plt_entry_size method rather than plt_entry_size variable.
3100 (Output_data_plt_x86_64::reserve_slot): Likewise.
3101 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3102 (Output_data_plt_x86_64::add_entry): Likewise.
3103 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3104 (Output_data_plt_x86_64::address_for_global): Likewise.
3105 (Output_data_plt_x86_64::address_for_local): Likewise.
3106 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3107 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3108 Make method non-static.
3109 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3110 method.
3111 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3112 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3113 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3114 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3115 virtual method.
3116 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3117 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3118 virtual method.
3119 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3120 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3121 virtual method.
3122 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3123 (Output_data_plt_x86_64::plt_entry_size)
3124 (Output_data_plt_x86_64::first_plt_entry)
3125 (Output_data_plt_x86_64::plt_entry)
3126 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3127 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3128 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3129 (Output_data_plt_x86_64_standard): ... here, new class.
3130 (Target_x86_64::Target_x86_64): Take optional argument for the
3131 Target_info pointer to use.
3132 (Target_x86_64::do_make_data_plt): New virtual method.
3133 (Target_x86_64::make_data_plt): New method to call it.
3134 (Target_x86_64::init_got_plt_for_update): Use that.
3135 Call this->plt_->add_eh_frame method here.
3136 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3137 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3138 rather than static method.
3139 (Target_x86_64::plt_entry_size): Likewise.
3140 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3141 rather than plt_entry_size variable. Move guts of PLT filling to...
3142 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3143 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3144 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3145
3146 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3147 additional argument for the section alignment.
3148 Don't do add_eh_frame_for_plt here.
3149 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3150 non-static. Use get_plt_entry_size method rather than plt_entry_size
3151 variable.
3152 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3153 method.
3154 (Output_data_plt_i386::get_plt_entry_size): Call it.
3155 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3156 (Output_data_plt_i386::add_eh_frame): New method to call it.
3157 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3158 method.
3159 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3160 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3161 method.
3162 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3163 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3164 method instead of plt_entry_size.
3165 (Output_data_plt_i386::plt_entry_size)
3166 (Output_data_plt_i386::plt_eh_frame_fde_size)
3167 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3168 (Output_data_plt_i386_standard): ... here, new class.
3169 (Output_data_plt_i386_exec): New class.
3170 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3171 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3172 (Output_data_plt_i386::exec_plt_entry): Move to ...
3173 (Output_data_plt_i386_exec::plt_entry): ... here.
3174 (Output_data_plt_i386_dyn): New class.
3175 (Output_data_plt_i386::first_plt_entry): Move to ...
3176 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3177 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3178 (Output_data_plt_i386_dyn::plt_entry): ... here.
3179 (Target_i386::Target_i386): Take optional argument for the Target_info
3180 pointer to use.
3181 (Target_i386::do_make_data_plt): New virtual method.
3182 (Target_i386::make_data_plt): New method to call it.
3183 (Target_i386::make_plt_section): Use that.
3184 Call this->plt_->add_eh_frame method here.
3185 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3186 rather than plt_entry_size variable.
3187 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3188 (Output_data_plt_i386::address_for_local): Likewise.
3189 (Output_data_plt_i386::do_write): Likewise.
3190 Move guts of PLT filling to...
3191 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3192 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3193 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3194 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3195
b9b9f2ee
CC
31962012-05-01 Cary Coutant <ccoutant@google.com>
3197
3198 * dwarf_reader.cc (Dwarf_die::read_attributes)
3199 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3200 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3201 * reduced_debug_output.cc
3202 (Output_reduced_debug_info_section::get_die_end): Remove
3203 DW_FORM_GNU_ref_index. Add default case.
3204
57923f48
MW
32052012-04-26 Mark Wielaard <mjw@redhat.com>
3206
3207 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3208 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3209 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3210 DW_AT_high_pc as offset from DW_AT_low_pc.
3211
3212 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3213 * testsuite/Makefile.in: Regenerate.
3214 * testsuite/gdb_index_test_3.c: New test source file.
3215 * testsuite/gdb_index_test_3.sh: New test source file.
3216
2c54b4f4
ILT
32172012-04-25 Ian Lance Taylor <iant@google.com>
3218
3219 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3220 pointer.
3221 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3222 as a class, not a struct.
3223 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3224 (Target_arm::apply_cortex_a8_workaround): Likewise.
3225 * gc.h: Declare Reloc_types as a struct, not a class.
3226 * object.h: Declare Symbols_data as a struct.
3227 * reloc.h: Declare Read_relocs_data as a struct.
3228 * target.h: Declare Relocate_info as a struct.
3229
a5a5f7a3
DM
32302012-04-24 David S. Miller <davem@davemloft.net>
3231
3232 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3233 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3234 and R_SPARC_WPLT30.
3235
f038d496
CC
32362012-04-24 Cary Coutant <ccoutant@google.com>
3237
3238 * incremental-dump.cc (find_input_containing_global): Replace
3239 magic number with symbolic constant.
3240 (dump_incremental_inputs): Update version number.
3241 * incremental.cc (Output_section_incremental_inputs): Update version
3242 number; import symbolic constants from Incremental_inputs_reader.
3243 (Incremental_inputs::create_data_sections): Align relocations
3244 section correctly for 64-bit targets.
3245 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3246 constants; add padding.
3247 (Output_section_incremental_inputs::write_header): Add assert for
3248 header_size.
3249 (Output_section_incremental_inputs::write_input_files): Add assert
3250 for input_entry_size.
3251 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3252 add assert for object_info_size, input_section_entry_size,
3253 global_sym_entry_size.
3254 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3255 for data structure sizes; use them.
3256 (Incremental_input_entry_reader): Import symbolic constants from
3257 Incremental_inputs_reader; use them.
3258
a4d85145
DM
32592012-04-23 David S. Miller <davem@davemloft.net>
3260
3261 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3262 and elf_flags_set_.
3263 (Target_sparc::Target_sparc): Initialize new fields.
3264 (Target_sparc::do_make_elf_object): New function.
3265 (Target_sparc::do_adjust_elf_header): New function.
3266
1d509098
CC
32672012-04-23 Cary Coutant <ccoutant@google.com>
3268
3269 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3270 CU range table of gdb index.
3271
7ebeff7f
DM
32722012-04-20 David S. Miller <davem@davemloft.net>
3273
3274 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3275 instead of false.
3276
13cf9988
DM
32772012-04-16 David S. Miller <davem@davemloft.net>
3278
2a1079e8
DM
3279 * sparc.cc (Target_sparc::got_address): New function.
3280 (Sparc_relocate_functions::gdop_hix22): New function.
3281 (Sparc_relocate_functions::gdop_lox10): New function.
3282 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3283 relocs.
3284 (Target_sparc::Scan::local): Likewise if the global symbol is not
3285 preemptible and is not IFUNC.
3286 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3287 transformations for local and non-preemptible non-IFUNC global
3288 symbols.
3289
0bc964fc
DM
3290 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3291 writing out 64-bit part of ranges.
3292
661d7a80
DM
3293 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3294 -fpic and -fpie respectively.
3295 * Makefile.in: Regenerate.
3296
8c2bf391
DM
3297 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3298 (Target_sparc::Target_sparc): Initialize new field.
3299 (Target_sparc::do_plt_section_for_global): New function.
3300 (Target_sparc::do_plt_section_for_local): New function.
3301 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3302 (Target_sparc::make_plt_section): New function, broken out of
3303 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3304 (Target_sparc::make_plt_entry): Call make_plt_section.
3305 (Target_sparc::make_local_ifunc_plt_entry): New function.
3306 (Target_sparc::rela_ifunc_section): New function.
3307 (Target_sparc::plt_section): Remove const.
3308 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3309 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3310 and ifunc_count_ fields.
3311 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3312 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3313 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3314 (Output_data_plt_sparc::rela_ifunc): New function.
3315 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3316 (Output_data_plt_sparc::has_ifunc_section): New function.
3317 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3318 (Output_data_plt_sparc::address_for_global): New function.
3319 (Output_data_plt_sparc::address_for_local): New function.
3320 (Output_data_plt_sparc::plt_index_to_offset): New function.
3321 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3322 and entry_count.
3323 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3324 entry_count.
3325 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3326 R_SPARC_JMP_IREL to switch.
3327 (Target_sparc::Scan::check_non_pic): Likewise.
3328 (Target_sparc::Scan::local): Handle IFUNC symbols.
3329 (Target_sparc::Scan::local): Likewise.
3330 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3331 and plt_address_for_local.
3332 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3333 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3334
13cf9988
DM
3335 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3336 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3337 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3338 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3339 global relocs too.
3340 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3341 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3342 calls.
3343 * sparc.cc (Target_sparc::Scan::global): Likewise.
3344 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3345
31821be0
CC
33462012-04-16 Cary Coutant <ccoutant@google.com>
3347
3348 * archive.cc (Library_base::should_include_member): Check for
3349 --export-dynamic-symbol.
3350 * options.h (class General_options): Add --export-dynamic-symbol.
3351 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3352 --export-dynamic-symbol.
3353 (Symbol_table::gc_mark_undef_symbols): Likewise.
3354 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3355
2615994e
DM
33562012-04-12 David S. Miller <davem@davemloft.net>
3357
3358 * sparc.cc (Reloc::wdisp10): New relocation method.
3359 (Reloc::h34): Likewise.
3360 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3361 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3362 R_SPARC_WDISP10.
3363 (Target_sparc::Scan::local): Likewise.
3364 (Target_sparc::Scan::global): Likewise.
3365 (Target_sparc::Relocate::relocate): Likewise.
3366
6782735d
CC
33672012-04-09 Cary Coutant <ccoutant@google.com>
3368
3369 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3370 low_pc == 0.
3371
8c7a0b00
ILT
33722012-04-06 Ian Lance Taylor <iant@google.com>
3373
3374 * timer.cc: #include <unistd.h>.
3375
58797674
RM
33762012-04-06 Roland McGrath <mcgrathr@google.com>
3377
3378 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3379 * config.in: Regenerate.
3380 * configure: Regenerate.
3381
44350750
NC
33822012-04-05 Nick Clifton <nickc@redhat.com>
3383
3384 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3385 (AM_LC_MESSAGES): Add.
3386 * aclocal.m4: Regenerate.
3387 * config.in: Regenerate.
3388 * configure: Regenerate.
3389
c1027032
CC
33902012-03-21 Cary Coutant <ccoutant@google.com>
3391
3392 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3393 * Makefile.in: Regenerate.
3394 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3395 (Sized_elf_reloc_mapper::symbol_section): New function.
3396 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3397 (make_elf_reloc_mapper): New function.
3398 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3399 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3400 (Dwarf_abbrev_table::do_get_abbrev): New function.
3401 (Dwarf_ranges_table::read_ranges_table): New function.
3402 (Dwarf_ranges_table::read_range_list): New function.
3403 (Dwarf_pubnames_table::read_section): New function.
3404 (Dwarf_pubnames_table::read_header): New function.
3405 (Dwarf_pubnames_table::next_name): New function.
3406 (Dwarf_die::Dwarf_die): New function.
3407 (Dwarf_die::read_attributes): New function.
3408 (Dwarf_die::skip_attributes): New function.
3409 (Dwarf_die::set_name): New function.
3410 (Dwarf_die::set_linkage_name): New function.
3411 (Dwarf_die::attribute): New function.
3412 (Dwarf_die::string_attribute): New function.
3413 (Dwarf_die::int_attribute): New function.
3414 (Dwarf_die::uint_attribute): New function.
3415 (Dwarf_die::ref_attribute): New function.
3416 (Dwarf_die::child_offset): New function.
3417 (Dwarf_die::sibling_offset): New function.
3418 (Dwarf_info_reader::check_buffer): New function.
3419 (Dwarf_info_reader::parse): New function.
3420 (Dwarf_info_reader::do_parse): New function.
3421 (Dwarf_info_reader::do_read_string_table): New function.
3422 (Dwarf_info_reader::lookup_reloc): New function.
3423 (Dwarf_info_reader::get_string): New function.
3424 (Dwarf_info_reader::visit_compilation_unit): New function.
3425 (Dwarf_info_reader::visit_type_unit): New function.
3426 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3427 Sized_elf_reloc_mapper.
3428 (Sized_dwarf_line_info::symbol_section): Remove function.
3429 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3430 (Sized_dwarf_line_info::read_line_mappings): Remove object
3431 parameter, adjust callers.
3432 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3433 * dwarf_reader.h: Include <sys/types.h>.
3434 (class Track_relocs): Remove forward declaration.
3435 (class Elf_reloc_mapper): New class.
3436 (class Sized_elf_reloc_mapper): New class.
3437 (class Dwarf_abbrev_table): New class.
3438 (class Dwarf_range_list): New class.
3439 (class Dwarf_ranges_table): New class.
3440 (class Dwarf_pubnames_table): New class.
3441 (class Dwarf_die): New class.
3442 (class Dwarf_info_reader): New class.
3443 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3444 (Sized_dwarf_line_info::symbol_section): Remove member function.
3445 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3446 base class.
3447 * gdb-index.cc: New source file.
3448 * gdb-index.h: New source file.
3449 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3450 and .debug_types sections, call Layout::add_to_gdb_index.
3451 (Sized_relobj_incr::do_section_name): Implement.
3452 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3453 return type; Implement.
3454 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3455 return type.
3456 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3457 parameter list and return type.
3458 (Sized_incr_dynobj::do_section_contents): Likewise.
3459 * layout.cc: Include gdb-index.h.
3460 (Layout::Layout): Initialize gdb_index_data_.
3461 (Layout::init_fixed_output_section): Check for .gdb_index section.
3462 (Layout::add_to_gdb_index): New function. Instantiate.
3463 * layout.h: Add forward declaration for class Gdb_index.
3464 (Layout::add_to_gdb_index): New member function.
3465 (Layout::gdb_index_data_): New data member.
3466 * main.cc: Include gdb-index.h.
3467 (main): Print statistics for gdb index.
3468 * object.cc (Object::section_contents): Move code into
3469 do_section_contents.
3470 (need_decompressed_section): Check for sections needed when building
3471 gdb index.
3472 (build_compressed_section_map): Likewise.
3473 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3474 gdb index.
3475 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3476 sections; call Layout::add_to_gdb_index.
3477 (Sized_relobj_file::do_decompressed_section_contents): Call
3478 do_section_contents directly.
3479 * object.h (Object::do_section_contents): Adjust parameter list and
3480 return type.
3481 (Object::do_decompressed_section_contents): Call do_section_contents
3482 directly.
3483 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3484 return type.
3485 * options.h (class General_options): Add --gdb-index option.
3486 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3487 list and return type.
3488 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3489 * reloc.h (Track_relocs::checkpoint): New function.
3490 (Track_relocs::reset): New function.
3491
3492 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3493 New test cases.
3494 * testsuite/Makefile.in: Regenerate.
3495 * testsuite/gdb_index_test.cc: New test source file.
3496 * testsuite/gdb_index_test_1.sh: New test source file.
3497 * testsuite/gdb_index_test_2.sh: New test source file.
3498
647f1574
DK
34992012-03-19 Doug Kwan <dougkwan@google.com>
3500
3501 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3502 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3503 __exidx_start and __exidx_end. Make symbol table parameter
3504 anonymous as it is not used.
3505 * gold.cc (queue_middle_tasks): Call target hook to define any
3506 target-specific symbols.
3507 * target.h (Target::define_standard_symbols): New method.
3508 (Target::do_define_standard_symbols): Same.
3509 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3510 * testsuite/Makefile.in: Regenerate.
3511 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3512 and __exidx_end.
3513 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3514 relocations are generated for __exidx_start and __exidx_end.
3515
7c6109da
DK
35162012-03-16 Doug Kwan <dougkwan@google.com>
3517
3518 * testsuite/Makefile.am: Disable test initpri3b.
3519 * testsuite/Makefile.in: Regenerate.
3520
7b8957f8
DK
35212012-03-15 Doug Kwan <dougkwan@google.com>
3522
3523 * arm.cc (Target_arm::got_section): Make .got section read-only
3524 if -z now is given.
3525
14dc9ef7
ILT
35262012-03-15 Ian Lance Taylor <iant@google.com>
3527
3528 PR gold/13850
3529 * layout.cc (Layout::make_output_section): Correctly mark
3530 SHT_INIT_ARRAY, et. al., as relro.
3531
fa40b62a
DK
35322012-03-14 Doug Kwan <dougkwan@google.com>
3533
3534 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3535 dynamic relocations for protected symbols in shared objects.
3536
fd325007
ILT
35372012-03-13 Ian Lance Taylor <iant@google.com>
3538
3539 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3540 keep the larger alignment.
3541
e8dd54e1
CC
35422012-03-12 Cary Coutant <ccoutant@google.com>
3543
3544 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3545 handling of DW_LNE_define_file.
3546
feb5f3b0
CC
35472012-03-12 Cary Coutant <ccoutant@google.com>
3548
3549 * reduced_debug_output.cc
3550 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3551 codes to switch.
3552
a1fb4256
CC
35532012-02-29 Cary Coutant <ccoutant@google.com>
3554
3555 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3556
5dd8762a
CC
35572012-02-29 Cary Coutant <ccoutant@google.com>
3558
3559 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3560 Call Object::decompressed_section_contents.
3561 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3562 New dtor.
3563 (Sized_dwarf_line_info::buffer_start_): New data member.
3564 * merge.cc (Output_merge_data::do_add_input_section): Call
3565 Object::decompressed_section_contents.
3566 (Output_merge_string::do_add_input_section): Likewise.
3567 * object.cc (need_decompressed_section): New function.
3568 (build_compressed_section_map): Decompress sections needed later.
3569 (Sized_relobj_file::do_decompressed_section_contents): New function.
3570 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3571 * object.h (Object::decompressed_section_contents): New function.
3572 (Object::discard_decompressed_sections): New function.
3573 (Object::do_decompressed_section_contents): New function.
3574 (Object::do_discard_decompressed_sections): New function.
3575 (Compressed_section_info): New type.
3576 (Compressed_section_map): Include decompressed section contents.
3577 (Sized_relobj_file::do_decompressed_section_contents): New function.
3578 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3579
7b5de7ee
CC
35802012-02-16 Cary Coutant <ccoutant@google.com>
3581
3582 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3583 * testsuite/Makefile.in: Regenerate.
3584
f9fa4a63
CC
35852012-02-14 Cary Coutant <ccoutant@google.com>
3586
3587 * options.cc (General_options::finalize): Disallow -pie and -static.
3588
2c175ebc
DK
35892012-02-03 Doug Kwan <dougkwan@google.com>
3590
3591 * arm.cc (Arm_relocate_functions::abs8,
3592 Arm_relocate_functions::abs16): Use
3593 Bits::has_signed_unsigned_overflow32.
3594 (Arm_relocate_functions::thm_abs8): Correct range of
3595 overflow check.
3596 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3597 in assertions.
3598
90cff06f
DK
35992012-02-02 Doug Kwan <dougkwan@google.com>
3600
3601 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3602 position independent outputs, not just shared objects.
3603
63887f3d
L
36042012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3605
3606 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3607 * configure: Regenerated.
3608
bef2b434
ILT
36092012-01-27 Ian Lance Taylor <iant@google.com>
3610
3611 * reloc.h (Bits): New class with static functions, copied from
3612 namespace utils in arm.cc.
3613 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3614 instead.
3615
c335b55d
L
36162012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3617
3618 * incremental.cc (write_info_blocks): Correct relocation offset.
3619
41194d9f
L
36202012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3621
3622 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3623 (Relocate::tls_gd_to_le): Likewise.
3624
1bae613c
L
36252012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3626
3627 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3628
24482ca0
L
36292012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3630
3631 * configure.ac: Check if -mcmodel=medium works.
3632 * configure: Regenerated.
3633
c2c7840a
CC
36342012-01-24 Cary Coutant <ccoutant@google.com>
3635
3636 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3637 definition and ...
3638 (read_unsigned_LEB_128_x): ... this new function.
3639 (read_signed_LEB_128): Replaced with inline definition and ...
3640 (read_signed_LEB_128_x): ... this new function.
3641 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3642 (read_unsigned_LEB_128): Add inline definition.
3643 (read_signed_LEB_128_x): New function.
3644 (read_signed_LEB_128): Add inline definition.
3645 * testsuite/Makefile.am (leb128_unittest): New unit test.
3646 * testsuite/Makefile.in: Regenerate.
3647 * testsuite/leb128_unittest.cc: New unit test.
3648
833de760 36492012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3650
3651 PR gold/13617
3652 * i386.cc (Target_i386::do_code_fill): When using a jmp
3653 instruction, pad with nop instructions.
3654 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3655
618d6666
L
36562012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3657
3658 * x86_64.cc (gc_process_relocs): Add typename on types used in
3659 template.
3660 (scan_relocs): Likewise.
3661 (relocate_section): Likewise.
3662 (apply_relocation): Likewise.
3663
3660ff06
L
36642012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3665
3666 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3667 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3668 under x32.
3669
fc51264f
L
36702012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3671
3672 * x86_64.cc: Initial support for x32.
3673
dd74ae06
CC
36742012-01-03 Cary Coutant <ccoutant@google.com>
3675
3676 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3677 Use abstract base class for GOT.
3678 * gold/output.h (class Output_data_got_base): New abstract base class.
3679 (class Output_data_got): Derive from new base class, adjust ctors.
3680 (Output_data_got::reserve_slot): Make virtual; rename to
3681 do_reserve_slot; Adjust callers.
3682 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3683 pointer to abstract base class.
3684 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3685
83896202
ILT
36862011-12-18 Ian Lance Taylor <iant@google.com>
3687
3688 * object.h (Relobj::local_symbol_value): New function.
3689 (Relobj::local_plt_offset): New function.
3690 (Relobj::local_has_got_offset): New function.
3691 (Relobj::local_got_offset): New function.
3692 (Relobj::set_local_got_offset): New function.
3693 (Relobj::do_local_symbol_value): New pure virtual function.
3694 (Relobj::do_local_plt_offset): Likewise.
3695 (Relobj::do_local_has_got_offset): Likewise.
3696 (Relobj::do_local_got_offset): Likewise.
3697 (Relobj::do_set_local_got_offset): Likewise.
3698 (Sized_relobj::do_local_has_got_offset): Rename from
3699 local_has_got_offset.
3700 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3701 (Sized_relobj::do_set_local_got_offset): Rename from
3702 set_local_got_offset.
3703 (Sized_relobj_file::do_local_plt_offset): Rename from
3704 local_plt_offset.
3705 (Sized_relobj_file::do_local_symbol_value): New function.
3706 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3707 local_plt_offset.
3708 * output.cc (Output_data_got::Got_entry::write): Change object to
3709 Relobj. Use local_symbol_value.
3710 (Output_data_got::add_global_with_rel): Change rel_dyn to
3711 Output_data_reloc_generic*. Use add_global_generic.
3712 (Output_data_got::add_global_with_rela): Remove. Change all
3713 callers to use add_global_with_rel.
3714 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3715 Output_data_reloc_generic*. Use add_global_generic.
3716 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3717 callers to use add_global_pair_with_rel.
3718 (Output_data_got::add_local): Change object to Relobj*.
3719 (Output_data_got::add_local_plt): Likewise.
3720 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3721 change rel_dyn to Output_data_reloc_generic*. Use
3722 add_local_generic.
3723 (Output_data_got::add_local_with_rela): Remove. Change all
3724 callers to use all_local_with_rel.
3725 (Output_data_got::add_local_pair_with_rel): Change object to
3726 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3727 add_output_section_generic.
3728 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3729 callers to use add_local_pair_with_rel.
3730 (Output_data_got::reserve_local): Change object to Relobj*.
3731 * output.h: (class Output_data_reloc_generic): Add pure virtual
3732 declarations for add_global_generic, add_local_generic,
3733 add_output_section_generic.
3734 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3735 functions for Output_data_reloc_generic. Update declarations for
3736 changes listed in output.cc.
3737 (class Output_data_got): Change template parameter to got_size.
3738 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3739 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3740 function.
3741 (Sized_relobj_incr::do_local_plt_offset): New function.
3742 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3743 add_global_generic.
3744
76677ad0
CC
37452011-12-17 Cary Coutant <ccoutant@google.com>
3746
3747 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3748 * resolve.cc (Symbol_table::resolve): Likewise.
3749 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3750 arrays.
3751 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3752
8b8dd8d5
ILT
37532011-12-16 Ian Lance Taylor <iant@google.com>
3754
3755 * output.h (Output_data_reloc_generic::add): Only call
3756 add_dynamic_reloc if this is a dynamic reloc section.
3757
d55525b9
L
37582011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3759
3760 PR gold/13505
3761 * target-reloc.h (apply_relocation): Replace <64, false> with
3762 <size, big_endian>.
3763
ff81c7c1
NC
37642011-11-25 Nick Clifton <nickc@redhat.com>
3765
3766 * po/it.po: New Italian translation.
3767
628f39be
SA
37682011-11-17 Sterling Augustine <saugustine@google.com>
3769
3770 * script.cc (script_include_directive): Implement.
3771 (read_script_file): New local variables name and search_path. Update
3772 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3773 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3774 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3775
98ef3ea4
SA
37762011-11-11 Sterling Augustine <saugustine@google.com>
3777
3778 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3779 (file_or_sections_cmd): Likewise.
3780
f4a8b6d7
DK
37812011-11-11 Doug Kwan <dougkwan@google.com>
3782
3783 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3784 if --just-symbols is given.
3785
29ab395d
DK
37862011-11-10 Doug Kwan <dougkwan@google.com>
3787
3788 PR gold/13362
3789 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3790 when processing data relocs.
3791 * reloc.h (Relocate_functions::rel_unaligned): New method.
3792 (Relocate_functions::pcrel_unaligned): Ditto.
3793 (Relocate_functions::rel32_unaligned): Ditto.
3794 (Relocate_functions::pcrel32_unaligned): Ditto.
3795
2c339f71
DK
37962011-11-09 Doug Kwan <dougkwan@google.com>
3797
3798 PR gold/13362
3799 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3800 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3801 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3802 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3803 (Relocate_functions::rel_unaligned): New.
3804 (Relocate_functions::rel32_unaligned): New.
3805 * target-reloc.h (relocate_for_relocatable): Add code to handle
3806 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3807 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3808 arm_unaligned_reloc_r): New targets.
3809 * testsuite/Makefile.in: Regenerate.
3810 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3811 linking.
3812
3f3cddf1
ILT
38132011-11-02 Ian Lance Taylor <iant@google.com>
3814
3815 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3816 NATIVE_LINKER.
3817 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
3818 * options.cc (General_options::finalize): Use library search path
3819 from configure script if specified. If not native and no sysroot,
3820 only search TOOLLIBDIR.
3821 * options.h (Search_directory::Search_directory): Change name to
3822 const std::string&.
3823 (General_options::add_to_library_path_with_sysroot): Change arg to
3824 const std::string&.
3825 * configure, Makefile.in, config.in: Rebuild.
3826
a8e2273b
ILT
38272011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3828
3829 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
3830 we are working around the ARM1176 Erratum.
3831 * options.h (General_options::fix_arm1176): Add option.
3832 * testsuite/Makefile.am: Add testcases, and keep current ones
3833 working.
3834 * testsuite/Makefile.in: Regenerate.
3835 * testsuite/arm_fix_1176.s: New file.
3836 * testsuite/arm_fix_1176.sh: Likewise.
3837
cd6eab1c
ILT
38382011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3839
3840 * arm.cc (Target_arm::Target_arm): Remove initialisation of
3841 may_use_blx_.
3842 (Target_arm::may_use_blx): Remove method.
3843 (Target_arm::set_may_use_blx): Likewise.
3844 (Target_arm::may_use_v4t_interworking): New method.
3845 (Target_arm::may_use_v5t_interworking): Likewise.
3846 (Target_arm::may_use_blx_): Remove member variable.
3847 (Arm_relocate_functions::arm_branch_common): Check for v5T
3848 interworking.
3849 (Arm_relocate_functions::thumb_branch_common): Likewise.
3850 (Reloc_stub::stub_type_for_reloc): Likewise.
3851 (Target_arm::do_finalize_sections): Correct interworking checks.
3852 * testsuite/Makefile.am: Add new tests.
3853 * testsuite/Makefile.in: Regenerate.
3854 * testsuite/arm_farcall_arm_arm.s: New test.
3855 * testsuite/arm_farcall_arm_arm.sh: Likewise.
3856 * testsuite/arm_farcall_arm_thumb.s: Likewise.
3857 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
3858 * testsuite/arm_farcall_thumb_arm.s: Likewise.
3859 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
3860 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
3861 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
3862
286adcf4
CC
38632011-10-31 Cary Coutant <ccoutant@google.com>
3864
3865 PR gold/13023
3866 * expression.cc (Expression::eval_with_dot): Add
3867 is_section_dot_assignment parameter.
3868 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
3869 absolute and assigning to dot within a section.
3870 * script-sections.cc
3871 (Output_section_element_assignment::set_section_addresses): Pass
3872 dot_section to set_if_absolute.
3873 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
3874 as is_section_dot_assignment flag to eval_with_dot.
3875 (Output_section_element_dot_assignment::set_section_addresses):
3876 Likewise.
3877 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
3878 parameter. Also set value if relative to dot_section; set the
3879 symbol's output_section.
3880 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
3881 parameter. Adjust all callers.
3882 (Expression::eval_maybe_dot): Likewise.
3883 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
3884 Adjust all callers.
3885 * testsuite/script_test_2.t: Test assignment of an absolute value
3886 to dot within an output section element.
3887
9634ed06
CC
38882011-10-31 Cary Coutant <ccoutant@google.com>
3889
3890 * options.h (class General_options): Add --[no-]gnu-unique options.
3891 * symtab.cc (Symbol_table::sized_write_globals): Convert
3892 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
3893
de4101c7
CC
38942011-10-31 Cary Coutant <ccoutant@google.com>
3895
3896 PR gold/13359
3897 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
3898 unnecessary assertion.
3899 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
3900
7257cc92
ST
39012011-10-31 Sriraman Tallam <tmsriram@google.com>
3902
3903 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3904 gc_mark_symbol.
3905 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3906 gc_mark_symbol.
3907 Change to just keep the section associated with symbol.
3908 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
3909 they are externally visible and --export-dynamic is turned on.
3910 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
3911
bfc34b3f
ILT
39122011-10-19 Ian Lance Taylor <iant@google.com>
3913
3914 PR gold/13163
3915 * script-sections.cc
3916 (Output_section_element_dot_assignment::needs_output_section): New
3917 function.
3918
ea0d8c47
ILT
39192011-10-19 Ian Lance Taylor <iant@google.com>
3920
3921 PR gold/13204
3922 * layout.cc (Layout::segment_precedes): Don't assert failure if a
3923 --section-start option was seen.
3924 * options.h (General_options::any_section_start): New function.
3925
abd242a9
DM
39262011-10-18 David S. Miller <davem@davemloft.net>
3927
3928 PR binutils/13301
3929 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
3930 member to track relocation locations that have moved during TLS
3931 reloc optimizations.
3932 (Target_sparc::Relocate::Relocate): Initialize to NULL.
3933 (Target_sparc::Relocate::relocate): Adjust view down by 4
3934 bytes if it matches reloc_adjust_addr_.
3935 (Target_sparc::Relocate::relocate_tls): Always move the
3936 __tls_get_addr call delay slot instruction forward 4 bytes when
3937 performing relaxation.
3938
bab9090f
CC
39392011-10-18 Cary Coutant <ccoutant@google.com>
3940
3941 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
3942 (Output_file::map_no_anonymous): Check for non-zero
3943 return code from posix_fallocate.
3944
f7c5b166
CC
39452011-10-17 Cary Coutant <ccoutant@google.com>
3946
3947 PR gold/13245
3948 * plugin.cc (is_visible_from_outside): Check for symbols
3949 referenced from dynamic objects.
3950 * resolve.cc (Symbol_table::resolve): Don't count references
3951 from dynamic objects as references from real ELF files.
3952 * testsuite/plugin_test_2.sh: Adjust expected result.
3953
b490c0bb
CC
39542011-10-17 Cary Coutant <ccoutant@google.com>
3955
3956 * gold.cc: Include timer.h.
3957 (queue_middle_tasks): Stamp time.
3958 (queue_final_tasks): Likewise.
3959 * main.cc (main): Store timer in parameters. Print timers
3960 for each pass.
3961 * parameters.cc (Parameters::Parameters): Initialize timer_.
3962 (Parameters::set_timer): New function.
3963 (set_parameters_timer): New function.
3964 * parameters.h (Parameters::set_timer): New function.
3965 (Parameters::timer): New function.
3966 (Parameters::timer_): New data member.
3967 (set_parameters_timer): New function.
3968 * timer.cc (Timer::stamp): New function.
3969 (Timer::get_pass_time): New function.
3970 * timer.h (Timer::stamp): New function.
3971 (Timer::get_pass_time): New function.
3972 (Timer::pass_times_): New data member.
3973
f475cf7b
CC
39742011-10-17 Cary Coutant <ccoutant@google.com>
3975
3976 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
3977 task for members of lib groups.
3978
cdd7e244
CC
39792011-10-17 Cary Coutant <ccoutant@google.com>
3980
3981 PR gold/13288
4f95c8b4 3982 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
3983 (File_read::make_view): Move bounds check (replace with assert)...
3984 (File_read::find_or_make_view): ... to here.
3985
dfb45471
CC
39862011-10-12 Cary Coutant <ccoutant@google.com>
3987
4f95c8b4 3988 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
3989 ::read returns less than requested size.
3990
53bbcc1b
CC
39912011-10-10 Cary Coutant <ccoutant@google.com>
3992
4f95c8b4 3993 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
3994 Initialize defined_count_.
3995 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
3996 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
3997 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
3998 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
3999 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4000 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4001 member.
4002 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4003 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4004 Return zeroes instead of internal error.
4005
397b129b
CC
40062011-10-10 Cary Coutant <ccoutant@google.com>
4007
4008 PR gold/13249
4f95c8b4 4009 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4010 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4011 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4012 (Output_reloc::type_): Adjust size of bit field.
4013 (Output_reloc::use_plt_offset_): New bit field.
4014 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4015 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4016 flag. Adjust all callers.
4f95c8b4 4017 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4018 creating RELATIVE relocations.
4019
d5698657
NC
40202011-10-10 Nick Clifton <nickc@redhat.com>
4021
4022 * po/es.po: Updated Spanish translation.
4023 * po/fi.po: Updated Finnish translation.
4024
6a59a5c2
DN
40252011-10-03 Diego Novillo <dnovillo@google.com>
4026
4027 * options.cc (parse_uint): Fix dereference of RETVAL.
4028
f0558624
ST
40292011-09-29 Sriraman Tallam <tmsriram@google.com>
4030
4031 * layout.h (section_order_map_): New member.
4032 (get_section_order_map): New member function.
4033 * output.cc (Output_section::add_input_section): Check for patterns
4034 only when --section-ordering-file is specified.
4035 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4036 output_sections have been formed.
4037 * layout.cc (Layout_Layout): Initialize section_order_map_.
4038 * plugin.cc (update_section_order): Store order in order_map. Do not
4039 update the order.
4040 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4041 * testsuite/Makefile.in: Regenerate.
4042 * testsuite/plugin_section_order.c: New file.
4043 * testsuite/plugin_final_layout.cc: New file.
4044 * testsuite/plugin_final_layout.sh: New file.
4045
a7dac153
CC
40462011-09-29 Cary Coutant <ccoutant@google.com>
4047
4f95c8b4 4048 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4049 Check for NULL.
4f95c8b4 4050 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4051 symbols during incremental update.
4052 (Symbol_table::add_from_dynobj): Likewise.
4053
eebd87a5
ILT
40542011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4055 Ian Lance Taylor <iant@google.com>
4056
4057 * symtab.cc (Symbol_table::define_special_symbol): Always
4058 canonicalize version string.
4059
403a3331
CC
40602011-09-26 Cary Coutant <ccoutant@google.com>
4061
4f95c8b4
CC
4062 * gold.cc (queue_initial_tasks): Move option checks ...
4063 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4064 some options; make others fatal.
4065
235061c2
CC
40662011-09-26 Cary Coutant <ccoutant@google.com>
4067
4068 gcc PR lto/47247
4069 * plugin.cc (get_symbols_v2): New function.
4070 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4071 (is_referenced_from_outside): New function.
4072 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4073 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4074 (get_symbols): Pass version parameter.
4075 (get_symbols_v2): New function.
4076 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4077 parameter.
4078 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4079 (onload): Add LDPT_GET_SYMBOLS_V2.
4080 (all_symbols_read_hook): Use get_symbols_v2; check for
4081 LDPR_PREVAILING_DEF_IRONLY_EXP.
4082 * testsuite/plugin_test_3.sh: Update expected results.
4083
dc87f620
ILT
40842011-09-23 Simon Baldwin <simonb@google.com>
4085
4086 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4087 configuration options.
4088 * configure: Regenerate.
4089 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4090 * Makefile.in: Regenerate.
4091 * testsuite/Makefile.in: Regenerate.
4092
a8279f82
ST
40932011-09-19 Sriraman Tallam <tmsriram@google.com>
4094
4095 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4096
0c9350c8
CC
40972011-09-19 Cary Coutant <ccoutant@google.com>
4098
4099 * incremental.cc (can_incremental_update): Fix typo in comment.
4100 * incremental.h (can_incremental_update): Likewise.
4101
aa06ae28
CC
41022011-09-18 Cary Coutant <ccoutant@google.com>
4103
4104 * incremental.cc (can_incremental_update): New function.
4105 * incremental.h (can_incremental_update): New function.
4106 * layout.cc (Layout::init_fixed_output_section): Call it.
4107 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4108 * object.cc (Sized_relobj_file::do_layout): Call
4109 can_incremental_update.
4110
ebb300b2
CC
41112011-09-13 Cary Coutant <ccoutant@google.com>
4112
4113 * configure.ac: Check for glibc support for gnu_indirect_function
4114 support with static linking, setting automake conditional
4115 IFUNC_STATIC.
4116 * Makefile.in: Regenerate.
4117 * configure: Regenerate.
4118
4119 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4120 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4121 for IFUNC_STATIC.
4122 * testsuite/Makefile.in: Regenerate.
4123
1206d0d5
CC
41242011-09-13 Cary Coutant <ccoutant@google.com>
4125
4126 * incremental.cc (Sized_relobj_incr::do_layout): Call
4127 report_comdat_group for kept comdat sections.
4128 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4129 * testsuite/Makefile.in: Regenerate.
4130 * testsuite/incr_comdat_test_1.cc: New source file.
4131 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4132 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4133 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4134
40b29874
ILT
41352011-09-13 Ian Lance Taylor <iant@google.com>
4136
4137 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4138 variable external_symbols_offset.
4139
1b045aac
ILT
41402011-09-12 Ian Lance Taylor <iant@google.com>
4141
4142 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4143 triggered if object has no symbols.
4144
24c6c55a
DM
41452011-09-09 David S. Miller <davem@davemloft.net>
4146
4147 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4148 (Output_fill_debug_line::do_write): Likewise.
4149
66570254
CC
41502011-08-29 Cary Coutant <ccoutant@google.com>
4151
4152 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4153 casts to match formatting specs.
4154 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4155
8ea8cd50
CC
41562011-08-26 Cary Coutant <ccoutant@google.com>
4157
4158 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4159 remaining hole size when allocating.
4160 (Layout::make_output_section): Set fill methods for debug sections.
4161 * layout.h (Free_list::Free_list_node): Move from private to
4162 public.
4163 (Free_list::set_min_hole_size): New function.
4164 (Free_list::begin, Free_list::end): New functions.
4165 (Free_list::min_hole_): New data member.
4166 * output.cc: Include dwarf.h.
4167 (Output_fill_debug_info::do_minimum_hole_size): New function.
4168 (Output_fill_debug_info::do_write): New function.
4169 (Output_fill_debug_line::do_minimum_hole_size): New function.
4170 (Output_fill_debug_line::do_write): New function.
4171 (Output_section::Output_section): Initialize new data member.
4172 (Output_section::set_final_data_size): Ensure patch space is larger
4173 than minimum hole size.
4174 (Output_section::do_write): Fill holes in debug sections.
4175 * output.h (Output_fill): New class.
4176 (Output_fill_debug_info): New class.
4177 (Output_fill_debug_line): New class.
4178 (Output_section::set_free_space_fill): New function.
4179 (Output_section::free_space_fill_): New data member.
4180 * testsuite/Makefile.am (incremental_test_3): Add
4181 --incremental-patch option.
4182 (incremental_test_4): Likewise.
4183 (incremental_test_5): Likewise.
4184 (incremental_test_6): Likewise.
4185 (incremental_copy_test): Likewise.
4186 (incremental_common_test_1): Likewise.
4187 * testsuite/Makefile.in: Regenerate.
4188
7cf80422
NC
41892011-08-26 Nick Clifton <nickc@redhat.com>
4190
4191 * po/es.po: Updated Spanish translation.
4192
c3f7b0e5
CC
41932011-08-01 Cary Coutant <ccoutant@google.com>
4194
4195 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4196 * gold/testsuite/Makefile.in: Regenerate.
4197 * gold/testsuite/justsyms_exec.c: New source file.
4198 * gold/testsuite/justsyms_lib.c: New source file.
4199
9590bf25
CC
42002011-08-01 Cary Coutant <ccoutant@google.com>
4201
4202 * layout.cc (Layout::set_segment_offsets): Don't realign text
4203 segment if -Ttext was specified.
4204 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4205 file type.
4206 * object.h (Sized_relobj_file::e_type): New function.
4207 (Sized_relobj_file::e_type_): New data member.
4208 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4209 base address for ET_EXEC files.
4210 * target.cc (Target::do_make_elf_object_implementation): Allow
4211 ET_EXEC files with --just-symbols option.
4212
dcd8d12e
CC
42132011-07-28 Cary Coutant <ccoutant@google.com>
4214
4215 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4216 Add thread_number parameter.
4217 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4218 * workqueue-threads.cc
4219 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4220 current thread if its thread number is greater than desired thread
4221 count.
4222 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4223 Add thread_number parameter.
4224 (Workqueue::should_cancel_thread): Likewise.
4225 (Workqueue::find_runnable_or_wait): Pass thread_number to
4226 should_cancel_thread.
4227 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4228 parameter.
4229
804eb480
ST
42302011-07-22 Sriraman Tallam <tmsriram@google.com>
4231
4232 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4233 only after checking if it cannot be forced local.
4234 * symtab.h (is_externally_visible): Check if the symbol is not forced
4235 local.
4236
f1ddb600
ILT
42372011-07-15 Ian Lance Taylor <iant@google.com>
4238
4239 * options.h (class General_options): Add --print-output-format.
4240 Move -EL next to -EB, for better --help output.
4241 * target-select.cc: Include <cstdio>, "options.h", and
4242 "parameters.h".
4243 (Target_selector::do_target_bfd_name): New function.
4244 (print_output_format): New function.
4245 * target-select.h (class Target_selector): Update declarations.
4246 (Target_selector::target_bfd_name): New function.
4247 (print_output_format): Declare.
4248 * main.cc: Include "target-select.h".
4249 (main): Handle --print-output-format.
4250 * gold.cc: Include "target-select.h".
4251 (queue_initial_tasks): Handle --print-output-format when there are
4252 no input files.
4253 * parameters.cc (parameters_force_valid_target): Give a better
4254 error message if -EB/-EL does not match target.
4255 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4256 function.
4257
7d172687
ILT
42582011-07-15 Ian Lance Taylor <iant@google.com>
4259
4260 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4261 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4262 (Output_data_plt_i386::do_write): Write address of .dynamic
4263 section to first entry in .got.plt section.
4264 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4265 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4266 Initialize layout_.
4267 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4268 section to first entry in .got.plt section.
4269 * layout.h (Layout::dynamic_section): New function.
4270
e9552f7e
ST
42712011-07-13 Sriraman Tallam <tmsriram@google.com>
4272
4273 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4274 to claim_file call.
4275 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4276 input_section_position_, and input_section_glob_.
4277 (read_layout_from_file): Call function section_ordering_specified.
4278 * layout.h (is_section_ordering_specified): New function.
4279 (section_ordering_specified): New function.
4280 (section_ordering_specified_): New boolean member.
4281 * main.cc(main): Call load_plugins after layout object is defined.
4282 * output.cc (Output_section::add_input_section): Use
4283 function section_ordering_specified to check if section ordering is
4284 needed.
4285 * output.cc (Output_section::add_relaxed_input_section): Use
4286 function section_ordering_specified to check if section ordering is
4287 needed.
4288 (Output_section::update_section_layout): New function.
4289 (Output_section::sort_attached_input_sections): Check if input section
4290 must be reordered.
4291 * output.h (Output_section::update_section_layout): New function.
4292 * plugin.cc (get_section_count): New function.
4293 (get_section_type): New function.
4294 (get_section_name): New function.
4295 (get_section_contents): New function.
4296 (update_section_order): New function.
58797674 4297 (allow_section_ordering): New function.
e9552f7e
ST
4298 (Plugin::load): Add the new interfaces to the transfer vector.
4299 (Plugin_manager::load_plugins): New parameter.
4300 (Plugin_manager::all_symbols_read): New parameter.
4301 (Plugin_manager::claim_file): New parameter. Save the elf object for
4302 unclaimed objects.
4303 (Plugin_manager::get_elf_object): New function.
4304 (Plugin_manager::get_view): Change to directly use the bool to check
4305 if get_view is called from claim_file_hook.
4306 * plugin.h (input_objects): New function
4307 (Plugin__manager::load_plugins): New parameter.
4308 (Plugin_manager::claim_file): New parameter.
4309 (Plugin_manager::get_elf_object): New function.
4310 (Plugin_manager::in_claim_file_handler): New function.
4311 (Plugin_manager::in_claim_file_handler_): New member.
4312 (layout): New function.
4313 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4314 handler with an extra parameter. Make the elf object before calling
4315 claim_file handler.
4316 * testsuite/plugin_test.c (get_section_count): New function pointer.
4317 (get_section_type): New function pointer.
4318 (get_section_name): New function pointer.
4319 (get_section_contents): New function pointer.
4320 (update_section_order): New function pointer.
4321 (allow_section_ordering): New function pointer.
4322 (onload): Check if the new interfaces exist.
4323
9446efde
ILT
43242011-07-13 Ian Lance Taylor <iant@google.com>
4325
4326 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4327 relro section.
4328 * x86_64.cc (Target_x86_64::got_section): Likewise.
4329 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4330 (relro_now_test_SOURCES): New variable.
4331 (relro_now_test_DEPENDENCIES): New variable.
4332 (relro_now_test_LDFLAGS): New variable.
4333 (relro_now_test_LDADD): New variable.
4334 (relro_now_test.so): New target.
4335 * testsuite/Makefile.in: Rebuild.
4336
07aa62f2
ILT
43372011-07-12 Ian Lance Taylor <iant@google.com>
4338
4339 PR gold/12980
4340 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4341 GLOB_DAT relocation rather than a RELATIVE relocation for a
4342 protected symbol when creating a shared library.
4343 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4344 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4345 * testsuite/protected_main_1.cc (main): Test that protected
4346 function has same address.
4347
e2153196
ILT
43482011-07-11 Ian Lance Taylor <iant@google.com>
4349
4350 PR gold/12979
4351 * options.h (class General_options): Add -Bgroup.
4352 * options.cc (General_options::finalize): If -Bgroup is set,
4353 default to --unresolved-symbols=report-all.
4354 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4355 * target-reloc.h (issue_undefined_symbol_error): Handle
4356 --unresolved-symbols=report-all.
4357
6daf5215
ILT
43582011-07-08 Ian Lance Taylor <iant@google.com>
4359
4360 PR gold/11985
4361 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4362 if linker script discards key sections.
4363 (Layout::create_dynamic_symtab): Likewise.
4364 (Layout::assign_local_dynsym_offsets): Likewise.
4365 (Layout::sized_create_version_sections): Likewise.
4366 (Layout::create_interp): Likewise.
4367 (Layout::finish_dynamic_section): Likewise.
4368 (Layout::set_dynamic_symbol_size): Likewise.
4369
beabb2c6
ILT
43702011-07-08 Ian Lance Taylor <iant@google.com>
4371
4372 PR gold/12386
4373 * options.h (class General_options): Add --unresolved-symbols.
4374 * target-reloc.h (issue_undefined_symbol_error): Check
4375 --unresolved-symbols. Add comments.
4376
9c16daf1
ILT
43772011-07-08 Ian Lance Taylor <iant@google.com>
4378
4379 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4380 expression more complex.
4381
191f1a2d
ILT
43822011-07-08 Ian Lance Taylor <iant@google.com>
4383
4384 PR gold/11317
4385 * target-reloc.h (issue_undefined_symbol_error): New inline
4386 function, broken out of relocate_section.
4387 (relocate_section): Call issue_undefined_symbol_error.
4388 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4389 there is no TLS segment if we are about to issue an undefined
4390 symbol error.
4391 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4392
62855347
ILT
43932011-07-08 Ian Lance Taylor <iant@google.com>
4394
4395 PR gold/12279
4396 * resolve.cc (Symbol_table::should_override): Add fromtype
4397 parameter. Change all callers. Give error when linking together
4398 TLS and non-TLS symbol.
4399 (Symbol_table::should_override_with_special): Add fromtype
4400 parameter. Change all callers.
4401 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4402 there is no TLS segment if we have reported some errors.
4403 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4404
67181c72
ILT
44052011-07-08 Ian Lance Taylor <iant@google.com>
4406
4407 PR gold/12372
4408 * target.h (Target::plt_address_for_global): New function.
4409 (Target::plt_address_for_local): New function.
4410 (Target::plt_section_for_global): Remove.
4411 (Target::plt_section_for_local): Remove.
4412 (Target::do_plt_address_for_global): New virtual function.
4413 (Target::do_plt_address_for_local): New virtual function.
4414 (Target::do_plt_section_for_global): Remove.
4415 (Target::do_plt_section_for_local): Remove.
4416 (Target::register_global_plt_entry): Add Symbol_table and Layout
4417 parameters.
4418 * output.cc (Output_data_got::Got_entry::write): Use
4419 plt_address_for_global and plt_address_for_local.
4420 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4421 address of output section.
4422 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4423 got_irelative_, and irelative_count_ fields. Update
4424 declarations.
4425 (Output_data_plt_i386::has_irelative_section): New function.
4426 (Output_data_plt_i386::entry_count): Add irelative_count_.
4427 (Output_data_plt_i386::set_final_data_size): Likewise.
4428 (class Target_i386): Add got_irelative_ and rel_irelative_
4429 fields. Update declarations.
4430 (Target_i386::Target_i386): Initialize new fields.
4431 (Target_i386::do_plt_address_for_global): New function replacing
4432 do_plt_section_for_global.
4433 (Target_i386::do_plt_address_for_local): New function replacing
4434 do_plt_section_for_local.
4435 (Target_i386::got_section): Create got_irelative_.
4436 (Target_i386::rel_irelative_section): New function.
4437 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4438 fields. Don't define __rel_iplt_{start,end}.
4439 (Output_data_plt_i386::add_entry): Add symtab and layout
4440 parameters. Change all callers. Use different PLT and GOT for
4441 IFUNC symbols.
4442 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4443 layout parameters. Change all callers. Use different PLT and
4444 GOT.
4445 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4446 (Output_data_plt_i386::rel_irelative): New function.
4447 (Output_data_plt_i386::address_for_global): New function.
4448 (Output_data_plt_i386::address_for_local): New function.
4449 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4450 IRELATIVE GOT when changing IFUNC GOT entries.
4451 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4452 reloc.
4453 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4454 if we didn't create an IRELATIVE GOT.
4455 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4456 plt_address_for_local.
4457 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4458 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4459 got_irelative_, and irelative_count_ fields. Update
4460 declarations.
4461 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4462 Initialize new fields. Remove symtab parameter. Change all
4463 callers.
4464 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4465 irelative_count_.
4466 (Output_data_plt_x86_64::has_irelative_section): New function.
4467 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4468 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4469 fields. Update declarations.
4470 (Target_x86_64::Target_x86_64): Initialize new fields.
4471 (Target_x86_64::do_plt_address_for_global): New function replacing
4472 do_plt_section_for_global.
4473 (Target_x86_64::do_plt_address_for_local): New function replacing
4474 do_plt_section_for_local.
4475 (Target_x86_64::got_section): Create got_irelative_.
4476 (Target_x86_64::rela_irelative_section): New function.
4477 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4478 all callers. Don't create __rel_iplt_{start,end}.
4479 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4480 parameters. Change all callers. Use different PLT and GOT for
4481 IFUNC symbols.
4482 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4483 layout parameters. Change all callers. Use different PLT and
4484 GOT.
4485 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4486 parameters. Change all callers. Use different PLT and GOT for
4487 IFUNC symbols.
4488 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4489 (Output_data_plt_x86_64::rela_irelative): New function.
4490 (Output_data_plt_x86_64::address_for_global): New function.
4491 (Output_data_plt_x86_64::address_for_local): New function.
4492 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4493 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4494 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4495 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4496 parameters.
4497 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4498 reloc.
4499 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4500 symbols if we didn't create an IRELATIVE GOT.
4501 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4502 plt_address_for_local.
4503 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4504 * testsuite/ifuncvar1.c: New test file.
4505 * testsuite/ifuncvar2.c: New test file.
4506 * testsuite/ifuncvar3.c: New test file.
4507 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4508 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4509 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4510 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4511 * testsuite/Makefile.in: Rebuild.
4512
33c15b45
CC
45132011-07-07 Cary Coutant <ccoutant@google.com>
4514
4515 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4516 (two_file_test_1_ndebug.o): Likewise.
4517 (two_file_test_1b_ndebug.o): Likewise.
4518 (two_file_test_2_ndebug.o): Likewise.
4519 (two_file_test_main_ndebug.o): Likewise.
4520 (incremental_test_2): Link with no-debug versions.
4521
f48b5fb7
CC
45222011-07-06 Cary Coutant <ccoutant@google.com>
4523
4524 * gold/incremental.cc
4525 (Output_section_incremental_inputs::write_info_blocks): Check for
4526 hidden and internal symbols.
4527
221597a5
CC
45282011-07-06 Cary Coutant <ccoutant@google.com>
4529
4530 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4531 Check disposition for startup file.
4532 (Incremental_inputs::report_command_line): Ignore
4533 --incremental-startup-unchanged option.
4534 * options.cc (General_options::parse_incremental_startup_unchanged):
4535 New function.
4536 (General_options::General_options): Initialize new data member.
4537 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4538 (General_options): Add --incremental-startup-unchanged option.
4539 (General_options::incremental_startup_disposition): New function.
4540 (General_options::incremental_startup_disposition_): New data member.
4541
e24719f6
CC
45422011-07-06 Cary Coutant <ccoutant@google.com>
4543
4544 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4545 input file index to Script_info ctor.
4546 (Sized_incremental_binary::do_file_has_changed): Find the
4547 command-line argument for files named in scripts.
4548 * incremental.h (Script_info::Script_info): New ctor
4549 with input file index.
4550 (Script_info::input_file_index): New function.
4551 (Script_info::input_file_index_): New data member.
4552 (Incremental_binary::get_library): Add const.
4553 (Incremental_binary::get_script_info): Add const.
4554 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4555 * testsuite/Makefile.am (incremental_test_5): New test case.
4556 (incremental_test_6): New test case.
4557 * testsuite/Makefile.in: Regenerate.
4558
8f7c81e8
CC
45592011-07-06 Cary Coutant <ccoutant@google.com>
4560
4561 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4562 debug output when command lines differ.
4563
9fbd3822
CC
45642011-07-06 Cary Coutant <ccoutant@google.com>
4565
4566 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4567 --incremental-patch option.
4568 * layout.cc (Free_list::allocate): Extend allocation beyond original
4569 end if enabled.
4570 (Layout::make_output_section): Mark sections that should get
4571 patch space.
4572 * options.cc (parse_percent): New function.
4573 * options.h (parse_percent): New function.
4574 (DEFINE_percent): New macro.
4575 (General_options): Add --incremental-patch option.
4576 * output.cc (Output_section::Output_section): Initialize new data
4577 members.
4578 (Output_section::add_input_section): Print section name when out
4579 of patch space.
4580 (Output_section::add_output_section_data): Likewise.
4581 (Output_section::set_final_data_size): Add patch space when
4582 doing --incremental-full.
4583 (Output_section::do_reset_address_and_file_offset): Remove patch
4584 space.
4585 (Output_segment::set_section_list_addresses): Print debug output
4586 only if --incremental-update.
4587 * output.h (Output_section::set_is_patch_space_allowed): New function.
4588 (Output_section::is_patch_space_allowed_): New data member.
4589 (Output_section::patch_space_): New data member.
4590 * parameters.cc (Parameters::incremental_full): New function.
4591 * parameters.h (Parameters::incremental_full): New function
4592 * testsuite/Makefile.am (incremental_test_2): Add test for
4593 --incremental-patch option.
4594 * testsuite/Makefile.in: Regenerate.
4595 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4596 (t18): Remove function body.
4597
f6cccc2c
DK
45982011-07-05 Doug Kwan <dougkwan@google.com>
4599
4600 PR gold/12771
4601 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4602 Arm_Address type for relocation result.
4603 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4604 overflow check.
4605 (Arm_relocate_functions::abs32): Use unaligned access.
4606 (Arm_relocate_functions::rel32): Ditto.
4607 (Arm_relocate_functions::prel31): Ditto.
4608 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4609 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4610 static data relocations.
4611 * testsuite/Makefile.in: Regnerate.
4612 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4613
28a13fec
ILT
46142011-07-05 Ian Lance Taylor <iant@google.com>
4615
4616 PR gold/12392
4617 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4618 symbols if necessary.
4619 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4620
24d47b34
ILT
46212011-07-05 Ian Lance Taylor <iant@google.com>
4622
4623 PR gold/12952
4624 * resolve.cc (Symbol::override_base_with_special): Simply override
4625 version with special symbol version, ignoring previous version.
4626
41f9cbbe
ILT
46272011-07-05 Ian Lance Taylor <iant@google.com>
4628
4629 * object.cc (Sized_relobj_file::include_section_group): Add
4630 information to comment about signature location.
4631
886288f1
ILT
46322011-07-02 Ian Lance Taylor <iant@google.com>
4633
4634 PR gold/12957
4635 * options.h (class General_options): Add -f and -F.
4636 * options.cc (General_options::finalize): Fatal error if -f/-F
4637 are used without -shared.
4638 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4639
ae3a6d4f
ILT
46402011-07-02 Ian Lance Taylor <iant@google.com>
4641
4642 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4643
21131061
ILT
46442011-07-01 Ian Lance Taylor <iant@google.com>
4645
4646 PR gold/12525
4647 PR gold/12952
4648 * resolve.cc (Symbol::override_base_with_special): Don't override
4649 the version if the overriding symbol has a different name.
4650 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4651 all callers. If we give an error about an undefined version,
4652 define the base version if necessary.
4653 * dynobj.h (class Versions): Update declaration.
4654 * testsuite/weak_alias_test_5.cc: New file.
4655 * testsuite/weak_alias_test.script: New file.
4656 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4657 and versioned_alias have the right value, and call t2.
4658 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4659 weak_alias_test_5.so.
4660 (weak_alias_test_LDADD): Likewise.
4661 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4662 * testsuite/Makefile.in: Rebuild.
4663
611062c0
ILT
46642011-07-01 Ian Lance Taylor <iant@google.com>
4665
4666 PR gold/12525
4667 * options.h (class General_options): Support -z notext.
4668 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4669 -Wl,-z,notext.
4670 (two_file_shared_nonpic.so): Likewise.
4671 (two_file_shared_mixed.so): Likewise.
4672 (two_file_shared_mixed_1.so): Likewise.
4673 (weak_undef_lib_nonpic.so): Likewise.
4674 (alt/weak_undef_lib_nonpic.so): Likewise.
4675 (tls_test_shared_nonpic.so): Likewise.
4676 * testsuite/Makefile.in: Rebuild.
4677
328c7c2f
ILT
46782011-07-01 Ian Lance Taylor <iant@google.com>
4679
4680 PR gold/12525
4681 * configure.ac: Test whether static linking works, setting
4682 the automake conditional HAVE_STATIC.
4683 * testsuite/Makefile.am: Disable tests using -static if
4684 HAVE_STATIC is not true.
4685 * configure, testsuite/Makefile.in: Rebuild.
4686
02d7cd44
ILT
46872011-07-01 Ian Lance Taylor <iant@google.com>
4688
4689 PR gold/12525
4690 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4691 Assert if we see DW_EH_PE_indirect.
4692 * target.h (Target::ehframe_datarel_base): New function.
4693 (Target::do_ehframe_datarel_base): New target function.
4694 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4695 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4696 function.
4697
07a60597
ILT
46982011-07-01 Ian Lance Taylor <iant@google.com>
4699
4700 PR gold/12571
4701 * options.h (class General_options): Add
4702 --ld-generated-unwind-info.
4703 * ehframe.cc (Fde::write): Add address parameter. Change all
4704 callers. If associated with PLT, fill in address and size.
4705 (Cie::set_output_offset): Only add merge mapping if there is an
4706 object.
4707 (Cie::write): Add address parameter. Change all callers.
4708 (Eh_frame::add_ehframe_for_plt): New function.
4709 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4710 input_offset_ fields into union u_, with new plt field.
4711 (Fde::Fde): Adjust for new union field.
4712 (Fde::Fde) [Output_data version]: New constructor.
4713 (Fde::add_mapping): Only add merge mapping if there is an object.
4714 (class Cie): Update declarations.
4715 (class Eh_frame): Declare add_ehframe_for_plt.
4716 * layout.cc (Layout::layout_eh_frame): Break out code into
4717 make_eh_frame_section, and call it.
4718 (Layout::make_eh_frame_section): New function.
4719 (Layout::add_eh_frame_for_plt): New function.
4720 * layout.h (class Layout): Update declarations.
4721 * merge.cc (Merge_map::add_mapping): Add assertion.
4722 * i386.cc: Include "dwarf.h".
4723 (class Output_data_plt_i386): Make first_plt_entry,
4724 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4725 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4726 and plt_eh_frame_fde.
4727 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4728 boundary. Call add_eh_frame_for_plt if appropriate.
4729 * x86_64.cc: Include "dwarf.h".
4730 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4731 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4732 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4733 and plt_eh_frame_fde.
4734 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4735 appropriate.
4736
14788a3f
ILT
47372011-06-29 Ian Lance Taylor <iant@google.com>
4738
4739 PR gold/12629
4740 * object.cc (Sized_relobj_file::layout_section): Change shdr
4741 parameter to be const.
4742 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4743 out of do_layout.
4744 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4745 appropriate. Call layout_eh_frame_section.
4746 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4747 sections.
4748 * object.h (class Sized_relobj_file): Update declarations.
4749
6c21fce1
ILT
47502011-06-29 Ian Lance Taylor <iant@google.com>
4751
37e41b03 4752 PR gold/12652
6c21fce1
ILT
4753 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4754 modifier.
4755 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4756
4d5e4e62
ILT
47572011-06-29 Ian Lance Taylor <iant@google.com>
4758
4759 PR gold/12675
4760 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4761 SHT_X86_64_UNWIND.
4762 * layout.cc (Layout::layout_eh_frame): Likewise.
4763
886f533a
ILT
47642011-06-29 Ian Lance Taylor <iant@google.com>
4765
4766 PR gold/12695
4767 * layout.cc (Layout::symtab_section_shndx): New function.
4768 * layout.h (class Layout): Declare symtab_section_shndx.
4769 * output.cc (Output_section::write_header): Call it.
4770
f3ae1b28
ILT
47712011-06-29 Ian Lance Taylor <iant@google.com>
4772
4773 PR gold/12818
4774 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4775 symbols which are not used in a relocation.
4776
aecf301f
ILT
47772011-06-28 Ian Lance Taylor <iant@google.com>
4778
4779 PR gold/12898
4780 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4781 script create indistinguishable segments.
4782 (Layout::set_segment_offsets): Use stable_sort when sorting
4783 segments. Pass this to Compare_segments constructor.
4784 * layout.h (class Layout): Make segment_precedes non-static.
4785 (class Compare_segments): Change from struct to class. Add
4786 layout_ field. Add constructor.
4787 * script-sections.cc
4788 (Script_sections::attach_sections_using_phdrs_clause): Rename
4789 local orphan to is_orphan. Don't report failure to put empty
4790 section in segment. On attachment failure, report name of
4791 section, and attach to first PT_LOAD segment.
4792
03ef7571
ILT
47932011-06-28 Ian Lance Taylor <iant@google.com>
4794
4795 PR gold/12934
4796 * target-select.cc (Target_selector::Target_selector): Add
4797 emulation parameter. Change all callers.
4798 (select_target_by_bfd_name): Rename from select_target_by_name.
4799 Change all callers.
4800 (select_target_by_emulation): New function.
4801 (supported_emulation_names): New function.
4802 * target-select.h (class Target_selector): Add emulation_ field.
4803 Update declarations.
4804 (Target_selector::recognize_by_bfd_name): Rename from
4805 recognize_by_name. Change all callers.
4806 (Target_selector::supported_bfd_names): Rename from
4807 supported_names. Change all callers.
4808 (Target_selector::recognize_by_emulation): New function.
4809 (Target_selector::supported_emulations): New function.
4810 (Target_selector::emulation): New function.
4811 (Target_selector::do_recognize_by_bfd_name): Rename from
4812 do_recognize_by_name. Change all callers.
4813 (Target_selector::do_supported_bfd_names): Rename from
4814 do_supported_names. Change all callers.
4815 (Target_selector::do_recognize_by_emulation): New function.
4816 (Target_selector::do_supported_emulations): New function.
4817 (select_target_by_bfd_name): Change name in declaration.
4818 (select_target_by_emulation): Declare.
4819 (supported_emulation_names): Declare.
4820 * parameters.cc (parameters_force_valid_target): Try to find
4821 target based on emulation from -m option.
4822 * options.h (class General_options): Change doc string for -m.
4823 * options.cc (help): Print emulations.
4824 (General_options::parse_V): Likewise.
4825 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
4826 Add emulation parameter. Change all callers.
4827
200b2bb9
ILT
48282011-06-28 Ian Lance Taylor <iant@google.com>
4829
4830 * target.h (class Target): Add osabi_ field.
4831 (Target::osabi): New function.
4832 (Target::set_osabi): New function.
4833 (Target::Target): Initialize osabi_.
4834 (Target::do_adjust_elf_header): Make pure virtual.
4835 (Sized_target::do_adjust_elf_header): Declare.
4836 * target.cc (Sized_target::do_adjust_elf_header): New function.
4837 (class Sized_target): Instantiate all versions.
4838 * freebsd.h (class Target_freebsd): Remove.
4839 (Target_selector_freebsd::do_recognize): Call set_osabi on
4840 Target.
4841 (Target_selector_freebsd::do_recognize_by_name): Likewise.
4842 (Target_selector_freebsd::set_osabi): Remove.
4843 * i386.cc (class Target_i386): Inherit from Sized_target rather
4844 than Target_freebsd.
4845 * x86_64.cc (class Target_x86_64): Likewise.
4846
b3ce541e
ILT
48472011-06-28 Ian Lance Taylor <iant@google.com>
4848
4849 * target.h (Target::can_check_for_function_pointers): Rewrite.
4850 Make non-virtual.
4851 (Target::can_icf_inline_merge_sections): Likewise.
4852 (Target::section_may_have_icf_unsafe_poineters): Likewise.
4853 (Target::Target_info): Add can_icf_inline_merge_sections field.
4854 (Target::do_can_check_for_function_pointers): New virtual
4855 function.
4856 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
4857 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
4858 from can_check_for_function_pointers, move in file.
4859 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
4860 section_may_have_icf_unsafe_poineters, move in file.
4861 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
4862 * i386.cc (Target_i386::do_can_check_for_function_pointers):
4863 Rename from can_check_for_function_pointers, move in file.
4864 (Target_i386::can_icf_inline_merge_sections): Remove.
4865 (Target_i386::i386_info): Initialize
4866 can_icf_inline_merge_sections.
4867 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
4868 Initialize can_icf_inline_merge_sections.
4869 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
4870 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
4871 Rename from can_check_for_function_pointers, move in file.
4872 (Target_x86_64::can_icf_inline_merge_sections): Remove.
4873 (Target_x86_64::x86_64_info): Initialize
4874 can_icf_inline_merge_sections.
4875 * testsuite/testfile.cc (Target_test::test_target_info):
4876 Likewise.
4877 * icf.cc (get_section_contents): Correct formatting.
4878
6d1c4efb
ILT
48792011-06-27 Ian Lance Taylor <iant@google.com>
4880
4881 * symtab.cc (Symbol::versioned_name): New function.
4882 (Symbol_table::add_to_final_symtab): Use versioned_name when
4883 appropriate.
4884 (Symbol_table::sized_write_symbol): Likewise.
4885 * symtab.h (class Symbol): Declare versioned_name.
4886 * stringpool.h (class Stringpool_template): Add variant of add
4887 which takes a std::basic_string.
4888 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
4889 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
4890 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
4891 (ver_test_12.o): New target.
4892 * testsuite/Makefile.in: Rebuild.
4893
57eb9b50
DK
48942011-06-27 Doug Kwan <dougkwan@google.com>
4895
4896 * arm.cc (Arm_relocate_functions::thm_jump8,
4897 Arm_relocate_functions::thm_jump11): Use a wider signed
4898 type to compute offset.
4899 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
4900 arm_thm_jump8.
4901 * testsuite/Makefile.in: Regenerate.
4902 * testsuite/arm_branch_in_range.sh: Check test results of
4903 arm_thm_jump11 and arm_thm_jump8.
4904 * testsuite/arm_thm_jump11.s: New test source file.
4905 * testsuite/arm_thm_jump11.t: New linker script.
4906 * testsuite/arm_thm_jump8.s: New test source file.
4907 * testsuite/arm_thm_jump8.t: New linker script.
4908
487b39df
ILT
49092011-06-24 Ian Lance Taylor <iant@google.com>
4910
4911 * layout.cc: Include "object.h".
4912 (ctors_sections_in_init_array): New static variable.
4913 (Layout::is_ctors_in_init_array): New function.
4914 (Layout::layout): Add entry to ctors_sections_in_init_array if
4915 appropriate.
4916 * layout.h (class Layout): Declare is_ctors_in_init_array.
4917 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
4918 is_ctors_reverse_view is set.
4919 (Sized_relobj_file::write_sections): Add layout parameter. Change
4920 all callers. Set is_ctors_reverse_view field of View_size.
4921 (Sized_relobj_file::reverse_words): New function.
4922 * object.h (Sized_relobj_file::View_size): Add
4923 is_ctors_reverse_view field.
4924 (class Sized_relobj_file): Update declarations.
4925 * testsuite/initpri3.c: New test.
4926 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
4927 initpri3b.
4928 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
4929 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
4930 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
4931 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
4932 * testsuite/Makefile.in: Rebuild.
4933
472076e4
CC
49342011-06-24 Cary Coutant <ccoutant@google.com>
4935
4936 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
4937 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
4938 (debug_msg_cdebug.err): New targets.
4939 * testsuite/Makefile.in: Regenerate.
4940 * testsuite/debug_msg.sh: Check output of link with compressed debug.
4941 Fix checks for link with shared library.
4942
a60af0db
DK
49432011-06-24 Doug Kwan <dougkwan@google.com>
4944
4945 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
4946 skip empty text sections.
4947 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
4948
5393d741
ILT
49492011-06-22 Ian Lance Taylor <iant@google.com>
4950
4951 PR gold/12910
4952 * options.h (class General_options): Add --ctors-in-init-array.
4953 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
4954 friends as SHT_PROGBITS for merging sections.
4955 (Layout::layout): Remove special handling of .init_array and
4956 friends. Don't sort if doing relocatable link. Sort for .ctors
4957 and .dtors if ctors_in_init_array.
4958 (Layout::make_output_section): Force correct section types for
4959 .init_array and friends. Don't sort if doing relocatable link,
4960 Don't sort .ctors and .dtors if ctors_in_init_array.
4961 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
4962 (Layout::output_section_name): Add relobj parameter. Change all
4963 callers. Handle .ctors. and .dtors. in code rather than table.
4964 Handle .ctors and .dtors if ctors_in_init_array.
4965 (Layout::match_file_name): New function, moved from output.cc.
4966 * layout.h (class Layout): Update declarations.
4967 * output.cc: Include "layout.h".
4968 (Input_section_sort_entry::get_priority): New function.
4969 (Input_section_sort_entry::match_file_name): Just call
4970 Layout::match_file_name.
4971 (Output_section::Input_section_sort_init_fini_compare::operator()):
4972 Handle .ctors and .dtors. Sort by explicit priority rather than
4973 by name.
4974 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
4975 * testsuite/initpri2.c: New test.
4976 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
4977 (check_PROGRAMS): Add initpri2.
4978 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
4979 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
4980 * configure, testsuite/Makefile.in: Rebuild.
4981
e1f74f98
ILT
49822011-06-19 Ian Lance Taylor <iant@google.com>
4983
4984 PR gold/12880
4985 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
4986 .interp section to a PT_INTERP segment even if we have seen a
4987 --dynamic-linker option. Don't do it if we have seen a PHDRS
4988 clause in a linker script.
4989 (Layout::finalize): Don't create a .interp section if we've
4990 already create a PT_INTERP segment.
4991 (Layout::create_interp): Always call choose_output_section (revert
4992 patch of 2011-06-17). Don't create PT_INTERP segment.
4993 * script-sections.cc
4994 (Script_sections::create_note_and_tls_segments): Add a .interp
4995 section to a PT_INTERP segment even if we have seen a
4996 --dynamic-linker option.
4997
766f91bb
ILT
49982011-06-18 Ian Lance Taylor <iant@google.com>
4999
5000 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5001 merely because a non-PT_LOAD segment has a dynamic reloc.
5002
0d212c3a
ILT
50032011-06-18 Ian Lance Taylor <iant@google.com>
5004
5005 * layout.cc (Layout::finish_dynamic_section): Don't create
5006 DT_FLAGS entry if not needed.
5007
911a5072
ILT
50082011-06-18 Ian Lance Taylor <iant@google.com>
5009
5010 PR gold/12745
5011 * layout.cc (Layout::layout_eh_frame): Correct handling of
5012 writable .eh_frame section.
5013
534b4e5f
ILT
50142011-06-17 Ian Lance Taylor <iant@google.com>
5015
5016 PR gold/12893
5017 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5018 symbol is redefined with the exact same object and value.
5019
10b4f102
ILT
50202011-06-17 Ian Lance Taylor <iant@google.com>
5021
5022 PR gold/12880
5023 * layout.h (class Layout): Add interp_segment_ field.
5024 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5025 (Layout::attach_allocated_section_to_segment): If making shared
5026 library, put .interp section in PT_INTERP segment.
5027 (Layout::finalize): Also call create_interp if -dynamic-linker
5028 option was used.
5029 (Layout::create_interp): Assert that there is no PT_INTERP
5030 segment. If not using a SECTIONS clause, use make_output_section.
5031 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5032 * script-sections.cc
5033 (Script_sections::create_note_and_tls_segments): If making shared
5034 library, put .interp section in PT_INTERP segment.
5035
a29b0dad
ILT
50362011-06-17 Ian Lance Taylor <iant@google.com>
5037
e588ea8d
ILT
5038 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5039 when making a shared library.
5040
50412011-06-17 Ian Lance Taylor <iant@google.com>
5042
5043 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5044 parameter. Change all callers. Don't issue warning about PC32
5045 against locally defined symbol.
a29b0dad 5046
9d3b0698
ILT
50472011-06-16 Ian Lance Taylor <iant@google.com>
5048
5049 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5050 occurs in same object.
5051
85b0f90c
AM
50522011-06-14 Alan Modra <amodra@gmail.com>
5053
5054 * po/POTFILES.in: Regenerate.
5055
a94907d9
ILT
50562011-06-09 Ian Lance Taylor <iant@google.com>
5057
5058 * script-sections.cc
5059 (Orphan_output_section::set_section_addresses): For a relocatable
5060 link set address to 0.
5061
4fb3a1c3
CC
50622011-06-09 Cary Coutant <ccoutant@google.com>
5063
5064 PR gold/12804
5065 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5066 used with --compress-debug-sections.
5067 * gold/object.cc (Sized_relobj_file::do_layout): Report
5068 uncompressed size of compressed input sections.
5069
61220854
CC
50702011-06-08 Cary Coutant <ccoutant@google.com>
5071
5072 PR gold/12804
5073 * testsuite/two_file_test_2_v1.cc: Change initialization of
5074 v2 to keep it in .data.
5075
e6455dfb
CC
50762011-06-07 Cary Coutant <ccoutant@google.com>
5077
5078 * common.cc (Symbol_table::do_allocate_commons_list): Call
5079 gold_fallback.
5080 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5081 (Errors::fallback): New function.
5082 (gold_fallback): New function.
5083 * errors.h (Errors::fallback): New function.
5084 * gold.cc (gold_exit): Change status parameter to enum; adjust
5085 all callers.
5086 (queue_initial_tasks): Call gold_fallback.
5087 * gold.h: Include cstdlib.
5088 (Exit_status): New enum type.
5089 (gold_exit): Change status parameter to enum.
5090 (gold_fallback): New function.
5091 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5092 (Layout::create_symtab_sections): Likewise.
5093 (Layout::create_shdrs): Likewise.
5094 * main.cc (main): Adjust call to gold_exit.
5095 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5096 (Output_data_got::add_got_entry_pair): Likewise.
5097 (Output_section::add_input_section): Likewise.
5098 (Output_section::add_output_section_data): Likewise.
5099 (Output_segment::set_section_list_addresses): Likewise.
5100 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5101
fb0e076f
CC
51022011-06-07 Cary Coutant <ccoutant@google.com>
5103
5104 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5105 for incremental links.
5106 * output.cc (Output_segment::set_section_list_addresses): Remove
5107 FIXME and test for TLS or BSS.
5108
a5ee4d5d
CC
51092011-06-07 Cary Coutant <ccoutant@google.com>
5110
5111 * testsuite/Makefile.am: Add incremental_copy_test,
5112 incremental_common_test_1.
5113 * testsuite/Makefile.in: Regenerate.
5114 * testsuite/common_test_1_v1.c: New source file.
5115 * testsuite/common_test_1_v2.c: New source file.
5116 * testsuite/copy_test_v1.cc: New source file.
5117
5146f448
CC
51182011-06-07 Cary Coutant <ccoutant@google.com>
5119
5120 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5121 update, allocate common from bss section's free list.
5122 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5123 linker-defined symbols.
5124 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5125 Skip GOT and PLT entries that are no longer referenced.
5126 (Output_section_incremental_inputs::write_info_blocks): Mark
5127 linker-defined symbols.
5128 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5129 * output.cc (Output_section::allocate): New function.
5130 * output.h (Output_section::allocate): New function.
5131 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5132 linker-defined symbols.
5133 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5134 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5135 (Symbol::init_base_output_data): Likewise.
5136 (Symbol::init_base_output_segment): Likewise.
5137 (Symbol::init_base_constant): Likewise.
5138 (Sized_symbol::init_output_data): Likewise.
5139 (Sized_symbol::init_output_segment): Likewise.
5140 (Sized_symbol::init_constant): Likewise.
5141 (Symbol_table::do_define_in_output_data): Likewise.
5142 (Symbol_table::do_define_in_output_segment): Likewise.
5143 (Symbol_table::do_define_as_constant): Likewise.
5144 * symtab.h (Symbol::is_predefined): New function.
5145 (Symbol::init_base_output_data): Add is_predefined parameter.
5146 (Symbol::init_base_output_segment): Likewise.
5147 (Symbol::init_base_constant): Likewise.
5148 (Symbol::is_predefined_): New data member.
5149 (Sized_symbol::init_output_data): Add is_predefined parameter.
5150 (Sized_symbol::init_output_segment): Likewise.
5151 (Sized_symbol::init_constant): Likewise.
5152 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5153
26d3c67d
CC
51542011-06-07 Cary Coutant <ccoutant@google.com>
5155
5156 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5157 instead of emit_copy_reloc.
5158 (Copy_relocs::emit_copy_reloc): Refactor.
5159 (Copy_relocs::make_copy_reloc): New function.
5160 (Copy_relocs::add_copy_reloc): Remove.
5161 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5162 section.
5163 (Copy_relocs::make_copy_reloc): New function.
5164 (Copy_relocs::add_copy_reloc): Remove.
5165 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5166 unchanged input files.
5167 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5168 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5169 Reserve BSS space for COPY relocations.
5170 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5171 (Output_section_incremental_inputs::write_info_blocks): Record
5172 whether a symbol is copied from a shared object.
5173 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5174 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5175 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5176 (Incremental_input_entry_reader::get_output_symbol_index): Add
5177 is_copy parameter.
5178 (Incremental_binary::emit_copy_relocs): New function.
5179 (Incremental_binary::do_emit_copy_relocs): New function.
5180 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5181 new data member.
5182 (Sized_incremental_binary::add_copy_reloc): New function.
5183 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5184 (Sized_incremental_binary::Copy_reloc): New struct.
5185 (Sized_incremental_binary::Copy_relocs): New typedef.
5186 (Sized_incremental_binary::copy_relocs_): New data member.
5187 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5188 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5189 * target.h (Sized_target::emit_copy_reloc): New function.
5190 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5191
7cdb37d9
CC
51922011-06-02 Cary Coutant <ccoutant@google.com>
5193
5194 PR gold/12163
5195 * gold/archive.cc (Archive::Archive): Initialize new data member.
5196 (Archive::include_all_members): Return if archive has already been
5197 included.
5198 * gold/archive.h (Archive::include_all_members_): New data member.
5199
cc643b88
NC
52002011-06-02 Nick Clifton <nickc@redhat.com>
5201
5202 * dynobj.h: Fix spelling mistake in comment.
5203 * output.cc: Likewise.
5204
f62a3ca7 52052011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5206 Asier Llano
f62a3ca7
DK
5207
5208 PR gold/12826
cc643b88 5209 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5210 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5211 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5212 redundant arm_exidx_test.so.
5213 * testsuite/Makefile.in: Regenerate.
5214 (check_SCRIPTS): Add pr12826.sh
5215 (check_DATA): Add pr12826.stdout
5216 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5217 * testsuite/pr12826.sh: New file.
5218 * testsuite/pr12826_1.s: Ditto.
5219 * testsuite/pr12826_1.s: Ditto.
5220
8dbe1edc
ILT
52212011-05-30 Ian Lance Taylor <iant@google.com>
5222
5223 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5224 sections.
5225
c49875be
ILT
52262011-05-29 Ian Lance Taylor <iant@google.com>
5227
5228 PR gold/12804
5229 * testsuite/Makefile.am: Use different file name for two_file_test
5230 temporary file for each incremental test.
5231 * testsuite/Makefile.in: Rebuild.
5232
69d53f7a
ILT
52332011-05-29 Ian Lance Taylor <iant@google.com>
5234
5235 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5236 binary input file is empty.
5237
41d0ab5f
ILT
52382011-05-27 Ian Lance Taylor <iant@google.com>
5239
5240 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5241 (ver_test_9.so): Likewise.
5242 * testsuite/Makefile.in: Rebuild.
5243
89d8a36b
CC
52442011-05-26 Cary Coutant <ccoutant@google.com>
5245
5246 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5247 * incremental.cc (Incremental_inputs::report_input_section): Fix
5248 comment, indentation.
5249 (Incremental_inputs::report_comdat_group): New function.
5250 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5251 of data for incremental input file entry.
5252 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5253 group count, COMDAT group signatures.
5254 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5255 an unchanged input file.
5256 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5257 Initialize new data member.
5258 (Incremental_object_entry::add_comdat_group): New function.
5259 (Incremental_object_entry::get_comdat_group_count): New function.
5260 (Incremental_object_entry::get_comdat_signature_key): New function.
5261 (Incremental_object_entry::groups_): New data member.
5262 (Incremental_inputs::report_comdat_group): New function.
5263 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5264 data for incremental input file entry.
5265 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5266 (Incremental_input_entry_reader::get_input_section): Adjust size of
5267 data for incremental input file entry.
5268 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5269 (Incremental_input_entry_reader::get_comdat_group_signature): New
5270 function.
5271 * object.cc (Sized_relobj::include_section_group): Report kept
5272 COMDAT groups for incremental links.
5273
1706a06f
ILT
52742011-05-24 David Meyer <pdox@google.com>
5275
5276 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5277 with name parameter. Add found_name parameter.
5278 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5279 * dirsearch.h (class Dirsearch): Update declaration.
5280
a10ae760
ILT
52812011-05-24 Ian Lance Taylor <iant@google.com>
5282
5283 * archive.cc (Library_base::should_include_member): Pull in object
5284 from archive if it defines the entry symbol.
5285 * parameters.cc (Parameters::entry): New function.
5286 * parameters.h (class Parameters): Declare entry.
5287 * output.h (class Output_file_header): Remove entry_ field.
5288 * output.cc (Output_file_header::Output_file_header): Remove entry
5289 parameter. Change all callers.
5290 (Output_file_header::entry): Use parameters->entry.
5291 * gold.cc (queue_middle_tasks): Likewise.
5292 * plugin.cc (Plugin_hook::run): Likewise.
5293
aa92d6ed
CC
52942011-05-24 Cary Coutant <ccoutant@google.com>
5295
5296 * gold.cc (queue_initial_tasks): Pass incremental base filename
5297 to Output_file::open_base_file; don't print error message.
5298 * incremental-dump.cc (main): Adjust call to
5299 Output_file::open_for_modification.
5300 * incremental-dump.cc (main): Likewise.
5301 * incremental.cc (Incremental_inputs::report_command_line):
5302 Ignore --incremental-base option when comparing command lines.
5303 Ignore parameter when given as separate argument.
5304 * options.h (class General_options): Add --incremental-base.
5305 * output.cc (Output_file::Output_file):
5306 (Output_file::open_base_file): Add base_name and writable parameters;
5307 read base file into new file; print error message here.
5308 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5309 callers.
5310 * output.h (Output_file::open_for_modification): Rename to...
5311 (Output_file::open_base_file): ...this; add base_name and
5312 writable parameters; adjust all callers.
5313 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5314 callers.
5315 * testsuite/Makefile.am (incremental_test_4): Test
5316 --incremental-base.
5317 * testsuite/Makefile.in: Regenerate.
5318
2eedd706
CC
53192011-05-24 Cary Coutant <ccoutant@google.com>
5320
5321 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5322 incremental_test_4.
5323 * testsuite/Makefile.in: Regenerate.
5324 * testsuite/two_file_test_1_v1.cc: New test source file.
5325 * testsuite/two_file_test_1b_v1.cc: New test source file.
5326 * testsuite/two_file_test_2_v1.cc: New test source file.
5327
0f1c85a6
CC
53282011-05-24 Cary Coutant <ccoutant@google.com>
5329
5330 * dynobj.h (Dynobj::do_dynobj): New function.
5331 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5332 flag and soname for shared objects.
5333 * incremental.cc (Incremental_inputs::report_object): Make
5334 either Incremental_object_entry or Incremental_dynobj_entry; add
5335 soname to string table.
5336 (Incremental_inputs::report_input_section): Add assertion.
5337 (Output_section_incremental_inputs::set_final_data_size): Adjust
5338 type of input file entry for shared libraries; adjust size of
5339 shared library info entry.
5340 (Output_section_incremental_inputs::write_input_files): Write
5341 as_needed flag for shared libraries.
5342 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5343 of input file entry for shared libraries; write soname.
5344 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5345 soname from incremental info.
5346 * incremental.h (enum Incremental_input_flags): Add
5347 INCREMENTAL_INPUT_AS_NEEDED.
5348 (Incremental_input_entry::Incremental_input_entry): Initialize new
5349 data member.
5350 (Incremental_input_entry::set_as_needed): New function.
5351 (Incremental_input_entry::as_needed): New function.
5352 (Incremental_input_entry::do_dynobj_entry): New function.
5353 (Incremental_input_entry::as_needed_): New data member.
5354 (Incremental_object_entry::Incremental_object_entry): Don't check
5355 for shared library.
5356 (Incremental_object_entry::do_type): Likewise.
5357 (class Incremental_dynobj_entry): New class.
5358 (Incremental_input_entry_reader::as_needed): New function.
5359 (Incremental_input_entry_reader::get_soname): New function.
5360 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5361 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5362 size of shared library info entry.
58797674 5363 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5364 incremental link when adding DT_NEEDED entries.
5365 * object.h (Object::Object): Initialize new data member.
5366 (Object::dynobj): New function.
5367 (Object::set_as_needed): New function.
5368 (Object::as_needed): New function.
5369 (Object::do_dynobj): New function.
5370 (Object::as_needed_): New data member.
5371
6fa2a40b
CC
53722011-05-24 Cary Coutant <ccoutant@google.com>
5373
5374 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5375 info; adjust display of GOT entries.
5376 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5377 vector of input objects; remove file_status_.
5378 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5379 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5380 got_plt reader; call target hooks to reserve GOT entries.
5381 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5382 of input file info header and GOT info entry.
5383 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5384 relocation info.
5385 (Got_plt_view_info::got_descriptor): Remove.
5386 (Got_plt_view_info::sym_index): New data member.
5387 (Got_plt_view_info::input_index): New data member.
5388 (Local_got_offset_visitor::visit): Write input file index.
5389 (Global_got_offset_visitor::visit): Write 0 for input file index.
5390 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5391 with sym_index and input_index.
5392 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5393 incremental info GOT entry; replace got_descriptor with input_index.
5394 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5395 map from input file index to object.
5396 (Sized_relobj_incr::do_layout): Replace direct data member reference
5397 with accessor function.
5398 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5399 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5400 Adjust size of input file info header.
5401 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5402 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5403 (Incremental_input_entry_reader::get_input_section): Adjust size of
5404 input file info header.
5405 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5406 of incremental info GOT entry.
5407 (Incremental_got_plt_reader::get_got_desc): Remove.
5408 (Incremental_got_plt_reader::get_got_symndx): New function.
5409 (Incremental_got_plt_reader::get_got_input_index): New function.
5410 (Sized_incremental_binary::Sized_incremental_binary): Remove
5411 file_status_; add input_objects_.
5412 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5413 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5414 (Sized_incremental_binary::file_is_unchanged): Remove.
5415 (Sized_incremental_binary::set_input_object): New function.
5416 (Sized_incremental_binary::input_object): New function.
5417 (Sized_incremental_binary::file_status_): Remove.
5418 (Sized_incremental_binary::input_objects_): New data member.
5419 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5420 references.
5421 (Sized_relobj_incr::invalid_address): Move to base class.
5422 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5423 class.
5424 (Sized_relobj_incr::do_output_section_offset): Likewise.
5425 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5426 (Sized_relobj_incr::section_offsets_): Likewise.
5427 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5428 function.
5429 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5430 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5431 with accessor function.
5432 (Sized_relobj_file::do_layout): Likewise.
5433 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5434 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5435 (Sized_relobj_file::compute_final_local_value): Replace refs to
5436 section_offsets_ with accessor function.
5437 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5438 * object.h (Relobj::Relobj): Initialize new data members.
5439 (Relobj::add_dyn_reloc): New function.
5440 (Relobj::first_dyn_reloc): New function.
5441 (Relobj::dyn_reloc_count): New function.
5442 (Relobj::first_dyn_reloc_): New data member.
5443 (Relobj::dyn_reloc_count_): New data member.
5444 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5445 references.
5446 (Sized_relobj::Address): New typedef.
5447 (Sized_relobj::invalid_address): Move here from child class.
5448 (Sized_relobj::Sized_relobj): Initialize new data members.
5449 (Sized_relobj::sized_relobj): New function.
5450 (Sized_relobj::is_output_section_offset_invalid): Move here from
5451 child class.
5452 (Sized_relobj::get_output_section_offset): Likewise.
5453 (Sized_relobj::local_has_got_offset): Likewise.
5454 (Sized_relobj::local_got_offset): Likewise.
5455 (Sized_relobj::set_local_got_offset): Likewise.
5456 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5457 (Sized_relobj::clear_got_offsets): New function.
5458 (Sized_relobj::section_offsets): Move here from child class.
5459 (Sized_relobj::do_output_section_offset): Likewise.
5460 (Sized_relobj::do_set_section_offset): Likewise.
5461 (Sized_relobj::Local_got_offsets): Likewise.
5462 (Sized_relobj::local_got_offsets_): Likewise.
5463 (Sized_relobj::section_offsets_): Likewise.
5464 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5465 references.
5466 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5467 class.
5468 (Sized_relobj_file::sized_relobj): New function
5469 (Sized_relobj_file::local_has_got_offset): Move to base class.
5470 (Sized_relobj_file::local_got_offset): Likewise.
5471 (Sized_relobj_file::set_local_got_offset): Likewise.
5472 (Sized_relobj_file::get_output_section_offset): Likewise.
5473 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5474 (Sized_relobj_file::do_output_section_offset): Likewise.
5475 (Sized_relobj_file::do_set_section_offset): Likewise.
5476 (Sized_relobj_file::Local_got_offsets): Likewise.
5477 (Sized_relobj_file::local_got_offsets_): Likewise.
5478 (Sized_relobj_file::section_offsets_): Likewise.
5479 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5480 (all constructors).
5481 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5482 (Output_reloc::get_symbol_index): Likewise.
5483 (Output_reloc::local_section_offset): Likewise.
5484 (Output_reloc::get_address): Likewise.
5485 (Output_reloc::symbol_value): Likewise.
5486 (Output_data_got::reserve_slot): Move to class definition.
5487 (Output_data_got::reserve_local): New function.
5488 (Output_data_got::reserve_slot_for_global): Remove.
5489 (Output_data_got::reserve_global): New function.
5490 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5491 (all constructors, two instantiations).
5492 (Output_reloc::get_relobj): New function (two instantiations).
5493 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5494 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5495 (Output_data_reloc::add_global): Adjust type of relobj.
5496 (Output_data_reloc::add_global_relative): Likewise.
5497 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5498 (Output_data_reloc::add_local): Likewise.
5499 (Output_data_reloc::add_local_relative): Likewise.
5500 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5501 (Output_data_reloc::add_local_section): Likewise.
5502 (Output_data_reloc::add_output_section): Likewise.
5503 (Output_data_reloc::add_absolute): Likewise.
5504 (Output_data_reloc::add_target_specific): Likewise.
5505 (Output_data_got::reserve_slot): Move definition here.
5506 (Output_data_got::reserve_local): New function.
5507 (Output_data_got::reserve_global): New function.
5508 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5509 section_offsets_ with accessor function.
5510 (Sized_relobj_file::write_sections): Likewise.
5511 (Sized_relobj_file::do_relocate_sections): Likewise.
5512 * target.h (Sized_target::reserve_local_got_entry): New function.
5513 (Sized_target::reserve_global_got_entry): New function.
5514 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5515 (Target_x86_64::reserve_global_got_entry): New function.
5516 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5517
4829d394
CC
55182011-05-23 Cary Coutant <ccoutant@google.com>
5519
5520 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5521 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5522 bit when checking got_type.
5523 * incremental.cc (Sized_incremental_binary::setup_readers):
5524 Store symbol table and string table locations; initialize bit vector
5525 of file status flags.
5526 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5527 unchanged files.
5528 (Sized_incremental_binary::do_process_got_plt): New function.
5529 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5530 (Output_section_incremental_inputs::set_final_data_size): Record
5531 file index for each input file.
5532 (Output_section_incremental_inputs::write_got_plt): Store file index
5533 instead of input entry offset for each GOT entry.
5534 * incremental.h
5535 (Incremental_input_entry::Incremental_input_entry): Initialize new
5536 data member.
5537 (Incremental_input_entry::set_offset): Store file index.
5538 (Incremental_input_entry::get_file_index): New function.
5539 (Incremental_input_entry::file_index_): New data member.
5540 (Incremental_binary::process_got_plt): New function.
5541 (Incremental_binary::do_process_got_plt): New function.
5542 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5543 data members.
5544 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5545 (Sized_incremental_binary::set_file_is_unchanged): New function.
5546 (Sized_incremental_binary::file_is_unchanged): New function.
5547 (Sized_incremental_binary::do_process_got_plt): New function.
5548 (Sized_incremental_binary::file_status_): New data member.
5549 (Sized_incremental_binary::main_symtab_loc_): New data member.
5550 (Sized_incremental_binary::main_strtab_loc_): New data member.
5551 * output.cc (Output_data_got::Got_entry::write): Add case
5552 RESERVED_CODE.
5553 (Output_data_got::add_global): Call add_got_entry.
5554 (Output_data_got::add_global_plt): Likewise.
5555 (Output_data_got::add_global_with_rel): Likewise.
5556 (Output_data_got::add_global_with_rela): Likewise.
5557 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5558 (Output_data_got::add_global_pair_with_rela): Likewise.
5559 (Output_data_got::add_local): Call add_got_entry.
5560 (Output_data_got::add_local_plt): Likewise.
5561 (Output_data_got::add_local_with_rel): Likewise.
5562 (Output_data_got::add_local_with_rela): Likewise.
5563 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5564 (Output_data_got::add_local_pair_with_rela): Likewise.
5565 (Output_data_got::reserve_slot): New function.
5566 (Output_data_got::reserve_slot_for_global): New function.
5567 (Output_data_got::add_got_entry): New function.
5568 (Output_data_got::add_got_entry_pair): New function.
5569 (Output_section::add_output_section_data): Edit FIXME.
5570 * output.h
5571 (Output_section_data_build::Output_section_data_build): New
5572 constructor with size parameter.
5573 (Output_data_space::Output_data_space): Likewise.
5574 (Output_data_got::Output_data_got): Initialize new data member; new
5575 constructor with size parameter.
5576 (Output_data_got::add_constant): Call add_got_entry.
5577 (Output_data_got::reserve_slot): New function.
5578 (Output_data_got::reserve_slot_for_global): New function.
5579 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5580 (Output_data_got::add_got_entry): New function.
5581 (Output_data_got::add_got_entry_pair): New function.
5582 (Output_data_got::free_list_): New data member.
5583 * target.h (Sized_target::init_got_plt_for_update): New function.
5584 (Sized_target::register_global_plt_entry): New function.
5585 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5586 Initialize new data member; call init; add constructor with PLT count.
5587 (Output_data_plt_x86_64::init): New function.
5588 (Output_data_plt_x86_64::add_relocation): New function.
5589 (Output_data_plt_x86_64::reserve_slot): New function.
5590 (Output_data_plt_x86_64::free_list_): New data member.
5591 (Target_x86_64::init_got_plt_for_update): New function.
5592 (Target_x86_64::register_global_plt_entry): New function.
5593 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5594 incremental updates.
5595 (Output_data_plt_x86_64::add_relocation): New function.
5596 * testsuite/object_unittest.cc (Object_test): Set default options.
5597
ec69d6da
ILT
55982011-05-16 Ian Lance Taylor <iant@google.com>
5599
5600 * options.h (class General_options): Make -i a synonym for -r.
5601
732e31de
ILT
56022011-05-16 Ian Lance Taylor <iant@google.com>
5603
5604 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5605
403676b5
CC
56062011-05-10 Cary Coutant <ccoutant@google.com>
5607
5608 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5609 strip_all (-s).
5610
5b7b7d6e
ILT
56112011-05-06 Ian Lance Taylor <iant@google.com>
5612
5613 * layout.cc (Layout::layout): If the output section flags change,
5614 update the ordering.
5615
f0f9babf
CC
56162011-04-25 Cary Coutant <ccoutant@google.com>
5617
5618 * incremental-dump.cc (dump_incremental_inputs): Print local
5619 symbol info for each input file.
5620 * incremental.cc
5621 (Output_section_incremental_inputs::set_final_data_size): Add local
5622 symbol info to input file entries in incremental info.
5623 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5624 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5625 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5626 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5627 implementation.
5628 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5629 (Sized_incr_relobj::do_relocate): Write the local symbols.
5630 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5631 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5632 Adjust size of input file header.
5633 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5634 (Incremental_inputs_reader::get_local_symbol_count): New function.
5635 (Incremental_inputs_reader::get_input_section): Adjust size of input
5636 file header.
5637 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5638 (Sized_incr_relobj::This): New typedef.
5639 (Sized_incr_relobj::sym_size): New const data member.
5640 (Sized_incr_relobj::Local_symbol): New struct.
5641 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5642 (Sized_incr_relobj::do_local_symbol_offset): New function.
5643 (Sized_incr_relobj::local_symbol_count_): New data member.
5644 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5645 (Sized_incr_relobj::local_symbol_index_): New data member.
5646 (Sized_incr_relobj::local_symbol_offset_): New data member.
5647 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5648 (Sized_incr_relobj::local_symbols_): New data member.
5649 * object.h (Relobj::output_local_symbol_count): New function.
5650 (Relobj::local_symbol_offset): New function.
5651 (Relobj::do_output_local_symbol_count): New function.
5652 (Relobj::do_local_symbol_offset): New function.
5653 (Sized_relobj::do_output_local_symbol_count): New function.
5654 (Sized_relobj::do_local_symbol_offset): New function.
5655
d0a9ace3
ILT
56562011-04-22 Vladimir Simonov <sv@sw.ru>
5657
5658 * descriptors.cc (set_close_on_exec): New function.
5659 (Descriptors::open): Use set_close_on_exec.
5660 * output.cc (S_ISLNK): Define if not defined.
5661
94a3fc8b
CC
56622011-04-22 Cary Coutant <ccoutant@google.com>
5663
5664 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5665 global symbol map.
5666 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5667 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5668 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5669 relocations.
5670 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5671 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5672 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5673 * incremental.h
5674 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5675 function.
5676 (Incremental_binary::apply_incremental_relocs): New function.
5677 (Incremental_binary::do_apply_incremental_relocs): New function.
5678 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5679 data member.
5680 (Sized_incremental_binary::add_global_symbol): New function.
5681 (Sized_incremental_binary::global_symbol): New function.
5682 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5683 (Sized_incremental_binary::symbol_map_): New data member.
5684 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5685 * target.h (Sized_target::apply_relocation): New function.
5686 * target-reloc.h (apply_relocation): New function.
5687 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5688
c87e4302
DK
56892011-04-22 Doug Kwan <dougkwan@google.com>
5690
5691 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5692 flag of a SHT_ARM_EXIDX section.
2e702c99 5693 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
5694 * testsuite/Makefile.in: Regenerate.
5695 * testsuite/arm_exidx_test.s: New file.
5696 * testsuite/arm_exidx_test.sh: Same.
5697
e7782cf6
CC
56982011-04-20 Cary Coutant <ccoutant@google.com>
5699
5700 PR gold/12689
5701 * archive.h (Incremental_archive_entry::Archive_member):
5702 Initialize arg_serial_ (second constructor).
5703
308ecdc7
ILT
57042011-04-17 Ian Lance Taylor <iant@google.com>
5705
5706 * object.cc (Relocate_info::location): Simplify location string.
5707 * errors.cc (Errors::error_at_location): Don't print program
5708 name.
5709 (Errors::warning_at_location): Likewise.
5710 (Errors::undefined_symbol): Likewise.
5711 * testsuite/debug_msg.sh: Update accordingly.
5712
bec5b579
CC
57132011-04-14 Cary Coutant <ccoutant@google.com>
5714
5715 * gold/layout.cc (Layout::symtab_section_offset): New function.
5716 * gold/layout.h (Layout::symtab_section_offset): New function.
5717 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5718
88597d34
ILT
57192011-04-12 Ian Lance Taylor <iant@google.com>
5720
5721 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5722 with MREMAP_MAYMOVE.
5723 * output.h (class Output_file): Add map_is_allocated_ field.
5724 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5725 not available, provide stubs. If mremap is not available, #define
5726 it to gold_mremap.
5727 (MREMAP_MAYMOVE): Define if not defined.
5728 (Output_file::Output_file): Initialize map_is_allocated_.
5729 (Output_file::resize): Check map_is_allocated_.
5730 (Output_file::map_anonymous): If mmap fails, use malloc.
5731 (Output_file::unmap): Don't do anything for an anonymous map.
5732 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5733 is not available, provide stubs.
5734 (File_read::View::~View): Use free rather than delete[].
5735 (File_read::make_view): Use malloc rather than new[]. If mmap
5736 fails, use malloc.
5737 (File_read::find_or_make_view): Use malloc rather than new[].
5738 * gold.h: Remove HAVE_REMAP code.
5739 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5740 exists. Rename mremap to gold_mremap. If mmap is not available
5741 don't do anything.
5742 * configure, config.in: Rebuild.
5743
11e361bc
ILT
57442011-04-11 Ian Lance Taylor <iant@google.com>
5745
5746 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5747 initialize local variable v.
5748
cdc29364
CC
57492011-04-11 Cary Coutant <ccoutant@google.com>
5750
5751 * archive.cc (Archive::include_member): Adjust call to
5752 report_object.
5753 (Add_archive_symbols::run): Track argument serial numbers.
5754 (Lib_group::include_member): Likewise.
5755 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5756 * archive.h (Incremental_archive_entry::Archive_member):
5757 Initialize arg_serial_.
5758 (Archive_member::arg_serial_): New data member.
5759 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5760 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5761 incremental link.
5762 (Sized_dynobj::do_for_all_local_got_entries): New function.
5763 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5764 function.
5765 * fileread.cc (get_mtime): New function.
5766 * fileread.h (get_mtime): New function.
5767 * gold.cc (queue_initial_tasks): Check for incremental update.
5768 (process_incremental_input): New function.
5769 (queue_middle_tasks): Don't force valid target for incremental
5770 update.
5771 * incremental-dump.cc (find_input_containing_global): Adjust
5772 size of symbol info entry.
5773 (dump_incremental_inputs): Dump argument serial number and
5774 in_system_directory flag; bias shndx by 1; print symbol names
5775 when dumping per-file symbol lists; use new symbol info readers.
5776 * incremental.cc
5777 (Output_section_incremental_inputs:update_data_size): New function.
5778 (Sized_incremental_binary::setup_readers): Setup input readers
5779 for each input file; build maps for files added from libraries
5780 and scripts.
5781 (Sized_incremental_binary::check_input_args): New function.
5782 (Sized_incremental_binary::do_check_inputs): Build map of argument
5783 serial numbers to input arguments.
5784 (Sized_incremental_binary::do_file_has_changed): Rename
5785 do_file_is_unchanged to this; compare file modification times.
5786 (Sized_incremental_binary::do_init_layout): New function.
5787 (Sized_incremental_binary::do_reserve_layout): New function.
5788 (Sized_incremental_binary::do_get_input_reader): Remove.
5789 (Sized_incremental_binary::get_symtab_view): New function.
5790 (Incremental_checker::can_incrementally_link_output_file): Remove.
5791 (Incremental_inputs::report_command_line): Exclude --debug options.
5792 (Incremental_inputs::report_archive_begin): Add parameter; track
5793 argument serial numbers; don't put input file entry for archive
5794 before archive members.
5795 (Incremental_inputs::report_archive_end): Put input file entry
5796 for archive after archive members.
5797 (Incremental_inputs::report_object): Add parameter; track argument
5798 serial numbers and in_system_directory flag.
5799 (Incremental_inputs::report_script): Add parameter; track argument
5800 serial numbers.
5801 (Output_section_incremental_inputs::set_final_data_size): Adjust
5802 size of symbol info entry; check for forwarding symbols.
5803 (Output_section_incremental_inputs::write_input_files): Write
5804 in_system_directory flag and argument serial number.
5805 (Output_section_incremental_inputs::write_info_blocks): Map section
5806 indices between incremental info and original input file; store
5807 input section index for each symbol.
5808 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5809 change operator() to visit().
5810 (class Global_got_offset_visitor): Likewise.
5811 (class Global_symbol_visitor_got_plt):
5812 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5813 classes.
5814 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5815 (Sized_incr_relobj::do_read_symbols): New function.
5816 (Sized_incr_relobj::do_layout): New function.
5817 (Sized_incr_relobj::do_layout_deferred_sections): New function.
5818 (Sized_incr_relobj::do_add_symbols): New function.
5819 (Sized_incr_relobj::do_should_include_member): New function.
5820 (Sized_incr_relobj::do_for_all_global_symbols): New function.
5821 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
5822 (Sized_incr_relobj::do_section_size): New function.
5823 (Sized_incr_relobj::do_section_name): New function.
5824 (Sized_incr_relobj::do_section_contents): New function.
5825 (Sized_incr_relobj::do_section_flags): New function.
5826 (Sized_incr_relobj::do_section_entsize): New function.
5827 (Sized_incr_relobj::do_section_address): New function.
5828 (Sized_incr_relobj::do_section_type): New function.
5829 (Sized_incr_relobj::do_section_link): New function.
5830 (Sized_incr_relobj::do_section_info): New function.
5831 (Sized_incr_relobj::do_section_addralign): New function.
5832 (Sized_incr_relobj::do_initialize_xindex): New function.
5833 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
5834 (Sized_incr_relobj::do_read_relocs): New function.
5835 (Sized_incr_relobj::do_gc_process_relocs): New function.
5836 (Sized_incr_relobj::do_scan_relocs): New function.
5837 (Sized_incr_relobj::do_count_local_symbols): New function.
5838 (Sized_incr_relobj::do_finalize_local_symbols): New function.
5839 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
5840 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
5841 (Sized_incr_relobj::do_relocate): New function.
5842 (Sized_incr_relobj::do_set_section_offset): New function.
5843 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
5844 (Sized_incr_dynobj::do_read_symbols): New function.
5845 (Sized_incr_dynobj::do_layout): New function.
5846 (Sized_incr_dynobj::do_add_symbols): New function.
5847 (Sized_incr_dynobj::do_should_include_member): New function.
5848 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
5849 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
5850 (Sized_incr_dynobj::do_section_size): New function.
5851 (Sized_incr_dynobj::do_section_name): New function.
5852 (Sized_incr_dynobj::do_section_contents): New function.
5853 (Sized_incr_dynobj::do_section_flags): New function.
5854 (Sized_incr_dynobj::do_section_entsize): New function.
5855 (Sized_incr_dynobj::do_section_address): New function.
5856 (Sized_incr_dynobj::do_section_type): New function.
5857 (Sized_incr_dynobj::do_section_link): New function.
5858 (Sized_incr_dynobj::do_section_info): New function.
5859 (Sized_incr_dynobj::do_section_addralign): New function.
5860 (Sized_incr_dynobj::do_initialize_xindex): New function.
5861 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
5862 (make_sized_incremental_object): New function.
5863 (Incremental_library::copy_unused_symbols): New function.
5864 (Incremental_library::do_for_all_unused_symbols): New function.
5865 * incremental.h (enum Incremental_input_flags): New type.
5866 (class Incremental_checker): Remove.
5867 (Incremental_input_entry::Incremental_input_entry): Add argument
5868 serial number.
5869 (Incremental_input_entry::arg_serial): New function.
5870 (Incremental_input_entry::set_is_in_system_directory): New function.
5871 (Incremental_input_entry::is_in_system_directory): New function.
5872 (Incremental_input_entry::arg_serial_): New data member.
5873 (Incremental_input_entry::is_in_system_directory_): New data member.
5874 (class Script_info): Move here from script.h.
5875 (Script_info::Script_info): Add filename parameter.
5876 (Script_info::filename): New function.
5877 (Script_info::filename_): New data member.
5878 (Incremental_script_entry::Incremental_script_entry): Add argument
5879 serial number.
5880 (Incremental_object_entry::Incremental_object_entry): Likewise.
5881 (Incremental_object_entry::add_input_section): Build list of input
5882 sections with map to original shndx.
5883 (Incremental_object_entry::get_input_section_index): New function.
5884 (Incremental_object_entry::shndx_): New data member.
5885 (Incremental_object_entry::name_key_): Rename; adjust all refs.
5886 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
5887 (Incremental_archive_entry::Incremental_archive_entry): Add argument
5888 serial number.
5889 (Incremental_inputs::report_archive_begin): Likewise.
5890 (Incremental_inputs::report_object): Likewise.
5891 (Incremental_inputs::report_script): Likewise.
5892 (class Incremental_global_symbol_reader): New class.
5893 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
5894 and store flags and input file type.
5895 (Incremental_input_entry_reader::arg_serial): New function.
5896 (Incremental_input_entry_reader::type): Extract type from flags.
5897 (Incremental_input_entry_reader::is_in_system_directory): New function.
5898 (Incremental_input_entry_reader::get_input_section_count): Call
5899 accessor function for type.
5900 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
5901 function for type; adjust size of global symbol entry.
5902 (Incremental_input_entry_reader::get_global_symbol_count): Call
5903 accessor function for type.
5904 (Incremental_input_entry_reader::get_object_count): Likewise.
5905 (Incremental_input_entry_reader::get_object_offset): Likewise.
5906 (Incremental_input_entry_reader::get_member_count): Likewise.
5907 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
5908 (Incremental_input_entry_reader::get_member_offset): Likewise.
5909 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
5910 (Incremental_input_entry_reader::Global_symbol_info): Remove.
5911 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
5912 (Incremental_input_entry_reader::get_global_symbol_reader): New
5913 function.
5914 (Incremental_input_entry_reader::get_output_symbol_index): New
5915 function.
5916 (Incremental_input_entry_reader::type_): Remove.
5917 (Incremental_input_entry_reader::flags_): New data member.
5918 (Incremental_inputs_reader::input_file_offset): New function.
5919 (Incremental_inputs_reader::input_file_index): New function.
5920 (Incremental_inputs_reader::input_file): Call input_file_offset.
5921 (Incremental_inputs_reader::input_file_at_offset): New function.
5922 (Incremental_relocs_reader::get_r_type): Reformat.
5923 (Incremental_relocs_reader::get_r_shndx): Reformat.
5924 (Incremental_relocs_reader::get_r_offset): Reformat.
5925 (Incremental_relocs_reader::data): New function.
5926 (Incremental_binary::Incremental_binary): Initialize new data members.
5927 (Incremental_binary::check_inputs): Add cmdline parameter.
5928 (Incremental_binary::file_is_unchanged): Remove.
5929 (Input_reader::arg_serial): New function.
5930 (Input_reader::get_unused_symbol_count): New function.
5931 (Input_reader::get_unused_symbol): New function.
5932 (Input_reader::do_arg_serial): New function.
5933 (Input_reader::do_get_unused_symbol_count): New function.
5934 (Input_reader::do_get_unused_symbol): New function.
5935 (Incremental_binary::input_file_count): New function.
5936 (Incremental_binary::get_input_reader): Change signature to use
5937 index instead of filename.
5938 (Incremental_binary::file_has_changed): New function.
5939 (Incremental_binary::get_input_argument): New function.
5940 (Incremental_binary::get_library): New function.
5941 (Incremental_binary::get_script_info): New function.
5942 (Incremental_binary::init_layout): New function.
5943 (Incremental_binary::reserve_layout): New function.
5944 (Incremental_binary::output_file): New function.
5945 (Incremental_binary::do_check_inputs): New function.
5946 (Incremental_binary::do_file_is_unchanged): Remove.
5947 (Incremental_binary::do_file_has_changed): New function.
5948 (Incremental_binary::do_init_layout): New function.
5949 (Incremental_binary::do_reserve_layout): New function.
5950 (Incremental_binary::do_input_file_count): New function.
5951 (Incremental_binary::do_get_input_reader): Change signature.
5952 (Incremental_binary::input_args_map_): New data member.
5953 (Incremental_binary::library_map_): New data member.
5954 (Incremental_binary::script_map_): New data member.
5955 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5956 new data members.
5957 (Sized_incremental_binary::output_section): New function.
5958 (Sized_incremental_binary::inputs_reader): Add const.
5959 (Sized_incremental_binary::symtab_reader): Add const.
5960 (Sized_incremental_binary::relocs_reader): Add const.
5961 (Sized_incremental_binary::got_plt_reader): Add const.
5962 (Sized_incremental_binary::get_symtab_view): New function.
5963 (Sized_incremental_binary::Inputs_reader): New typedef.
5964 (Sized_incremental_binary::Input_entry_reader): New typedef.
5965 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
5966 (Sized_incremental_binary::do_file_is_unchanged): Remove.
5967 (Sized_incremental_binary::do_file_has_changed): New function.
5968 (Sized_incremental_binary::do_init_layout): New function.
5969 (Sized_incremental_binary::do_reserve_layout): New function.
5970 (Sized_input_reader::Inputs_reader): Remove.
5971 (Sized_input_reader::Input_entry_reader): Remove.
5972 (Sized_input_reader::do_arg_serial): New function.
5973 (Sized_input_reader::do_get_unused_symbol_count): New function.
5974 (Sized_input_reader::do_get_unused_symbol): New function.
5975 (Sized_incremental_binary::do_input_file_count): New function.
5976 (Sized_incremental_binary::do_get_input_reader): Change signature;
5977 use index instead of filename.
5978 (Sized_incremental_binary::section_map_): New data member.
5979 (Sized_incremental_binary::input_entry_readers_): New data member.
5980 (class Sized_incr_relobj): New class.
5981 (class Sized_incr_dynobj): New class.
5982 (make_sized_incremental_object): New function.
5983 (class Incremental_library): New class.
5984 * layout.cc (Free_list::num_lists): New static data member.
5985 (Free_list::num_nodes): New static data member.
5986 (Free_list::num_removes): New static data member.
5987 (Free_list::num_remove_visits): New static data member.
5988 (Free_list::num_allocates): New static data member.
5989 (Free_list::num_allocate_visits): New static data member.
5990 (Free_list::init): New function.
5991 (Free_list::remove): New function.
5992 (Free_list::allocate): New function.
5993 (Free_list::dump): New function.
5994 (Free_list::print_stats): New function.
5995 (Layout_task_runner::run): Resize output file for incremental updates.
5996 (Layout::Layout): Initialize new data members.
5997 (Layout::set_incremental_base): New function.
5998 (Layout::init_fixed_output_section): New function.
5999 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6000 incremental updates.
6001 (Layout::create_gold_note): Do not create gold note section for
6002 incremental updates.
6003 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6004 for incremental updates.
6005 (Layout::set_section_offsets): For incremental updates, allocate space
6006 from free list.
6007 (Layout::create_symtab_sections): Layout with offsets relative to
6008 start of section; for incremental updates, allocate space from free
6009 list.
6010 (Layout::create_shdrs): For incremental updates, allocate space from
6011 free list.
6012 (Layout::finish_dynamic_section): For incremental updates, do not
6013 check --as-needed (fixed in subsequent patch).
6014 * layout.h (class Free_list): New class.
6015 (Layout::set_incremental_base): New function.
6016 (Layout::incremental_base): New function.
6017 (Layout::init_fixed_output_section): New function.
6018 (Layout::allocate): New function.
6019 (Layout::incremental_base_): New data member.
6020 (Layout::free_list_): New data member.
6021 * main.cc (main): Print Free_list statistics.
6022 * object.cc (Relobj::finalize_incremental_relocs): Add
6023 clear_counts parameter; clear counts only when clear_counts is set.
6024 (Sized_relobj::Sized_relobj): Initialize new base class.
6025 (Sized_relobj::do_layout): Don't report special sections.
6026 (Sized_relobj::do_for_all_local_got_entries): New function.
6027 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6028 symtab_off to all symbol table offsets.
6029 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6030 * object.h (class Got_offset_list): Move to top of file.
6031 (Object::Object): Allow case where input_file == NULL.
6032 (Object::~Object): Likewise.
6033 (Object::input_file): Assert that input_file != NULL.
6034 (Object::lock): Allow case where input_file == NULL.
6035 (Object::unlock): Likewise.
6036 (Object::is_locked): Likewise.
6037 (Object::token): Likewise.
6038 (Object::release): Likewise.
6039 (Object::is_incremental): New function.
6040 (Object::get_mtime): New function.
6041 (Object::for_all_local_got_entries): New function.
6042 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6043 (Object::set_is_in_system_directory): New function.
6044 (Object::is_in_system_directory): New function.
6045 (Object::do_is_incremental): New function.
6046 (Object::do_get_mtime): New function.
6047 (Object::do_for_all_local_got_entries): New function.
6048 (Object::is_in_system_directory_): New data member.
6049 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6050 (class Sized_relobj_base): New class.
6051 (class Sized_relobj): Derive from Sized_relobj_base.
6052 (class Sized_relobj::Symbols): Redeclare from base class.
6053 (class Sized_relobj::local_got_offset_list): Remove.
6054 (class Sized_relobj::Output_sections): Redeclare from base class.
6055 (class Sized_relobj::do_for_all_local_got_entries): New function.
6056 (class Sized_relobj::write_local_symbols): Add offset parameter.
6057 (class Sized_relobj::local_symbol_offset_): Update comment.
6058 (class Sized_relobj::local_dynsym_offset_): Update comment.
6059 * options.cc (Input_arguments::add_file): Remove const.
6060 * options.h (Input_file_argument::Input_file_argument):
6061 Initialize arg_serial_ (all constructors).
6062 (Input_file_argument::set_arg_serial): New function.
6063 (Input_file_argument::arg_serial): New function.
6064 (Input_file_argument::arg_serial_): New data member.
6065 (Input_arguments::Input_arguments): Initialize file_count_.
6066 (Input_arguments::add_file): Remove const.
6067 (Input_arguments::number_of_input_files): New function.
6068 (Input_arguments::file_count_): New data member.
6069 (Command_line::number_of_input_files): Call
6070 Input_arguments::number_of_input_files.
6071 * output.cc (Output_segment_headers::Output_segment_headers):
6072 Set current size.
6073 (Output_section::Input_section::current_data_size): New function.
6074 (Output_section::Output_section): Initialize new data members.
6075 (Output_section::add_input_section): Don't do merge sections for
6076 an incremental link; allocate space from free list for an
6077 incremental update.
6078 (Output_section::add_output_section_data): Allocate space from
6079 free list for an incremental update.
6080 (Output_section::update_data_size): New function.
6081 (Output_section::set_fixed_layout): New function.
6082 (Output_section::reserve): New function.
6083 (Output_segment::set_section_addresses): Remove const.
6084 (Output_segment::set_section_list_addresses): Remove const; allocate
6085 space from free list for an incremental update.
6086 (Output_segment::set_offset): Adjust size of RELRO segment for an
6087 incremental update.
6088 * output.h (Output_data::current_data_size): Move here from
6089 child classes.
6090 (Output_data::pre_finalize_data_size): New function.
6091 (Output_data::update_data_size): New function.
6092 (Output_section_headers::update_data_size): new function.
6093 (Output_section_data_build::current_data_size): Move to Output_data.
6094 (Output_data_strtab::update_data_size): New function.
6095 (Output_section::current_data_size): Move to Output_data.
6096 (Output_section::set_fixed_layout): New function.
6097 (Output_section::has_fixed_layout): New function.
6098 (Output_section::reserve): New function.
6099 (Output_section::update_data_size): New function.
6100 (Output_section::has_fixed_layout_): New data member.
6101 (Output_section::free_list_): New data member.
6102 (Output_segment::set_section_addresses): Remove const.
6103 (Output_segment::set_section_list_addresses): Remove const.
6104 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6105 New function.
6106 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6107 New function.
6108 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6109 parameter when calling Add_symbols constructor; store argument
6110 serial number for members of a lib group.
6111 (Add_symbols::locks): Allow case where token == NULL.
6112 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6113 (Read_member::~Read_member): New function.
6114 (Read_member::is_runnable): New function.
6115 (Read_member::locks): New function.
6116 (Read_member::run): New function.
6117 (Check_script::~Check_script): New function.
6118 (Check_script::is_runnable): New function.
6119 (Check_script::locks): New function.
6120 (Check_script::run): New function.
6121 (Check_library::~Check_library): New function.
6122 (Check_library::is_runnable): New function.
6123 (Check_library::locks): New function.
6124 (Check_library::run): New function.
6125 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6126 (Add_symbols::library_): New data member.
6127 (class Read_member): New class.
6128 (class Check_script): New class.
6129 (class Check_library): New class.
6130 * reloc.cc (Read_relocs::is_runnable): Allow case where
6131 token == NULL.
6132 (Read_relocs::locks): Likewise.
6133 (Scan_relocs::locks): Likewise.
6134 (Relocate_task::locks): Likewise.
6135 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6136 to clear counters.
6137 (Sized_relobj::incremental_relocs_scan): Fix comment.
6138 (Sized_relobj::do_relocate): Pass output file offset to
6139 write_local_symbols.
6140 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6141 from class declaration.
6142 * script.cc (read_input_script): Allocate Script_info; pass
6143 argument serial number to report_script.
6144 * script.h (class Script_info): Move to incremental.h.
6145 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6146 * symtab.h (Symbol_table::add_from_incrobj): New function.
6147 (Symbol_table::set_file_offset): New function.
6148
b961d0d7
CC
61492011-04-05 Cary Coutant <ccoutant@google.com>
6150
6151 * incremental-dump.cc (dump_incremental_inputs): Change signature
6152 to take a Sized_incremental_binary; change caller. Use readers
6153 in Sized_incremental_binary.
6154 * incremental.cc
6155 (Sized_incremental_binary::find_incremental_inputs_sections):
6156 Rename do_find_incremental_inputs_sections to this.
6157 (Sized_incremental_binary::setup_readers): New function.
6158 (Sized_incremental_binary::do_check_inputs): Check
6159 has_incremental_info_ flag; move setup code to setup_readers;
6160 use input readers.
6161 (Sized_incremental_binary::do_file_is_unchanged): New function.
6162 (Sized_incremental_binary::do_get_input_reader): New function.
6163 * incremental.h (class Incremental_binary): Move to end of file.
6164 (Incremental_binary::file_is_unchanged): New function.
6165 (Incremental_binary::do_file_is_unchanged): New function.
6166 (Incremental_binary::Input_reader): New class.
6167 (Incremental_binary::get_input_reader): New function.
6168 (class Sized_incremental_binary): Move to end of file.
6169 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6170 input section reader classes.
6171 (Sized_incremental_binary::has_incremental_info): New function.
6172 (Sized_incremental_binary::inputs_reader): New function.
6173 (Sized_incremental_binary::symtab_reader): New function.
6174 (Sized_incremental_binary::relocs_reader): New function.
6175 (Sized_incremental_binary::got_plt_reader): New function.
6176 (Sized_incremental_binary::do_file_is_unchanged): New function.
6177 (Sized_incremental_binary::Sized_input_reader): New class.
6178 (Sized_incremental_binary::get_input_reader): New function.
6179 (Sized_incremental_binary::find_incremental_inputs_sections):
6180 Rename do_find_incremental_inputs_sections to this.
6181 (Sized_incremental_binary::setup_readers): New function.
6182 (Sized_incremental_binary::has_incremental_info_): New data member.
6183 (Sized_incremental_binary::inputs_reader_): New data member.
6184 (Sized_incremental_binary::symtab_reader_): New data member.
6185 (Sized_incremental_binary::relocs_reader_): New data member.
6186 (Sized_incremental_binary::got_plt_reader_): New data member.
6187 (Sized_incremental_binary::current_input_file_): New data member.
6188
a869183f
PP
61892011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6190
6191 PR gold/12640
6192 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6193 violation.
6194
61952011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6196
6197 * archive.cc (Archive::include_member): Adjust call to report_object.
6198 (Add_archive_symbols::run): Add script_info to call to
6199 report_archive_begin.
6200 (Lib_group::include_member): Adjust call to report_object.
6201 (Add_lib_group_symbols::run): Adjust call to report_object.
6202 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6203 blocks. Add object count for script input files.
6204 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6205 script_info parameter; change all callers.
6206 (Incremental_inputs::report_object): Add script_info parameter;
6207 change all callers.
6208 (Incremental_inputs::report_script): Store backpointer to
6209 incremental info entry.
6210 (Output_section_incremental_inputs::set_final_data_size): Record
6211 additional information for scripts.
6212 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6213 * incremental.h (Incremental_script_entry::add_object): New function.
6214 (Incremental_script_entry::get_object_count): New function.
6215 (Incremental_script_entry::get_object): New function.
6216 (Incremental_script_entry::objects_): New data member; adjust
6217 constructor.
6218 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6219 (Incremental_inputs::report_object): Add script_info parameter.
6220 (Incremental_inputs_reader::get_object_count): New function.
6221 (Incremental_inputs_reader::get_object_offset): New function.
6222 * options.cc (Input_arguments::add_file): Return reference to
6223 new input argument.
6224 * options.h (Input_argument::set_script_info): New function.
6225 (Input_argument::script_info): New function.
6226 (Input_argument::script_info_): New data member; adjust all
6227 constructors.
6228 (Input_file_group::add_file): Return reference to new input argument.
6229 (Input_file_lib::add_file): Likewise.
6230 (Input_arguments::add_file): Likewise.
6231 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6232 * script.cc (Parser_closure::Parser_closure): Add script_info
6233 parameter; adjust all callers.
6234 (Parser_closure::script_info): New function.
6235 (Parser_closure::script_info_): New data member.
6236 (read_input_script): Report scripts earlier to incremental info.
6237 (script_add_file): Set script_info in Input_argument.
6238 (script_add_library): Likewise.
6239 * script.h (Script_options::Script_info): Rewrite class.
6240
a869183f 62412011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6242
6243 * archive.cc (Library_base::should_include_member): Move
6244 method here from class Archive.
6245 (Archive::Archive): Initialize base class.
6246 (Archive::should_include_member): Move to base class.
6247 (Archive::do_for_all_unused_symbols): New function.
6248 (Add_archive_symbols::run): Remove redundant access to
6249 incremental_inputs.
6250 (Lib_group::Lib_group): Initialize base class.
6251 (Lib_group::do_filename): New function.
6252 (Lib_group::include_member): Pass pointer to Lib_group to
6253 report_object.
6254 (Lib_group::do_for_all_unused_symbols): New function.
6255 (Add_lib_group_symbols::run): Report archive information for
6256 incremental links.
6257 * archive.h (class Library_base): New base class.
6258 (class Archive): Derive from Library_base.
6259 (Archive::filename): Move to base class.
6260 (Archive::set_incremental_info): Likewise.
6261 (Archive::incremental_info): Likewise.
6262 (Archive::Should_include): Likewise.
6263 (Archive::should_include_member): Likewise.
6264 (Archive::Armap_entry): Remove.
6265 (Archive::Unused_symbol_iterator): Remove.
6266 (Archive::unused_symbols_begin): Remove.
6267 (Archive::unused_symbols_end): Remove.
6268 (Archive::do_filename): New function.
6269 (Archive::do_get_mtime): New function.
6270 (Archive::do_for_all_unused_symbols): New function.
6271 (Archive::task_): Move to base class.
6272 (Archive::incremental_info_): Likewise.
6273 (class Lib_group): Derive from Library_base.
6274 (Lib_group::do_filename): New function.
6275 (Lib_group::do_get_mtime): New function.
6276 (Lib_group::do_for_all_unused_symbols): New function.
6277 (Lib_group::task_): Move to base class.
6278 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6279 function.
6280 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6281 function.
6282 * incremental.cc (Incremental_inputs::report_archive_begin):
6283 Use Library_base; call library's get_mtime; add incremental inputs
6284 entry before members.
6285 (class Unused_symbol_visitor): New class.
6286 (Incremental_inputs::report_archive_end): Use Library_base; use
6287 visitor class to record unused symbols; don't add incremental inputs
6288 entry after members.
6289 (Incremental_inputs::report_object): Use Library_base.
6290 * incremental.h
6291 (Incremental_archive_entry::Incremental_archive_entry): Remove
6292 unused Archive parameter.
6293 (Incremental_inputs::report_archive_begin): Use Library_base.
6294 (Incremental_inputs::report_archive_end): Likewise.
6295 (Incremental_inputs::report_object): Likewise.
6296 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6297 function.
6298 * object.h (Object::for_all_global_symbols): New function.
6299 (Object::do_for_all_global_symbols): New function.
6300 (Sized_relobj::do_for_all_global_symbols): New function.
6301 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6302 function.
6303 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6304 function.
6305
61ab3e40
ILT
63062011-03-27 Ian Lance Taylor <iant@google.com>
6307
6308 * archive.cc (Archive::interpret_header): Return -1 if something
6309 goes wrong. Change callers accordingly.
6310
30e1f9e6
CC
63112011-03-25 Cary Coutant <ccoutant@google.com>
6312
6313 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6314 * testsuite/Makefile.in: Regenerate.
6315
9370ce59 63162011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6317
6318 * plugin.cc (get_view): New.
6319 (Plugin::load): Pass get_view to the plugin.
6320 (Plugin_manager::get_view): New.
6321
9312bb0a
ILT
63222011-03-21 Ian Lance Taylor <iant@google.com>
6323
6324 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6325 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6326
7e12ba9e
ST
63272011-03-21 Sriraman Tallam <tmsriram@google.com>
6328
6329 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6330 Change == to -eq.
6331 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6332 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6333 Change == to -eq.
6334 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6335 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6336
fd7a005d
ILT
63372011-03-14 Ian Lance Taylor <iant@google.com>
6338
6339 * script-sections.cc (Sort_output_sections::script_compare):
6340 Rename from is_before, change return type.
6341 (Sort_output_sections::operator()): Adjust accordingly.
6342
ed16fd1b
ILT
63432011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6344
6345 PR gold/12572
6346 * testsuite/odr_violation2.cc: Add comment to make all error line
6347 numbers double digits.
6348 * testsuite/debug_msg.sh: Adjust expected errors.
6349
71ff8986
ILT
63502011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6351
6352 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6353 but mark earlier ones as non-canonical
6354 (offset_to_iterator): Update search target and example
6355 (do_addr2line): Return extra lines in a vector*
6356 (format_file_lineno): Extract from do_addr2line
6357 (one_addr2line): Add vector* out-param
6358 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6359 when a lineno entry appeared last for its instruction
6360 (Dwarf_line_info): Add vector* out-param
6361 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6362 * symtab.cc (Odr_violation_compare): Include the lineno in the
6363 comparison again.
6364 (linenos_from_loc): New. Combine the canonical line for an
6365 address with its other lines.
6366 (True_if_intersect): New. Helper functor to make
6367 std::set_intersection a query.
6368 (detect_odr_violations): Compare sets of lines instead of just
6369 one line for each function. This became less deterministic, but
6370 has fewer false positives.
6371 * symtab.h: Declarations.
6372 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6373 mix an optimized and non-optimized object in the same binary
6374 (odr_violation2.so): Same.
6375 * testsuite/Makefile.in: Regenerate from Makefile.am.
6376 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6377 * testsuite/debug_msg.sh: Update line numbers and add
6378 assertions.
6379 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6380 non-optimized context.
6381 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6382 isn't inlined, and use OdrDerived in an optimized context.
6383 * testsuite/odr_header1.h: Defines OdrDerived, where
6384 optimization will change the
6385 first-instruction-in-the-destructor's file and line number.
6386 * testsuite/odr_header2.h: Defines OdrBase.
6387
a19fefdc
ILT
63882011-03-09 Ian Lance Taylor <iant@google.com>
6389
6390 * fileread.cc (File_read::clear_views): Don't delete the whole
6391 file view.
6392
ecb351e9
ILT
63932011-03-08 Ian Lance Taylor <iant@google.com>
6394
6395 PR gold/12525
6396 * fileread.cc: #include <climits>.
6397 (GOLD_IOV_MAX): Define.
6398 (File_read::read_multiple): Limit number of entries by iov_max.
6399 * fileread.h (class File_read): Always set max_readv_entries to
6400 128.
6401
b821d13c
ILT
64022011-03-07 Ian Lance Taylor <iant@google.com>
6403
6404 PR gold/12525
6405 * options.h (class General_options): Add -dy and -dn.
6406
89243142
CC
64072011-03-02 Cary Coutant <ccoutant@google.com>
6408
6409 * testsuite/script_test_9.t: Add TLS segment.
6410
d0773f31
ILT
64112011-03-02 Simon Baldwin <simonb@google.com>
6412
6413 * configure.ac: Add check for gnu_indirect_function support in
6414 the toolchain building binutils.
6415 * configure: Rebuild.
6416
9370ce59 64172011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6418
6419 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6420 plugin only symbols.
6421 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6422 in plugin files as not needed in the symbol table.
6423
4cf7a849
ST
64242011-02-11 Sriraman Tallam <tmsriram@google.com>
6425
6426 * output.cc (Output_section::add_input_section): Delay fill
6427 generation for section ordering.
6428
b578bd7d
ILT
64292011-02-09 Ian Lance Taylor <iant@google.com>
6430
6431 PR gold/12316
6432 * object.h (class Sized_relobj): Remove clear_local_symbols.
6433 * reloc.cc (Sized_relobj::do_relocate): Don't call
6434 clear_local_symbols.
6435
9370ce59 64362011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6437
6438 * plugin.cc (is_visible_from_outside): Return true for symbols
6439 in the -u option.
6440
55382fb7
ILT
64412011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6442
6443 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6444 filename.
6445
4e271fff
ST
64462011-02-02 Sriraman Tallam <tmsriram@google.com>
6447
6448 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6449 to std::string.
4e271fff 6450 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6451 section_name to be std::string.
4e271fff
ST
6452 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6453
d433c3ac
ILT
64542011-01-25 Ian Lance Taylor <iant@google.com>
6455
6456 * script.cc (script_add_extern): Rewrite to use
6457 add_symbol_reference.
6458
880473a6
DK
64592011-01-25 Doug Kwan <dougkwan@google.com>
6460
d433c3ac 6461 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6462
f30f86fa
ILT
64632011-01-24 Ian Lance Taylor <iant@google.com>
6464
6465 * options.h (class General_options): Accept
6466 --no-detect-odr-violations.
6467
8e51a0b9
ILT
64682011-01-24 Ian Lance Taylor <iant@google.com>
6469
6470 * version.cc (version_string): Bump to 1.11.
6471
0f3b89d8
ILT
64722011-01-24 Ian Lance Taylor <iant@google.com>
6473
6474 * plugin.cc (class Plugin_rescan): Define new class.
6475 (Plugin_manager::claim_file): Set any_claimed_.
6476 (Plugin_manager::save_archive): New function.
6477 (Plugin_manager::save_input_group): New function.
6478 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6479 necessary.
6480 (Plugin_manager::new_undefined_symbol): New function.
6481 (Plugin_manager::rescan): New function.
6482 (Plugin_manager::rescannable_defines): New function.
6483 (Plugin_manager::add_input_file): Set any_added_.
6484 * plugin.h (class Plugin_manager): define new fields rescannable_,
6485 undefined_symbols_, any_claimed_, and any_added_. Declare
6486 Plugin_rescan as friend. Declare new functions.
6487 (Plugin_manager::Rescannable): Define type.
6488 (Plugin_manager::Rescannable_list): Define type.
6489 (Plugin_manager::Undefined_symbol_list): Define type.
6490 (Plugin_manager::Plugin_manager): Initialize new fields.
6491 * archive.cc (Archive::defines_symbol): New function.
6492 (Add_archive_symbols::run): Pass archive to plugins if any.
6493 * archive.h (class Archive): Declare defines_symbol.
6494 * readsyms.cc (Input_group::~Input_group): New function.
6495 (Finish_group::run): Pass input_group to plugins if any.
6496 * readsyms.h (class Input_group): Declare destructor.
6497 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6498 any.
6499
3bb951e5
ILT
65002011-01-10 Ian Lance Taylor <iant@google.com>
6501
6502 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6503 section as relro.
6504 (Layout::set_segment_offsets): Reset increase_relro before calling
6505 set_section_addresses a second time.
6506
0aa45fac
CC
65072011-01-04 Cary Coutant <ccoutant@google.com>
6508
6509 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6510 sections before NOBITS sections.
6511
0db46eb4
L
65122011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6513
6514 * version.cc (print_version): Update copyright to 2011.
6515
829c9745
CC
65162010-12-23 Cary Coutant <ccoutant@google.com>
6517
6518 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6519 of OS to this->add. Add OD parameter to second form of the function.
6520
7500420b
ILT
65212010-12-20 Ian Lance Taylor <iant@google.com>
6522
6523 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6524 second of two consecutive entries with same offset.
6525
f8e9a930
RW
65262010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6527
6528 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6529 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6530 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6531 to avoid unneeded links against $(LDADD).
6532 * testsuite/Makefile.in: Regenerate.
6533
2fbb4320
ILT
65342010-12-15 Ian Lance Taylor <iant@google.com>
6535
6536 PR gold/12324
6537 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6538 for R_X86_64_32 and R_X86_64_PC32.
6539 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6540 ver_matching_def_pic.o.
6541 (ver_matching_def_pic.o): New target.
6542
fedb228d
RW
65432010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6544
6545 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6546 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6547 Move definition before File_read::View member definitions.
6548 (File_read::View::~View): Initialize and hold lock before
6549 updating current_mapped_bytes.
6550
9b547ce6
RW
65512010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6552
6553 * dwarf_reader.cc: Remove outdated comment.
6554 * gold-threads.cc: Fix typo in error message.
6555 * archive.cc: Fix typos in comments.
6556 * archive.h: Likewise.
6557 * arm-reloc-property.cc: Likewise.
6558 * arm-reloc-property.h: Likewise.
6559 * arm-reloc.def: Likewise.
6560 * arm.cc: Likewise.
6561 * attributes.h: Likewise.
6562 * cref.cc: Likewise.
6563 * ehframe.cc: Likewise.
6564 * fileread.h: Likewise.
6565 * gold.h: Likewise.
6566 * i386.cc: Likewise.
6567 * icf.cc: Likewise.
6568 * incremental.h: Likewise.
6569 * int_encoding.cc: Likewise.
6570 * layout.h: Likewise.
6571 * main.cc: Likewise.
6572 * merge.h: Likewise.
6573 * object.cc: Likewise.
6574 * object.h: Likewise.
6575 * options.cc: Likewise.
6576 * readsyms.cc: Likewise.
6577 * reduced_debug_output.cc: Likewise.
6578 * reloc.cc: Likewise.
6579 * script-sections.cc: Likewise.
6580 * sparc.cc: Likewise.
6581 * symtab.h: Likewise.
6582 * target-reloc.h: Likewise.
6583 * target.cc: Likewise.
6584 * target.h: Likewise.
6585 * timer.cc: Likewise.
6586 * timer.h: Likewise.
6587 * x86_64.cc: Likewise.
6588
83e17bd5
CC
65892010-12-09 Cary Coutant <ccoutant@google.com>
6590
6591 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6592 stack.
6593 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6594 parameter; change all callers.
6595 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6596 * options.h (warn_execstack): New option.
6597
017257f8
DK
65982010-12-07 Doug Kwan <dougkwan@google.com>
6599
6600 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6601 like function call relocations.
6602
c20cbc06
ILT
66032010-12-07 Ian Lance Taylor <iant@google.com>
6604
6605 * archive.cc (Archive::get_elf_object_for_member): Permit
6606 punconfigured to be NULL.
6607 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6608 (Archive::include_member): Pass NULL to get_elf_object_for_member
6609 if we searched for the archive and this is the first included
6610 object.
6611
4dbfafcc
ILT
66122010-12-01 Ian Lance Taylor <iant@google.com>
6613
6614 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6615 track_relocs_type_ field.
6616 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6617 Set track_relocs_type_.
6618 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6619 contents when using RELA relocs.
6620 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6621 reloc_map_.
6622 * reloc.cc (Track_relocs::next_addend): New function.
6623 * reloc.h (class Track_relocs): Declare next_addend.
6624
e5e19edd
ILT
66252010-12-01 Ian Lance Taylor <iant@google.com>
6626
6627 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6628 virtual destructor.
6629
9a5ce24c
ILT
66302010-12-01 Ian Lance Taylor <iant@google.com>
6631
6632 * README: Update compilers known to work and fail.
6633
c7791212
NC
66342010-11-23 Matthias Klose <doko@ubuntu.com>
6635
6636 * configure.in: For --enable-gold, handle value `default' instead of
6637 `both*'. Always install ld as ld.bfd, install as ld if gold is
6638 not the default.
6639 * configure: Regenerate.
6640
0ad220c9
DK
66412010-11-18 Doug Kwan <dougkwan@google.com>
6642
6643 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6644 and right_alignment to be zero. Store result alignment only if it is
6645 greater than existing alignment.
6646
ab8056e0
CC
66472010-11-16 Cary Coutant <ccoutant@google.com>
6648
6649 PR gold/12220
6650 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6651 Check for ".zdebug_line".
6652
fd064a5b
CC
66532010-11-16 Doug Kwan <dougkwan@google.com>
6654 Cary Coutant <ccoutant@google.com>
6655
6656 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6657 by reference; adjust all callers.
6658 * output.cc (Output_segment::set_section_addresses): Adjust references
6659 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6660 list is empty.
6661 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6662 end at page boundary.
6663
6fc6ea19
CC
66642010-11-16 Cary Coutant <ccoutant@google.com>
6665
6666 PR gold/12220
6667 * layout.cc (Layout::choose_output_section): Transform names of
6668 compressed sections even when using a script with a SECTIONS clause.
6669 (Layout::output_section_name): Remove code to transform
6670 compressed debug section names.
6671 * output.cc (Output_section::add_input_section): Use uncompressed
6672 section size when tracking input sections.
6673
95a2c8d6
RS
66742010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6675
6676 * symtab.h (Symbol::NON_PIC_REF): Remove.
6677 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6678 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6679 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6680 (Symbol::use_plt_offset): Take a flags argument and pass it
6681 directly to needs_dynamic_reloc. Restrict check for undefined
6682 weak symbols to function calls.
6683 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6684 (Target_arm::Scan::global): Use it.
6685 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6686 (Target_arm::Relocate::relocate): Likewise.
6687 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6688 parameter with an r_type parameter. Use get_reference_flags
6689 to get the flags.
6690 (Target_arm::Relocate::relocate): Update accordingly.
6691 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6692 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6693 (Target_i386::Scan::global): Likewise.
6694 (Target_i386::Relocate::relocate): Likewise.
6695 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6696 parameter with an r_type parameter. Use get_reference_flags
6697 to get the flags.
6698 (Target_i386::Relocate::relocate): Update accordingly.
6699 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6700 (Target_powerpc::Scan::global): Use it.
6701 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6702 (Target_powerpc::Relocate::relocate): Likewise.
6703 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6704 (Target_sparc::Scan::global): Use it.
6705 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6706 (Target_sparc::Relocate::relocate): Likewise.
6707 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6708 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6709 (Target_x86_64::Scan::global): Likewise.
6710 (Target_x86_64::Relocate::relocate): Likewise.
6711
f625ae50
DK
67122010-11-08 Doug Kwan <dougkwan@google.com>
6713 Cary Coutant <ccoutant@google.com>
6714
6715 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6716 (Arm_exidx_merge_section::section_contents_): New data member.
6717 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6718 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 6719 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
6720 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6721 in parameters instead of calling Object::section_contents without
6722 locking.
6723 (Arm_output_section::group_section): New parameter TASK. Pass it
6724 to callees that need locking objects.
6725 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6726 to lock EXIDX input sections. Fix a formatting issue. Call
6727 Arm_exidx_merged_section::build_contents to create merged section
6728 contents.
6729 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6730 to lock object of stub table owner.
6731 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6732 TEXT_SIZE to initialize data member TEXT_SIZE_.
6733 (Arm_exidx_input_section::addralign): Fix typo in comment.
6734 (Arm_exidx_input_section::text_size): New method.
6735 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6736 that require locking objects. Lock objects before scanning for stubs
6737 and updating local symbols.
6738 (Arm_input_section<big_endian>::init): Copy contents of original
6739 input section.
2e702c99 6740 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
6741 original input section instead of calling Object::section_contents
6742 without locking.
6743 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6744 size without calling Object::section_size().
6745 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6746 for size. Allocate a buffer for merged EXIDX entries.
6747 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 6748 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
6749 building code to Arm_exidx_merged_section::build_contetns. Write
6750 out contetns in buffer instead of building it on the fly.
6751 (Arm_relobj::make_exidx_input_section): Also pass text section size
6752 to Arm_exidx_input_section constructor.
6753 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6754 (Arm_dynobj::do_read_symbols): Fix memory leak.
6755 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6756 * target.h: (class Task): Add forward declaration.
6757 (Target::relax): Add new parameter TASK and pass it to
6758 Target::do_relax().
6759 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6760
5f9bcf58
CC
67612010-11-05 Cary Coutant <ccoutant@google.com>
6762
6763 PR gold/10708
6764 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6765 object when reading from the file.
6766 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6767 second layout pass.
6768 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6769 when reading section contents.
6770 (get_section_contents): Likewise.
6771 (icf::find_identical_sections): Likewise.
6772 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6773 object when reading from the file.
6774 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6775 the object when doing deferred section layout.
6776
e597fa08
NC
67772010-11-03 Nick Clifton <nickc@redhat.com>
6778
6779 PR gold/12001
6780 * script.h (class Symbol_assignment: name): New member. Returns
6781 the name of the symbol.
6782 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6783 Returns true if the given symbol name is on the list of
6784 assignments wating to be processed.
6785 * archive.cc (should_incldue_member): If the symbol is undefined,
6786 check to see if it is on the list of symbols pending assignment.
6787
3f9a3278
ILT
67882010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6789
6790 * script-sections.cc (Script_sections::find_memory_region): Check
6791 for a NULL output section pointer.
6792
d06fb4d1
DK
67932010-10-29 Doug Kwan <dougkwan@google.com>
6794
6795 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6796 Output_section::add_relaxed_input_section.
6797 * output.cc (Output_section::add_relaxed_input_section): Add new
6798 arguments LAYOUT and NAME. Set section order index.
6799 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6800 Copy section order index.
6801 * output.h (Output_section::add_relaxed_input_section): Add new
6802 arguments LAYOUT and NAME.
6803
90e24de5
ILT
68042010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6805
6806 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 6807 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
6808 * testsuite/Makefile.in: Regenerate.
6809
c9484ea5
DK
68102010-10-20 Doug Kwan <dougkwan@google.com>
6811
6812 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6813 without SHF_LINK_ORDER flags.
6814 * layout.cc (Layout::choose_output_section): Do not filter
6815 SHF_LINK_ORDER flag in a relocatable link.
6816
5bc2f5be
CC
68172010-10-17 Cary Coutant <ccoutant@google.com>
6818
6819 * output.h (Output_segment::set_section_addresses): Change function
6820 signature. Update all callers.
6821 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
6822 sections.
6823 (Output_segment::set_section_addresses): Align after last TLS
6824 section. Add padding before last relro section instead of after.
6825
0c91cf04
DK
68262010-10-17 Doug Kwan <dougkwan@google.com>
6827
6828 * gold/arm.cc (Target_arm::got_section): Use correct order and set
6829 GOT output section to be writable.
6830
8c21d9d3
CC
68312010-10-14 Cary Coutant <ccoutant@google.com>
6832
6833 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
6834 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
6835 * gold.cc (queue_initial_tasks): Check parameters for incremental link
6836 mode.
6837 * incremental.cc (report_command_line): Ignore all forms of
6838 --incremental.
6839 * layout.cc (Layout::Layout): Check parameters for incremental link
6840 mode.
6841 * options.cc (General_options::parse_incremental): New function.
6842 (General_options::parse_no_incremental): New function.
6843 (General_options::parse_incremental_full): New function.
6844 (General_options::parse_incremental_update): New function.
6845 (General_options::incremental_mode_): New data member.
6846 (General_options::finalize): Check incremental_mode_.
6847 * options.h (General_options): Update help text for --incremental.
6848 Add --no-incremental, --incremental-full, --incremental-update.
6849 (General_options::Incremental_mode): New enum type.
6850 (General_options::incremental_mode): New function.
6851 (General_options::incremental_mode_): New data member.
6852 * parameters.cc (Parameters::incremental_mode_): New data member.
6853 (Parameters::set_options): Set incremental_mode_.
6854 (Parameters::set_incremental_full): New function.
6855 (Parameters::incremental): New function.
6856 (Parameters::incremental_update): New function.
6857 (set_parameters_incremental_full): New function.
6858 * parameters.h (Parameters::set_incremental_full): New function.
6859 (Parameters::incremental): New function.
6860 (Parameters::incremental_update): New function.
6861 (Parameters::incremental_mode_): New data member.
6862 (set_parameters_incremental_full): New function.
6863 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
6864 incremental link mode.
6865 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
6866 (Sized_relobj::do_relocate_sections): Likewise.
6867 * testsuite/Makefile.am (incremental_test): Use --incremental-full
6868 option.
6869 * testsuite/Makefile.in: Regenerate.
6870 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 6871
bb32aa18 68722010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
6873
6874 * script-sections.h (class Script_sections): Make
6875 Sections_elements typedef public.
6876 * script-sections.cc (class Sort_output_sections): Add elements_
6877 field. Add constructor which sets it; change all callers.
6878 (Sort_output_sections::is_before): New function.
6879 (Sort_output_sections::operator()): Call is_before.
6880 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
6881 conditional.
6882 * testsuite/script_test_10.sh: New test. Test script section
6883 order.
6884 * testsuite/script_test_10.t: Likewise.
6885 * testsuite/script_test_10.s: Likewise.
6886 * testsuite/Makefile.am: Wrap the cross linker tests and the
6887 common tests into NATIVE_OR_CROSS_LINKER.
6888 (check_SCRIPTS): Add script_test_10.sh.
6889 (check_DATA): Add script_test_10.stdout.
6890 (script_test_10.o, script_test_10): New targets.
6891 (script_test_10.stdout): New target.
6892 * configure, testsuite/Makefile.in: Regenerate.
6893
3cef7179
ILT
68942010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6895
6896 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
6897 error for the deprecated relocations.
6898 (Target_arm::Scan::global): Likewise.
6899 (Target_arm::Relocate::relocate): Likewise.
6900
7411e9a8
RS
69012010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
6902
6903 * fileread.cc (Input_file::find_file): Initialize *found_name
6904 and *namep when using the fallback search for case 4.
6905
6a9da32a
CC
69062010-10-11 Cary Coutant <ccoutant@google.com>
6907
6908 * options.h (class General_options): Redefine -z lazy as an alias for
6909 the negation of -z now.
6910
ac897c20
ILT
69112010-10-11 Ian Lance Taylor <iant@google.com>
6912
6913 * resolve.cc (symbol_to_bits): Report the value of the unsupported
6914 binding.
6915
ea5cae92
NC
69162010-10-06 Nick Clifton <nickc@redhat.com>
6917
6918 * script-sections.cc(class Memory_region): Remove
6919 current_lma_offset_ field. Rename current_vma_offset_ to
6920 current_offset_. Add last_section_ field.
6921 (Memory_region::get_current_vma_address): Rename to
6922 get_current_address.
6923 (Memory_region::get_current_lma_address): Delete.
6924 (Memory_region::increment_vma_offset): Rename to
6925 increment_offset.
6926 (Memory_region::increment_lma_offset): Delete.
6927 (Memory_region::attributes_compatible): New method. Returns
6928 true if the provided section is compatible with the region.
6929 (Memory_region::get_last_section): New method. Returns the last
6930 section to use the region.
6931 (Memory_region::set_last_section): New method. Stores the last
6932 section to use the region.
6933 (Script_sections::block_in_region): New method. Returns true if
6934 a block of memory is contained within a region.
6935 (Script_sections::find_memory_region): New method. Locates a
6936 memory region to be used to set a VMA or LMA address.
6937 (Output_section_definition::set_section_addresses): Add code to
6938 check for addresses set by memory regions.
6939 (Output_segment::set_section_addresses): Remove memory region
6940 walking code.
6941 (Script_sections::create_segment): Add a warning if a header
6942 segment is created outside of any region.
6943 * script-sections.h (class Script_sections): Add prototypes for
6944 find_memory_region and block_in_region methods.
6945 * testsuite/memory_test.s: Use .long instead of .word.
6946 * testsuite/memory_test.t: Add some more output sections.
6947 * testsuite/memory_test.sh: Update expected output.
6948
a9bfd952
DK
69492010-10-02 Doug Kwan <dougkwan@google.com>
6950
6951 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
6952 defintion to symtab.h
6953 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
6954 declaration to defintion.
6955
bacff3ab
NC
69562010-10-01 Nick Clifton <nickc@redhat.com>
6957
6958 * expression.cc (eval): Replace dummy argument with NULL.
6959 (eval_maybe_dot): Check for a NULL result section pointer.
6960 (Symbol_expression::value): Likewise.
6961 (Dot_expression::value): Likewise.
6962 (BINARY_EXPRESSION): Likewise.
6963 (Max_expression::value): Likewise.
6964 (Min_expression::value): Likewise.
6965 (Absolute_expression::value): Likewise.
6966 (Addr_expression::value_from_output_section): Likewise.
6967 (Loaddddr_expression::value_from_output_section): Likewise.
6968 (Segment_start_expression::value): Likewise.
6969 * script-sections.cc
6970 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
6971 argument with NULL.
6972 (Sections_elememt_dot_assignment::set_section_addresses):
6973 Likewise.
6974 (Output_data_expression::do_write_to_buffer): Likewise.
6975 (Output_section_definition::finalize_symbols): Likewise.
6976 (Output_section_definition::set_section_addresses): Likewise.
6977
f81bc8b5
DK
69782010-09-30 Doug Kwan <dougkwan@google.com>
6979
6980 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
6981
c95e9f27
ST
69822010-09-28 Sriraman Tallam <tmsriram@google.com>
6983
6984 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 6985 function.
c95e9f27
ST
6986 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
6987 virtual function.
6988 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
6989 virtual function.
6990 * icf.cc (get_section_contents): Inline merge sections only when
6991 target allows it.
6992
3cac54d2
RW
69932010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6994
6995 * configure: Regenerate.
6996
2904037a
ILT
69972010-09-17 Ian Lance Taylor <iant@google.com>
6998
6999 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7000 * testsuite/Makefile.am (memory_test.o): New target.
7001 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7002 memory_test.t.
7003 * testsuite/Makefile.in: Rebuild.
2904037a 7004
bca7fb63
DK
70052010-09-17 Doug Kwan <dougkwan@google.com>
7006
7007 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7008 defintion if relocation uses GOT entries of the symbol.
7009 * testsuite/icf_safe_test.sh: Fix test.
7010 * testsuite/icf_safe_so_test.sh: Fix test.
7011
4ef28648
CC
70122010-09-16 Cary Coutant <ccoutant@google.com>
7013
7014 * script_sections.cc (class Memory_region): Remove "NULL" from
7015 vector initializations.
7016
793990de
CC
70172010-09-15 Cary Coutant <ccoutant@google.com>
7018
7019 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7020 Resolve forwarding symbols.
7021
81e015e2
DK
70222010-09-15 Doug Kwan <dougkwan@google.com>
7023
7024 * gold/testsuite/script_test_3.t: Add ARM special sections.
7025 * gold/testsuite/script_test_4.t: Same.
7026 * gold/testsuite/script_test_5.t: Same.
7027 * gold/testsuite/script_test_6.t: Same.
7028 * gold/testsuite/script_test_7.t: Same.
7029 * gold/testsuite/script_test_7.t: Same.
7030 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7031
36171d64
CC
70322010-09-14 Cary Coutant <ccoutant@google.com>
7033
7034 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7035 (Target_x86_64::Relocate::relocate_tls): Replace check for
7036 saw_tls_block_reloc_ with test for executable section.
7037
d89051bd
CC
70382010-09-12 Cary Coutant <ccoutant@google.com>
7039
7040 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7041 position-independent executables to shared libraries need dynamic
7042 relocations.
7043 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7044 position-independent executables.
7045 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7046 * testsuite/Makefile.in: Regenerate.
7047
fca41f0f
NC
70482010-09-10 Nick Clifton <nickc@redhat.com>
7049
7050 PR gold/11997
7051 * testsuite/memory_test.t: Discard any sections that are not
7052 needed.
7053
6695e4b3
L
70542010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7055
7056 PR gold/11996
7057 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7058 "This::" to work around a bug in gcc 4.2.
7059
7060 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7061
0f72bf6f
RÁE
70622010-09-09 Rafael Espindola <espindola@google.com>
7063
7064 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7065 sections with different PF_X flags in the same segment.
7066 (Layout::find_first_load_seg): Search all segments to find the first
7067 one.
7068 * options.h (rosegment): New.
7069
70702010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7071
05a79166 7072 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7073
aa98ff75
DK
70742010-09-08 Doug Kwan <dougkwan@google.com>
7075
7076 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7077 (Arm_relobj::do_relocate_sections): Add new parameter for output
7078 file to match the parent.
7079 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7080 of local symbols instead of input values. Update code to track
7081 changes in gold::relocate_section.
7082 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7083 (Sized_relobj::compute_final_local_value_internal): New methods.
7084 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7085 body into private version of Sized_relobj::compute_final_local_value.
7086 Call the inline method.
7087 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7088 merged symbol value if there is one.
7089 (Symbol_value::has_output_value): New method defintiion.
7090 (Sized_relobj::Compute_final_local_value_status): New enum type.
7091 (Sized_relobj::compute_final_local_value): New methods.
7092 (Sized_relobj::compute_final_local_value_internal): New methods.
7093 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7094 and arm_cortex_a8.sh.
7095 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7096 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7097 New tests.
7098 * Makefile.in: Regenerate.
7099 * testsuite/arm_bl_out_of_range.s: Update test.
7100 * testsuite/thumb_bl_out_of_range.s: Ditto.
7101 * testsuite/thumb_blx_out_of_range.s: Ditto.
7102 * testsuite/arm_branch_out_of_range.sh: New file.
7103 * testsuite/arm_cortex_a8.sh: Ditto.
7104 * testsuite/arm_cortex_a8_b.s: Ditto.
7105 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7106 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7107 * testsuite/arm_cortex_a8_bl.s: Ditto.
7108 * testsuite/arm_cortex_a8_blx.s: Ditto.
7109 * testsuite/arm_cortex_a8_local.s: Ditto.
7110 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7111 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7112
05a79166
L
71132010-09-08 Rafael Espindola <espindola@google.com>
7114
7115 * Makefile.am (memory_test.stdout): Run readelf with -W.
7116 * Makefile.in: Regenerate.
7117 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7118 64 bit output.
7119
33dbc701
RÁE
71202010-09-08 Rafael Espindola <espindola@google.com>
7121
7122 * script-sections.cc (Script_sections::add_memory_region): Convert
7123 field precision to int.
7124 * script.cc (script_set_section_region, script_set_section_region):
7125 Convert field precision to int.
7126
731ca54a
RÁE
71272010-09-08 Rafael Espindola <espindola@google.com>
7128
7129 * arm.cc (do_finalize_sections): Create the __exidx_start and
7130 __exdix_end symbols even when the section is missing.
7131
7f8cd844
NC
71322010-09-08 Nick Clifton <nickc@redhat.com>
7133
7134 * README: Remove claim that MEMORY is not supported.
7135 * expression.cc (script_exp_function_origin)
7136 (script_exp_function_length): Move from here to ...
7137 * script.cc: ... here.
7138 (script_set_section_region, script_add_memory)
7139 (script_parse_memory_attr, script_include_directive): New
7140 functions.
7141 * script-sections.cc
7142 (class Memory_region): New class.
7143 (class Output_section_definition): Add set_memory_region,
7144 set_section_vma, set_section_lma and get_section_name methods.
7145 (class Script_Sections): Add add_memory_region,
7146 find_memory_region, find_memory_region_origin,
7147 find_memory_region_length and set_memory_region methods.
7148 Have set_section_addresses method walk the list of set memory
7149 regions.
7150 Extend the print methos to display memory regions.
7151 * script-sections.h: Add prototypes for new methods.
7152 Add enum for MEMORY region attributes.
7153 * yyscript.y: Add support for parsing MEMORY regions.
7154 * script-c.h: Add prototypes for new functions.
7155 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7156 * testsuite/Makefile.in: Regenerate.
7157 * testsuite/memory_test.sh: New script.
7158 * testsuite/memory_test.s: New assembler source file.
7159 * testsuite/memory_test.t: New linker script.
7160
a4649286
DK
71612010-08-27 Doug Kwan <dougkwan@google.com>
7162
7163 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7164 reference override an existing dynamic weak reference.
7165 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7166 * testsuite/Makefile.in: Regenerate.
7167 * testsuite/dyn_weak_ref.sh: New file.
7168 * testsuite/dyn_weak_ref_1.c: Ditto.
7169 * testsuite/dyn_weak_ref_2.c: Ditto.
7170
b56648ad
ILT
71712010-08-27 Ian Lance Taylor <iant@google.com>
7172
7173 * incremental.h (class Incremental_input_entry): Add virtual
7174 destructor.
7175
809313cb
ILT
71762010-08-27 Ian Lance Taylor <iant@google.com>
7177
7178 * testsuite/start_lib_test_3.c: Mark t3 as used.
7179
11e32464
NC
71802010-08-27 Nick Clifton <nickc@redhat.com>
7181
7182 * options.cc (version_script): Fix small typo in previous
7183 whitespace tidyup.
7184
ca09d69a
NC
71852010-08-25 Nick Clifton <nickc@redhat.com>
7186
7187 * archive.cc: Formatting fixes: Remove whitespace between
7188 typename and following asterisk. Remove whitespace between
7189 function name and opening parenthesis.
7190 * archive.h: Likewise.
7191 * arm.cc: Likewise.
7192 * attributes.cc: Likewise.
7193 * attributes.h: Likewise.
7194 * common.cc: Likewise.
7195 * copy-relocs.cc: Likewise.
7196 * dirsearch.h: Likewise.
7197 * dynobj.cc: Likewise.
7198 * ehframe.cc: Likewise.
7199 * ehframe.h: Likewise.
7200 * expression.cc: Likewise.
7201 * fileread.cc: Likewise.
7202 * fileread.h: Likewise.
7203 * gc.h: Likewise.
7204 * gold-threads.cc: Likewise.
7205 * gold.cc: Likewise.
7206 * i386.cc: Likewise.
7207 * icf.h: Likewise.
7208 * incremental-dump.cc: Likewise.
7209 * incremental.cc: Likewise.
7210 * layout.cc: Likewise.
7211 * layout.h: Likewise.
7212 * main.cc: Likewise.
7213 * merge.cc: Likewise.
7214 * merge.h: Likewise.
7215 * object.cc: Likewise.
7216 * object.h: Likewise.
7217 * options.cc: Likewise.
7218 * options.h: Likewise.
7219 * output.cc: Likewise.
7220 * output.h: Likewise.
7221 * plugin.cc: Likewise.
7222 * plugin.h: Likewise.
7223 * powerpc.cc: Likewise.
7224 * reloc.cc: Likewise.
7225 * script-c.h: Likewise.
7226 * script-sections.cc: Likewise.
7227 * script.cc: Likewise.
7228 * stringpool.cc: Likewise.
7229 * symtab.cc: Likewise.
7230 * symtab.h: Likewise.
7231 * target.cc: Likewise.
7232 * timer.cc: Likewise.
7233 * timer.h: Likewise.
7234 * version.cc: Likewise.
7235 * x86_64.cc: Likewise.
7236
b8fa8750
NC
72372010-08-24 Nick Clifton <nickc@redhat.com>
7238
7239 PR 11899
7240 * layout.cc (segment_precedes): Sort segments by their physical
7241 addresses, if they have been set.
7242
9919d93b
CC
72432010-08-23 Cary Coutant <ccoutant@google.com>
7244
7245 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7246 symbols data.
7247 (Lib_group::include_member): Unlock object after deleting its
7248 symbols data.
7249 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7250 the bug fixed here.
7251
97b4be1c
CC
72522010-08-19 Neil Vachharajani <nvachhar@google.com>
7253 Cary Coutant <ccoutant@google.com>
7254
7255 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7256 constructor, and set_blocker.
7257 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7258 readsyms_blocker_.
7259 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7260 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7261 * testsuite/Makefile.am (start_lib_test): New test case.
7262 * testsuite/Makefile.in: Regenerate.
7263 * testsuite/start_lib_test_main.c: New file.
7264 * testsuite/start_lib_test_1.c: New file.
7265 * testsuite/start_lib_test_2.c: New file.
7266 * testsuite/start_lib_test_3.c: New file.
7267
dd0b1884
ILT
72682010-08-19 Ian Lance Taylor <iant@google.com>
7269
7270 * Makefile.in: Rebuild with automake 1.11.1.
7271 * aclocal.m4: Likewise.
7272 * testsuite/Makefile.in: Likewise.
7273
7223e9ca
ILT
72742010-08-19 Ian Lance Taylor <iant@google.com>
7275
7276 PR 10893
7277 * i386.cc (class Output_data_plt_i386): Update declarations.
7278 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7279 local_ifuncs_ fields.
7280 (Target_i386::do_plt_section_for_global): New function.
7281 (Target_i386::do_plt_section_for_local): New function.
7282 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7283 parameter; change all callers. Initialize global_ifuncs_ and
7284 local_ifuncs_. If doing a static link define __rel_iplt_start and
7285 __rel_iplt_end.
7286 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7287 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7288 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7289 symbols.
7290 (Target_i386::make_plt_section): New function, broken out of
7291 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7292 (Target_i386::make_plt_entry): Call make_plt_section.
7293 (Target_i386::make_local_ifunc_plt_entry): New function.
7294 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7295 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7296 R_386_IRELATIVE to switch.
7297 (Target_i386::Scan::global): Likewise.
7298 (Target_i386::Relocate::relocate): Likewise.
7299 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7300 switch.
7301 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7302 (Target_x86_64::do_plt_section_for_global): New function.
7303 (Target_x86_64::do_plt_section_for_local): New function.
7304 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7305 parameter; change all callers. If doing a static link define
7306 __rela_iplt_start and __rela_iplt_end.
7307 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7308 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7309 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7310 to point to .plt.
7311 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7312 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7313 switch.
7314 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7315 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7316 R_X86_64_IRELATIVE to switch.
7317 (Target_x86_64::Scan::global): Likewise.
7318 (Target_x86_64::Relocate::relocate): Likewise.
7319 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7320 switch.
7321 * target.h (class Target): Add plt_section_for_global and
7322 plt_section_for_local functions. Add do_plt_section_for_global
7323 and do_plt_section_for_local virtual functions.
7324 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7325 clarifying comments.
7326 (Symbol::use_plt_offset): Handle IFUNC symbol.
7327 * object.cc (Sized_relobj::Sized_relobj): Initialize
7328 local_plt_offsets_.
7329 (Sized_relobj::local_has_plt_offset): New function.
7330 (Sized_relobj::local_plt_offset): New function.
7331 (Sized_relobj::set_local_plt_offset): New function.
7332 (Sized_relobj::do_count): Handle IFUNC symbol.
7333 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7334 a bit away from input_shndx_ field. Add set_is_func_symbol and
7335 is_ifunc_symbol functions.
7336 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7337 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7338 local_plt_offsets_ field.
7339 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7340 * output.h (class Output_section_data): Add non-const
7341 output_section function.
7342 (class Output_data_got): Update declarations.
7343 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7344 Add use_plt_offset parameter to global and local constructors.
7345 Change all callers. Change local_sym_index_ field to 31 bits.
7346 Change GSYM_CODE and CONSTANT_CODE accordingly.
7347 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7348 doing a static link don't set sh_link field.
7349 (Output_data_got::Got_entry::write): Use PLT offset if
7350 appropriate.
7351 (Output_data_got::add_global_plt): New function.
7352 (Output_data_got::add_local_plt): New function.
7353 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7354 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7355 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7356 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7357 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7358 IFUNC conditional.
7359 * testsuite/ifunc-sel.h: New file.
7360 * testsuite/ifuncmain1.c: New file.
7361 * testsuite/ifuncmain1vis.c: New file.
7362 * testsuite/ifuncmod1.c: New file.
7363 * testsuite/ifuncdep2.c: New file.
7364 * testsuite/ifuncmain2.c: New file.
7365 * testsuite/ifuncmain3.c: New file.
7366 * testsuite/ifuncmod3.c: New file.
7367 * testsuite/ifuncmain4.c: New file.
7368 * testsuite/ifuncmain5.c: New file.
7369 * testsuite/ifuncmod5.c: New file.
7370 * testsuite/ifuncmain6pie.c: New file.
7371 * testsuite/ifuncmod6.c: New file.
7372 * testsuite/ifuncmain7.c: New file.
7373 * configure, testsuite/Makefile.in: Rebuild.
7374
56f75c03
ILT
73752010-08-18 Ian Lance Taylor <iant@google.com>
7376
7377 * incremental.cc
7378 (Output_section_incremental_inputs::write_input_files): Add cast
7379 to avoid signed/unsigned comparison warning.
7380 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7381
55455f89
CC
73822010-08-12 Cary Coutant <ccoutant@google.com>
7383
7384 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7385
e2054bcb
ILT
73862010-08-13 Ian Lance Taylor <iant@google.com>
7387
7388 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7389
74f67560
DK
73902010-08-12 Cary Coutant <ccoutant@google.com>
7391 Doug Kwan <dougkwan@google.com>
7392
7393 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7394 defintion overrides non-weak undef, remember that the original undef
7395 is not weak.
7396 * symtab.cc (Symbol_table::sized_write_global): For undef without
7397 an original weak binding, set binding to global in output.
7398 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7399 * testsuite/Makefile.in: Regenerate.
7400 * testsuite/strong_ref_weak_def.sh: New file.
7401 * testsuite/strong_ref_weak_def_1.c: Ditto.
7402 * testsuite/strong_ref_weak_def_2.c: Ditto.
7403
d1238d12
CC
74042010-08-12 Cary Coutant <ccoutant@google.com>
7405
7406 * testsuite/incremental_test.sh: Rewrite.
7407 * testsuite/incremental_test_1.c: Rewrite.
7408 * testsuite/incremental_test_2.c: Rewrite.
7409
0e70b911
CC
74102010-08-12 Cary Coutant <ccoutant@google.com>
7411
7412 * arm.cc (Target_arm::got_size): Add const.
7413 (Target_arm::got_entry_count): New function.
7414 (Target_arm::plt_entry_count): New function.
7415 (Target_arm::first_plt_entry_offset): New function.
7416 (Target_arm::plt_entry_size): New function.
7417 (Output_data_plt_arm::entry_count): New function.
7418 (Output_data_plt_arm::first_plt_entry_offset): New function.
7419 (Output_data_plt_arm::get_plt_entry_size): New function.
7420 * i386.cc (Target_i386::got_size): Add const.
7421 (Target_i386::got_entry_count): New function.
7422 (Target_i386::plt_entry_count): New function.
7423 (Target_i386::first_plt_entry_offset): New function.
7424 (Target_i386::plt_entry_size): New function.
7425 (Output_data_plt_i386::entry_count): New function.
7426 (Output_data_plt_i386::first_plt_entry_offset): New function.
7427 (Output_data_plt_i386::get_plt_entry_size): New function.
7428 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7429 find_incremental_inputs_sections. Dump incremental_got_plt section.
7430 * incremental.cc: Include target.h.
7431 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7432 parameter. Adjust all callers. Find incremental_got_plt section.
7433 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7434 section.
7435 (Output_section_incremental_inputs::set_final_data_size): Calculate
7436 size of incremental_got_plt section.
7437 (Output_section_incremental_inputs::do_write): Write the
7438 incremental_got_plt section.
7439 (Got_plt_view_info): New struct.
7440 (Local_got_offset_visitor): New class.
7441 (Global_got_offset_visitor): New class.
7442 (Global_symbol_visitor_got_plt): New class.
7443 (Output_section_incremental_inputs::write_got_plt): New function.
7444 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7445 Add parameter. Adjust all callers.
7446 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7447 (Incremental_inputs::got_plt_section): New function.
7448 (Incremental_inputs::got_plt_section_): New data member.
7449 (Incremental_got_plt_reader): New class.
7450 * layout.cc (Layout::create_incremental_info_sections): Add the
7451 incremental_got_plt section.
7452 * object.h (Got_offset_list::get_list): New function.
7453 (Got offset_list::for_all_got_offsets): New function.
7454 (Sized_relobj::local_got_offset_list): New function.
7455 * powerpc.cc (Target_powerpc::got_size): Add const.
7456 (Target_powerpc::got_entry_count): New function.
7457 (Target_powerpc::plt_entry_count): New function.
7458 (Target_powerpc::first_plt_entry_offset): New function.
7459 (Target_powerpc::plt_entry_size): New function.
7460 (Output_data_plt_powerpc::entry_count): New function.
7461 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7462 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7463 * sparc.cc (Target_sparc::got_size): Add const.
7464 (Target_sparc::got_entry_count): New function.
7465 (Target_sparc::plt_entry_count): New function.
7466 (Target_sparc::first_plt_entry_offset): New function.
7467 (Target_sparc::plt_entry_size): New function.
7468 (Output_data_plt_sparc::entry_count): New function.
7469 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7470 (Output_data_plt_sparc::get_plt_entry_size): New function.
7471 * symtab.h (Symbol::got_offset_list): New function.
7472 (Symbol_table::for_all_symbols): New function.
7473 * target.h (Sized_target::got_entry_count): New function.
7474 (Sized_target::plt_entry_count): New function.
7475 (Sized_target::plt_entry_size): New function.
7476 * x86_64.cc (Target_x86_64::got_size): Add const.
7477 (Target_x86_64::got_entry_count): New function.
7478 (Target_x86_64::plt_entry_count): New function.
7479 (Target_x86_64::first_plt_entry_offset): New function.
7480 (Target_x86_64::plt_entry_size): New function.
7481 (Output_data_plt_x86_64::entry_count): New function.
7482 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7483 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7484
09ec0418
CC
74852010-08-12 Cary Coutant <ccoutant@google.com>
7486
7487 * archive.cc: Include incremental.h.
7488 (Archive::Archive): Initialize incremental_info_.
7489 (Archive::include_member): Record archive members in incremental info.
7490 (Add_archive_symbols::run): Record begin and end of an archive in
7491 incremental info.
7492 (Lib_group::include_member): Record objects in incremental info.
7493 * archive.h (Incremental_archive_entry): Forward declaration.
7494 (Archive::set_incremental_info): New member function.
7495 (Archive::incremental_info): New member function.
7496 (Archive::Unused_symbol_iterator): New class.
7497 (Archive::unused_symbols_begin): New member function.
7498 (Archive::unused_symbols_end): New member function.
7499 (Archive::incremental_info_): New data member.
7500 * incremental-dump.cc (find_input_containing_global): New function.
7501 (dump_incremental_inputs): Dump new incremental info sections.
7502 * incremental.cc: Include symtab.h.
7503 (Output_section_incremental_inputs): New class.
7504 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7505 new incremental info sections.
7506 (Sized_incremental_binary::do_check_inputs): Likewise.
7507 (Incremental_inputs::report_archive): Remove.
7508 (Incremental_inputs::report_archive_begin): New function.
7509 (Incremental_inputs::report_archive_end): New function.
7510 (Incremental_inputs::report_object): New function.
7511 (Incremental_inputs::finalize_inputs): Remove.
7512 (Incremental_inputs::report_input_section): New function.
7513 (Incremental_inputs::report_script): Rewrite.
7514 (Incremental_inputs::finalize): Do nothing but finalize string table.
7515 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7516 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7517 (Incremental_inputs::create_data_sections): New function.
7518 (Incremental_inputs::relocs_entsize): New function.
7519 (Output_section_incremental_inputs::set_final_data_size): New function.
7520 (Output_section_incremental_inputs::do_write): New function.
7521 (Output_section_incremental_inputs::write_header): New function.
7522 (Output_section_incremental_inputs::write_input_files): New function.
7523 (Output_section_incremental_inputs::write_info_blocks): New function.
7524 (Output_section_incremental_inputs::write_symtab): New function.
7525 * incremental.h (Incremental_script_entry): Forward declaration.
7526 (Incremental_object_entry): Forward declaration.
7527 (Incremental_archive_entry): Forward declaration.
7528 (Incremental_inputs): Forward declaration.
7529 (Incremental_inputs_header_data): Remove.
7530 (Incremental_inputs_header): Remove.
7531 (Incremental_inputs_header_write): Remove.
7532 (Incremental_inputs_entry_data): Remove.
7533 (Incremental_inputs_entry): Remove.
7534 (Incremental_inputs_entry_write): Remove.
7535 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7536 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7537 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7538 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7539 Likewise.
7540 (Incremental_input_entry): New class.
7541 (Incremental_script_entry): New class.
7542 (Incremental_object_entry): New class.
7543 (Incremental_archive_entry): New class.
7544 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7545 (Incremental_inputs::report_inputs): Remove.
7546 (Incremental_inputs::report_archive): Remove.
7547 (Incremental_inputs::report_archive_begin): New function.
7548 (Incremental_inputs::report_archive_end): New function.
7549 (Incremental_inputs::report_object): Change prototype.
7550 (Incremental_inputs::report_input_section): New function.
7551 (Incremental_inputs::report_script): Change prototype.
7552 (Incremental_inputs::get_reloc_count): New function.
7553 (Incremental_inputs::set_reloc_count): New function.
7554 (Incremental_inputs::create_data_sections): New function.
7555 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7556 (Incremental_inputs::inputs_section): New function.
7557 (Incremental_inputs::symtab_section): New function.
7558 (Incremental_inputs::relocs_section): New function.
7559 (Incremental_inputs::get_stringpool): Add const.
7560 (Incremental_inputs::command_line): Add const.
7561 (Incremental_inputs::inputs): Remove.
7562 (Incremental_inputs::command_line_key): New function.
7563 (Incremental_inputs::input_file_count): New function.
7564 (Incremental_inputs::input_files): New function.
7565 (Incremental_inputs::relocs_entsize): New function.
7566 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7567 (Incremental_inputs::finalize_inputs): Remove.
7568 (Incremental_inputs::Input_info): Remove.
7569 (Incremental_inputs::lock_): Remove.
7570 (Incremental_inputs::inputs_): Change type.
7571 (Incremental_inputs::inputs_map_): Remove.
7572 (Incremental_inputs::current_object_entry_): New data member.
7573 (Incremental_inputs::inputs_section_): New data member.
7574 (Incremental_inputs::symtab_section_): New data member.
7575 (Incremental_inputs::relocs_section_): New data member.
7576 (Incremental_inputs::reloc_count_): New data member.
7577 (Incremental_inputs_reader): New class.
7578 (Incremental_symtab_reader): New class.
7579 (Incremental_relocs_reader): New class.
7580 * layout.cc (Layout::finalize): Move finalization of incremental info
7581 and creation of incremental info sections to follow finalization of
7582 symbol table. Set offsets for postprocessing sections.
7583 (Layout::create_incremental_info_sections): Call
7584 Incremental_inputs::create_data_sections. Add incremental symtab
7585 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7586 sections to layout after input sections.
7587 * layout.h (struct Timespec): Forward declaration.
7588 (Layout::incremental_inputs): Add const.
7589 (Layout::create_incremental_info_sections): Add parameter.
7590 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7591 * object.cc: Include incremental.h.
7592 (Relobj::finalize_incremental_relocs): New function.
7593 (Sized_relobj::do_layout): Record input sections in incremental info.
7594 * object.h (Object::output_section): New function.
7595 (Object::output_section_offset): Moved from Relobj.
7596 (Object::get_incremental_reloc_base): New function.
7597 (Object::get_incremental_reloc_count): New function.
7598 (Object::do_output_section): New function.
7599 (Object::do_output_section_offset): Moved from Relobj.
7600 (Object::do_get_incremental_reloc_base): New function.
7601 (Object::do_get_incremental_reloc_count): New function.
7602 (Object::Object): Initialize new data members.
7603 (Relobj::output_section): Renamed do_output_section and moved to
7604 protected.
7605 (Relobj::output_section_offset): Moved to Object.
7606 (Relobj::do_get_incremental_reloc_base): New function.
7607 (Relobj::do_get_incremental_reloc_count): New function.
7608 (Relobj::allocate_incremental_reloc_counts): New function.
7609 (Relobj::count_incremental_reloc): New function.
7610 (Relobj::finalize_incremental_relocs): New function.
7611 (Relobj::next_incremental_reloc_index): New function.
7612 (Relobj::reloc_counts_): New data member.
7613 (Relobj::reloc_bases_): New data member.
7614 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7615 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7616 (Sized_relobj::incremental_relocs_scan): New function.
7617 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7618 (Sized_relobj::incremental_relocs_write): New function.
7619 (Sized_relobj::incremental_relocs_write_reltype): New function.
7620 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7621 incremental link.
7622 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7623 archives and object files elsewhere.
7624 (Add_symbols::run): Report object files here.
7625 (Finish_group::run): Report end of archive at end of group.
7626 * reloc.cc: Include layout.h, incremental.h.
7627 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7628 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7629 (Sized_relobj::incremental_relocs_scan): New function.
7630 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7631 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7632 (Sized_relobj::incremental_relocs_write): New function.
7633 (Sized_relobj::incremental_relocs_write_reltype): New function.
7634 * script.cc (read_input_script): Rewrite test for incremental link.
7635 Change call to Incremental_inputs::report_script.
7636 * symtab.h (Symbol_table::first_global_index): New function.
7637 (Symbol_table::output_count): New function.
7638
ce0d1972
DK
76392010-08-12 Doug Kwan <dougkwan@google.com>
7640
7641 * arm.cc (Target_arm::merge_object_attributes): Check command line
7642 options --no-wchar-size-warning and --no-enum-size-warning.
7643 * options.h (General_options): Add ld-compatible options
7644 --no-enum-size-warning and --no-wchar-size-warning.
7645
6e5710ce
ILT
76462010-08-04 Ian Lance Taylor <iant@google.com>
7647
7648 * x86_64.cc (Target_x86_64::Scan::local): Use
7649 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7650 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7651 (Target_x86_64::Scan::global): Likewise.
7652 (Target_x86_64::Relocate::relocate): Likewise.
7653 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7654 Likewise.
7655
fef830db
CC
76562010-08-03 Cary Coutant <ccoutant@google.com>
7657
7658 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7659 to reserve space in merged_strings vector. Keep total input size
7660 for stats.
7661 (Output_merge_string::do_print_merge_stats): Print total input size.
7662 * merge.h (Output_merge_string): Add input_size_ field.
7663 * stringpool.cc (Stringpool_template::string_length): Move
7664 implementations out of Stringpool_template class and place in
7665 stringpool.h.
7666 * stringpool.h (string_length): Move out of Stringpool_template.
7667
1e3811b0
ILT
76682010-08-03 Ian Lance Taylor <iant@google.com>
7669
7670 PR 11712
7671 * layout.cc (relaxation_loop_body): If address of load segment is
7672 set, adjust address to include headers if possible.
7673
7af0c620
ILT
76742010-08-03 Ian Lance Taylor <iant@google.com>
7675
7676 * version.cc (version_string): Bump to 1.10.
7677
22f0da72
ILT
76782010-08-03 Ian Lance Taylor <iant@google.com>
7679
7680 PR 11805
7681 * layout.h (enum Output_section_order): Define.
7682 (class Layout): Update declarations.
7683 * layout.cc (Layout::get_output_section): Add order parameter.
7684 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7685 is_first_non_relro parameters. Change all callers.
7686 (Layout::choose_output_section): Likewise.
7687 (Layout::add_output_section_data): Likewise.
7688 (Layout::make_output_section): Likewise. Set order.
7689 (Layout::default_section_order): New function.
7690 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7691 * output.cc (Output_section::Output_section): Initialize order_.
7692 Don't initialize deleted fields.
7693 (Output_segment::Output_segment): Don't initialize deleted
7694 fields.
7695 (Output_segment::add_output_section_to_load): New function
7696 replacing add_output_section. Change all callers to call this or
7697 add_output_section_to_nonload.
7698 (Output_segment::add_output_section_to_nonload): New function.
7699 (Output_segment::remove_output_section): Rewrite.
7700 (Output_segment::add_initial_output_data): Likewise.
7701 (Output_segment::has_any_data_sections): Likewise.
7702 (Output_segment::is_first_section_relro): Likewise.
7703 (Output_segment::maximum_alignment): Likewise.
7704 (Output_segment::has_dynamic_reloc): New function replacing
7705 dynamic_reloc_count. Change all callers.
7706 (Output_segment::has_dynamic_reloc_list): New function replacing
7707 dynamic_reloc_count_list. Change all callers.
7708 (Output_segment::set_section_addresses): Rewrite.
7709 (Output_segment::set_offset): Rewrite.
7710 (Output_segment::find_first_and_last_list): Remove.
7711 (Output_segment::set_tls_offsets): Rewrite.
7712 (Output_segment::first_section_load_address): Likewise.
7713 (Output_segment::output_section_count): Likewise.
7714 (Output_segment::section_with_lowest_load_address): Likewise.
7715 (Output_segment::write_section_headers): Likewise.
7716 (Output_segment::print_sections_to_map): Likewise.
7717 * output.h (class Output_data): Remove dynamic_reloc_count_
7718 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7719 (Output_data::add_dynamic_reloc): Rewrite.
7720 (Output_data::has_dynamic_reloc): New function.
7721 (Output_data::dynamic_reloc_count): Remove.
7722 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7723 is_last_relro_, is_first_non_relro_, is_interp_,
7724 is_dynamic_linker_section_ fields. Add order and set_order
7725 functions. Remove is_relro_local, set_is_relro_local,
7726 is_last_relro, set_is_last_relro, is_first_non_relro,
7727 set_is_first_non_relro functions, is_interp, set_is_interp,
7728 is_dynamic_linker_section, and set_is_dynamic_linker_section
7729 functions.
7730 (class Output_segment): Change Output_data_list from std::list to
7731 std:;vector. Add output_lists_ field. Remove output_data_ and
7732 output_bss_ fields. Update declarations.
7733
3ff2ccb0
ILT
77342010-08-02 Ian Lance Taylor <iant@google.com>
7735
7736 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7737 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7738 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7739
88a4108b
ILT
77402010-08-02 Ian Lance Taylor <iant@google.com>
7741
7742 PR 11855
7743 * script.cc (Script_options::Script_options): Initialize
7744 symbol_definitions_ and symbol_references_.
7745 (Script_options::add_symbol_assignment): Update
7746 symbol_definitions_ and symbol_references_.
7747 (Script_options::add_symbol_reference): New function.
7748 (script_symbol): New function.
7749 * script.h (class Script_options): Add symbol_definitions_ and
7750 symbol_references_ fields.
7751 (Script_options::referenced_const_iterator): New type.
7752 (Script_options::referenced_begin): New function.
7753 (Script_options::referenced_end): New function.
7754 (Script_options::is_referenced): New function.
7755 (Script_options::any_unreferenced): New function.
7756 * script-c.h (script_symbol): Declare.
7757 * yyscript.y (exp): Call script_symbol.
7758 * symtab.cc: Include "script.h".
7759 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7760 Change all callers. Check symbols referenced by scripts.
7761 (Symbol_table::add_undefined_symbols_from_command_line): Add
7762 layout parameter. Change all callers.
7763 (Symbol_table::do_add_undefined_symbols_from_command_line):
7764 Likewise. Break out loop body. Check symbols referenced by
7765 scripts.
7766 (Symbol_table::add_undefined_symbol_from_command_line): New
7767 function broken out of
7768 do_add_undefined_symbols_from_command_line.
7769 * symtab.h (class Symbol_table): Update declarations.
7770 * archive.cc: Include "layout.h".
7771 (Archive::should_include_member): Add layout parameter. Change
7772 all callers. Check for symbol mentioned in expression.
7773 * archive.h (class Archive): Update declaration.
7774 * object.cc (Sized_relobj::do_should_include_member): Add layout
7775 parameter.
7776 * object.h (Object::should_include_member): Add layout parameter.
7777 Change all callers.
7778 (Object::do_should_include_member): Add layout parameter.
7779 (class Sized_relobj): Update declaration.
7780 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7781 parameter.
7782 * dynobj.h (class Sized_dynobj): Update declaration.
7783 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7784 layout parameter.
7785 * plugin.h (class Sized_pluginobj): Update declaration.
7786
5f1ab67a
ILT
77872010-08-02 Ian Lance Taylor <iant@google.com>
7788
7789 PR 11866
7790 * output.cc (Output_segment::set_offset): Search for the first and
7791 last sections rather than assuming that the list is in order.
7792 (Output_segment::find_first_and_last_list): New function.
7793 * output.h (class Output_segment): Update declarations.
7794 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7795 (relro_strip_test_SOURCES): New variable.
7796 (relro_strip_test_DEPENDENCIES): New variable.
7797 (relro_strip_test_LDFLAGS): New variable.
7798 (relro_strip_test_LDADD): New variable.
7799 (relro_strip_test.so): New target.
7800
a8df5856
ILT
78012010-08-02 Ian Lance Taylor <iant@google.com>
7802
7803 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7804 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7805 (Target_i386::got_tlsdesc_section): New function.
7806 (Target_i386::got_section): Create space for GOT entries for
7807 TLSDESC relocations.
7808 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7809 R_386_TLS_GOTDESC.
7810 (Target_i386::Scan::global): Likewise.
7811 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7812 using TLSDESC GOT.
7813 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7814 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7815 (Target_x86_64::got_tlsdesc_section): New function.
7816 (Target_x86_64::got_section): Create space for GOT entries for
7817 TLSDESC relocations.
7818 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
7819 R_386_TLS_GOTDESC.
7820 (Target_x86_64::Scan::global): Likewise.
7821 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
7822 using TLSDESC GOT.
7823
0c10a0a6
ILT
78242010-08-02 Ian Lance Taylor <iant@google.com>
7825
7826 * testsuite/final_layout.sh: Use dc to convert from hex to
7827 decimal.
7828
41cbeecc
ST
78292010-07-29 Sriraman Tallam <tmsriram@google.com>
7830
7831 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
7832 paramter to the call to gold::gc_process_relocs.
7833 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
7834 paramter to the call to gold::gc_process_relocs.
7835 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
7836 parameter to the call to gold::gc_process_relocs.
7837 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
7838 template parameter to the call to gold::gc_process_relocs.
7839 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
7840 paramter to the call to gold::gc_process_relocs.
7841 * gc.h (get_embedded_addend_size): New function.
7842 (gc_process_relocs): Save the size of the reloc for use by ICF.
7843 * icf.cc (get_section_contents): Get the addend from the text section
7844 for SHT_REL relocation sections.
7845 * icf.h (Icf::Reloc_addend_size_info): New typedef.
7846 (Icf::Reloc_info): Add new member reloc_addend_size_info.
7847 * int_encoding.h (read_from_pointer): New overloaded function.
7848 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
7849 * testsuite/icf_sht_rel_addend_test.sh: New file.
7850 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
7851 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
7852
6ea55b82
RW
78532010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7854
7855 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
7856 * Makefile.in: Regenerate.
7857 * testsuite/Makefile.in: Regenerate.
7858
9691462b
ILT
78592010-07-27 Jeffrey Yasskin <jyasskin@google.com>
7860
7861 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
7862 * gold/testsuite/debug_msg.cc: Likewise.
7863 * gold/testsuite/odr_violation1.cc
7864 * gold/testsuite/odr_violation2.cc
7865
76897331
CC
78662010-07-21 Cary Coutant <ccoutant@google.com>
7867
7868 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
7869 string, and length fields.
7870 (Output_merge_string::Merged_strings_list): New type.
7871 (Output_merge_string::Merged_strings_lists): New typedef.
7872 (Output_merge_string): Replace merged_strings_ with
7873 merged_strings_lists_.
7874 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
7875 Merged_strings_list per input object and section. Don't store pointer
7876 to the string. Don't store length with each merged string entry.
7877 (Output_merge_string::finalize_merged_data): Loop over list of merged
7878 strings lists. Recompute length of each merged string.
7879
78384e8f
CC
78802010-07-15 Cary Coutant <ccoutant@google.com>
7881
7882 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
7883 here.
7884
783659f9
ILT
78852010-07-14 Ian Lance Taylor <iant@google.com>
7886
7887 * descriptors.cc (Descriptors::open): Report correct name in error
7888 message.
7889
131687b4
DK
78902010-07-13 Doug Kwan <dougkwan@google.com>
7891
7892 * arm.cc (Arm_input_section::Arm_input_section): For a
7893 SHT_ARM_EXIDX section, always keeps the input sections.
7894 (Arm_input_section::set_exidx_section_link): New method.
7895 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
7896 has_errors_ to false.
7897 (Arm_exidx_input_section::has_errors,
7898 Arm_exidx_input_section::set_has_errors): New methods.
7899 (Arm_exidx_input_section::has_errors_): New data member.
7900 (Arm_relobj::get_exidx_shndx_list): New method.
7901 (Arm_output_section::append_text_sections_to_list): Do not skip
7902 section without SHF_EXECINSTR.
7903 (Arm_output_section::fix_exidx_coverage): Skip input sections with
7904 errors.
2e702c99 7905 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
7906 section header. Make error messages more verbose. Check for
7907 a non-executable section linked to an EXIDX section.
7908 (Arm_relobj::do_read_symbols): Remove error checking, which has been
7909 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
7910 check that there is no deferred EXIDX section if we exit early.
7911 Instead of not making an EXIDX section in case of an error, make one
7912 and set the has_errors flag of it.
7913 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
7914 in a relocatable link.
7915 (Target_arm::do_relax): Look for the EXIDX output section instead of
7916 assuming that it is called .ARM.exidx.
2e702c99 7917 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
7918 section list. Do not check for SHF_EXECINSTR section flags but
7919 skip any input section with errors.
7920 * output.cc (Output_section::Output_section): Initialize
7921 always_keeps_input_sections_ to false.
7922 (Output_section::add_input_section): Check for
7923 always_keeps_input_sections_.
7924 * output.h (Output_section::always_keeps_input_sections,
7925 Output_section::set_always_keeps_input_sections): New methods.
7926 (Output_section::always_keeps_input_sections): New data member.
7927
69517287
RÁE
79282010-07-13 Rafael Espindola <espindola@google.com>
7929
7930 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
7931 * fileread.h (Input_file): Add try_extra_search_path and find_file.
7932
82742395
ILT
79332010-07-13 Philip Herron <herron.philip@googlemail.com>
7934 Ian Lance Taylor <iant@google.com>
7935
7936 * output.h (Output_section_lookup_maps::add_merge_section):
7937 Correct check of whether value was inserted.
7938 (Output_section_lookup_maps::add_merge_input_section): Likewise.
7939 (Output_section_lookup_maps::add_relaxed_input_section):
7940 Likewise.
7941 * arm.cc (Target_arm::got_section): Remove used local os.
7942 * i386.cc (Target_i386::got_section): Likewise.
7943 * x86_64.cc (Target_x86_64::got_section): Likewise.
7944 * sparc.cc (Target_sparc::got_section): Likewise.
7945 (Target_sparc::relocate): Remove unused local have_got_offset.
7946 * powerpc.cc (Target_powerpc::relocate): Likewise.
7947
f2d707b5
ILT
79482010-07-13 Ian Lance Taylor <iant@google.com>
7949
241531d6
ILT
7950 * compressed_output.cc (zlib_decompress): Fix signature in
7951 !HAVE_ZLIB_H case.
7952
f2d707b5
ILT
7953 * archive.cc (Archive::include_member): Unlock an external member
7954 of a thin archive. Don't bother to delete an object we know is
7955 NULL.
7956
a2e47362
CC
79572010-07-12 Cary Coutant <ccoutant@google.com>
7958
7959 * compressed_output.cc (zlib_decompress): New function.
7960 (get_uncompressed_size): New function.
7961 (decompress_input_section): New function.
7962 * compressed_output.h (get_uncompressed_size): New function.
7963 (decompress_input_section): New function.
7964 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
7965 Handle compressed debug sections.
7966 * layout.cc (is_compressed_debug_section): New function.
7967 (Layout::output_section_name): Map compressed section names to
7968 canonical names.
7969 * layout.h (is_compressed_debug_section): New function.
7970 (is_debug_info_section): Recognize compressed debug sections.
7971 * merge.cc: Include compressed_output.h.
7972 (Output_merge_data::do_add_input_section): Handle compressed
7973 debug sections.
7974 (Output_merge_string::do_add_input_section): Handle compressed
7975 debug sections.
7976 * object.cc: Include compressed_output.h.
7977 (Sized_relobj::Sized_relobj): Initialize new data members.
7978 (build_compressed_section_map): New function.
7979 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
7980 * object.h (Object::section_is_compressed): New method.
7981 (Object::do_section_is_compressed): New method.
7982 (Sized_relobj::Compressed_section_map): New type.
7983 (Sized_relobj::do_section_is_compressed): New method.
7984 (Sized_relobj::compressed_sections_): New data member.
7985 * output.cc (Output_section::add_input_section): Handle compressed
7986 debug sections.
7987 * reloc.cc: Include compressed_output.h.
7988 (Sized_relobj::write_sections): Handle compressed debug sections.
7989
ce279a62
CC
79902010-07-08 Cary Coutant <ccoutant@google.com>
7991
7992 * resolve.cc (Symbol_table::resolve): Remember whether undef was
7993 weak when resolving to a dynamic def.
7994 (Symbol_table::should_override): Add adjust_dyndef flag; set it
7995 for weak undef/dynamic def cases. Adjust callers.
7996 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
7997 undef_binding_weak_.
7998 (Symbol_table::sized_write_globals): Adjust symbol binding.
7999 (Symbol_table::sized_write_symbol): Add binding parameter.
8000 * symtab.h (Symbol::set_undef_binding): New method.
8001 (Symbol::is_undef_binding_weak): New method.
8002 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8003 (Symbol_table::should_override): Add new parameter.
8004 (Symbol_table::sized_write_symbol): Add new parameter.
8005
8006 * testsuite/weak_undef_file1.cc: Add new test case.
8007 * testsuite/weak_undef_file2.cc: Fix header comment.
8008 * testsuite/weak_undef_test.cc: Add new test case.
8009
b2286c10
DK
80102010-06-29 Doug Kwan <dougkwan@google.com>
8011
8012 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8013 Initialize USE_SYMBOL_.
8014 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8015 definition.
8016 (Arm_reloc_property::uses_symbol_): New data member declaration.
8017 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8018 uses symbol value and symbol is undefined but not weakly undefined.
8019
4802450a
RÁE
80202010-06-28 Rafael Espindola <espindola@google.com>
8021
8022 * plugin.cc (Plugin::load): Use dlerror.
8023
e5ca47ba
ILT
80242010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8025
8026 * symtab.cc (detect_odr_violations): When reporting an ODR
8027 violation, report an object where the symbol is defined.
8028
8a75a161
DK
80292010-06-25 Doug Kwan <dougkwan@google.com>
8030
8031 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8032 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8033 definition.
8034 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8035 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8036 target hook to detect function points.
8037 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8038 * icf.h (Icf::check_section_for_function_pointers): Change type of
8039 parameter SECTION_NAME to const reference to std::string. Use
8040 target hook to determine if section may have unsafe pointers.
8041 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8042 method definition.
8043
42218b9f
RÁE
80442010-06-21 Rafael Espindola <espindola@google.com>
8045
8046 * fileread.cc (Input_file::find_fie): New
8047 (Input_file::open): Use Input_file::find_fie.
8048 * fileread.h (Input_file::find_fie): New
8049 * plugin.cc (set_extra_library_path): New.
8050 (Plugin::load): Add set_extra_library_path to the transfer vector.
8051 (Plugin_manager::set_extra_library_path): New.
8052 (Plugin_manager::add_input_file): Use the extra search path if set.
8053 (set_extra_library_path(): New.
8054 * plugin.h (Plugin_manager): Add set_extra_library_path and
8055 extra_search_path_.
8056
a0506cca
CC
80572010-06-19 Cary Coutant <ccoutant@google.com>
8058
8059 * layout.cc (gdb_sections): Add .debug_types.
8060 (lines_only_debug_sections): Likewise.
8061
6508b958
RÁE
80622010-06-18 Rafael Espindola <espindola@google.com>
8063
8064 * plugin.cc (add_input_file,add_input_library)
8065 (Plugin_manager::add_input_file): Make filename arguments const.
8066 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8067 const.
8068
3e235302
DK
80692010-06-16 Doug Kwan <dougkwan@google.com>
8070
8071 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8072 .ARM.attributes section if we have not merged any input
8073 attributes sections.
8074
106e8a6c
DK
80752010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8076
8077 * arm.cc: Allow combining objects with no EABI version
8078 information.
8079
91ff43fe
RÁE
80802010-06-15 Rafael Espindola <espindola@google.com>
8081
8082 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8083
68ed838c
ILT
80842010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8085
8086 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8087 (struct iovec): Correct !HAVE_READV definition.
8088
f3a2388f
CC
80892010-06-10 Cary Coutant <ccoutant@google.com>
8090
8091 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8092 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8093 reloc sections.
8094 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8095
8096 PR 11683
8097 * symtab.h (Symbol::is_placeholder): New member function.
8098 * target-reloc.h (relocate_section): Check for placeholder symbols.
8099
8100 * testsuite/Makefile.am (plugin_test_8): New test.
8101 (plugin_test_9): New test.
8102 * testsuite/Makefile.in: Regenerate.
8103
e1df38aa
NC
81042010-06-09 Nick Clifton <nickc@redhat.com>
8105
8106 * yyscript.y (input_list_element): Allow strings prefixed with
8107 the '-' character. Treat these as libraries.
8108 * script.cc (script_add_library): New function. Adds a library
8109 specified by "-l<name>" found in an input script.
8110 * script-c.h: Add prototype for script_add_library.
8111
25bbe950
DK
81122010-06-07 Doug Kwan <dougkwan@google.com>
8113
8114 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8115 Restrict stub-group size to be within long conditional branch
8116 range when working around cortex-A8 erratum.
8117
0f32ea4c
ILT
81182010-06-07 Damien Diederen <dd@crosstwine.com>
8119
8120 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8121 #ifdef typo.
8122
8fe2a369
ST
81232010-06-03 Sriraman Tallam <tmsriram@google.com>
8124
8125 PR gold/11658
8126 * output.cc
8127 (Output_section::Input_section_sort_entry::compare_section_ordering):
8128 Change to return non-zero correctly.
8129 (Output_section::Input_section_sort_section_order_index_compare
8130 ::operator()): Change to fix ambiguity in comparisons.
8131
6e9ba2ca
ST
81322010-06-01 Sriraman Tallam <tmsriram@google.com>
8133
8134 * gold.h (is_wildcard_string): New function.
8135 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8136 (Layout::layout_eh_frame): Ditto.
8137 (Layout::find_section_order_index): New method.
8138 (Layout::read_layout_from_file): New method.
8139 * layout.h (Layout::find_section_order_index): New method.
8140 (Layout::read_layout_from_file): New method.
8141 (Layout::input_section_position_): New private member.
8142 (Layout::input_section_glob_): New private member.
8143 * main.cc (main): Call read_layout_from_file here.
8144 * options.h (--section-ordering-file): New option.
8145 * output.cc (Output_section::input_section_order_specified_): New
8146 member.
8147 (Output_section::Output_section): Initialize new member.
8148 (Output_section::add_input_section): Add new parameter.
8149 Keep input sections when --section-ordering-file is used.
8150 (Output_section::set_final_data_size): Sort input sections when
8151 section ordering file is specified.
8152 (Output_section::Input_section_sort_entry): Add new parameter.
8153 Check sorting type.
8154 (Output_section::Input_section_sort_entry::compare_section_ordering):
8155 New method.
8156 (Output_section::Input_section_sort_compare::operator()): Change to
8157 consider section_order_index.
8158 (Output_section::Input_section_sort_init_fini_compare::operator()):
8159 Change to consider section_order_index.
8160 (Output_section::Input_section_sort_section_order_index_compare
8161 ::operator()): New method.
8162 (Output_section::sort_attached_input_sections): Change to sort
8163 according to section order when specified.
e1df38aa
NC
8164 (Output_section::add_input_section<32, true>): Add new parameter.
8165 (Output_section::add_input_section<64, true>): Add new parameter.
8166 (Output_section::add_input_section<32, false>): Add new parameter.
8167 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8168 * output.h (Output_section::add_input_section): Add new parameter.
8169 (Output_section::input_section_order_specified): New
8170 method.
8171 (Output_section::set_input_section_order_specified): New method.
8172 (Input_section::Input_section): Initialize section_order_index_.
8173 (Input_section::section_order_index): New method.
8174 (Input_section::set_section_order_index): New method.
8175 (Input_section::section_order_index_): New member.
8176 (Input_section::Input_section_sort_section_order_index_compare): New
8177 struct.
8178 (Output_section::input_section_order_specified_): New member.
8179 * script-sections.cc (is_wildcard_string): Delete and move modified
8180 method to gold.h.
8181 (Output_section_element_input::Output_section_element_input): Modify
8182 call to is_wildcard_string.
8183 (Output_section_element_input::Input_section_pattern
8184 ::Input_section_pattern): Ditto.
8185 (Output_section_element_input::Output_section_element_input): Ditto.
8186 * testsuite/Makefile.am (final_layout): New test case.
8187 * testsuite/Makefile.in: Regenerate.
8188 * testsuite/final_layout.cc: New file.
8189 * testsuite/final_layout.sh: New file.
8190
3537c84b
RÁE
81912010-06-01 Rafael Espindola <espindola@google.com>
8192
8193 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8194
105b6afd
RÁE
81952010-06-01 Rafael Espindola <espindola@google.com>
8196
8197 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8198 visibility of symbols.
8199
29e11421
DK
82002010-05-27 Doug Kwan <dougkwan@google.com>
8201
8202 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8203 from start of output section instead of address for a local symbol
8204 in a merged or relaxed section when doing a relocatable link.
8205
5e0f337e
RÁE
82062010-05-26 Rafael Espindola <espindola@google.com>
8207
703d02da 8208 PR 11604
5e0f337e
RÁE
8209 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8210 adding sections the garbage collector removed.
8211 * gold/testsuite/Makefile.am: Add test.
8212 * gold/testsuite/Makefile.in: Regenerate.
8213 * gold/testsuite/plugin_test_7.sh: New.
8214 * gold/testsuite/plugin_test_7_1.c: New.
8215 * gold/testsuite/plugin_test_7_2.c: New.
8216
f4187277
RÁE
82172010-05-26 Rafael Espindola <espindola@google.com>
8218
8219 * script-sections.cc (Output_section_definition::set_section_addresses):
8220 Check for --section-start.
8221
5c388529
DK
82222010-05-26 Doug Kwan <dougkwan@google.com>
8223
8224 * arm.cc (Arm_scan_relocatable_relocs): New class.
8225 (Target_arm::relocate_special_relocatable): New method.
8226 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8227 (Arm_relocate_functions::thumb_branch_common): Same.
8228 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8229 instead of Default_scan_relocatable_relocs.
8230 * target-reloc.h (relocate_for_relocatable): Let target handle
8231 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8232 * target.h (Sized_target::relocate_special_relocatable): New method.
8233
bca1c3ae
ILT
82342010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8235
8236 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8237
0439c796
DK
82382010-05-23 Doug Kwan <dougkwan@google.com>
8239
8240 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8241 instead of a cast.
8242 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8243 with a direct branch, not a conditional branch, to a stub.
8244 * merge.cc (Output_merge_base::record_input_section): New method
8245 defintion.
8246 (Output_merge_data::do_add_input_section): Record input section if
8247 keeps-input-sections flag is set.
8248 (Output_merge_string::do_add_input_section): Ditto.
8249 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8250 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8251 INPUT_SECTIONS_.
8252 (Output_merge_base::keeps_input_sections,
8253 Output_merge_base::set_keeps_input_sections,
8254 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8255 method definitions.
8256 (Output_merge_base::Input_sections): New type declaration.
8257 (Output_merge_base::input_sections_begin,
8258 Output_merge_base::input_sections_end,
8259 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8260 (Output_merge_base::bool keeps_input_sections_,
8261 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8262 Output_merge_base::input_sections_): New data members.
8263 (Output_merge_data::do_set_keeps_input_sections): New method
8264 defintion.
8265 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8266 * output.cc (Output_section::Input_section::relobj): Move method
8267 defintion from class declaration to here and handle merge sections.
8268 (Output_section::Input_section::shndx): Ditto.
8269 (Output_section::Output_section): Remove initializations of removed
8270 data members and initialize new data member LOOKUP_MAPS_.
8271 (Output_section::add_input_section): Set keeps-input-sections flag
8272 for a newly created merge output section as appropriate. Adjust code
8273 to use Output_section_lookup_maps class.
8274 (Output_section::add_relaxed_input_section): Adjst code for lookup
8275 maps code refactoring.
2e702c99 8276 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8277 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8278 class. If adding input section to a newly created merge output
8279 section fails, remove the new merge section.
8280 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8281 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8282 (Output_section::find_merge_section): Ditto.
0439c796 8283 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8284 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8285 Output_section_lookup_maps class.
8286 (Output_section::get_input_sections): Export merge sections. Adjust
8287 code to use Output_section_lookup_maps class.
8288 (Output_section:::add_script_input_section): Adjust code to use
8289 Output_section_lookup_maps class. Update lookup maps for merge
8290 sections also.
8291 (Output_section::discard_states): Use Output_section_lookup_maps.
8292 (Output_section::restore_states): Same.
8293 * output.h (Merge_section_properties): Move class defintion out of
8294 Output_section.
8295 (Output_section_lookup_maps): New class.
8296 (Output_section::Input_section::is_merge_section): New method
8297 defintion.
8298 (Output_section::Input_section::relobj): Move defintion out of class
8299 defintion. Declare method only.
8300 (Output_section::Input_section::shndx): Ditto.
8301 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8302 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8303 (Output_section::Merge_section_by_properties_map,
8304 Output_section::Output_section_data_by_input_section_map,
8305 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8306 Remove types.
2e702c99 8307 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8308 KEEPS_INPUT_SECTIONS.
8309 (Output_section::build_lookup_maps): New method declaration.
8310 (Output_section::merge_section_map_,
8311 Output_section::merge_section_by_properties_map_,
8312 Output_section::relaxed_input_section_map_,
8313 Output_section::is_relaxed_input_section_map_valid_): Remove data
8314 members.
8315 (Output_section::lookup_maps_): New data member.
8316
76295588
L
83172010-05-21 Doug Kwan <dougkwan@google.com>
8318
8319 PR gold/11619
8320 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8321 avoid a compilation error.
8322
d103a984
RÁE
83232010-05-19 Rafael Espindola <espindola@google.com>
8324
8325 * script-sections.cc (Output_section_definition::allocate_to_segment):
8326 Update the phdrs_list even when the output section is NULL.
8327 * testsuite/Makefile.am: Add test.
8328 * testsuite/Makefile.in: Regenerate.
8329 * testsuite/script_test_9.cc: New.
8330 * testsuite/script_test_9.sh: New.
8331 * testsuite/script_test_9.t: New.
8332
6625d24e
DK
83332010-05-19 Doug Kwan <dougkwan@google.com>
8334
8335 * arm.cc (Arm_input_section::original_size): New method.
8336 (Arm_input_section::do_addralign): Add a cast.
8337 (Arm_input_section::do_output_offset): Remove static cast.
8338 (Arm_input_section::original_addralign,
8339 Arm_input_section::original_size_): Change type to uint32_t.
8340 (Arm_input_section::init): Add safe casts for section alignment
8341 and size.
8342 (Arm_input_section::set_final_data_size): Do not set address and
8343 offset of stub table.
8344 (Arm_output_section::fix_exidx_coverage): Change use of of
8345 Output_section::Simple_input_section to that of
8346 Output_section::Input_section.
8347 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8348 except for the first pass.
8349 * output.cc (Output_section::get_input_sections): Change type of
8350 input_sections to std::list<Input_section>.
8351 (Output_section::add_script_input_section): Rename from
8352 Output_section::add_simple_input_section. Change type of SIS
8353 parameter from Simple_input_section to Input_section.
8354 * output.h (Output_section::Simple_input_section): Remove class.
8355 (Output_section::Input_section): Change class visibility to public.
8356 (Output_section::Input_section::addralign): Use stored alignments
8357 for special input sections if set.
8358 (Output_section::Input_section::set_addralign): New method.
8359 (Output_section::get_input_sections): Change parameter type from
8360 list of Simple_input_section to list of Input_section.
8361 (Output_section::add_script_input_section): Rename from
8362 Output_section::add_simple_input_section. Change first parameter's
8363 type from Simple_input_section to Input_section and remove the
8364 second and third parameters.
8365 * script-sections.cc (Input_section::Input_section_list): Change
8366 type to list of Output_section::Input_section/
8367 (Input_section_info::Input_section_info): Change parameter type of
8368 INPUT_SECTION to Output_section::Input_section.
8369 (Input_section_info::input_section): Change return type.
8370 (Input_section_info::input_section_): Change type to
8371 Output_section::Input_section.
8372 (Output_section_element_input::set_section_addresses): Adjust code
8373 to use Output_section::Input_section instead of
8374 Output_section::Simple_input_section. Adjust code for renaming
8375 of Output_section::add_simple_input_section.
8376 (Orphan_output_section::set_section_addresses): Ditto.
8377
e1e82ea4
RW
83782010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8379
8380 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8381 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8382
91e75c8a
RÁE
83832010-05-18 Rafael Espindola <espindola@google.com>
8384
8385 * options.cc (General_options::finalize): Handle -nostdlib.
8386 * options.h (nostdlib): New option.
8387 * script.cc (script_add_search_dir): Handle -nostdlib.
8388
da59ad79
DK
83892010-05-12 Doug Kwan <dougkwan@google.com>
8390
8391 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8392 attributes section only if there no attributes section after merging.
8393 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8394 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8395 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8396 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8397 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8398 and arm_attr_merge_7.stdout.
8399 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8400 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8401 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8402 arm_attr_merge_7b.o): New rules.
8403 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8404 arm_attr_merge_7
8405 * testsuite/Makefile.in: Regenerate.
8406 * testsuite/arm_attr_merge.sh: New file.
8407 * testsuite/arm_attr_merge_[67][ab].s: Same.
8408
3e01a7fd
NC
84092010-05-05 Nick Clifton <nickc@redhat.com>
8410
8411 * po/es.po: Updated Spanish translation.
8412
7ad2014a
L
84132010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8414
8415 * Makefile.am (install-exec-local): Properly install gold as
8416 default cross linker.
8417 * Makefile.in: Regenerated.
8418
4fda8867
NC
84192010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8420 Nick Clifton <nickc@redhat.com>
8421
8422 * configure.ac (install_as_default): Define and set to false
8423 unless --enable-gold or --enable-gold=both/gold has been
8424 specified.
8425 * configure: Regenerate.
8426
8427 * Makefile.am (install-exec-local): Install the executable as
8428 'ld.gold'. If install_as_default is true then also install it as
8429 'ld'.
8430 * Makefile.in: Regenerated.
8431
bd288ea2
ILT
84322010-04-24 Ian Lance Taylor <iant@google.com>
8433
8434 * layout.cc (Layout::layout_reloc): In relocatable link don't
8435 combine reloc sections for grouped sections.
8436
ef38fd8a
ST
84372010-04-23 Sriraman Tallam <tmsriram@google.com>
8438
8439 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8440 sections that are not ordinary to icf.
8441 * icf.cc (get_section_contents): Handle relocation pointing to section
8442 with no object or shndx information.
8443 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8444 * testsuite/Makefile.in: Regenerate.
8445 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8446 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8447
f6973bdc
ILT
84482010-04-22 Ian Lance Taylor <iant@google.com>
8449
8450 * expression.cc (Expression::Expression_eval_info): Add
8451 result_alignment_pointer field.
8452 (Expression::eval_with_dot): Add result_alignment_pointer
8453 parameter. Change all callers.
8454 (Expression::eval_maybe_dot): Likewise.
8455 (class Binary_expression): Add alignment_pointer parameter to
8456 left_value and right_value. Change all callers.
8457 (BINARY_EXPRESSION): Set result alignment.
8458 (class Trinary_expression): Add alignment_pointer parameter to
8459 arg2_value and arg3_value. Change all callers.
8460 (Trinary_cond::value): Set result alignment.
8461 (Max_expression::value, Min_expression::value): Likewise.
8462 (Align_expression::value): Likewise.
8463 * script-sections.cc (class Sections_element): Add dot_alignment
8464 parameter to set_section_addresses virtual function. Update
8465 instantiations.
8466 (class Output_section_element): Likewise.
8467 (Script_sections::create_segments): Add dot_alignment parameter.
8468 Change all callers.
8469 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8470 (Script_sections::set_phdrs_clause_addresses): Likewise.
8471 * script-sections.h: Update declarations.
8472 * script.h: Update declarations.
8473 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8474 min_p_align.
8475 * testsuite/script_test_3.t: Set large alignment.
8476 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8477 segment has expected alignment.
8478
9c9c98a5
NC
84792010-04-22 Nick Clifton <nickc@redhat.com>
8480
8481 * po/gold.pot: Updated by the Translation project.
8482 * po/vi.po: Updated Vietnamese translation.
8483
2253bfba
L
84842010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8485
8486 * testsuite/Makefile.am (check_PROGRAMS): Add
8487 icf_virtual_function_folding_test.
8488 * testsuite/Makefile.in: Regenerated.
8489
85fdf906
AH
84902010-04-15 Andrew Haley <aph@redhat.com>
8491
8492 * options.h (merge_exidx_entries): New option.
8493 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8494 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8495 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8496 (Target_arm::merge_exidx_entries): New function.
8497 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8498 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8499 to Arm_exidx_fixup constructor.
8500 Add new arg, merge_exidx_entries.
8501 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8502 Arm_output_section::fix_exidx_coverage.
8503
ce97fa81
ST
85042010-04-18 Sriraman Tallam <tmsriram@google.com>
8505
8506 * icf.cc (get_section_contents): Check for preemptible functions.
8507 Ignore addend when appropriate.
8508 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8509 section folded.
8510 (add_from_relobj): Check for section folded.
8511 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8512 * symtab.h (should_add_dynsym_entry): Add new parameter.
8513 * target-reloc.h (scan_relocs): Check for section folded.
8514 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8515 Check reloc types for function pointers in shared objects.
8516 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8517 case.
8518 (icf_preemptible_functions_test): New test case.
8519 (icf_string_merge_test): New test case.
8520 * testsuite.Makefile.in: Regenerate.
8521 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8522 bar_glob. Refactor code.
8523 * testsuite/icf_preemptible_functions_test.cc: New file.
8524 * testsuite/icf_preemptible_functions_test.sh: New file.
8525 * testsuite/icf_string_merge_test.cc: New file.
8526 * testsuite/icf_string_merge_test.sh: New file.
8527 * testsuite/icf_virtual_function_folding_test.cc: New file.
8528 * testsuite/icf_virtual_function_folding_test.sh: New file.
8529
04ceb17c
DK
85302010-04-14 Doug Kwan <dougkwan@google.com>
8531
8532 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8533 for local symbol recounting if we remove a section due to ICF.
8534 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8535 there are no regular objects in input.
8536
153e7da4
DK
85372010-04-13 Doug Kwan <dougkwan@google.com>
8538
8539 * arm.cc (Arm_input_section::set_final_data_size): Compute
8540 accurate final data size instead of using current data size.
8541
4dbd9faf
DK
85422010-04-09 Doug Kwan <dougkwan@google.com>
8543
8544 * layout.cc (Layout::choose_output_section): Handle script section
8545 types.
8546 (Layout::make_output_section_for_script): Add section type parameter.
8547 Handle script section types.
8548 * layout.h (Layout::make_output_section_for_script): Add section
8549 type parameter.
8550 * output.cc (Output_section::Output_section): Initialize data member
8551 is_noload_.
8552 (Output_section::do_reset_address_and_file_offset): Do not set address
8553 to 0 if section is a NOLOAD section.
8554 * output.h (Output_section::is_noload): New method.
8555 (Output_section::set_is_noload): Ditto.
8556 (Output_section::is_noload_): New data member.
8557 * script-c.h (Script_section_type): New enum type.
8558 (struct Parser_output_section_header): Add new file section_type.
8559 * script-sections.cc (Sections_element::output_section_name): Add
8560 parameter for returning script section type.
8561 (Output_section_definition::output_section_name): Ditto.
8562 (Output_section_definition::section_type)P; New method.
8563 (Output_section_definiton::script_section_type_name): Ditto.
8564 (Output_section_definition::script_section_type_): New data member.
8565 (Output_section_definition::Output_section_definition): Initialize
8566 data member Output_section_definition::script_section_type_.
8567 (Output_section_definition::create_sections): Pass script section type
8568 to Layout::make_output_section_for_script.
8569 (Output_section_definition::output_section_name): Return script
8570 section type to caller.
8571 (Output_section_definition::set_section_address): Do not advance
8572 dot value and load address if section type is NOLOAD. Set address
8573 of NOLOAD sections regardless of section flags.
8574 (Output_section_definition::print): Print section type if it is
8575 not SCRIPT_SECTION_TYPE_NONE.
8576 (Output_section_definition::section_type): New method.
8577 (Output_section_definition::script_section_type_name): Ditto.
8578 (Script_sections::output_section_name): Add new parameter
8579 PSECTION_TYPE for returning script section type. Pass it to
8580 section elements. Handle discard sections.
8581 (Sort_output_sections::operator()): Handle NOLOAD sections.
8582 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8583 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8584 returning script section type.
8585 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8586 INFO and NOLOAD.
8587 * yyscript.y (union): Add new field SECTION_TYPE.
8588 (COPY, DSECT, INFO, NOLOAD): New tokens.
8589 (opt_address_and_section_type): Change type to output_section_header.
8590 (section_type): New non-terminal
8591 (section_header): Handle section type.
2253bfba 8592 (opt_address_and_section_type): Return section type value.
4dbd9faf 8593
721ea635
L
85942010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8595
8596 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8597 * testsuite/plugin_common_test_2.c (foo): Likewise.
8598
6bf924b0
DK
85992010-04-08 Doug Kwan <dougkwan@google.com>
8600
8601 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8602 Output_merge_data.
8603 * output.cc (Output_section::add_merge_input_section): Simplify
8604 code and return status of Output_merge_base::add_input_section.
e1df38aa 8605 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8606 returns true.
8607
24af6f92
DK
86082010-04-07 Doug Kwan <dougkwan@google.com>
8609
8610 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8611 if section is marked as containing instructions but has no mapping
8612 symbols.
8613 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8614 correct section index.
8615 (Arm_relobj::find_linked_text_section): Ditto.
8616
00698fc5
CC
86172010-04-07 Cary Coutant <ccoutant@google.com>
8618
8619 * archive.cc (include_member): Destroy Read_symbols_data object before
8620 releasing file.
8621 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8622 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8623 (Read_symbols_data::~Read_symbols_data) New destructor.
8624 (Section_relocs::Section_relocs) New constructor.
8625 (Section_relocs::~Section_relocs) New destructor.
8626 (Read_relocs_data::Read_relocs_data) New constructor.
8627 (Read_relocs_data::~Read_relocs_data) New destructor.
8628 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8629 pointers to NULL after deleting.
8630
7296d933
DK
86312010-04-07 Doug Kwan <dougkwan@google.com>
8632
8633 * arm.cc: Replace "endianity" with "endianness" in comments.
8634 (Arm_exidx_cantunwind): Ditto.
8635 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8636 (Arm_relobj::merge_flags_and_attributes): New method.
8637 (Arm_relobj::merge_flags_and_attributes_): New data member.
8638 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8639 (Arm_relobj::scan_sections_for_stubs): Ditto.
8640 (Arm_relobj::do_read_symbols): Check to see if we really want to
8641 merge processor-specific flags and attributes. Exit early if
8642 an object is empty except for section names and the undefined symbol.
8643 (Target_arm::do_finalize_sections): Move check for ELF format to
8644 Arm_relobj::do_read_symbols. Merge processor specific flags and
8645 attributes from a regular object only when we have determined that
8646 it is aapropriate. Do not create an .ARM.attributes section in
8647 output if there is no regular input object.
8648 (Target_arm::merge_processor_specific_flags): Check
8649 --warn-mismatch before printing any error.
8650 (Target_arm::merge_object_attributes): Ditto.
8651 * gold.cc (queue_middle_tasks): Handle the case in which there is
8652 no regular object in input.
8653 * options.cc (General_options::parse_EB): New method.
8654 (General_options::parse_EL): Same.
8655 (General_options::General_options): Initialize endianness_.
8656 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8657 New options.
8658 (General_options::Endianness): New enum.
8659 (General_options::endianness): New method.
8660 (General_options::endianness_): New data member.
8661 * parameters.cc (Parameters::set_options): Check target endianness.
8662 (Parameters::set_target_once): Ditto.
8663 (Parameters::check_target_endianness): New method.
8664 (parameters_force_valid_target): If either -EL or -EB is specified,
8665 use it to define endianness of default target.
8666 * parameters.h (Parameters::check_target_endianness): New method
8667 declaration.
8668 * target.h (class Target): Change "endianity" to "endianness"
8669 in comments.
8670
efc8d4f2
RW
86712010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8672
8673 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8674 * configure: Regenerate.
8675 * Makefile.in: Regenerate.
8676 * testsuite/Makefile.in: Regenerate.
8677
be234d88
CC
86782010-04-06 Cary Coutant <ccoutant@google.com>
8679
8680 gcc PR lto/42757
8681 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8682 prevailing definitions of common symbols.
8683 * testsuite/plugin_test_6.sh: New test case.
8684 * testsuite/plugin_common_test_1.c: New test case.
8685 * testsuite/plugin_common_test_2.c: New test case.
8686 * testsuite/Makefile.am (plugin_test_6): New test case.
8687 * testsuite/Makefile.in: Regenerate.
8688
bd32c6bd
NC
86892010-04-06 Nick Clifton <nickc@redhat.com>
8690
8691 * po/vi.po: New Vietnamese translation.
8692
323c532f
DK
86932010-03-30 Doug Kwan <dougkwan@google.com>
8694
8695 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8696
4fcd97eb
DK
86972010-03-25 Doug Kwan <dougkwan@google.com>
8698
8699 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8700 to avoid a conversion warning on a 32-bit host.
8701
4ebf39db
ILT
87022010-03-24 Ian Lance Taylor <iant@google.com>
8703
8704 * testsuite/script_test_3.t: Add a TLS segment.
8705 * testsuite/Makefile.am (check_PROGRAMS): Add
8706 tls_phdrs_script_test.
8707 (tls_phdrs_script_test_SOURCES): Define.
8708 (tls_phdrs_script_test_DEPENDENCIES): Define.
8709 (tls_phdrs_script_test_LDFLAGS): Define.
8710 (tls_phdrs_script_test_LDADD): Define.
8711 * testsuite/Makefile.in: Rebuild.
8712
4a599bdd
CC
87132010-03-23 Cary Coutant <ccoutant@google.com>
8714
8715 * fileread.cc (find_or_make_view): Fix comment.
8716
6c93b22c
ILT
87172010-03-23 Ian Lance Taylor <iant@google.com>
8718
8719 * script-sections.cc (class Orphan_section_placement): Define
8720 PLACE_TLS and PLACE_TLS_BSS.
8721 (Orphan_section_placement::Orphan_section_placement): Initialize
8722 new places.
8723 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8724 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8725 (tls_script_test_SOURCES): Define.
8726 (tls_script_test_DEPENDENCIES): Define.
8727 (tls_script_test_LDFLAGS): Define.
8728 (tls_script_test_LDADD): Define.
8729 * testsuite/Makefile.in: Rebuild.
8730
a2c7281b
DK
87312010-03-22 Doug Kwan <dougkwan@google.com>
8732
8733 * arm.cc (Arm_relocate_functions::abs8,
8734 Arm_relocate_functions::abs16): Use correct check for overflow
8735 specified in the ARM ELF specs.
8736 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8737 target of a BLX instruction specially.
8738 (Reloc_stub::stub_type_for_reloc): Ditto.
8739 (Relocate::relocate): Use symbolic names instead of numeric relocation
8740 codes to report error.
8741 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8742 workaround.
8743 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8744 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8745 thumb2_blx_out_of_range.stdout
8746 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8747 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8748 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8749 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8750 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8751 thumb2_blx_in_range, thumb2_blx_in_range.o,
8752 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8753 thumb2_blx_out_of_range.o): New rules.
2e702c99 8754 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
8755 thumb2_blx_in_range and thumb2_blx_out_of_range.
8756 * testsuite/Makefile.in: Regenerate.
8757 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8758 * testsuite/thumb_blx_in_range.s: New file.
8759 * testsuite/thumb_blx_out_of_range.s: New file.
8760
b0193076
RÁE
87612010-03-22 Rafael Espindola <espindola@google.com>
8762
8763 * archive.cc (Should_include): Move to archive.h.
8764 (should_include_member): Make it a member of Archive.
8765 (Lib_group): New.
8766 (Add_lib_group_symbols): New.
8767 * archive.h: Include options.h.
8768 (Archive_member): Moved from Archive.
8769 (Should_include): Moved from archive.cc.
8770 (Lib_group): New.
8771 (Add_lib_group_symbols): New.
8772 * dynobj.cc (do_should_include_member): New.
8773 * dynobj.h (do_should_include_member): New.
8774 * gold.cc (queue_initial_tasks): Update call to queue.
8775 * main.cc (main): Print lib group stats.
8776 * object.cc (do_should_include_member): New.
8777 * object.h: Include archive.h.
8778 (Object::should_include_member): New.
8779 (Object::do_should_include_member): New.
8780 (Sized_relobj::do_should_include_member): New.
8781 * options.cc (General_options::parse_start_lib): New.
8782 (General_options::parse_end_lib): New.
8783 (Input_arguments::add_file): Handle lib groups.
8784 (Input_arguments::start_group): Check we are not in a lib.
8785 (Input_arguments::start_lib): New.
8786 (Input_arguments::end_lib): New.
8787 * options.h (General_options): Add start_lib and end_lib.
8788 (Input_argument::lib_): New.
8789 (Input_argument::lib): New.
8790 (Input_argument::is_lib): New.
8791 (Input_file_lib): New.
8792 (Input_arguments::in_lib_): New.
8793 (Input_arguments::in_lib): New.
8794 (Input_arguments::start_lib): New.
8795 (Input_arguments::end_lib_): New.
8796 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8797 in unused members as preempted.
8798 (Sized_pluginobj::do_should_include_member): New.
8799 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8800 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8801 return the blocker.
8802 (Read_symbols::do_whole_lib_group): New.
8803 (Read_symbols::do_lib_group): New.
8804 (Read_symbols::do_read_symbols): Handle lib groups.
8805 (Read_symbols::get_name): Handle lib groups.
8806 * readsyms.h (Read_symbols): Add an archive member pointer.
8807 (Read_symbols::do_whole_lib_group): New.
8808 (Read_symbols::do_lib_group): New.
8809 (Read_symbols::member_): New.
8810 * script.cc (read_input_script): Update call to queue_soon.
8811
d099120c
DK
88122010-03-19 Doug Kwan <dougkwan@google.com>
8813
8814 * arm.cc (Stub_table::Stub_table): Initialize new data members
8815 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8816 (Stub_table::add_reloc_stub): Assign stub offset and update
8817 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8818 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
8819 New data members.
2e702c99 8820 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
8821 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
8822 instead of going over all reloc stubs.
2e702c99 8823 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
8824 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8825 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 8826 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
8827 Stringpool_template::offset_.
8828 * stringpool.h (Stringpool_template::set_no_zero_null): Set
8829 Stringpool_template::offset_ to zero.
8830
1aa37384
DK
88312010-03-15 Doug Kwan <dougkwan@google.com>
8832
8833 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8834 offset_.
8835 (Stringpool_template::new_key_offset): New method.
8836 (Stringpool_template::add_string): Assign offsets when adding new
8837 strings.
8838 (Stringpool_template::set_string_offsets): Do not set string offsets
8839 when not optimizing.
8840 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
8841 member size_.
2e702c99
RM
8842 (Chunked_vector::clear): Clear size_.
8843 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
8844 (Chunked_vector::size): Return size_.
8845 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 8846 (Chunked_vector::size_): New data member.
1aa37384
DK
8847 (Stringpool_template::set_no_zero_null): Assert string set is empty.
8848 (Stringpool_template::new_key_offset): New method declaration.
8849 (Stringpool_template::offset_): New data member.
8850
b672b057
RÁE
88512010-03-15 Rafael Espindola <espindola@google.com>
8852
8853 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
8854 Add_symbols' constructor.
8855 * readsyms.h (Add_symbols): Remove the input_group member.
8856
b6848d3c
ILT
88572010-03-10 Ian Lance Taylor <iant@google.com>
8858
8859 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
8860 target to ask whether a reference to a symbol requires a stack
8861 split.
8862 * target.h (Target::is_call_to_non_split): New function.
8863 (Target::do_is_call_to_non_split): Declare virtual function.
8864 * target.cc: Include "symtab.h".
8865 (Target::do_is_call_to_non_split): New function.
8866 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
8867
a2a5469e
CC
88682010-03-10 Cary Coutant <ccoutant@google.com>
8869
8870 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
8871 (File_read::open[1]): Remove initial mapping of whole_file_view_.
8872 (File_read::open[2]): Add whole_file_view_ to list of views.
8873 (File_read::make_view): Remove test of whole_file_view_.
8874 (File_read::find_or_make_view): Create whole_file_view_ if
8875 necessary.
8876 (File_read::clear_views): Replace bool parameter with enum;
8877 adjust all callers. Don't delete views with permanent data;
8878 do delete cached views and views from archives if
8879 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
8880 if clearing the corresponding view.
8881 * fileread.h (File_read::Clear_views_mode): New enum.
8882 (File_read::View::is_permanent_view): New method.
8883 (File_read::clear_views): Replace bool parameter
8884 with enum; adjust all callers.
8885 * options.h (General_options): Change keep_files_mapped option;
8886 add map_whole_files.
8887 * readsyms.cc (Add_symbols::run): Delete sd_ object before
8888 releasing the file.
8889 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
8890 the file.
8891
8861f32b
DM
88922010-03-10 David S. Miller <davem@davemloft.net>
8893
8894 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
8895
d62d0f5f
ST
88962010-03-09 Sriraman Tallam <tmsriram@google.com>
8897
8898 * icf.cc (get_section_contents): Add '@' marker after processing the
8899 merge reloc.
8900
9177756d
DK
89012010-03-08 Doug Kwan <dougkwan@google.com>
8902
8903 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
8904 due to a conversion warning.
8905 (Arm_relobj::update_output_local_symbol_count): Check for local
8906 symbol with unset output index.
8907
9e9e071b
ILT
89082010-03-05 Ian Lance Taylor <iant@google.com>
8909
8910 * options.h (class General_options): Add --spare-dynamic-tags.
8911 * output.cc (Output_data_dynamic::set_final_data_size): Implement
8912 --spare-dynamic-tags.
8913
a81ee015
ILT
89142010-03-05 Ian Lance Taylor <iant@google.com>
8915
8916 * incremental.cc: Include "libiberty.h".
8917
44ec90b9
RO
89182010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
8919
8920 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
8921 function, is_info_ member.
8922 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
8923 (Versions::Versions): Update caller.
8924 (Versions::define_base_version): Likewise.
8925 (Versions::add_def): Likewise.
8926
0897ed3b
ST
89272010-03-03 Sriraman Tallam <tmsriram@google.com>
8928
8929 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
8930 (Scan::possible_function_pointer_reloc): New function.
8931 (Scan::local_reloc_may_be_function_pointer): Change to call
8932 possible_function_pointer_reloc.
8933 (Scan::global_reloc_may_be_function_pointer): Ditto.
8934 * icf.h (Icf::check_section_for_function_pointers): Change to reject
8935 relocations in ".data.rel.ro._ZTV" section.
8936 * testsuite/icf_safe_so_test.sh: Change to pass i386.
8937 * testsuite/icf_safe_so_test.cc: Ditto.
8938 * testsuite/icf_safe_test.cc: Ditto.
8939 * testsuite/icf_safe_test.sh: Ditto.
8940
d3bbad62
ILT
89412010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8942 Ian Lance Taylor <iant@google.com>
8943
8944 * target-reloc.h (relocate_section): Check the symbol table index
8945 for -1U before setting the local symbol index.
8946 (scan_relocatable_relocs): If copying the relocation, record that
8947 the local symbol is required.
8948 * object.h (Symbol_value::is_output_symtab_index_set): New
8949 function.
8950 (Symbol_value::may_be_discarded_from_output_symtab): New
8951 function.
8952 (Symbol_value::has_output_symtab_entry): New function.
8953 (Symbol_value::needs_output_symtab_entry): Remove.
8954 (Symbol_value::output_symtab_index): Make sure the symbol index is
8955 set.
8956 (Symbol_value::set_output_symtab_index): Make sure the symbol
8957 index is not set. Make sure the new index is valid.
8958 (Symbol_value::set_must_have_output_symtab_entry): New function.
8959 (Symbol_value::has_output_dynsym_entry): New function.
8960 (Symbol_value::set_output_dynsym_index): Make sure the new index
8961 is valid.
8962 (Sized_relobj::set_must_have_output_symtab_entry): New function.
8963 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
8964 local symbol if permitted.
8965 (Sized_relobj::do_finalize_local_symbols): Call
8966 is_output_symtab_index_set rather than needs_output_symtab_entry.
8967 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
8968 rather than needs_output_symtab_entry. Call
8969 has_output_dynsym_entry rather than needs_output_dynsym_entry.
8970 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
8971 is_output_symtab_index_set rather than needs_output_symtab_entry.
8972 * testsuite/discard_locals_relocatable_test.c: New file.
8973 * testsuite/discard_locals_test.sh: Test -r.
8974 * testsuite/Makefile.am (check_DATA): Add
8975 discard_locals_relocatable_test1.syms,
8976 discard_local_relocatable_test2.syms.
8977 (MOSTLYCLEANFILES): Likewise. Also add
8978 discard_locals_relocatable_test1.lout and
8979 discard_locals_relocatable_test2.out.
8980 (discard_locals_relocatable_test1.syms): New target.
8981 (discard_locals_relocatable_test.o): New target.
8982 (discard_locals_relocatable_test1.out): New target.
8983 (discard_locals_relocatable_test2.syms): New target.
8984 (discard_locals_relocatable_test2.out): New target.
8985 (various): Add missing ../ld-new dependencies.
8986 * testsuite/Makefile.in: Rebuild.
8987
7e8ccf26
NC
89882010-03-03 Nick Clifton <nickc@redhat.com>
8989
8990 * po/fi.po: New Finnish translation.
8991
2a0ff005
DK
89922010-03-01 Doug Kwan <dougkwan@google.com>
8993
8994 * layout.cc (Layout::Layout): Force section types of .init_array*,
8995 .preinit_array* and .fini_array* sections.
8996 * output.cc (Output_section::Input_section_sort_entry::has_priority):
8997 Fix check of return value of std::string::find.().
8998 (Output_section::Input_section_sort_compare::operator()): Remove
8999 comment about .init_array.
9000 (Output_section::Input_section_sort_init_fini_compare::operator()):
9001 New method.
9002 (Output_section::sort_attached_input_sections): Handle .init_array
9003 and .fini_array specially.
9004 * output.h (Output_section::Inut_section_sort_compare): Update
9005 comment.
9006 (Output_section::Input_section_sort_init_fini_compare): New struct.
9007
c3e4ae29
DK
90082010-02-26 Doug Kwan <dougkwan@google.com>
9009
9010 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9011 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9012 * testsuite/debug_msg.sh: Avoid matching source line number for
9013 use of global variable undef_int.
9014
2fd9ae7a
DK
90152010-02-26 Doug Kwan <dougkwan@google.com>
9016
9017 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9018 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9019 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9020 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9021 * options.cc (General_options::General_options): Initialize member
9022 fix_v4bx_.
9023 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9024 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9025 and rm_no_fix_v4bx.stdout
9026 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9027 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9028 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9029 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9030 and arm_no_fix_v4bx.
9031 * Makefile.in: Regenerate.
9032 * testsuite/arm_fix_v4bx.s: New file.
9033 * testsuite/arm_fix_v4bx.sh: Ditto.
9034
67ec7d0b
DK
90352010-02-24 Doug Kwan <dougkwan@google.com>
9036
9037 * arm.cc (Target_arm::got_section): Make the .got section the first
9038 non RELRO section in the data segment.
9039 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9040 suffixes of section names.
9041
10165461
DK
90422010-02-24 Doug Kwan <dougkwan@google.com>
9043
9044 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9045 flags and attributes merging if an input file is a binary file.
9046 * fileread.cc (Input_file::open): Record format of original file.
9047 * fileread.h (Input_file::Format): New enum type.
2e702c99 9048 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9049 (Input_file::format): New method definition.
9050 (Input_file::format_):: New data member.
9051
4a54abbb
DK
90522010-02-24 Doug Kwan <dougkwan@google.com>
9053
9054 * arm.cc (Arm_output_data_got): New class.
9055 (ARM_TCB_SIZE): New constant
9056 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9057 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9058 If user uses a script with a SECTIONS clause, issue only a warning
9059 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9060 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9061 garbage collection.
9062 (Target_arm::got_mode_index_entry): Handle static linking.
9063 (Target_arm::Scan::local): Ditto.
9064 (Target_arm::Scan::global): Ditto.
9065 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9066 all incorrectly implemented relocations.
e1df38aa 9067 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9068 Arm_output_section::fix_exidx_coverage.
9069 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9070 from ".ARM.exidx." and ".ARM.extab.".
9071
ca419a6f
ILT
90722010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9073
9074 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9075 section if it does not already exist.
9076 * attributes.cc (Attributes_section_data::Attributes_section_data):
9077 Don't crash if size is zero.
9078
135b9c78
ILT
90792010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9080 Ian Lance Taylor <iant@google.com>
9081
9082 * gold.cc (queue_middle_tasks): If no input files were opened,
9083 exit.
9084 * workqueue.h (Task_function::Task_function): Assert that there is
9085 a blocker.
9086
bb0bfe4f
DK
90872010-02-22 Doug Kwan <dougkwan@google.com>
9088
9089 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9090 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9091 types to avoid warnings due to different uint64_t implementations
9092 on different hosts.
9093
2a2b6d42
DK
90942010-02-21 Doug Kwan <dougkwan@google.com>
9095
9096 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9097 handling of the maximum backward branch offset.
2e702c99 9098 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9099 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9100 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9101 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9102 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9103 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9104 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9105 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9106 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9107 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9108 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9109 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9110 thumb2_bl_out_of_range.o): New rules.
9111 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9112 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9113 thumb2_bl_out_of_range
9114 * testsuite/Makefile.in: Regenerate.
9115 * testsuite/arm_bl_in_range.s: New file.
9116 * testsuite/arm_bl_out_of_range.s: Ditto.
9117 * testsuite/arm_branch_in_range.sh: Ditto.
9118 * testsuite/arm_branch_range.t: Ditto.
9119 * testsuite/thumb2_branch_range.t: Ditto.
9120 * testsuite/thumb_bl_in_range.s: Ditto.
9121 * testsuite/thumb_bl_out_of_range.s: Ditto.
9122 * testsuite/thumb_branch_range.t: Ditto.
9123
b487ad64
ST
91242010-02-20 Sriraman Tallam <tmsriram@google.com>
9125
9126 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9127 Add reloc offset information.
9128 * icf.cc (get_section_contents): Change iterators to point to the new
9129 vectors. Add reloc offset information to the contents.
9130 * icf.h (Icf::Sections_reachable_info): New typedef.
9131 (Icf::Sections_reachable_list): New typedef.
9132 (Icf::Offset_info): New typedef.
9133 (Icf::Reloc_info): New struct typedef.
9134 (Icf::Reloc_info_list): New typedef.
9135 (Icf::symbol_reloc_list): Delete method.
9136 (Icf::addend_reloc_list): Delete method.
9137 (Icf::section_reloc_list): Delete method.
9138 (Icf::reloc_info_list): New method.
9139 (Icf::reloc_info_list_): New member.
9140
f96accdf
DK
91412010-02-19 Doug Kwan <dougkwan@google.com>
9142
9143 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9144 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9145 * arm.cc (Arm_relocation_functions): New forward declaration.
9146 (Target_arm::Target_arm): Initialize new data members
9147 got_mod_index_offset_ and tls_base_symbol_defined_.
9148 (Target_arm::Relocate::relocate_tls): New method.
9149 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9150 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9151 New methods.
2e702c99 9152 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9153 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9154 (Target_arm::got_mod_index_offset_,
9155 Target_arm::tls_base_symbol_defined_): New data members.
9156 (Target_arm::Scan::local, Target::Scan::global,
9157 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9158 relocations.
9159
c8761b9a
DK
91602010-02-18 Doug Kwan <dougkwan@google.com>
9161
9162 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9163 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9164 text section as a parameter becuase some broken tools may not set
9165 the link in section header.
9166 (Target_arm::has_got_section): New method.
9167 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9168 without any mapping symbol as data only. Remove warning.
9169 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9170 link in its section header, try to discover the link by inspecting the
9171 REL31 relocation at the beginning of the section.
9172 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9173 in error message.
9174 (Target_arm::Scan::global): Treat any reference to the symbol
9175 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9176
21bb3914
ST
91772010-02-12 Sriraman Tallam <tmsriram@google.com>
9178
9179 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9180 (Scan::global_reloc_may_be_function_pointer): New function.
9181 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9182 (Scan::global_reloc_may_be_function_pointer): New function.
9183 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9184 (Scan::global_reloc_may_be_function_pointer): New function.
9185 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9186 (Scan::global_reloc_may_be_function_pointer): New function.
9187 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9188 (Scan::global_reloc_may_be_function_pointer): New function.
9189 (Scan::possible_function_pointer_reloc): New function.
9190 (Target_x86_64::can_check_for_function_pointers): New function.
9191 * gc.h (gc_process_relocs): Scan relocation types to determine if
9192 function pointers were taken for targets that support it.
9193 * icf.cc (Icf::find_identical_sections): Include functions for
9194 folding in safe ICF whose pointer is not taken.
9195 * icf.h (Secn_fptr_taken_set): New typedef.
9196 (fptr_section_id_): New member.
9197 (section_has_function_pointers): New function.
9198 (set_section_has_function_pointers): New function.
9199 (check_section_for_function_pointers): New function.
9200 * options.h: Fix comment for safe ICF option.
9201 * target.h (can_check_for_function_pointers): New function.
9202 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9203 Modify icf_safe_test for X86-64.
9204 * testsuite/Makefile.in: Regenerate.
9205 * testsuite/icf_safe_so_test.cc: New file.
9206 * testsuite/icf_safe_so_test.sh: New file.
9207 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9208 (main): Change to take pointer to function kept_func_3.
9209 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9210 folding is done correctly for X86-64.
9211
0da6fa6c
DM
92122010-02-12 David S. Miller <davem@davemloft.net>
9213
9214 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9215 is_symbolless parameter.
9216 (Output_reloc<SHT_REL>::is_symbolless): New.
9217 (Output_reloc<SHT_REL>::is_symbolless_): New.
9218 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9219 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9220 (Output_reloc<SHT_RELA>::is_symbolless): New.
9221 (Output_data_reloc::add_global): Handle is_symbolless.
9222 (Output_data_reloc::add_global_relative): Likewise.
9223 (Output_data_reloc::add_local): Likewise.
9224 (Output_data_reloc::add_local_relative): Likewise.
9225 (Output_data_reloc::add_symbolless_global_addend): New.
9226 (Output_data_reloc::add_symbolless_local_addend): New.
9227 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9228 is_symbolless.
9229 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9230 instead of ->is_relative_
9231 (Output_reloc::write): Likewise.
9232 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9233 (Output_reloc::write_rel): Simplify.
9234
9235 * sparc.cc (Target_sparc::Scan::local): Use
9236 ->add_symbolless_local_addend as needed.
9237 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9238 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9239 based upon relocation offset.
9240
e4782e83
DK
92412010-02-11 Doug Kwan <dougkwan@google.com>
9242
9243 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9244 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9245 beginning of function.
9246 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9247 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9248 parameter is_32bit in calls to should_apply_static_reloc.
9249 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9250 (check_DATA): Add arm_abs_global.stdout.
9251 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9252 arm_abs_global.stdout): New rules.
9253 (MOSTLLYCLEANFILES): Add arm_abs_global
9254 * Makefile.in: Regenerate.
9255 * testsuite/arm_abs_global.s: New file.
9256 * testsuite/arm_abs_global.sh: Ditto.
9257 * testsuite/arm_abs_lib.s: Ditto.
9258
93ceb764
ILT
92592010-02-11 Ian Lance Taylor <iant@google.com>
9260
9261 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9262 Read_relocs task.
9263 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9264 Allocate_commons_task first.
9265 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9266 task, rather than symtab_lock_.
9267 (Gc_process_relocs::~Gc_process_relocs): New function.
9268 (Gc_process_relocs::is_runnable): Check this_blocker_.
9269 (Gc_process_relocs::locks): Use next_blocker_ rather than
9270 blocker_.
9271 (Scan_relocs::~Scan_relocs): New function.
9272 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9273 symtab_lock_.
9274 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9275 next_blocker_.
9276 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9277 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9278 constructor accordingly.
9279 (class Gc_process_relocs): Likewise.
9280 (class Scan_relocs): Likewise.
9281 * common.h (class Allocate_commons_task): Remove symtab_lock_
9282 field, and corresponding constructor parameter.
9283 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9284 symtab_lock_.
9285 (Allocate_commons_task::locks): Likewise.
9286
114dfbe1
ILT
92872010-02-11 Ian Lance Taylor <iant@google.com>
9288
9289 * gold-threads.h (class Once): Define.
9290 (class Initialize_lock): Rewrite as child of Once.
9291 * gold-threads.cc (class Once_initialize): Define.
9292 (once_pointer_control): New static variable.
9293 (once_pointer, once_arg): New static variables.
9294 (c_run_once): New static function.
9295 (Once::Once, Once::run_once, Once::internal_run): New functions.
9296 (class Initialize_lock_once): Remove.
9297 (initialize_lock_control): Remove.
9298 (initialize_lock_pointer): Remove.
9299 (initialize_lock_once): Remove.
9300 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9301 (Initialize_lock::initialize): Rewrite.
9302 (Initialize_lock::do_run_once): New function.
9303 * archive.cc (Archive::interpret_header): Only clear name if it is
9304 not already empty.
9305 * fileread.cc: Include "gold-threads.h"
9306 (file_counts_lock): New static variable.
9307 (file_counts_initialize_lock): Likewise.
9308 (File_read::release): Only increment counts when using --stats.
9309 Use a lock around the increment.
9310 * parameters.cc (class Set_parameters_target_once): Define.
9311 (set_parameters_target_once): New static variable.
9312 (Parameters::Parameters): Move here from parameters.h.
9313 (Parameters::set_target): Rewrite.
9314 (Parameters::set_target_once): New function.
9315 (Parameters::clear_target): Move here and rewrite.
9316 * parameters.h (class Parameters): Update declarations. Add
9317 set_parameters_target_once_ field.
9318 (Parameters::Parameters): Move to parameters.cc.
9319 (Parameters::clear_target): Likewise.
9320 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9321 task.
9322 (Start_group::~Start_group): New function.
9323 (Start_group::is_runnable): New function.
9324 (Start_group::locks, Start_group::run): New functions.
9325 (Finish_group::run): Change saw_undefined to size_t.
9326 * readsyms.h (class Start_group): Define.
9327 (class Finish_group): Change saw_undefined_ field to size_t.
9328 (Finish_group::Finish_group): Remove saw_undefined and
9329 this_blocker parameters. Change all callers.
9330 (Finish_group::set_saw_undefined): New function.
9331 (Finish_group::set_blocker): New function.
9332 * symtab.h (class Symbol_table): Change saw_undefined to return
9333 size_t. Change saw_undefined_ field to size_t.
9334 * target-select.cc (Set_target_once::do_run_once): New function.
9335 (Target_selector::Target_selector): Initialize set_target_once_
9336 field. Don't initialize lock_ and initialize_lock_ fields.
9337 (Target_selector::instantiate_target): Rewrite.
9338 (Target_selector::set_target): New function.
9339 * target-select.h (class Set_target_once): Define.
9340 (class Target_selector): Update declarations. Make
9341 Set_target_once a friend. Remove lock_ and initialize_lock_
9342 fields. Add set_target_once_ field.
9343
fa17a3f4
ILT
93442010-02-10 Ian Lance Taylor <iant@google.com>
9345
9346 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9347 queueing any tasks.
9348 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9349 (queue_middle_tasks): Add all blockers before queueing any tasks.
9350 (queue_final_tasks): Likewise.
9351 * token.h (Task_token::add_blockers): New function.
9352 * object.h (Input_objects::number_of_relobjs): New function.
9353
c7177d31
ILT
93542010-02-10 Ian Lance Taylor <iant@google.com>
9355
5de0e392
ILT
9356 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9357 shared, not if not position independent.
9358 * x86_64.cc (Relocate::relocate_tls): Likewise.
9359 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9360 (tls_pie_pic_test): New target.
9361 * testsuite/Makefile.in: Rebuild.
9362
c7177d31
ILT
9363 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9364 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9365 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9366 * testsuite/Makefile.in: Rebuild.
9367
684b268a
DM
93682010-02-09 David S. Miller <davem@davemloft.net>
9369
9370 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9371 R_SPARC_RELATIVE using ->add_local_relative().
9372 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9373
612a8d3d
DM
9374 * output.h (Output_data_dynamic::add_section_size): New method
9375 that takes two Output_data objects.
9376 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9377 entry param. Handle it in initializers.
9378 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9379 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9380 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9381 arg.
9382 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9383 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9384 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9385 for dynrel_includes_plt.
9386 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9387 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9388 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9389 before .rela.plt
9390 (Target_sparc::do_finalize_sections): Update to pass true for
9391 dynrel_includes_plt.
9392 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9393 output before .rela.plt
9394 (Target_powerpc::do_finalize_sections): Update to pass true for
9395 dynrel_includes_plt when 32-bit.
9396
cb1be87e
DK
93972010-02-08 Doug Kwan <dougkwan@google.com>
9398
9399 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9400 method.
9401 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9402 Arm_relobj::scan_section_for_cortex_a8_stubs,
9403 Arm_relobj::do_relocation_section): Instead of calling
9404 Output_section::output_address, use faster
9405 Arm_relobj::simple_input_section_output_address.
9406
705b5121
DM
94072010-02-08 David S. Miller <davem@davemloft.net>
9408
9409 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9410 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9411 relocation helper function.
9412
024c4466
DM
9413 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9414 just like R_SPARC_GOT{10,13,22}.
9415 (Target_sparc::Scan::local): Likewise.
9416 (Target_sparc::Relocate:relocate): Likewise.
9417
9109c078
ILT
94182010-02-06 Ian Lance Taylor <iant@google.com>
9419
9420 * configure.ac: Rewrite targetobjs duplicate removal code to use
9421 only shell constructs.
9422 * configure: Rebuild.
9423
cf846138
DK
94242010-02-05 Doug Kwan <dougkwan@google.com>
9425
9426 PR 11247
9427 * arm.cc (Arm_relobj::section_is_scannable): New method.
9428 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9429 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9430
6cfaf60b
DK
94312010-02-04 Doug Kwan <dougkwan@google.com>
9432
9433 PR 11247
9434 * arm-reloc-property.cc (cstdio): Include.
9435 * configure.ac (targetobjs): Remove duplicates.
9436 * configure: Regenerate.
9437 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9438 big and little endian version for a given address size.
9439
5c57f1be
DK
94402010-02-03 Doug Kwan <dougkwan@google.com>
9441
9442 * arm-reloc-property.cc
9443 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9444 definition.
9445 * arm-reloc-property.h
9446 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9447 New method definition.
9448 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9449 declaration.
9450 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9451 overflow to N.
9452 (GOT_PREL): Change implemented to Y.
9453 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9454 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9455 (Arm_relocate_functions::movw_abs_nc): Remove method.
9456 (Arm_relocate_functions::movt_abs): Ditto.
9457 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9458 (Arm_relocate_functions::thm_movt_abs): Ditto.
9459 (Arm_relocate_functions::movw_rel_nc): Ditto.
9460 (Arm_relocate_functions::movw_rel): Ditto.
9461 (Arm_relocate_functions::movt_rel): Ditto.
9462 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9463 (Arm_relocate_functions:thm_movw_rel): Ditto.
9464 (Arm_relocate_functions:thm_movt_rel): Ditto.
9465 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9466 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9467 New method definitions.
9468 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9469 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9470 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9471 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9472 (Target_arm::Relocate::relocate): Check for non-static or
9473 unimplemented relocation code and exit early. Change calls to
9474 Target_arm::reloc_uses_thumb_bit and
9475 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9476 instead. Refactor code to handle similar relocations to increase
9477 code sharing. Remove check for unsupported relocation code in switch
9478 statement.
9479 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9480 relocation property table to find out size. Change error message to
9481 print out the name of a relocation code instead of the numeric value.
9482 (Target_arm::scan_reloc_for_stub): Use relocation property table
9483 instead of calling Target_arm::reloc_uses_thumb_bit().
9484
218c5831
DK
94852010-02-02 Doug Kwan <dougkwan@google.com>
9486
9487 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9488 types of relaxed input section.
9489
0d31c79d
DK
94902010-02-02 Doug Kwan <dougkwan@google.com>
9491
9492 * Makefile.am (HFILES): Add arm-reloc-property.h.
9493 (DEFFILES): New.
2e702c99
RM
9494 (TARGETSOURCES): Add arm-reloc-property.cc
9495 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9496 (libgold_a_SOURCES): $(DEFFILES)
9497 * Makefile.in: Regenerate.
9498 * arm-reloc-property.cc: New file.
9499 * arm-reloc-property.h: New file.
9500 * arm-reloc.def: New file.
9501 * arm.cc: Update comments.
9502 (arm-reloc-property.h): New included header.
9503 (arm_reloc_property_table): New global variable.
9504 (Target_arm::do_select_as_default_target): New method definition.
9505 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9506 arm-reloc-property to targ_extra_obj.
9507 * parameters.cc (set_parameters_target): Call
9508 Target::select_as_default_target().
9509 * target.h (Target::select_as_default_target): New method definition.
9510 (Target::do_select_as_default_target): Same.
9511
546c7457
DK
95122010-02-01 Doug Kwan <dougkwan@google.com>
9513
9514 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9515 first_output_text_section_.
9516 (Arm_exidx_fixup::first_output_text_section): New method definition.
9517 (Arm_exidx_fixup::first_output_text_section_): New data member.
9518 (Arm_exidx_fixup::process_exidx_section): Record the first text
9519 output section seen.
9520 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9521 and entsize in output section header.
9522
11b861d5
DK
95232010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9524
9525 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9526 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9527 (Arm_relocate_functions::thm_alu11): New Method.
9528 (Arm_relocate_functions::thm_pc8): New Method.
9529 (Arm_relocate_functions::thm_pc12): New Method.
9530 (Target_arm::Scan::local): Handle the relocations.
9531 (Target_arm::Scan::global): Likewise.
9532 (Target_arm::Relocate::relocate): Likewise.
9533 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9534
c9a2c125
DK
95352010-01-29 Doug Kwan <dougkwan@google.com>
9536
9537 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9538 of relocation types as ld.
9539
1521477a
DK
95402010-01-29 Doug Kwan <dougkwan@google.com>
9541
9542 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9543 to public.
9544 (Arm_relocate_functions::thumb_branch_common): Ditto.
9545 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9546 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9547 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9548 Arm_relocate_functions::jump24): Remove.
9549 (Target_arm::Relocate::relocate): Adjust code to call
9550 Arm_relocation_functions::arm_branch_common and
9551 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9552 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9553
e7eca48c
DK
95542010-01-29 Doug Kwan <dougkwan@google.com>
9555
9556 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9557 output_local_symbol_count_needs_update_.
9558 (Arm_relobj::output_local_symbol_count_needs_update,
9559 Arm_relobj::set_output_local_symbol_count_needs_update,
9560 Arm_relobj::update_output_local_symbol_count): New methods.
9561 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9562 member.
9563 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9564 of pointed function as in a R_ARM_PREL31 relocation.
9565 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9566 for output local symbol count updating.
9567 (Target_arm::do_relax): Update output local symbol counts in objects
9568 if necessary.
9569 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9570
02961d7e
ILT
95712010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9572
9573 * arm.cc: Added support for the ARM relocations:
9574 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9575 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9576 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9577 movw_prel_nc).
9578 (Arm_relocate_functions::movw_rel): New method.
9579 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9580 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9581 thm_movw_prel_nc).
9582 (Arm_relocate_functions::thm_movw_rel): New method.
9583 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9584 thm_movt_prel).
9585 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9586 relocations.
9587 (Target_arm::Scan::global): Likewise.
9588 (Target_arm::Relocate::relocate): Likewise.
9589 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9590 Likewise.
9591
b10d2873
ILT
95922010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9593
9594 * arm.cc: Added support for ARM group relocations.
9595 (Target_arm::reloc_needs_sym_origin): New method.
9596 (Arm_relocate_functions::calc_grp_kn): New method.
9597 (Arm_relocate_functions::calc_grp_residual): New method.
9598 (Arm_relocate_functions::calc_grp_gn): New method.
9599 (Arm_relocate_functions::arm_grp_alu): New Method.
9600 (Arm_relocate_functions::arm_grp_ldr): New Method.
9601 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9602 (Arm_relocate_functions::arm_grp_ldc): New Method.
9603 (Target_arm::Scan::local): Handle the ARM group relocations.
9604 (Target_arm::Scan::global): Likewise.
9605 (Target_arm::Relocate::relocate): Likewise.
9606 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9607 Likewise.
9608
2b328d4e
DK
96092010-01-26 Doug Kwan <dougkwan@google.com>
9610
9611 * arm.cc (set): Include.
9612 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9613 pointer type.
2e702c99 9614 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9615 (Arm_output_section::append_text_sections_to_list): New method.
9616 (Arm_output_section::fix_exidx_coverage): Ditto.
9617 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9618 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9619 Relobj::set_section_offset() instead of
9620 Sized_relobj::invalidate_section_offset().
2e702c99 9621 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9622 parameter for section headers. Ignore relocation sections for
9623 unallocated sections and EXIDX sections.
9624 (Target_arm::fix_exidx_coverage): New method.
9625 (Target_arm::output_section_address_less_than): New type.
9626 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9627 linked text section instead of the EXIDX section.
9628 (Arm_output_section::create_stub_group): Add an assertion to check
9629 that this is not an EXIDX output section.
9630 (Arm_output_section::append_text_sections_to_list): New method.
9631 (Arm_output_section::fix_exidx_coverage): Ditto.
9632 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9633 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9634 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9635 first pass.
9636 (Target_arm::fix_exidx_coverage): New method.
9637 * object.h (Relobj::set_output_section): New method.
9638 (Sized_relobj::invalidate_section_offset): Remove method.
9639 (Sized_relobj::do_invalidate_section_offset): Remove method.
9640 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9641
c7f3c371
DK
96422010-01-25 Doug Kwan <dougkwan@google.com>
9643
9644 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9645 Fix warning due to signed and unsigned comparison on a 32-bit host.
9646
8923b24c
DK
96472010-01-22 Doug Kwan <dougkwan@google.com>
9648
9649 * arm.cc (Target_arm::do_relax): Record an output section for section
9650 offset adjustment it contains any stub table that has changed.
9651 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9652 offsets in an output section if necessary.
9653 * output.cc (Output_section::Output_section): Initialize
9654 section_offsets_need_adjustments_.
9655 (Output_section::add_input_section_for_script): Renamed to
9656 Output_section::add_simple_input_section.
9657 (Output_section::save_states): Add a comment.
9658 (Output_section::discard_states): New method defintion.
9659 (Output_section::adjust_section_offsets): Same.
9660 * output.h (Output_section::add_input_section_for_script): Renamed to
9661 Output_section::add_simple_input_section.
9662 (Output_section::discard_states): New method declaration.
9663 (Output_section::adjust_section_offsets): Same.
9664 (Output_section::section_offsets_need_adjustment,
9665 Output_section::set_section_offsets_need_adjustment): New method
9666 definitions.
9667 (Output_section::section_offsets_need_adjustment_): New data member.
9668 * script-sections.cc
9669 (Output_section_element_input::set_section_address): Adjust code for
9670 renaming of Output_section::add_input_section_for_script.
9671 (Orphan_output_section::set_section_address): Same.
9672
9b2fd367
DK
96732010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9674
9675 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9676 Fix_v4bx enum values .
9677 * gold/options.h (General_options): New option definitions.
9678 (General_options::fix_v4bx): New method.
9679 (General_options::Fix_v4bx): New enum.
9680 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9681 (General_options::parse_fix_v4bx_interworking): New method.
9682
80d0d023
DK
96832010-01-22 Doug Kwan <dougkwan@google.com>
9684
9685 * arm.cc (Arm_exidx_fixup): New class.
9686
af2cdeae
DK
96872010-01-21 Doug Kwan <dougkwan@google.com>
9688
9689 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9690 classes.
9691 (Arm_exidx_section_offset_map): New type.
9692
993d07c1
DK
96932010-01-21 Doug Kwan <dougkwan@google.com>
9694
9695 * arm.cc (Arm_exidx_input_section): New class.
9696 (Arm_relobj::exidx_input_section_by_link,
9697 Arm_relobj::exidx_input_section_by_shndx,
9698 Arm_relobj::make_exidx_input_section): New methods.
9699 (read_arm_attributes_section): Remove.
9700 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9701 information about them.
9702 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9703 to here.
9704
5ac169d4
DK
97052010-01-20 Doug Kwan <dougkwan@google.com>
9706
9707 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9708 Input_section_specifier to Section_id.
9709 (Target_arm::new_arm_input_section: Adjust code for change of key
9710 type.
9711 (Target_arm::find_arm_input_section): Ditto.
9712 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9713 (Section_id): Remove.
9714 (Garbage_collection::Section_id_hash): Remove.
9715 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9716 (Section_id): Remove.
9717 (Icf::Section_id_hash): Remove.
9718 * object.h (Section_id, Const_section_id, Section_id_hash,
9719 Const_section_id_hash): New type definitions.
9720 * output.cc (Output_section::add_relaxed_input_section): Change to
9721 use Const_section_id instead of Input_section_specifier as key type.
9722 (Output_section::add_merge_input_section): Ditto.
9723 (Output_section::build_relaxation_map): Change to use Section_id
9724 instead of Input_section_specifier as key type.
2e702c99 9725 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
9726 Ditto.
9727 (Output_section::convert_input_sections_to_relaxed_sections): Change
9728 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 9729 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
9730 (Output_section::find_relaxed_input_section): Ditto.
9731 * output.h (Input_section_specifier): Remove class.
9732 (Output_section::Output_section_data_by_input_section_map): Change
9733 key type to Const_section_id.
9734 (Output_section::Output_relaxed_input_section_by_input_section_map):
9735 Ditto.
9736 (Output_section::Relaxation_map): Change key type to Section_id.
9737
a2162063
ILT
97382010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9739
9740 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9741 (class Arm_v4bx_stub): New class.
9742 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9743 (Stub_factory::make_arm_v4bx_stub): New method.
9744 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9745 (Stub_table::empty): Handle v4bx stubs.
9746 (Stub_table::add_arm_v4bx_stub): New method.
9747 (Stub_table::find_arm_v4bx_stub): New method.
9748 (Arm_relocate_functions::v4bx): New method.
9749 (Target_arm::fix_v4bx): New method.
9750 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9751 (Stub_table::relocate_stubs): Likewise.
9752 (Stub_table::do_write): Likewise.
9753 (Stub_table::update_data_size_and_addralign): Likewise.
9754 (Stub_table::finalize_stubs): Likewise.
9755 (Target_arm::Scan::local): Likewise.
9756 (Target_arm::Scan::global): Likewise.
9757 (Target_arm::do_finalize_sections): Likewise.
9758 (Target_arm::Relocate::relocate): Likewise.
9759 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9760 Likewise.
9761 (Target_arm::scan_reloc_for_stub): Likewise.
9762 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9763
5696ab0b
ILT
97642010-01-19 Ian Lance Taylor <iant@google.com>
9765
9766 * output.cc (Output_section_headers::do_sized_write): Write large
9767 segment count to sh_info field.
9768 (Output_file_header::do_sized_write): For large segment count,
9769 write PN_XNUM to e_phnum field.
9770
800d0f56
ILT
97712010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9772
9773 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9774 (Arm_relocate_functions::thm_jump8): New function.
9775 (Arm_relocate_functions::thm_jump11): New function.
9776 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9777 R_ARM_THM_JUMP11.
9778 (Target_arm::Scan::global): Likewise.
9779 (Target_arm::Relocate::relocate): Likewise.
9780 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9781 Likewise.
9782
41263c05
DK
97832010-01-14 Doug Kwan <dougkwan@google.com>
9784
9785 * arm.cc (map, utility): Include headers.
9786 (Target_arm::apply_cortex_a8_workaround): New method.
9787 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9788 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9789 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9790 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9791 the --[no-]fix-cortex-a8 command line options.
9792 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9793 (Target_arm::relocate_stub): Use addend in instruction template.
9794 * options.h (DEFINE_bool): Set the user-set flag.
9795 (General_options): Add --[no-]-fix-cortex options.
9796 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 9797 : Update fast look-up map after conversion.
41263c05 9798
459e9b03
ST
97992010-01-14 Sriraman Tallam <tmsriram@google.com>
9800
9801 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9802 in the first pass of do_layout.
9803
b521dfe4
DK
98042010-01-13 Doug Kwan <dougkwan@google.com>
9805
9806 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9807 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9808 apparent compiler problem of not folding static constant integral
9809 data members of elfcpp::Elf_sizes<32>.
9810
44272192
DK
98112010-01-13 Doug Kwan <dougkwan@google.com>
9812
9813 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9814 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9815 Arm_relobj::scan_section_for_cortex_a8_erratum,
9816 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
9817 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
9818 sections to scan for relocation stubs into a new method
9819 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
9820 relocation and Cortex-A8 stub scanning.
9821 (Target_arm::do_relax): Force stubs to be after stubbed sections
9822 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 9823 the beginning of a new relaxation pass. Update a comment.
44272192
DK
9824 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
9825
44b71ece
ILT
98262010-01-12 Ian Lance Taylor <iant@google.com>
9827
9828 * target-reloc.h (visibility_error): New inline function.
9829 (relocate_section): Call visibility_error.
9830 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
9831 (MOSTLYCLEANFILES): Likewise.
9832 (protected_4_pic.o, protected_3.err): New targets.
9833 * testsuite/protected_4.cc: New file.
9834
a120bc7f
DK
98352010-01-12 Doug Kwan <dougkwan@google.com>
9836
9837 * arm.cc (Cortex_a8_reloc): New class.
9838 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
9839 and cortex_a8_relocs_info_.
9840 (Target_arm::fix_cortex_a8): New method definition.
9841 (Target_arm::Cortex_a8_relocs_info): New type.
9842 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
9843 New data member declarations.
9844 (Target_arm::scan_reloc_for_stub): Record information about
9845 relocations for THUMB branches that might be exempted from the
9846 Cortex-A8 workaround.
9847 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
9848 at the beginning of a relaxation pass.
9849
20138696
DK
98502010-01-12 Doug Kwan <dougkwan@google.com>
9851
9852 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
9853 (Arm_relobj::Mapping_symbol_position,
9854 Arm_reloj::Mapping_symbol_position_less,
9855 Arm_relobj::Mapping_symbols_info): New types.
9856 (Target_arm::is_mapping_symbol_name): New method definition.
9857 (Arm_relobj::do_count_local_symbols): Save information about mapping
9858 symbols.
9859
089d69dc
DK
98602010-01-11 Doug Kwan <dougkwan@google.com>
9861
9862 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
9863 Arm_relocate_functions::thumb32_branch_upper,
9864 Arm_relocate_functions::thumb32_branch_lower,
9865 Arm_relocate_functions::thumb32_cond_branch_offset,
9866 Arm_relocate_functions::thumb32_cond_branch_upper,
9867 Arm_relocate_functions::thumb32_cond_branch_lower,
9868 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
9869 branch offset encoding.
9870 (Arm_relocate_functions::thumb_branch_common): Use new branch
9871 offset encoding methods to avoid code duplication.
9872 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
9873 (Stub_addend_reader::operator()): Use new branch encoding method
9874 to avoid code duplication.
9875
99e5bff2
DK
98762010-01-11 Doug Kwan <dougkwan@google.com>
9877
9878 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
9879 (Target_arm::do_finalize_sections): Define special EXIDX section
9880 symbols only if referenced.
9881 * gc.h (Garbage_collection::add_reference): New method.
9882 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
9883 code duplication.
9884
98e090bd
ILT
98852010-01-11 Ian Lance Taylor <iant@google.com>
9886
d0a91bd8
ILT
9887 * script.cc (Version_script_info::build_expression_list_lookup):
9888 Change complaing about duplicate wildcard match from error to
9889 warning.
9890
98e090bd
ILT
9891 * script.cc (class Lazy_demangler): Recreate--revert part of patch
9892 of 2009-12-30.
9893 (Version_script_info::Version_script_info): Initialize globs_,
9894 default_version_, default_is_global_, and exact_. Don't
9895 initialize globals_ or locals_.
9896 (Version_script_info::build_lookup_tables): Build local symbols
9897 first.
9898 (Version_script_info::unquote): New function.
9899 (Version_script_info::add_exact_match): New function.
9900 (Version_script_info::build_expression_list_lookup): Remove lookup
9901 parameter. Add is_global parameter. Change all callers. Handle
9902 wildcard pattern specially. Unquote pattern. Call
9903 add_exact_match.
9904 (Version_script_info::get_name_to_match): New function.
9905 (Version_script_info::get_symbol_version): New function.
9906 (Version_script_info::get_symbol_version_helper): Remove.
9907 (Version_script_info::check_unmatched_names): Call unquote.
9908 * script.h (class Version_script_info): Change get_symbol_version
9909 to be non-inline and add is_global parameter; change all callers.
9910 Rewrite symbol_is_local. Update declarations. Define struct
9911 Version_tree_match, Exact, Globs. Don't define struct Lookup.
9912 Remove globals_ and locals_ members. Add exact_, globs_,
9913 default_version_, is_global_.
9914 (Version_script_info::Glob): Remove pattern, add expression and
9915 is_global. Update constructor. Change all callers.
9916 * dynobj.cc (Versions::finalize): Mark the version symbol as the
9917 default version.
9918 (Versions::symbol_section_contents): If a symbol is undefined, or
9919 defined in a dynamic object, set the version index to
9920 VER_NDX_LOCAL.
9921 * symtab.cc (Symbol_table::add_from_relobj): Don't call
9922 symbol_is_local.
9923 (Symbol_table::add_from_pluginobj): Likewise.
9924 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
9925
d56962d3
DK
99262010-01-11 Doug Kwan <dougkwan@google.com>
9927
9928 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
9929 (incremental_dump_LDADD): Add linking option for libintl.
9930 * Makefile.in: Regenerate.
9931
94e6ee91
L
99322010-01-11 H.J. Lu <hongjiu.lu@intel.com>
9933
9934 PR gold/11144
9935 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
9936 instead of -Ds.
9937 * testsuite/Makefile.in: Regenerated.
9938
e96c574b
DK
99392010-01-10 Doug Kwan <dougkwan@google.com>
9940
9941 * options.h (DEFINE_var): Use parentheses around argument varname__
9942 in macro body to avoid any unintended subsequent substitutions.
9943
7198066b
ILT
99442010-01-10 Ian Lance Taylor <iant@google.com>
9945
ba4d53bf
ILT
9946 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
9947 candidates before doing symbol resolution.
9948
7198066b
ILT
9949 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
9950 ODR candidates if only one is weak.
9951
a2beed37
ILT
99522010-01-08 Ian Lance Taylor <iant@google.com>
9953
9954 * script.cc (Version_script_info::build_expression_list_lookup):
9955 Don't warn about ambiguous version, just record the ambiguity.
9956 (Version_script_info::get_symbol_version_helper): Give error if
9957 version is ambiguous.
9958
2fb7225c
DK
99592010-01-08 Doug Kwan <dougkwan@google.com>
9960
9961 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
9962 prev_data_size_ and prev_addralign_. Remove initializer for
9963 deleted data member has_been_changed_.
9964 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
9965 to determine if the table is empty.
9966 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
9967 Remove.
9968 (Stub_table::add_reloc_stub): Define method in class definition
9969 instead of just declaring it there.
9970 (Stub_table::add_cortex_a8_stub): New method definition.
9971 (Stub_table::update_data_size_and_addralign): Ditto.
9972 (Stub_table::finalize_stubs): Ditto.
9973 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
9974 (Stub_table::do_addralign_): Return address alignment in the
9975 (Stub_table::do_reset_address_and_file_offset): Define method in
9976 class definition instead of declaring it there. Set current data
9977 size to be the data size of the previous pass.
9978 (Stub_table::set_final_data_size): Use current data size as the
9979 final data size.
9980 (Stub_table::relocate_stub): Change parameter type of stub from
9981 Reloc_stub pointer to Stub pointer.
9982 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
9983 (Stub_table::Cortex_a8_stub_list): New typedef.
9984 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
9985 Stub_table::prev_addralign_): New data member.
9986 (Arm_relobj::Arm_relobj): Initialize data member
9987 section_has_cortex_a8_workaround_.
9988 (Arm_relobj::section_has_cortex_a8_workaround,
9989 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
9990 definitions.
9991 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
9992 declarations.
9993 (Target_arm::relocate_stub): Change parameter type of stub from
9994 Reloc_stub pointer to Stub pointer.
9995 (Insn_template::size, Insn_template::alignment): Handle
9996 THUMB16_SPECIAL_TYPE.
9997 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
9998 Stub_table::update_data_size_and_addralign,
9999 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10000 definitions.
10001 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10002 (Stub_table::do_write): Ditto.
10003 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10004
880cd20d
ILT
100052010-01-08 Ian Lance Taylor <iant@google.com>
10006
10007 PR 11108
10008 * symtab.h (class Symbol): Remove fields is_target_special_ and
10009 has_plt_offset_. Add field is_defined_in_discarded_section_.
10010 (Symbol::is_defined_in_discarded_section): New function.
10011 (Symbol::set_is_defined_in_discarded_section): New function.
10012 (Symbol::has_plt_offset): Rewrite.
10013 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10014 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10015 Don't initialize is_target_special_ or has_plt_offset_.
10016 Initialize is_defined_in_discarded_section_.
10017 (Symbol_table::add_from_relobj): If appropriate, set
10018 is_defined_in_discarded_section.
10019 * resolve.cc (Symbol::override_base_with_special): Don't test
10020 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10021 * target-reloc.h (relocate_section): Do special handling for
10022 symbols defined in discarded sections for global symbols as well
10023 as local symbols.
10024
2703e3eb
ILT
100252010-01-08 Ian Lance Taylor <iant@google.com>
10026
10027 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10028 the SHT_SYMTAB case.
10029
339d40a3
ILT
100302010-01-08 Ian Lance Taylor <iant@google.com>
10031
10032 * object.cc (Sized_relobj::do_layout): Don't get confused if
10033 layout_eh_frame returns NULL.
10034
abecea76
ILT
100352010-01-08 Ian Lance Taylor <iant@google.com>
10036
10037 PR 11084
10038 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10039 dynamic symbol table, use the normal symbol table.
10040 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10041 symbol table.
10042
6b7dd3f3
ILT
100432010-01-08 Ian Lance Taylor <iant@google.com>
10044
10045 PR 11072
10046 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10047 sections.
10048
36c50e63
L
100492010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10050
10051 * version.cc (print_version): Change to "Copyright 2010".
10052
e291e7b9
ILT
100532010-01-08 Ian Lance Taylor <iant@google.com>
10054
10055 PR 10287
10056 PR 11063
10057 * i386.cc (class Target_i386): Change return type of plt_section
10058 to be non-const.
10059 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10060 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10061 tls_desc_rel_ field.
10062 (Output_data_plt_i386::rel_tls_desc): New function.
10063 (Target_i386::rel_tls_desc_section): New function.
10064 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10065 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10066 R_386_TLS_DESC reloc in rel_tls_desc_section.
10067 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10068 Define struct Tlsdesc_info.
10069 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10070 (Target_x86_64::do_reloc_symbol_index): New function.
10071 (Target_x86_64::add_tlsdesc_info): New function.
10072 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10073 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10074 tlsdesc_rel_ field.
10075 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10076 all callers.
10077 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10078 (Target_x86_64::rela_tlsdesc_section): New function.
10079 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10080 handling.
10081 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10082 (Target_x86_64::do_reloc_addend): New function.
10083 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10084 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10085 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10086 (Output_reloc::type): New function.
10087 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10088 (Output_reloc::is_target_specific): New function.
10089 (Output_reloc::target_arg): New function.
10090 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10091 absolute relocs and target specific relocs.
10092 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10093 add_target_specific.
10094 (class Output_data_reloc) [SHT_RELA]: Likewise.
10095 * output.cc (Output_reloc::Output_reloc): Add four new versions
10096 for absolute relocs and target specific relocs.
10097 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10098 (Output_reloc::get_symbol_index): Likewise.
10099 (Output_reloc::local_section_offset): Check that local_sym_index_
10100 is not TARGET_CODE or 0.
10101 (Output_reloc::symbol_value): Likewise.
10102 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10103 reloc.
10104 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10105 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10106 functions.
10107 * layout.cc (add_target_dynamic_tags): Use output section for
10108 DT_PLTRELSZ and DT_JMPREL.
10109
3a44184e
ILT
101102010-01-07 Ian Lance Taylor <iant@google.com>
10111
10112 PR 11061
10113 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10114 function.
10115 (class Output_data_reloc_generic): Define.
10116 (class Output_data_reloc_base): Change base class to
10117 Output_data_reloc_generic. Change add() method to call
10118 bump_relative_reloc_count for a relative reloc. Remove
10119 sort_relocs_ field.
10120 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10121 to sort_relocs().
10122 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10123 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10124 appropriate.
10125 * layout.h (class Layout): Update declaration.
10126
ea715a34
ILT
101272010-01-07 Ian Lance Taylor <iant@google.com>
10128
10129 * output.h (class Output_data): Add const version of
10130 output_section and do_output_section.
10131 (class Output_section_data): Add const version of
10132 do_output_section.
10133 (class Output_section): Likewise.
10134 * layout.cc (Layout::add_target_dynamic_tags): New function.
10135 * layout.h (class Layout): Update declarations.
10136 * arm.cc (Target_arm::do_finalize_sections): Use
10137 add_target_dynamic_tags.
10138 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10139 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10140 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10141 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10142
659948a4
ILT
101432010-01-07 Ian Lance Taylor <iant@google.com>
10144
10145 PR 11042
10146 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10147 object as needed.
10148
9d3b86f6
ILT
101492010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10150 Ian Lance Taylor <iant@google.com>
10151
10152 PR 11019
10153 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10154 Xindex::read_symtab_xindex.
10155
bb0d3eb0
DK
101562010-01-07 Doug Kwan <dougkwan@google.com>
10157
10158 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10159 (Insn_template::thumb16_bcond_insn): New method declaration.
10160 (Insn_template): Fix spelling.
10161 (Stub::thumb16_special): New method declaration.
10162 (Stub::do_write): Define virtual method which was previously pure
10163 virtual.
10164 (Stub::do_thumb16_special): New method declaration.
10165 (Stub::do_fixed_endian_write): New template member.
10166 (Reloc_stub::do_write): Remove.
10167 (Reloc_stub::do_fixed_endian_write): Remove.
10168 (Cortex_a8_stub): New class definition.
10169 (Stub_factory::make_cortex_a8_stub): New method definition.
10170 (Stub_factory::Stub_factory): Add missing static storage class
10171 qualifier for elf32_arm_stub_a8_veneer_blx.
10172
ffeef7df
ILT
101732010-01-07 Ian Lance Taylor <iant@google.com>
10174
dc3f80fe
ILT
10175 PR 10980
10176 * options.h (class General_options): Add --warn-unresolved-symbols
10177 and --error-unresolved-symbols.
10178 * errors.cc (Errors::undefined_symbol): Implement
10179 --warn-unresolved-symbols.
10180
ffeef7df
ILT
10181 * options.h (class General_options): Add -z text and -z textoff.
10182 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10183
f1ec9ded
ST
101842010-01-06 Sriraman Tallam <tmsriram@google.com>
10185
10186 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10187 (Garbage_collection::cident_sections): New function.
10188 (Garbage_collection::add_cident_section): New function.
10189 (Garbage_collection::cident_sections_): New member.
10190 (gc_process_relocs): Add references to sections whose names are C
10191 identifiers.
10192 * gold.h (cident_section_start_prefix): New constant.
10193 (cident_section_stop_prefix): New constant.
10194 (is_cident): New function.
10195 * layout.cc (Layout::define_section_symbols): Replace string constants
10196 with the newly defined constants.
10197 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10198 C identifiers.
10199 * testsuite/Makefile.am: Add gc_orphan_section_test.
10200 * testsuite/Makefile.in: Regenerate.
10201 * testsuite/gc_orphan_section_test.cc: New file.
10202 * testsuite/gc_orphan_section_test.sh: New file.
10203
6eda8c29
ILT
102042010-01-06 Ian Lance Taylor <iant@google.com>
10205
b9674e17
ILT
10206 PR 10980
10207 * options.h (class General_options): Add --warn-shared-textrel.
10208 * layout.cc (Layout::finish_dynamic_section): Implement
10209 --warn-shared-textrel.
10210
6eda8c29
ILT
10211 PR 10980
10212 * options.h (class General_options): Add --warn-multiple-gp.
10213
32dcd44e
ILT
102142010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10215
10216 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10217 $(THREADSLIB) and $(LIBDL).
10218 * Makefile.in: Rebuild.
10219
a192ba05
ILT
102202010-01-06 Ian Lance Taylor <iant@google.com>
10221
10222 PR 10980
10223 * options.cc (General_options::parse_section_start): New function.
10224 (General_options::section_start): New function.
10225 (General_options::General_options): Initialize all members.
10226 * options.h: Include <map>
10227 (class General_options): Add --section-start. Add section_starts_
10228 member.
10229 * layout.cc (Layout::attach_allocated_section_to_segment): If
10230 --section-start was used, set the address of the segment. Remove
10231 local sort_sections.
10232 (Layout::relaxation_loop_body): If the address of the load segment
10233 has been set by --section-start, don't use it.
10234 * output.h (Output_segment::update_flags_for_output_section): New
10235 function.
10236 * output.cc (Output_segment::add_output_section): Call
10237 update_flags_for_output_section.
10238
dde3f402
ILT
102392010-01-05 Ian Lance Taylor <iant@google.com>
10240
62dfdd4d
ILT
10241 PR 10980
10242 * options.h (class General_options): Add --undefined-version.
10243 * script.cc (struct Version_expression): Add was_matched_by_symbol
10244 field.
10245 (Version_script_info::matched_symbol): New function.
10246 (Version_script_info::get_symbol_version_helper): Call
10247 matched_symbol.
10248 (Version_script_info::check_unmatched_names): New function.
10249 * script.h (class Version_script_info): Update declarations.
10250 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10251
9c4ae156
ILT
10252 * options.h (class General_options): Use DEFINE_bool_alias for
10253 allow_multiple_definition.
10254 * resolve.cc (Symbol_table::should_override): Don't test
10255 allow_multiple_definition.
10256
dde3f402
ILT
10257 PR 10980
10258 * options.h (class General_options): Add --cref.
10259 * main.cc (main): Print cref table if --cref. Don't close mapfile
10260 until after printing cref table.
10261 * cref.cc: Include "symtab.h".
10262 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10263 (Cref_table_compare::operator()): New function.
10264 (Cref_inputs::gather_cref): New function.
10265 (filecol): New static const.
10266 (Cref_inputs::print_cref): New function.
10267 (Cref::print_cref): New function.
10268 * cref.h: Include <cstdio>.
10269 (class Cref): Update declarations.
10270 * mapfile.h (Mapfile::file): New function.
10271 * object.h (class Object): Define Symbols. Declare virtual
10272 do_get_global_symbols.
10273 (Object::get_global_symbols): New function.
10274 * object.cc (Input_objects::add_object): Pass object to cref_ if
10275 --cref.
10276 (Input_objects::archive_start): Likewise.
10277 (Input_objects::archive_stop): Likewise.
10278 (Input_objects::print_cref): New function.
10279 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10280 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10281 --cref.
10282 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10283 function.
10284 * plugin.h (class Sized_pluginobj): Update declarations.
10285
8781f709
ILT
102862010-01-05 Ian Lance Taylor <iant@google.com>
10287
10288 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10289 to is_default_version. Rename insdef to insdefault.
10290 (Symbol_table::add_from_relobj): Rename def to is_default_version
10291 and local to is_forced_local.
10292 (Symbol_table::add_from_pluginobj): Likewise.
10293 (Symbol_table::add_from_dynobj): Likewise.
10294 (Symbol_table::define_special_symbol): Rename insdef to
10295 insdefault.
10296
fe35d28d
ILT
102972010-01-04 Ian Lance Taylor <iant@google.com>
10298
30bc8c46
ILT
10299 PR 10980
10300 * options.h (class General_options): Add
10301 --allow-multiple-definition and -z muldefs.
10302 * resolve.cc (Symbol_table::should_override): Don't warn about a
10303 multiple symbol definition if --allow-multiple-definition or -z
10304 muldefs.
10305
7eaea549
ILT
10306 PR 10980
10307 * options.h (class General_options): Add --add-needed and
10308 --copy-dt-needed-entries. Tweak --as-needed help entry.
10309 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10310 error if --copy-dt-needed-entries aka --add-needed is used and
10311 would cause a change in behaviour.
10312
fe35d28d
ILT
10313 PR 10980
10314 * options.h (class General_options): Add -G as a short version of
10315 --shared. Add no-op options -assert, -g, and -i.
10316
55a2bb35
ST
103172010-01-04 Sriraman Tallam <tmsriram@google.com>
10318
10319 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10320 check for .text or .gnu.linkonce.t sections.
10321 * icf.cc (Icf::find_identical_sections): Ditto.
10322 Change the detection for mangled function name within the section
10323 name.
10324 * icf.h (is_section_foldable_candidate): New function.
10325
719328e1
ILT
103262009-12-30 Ian Lance Taylor <iant@google.com>
10327
10328 PR 10980
10329 * options.h (class General_options): Permit two dashes with
10330 --retain-symbols-file.
10331
d7bb5745
ILT
103322009-12-30 Ian Lance Taylor <iant@google.com>
10333
403a15dd
ILT
10334 PR 10979
10335 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10336 don't put the file header and segment headers in the text
10337 segment.
10338
eda294df
ILT
10339 PR 10979
10340 * common.cc (Sort_commons::operator()): Stabilize sort when both
10341 entries are NULL.
10342 (Symbol_table::do_allocate_commons_list): When allocating common
10343 symbols, skip a symbol which is no longer common.
10344 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10345 an object before checking its type.
10346 * testsuite/common_test_2.c: New file.
10347 * testsuite/common_test_3.c: New file.
10348 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10349 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10350 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10351 (common_test_2_pic.o, common_test_2.so): New targets.
10352 (common_test_3_pic.o, common_test_3.so): New targets.
10353 * testsuite/Makefile.in: Rebuild.
10354
d7bb5745
ILT
10355 PR 10979
10356 * script.cc (read_input_script): If we see a new SECTIONS clause,
10357 and we have added an input section, give an error.
10358 * layout.h (class Layout): Add have_added_input_section function.
10359 Add have_added_input_section_ field.
10360 * layout.cc (Layout::Layout): Initialize
10361 have_added_input_section_.
10362 (Layout::layout): Set have_added_input_section_.
10363 (Layout::layout_eh_frame): Likewise.
10364
fc59c572
ILT
103652009-12-30 Ian Lance Taylor <iant@google.com>
10366
10367 PR 10931
10368 * options.h (class General_options): Add --sort-common option.
10369 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10370 * common.cc (Sort_common): Add sort_order parameter to
10371 constructor. Add sort_order_ field.
10372 (Sort_commons::operator): Check sort_order_.
10373 (Symbol_table::allocate_commons): Determine the sort order.
10374 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10375 Change all callers.
10376 (Symbol_table::do_allocate_commons_list): Likewise.
10377
1c74fab0
ILT
103782009-12-30 Ian Lance Taylor <iant@google.com>
10379
10380 PR 10916
10381 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10382 symbols from this object, don't change the visibility of an
10383 undefined symbol.
10384 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10385
6affe781
ILT
103862009-12-30 Ian Lance Taylor <iant@google.com>
10387
10388 PR 10861
10389 * script.h (class Version_script_info): Define Language enum.
10390 Update declarations. Define Glob, Exact, and Lookup types. Add
10391 new fields globals_, locals_, and is_finalized_.
10392 * script.cc: Various formatting fixes.
10393 (class Parser_closure): Change language_stack_ from a vector of
10394 std::string to one of Version_script_info::Language. Adjust all
10395 uses accordingly.
10396 (class Lazy_demangler): Remove.
10397 (struct Version_expression): Change language from std::string to
10398 Version_script_info::Language.
10399 (Version_script_info::Version_script_info): New function.
10400 (Version_script_info::~Version_script_info): Don't call clear.
10401 (Version_script_info::finalize): New function.
10402 (Version_script_info::build_lookup_tables): New function.
10403 (Version_script_info::build_expression_list_lookup): New
10404 function.
10405 (Version_script_info::get_symbol_version_helper): Rewrite to use
10406 lookup tables.
10407 (Version_script_info::print_expression_list): Adjust to use
10408 Version_script_info::Language.
10409 (script_push_lex_into_version_mode): Check that the version script
10410 has not been finalized.
10411 (version_script_push_lang): Change language string to
10412 Version_script_info::Language.
10413 * options.cc (Command_line::version_script): New function.
10414 * options.h (class General_options): Add finalize_dynamic_list
10415 function. Change version_script from declaration to definition.
10416 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10417 * testsuite/version_script.map: Remove duplicate def of foo.
10418 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10419 version_script.map.
10420 * testsuite/Makefile.in: Rebuild.
10421
818bf354
ILT
104222009-12-30 Ian Lance Taylor <iant@google.com>
10423
10424 PR 10843
10425 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10426 if the input symbol index is 0, make the output symbol index 0.
10427
ebcc8304
ILT
104282009-12-30 Ian Lance Taylor <iant@google.com>
10429
10430 PR 10670
10431 * options.h (class General_options): Add -x/--discard-all.
10432 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10433 --discard-all. If the local symbol needs a dynamic entry, check
10434 that before handling --discard-locals.
10435
176fe33f
ILT
104362009-12-30 Ian Lance Taylor <iant@google.com>
10437
bb321bb1
ILT
10438 PR 10450
10439 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10440 flags to PF_R.
10441 (Output_segment::add_output_section): Don't change the flags if
10442 the type is PT_TLS.
10443
176fe33f
ILT
10444 PR 10450
10445 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10446 GNU hash table if they need a dynamic value. Otherwise, don't add
10447 them if they are defined in a dynamic object or are forced local.
10448
e8cd95c7
ILT
104492009-12-29 Ian Lance Taylor <iant@google.com>
10450
1b81fb71
ILT
10451 PR 10450
10452 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10453 .gnu.hash table for a 32-bit target.
10454
8d6d383d
ILT
10455 PR 10450
10456 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10457 regular and a dynamic object only needs a dynamic symbol table
10458 entry if it is externally visible.
10459
e785ec03
ILT
10460 PR 10450
10461 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10462 constructor. Add global_offset_table_ field.
10463 (Target_i386::got_section): Set global_offset_table_.
10464 (Target_i386::do_finalize_sections): Set global_offset_table_
10465 size.
10466 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10467 in constructor. Add global_offset_table_ field.
10468 (Target_x86_64::got_section): Set global_offset_table_.
10469 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10470 size.
10471
1a2dff53
ILT
10472 * layout.cc (Layout::Layout): Initialize increase_relro_.
10473 (Layout::get_output_section): Add is_relro, is_last_relro, and
10474 is_first_non_relro parameters. Change all callers.
10475 (Layout::choose_output_section): Likewise.
10476 (Layout::add_output_section_data): Likewise.
10477 (Layout::make_output_section): Likewise.
10478 (Layout::set_segment_offsets): Clear increase_relro when using a
10479 linker script.
10480 * layout.h (class Layout): Add increase_relro method. Add
10481 increase_relro_ field. Update declarations.
10482 * output.cc (Output_section::Output_section): Initialize
10483 is_last_relro_ and is_first_non_relro_.
10484 (Output_segment::add_output_section): Group relro sections is
10485 do_sort is true. Handle is_last_relro and is_first_non_relro.
10486 (Output_segment::maximum_alignment): Remove relro handling.
10487 (Output_segment::set_section_addresses): Add increase_relro
10488 parameter. Change all callers. Add initial alignment to align
10489 relro sections on separate page. Remove old relro handling.
10490 (Output_segment::set_section_list_addresses): Remove in_relro
10491 parameter. Change all callers.
10492 (Output_segment::set_offset): Add increase parameter. Change all
10493 callers. Remove old relro handling.
10494 * output.h (class Output_section): Add new methods: is_last_relro,
10495 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10496 Add is_last_relro_ and is_first_non_relro_ fields.
10497 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10498 Create separate .got.plt section. Call increase_relro.
10499 * x86_64.cc (Target_x86_64::got_section): Likewise.
10500 * testsuite/relro_script_test.t: Add .got.plt.
10501
f0ba79e2
ILT
10502 PR 10450
10503 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10504 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10505 (Layout::finalize): Call set_dynamic_symbol_size.
10506 (Layout::set_dynamic_symbol_size): New function.
10507 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10508 set_dynamic_symbol_size.
10509
e8cd95c7
ILT
10510 PR 10450
10511 * output.h (class Output_section): Add is_entsize_zero_ field.
10512 * output.cc (Output_section::Output_section): Initialize
10513 is_entsize_zero_.
10514 (Output_section::set_entsize): If two different entsizes are
10515 requested, force it to zero.
10516 (Output_section::add_input_section): Set flags for .debug_str
10517 before updating section flags. Set entsize.
10518 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10519 and SHF_STRING if all input sections have those flags.
10520
3e1b9a8a
RÁE
105212009-12-29 Rafael Espindola <espindola@google.com>
10522
10523 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10524 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10525 reporting.
3e1b9a8a 10526
3dcad376
ST
105272009-12-29 Sriraman Tallam <tmsriram@google.com>
10528
10529 * options.cc (General_options::parse_version): Allow -v to exit
10530 without an error if there is nothing to link.
10531
084e2665
ILT
105322009-12-29 Ian Lance Taylor <iant@google.com>
10533
10534 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10535 using a version of gcc before 4.1.
10536 * configure: Rebuild.
10537
250acde3
CD
105382009-12-28 Chris Demetriou <cgd@google.com>
10539
10540 * attributes.cc (Output_attributes_section_data::do_write): Use
10541 std::vector::front rather than std::vector::data.
10542
99fff23b
ILT
105432009-12-28 Ian Lance Taylor <iant@google.com>
10544
10545 * symtab.h (class Symbol_table): Add enum Defined.
10546 * resolve.cc (Symbol_table::should_override): Add defined
10547 parameter. Change all callers. Test whether object is NULL
10548 before calling a method on it.
10549 (Symbol_table::report_resolve_problem): Add defined parameter.
10550 Change all callers.
10551 (Symbol_table::should_override_with_special): Likewise.
10552 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10553 parameter. Change all callers.
10554 (Symbol_table::do_define_in_output_data): Likewise.
10555 (Symbol_table::define_in_output_segment): Likewise.
10556 (Symbol_table::do_define_in_output_segment): Likewise.
10557 (Symbol_table::define_as_constant): Likewise.
10558 (Symbol_table::do_define_as_constant): Likewise.
10559 * script.h (class Symbol_assignment): Add is_defsym parameter to
10560 constructor; change all callers.
10561 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10562 parameter. Change all callers. Add is_defsym_ field.
10563 (class Parser_closure): Add parsing_defsym parameter to
10564 constructor; change all callers. Add parsing_defsym accessor
10565 function. Add parsing_defsym_ field.
10566
556bd683
ILT
105672009-12-28 Ian Lance Taylor <iant@google.com>
10568
10569 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10570 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10571
1782c879
ILT
105722009-12-23 Ian Lance Taylor <iant@google.com>
10573
10574 * i386.cc (Target_i386::do_calls_non_split): Recognize
10575 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10576 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10577 -fsplit-stack prologue when using %r11.
1782c879 10578
329ca2b1
ST
105792009-12-21 Sriraman Tallam <tmsriram@google.com>
10580
10581 * options.cc (General_options::parse_version): Make -v continue and do
10582 the link like GNU ld does.
10583
d675ff46
RÁE
105842009-12-17 Rafael Avila de Espindola <espindola@google.com>
10585
10586 * Makefile.am (CCFILES): Add timer.cc.
10587 (HFILES): Add timer.h.
10588 * configure.ac: Check for sysconf and times.
10589 * main.cc: include timer.h.
10590 (main): Use Timer instead of get_run_time.
10591 * timer.cc: New.
10592 * timer.h: New.
10593 * workqueue.cc: include timer.h.
10594 (Workqueue::find_and_run_task):
10595 Report user, sys and wall time.
10596 * Makefile.in: Regenerate.
10597 * config.in: Regenerate.
10598 * configure: Regenerate.
10599
d6344fb5
DK
106002009-12-16 Doug Kwan <dougkwan@google.com>
10601
10602 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10603 sections.
10604 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10605 relaxed input sections.
10606 * output.cc (Output_section::find_relaxed_input_section): Change
10607 return type to Output_relaxed_input_section pointer. Adjust code
10608 for new type of relaxed_input_section_map_.
10609 * output.h (Output_section::find_relaxed_input_section): Change
10610 return type to Output_relaxed_input_section pointer.
10611 (Output_section::Output_relaxed_input_section_by_input_section_map):
10612 New type.
10613 (Output_section::relaxed_input_section_map_): Change type to
10614 Output_section::Output_relaxed_input_section_by_input_section_map.
10615 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10616 input section.
10617
0e0d5469
ILT
106182009-12-15 Ian Lance Taylor <iant@google.com>
10619
10620 * layout.cc (Layout::create_shstrtab): Only write out after input
10621 sections if we are compressing debug sections.
10622
0649a889
ILT
106232009-12-15 Ian Lance Taylor <iant@google.com>
10624
10625 * archive.cc (Archive::add_symbols): Only look up a symbol without
10626 a version if there is, in fact, a version.
10627
2ea97941
ILT
106282009-12-14 Ian Lance Taylor <iant@google.com>
10629
10630 Revert -Wshadow changes, all changes from:
10631 2009-12-11 Doug Kwan <dougkwan@google.com>
10632 2009-12-11 Nick Clifton <nickc@redhat.com>
10633 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10634
b0eec2cc
DK
106352009-12-11 Doug Kwan <dougkwan@google.com>
10636
10637 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10638 due to -Wshadow.
10639 * attributes.cc (Object_attribute::size): Ditto.
10640 (Attributes_section_data::size): Ditto.
10641 (Attributes_section_data::Attributes_section_data): Ditto.
10642 (Output_attributes_section_data::do_write): Ditto.
10643 * attributes.h (Object_attribute::set_type): Ditto.
10644 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10645
91d6fa6a
NC
106462009-12-11 Nick Clifton <nickc@redhat.com>
10647
10648 * archive.cc: Fix shadowed variable warnings.
10649 * arm.cc: Likewise.
10650 * compressed_output.cc: Likewise.
10651 * compressed_output.h: Likewise.
10652 * configure: Likewise.
10653 * dwarf_reader.cc: Likewise.
10654 * dynobj.cc: Likewise.
10655 * dynobj.h: Likewise.
10656 * ehframe.cc: Likewise.
10657 * ehframe.h: Likewise.
10658 * errors.cc: Likewise.
10659 * expression.cc: Likewise.
10660 * fileread.cc: Likewise.
10661 * fileread.h: Likewise.
10662 * freebsd.h: Likewise.
10663 * i386.cc: Likewise.
10664 * icf.cc: Likewise.
10665 * incremental.h: Likewise.
10666 * layout.cc: Likewise.
10667 * layout.h: Likewise.
10668 * mapfile.cc: Likewise.
10669 * merge.cc: Likewise.
10670 * merge.h: Likewise.
10671 * object.cc: Likewise.
10672 * object.h: Likewise.
10673 * options.h: Likewise.
10674 * output.cc: Likewise.
10675 * output.h: Likewise.
10676 * parameters.cc: Likewise.
10677 * plugin.cc: Likewise.
10678 * powerpc.cc: Likewise.
10679 * reduced_debug_output.cc: Likewise.
10680 * reduced_debug_output.h: Likewise.
10681 * reloc.cc: Likewise.
10682 * reloc.h: Likewise.
10683 * resolve.cc: Likewise.
10684 * script-sections.cc: Likewise.
10685 * script.cc: Likewise.
10686 * script.h: Likewise.
10687 * sparc.cc: Likewise.
10688 * symtab.cc: Likewise.
10689 * symtab.h: Likewise.
10690 * target-select.cc: Likewise.
10691 * target-select.h: Likewise.
10692 * token.h: Likewise.
10693 * workqueue.cc: Likewise.
10694 * workqueue.h: Likewise.
10695 * x86_64.cc: Likewise.
10696
a0351a69
DK
106972009-12-10 Doug Kwan <dougkwan@google.com>
10698
10699 * arm.cc (attributes.h): New include.
10700 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10701 (Arm_relobj::~Arm_relobj): Delete object pointed by
10702 attributes_section_data_.
10703 (Arm_relobj::attributes_section_data): New method definition.
10704 (Arm_relobj::attributes_section_data_): New data member declaration.
10705 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10706 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10707 attributes_section_data_.
10708 (Arm_dynobj::attributes_section_data): New method definition.
10709 (Arm_dynobj::attributes_section_data_): New data member declaration.
10710 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10711 initialization value of may_use_blx_ to false.
2e702c99 10712 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
10713 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10714 object attributes to compute results instead of hard-coding.
10715 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10716 Target_arm::get_secondary_compatible_arch,
10717 Target_arm::set_secondary_compatible_arch
10718 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10719 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10720 New method declarations.
10721 (Target_arm::get_aeabi_object_attribute): New method definition.
10722 (Target_arm::attributes_section_data_): New data member declaration.
10723 (read_arm_attributes_section): New template definition.
10724 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10725 (Arm_dynobj::do_read_symbols): Ditto.
10726 (Target_arm::do_finalize_sections): Merge attributes sections from
10727 input. Check for BLX use after attributes section merging.
10728 Fix __exidx_start and __exidx_end visibility. Create an
10729 .ARM.attributes section if necessary.
10730 (Target_arm::get_secondary_compatible_arch,
10731 Target_arm::set_secondary_compatible_arch,
10732 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10733 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 10734 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
10735 New method definitions.
10736
b59befec
ILT
107372009-12-09 Ian Lance Taylor <iant@google.com>
10738
10739 * plugin.cc (Plugin::load): Don't cast from void* to a function
10740 pointer.
10741
1276bc89
ILT
107422009-12-09 Ian Lance Taylor <iant@google.com>
10743
10744 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10745 information fields.
10746
2f2de248
L
107472009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10748
10749 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10750 Replace two_file_shared_1.so with two_file_shared_2.so.
10751 * testsuite/Makefile.in: Regenerated.
10752
4f787271
DK
107532009-12-08 Doug Kwan <dougkwan@google.com>
10754
10755 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10756 (HFILES): Add attributes.h and int_encoding.h.
10757 * Makefile.in: Regenerate.
10758 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10759 function definitions to int_encoding.cc
10760 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10761 prototypes to int_encoding.h
10762 * reduced_debug_output.cc (int_encoding.h): New include.
10763 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10764 function definitions to int_encoding.cc
10765 (insert_into_vector, read_from_pointer): Move template definitions to
10766 int_encoding.h
10767 * attributes.cc: New file.
10768 * attributes.h: New file.
10769 * int_encoding.cc: New file.
10770 * int_encoding.h: New file.
10771
20b52f1a
RÁE
107722009-12-07 Rafael Avila de Espindola <espindola@google.com>
10773
10774 PR gold/11055
10775 * incremental-dump.cc (dump_incremental_inputs): New.
10776 (main): Use dump_incremental_inputs.
10777
53d7974c
L
107782009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10779
10780 PR gold/10893
10781 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10782 checking elfcpp::STT_FUNC.
10783 (Target_i386::Relocate::relocate): Likewise.
10784 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10785
10786 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10787 symbols from shared libraries into normal FUNC symbols.
10788
10789 * symtab.h (Symbol): Add is_func and use it.
10790
05a352e6
DK
107912009-12-05 Doug Kwan <dougkwan@google.com>
10792
10793 * arm.cc (Target_arm::arm_info): Initialize new fields
10794 attributes_section and attributes_vendor.
10795 * i386.cc (Target_i386::i386_info): Same.
10796 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10797 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10798 fields attributes_section and attributes_vendor.
53d7974c 10799 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
10800 * target.h (Target::attributes_section, Target::attributes_vendor,
10801 Target::is_attributes_section, Target::attribute_arg_type,
10802 Target::attributes_order): New method definitions.
10803 (Target::Target_info::attributes_section,
10804 Target::Target_info::attributes_vendor): New fields.
10805 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10806 virtual method definitions.
10807 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10808 attributes_section and attributes_vendor.
10809 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10810
f4e5969c
DK
108112009-12-05 Doug Kwan <dougkwan@google.com>
10812
10813 * arm.cc: Update comments about interworking and stub generation.
10814 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10815 considered as non-PIC.
10816 (Arm_relocate_functions::base_abs): Fix formatting.
10817 (Arm_relocate_functions::got_prel): Fix comment. Change interface
10818 of function to use GOT entry address instead of offset.
10819 (Target_arm::Scan::global): Issue an error if a symbol would need a
10820 PLT does not get one because it is untyped. Remove code to create
10821 dynamic symbols for relative branches.
10822 (Target_arm::Relocate::relocate: Use 0 instead of false since function
10823 takes unsigned integer instead of boolean.
10824
1abce4a6
L
108252009-12-05 H.J. Lu <hongjiu.lu@intel.com>
10826
10827 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
10828 (two_file_test_LDADD): Likewise.
10829 (common_test_1_LDADD): Likewise.
10830 (exception_test_LDADD) Likewise.
10831 (weak_test_LDADD): Likewise.
10832 (many_sections_test_LDADD): Likewise.
10833 (initpri1_LDADD): Likewise.
10834 (script_test_1_LDADD): Likewise.
10835 (script_test_2_LDADD): Likewise.
10836 (justsyms_LDADD): Likewise.
10837 (binary_test_LDADD): Likewise.
10838 (large_LDADD): Likewise.
10839 * testsuite/Makefile.in: Regenerated.
10840
adcf2816 108412009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 10842
adcf2816
L
10843 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
10844 (Symbol_table::override_with_special): Likewise.
10845 (Symbol_table::add_from_object): Likewise.
10846
28e67f5d
RÁE
108472009-12-04 Rafael Avila de Espindola <espindola@google.com>
10848
10849 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10850 Don't set the data_offset twice.
10851
ae10a101
RÁE
108522009-12-04 Rafael Avila de Espindola <espindola@google.com>
10853
10854 * testsuite/Makefile.in: Regenerate.
10855
f59f41f3
DK
108562009-12-03 Doug Kwan <dougkwan@google.com>
10857
10858 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
10859 (Target_arm::do_finalize_sections): Add parameter for symbol table
10860 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
10861 * i386.cc (Target_i386::do_finalize_sections): Add an additional
10862 parameter for symbol table pointer.
10863 * layout.cc (Layout::finalize): Call Target::finalize_sections with
10864 an additional parameter for a pointer to symbol table.
10865 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
10866 parameter for a symbol table pointer.
10867 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
10868 * target.h (Target::finalize_sections, Target::do_finalize_sections):
10869 Ditto.
10870 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
10871 parameter for a symbol table pointer.
10872
ca55d848
RÁE
108732009-12-03 Rafael Avila de Espindola <espindola@google.com>
10874
10875 * incremental.cc (Incremental_inputs_header)
10876 (Incremental_inputs_header_write, Incremental_inputs_entry)
10877 (Incremental_inputs_entry_write): Move ...
10878 * incremental.h (Incremental_inputs_header)
10879 (Incremental_inputs_header_write, Incremental_inputs_entry)
10880 (Incremental_inputs_entry_write): here.
10881
3aec4f9c
RÁE
108822009-12-02 Rafael Avila de Espindola <espindola@google.com>
10883
10884 * incremental.cc (make_sized_incremental_binary): Set the target.
10885 Error if it is incompatible.
10886 * output.h (Output_file): Add filename method.
10887
9c0ae74d
RÁE
108882009-12-02 Rafael Avila de Espindola <espindola@google.com>
10889
10890 * incremental.cc (Incremental_inputs_entry): Remove unused argument
10891 from the get_* methods.
10892
a45500ae
RÁE
108932009-12-02 Rafael Avila de Espindola <espindola@google.com>
10894
10895 * incremental-dump.cc (main): Check that the offeset of a script is 0.
10896 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10897 Write 0 for the data_offset of scripts.
10898
325e6408
RÁE
108992009-12-02 Rafael Avila de Espindola <espindola@google.com>
10900
10901 * testsuite/Makefile.am: Add the incremental_test.sh test.
10902 * testsuite/incremental_test.sh: New.
10903 * testsuite/incremental_test_1.c: New.
10904 * testsuite/incremental_test_2.c: New.
10905
954c3e2e
RÁE
109062009-12-01 Rafael Avila de Espindola <espindola@google.com>
10907
703d02da 10908 * incremental-dump.cc (main): Fix typos.
954c3e2e 10909
f8086623
RÁE
109102009-11-27 Rafael Avila de Espindola <espindola@google.com>
10911
10912 PR gold/11025
10913 * incremental-dump.cc (main): Use llu to print 64 bit values.
10914
3b0dd6ac
L
109152009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
10916 H.J. Lu <hongjiu.lu@intel.com>
10917
10918 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
10919 $(LIBDL).
10920 (incremental_dump_LDADD): Likewise.
10921 * Makefile.in: Regenerated.
10922
a6d1ef57 109232009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 10924
a6d1ef57
DK
10925 Revert:
10926
10927 2009-11-25 Doug Kwan <dougkwan@google.com>
10928
10929 * arm.cc (Target_arm::Target_arm): Move method definition
10930 outside of class definition. Add code to handle
10931 --target1-rel, --target1-abs and --target2= options.
10932 (Target_arm::get_reloc_reloc_type): Change method to be
10933 non-static and const.
10934 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
10935 New data 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):
10939 Adjust call to Target_arm::get_real_reloc_type.
10940 (Target_arm::get_real_reloc_type): Use command line options
10941 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10942 * options.h (--target1-rel, --target1-abs, --target2): New
10943 ARM-only options.
10944
50aeb7d4
DK
109452009-11-25 Doug Kwan <dougkwan@google.com>
10946
10947 * arm.cc (Target_arm::Target_arm): Move method definition outside of
10948 class definition. Add code to handle --target1-rel, --target1-abs
10949 and --target2= options.
10950 (Target_arm::get_reloc_reloc_type): Change method to be non-static
10951 and const.
10952 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
10953 member declaration.
10954 (Target_arm::Scan::local, Target_arm::Scan::global,
10955 Target_arm::Relocate::relocate,
10956 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
10957 call to Target_arm::get_real_reloc_type.
10958 (Target_arm::get_real_reloc_type): Use command line options to
10959 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10960 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
10961 options.
10962
51938283
DK
109632009-11-25 Doug Kwan <dougkwan@google.com>
10964
10965 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
10966 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
10967 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
10968 formatting.
10969 (Arm_relocate_functions::thm_call): Replace body with a call to
10970 Arm_relocate_functions::thumb_branch_common.
10971 (Arm_relocate_functions::thm_jump24,
10972 Arm_relocate_functions::thm_xpc22): New method definitions.
10973 (Arm_relocate_functions::thumb_branch_common): New method definition.
10974 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
10975 operator.
10976 (Target_arm::Relocate::relocate): Adjust call to thm_call.
10977 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
10978
e2b8f3c4
RÁE
109792009-11-24 Rafael Avila de Espindola <espindola@google.com>
10980
10981 * Makefile.am: Build incremental-dump
10982 * Makefile.in: Regenerate.
10983 * incremental-dump.cc: New.
10984 * incremental.cc (Incremental_inputs_header_data,
10985 Incremental_inputs_entry_data): Move to incremental.h
10986 * incremental.h: (Incremental_inputs_header_data,
10987 Incremental_inputs_entry_data): Move from incremental.cc
10988
bcba9aec
RÁE
109892009-11-24 Rafael Avila de Espindola <espindola@google.com>
10990
10991 * incremental.cc (Incremental_inputs_header,
10992 Incremental_inputs_header_write, Incremental_inputs_entry,
10993 Incremental_inputs_entry_write): Add a typedef with the data type.
10994
7c3afe08
RÁE
109952009-11-24 Rafael Avila de Espindola <espindola@google.com>
10996
10997 * incremental.cc (Incremental_inputs_header,
10998 Incremental_inputs_header_write, Incremental_inputs_entry,
10999 Incremental_inputs_entry_write): Update comment about which
11000 type has the filed descriptions.
11001
d204b6e9
DK
110022009-11-15 Doug Kwan <dougkwan@google.com>
11003
11004 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11005 (Arm_relocate_functions::arm_branch_common): Change method defintion
11006 in class definition to a method declaration and update list of formal
11007 parameters.
11008 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11009 Arm_relocation_functions::jump24): Adjust call to
11010 Arm_relocate_functions::arm_branch_common. Update list of formal
11011 parameters.
11012 (Arm_relocate_functions::xpc25): New method definition.
11013 (Arm_relocate_functions::arm_branch_common): Move method defintion
11014 out from class definition. Use stubs for mode-switching and extending
11015 branch ranges.
11016 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11017 specially. Change code to enable use of stubs in ARM branches.
11018
43d12afe
DK
110192009-11-10 Doug Kwan <dougkwan@google.com>
11020
11021 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11022 in method declaration.
11023 (Target_arm::relocate_stub): New method declaration.
11024 (Target_arm::default_target): Change to return a pointer instead of
11025 a const reference.
11026 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11027 Target_arm::default_target.
11028 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11029 method definition.
11030 (Target_arm::relocate_section): Adjust view.
11031 (Target_arm::relocate_stub): New method definition.
11032
ac33a407
DK
110332009-11-10 Doug Kwan <dougkwan@google.com>
11034
11035 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11036 a format warning.
11037 * incremental.cc (open_incremental_binary): Initialized local
11038 variables to avoid warnings.
11039 * object.cc (make_elf_object): Ditto.
11040 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11041 a format warning.
e1df38aa 11042
88ee28e9
L
11043009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11044
11045 PR gold/10930
11046 * testsuite/plugin_test.c: Include "config.h".
11047
2daedcd6
DK
110482009-11-09 Doug Kwan <dougkwan@google.com>
11049
11050 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11051 (arm_symbol_value): Remove.
11052 (Arm_relocate_functions::arm_branch_common,
11053 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11054 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11055 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11056 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11057 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11058 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11059 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11060 Arm_relocate_functions::thm_mobw_abs_nc,
11061 Arm_relocate_functions::thm_mov_abs,
11062 Arm_relocate_functions::movw_prel_nc,
11063 Arm_relocate_functions::thm_movt_abs,
11064 Arm_relocate_functions::movt_prel,
11065 Arm_relocate_functions::thm_movw_prel_nc,
11066 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11067 (Target_arm::Relocate::relocate): Only decompose address into two
11068 parts if relocation type uses the thumb-bit and pass the actual
11069 bit instead of a flag indicating that the thumb-bit is used. Adjust
11070 calls to methods in Arm_relocate_functions for this change.
11071
1276bc89 110722009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11073
11074 PR 10925
11075 * reloc.cc: Instantiate
11076 Sized_relobj::initialize_input_to_output_maps and
11077 Sized_relobj:free_input_to_output_maps.
11078
e53ad1b5
ILT
110792009-11-06 Ian Lance Taylor <iant@google.com>
11080
11081 PR 10876
11082 * defstd.cc (in_segment): Set only_if_ref true for "end".
11083
eb44217c
DK
110842009-11-06 Doug Kwan <dougkwan@google.com>
11085
11086 * arm.cc (class Reloc_stub): Correct a comment.
11087 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11088 (Target_arm::scan_section_for_stubs): New method declaration.
11089 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11090 Change methods from private to protected.
11091 (Target_arm::do_may_relax): New method definition.
11092 (Target_arm::do_relax, Target_arm::group_sections,
11093 Target_arm::scan_reloc_for_stub,
11094 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11095 (Target_arm::arm_input_section_map_): New data member declaration.
11096 (Target_arm::scan_reloc_for_stub,
11097 Target_arm::scan_reloc_section_for_stubs,
11098 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11099 Target_arm::do_relax): New method definitions.
11100
5d329b7d
ILT
111012009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11102
11103 * configure.ac: Check for (struct stat)::st_mtim
11104 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11105 * config.in: Regenerate.
11106 * configure: Regenerate.
11107
96a0d71b
ILT
111082009-11-05 Ian Lance Taylor <iant@google.com>
11109
11110 PR 10910
11111 * output.cc (Output_segment::add_output_section): Add missing
11112 return statement.
11113
594c8e5e
ILT
111142009-11-04 Ian Lance Taylor <iant@google.com>
11115
11116 PR 10880
11117 * object.h (class Object): Add is_needed and set_is_needed
11118 methods. Add is_needed_ field. Make bool fields into bitfields.
11119 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11120 defined in a dynamic object and referenced by a regular object,
11121 set is_needed for the dynamic object.
11122 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11123 if the file is marked with as_needed and it is not needed.
11124
22b127cc
ILT
111252009-11-04 Ian Lance Taylor <iant@google.com>
11126
11127 PR 10887
11128 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11129 tags if data is discarded by linker script.
11130 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11131 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11132 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11133 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11134
f5c870d2
ILT
111352009-11-04 Ian Lance Taylor <iant@google.com>
11136
11137 * layout.cc (Layout::get_output_section): Add is_interp and
11138 is_dynamic_linker_section parameters. Change all callers.
11139 (Layout::choose_output_section): Likewise.
11140 (Layout::make_output_section): Likewise.
11141 (Layout::add_output_section_data): Add is_dynamic_linker_section
11142 parameter. Change all callers.
11143 * layout.h (class Layout): Update declarations.
11144 * output.h (class Output_section): Add is_interp, set_is_interp,
11145 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11146 Add is_interp_, is_dynamic_linker_section_ fields. Change
11147 generate_code_fills_at_write_ to a bitfield.
11148 * output.cc (Output_section::Output_sections): Initialize new
11149 fields.
11150 (Output_segment::add_output_section): Add do_sort parameter.
11151 Change all callers.
11152
1ae4d23b
ILT
111532009-11-03 Ian Lance Taylor <iant@google.com>
11154
11155 PR 10860
11156 * options.h (class General_options): Add --warn-common.
11157 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11158 merging two common symbols.
11159 (Symbol_table::should_override): Handle --warn-common when merging
11160 a common symbol with a defined symbol. Use report_resolve_problem
11161 for multiple definitions.
11162 (Symbol_table::report_resolve_problem): New function.
11163 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11164
55da9579
DK
111652009-11-03 Doug Kwan <dougkwan@google.com>
11166
11167 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11168 stub_factory_.
11169 (Target_arm::stub_factory): New method definition.
11170 (Target_arm::new_arm_input_section,
11171 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11172 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11173 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11174 New type definitions.
11175 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11176 member declarations.
11177 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11178 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11179 New method definitions.
11180
37a9ac43
ILT
111812009-11-03 Ian Lance Taylor <iant@google.com>
11182
11183 * options.h (class General_options): Add --warn_constructors.
11184
b3d6a3d4
ILT
111852009-11-03 Ian Lance Taylor <iant@google.com>
11186
11187 PR 10893
11188 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11189 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11190
934b01dd
ILT
111912009-11-03 Ian Lance Taylor <iant@google.com>
11192
11193 PR 10895
11194 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11195 --msgid-bugs-address.
11196 (install-pdf): New target.
11197 (install-data_yes): Look up one directory to find mkinstalldirs.
11198
03c1939b
L
111992009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11200
11201 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11202 tree.
11203
ebd95253
DK
112042009-10-30 Doug Kwan <dougkwan@google.com>
11205
11206 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11207
e9bbb538
DK
112082009-10-30 Doug Kwan <dougkwan@google.com>
11209
11210 * arm.cc (Stub_addend_reader): New struct template definition
11211 and partial specializations.
11212 (Stub_addend_reader::operator()): New method definition for a
11213 partially specialized template.
11214
d5b40221
DK
112152009-10-30 Doug Kwan <dougkwan@google.com>
11216
11217 * arm.cc (Arm_relobj::processor_specific_flags): New method
11218 definition.
11219 (Arm_relobj::do_read_symbols): New method declaration.
11220 (Arm_relobj::processor_specific_flags_): New data member declaration.
11221 (Arm_dynobj): New class definition.
11222 (Target_arm::do_finalize_sections): Add input_objects parameter.
11223 (Target_arm::do_adjust_elf_header): New method declaration.
11224 (Target_arm::are_eabi_versions_compatible,
11225 (Target_arm::merge_processor_specific_flags): New method declaration.
11226 (Target_arm::do_make_elf_object): New overloaded method definitions
11227 and declaration.
11228 (Arm_relobj::do_read_symbols): New method definition.
11229 (Arm_dynobj::do_read_symbols): Ditto.
11230 (Target_arm::do_finalize_sections): Add input_objects parameters.
11231 Merge processor-specific flags from all input objects.
11232 (Target_arm::are_eabi_versions_compatible,
11233 Target_arm::merge_processor_specific_flags,
11234 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11235 New method definitions.
11236 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11237 Input_objects pointer type parameter.
11238 * layout.cc (Layout::finalize): Pass input objects to target's.
11239 finalize_sections function.
11240 * output.cc (Output_file_header::do_sized_write): Set ELF file
11241 header's processor-specific flags.
11242 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11243 Input_objects pointer type parameter.
11244 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11245 * target.h (Input_objects): New forward class declaration.
11246 (Target::processor_specific_flags,
11247 Target::are_processor_specific_flags_sect): New method definitions.
11248 (Target::finalize_sections): Add input_objects parameter.
11249 (Target::Target): Initialize processor_specific_flags_ and
11250 are_processor_specific_flags_set_.
11251 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11252 parameter.
11253 (Target::set_processor_specific_flags): New method definition.
11254 (Target::processor_specific_flags_,
11255 Target::are_processor_specific_flags_set_): New data member
11256 declarations.
11257 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11258 Input_objects pointer type parameter.
11259
ebabffbd
DK
112602009-10-30 Doug Kwan <dougkwan@google.com>
11261
11262 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11263
ad0f2072
ILT
112642009-10-28 Ian Lance Taylor <iant@google.com>
11265
11266 * object.h (class Relobj): Drop options parameter from
11267 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11268 do_scan_relocs, do_relocate. Change all callers.
11269 (class Sized_relobj): Drop options parameters from
11270 do_gc_process_relocs, do_scan_relocs, do_relocate,
11271 do_relocate_sections, relocate_sections, emit_relocs_scan,
11272 emit_relocs_scan_reltype. Change all callers.
11273 (struct Relocate_info): Remove options field and all references to
11274 it.
11275 * reloc.h (class Read_relocs): Remove options constructor
11276 parameter and options_ field. Change all callers.
11277 (class Gc_process_relocs, class Scan_relocs): Likewise.
11278 (class Relocate_task): Likewise.
11279 * target-reloc.h (scan_relocs): Remove options parameter. Change
11280 all callers.
11281 (scan_relocatable_relocs): Likewise.
11282 * target.h (class Sized_target): Remove options parameter from
11283 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11284 all callers.
11285 * gc.h (gc_process_relocs): Remove options parameter. Change all
11286 callers.
11287 * arm.cc: Update functions to remove options parameters.
11288 * i386.cc: Likewise.
11289 * powerpc.cc: Likewise.
11290 * sparc.cc: Likewise.
11291 * x86_64.cc: Likewise.
11292 * testsuite/testfile.cc: Likewise.
11293
8ffa3667
DK
112942009-10-28 Doug Kwan <dougkwan@google.com>
11295
11296 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11297 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11298 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11299 New method definitions.
11300
40f36857
CC
113012009-10-28 Cary Coutant <ccoutant@google.com>
11302
11303 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11304 (Plugin::cleanup_done_): New member.
11305 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11306 (Plugin_manager::cleanup_done_): Remove.
11307 (Plugin_manager::add_input_file): Edit error message.
11308 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11309 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11310
2c849493
ILT
113112009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11312
11313 * fileread.cc: (File_read::View::~View): Use the new
11314 data_ownership_ filed.
11315 (File_read::~File_read): Dispose the new whole_file_view_.
11316 (File_read::open): Mmap the whole file if needed.
11317 (File_read::open): Use whole_file_view_ instead of contents_.
11318 (File_read::find_view): Use whole_file_view_ if applicable.
11319 (File_read::do_read): Use whole_file_view_ instead of contents_.
11320 (File_read::make_view): Use whole_file_view_ instead of contents_,
11321 update File_read::View::View call.
11322 (File_read::find_or_make_view): Update File_read::View::View
11323 call.
11324 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11325 remove contents_
11326 (File_read::View::Data_ownership): New enum.
11327 (File_read::View::View): Replace bool mapped_ with Data_ownership
11328 argument.
11329 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11330 (File_read::View::data_ownership_): New field.
11331 (File_read::contents_): Remove (replaced by whole_file_view_).
11332 (File_read::whole_file_view_): New field.
11333 * options.h (class General_options): Add --keep-files-mapped.
11334
24998053
CC
113352009-10-27 Cary Coutant <ccoutant@google.com>
11336
11337 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11338 * testsuite/Makefile.am (plugin_test_5): New test case.
11339 * testsuite/Makefile.in: Regenerate.
11340
72adc4fa
DK
113412009-10-25 Doug Kwan <dougkwan@google.com>
11342
11343 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11344 from private to protected to allow access by child class.
11345 (Sized_relobj::do_relocate_sections): New method declaration.
11346 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11347 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11348 Sized_relobj::relocate_sections. Instantiate template explicitly
11349 for different target sizes and endianity.
11350
07f508a2
DK
113512009-10-24 Doug Kwan <dougkwan@google.com>
11352
11353 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11354 (Arm_input_section::as_arm_input_section): New method.
11355 (Arm_output_section): New class definition.
11356 (Arm_output_section::create_stub_group,
11357 Arm_output_section::group_sections): New method definitions.
11358
10ad9fe5
DK
113592009-10-22 Doug Kwan <dougkwan@google.com>
11360
11361 * arm.cc (Arm_input_section): New class definition.
11362 (Arm_input_section::init, Arm_input_section:do_write,
11363 Arm_input_section::set_final_data_size,
11364 Arm_input_section::do_reset_address_and_file_offset): New method
11365 definitions.
11366
56ee5e00
DK
113672009-10-21 Doug Kwan <dougkwan@google.com>
11368
11369 * arm.cc (Stub_table, Arm_input_section): New forward class
11370 declarations.
11371 (Stub_table): New class defintion.
11372 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11373 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11374 New method definition.
11375
b569affa
DK
113762009-10-21 Doug Kwan <dougkwan@google.com>
11377
11378 * arm.cc: Update copyright comments.
11379 (Target_arm): New forward class template declaration.
11380 (Arm_address): New type.
11381 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11382 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11383 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11384 constants.
11385 (Insn_template): Same.
11386 (DEF_STUBS): New macro.
11387 (Stub_type): New enum type.
11388 (Stub_template): New class definition.
11389 (Stub): Same.
11390 (Reloc_stub): Same.
11391 (Stub_factory): Same.
11392 (Target_arm::Target_arm): Initialize may_use_blx_ and
11393 should_force_pic_veneer_.
11394 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11395 Target_arm::should_force_pic_veneer,
11396 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11397 Target_arm::using_thumb_only, Target_arm:;default_target): New
11398 method defintions.
11399 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11400 New data member declarations.
11401 (Insn_template::size, Insn_template::alignment): New method defintions.
11402 (Stub_template::Stub_template): New method definition.
11403 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11404 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11405 (Stub_factory::Stub_factory): New method definition.
11406 * gold.h (string_hash): New template.
11407 * output.h (Input_section_specifier::hash_value): Use
11408 gold::string_hash.
11409 (Input_section_specifier::string_hash): Remove.
11410 * stringpool.cc (Stringpool_template::string_hash): Use
11411 gold::string_hash.
11412
6c172549
DK
114132009-10-20 Doug Kwan <dougkwan@google.com>
11414
11415 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11416 symbols of relaxed input sections.
11417 * output.h (Output_section::find_relaxed_input_section): Make
11418 method public.
11419
c5617f2f
DK
114202009-10-16 Doug Kwan <dougkwan@google.com>
11421
11422 * dynobj.cc (Versions::Versions): Initialize version_script_.
11423 Only insert base version symbol definition for a shared object
11424 if version script defines any version versions.
11425 (Versions::define_base_version): New method definition.
11426 (Versions::add_def): Check that base version is not needed.
11427 (Versions::add_need): Define base version lazily.
11428 * dynobj.h (Versions::define_base_version): New method declaration.
11429 (Versions::needs_base_version_): New data member declaration.
11430 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11431 (check_DATA): Add no_version_test.stdout.
11432 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11433 New make rules.
11434 * testsuite/Makefile.in: Regenerate.
11435 * testsuite/no_version_test.c: New file.
11436 * testsuite/no_version_test.sh: Ditto.
11437
3c12dcdb
DK
114382009-10-16 Doug Kwan <dougkwan@google.com>
11439
11440 * expression.cc (class Segment_start_expression): New class definition.
11441 (Segment_start_expression::value): New method definition.
11442 (script_exp_function_segment_start): Return a new
11443 Segment_start_expression.
11444 * gold/script-c.h (script_saw_segment_start_expression): New function
11445 prototype.
11446 * script-sections.cc (Script_sections::Script_sections): Initialize
11447 SAW_SEGMENT_START_EXPRESSION_ to false.
11448 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11449 and -Tbbs options to specify section addresses if given in
11450 command line and no SEGMENT_START expression is seen in a script.
11451 * script-sections.h (Script_sections::saw_segment_start_expression,
11452 Script_sections::set_saw_segment_start_expression): New method
11453 definition.
11454 (Script_sections::saw_segment_start_expression_): New data member
11455 declaration.
11456 * script.cc (script_saw_segment_start_expression): New function.
11457 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11458 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11459 script_test_7.sh and script_test_8.sh.
11460 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11461 script_test_8.stdout.
11462 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11463 (script_test_6, script_test_6.stdout, script_test_7,
11464 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11465 * Makefile.in: Regenerate.
11466 * testsuite/script_test_6.sh: New file.
11467 * testsuite/script_test_6.t: Same.
11468 * testsuite/script_test_7.sh: Same.
11469 * testsuite/script_test_7.t: Same.
11470 * testsuite/script_test_8.sh: Same.
11471
64b1ae37
DK
114722009-10-16 Doug Kwan <dougkwan@google.com>
11473
11474 * output.cc (Output_segment::set_section_list_address): Cast
11475 expressions to unsigned long long type to avoid format warnings.
11476
661be1e2
ILT
114772009-10-15 Ian Lance Taylor <iant@google.com>
11478
12edd763 11479 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11480 dot assignment to script_sections_.
12edd763
ILT
11481 * script-sections.cc (Script_sections::add_dot_assignment):
11482 Initialize if necessary.
11483
68b6574b
ILT
11484 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11485 program headers with no load segment if there is a linker script.
11486
661be1e2
ILT
11487 * layout.cc (Layout::set_segment_offsets): Align the file offset
11488 to the segment aligment for -N or -n with no load segment.
11489 * output.cc (Output_segment::add_output_section): Don't crash if
11490 the first section is a TLS section.
11491 (Output_segment::set_section_list_addresses): Print an error
11492 message if the address moves backward in a linker script.
11493 * script-sections.cc
11494 (Output_section_element_input::set_section_addresses): Don't
11495 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11496 (Orphan_output_section::set_section_addresses): Likewise.
11497
f15f61a7
DK
114982009-10-15 Doug Kwan <dougkwan@google.com>
11499
11500 * layout.cc (Layout::finish_dynamic_section): Generate tags
11501 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11502 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11503 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11504
82bb573a
ILT
115052009-10-14 Ian Lance Taylor <iant@google.com>
11506
11507 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11508 fields.
11509 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11510 data_shdr fields of relinfo.
11511 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11512 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11513 R_386_TLS_LDO_32, adjust based on section flags.
11514 (Target_i386::Relocate::fix_up_ldo): Remove.
11515
374ad285
ILT
115162009-10-13 Ian Lance Taylor <iant@google.com>
11517
11518 Add support for -pie.
11519 * options.h (class General_options): Add -pie and
11520 --pic-executable.
11521 (General_options::output_is_position_independent): Test -pie.
11522 (General_options::output_is_executable): Return true if not shared
11523 and not relocatable.
11524 (General_options::output_is_pie): Remove.
11525 * options.cc (General_options::finalize): Reject incompatible uses
11526 of -pie.
11527 * gold.cc (queue_middle_tasks): A -pie link is not static.
11528 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11529 * symtab.cc (Symbol::final_value_is_known): Return false if
11530 output_is_position_independent.
11531 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11532 output_is_position_independent.
11533 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11534 output_is_position_independent.
11535 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11536 output_is_position_independent.
11537 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11538 two_file_pie_test.
11539 (basic_pie_test.o, basic_pie_test): New targets.
11540 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11541 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11542 (two_file_pie_test): New target.
11543 * testsuite/Makefile.in: Rebuild.
11544 * README: Remove note saying that -pie is not supported.
11545
c6585162
ILT
115462009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11547
11548 * options.h (class General_options): Add -init and -fini.
11549 * layout.cc (Layout::finish_dynamic_section): Emit
11550 given init and fini functions.
11551
032ce4e9
ST
115522009-10-13 Sriraman Tallam <tmsriram@google.com>
11553
11554 * gc.h (gc_process_relocs): Check if icf is enabled using new
11555 function.
11556 * gold.cc (queue_initial_tasks): Likewise.
11557 (queue_middle_tasks): Likewise.
11558 * object.cc (do_layout): Likewise.
11559 * symtab.cc (is_section_folded): Likewise.
11560 * main.cc (main): Likewise.
11561 * reloc.cc (Read_relocs::run): Likewise.
11562 (Sized_relobj::do_scan_relocs): Likewise.
11563 * icf.cc (is_function_ctor_or_dtor): New function.
11564 (Icf::find_identical_sections): Check if function is ctor or dtor when
11565 safe icf is chosen.
11566 * options.h (General_options::icf): Change option to be an enum.
11567 (Icf_status): New enum.
11568 (icf_enabled): New method.
11569 (icf_safe_folding): New method.
11570 (set_icf_status): New method.
11571 (icf_status_): New variable.
11572 * (options.cc) (General_options::finalize): Set icf_status_.
11573 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11574 icf_test and icf_keep_unique_test to use the --icf enum flag.
11575 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11576 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11577
f345227a
ST
115782009-10-12 Sriraman Tallam <tmsriram@google.com>
11579
11580 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11581 includes to gc.h and icf.h.
11582 * arm.cc: Include gc.h.
11583 * gold.cc: Likewise.
11584 * i386.cc: Likewise.
11585 * powerpc.cc: Likewise.
11586 * sparc.cc: Likewise.
11587 * x86_64.cc: Likewise.
11588 * gc.h: Include icf.h.
11589
1c7814ed
ILT
115902009-10-11 Ian Lance Taylor <iant@google.com>
11591
11592 * plugin.cc: Include "gold.h" before other header files.
11593
ae3b5189
CD
115942009-10-10 Chris Demetriou <cgd@google.com>
11595
11596 * options.h (Input_file_argument::Input_file_type): New enum.
11597 (Input_file_argument::is_lib_): Replace with...
11598 (Input_file_argument::type_): New member.
11599 (Input_file_argument::Input_file_argument): Take Input_file_type
11600 'type' rather than boolean 'is_lib' as second argument.
11601 (Input_file_argument::is_lib): Use type_.
11602 (Input_file_argument::is_searched_file): New function.
11603 (Input_file_argument::may_need_search): Handle is_searched_file.
11604 * options.cc (General_options::parse_library): Support -l:filename.
11605 (General_options::parse_just_symbols): Update for Input_file_argument
11606 changes.
11607 (Command_line::process): Likewise.
11608 * archive.cc (Archive::get_file_and_offset): Likewise.
11609 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11610 * script.cc (read_script_file, script_add_file): Likewise.
11611 * fileread.cc (Input_file::Input_file): Likewise.
11612 (Input_file::will_search_for): Handle is_searched_file.
11613 (Input_file::open): Likewise.
11614 * readsyms.cc (Read_symbols::get_name): Likewise.
11615 * testsuite/Makefile.am (searched_file_test): New test.
11616 * testsuite/Makefile.in: Regenerate.
11617 * testsuite/searched_file_test.cc: New file.
11618 * testsuite/searched_file_test_lib.cc: New file.
11619
f3048a1d
ILT
116202009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11621 Ian Lance Taylor <iant@google.com>
11622
11623 * descriptor.cc: Include <cstdio> and "binary-io.h".
11624 (Descriptors::open): Open the files in binary mode always.
11625 * script.cc (Lex::get_token): Treat \r as whitespace.
11626
d4780e57
ILT
116272009-10-09 Ian Lance Taylor <iant@google.com>
11628
11629 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11630
d9a893b8
ILT
116312009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11632 Ian Lance Taylor <iant@google.com>
11633
11634 * configure.ac: Check for readv function also.
11635 * fileread.cc (readv): Define if not HAVE_READV.
11636 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11637 does not exist.
11638 * config.in: Regenerate.
11639 * configure: Regenerate.
11640
c0a62865
DK
116412009-10-09 Doug Kwan <dougkwan@google.com>
11642
11643 * layout.cc (Layout::make_output_section): Call target hook to make
11644 ordinary output section.
11645 (Layout::finalize): Adjust parameter list of call the
11646 Target::may_relax().
11647 * layout.h (class Layout::section_list): New method.
11648 * merge.h (Output_merge_base::entsize): Change visibility to public.
11649 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11650 New methods.
11651 (Output_merge_string::do_is_string): New method.
11652 * object.cc (Sized_relobj::do_setup): renamed from
11653 Sized_relobj::set_up.
11654 * object.h (Sized_relobj::adjust_shndx,
11655 Sized_relobj::initializ_input_to_output_maps,
11656 Sized_relobj::free_input_to_output_maps): Change visibilities to
11657 protected.
11658 (Sized_relobj::setup): Virtualize.
11659 (Sized_relobj::do_setup): New method declaration.
11660 (Sized_relobj::invalidate_section_offset,
11661 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11662 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11663 * options.cc (parse_int): New function.
11664 * options.h (parse_int): New declaration.
11665 (DEFINE_int): New macro.
11666 (stub_group_size): New option.
11667 * output.cc (Output_section::Output_section): Initialize memebers
11668 merge_section_map_, merge_section_by_properties_map_,
11669 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11670 (Output_section::add_input_section): Handled deferred code-fill
11671 generation and remove an old comment.
11672 (Output_section::add_relaxed_input_section): New method definition.
11673 (Output_section::add_merge_input_section): Use merge section by
11674 properties map to speed to search. Update merge section maps
11675 as appropriate.
11676 (Output_section::build_relaxation_map): New method definition.
11677 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11678 Same.
11679 (Output_section::relax_input_section): Renamed to
11680 Output_section::convert_input_sections_to_relaxed_sections and change
11681 interface to take a vector of pointers to relaxed sections.
11682 (Output_section::find_merge_section,
11683 Output_section::find_relaxed_input_section): New method definitions.
11684 (Output_section::is_input_address_mapped,
11685 Output_section::output_offset, Output_section::output_address):
11686 Use output section data maps to speed up searching.
11687 (Output_section::find_starting_output_address): Add comments.
11688 (Output_section::do_write,
11689 Output_section::write_to_postprocessing_buffer): Do code-fill
11690 generation as appropriate.
11691 (Output_section::get_input_sections): Invalidate relaxed input section
11692 map.
11693 (Output_section::restore_states): Adjust type of checkpoint .
11694 Invalidate relaxed input section map.
11695 * output.h (Output_merge_base): New class declaration.
11696 (Input_section_specifier): New class defintion.
11697 (class Output_relaxed_input_section) Change base class to
11698 Output_section_data_build.
11699 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11700 base class initializer.
11701 (Output_section::add_relaxed_input_section): New method declaration.
11702 (Output_section::Input_section): Change visibility to protected.
2e702c99 11703 (Output_section::Input_section::relobj,
c0a62865
DK
11704 Output_section::Input_section::shndx): Handle relaxed input sections.
11705 Output_section::input_sections) Change visibility to protected. Also
11706 define overload to return a non-const pointer.
11707 (Output_section::Merge_section_properties): New class defintion.
11708 (Output_section::Merge_section_by_properties_map,
11709 Output_section::Output_section_data_by_input_section_map,
11710 Output_section::Relaxation_map): New types.
11711 (Output_section::relax_input_section): Rename method to
11712 Output_section::convert_input_sections_to_relaxed_sections and change
11713 interface to take a vector of relaxed section pointers.
11714 (Output_section::find_merge_section,
11715 Output_section::find_relaxed_input_section,
11716 Output_section::build_relaxation_map,
11717 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11718 New method declarations.
11719 (Output_section::merge_section_map_
11720 Output_section::merge_section_by_properties_map_,
11721 Output_section::relaxed_input_section_map_,
11722 Output_section::is_relaxed_input_section_map_valid_,
11723 Output_section::generate_code_fills_at_write_): New data members.
11724 * script-sections.cc
11725 (Output_section_element_input::set_section_addresses): Call
11726 current_data_size and addralign methods of relaxed input sections.
11727 (Orphan_output_section::set_section_addresses): Call current_data_size
11728 and addralign methods of relaxed input sections.
11729 * symtab.cc (Symbol_table::compute_final_value): Extract template
11730 from the body of Symbol_table::sized_finalize_symbol.
11731 (Symbol_table::sized_finalized_symbol): Call
11732 Symbol_table::compute_final_value.
11733 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11734 (Symbol_table::compute_final_value): New templated method declaration.
11735 * target.cc (Target::do_make_output_section): New method defintion.
11736 * target.h (Target::make_output_section): New method declaration.
11737 (Target::relax): Add more parameters for input objects, symbol table
11738 and layout. Adjust call to do_relax.
11739 (Target::do_make_output_section): New method declaration.
11740 (Target::do_relax): Add parameters for input objects, symbol table
11741 and layout.
11742
d446d6c4
ILT
117432009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11744
11745 * pread.c: Include stdio.h.
11746
bc06c745
ILT
117472009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11748
11749 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11750 defined.
11751
75aea3d0
ILT
117522009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11753
11754 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11755 Change read_shndx type to unsigned int.
11756 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11757 int.
11758 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11759 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11760 Change read_shndx type to unsigned int.
11761 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11762 int.
11763 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11764 * layout.cc (Layout::create_symtab_sections): Cast the result of
11765 local_symcount * symsize to off_t in the gold_assert.
11766
be8fcb75
ILT
117672009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11768
11769 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11770 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11771 R_ARM_BASE_ABS.
11772 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11773 (Arm_relocate_functions::thm_abs5): New function.
11774 (Arm_relocate_functions::abs12): New function.
11775 (Arm_relocate_functions::abs16): New function.
11776 (Arm_relocate_functions::base_abs): New function.
11777 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11778 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11779 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11780 R_ARM_BASE_ABS.
11781 (Scan::global): Likewise.
11782 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11783 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11784 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11785 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11786 R_ARM_BASE_ABS.
11787
c2a122b6
ILT
117882009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11789
11790 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11791 (Arm_relocate_functions::movt_prel): New function.
11792 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11793 (Arm_relocate_functions::thm_movt_prel): New function.
11794 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11795 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11796 (Scan::global, Relocate::relocate): Likewise.
11797 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11798
c4aa1e2d
ILT
117992009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11800
11801 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11802 Incremental_checker.
11803 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11804 unsigned int.
11805 (class Incremental_inputs_header): New class.
11806 (Incremental_inputs_header_writer): Edit comment.
11807 (Incremental_inputs_entry): New class.
11808 (Incremental_inputs_entry_writer): Edit comment.
11809 (Sized_incremental_binary::do_find_incremental_inputs_section):
11810 Add *strtab_shndx parameter, fill it.
11811 (Sized_incremental_binary::do_check_inputs): New method.
11812 (Incremental_checker::can_incrementally_link_output_file): Use
11813 Sized_incremental_binary::check_inputs.
11814 (Incremental_inputs::report_command_line): Save command line in
11815 command_line_.
11816 * incremental.h:
11817 (Incremental_binary::find_incremental_inputs_section): New
11818 method.
11819 (Incremental_binary::do_find_incremental_inputs_section): Add
11820 strtab_shndx parameter.
11821 (Incremental_binary::do_check_inputs): New pure virtual method.
11822 (Sized_incremental_binary::do_check_inputs): Declare.
11823 (Incremental_checker::Incremental_checker): Add incremental_inputs
11824 parameter, use it to initialize incremental_inputs_.
11825 (Incremental_checker::incremental_inputs_): New field.
11826 (Incremental_checker::command_line): New method.
11827 (Incremental_checker::inputs): New method.
11828 (Incremental_checker::command_line_): New field.
11829
c549a694
ILT
118302009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11831
11832 * incremental.cc: Include <cstdarg> and "target-select.h".
11833 (vexplain_no_incremental): New function.
11834 (explain_no_incremental): New function.
11835 (Incremental_binary::error): New method.
11836 (Sized_incremental_binary::do_find_incremental_inputs_section): New
11837 method.
11838 (make_sized_incremental_binary): New function.
11839 (open_incremental_binary): New function.
11840 (can_incrementally_link_file): Add checks if output is ELF and has
11841 inputs section.
11842 * incremental.h: Include "elfcpp_file.h" and "output.h".
11843 (Incremental_binary): New class.
11844 (Sized_incremental_binary): New class.
11845 (open_incremental_binary): Declare.
11846 * object.cc (is_elf_object): Use
11847 elfcpp::Elf_recognizer::is_elf_file.
11848 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
11849 * output.h (Output_file::filesize): New method.
11850
fd3c5f0b
ILT
118512009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11852
11853 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
11854 New function.
11855 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
11856 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
11857 function.
11858 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
11859 function.
11860 (Arm_relocate_functions::movw_abs_nc): New function.
11861 (Arm_relocate_functions::movt_abs): New function.
11862 (Arm_relocate_functions::thm_movw_abs_nc): New function.
11863 (Arm_relocate_functions::thm_movt_abs): New function.
11864 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
11865 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
11866 (Scan::global): Likewise.
11867 (Relocate::relocate): Likewise.
11868 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11869
7f5309a5
ILT
118702009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11871
11872 * arm.cc (Arm_relocate_functions::got_prel) New function.
11873 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
11874 (Relocate::relocate): Likewise.
11875 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11876
364c7fa5
ILT
118772009-10-06 Ian Lance Taylor <iant@google.com>
11878
11879 * options.h (class General_options): Define
11880 split_stack_adjust_size parameter.
11881 * object.h (class Object): Add uses_split_stack_ and
11882 has_no_split_stack_ fields. Add uses_split_stack and
11883 has_no_split_stack accessor functions. Declare
11884 handle_split_stack_section.
11885 (class Reloc_symbol_changes): Define.
11886 (class Sized_relobj): Define Function_offsets. Declare
11887 split_stack_adjust, split_stack_adjust_reltype, and
11888 find_functions.
11889 * object.cc (Object::handle_split_stack_section): New function.
11890 (Sized_relobj::do_layout): Call handle_split_stack_section.
11891 * dynobj.cc (Sized_dynobj::do_layout): Call
11892 handle_split_stack_section.
11893 * reloc.cc (Sized_relobj::relocate_sections): Call
11894 split_stack_adjust for executable sections in split_stack
11895 objects. Pass reloc_map to relocate_section.
11896 (Sized_relobj::split_stack_adjust): New function.
11897 (Sized_relobj::split_stack_adjust_reltype): New function.
11898 (Sized_relobj::find_functions): New function.
11899 * target-reloc.h: Include "object.h".
11900 (relocate_section): Add reloc_symbol_changes parameter. Change
11901 all callers.
11902 * target.h (class Target): Add calls_non_split method. Declare
11903 do_calls_non_split virtual method. Declare match_view and
11904 set_view_to_nop.
11905 * target.cc: Include "elfcpp.h".
11906 (Target::do_calls_non_split): New function.
11907 (Target::match_view): New function.
11908 (Target::set_view_to_nop): New function.
11909 * gold.cc (queue_middle_tasks): Give an error if mixing
11910 split-stack and non-split-stack objects with -r.
11911 * i386.cc (Target_i386::relocate_section): Add
11912 reloc_symbol_changes parameter.
11913 (Target_i386::do_calls_non_split): New function.
11914 * x86_64.cc (Target_x86_64::relocate_section): Add
11915 reloc_symbol_changes parameter.
11916 (Target_x86_64::do_calls_non_split): New function.
11917 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
11918 parameter.
11919 * powerpc.cc (Target_powerpc::relocate_section): Add
11920 reloc_symbol_changes parameter.
11921 * sparc.cc (Target_sparc::relocate_section): Add
11922 reloc_symbol_changes parameter.
11923 * configure.ac: Call AM_CONDITIONAL for the default target.
11924 * configure: Rebuild.
11925 * testsuite/Makefile.am (TEST_AS): New variable.
11926 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
11927 (check_DATA): Add split_i386 and split_x86_64 files.
11928 (SPLIT_DEFSYMS): Define.
11929 (split_i386_[1234n].o): New targets.
11930 (split_i386_[124]): New targets.
11931 (split_i386_[1234r].stdout): New targets.
11932 (split_x86_64_[1234n].o): New targets.
11933 (split_x86_64_[124]): New targets.
11934 (split_x86_64_[1234r].stdout): New targets.
11935 (MOSTLYCLEANFILES): Add new executables.
11936 * testsuite/split_i386.sh: New file.
11937 * testsuite/split_x86_64.sh: New file.
11938 * testsuite/split_i386_1.s: New file.
11939 * testsuite/split_i386_2.s: New file.
11940 * testsuite/split_i386_3.s: New file.
11941 * testsuite/split_i386_4.s: New file.
11942 * testsuite/split_i386_n.s: New file.
11943 * testsuite/split_x86_64_1.s: New file.
11944 * testsuite/split_x86_64_2.s: New file.
11945 * testsuite/split_x86_64_3.s: New file.
11946 * testsuite/split_x86_64_4.s: New file.
11947 * testsuite/split_x86_64_n.s: New file.
11948 * testsuite/testfile.cc (Target_test): Update relocation_section
11949 function.
11950 * testsuite/Makefile.in: Rebuild.
11951
e8a9fcda
ILT
119522009-10-06 Ian Lance Taylor <iant@google.com>
11953
11954 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
11955 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
11956 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
11957 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
11958 the address on ldo_addrs_.
11959 (Target_i386::Relocate::fix_up_ldo): New function.
11960
e99daf92
ILT
119612009-10-06 Rafael Espindola <espindola@google.com>
11962
11963 * plugin.cc (add_input_library): New.
11964 (Plugin::load): Add add_input_library to tv.
11965 (Plugin_manager::add_input_file): Add the is_lib argument.
11966 (add_input_file): Update call to Plugin_manager::add_input_file.
11967 (add_input_library): New.
11968 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
11969
966d4097
DK
119702009-09-30 Doug Kwan <dougkwan@google.com>
11971
11972 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
11973 symbol and call Symbol::may_need_copy_reloc to determine if
11974 a copy reloc is needed.
11975 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
11976 nocopyreloc is given in command line.
11977 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
11978 given in command line.
11979 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
11980 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
11981 of the removed Target_i386::may_need_copy_reloc.
11982 * options.h (copyreloc): New option with default value false.
11983 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11984 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
11985 instead of the removed Target_powerpc::may_need_copy_reloc.
11986 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11987 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
11988 instead of the removed Target_sparc::may_need_copy_reloc.
11989 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
11990 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
11991 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
11992 instead of the removed Target_x86_64::may_need_copy_reloc.
11993
029ba973
ILT
119942009-09-30 Ian Lance Taylor <iant@google.com>
11995
11996 * object.h (class Object): Remove target_ field, and target,
11997 sized_target, and set_target methods.
11998 (Object::sized_target): Remove.
11999 (class Sized_relobj): Update declarations. Remove sized_target.
12000 * object.cc (Sized_relobj::setup): Remove target parameter.
12001 Change all callers.
12002 (Input_objects::add_object): Don't do anything with the target.
12003 (make_elf_sized_object): Add punconfigured parameter. Change all
12004 callers. Set or test parameter target.
12005 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12006 Change all callers.
12007 * parameters.cc (Parameters::set_target): Change parameter type to
12008 be non-const.
12009 (Parameters::default_target): Remove.
12010 (set_parameters_target): Change parameter type to be non-const.
12011 (parameters_force_valid_target): New function.
12012 (parameters_clear_target): New function.
12013 * parameters.h (class Parameters): Update declarations. Remove
12014 default_target method. Add sized_target and clear_target
12015 methods. Change target_ to be non-const.
12016 (set_parameters_target): Update declaration.
12017 (parameters_force_valid_target): Declare.
12018 (parameters_clear_target): Declare.
12019 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12020 as NULL if we aren't searching.
12021 (Add_symbols::run): Don't check for compatible target.
12022 * fileread.cc (Input_file::open_binary): Call
12023 parameters_force_valid_target.
12024 * gold.cc (queue_middle_tasks): Likewise.
12025 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12026 set_target on object.
12027 * dynobj.h (class Sized_dynobj): Update declarations.
12028 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12029 make_elf_object returns NULL.
12030 (Archive::include_member): Don't check whether object target is
12031 compatible.
12032 * output.cc (Output_section::add_input_section): Get target from
12033 parameters.
12034 (Output_section::relax_input_section): Likewise.
12035 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12036 parameters.
12037 (Sized_relobj::do_scan_relocs): Likewise.
12038 (Sized_relobj::relocate_sections): Likewise.
12039 * resolve.cc (Symbol_table::resolve): Likewise.
12040 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12041 parameter. Change all callers.
12042 (Symbol_table::add_from_object): Get target from parameters.
12043 (Symbol_table::add_from_relobj): Don't check object target.
12044 (Symbol_table::add_from_dynobj): Likewise.
12045 (Symbol_table::define_special_symbol): Get target from
12046 parameters.
12047 * symtab.h (class Symbol_table): Update declaration.
12048 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12049 parameter. Change all callers. Clear parameter target.
12050 (Binary_test): Test target here.
12051 * testsuite/object_unittest.cc (gold_testsuite): Remove
12052 target_test_pointer parameter. Change all callers.
12053 (Object_test): Test target here.
12054
a6a22b83
ILT
120552009-09-26 Ian Lance Taylor <iant@google.com>
12056
12057 * testsuite/initpri1.c: Don't try to use constructor priorities if
12058 compiling with gcc before 4.3.
12059
6a8f49fe
ILT
120602009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12061
12062 * testsuite/retain_symbols_file_test.sh (check_present): Change
12063 output file name to retain_symbols_file_test.stdout.
12064 (check_absent): Likewise.
12065
8c604651
CS
120662009-09-18 Craig Silverstein <csilvers@google.com>
12067
12068 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12069 * options.cc: Include <cerrno> and <fstream>.
12070 (General_options::finalize): Parse -retain-symbols-file tag.
12071 * options.h: New flag.
12072 (General_options): New method should_retain_symbol, new
12073 variable symbols_to_retain.
12074 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12075 should_retain_symbol map.
12076 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12077 * testsuite/Makefile.in: Regenerate.
12078 * testsuite/retain_symbols_file_test.sh: New file.
12079
ca58b19f
NC
120802009-09-18 Nick Clifton <nickc@redhat.com>
12081
12082 * po/es.po: Updated Spanish translation.
12083
20e6d0d6
DK
120842009-09-17 Doug Kwan <dougkwan@google.com>
12085
12086 * debug.h (DEBUG_RELAXATION): New constant.
12087 (DEBUG_ALL): Add DEBUG_RELAXATION.
12088 (debug_string_to_enum): Add relaxation debug option.
12089 * layout.cc
12090 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12091 Layout::Relaxation_debug_check::read_sections,
12092 Layout::Relaxation_debug_check::read_sections): New method definitions.
12093 (Layout::Layout): Initialize data members
12094 record_output_section_data_from_scrips_,
12095 script_output_section_data_list_ and relaxation_debug_check_.
12096 (Layout::save_segments, Layout::restore_segments,
12097 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12098 Layout::relaxation_loop_body): New method definitions.
12099 (Layout::finalize): Support relaxation. Move section layout code to
12100 Layout::relaxation_loop_body.
12101 (Layout::set_asection_address_from_script): Move code for orphan
12102 section placement out.
12103 (Layout::place_orphan_sections_in_script): New method definition.
12104 * layout.h (Output_segment_headers, Output_file_header):
12105 New forward class declarations.
12106 (Layout::~Layout): Define.
12107 (Layout::new_output_section_data_from_script): New method definition.
12108 (Layout::place_orphan_sections_in_script): New method declaration.
12109 (Layout::Segment_states): New type declaration.
12110 (Layout::save_segments, Layout::restore_segments,
12111 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12112 Layout::relaxation_loop_body): New method declarations.
12113 (Layout::Output_section_data_list): New type declaration.
12114 (Layout::Relaxation_debug_check): New class definition.
12115 (Layout::record_output_section_data_from_script_,
12116 Layout::script_output_section_data_list_, Layout::segment_states_,
12117 Layout::relaxation_debug_check_): New data members.
12118 * output.cc: (Output_section_headers::do_size): New method definition.
12119 (Output_section_headers::Output_section_headers): Move size
12120 computation to Output_section_headers::do_size.
12121 (Output_segment_headers::do_size): New method definition.
e1df38aa 12122 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12123 Output_file_header::do_size and call it.
12124 (Output_file_header::do_size): New method definition.
12125 (Output_data_group::Output_data_group): Adjust call to
12126 Output_section_data.
12127 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12128 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12129 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12130 RELAXED_INPUT_SECTION_CODE.
12131 (Output_section::Output_section): Initialize data member checkpoint_.
12132 (Output_section::~Output_section): Delete checkpoint object pointed
12133 by checkpoint_.
12134 (Output_section::add_input_section): Always add an Input_section if
12135 relaxing.
12136 (Output_section::add_merge_input_section): Add assert.
12137 (Output_section::relax_input_section): New method definition.
12138 (Output_section::set_final_data_size): Set load address to zero for
12139 an unallocated section.
12140 (Output_section::do_address_and_file_offset_have_reset_values):
12141 New method definition.
12142 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12143 Handle relaxed input section.
12144 (Output_section::sort_attached_input_sections): Checkpoint input
12145 section list lazily.
12146 (Output_section::get_input_sections): Change type of input_sections to
12147 list of Simple_input_section pointers. Checkpoint input section list
12148 lazily. Also handle relaxed input sections.
12149 (Output_section::add_input_section_for_script): Take a reference to
12150 a Simple_input_section object instead of Relobj pointer and section
12151 index as parameter. Handle relaxed input sections.
12152 (Output_section::save_states, Output_section::restore_states): New
12153 method definitions.
12154 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12155 (Output_data::is_data_size_fixed): New method definition.
12156 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12157 if it is fixed.
12158 (Output_data::address_and_file_offset_have_reset_values): New method
12159 definition.
12160 (Output_data::do_address_and_file_offset_have_reset_values): New method
12161 definition.
12162 (Output_data::set_data_size): Check that data size is not fixed.
12163 (Output_data::fix_data_size): New method definition.
12164 (Output_data::is_data_size_fixed_): New data member.
12165 (Output_section_headers::set_final_data_size): New method definition.
12166 (Output_section_headers::do_size): New method declaration.
12167 (Output_segment_headers::set_final_data_size): New method definition.
12168 (Output_segment_headers::do_size): New method declaration.
12169 (Output_file_header::set_final_data_size)::New method definition.
12170 (Output_file_header::do_size)::New method declaration.
12171 (Output_section_data::Output_section_data): Add new parameter
12172 is_data_size_fixed and use it to fix data size.
12173 (Output_data_const::Output_data_const): Adjust call to base class
12174 constructor and fix data size.
12175 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12176 base class constructor and fix data size.
12177 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12178 base class constructor and fix data size.
12179 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12180 class constructor and fix data size.
12181 (Output_data_group::set_final_data_size): New method definition.
12182 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12183 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12184 class constructor and fix data size.
12185 (Output_relaxed_input_section): New class definition.
12186 (Output_section::Simple_input_section): New class definition.
12187 (Output_section::get_input_sections): Adjust parameter list.
12188 (Output_section::add_input_section_for_script): Same.
12189 (Output_section::save_states, Output_section::restore_states,
12190 Output_section::do_address_and_file_offset_have_reset_values,
12191 (Output_section::Input_section::Input_section): Handle
12192 RELAXED_INPUT_SECTION_CODE. Add new overload for
12193 Output_relaxed_input_section.
12194 (Output_section::Input_section::is_input_section,
12195 Output_section::Input_section::set_output_section): Handle relaxed
12196 input section.
12197 (Output_section::Input_section::is_relaxed_input_section,
12198 Output_section::Input_section::output_section_data,
12199 Output_section::Input_section::relaxed_input_section): New method
12200 definitions.
12201 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12202 value.
12203 (Output_section::Input_section::u1_): Update comments.
12204 (Output_section::Input_section::u2_): Add new union member poris.
12205 (Output_section::Checkpoint_output_section): New classs definition.
12206 (Output_section::relax_input_section): New method declaration.
12207 (Output_section::checkpoint_): New data member.
12208 (Output_segment): Update comments.
12209 (Output_segment::Output_segment): Un-privatize copy constructor.
12210 (Output_segment::operator=): Un-privatize.
12211 * script-sections.cc (Output_section_element::Input_section_list):
12212 Change element type to Output_section::Simple_input_section.
12213 (Output_section_element_dot_assignment::set_section_addresses):
12214 Register output section data for relaxation clean up.
12215 (Output_data_exression::Output_data_expression): Adjust call to base
12216 constructor to fix data size.
12217 (Output_section_element_data::set_section_addresses): Register
12218 Output_data_expression object for relaxation clean up.
12219 (struct Input_section_info): Replace Relobj pointer and section index
12220 pair with Output_section::Simple_input_section and Convert struct to a
12221 class.
12222 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12223 Input_section_info data member to use accessors.
20e6d0d6
DK
12224 (Output_section_element_input::set_section_addresses): Use layout
12225 parameter. Adjust code to use Output_section::Simple_input_section
12226 and Input_secction_info classes. Register filler for relaxation
12227 clean up.
12228 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12229 and section index pair with Output_section::Simple_input_section
12230 class. Adjust code accordingly.
12231 (Phdrs_element::release_segment): New method definition.
12232 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12233 segment list.
12234 (Script_sections::release_segments): New method definition.
12235 * gold/script-sections.h (Script_sections::release_segments): New
12236 method declaration.
12237 * gold/target.h (Target::may_relax, Target::relax,
12238 Target::do_may_relax, Target::do_relax): New method definitions.
12239
5e445df6
ILT
122402009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12241
12242 * arm.cc (has_signed_unsigned_overflow): New function.
12243 (Arm_relocate_functions::abs8): New function.
12244 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12245 (Target_arm::Scan::global): Likewise.
12246 (Target_arm::relocate::relocate): Likewise.
12247 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12248 Likewise.
12249
8c604651 122502009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12251
12252 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12253 * testsuite/Makefile.in: Regenerate.
12254
1e9cc1c2
NC
122552009-09-11 Nick Clifton <nickc@redhat.com>
12256
12257 * po/gold.pot: Updated by the Translation project.
12258
6a89f575
CC
122592009-09-08 Cary Coutant <ccoutant@google.com>
12260
12261 * output.cc (Output_file::open): Add execute permission to empty file.
12262 * testsuite/Makefile.am (permission_test): New test.
12263 * testsuite/Makefile.in: Regenerate.
12264
fdcac5af
ILT
122652009-09-02 Ian Lance Taylor <iant@google.com>
12266
12267 * output.cc (Output_file::resize): Call map_no_anonymous rather
12268 than map.
12269
44453f85
ILT
122702009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12271
12272 * gold.cc: Include "incremental.h".
12273 (queue_initial_tasks): Call Incremental_checker methods.
12274 * incremental.cc: Include "output.h".
12275 (Incremental_checker::can_incrementally_link_output_file): New
12276 method.
12277 * incremental.h (Incremental_checker): New class.
12278
12279 * output.cc (Output_file::open_for_modification): New method.
12280 (Output_file::map_anonymous): Changed return type to bool. Record
12281 map in base_ field.
12282 (Output_file::map_no_anonymous): New method, broken out of map.
12283 (Output_file::map): Use map_no_anonymous and map_anonymous.
12284 * output.h (class Output_file): Update declarations.
12285
293c1386
CC
122862009-08-24 Cary Coutant <ccoutant@google.com>
12287
12288 * options.h (Command_line::Pre_options): New class.
12289 (Command_line::pre_options): New member.
12290 * options.cc (gold::options::ready_to_register): New variable.
12291 (One_option::register_option): Do nothing if not registering options.
12292 Assert if same short option registered twice.
12293 (General_options::General_options): Turn off option registration when
12294 done constructing.
12295 (Command_line::Pre_options::Pre_options): New constructor.
12296
f773f3d2
CC
122972009-08-24 Cary Coutant <ccoutant@google.com>
12298
06a73cfe
CC
12299 * options.h (General_options::no_keep_memory): Remove incorrect
12300 short option.
f773f3d2 12301
a15af8e2
RW
123022009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12303
12304 * Makefile.am (am__skiplex, am__skipyacc): New.
12305 * Makefile.in: Regenerate.
12306
c462b41b
RW
123072009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12308
14ec8efd
RW
12309 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12310 (INCLUDES): ... this.
12311 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12312 (AM_CPPFLAGS): Renamed from ...
12313 (INCLUDE): ... this.
12314 * Makefile.in, testsuite/Makefile.in: Regenerate.
12315
81ecdfbb
RW
12316 * Makefile.in: Regenerate.
12317 * aclocal.m4: Likewise.
12318 * config.in: Likewise.
12319 * configure: Likewise.
12320 * testsuite/Makefile.in: Likewise.
12321
c462b41b
RW
12322 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12323 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12324 * Makefile.in: Regenerate.
12325 * testsuite/Makefile.in: Regenerate.
12326
2da73f13
CC
123272009-08-19 Cary Coutant <ccoutant@google.com>
12328
12329 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12330 symbols in shared libraries overridden by hidden or internal symbols
12331 in the main program.
12332
2db70501
CD
123332009-08-19 Chris Demetriou <cgd@google.com>
12334
12335 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12336 checking source file names in error messages.
12337
f733487b
DK
123382009-08-18 Doug Kwan <dougkwan@google.com>
12339
12340 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12341 an elcpp::Ehdr as parameter. Adjust call to set_target.
12342 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12343 an elfcpp::Ehdr as parameter.
12344 * object.cc (Object::set_target): Remove the version that looks up
12345 a target and sets it.
12346 (Sized_relobj::setup): Take a Target object instead of
12347 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12348 (make_elf_sized_object): Find target and ask target to
12349 make an ELF object.
12350 * object.h: (Object::set_target): Remove the version that looks up
12351 a target and sets it.
12352 (Sized_relobj::setup): Take a Target object instead of
12353 an elfcpp:Ehdr as parameter.
12354 * target.cc: Include dynobj.h.
12355 (Target::do_make_elf_object_implementation): New.
2e702c99 12356 (Target::do_make_elf_object): New.
f733487b
DK
12357 * target.h (Target::make_elf_object): New template declaration.
12358 (Target::do_make_elf_object): New method declarations.
12359 (Target::do_make_elf_object_implementation): New template declaration.
12360
cc70f101
ILT
123612009-08-14 Ian Lance Taylor <iant@google.com>
12362
12363 * gold.h (FUNCTION_NAME): Define.
12364 (gold_unreachable): Use FUNCTION_NAME.
12365
ef5e0cb1
ST
123662009-08-12 Sriraman Tallam <tmsriram@google.com>
12367
12368 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12369 symbol in the --keep-unique list is not found.
12370
48c187ce
ST
123712009-08-12 Sriraman Tallam <tmsriram@google.com>
12372
12373 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12374 been maked as --keep-unique.
12375 (Icf::unfold_section): New function.
12376 * icf.h (Icf::unfold_section): New function.
12377 * options.h (General_options::keep_unique): New option.
12378 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12379 * testsuite/Makefile.in: Regenerate.
12380 * testsuite/icf_keep_unique_test.sh: New file.
12381 * testsuite/icf_keep_unique_test.cc: New file.
12382
645afe0c
CC
123832009-08-12 Cary Coutant <ccoutant@google.com>
12384
12385 PR 10471
12386 * resolve.cc (Symbol_table::resolve): Check for references from
12387 dynamic objects to hidden and internal symbols.
12388 * testsuite/Makefile.am (hidden_test.sh): New test.
12389 * testsuite/Makefile.in: Regenerate.
12390 * testsuite/hidden_test.sh: New script.
12391 * testsuite/hidden_test_1.c: New test source.
12392 * testsuite/hidden_test_main.c: New test source.
12393
11af873f
DK
123942009-08-11 Doug Kwan <dougkwan@google.com>
12395
12396 * arm.cc: Update comments.
12397 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12398 segment to locate the .ARM.exidx section if present.
12399
b9f7d72d
DK
124002009-08-09 Doug Kwan <dougkwan@google.com>
12401
12402 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12403 patch.
12404
ddd3c53c
ST
124052009-08-07 Sriraman Tallam <tmsriram@google.com>
12406 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12407 compiler warnings.
12408
27721062
ST
124092009-08-06 Sriraman Tallam <tmsriram@google.com>
12410
12411 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12412 valid tls_segment only for non-debug-section relocations.
12413 * testsuite/Makefile.am: Add gc_tls_test.
12414 * testsuite/Makefile.in: Regenerate.
12415 * testsuite/gc_tls_test.cc: New file.
12416 * testsuite/gc_tls_test.sh: New file.
12417
ef15dade 124182009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12419
ef15dade
ST
12420 * icf.cc: New file.
12421 * icf.h: New file.
12422 * Makefile.am (CCFILES): Add icf.cc.
12423 (HFILES): Add icf.h
12424 * Makefile.in: Regenerate.
12425 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12426 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12427 section, symbol and addend information for the relocs.
12428 * gold.cc (queue_middle_tasks): Call identical code folding.
12429 * gold.h: Add defines for multimap.
12430 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12431 to the call of finalize_local_symbols.
12432 * main.cc (main): Create object of class Icf.
12433 * object.cc (Sized_relobj::do_layout): Allow this function to be
12434 called twice during icf.
12435 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12436 to sections marked as identical by icf.
12437 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12438 when available.
12439 (Sized_relobj::do_section_entsize): New function.
12440 * object.h (Object::section_entsize): New function.
12441 (Object::do_section_entsize): New pure virtual function.
12442 (Relobj::finalize_local_symbols): Add new parameter.
12443 (Relobj::do_section_entsize): New function.
12444 * options.h (General_options::icf): New option.
12445 (General_options::icf_iterations): New option.
12446 (General_options::print_icf_sections): New option.
12447 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12448 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12449 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12450 icf.
12451 * symtab.cc (Symbol_table::is_section_folded): New function.
12452 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12453 to sections marked as identical by icf.
12454 * symtab.h (Symbol_table::set_icf): New function.
12455 (Symbol_table::icf): New function.
12456 (Symbol_table::is_section_folded): New function.
12457 (Symbol_table::icf_): New data member.
12458 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12459 * testsuite/Makefile.am: Add commands to build icf_test.
12460 * testsuite/Makefile.in: Regenerate.
12461 * testsuite/icf_test.sh: New file.
12462 * testsuite/icf_test.cc: New file.
12463
c3b65ac4
CD
124642009-07-24 Chris Demetriou <cgd@google.com>
12465
12466 * layout.cc (is_compressible_debug_section): Fix incorrect
12467 comment about compressed section names.
12468
1caf2c51
ILT
124692009-07-20 Ian Lance Taylor <ian@airs.com>
12470
12471 PR 10419
12472 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12473
1ef4d87f
ILT
124742009-07-16 Ian Lance Taylor <iant@google.com>
12475
12476 PR 10400
12477 * layout.h: #include <map>.
12478 (class Kept_section): Change from struct to class. Add accessors
12479 and setters. Add section size to Comdat_group mapping. Change
12480 Comdat_group to std::map. Add is_comdat_ field. Add
12481 linkonce_size field in union.
12482 (class Layout): Update declaration of find_or_add_kept_section.
12483 Don't declare find_kept_object.
12484 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12485 parameter. Add object, shndx, is_comdat, and is_group_name
12486 parameters. Change all callers. Adjust for new Kept_section.
12487 (Layout::find_kept_object): Remove.
12488 * object.cc (Sized_relobj::include_section_group): Update use of
12489 Kept_section. Rename secnum to shndx. Only record
12490 Kept_comdat_section if sections are the same size.
12491 (Sized_relobj::include_linkonce_section): Update use of
12492 Kept_section. Only record Kept_comdat_section if sections are the
12493 same size. Set size of linkonce section.
12494 (Sized_relobj::map_to_kept_section): Update call to
12495 get_kept_comdat_section.
12496 * object.h (class Sized_relobj): Rename fields in
12497 Kept_comdat_section to drop trailing underscores; change object
12498 field to Relobj*. Change Kept_comdat_section_table to store
12499 struct rather than pointer.
12500 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12501 Add kept_object and kept_shndx parameters. Change all callers.
12502 (Sized_relobj::get_kept_comdat_section): Change return type to
12503 bool. Add kept_object and kept_shndx parameters. Change all
12504 callers.
12505 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12506 Layout::find_or_add_kept_section.
12507
37c3b7b0
ILT
125082009-07-09 Ian Lance Taylor <iant@google.com>
12509
12510 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12511 Reserve space in the hash table.
12512
98fa85cb
ILT
125132009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12514
12515 * fileread.cc (File_read::get_mtime): New method.
12516 * fileread.h (Timespec): New structure.
12517 (File_read::get_mtime): New method.
12518 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12519 Renamed from timestamp_nsec.
12520 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12521 Elf_Xword.
e1df38aa 12522 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12523 timestamp_nsec.
e1df38aa 12524 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12525 (Incremental_inputs::report_obejct): Save mtime; style fix.
12526 (Incremental_inputs::report_script): Save mtime; style fix.
12527 (Incremental_inputs::finalize_inputs): Style fix.
12528 (Incremental_inputs::finalize): Style fix.
12529 (Incremental_inputs::create_input_section_data): Store inputs
12530 mtime.
12531 * incremental.h (Incremental_inputs::report_script): Add mtime
12532 argument.
12533 (Incremental_inputs::Input_info::Input_info): Intialize only one
12534 union member.
12535 (Incremental_inputs::Input_info::archive): Move to nameless
12536 union.
12537 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12538 (Incremental_inputs::Input_info::script): Move to nameless union.
12539 (Incremental_inputs::mtime): New field.
12540 * script.cc (read_input_script): Pass file mtime to
12541 Incremental_input.
12542 * script.h (Script_info::inputs): Style fix.
12543
c9d70757
ILT
125442009-07-01 Ian Lance Taylor <ian@airs.com>
12545
12546 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12547 instead of 32.
12548
9c547ec3
ILT
125492009-06-24 Ian Lance Taylor <iant@google.com>
12550
12551 PR 10156
12552 * layout.cc (Layout::choose_output_section): If we find an
12553 existing section, update the flags.
12554 (Layout::create_notes): New function, broken out of
12555 Layout::finalize.
12556 (Layout::finalize): Don't create note sections.
12557 (Layout::create_note): Don't crash if linker script discards
12558 section.
12559 (Layout::create_gold_note): Likewise.
12560 (Layout::create_build_id): Likewise. Don't set
12561 after_input_sections on the section.
12562 (Layout::create_executable_stack_info): Remove target parameter.
12563 Change caller.
12564 * layout.h (class Layout): Declare create_notes. Update
12565 declaration of create_executable_stack_info.
12566 * gold.cc (queue_middle_tasks): Call create_notes.
12567 * output.cc (Output_section::update_flags_for_input_section): Move
12568 here from output.h. If SHF_ALLOC flag is newly set, mark address
12569 invalid.
12570 * output.h (Output_data::mark_address_invalid): New function.
12571 (class Output_section): Only declare, not define,
12572 update_flags_for_input_section. Remove set_flags.
12573
55458500
ILT
125742009-06-24 Ian Lance Taylor <iant@google.com>
12575
12576 * script-sections.cc (Output_section_definition::
12577 set_section_addresses): Rename shadowing local load_address to
12578 laddr.
12579
1307d6cd
ILT
125802009-06-24 Ian Lance Taylor <iant@google.com>
12581
12582 PR 10244
12583 * reloc.cc (relocate_sections): Skip empty relocation sections.
12584
ec3f783e
ILT
125852009-06-23 Ian Lance Taylor <iant@google.com>
12586
12587 PR 10156
12588 * layout.cc (Layout::create_note): Use choose_output_section
12589 rather than make_output_section.
12590
459c9f1c
ILT
125912009-06-23 Ian Lance Taylor <iant@google.com>
12592
12593 PR 10237
12594 * options.cc (General_options::parse_V): Set printed_version_.
12595 (General_options::General_options): Initialize printed_version_.
12596 * options.h (class General_options): Add printed_version_ field.
12597 * gold.cc (queue_initial_tasks): If there are no input files,
12598 don't give a fatal error if we printed the version information.
12599 (queue_middle_tasks): If using -r with a shared object, give a
12600 fatal error rather than an ordinary error.
12601
1518dc8f
ILT
126022009-06-23 Ian Lance Taylor <iant@google.com>
12603
12604 PR 10219
12605 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12606 (Layout::make_output_section): Set have_stabstr_section_ if we see
12607 a .stab*str section.
12608 (Layout::finalize): Call link_stabs_sections.
12609 (Layout::link_stabs_sections): New file.
12610 * layout.h (class Layout): Add have_stabstr_section_ field.
12611 Declare link_stabs_sections.
12612
3d857b98
DK
126132009-06-23 Doug Kwan <dougkwan@google.com>
12614
12615 * Makefile.am (libgold_a_LIBADD): New.
12616 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12617 * Makefile.in: Regenerate.
3d857b98
DK
12618 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12619 * configure: Regenerate.
12620 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12621 * fileread.cc: Include sys/state.h
12622 * gold.h: Declare memmem and strndup if found missing.
12623 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12624
0639a6f6
ILT
126252009-06-23 Ian Lance Taylor <iant@google.com>
12626
12627 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12628 * configure: Rebuild.
12629
8d63875c
ILT
126302009-06-23 Ian Lance Taylor <iant@google.com>
12631
12632 PR 10147
12633 * object.cc (Object::section_contents): Don't try to get a view if
12634 the section has length zero.
12635 (Object::handle_gnu_warning_section): If the section is empty, use
12636 the name of the section as the warning.
12637
f7c8a183
ILT
126382009-06-23 Ian Lance Taylor <iant@google.com>
12639
12640 PR 10133
12641 * stringpool.h (class Stringpool_template): Add optimize_ field.
12642 (Stringpool_template::set_optimize): New function.
12643 * stringpool.cc (Stringpool_template::Stringpool_template):
12644 Initialize optimize_ field.
12645 (Stringpool_template::set_string_offsets): Test local optimize
12646 fild rather than parameter.
12647 * layout.cc (Layout::Layout): Call set_optimize on the section
12648 name stringpool.
12649
e6a307ba
ILT
126502009-06-22 Ian Lance Taylor <iant@google.com>
12651
12652 PR 10030
12653 * yyscript.y: Parse TARGET.
12654 * script.cc (script_set_target): New function.
12655 * script-c.h (script_set_target): Declare.
12656 * options.cc (General_options::string_to_object_format): Rename
12657 from string_to_object_format in anonymous namespace. Change
12658 callers.
12659 * options.h (class General_options): Declare
12660 string_to_object_format.
12661
3ee173de
ILT
126622009-06-22 Ian Lance Taylor <iant@google.com>
12663
12664 * script-sections.cc (Script_sections::create_segments): Don't put
12665 program headers in a PT_LOAD segment if -n or -N.
12666
126672009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
12668
12669 PR 10141
12670 * options.h (class General_options): Add -z lazy and -z now. Sort
12671 -z options into alphabetical order.
12672 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12673
cd6739a1 126742009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
12675
12676 * layout.cc (Layout::make_output_section): Call
12677 Target::new_output_section.
12678 (Layout::attach_allocated_section_to_segment): Put large section
12679 sections in a separate load segment with the large segment flag
12680 set.
12681 (Layout::segment_precedes): Sort large data segments after other
12682 load segments.
12683 (align_file_offset): New static function.
12684 (Layout::set_segment_offsets): Use align_file_offset.
12685 * output.h (class Output_section): Add is_small_section_ and
12686 is_large_section_ fields.
12687 (Output_section::is_small_section): New function.
12688 (Output_section::set_is_small_section): New function.
12689 (Output_section::is_large_section): New function.
12690 (Output_section::set_is_large_section): New function.
12691 (Output_section::is_large_data_section): New function.
12692 (class Output_segment): Add is_large_data_segment_ field.
12693 (Output_segment::is_large_data_segment): New function.
12694 (Output_segment::set_is_large_data_segment): New function.
12695 * output.cc (Output_section::Output_section): Initialize new
12696 fields.
12697 (Output_segment::Output_segment): Likewise.
12698 (Output_segment::add_output_section): Add assertion that large
12699 data sections always go in large data segments. Force small data
12700 sections to the end of the list of data sections. Force small BSS
12701 sections to the start of the list of BSS sections. For large BSS
12702 sections to the end of the list of BSS sections.
12703 * symtab.h (class Symbol): Declare is_common_shndx.
12704 (Symbol::is_defined): Check Symbol::is_common_shndx.
12705 (Symbol::is_common): Likewise.
12706 (class Symbol_table): Define enum Commons_section_type. Update
12707 declarations. Add small_commons_ and large_commons_ fields.
12708 * symtab.cc (Symbol::is_common_shndx): New function.
12709 (Symbol_table::Symbol_table): Initialize new fields.
12710 (Symbol_table::add_from_object): Put small and large common
12711 symbols in the right list.
12712 (Symbol_table::sized_finalized_symbol): Check
12713 Symbol::is_common_shndx.
12714 (Symbol_table::sized_write_globals): Likewise.
12715 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12716 common symbol lists. Don't call do_allocate_commons_list if the
12717 list is empty.
12718 (Symbol_table::do_allocate_commons_list): Remove is_tls
12719 parameter. Add comons_section_type parameter. Change all
12720 callers. Handle small and large common symbols.
12721 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12722 Symbol::is_common_shndx.
12723 * resolve.cc (symbol_to_bits): Likewise.
12724 * target.h (Target::small_common_shndx): New function.
12725 (Target::small_common_section_flags): New function.
12726 (Target::large_common_shndx): New function.
12727 (Target::large_common_section_flags): New function.
12728 (Target::new_output_section): New function.
12729 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12730 small_common_section_flags, and large_common_section_flags
12731 fields.
12732 (Target::do_new_output_section): New virtual function.
12733 * arm.cc (Target_arm::arm_info): Initialize new fields.
12734 * i386.cc (Target_i386::i386_info): Likewise.
12735 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12736 Likewise.
12737 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12738 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12739 (Target_x86_64::do_new_output_section): New function.
12740 * configure.ac: Define conditional MCMODEL_MEDIUM.
12741 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12742 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12743 (large_LDFLAGS): Define.
12744 * testsuite/large.c: New file.
12745 * testsuite/testfile.cc (Target_test::test_target_info):
12746 Initialize new fields.
12747 * configure, testsuite/Makefile.in: Rebuild.
12748
bb04269c
DK
127492009-06-05 Doug Kwan <dougkwan@google.com>
12750
12751 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 12752 * Makefile.in: Regenerate.
bb04269c
DK
12753 * i386.cc (class Target_i386): Define new virtual method to
12754 override do_is_local_label_name in parent.
12755 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12756 local symbols if --discard-locals or -X is given.
12757 * options.h (class General_options): Declare new options
12758 '--discard-locals' and '-X' for discarding locals.
12759 * target.h (class Target): Define new methods is_local_label_name.
12760 Declare new virtual method do_is_local_label_name.
12761 * target.cc: New file.
12762 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12763 (check_SCRIPTS): Add discard_locals_test.sh.
12764 (check_DATA): Add discard_local_tests.syms.
12765 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12766 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12767 * testsuite/Makefile.in: Regenerate.
12768 * testsuite/discard_locals_test.c: New file.
12769 * testsuite/discard_locals_test.sh: Same.
12770
805bb01c
DK
127712009-06-05 Doug Kwan <dougkwan@google.com>
12772
12773 * object.cc (Sized_relobj::Sized_relobj): Initialize
12774 discarded_eh_frame_shndx_ to -1U.
12775 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12776 section.
12777 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12778 a discarded .eh_frame section.
12779 (Sized_relobj::do_finalize_local_symbols): Ditto.
12780 * object.h (class Sized_relobj): Declare new member
12781 discarded_eh_frame_shndx_.
12782 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12783 (local_labels_test.o, local_labels_test): New rules.
12784 * testsuite/Makefile.in: Regenerate.
12785
1dcd334d
DK
127862009-06-04 Doug Kwan <dougkwan@google.com>
12787
12788 * layout.cc (Layout::section_name_mapping): Add mapping for
12789 special ARM sections.
12790
96d49306
DK
127912009-06-03 Doug Kwan <dougkwan@google.com>
12792
12793 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12794 (utils::has_overflow): Same.
12795
dff16297
ILT
127962009-06-03 Ian Lance Taylor <iant@google.com>
12797
12798 * layout.cc (Layout::section_name_mapping): New array, replacing
12799 Layout::linkonce_mapping.
12800 (Layout::section_name_mapping_count): New variable, replacing
12801 Layout::linkonce_mapping_count.
12802 (Layout::linkonce_output_name): Remove.
12803 (Layout::output_section_name): Rewrite.
12804 * layout.h (class Layout): Rename Linkonce_mapping to
12805 Section_name_mapping, linkonce_mapping to section_name_mapping,
12806 linkonce_mapping_count to section_name_mapping_count. Don't
12807 declare linkonce_output_name.
12808
c121c671
DK
128092009-06-03 Doug Kwan <dougkwan@google.com>
12810
12811 * gold/arm.cc (namespace utils): New.
12812 (Target_arm::reloc_is_non_pic): Define new method.
12813 (class Arm_relocate_functions): New.
12814 (Target_arm::Relocate::relocate): Handle relocation types used by
12815 Android.
12816
07800fab
ILT
128172009-06-03 Ian Lance Taylor <iant@google.com>
12818
12819 * arm.cc (Target_arm::scan::global): Use || instead of |.
12820
c121c671
DK
128212009-06-02 Doug Kwan <dougkwan@google.com>
12822
12823 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
12824 issued_non_pic_error_.
12825 (class Target_arm::Scan): Declare new method check_non_pic.
12826 Define new method symbol_needs_plt_entry.
12827 Declare new data member issued_non_pic_error_.
12828 (class Target_arm::Relocate): Declare new method
12829 should_apply_static_reloc.
12830 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
12831 (Target_arm::Scan::check_non_pic): Define new method.
12832 (Target_arm::Scan::local): Handle a small subset of reloc types used
12833 by Android.
12834 (Target_arm::Scan::local): Same.
12835 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
12836
b19b0c6d
ILT
128372009-05-31 Mikolaj Zalewski <mikolajz@google.com>
12838
12839 * incremental.cc (Incremental_inputs::report_command_line): Filter
12840 out --incremental-* options.
12841
94cdfcff
DK
128422009-05-29 Doug Kwan <dougkwan@google.com>
12843
12844 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
12845 template class.
12846 (class Target_arm): Update comment.
12847 (Target_arm::Target_arm): Initialize new data members GOT_,
12848 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
12849 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
12850 and Target_arm::rel_dyn_section.
12851 Declare new_enum Target_arm::Got_type.
12852 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
12853 and DYNBSS_.
12854 Update commments for member do_dynsym_value.
12855 (Target_arm::got_size, Target_arm::plt_section,
12856 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
12857 new methods inside class defintion.
12858 (Target_arm::got_section): Define new method.
12859 (Target_arm::rel_dyn_section): Same.
12860 (Output_data_plt_arm): New template class.
12861 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
12862 (Output_data_plt_arm:do_adjust_output_section): Define new method.
12863 (Output_data_plt_arm::add_entry): Same.
12864 (Output_data_plt_arm::first_plt_entry): Define new
12865 static data member for PLT instruction template.
12866 (Output_data_plt_arm::plt_entry): Same.
12867 (Output_data_plt_arm::do_write): Define new method.
12868 (Target_arm::make_plt_entry): Same.
12869 (Target_arm::do_finalize_sections): Same.
12870 (Target_arm::do_dynsym_value): Same.
12871
4a657b0d
DK
128722009-05-28 Doug Kwan <dougkwan@google.com>
12873
12874 * Makefile.am (TARGETSOURCES): Add arm.cc.
12875 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
12876 * Makefile.in: Regenerate.
12877 * arm.cc: New file.
12878 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
12879
e7ae8c36
DK
128802009-05-26 Doug Kwan <dougkwan@google.com>
12881
12882 * options.cc (General_options::parse_exclude_libs). Fix a comment.
12883 (General_options::check_excluded_libs): Strip off directories in
12884 archive name before matching like GNU ld does.
12885 * testsuite/Makefile.am (MOSTLYCLEANFILES,
12886 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
12887 (exclude_libs_test_LDFLAGS): Add linker option
12888 -Wl,--exclude-libs,libexclude_libs_test_3
12889 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
12890 an explicit archive without using -l.
12891 (alt/libexclude_libs_test_3.a): New make rule.
12892 * testsuite/Makefile.in: Regenerate.
12893 * testsuite/exclude_libs_test.c : Declare lib3_default().
12894 (main): Call it.
12895 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
12896 * exclude_libs_test_3.c: New file.
12897
f12e7348
NC
128982009-05-26 Nick Clifton <nickc@redhat.com>
12899
12900 * po/id.po: New Indonesian translation.
12901 * po/gold.pot: Updated template file.
12902
4daadc0d
ST
129032009-05-22 Sriraman Tallam <tmsriram@google.com>
12904
e1df38aa 12905 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
12906 gc_comdat_test files. Add -Wl,--gc-sections to build
12907 gc_comdat_test.
12908 * testsuite/Makefile.in: Regenerate.
12909 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
12910
531813ad
ST
129112009-05-21 Sriraman Tallam <tmsriram@google.com>
12912
12913 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
12914 kept comdat section was garbage collected.
12915 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
12916 * testsuite/Makefile.in: Regenerate.
12917 * testsuite/gc_comdat_test.sh: New file.
12918 * testsuite/gc_comdat_test_1.cc: New file.
12919 * testsuite/gc_comdat_test_2.cc: New file.
12920
65514900
CC
129212009-05-19 Doug Kwan <dougkwan@google.com>
12922
12923 * archive.cc (Archive::Archive): Move constructor from archive.h
12924 to here. Initialize no_export_.
12925 (Archive::get_elf_object_for_member): Set no_export flag of object.
12926 * archive.h (Archive::Archive): Move constructor body to
12927 archive.cc.
12928 (Archive::no_export): New method.
12929 (Archive::no_export_): New field.
12930 * object.h (Object::Object): Initialize no_export_ to false.
12931 (Object::no_export, Object::set_no_export): New methods.
12932 (Object::no_export_): New field.
12933 * options.cc (General_options::parse_exclude_libs): New method.
12934 (General_options::check_excluded_libs) Same.
12935 * options.h (exclude_libs): New option.
12936 (General_options::check_excluded_libs): New method declaration.
12937 (General_options::excluded_libs_): New field.
12938 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
12939 default or protected visibility if an object has no-export flag set.
12940 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
12941 (check_SCRIPTS): Add exclude_libs_test.sh.
12942 (check_DATA): Add exclude_libs_test.syms.
12943 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
12944 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
12945 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
12946 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
12947 (exclude_libs_test.syms, libexclude_libs_test_1.a,
12948 libexclude_libs_test_2.a): New rules.
12949 * testsuite/Makefile.in: Regenerate.
12950 * testsuite/exclude_libs_test.c: New file.
12951 * testsuite/exclude_libs_test.sh: Ditto.
12952 * testsuite/exclude_libs_test_1.c: Ditto.
12953 * testsuite/exclude_libs_test_2.c: Ditto.
12954
1b77ea50
ILT
129552009-05-15 Ian Lance Taylor <iant@google.com>
12956
12957 * configure.ac: Check for declarations for cases where libiberty.h
12958 checks HAVE_DECL_xxx.
12959 * configure, config.in: Rebuild.
12960
072fe7ce
ILT
129612009-05-15 Mikolaj Zalewski <mikolajz@google.com>
12962
12963 * gold.h (Incremental_argument_list): Remove (invalid) forward
12964 declaration.
12965 * incremental.cc (Incremental_inputs::report_achive): New method.
12966 (Incremental_inputs::report_object): New method.
12967 (Incremental_inputs::report_script): New method.
12968 (Incremental_inputs::finalize_inputs): New method.
12969 (Incremental_inputs::finalize): Call finalize_inputs().
12970 (Incremental_inputs::sized_create_incremental_inputs_section_data):
12971 Create inputs entries.
12972 * incremental.h (Incremental_input_type): New enum.
12973 (Incremental_inputs::Incremental_input): Initialize new fields.
12974 (Incremental_inputs::report_inputs): New method.
12975 (Incremental_inputs::report_achive): New method.
12976 (Incremental_inputs::report_object): New method.
12977 (Incremental_inputs::report_script): New method.
12978 (Incremental_inputs::finalize_inputs): New method.
12979 (Incremental_inputs::Input_info): New struct.
12980 (Incremental_inputs::Input_info_map): New typedef.
12981 (Incremental_inputs::lock_): New field.
12982 (Incremental_inputs::Inputs_): New field.
12983 (Incremental_inputs::Inputs_map): New field.
12984 * main.cc (main): Call Incremental_input::report_inputs.
12985 * options.h (Input_argument_list): Typedef moved from
12986 Input_arguments.
12987 (Input_file_group::Files): Remove, use ::Input_argument_list.
12988 (Input_file_group::Input_argument_list): Remove, use
12989 ::Input_argument_list.
12990 * plugin.cc (Plugin_manager::add_input_file): Add error in
12991 incremental build.
12992 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
12993 functions.
12994 * script.cc (read_input_script): Call
12995 Incremental_input::report_script.
12996 * script.h (Script_info): New class.
12997
b0481b0b
ILT
129982009-04-27 Ian Lance Taylor <iant@google.com>
12999
13000 * x86_64.cc (do_adjust_output_section): Set entsize to
13001 plt_entry_size.
13002
b22a5a41 130032009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13004
13005 * output.cc (Output_file::close): After short writes, continue
13006 writing from the correct offset in the buffer being written.
13007
40fde488
CD
130082009-04-23 Chris Demetriou <cgd@google.com>
13009
13010 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13011 * configure: Regenerate.
13012 * config.in: Regenerate.
13013 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13014 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13015
3ce2c28e
ILT
130162009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13017
13018 * incremental.cc (Incremental_inputs_header_data): Renamed from
13019 Incremental_input_header_data.
13020 (Incremental_inputs_header_data::data_size): New field.
13021 (Incremental_inputs_header_data::put_input_file_count): Renamed
13022 from input_file_count.
13023 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13024 from command_line_offset.
13025 (Incremental_inputs_header_data::put_reserved): Renamed from
13026 put_reserved.
13027 (Incremental_inputs_entry_data): Renamed from
13028 Incremental_input_entry_data.
13029 (Incremental_inputs_entry_data::data_size): New field.
13030 (Incremental_inputs::report_command_line): New method.
13031 (Incremental_inputs::finalize): New method.
13032 (Incremental_inputs::create_incremental_inputs_data): New method.
13033 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13034 * incremental.h: New file.
13035 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13036 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13037 incremental builds.
703d02da 13038 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13039 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13040 (Layout::create_incremental_info_sections): New method.
13041 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13042 * main.cc (main): Notify Incremental_input of the command line.
13043
e55bde5e
ILT
130442009-04-01 Ian Lance Taylor <iant@google.com>
13045 Mikolaj Zalewski <mikolajz@google.com>
13046
13047 * gold.h (reserve_unordered_map): Define, three versions, one for
13048 each version of Unordered_map.
13049 * layout.cc (Layout::Layout): Remove options parameter. Add
13050 number_of_input_files parameter. Don't initialize options_.
13051 Initialize number_of_input_files_ and resized_signatures_. Move
13052 sections_are_attached_.
13053 (Layout::layout_group): Reserve space for group_signatures_.
13054 (Layout::find_or_add_kept_section): Change name parameter to be a
13055 reference. Resize signatures_ map when it gets large enough.
13056 (Layout::layout_eh_frame): Use parameters->options() instead of
13057 this->options_.
13058 (Layout::make_output_section): Likewise.
13059 (Layout::attach_allocated_section_to_segment): Likewise.
13060 (Layout::finalize, Layout::create_executable_stack): Likewise.
13061 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13062 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13063 * layout.h (class Layout): Update declarations. Remove options_
13064 field. Add number_of_input_files_ and resized_signatures_
13065 fields. Move sections_are_attached_ field.
13066 * main.cc (main): Pass number of input files to Layout
13067 constructor. Don't pass options.
13068
154b857c
ILT
130692009-03-30 Ian Lance Taylor <iant@google.com>
13070
13071 * ffsll.c (ffsll): Correct implementation.
13072
2f35ab9b
ILT
130732009-03-27 Ian Lance Taylor <iant@google.com>
13074
fd03461a
ILT
13075 * ffsll.c: New file.
13076 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13077 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13078 * ftruncate.c (ftruncate): Declare before definition.
13079 * mremap.c (mremap): Likewise.
13080 * pread.c (pread): Likewise.
13081 * configure, Makefile.in, config.in: Rebuild.
13082
2f35ab9b
ILT
13083 * mremap.c: New file.
13084 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13085 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13086 (mremap): Declare if HAVE_MREMAP is not defined.
13087 * configure, Makefile.in, config.in: Rebuild.
13088
33aea2fd
CC
130892009-03-27 Cary Coutant <ccoutant@google.com>
13090
13091 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13092 position independent.
13093 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13094 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13095
6d479619
CC
130962009-03-24 Cary Coutant <ccoutant@google.com>
13097
13098 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13099 an executable.
13100 (needs_dynamic_reloc): Likewise.
13101
afc06bb8
ILT
131022009-03-24 Ian Lance Taylor <iant@google.com>
13103
13104 * yyscript.y (file_cmd): Recognize EXTERN.
13105 (extern_name_list, extern_name_list_body): New nonterminals.
13106 * script.cc (script_add_extern): Define.
13107 * script-c.h (script_add_extern): Declare.
13108
f6060a4d
ILT
131092009-03-24 Rafael Avila de Espindola <espindola@google.com>
13110
13111 * object.cc (is_elf_object): Define.
13112 * object.h (is_elf_object): Declare.
13113 * archive.cc (Archive::get_elf_object_for_member): Call
13114 is_elf_object.
33aea2fd 13115 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13116
26736d8e
ILT
131172009-03-24 Elliott Hughes <enh@google.com>
13118
13119 * output.cc (Output_file::map_anonymous): Define.
13120 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13121 try an anonymous one. Report the size if the mmap fails.
13122 * output.h (class Output_file): Declare map_anonymous.
13123
22fd9730
ILT
131242009-03-24 Ian Lance Taylor <iant@google.com>
13125
13126 * target-select.cc (instantiate_target): Don't acquire the lock if
13127 the instantiated_target_ field has already been set.
13128
cb010894
ILT
131292009-03-23 Ian Lance Taylor <iant@google.com>
13130
7f055c20
ILT
13131 * gold-threads.h (class Initialize_lock): Define.
13132 * gold-threads.cc (class Initialize_lock_once): Define.
13133 (initialize_lock_control): New static variable.
13134 (initialize_lock_pointer): New static variable.
13135 (initialize_lock_once): New static function.
13136 (Initialize_lock::Initialize_lock): Define.
13137 (Initialize_lock::initialize): Define.
13138 * target-select.h: Include "gold-threads.h".
13139 (class Target_selector): Add lock_ and initialize_lock_ fields.
13140 Don't define instantiate_target, just declare it.
13141 * target-select.cc (Target_selector::Target_selector): Initialize
13142 new fields.
13143 (Target_selector::instantiate_target): Define.
13144 * descriptors.h: Include "gold-threads.h".
13145 (class Descriptors): Add initialize_lock_ field.
13146 * descriptors.cc (Descriptors::Descriptors): Initialize new
13147 field.
13148 (Descriptors::open): Use initialize_lock_ field
13149 * errors.h (class Errors): Add initialize_lock_ field.
13150 * errors.cc (Errors::Errors): Initialize new field.
13151 (Errors::initialize_lock): Use initialize_lock_ field.
13152 * powerpc.cc (class Target_selector_powerpc): Remove
13153 instantiated_target_ field. In do_recognize call
13154 instantiate_target rather than do_instantiate_target. In
13155 do_instantiate_target just allocate a new target.
13156 * sparc.cc (class Target_selector_sparc): Likewise.
13157
36959681
ILT
13158 * freebsd.h: New file.
13159 * i386.cc: Include "freebsd.h".
13160 (Target_i386): Derive from Target_freebsd rather than
13161 Sized_target.
13162 (Target_selector_i386): Derive from Target_selector_freebsd rather
13163 than Target_selector.
13164 * x86_64.cc: Include "freebsd.h".
13165 (Target_x86_64): Derive from Target_freebsd rather than
13166 Sized_target.
13167 (Target_selector_x86_64): Derive from Target_selector_freebsd
13168 rather than Target_selector.
13169 * target.h (class Target): Add adjust_elf_header and
13170 do_adjust_elf_header.
13171 * output.cc (Output_file_header:: do_sized_write): Call target
13172 adjust_elf_header routine.
13173 * configure.tgt: Set targ_osabi.
13174 * configure.ac: Define GOLD_DEFAULT_OSABI.
13175 * parameters.cc (Parameters::default_target): Pass
13176 GOLD_DEFAULT_OSABI to select_target.
13177 * target-select.h (class Target_selector): Make instantiate_target
13178 protected rather than private.
13179 * Makefile.am (HFILES): Add freebsd.h.
13180 * configure, Makefile.in, config.in: Rebuild.
13181
cb010894
ILT
13182 * merge.cc (do_add_input_section): Correct pend value. Change
13183 message about last entry not being null terminated from error to
13184 warning.
13185
0e879927
ILT
131862009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13187
13188 * incremental.cc: New file.
13189 * Makefile.am (CCFILES): Add incremental.cc.
13190 * Makefile.in: Rebuild.
13191
41105937
PP
131922009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13193
13194 * layout.cc (Layout::output_section_name): Preserve names
13195 of '.note.' sections.
e1df38aa 13196
60439920
ILT
131972009-03-19 Ian Lance Taylor <iant@google.com>
13198
13199 * descriptors.cc (Descriptors::open): Check that the options are
13200 valid before using them.
13201
0d371ad3
ILT
132022009-03-18 Ian Lance Taylor <iant@google.com>
13203
13204 * script-sections.h: Include <list>.
13205 (class Script_sections): Change Sections_elements from std::vector
13206 to std::list. Typedef public Elements_iterator. Add
13207 orphan_section_placement_, data_segment_align_start_, and
13208 saw_data_segment_align_ fields. Remove data_segment_align_index_
13209 field.
13210 * script-sections.cc (class Orphan_section_placement): New class.
13211 (class Sections_element): Add virtual functions is_relro and
13212 orphan_section_init. Remove virtual function place_orphan_here.
13213 (class Output_section_definition): Add is_relro and
13214 orphan_section_init. Remove place_orphan_here.
13215 (class Orphan_output_section): Likewise.
13216 (Script_sections::Script_sections): Update for field changes.
13217 (Script_sections::data_segment_align): Set saw_data_segment_align_
13218 and data_segment_align_start_, not data_segment_align_index.
13219 (Script_sections::data_segment_relro_end): Check
13220 saw_data_segment_align_. Use data_segment_align_start_ rather
13221 than data_segment_align_index_.
13222 (Script_sections::place_orphan): Rewrite to use
13223 Orphan_section_placement.
13224
9201d894
ILT
132252009-03-17 Ian Lance Taylor <iant@google.com>
13226
9c5b8369
ILT
13227 * archive.cc (Archive::add_symbols): Check for a version attached
13228 to the symbol name in the archive map.
13229 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13230 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13231 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13232 (ver_test_11.a): New target.
13233 * testsuite/Makefile.in: Rebuild.
13234
9201d894
ILT
13235 * configure.ac: Check for chsize and posix_fallocate. Replace
13236 ftruncate.
13237 * ftruncate.c: New file, from gnulib.
13238 * output.cc (posix_fallocate): Define dummy version if not
13239 HAVE_POSIX_FALLOCATE.
13240 (Output_file::map): Call posix_fallocate rather than lseek and
13241 write.
13242 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13243 * configure, Makefile.in, config.in: Rebuild.
13244
ef4ab7a8 132452009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13246
ef4ab7a8
PP
13247 * layout.h (Layout::create_note): Add section_name parameter.
13248 * layout.cc (Layout::create_note): Likewise.
13249 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13250
8c500701
ILT
132512009-03-17 Ian Lance Taylor <iant@google.com>
13252
e85b18e1
ILT
13253 * descriptors.cc: Include "options.h".
13254 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13255 (Descriptors::open): Always use O_CLOEXEC when opening a new
13256 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13257 then set FD_CLOEXEC.
13258
9efe6174
ILT
13259 * sparc.cc (class Target_sparc): Add has_got_section.
13260 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13261 make sure we have a GOT section.
13262
13263 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13264 (Target_sparc::Scan::local): Likewise.
13265 (Target_sparc::Scan::global): Likewise.
13266 (Target_sparc::Relocate::relocate): Likewise.
13267 (Target_sparc::Relocate::relocate_tls): Likewise.
13268
8c500701
ILT
13269 * symtab.cc (Symbol_table::define_default_version): New function,
13270 broken out of add_from_object.
13271 (Symbol_table::add_from_object): Call define_default_version.
13272 (Symbol_table::define_special_symbol): Add resolve_oldsym
13273 parameter. Change all callers. If the version for a symbol comes
13274 from a version script, resolve it with the symbol with the same
13275 name with no version. Also add the symbol without a version if
13276 appropriate.
13277 (do_define_in_output_data): If resolving with oldsym, don't delete
13278 sym.
13279 (do_define_in_output_segment): Likewise.
13280 (do_define_as_constant): Likewise.
13281 * symtab.h (class Symbol_table): Update declarations.
13282
f1ed28fb
ILT
132832009-03-13 Ian Lance Taylor <iant@google.com>
13284
15f8229b
ILT
13285 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13286 (Read_symbols::requeue): New function.
13287 (Read_symbols::do_read_symbols): If make_elf_object fails because
13288 the target type is not configured, and the file was searched for,
13289 issue a warning and retry with the next directory.
13290 (Add_symbols::run): If the file has an incompatible format, and
13291 it was searched for, requeue the Read_symbols task. On error,
13292 release the object.
13293 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13294 dirindex parameter to constructor. Change all callers. Declare
13295 incompatible_warning and requeue.
13296 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13297 input_argument_ and input_group_ fields. Add them to
13298 constructor. Change all callers.
13299 (class Read_script): Add dirindex_ field. Add it to constructor.
13300 Change all callers.
13301 * archive.cc (Archive::setup): Remove input_objects parameter.
13302 Change all callers.
13303 (Archive::get_file_and_offset): Likewise.
13304 (Archive::read_all_symbols): Likewise.
13305 (Archive::read_symbols): Likewise.
13306 (Archive::get_elf_object_for_member): Remove input_objects
13307 parameter. Add punconfigured parameter. Change all callers.
13308 (Archive::add_symbols): Change return type to bool. Check return
13309 value of include_member.
13310 (Archive::include_all_members): Likewise.
13311 (Archive::include_member): Change return type to bool. Return
13312 false if first included object has incompatible target. Set
13313 included_member_ field.
13314 (Add_archive_symbols::run): If add_symbols returns false, requeue
13315 Read_symbols task.
13316 * archive.h (class Archive): Add included_member_ field.
13317 Initialize it in constructor. Add input_file and searched_for
13318 methods. Update declarations.
13319 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13320 input_argument_ fields. Add them to constructor. Change all
13321 callers.
13322 * script.cc: Include "target-select.h".
13323 (class Parser_closure): Add skip_on_incompatible_target_ and
13324 found_incompatible_target_ fields. Add
13325 skip_on_incompatible_target parameter to constructor. Change all
13326 callers. Add methods skip_on_incompatible_target,
13327 clear_skip_on_incompatible_target, found_incompatible_target, and
13328 set_found_incompatible_target.
13329 (read_input_script): Add dirindex parameter. Change all callers.
13330 If parser finds an incompatible target, requeue Read_symbols
13331 task.
13332 (script_set_symbol): Clear skip_on_incompatible_target in
13333 closure.
13334 (script_add_assertion, script_parse_option): Likewise.
13335 (script_start_sections, script_add_phdr): Likewise.
13336 (script_check_output_format): New function.
13337 * script.h (read_input_script): Update declaration.
13338 * script-c.h (script_check_output_format): Declare.
13339 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13340 (ignore_cmd): Remove OUTPUT_FORMAT.
13341 * fileread.cc (Input_file::Input_file): Add explicit this.
13342 (Input_file::will_search_for): New function.
13343 (Input_file::open): Add pindex parameter. Change all callers.
13344 * fileread.h (class Input_file): Add input_file_argument method.
13345 Declare will_search_for. Update declarations.
13346 * object.cc (make_elf_object): Add punconfigured parameter.
13347 Change all callers.
13348 * object.h (class Object): Make input_file public. Add
13349 searched_for method.
13350 (make_elf_object): Update declaration.
13351 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13352 restart search.
13353 * dirsearch.h (class Dirsearch): Update declaration.
13354 * options.h (class General_options): Add --warn-search-mismatch.
13355 * parameters.cc (Parameters::is_compatible_target): New function.
13356 * parameters.h (class Parameters): Declare is_compatible_target.
13357 * workqueue.cc (Workqueue::add_blocker): New function.
13358 * workqueue.h (class Workqueue): Declare add_blocker.
13359
f1ed28fb
ILT
13360 * fileread.cc (Input_file::open): Remove options parameter.
13361 Change all callers.
13362 (Input_file::open_binary): Likewise.
13363 * script.cc (read_input_script): Likewise.
13364 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13365 options parameter from constructor. Change all callers.
13366 (class Read_script): Likewise.
13367 * fileread.h (class Input_file): Update declarations.
13368 * script.h (read_input_script): Update declaration.
13369
34dd024a
NC
133702009-03-10 Nick Clifton <nickc@redhat.com>
13371
13372 * po/es.po: New Spanish translation.
13373
6d71b17c
CC
133742009-03-06 Cary Coutant <ccoutant@google.com>
13375
13376 * options.cc (parse_short_option): Keep dash_z from registering itself.
13377
031cdbed
ILT
133782009-03-03 Ian Lance Taylor <iant@google.com>
13379
13380 PR 9918
13381 * target-reloc.h (relocate_section): Pass output_section to
13382 relocate.
13383 * i386.cc (Target_i386::should_apply_static_reloc): Add
13384 output_section parameter. Change all callers.
13385 (Target_i386::Relocate::relocate): Add output_section parameter.
13386 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13387 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13388 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13389 * testsuite/two_file_shared.sh: New script.
13390 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13391 (check_DATA): Add two_file_shared.dbg.
13392 (two_file_shared.dbg): New target.
13393 * testsuite/Makefile.in: Rebuild.
13394
15d5fa16
ILT
133952009-03-01 Ian Lance Taylor <iant@google.com>
13396
13397 * configure.ac: Check for byteswap.h.
13398 * configure: Rebuild.
13399 * config.in: Rebuild.
13400
8a4c0b0d
ILT
134012009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13402
13403 * layout.cc (Layout::find_or_add_kept_section): New function.
13404 (Layout::add_comdat): Removed.
13405 * layout.h (struct Kept_section): Move out of class Layout.
13406 Remove trailing underscores from field names. Add group_sections
13407 field. Rename group_ field to is_group. Change all uses.
13408 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13409 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13410 comdat_groups_ field.
13411 (Sized_relobj::include_section_group): Use
13412 find_or_add_kept_section and Kept_section::group_sections.
13413 (Sized_relobj::include_linkonce_section): Likewise.
13414 * object.cc (class Sized_relobj): Don't define Comdat_group or
13415 Comdat_group_table. Remove find_comdat_group and
13416 add_comdat_group. Remove comdat_groups_ field.
13417 * plugin.cc (include_comdat_group): Use
13418 Layout::find_or_add_kept_section.
13419
b4ecf66b
ILT
134202009-02-28 Ian Lance Taylor <iant@google.com>
13421
14359ca0
ILT
13422 * README: --gc-sections and map files are now supported. Document
13423 some build requirements.
13424
b4ecf66b
ILT
13425 PR 6992
13426 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13427 relocatable link set the value of the section symbol to zero.
13428 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13429 relocatable link don't include the section address in the local
13430 symbol value.
13431
0602e05a
ILT
134322009-02-27 Ian Lance Taylor <iant@google.com>
13433
fd9d194f
ILT
13434 PR 6811
13435 * options.h (class Search_directory): Add is_system_directory.
13436 (class General_options): Declare is_in_system_directory.
13437 * options.cc (get_relative_sysroot): Make static.
13438 (get_default_sysroot): Make static.
13439 (General_optoins::is_in_system_directory): New function.
13440 * fileread.cc (Input_file::is_in_system_directory): New function.
13441 * fileread.h (class Input_file): Declare is_in_system_directory.
13442 * object.h (class Object): Add is_in_system_directory.
13443 (class Input_objects): Remove system_library_directory_ field.
13444 * object.cc (Input_objects::add_object): Don't set
13445 system_library_directory_.
13446 (input_objects::found_in_system_library_directory): Remove.
13447 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13448 parameter. Change all callers.
13449 (Symbol_table::sized_write_globals): Likewise.
13450 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13451 Call Object::is_in_system_directory.
13452 * symtab.h (class Symbol_table): Update declarations.
13453
61edd21f
ILT
13454 PR 5990
13455 * descriptors.h (Open_descriptor): Add is_on_stack field.
13456 * descriptors.cc (Descriptors::open): If the descriptor is on the
13457 top of the stack, remove it. Initialize is_on_stack field.
13458 (Descriptors::release): Only add pod to stack if it is not on the
13459 stack already.
13460 (Descriptors::close_some_descriptor): Clear stack_next and
13461 is_on_stack fields.
13462
e29e076a
ILT
13463 PR 7091
13464 * output.cc (Output_section::find_starting_output_address): Rename
13465 from starting_output_address; add PADDR parameter; change return
13466 type.
13467 * output.h (class Output_section): Declare
13468 find_starting_output_address instead of starting_output_address.
13469 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13470 section symbol for which we can't find a merge section.
13471
0602e05a
ILT
13472 PR 9836
13473 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13474 hidden or internal, force the symbol to be local.
13475 * resolve.cc (Symbol::override_visibility): Define.
13476 (Symbol::override_base): Use override_visibility.
13477 (Symbol_table::resolve): Likewise.
13478 (Symbol::override_base_with_special): Likewise.
13479 (Symbol_table::override_with_special): If the visibility is hidden
13480 or internal, force the symbol to be local.
13481 * symtab.h (class Symbol): Add set_visibility and
13482 override_visibility.
13483 * testsuite/ver_test_1.sh: New file.
13484 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13485 (check_DATA): Add ver_test_1.syms.
13486 (ver_test_1.syms): New target.
13487 * testsuite/Makefile.in: Rebuild.
13488
401a9a73
CC
134892009-02-25 Cary Coutant <ccoutant@google.com>
13490
13491 * layout.cc (Layout::choose_output_section): Don't rename sections
13492 when using a linker script that has a SECTIONS clause.
13493 * Makefile.in: Regenerate.
13494
13495 * testsuite/Makefile.am (script_test_5.sh): New test case.
13496 * testsuite/Makefile.in: Regenerate.
13497 * testsuite/script_test_5.cc: New file.
13498 * testsuite/script_test_5.sh: New file.
13499 * testsuite/script_test_5.t: New file.
13500
f488e4b0
CC
135012009-02-13 Rafael Avila de Espindola <espindola@google.com>
13502
13503 * archive.cc (Archive::include_member): Update calls to add_symbols.
13504 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13505 the Layout argument.
13506 * dynobj.h (do_add_symbols): Add the Layout argument.
13507 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13508 Layout argument.
13509 * object.h (Object::add_symbols): Add the Layout argument.
13510 (Object::do_add_symbols): Add the Layout argument.
13511 (Sized_relobj::do_add_symbols): Add the Layout argument.
13512 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13513 Unify the two versions.
13514 (Add_plugin_symbols): Remove.
13515 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13516 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13517 (Add_plugin_symbols): Remove.
13518 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13519 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13520 (Add_symbols::run): Make it work with Pulginobj.
13521
89dd1680
ILT
135222009-02-06 Ian Lance Taylor <iant@google.com>
13523
13524 * object.cc (Sized_relobj::do_layout): Make info message start
13525 with lower case letter.
13526
266d0a74
ILT
135272009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13528
602b464e
ILT
13529 * binary.cc: Fix file comment.
13530
266d0a74
ILT
13531 * options.h (enum Incremental_disposition): Define.
13532 (class General_options): Add new options: --incremental,
13533 --incremental_changed, --incremental_unchanged,
13534 --incremental_unknown. Add incremental_disposition_ and
13535 implicit_incremental_ fields.
13536 (General_options::incremental_disposition): New function.
13537 (class Position_dependent_options): Add incremental_disposition
13538 option.
13539 (Position_dependent_options::copy_from_options): Set incremental
13540 dispositions.
13541 * options.cc (General_options::parse_incremental_changed): New
13542 function.
2e702c99
RM
13543 (General_options::parse_incremental_unchanged): New function.
13544 (General_options::parse_incremental_unknown): New function.
13545 (General_options::General_options): Initialize new fields
266d0a74 13546 incremental_disposition_ and implicit_incremental_.
2e702c99 13547 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13548 without --incremental.
13549
f073bbf7
CD
135502009-02-06 Chris Demetriou <cgd@google.com>
13551
13552 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13553 pointer and to report location as the file name associated with
13554 the symbol.
13555 (gold_undefined_symbol_at_location): New function to replace the
13556 old gold_undefined_symbol functionality.
13557 * target-reloc.h (relocate_section): Update to use
13558 gold_undefined_symbol_at_location.
13559 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13560 Call gold_undefined_symbol function rather than gold_error.
13561 * errors.h (Errors::undefined_symbol): Take location as a
13562 string, rather than calculating it from a relocation.
13563 * errors.cc (Errors::fatal): Print "fatal error:" before the
13564 formatted message.
13565 (Errors::error, Errors::error_at_location): Print "error: "
13566 before the formatted message.
13567 (Errors::undefined_symbol): Take location as a string, rather
13568 than calculating it from a relocation.
13569 (gold_undefined_symbol_at_location): New function akin to
13570 old gold_undefined_symbol, calculates location from relocation.
13571 (gold_undefined_symbol): Change to take only a Symbol pointer
13572 and to report location as the file name associated with the symbol.
13573 * testsuite/debug_msg.sh: Update for changed error messages.
13574 * testsuite/undef_symbol.sh: Likewise.
13575
8e94a90c
ILT
135762009-02-04 Duncan Sands <baldrick@free.fr>
13577
13578 PR 9812
13579 * reduced_debug_output.h
13580 (Output_reduced_debug_abbrev_section::failed): Use format for
13581 gold_warning.
13582 (Output_reduced_debug_info_section::faild): Likewise.
13583
88a0e15b
ILT
135842009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13585
13586 * script.cc (Lazy_demangler): New class.
2e702c99 13587 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13588 symbol only once.
13589
5efc7cd2
CC
135902009-01-29 Cary Coutant <ccoutant@google.com>
13591
13592 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13593 to __tls_get_addr.
13594 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13595
e0ebcf42
ILT
135962009-01-28 Ian Lance Taylor <iant@google.com>
13597
5efc7cd2 13598 * version.cc (version_string): Bump to 1.9.
75fe7426 13599
e0ebcf42
ILT
13600 * gold.h: Include <cstring> and <stdint.h>.
13601 * version.cc: Include <cstdio>.
13602 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13603 warning.
13604 * reduced_debug_output.cc (insert_into_vector): Rename from
13605 Insert_into_vector; change all callers. Use Swap_unaligned to
13606 avoid aliasing issue; remove union since it is unnecessary.
13607
8e2813be 136082009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13609
13610 * Makefile.am (CCFILES): Add gc.cc.
13611 (HFILES): Add gc.h.
13612 * Makefile.in: Regenerate.
13613 * gold.cc (Gc_runner): New class.
13614 (queue_initial_tasks): Call garbage collection related tasks
13615 when corresponding options are invoked.
13616 (queue_middle_gc_tasks): New function.
13617 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13618 processed early before laying out sections during garbage collection.
13619 * gold.h (queue_middle_gc_tasks): New function.
13620 (is_prefix_of): Move from "layout.cc".
13621 * i386.cc (Target_i386::gc_process_relocs): New function.
13622 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13623 * main.cc (main): Create object of class "Garbage_collection".
13624 * object.cc (Relobj::copy_symbols_data): New function.
13625 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13626 (Sized_relobj::do_layout): Allow this function to be called twice
13627 during garbage collection and defer layout of section during the
6d03d481
ST
13628 first call.
13629 * object.h (Relobj::get_symbols_data): New function.
13630 (Relobj::is_section_name_included): New function.
13631 (Relobj::copy_symbols_data): New function.
13632 (Relobj::set_symbols_data): New function.
13633 (Relobj::get_relocs_data): New function.
13634 (Relobj::set_relocs_data): New function.
13635 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13636 (Relobj::gc_process_relocs): New function.
13637 (Relobj::do_gc_process_relocs): New pure virtual function.
13638 (Relobj::sd_): New data member.
13639 (Sized_relobj::is_output_section_offset_invalid): New function.
13640 (Sized_relobj::do_gc_process_relocs): New function.
13641 * options.h (General_options::gc_sections): Modify to not be a no-op.
13642 (General_options::print_gc_sections): New option.
13643 * plugin.cc (Plugin_finish::run): Remove function call to
13644 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13645 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13646 * reloc.cc (Read_relocs::run): Add task to process relocs and
13647 determine unreferenced sections when doing garbage collection.
13648 (Gc_process_relocs): New class.
13649 (Sized_relobj::do_gc_process_relocs): New function.
13650 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13651 sections that are garbage collected.
13652 * reloc.h (Gc_process_relocs): New class.
13653 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13654 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13655 symbols whose corresponding sections are garbage collected.
13656 (Symbol_table::Symbol_table): Add new parameter for the garbage
13657 collection object.
13658 (Symbol_table::gc_mark_undef_symbols): New function.
13659 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13660 (Symbol_table::gc_mark_dyn_syms): New function.
13661 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13662 as garbage.
13663 (Symbol_table::add_from_object): Likewise.
13664 (Symbol_table::add_from_relobj): When building shared objects, do not
13665 treat externally visible symbols as garbage.
13666 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13667 table information for static and relocatable links.
13668 * symtab.h (Symbol_table::set_gc): New function.
13669 (Symbol_table::gc): New function.
13670 (Symbol_table::gc_mark_undef_symbols): New function.
13671 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13672 (Symbol_table::gc_mark_dyn_syms): New function.
13673 (Symbol_table::gc_): New data member.
e1df38aa 13674 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
13675 function.
13676 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13677 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13678
3b293544
CF
136792009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13680
13681 * options.h (General_options::gc_sections): Define as a no-op for now.
13682 (General_options::no_keep_memory): Ditto.
13683 (General_options::Bshareable): Define.
13684 * options.cc (General_options::finalize): Honor -Bshareable.
13685
83d22aa8
AS
136862009-01-20 Andreas Schwab <schwab@suse.de>
13687
13688 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13689 read the value in the contents, since we don't use it. Use the
13690 template endianness when writing.
13691 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13692
cd536b21
AS
136932009-01-19 Andreas Schwab <schwab@suse.de>
13694
13695 * configure.tgt (powerpc64-*): Fix targ_obj.
13696
99e9a495
ILT
136972009-01-15 Ian Lance Taylor <iant@google.com>
13698
13699 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13700 local symbols when stripping all symbols.
13701
bbbfea06
CC
137022009-01-14 Cary Coutant <ccoutant@google.com>
13703
99e9a495 13704 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 13705
0f7c0701
CC
137062009-01-14 Cary Coutant <ccoutant@google.com>
13707
13708 * archive.cc (Archive::get_elf_object_for_member): Remove call
13709 to File_read::claim_for_plugin.
13710 * descriptors.cc (Descriptors::open): Remove reference to
13711 is_claimed.
13712 (Descriptors::claim_for_plugin): Remove.
13713 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13714 (Descriptors::is_claimed): Remove.
13715 (claim_descriptor_for_plugin): Remove.
13716 * fileread.cc (File_read::claim_for_plugin): Remove.
13717 * fileread.h (File_read::claim_for_plugin): Remove.
13718 (File_read::descriptor): Reopen descriptor if necessary.
13719 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13720 (Plugin_manager::all_symbols_read): Add task parameter. Change
13721 all callers.
13722 (Plugin_manager::get_input_file): New function.
13723 (Plugin_manager::release_input_file): New function.
13724 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13725 corresponding data member.
13726 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13727 and pass to base constructor. Change all callers.
13728 (get_input_file, release_input_file): New functions.
13729 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13730 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13731 (Plugin_manager::all_symbols_read): Add task parameter.
13732 (Plugin_manager::get_input_file): New function.
13733 (Plugin_manager::release_input_file): New function.
13734 (Plugin_manager::task_): New data member.
13735 (Pluginobj::Pluginobj): Add filesize parameter.
13736 (Pluginobj::filename): New function.
13737 (Pluginobj::descriptor): New function.
13738 (Pluginobj::filesize): New function.
13739 (Pluginobj::filesize_): New data member.
13740 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13741 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13742 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13743
13744 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13745 with archive libraries.
13746 * testsuite/Makefile.in: Regenerate.
13747 * testsuite/plugin_test.c (struct sym_info): New type.
13748 (get_input_file, release_input_file): New static variables.
13749 (onload): Capture new transfer vector entries.
13750 (claim_file_hook): Stop reading at end of file according to filesize.
13751 Factor out parsing of readelf output into separate function.
13752 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13753 APIs and get the source file name from the symbol table. Convert
13754 source file name to corresponding object file name. Print info
13755 message when adding new input files.
13756 (parse_readelf_line): New function.
13757 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13758 * testsuite/plugin_test_2.sh: Likewise.
13759 * testsuite/plugin_test_3.sh: Likewise.
13760 * testsuite/plugin_test_4.sh: New test case.
13761
62a6d109
ILT
137622009-01-07 Ian Lance Taylor <iant@google.com>
13763
13764 * version.cc (version_string): Bump to 1.8.
13765
483620e8
CC
137662008-12-23 Cary Coutant <ccoutant@google.com>
13767
13768 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13769 * plugin.cc (Plugin_manager::finish): Rename as
13770 layout_deferred_objects. Move cleanup to separate function.
13771 (Plugin_manager::cleanup): New function.
13772 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13773 separately.
13774 * plugin.h (Plugin_manager::finish): Rename as
13775 layout_deferred_objects.
13776 (Plugin_manager::cleanup): New function.
13777 (Plugin_manager::cleanup_done): New field.
13778
d66a9eb3
CC
137792008-12-23 Cary Coutant <ccoutant@google.com>
13780
13781 * plugin.cc (is_visible_from_outside): New function.
13782 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13783 so we don't return "IR only" status for exported symbols or -r links.
13784
13785 * testsuite/Makefile.am (plugin_test_3): New test case.
13786 * testsuite/Makefile.in: Regenerate.
13787 * testsuite/plugin_test_3.sh: New file.
13788
5995b570
CC
137892008-12-22 Cary Coutant <ccoutant@google.com>
13790
13791 * object.cc (Sized_relobj::layout_section): New function.
13792 (Sized_relobj::do_layout): Defer layout of input sections until after
13793 plugin has provided replacement files.
13794 (Sized_relobj::do_layout_deferred_sections): New function.
13795 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13796 (Relobj::layout_deferred_sections): New function.
13797 (Relobj::do_layout_deferred_sections): New function.
13798 (Sized_relobj::do_layout_deferred_sections): New function.
13799 (Sized_relobj::layout_section): New function.
13800 (Sized_relobj::Deferred_layout): New structure.
13801 (Sized_relobj::deferred_layout_): New field.
13802 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13803 Change all callers. Layout deferred sections.
13804 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13805 references.
13806 (Plugin_hook::run): Move code from do_plugin_hook inline.
13807 (Plugin_hook::do_plugin_hook): Remove.
13808 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13809 (Plugin_manager::finish): Renamed, was cleanup.
13810 (Plugin_manager::should_defer_layout): New function.
13811 (Plugin_manager::add_deferred_layout_object): New function.
13812 (Plugin_manager::Deferred_layout_list): New type.
13813 (Plugin_manager::deferred_layout_objects_): New field.
13814 (Plugin_hook::do_plugin_hook): Remove.
13815
ee769c88
ILT
138162008-12-17 Ian Lance Taylor <iant@google.com>
13817
13818 * options.h (class General_options): Add --no case for
13819 --export-dynamic.
13820
abc8dcba
CC
138212008-12-16 Cary Coutant <ccoutant@google.com>
13822
13823 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
13824 vector.
13825 (Plugin_manager::claim_file): Create plugin object even if
13826 plugin did not call the add_symbols callback.
13827 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
13828 asking for more symbols than were added.
13829 * testsuite/Makefile.am (plugin_test_1): Add test case with
13830 no global symbols.
13831 (empty.syms): New target.
13832 * testsuite/Makefile.in: Regenerate.
13833 * testsuite/plugin_test.c (claim_file_hook): Add new debug
13834 message. Don't call add_symbols if no globals.
13835 (all_symbols_read_hook): Don't provide replacement for empty
13836 claimed file.
13837
b0074644
ILT
138382008-12-12 Ian Lance Taylor <iant@google.com>
13839
68943102
ILT
13840 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
13841 r_type == 0 for a local symbol with r_sym == 0.
13842 (scan_relocatable_relocs): Pass r_sym to
13843 local_non_section_strategy.
13844 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
13845 r_sym parameter.
13846
b0074644
ILT
13847 * configure.ac: Update test for TLS descriptors: they are
13848 supported as of glibc 2.9.
13849 * configure: Rebuild.
13850
c2508178
ILT
138512008-12-11 Ian Lance Taylor <iant@google.com>
13852
13853 PR 7091
13854 * target-reloc.h (Default_scan_relocatable_relocs): For each
13855 function, map r_type == 0 to RELOC_DISCARD.
13856
2756a258
CC
138572008-12-10 Cary Coutant <ccoutant@google.com>
13858
13859 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
13860 object to override a kept COMDAT group from a plugin object.
13861
bb6f53d3
ILT
138622008-12-09 Ian Lance Taylor <iant@google.com>
13863
fbc558e1
ILT
13864 PR 7088
13865 * yyscript.y (file_cmd): Handle INPUT.
13866
bb6f53d3
ILT
13867 * testsuite/initpri1.c: Change all declarations to be full
13868 prototypes by adding void, to avoid compiler warnings.
13869
4674ecfc
CC
138702008-12-05 Rafael Avila de Espindola <espindola@google.com>
13871
13872 * options.cc (General_options::parse_plugin_opt): New.
13873 (General_options::add_plugin): The argument now is just the filename.
13874 (General_options::add_plugin_option): New.
13875 * options.h (plugin_opt): New.
13876 (add_plugin): Change argument name.
13877 (add_plugin_option): New.
13878 * plugin.cc (Plugin::load): Don't parse the plugin option.
13879 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
13880 (Plugin::add_option): New.
13881 (Plugin::args_): Change type.
13882 (Plugin::filename_): New.
13883 (Plugin_manager::add_plugin_option): New.
13884 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
13885 * testsuite/Makefile.in: Regenerate.
13886
fd06b4aa
CC
138872008-12-05 Cary Coutant <ccoutant@google.com>
13888
13889 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
13890 Handle --strip-lto-sections option.
13891 * options.h (strip_lto_sections): New option.
13892
6c52134c
CC
138932008-12-01 Cary Coutant <ccoutant@google.com>
13894
13895 * plugin.cc (ld_plugin_message): Change format parameter to const.
13896 Fix mismatch between new[] and delete.
13897
a45248e0
CC
138982008-11-14 Cary Coutant <ccoutant@google.com>
13899
13900 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
13901 instead of -1U.
13902
c82fbeee
CS
139032008-11-05 Craig Silverstein <csilvers@google.com>
13904
13905 * options.cc (General_options::parse_dynamic_list): New function.
13906 * options.h (General_options): New flags dynamic_list,
13907 dynamic_list_data, dynamic_list_cpp_new, and
13908 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
13909 (General_options::in_dynamic_list): New function.
13910 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
13911 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
13912 (Lex::can_continue_name): Likewise.
13913 (yylex): Likewise.
13914 (read_script_file): New parameter script_options.
13915 (read_dynamic_list): New function.
13916 (Script_options::define_dynamic_list): New function.
13917 (dynamic_list_keyword_parsecodes): New variable.
13918 (dynamic_list_keywords): New variable.
13919 * script.h (Script_options::define_dynamic_list): New function
13920 prototype.
13921 (read_dynamic_list): New function prototype.
13922 * symtab.cc (strprefix): New macro.
13923 (Symbol::should_add_dynsym_entry): Support dynamic_list,
13924 dynamic_list_data, dynamic_list_cpp_new, and
13925 dynamic_list_cpp_typeinfo.
13926 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
13927 (dynamic_list_expr): New rule.
13928 (dynamic_list_nodes): Likewise.
13929 (dynamic_list_node): Likewise.
13930 * testsuite/Makefile.am (dynamic_list): New test.
13931 * testsuite/Makefile.in: Regenerated.
13932 * testsuite/dynamic_list.t: New file.
13933 * testsuite/dynamic_list.sh: New file.
13934
e0bb29a5
CS
139352008-11-05 Craig Silverstein <csilvers@google.com>
13936
13937 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
13938 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
13939 (t11_last): Likewise.
13940 * testsuite/ver_test_6.c (main): Likewise.
13941
4e1e25e0
CC
139422008-10-07 Cary Coutant <ccoutant@google.com>
13943
13944 * options.c (General_options::finalize): Add check for -static and
13945 -shared.
13946 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
13947 is not empty.
13948
92f03fcb
CC
139492008-10-02 Cary Coutant <ccoutant@google.com>
13950
13951 * plugin.cc (make_sized_plugin_object): Fix conditional
13952 compilation to work when not all targets are enabled.
13953
fbd8a257
CC
139542008-09-29 Cary Coutant <ccoutant@google.com>
13955
13956 * archive.cc (Archive::get_file_and_offset): Use filename instead
13957 of name to get library path.
13958 (Archive::include_member): Unlock external member of a thin archive.
13959
13960 * testsuite/Makefile.am (TEST_AR): New variable.
13961 (thin_archive_test_1): New test.
13962 (thin_archive_test_2): New test.
81636b3f
CC
13963 * testsuite/Makefile.in: Regenerate.
13964 * testsuite/thin_archive_main.cc: New file.
13965 * testsuite/thin_archive_test_1.cc: New file.
13966 * testsuite/thin_archive_test_2.cc: New file.
13967 * testsuite/thin_archive_test_3.cc: New file.
13968 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 13969
eff45813
CC
139702008-09-29 Cary Coutant <ccoutant@google.com>
13971
13972 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
13973 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
13974 instead of -1U.
13975 (Sized_relobj::do_finalize_local_symbols): Likewise.
13976 (Sized_relobj::map_to_kept_section): Likewise.
13977 * object.h (Sized_relobj::invalid_address): New constant.
13978 (Sized_relobj::do_output_section_offset): Check for invalid_address
13979 and return -1ULL.
13980 * output.cc (Output_reloc::local_section_offset): Use constant
13981 invalid_address instead of -1U.
13982 (Output_reloc::get_address): Likewise.
13983 (Output_section::output_address): Change -1U to -1ULL.
13984 * output.h (Output_reloc::invalid_address): New constant.
13985 * reloc.cc (Sized_relobj::write_sections): Use constant
13986 invalid_address instead of -1U.
13987 (Sized_relobj::relocate_sections): Likewise.
13988 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
13989 values for merge sections.
13990 * target-reloc.h (relocate_for_relocatable): Use constant
13991 invalid_address instead of -1U.
13992
89fc3421
CC
139932008-09-19 Cary Coutant <ccoutant@google.com>
13994
13995 Add plugin functionality for link-time optimization (LTO).
13996 * configure.ac (plugins): Add --enable-plugins option.
13997 * configure: Regenerate.
13998 * config.in: Regenerate.
13999 * Makefile.am (LIBDL): New variable.
14000 (CCFILES): Add plugin.cc.
14001 (HFILES): Add plugin.h.
14002 (ldadd_var): Add LIBDL.
14003 * Makefile.in: Regenerate.
14004
14005 * archive.cc: Include "plugin.h".
14006 (Archive::setup): Don't preread archive symbols when using a plugin.
14007 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14008 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14009 files.
14010 (Archive::include_member): Add symbols from plugin objects.
14011 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14012 * descriptors.cc (Descriptors::open): Check for file descriptors
14013 abandoned by plugins.
14014 (Descriptors::claim_for_plugin): New function.
14015 * descriptors.h (Descriptors::claim_for_plugin): New function.
14016 (Open_descriptor::is_claimed): New field.
14017 (claim_descriptor_for_plugin): New function.
14018 * fileread.cc (File_read::claim_for_plugin): New function.
14019 * fileread.h (File_read::claim_for_plugin): New function.
14020 (File_read::descriptor): New function.
14021 * gold.cc: Include "plugin.h".
14022 (queue_initial_tasks): Add task to call plugin hooks for generating
14023 new object files.
14024 * main.cc: Include "plugin.h".
14025 (main): Load plugin libraries.
14026 * object.h (Pluginobj): Declare.
14027 (Object::pluginobj): New function.
14028 (Object::do_pluginobj): New function.
14029 (Object::set_target): New function.
14030 * options.cc: Include "plugin.h".
14031 (General_options::parse_plugin): New function.
14032 (General_options::General_options): Initialize plugins_ field.
14033 (General_options::add_plugin): New function.
14034 * options.h (Plugin_manager): Declare.
14035 (General_options): Add --plugin option.
14036 (General_options::has_plugins): New function.
14037 (General_options::plugins): New function.
14038 (General_options::add_plugin): New function.
14039 (General_options::plugins_): New field.
14040 * plugin.cc: New file.
14041 * plugin.h: New file.
14042 * readsyms.cc: Include "plugin.h".
14043 (Read_symbols::do_read_symbols): Check for archive before checking
14044 for ELF file. Call plugin hooks to claim files.
14045 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14046 from a real object file; force override when processing replacement
14047 files.
14048 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14049 (Symbol::init_base_object): Likewise.
14050 (Symbol::init_base_output_data): Likewise.
14051 (Symbol::init_base_output_segment): Likewise.
14052 (Symbol::init_base_constant): Likewise.
14053 (Symbol::init_base_undefined): Likewise.
14054 (Symbol::output_section): Assert that object is not a plugin.
14055 (Symbol_table::add_from_pluginobj): New function.
14056 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14057 undefined.
14058 (Symbol_table::sized_write_globals): Likewise.
14059 (Symbol_table::add_from_pluginobj): Instantiate template.
14060 * symtab.h (Sized_pluginobj): Declare.
14061 (Symbol::in_real_elf): New function.
14062 (Symbol::set_in_real_elf): New function.
14063 (Symbol::in_real_elf_): New field.
14064 (Symbol_table::add_from_pluginobj): New function.
14065
14066 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14067 (LIBDL): New variable.
14068 (LDADD): Add LIBDL.
14069 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14070 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14071 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14072 (MOSTLYCLEANFILES): Likewise.
14073 * testsuite/Makefile.in: Regenerate.
14074 * testsuite/plugin_test.c: New file.
14075 * testsuite/plugin_test_1.sh: New file.
14076 * testsuite/plugin_test_2.sh: New file.
14077
de31bda5
ILT
140782008-09-16 Ian Lance Taylor <iant@google.com>
14079
9c2d0ef9
ILT
14080 * target-reloc.h (relocate_section): Check whether a symbol is
14081 defined by the ABI before reporting an undefined symbol error.
14082 * target.h (Target::is_defined_by_abi): Make parameter const.
14083 (Target::do_is_defined_by_abi): Likewise.
14084 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14085 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14086 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14087 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14088 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14089 * testsuite/Makefile.in: Rebuild.
14090
de31bda5
ILT
14091 * fileread.cc (make_view): Add casts to avoid warning.
14092
9fa33bee
AO
140932008-09-16 Alexandre Oliva <aoliva@redhat.com>
14094
14095 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14096 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14097
183fd0e3
AO
140982008-09-16 Alexandre Oliva <aoliva@redhat.com>
14099
14100 * options.h (General_options::output_is_executable): New.
14101 (General_options::output_is_pie): New.
14102 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14103 for shared libraries.
14104 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14105
7be8330a
CD
141062008-09-11 Chris Demetriou <cgd@google.com>
14107
14108 * options.h (origin): New -z option.
14109 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14110 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14111 in DT_FLAGS_1.
14112
a9caad02
CC
141132008-09-05 Cary Coutant <ccoutant@google.com>
14114
14115 * fileread.cc (File_read::make_view): Add check for attempt to map
14116 beyond end of file.
14117
ae6dce4d
CC
141182008-09-05 Cary Coutant <ccoutant@google.com>
14119
14120 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14121 explicit instantiations.
14122
d7ab2a47
KVH
141232008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14124
14125 PR gold/6858
14126 * options.cc (General_options::finalize): Allow undefined symbols
14127 in shlibs if linking -shared.
14128
14129 PR gold/6859
14130 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14131 symbols as not needing a dynsym entry.
14132
1e52a9c1
CS
141332008-08-20 Craig Silverstein <csilvers@google.com>
14134
14135 * fileread.cc (File_read::open): Do not lock the file unless it
14136 was successfully opened.
14137
d85c80a3
CC
141382008-08-14 Cary Coutant <ccoutant@google.com>
14139
14140 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14141 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14142 * testsuite/tls_test.cc (struct int128): 128-bit struct
14143 for testing TLS relocs with non-zero addend.
14144 (v12): New TLS variable.
14145 (t12): New test.
14146 (t_last): Add check for v12.
14147 * testsuite/tls_test.h (t12): New function.
14148 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14149
2d924fd9
ILT
141502008-08-13 Ian Lance Taylor <iant@google.com>
14151
14152 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14153 set tls_segment_ or relro_segment_.
14154 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14155 when appropriate.
14156 * output.h (Output_section::clear_is_relro): New function.
14157 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14158 sections specially even when output_data_ is empty.
14159 (Output_segment::maximum_alignment): When first section is relro,
14160 only force alignment for PT_LOAD segments.
14161 * script.cc (script_data_segment_align): New function.
14162 (script_data_segment_relro_end): New function.
14163 * script-c.h (script_data_segment_align): Declare.
14164 (script_data_segment_relro_end): Declare.
14165 * script-sections.h (class Script_sections): Declare
14166 data_segment_align and data_segment_relro_end. Add fields
14167 segment_align_index_ and saw_relro_end_.
14168 * script-sections.cc (class Sections_element): Add set_is_relro
14169 virtual function. Add new bool* parameter to place_orphan_here.
14170 Add get_output_section virtual function.
14171 (class Output_section_definition): Add set_is_relro. Add new
14172 bool* parameter to place_orphan_here. Add get_output_section.
14173 Add is_relro_ field.
14174 (Output_section_definition::Output_section_definition): Initialize
14175 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14176 and is_relro_ fields.
14177 (Output_section_definition::place_orphan_here): Add is_relro
14178 parameter.
14179 (Output_section_definition::set_section_addresses): Set relro for
14180 output section.
14181 (Output_section_definition::alternate_constraint): Likewise.
14182 (class Orphan_output_section): Add new bool* parameter to
14183 place_orphan_here. Add get_output_section.
14184 (Orphan_output_section::place_orphan_here): Add is_relro
14185 parameter.
14186 (Script_sections::Script_sections): Initialize
14187 data_segment_align_index_ and saw_relro_end_.
14188 (Script_sections::data_segment_align): New function.
14189 (Script_sections::data_segment_relro_end): New function.
14190 (Script_sections::place_orphan): Set or clear is_relro.
14191 (Script_sections::set_section_addresses): Force alignment of first
14192 TLS section.
14193 * yyscript.y (exp): Call script_data_segment_align and
14194 script_data_segment_relro_end.
14195 * testsuite/relro_script_test.t: New file.
14196 * testsuite/relro_test.cc (using_script): Declare.
14197 (t1, t2): Test using_script.
14198 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14199 (relro_script_test_SOURCES): Define.
14200 (relro_script_test_DEPENDENCIES): Define.
14201 (relro_script_test_LDFLAGS): Define.
14202 (relro_script_test_LDADD): Define.
14203 (relro_script_test.so): New target.
14204 * testsuite/Makefile.in: Rebuild.
14205
f827c9a9
CC
142062008-08-06 Cary Coutant <ccoutant@google.com>
14207
14208 * archive.cc (Archive::total_archives, Archive::total_members)
14209 (Archive::total_members_loaded): New variables.
14210 (Archive::setup): Add parameter. Add option to preread
14211 archive symbols.
14212 (Archive::read_armap): Add counter.
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::add_symbols): Add counters.
14218 (Archive::include_all_members): Use armap to find members if it's
14219 already built.
14220 (Archive::include_member): Skip reading symbols if already read.
14221 Factored code into Archive::get_file_and_offset and
14222 Archive::get_elf_object_for_member. Changed call to
14223 Mapfile::report_include_archive_member.
14224 (Archive::print_stats): New function.
14225 * archive.h: Declare Object and Read_symbols_data classes.
14226 (Archive::Archive): Add initializers for new members.
14227 (Archive::setup): Add parameter.
14228 (Archive::print_stats): New function.
14229 (Archive::total_archives, Archive::total_members)
14230 (Archive::total_members_loaded): New variables.
14231 (Archive::get_file_and_offset): New function.
14232 (Archive::get_elf_object_for_member): New function.
14233 (Archive::read_all_symbols): New function.
14234 (Archive::read_symbols): New function.
14235 (Archive::Archive_member): New class.
14236 (Archive::members_): New member.
14237 (Archive::num_members_): New member.
14238 * main.cc: Include archive.h.
14239 (main): Call Archive::print_stats.
14240 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14241 archive parameter; member_name is now the fully-decorated name.
14242 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14243 * options.h: (General_options): Add --preread-archive-symbols option.
14244 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14245 Archive::setup.
14246
de4c45bd
ILT
142472008-08-04 Ian Lance Taylor <iant@google.com>
14248
14249 * symtab.h (Symbol::use_plt_offset): New function.
14250 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14251 * powerpc.cc (Relocate::relocate): Likewise.
14252 * sparc.cc (Relocate::relocate): Likewise.
14253 * x86_64.cc (Relocate::relocate): Likewise.
14254 * testsuite/weak_plt.sh: New test.
14255 * testsuite/weak_plt_main.cc: New test.
14256 * testsuite/weak_plt_shared.cc: New test.
14257 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14258 (check_PROGRAMS): Add weak_plt.
14259 (check_DATA): Add weak_plt_shared.so.
14260 (weak_plt_main_pic.o, weak_plt): New targets.
14261 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14262 * testsuite/Makefile.in: Rebuild.
14263
14264 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14265 gcctestdir/ld.
14266 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14267 * testsuite/Makefile.in: Rebuild.
14268
323ee3f4
AM
142692008-08-04 Alan Modra <amodra@bigpond.net.au>
14270
14271 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14272 * Makefile.in: Regenerate.
14273 * po/POTFILES.in: Regenerate.
14274
7c07ecec
ILT
142752008-07-29 Ian Lance Taylor <iant@google.com>
14276
14277 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14278 symbols before other symbols.
14279 * testsuite/script_test_2.cc (test_addr): Declare.
14280 (test_addr_alias): Declare.
14281 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14282 values.
7c07ecec
ILT
14283 * testsuite/script_test_2.t: Define test_addr_alias and
14284 test_addr.
14285
5778530e
ILT
142862008-07-24 Ian Lance Taylor <iant@google.com>
14287
2a00e4fb
ILT
14288 PR 5990
14289 * descriptors.cc: New file.
14290 * descriptors.h: New file.
14291 * gold-threads.h (class Hold_optional_lock): New class.
14292 * fileread.cc: Include "descriptors.h".
14293 (File_read::~File_read): Release descriptor rather than closing
14294 it.
14295 (File_read::open) [file]: Call open_descriptor rather than open.
14296 Set is_descriptor_opened_.
14297 (File_read::open) [memory]: Assert that descriptor is not open.
14298 (File_read::reopen_descriptor): New function.
14299 (File_read::release): Release descriptor.
14300 (File_read::do_read): Make non-const. Reopen descriptor.
14301 (File_read::read): Make non-const.
14302 (File_read::make_view): Reopen descriptor.
14303 (File_read::do_readv): Likewise.
14304 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14305 Update declarations.
14306 * layout.cc: Include "descriptors.h".
14307 (Layout::create_build_id): Use open_descriptor rather than open.
14308 * output.cc: Include "descriptors.h".
14309 (Output_file::open): Use open_descriptor rather than open.
14310 * archive.cc (Archive::const_iterator): Change Archive to be
14311 non-const.
14312 (Archive::begin, Archive::end): Make non-const.
14313 (Archive::count_members): Likewise.
14314 * archive.h (class Archive): Update declarations.
14315 * object.h (Object::read): Make non-const.
14316 * Makefile.am (CCFILES): Add descriptors.cc.
14317 (HFILES): Add descriptors.h.
14318 * Makefile.in: Rebuild.
14319
801647d1
ILT
14320 PR 6716
14321 * gold.h: Always include <clocale>. Add Solaris workarounds
14322 following code in binutils/sysdep.h.
14323
5edd166e
ILT
14324 PR 6048
14325 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14326 this->eh_frame_hdr_ is NULL before using it.
14327
c89ad728
ILT
14328 * dynobj.cc (Versions::Versions): Update comment.
14329
aa86f06b
ILT
14330 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14331 the base version name.
14332
5778530e
ILT
14333 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14334 array size plus one.
14335 (Stringpool_template::set_string_offsets): Subtract one from key
14336 before using it as an array index.
14337 (Stringpool_template::get_offset_with_length): Likewise.
14338 (Stringpool_template::write_to_buffer): Likewise.
14339 * stringpool.h (Stringpool_template::get_offset_from_key):
14340 Likewise.
14341
057ead22
ILT
143422008-07-23 Ian Lance Taylor <iant@google.com>
14343
7f649c59
ILT
14344 PR 6658
14345 * object.h (Merged_symbol_value::value): Do our best to handle a
14346 negative addend.
14347
057ead22
ILT
14348 PR 6647
14349 * script.cc (Version_script_info::get_versions): Don't add empty
14350 version tag to return value.
14351 (Version_script_info::get_symbol_version_helper): Change return
14352 type to bool. Add pversion parameter. Change all callers.
14353 (script_register_vers_node): Don't require a non-NULL tag.
14354 * script.h (class Version_script_info): Update declarations.
14355 (Version_script_info::get_symbol_version): Change return type to
14356 bool. Add version parameter. Change all callers.
14357 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14358 handling. Handle an empty version from a version script.
14359 (Symbol_table::define_special_symbol): Likewise.
14360 * testsuite/ver_test_10.script: New file.
14361 * testsuite/ver_test_10.sh: New file.
14362 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14363 (check_DATA): Add ver_test_10.syms.
14364 (ver_test_10.syms, ver_test_10.so): New target.
14365 * testsuite/Makefile.in: Rebuild.
14366
58e54ac2
CD
143672008-07-23 Simon Baldwin <simonb@google.com>
14368
14369 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14370 to zero for undefined symbols from dynamic libraries.
14371
95d14cd3
ILT
143722008-07-23 Ian Lance Taylor <iant@google.com>
14373
14374 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14375 Change all callers.
14376 * symtab.h (class Symbol_table): Update declaration.
14377 * testsuite/ver_test_9.cc: New file.
14378 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14379 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14380 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14381 (ver_test_9.so, ver_test_9.o): New targets.
14382 * testsuite/Makefile.in: Rebuild.
14383
92de84a6
ILT
143842008-07-22 Ian Lance Taylor <iant@google.com>
14385
34810851
ILT
14386 * options.h (class General_options): Define --check-sections.
14387 * layout.cc (Layout::set_segment_offsets): Handle
14388 --check-sections.
14389
af6156ef
ILT
14390 * options.h (class General_options): Define -n/--nmagic and
14391 -N/--omagic.
14392 * options.cc (General_options::finalize): For -n/--nmagic or
14393 -N/--omagic, set -static.
14394 * layout.cc (Layout::attach_allocated_section_to_segment): If
14395 -N/--omagic, don't put read-only and read-write sections in
14396 different segments.
14397 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14398 finding a read-only segment.
14399 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14400 don't set the minimum segment alignment to the common page size,
14401 and don't set the file offset to the address modulo the page size.
14402 * script-sections.cc (Script_sections::create_segments): If
14403 -n/--omagic, don't put read-only and read-write sections in
14404 different segments.
14405
92de84a6
ILT
14406 * cref.cc: New file.
14407 * cref.h: New file.
14408 * options.h (class General_options): Add --print-symbol-counts.
14409 * main.cc (main): Issue defined symbol report if requested.
14410 * archive.cc (Archive::interpret_header): Make into a const member
14411 function.
14412 (Archive::add_symbols): Call Input_objects::archive_start and
14413 archive_stop.
14414 (Archive::const_iterator): Define new class.
14415 (Archive::begin, Archive::end): New functions.
14416 (Archive::include_all_members): Rewrite to use iterator.
14417 (Archive::count_members): New function.
14418 * archive.h (class Archive): Update declarations.
14419 (Archive::filename): New function.
14420 * object.cc: Include "cref.h".
14421 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14422 (Sized_relobj::do_get_global_symbol_counts): New function.
14423 (Input_objects::add_object): Add object to cross-referencer.
14424 (Input_objects::archive_start): New function.
14425 (Input_objects::archive_stop): New function.
14426 (Input_objects::print_symbol_counts): New function.
14427 * object.h: Declare Cref and Archive.
14428 (Object::get_global_symbol_counts): New function.
14429 (Object::do_get_global_symbol_counts): New pure virtual function.
14430 (class Sized_relobj): Add defined_count_ field. Update
14431 declarations.
14432 (class Input_objects): Add cref_ field. Update constructor.
14433 Update declarations.
14434 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14435 defined_count_.
14436 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14437 symbol counts.
14438 (Sized_dynobj::do_get_global_symbol_counts): New function.
14439 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14440 defined_count_. Update declarations. Define Symbols typedef.
14441 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14442 parameter. Change all callers.
14443 (Symbol_table::add_from_dynobj): Add sympointers and defined
14444 parameters. Change all callers.
14445 * symtab.h (class Symbol_table): Update declarations.
14446 * Makefile.am (CCFILES): Add cref.cc.
14447 (HFILES): Add cref.h.
14448 * Makefile.in: Rebuild.
14449
3f7c5e1d
CD
144502008-07-22 Simon Baldwin <simonb@google.com>
14451
14452 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14453 to zero when writing undefined symbols.
14454
e0b64032
ILT
144552008-07-22 Ian Lance Taylor <iant@google.com>
14456
14457 * output.cc (Output_section::add_input_section): Don't try to
14458 merge empty merge sections.
14459
096b02cf
CS
144602008-07-21 Craig Silverstein <csilvers@google.com>
14461
14462 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14463 Include symbol version in error message.
cd536b21 14464
1d1f116d
CD
144652008-07-20 Chris Demetriou <cgd@google.com>
14466
cd536b21 14467 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14468 (RANDOM_SEED_CFLAGS): New substituted variable.
14469 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14470 * configure: Rebuild.
14471 * Makefile.in: Likewise.
14472 * testsuite/Makefile.in: Likewise.
14473
a18f591e
ILT
144742008-07-18 Ian Lance Taylor <iant@google.com>
14475
14476 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14477 where we see NAME/NULL and NAME/VERSION as separate symbols.
14478 * testsuite/ver_test_main.cc (main): Call t4.
14479 (t4, t4_2a): Define.
14480 * testsuite/ver_test_2.cc (t4_2): Define.
14481 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14482 * testsuite/ver_test_4.cc (t4_2a): Define.
14483 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14484 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14485
c6e3f6ed
ILT
144862008-07-17 Ian Lance Taylor <iant@google.com>
14487
14488 * dynobj.cc (Versions::add_def): If we give an error about a
14489 missing version, go ahead and create the version anyhow.
14490
ef9beddf
ILT
144912008-07-10 Ian Lance Taylor <iant@google.com>
14492
14493 Handle output sections with more than 0x7fffffff bytes.
14494 * object.h (class Relobj): Change map_to_output_ to
14495 output_sections_, and just keep a section pointer. Change all
14496 uses. Move comdat group support to Sized_relobj.
14497 (Relobj::is_section_specially_mapped): Remove.
14498 (Relobj::output_section): Remove poff parameter. Change all
14499 callers.
14500 (Relobj::output_section_offset): New function.
14501 (Relobj::set_section_offset): Rewrite.
14502 (Relobj::map_to_output): Remove.
14503 (Relobj::output_sections): New function.
14504 (Relobj::do_output_section_offset): New pure virtual function.
14505 (Relobj::do_set_section_offset): Likewise.
14506 (class Sized_relobj): Add section_offsets_ field. Add comdat
14507 group support from Relobj. Update declarations.
14508 (Sized_relobj::get_output_section_offset): New function.
14509 (Sized_relobj::do_output_section_offset): New function.
14510 (Sized_relobj::do_set_section_offset): New function.
14511 * object.cc (Relobj::output_section_address): Remove.
14512 (Sized_relobj::Sized_relobj): Initialize new fields.
14513 (Sized_relobj::include_section_group): Cast find_kept_object to
14514 Sized_relobj.
14515 (Sized_relobj::include_linkonce_section): Likewise.
14516 (Sized_relobj::do_layout): Use separate arrays for output section
14517 and output offset.
14518 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14519 output_sections.
14520 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14521 output_sections and section_offsets.
14522 (Sized_relobj::write_local_symbols): Likewise.
14523 (map_to_kept_section): Compute output address directly.
14524 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14525 output_sections and section_offsets.
14526 (Sized_relobj::write_sections): Likewise.
14527 (Sized_relobj::relocate_sections): Likewise.
14528 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14529 * output.h (class Output_reloc): Update declarations. Change
14530 u2_.relobj to Sized_relobj*.
14531 (class Output_data_reloc): Change add functions to use
14532 Sized_relobj*.
14533 * output.cc (Output_reloc::Output_reloc): Change relobj to
14534 Sized_relobj*.
14535 (Output_reloc::local_section_offset): Change return type to
14536 Elf_Addr. Use get_output_section_offset.
14537 (Output_reloc::get_address): Likewise.
14538 (Output_section::is_input_address_mapped): Don't call
14539 is_section_specially_mapped.
14540 (Output_section::output_offset): Likewise.
14541 (Output_section::output_address): Likewise.
14542 (Output_section::starting_output_address): Likewise.
14543 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14544 parameter to Sized_relobj*.
14545 (Copy_relocs::need_copy_reloc): Likewise.
14546 (Copy_relocs::save): Likewise.
14547 * copy-relocs.h (class Copy_relocs): Update declarations.
14548 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14549 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14550 * target-reloc.h (relocate_for_relocatable): Change
14551 offset_in_output_section type to Elf_Addr. Change code that uses
14552 it as well.
14553 * layout.cc (Layout::layout): Always set *off.
14554 * mapfile.cc (Mapfile::print_input_section): Use
14555 output_section_offset.
14556 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14557 Sized_relobj*.
14558 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14559 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14560 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14561
5cb66f97
ILT
145622008-07-03 Ian Lance Taylor <iant@google.com>
14563
14564 * layout.cc (Layout::include_section): Do not discard unrecognized
14565 SHT_STRTAB sections.
14566
afe47622
CS
145672008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14568
14569 * script.cc (Lex::can_continue_name): Make '?' allowable in
14570 version-script names.
14571 * testsuite/version_script.map: Change glob pattern to use '?'
14572
5adf9721
ILT
145732008-06-30 Manish Singh <yosh@gimp.org>
14574
14575 PR 6585
14576 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14577 Correct typo.
14578
e6fde208
ILT
145792008-06-30 Ian Lance Taylor <iant@google.com>
14580
14581 PR 6660
14582 PR 6682
14583 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14584 versions]: Don't try to read the value in the contents, since we
14585 don't use it. Use the template endianness when writing.
14586
3f2e6a2d
CC
145872008-06-25 Cary Coutant <ccoutant@google.com>
14588
14589 * fileread.cc (File_read::make_view): Assert on zero-length view.
14590 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14591 symbol table when there are no symbols to read.
14592
c43d3a48
CS
145932008-06-23 Craig Silverstein <csilvers@google.com>
14594
14595 * version.cc (version_string): Bump to 1.7
14596
5f494ea0
CS
145972008-06-18 Craig Silverstein <csilvers@google.com>
14598
14599 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14600 constant 0xFFFF to type Valtype.
14601 (Powerpc_relocate_functions::rel16_ha): Likewise.
14602
c42e122e
ILT
146032008-06-17 Ian Lance Taylor <iant@google.com>
14604
f34787f8
ILT
14605 * output.h (Output_section::Input_section): Initialize p2align_ to
14606 zero for Output_section_data constructors.
14607 (Output_section::Input_section::addralign): If not an input
14608 section, return the alignment of the Output_section_data.
14609 * testsuite/copy_test.cc: New file.
14610 * testsuite/copy_test_1.cc: New file.
14611 * testsuite/copy_test_2.cc: New file.
14612 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14613 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14614 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14615 (copy_test_1_pic.o, copy_test_1.so): New targets.
14616 (copy_test_2_pic.o, copy_test_2.so): New targets.
14617 * testsuite/Makefile.in: Rebuild.
14618
c42e122e
ILT
14619 * script-sections.cc (Script_sections::place_orphan): Initialize
14620 local variable exact.
14621
ce3ac18a
DE
146222008-06-13 David Edelsohn <edelsohn@gnu.org>
14623
14624 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14625
42cacb20
DE
146262008-06-12 David Edelsohn <edelsohn@gnu.org>
14627 David S. Miller <davem@davemloft.net>
14628
14629 * powerpc.cc: New file.
14630 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14631 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14632 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14633 * Makefile.in: Rebuild.
14634
7b308235
ILT
146352008-06-09 Ian Lance Taylor <iant@google.com>
14636
14637 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14638 <exception>.
14639 (throwing, orig_terminate): New static variables.
14640 (terminate_handler): New static function.
14641 (t2): Set terminate handler.
14642
f0b886e3
ILT
146432008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14644
14645 PR 6584
cd536b21 14646 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14647 alignment.
14648
3e90f135
CC
146492008-05-30 Cary Coutant <ccoutant@google.com>
14650
14651 * archive.cc (Archive::include_all_members) Correct to step
14652 over symbol table and extended name table in thin archives.
14653
e09ad04a
ILT
146542008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14655
14656 PR 6407
14657 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14658 calculation.
14659
62b01cb5
ILT
146602008-05-28 Caleb Howe <cshowe@google.com>
14661
14662 * reduced_debug_output.cc: New file.
14663 * reduced_debug_output.h: New file.
92de84a6 14664 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
14665 * options.cc (General_options::finalize): Add strip_debug_non_line
14666 to the strip heirarchy.
14667 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14668 fields.
14669 * layout.cc: Include "reduced_debug_output.h".
14670 (Layout::Layout): Initialize new fields.
14671 (line_only_debug_sections): New static array.
14672 (is_lines_only_debug_sections): New static inline function.
14673 (Layout::include_section): Handle --strip-debug-non-line.
14674 (Layout::make_output_section): If --strip-debug-non-line, build
14675 new output sections for .debug_abbrev and .debug_info.
14676 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14677 gold. Warn about possible overflow.
14678 (read_signed_LEB_128): Likewise.
14679 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14680 (read_signed_LEB_128): Declare.
14681 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14682 (HFILES): Add reduced_debug_output.h.
14683 * Makefile.in: Rebuild.
14684
7d9e3d98
ILT
146852008-05-21 Ian Lance Taylor <iant@google.com>
14686
14687 * mapfile.cc: New file.
14688 * mapfile.h: New file.
14689 * options.h (class General_options): Add -M/--print-map and -Map.
14690 * options.cc (General_options::finalize): Make -M equivalent to
14691 -Map -.
14692 * main.cc: Include <cstdio> and "mapfile.h".
14693 (main): Open mapfile if requested.
14694 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14695 constructor. Change caller.
14696 (queue_initial_tasks): Add mapfile parameter. Change caller.
14697 (queue_middle_tasks): Likewise.
14698 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14699 declarations.
14700 * archive.cc: Include "mapfile.h".
14701 (Archive::add_symbols): Add mapfile parameter. Change all
14702 callers. Pass mapfile, symbol, and reason to include_member.
14703 (Archive::include_all_members): Add mapfile parameter. Change all
14704 callers.
14705 (Archive::include_member): Add mapfile, sym, and why parameters.
14706 Change all callers. Report inclusion to map file.
14707 * archive.h: Include "fileread.h".
14708 (class Archive): Update declarations.
14709 (Archive::file): New const method.
14710 (class Add_archive_symbols): Add mapfile_ field. Update
14711 constructor. Change all callers.
14712 * readsyms.h (class Read_symbols): Likewise.
14713 (class Finish_group): Likewise.
14714 (class Read_script): Likewise.
14715 * common.cc: Include "mapfile.h".
14716 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14717 all callers.
14718 (Symbol_table::do_allocate_commons): Likewise.
14719 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14720 symbol allocation to mapfile.
14721 * common.h (class Allocate_commons_task): Add mapfile_ field.
14722 Update constructor. Change all callers.
14723 * symtab.h (class Symbol_table): Update declarations.
14724 * layout.cc: Include "mapfile.h".
14725 (Layout_task_runner::run): Print information to mapfile.
14726 (Layout::create_gold_note): Change Output_data_fixed_space to
14727 Output_data_zero_fill.
14728 (Layout::create_build_id): Likewise.
14729 (Layout::print_to_mapfile): New function.
14730 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14731 constructor. Change caller.
14732 (class Layout): Declare print_to_mapfile.
14733 * output.cc (Output_section::Input_section::print_to_mapfile): New
14734 function.
14735 (Output_section::add_input_section): If producing a map, always
14736 add to input_sections_ list.
14737 (Output_section::do_print_to_mapfile): New function.
14738 (Output_segment::print_sections_to_mapfile): New function.
14739 (Output_segment::print_section_list_to_mapfile): New function.
14740 * output.h: Include "mapfile.h".
14741 (Output_data::print_to_mapfile): New function.
14742 (Output_data::do_print_to_mapfile): New virtual function.
14743 (Output_segment_headers::do_print_to_mapfile): New function.
14744 (Output_file_header::do_print_to_mapfile): New function.
14745 (Output_data_const::do_print_to_mapfile): New function.
14746 (class Output_data_const_buffer): Add map_name_ field. Update
14747 constructor. Change all callers. Add do_print_to_mapfile
14748 function.
14749 (class Output_data_fixed_space): Likewise.
14750 (class Output_data_space): Likewise.
14751 (class Output_data_zero_fill): New class.
14752 (Output_data_strtab::do_print_to_mapfile): New function.
14753 (Output_data_reloc_base::do_print_to_mapfile): New function.
14754 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14755 (Output_data_group::do_print_to_mapfile): New function.
14756 (Output_data_got::do_print_to_mapfile): New function.
14757 (Output_data_dynamic::do_print_to_mapfile): New function.
14758 (Output_symtab_xindex::do_print_to_mapfile): New function.
14759 (class Output_section): Declare do_print_to_mapflie. Declare
14760 print_to_mapfile in Input_section.
14761 (class Output_segment): Declare new functions.
14762 * object.h (Sized_relobj::symbol_count): New function.
14763 * script-sections.cc
14764 (Output_section_element_dot_assignment::set_section_addresses):
14765 Change Output_data_fixed_space to Output_data_zero_fill.
14766 (Output_data_expression::do_print_to_mapfile): New function.
14767 * script.cc (read_input_script): Add mapfile parameter. Change
14768 all callers.
14769 * script.h (read_input_script): Update declaration.
14770 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14771 (Eh_frame::do_print_to_mapfile): New function.
14772 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14773 (Output_merge_string::do_print_to_mapfile): New function.
14774 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14775 function.
14776 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14777 function.
14778 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14779 function.
14780 * Makefile.am (CCFILES): Add mapfile.cc.
14781 (HFILES): Add mapfile.h.
14782 * Makefile.in: Rebuild.
14783
9f1d377b
ILT
147842008-05-19 Ian Lance Taylor <iant@google.com>
14785
14786 * options.h (class General_options): Add -z relro.
14787 * layout.cc (Layout::Layout): Initialize relro_segment_.
14788 (Layout::add_output_section_data): Return the output section.
14789 (Layout::make_output_section): Rcognize relro sections and mark
14790 them appropriately.
14791 (Layout::attach_allocated_section_to_segment): Put relro sections
14792 in a PT_GNU_RELRO segment.
14793 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14794 section as relro.
14795 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14796 PT_TLS segments.
14797 (Layout::linkonce_mapping): Map d.rel.ro.local to
14798 .data.rel.ro.local.
14799 (Layout::output_section_name): Us .data.rel.ro.local for any
14800 section which begins with that.
14801 * layout.h (class Layout): Update add_output_section_data
14802 declaration. Add relro_segment_ field.
14803 * output.cc (Output_section::Output_section): Initialize is_relro_
14804 and is_relro_local_ fields.
14805 (Output_segment::add_output_section): Group relro sections.
14806 (Output_segment::is_first_section_relro): New function.
14807 (Output_segment::maximum_alignment): If there is a relro section,
14808 align the segment to the common page size.
14809 (Output_segment::set_section_addresses): Track whether we are
14810 looking at relro sections. If the last section is a relro
14811 section, align to the common page size.
14812 (Output_segment::set_section_list_addresses): Add in_relro
14813 parameter. Change all callers. Align to the page size when
14814 moving from relro to non-relro section.
14815 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14816 segment.
14817 * output.h (class Output_section): Add is_relro_ and
14818 is_relro_local_ fields.
14819 (Output_section::is_relro): New function.
14820 (Output_section::set_is_relro): New function.
14821 (Output_section::is_relro_local): New function.
14822 (Output_section::set_is_relro_local): New function.
14823 (class Output_segment): Update declarations.
14824 * i386.cc (Target_i386::got_section): Mark .got section as relro.
14825 * sparc.cc (Target_sparc::got_section): Likewise.
14826 * x86_64.cc (Target_x86_64::got_section): Likewise.
14827 * testsuite/relro_test_main.cc: New file.
14828 * testsuite/relro_test.cc: New file.
14829 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
14830 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
14831 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
14832 (relro_test.so, relro_test_pic.o): New targets.
14833 * testsuite/Makefile.in: Rebuild.
14834
a984ee1d
ILT
148352008-05-16 Ian Lance Taylor <iant@google.com>
14836
01676dcd
ILT
14837 * output.cc (Output_segment::add_output_section): Remove front
14838 parameter.
14839 * output.h (class Output_segment): Remove
14840 add_initial_output_section and overloaded add_output_section.
14841 Update declaration of remaining add_output_section.
14842 * layout.cc (Layout::create_interp): Call add_output_section
14843 rather than add_initial_output_section.
14844 (Layout::finish_dynamic_section): Likewise.
14845
497897f9
ILT
14846 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
14847 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
14848 know the dynamic type.
14849 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
14850 field. Initialize it in constructor.
14851 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
14852 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
14853 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
14854 reloc.
14855
a984ee1d
ILT
14856 * output.cc (Output_reloc::get_address): Change return type to
14857 Elf_Addr.
14858 * output.h (class Output_reloc): Update get_address declaration.
14859 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
14860 for section addresses.
14861
55ba0940
ILT
148622008-05-09 Ian Lance Taylor <iant@google.com>
14863
14864 PR 6493
14865 * gold.cc (gold_nomem): Use return value of write.
14866
75517b77
ILT
148672008-05-08 Ian Lance Taylor <iant@google.com>
14868
14869 * symtab.c (Symbol::init_base_output_data): Add version
14870 parameter. Change all callers.
14871 (Symbol::init_base_output_segment): Likewise.
14872 (Symbol::init_base_constant): Likewise.
14873 (Symbol::init_base_undefined): Likewise.
14874 (Sized_symbol::init_output_data): Likewise.
14875 (Sized_symbol::init_output_segment): Likewise.
14876 (Sized_symbol::init_constant): Likewise.
14877 (Sized_symbol::init_undefined): Likewise.
14878 (Symbol_table::do_define_in_output_data): If the new symbol has a
14879 version, mark it as the default.
14880 (Symbol_table::do_define_in_output_segment): Likewise.
14881 (Symbol_table::do_define_as_constant): Likewise.
14882 * symtab.h (class Symbol): Update declarations.
14883 (class Sized_symbol): Likewise.
14884 * resolve.cc (Symbol::override_version): New function.
c42e122e 14885 (Symbol::override_base): Call override_version.
75517b77
ILT
14886 (Symbol::override_base_with_special): Likewise.
14887 * testsuite/ver_script_8.script: New file.
14888 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
14889 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
14890 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
14891 (ver_test_8_1.so, ver_test_8_2.so): New targets.
14892
f1f70eae
ILT
148932008-05-06 Ian Lance Taylor <iant@google.com>
14894
f3e9c5c5
ILT
14895 PR 6049
14896 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
14897 functions.
14898 (class General_options): Remove existing --undefined, and add
14899 --no-undefined instead. Add new --undefined as synonym for -u.
14900 * archive.cc (Archive::add_symbols): Check whether symbol was
14901 named with -u.
14902 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
14903 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
14904 all uses. Add IS_UNDEFINED. Update declarations to split
14905 different versions of init_base. Declare init_base_undefined.
14906 (Symbol::is_defined): Handle IS_UNDEFINED.
14907 (Symbol::is_undefined): Likewise.
14908 (Symbol::is_weak_undefined): Call is_undefined.
14909 (Symbol::is_absolute): Handle IS_CONSTANT.
14910 (class Sized_symbol): Update declarations to split different
14911 versions of init. Declare init_undefined.
14912 (class Symbol_table): Declare new functions.
14913 * symtab.cc (Symbol::init_base_object): Rename from init_base.
14914 Change all callers.
14915 (Symbol::init_base_output_data): Likewise.
14916 (Symbol::init_base_output_segment): Likewise.
14917 (Symbol::init_base_constant): Likewise.
14918 (Symbol::init_base_undefined): New function.
14919 (Sized_symbol::init_object): Rename from init. Change all
14920 callers.
14921 (Sized_symbol::init_output_data): Likewise.
14922 (Sized_symbol::init_output_segment): Likewise.
14923 (Sized_symbol::init_constant): Likewise.
14924 (Sized_symbol::init_undefined): New function.
14925 (Symbol_table::add_undefined_symbols_from_command_line): New
14926 function.
14927 (Symbol_table::do_add_undefined_symbols_from_command_line): New
14928 function.
14929 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
14930 (Symbol::output_section): Likewise.
14931 (Symbol::set_output_section): Likewise.
14932 (Symbol_table::sized_finalize_symbol): Likewise.
14933 (Symbol_table::sized_write_globals): Likewise.
14934 * resolve.cc (Symbol_table::should_override): Likewise.
14935 (Symbol::override_base_with_special): Likewise.
14936
8bdcdf2c
ILT
14937 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
14938 symbol, change it to have default visibility.
14939 * testsuite/protected_1.cc: New file.
14940 * testsuite/protected_2.cc: New file.
14941 * testsuite/protected_3.cc: New file.
14942 * testsuite/protected_main_1.cc: New file.
14943 * testsuite/protected_main_2.cc: New file.
14944 * testsuite/protected_main_3.cc: New file.
14945 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
14946 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
14947 (protected_1_LDFLAGS, protected_1_LDADD): Define.
14948 (protected_1.so): New target.
14949 (protected_1_pic.o, protected_2_pic.o): New targets.
14950 (protected_3_pic.o): New target.
14951 (check_PROGRAMS): Add protected_2.
14952 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
14953 (protected_2_LDFLAGS, protected_2_LDADD): Define.
14954 * testsuite/Makefile.in: Rebuild.
14955
2b706932
ILT
14956 * options.h (DEFINE_var): Add set_user_set_##varname__.
14957 (DEFINE_bool_alias): New macro.
14958 (class General_options): Define -Bstatic using DEFINE_bool_alias
14959 rather than DEFINE_special. Add --undefined as an alias for -z
14960 defs.
14961 * options.cc (General_options::parse_Bstatic): Remove.
14962
d82a5bcc
ILT
14963 * options.h (class General_options): Add --fatal-warnings.
14964 * main.cc (main): Implement --fatal-warnings.
14965 * errors.h (Errors::warning_count): New function.
14966
f1f70eae
ILT
14967 * options.h (class General_options): Add -Bsymbolic-functions.
14968 * symtab.h (Symbol::is_preemptible): Check for
14969 -Bsymbolic-functions.
14970
8825ac63
ILT
149712008-05-05 Ian Lance Taylor <iant@google.com>
14972
d98bc257
ILT
14973 * options.h (DEFINE_bool): For DASH_Z, create the negative option
14974 as noVARNAME rather than no-VARNAME.
14975 (class General_options): Add option -z combreloc.
14976 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
14977 get_address.
14978 (Output_reloc::sort_before) [SHT_REL]: New function.
14979 (Output_reloc::sort_before) [SHT_RELA]: New function.
14980 (class Output_data_reloc_base): Add sort_relocs_ field. Define
14981 Sort_relocs_comparison.
14982 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
14983 parameter. Change all callers.
14984 (Output_data_reloc::Output_data_reloc) [both versions]: Add
14985 sort_relocs parameter. Change all callers.
14986 * output.cc (Output_reloc::get_address): New function, broken out
14987 of write_rel.
14988 (Output_reloc::write_rel): Call it.
14989 (Output_reloc::compare): New function.
14990 (Output_data_reloc_base::do_write): Optionally sort relocs.
14991
60b2b4e7
ILT
14992 * configure.ac: If targ_extra_obj is set, link it in.
14993 * configure.tgt: Initialize all variables.
14994 (x86_64*): Set targ_extra_obj and targ_extra_size.
14995 * configure: Rebuild.
14996
8825ac63
ILT
14997 * object.cc (Sized_relobj::include_section_group): Adjust section
14998 indexes read from group data. Build vector to pass to
14999 layout_group.
15000 * layout.cc (Layout::layout_group): Add flags and shndxes
15001 parameters. Remove contents parameter. Change caller. Update
15002 explicit instantiations.
15003 * layout.h (class Layout): Update layout_group declaration.
15004 * output.cc (Output_data_group::Output_data_group): Add flags and
15005 input_shndxes parameters. Remove contents parameter. Change
15006 caller.
15007 (Output_data_group::do_write): Change input_sections_ to
15008 input_shndxes_.
15009 * output.h (class Output_data_group): Update constructor
15010 declaration. Rename input_sections_ to input_shndxes_.
15011 * testsuite/many_sections_test.cc: Add template.
15012
e94cf127
CC
150132008-04-30 Cary Coutant <ccoutant@google.com>
15014
4418b2d5
CC
15015 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15016
e94cf127
CC
15017 * layout.cc (Layout::include_section): Refactored check for debug
15018 info section.
15019 (Layout::add_comdat): Add new parameters. Change type
15020 of signature parameter. Add object and shndx to signatures table.
15021 (Layout::find_kept_object): New function.
15022 * layout.h: Include <cstring>.
15023 (Layout::is_debug_info_section): New function.
15024 (Layout::add_comdat): Add new parameters.
15025 (Layout::find_kept_object): New function.
15026 (Layout::Kept_section): New struct.
15027 (Layout::Signatures): Change type of map range.
15028 * object.cc (Relobj::output_section_address): New function.
15029 (Sized_relobj::include_section_group): Add new parameters. Change
15030 calls to Layout::add_comdat. Change to build table of kept comdat
15031 groups and table mapping discarded sections to kept sections.
15032 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15033 (Sized_relobj::do_layout): Change calls to include_section_group and
15034 include_linkonce_section.
15035 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15036 value to zero when section is discarded.
15037 (Sized_relobj::map_to_kept_section): New function.
15038 * object.h (Relobj::output_section_address): New function.
15039 (Relobj::Comdat_group): New type.
15040 (Relobj::find_comdat_group): New function.
15041 (Relobj::Comdat_group_table): New type.
15042 (Relobj::Kept_comdat_section): New type.
15043 (Relobj::Kept_comdat_section_table): New type.
15044 (Relobj::add_comdat_group): New function.
15045 (Relobj::set_kept_comdat_section): New function.
15046 (Relobj::get_kept_comdat_section): New function.
15047 (Relobj::comdat_groups_): New field.
15048 (Relobj::kept_comdat_sections_): New field.
15049 (Symbol_value::input_value): Update comment.
15050 (Sized_relobj::map_to_kept_section) New function.
15051 (Sized_relobj::include_linkonce_section): Add new parameter.
15052 * target-reloc.h (Comdat_behavior): New type.
15053 (get_comdat_behavior): New function.
15054 (relocate_section): Add code to map a discarded section to the
15055 corresponding kept section when applying a relocation.
15056
e4e5049b
CS
150572008-04-30 Craig Silverstein <csilvers@google.com>
15058
15059 * dwarf_reader.cc (next_generation_count): New static var.
15060 (Addr2line_cache_entry): New struct.
15061 (addr2line_cache): New static var.
15062 (Dwarf_line_info::one_addr2line): Added caching.
15063 (Dwarf_line_info::clear_addr2line_cache): New function.
15064 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15065 cache-size parameter.
15066 (Dwarf_line_info::one_addr2line_cache): New function.
15067 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15068 new cache-size argument to one_addr2line(), and clear cache.
15069
d09e9154
CC
150702008-04-28 Cary Coutant <ccoutant@google.com>
15071
15072 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15073 R_386_PC8 relocations.
15074
7ef73768
ILT
150752008-04-23 Ian Lance Taylor <iant@google.com>
15076
55438702
ILT
15077 * object.cc (Sized_relobj::include_section_group): Check for
15078 invalid section group.
15079
c165fb93
ILT
15080 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15081 header size.
15082
7ef73768
ILT
15083 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15084 than read for file header.
15085 * archive.cc (Archive::include_member): Likewise.
15086
6194aaab
L
150872008-04-23 Paolo Bonzini <bonzini@gnu.org>
15088
15089 * aclocal.m4: Regenerate.
15090 * configure: Regenerate.
15091
d491d34e
ILT
150922008-04-19 Ian Lance Taylor <iant@google.com>
15093
5ea2bac6
ILT
15094 * version.cc (version_string): Bump to 1.6.
15095
7bc3e21a
ILT
15096 * testsuite/Makefile.am (many_sections_r_test): New target.
15097 (many_sections_r_test_SOURCES): Remove.
15098 (many_sections_r_test_DEPENDENCIES): Remove.
15099 (many_sections_r_test_LDFLAGS): Remove.
15100 (many_sections_r_test_LDADD): Remove.
15101
7fcd3aa9
ILT
15102 * object.cc (Sized_relobj::do_add_symbols): Always pass
15103 local_symbol_count_ to add_from_relobj.
15104
4c94d6ae
ILT
15105 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15106 every thousand variables.
15107 * testsuite/Makefile.in: Rebuild.
15108
d491d34e
ILT
15109 * object.cc (Xindex::initialize_symtab_xindex): New function.
15110 (Xindex::read_symtab_xindex): New function.
15111 (Xindex::sym_xindex_to_shndx): New function.
15112 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15113 available.
15114 (Sized_relobj::do_initialize_xindex): New function.
15115 (Sized_relobj::do_read_symbols): Adjust section links.
15116 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15117 parameter. Change all callers.
15118 (Sized_relobj::include_section_group): Adjust section links and
15119 symbol section indexes.
15120 (Sized_relobj::do_layout): Adjust section links.
15121 (Sized_relobj::do_count_local_symbols): Adjust section links and
15122 symbol section indexes.
15123 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15124 ordinary and special symbols.
15125 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15126 dynsym_xindex parameters. Change all callers. Adjust section
15127 links. Use SHN_XINDEX when needed.
15128 (Sized_relobj::get_symbol_location_info): Adjust section links.
15129 Don't get fooled by special symbols.
15130 * object.h (class Xindex): Define.
15131 (class Object): Add xindex_ parameter. Declare virtual functoin
15132 do_initialize_xindex.
15133 (Object::adjust_sym_shndx): New function.
15134 (Object::set_xindex): New protected function.
15135 (class Symbol_value): Add is_ordinary_shndx_ field.
15136 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15137 (Symbol_value::value): Assert ordinary section.
15138 (Symbol_value::initialize_input_to_output_map): Likewise.
15139 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15140 Change all callers.
15141 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15142 all callers.
15143 (class Sized_relobj): Update declarations.
15144 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15145 parameter. Change all callers.
15146 (Sized_relobj::adjust_shndx): New function.
15147 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15148 field.
15149 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15150 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15151 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15152 (Sized_dynobj::read_dynsym_section): Adjust section links.
15153 (Sized_dynobj::read_dynamic): Likewise.
15154 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15155 section links.
15156 (Sized_dynobj::do_initialize_xindex): New function.
15157 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15158 do_initialize_xindex.
15159 (Sized_dynobj::adjust_shndx): New function.
15160 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15161 dynsym_xindex_ fields.
15162 (Layout::finalize): Add a call to set_section_indexes before
15163 creating the symtab sections.
15164 (Layout::set_section_indexes): Don't do anything if the section
15165 already has a section index.
15166 (Layout::create_symtab_sections): Add shnum parameter. Change
15167 caller. Create .symtab_shndx section if needed.
15168 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15169 caller.
15170 (Layout::allocated_output_section_count): New function.
15171 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15172 needed.
15173 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15174 fields. Update declarations.
15175 (Layout::symtab_xindex): New function.
15176 (Layout::dynsym_xindex): New function.
15177 (class Write_symbols_task): Add layout_ field.
15178 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15179 Change caller.
15180 * output.cc (Output_section_headers::Output_section_headers): Add
15181 shstrtab_section parameter. Change all callers.
15182 (Output_section_headers::do_sized_write): Store overflow values
15183 for section count and section string table section index in
15184 section header zero.
15185 (Output_file_header::do_sized_write): Check for overflow of
15186 section count and section string table section index.
15187 (Output_symtab_xindex::do_write): New function.
15188 (Output_symtab_xindex::endian_do_write): New function.
15189 * output.h (class Output_section_headers): Add shstrtab_section_.
15190 Update declarations.
15191 (class Output_symtab_xindex): Define.
15192 (Output_section::has_out_shndx): New function.
15193 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15194 field.
15195 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15196 Change all callers.
15197 (Sized_symbol::init): Likewise.
15198 (Symbol::output_section): Check for ordinary symbol.
15199 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15200 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15201 callers.
15202 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15203 Change all callers. Simplify handling of symbols from sections
15204 not included in the link.
15205 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15206 distinction.
15207 (Weak_alias_sorter::operator()): Assert that symbols are
15208 ordinary.
15209 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15210 distinction.
15211 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15212 parameters. Change all callers.
15213 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15214 symbol distinction. Use SHN_XINDEX when needed.
15215 (Symbol_table::write_section_symbol): Add symtab_xindex
15216 parameter. Change all callers.
15217 (Symbol_table::sized_write_section_symbol): Likewise. Use
15218 SHN_XINDEX when needed.
15219 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15220 declarations.
15221 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15222 (Symbol::is_defined): Check is_ordinary.
15223 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15224 (Symbol::is_absolute, Symbol::is_common): Likewise.
15225 (class Sized_symbol): Update declarations.
15226 (class Symbol_table): Update declarations.
15227 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15228 parameters. Change all callers.
15229 (Sized_symbol::override): Likewise.
15230 (Symbol_table::override): Likewise.
15231 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15232 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15233 is_ordinary, and orig_st_shndx parameters. Change all callers.
15234 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15235 to be in an ordinary section.
15236 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15237 object and is_ordinary parameters. Change all callers.
15238 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15239 Change all callers. Don't add undefined or non-ordinary symbols
15240 to reloc_map_.
15241 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15242 Change all callers.
15243 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15244 declarations.
15245 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15246 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15247 (Sized_relobj::relocate_sections): Likewise.
15248 * target-reloc.h (scan_relocs): Adjust section symbol index.
15249 (scan_relocatable_relocs): Likewise.
15250 * i386.cc (Scan::local): Check for ordinary symbols.
15251 * sparc.cc (Scan::local): Likewise.
15252 * x86_64.cc (Scan::local): Likewise.
15253 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15254 to symbol_section_and_value.
15255 * testsuite/many_sections_test.cc: New file.
15256 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15257 (check_PROGRAMS): Add many_sections_test.
15258 (many_sections_test_SOURCES): Define.
15259 (many_sections_test_DEPENDENCIES): Define.
15260 (many_sections_test_LDFLAGS): Define.
15261 (BUILT_SOURCES): Add many_sections_define.h.
15262 (many_sections_define.h): New target.
15263 (BUILT_SOURCES): Add many_sections_check.h.
15264 (many_sections_check.h): New target.
15265 (check_PROGRAMS): Add many_sections_r_test.
15266 (many_sections_r_test_SOURCES): Define.
15267 (many_sections_r_test_DEPENDENCIES): Define.
15268 (many_sections_r_test_LDFLAGS): Define.
15269 (many_sections_r_test_LDADD): Define.
15270 (many_sections_r_test.o): New target.
15271 * testsuite/Makefile.in: Rebuild.
15272
c5818ff1
CC
152732008-04-17 Cary Coutant <ccoutant@google.com>
15274
15275 * errors.cc (Errors::info): New function.
15276 (gold_info): New function.
15277 * errors.h (Errors::info): New function.
15278 * gold.h (gold_info): New function.
15279 * object.cc (Input_objects::add_object): Print trace output.
15280 * options.cc (options::parse_set): New function.
15281 (General_options::parse_wrap): Deleted.
15282 (General_options::General_options): Deleted initializer.
15283 * options.h (options::String_set): New typedef.
15284 (options::parse_set): New function.
15285 (DEFINE_set): New macro.
15286 (General_options::wrap): Changed to use DEFINE_set. Changed
15287 callers of any_wrap_symbols and is_wrap_symbol.
15288 (General_options::trace, General_options::trace_symbol):
15289 New options.
15290 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15291 (General_options::wrap_symbols_): Deleted.
15292 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15293
b5be4a7c
DM
152942008-04-17 David S. Miller <davem@davemloft.net>
15295
15296 * options.cc (General_options::parse_V): New function.
15297 * options.h: Add entries for -V and -Qy.
15298
155a0dd7
ILT
152992008-04-17 Ian Lance Taylor <iant@google.com>
15300
15301 * common.cc (Symbol_table::allocate_commons): Remove options
15302 parameter. Change caller.
15303 (Symbol_table::do_allocate_commons): Remove options parameter.
15304 Change caller. Just call do_allocate_commons_list twice.
15305 (Symbol_table::do_allocate_commons_list): New function, broken out
15306 of do_allocate_commons.
15307 * common.h (class Allocate_commons_task): Remove options_ field.
15308 Update constructor.
15309 * symtab.cc (Symbol_table::Symbol_table): Initialize
15310 tls_commons_.
15311 (Symbol_table::add_from_object): Put TLS common symbols on
15312 tls_commons_ list.
15313 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15314 which are IN_OUTPUT_DATA.
15315 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15316 allocate_commons and do_allocate_commons declarations. Declare
15317 do_allocate_commons_list.
15318 * gold.cc (queue_middle_tasks): Update creation of
15319 Allocate_commons_task to not pass options.
15320 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15321 (TLS_TEST_C_FLAGS): New variable.
15322 (tls_test_c_pic.o): New target.
15323 (tls_test_shared.so): Link in tls_test_c_pic.o.
15324 (tls_test_c_pic_ie.o): New target.
15325 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15326 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15327 (tls_test_c.o): New target.
15328 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15329 (tls_pic_test_LDADD): Likewise.
15330 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15331 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15332 (tls_test_c_gnu2.o): New target.
15333 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15334 tls_test_c_gnu2.o.
15335 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15336 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15337 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15338 * testsuite/tls_test.cc: Include "config.h".
15339 (t_last): Call t11_last.
15340 * testsuite/tls_test.h (t11, t11_last): Declare.
15341 * testsuite/tls_test_c.c: New file.
15342 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15343 * configure.ac: Check for OpenMP support.
15344 * configure, config.in, Makefile.in: Rebuild.
15345 * testsuite/Makefile.in: Rebuild.
15346
edfbb029
CC
153472008-04-16 Cary Coutant <ccoutant@google.com>
15348
15349 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15350 (Target_i386::tls_base_symbol_defined_): New field.
15351 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15352 (Target_i386::Scan::global): Likewise.
15353 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15354 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15355 (Target_x86_64::tls_base_symbol_defined_): New field.
15356 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15357 (Target_x86_64::Scan::global): Likewise.
15358
f3c69fca
CC
153592008-04-16 Cary Coutant <ccoutant@google.com>
15360
15361 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15362 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15363 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15364 building shared libraries.
15365 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15366 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15367 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15368 * testsuite/Makefile.in: Rebuild.
15369 * testsuite/weak_undef.h: New file.
15370 * testsuite/weak_undef_file1.cc: Add extra test cases.
15371 * testsuite/weak_undef_file2.cc: Likewise.
15372 * testsuite/weak_undef_test.cc: Likewise.
15373
7c414435
DM
153742008-04-16 David S. Miller <davem@davemloft.net>
15375
32b769e1
DM
15376 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15377 Add issued_non_pic_error_ field. Declare check_non_pic.
15378 (Target_sparc::Scan::check_non_pic): New function.
15379 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15380 (Target_sparc::Scan::global): Likewise.
15381
11936fb1
DM
15382 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15383 * configure: Rebuild.
15384
7c414435
DM
15385 * options.h (DEFINE_enable): New macro.
15386 (new_dtags): New enable option.
15387 (initfirst, interpose, loadfltr, nodefaultlib,
15388 nodelete, nodlopen, nodump): New -z options.
15389 * layout.cc (Layout:finish_dynamic_section): If new
15390 dtags enabled, emit DT_RUNPATH. Also, emit a
15391 DT_FLAGS_1 containing any specified -z flags.
15392
85c7bf8b
ILT
153932008-04-16 Ian Lance Taylor <iant@google.com>
15394
12c0daef
ILT
15395 * copy-relocs.cc: New file.
15396 * copy-relocs.h: New file.
15397 * reloc.cc: Remove Copy_relocs code.
15398 * reloc.h: Likewise.
15399 * reloc-types.h (struct Reloc_types) [both versions]: Add
15400 get_reloc_addend_noerror.
15401 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15402 variants of add_global which take an addend which must be zero.
15403 * i386.cc: Include "copy-relocs.h".
15404 (class Target_i386): Change type of copy_relocs_ to variable,
15405 update initializer.
15406 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15407 Change all callers.
15408 (Target_i386::do_finalize_sections): Change handling of
15409 copy_relocs_.
15410 * sparc.cc: Include "copy-relocs.h".
15411 (class Target_sparc): Change type of copy_relocs_ to variable,
15412 update initializer.
15413 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15414 Change all callers.
15415 (Target_sparc::do_finalize_sections): Change handling of
15416 copy_relocs_.
15417 * x86_64.cc: Include "copy-relocs.h".
15418 (class Target_x86_64): Change type of copy_relocs_ to variable,
15419 update initializer.
15420 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15421 class. Change all callers.
15422 (Target_x86_64::do_finalize_sections): Change handling of
15423 copy_relocs_.
15424 * Makefile.am (CCFILES): Add copy-relocs.cc.
15425 (HFILES): Add copy-relocs.h.
15426
4f4995b6
ILT
15427 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15428
85c7bf8b
ILT
15429 * testsuite/script_test_4.sh: Permit leading zeroes.
15430
4f2a9edd
ILT
154312008-04-15 Ian Lance Taylor <iant@google.com>
15432
e6188289
ILT
15433 * script-sections.cc (Script_sections::create_segments): Use
15434 header_size_adjustment even when there is enough room for the
15435 headers.
15436 * testsuite/script_test_4.sh: New file.
15437 * testsuite/script_test_4.t: New file.
15438 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15439 (check_DATA): Add script_test_4.stdout.
15440 (MOSTLYCLEANFILES): Likewise.
15441 (script_test_4): New target.
15442 (script_test_4.stdout): New target.
15443 * testsuite/Makefile.in: Rebuild.
15444
4f2a9edd
ILT
15445 * sparc.cc: Add definitions for Output_data_plt_sparc class
15446 constants.
15447
f5314dd5
DM
154482008-04-14 David S. Miller <davem@davemloft.net>
15449
15450 * sparc.cc: New file.
15451 * Makefile.am (TARGETSOURCES): Add sparc.cc
15452 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15453 * configure.tgt: Document targ_extra_size and
15454 targ_extra_big_endian. Add entries for sparc-* and
15455 sparc64-*.
15456 * configure.ac: Handle targ_extra_size and
15457 targ_extra_big_endian.
15458 * Makefile.in: Rebuild.
15459 * configure: Likewise.
15460 * po/POTFILES.in: Likewise.
15461 * po/gold.pot: Likewise.
15462
154e0e9a
ILT
154632008-04-14 Ian Lance Taylor <iant@google.com>
15464
15465 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15466 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15467 in the name/type/flags to section mapping. Don't call
15468 allocate_output_section.
15469 (Layout::choose_output_section): Change parameter from adjust_name
15470 to is_input_section. Don't permit input sections after sections
15471 are attached to segments. Don't call allocate_output_section.
15472 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15473 not write_enable_output_section.
15474 (Layout::make_output_section): Don't push to
15475 unattached_section_list_ nor call attach_to_segment. Call
15476 attach_section_to_segment if sections are attached.
15477 (Layout::attach_sections_to_segments): New function.
15478 (Layout::attach_section_to_segment): New function.
15479 (Layout::attach_allocated_section_to_segment): Rename from
15480 attach_to_segment. Remove flags parameter.
15481 (Layout::allocate_output_section): Remove function.
15482 (Layout::write_enable_output_section): Remove function.
15483 * layout.h (class Layout): Update for above changes. Add new
15484 field sections_are_attached_.
15485 * output.h (Output_section::update_flags_for_input_section): New
15486 function.
15487 * output.cc (Output_section::add_input_section): Call
15488 update_flags_for_input_section.
15489 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15490
009a67a2
CC
154912008-04-11 Cary Coutant <ccoutant@google.com>
15492
15493 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15494 thought unnecessary.
15495 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15496
759b1a24
ILT
154972008-04-11 Ian Lance Taylor <iant@google.com>
15498
15499 * output.h (class Output_section_data): Remove inline definition
15500 of set_addralign.
15501 * output.cc (Output_section_data::set_addralign): New function.
15502
c2b45e22
CC
155032008-04-11 Cary Coutant <ccoutant@google.com>
15504
15505 Add support for TLS descriptors for i386 and x86_64.
15506 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15507 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15508 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15509 GOT_TYPE_TLS_DESC.
15510 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15511 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15512 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15513 relocations.
15514 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15515 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15516 Fix problem with initial-exec relocations.
15517 (Target_i386::Relocate::relocate_tls): Likewise.
15518 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15519 relaxation.
15520 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15521 support for section-plus-offset dynamic table entries.
15522 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15523 (Output_data_dynamic::Dynamic_entry): Add support for
15524 section-plus-offset dynamic table entries.
15525 (Output_data_dynamic::Classification): Likewise.
15526 (Output_data_dynamic::classification_): Renamed offset_.
15527 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15528 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15529 (Target_x86_64::make_plt_section): New function.
15530 (Target_x86_64::reserve_tlsdesc_entries): New function.
15531 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15532 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15533 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15534 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15535 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15536 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15537 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15538 add extra PLT entry for TLS descriptors.
15539 (Output_data_plt_x86_64::got_): New field.
15540 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15541 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15542 fields.
15543 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15544 descriptors.
15545 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15546 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15547 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15548 R_386_TLS_DESC_CALL relocations.
15549 (Target_x86_64::Scan::global): Likewise.
15550 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15551 for TLS descriptors.
15552 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15553 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15554 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15555 GD-to-IE relaxation.
15556 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15557 and TLS_DESCRIPTORS.
15558 * Makefile.in: Rebuild.
15559 * configure: Rebuild.
15560 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15561 (tls_test_shared2.so): New target.
15562 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15563 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15564 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15565 (tls_shared_gd_to_ie_test_LDADD): New variable.
15566 (tls_shared_gnu2_gd_to_ie_test): New target.
15567 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15568 New targets.
15569 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15570 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15571 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15572 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15573 (tls_shared_gnu2_test): New target.
15574 (tls_test_gnu2_shared.so): New target.
15575 (tls_shared_gnu2_test_SOURCES): New variable.
15576 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15577 (tls_shared_gnu2_test_LDFLAGS): New variable.
15578 (tls_shared_gnu2_test_LDADD): New variable.
15579 * testsuite/Makefile.in: Rebuild.
15580 * testsuite/Makefile.
15581
83bfb6b7
ILT
155822008-04-11 Ian Lance Taylor <iant@google.com>
15583
15584 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15585 justsyms.t.
15586 * testsuite/Makefile.in: Rebuild.
15587
15588 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15589 long.
15590 * testsuite/script_test_2.cc (main): Adjust test.
15591
706e1f5e
ILT
155922008-04-11 David S. Miller <davem@davemloft.net>
15593 Ian Lance Taylor <iant@google.com>
15594
15595 * options.h (General_options): Add entries for '-Y' and
15596 '-relax'.
15597 * options.cc (General_options:finalize): If -Y was used, add those
15598 entries to the library path instead of the default "/lib" and
15599 "/usr/lib".
15600
7c98e6bb
DM
156012008-04-11 David S. Miller <davem@davemloft.net>
15602
15603 * testsuite/justsyms.t: Start at 0x100.
15604 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15605 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15606 long.
15607 * testsuite/script_test_2.cc: Adjust string and section length
15608 checks.
7c98e6bb 15609
99a37bfd
ILT
156102008-04-09 Ian Lance Taylor <iant@google.com>
15611
2cefc357
ILT
15612 PR gold/5996
15613 * script-sections.cc (Sections_element::allocate_to_segment): Add
15614 orphan parameter.
15615 (Output_section_definition::allocate_to_segment): Likewise.
15616 (Orphan_output_section::allocate_to_segment): Likewise.
15617 (Script_sections::attach_sections_using_phdrs_clause): Don't
15618 propagate non-PT_LOAD segments to orphan sections.
15619 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15620 readelf rather than objdump.
15621 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15622 .interp section and PT_INTERP segment are the same size.
15623 * testsuite/Makefile.in: Rebuild.
15624
99a37bfd
ILT
15625 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15626 aliases for symbols defined in the same object.
15627 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15628 (weak_alias_test_SOURCES): New variable.
15629 (weak_alias_test_DEPENDENCIES): New variable.
15630 (weak_alias_test_LDFLAGS): New variable.
15631 (weak_alias_test_LDADD): New variable.
15632 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15633 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15634 (weak_alias_test_3.o): New target.
15635 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15636 * testsuite/weak_alias_test_main.cc: New file.
15637 * testsuite/weak_alias_test_1.cc: New file.
15638 * testsuite/weak_alias_test_2.cc: New file.
15639 * testsuite/weak_alias_test_3.cc: New file.
15640
780e49c5
ILT
156412008-04-08 Ian Lance Taylor <iant@google.com>
15642
cdb0b8f5
ILT
15643 * options.h (class General_options): Add --noinhibit-exec option.
15644 * main.cc (main): Check --noinhibit-exec.
15645
0864d551
ILT
15646 * options.h (class General_options): Define --wrap as a special
15647 option. Add wrap_symbols_ field.
15648 (General_options::any_wrap_symbols): New function.
15649 (General_options::is_wrap_symbol): New function.
15650 * options.cc (General_options::parse_wrap): New function.
15651 (General_options::General_options): Initialize wrap_symbols_.
15652 * symtab.cc (Symbol_table::wrap_symbol): New function.
15653 (Symbol_table::add_from_object): Handle --wrap.
15654 * symtab.h (class Symbol_table): Declare wrap_symbol.
15655 * target.h (Target::wrap_char): New function.
15656 (Target::Target_info): Add wrap_char field.
15657 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15658 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15659 * testsuite/testfile.cc (Target_test::test_target_info):
15660 Likewise.
15661
789aa6de
ILT
15662 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15663 there is one.
15664
2c38906f
ILT
15665 * layout.h (class Layout): Add added_eh_frame_data_ field.
15666 * layout.cc (Layout::Layout): Initialize new field.
15667 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15668 output section until we find a section we merged successfully.
15669 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15670 that the size be non-zero.
15671
780e49c5
ILT
15672 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15673 qualifier.
15674
7fcd0256
ILT
156752008-04-08 Craig Silverstein <csilvers@google.com>
15676
15677 * configure.ac: Export new conditional variable HAVE_ZLIB.
15678 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15679 on HAVE_ZLIB.
15680 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15681 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15682
6835af53
ILT
156832008-04-07 Ian Lance Taylor <iant@google.com>
15684
e24f324c
ILT
15685 * version.cc (version_string): Set to "1.5".
15686
a036edd8
ILT
15687 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15688 Add issued_non_pic_error_ field. Declare check_non_pic.
15689 (Target_x86_64::Scan::check_non_pic): New function.
15690 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15691 (Target_x86_64::Scan::global): Likewise.
15692
624f8810
ILT
15693 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15694 addend parameter. Change caller. Handle merge sections.
15695 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15696 Address to Addend. Don't add in the result of
15697 local_section_offset, pass down the addend and use the returned
15698 value.
15699 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15700 Update declarations of local_section_offset and symbol_value.
15701 * testsuite/two_file_test_1.cc (t18): New function.
15702 * testsuite/two_file_test_2.cc (f18): New function.
15703 * testsuite/two_file_test_main.cc (main): Call t18.
15704 * testsuite/two_file_test.h (t18, f18): Declare.
15705
6835af53
ILT
15706 * configure.ac: Don't test for objdump, c++filt, or readelf.
15707 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15708 conditionals.
15709 (TEST_READELF): New variable.
15710 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15711 (check_PROGRAMS): Add two_file_strip_test.
15712 (two_file_strip_test): New target.
15713 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15714 (two_file_same_shared_strip_test_SOURCES): New variable.
15715 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15716 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15717 (two_file_same_shared_strip_test_LDADD): New variable.
15718 (two_file_shared_strip.so): New target.
15719 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15720 (ver_test_5.syms, ver_test_7.syms): Likewise.
15721 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15722 (strip_test_3.stdout): Use TEST_OBJDUMP.
15723 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15724
86925eef
CC
157252008-04-04 Cary Coutant <ccoutant@google.com>
15726
15727 * symtab.h (Symbol::is_weak_undefined): New function.
15728 (Symbol::is_strong_undefined): New function.
15729 (Symbol::is_absolute): New function.
15730 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15731 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15732 absolute symbols.
15733 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15734 (weak_undef_test): New target.
15735 * testsuite/Makefile.in: Rebuild.
15736 * testsuite/weak_undef_file1.cc: New file.
15737 * testsuite/weak_undef_file2.cc: New file.
15738 * testsuite/weak_undef_test.cc: New file.
15739
126f3ece
ILT
157402008-04-03 Craig Silverstein <csilvers@google.com>
15741
15742 * compressed_output.h (class Output_compressed_section): Use
15743 unsigned buffer.
15744 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15745 add zlib header.
15746 (zlib_compressed_suffix): Removed.
15747 (Output_compressed_section::set_final_data_size): Use unsigned
15748 buffers.
15749 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15750 Fix linker invocation.
15751 (flagstest_o_specialfile_and_compress_debug_sections):
15752 Likewise.
15753 * testsuite/Makefile.in: Regenerated.
15754
deae2a14
DM
157552008-04-02 David S. Miller <davem@davemloft.net>
15756
15757 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15758 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15759
70752818
ILT
157602008-04-02 Craig Silverstein <csilvers@google.com>
15761
15762 * TODO: New file.
15763
39d0cb0e
ILT
157642008-04-02 Ian Lance Taylor <iant@google.com>
15765
15766 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15767 parameters. Update for new key type to views_. Change all
15768 callers.
15769 (File_read::read): Adjust for byteshift in returned view.
15770 (File_read::add_view): New function, broken out of
15771 find_and_make_view.
15772 (File_read::make_view): New function, broken out of
15773 find_and_make_view.
15774 (File_read::find_or_make_view): Add offset and aligned
15775 parameters. Rewrite accordingly. Change all callers.
15776 (File_read::get_view): Add offset and aligned parameters. Adjust
15777 for byteshift in return value.
15778 (File_read::get_lasting_view): Likewise.
15779 * fileread.h (class File_read): Update declarations.
15780 (class File_read::View): Add byteshift_ field. Add byteshift to
15781 constructor. Add byteshift method.
15782 * archive.h (Archive::clear_uncached_views): New function.
15783 (Archive::get_view): Add aligned parameter. Change all callers.
15784 * object.h (Object::get_view): Add aligned parameter. Change all
15785 callers.
15786 (Object::get_lasting_view): Likewise.
15787
15788 * fileread.cc (File_read::release): Don't call clear_views if
15789 there are multiple objects.
15790 * fileread.h (File_read::clear_uncached_views): New function.
15791 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15792 on the archive.
15793
a1207466
CC
157942008-03-31 Cary Coutant <ccoutant@google.com>
15795
15796 Add thin archive support.
15797 * archive.cc (Archive::armagt): New const.
15798 (Archive::setup): Remove task parameter and calls to unlock.
15799 (Archive::unlock_nested_archives): New function.
15800 (Archive::read_header): Add nested_off parameter. Change
15801 all callers.
15802 (Archive::interpret_header): Likewise.
15803 (Archive::include_all_members): Change to handle thin
15804 archives.
15805 (Archive::include_member): Likewise.
15806 * archive.h (Archive::Archive): Add new parameters and
15807 initializers.
15808 (Archive::armagt): New const.
15809 (Archive::setup): Remove task parameter.
15810 (Archive::unlock_nested_archives): New function.
15811 (Archive::read_header): Add nested_off parameter.
15812 (Archive::interpret_header): Likewise.
15813 (Archive::Nested_archive_table): New typedef.
15814 (Archive::is_thin_archive_): New field.
15815 (Archive::nested_archives_): New field.
15816 (Archive::options_): New field.
15817 (Archive::dirpath_): New field.
15818 (Archive::task_): New field.
15819 * readsyms.cc (Read_symbols::do_read_symbols): Add check
15820 for thin archives. Pass additional parameters to
15821 Archive::Archive. Unlock the archive file after calling
15822 Archive::setup.
cd536b21 15823
479f6503
ILT
158242008-03-29 Ian Lance Taylor <iant@google.com>
15825
686c8caf
ILT
15826 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
15827 version symbol to be local.
15828 * testsuite/ver_test_4.sh: New file.
15829 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
15830 (check_DATA): Add ver_test_4.syms.
15831 (ver_test_4.syms): New target.
15832 * testsuite/Makefile.in: Rebuild.
15833
ab794b6b
ILT
15834 * output.cc
15835 (Output_section::Input_section_sort_entry::has_priority): New
15836 function.
15837 (Output_section::Input_section_sort_entry::match_file_name): New
15838 function.
15839 (Output_section::Input_section_sort_entry::match_section_name):
15840 Remove.
15841 (Output_section::Input_section_sort_entry::match_section_name_prefix):
15842 Remove.
15843 (Output_section::Input_section_sort_entry::match_section_file):
15844 Remove.
15845 (Output_section::Input_section_sort_compare::operator()): Rewrite
15846 using new Input_section_sort_entry functions. Sort crtbegin and
15847 crtend first. Sort sections with no priority before sections with
15848 a priority.
15849 * testsuite/initpri1.c (d3): Check j != 4.
15850 (cd5): New constructor/destructor function.
15851 (main): Check j != 2.
15852
479f6503
ILT
15853 * symtab.cc (Symbol_table::add_from_object): If we don't use the
15854 new symbol when resolving, don't call set_is_default.
15855 * testsuite/ver_test_7.cc: New file.
15856 * testsuite/ver_test_7.sh: New file.
15857 * testsuite/Makefile.am (ver_test_7.so): New target.
15858 (ver_test_7.o): New target.
15859 (check_SCRIPTS): Add ver_test_7.sh.
15860 (check_DATA): Add ver_test_7.syms.
15861 (ver_test_7.syms): New target.
15862
2fd32231
ILT
158632008-03-28 Ian Lance Taylor <iant@google.com>
15864
15865 * layout.cc (Layout::layout): If we see an input section with a
15866 name that needs sorting, set the must_sort flag for the output
15867 section.
15868 (Layout::make_output_section): If the name of the output section
15869 indicates that it might require sorting, set the may_sort flag.
15870 * output.h (Output_section::may_sort_attached_input_sections): New
15871 function.
15872 (Output_section::set_may_sort_attached_input_sections): New
15873 function.
15874 (Output_section::must_sort_attached_input_sections): New
15875 function.
15876 (Output_section::set_must_sort_attached_input_sections): New
15877 function.
15878 (class Output_section): Declare Input_section_sort_entry. Define
15879 Input_section_sort_compare. Declare
15880 sort_attached_input_sections. Add new fields:
15881 may_sort_attached_input_sections_,
15882 must_sort_attached_input_sections_,
15883 attached_input_sections_are_sorted_.
15884 * output.cc (Output_section::Output_section): Initialize new
15885 fields.
15886 (Output_section::add_input_section): Add an entry to
15887 input_sections_ if may_sort or must_sort are true.
15888 (Output_section::set_final_data_size): Call
15889 sort_attached_input_sections if necessary.
15890 (Output_section::Input_section_sort_entry): Define new class.
15891 (Output_section::Input_section_sort_compare::operator()): New
15892 function.
15893 (Output_section::sort_attached_input_sections): New function.
15894 * configure.ac: Check whether the compiler supports constructor
15895 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
15896 * testsuite/initpri1.c: New file.
15897 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
15898 CONSTRUCTOR_PRIORITY.
15899 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
15900 (initpri1_LDFLAGS): New variable.
15901 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15902
18e6b24e
ILT
159032008-03-27 Ian Lance Taylor <iant@google.com>
15904
49bdd526
ILT
15905 * common.cc (Sort_commons::operator): Correct sorting algorithm.
15906 * testsuite/common_test_1.c: New file.
15907 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
15908 (common_test_1_SOURCES): New variable.
15909 (common_test_1_DEPENDENCIES): New variable.
15910 (common_test_1_LDFLAGS): New variable.
15911
18e6b24e
ILT
15912 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
15913 and commons_ correctly when NAME/VERSION does not override
15914 NAME/NULL.
15915 * testsuite/ver_test_6.c: New file.
15916 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
15917 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
15918 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
15919
04bf7072
ILT
159202008-03-26 Ian Lance Taylor <iant@google.com>
15921
5871526f
ILT
15922 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
15923 of an undefined symbol from a version script.
15924 * testsuite/Makefile.am (ver_test_5.so): New target.
15925 (ver_test_5.o): New target.
15926 (check_SCRIPTS): Add ver_test_5.sh.
15927 (check_DATA): Add ver_test_5.syms.
15928 (ver_test_5.syms): New target.
15929 * testsuite/ver_test_5.cc: New file.
15930 * testsuite/ver_test_5.script: New file.
15931 * testsuite/ver_test_5.sh: New file.
15932 * Makefile.in, testsuite/Makefile.in: Rebuild.
15933
04bf7072
ILT
15934 PR gold/5986
15935 Fix problems building gold with gcc 4.3.0.
15936 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
15937 (gold_error_at_location, gold_warning_at_location): Use it.
15938 * configure.ac: Check whether we can compile and use a template
15939 function with a printf attribute.
15940 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
15941 when jumping over bytes.
15942 * object.cc: Instantiate Object::read_section_data.
15943 * debug.h: Include <cstring>
15944 * dwarf_reader.cc: Include <algorithm>
15945 * main.cc: Include <cstring>.
15946 * options.cc: Include <cstring>.
15947 * output.cc: Include <cstring>.
15948 * script.cc: Include <cstring>.
15949 * script.h: Include <string>.
15950 * symtab.cc: Include <cstring> and <algorithm>.
15951 * target-select.cc: Include <cstring>.
15952 * version.cc: Include <string>.
15953 * testsuite/testmain.cc: Include <cstdlib>.
15954 * configure, config.in: Rebuild.
15955
874c5b28
ILT
159562008-03-25 Ian Lance Taylor <iant@google.com>
15957
819d6c3a
ILT
15958 * options.cc: Include "../bfd/bfdver.h".
15959 (options::help): Print bug reporting address.
15960
f4b2c6f5
ILT
15961 * version.cc (print_version): Adjust output for current value of
15962 BFD_VERSION_STRING.
15963
15964 * NEWS: New file.
15965
e96caa79
ILT
15966 * options.cc (options::help): Print list of supported targets.
15967 * target-select.h: Include <vector>.
15968 (class Target_selector): Make machine_, size_, and is_big_endian_
15969 fields const. Add bfd_name_ and instantiated_target_ fields.
15970 (Target_selector::Target_selector): Add bfd_name parameter.
15971 (Target_selector::recognize): Make non-virtual, call
15972 do_recognize.
15973 (Target_selector::recognize_by_name): Make non-virtual, call
15974 do_recognize_by_name.
15975 (Target_selector::supported_names): New function.
15976 (Target_selector::bfd_name): New function.
15977 (Target_selector::do_instantiate_target): New pure virtual
15978 function.
15979 (Target_selector::do_recognize): New virtual function.
15980 (Target_selector::do_recognize_by_name): New virtual function.
15981 (Target_selector::instantiate_target): New private function.
15982 (supported_target_names): Declare.
15983 * target-select.cc (Target_selector::Target_selector): Update for
15984 new parameter and fields.
15985 (select_target_by_name): Check that the name matches before
15986 calling recognize_by_name.
15987 (supported_target_names): New function.
15988 * i386.cc (class Target_selector_i386): Update Target_selector
15989 constructor call. Remove recognize and recognize_by_name. Add
15990 do_instantiate_target.
15991 * x86_64.cc (class Target_selector_x86_64): Likewise.
15992 * testsuite/testfile.cc (class Target_selector_test): Update for
15993 changes to Target_selector.
15994
874c5b28
ILT
15995 * README: Rewrite, with some notes on unsupported features.
15996
0a65a3a7
CC
159972008-03-24 Cary Coutant <ccoutant@google.com>
15998
15999 * i386.cc (Target_i386::Got_type): New enum declaration.
16000 (Target_i386::Scan::local): Updated callers of Output_data_got
16001 member functions.
16002 (Target_i386::Scan::global): Likewise.
16003 (Target_i386::Relocate::relocate): Likewise.
16004 (Target_i386::Relocate::relocate_tls): Likewise.
16005 * object.h (Got_offset_list): New class.
16006 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16007 (Sized_relobj::local_got_offset): Likewise.
16008 (Sized_relobj::set_local_got_offset): Likewise.
16009 (Sized_relobj::local_has_tls_got_offset): Removed.
16010 (Sized_relobj::local_tls_got_offset): Removed.
16011 (Sized_relobj::set_local_tls_got_offset): Removed.
16012 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16013 * output.cc (Output_data_got::add_global): Added got_type parameter.
16014 (Output_data_got::add_global_with_rel): Likewise.
16015 (Output_data_got::add_global_with_rela): Likewise.
16016 (Output_data_got::add_global_pair_with_rel): New function.
16017 (Output_data_got::add_global_pair_with_rela): New function.
16018 (Output_data_got::add_local): Added got_type parameter.
16019 (Output_data_got::add_local_with_rel): Likewise.
16020 (Output_data_got::add_local_with_rela): Likewise.
16021 (Output_data_got::add_local_pair_with_rel): New function.
16022 (Output_data_got::add_local_pair_with_rela): New function.
16023 (Output_data_got::add_global_tls): Removed.
16024 (Output_data_got::add_global_tls_with_rel): Removed.
16025 (Output_data_got::add_global_tls_with_rela): Removed.
16026 (Output_data_got::add_local_tls): Removed.
16027 (Output_data_got::add_local_tls_with_rel): Removed.
16028 (Output_data_got::add_local_tls_with_rela): Removed.
16029 * output.h (Output_data_got::add_global): Added got_type parameter.
16030 (Output_data_got::add_global_with_rel): Likewise.
16031 (Output_data_got::add_global_with_rela): Likewise.
16032 (Output_data_got::add_global_pair_with_rel): New function.
16033 (Output_data_got::add_global_pair_with_rela): New function.
16034 (Output_data_got::add_local): Added got_type parameter.
16035 (Output_data_got::add_local_with_rel): Likewise.
16036 (Output_data_got::add_local_with_rela): Likewise.
16037 (Output_data_got::add_local_pair_with_rel): New function.
16038 (Output_data_got::add_local_pair_with_rela): New function.
16039 (Output_data_got::add_global_tls): Removed.
16040 (Output_data_got::add_global_tls_with_rel): Removed.
16041 (Output_data_got::add_global_tls_with_rela): Removed.
16042 (Output_data_got::add_local_tls): Removed.
16043 (Output_data_got::add_local_tls_with_rel): Removed.
16044 (Output_data_got::add_local_tls_with_rela): Removed.
16045 * resolve.cc (Symbol::override_base_with_special): Removed
16046 reference to has_got_offset_ field.
16047 * symtab.cc (Symbol::init_fields): Replaced initialization
16048 of got_offset_ with got_offsets_. Removed initialization
16049 of has_got_offset_
53fcba31 16050 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16051 (Symbol::got_offset): Likewise.
16052 (Symbol::set_got_offset): Likewise.
16053 (Symbol::has_tls_got_offset): Removed.
16054 (Symbol::tls_got_offset): Removed.
16055 (Symbol::set_tls_got_offset): Removed.
16056 (Symbol::got_offset_): Removed.
16057 (Symbol::tls_mod_got_offset_): Removed.
16058 (Symbol::tls_pair_got_offset_): Removed.
16059 (Symbol::got_offsets_): New field.
16060 (Symbol::has_got_offset): Removed.
16061 (Symbol::has_tls_mod_got_offset): Removed.
16062 (Symbol::has_tls_pair_got_offset): Removed.
16063 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16064 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16065 member functions.
16066 (Target_x86_64::Scan::global): Likewise.
16067 (Target_x86_64::Relocate::relocate): Likewise.
16068 (Target_x86_64::Relocate::relocate_tls): Likewise.
16069
bd52eafb
BE
160702008-03-25 Ben Elliston <bje@au.ibm.com>
16071
16072 * yyscript.y: Fix spelling error in comment.
16073
8b105e34
ILT
160742008-03-24 Ian Lance Taylor <iant@google.com>
16075
8ed814a9
ILT
16076 * options.h (class General_options): Define build_id option.
16077 * layout.h (class Layout): Declare write_build_id, create_note,
16078 create_build_id. Add build_id_note_ member.
16079 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16080 "libiberty.h", "md5.h", "sha1.h".
16081 (Layout::Layout): Initialize eh_frame_data_,
16082 eh_frame_hdr_section_, and build_id_note_.
16083 (Layout::finalize): Call create_build_id.
16084 (Layout::create_note): New function, broken out of
16085 Layout::create_gold_note.
16086 (Layout::create_gold_note): Call create_note.
16087 (Layout::create_build_id): New function.
16088 (Layout::write_build_id): New function.
16089 (Close_task_runner::run): Call write_build_id.
16090
8b105e34
ILT
16091 * x86_64.cc: Correct license to GPLv3.
16092
086a1841
ILT
160932008-03-23 Ian Lance Taylor <iant@google.com>
16094
16095 * options.cc: Include "demangle.h".
16096 (parse_optional_string): New function.
16097 (parse_long_option): Handle takes_optional_argument.
16098 (parse_short_option): Update dash_z initializer. Handle
16099 takes_optional_argument.
16100 (General_options::General_options): Initialize do_demangle_.
16101 (General_options::finalize): Set do_demangle_. Handle demangling
16102 style.
16103 * options.h (parse_optional_string): Declare.
16104 (struct One_option): Add optional_arg field. Update constructor.
16105 Update call constructor calls. Add takes_optional_argument
16106 function.
16107 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16108 (DEFINE_optional_string): Define.
16109 (General_options::demangle): Change from DEFINE_bool to
16110 DEFINE_optional_string.
16111 (General_options::no_demangle): New function.
16112 (General_options::do_demangle): New function.
16113 (General_options::set_do_demangle): New function.
16114 (General_options::execstack_status_): Move definition to end of
16115 class definition.
16116 (General_options::static_): Likewise.
16117 (General_options::do_demangle_): New field.
16118 * object.cc (big_endian>::get_symbol_location_info): Call
16119 Options::do_demangle, not Options::demangle.
16120 * symtab.cc (demangle): Likewise.
16121
cbb93e63
ILT
161222008-03-22 Ian Lance Taylor <iant@google.com>
16123
16124 * gold.h: Include <cstddef> and <sys/types.h>
16125 * options.h: Include <cstring>.
16126
ec531623
ILT
161272008-03-21 Ian Lance Taylor <iant@google.com>
16128
16129 * Added source code to GNU binutils.
752937aa 16130\f
4b95cf5c 16131Copyright (C) 2008-2014 Free Software Foundation, Inc.
752937aa
NC
16132
16133Copying and distribution of this file, with or without modification,
16134are permitted in any medium without royalty provided the copyright
16135notice and this notice are preserved.
16136
16137Local Variables:
16138mode: change-log
16139left-margin: 8
16140fill-column: 74
16141version-control: never
16142End:
This page took 1.069238 seconds and 4 git commands to generate.