Add "typename" keyword to satisfy GCC 4.2.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
aed56ec5
CC
12014-10-17 Cary Coutant <ccoutant@google.com>
2
3 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
4 Add "typename" keyword.
5
83a01957
HS
62014-09-22 Han Shen <shenhan@google.com>
7 Jing Yu <jingyu@google.com>
8
9 Patch for gold aarch64 backend to support relaxation.
10 * aarch64-reloc.def: Change format.
11 * aarch64.cc (class Reloc_stub): New class.
12 (class Stub_table): New class.
13 (class AArch64_relobj): New class.
14 (class AArch64_input_section): New class.
15 (class AArch64_output_section): New class.
16 (Target_aarch64::new_stub_table): New method.
17 (Target_aarch64::new_aarch64_input_section): New method.
18 (Target_aarch64::find_aarch64_input_section): New method.
19 (Target_aarch64::scan_section_for_stubs): New method.
20 (Target_aarch64::scan_reloc_section_for_stubs): New method.
21 (Target_aarch64::relocate_stub): New method.
22 (Target_aarch64::current_target): New method.
23 (Target_aarch64::do_make_elf_object): New method.
24 (Target_aarch64::do_may_relax): New method.
25 (Target_aarch64::do_relax): New method.
26 (Target_aarch64::group_sections): New method.
27 (Target_aarch64::scan_reloc_for_stub): New method.
28 (Target_aarch64::do_make_output_section): New method.
29 (Target_aarch64::stub_tables_): New data member.
30 (Target_aarch64::aarch64_input_section_map_): New data member.
31 (AArch64_relocate_functions::maybe_apply_stub): New method.
32
db4c9594
CC
332014-09-30 Cary Coutant <ccoutant@google.com>
34
35 PR gold/17432
36 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
37
cd6da036
KC
382014-09-30 Kito Cheng <kito@0xlab.org>
39
40 PR gold/13597
41 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
42 hash table before sysv-style hash table.
43
5f772412
ST
442014-09-29 Sriraman Tallam <tmsriram@google.com>
45
46 * options.h (--pic-executable): Add negative to alias to -no-pie.
47
5efeedf6
CC
482014-09-26 Cary Coutant <ccoutant@google.com>
49
50 PR gold/16773
51 * object.cc (Sized_relobj_file): Compute value of section symbols
52 for TLS sections the same as TLS symbols.
53
1707f183
CC
542014-09-25 Cary Coutant <ccoutant@google.com>
55
56 PR gold/17432
57 * resolve.cc (Symbol_table::resolve): Override common placeholder
58 symbols, but adjust sizes.
59 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
60 symbols to common lists.
61
00cac886
AM
622014-09-24 Alan Modra <amodra@gmail.com>
63
64 * po/POTFILES.in: Regenerate.
65
635aa30e
CC
662014-09-23 Taiju Tsuiki <tzik@google.com>
67 Cary Coutant <ccoutant@google.com>
68
71b9b91b 69 PR gold/14860
635aa30e
CC
70 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
71 on input_sections_blocker.
72 * layout.cc (Write_sections_task::locks): Unblock
73 input_sections_blocker_.
74 * layout.h (Write_sections_task::Write_sections_task): Add
75 input_sections_blocker.
76 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
77 to DEPENDENCIES.
78 * testsuite/Makefile.in: Regenerate.
79
c0c71592
RÁE
802014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
81
82 * testsuite/Makefile.am (plugin_test_10): New test.
83 * testsuite/Makefile.in: Regenerate
84 * testsuite/plugin_common_test_2.c (c1): Align to 8.
85 * testsuite/plugin_test_10.sh: New file.
86
6168c2a1
RÁE
872014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
88
89 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
90 * resolve.cc (Symbol_table::resolve): Don't override common symbols
91 during the replacement phase.
92
3a531937
JY
932014-09-17 Han Shen <shenhan@google.com>
94 Jing Yu <jingyu@google.com>
95
96 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
97 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
98 * aarch64.cc (Target_aarch64): Add data members
99 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
100 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
101 constructor.
102 (Target_aarch64::do_reloc_symbol_index): New method.
103 (Target_aarch64::do_reloc_addend): New method.
104 (Target_aarch64::add_tlsdesc_info): New method.
105 (Target_aarch64::do_dynsym_value): New method.
106 (Target_aarch64::do_make_data_plt): Add new parameters: got,
107 got_irelative. Pass them to Output_data_plt_aarch64_standard.
108 (Target_aarch64::make_data_plt): Add new parameters: got,
109 got_irelative. Pass them to do_make_data_plt.
110 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
111 (Target_aarch64::Relocate:tls_gd_to_le): New method.
112 (Target_aarch64::Relocate:tls_ie_to_le): New method.
113 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
114 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
115 (Target_aarch64::got_tlsdesc_section): New method.
116 (Target_aarch64::make_local_ifunc_plt_entry): New method.
117 (Target_aarch64::define_tls_base_symbol): New method.
118 (Target_aarch64::reserve_tlsdesc_entries): New method.
119 (Target_aarch64::got_mod_index_entry): New method.
120 (Target_aarch64::rela_tlsdesc_section): New method.
121 (Target_aarch64::rela_irelative_section): New method.
122 (Target_aarch64::Tlsdesc_info): New struct.
123 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
124 relocations and tlsdesc relocations.
125 (Target_aarch64::optimize_tls_reloc): Implement method.
126 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
127 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
128 in constructor.
129 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
130 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
131 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
132 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
133 (Output_data_plt_aarch64::rela_tlsdesc): New method.
134 (Output_data_plt_aarch64::rela_irelative): New method.
135 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
136 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
137 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
138 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
139 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
140 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
141 (Output_data_plt_aarch64_standard): New member variables:
142 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
143 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
144 New parameter: got, got_irelative.
145 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
146 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
147 (Output_data_plt_aarch64::do_write): Replace got_address with
148 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
149 (AArch64_relocate_functions::update_movnz): New method.
150 (AArch64_relocate_functions): Correct format.
151 (AArch64_relocate_functions::movnz): New method.
152 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
153 before the switch. Add new cases to switch.
00cac886 154 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
155 tlsgd tlsdesc cases.
156 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
157 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
158 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
159 Call reloc_name_in_error_message to print unsupported reloc.
160 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
161 make_data_plt.
162 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
163 relocs. Fill in some more dynamic tags.
164 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
165 Skip call tls_get_addr when tlsgd is relaxed.
166 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
167 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
168 tlsdesc->ie relaxation.
169
62661c93
SS
1702014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
171
172 * mips.cc (Target_mips_nacl): New class.
173 (Target_selector_mips_nacl): New class.
174 (target_selector_mips32): Rename from target_selector_mips32be and use
175 Target_selector_mips_nacl instead of Target_selector_mips.
176 (target_selector_mips32el): Rename from target_selector_mips32 and use
177 Target_selector_mips_nacl instead of Target_selector_mips.
178 (target_selector_mips64): Rename from target_selector_mips64be and use
179 Target_selector_mips_nacl instead of Target_selector_mips.
180 (target_selector_mips64el): Rename from target_selector_mips64 and use
181 Target_selector_mips_nacl instead of Target_selector_mips.
182 (Target_mips::mips_info): Add const attribute.
183
54674d38
CC
1842014-09-02 Cary Coutant <ccoutant@google.com>
185
186 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
187 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
188 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
189 (Sized_incr_dynobj::do_section_name): Likewise.
190 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
191 (Sized_incr_dynobj::do_section_name): Likewise.
192 * object.h (Object::section_name): Likewise.
193 (Object::do_section_name): Likewise.
194 (Sized_relobj_file::do_section_name): Likewise.
195 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
196 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
197
9860cbcf
CC
1982014-09-02 Cary Coutant <ccoutant@google.com>
199
200 PR gold/17005
201 * ehframe.cc (Fde::write): Add output_offset parameter.
202 (Cie::write): Likewise.
203 (Eh_frame::set_final_data_size): Account for offset within output
204 section.
205 (Eh_frame::do_sized_write): Likewise.
206 * ehframe.h (Fde::write): Add output_offset parameter.
207 (Cie::write): Likewise.
208 * output.cc (Output_section::Input_section_sort_entry): Remove
209 section_has_name_; add output_section_name parameter. Use
210 output section name for non-input sections.
211 (Output_section::Input_section_sort_entry::section_has_name): Remove.
212 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
213 (Output_section::Input_section_sort_compare): Remove logic for
214 sections without names.
215 (Output_section::Input_section_sort_init_fini_compare): Likewise.
216 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
217 Likewise.
218 (Output_section::Input_section_sort_section_name_compare): Likewise.
219
8e33481e
HS
2202014-08-29 Han Shen <shenhan@google.com>
221 Jing Yu <jingyu@google.com>
222
223 * aarch64-reloc-property.cc
224 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
225 reference reloc property in the table.
226 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
227 3 other entries.
228 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
229 2 new overloaded methods.
230 (Output_data_got_aarch64::do_write): Add code to write out
231 static relocs.
232 (class Output_data_got_aarch64::Static_reloc): New class to wrap
233 static relocs.
234 (Output_data_got_aarch64::static_relocs): New vector to
235 hold static relocs.
236 (Target_aarch64::TCB_SIZE): New const static memeber.
237 (Target_aarch64::tcb_size): New method.
238 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
239 (Target_aarch64::Relocate::relocate_tls): New method.
240 (Target_aarch64::Scan::local): Add code handling new reloc types.
241 (Target_aarch64::Scan::global): Add code handling new reloc types.
242
81233653
ST
2432014-08-13 Sriraman Tallam <tmsriram@google.com>
244
245 * options.h (-no-pie): Add option.
246
9363c7c3
JY
2472014-08-08 Jing Yu <jingyu@google.com>
248 Han Shen <shenhan@google.com>
249
250 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
251 (DEFFILES): add aarch64-reloc.def.
252 (TARGETSOURCES): Add aarch64-reloc-property.cc.
253 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
254 * Makefile.in: Regenerate.
255 * aarch64-reloc-property.cc: New file.
256 * aarch64-reloc-property.h: New file.
257 * aarch64-reloc.def: New file.
258 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
259 with tab to make the format consistent.
260 (Output_data_got_aarch64::symbol_table_): New method.
261 (Target_aarch64::do_plt_address_for_global): New method.
262 (Target_aarch64::do_plt_address_for_local): New method.
263 (Target_aarch64::do_select_as_default_target): New method.
264 (Target_aarch64::do_make_data_plt): New method.
265 (Target_aarch64::make_data_plt): New method.
266 (Output_data_plt_aarch64::has_irelative_section): New method.
267 (Output_data_plt_aarch64::address_for_global): New method.
268 (Output_data_plt_aarch64::address_for_local): New method.
269 (Output_data_plt_aarch64::irelative_rel_): New parameter.
270 (Output_data_plt_aarch64::add_entry): Implement contents.
271 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
272 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
273 the got_pov entry to plt0.
274 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
275 Implement contents.
276 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
277 (AArch64_howto): New struct.
278 (aarch64_howto[]): New static const array.
279 (AArch64_relocate_functions): New class.
280 (Target_aarch64::Scan::get_reference_flags): Remove method.
281 (Target_aarch64::Scan::local): Implement to support a few relocations.
282 (Target_aarch64::Scan::global): Implement to support a few relocations.
283 (Target_aarch64::make_plt_section): Implement contents.
284 (Target_aarch64::make_plt_entry): Implement contents.
285 (Target_aarch64::do_finalize_sections): Implement contents.
286 (Target_aarch64::Relocate::relocate): Implement a few relocations.
287 (Target_aarch64::relocate_section): Implement contents.
288
ad9fe6c1
AM
2892014-08-06 Alan Modra <amodra@gmail.com>
290
291 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
292
7cd4e5b7
AM
2932014-08-06 Alan Modra <amodra@gmail.com>
294
295 PR 13227
296 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
297
5ad9b0a7
ST
2982014-07-21 Sriraman Tallam <tmsriram@google.com>
299
300 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 301 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 302
e051745c
CC
3032014-07-08 Cary Coutant <ccoutant@google.com>
304
305 * expression.cc (struct Expression::Expression_eval_info): Add
306 new fields type_pointer, vis_pointer, and nonvis_pointer.
307 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
308 nonvis_pointer parameters. Adjust all calls.
309 (Symbol_expression::value): Update type, visibility, and nonvis bits
310 in caller.
311 * script.cc (Symbol_assignment::sized_finalize): Update type,
312 visibility, and remaining st_other bits for new symbol.
313 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
314 vis_pointer, and nonvis_pointer parameters.
315 * symtab.h (Symbol::set_type): New method.
316
317 * testsuite/Makefile.am (defsym_test): New test.
318 * testsuite/Makefile.in: Regenerate.
319 * testsuite/defsym_test.c: New file.
320 * testsuite/defsym_test.sh: New file.
321
f35c4853
CC
3222014-07-08 Cary Coutant <ccoutant@google.com>
323
324 PR gold/15639
325 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
326 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
327 (Sized_dynobj::base_read_symbols): ...new method.
328 * object.h (Sized_relobj_file::base_read_symbols): New method.
329 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
330 (Sized_relobj_file::base_read_symbols): ...new method.
331 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
332 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
333 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
334
2900af2d
AM
3352014-07-04 Alan Modra <amodra@gmail.com>
336
337 * po/POTFILES.in: Regenerate.
338
053a4d68
JY
3392014-07-02 Jing Yu <jingyu@google.com>
340
341 * aarch64.cc: New file
342 * Makefile.am (TARGETSOURCES): Add aarch64.cc
343 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
344 * Makefile.in: Regenerate.
345 * configure.tgt: Add entries for aarch64*.
346 * configure.ac: Likewise.
347 * configure: Likewise.
348
7b549045
AM
3492014-06-27 Alan Modra <amodra@gmail.com>
350
351 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
352
cb818dbf
CC
3532014-06-24 Cary Coutant <ccoutant@google.com>
354
355 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
356 sections.
357 (Dwo_file::sized_read_unit_index): Likewise.
358
9810d34d
SS
3592014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
360
361 * mips.cc: New file.
362 * Makefile.am (TARGETSOURCES): Add mips.cc
363 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
364 * configure.tgt: Add entries for mips*.
365 * configure.ac: Likewise.
366 * Makefile.in: Regenerate.
367 * configure: Likewise.
368
9baa787b
CC
3692014-06-09 Cary Coutant <ccoutant@google.com>
370
371 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
372 unit_length is within section bounds.
373
8f89af0a
CC
3742014-06-09 Cary Coutant <ccoutant@google.com>
375
376 PR gold/16980
377 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
378 map.
379
a47622ac
AM
3802014-06-07 Alan Modra <amodra@gmail.com>
381
382 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
383
4320c691
CC
3842014-06-06 Cary Coutant <ccoutant@google.com>
385
386 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
387 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
388 (Dwarf_pubnames_table::read_header): Likewise.
389 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
390 .debug_gnu_pubtypes.
391
270c9937
JB
3922014-06-05 Joel Brobecker <brobecker@adacore.com>
393
394 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
395 * Makefile.in, configure: Regenerate.
396
397998fc
AM
3972014-06-03 Alan Modra <amodra@gmail.com>
398
399 * powerpc.cc (addis_12_2): Define.
400 (Stub_table::do_write): Support fusion on ELFv2 stubs.
401
61f5c66f
AM
4022014-06-03 Alan Modra <amodra@gmail.com>
403
404 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
405 st_other output.
406
f6971787
AM
4072014-06-02 Alan Modra <amodra@gmail.com>
408
409 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
410 Only ignore relocs on ELFv1.
411 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
412
f6fb8322
CC
4132014-05-30 Cary Coutant <ccoutant@google.com>
414
415 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
416 * testsuite/Makefile.in: Regenerate.
417 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
418
c23dd342
L
4192014-05-27 H.J. Lu <hongjiu.lu@intel.com>
420
421 PR gold/16945
422 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
423 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
424
5fe7ffdc
AM
4252014-05-15 Alan Modra <amodra@gmail.com>
426
427 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
428 Compare FDE contents with DW_CFA_nop rather than 0.
429
a82bef93
ST
4302014-05-13 Sriraman Tallam <tmsriram@google.com>
431
432 * symtab.h (may_need_copy_reloc): Remove check for position independent
433 code.
434 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
435 position independence before pc absolute may_need_copy_reloc call.
436 Add check for executable output befor pc relative may_need_copy_reloc
437 call.
438 * i386.cc: Ditto.
439 * arm.cc: Ditto.
440 * sparc.cc: Ditto.
441 * tilegx.cc: Ditto.
442 * powerpc.cc: Add check for no position independence before
443 may_need_copy_reloc calls.
444 * testsuite/pie_copyrelocs_test.cc: New file.
445 * testsuite/pie_copyrelocs_shared_test.cc: New file.
446 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 447 * Makefile.in: Regenerate.
a82bef93 448
53c66605
ML
4492014-05-08 Martin Liška <mliska@suse.cz>
450
451 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
452
57b2284c
CC
4532014-05-06 Cary Coutant <ccoutant@google.com>
454
455 PR gold/16900
456 * i386.cc (Output_data_got_plt_i386): New class.
457 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
458 parameter. Change all callers.
459 (Output_data_plt_i386::layout_): Remove.
460 (Output_data_plt_i386::got_plt_): Change type.
461 (Target_i386::got_plt_): Change type. Change all references.
462 (Target_i386::got_section): Create instance of new class.
463 (Output_data_got_plt_i386::do_write): New function.
464 * x86_64.cc (Output_data_got_plt_x86_64): New class.
465 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
466 parameter. Change all callers.
467 (Output_data_plt_x86_64::layout_): Remove.
468 (Output_data_plt_x86_64::got_plt_): Change type.
469 (Target_x86_64::got_plt_): Change type. Change all references.
470 (Target_x86_64::got_section): Create instance of new class.
471 (Output_data_got_plt_x86_64::do_write): New function.
472 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
473 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
474 class.
475
6b97515d 4762014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 477
6b97515d
CC
478 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
479 if we have pubnames/pubtypes.
480
d1bddd3c
CC
4812014-05-02 Cary Coutant <ccoutant@google.com>
482
5fe7ffdc
AM
483 * defstd.cc (in_segment): Define __ehdr_start here...
484 * layout.cc (Layout::finalize): ...Instead of here. Set the
485 output segment when known.
486 * resolve.cc (Symbol::override_base_with_special): Remember
487 the original binding.
488 * symtab.cc (Symbol::set_output_segment): New function.
489 (Symbol::set_undefined): New function.
490 * symtab.h (Symbol::is_weak_undefined): Check original undef
491 binding.
492 (Symbol::is_strong_undefined): New function.
493 (Symbol::set_output_segment): New function.
494 (Symbol::set_undefined): New function.
495 * target-reloc.h (is_strong_undefined): Remove.
496 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
497 Check for hidden undefs.
498 (relocate_section): Call Symbol::is_strong_undefined.
499
500 * testsuite/Makefile.am (ehdr_start_test_1)
501 (ehdr_start_test_2, ehdr_start_test_3)
502 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
503 * testsuite/Makefile.in: Regenerate.
504 * testsuite/ehdr_start_def.cc: New source file.
505 * testsuite/ehdr_start_test.cc: New source file.
506 * testsuite/ehdr_start_test.t: New linker script.
507 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 508
7849f6d8
CC
5092014-04-23 Cary Coutant <ccoutant@google.com>
510
bf2cc635 511 PR gold/16870
7849f6d8
CC
512 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
513
99fd8cff
CC
5142014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
515
516 * layout.cc (Layout::include_section): Allow a target to decide
517 whether to include a section.
518 * target.h (Target::should_include_section): New function.
519 (Target::do_should_include_section): New function.
520
91f43acd
CC
5212014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
522
523 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
524 inline into ...
525 (Copy_relocs::emit): ... here.
526 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
527 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
528 (Copy_reloc_entry::entries_): Change from private to protected.
529
c4eb27e1
ST
5302014-04-02 Sriraman Tallam <tmsriram@google.com>
531
532 * icf.cc (get_section_contents): Replace copies of reloc
533 vectors with const references.
534
ae447ddd
CC
5352014-04-02 Cary Coutant <ccoutant@google.com>
536
537 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
538 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
539 * configure: Regenerate.
540 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
541 -fno-use-linker-plugin.
542 (LINK1, CXXLINK1): Add it to the link command.
543 * testsuite/Makefile.in: Regenerate.
544
fa47fa92
AM
5452014-03-12 Alan Modra <amodra@gmail.com>
546
547 * Makefile.in: Regenerate.
548
9b12c500
CC
5492014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
550
551 * symtab.h (Symbol::set_nonvis): New function.
552
beacaa96
CC
5532014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
554
555 * symtab.cc (Sized_symbol<32>::init_output_data):
556 Instantiate the template.
557 (Sized_symbol<64>::init_output_data): Likewise.
558
800d9823
CC
5592014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
560
561 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
562 adjust dynamic symbol value.
563 * target.h (Target::adjust_dyn_symbol): New function.
564 (Target::do_adjust_dyn_symbol): New function.
565
918fc1f8 5662014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 567
918fc1f8
CC
568 * output.cc (Output_data_dynamic::Dynamic_entry::write):
569 Get the value of DYNAMIC_CUSTOM dynamic entry.
570 * output.h (Output_data_dynamic::add_custom): New function.
571 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
572 dynamic entry.
573 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
574 * target.h (Target::dynamic_tag_custom_value): New function.
575 (Target::do_dynamic_tag_custom_value): New function.
576
98ff9231
CC
5772014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
578
579 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
580 dynsym indexes.
581 * target.h (Target::has_custom_set_dynsym_indexes): New function.
582 (Target::do_has_custom_set_dynsym_indexes): New function.
583 (Target::set_dynsym_indexes): New function.
584 (Target::do_set_dynsym_indexes): New function.
585
b80eed39
AM
5862014-03-07 Alan Modra <amodra@gmail.com>
587
588 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
589 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
590 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
591 (Powerpc_relocate_functions::has_overflow_bitfield,
592 overflowed): Use the above.
593 (Target_powerpc::Relocate::relocate): Correct overflow checking
594 for a number of relocations. Modify overflow test for 16-bit
595 fields in instructions to signed/unsigned according to whether
596 the field takes a signed or unsigned value.
597
4b95cf5c
AM
5982014-03-05 Alan Modra <amodra@gmail.com>
599
600 Update copyright years.
601
45965137
AM
6022014-03-05 Alan Modra <amodra@gmail.com>
603
604 * powerpc.cc (Target_powerpc::Scan::local, global): Support
605 R_PPC64_ADDR64_LOCAL.
606 (Target_powerpc::Relocate::relocate): Likewise.
607
2c80b753
AM
6082014-03-03 Alan Modra <amodra@gmail.com>
609
610 * dwp.cc (print_version): Update copyright year to current.
611
c1c69e83
AM
6122014-02-10 Alan Modra <amodra@gmail.com>
613
614 * po/gold.pot: Regenerate.
615
dd0c4e70
CC
6162014-02-06 Cary Coutant <ccoutant@google.com>
617
618 Fix problem where -u is ignored when a weak undef is seen.
619
620 * archive.cc (Library_base::should_include_member): Reorder
621 code to check for -u option if a weak undef has already been seen.
622 * testsuite/Makefile.am (weak_undef_test_2): New test case.
623 * testsuite/Makefile.in: Regenerate.
624 * testsuite/weak_undef_file3.cc: New file.
625 * testsuite/weak_undef_file4.cc: New file.
626 * testsuite/weak_undef_test_2.cc: New file.
627
1a221d3d
CC
6282014-02-05 Cary Coutant <ccoutant@google.com>
629
630 Fix issues with gold undefined symbol diagnostics.
631
632 PR binutils/15435
633 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
634 check to here.
635 * target-reloc.h (is_strong_undefined): New function.
636 (relocate_section): Move undef vtable symbol check from here.
637 Check for is_strong_undefined.
638
e889f0a4 6392014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 640
e889f0a4
CC
641 Fix problems with the --dynamic-list option.
642
643 PR gold/13577
644 * options.cc (General_options::parse_dynamic_list):
645 Set have_dynamic_list_.
646 (General_options::General_options): Initialize have_dynamic_list_.
647 (General_options::finalize): Turn off -Bsymbolic and
648 -Bsymbolic-functions if --dynamic-list provided.
649 * options.h (General_options::have_dynamic_list): New function.
650 (General_options::have_dynamic_list_): New data member.
651 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
652 correctly.
5fe7ffdc 653
e889f0a4
CC
654 PR gold/16530
655 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
656 in --dynamic-list, mark it.
5fe7ffdc 657
e889f0a4
CC
658 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
659 (dynamic_list_2): New test case.
660 * testsuite/Makefile.in: Regenerate.
661 * testsuite/dynamic_list_2.cc: New file.
662 * testsuite/dynamic_list_2.t: New file.
663 * testsuite/dynamic_list_lib1.cc: New file.
664 * testsuite/dynamic_list_lib2.cc: New file.
665 * testsuite/gc_dynamic_list_test.c: New file.
666 * testsuite/gc_dynamic_list_test.sh: New file.
667 * testsuite/gc_dynamic_list_test.t: New file.
668
ec673e64
CC
6692014-01-28 Cary Coutant <ccoutant@google.com>
670
671 Add .gdb_index version 7 support.
672
673 * gold/dwarf_reader.cc: include <utility> (for make_pair).
674 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
675 debug sections.
676 (Dwarf_ranges_table::read_ranges_table): Likewise.
677 (Dwarf_pubnames_table::read_section): Check for GNU-style
678 sections, and for compressed debug sections.
679 (Dwarf_pubnames_table::read_header): Compute end address of table.
680 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
681 for end of list by offset, not by offset == 0.
682 (Dwarf_info_reader::do_read_string_table): Check for compressed
683 debug sections.
684 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
685 Initialize new data members.
686 (Dwarf_pubnames_table::next_name): return flag_byte.
687 (Dwarf_pubnames_table::end_of_table_): New data member.
688 (Dwarf_pubnames_table::is_gnu_style_): New data member.
689 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
690 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
691 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
692 read skeleton type unit DIEs.
693 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
694 (Gdb_index::do_write): Write flag_byte.
695 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
696 (Gdb_index::Cu_vector): Store flags along with cu indexes.
697 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
698 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
699
221fd5d5
L
7002014-01-08 H.J. Lu <hongjiu.lu@intel.com>
701
702 * version.cc (print_version): Update copyright year to 2014.
703
6c09fb0b
ILT
7042013-12-19 Dimitry Andric <dimitry@andric.com>
705
706 * stringpool.cc (Stringpool_template::reserve): Add
707 HAVE_UNORDERED_MAP case.
708 * stringpool.cc (Stringpool_template::print_stats): Likewise.
709
8356f2d0
CC
7102013-12-18 Cary Coutant <ccoutant@google.com>
711
712 * configure.ac: Check for <unordered_set> and <unordered_map>.
713 * config.in: Regenerate.
714 * configure: Regenerate.
715 * system.h: Use <unordered_set> and <unordered_map> if available.
716
f2c7d7ee
RM
7172013-12-10 Roland McGrath <mcgrathr@google.com>
718
719 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
720 with $(INSTALL_PROGRAM_ENV).
721 * Makefile.in: Regenerate.
722
6632e8cc
CC
7232013-11-22 Cary Coutant <ccoutant@google.com>
724
725 * configure.ac: Add check for which library is needed for
726 dlopen.
727 * configure: Regenerate.
728
0c075858
CC
7292013-11-22 Cary Coutant <ccoutant@google.com>
730
731 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
732 assembler.
733 * testsuite/Makefile.in: Regenerate.
734
f49fe902
L
7352013-11-17 H.J. Lu <hongjiu.lu@intel.com>
736
737 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
738 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
739 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
740 (Target_x86_64<size>::Scan::local): Likewise.
741 (Target_x86_64<size>::Scan::global): Likewise.
742 (Target_x86_64<size>::Relocate::relocate): Likewise.
743 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
744 Likewise.
745 (Target_x86_64<size>::Scan::check_non_pic(): Handle
746 R_X86_64_PC32_BND.
747
748 * testsuite/Makefile.am (check_PROGRAMS): Add
749 exception_x86_64_bnd_test.
750 (exception_x86_64_bnd_test_SOURCES): New macro.
751 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
752 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
753 (exception_x86_64_bnd_test_LDADD): Likewise.
754 (exception_x86_64_bnd_1.o): New rule.
755 (exception_x86_64_bnd_2.o): Likewise.
756 * testsuite/Makefile.in: Regenerated.
757
9055360d
AM
7582013-11-15 Alan Modra <amodra@gmail.com>
759
760 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
761 accessor.
762 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
763 Only call ppc64_local_entry_offset for 64-bit. Restrict
764 symval_for_branch lookup to ELFv1.
765 (Stub_table::add_plt_call_entry): Use unsigned int off.
766 (Output_data_glink::Address, invalid_address): New.
767 (Output_data_glink::add_eh_frame): Move out of line. Add
768 support for ELFv2.
769 (Output_data_glink::add_global_entry, find_global_entry,
770 global_entry_address): New functions.
771 (Output_data_glink::global_entry_stubs_, end_branch_table_,
772 ge_size): New variables.
773 (Output_data_glink::set_final_data_size): Add global entry
774 stub sizing.
775 (Output_data_glink::do_write): Write global entry stubs.
776 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
777 parameter. Return true for ELFv2. Adjust callers.
778 (Target_powerpc::Scan::local, global): Restrict opd lookup to
779 ELFv1. Similarly for ifunc and dynamic relocation processing
780 specific to ELFv1. Recognize that symbols are defined on
781 their plt entries for ELFv2.
782 (Target_powerpc::symval_for_branch): Assert if called for
783 ELFv2 or ppc32.
784 (Target_powerpc::Relocate::relocate): Use global entry plt
785 stub for symbol value if such exists on ELFv2.
786 (Target_powerpc::Relocate::relocate): Don't call
787 symval_for_branch when ELFv2. Do adjust for local entry
788 offset when ELFv2.
789 (Target_powerpc::do_dynsym_value): Set symbols to global entry
790 plt stub for ELFv2.
791 (Target_powerpc::do_plt_address_for_global): Similarly.
792
cafdd569
CC
7932013-11-14 Cary Coutant <ccoutant@google.com>
794
795 Revert patch -- this did not fix the problem, and there is
796 no race there.
797
798 2013-11-14 Cary Coutant <ccoutant@google.com>
799
800 PR gold/14860
801 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
802 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
803 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
804 updating fde_offsets_.
805 (Eh_frame_hdr::lock_): New data member.
806
94e49e16
CC
8072013-11-14 Cary Coutant <ccoutant@google.com>
808
809 * dwp.cc (Dwo_file_entry): New type.
810 (File_list): Use Dwo_file_entry.
811 (Dwo_file::verify): New function.
812 (Dwo_file::verify_dwo_list): New function.
813 (Dwo_file::sized_verify_dwo_list): New function.
814 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
815 list.
816 (Dwp_options): New enum type.
817 (dwp_options): Add --verify-only.
818 (usage): Likewise.
819 (main): Likewise.
820 * dwp.h (gold_info): Add declaration.
821
7cdd7d57
CC
8222013-11-14 Cary Coutant <ccoutant@google.com>
823
824 PR gold/14860
825 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
826 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
827 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
828 updating fde_offsets_.
829 (Eh_frame_hdr::lock_): New data member.
830
1d946cb3
CC
8312013-11-06 Cary Coutant <ccoutant@google.com>
832
833 PR gold/15758
834 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
835 before reloc sections.
836
4f65b40e
AM
8372013-11-04 Alan Modra <amodra@gmail.com>
838
839 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
840 (Symbol::needs_dynamic_reloc): Test new flag.
841 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
842 (Target_powerpc::Scan::get_reference_flags): Add target param.
843 Return FUNC_DESC_ABI for 64-bit ELFv1.
844 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
845 call.
846 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
847 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
848
908794a9
CC
8492013-10-31 Cary Coutant <ccoutant@google.com>
850
851 Restore support for dwp v2 DWARF package file format.
852
853 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
854 tu_length parameter. Adjust all callers.
855 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
856 * dwp.cc: Include dwarf.h.
857 (Section_bounds): New struct type.
858 (Unit_set): New struct type.
859 (Dwo_file::Dwo_file): Initialize new data member.
860 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
861 Combine and rename to...
862 (Dwo_file::read_unit_index): ...this.
863 (Dwo_file::sized_read_compunit_index)
864 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
865 (Dwo_file::sized_read_unit_index): ...this.
866 (Dwo_file::copy_section): Remove section_name, is_str_offsets
867 parameters; add section_id parameter.
868 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
869 (Dwo_file::add_unit_set): ...this.
870 (Dwo_file::shndx_map_): Remove.
871 (Dwo_file::sect_offsets_): New data member.
872 (Dwp_output_file::Dwp_output_file): Initialize new data members.
873 (Dwp_output_file::add_section): Rename to...
874 (Dwp_output_file::add_contribution): ...this.
875 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
876 (Dwp_output_file::add_tu_set): Likewise.
877 (Dwp_output_file::Contribution): New type.
878 (Dwp_output_file::Section::contributions): New data member.
879 (Dwp_output_file::Cu_or_tu_set): Remove.
880 (Dwp_output_file::Section::Section): New ctor.
881 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
882 (Dwp_output_file::Dwp_index::Section_table): New type.
883 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
884 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
885 parameter.
886 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
887 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
888 (Dwp_output_file::Dwp_index::section_table): New member function.
889 (Dwp_output_file::Dwp_index::section_table_end): New member function.
890 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
891 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
892 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
893 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
894 (Dwp_output_file::Dwp_index::section_table_): New data member.
895 (Dwp_output_file::Dwp_index::section_mask_): New data member.
896 (Dwp_output_file::add_output_section): New member function.
897 (Dwp_output_file::write_new_section): New member function.
898 (Dwp_output_file::write_contributions): New member function.
899 (Dwp_output_file::section_id_map_): New data member.
900 (class Dwo_id_info_reader): Remove.
901 (class Unit_reader): New class.
902 (get_dwarf_section_name): New function.
903 (Dwo_file::read_executable): Adjust initializations of class data.
904 (Dwo_file::read): Add support for v2 package file format.
905 (Dwo_file::read_unit_index): Likewise.
906 (Dwo_file::sized_read_unit_index): Likewise.
907 (Dwo_file::copy_section): Likewise.
908 (Dwo_file::add_unit_set): Likewise.
909 (Dwp_output_file::add_output_section): Likewise.
910 (Dwp_output_file::add_contribution): Likewise.
911 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
912 for empty slot.
913 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
914 file format.
915 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
916 slot.
917 (Dwp_output_file::initialize): Remove unused function.
918 (Dwp_output_file::finalize): Add support for v2 package file format.
919 (Dwp_output_file::write_index): Likewise.
920 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
921 function prototype.
922
2500c017
CC
9232013-10-31 Cary Coutant <ccoutant@google.com>
924
925 * configure.ac: Fix check for -fmerge-constants.
926 * configure.ac: Regenerate.
927
dd0845d7
RM
9282013-10-30 Roland McGrath <mcgrathr@google.com>
929
930 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
931 Correct 9-byte nop sequence to match what the assembler generates.
932
b4f7960d
AM
9332013-10-30 Alan Modra <amodra@gmail.com>
934
935 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
936 ppc64_local_entry_offset, ppc64_local_entry_offset,
937 do_read_symbols): New functions.
938 (Powerpc_relobj::e_flags_, st_other_): New vars.
939 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
940 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
941 (Powerpc_relobj::e_flags_): New var.
942 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
943 and adjust for ELFv2.
944 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
945 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
946 (Powerpc_dynobj::do_find_special_sections): Likewise.
947 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
948 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
949 to ELFv2 local entry.
950 (Target_powerpc::do_relax): No thread safe barriers needed for
951 ELFv2.
952 (Output_data_plt_powerpc::initial_plt_entry_size_,
953 plt_entry_size): Delete. Replace all uses with
954 first_plt_entry_offset() and plt_entry_size().
955 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
956 reserved_size parm. Update callers.
957 (Output_data_plt_powerpc::entry_count): Update.
958 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
959 and use Target_powerpc::first_plt_entry_offset().
960 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
961 rename to plt_entry_size.
962 (Output_data_plt_powerpc::add_ifunc_entry,
963 add_local_ifunc_entry): Adjust reloc for ELFv2.
964 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
965 (glink_eh_frame_fde_64v2): New.
966 (Stub_table::plt_call_size): Support ELFv2 sizing.
967 (Output_data_glink::add_eh_frame): Use the new FDE.
968 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
969 (Stub_table::do_write): Write ELFv2 stubs and glink.
970 (Target_powerpc::Relocate::relocate): Replaces nop after call
971 with ld 2,24(1) and adjust local offset destination for ELFv2.
972
f9c6b907
AM
9732013-10-30 Alan Modra <amodra@gmail.com>
974
975 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
976 (Target_powerpc::Scan::global, local): Likewise.
977 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
978 on all ppc64 @h and @ha relocs.
979
e84fe78f
AM
9802013-10-14 Alan Modra <amodra@gmail.com>
981
982 * output.h (Output_data_got::add_constant): Tidy.
983 (Output_data_got::add_constant_pair): New function.
984 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
985 methods used so as to first call reserve_ent().
986
679e4abf
RM
9872013-10-11 Roland McGrath <mcgrathr@google.com>
988
44dcb735
RM
989 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
990 add_got_entry and add_got_entry_pair.
991
13323c49
RM
992 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
993 (HAVE_PUBNAMES): Likewise.
994 * configure: Regenerate.
995
1496b446
RM
996 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
997 * testsuite/Makefile.in: Regenerate.
998
cc84c10b
RM
999 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1000 Remove const from declaration.
1001 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1002 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1003 * output.h (Output_file_header): Remove const from member target_
1004 and corresponding constructor argument.
1005 * output.cc (Output_file_header::Output_file_header): Update prototype.
1006 (Output_file_header::do_sized_write): Use this->target_ in place
1007 of parameters()->target().
1008
52f66a2c
RM
1009 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1010
2b64b551
RM
1011 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1012 * configure: Regenerate.
1013 * Makefile.in: Regenerate.
1014 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1015 * testsuite/merge_string_literals_2.c: Likewise.
1016 * testsuite/Makefile.am
1017 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1018 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1019 literal -fmerge-constants.
1020 * testsuite/Makefile.in: Regenerate.
1021
43819297
RM
1022 * i386.cc (Target_i386): Remove unused member dynbss_.
1023 * arm.cc (Target_arm): Likewise.
1024 * powerpc.cc (Target_powerpc): Likewise.
1025 * sparc.cc (Target_sparc): Likewise.
1026 * tilegx.cc (Target_tilegx): Likewise.
1027 * x86_64.cc (Target_x86_64): Likewise.
1028 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1029 type_signature_, type_offset_.
1030 * plugin.h (Plugin_hook): Remove unused member layout_.
1031 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1032 mapfile_.
1033 (Read_member): Remove unused members input_objects_, symtab_,
1034 mapfile_, layout_.
1035 (Check_library): Remove unused member symtab_.
1036 * archive.h (Lib_group): Remove unused member lib_.
1037 * archive.cc (Lib_group::Lib_group): Update initializer.
1038 * incremental.h (Incremental_binary): Remove unused member target_.
1039 (Incremental_script_entry): Removed unused member script_.
1040 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1041 * icf.h (Icf): Remove unused member num_tracked_relocs.
1042
39d9ead7
RM
1043 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1044 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1045 its only use.
1046 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1047
679e4abf
RM
1048 * archive.h: Use struct rather than class for forward declaration
1049 of Read_symbols_data.
1050
54de2ea6
CC
10512013-10-07 Cary Coutant <ccoutant@google.com>
1052
1053 PR gold/16010
1054 * testsuite/Makefile.am (icf_test): Fix dependencies.
1055 (icf_safe_test): Likewise.
1056 (icf_safe_so_test): Likewise.
1057 (large_symbol_alignment): Add empty _LDADD rule.
1058 * testsuite/Makefile.in: Regenerate.
1059
b14016f0
L
10602013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1061
1062 PR gold/15927
1063 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1064 relocation for R_X86_64_32 on x32.
1065
eb426534
RM
10662013-08-27 Roland McGrath <mcgrathr@google.com>
1067
1068 * output.cc (Output_segment::set_section_addresses): Take new
1069 Target* argument. If target->isolate_execinstr() and the segment
1070 is executable and starts at a target->abi_pagesize() boundary,
1071 pad its end out to a target->abi_pagesize() boundary with code fill.
1072 * output.h (Output_segment::set_section_addresses): Update decl.
1073 * layout.h (Layout::check_output_data_for_reset_values): Take new
1074 argument RELAX_OUTPUTS.
1075 (Layout): New member relax_output_list_.
1076 (Layout::add_relax_output): New method.
1077 * layout.cc (Layout::Layout): Update constructor.
1078 (Layout::reset_relax_output): New method.
1079 (Layout::clean_up_after_relaxation): Call it.
1080 (Layout::prepare_for_relaxation): Update caller.
1081 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1082 Call reset_relax_output before re-processing segments for
1083 isolate_execinstr case.
1084 (Layout::write_data): Handle relax_output_list_.
1085 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1086 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1087
9aff4b7a
NC
10882013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1089
1090 PR binutils/15834
1091 * object.h: Fix typos.
1092
93f8221c
RM
10932013-08-16 Roland McGrath <mcgrathr@google.com>
1094
1095 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1096 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1097
e44c3715
CC
10982013-08-07 Cary Coutant <ccoutant@google.com>
1099
1100 Revert support for v2 DWP files:
1101
1102 2013-03-01 Cary Coutant <ccoutant@google.com>
1103
1104 Add dwp support for v2 DWARF package file format.
1105 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1106 tu_length parameter. Adjust all callers.
1107 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1108 * dwp.cc: Include dwarf.h.
1109 (Section_bounds): New struct type.
1110 (Unit_set): New struct type.
1111 (Dwo_file::Dwo_file): Initialize new data member.
1112 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1113 Combine and rename to...
1114 (Dwo_file::read_unit_index): ...this.
1115 (Dwo_file::sized_read_compunit_index)
1116 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1117 (Dwo_file::sized_read_unit_index): ...this.
1118 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1119 parameters; add section_id parameter.
1120 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1121 (Dwo_file::add_unit_set): ...this.
1122 (Dwo_file::shndx_map_): Remove.
1123 (Dwo_file::sect_offsets_): New data member.
1124 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1125 (Dwp_output_file::add_section): Rename to...
1126 (Dwp_output_file::add_contribution): ...this.
1127 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1128 (Dwp_output_file::add_tu_set): Likewise.
1129 (Dwp_output_file::Contribution): New type.
1130 (Dwp_output_file::Section::contributions): New data member.
1131 (Dwp_output_file::Cu_or_tu_set): Remove.
1132 (Dwp_output_file::Section::Section): New ctor.
1133 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1134 (Dwp_output_file::Dwp_index::Section_table): New type.
1135 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1136 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1137 parameter.
1138 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1139 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1140 (Dwp_output_file::Dwp_index::section_table): New member function.
1141 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1142 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1143 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1144 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1145 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1146 (Dwp_output_file::Dwp_index::section_table_): New data member.
1147 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1148 (Dwp_output_file::add_output_section): New member function.
1149 (Dwp_output_file::write_new_section): New member function.
1150 (Dwp_output_file::write_contributions): New member function.
1151 (Dwp_output_file::section_id_map_): New data member.
1152 (class Dwo_id_info_reader): Remove.
1153 (class Unit_reader): New class.
1154 (get_dwarf_section_name): New function.
1155 (Dwo_file::read_executable): Adjust initializations of class data.
1156 (Dwo_file::read): Add support for v2 package file format.
1157 (Dwo_file::read_unit_index): Likewise.
1158 (Dwo_file::sized_read_unit_index): Likewise.
1159 (Dwo_file::copy_section): Likewise.
1160 (Dwo_file::add_unit_set): Likewise.
1161 (Dwp_output_file::add_output_section): Likewise.
1162 (Dwp_output_file::add_contribution): Likewise.
1163 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1164 for empty slot.
1165 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1166 file format.
1167 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1168 slot.
1169 (Dwp_output_file::initialize): Remove unused function.
1170 (Dwp_output_file::finalize): Add support for v2 package file format.
1171 (Dwp_output_file::write_index): Likewise.
1172 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1173 function prototype.
1174
c6905c28
CC
11752013-07-31 Cary Coutant <ccoutant@google.com>
1176
1177 * object.cc (Sized_relobj::do_output_section_address): New function.
1178 (Sized_relobj): Instantiate explicitly.
1179 * object.h (Object::output_section_address): New function.
1180 (Object::do_output_section_address): New function.
1181 (Sized_relobj::do_output_section_address): New function.
1182 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1183
11842013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1185 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1186
1187 * parameters.cc (Parameters::entry): Return target-specific entry
1188 symbol name.
1189 * target.h (Target::entry_symbol_name): New function.
1190 (Target_info::entry_symbol_name): New data member.
1191
1192 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1193 * i386.cc (Target_i386::i386_info): Likewise.
1194 (Target_i386_nacl::i386_nacl_info): Likewise.
1195 * sparc.cc (Target_sparc::sparc_info): Likewise.
1196 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1197 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1198 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1199 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1200
234d4ab8
SA
12012013-07-22 Sterling Augustine <saugustine@google.com>
1202
1203 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1204 Convert parameter shndx to local variable. Add parameters symtab
1205 and symtab_size. Scan over section names. Find relocation
1206 section corresponding to current section. Create and initialize
1207 reloc_mapper_ and reloc_type_.
1208 (Dwarf_pubnames_table::read_header): Add assertion. Change
1209 unit_length to off_t. Initialize member unit_length_. Fill in field
1210 cu_offset_.
1211 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1212 Initialize new fields unit_length_ and cu_offset_.
1213 (Dwarf_pubnames_table::read_section): Update prototype.
1214 (Dwarf_pubnames_table::cu_offset): New member function.
1215 (Dwarf_pubnames_table::subsection_size): Likewise.
1216 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1217 New fields.
1218 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1219 member functions public.
1220 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1221 Update comment. Rework logic. Move repeated parts to...
1222 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1223 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1224 pubtypes_table_, and stmt_list_offset.
1225 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1226 Gdb_index::find_pubtype_offset,
1227 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1228 (Gdb_index::pubnames_read): Update prototype and rework logic.
1229 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1230 Forward declare.
1231 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1232 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1233 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1234 Gdb_index::map_pubtable_to_dies):
1235 Declare functions.
1236 (Gdb_index::pubnames_read): Update declaration.
1237 (Gdb_index::Pubname_offset_map): New type.
1238 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1239 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1240 Gdb_index::stmt_list_offset): Declare.
1241 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1242 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1243 Gdb_index::pubtypes_offset_): Remove.
1244
a3ed37d8
RM
12452013-07-19 Roland McGrath <mcgrathr@google.com>
1246
1247 * options.h (General_options): Add -Trodata-segment option.
1248 * parameters.cc (Parameters::check_rodata_segment): New function.
1249 (Parameters::set_target_once): Call it.
1250 * parameters.h (Parameters): Declare it (private member function).
1251 * layout.cc (load_seg_unusable_for_headers): New function, broken
1252 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1253 then validate rodata segment rather than text segment.
1254 (relaxation_loop_body): Call that.
1255 (is_text_segment): New function. Don't admit a non-executable
1256 segment if TARGET->isolate_execinstr().
1257 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1258
eb5b4ded
CC
12592013-07-15 Shawn Landden <shawnlandden@gmail.com>
1260
1261 PR gold/15070
1262 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1263 * nacl.h (Sniff_file::View::View): Request aligned view.
1264
4d5effb9
CC
12652013-07-11 Cary Coutant <ccoutant@google.com>
1266
1267 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1268 correct BRLT entry size.
1269
ba8ca3e7
AM
12702013-07-03 Alan Modra <amodra@gmail.com>
1271
1272 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1273 comment.
1274
267257d2
CC
12752013-07-01 Cary Coutant <ccoutant@google.com>
1276
1277 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1278 reloc_type_.
1279 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1280 (Dwarf_ranges_table::lookup_reloc): New function.
1281 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1282 reloc_type_.
1283 (Dwarf_ranges_table::lookup_reloc): New function.
1284 (Dwarf_ranges_table::reloc_type_): New data member.
1285
06f30c9d
CC
12862013-06-27 Jing Yu <jingyu@google.com>
1287
1288 PR gold/15662
1289 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1290 function.
1291 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1292 (Target_powerpc::do_relax): Call the above.
1293
a2d7bf59
AM
12942013-06-27 Cary Coutant <ccoutant@google.com>
1295
1296 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1297 on garbage collected .opd section.
1298
12992013-06-27 Alan Modra <amodra@gmail.com>
1300
1301 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1302 is non-zero.
1303 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1304 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1305
32364e50
CC
13062013-06-14 Cary Coutant <ccoutant@google.com>
1307
1308 * resolve.cc (Symbol::override_base): Don't override st_type
1309 from plugin placeholder symbols.
1310 (Symbol_table::resolve): Likewise.
1311 (Symbol_table::should_override): Don't complain about TLS mismatch
1312 if the TO symbol is a plugin placeholder.
1313 * testsuite/Makefile.am (plugin_test_tls): New test.
1314 * testsuite/Makefile.in: Regenerate.
1315 * testsuite/plugin_test_tls.sh: New test script.
1316 * testsuite/two_file_test_2_tls.cc: New test source.
1317 * testsuite/two_file_test_tls.cc: New test source.
1318
7fb47cc9
CC
13192013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1320
1321 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1322 the maximum segment alignment is larger than the page size.
1323 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1324 correctly aligns the symbols with large alignemnt.
1325 * testsuite/Makefile.in: Regenerate.
1326 * testsuite/large_symbol_alignment.cc: New file.
1327
6934001a
CC
13282013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1329 Sriraman Tallam <tmsriram@google.com>
1330
1331 * options.h (sort_section): New option.
1332 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1333 Rename from Input_section_sort_section_name_special_ordering_compare.
1334 (Input_section_sort_section_name_compare): New struct.
1335 * output.cc (Output_section::Input_section_sort_section_name_compare::
1336 operator()): New function.
1337 (Output_section::sort_attached_input_sections): Use new sort function
1338 for .text if --sort-section=name is specified.
1339 * layout.cc (Layout::make_output_section):
1340 Add sorting by name when --sort-section=name is specified.
1341 * testsuite/Makefile.am (text_section_grouping): Test option
1342 --sort-section=name.
1343 * testsuite/Makefile.in: Regenerate.
1344 * testsuite/section_sorting_name.cc: New file.
1345 * testsuite/section_sorting_name.sh: New file.
1346
93acabad
CC
13472013-05-21 Cary Coutant <ccoutant@google.com>
1348
1349 * symtab.h (Symbol::is_cxx_vtable): New function.
1350 * target-reloc.h (relocate_section): Check for vtable symbol.
1351 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1352 * testsuite/Makefile.in: Regenerate.
1353 * testsuite/missing_key_func.cc: New test source.
1354 * testsuite/missing_key_func.sh: New test script.
1355
60e8b3fc
CC
13562013-05-21 Cary Coutant <ccoutant@google.com>
1357
2b64b551
RM
1358 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1359 type of enclosing symbol.
1360 (Relocate_info::location): Check symbol type when describing symbol.
1361 * object.h (Symbol_location_info): Remove unused line_number;
1362 add enclosing_symbol_type.
1363 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1364
9df9de2c
CC
13652013-05-13 Cary Coutant <ccoutant@google.com>
1366
2b64b551
RM
1367 * configure.ac: Export DEFAULT_TARGET.
1368 * configure: Regenerate.
1369 * Makefile.in: Regenerate.
1370 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1371 * testsuite/Makefile.in: Regenerate.
1372 * testsuite/debug_msg.sh: Delete duplicate tests.
1373 Don't check undef_int error message match for powerpc where the
1374 source file and line number aren't available.
9df9de2c 1375
bbc5ae17
RM
13762013-05-10 Roland McGrath <mcgrathr@google.com>
1377
1378 * options.h (General_options): Add --rosegment-gap option.
1379 * options.cc (finalize): --rosegment-gap implies --rosegment.
1380 * layout.cc (set_segment_offsets): Let user option override
1381 target->rosegment_gap().
1382
0c6e6c39
RM
13832013-05-10 Roland McGrath <mcgrathr@google.com>
1384
1385 * options.h (General_options): Remove leading space from help
1386 messages for -nostdlib and --rosegment.
1387
cde7cb01
MR
13882013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1389
1390 PR ld/15365
1391 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1392
f31ae5b8
AM
13932013-05-03 Alan Modra <amodra@gmail.com>
1394
1395 * merge.cc (Output_merge_string::do_add_input_section): Correct
1396 scan for number of strings. Rename vars to avoid shadowing.
1397 Include missing terminator in input_size_.
1398
d3a7cd45
L
13992013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1400
1401 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1402 Restore empty string handling.
1403
6ad3daba
CC
14042013-05-01 Cary Coutant <ccoutant@google.com>
1405
1406 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1407 uninitialized warning.
1408
e31908b6
CC
14092013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1410
1411 * output.cc (Output_section::add_merge_input_section): Allow
1412 to merge sections if the alignment is more than character size.
1413 * merge.h (Output_merge_string::Output_merge_string): Remove
1414 assert.
1415 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1416 only not-null strings. Check the alignment of strings.
1417 * stringpool.h
1418 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1419 alignment as the argument.
1420 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1421 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1422 Align non-zero length strings according to the addralign_.
1423 (Stringpool_template<Stringpool_char>::set_string_offsets):
1424 Updating offsets according to the given alignment.
1425 * testsuite/Makefile.am (text_section_grouping): Test if string
1426 literals are getting merged.
1427 * testsuite/Makefile.in: Regenerate.
1428 * testsuite/merge_string_literals_1.c: New file.
1429 * testsuite/merge_string_literals_2.c: Ditto.
1430 * testsuite/merge_string_literals.sh: Ditto.
1431
0e804863
ILT
14322013-04-26 Ian Lance Taylor <iant@google.com>
1433
1434 * target-reloc.h (relocate_section): If the reloc offset is out of
1435 range, pass VIEW as NULL to relocate.relocate.
1436 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1437 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1438 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1439 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1440 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1441 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1442
e7c5ea40
CC
14432013-04-26 Geoff Pike <gpike@chromium.org>
1444
1445 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1446 * layout.cc (Hash_task): New class.
1447 (Layout::queue_build_id_tasks): New function.
1448 (Layout::write_build_id): Handle single-thread portion of build ID
1449 computation. (In some cases, all of it is single-threaded.) Replace
1450 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1451 functionality in fewer lines of code.
1452 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1453 * options.h (General_options): make "--build-id" default to tree
1454 rather than sha1. Add two new options related to --build-id=tree:
1455 --build-id-chunk-size-for-treehash and
1456 --build-id-min-file-size-for-treehash.
1457 * Makefile.am: add testing of --build-id=tree and related new options
1458 (these tests will be invoked by "make check").
1459 * Makefile.in: Regenerate.
1460
49926cd0
AM
14612013-04-25 Alan Modra <amodra@gmail.com>
1462
1463 * configure.tgt: Add powerpcle and powerpc64le.
1464
a4034750
AM
14652013-04-22 Alan Modra <amodra@gmail.com>
1466
1467 PR gold/15355
1468 * layout.cc (Layout::segment_precedes): Allow more than one
1469 segment with the same type and flags.
1470
e79c84aa
CC
14712013-04-15 Cary Coutant <ccoutant@google.com>
1472
1473 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1474 allocate space in file for BSS sections.
1475
2199fbe7
CC
14762013-04-15 Cary Coutant <ccoutant@google.com>
1477
1478 * script-sections.cc (Orphan_output_section): Reset address
1479 to zero after each orphaned section for relocatable links.
1480
502e8a84
CC
14812013-04-15 Cary Coutant <ccoutant@google.com>
1482
a4034750
AM
1483 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1484 section starting address for relocatable link.
1485 * testsuite/Makefile.am (script_test_11): New test.
1486 * testsuite/Makefile.in: Regenerate.
1487 * testsuite/script_test_11.c: New source file.
1488 * testsuite/script_test_11.t: New linker script.
502e8a84 1489
0cfdc767
AM
14902013-04-13 Alan Modra <amodra@gmail.com>
1491
1492 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1493 owner when sections are not adjacent and exceed group size.
1494 (Target_powerpc::group_sections): Handle corner case.
1495 (Target_powerpc::Branch_info::make_stub): Handle case where
1496 stub table doesn't exist due to branches in non-exec sections.
1497 (Target_powerpc::Relocate::relocate): Likewise.
1498
6830ee24
AM
14992013-04-11 Alan Modra <amodra@gmail.com>
1500
1501 PR gold/15354
1502 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1503 .branch_lt to match bfd ld. Adjust comments throughout file.
1504
54a3d865
ILT
15052013-04-04 Ian Lance Taylor <iant@google.com>
1506
1507 GCC PR c++/56840
1508 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1509 sections before checking whether they are included in the link.
1510
9993ba11
ST
15112013-03-29 Sriraman Tallam <tmsriram@google.com>
1512
1513 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1514 object before calling the plugin claim_file handler. Pass the elf
1515 object of the archive to the plugin. Delete the elf object if the
1516 plugin claims the file.
1517
ebacd51e
AM
15182013-03-21 Alan Modra <amodra@gmail.com>
1519
1520 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1521 segment when omagic.
1522
117be58f
AM
15232013-03-21 Alan Modra <amodra@gmail.com>
1524
1525 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1526 comparison warning.
1527 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1528 uninitialized" warning.
1529
32e2b61d
AM
15302013-03-20 Alan Modra <amodra@gmail.com>
1531
1532 * symtab.h (Symbol::clear_version): New function.
1533 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1534 is_needed by weak references. Clear version for symbols defined
1535 in as-needed objects that are not needed.
1536
b3ccdeb5
AM
15372013-03-15 Alan Modra <amodra@gmail.com>
1538
1539 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1540 static and public. Add report_err param. Return false for data refs.
1541 (Target_powerpc::rela_dyn_section): New overloaded function.
1542 (Target_powerpc::plt_, iplt_): Elucidate.
1543 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1544 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1545 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1546 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1547 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1548 push_branch and make_plt_entry for ifunc syms when
1549 reloc_needs_plt_for_ifunc.
1550 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1551 for ifunc unless reloc_needs_plt_for_ifunc.
1552
ad3d8a2f
AM
15532013-03-15 Alan Modra <amodra@gmail.com>
1554
1555 * gc.h (gc_process_relocs): Don't look through function descriptors.
1556 * icf.cc (get_section_contents): Do so here instead.
1557
4d9aa155
AM
15582013-03-13 Alan Modra <amodra@gmail.com>
1559
1560 * powerpc.cc (is_branch_reloc): Forward declare.
1561 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1562 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1563 false for 64-bit, true for 32-bit non-branch relocs.
1564 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1565 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1566 nm output.
1567 (icf_safe_test): Generate linker map file as well as nm output.
1568 (icf_safe_so_test): Likewise.
1569 * testsuite/Makefile.in: Regenerate.
1570 * testsuite/icf_test.sh: Parse linker map file to determine
1571 section folding.
1572 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1573 * testsuite/icf_safe_so_test.sh: Likewise.
1574 (X86_32_or_ARM_specific_safe_fold): Merge into..
1575 (arch_specific_safe_fold): ..this.
1576 (X86_64_specific_safe_fold): Delete unused function.
1577
57420c20
AM
15782013-03-12 Alan Modra <amodra@gmail.com>
1579
1580 * gc.h (gc_process_relocs): Look through function descriptors
1581 to determine shndx, symvalue and addend used by ICF. Tidy
1582 variable duplication.
1583
dc3714f3
AM
15842013-03-11 Alan Modra <amodra@gmail.com>
1585
1586 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1587 * layout.cc (Layout_task_runner::run): ..to here.
1588 * symtab.h (struct Symbol_location): Extract from..
1589 (class Symbol_table): ..here.
1590 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1591 * target.h (class Target): Add function_location and
1592 do_function_location functions.
1593 (class Sized_target): Add do_function_location.
1594 * object.h (class Sized_relobj_file): Move find_shdr..
1595 (class Object): ..to here.
1596 * object.cc: Likewise. Update to suit. Instantiate.
1597 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1598 * powerpc.cc (class Powerpc_dynobj): New.
1599 (Target_powerpc::do_function_location): New function.
1600 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1601 (Powerpc_dynobj::do_read_symbols): New function.
1602 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1603
956b03bb
ILT
16042013-03-08 Ian Lance Taylor <iant@google.com>
1605
1606 * options.cc (General_options::string_to_object_format): Accept
1607 "default".
1608
4bead2d5
AM
16092013-03-08 Alan Modra <amodra@gmail.com>
1610
1611 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1612 pointer to Post_fde.
1613 (struct Post_fde): Move definition to here..
1614 * ehframe.cc (struct Post_fde): ..from here.
1615 (Cie::write): Don't alloc Post_fde.
1616 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1617
02e60bf7
AM
16182013-03-07 Alan Modra <amodra@gmail.com>
1619
1620 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1621 relocation referencing .LC0.
1622 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1623
8343f03a
AM
16242013-03-07 Alan Modra <amodra@gmail.com>
1625
1626 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1627 always_inline. Add assembly for powerpc to avoid GOT.
1628
3366d57c
AM
16292013-03-07 Alan Modra <amodra@gmail.com>
1630
1631 * testsuite/script_test_10.sh: Don't test .bss section
1632 header number.
1633
6c77229c
AM
16342013-03-06 Alan Modra <amodra@gmail.com>
1635
1636 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1637 (Target_powerpc::symval_for_branch): Add symtab param. Update
1638 all callers. Handle folded sections.
1639 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1640 to Powerpc_relobj.
1641 (Global_symbol_visitor_opd::operator()): Likewise.
1642
a39e4af6
AM
16432013-03-04 Alan Modra <amodra@gmail.com>
1644
1645 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1646 * testsuite/Makefile.in: Regenerate.
1647
d5834edb
CC
16482013-03-01 Cary Coutant <ccoutant@google.com>
1649
1650 Add dwp support for v2 DWARF package file format.
1651 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1652 tu_length parameter. Adjust all callers.
1653 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1654 * dwp.cc: Include dwarf.h.
1655 (Section_bounds): New struct type.
1656 (Unit_set): New struct type.
1657 (Dwo_file::Dwo_file): Initialize new data member.
1658 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1659 Combine and rename to...
1660 (Dwo_file::read_unit_index): ...this.
1661 (Dwo_file::sized_read_compunit_index)
1662 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1663 (Dwo_file::sized_read_unit_index): ...this.
1664 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1665 parameters; add section_id parameter.
1666 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1667 (Dwo_file::add_unit_set): ...this.
1668 (Dwo_file::shndx_map_): Remove.
1669 (Dwo_file::sect_offsets_): New data member.
1670 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1671 (Dwp_output_file::add_section): Rename to...
1672 (Dwp_output_file::add_contribution): ...this.
1673 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1674 (Dwp_output_file::add_tu_set): Likewise.
1675 (Dwp_output_file::Contribution): New type.
1676 (Dwp_output_file::Section::contributions): New data member.
1677 (Dwp_output_file::Cu_or_tu_set): Remove.
1678 (Dwp_output_file::Section::Section): New ctor.
1679 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1680 (Dwp_output_file::Dwp_index::Section_table): New type.
1681 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1682 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1683 parameter.
1684 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1685 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1686 (Dwp_output_file::Dwp_index::section_table): New member function.
1687 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1688 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1689 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1690 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1691 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1692 (Dwp_output_file::Dwp_index::section_table_): New data member.
1693 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1694 (Dwp_output_file::add_output_section): New member function.
1695 (Dwp_output_file::write_new_section): New member function.
1696 (Dwp_output_file::write_contributions): New member function.
1697 (Dwp_output_file::section_id_map_): New data member.
1698 (class Dwo_id_info_reader): Remove.
1699 (class Unit_reader): New class.
1700 (get_dwarf_section_name): New function.
1701 (Dwo_file::read_executable): Adjust initializations of class data.
1702 (Dwo_file::read): Add support for v2 package file format.
1703 (Dwo_file::read_unit_index): Likewise.
1704 (Dwo_file::sized_read_unit_index): Likewise.
1705 (Dwo_file::copy_section): Likewise.
1706 (Dwo_file::add_unit_set): Likewise.
1707 (Dwp_output_file::add_output_section): Likewise.
1708 (Dwp_output_file::add_contribution): Likewise.
1709 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1710 for empty slot.
1711 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1712 file format.
1713 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1714 slot.
1715 (Dwp_output_file::initialize): Remove unused function.
1716 (Dwp_output_file::finalize): Add support for v2 package file format.
1717 (Dwp_output_file::write_index): Likewise.
1718 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1719 function prototype.
1720
a68a081d
CC
17212013-03-01 Cary Coutant <ccoutant@google.com>
1722
1723 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1724 function into class definition in header file.
1725 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1726 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1727 New function.
1728 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1729
9d5781f8
AM
17302013-02-28 Alan Modra <amodra@gmail.com>
1731
1732 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1733 * target.cc (Target::do_plt_fde_location): New function.
1734 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1735 accessor function, and constructor param.
1736 (struct Post_fde, Post_fdes): Declare.
1737 (Cie::write): Add post_fdes param.
1738 * ehframe.cc (Fde::write): Use plt_fde_location.
1739 (struct Post_fde): Define.
1740 (Cie::write): Stash FDEs added post merge mapping.
1741 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1742 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1743 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1744 other FDEs.
1745 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1746 (Target_powerpc::has_glink): New function.
1747 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1748 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1749 glink_eh_frame_fde_32, default_fde): New data.
1750 (Stub_table::eh_frame_added_): New var.
1751 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1752 Make const.
1753 (Stub_table::add_eh_frame): New function.
1754 (Output_data_glink::add_eh_frame): New function.
1755 (Target_powerpc::make_glink_section): Call add_eh_frame.
1756
214383dd
ILT
17572013-02-15 Ian Lance Taylor <iant@google.com>
1758
1759 * options.h (DEFINE_uint64_alias): Define.
1760 (class General_options): Add -Ttext-segment as an alias for
1761 -Ttext.
1762
91c2b899
AM
17632013-02-15 Alan Modra <amodra@gmail.com>
1764
1765 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1766 (Stub_table::do_write): ..here, two places.
1767 (Stub_table::plt_call_size): Use it here too.
1768
20e2a8aa
ILT
17692013-02-11 Ian Lance Taylor <iant@google.com>
1770
1771 * descriptors.cc (Descriptors::close_all): New function.
1772 * descriptors.h (class Descriptors): Declare close_all.
1773 (close_all_descriptors): New inline function.
1774 * plugin.cc: Include "descriptors.h".
1775 (Plugin_manager::cleanup): Call close_all_descriptors.
1776
8952bc69
AM
17772013-02-06 Alan Modra <amodra@gmail.com>
1778
1779 * README: Update coding style link.
1780
29bd8b6b
CC
17812013-01-28 Cary Coutant <ccoutant@google.com>
1782
a4034750
AM
1783 * dwp.cc (File_list): New typedef.
1784 (Dwo_name_info_reader): New class.
1785 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1786 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1787 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1788 (Dwo_file::read_executable): New function.
1789 (Dwo_file::read): Move common setup code to ...
1790 (Dwo_file::make_object): ... here.
1791 (dwp_options): Add --exec/-e.
1792 (usage): Likewise.
1793 (main): Likewise.
29bd8b6b 1794
c6ac678d
ST
17952013-01-24 Sriraman Tallam <tmsriram@google.com>
1796
1797 * layout.cc (Layout::layout): Check for option text_reorder.
1798 (Layout::make_output_section): Ditto.
1799 * options.h (text_reorder): New option.
1800 * output.cc (Input_section_sort_compare): Remove special ordering
1801 of section names.
1802 (Output_section::
1803 Input_section_sort_section_name_special_ordering_compare::
1804 operator()): New function.
1805 (Output_section::sort_attached_input_sections): Use new sort function
1806 for .text.
1807 * output.h (Input_section_sort_section_name_special_ordering_compare):
1808 New struct.
1809 * testsuite/Makefile.am (text_section_grouping): Test option
1810 --no-text-reorder
1811 * testsuite/Makefile.in: Regenerate.
1812 * testsuite/text_section_grouping.sh: Check order of functions without
1813 default text reordering.
1814
50701cc1
MF
18152013-01-18 Mike Frysinger <vapier@gentoo.org>
1816
1817 * options.h (General_options): Change default to true for new_dtags.
1818
b1b00fcc
MF
18192013-01-18 Mike Frysinger <vapier@gentoo.org>
1820
1821 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1822 when enable_new_dtags is false. Only add DT_RUNPATH when
1823 enable_new_dtags is true.
1824
ec5b8187
AM
18252013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1826
1827 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1828 used in declaration and definition consistent.
1829 (Target_powerpc::symval_for_branch): Ditto.
1830
a880d4c4
ST
18312013-01-16 Sriraman Tallam <tmsriram@google.com>
1832
1833 * testsuite/plugin_final_layout.cc: Fix comment.
1834
7c381248
ST
18352013-01-16 Sriraman Tallam <tmsriram@google.com>
1836
1837 * layout.cc (Layout::layout): Do not do default sorting for
1838 text sections when section ordering is specified.
1839 (make_output_section): Ditto.
1840 * testsuite/plugin_final_layout.cc: Name the function sections
1841 to catch reordering issues.
1842
e2458743
AM
18432013-01-15 Alan Modra <amodra@gmail.com>
1844
1845 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1846 plt-thread-safe.
1847
431ed302
AM
18482013-01-15 Alan Modra <amodra@gmail.com>
1849
1850 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1851 * testsuite/Makefile.in: Regenerate.
1852
0ec6429b
AM
18532013-01-14 Alan Modra <amodra@gmail.com>
1854
1855 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1856 * testsuite/Makefile.in: Regenerate.
1857
0bf402d5
ILT
18582013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1859
36af3926 1860 PR bfd/14430
0bf402d5
ILT
1861 Fix mingw gold build with plugins enabled
1862 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1863 * configure.ac: Export DLOPEN_LIBS and add headers check.
1864 * plugin.cc: Handle non-dlfcn case.
1865 * Makefile.in: Regenerate.
1866 * config.in: Regenerate.
1867 * configure: Regenerate.
1868 * testsuite/Makefile.in: Regenerate.
1869
9e9143bc
ST
18702013-01-09 Sriraman Tallam <tmsriram@google.com>
1871
1872 * output.h (sort_attached_input_sections): Change to be public.
1873 * script-sections.cc
1874 (Output_section_definition::set_section_addresses): Sort
1875 attached input sections according to section order before linker
1876 script assigns section addresses.
1877 (Orphan_output_section::set_section_addresses): Sort
1878 attached input sections according to section order before linker
1879 script assigns section addresses.
1880 * Makefile.am (final_layout.sh): Use a simple linker script to
1881 check if section ordering still works.
1882 * Makefile.in: Regenerate.
1883
679af368
ILT
18842013-01-09 Ben Cheng <bccheng@google.com>
1885
1886 * arm.cc (Target_arm::attributes_accept_div): New function.
1887 (Target_arm::attributes_forbid_div): New function.
1888 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
1889 attribute using the same new functions as what bfd/elf32_arm.c
1890 does.
1891
3136a00e
CC
18922013-01-07 Cary Coutant <ccoutant@google.com>
1893
1894 PR gold/14993
1895 * output.cc (Output_section::add_input_section): For incremental
1896 updates, don't track input sections that are allocated from patch
1897 space.
1898
f2a6224b
L
18992013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1900 Ian Lance Taylor <iant@google.com>
1901
1902 PR gold/14897
1903 * configure.ac (--enable-ld): Removed.
1904 (install_as_default): Set to yes only for --enable-gold=default
1905 or --disable-ld.
1906 * configure: Regenerated.
1907
4f46f626
L
19082013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1909
1910 * options.h (General_options): Add -fuse-ld= for GCC linker
1911 option compatibility.
1912
26e4ef59
CC
19132013-01-04 Cary Coutant <ccoutant@google.com>
1914
1915 * configure.ac: Fix typo restoring CXXFLAGS.
1916 * configure: Regenerate.
1917
3d587466
CC
19182013-01-04 Cary Coutant <ccoutant@google.com>
1919
4f46f626
L
1920 * testsuite/Makefile.am (CXXLINK_S): New macro.
1921 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
1922 * testsuite/Makefile.in: Regenerate.
3d587466 1923
44db6695
L
19242013-01-02 H.J. Lu <hongjiu.lu@intel.com>
1925
1926 * version.cc (print_version): Update copyright year to 2013.
1927
edcac0c1
ILT
19282012-12-20 Ian Lance Taylor <iant@google.com>
1929
1930 * layout.cc (Layout::special_ordering_of_input_section): New
1931 function.
1932 (Layout::layout): If input section requires special ordering, must
1933 sort input sections.
1934 (Layout::make_output_section): May sort .text input sections.
1935 (Layout::is_section_name_prefix_grouped): Remove.
1936 * layout.h (class Layout): Declare
1937 special_ordering_of_input_section. Don't declare
1938 is_section_name_prefix_grouped.
1939 * output.cc (Output_section::add_input_section): Revert last
1940 change.
1941 (Output_section::Input_section_sort::match_file_name): Don't crash
1942 if called on output section data.
1943 (Output_section::Input_section_sort_compare): Sort based on
1944 special ordering.
1945 (Output_section::Input_section_sort_section_order_index_compare):
1946 Revert last patch.
1947 (Output_section::sort_attached_input_sections): Likewise.
1948
28f2a4ac
ST
19492012-12-18 Sriraman Tallam <tmsriram@google.com>
1950
edcac0c1 1951 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
1952 * layout.h (Layout::is_section_name_prefix_grouped): New function.
1953 * output.cc (Output_section::add_input_section): Check if section
1954 name contains special prefix. Keep input sections to sort such
1955 sections.
1956 (Output_section::Input_section_sort_section_order_index_compare
1957 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
1958 (Output_section::sort_attached_input_sections): Add condition to
1959 Input_section_entry constructor call.
28f2a4ac
ST
1960 * testsuite/Makefile.am (text_section_grouping): New test.
1961 * testsuite/Makefile.in: Regenerate.
1962 * testsuite/text_section_grouping.cc: New file.
1963 * testsuite/text_section_grouping.sh: New file.
1964
5bf135a7
NC
19652012-12-17 Nick Clifton <nickc@redhat.com>
1966
1967 * Makefile.am: Add copyright notice.
1968 * NEWS: Likewise.
1969 * README: Likewise.
1970 * configure.ac: Likewise.
1971 * ftruncate.c: Likewise.
1972 * Makefile.in: Regenerate.
1973
59965708
CC
19742012-12-14 Cary Coutant <ccoutant@google.com>
1975
a4034750
AM
1976 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
1977 --no-as-needed flag.
1978 (exception_separate_shared_12_test): Likewise.
1979 (incremental_copy_test): Likewise.
1980 * testsuite/Makefile.in: Regenerate.
59965708 1981
2a77e2ab
CC
19822012-12-14 Cary Coutant <ccoutant@google.com>
1983
1984 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
1985 (Dwp_output_file::Dwp_index::enter_set): Add assert.
1986
e3deeb9c
AM
19872012-12-12 Alan Modra <amodra@gmail.com>
1988
1989 * powerpc.cc (class Track_tls): New.
1990 (class Relocate, class Scan): Inherit Track_tls.
1991 (Target_powerpc::Scan::local, global): Track tls optimization
1992 and avoid creating plt entry for __tls_get_addr if all uses
1993 are optimized away.
1994 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
1995
d8f5a274
AM
19962012-12-12 Alan Modra <amodra@gmail.com>
1997
1998 * options.h (General_options): Add --toc-sort/--no-toc-sort.
1999 Replace no_toc_optimize with toc_optimize.
2000 * output.h (Output_section::input_sections): Provide non-const variant.
2001 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2002 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2003 accessors.
2004 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2005 (class Sort_toc_sections): New.
2006 (Target_powerpc::do_finalize_sections): Sort toc sections.
2007 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2008
4c8a1de1
RM
20092012-12-10 Roland McGrath <mcgrathr@google.com>
2010
2011 * testsuite/binary_unittest.cc (read_all): New function.
2012 (Sized_binary_test): Use it instead of ::read.
2013 * fileread.cc (do_read): Don't assume pread always reads the whole
2014 amount in a single call.
2015
edc27beb
AM
20162012-12-10 Alan Modra <amodra@gmail.com>
2017
2018 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2019 Set EM_PPC64 or EM_PPC here.
2020 (Target_selector_powerpc::do_recognize): Delete.
2021
906b9150
AM
20222012-12-10 Alan Modra <amodra@gmail.com>
2023
2024 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2025 stub_table_.
2026 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2027
418c15ae
RM
20282012-12-07 Roland McGrath <mcgrathr@google.com>
2029
2030 * testsuite/binary_unittest.cc (Sized_binary_test):
2031 Use open_descriptor rather than ::open.
2032
decdd3bc
AM
20332012-12-07 Alan Modra <amodra@gmail.com>
2034
2035 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2036 typedef and invalid_address constant.
2037 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2038 instantiate constants.
2039
db399005
ILT
20402012-12-06 Roland McGrath <mcgrathr@google.com>
2041
2042 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2043 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2044 * aclocal.m4: Regenerate.
2045 * configure: Regenerate.
2046 * Makefile.in: Regenerate.
2047 * testsuite/Makefile.in: Regenerate.
2048
aba6bc71
AM
20492012-12-07 Alan Modra <amodra@gmail.com>
2050
2051 * options.h (General_options): Add no_toc_optimize.
2052 * powerpc.cc (ok_lo_toc_insn): New function.
2053 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2054
9e69ed50
AM
20552012-12-06 Alan Modra <amodra@gmail.com>
2056
2057 * options.h (General_options): Add plt_align, plt_static_chain,
2058 plt_thread_safe. Update stub_group_size help text.
2059 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2060 for new plt_thread_safe_ var.
2061 (use_plt_offset): Correct comments.
2062 (Target_powerpc::do_relax): Look for thread creation symbols to
2063 determine default plt_thread_safe value. Clear plt call stubs
2064 as well as branch stubs each iteration.
2065 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2066 insn constants.
2067 (l, hi, ha, write_insn): Move earlier.
2068 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2069 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2070 plt stubs too.
2071 (Stub_table::update_size): Adjust.
2072 (Stub_table::prev_size, set_prev_size): Delete.
2073 (Stub_table::stub_align): Let --plt-align affect result.
2074 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2075 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2076 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2077 (Stub_table::do_write): Support more stub variants.
2078
f43ba157
AM
20792012-12-04 Alan Modra <amodra@gmail.com>
2080
2081 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2082 (Target_powerpc::do_define_standard_symbols): New function.
2083
34171bc5
AM
20842012-12-03 Alan Modra <amodra@gmail.com>
2085
2086 * output.h: Formatting, whitespace.
2087
dc9589e9 20882012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2089
2090 * layout.h (Layout::get_executable_sections): Declare.
2091 * layout.cc (Layout::get_executable_sections): New function.
2092 * arm.cc (Target_arm::group_sections): Use it.
2093 (Arm_output_section::group_sections): Delete now redundant test.
2094 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2095 param to handle relative relocs.
2096 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2097 (Output_data_reloc::add_absolute): Adjust.
2098 (Output_data_reloc::add_relative): New function.
2099 (Output_data::reset_data_size): New function.
2100 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2101 (Output_section::set_addralign): New function.
2102 (Output_section::checkpoint_set_addralign): New function.
2103 (Output_section::clear_section_offsets_need_adjustment): New function.
2104 (Output_section::input_sections): Make public.
2105 * powerpc.cc (class Output_data_brlt_powerpc): New.
2106 (class Stub_table, class Stub_control): New.
2107 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2108 stub_table_, set_stub_table, stub_table): New vectors and accessor
2109 functions.
2110 (Target_powerpc::do_may_relax, do_relax, push_branch,
2111 new_stub_table, stub_tables, brlt_section, group_sections,
2112 add_branch_lookup_table, find_branch_lookup_table,
2113 write_branch_lookup_table, make_brlt_section): New functions.
2114 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2115 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2116 branch_info_): New vars.
2117 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2118 make call stubs here.
2119 (Output_data_glink): Remove all call stub handling from this class.
2120 (Target_powerpc::Scan::local, global): Save interesting branch
2121 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2122 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2123 functions on final link.
2124 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2125 Handle long branch destinations too.
2126 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2127 do_plt_address_for_local): Adjust lookup of plt call stubs.
2128
627b30b7
AM
21292012-11-30 Alan Modra <amodra@gmail.com>
2130
2131 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2132 relocs against protected symbols when building 32-bit shared libs.
2133
40b469d7
AM
21342012-11-30 Alan Modra <amodra@gmail.com>
2135
2136 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2137 param. Call got_section() to make .got. Update all callers
2138 and their callers and so on.
2139
bb66a627
AM
21402012-11-30 Alan Modra <amodra@gmail.com>
2141
2142 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2143 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2144 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2145 value if it already exists.
2146
d2cf1c6c
L
21472012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2148
2149 PR gold/14858
2150 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2151
edccdf7c
RM
21522012-11-14 Roland McGrath <mcgrathr@google.com>
2153
2154 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2155 than bfc instruction for data sandboxing.
2156
6febeb74
AM
21572012-11-08 Alan Modra <amodra@gmail.com>
2158
2159 * po/POTFILES.in: Regenerate.
2160
0a6f1bf2
AM
21612012-11-05 Alan Modra <amodra@gmail.com>
2162
2163 * configure.ac: Apply 2012-09-10 change to config.in here.
2164 * configure: Regenerate.
2165
26a4e9cb
AM
21662012-11-05 Alan Modra <amodra@gmail.com>
2167
2168 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2169 (struct Opd_ent): Use "Address" rather than "Offset".
2170 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2171 (Target_powerpc::got_section): Make public.
2172 (Target_powerpc::scan_relocs): Move code setting symbols..
2173 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2174 Create _SDA_BASE_ only when referenced.
2175
cc928013
RM
21762012-11-02 Roland McGrath <mcgrathr@google.com>
2177
2178 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2179 from last change.
2180
50ed5eb1
RM
21812012-11-01 Roland McGrath <mcgrathr@google.com>
2182
62fe925a
RM
2183 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2184 for offset_in_output_section parameter.
2185 (Sized_target::relocate_special_relocatable): Likewise.
2186 * arm.cc (Target_arm::relocate_relocs): Likewise.
2187 (Target_arm::relocate_special_relocatable): Likewise.
2188 * i386.cc (Target_i386::relocate_relocs): Likewise.
2189 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2190 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2191 * target-reloc.h (relocate_relocs): Likewise.
2192 * testsuite/testfile.cc (Target_test): Likewise.
2193 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2194 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2195
2196 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2197 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2198
2199 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2200 parameter, which is unused in the [!F_SETFD] case.
2201
50ed5eb1
RM
2202 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2203 SYMNDX to off_t before comparing it to this->data_size().
2204 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2205 * incremental.cc (Output_section_incremental_inputs::do_write):
2206 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2207
2cadc0bf
RM
2208 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2209
3bfcb652
NC
22102012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2211
2212 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2213 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2214 in EABI_VER5.
2215
c1a8d56e
CC
22162012-10-29 Cary Coutant <ccoutant@google.com>
2217
2218 * dwp.cc (usage): Add file and exit status parameters;
2219 add --help and --version options.
2220 (print_version): New function.
2221 (main): Add --help and --version options.
2222
b2490a7b
L
22232012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2224
2225 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2226 final_layout_sequence.txt.
2227 * testsuite/Makefile.in: Regenerated.
2228
aa543512
L
22292012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2230
2231 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2232 COMPILE generated by automake.
2233 (LINK1): Likewise.
2234 (CXXCOMPILE1): Likewise.
2235 (CXXLINK1): Likewise.
2236 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2237 (LINK): Likewise.
2238 (CXXCOMPILE): Likewise.
2239 (CXXLINK): Likewise.
2240 * testsuite/Makefile.in: Regenerated.
2241
d361fafb
L
22422012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2243
2244 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2245 on bad fwrite return.
2246
598c7410
L
22472012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2248
2249 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2250 on val.
2251
35c813e2
CC
22522012-10-23 Cary Coutant <ccoutant@google.com>
2253
2254 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2255 * testsuite/Makefile.in: Regenerate.
2256 * testsuite/dwp_test.h: New source file.
2257 * testsuite/dwp_test_1.cc: New source file.
2258 * testsuite/dwp_test_1.s: New source file.
2259 * testsuite/dwp_test_1.sh: New source file.
2260 * testsuite/dwp_test_1b.cc: New source file.
2261 * testsuite/dwp_test_1b.s: New source file.
2262 * testsuite/dwp_test_2.cc: New source file.
2263 * testsuite/dwp_test_2.s: New source file.
2264 * testsuite/dwp_test_2.sh: New source file.
2265 * testsuite/dwp_test_main.cc: New source file.
2266 * testsuite/dwp_test_main.s: New source file.
2267
77429909
CC
22682012-10-23 Cary Coutant <ccoutant@google.com>
2269
2270 * dwp.h: New header file.
2271 * dwp.cc: New source file.
2272 * gold.h: Move shared declarations to system.h.
2273 * system.h: New header file.
2274 * Makefile.am: Add dwp.
2275 * Makefile.in: Regenerate.
2276
ed5d6712
CC
22772012-10-23 Cary Coutant <ccoutant@google.com>
2278
2279 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2280 Dwarf_info_reader::read_from_pointer.
2281 (Dwarf_pubnames_table::read_header): Likewise.
2282 (Dwarf_pubnames_table::next_name): Likewise.
2283 (Dwarf_die::read_attributes): Likewise.
2284 (Dwarf_die::skip_attributes): Likewise.
2285 (Dwarf_info_reader::read_from_pointer): New function template.
2286 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2287 (Dwarf_pubnames_table): Likewise.
2288 (Dwarf_info_reader::read_from_pointer): New function template.
2289 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2290 Dwarf_pubnames_table ctor.
2291
8787852d
CC
22922012-10-23 Cary Coutant <ccoutant@google.com>
2293
2294 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2295 abbrev_shndx.
2296 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2297 abbrev_shndx_.
2298 (Dwarf_info_reader::set_abbrev_shndx): New method.
2299 (Dwarf_info_reader::abbrev_shndx_): New data member.
2300
9fc236f3
CC
23012012-10-23 Cary Coutant <ccoutant@google.com>
2302
2303 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2304 from object, not parameters.
2305 (Dwarf_info_reader::parse): Likewise.
2306 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2307 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2308 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2309 methods.
2310
effe8365
CC
23112012-10-23 Cary Coutant <ccoutant@google.com>
2312
2313 * fileread.cc (Input_file::Input_file): New constructor.
2314 * fileread.h (class Input_file): Add new constructor.
2315
1698990d
AM
23162012-10-18 Alan Modra <amodra@gmail.com>
2317
2318 PR gold/14727
2319 * object.cc (Relobj::is_section_name_included): Also match
2320 .sdata personality section.
2321
168a4726
AM
23222012-10-18 Alan Modra <amodra@gmail.com>
2323
2324 * target-reloc.h (class Default_comdat_behavior): New, package up..
2325 (get_comdat_behaviour): ..this.
2326 (relocate_section): Add Relocate_comdat_behavior template arg,
2327 adjust code to suit.
2328 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2329 (Target_arm::scan_reloc_section): Likewise.
2330 * i386.cc (Target_i386::relocate_section): Likewise.
2331 * sparc.cc (Target_sparc::relocate_section): Likewise.
2332 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2333 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2334 * powerpc.cc (class Relocate_comdat_behavior): New.
2335 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2336 gold::relocate_section with new template arg.
2337
acc276d8
AM
23382012-10-18 Alan Modra <amodra@gmail.com>
2339
2340 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2341 dynamic relocs for GOT_TPREL got entries, without symbol if
2342 resolving locally.
2343 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2344 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2345 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2346
e10f9870
AM
23472012-10-17 Alan Modra <amodra@gmail.com>
2348
2349 PR gold/14726
2350 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2351
ae034989
ST
23522012-10-16 Sriraman Tallam <tmsriram@google.com>
2353
2354 * layout.cc (Layout::include_section): Keep sections marked
2355 SHF_EXCLUDE when doing relocatable links.
2356
f3a0ed29
AM
23572012-10-16 Alan Modra <amodra@gmail.com>
2358
2359 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2360 (Target_powerpc::do_finalize_sections): Call it.
2361 (Output_data_save_res): New class and supporting functions.
2362 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2363 normal symbols defined in object files.
2364
c6de8ed4
AM
23652012-10-12 Alan Modra <amodra@gmail.com>
2366
2367 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2368 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2369 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2370 section if scan_opd_relocs not yet called.
2371 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2372
03e25981
AM
23732012-10-12 Alan Modra <amodra@gmail.com>
2374
2375 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2376 add_local_ifunc_entry): Revert last change.
2377 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2378
c9824451
AM
23792012-10-05 Alan Modra <amodra@gmail.com>
2380
2381 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2382 do_plt_address_for_global): New functions.
2383 (Output_data_got_powerpc::do_write): Don't segfault when linking
2384 statically.
2385 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2386 add_local_ifunc_entry): Return true on adding entry..
2387 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2388 glink->add_entry call. Remove unused symtab param. Adjust calls.
2389 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2390 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2391 set up symbols here.
2392 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2393 syms here. Do so even when no .iplt. Don't segfault when linking
2394 statically.
2395 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2396 new variants without reloc param.
2397 (Glink_sym_ent::Glink_sym_ent): Likewise.
2398 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2399 reloc when refs will resolve to plt call stub.
2400 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2401 R_PPC_PLTREL24 to resolve locally.
2402 (Target_powerpc::Scan::global): Correct ifunc handling.
2403 (Target_powerpc::Relocate::relocate): Correct local sym glink
2404 lookup. Don't destroy "value" when we have a plt call stub,
2405 and when checking plt call validity.
2406 (Target_powerpc::do_dynsym_value): Simplify.
2407
19fec8c1
AM
24082012-10-05 Alan Modra <amodra@gmail.com>
2409
2410 * i386.cc (Output_data_plt_i386::address_for_global,
2411 address_for_local): Add plt offset to returned value. Adjust uses.
2412 * sparc.cc (Output_data_plt_sparc::address_for_global,
2413 address_for_local): Likewise.
2414 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2415 address_for_local): Likewise.
2416 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2417 address_for_local): Likewise.
2418 * target.h (Target::plt_address_for_global, plt_address_for_local):
2419 Update comment.
2420 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2421 (Output_data_got::Got_entry::write): Nor here.
2422 * output.h: Comment fix.
2423
e867b647
WL
24242012-10-02 Jiong Wang <jiwang@tilera.com>
2425
2426 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2427 global_offset_table_ value for larget got.
2428 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2429
e5d5f5ed
AM
24302012-09-29 Alan Modra <amodra@gmail.com>
2431
2432 * powerpc.cc (Target_powerpc::iplt_): New output section.
2433 (Target_powerpc::iplt_section, make_iplt_section,
2434 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2435 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2436 Target_powerpc::plt_entry_count): Count iplt entries too.
2437 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2438 reloc section in constructor. New params.
2439 (Target_powerpc::make_plt_section): Create reloc section here instead.
2440 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2441 functions.
2442 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2443 (Output_data_glink::add_entry, find_entry): New functions to
2444 deal with local syms.
2445 (Glink_sym_ent): Add support for local syms.
2446 (Output_data_glink::do_write): Handle ifunc plt entries.
2447 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2448 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2449 (Target_powerpc::Relocate::relocate): Likewise.
2450 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2451
ec4dbad3
AM
24522012-09-25 Alan Modra <amodra@gmail.com>
2453
2454 * object.h (Sized_relobj_file::adjust_local_symbol,
2455 do_adjust_local_symbol): New functions.
2456 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2457 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2458 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2459 and irregular opd entry spacing.
2460 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2461 (Global_symbol_visitor_opd): New functor.
2462 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2463 on deleted opd entries.
2464
5c0b3823
WL
24652012-09-15 Jiong Wang <jiwang@tilera.com>
2466
2467 * tilegx.cc: New file.
2468 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2469 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2470 * configure.tgt: Add entries for tilegx*.
2471 * configure.ac: Likewise.
2472 * Makefile.in: Rebuild.
2473 * configure: Likewise.
2474 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2475 tilegx.
2476
bfdfa4cd
AM
24772012-09-13 Alan Modra <amodra@gmail.com>
2478
2479 * target-reloc.h (scan_relocs): Call scan.local for relocs
2480 against symbols in discarded sections. Pass is_discarded
2481 param.
2482 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2483 Add is_discarded param.
2484 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2485 is_discarded to flag opd entry as discarded. Don't emit dyn
2486 relocs on such entries.
2487 (Target_powerpc::Scan::global): Similarly detect and handle
2488 such opd entries.
2489 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2490 opd_ent_. Update all uses.
2491 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2492 (Target_powerpc::relocate_section): Zero out discarded opd
2493 entry relocs.
2494
d77a0555
ILT
24952012-09-12 Ian Lance Taylor <iant@google.com>
2496
2497 PR gold/14570
2498 * output.cc: Rename Output_data_got template parameter from size
2499 to got_size for all functions. Compile all variants of
2500 Output_data_got.
2501 (Output_data_got::Got_entry::write): Correct use of size for
2502 symbol value. Use local_is_tls rather than casting to
2503 Sized_relobj_file.
2504 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2505 (class Sized_relobj_file): Add do_local_is_tls.
2506 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2507
815a1205
AM
25082012-09-11 Alan Modra <amodra@gmail.com>
2509
2510 PR gold/14566
2511 * layout.cc (Layout::set_segment_offsets): When using
2512 common-page-size alignment, ensure we are on a new max-page-size
2513 page.
2514 * output.cc (Output_segment::set_section_addresses): Use
2515 abi_pagesize, not common_pagesize for relro boundary.
2516 (Output_segment::set_offset): Likewise.
2517
bd73a62d
AM
25182012-09-11 Alan Modra <amodra@gmail.com>
2519
2520 * output.h (Output_data_got::add_global_tls, add_local_tls,
2521 add_local_tls_pair): New functions.
2522 (Output_data_got::add_local_pair_with_rel): Remove second
2523 reloc param. Expand comment.
2524 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2525 use_plt_or_tls_offset_, similarly for constructor param.
2526 (Output_data_got::Got_entry::write): Add got_index param.
2527 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2528 add_local_tls_pair): New functions.
2529 (Output_data_got::Got_entry::write): Handle tls symbols
2530 with use_plt_or_tls_offset_ set specially.
2531 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2532 (Output_data_got::do_write): Replace iterator with index, pass
2533 index to entry write function.
2534 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2535 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2536 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2537 call.
2538 * i386.cc (Target_i386::Scan::local): Likewise.
2539 * sparc.cc (Target_sparc::Scan::local): Likewise.
2540 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2541 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2542 do_tls_offset_for_global): New functions.
2543 (Target_powerpc::Scan::local): Correct TLS relocations and got
2544 entry values.
2545 (Target_powerpc::Scan::global): Don't emit unnecessary
2546 dynamic relocations on TLS GOT entries.
2547
00716ab1
AM
25482012-09-10 Matthias Klose <doko@ubuntu.com>
2549
2550 * config.in: Disable sanity check for kfreebsd.
2551
c891b3f9
SA
25522012-09-10 Sterling Augustine <saugustine@google.com>
2553
2554 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2555 (Gdb_index::pubtypes_read): New parameter.
2556 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2557 to calls.
2558 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2559 pubtypes_object_.
2560
e81fea4d
AM
25612012-09-09 Alan Modra <amodra@gmail.com>
2562
2563 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2564 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2565 * gc.h (gc_process_relocs): Call target gc_add_reference.
2566 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2567 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2568 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2569 unnecessary cast.
2570 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2571 to cater for when we don't need code offset. Update use.
2572 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2573 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2574 set_opd_valid): New functions.
2575 (Target_powerpc::do_gc_add_reference): New function.
2576 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2577 stashed refs.
2578 (Target_powerpc::do_gc_mark_symbol): New function.
2579
d2d60eef
CC
25802012-09-06 Cary Coutant <ccoutant@google.com>
2581
2582 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2583 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2584 (Dwarf_die::skip_attributes): Likewise.
2585 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2586 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2587 (main): Call it.
2588 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2589
32ed4573
L
25902012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2591
2592 * testsuite/script_test_3.t: Add .got.plt output section
2593 statement.
2594 * testsuite/script_test_4.t: Likewise.
2595
f4baf0d4
AM
25962012-09-05 Alan Modra <amodra@gmail.com>
2597
2598 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2599 update all uses and lose "enum" when using type.
2600
864a1b56
AM
26012012-09-05 Alan Modra <amodra@gmail.com>
2602
2603 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2604 * configure: Regenerate.
2605 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2606 (plugin_final_layout.stdout): Likewise.
2607 (memory_test): Set page sizes to 0x1000.
2608 * testsuite/Makefile.in: Regenerate.
2609 * testsuite/discard_locals_test.sh: Add FIXME comment.
2610 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2611 * testsuite/pr14265.t: Add .got output section statement.
2612 * testsuite/script_test_2.t: Likewise.
2613 * testsuite/script_test_3.t: Likewise.
2614 * testsuite/script_test_4.t: Likewise.
2615 * testsuite/script_test_5.t: Likewise.
2616 * testsuite/script_test_6.t: Likewise.
2617 * testsuite/script_test_7.t: Likewise.
2618 * testsuite/script_test_9.t: Likewise.
2619
3ea0a085
AM
26202012-09-05 Alan Modra <amodra@gmail.com>
2621
2622 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2623 (Powerpc_relocate_functions::Status): New typedef.
2624 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2625 (Target_powerpc::Scan::local): Handle REL64.
2626 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2627 for REL32 and REL64.
2628 (Target_powerpc::symval_for_branch): New function, extracted from..
2629 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2630 checks. Report overflow errors.
2631
7404fe1b
AM
26322012-09-05 Alan Modra <amodra@gmail.com>
2633
2634 * object.h (Sized_relobj_file::emit_relocs): Delete.
2635 (Sized_relobj_file::emit_relocs_reltype): Delete.
2636 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2637 relocate_relocs for --emit-relocs.
2638 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2639 * output.h: Update comment.
2640 (Output_segment::first_section): New function.
2641 (Output_segment::first_section_load_address): Use first_section.
2642 * output.cc (Output_segment::first_section): New function extracted..
2643 (Output_segment::first_section_load_address): ..from here. Delete.
2644 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2645 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2646 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2647 adjust call to target.h function.
2648 * i386.cc (Target_i386): Likewise.
2649 * sparc.cc (Target_sparc): Likewise.
2650 * x86_64.cc (Target_x86_64): Likewise.
2651 * powerpc.cc (Target_powerpc): Likewise.
2652 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2653 first tls section has section symbol for optimised local dynamic
2654 output relocs.
2655 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2656 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2657 optimised tls code.
2658 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2659 Rename to relocate_relocs. Update error message.
2660
957564c9
AS
26612012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2662
2663 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2664 --just-symbols.
2665
dd93cd0a
AM
26662012-08-31 Alan Modra <amodra@gmail.com>
2667
2668 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2669 (Powerpc_relobj::toc_base_offset): New stub function.
2670 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2671 got_mod_index_offset to tlsld_got_offset. Update all refs.
2672 (Target_powerpc::Relocate::enum skip_tls): New.
2673 (Target_powerpc::call_tls_get_addr_): New var.
2674 (Target_powerpc::is_branch_reloc): Move to file scope.
2675 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2676 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2677 New functions.
2678 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2679 (powerpc_info): Correct common_pagesize for ppc64.
2680 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2681 (Powerpc_relocate_functions): Add overflow check enums and functions.
2682 Add non-shift version of rela, rela_ua. Delete all rel public
2683 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2684 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2685 addr16_ha3, addr14 functions.
2686 (Output_data_got_powerpc::add_constant_pair): New function.
2687 (Output_data_got_powerpc::got_base_offset): Likewise.
2688 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2689 (instruction constants): Sort, add some more.
2690 (Output_data_glink::do_write): Add and use Address typedef. Use
2691 object->toc_base_offset() stub for 64-bit.
2692 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2693 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2694 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2695 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2696 Always treat .opd relocs as against locally defined symbol.
2697 Correct condition for RELATIVE relocs.
2698 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2699 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2700 for 32-bit syms with a plt entry. Correct ppc64 toc base
2701 calculations. Handle TLS relocs, and more. Add overflow
2702 checking and adjust for Powerpc_relocate_functions changes.
2703 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2704 Reinstate --emit-relocs code with FIXME.
2705
a1373b60
AM
27062012-08-30 Alan Modra <amodra@gmail.com>
2707
2708 * layout.cc (Layout::set_segment_offsets): Set p_align to
2709 abi_pagesize, not common_pagesize.
2710 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2711 to determine whether file header can go in segment.
2712
703d02da
AM
27132012-08-30 Alan Modra <amodra@gmail.com>
2714
2715 * output.h (Output_reloc::Output_reloc <output section>): Add
2716 is_relative param. Adjust calls.
2717 (Output_reloc::add_output_section_relative): New functions.
2718 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2719 is_relative.
2720 (Output_reloc::symbol_value): Handle SECTION_CODE.
2721
16164a6b
ST
27222012-08-24 Sriraman Tallam <tmsriram@google.com>
2723
2724 * gold.cc (queue_middle_tasks): Call layout again when unique
2725 segments for sections is desired.
2726 * layout.cc (Layout::Layout): Initialize new members.
2727 (Layout::get_output_section_flags): New function.
2728 (Layout::choose_output_section): Call get_output_section_flags.
2729 (Layout::layout): Make output section for mapping to a unique segment.
2730 (Layout::insert_section_segment_map): New function.
2731 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 2732 output sections marked so.
16164a6b
ST
2733 (Layout::segment_precedes): Check for unique segments when sorting.
2734 * layout.h (Layout::Unique_segment_info): New struct.
2735 (Layout::Section_segment_map): New typedef.
2736 (Layout::insert_section_segment_map): New function.
2737 (Layout::get_output_section_flags): New function.
2738 (Layout::is_unique_segment_for_sections_specified): New function.
2739 (Layout::set_unique_segment_for_sections_specified): New function.
2740 (Layout::unique_segment_for_sections_specified_): New member.
2741 (Layout::section_segment_map_): New member.
2742 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2743 Rename is_gc_pass_one to is_pass_one.
2744 Rename is_gc_pass_two to is_pass_two.
2745 Rename is_gc_or_icf to is_two_pass.
2746 Check for which pass based on whether symbols data is present.
2747 Make it two pass when unique segments for sections is desired.
2748 * output.cc (Output_section::Output_section): Initialize new
2749 members.
2750 * output.h (Output_section::is_unique_segment): New function.
2751 (Output_section::set_is_unique_segment): New function.
2752 (Output_section::is_unique_segment_): New member.
2753 (Output_section::extra_segment_flags): New function.
2754 (Output_section::set_extra_segment_flags): New function.
2755 (Output_section::extra_segment_flags_): New member.
2756 (Output_section::segment_alignment): New function.
2757 (Output_section::set_segment_alignment): New function.
2758 (Output_section::segment_alignment_): New member.
2759 (Output_segment::Output_segment): Initialize is_unique_segment_.
2760 (Output_segment::is_unique_segment): New function.
2761 (Output_segment::set_is_unique_segment): New function.
2762 (Output_segment::is_unique_segment_): New member.
2763 * plugin.cc (allow_unique_segment_for_sections): New function.
2764 (unique_segment_for_sections): New function.
2765 (Plugin::load): Add new functions to transfer vector.
2766 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2767 * Makefile.in: Regenerate.
2768 * testsuite/plugin_final_layout.sh: Check if unique segment
2769 functionality works.
2770 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2771 are available.
2772 (allow_unique_segment_for_sections): New global.
2773 (unique_segment_for_sections): New global.
2774 (claim_file_hook): Call allow_unique_segment_for_sections.
2775 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 2776
1e2bee4f
CC
27772012-08-22 Cary Coutant <ccoutant@google.com>
2778
2779 * layout.cc (Layout::include_section): Don't assert on GROUP
2780 sections with --emit-relocs.
2781
1d5dfe78
CC
27822012-08-21 Cary Coutant <ccoutant@google.com>
2783
2784 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2785 if --export-dynamic-symbol names an undef symbol.
2786
c9269dff
AM
27872012-08-18 Alan Modra <amodra@gmail.com>
2788
2789 * powerpc.cc: Formatting and white space.
2790 (Powerpc_relobj): Rename got2_section_ to special_.
2791 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2792 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2793 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2794 (Target_powerpc): Add Address typedef and invalid_address. Use
2795 throughout.
2796 (Target_powerpc::is_branch_reloc): New function.
2797 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2798 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2799 for dst_mask, value and addend.
2800 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2801 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2802 (Output_data_glink::do_write): Correct toc base. Don't try to use
2803 uint16_t for 24-bit offset. Use get_output_section_offset and
2804 check return.
2805 (Target_powerpc::Scan::local): Handle more relocs.
2806 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2807 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2808 Plug in toc restoring insn after plt calls. Translate branches
2809 to function descriptor symbols to corresponding entry point.
2810 (Target_powerpc::relocate_for_relocatable): Check return from
2811 get_output_section_offset.
2812 * symtab.h: Comment typo.
2813
b1759dce
ILT
28142012-08-14 Ian Lance Taylor <iant@google.com>
2815
2816 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2817 unsupported_relocal_local to call unsupported_reloc_global.
2818
b9b2ae8b
NC
28192012-08-14 Nick Clifton <nickc@redhat.com>
2820
2821 PR ld/14265
2822 * script-sections.cc (Sections_element::output_section_name): Add
2823 keep return parameter.
2824 (Output_section_element::match_name): Add keep return parameter.
2825 Return the value of the keep_ member.
2826 * script-sections.h (class Output_section): Update
2827 output_section_name prototype.
2828 * layout.cc (Layout::keep_input_section): New public member
2829 function.
2830 (Layout::choose_output_section): Pass keep parameter to
2831 output_section_name.
2832 * layout.h (class Layout): Add keep_input_section.
2833 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2834 sections.
2835 * testsuite/Makefile.am: Add a test.
2836 * testsuite/Makefile.in: Regenerate.
2837 * testsuite/pr14265.c: Source file for the test.
2838 * testsuite/pr14265.t: Linker script for the test.
2839 * testsuite/pr14265.sh: Shell script for the test.
2840
921b5322
AM
28412012-08-14 Alan Modra <amodra@gmail.com>
2842
2843 * target.h (Target::output_section_name): New function.
2844 (Target::do_output_section_name): New function.
2845 * layout.cc (Layout::choose_output_section): Call the above.
2846 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2847
6ce78956
AM
28482012-08-14 Alan Modra <amodra@gmail.com>
2849
2850 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2851 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2852 for replace_constant call.
2853 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2854 (Output_data_glink::do_print_to_mapfile): New function.
2855 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2856 (Target_powerpc::Relocate::relocate): Likewise.
2857
d1a8cabd
AM
28582012-08-14 Alan Modra <amodra@gmail.com>
2859
2860 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2861 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2862 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2863 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2864 all references to shndx_. Handle special case for R_PPC_PLTREL24
2865 here.
2866 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2867 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2868 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2869 here.
2870 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2871 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2872
d83ce4e3
AM
28732012-08-12 Alan Modra <amodra@gmail.com>
2874
2875 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2876 (glink insn constants): Use uint32_t.
2877 (Output_data_glink::add_entry): Use insert, not [] operator.
2878
cf43a2fe
AM
28792012-08-11 Alan Modra <amodra@gmail.com>
2880
2881 * object.h (Sized_relobj_file::find_shdr): New function.
2882 (Sized_relobj_file::find_special_sections): New function.
2883 * object.cc (Sized_relobj_file::find_shdr): New function.
2884 (Sized_relobj_file::find_eh_frame): Use find_shdr.
2885 (Sized_relobj_file::find_special_sections): New function, split out..
2886 (Sized_relobj_file::do_read_symbols): ..from here.
2887 * output.h (Output_data_got::replace_constant): New function.
2888 (Output_data_got::num_entries): New function.
2889 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
2890 (Output_data_got::got_offset): Protected rather than private.
2891 (Output_data_got::replace_got_entry): New function.
2892 * output.cc (Output_data_got::replace_got_entry): New function.
2893 * powerpc.cc (class Powerpc_relobj): New.
2894 (class Powerpc_relocate_functions): Delete all psymval variants or
2895 convert to value,addend type. Delete pcrela, pcrela_unaligned.
2896 Implement _ha functions using corresponding _hi function.
2897 (Powerpc_relobj::find_special_sections): New function.
2898 (Target_powerpc::do_make_elf_object): New function.
2899 (class Output_data_got_powerpc): New.
2900 (class Output_data_glink): New.
2901 (class Powerpc_scan_relocatable_reloc): New.
2902 Many more changes througout file.
2903
3c892704
NC
29042012-08-09 Nick Clifton <nickc@redhat.com>
2905
2906 * po/vi.po: Updated Vietnamese translation.
2907
82435b3b
ILT
29082012-08-07 Ian Lance Taylor <iant@google.com>
2909
2910 * layout.cc (Layout::add_target_dynamic_tags): If
2911 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
2912 plt_rel.
2913
a6dc81d2
NC
29142012-07-30 Nick Clifton <nickc@redhat.com>
2915
2916 * po/gold.pot: Updated template.
2917 * po/es.po: Updated Spanish translation.
2918
f1415016
CC
29192012-07-18 Cary Coutant <ccoutant@google.com>
2920
2921 PR gold/14344
2922 * configure.ac: Add check for -gpubnames support.
2923 * configure: Regenerate.
2924 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
2925 support; force -gno-pubnames.
2926 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
2927 support.
2928 (gdb_index_test_4): New test.
2929 * testsuite/Makefile.in: Regenerate.
2930 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
2931 * testsuite/gdb_index_test_2.sh: Likewise.
2932 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
2933 * testsuite/gdb_index_test_4.sh: New script.
2934 * testsuite/gdb_index_test_comm.sh: New script with common code;
2935 don't look for space after colon.
2936
b7fd7c37
ST
29372012-07-16 Sriraman Tallam <tmsriram@google.com>
2938
2939 * gold.cc (queue_middle_tasks): Update function order only after
2940 deferred objects due to plugins are processed.
2941
1f3212db
ILT
29422012-07-11 Ian Lance Taylor <iant@google.com>
2943
2944 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
2945 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
2946 (Target_arm::scan_reloc_for_stub): Likewise.
2947 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
2948 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
2949 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
2950 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
2951 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
2952
81c82a68
ILT
29532012-07-10 Dodji Seketeli <dodji@redhat.com>
2954 Ian Lance Taylor <iant@google.com>
2955
2956 PR gold/14309
2957 * configure.ac: Test whether std::tr1::hash<off_t> works.
2958 * gold.h: Add a specialization for std::tr1::hash<off_t> if
2959 needed.
2960 * output.h (class Output_fill): Add virtual destructor.
2961 * configure, config.in: Rebuild.
2962
eabc84f4
RM
29632012-06-22 Roland McGrath <mcgrathr@google.com>
2964
2965 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
2966
370e30b6
RÁE
29672012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
2968
2969 * plugin.cc (Plugin::load): Handle position independent executables.
2970
fb1b895d
CC
29712012-06-06 Cary Coutant <ccoutant@google.com>
2972
2973 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
2974 add .debug_macro.
2975 (lines_only_debug_sections): Likewise.
2976 (gdb_fast_lookup_sections): New static array.
2977 (is_gdb_debug_section): Rename formal parameter.
2978 (is_lines_only_debug_section): Likewise.
2979 (is_gdb_fast_lookup_section): New function.
2980 (Layout::include_section): Check for ".zdebug_" prefix; pass
2981 section name suffix to is_gdb_debug_section, et al.; check for
2982 fast-lookup sections when building .gdb_index.
2983 * options.h (--strip-debug-gdb): Update GDB version number.
2984
7c0640fa
CC
29852012-06-06 Cary Coutant <ccoutant@google.com>
2986
2987 * configure.ac: Add check for fallocate.
2988 * configure: Regenerate.
2989 * config.in: Regenerate.
2990
2991 * options.h (class General_options): Add --mmap-output-file and
2992 --posix-fallocate options.
2993 * output.cc: (posix_fallocate): Remove; replace with...
2994 (gold_fallocate): New function.
2995 (Output_file::map_no_anonymous): Call gold_fallocate.
2996 (Output_file::map): Check --mmap-output-file option.
2997
2a49eb69
DK
29982012-06-05 Jing Yu <jingyu@google.com>
2999
3000 * gold.h (textdomain): Add do {} to empty while(0).
3001 (bindtextdomain): Likewise.
3002
fad072ac
CC
30032012-06-04 Cary Coutant <ccoutant@google.com>
3004
3005 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3006 has_dynsym_index.
3007
8cc69fb6
ST
30082012-05-25 Sriraman Tallam <tmsriram@google.com>
3009
3010 * symtab.cc (Symbol_table::define_special_symbol):
3011 Initialize *poldsym to prevent uninitialized variable errors.
3012
1be75daa
CC
30132012-05-23 Cary Coutant <ccoutant@google.com>
3014
3015 * layout.cc (Layout::section_name_mapping): Add rules to handle
3016 exact match on .data.rel.ro.local or .data.rel.ro.
3017 (Layout::output_section_name): Check for exact matches.
3018
9b689de0
CC
30192012-05-23 Cary Coutant <ccoutant@google.com>
3020
3021 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3022 more carefully.
3023
b24fdbf5
CC
30242012-05-22 Cary Coutant <ccoutant@google.com>
3025
3026 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3027 object before exporting symbol.
3028
e550e1a2
L
30292012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3030
3031 * testsuite/tls_test.cc: Include "config.h" first.
3032 * testsuite/tls_test_c.c: Likewise.
3033
df7b86aa
NC
30342012-05-17 Daniel Richard G. <skunk@iskunk.org>
3035 Nick Clifton <nickc@redhat.com>
3036
3037 PR 14072
3038 * configure.in: Add check that sysdep.h has been included before
3039 any system header files.
3040 * configure: Regenerate.
3041 * config.in: Regenerate.
3042
1007b503
CC
30432012-05-14 Cary Coutant <ccoutant@google.com>
3044
3045 * layout.cc (Layout::make_output_section): Mark .tdata section
3046 as RELRO.
3047 * testsuite/relro_test.cc: Add a TLS variable.
3048
fd885f3a
L
30492012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3050
3051 PR gold/14091
3052 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3053 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3054 R_X86_64_64.
3055
80f5885c
CC
30562012-05-08 Cary Coutant <ccoutant@google.com>
3057
3058 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3059 (lines_only_debug_sections): Likewise.
3060
2e702c99
RM
30612012-05-02 Roland McGrath <mcgrathr@google.com>
3062
3063 * nacl.cc: New file.
3064 * nacl.h: New file.
3065 * Makefile.am (CCFILES, HFILES): Add them.
3066 * Makefile.in: Regenerate.
3067 * i386.cc (Output_data_plt_i386_nacl): New class.
3068 (Output_data_plt_i386_nacl_exec): New class.
3069 (Output_data_plt_i386_nacl_dyn): New class.
3070 (Target_i386_nacl): New class.
3071 (Target_selector_i386_nacl): New class.
3072 (target_selector_i386): Use it instead of Target_selector_i386.
3073 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3074 (Target_x86_64_nacl): New class.
3075 (Target_selector_x86_64_nacl): New class.
3076 (target_selector_x86_64, target_selector_x32): Use it instead of
3077 Target_selector_x86_64.
3078 * arm.cc (Output_data_plt_arm_nacl): New class.
3079 (Target_arm_nacl): New class.
3080 (Target_selector_arm_nacl): New class.
3081 (target_selector_arm, target_selector_armbe): Use it instead of
3082 Target_selector_arm.
3083
3084 * target-select.cc (select_target): Take new Input_file* and off_t
3085 arguments, pass them on to recognize method of selector.
3086 * object.cc (make_elf_sized_object): Update caller.
3087 * parameters.cc (parameters_force_valid_target): Likewise.
3088 * incremental.cc (make_sized_incremental_binary): Likewise.
3089 * target-select.h: Update decl.
3090 (Target_selector::recognize): Take new Input_file* argument,
3091 pass it on to do_recognize.
3092 (Target_selector::do_recognize): Take new Input_file* argument.
3093 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3094 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3095 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3096 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3097
3098 * target.h (Target::Target_info): New members isolate_execinstr
3099 and rosegment_gap.
3100 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3101 * arm.cc (Target_arm::arm_info): Update initializer.
3102 * i386.cc (Target_i386::i386_info): Likewise.
3103 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3104 * sparc.cc (Target_sparc::sparc_info): Likewise.
3105 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3106 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3107 * layout.cc (Layout::attach_allocated_section_to_segment):
3108 Take new const Target* argument. If target->isolate_execinstr(), act
3109 like --rosegment.
3110 (Layout::find_first_load_seg): Take new const Target* argument;
3111 if target->isolate_execinstr(), reject PF_X segments.
3112 (Layout::relaxation_loop_body): Update caller.
3113 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3114 reset file offset to zero when we hit LOAD_SEG, and then do a second
3115 loop over the segments before LOAD_SEG to reassign offsets after
3116 addresses have been determined. Handle target->rosegment_gap().
3117 (Layout::attach_section_to_segment): Take new const Target* argument;
3118 pass it to attach_allocated_section_to_segment.
3119 (Layout::make_output_section): Update caller.
3120 (Layout::attach_sections_to_segments): Take new const Target* argument;
3121 pass it to attach_section_to_segment.
3122 * gold.cc (queue_middle_tasks): Update caller.
3123 * layout.h (Layout): Update method decls with new arguments.
3124
3125 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3126 Target_info pointer to use.
3127 (Target_arm::do_make_data_plt): New virtual method.
3128 (Target_arm::make_data_plt): New method that calls it.
3129 (Target_arm::make_plt_entry): Use it.
3130 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3131 for the section alignment.
3132 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3133 method.
3134 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3135 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3136 method.
3137 (Output_data_plt_arm::get_plt_entry_size): Call it.
3138 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3139 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3140 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3141 method.
3142 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3143 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3144 method instead of sizeof(plt_entry).
3145 (Output_data_plt_arm::add_entry): Likewise.
3146 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3147 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3148 than static method.
3149 (Target_arm::plt_entry_size): Likewise.
3150 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3151 Move to ...
3152 (Output_data_plt_arm_standard): ... here, new class.
3153 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3154 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3155 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3156
3157 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3158 Take additional argument for the PLT entry size.
3159 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3160 Use get_plt_entry_size method rather than plt_entry_size variable.
3161 (Output_data_plt_x86_64::reserve_slot): Likewise.
3162 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3163 (Output_data_plt_x86_64::add_entry): Likewise.
3164 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3165 (Output_data_plt_x86_64::address_for_global): Likewise.
3166 (Output_data_plt_x86_64::address_for_local): Likewise.
3167 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3168 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3169 Make method non-static.
3170 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3171 method.
3172 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3173 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3174 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3175 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3176 virtual method.
3177 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3178 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3179 virtual method.
3180 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3181 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3182 virtual method.
3183 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3184 (Output_data_plt_x86_64::plt_entry_size)
3185 (Output_data_plt_x86_64::first_plt_entry)
3186 (Output_data_plt_x86_64::plt_entry)
3187 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3188 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3189 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3190 (Output_data_plt_x86_64_standard): ... here, new class.
3191 (Target_x86_64::Target_x86_64): Take optional argument for the
3192 Target_info pointer to use.
3193 (Target_x86_64::do_make_data_plt): New virtual method.
3194 (Target_x86_64::make_data_plt): New method to call it.
3195 (Target_x86_64::init_got_plt_for_update): Use that.
3196 Call this->plt_->add_eh_frame method here.
3197 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3198 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3199 rather than static method.
3200 (Target_x86_64::plt_entry_size): Likewise.
3201 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3202 rather than plt_entry_size variable. Move guts of PLT filling to...
3203 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3204 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3205 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3206
3207 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3208 additional argument for the section alignment.
3209 Don't do add_eh_frame_for_plt here.
3210 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3211 non-static. Use get_plt_entry_size method rather than plt_entry_size
3212 variable.
3213 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3214 method.
3215 (Output_data_plt_i386::get_plt_entry_size): Call it.
3216 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3217 (Output_data_plt_i386::add_eh_frame): New method to call it.
3218 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3219 method.
3220 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3221 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3222 method.
3223 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3224 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3225 method instead of plt_entry_size.
3226 (Output_data_plt_i386::plt_entry_size)
3227 (Output_data_plt_i386::plt_eh_frame_fde_size)
3228 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3229 (Output_data_plt_i386_standard): ... here, new class.
3230 (Output_data_plt_i386_exec): New class.
3231 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3232 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3233 (Output_data_plt_i386::exec_plt_entry): Move to ...
3234 (Output_data_plt_i386_exec::plt_entry): ... here.
3235 (Output_data_plt_i386_dyn): New class.
3236 (Output_data_plt_i386::first_plt_entry): Move to ...
3237 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3238 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3239 (Output_data_plt_i386_dyn::plt_entry): ... here.
3240 (Target_i386::Target_i386): Take optional argument for the Target_info
3241 pointer to use.
3242 (Target_i386::do_make_data_plt): New virtual method.
3243 (Target_i386::make_data_plt): New method to call it.
3244 (Target_i386::make_plt_section): Use that.
3245 Call this->plt_->add_eh_frame method here.
3246 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3247 rather than plt_entry_size variable.
3248 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3249 (Output_data_plt_i386::address_for_local): Likewise.
3250 (Output_data_plt_i386::do_write): Likewise.
3251 Move guts of PLT filling to...
3252 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3253 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3254 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3255 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3256
b9b9f2ee
CC
32572012-05-01 Cary Coutant <ccoutant@google.com>
3258
3259 * dwarf_reader.cc (Dwarf_die::read_attributes)
3260 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3261 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3262 * reduced_debug_output.cc
3263 (Output_reduced_debug_info_section::get_die_end): Remove
3264 DW_FORM_GNU_ref_index. Add default case.
3265
57923f48
MW
32662012-04-26 Mark Wielaard <mjw@redhat.com>
3267
3268 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3269 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3270 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3271 DW_AT_high_pc as offset from DW_AT_low_pc.
3272
3273 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3274 * testsuite/Makefile.in: Regenerate.
3275 * testsuite/gdb_index_test_3.c: New test source file.
3276 * testsuite/gdb_index_test_3.sh: New test source file.
3277
2c54b4f4
ILT
32782012-04-25 Ian Lance Taylor <iant@google.com>
3279
3280 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3281 pointer.
3282 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3283 as a class, not a struct.
3284 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3285 (Target_arm::apply_cortex_a8_workaround): Likewise.
3286 * gc.h: Declare Reloc_types as a struct, not a class.
3287 * object.h: Declare Symbols_data as a struct.
3288 * reloc.h: Declare Read_relocs_data as a struct.
3289 * target.h: Declare Relocate_info as a struct.
3290
a5a5f7a3
DM
32912012-04-24 David S. Miller <davem@davemloft.net>
3292
3293 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3294 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3295 and R_SPARC_WPLT30.
3296
f038d496
CC
32972012-04-24 Cary Coutant <ccoutant@google.com>
3298
3299 * incremental-dump.cc (find_input_containing_global): Replace
3300 magic number with symbolic constant.
3301 (dump_incremental_inputs): Update version number.
3302 * incremental.cc (Output_section_incremental_inputs): Update version
3303 number; import symbolic constants from Incremental_inputs_reader.
3304 (Incremental_inputs::create_data_sections): Align relocations
3305 section correctly for 64-bit targets.
3306 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3307 constants; add padding.
3308 (Output_section_incremental_inputs::write_header): Add assert for
3309 header_size.
3310 (Output_section_incremental_inputs::write_input_files): Add assert
3311 for input_entry_size.
3312 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3313 add assert for object_info_size, input_section_entry_size,
3314 global_sym_entry_size.
3315 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3316 for data structure sizes; use them.
3317 (Incremental_input_entry_reader): Import symbolic constants from
3318 Incremental_inputs_reader; use them.
3319
a4d85145
DM
33202012-04-23 David S. Miller <davem@davemloft.net>
3321
3322 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3323 and elf_flags_set_.
3324 (Target_sparc::Target_sparc): Initialize new fields.
3325 (Target_sparc::do_make_elf_object): New function.
3326 (Target_sparc::do_adjust_elf_header): New function.
3327
1d509098
CC
33282012-04-23 Cary Coutant <ccoutant@google.com>
3329
3330 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3331 CU range table of gdb index.
3332
7ebeff7f
DM
33332012-04-20 David S. Miller <davem@davemloft.net>
3334
3335 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3336 instead of false.
3337
13cf9988
DM
33382012-04-16 David S. Miller <davem@davemloft.net>
3339
2a1079e8
DM
3340 * sparc.cc (Target_sparc::got_address): New function.
3341 (Sparc_relocate_functions::gdop_hix22): New function.
3342 (Sparc_relocate_functions::gdop_lox10): New function.
3343 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3344 relocs.
3345 (Target_sparc::Scan::local): Likewise if the global symbol is not
3346 preemptible and is not IFUNC.
3347 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3348 transformations for local and non-preemptible non-IFUNC global
3349 symbols.
3350
0bc964fc
DM
3351 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3352 writing out 64-bit part of ranges.
3353
661d7a80
DM
3354 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3355 -fpic and -fpie respectively.
3356 * Makefile.in: Regenerate.
3357
8c2bf391
DM
3358 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3359 (Target_sparc::Target_sparc): Initialize new field.
3360 (Target_sparc::do_plt_section_for_global): New function.
3361 (Target_sparc::do_plt_section_for_local): New function.
3362 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3363 (Target_sparc::make_plt_section): New function, broken out of
3364 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3365 (Target_sparc::make_plt_entry): Call make_plt_section.
3366 (Target_sparc::make_local_ifunc_plt_entry): New function.
3367 (Target_sparc::rela_ifunc_section): New function.
3368 (Target_sparc::plt_section): Remove const.
3369 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3370 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3371 and ifunc_count_ fields.
3372 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3373 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3374 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3375 (Output_data_plt_sparc::rela_ifunc): New function.
3376 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3377 (Output_data_plt_sparc::has_ifunc_section): New function.
3378 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3379 (Output_data_plt_sparc::address_for_global): New function.
3380 (Output_data_plt_sparc::address_for_local): New function.
3381 (Output_data_plt_sparc::plt_index_to_offset): New function.
3382 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3383 and entry_count.
3384 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3385 entry_count.
3386 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3387 R_SPARC_JMP_IREL to switch.
3388 (Target_sparc::Scan::check_non_pic): Likewise.
3389 (Target_sparc::Scan::local): Handle IFUNC symbols.
3390 (Target_sparc::Scan::local): Likewise.
3391 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3392 and plt_address_for_local.
3393 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3394 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3395
13cf9988
DM
3396 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3397 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3398 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3399 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3400 global relocs too.
3401 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3402 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3403 calls.
3404 * sparc.cc (Target_sparc::Scan::global): Likewise.
3405 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3406
31821be0
CC
34072012-04-16 Cary Coutant <ccoutant@google.com>
3408
3409 * archive.cc (Library_base::should_include_member): Check for
3410 --export-dynamic-symbol.
3411 * options.h (class General_options): Add --export-dynamic-symbol.
3412 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3413 --export-dynamic-symbol.
3414 (Symbol_table::gc_mark_undef_symbols): Likewise.
3415 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3416
2615994e
DM
34172012-04-12 David S. Miller <davem@davemloft.net>
3418
3419 * sparc.cc (Reloc::wdisp10): New relocation method.
3420 (Reloc::h34): Likewise.
3421 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3422 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3423 R_SPARC_WDISP10.
3424 (Target_sparc::Scan::local): Likewise.
3425 (Target_sparc::Scan::global): Likewise.
3426 (Target_sparc::Relocate::relocate): Likewise.
3427
6782735d
CC
34282012-04-09 Cary Coutant <ccoutant@google.com>
3429
3430 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3431 low_pc == 0.
3432
8c7a0b00
ILT
34332012-04-06 Ian Lance Taylor <iant@google.com>
3434
3435 * timer.cc: #include <unistd.h>.
3436
58797674
RM
34372012-04-06 Roland McGrath <mcgrathr@google.com>
3438
3439 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3440 * config.in: Regenerate.
3441 * configure: Regenerate.
3442
44350750
NC
34432012-04-05 Nick Clifton <nickc@redhat.com>
3444
3445 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3446 (AM_LC_MESSAGES): Add.
3447 * aclocal.m4: Regenerate.
3448 * config.in: Regenerate.
3449 * configure: Regenerate.
3450
c1027032
CC
34512012-03-21 Cary Coutant <ccoutant@google.com>
3452
3453 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3454 * Makefile.in: Regenerate.
3455 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3456 (Sized_elf_reloc_mapper::symbol_section): New function.
3457 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3458 (make_elf_reloc_mapper): New function.
3459 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3460 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3461 (Dwarf_abbrev_table::do_get_abbrev): New function.
3462 (Dwarf_ranges_table::read_ranges_table): New function.
3463 (Dwarf_ranges_table::read_range_list): New function.
3464 (Dwarf_pubnames_table::read_section): New function.
3465 (Dwarf_pubnames_table::read_header): New function.
3466 (Dwarf_pubnames_table::next_name): New function.
3467 (Dwarf_die::Dwarf_die): New function.
3468 (Dwarf_die::read_attributes): New function.
3469 (Dwarf_die::skip_attributes): New function.
3470 (Dwarf_die::set_name): New function.
3471 (Dwarf_die::set_linkage_name): New function.
3472 (Dwarf_die::attribute): New function.
3473 (Dwarf_die::string_attribute): New function.
3474 (Dwarf_die::int_attribute): New function.
3475 (Dwarf_die::uint_attribute): New function.
3476 (Dwarf_die::ref_attribute): New function.
3477 (Dwarf_die::child_offset): New function.
3478 (Dwarf_die::sibling_offset): New function.
3479 (Dwarf_info_reader::check_buffer): New function.
3480 (Dwarf_info_reader::parse): New function.
3481 (Dwarf_info_reader::do_parse): New function.
3482 (Dwarf_info_reader::do_read_string_table): New function.
3483 (Dwarf_info_reader::lookup_reloc): New function.
3484 (Dwarf_info_reader::get_string): New function.
3485 (Dwarf_info_reader::visit_compilation_unit): New function.
3486 (Dwarf_info_reader::visit_type_unit): New function.
3487 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3488 Sized_elf_reloc_mapper.
3489 (Sized_dwarf_line_info::symbol_section): Remove function.
3490 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3491 (Sized_dwarf_line_info::read_line_mappings): Remove object
3492 parameter, adjust callers.
3493 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3494 * dwarf_reader.h: Include <sys/types.h>.
3495 (class Track_relocs): Remove forward declaration.
3496 (class Elf_reloc_mapper): New class.
3497 (class Sized_elf_reloc_mapper): New class.
3498 (class Dwarf_abbrev_table): New class.
3499 (class Dwarf_range_list): New class.
3500 (class Dwarf_ranges_table): New class.
3501 (class Dwarf_pubnames_table): New class.
3502 (class Dwarf_die): New class.
3503 (class Dwarf_info_reader): New class.
3504 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3505 (Sized_dwarf_line_info::symbol_section): Remove member function.
3506 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3507 base class.
3508 * gdb-index.cc: New source file.
3509 * gdb-index.h: New source file.
3510 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3511 and .debug_types sections, call Layout::add_to_gdb_index.
3512 (Sized_relobj_incr::do_section_name): Implement.
3513 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3514 return type; Implement.
3515 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3516 return type.
3517 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3518 parameter list and return type.
3519 (Sized_incr_dynobj::do_section_contents): Likewise.
3520 * layout.cc: Include gdb-index.h.
3521 (Layout::Layout): Initialize gdb_index_data_.
3522 (Layout::init_fixed_output_section): Check for .gdb_index section.
3523 (Layout::add_to_gdb_index): New function. Instantiate.
3524 * layout.h: Add forward declaration for class Gdb_index.
3525 (Layout::add_to_gdb_index): New member function.
3526 (Layout::gdb_index_data_): New data member.
3527 * main.cc: Include gdb-index.h.
3528 (main): Print statistics for gdb index.
3529 * object.cc (Object::section_contents): Move code into
3530 do_section_contents.
3531 (need_decompressed_section): Check for sections needed when building
3532 gdb index.
3533 (build_compressed_section_map): Likewise.
3534 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3535 gdb index.
3536 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3537 sections; call Layout::add_to_gdb_index.
3538 (Sized_relobj_file::do_decompressed_section_contents): Call
3539 do_section_contents directly.
3540 * object.h (Object::do_section_contents): Adjust parameter list and
3541 return type.
3542 (Object::do_decompressed_section_contents): Call do_section_contents
3543 directly.
3544 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3545 return type.
3546 * options.h (class General_options): Add --gdb-index option.
3547 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3548 list and return type.
3549 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3550 * reloc.h (Track_relocs::checkpoint): New function.
3551 (Track_relocs::reset): New function.
3552
3553 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3554 New test cases.
3555 * testsuite/Makefile.in: Regenerate.
3556 * testsuite/gdb_index_test.cc: New test source file.
3557 * testsuite/gdb_index_test_1.sh: New test source file.
3558 * testsuite/gdb_index_test_2.sh: New test source file.
3559
647f1574
DK
35602012-03-19 Doug Kwan <dougkwan@google.com>
3561
3562 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3563 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3564 __exidx_start and __exidx_end. Make symbol table parameter
3565 anonymous as it is not used.
3566 * gold.cc (queue_middle_tasks): Call target hook to define any
3567 target-specific symbols.
3568 * target.h (Target::define_standard_symbols): New method.
3569 (Target::do_define_standard_symbols): Same.
3570 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3571 * testsuite/Makefile.in: Regenerate.
3572 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3573 and __exidx_end.
3574 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3575 relocations are generated for __exidx_start and __exidx_end.
3576
7c6109da
DK
35772012-03-16 Doug Kwan <dougkwan@google.com>
3578
3579 * testsuite/Makefile.am: Disable test initpri3b.
3580 * testsuite/Makefile.in: Regenerate.
3581
7b8957f8
DK
35822012-03-15 Doug Kwan <dougkwan@google.com>
3583
3584 * arm.cc (Target_arm::got_section): Make .got section read-only
3585 if -z now is given.
3586
14dc9ef7
ILT
35872012-03-15 Ian Lance Taylor <iant@google.com>
3588
3589 PR gold/13850
3590 * layout.cc (Layout::make_output_section): Correctly mark
3591 SHT_INIT_ARRAY, et. al., as relro.
3592
fa40b62a
DK
35932012-03-14 Doug Kwan <dougkwan@google.com>
3594
3595 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3596 dynamic relocations for protected symbols in shared objects.
3597
fd325007
ILT
35982012-03-13 Ian Lance Taylor <iant@google.com>
3599
3600 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3601 keep the larger alignment.
3602
e8dd54e1
CC
36032012-03-12 Cary Coutant <ccoutant@google.com>
3604
3605 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3606 handling of DW_LNE_define_file.
3607
feb5f3b0
CC
36082012-03-12 Cary Coutant <ccoutant@google.com>
3609
3610 * reduced_debug_output.cc
3611 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3612 codes to switch.
3613
a1fb4256
CC
36142012-02-29 Cary Coutant <ccoutant@google.com>
3615
3616 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3617
5dd8762a
CC
36182012-02-29 Cary Coutant <ccoutant@google.com>
3619
3620 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3621 Call Object::decompressed_section_contents.
3622 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3623 New dtor.
3624 (Sized_dwarf_line_info::buffer_start_): New data member.
3625 * merge.cc (Output_merge_data::do_add_input_section): Call
3626 Object::decompressed_section_contents.
3627 (Output_merge_string::do_add_input_section): Likewise.
3628 * object.cc (need_decompressed_section): New function.
3629 (build_compressed_section_map): Decompress sections needed later.
3630 (Sized_relobj_file::do_decompressed_section_contents): New function.
3631 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3632 * object.h (Object::decompressed_section_contents): New function.
3633 (Object::discard_decompressed_sections): New function.
3634 (Object::do_decompressed_section_contents): New function.
3635 (Object::do_discard_decompressed_sections): New function.
3636 (Compressed_section_info): New type.
3637 (Compressed_section_map): Include decompressed section contents.
3638 (Sized_relobj_file::do_decompressed_section_contents): New function.
3639 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3640
7b5de7ee
CC
36412012-02-16 Cary Coutant <ccoutant@google.com>
3642
3643 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3644 * testsuite/Makefile.in: Regenerate.
3645
f9fa4a63
CC
36462012-02-14 Cary Coutant <ccoutant@google.com>
3647
3648 * options.cc (General_options::finalize): Disallow -pie and -static.
3649
2c175ebc
DK
36502012-02-03 Doug Kwan <dougkwan@google.com>
3651
3652 * arm.cc (Arm_relocate_functions::abs8,
3653 Arm_relocate_functions::abs16): Use
3654 Bits::has_signed_unsigned_overflow32.
3655 (Arm_relocate_functions::thm_abs8): Correct range of
3656 overflow check.
3657 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3658 in assertions.
3659
90cff06f
DK
36602012-02-02 Doug Kwan <dougkwan@google.com>
3661
3662 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3663 position independent outputs, not just shared objects.
3664
63887f3d
L
36652012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3666
3667 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3668 * configure: Regenerated.
3669
bef2b434
ILT
36702012-01-27 Ian Lance Taylor <iant@google.com>
3671
3672 * reloc.h (Bits): New class with static functions, copied from
3673 namespace utils in arm.cc.
3674 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3675 instead.
3676
c335b55d
L
36772012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3678
3679 * incremental.cc (write_info_blocks): Correct relocation offset.
3680
41194d9f
L
36812012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3682
3683 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3684 (Relocate::tls_gd_to_le): Likewise.
3685
1bae613c
L
36862012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3687
3688 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3689
24482ca0
L
36902012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3691
3692 * configure.ac: Check if -mcmodel=medium works.
3693 * configure: Regenerated.
3694
c2c7840a
CC
36952012-01-24 Cary Coutant <ccoutant@google.com>
3696
3697 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3698 definition and ...
3699 (read_unsigned_LEB_128_x): ... this new function.
3700 (read_signed_LEB_128): Replaced with inline definition and ...
3701 (read_signed_LEB_128_x): ... this new function.
3702 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3703 (read_unsigned_LEB_128): Add inline definition.
3704 (read_signed_LEB_128_x): New function.
3705 (read_signed_LEB_128): Add inline definition.
3706 * testsuite/Makefile.am (leb128_unittest): New unit test.
3707 * testsuite/Makefile.in: Regenerate.
3708 * testsuite/leb128_unittest.cc: New unit test.
3709
833de760 37102012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3711
3712 PR gold/13617
3713 * i386.cc (Target_i386::do_code_fill): When using a jmp
3714 instruction, pad with nop instructions.
3715 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3716
618d6666
L
37172012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3718
3719 * x86_64.cc (gc_process_relocs): Add typename on types used in
3720 template.
3721 (scan_relocs): Likewise.
3722 (relocate_section): Likewise.
3723 (apply_relocation): Likewise.
3724
3660ff06
L
37252012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3726
3727 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3728 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3729 under x32.
3730
fc51264f
L
37312012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3732
3733 * x86_64.cc: Initial support for x32.
3734
dd74ae06
CC
37352012-01-03 Cary Coutant <ccoutant@google.com>
3736
3737 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3738 Use abstract base class for GOT.
3739 * gold/output.h (class Output_data_got_base): New abstract base class.
3740 (class Output_data_got): Derive from new base class, adjust ctors.
3741 (Output_data_got::reserve_slot): Make virtual; rename to
3742 do_reserve_slot; Adjust callers.
3743 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3744 pointer to abstract base class.
3745 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3746
83896202
ILT
37472011-12-18 Ian Lance Taylor <iant@google.com>
3748
3749 * object.h (Relobj::local_symbol_value): New function.
3750 (Relobj::local_plt_offset): New function.
3751 (Relobj::local_has_got_offset): New function.
3752 (Relobj::local_got_offset): New function.
3753 (Relobj::set_local_got_offset): New function.
3754 (Relobj::do_local_symbol_value): New pure virtual function.
3755 (Relobj::do_local_plt_offset): Likewise.
3756 (Relobj::do_local_has_got_offset): Likewise.
3757 (Relobj::do_local_got_offset): Likewise.
3758 (Relobj::do_set_local_got_offset): Likewise.
3759 (Sized_relobj::do_local_has_got_offset): Rename from
3760 local_has_got_offset.
3761 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3762 (Sized_relobj::do_set_local_got_offset): Rename from
3763 set_local_got_offset.
3764 (Sized_relobj_file::do_local_plt_offset): Rename from
3765 local_plt_offset.
3766 (Sized_relobj_file::do_local_symbol_value): New function.
3767 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3768 local_plt_offset.
3769 * output.cc (Output_data_got::Got_entry::write): Change object to
3770 Relobj. Use local_symbol_value.
3771 (Output_data_got::add_global_with_rel): Change rel_dyn to
3772 Output_data_reloc_generic*. Use add_global_generic.
3773 (Output_data_got::add_global_with_rela): Remove. Change all
3774 callers to use add_global_with_rel.
3775 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3776 Output_data_reloc_generic*. Use add_global_generic.
3777 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3778 callers to use add_global_pair_with_rel.
3779 (Output_data_got::add_local): Change object to Relobj*.
3780 (Output_data_got::add_local_plt): Likewise.
3781 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3782 change rel_dyn to Output_data_reloc_generic*. Use
3783 add_local_generic.
3784 (Output_data_got::add_local_with_rela): Remove. Change all
3785 callers to use all_local_with_rel.
3786 (Output_data_got::add_local_pair_with_rel): Change object to
3787 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3788 add_output_section_generic.
3789 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3790 callers to use add_local_pair_with_rel.
3791 (Output_data_got::reserve_local): Change object to Relobj*.
3792 * output.h: (class Output_data_reloc_generic): Add pure virtual
3793 declarations for add_global_generic, add_local_generic,
3794 add_output_section_generic.
3795 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3796 functions for Output_data_reloc_generic. Update declarations for
3797 changes listed in output.cc.
3798 (class Output_data_got): Change template parameter to got_size.
3799 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3800 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3801 function.
3802 (Sized_relobj_incr::do_local_plt_offset): New function.
3803 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3804 add_global_generic.
3805
76677ad0
CC
38062011-12-17 Cary Coutant <ccoutant@google.com>
3807
3808 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3809 * resolve.cc (Symbol_table::resolve): Likewise.
3810 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3811 arrays.
3812 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3813
8b8dd8d5
ILT
38142011-12-16 Ian Lance Taylor <iant@google.com>
3815
3816 * output.h (Output_data_reloc_generic::add): Only call
3817 add_dynamic_reloc if this is a dynamic reloc section.
3818
d55525b9
L
38192011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3820
3821 PR gold/13505
3822 * target-reloc.h (apply_relocation): Replace <64, false> with
3823 <size, big_endian>.
3824
ff81c7c1
NC
38252011-11-25 Nick Clifton <nickc@redhat.com>
3826
3827 * po/it.po: New Italian translation.
3828
628f39be
SA
38292011-11-17 Sterling Augustine <saugustine@google.com>
3830
3831 * script.cc (script_include_directive): Implement.
3832 (read_script_file): New local variables name and search_path. Update
3833 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3834 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3835 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3836
98ef3ea4
SA
38372011-11-11 Sterling Augustine <saugustine@google.com>
3838
3839 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3840 (file_or_sections_cmd): Likewise.
3841
f4a8b6d7
DK
38422011-11-11 Doug Kwan <dougkwan@google.com>
3843
3844 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3845 if --just-symbols is given.
3846
29ab395d
DK
38472011-11-10 Doug Kwan <dougkwan@google.com>
3848
3849 PR gold/13362
3850 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3851 when processing data relocs.
3852 * reloc.h (Relocate_functions::rel_unaligned): New method.
3853 (Relocate_functions::pcrel_unaligned): Ditto.
3854 (Relocate_functions::rel32_unaligned): Ditto.
3855 (Relocate_functions::pcrel32_unaligned): Ditto.
3856
2c339f71
DK
38572011-11-09 Doug Kwan <dougkwan@google.com>
3858
3859 PR gold/13362
3860 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3861 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3862 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3863 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3864 (Relocate_functions::rel_unaligned): New.
3865 (Relocate_functions::rel32_unaligned): New.
3866 * target-reloc.h (relocate_for_relocatable): Add code to handle
3867 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3868 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3869 arm_unaligned_reloc_r): New targets.
3870 * testsuite/Makefile.in: Regenerate.
3871 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3872 linking.
3873
3f3cddf1
ILT
38742011-11-02 Ian Lance Taylor <iant@google.com>
3875
3876 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3877 NATIVE_LINKER.
3878 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
3879 * options.cc (General_options::finalize): Use library search path
3880 from configure script if specified. If not native and no sysroot,
3881 only search TOOLLIBDIR.
3882 * options.h (Search_directory::Search_directory): Change name to
3883 const std::string&.
3884 (General_options::add_to_library_path_with_sysroot): Change arg to
3885 const std::string&.
3886 * configure, Makefile.in, config.in: Rebuild.
3887
a8e2273b
ILT
38882011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3889
3890 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
3891 we are working around the ARM1176 Erratum.
3892 * options.h (General_options::fix_arm1176): Add option.
3893 * testsuite/Makefile.am: Add testcases, and keep current ones
3894 working.
3895 * testsuite/Makefile.in: Regenerate.
3896 * testsuite/arm_fix_1176.s: New file.
3897 * testsuite/arm_fix_1176.sh: Likewise.
3898
cd6eab1c
ILT
38992011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3900
3901 * arm.cc (Target_arm::Target_arm): Remove initialisation of
3902 may_use_blx_.
3903 (Target_arm::may_use_blx): Remove method.
3904 (Target_arm::set_may_use_blx): Likewise.
3905 (Target_arm::may_use_v4t_interworking): New method.
3906 (Target_arm::may_use_v5t_interworking): Likewise.
3907 (Target_arm::may_use_blx_): Remove member variable.
3908 (Arm_relocate_functions::arm_branch_common): Check for v5T
3909 interworking.
3910 (Arm_relocate_functions::thumb_branch_common): Likewise.
3911 (Reloc_stub::stub_type_for_reloc): Likewise.
3912 (Target_arm::do_finalize_sections): Correct interworking checks.
3913 * testsuite/Makefile.am: Add new tests.
3914 * testsuite/Makefile.in: Regenerate.
3915 * testsuite/arm_farcall_arm_arm.s: New test.
3916 * testsuite/arm_farcall_arm_arm.sh: Likewise.
3917 * testsuite/arm_farcall_arm_thumb.s: Likewise.
3918 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
3919 * testsuite/arm_farcall_thumb_arm.s: Likewise.
3920 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
3921 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
3922 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
3923
286adcf4
CC
39242011-10-31 Cary Coutant <ccoutant@google.com>
3925
3926 PR gold/13023
3927 * expression.cc (Expression::eval_with_dot): Add
3928 is_section_dot_assignment parameter.
3929 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
3930 absolute and assigning to dot within a section.
3931 * script-sections.cc
3932 (Output_section_element_assignment::set_section_addresses): Pass
3933 dot_section to set_if_absolute.
3934 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
3935 as is_section_dot_assignment flag to eval_with_dot.
3936 (Output_section_element_dot_assignment::set_section_addresses):
3937 Likewise.
3938 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
3939 parameter. Also set value if relative to dot_section; set the
3940 symbol's output_section.
3941 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
3942 parameter. Adjust all callers.
3943 (Expression::eval_maybe_dot): Likewise.
3944 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
3945 Adjust all callers.
3946 * testsuite/script_test_2.t: Test assignment of an absolute value
3947 to dot within an output section element.
3948
9634ed06
CC
39492011-10-31 Cary Coutant <ccoutant@google.com>
3950
3951 * options.h (class General_options): Add --[no-]gnu-unique options.
3952 * symtab.cc (Symbol_table::sized_write_globals): Convert
3953 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
3954
de4101c7
CC
39552011-10-31 Cary Coutant <ccoutant@google.com>
3956
3957 PR gold/13359
3958 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
3959 unnecessary assertion.
3960 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
3961
7257cc92
ST
39622011-10-31 Sriraman Tallam <tmsriram@google.com>
3963
3964 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3965 gc_mark_symbol.
3966 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3967 gc_mark_symbol.
3968 Change to just keep the section associated with symbol.
3969 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
3970 they are externally visible and --export-dynamic is turned on.
3971 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
3972
bfc34b3f
ILT
39732011-10-19 Ian Lance Taylor <iant@google.com>
3974
3975 PR gold/13163
3976 * script-sections.cc
3977 (Output_section_element_dot_assignment::needs_output_section): New
3978 function.
3979
ea0d8c47
ILT
39802011-10-19 Ian Lance Taylor <iant@google.com>
3981
3982 PR gold/13204
3983 * layout.cc (Layout::segment_precedes): Don't assert failure if a
3984 --section-start option was seen.
3985 * options.h (General_options::any_section_start): New function.
3986
abd242a9
DM
39872011-10-18 David S. Miller <davem@davemloft.net>
3988
3989 PR binutils/13301
3990 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
3991 member to track relocation locations that have moved during TLS
3992 reloc optimizations.
3993 (Target_sparc::Relocate::Relocate): Initialize to NULL.
3994 (Target_sparc::Relocate::relocate): Adjust view down by 4
3995 bytes if it matches reloc_adjust_addr_.
3996 (Target_sparc::Relocate::relocate_tls): Always move the
3997 __tls_get_addr call delay slot instruction forward 4 bytes when
3998 performing relaxation.
3999
bab9090f
CC
40002011-10-18 Cary Coutant <ccoutant@google.com>
4001
4002 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4003 (Output_file::map_no_anonymous): Check for non-zero
4004 return code from posix_fallocate.
4005
f7c5b166
CC
40062011-10-17 Cary Coutant <ccoutant@google.com>
4007
4008 PR gold/13245
4009 * plugin.cc (is_visible_from_outside): Check for symbols
4010 referenced from dynamic objects.
4011 * resolve.cc (Symbol_table::resolve): Don't count references
4012 from dynamic objects as references from real ELF files.
4013 * testsuite/plugin_test_2.sh: Adjust expected result.
4014
b490c0bb
CC
40152011-10-17 Cary Coutant <ccoutant@google.com>
4016
4017 * gold.cc: Include timer.h.
4018 (queue_middle_tasks): Stamp time.
4019 (queue_final_tasks): Likewise.
4020 * main.cc (main): Store timer in parameters. Print timers
4021 for each pass.
4022 * parameters.cc (Parameters::Parameters): Initialize timer_.
4023 (Parameters::set_timer): New function.
4024 (set_parameters_timer): New function.
4025 * parameters.h (Parameters::set_timer): New function.
4026 (Parameters::timer): New function.
4027 (Parameters::timer_): New data member.
4028 (set_parameters_timer): New function.
4029 * timer.cc (Timer::stamp): New function.
4030 (Timer::get_pass_time): New function.
4031 * timer.h (Timer::stamp): New function.
4032 (Timer::get_pass_time): New function.
4033 (Timer::pass_times_): New data member.
4034
f475cf7b
CC
40352011-10-17 Cary Coutant <ccoutant@google.com>
4036
4037 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4038 task for members of lib groups.
4039
cdd7e244
CC
40402011-10-17 Cary Coutant <ccoutant@google.com>
4041
4042 PR gold/13288
4f95c8b4 4043 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4044 (File_read::make_view): Move bounds check (replace with assert)...
4045 (File_read::find_or_make_view): ... to here.
4046
dfb45471
CC
40472011-10-12 Cary Coutant <ccoutant@google.com>
4048
4f95c8b4 4049 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4050 ::read returns less than requested size.
4051
53bbcc1b
CC
40522011-10-10 Cary Coutant <ccoutant@google.com>
4053
4f95c8b4 4054 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4055 Initialize defined_count_.
4056 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4057 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4058 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4059 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4060 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4061 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4062 member.
4063 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4064 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4065 Return zeroes instead of internal error.
4066
397b129b
CC
40672011-10-10 Cary Coutant <ccoutant@google.com>
4068
4069 PR gold/13249
4f95c8b4 4070 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4071 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4072 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4073 (Output_reloc::type_): Adjust size of bit field.
4074 (Output_reloc::use_plt_offset_): New bit field.
4075 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4076 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4077 flag. Adjust all callers.
4f95c8b4 4078 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4079 creating RELATIVE relocations.
4080
d5698657
NC
40812011-10-10 Nick Clifton <nickc@redhat.com>
4082
4083 * po/es.po: Updated Spanish translation.
4084 * po/fi.po: Updated Finnish translation.
4085
6a59a5c2
DN
40862011-10-03 Diego Novillo <dnovillo@google.com>
4087
4088 * options.cc (parse_uint): Fix dereference of RETVAL.
4089
f0558624
ST
40902011-09-29 Sriraman Tallam <tmsriram@google.com>
4091
4092 * layout.h (section_order_map_): New member.
4093 (get_section_order_map): New member function.
4094 * output.cc (Output_section::add_input_section): Check for patterns
4095 only when --section-ordering-file is specified.
4096 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4097 output_sections have been formed.
4098 * layout.cc (Layout_Layout): Initialize section_order_map_.
4099 * plugin.cc (update_section_order): Store order in order_map. Do not
4100 update the order.
4101 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4102 * testsuite/Makefile.in: Regenerate.
4103 * testsuite/plugin_section_order.c: New file.
4104 * testsuite/plugin_final_layout.cc: New file.
4105 * testsuite/plugin_final_layout.sh: New file.
4106
a7dac153
CC
41072011-09-29 Cary Coutant <ccoutant@google.com>
4108
4f95c8b4 4109 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4110 Check for NULL.
4f95c8b4 4111 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4112 symbols during incremental update.
4113 (Symbol_table::add_from_dynobj): Likewise.
4114
eebd87a5
ILT
41152011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4116 Ian Lance Taylor <iant@google.com>
4117
4118 * symtab.cc (Symbol_table::define_special_symbol): Always
4119 canonicalize version string.
4120
403a3331
CC
41212011-09-26 Cary Coutant <ccoutant@google.com>
4122
4f95c8b4
CC
4123 * gold.cc (queue_initial_tasks): Move option checks ...
4124 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4125 some options; make others fatal.
4126
235061c2
CC
41272011-09-26 Cary Coutant <ccoutant@google.com>
4128
4129 gcc PR lto/47247
4130 * plugin.cc (get_symbols_v2): New function.
4131 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4132 (is_referenced_from_outside): New function.
4133 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4134 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4135 (get_symbols): Pass version parameter.
4136 (get_symbols_v2): New function.
4137 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4138 parameter.
4139 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4140 (onload): Add LDPT_GET_SYMBOLS_V2.
4141 (all_symbols_read_hook): Use get_symbols_v2; check for
4142 LDPR_PREVAILING_DEF_IRONLY_EXP.
4143 * testsuite/plugin_test_3.sh: Update expected results.
4144
dc87f620
ILT
41452011-09-23 Simon Baldwin <simonb@google.com>
4146
4147 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4148 configuration options.
4149 * configure: Regenerate.
4150 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4151 * Makefile.in: Regenerate.
4152 * testsuite/Makefile.in: Regenerate.
4153
a8279f82
ST
41542011-09-19 Sriraman Tallam <tmsriram@google.com>
4155
4156 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4157
0c9350c8
CC
41582011-09-19 Cary Coutant <ccoutant@google.com>
4159
4160 * incremental.cc (can_incremental_update): Fix typo in comment.
4161 * incremental.h (can_incremental_update): Likewise.
4162
aa06ae28
CC
41632011-09-18 Cary Coutant <ccoutant@google.com>
4164
4165 * incremental.cc (can_incremental_update): New function.
4166 * incremental.h (can_incremental_update): New function.
4167 * layout.cc (Layout::init_fixed_output_section): Call it.
4168 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4169 * object.cc (Sized_relobj_file::do_layout): Call
4170 can_incremental_update.
4171
ebb300b2
CC
41722011-09-13 Cary Coutant <ccoutant@google.com>
4173
4174 * configure.ac: Check for glibc support for gnu_indirect_function
4175 support with static linking, setting automake conditional
4176 IFUNC_STATIC.
4177 * Makefile.in: Regenerate.
4178 * configure: Regenerate.
4179
4180 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4181 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4182 for IFUNC_STATIC.
4183 * testsuite/Makefile.in: Regenerate.
4184
1206d0d5
CC
41852011-09-13 Cary Coutant <ccoutant@google.com>
4186
4187 * incremental.cc (Sized_relobj_incr::do_layout): Call
4188 report_comdat_group for kept comdat sections.
4189 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4190 * testsuite/Makefile.in: Regenerate.
4191 * testsuite/incr_comdat_test_1.cc: New source file.
4192 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4193 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4194 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4195
40b29874
ILT
41962011-09-13 Ian Lance Taylor <iant@google.com>
4197
4198 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4199 variable external_symbols_offset.
4200
1b045aac
ILT
42012011-09-12 Ian Lance Taylor <iant@google.com>
4202
4203 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4204 triggered if object has no symbols.
4205
24c6c55a
DM
42062011-09-09 David S. Miller <davem@davemloft.net>
4207
4208 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4209 (Output_fill_debug_line::do_write): Likewise.
4210
66570254
CC
42112011-08-29 Cary Coutant <ccoutant@google.com>
4212
4213 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4214 casts to match formatting specs.
4215 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4216
8ea8cd50
CC
42172011-08-26 Cary Coutant <ccoutant@google.com>
4218
4219 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4220 remaining hole size when allocating.
4221 (Layout::make_output_section): Set fill methods for debug sections.
4222 * layout.h (Free_list::Free_list_node): Move from private to
4223 public.
4224 (Free_list::set_min_hole_size): New function.
4225 (Free_list::begin, Free_list::end): New functions.
4226 (Free_list::min_hole_): New data member.
4227 * output.cc: Include dwarf.h.
4228 (Output_fill_debug_info::do_minimum_hole_size): New function.
4229 (Output_fill_debug_info::do_write): New function.
4230 (Output_fill_debug_line::do_minimum_hole_size): New function.
4231 (Output_fill_debug_line::do_write): New function.
4232 (Output_section::Output_section): Initialize new data member.
4233 (Output_section::set_final_data_size): Ensure patch space is larger
4234 than minimum hole size.
4235 (Output_section::do_write): Fill holes in debug sections.
4236 * output.h (Output_fill): New class.
4237 (Output_fill_debug_info): New class.
4238 (Output_fill_debug_line): New class.
4239 (Output_section::set_free_space_fill): New function.
4240 (Output_section::free_space_fill_): New data member.
4241 * testsuite/Makefile.am (incremental_test_3): Add
4242 --incremental-patch option.
4243 (incremental_test_4): Likewise.
4244 (incremental_test_5): Likewise.
4245 (incremental_test_6): Likewise.
4246 (incremental_copy_test): Likewise.
4247 (incremental_common_test_1): Likewise.
4248 * testsuite/Makefile.in: Regenerate.
4249
7cf80422
NC
42502011-08-26 Nick Clifton <nickc@redhat.com>
4251
4252 * po/es.po: Updated Spanish translation.
4253
c3f7b0e5
CC
42542011-08-01 Cary Coutant <ccoutant@google.com>
4255
4256 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4257 * gold/testsuite/Makefile.in: Regenerate.
4258 * gold/testsuite/justsyms_exec.c: New source file.
4259 * gold/testsuite/justsyms_lib.c: New source file.
4260
9590bf25
CC
42612011-08-01 Cary Coutant <ccoutant@google.com>
4262
4263 * layout.cc (Layout::set_segment_offsets): Don't realign text
4264 segment if -Ttext was specified.
4265 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4266 file type.
4267 * object.h (Sized_relobj_file::e_type): New function.
4268 (Sized_relobj_file::e_type_): New data member.
4269 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4270 base address for ET_EXEC files.
4271 * target.cc (Target::do_make_elf_object_implementation): Allow
4272 ET_EXEC files with --just-symbols option.
4273
dcd8d12e
CC
42742011-07-28 Cary Coutant <ccoutant@google.com>
4275
4276 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4277 Add thread_number parameter.
4278 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4279 * workqueue-threads.cc
4280 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4281 current thread if its thread number is greater than desired thread
4282 count.
4283 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4284 Add thread_number parameter.
4285 (Workqueue::should_cancel_thread): Likewise.
4286 (Workqueue::find_runnable_or_wait): Pass thread_number to
4287 should_cancel_thread.
4288 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4289 parameter.
4290
804eb480
ST
42912011-07-22 Sriraman Tallam <tmsriram@google.com>
4292
4293 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4294 only after checking if it cannot be forced local.
4295 * symtab.h (is_externally_visible): Check if the symbol is not forced
4296 local.
4297
f1ddb600
ILT
42982011-07-15 Ian Lance Taylor <iant@google.com>
4299
4300 * options.h (class General_options): Add --print-output-format.
4301 Move -EL next to -EB, for better --help output.
4302 * target-select.cc: Include <cstdio>, "options.h", and
4303 "parameters.h".
4304 (Target_selector::do_target_bfd_name): New function.
4305 (print_output_format): New function.
4306 * target-select.h (class Target_selector): Update declarations.
4307 (Target_selector::target_bfd_name): New function.
4308 (print_output_format): Declare.
4309 * main.cc: Include "target-select.h".
4310 (main): Handle --print-output-format.
4311 * gold.cc: Include "target-select.h".
4312 (queue_initial_tasks): Handle --print-output-format when there are
4313 no input files.
4314 * parameters.cc (parameters_force_valid_target): Give a better
4315 error message if -EB/-EL does not match target.
4316 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4317 function.
4318
7d172687
ILT
43192011-07-15 Ian Lance Taylor <iant@google.com>
4320
4321 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4322 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4323 (Output_data_plt_i386::do_write): Write address of .dynamic
4324 section to first entry in .got.plt section.
4325 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4326 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4327 Initialize layout_.
4328 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4329 section to first entry in .got.plt section.
4330 * layout.h (Layout::dynamic_section): New function.
4331
e9552f7e
ST
43322011-07-13 Sriraman Tallam <tmsriram@google.com>
4333
4334 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4335 to claim_file call.
4336 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4337 input_section_position_, and input_section_glob_.
4338 (read_layout_from_file): Call function section_ordering_specified.
4339 * layout.h (is_section_ordering_specified): New function.
4340 (section_ordering_specified): New function.
4341 (section_ordering_specified_): New boolean member.
4342 * main.cc(main): Call load_plugins after layout object is defined.
4343 * output.cc (Output_section::add_input_section): Use
4344 function section_ordering_specified to check if section ordering is
4345 needed.
4346 * output.cc (Output_section::add_relaxed_input_section): Use
4347 function section_ordering_specified to check if section ordering is
4348 needed.
4349 (Output_section::update_section_layout): New function.
4350 (Output_section::sort_attached_input_sections): Check if input section
4351 must be reordered.
4352 * output.h (Output_section::update_section_layout): New function.
4353 * plugin.cc (get_section_count): New function.
4354 (get_section_type): New function.
4355 (get_section_name): New function.
4356 (get_section_contents): New function.
4357 (update_section_order): New function.
58797674 4358 (allow_section_ordering): New function.
e9552f7e
ST
4359 (Plugin::load): Add the new interfaces to the transfer vector.
4360 (Plugin_manager::load_plugins): New parameter.
4361 (Plugin_manager::all_symbols_read): New parameter.
4362 (Plugin_manager::claim_file): New parameter. Save the elf object for
4363 unclaimed objects.
4364 (Plugin_manager::get_elf_object): New function.
4365 (Plugin_manager::get_view): Change to directly use the bool to check
4366 if get_view is called from claim_file_hook.
4367 * plugin.h (input_objects): New function
4368 (Plugin__manager::load_plugins): New parameter.
4369 (Plugin_manager::claim_file): New parameter.
4370 (Plugin_manager::get_elf_object): New function.
4371 (Plugin_manager::in_claim_file_handler): New function.
4372 (Plugin_manager::in_claim_file_handler_): New member.
4373 (layout): New function.
4374 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4375 handler with an extra parameter. Make the elf object before calling
4376 claim_file handler.
4377 * testsuite/plugin_test.c (get_section_count): New function pointer.
4378 (get_section_type): New function pointer.
4379 (get_section_name): New function pointer.
4380 (get_section_contents): New function pointer.
4381 (update_section_order): New function pointer.
4382 (allow_section_ordering): New function pointer.
4383 (onload): Check if the new interfaces exist.
4384
9446efde
ILT
43852011-07-13 Ian Lance Taylor <iant@google.com>
4386
4387 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4388 relro section.
4389 * x86_64.cc (Target_x86_64::got_section): Likewise.
4390 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4391 (relro_now_test_SOURCES): New variable.
4392 (relro_now_test_DEPENDENCIES): New variable.
4393 (relro_now_test_LDFLAGS): New variable.
4394 (relro_now_test_LDADD): New variable.
4395 (relro_now_test.so): New target.
4396 * testsuite/Makefile.in: Rebuild.
4397
07aa62f2
ILT
43982011-07-12 Ian Lance Taylor <iant@google.com>
4399
4400 PR gold/12980
4401 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4402 GLOB_DAT relocation rather than a RELATIVE relocation for a
4403 protected symbol when creating a shared library.
4404 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4405 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4406 * testsuite/protected_main_1.cc (main): Test that protected
4407 function has same address.
4408
e2153196
ILT
44092011-07-11 Ian Lance Taylor <iant@google.com>
4410
4411 PR gold/12979
4412 * options.h (class General_options): Add -Bgroup.
4413 * options.cc (General_options::finalize): If -Bgroup is set,
4414 default to --unresolved-symbols=report-all.
4415 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4416 * target-reloc.h (issue_undefined_symbol_error): Handle
4417 --unresolved-symbols=report-all.
4418
6daf5215
ILT
44192011-07-08 Ian Lance Taylor <iant@google.com>
4420
4421 PR gold/11985
4422 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4423 if linker script discards key sections.
4424 (Layout::create_dynamic_symtab): Likewise.
4425 (Layout::assign_local_dynsym_offsets): Likewise.
4426 (Layout::sized_create_version_sections): Likewise.
4427 (Layout::create_interp): Likewise.
4428 (Layout::finish_dynamic_section): Likewise.
4429 (Layout::set_dynamic_symbol_size): Likewise.
4430
beabb2c6
ILT
44312011-07-08 Ian Lance Taylor <iant@google.com>
4432
4433 PR gold/12386
4434 * options.h (class General_options): Add --unresolved-symbols.
4435 * target-reloc.h (issue_undefined_symbol_error): Check
4436 --unresolved-symbols. Add comments.
4437
9c16daf1
ILT
44382011-07-08 Ian Lance Taylor <iant@google.com>
4439
4440 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4441 expression more complex.
4442
191f1a2d
ILT
44432011-07-08 Ian Lance Taylor <iant@google.com>
4444
4445 PR gold/11317
4446 * target-reloc.h (issue_undefined_symbol_error): New inline
4447 function, broken out of relocate_section.
4448 (relocate_section): Call issue_undefined_symbol_error.
4449 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4450 there is no TLS segment if we are about to issue an undefined
4451 symbol error.
4452 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4453
62855347
ILT
44542011-07-08 Ian Lance Taylor <iant@google.com>
4455
4456 PR gold/12279
4457 * resolve.cc (Symbol_table::should_override): Add fromtype
4458 parameter. Change all callers. Give error when linking together
4459 TLS and non-TLS symbol.
4460 (Symbol_table::should_override_with_special): Add fromtype
4461 parameter. Change all callers.
4462 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4463 there is no TLS segment if we have reported some errors.
4464 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4465
67181c72
ILT
44662011-07-08 Ian Lance Taylor <iant@google.com>
4467
4468 PR gold/12372
4469 * target.h (Target::plt_address_for_global): New function.
4470 (Target::plt_address_for_local): New function.
4471 (Target::plt_section_for_global): Remove.
4472 (Target::plt_section_for_local): Remove.
4473 (Target::do_plt_address_for_global): New virtual function.
4474 (Target::do_plt_address_for_local): New virtual function.
4475 (Target::do_plt_section_for_global): Remove.
4476 (Target::do_plt_section_for_local): Remove.
4477 (Target::register_global_plt_entry): Add Symbol_table and Layout
4478 parameters.
4479 * output.cc (Output_data_got::Got_entry::write): Use
4480 plt_address_for_global and plt_address_for_local.
4481 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4482 address of output section.
4483 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4484 got_irelative_, and irelative_count_ fields. Update
4485 declarations.
4486 (Output_data_plt_i386::has_irelative_section): New function.
4487 (Output_data_plt_i386::entry_count): Add irelative_count_.
4488 (Output_data_plt_i386::set_final_data_size): Likewise.
4489 (class Target_i386): Add got_irelative_ and rel_irelative_
4490 fields. Update declarations.
4491 (Target_i386::Target_i386): Initialize new fields.
4492 (Target_i386::do_plt_address_for_global): New function replacing
4493 do_plt_section_for_global.
4494 (Target_i386::do_plt_address_for_local): New function replacing
4495 do_plt_section_for_local.
4496 (Target_i386::got_section): Create got_irelative_.
4497 (Target_i386::rel_irelative_section): New function.
4498 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4499 fields. Don't define __rel_iplt_{start,end}.
4500 (Output_data_plt_i386::add_entry): Add symtab and layout
4501 parameters. Change all callers. Use different PLT and GOT for
4502 IFUNC symbols.
4503 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4504 layout parameters. Change all callers. Use different PLT and
4505 GOT.
4506 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4507 (Output_data_plt_i386::rel_irelative): New function.
4508 (Output_data_plt_i386::address_for_global): New function.
4509 (Output_data_plt_i386::address_for_local): New function.
4510 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4511 IRELATIVE GOT when changing IFUNC GOT entries.
4512 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4513 reloc.
4514 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4515 if we didn't create an IRELATIVE GOT.
4516 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4517 plt_address_for_local.
4518 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4519 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4520 got_irelative_, and irelative_count_ fields. Update
4521 declarations.
4522 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4523 Initialize new fields. Remove symtab parameter. Change all
4524 callers.
4525 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4526 irelative_count_.
4527 (Output_data_plt_x86_64::has_irelative_section): New function.
4528 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4529 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4530 fields. Update declarations.
4531 (Target_x86_64::Target_x86_64): Initialize new fields.
4532 (Target_x86_64::do_plt_address_for_global): New function replacing
4533 do_plt_section_for_global.
4534 (Target_x86_64::do_plt_address_for_local): New function replacing
4535 do_plt_section_for_local.
4536 (Target_x86_64::got_section): Create got_irelative_.
4537 (Target_x86_64::rela_irelative_section): New function.
4538 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4539 all callers. Don't create __rel_iplt_{start,end}.
4540 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4541 parameters. Change all callers. Use different PLT and GOT for
4542 IFUNC symbols.
4543 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4544 layout parameters. Change all callers. Use different PLT and
4545 GOT.
4546 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4547 parameters. Change all callers. Use different PLT and GOT for
4548 IFUNC symbols.
4549 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4550 (Output_data_plt_x86_64::rela_irelative): New function.
4551 (Output_data_plt_x86_64::address_for_global): New function.
4552 (Output_data_plt_x86_64::address_for_local): New function.
4553 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4554 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4555 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4556 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4557 parameters.
4558 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4559 reloc.
4560 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4561 symbols if we didn't create an IRELATIVE GOT.
4562 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4563 plt_address_for_local.
4564 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4565 * testsuite/ifuncvar1.c: New test file.
4566 * testsuite/ifuncvar2.c: New test file.
4567 * testsuite/ifuncvar3.c: New test file.
4568 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4569 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4570 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4571 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4572 * testsuite/Makefile.in: Rebuild.
4573
33c15b45
CC
45742011-07-07 Cary Coutant <ccoutant@google.com>
4575
4576 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4577 (two_file_test_1_ndebug.o): Likewise.
4578 (two_file_test_1b_ndebug.o): Likewise.
4579 (two_file_test_2_ndebug.o): Likewise.
4580 (two_file_test_main_ndebug.o): Likewise.
4581 (incremental_test_2): Link with no-debug versions.
4582
f48b5fb7
CC
45832011-07-06 Cary Coutant <ccoutant@google.com>
4584
4585 * gold/incremental.cc
4586 (Output_section_incremental_inputs::write_info_blocks): Check for
4587 hidden and internal symbols.
4588
221597a5
CC
45892011-07-06 Cary Coutant <ccoutant@google.com>
4590
4591 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4592 Check disposition for startup file.
4593 (Incremental_inputs::report_command_line): Ignore
4594 --incremental-startup-unchanged option.
4595 * options.cc (General_options::parse_incremental_startup_unchanged):
4596 New function.
4597 (General_options::General_options): Initialize new data member.
4598 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4599 (General_options): Add --incremental-startup-unchanged option.
4600 (General_options::incremental_startup_disposition): New function.
4601 (General_options::incremental_startup_disposition_): New data member.
4602
e24719f6
CC
46032011-07-06 Cary Coutant <ccoutant@google.com>
4604
4605 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4606 input file index to Script_info ctor.
4607 (Sized_incremental_binary::do_file_has_changed): Find the
4608 command-line argument for files named in scripts.
4609 * incremental.h (Script_info::Script_info): New ctor
4610 with input file index.
4611 (Script_info::input_file_index): New function.
4612 (Script_info::input_file_index_): New data member.
4613 (Incremental_binary::get_library): Add const.
4614 (Incremental_binary::get_script_info): Add const.
4615 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4616 * testsuite/Makefile.am (incremental_test_5): New test case.
4617 (incremental_test_6): New test case.
4618 * testsuite/Makefile.in: Regenerate.
4619
8f7c81e8
CC
46202011-07-06 Cary Coutant <ccoutant@google.com>
4621
4622 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4623 debug output when command lines differ.
4624
9fbd3822
CC
46252011-07-06 Cary Coutant <ccoutant@google.com>
4626
4627 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4628 --incremental-patch option.
4629 * layout.cc (Free_list::allocate): Extend allocation beyond original
4630 end if enabled.
4631 (Layout::make_output_section): Mark sections that should get
4632 patch space.
4633 * options.cc (parse_percent): New function.
4634 * options.h (parse_percent): New function.
4635 (DEFINE_percent): New macro.
4636 (General_options): Add --incremental-patch option.
4637 * output.cc (Output_section::Output_section): Initialize new data
4638 members.
4639 (Output_section::add_input_section): Print section name when out
4640 of patch space.
4641 (Output_section::add_output_section_data): Likewise.
4642 (Output_section::set_final_data_size): Add patch space when
4643 doing --incremental-full.
4644 (Output_section::do_reset_address_and_file_offset): Remove patch
4645 space.
4646 (Output_segment::set_section_list_addresses): Print debug output
4647 only if --incremental-update.
4648 * output.h (Output_section::set_is_patch_space_allowed): New function.
4649 (Output_section::is_patch_space_allowed_): New data member.
4650 (Output_section::patch_space_): New data member.
4651 * parameters.cc (Parameters::incremental_full): New function.
4652 * parameters.h (Parameters::incremental_full): New function
4653 * testsuite/Makefile.am (incremental_test_2): Add test for
4654 --incremental-patch option.
4655 * testsuite/Makefile.in: Regenerate.
4656 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4657 (t18): Remove function body.
4658
f6cccc2c
DK
46592011-07-05 Doug Kwan <dougkwan@google.com>
4660
4661 PR gold/12771
4662 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4663 Arm_Address type for relocation result.
4664 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4665 overflow check.
4666 (Arm_relocate_functions::abs32): Use unaligned access.
4667 (Arm_relocate_functions::rel32): Ditto.
4668 (Arm_relocate_functions::prel31): Ditto.
4669 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4670 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4671 static data relocations.
4672 * testsuite/Makefile.in: Regnerate.
4673 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4674
28a13fec
ILT
46752011-07-05 Ian Lance Taylor <iant@google.com>
4676
4677 PR gold/12392
4678 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4679 symbols if necessary.
4680 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4681
24d47b34
ILT
46822011-07-05 Ian Lance Taylor <iant@google.com>
4683
4684 PR gold/12952
4685 * resolve.cc (Symbol::override_base_with_special): Simply override
4686 version with special symbol version, ignoring previous version.
4687
41f9cbbe
ILT
46882011-07-05 Ian Lance Taylor <iant@google.com>
4689
4690 * object.cc (Sized_relobj_file::include_section_group): Add
4691 information to comment about signature location.
4692
886288f1
ILT
46932011-07-02 Ian Lance Taylor <iant@google.com>
4694
4695 PR gold/12957
4696 * options.h (class General_options): Add -f and -F.
4697 * options.cc (General_options::finalize): Fatal error if -f/-F
4698 are used without -shared.
4699 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4700
ae3a6d4f
ILT
47012011-07-02 Ian Lance Taylor <iant@google.com>
4702
4703 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4704
21131061
ILT
47052011-07-01 Ian Lance Taylor <iant@google.com>
4706
4707 PR gold/12525
4708 PR gold/12952
4709 * resolve.cc (Symbol::override_base_with_special): Don't override
4710 the version if the overriding symbol has a different name.
4711 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4712 all callers. If we give an error about an undefined version,
4713 define the base version if necessary.
4714 * dynobj.h (class Versions): Update declaration.
4715 * testsuite/weak_alias_test_5.cc: New file.
4716 * testsuite/weak_alias_test.script: New file.
4717 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4718 and versioned_alias have the right value, and call t2.
4719 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4720 weak_alias_test_5.so.
4721 (weak_alias_test_LDADD): Likewise.
4722 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4723 * testsuite/Makefile.in: Rebuild.
4724
611062c0
ILT
47252011-07-01 Ian Lance Taylor <iant@google.com>
4726
4727 PR gold/12525
4728 * options.h (class General_options): Support -z notext.
4729 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4730 -Wl,-z,notext.
4731 (two_file_shared_nonpic.so): Likewise.
4732 (two_file_shared_mixed.so): Likewise.
4733 (two_file_shared_mixed_1.so): Likewise.
4734 (weak_undef_lib_nonpic.so): Likewise.
4735 (alt/weak_undef_lib_nonpic.so): Likewise.
4736 (tls_test_shared_nonpic.so): Likewise.
4737 * testsuite/Makefile.in: Rebuild.
4738
328c7c2f
ILT
47392011-07-01 Ian Lance Taylor <iant@google.com>
4740
4741 PR gold/12525
4742 * configure.ac: Test whether static linking works, setting
4743 the automake conditional HAVE_STATIC.
4744 * testsuite/Makefile.am: Disable tests using -static if
4745 HAVE_STATIC is not true.
4746 * configure, testsuite/Makefile.in: Rebuild.
4747
02d7cd44
ILT
47482011-07-01 Ian Lance Taylor <iant@google.com>
4749
4750 PR gold/12525
4751 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4752 Assert if we see DW_EH_PE_indirect.
4753 * target.h (Target::ehframe_datarel_base): New function.
4754 (Target::do_ehframe_datarel_base): New target function.
4755 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4756 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4757 function.
4758
07a60597
ILT
47592011-07-01 Ian Lance Taylor <iant@google.com>
4760
4761 PR gold/12571
4762 * options.h (class General_options): Add
4763 --ld-generated-unwind-info.
4764 * ehframe.cc (Fde::write): Add address parameter. Change all
4765 callers. If associated with PLT, fill in address and size.
4766 (Cie::set_output_offset): Only add merge mapping if there is an
4767 object.
4768 (Cie::write): Add address parameter. Change all callers.
4769 (Eh_frame::add_ehframe_for_plt): New function.
4770 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4771 input_offset_ fields into union u_, with new plt field.
4772 (Fde::Fde): Adjust for new union field.
4773 (Fde::Fde) [Output_data version]: New constructor.
4774 (Fde::add_mapping): Only add merge mapping if there is an object.
4775 (class Cie): Update declarations.
4776 (class Eh_frame): Declare add_ehframe_for_plt.
4777 * layout.cc (Layout::layout_eh_frame): Break out code into
4778 make_eh_frame_section, and call it.
4779 (Layout::make_eh_frame_section): New function.
4780 (Layout::add_eh_frame_for_plt): New function.
4781 * layout.h (class Layout): Update declarations.
4782 * merge.cc (Merge_map::add_mapping): Add assertion.
4783 * i386.cc: Include "dwarf.h".
4784 (class Output_data_plt_i386): Make first_plt_entry,
4785 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4786 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4787 and plt_eh_frame_fde.
4788 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4789 boundary. Call add_eh_frame_for_plt if appropriate.
4790 * x86_64.cc: Include "dwarf.h".
4791 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4792 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4793 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4794 and plt_eh_frame_fde.
4795 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4796 appropriate.
4797
14788a3f
ILT
47982011-06-29 Ian Lance Taylor <iant@google.com>
4799
4800 PR gold/12629
4801 * object.cc (Sized_relobj_file::layout_section): Change shdr
4802 parameter to be const.
4803 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4804 out of do_layout.
4805 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4806 appropriate. Call layout_eh_frame_section.
4807 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4808 sections.
4809 * object.h (class Sized_relobj_file): Update declarations.
4810
6c21fce1
ILT
48112011-06-29 Ian Lance Taylor <iant@google.com>
4812
37e41b03 4813 PR gold/12652
6c21fce1
ILT
4814 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4815 modifier.
4816 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4817
4d5e4e62
ILT
48182011-06-29 Ian Lance Taylor <iant@google.com>
4819
4820 PR gold/12675
4821 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4822 SHT_X86_64_UNWIND.
4823 * layout.cc (Layout::layout_eh_frame): Likewise.
4824
886f533a
ILT
48252011-06-29 Ian Lance Taylor <iant@google.com>
4826
4827 PR gold/12695
4828 * layout.cc (Layout::symtab_section_shndx): New function.
4829 * layout.h (class Layout): Declare symtab_section_shndx.
4830 * output.cc (Output_section::write_header): Call it.
4831
f3ae1b28
ILT
48322011-06-29 Ian Lance Taylor <iant@google.com>
4833
4834 PR gold/12818
4835 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4836 symbols which are not used in a relocation.
4837
aecf301f
ILT
48382011-06-28 Ian Lance Taylor <iant@google.com>
4839
4840 PR gold/12898
4841 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4842 script create indistinguishable segments.
4843 (Layout::set_segment_offsets): Use stable_sort when sorting
4844 segments. Pass this to Compare_segments constructor.
4845 * layout.h (class Layout): Make segment_precedes non-static.
4846 (class Compare_segments): Change from struct to class. Add
4847 layout_ field. Add constructor.
4848 * script-sections.cc
4849 (Script_sections::attach_sections_using_phdrs_clause): Rename
4850 local orphan to is_orphan. Don't report failure to put empty
4851 section in segment. On attachment failure, report name of
4852 section, and attach to first PT_LOAD segment.
4853
03ef7571
ILT
48542011-06-28 Ian Lance Taylor <iant@google.com>
4855
4856 PR gold/12934
4857 * target-select.cc (Target_selector::Target_selector): Add
4858 emulation parameter. Change all callers.
4859 (select_target_by_bfd_name): Rename from select_target_by_name.
4860 Change all callers.
4861 (select_target_by_emulation): New function.
4862 (supported_emulation_names): New function.
4863 * target-select.h (class Target_selector): Add emulation_ field.
4864 Update declarations.
4865 (Target_selector::recognize_by_bfd_name): Rename from
4866 recognize_by_name. Change all callers.
4867 (Target_selector::supported_bfd_names): Rename from
4868 supported_names. Change all callers.
4869 (Target_selector::recognize_by_emulation): New function.
4870 (Target_selector::supported_emulations): New function.
4871 (Target_selector::emulation): New function.
4872 (Target_selector::do_recognize_by_bfd_name): Rename from
4873 do_recognize_by_name. Change all callers.
4874 (Target_selector::do_supported_bfd_names): Rename from
4875 do_supported_names. Change all callers.
4876 (Target_selector::do_recognize_by_emulation): New function.
4877 (Target_selector::do_supported_emulations): New function.
4878 (select_target_by_bfd_name): Change name in declaration.
4879 (select_target_by_emulation): Declare.
4880 (supported_emulation_names): Declare.
4881 * parameters.cc (parameters_force_valid_target): Try to find
4882 target based on emulation from -m option.
4883 * options.h (class General_options): Change doc string for -m.
4884 * options.cc (help): Print emulations.
4885 (General_options::parse_V): Likewise.
4886 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
4887 Add emulation parameter. Change all callers.
4888
200b2bb9
ILT
48892011-06-28 Ian Lance Taylor <iant@google.com>
4890
4891 * target.h (class Target): Add osabi_ field.
4892 (Target::osabi): New function.
4893 (Target::set_osabi): New function.
4894 (Target::Target): Initialize osabi_.
4895 (Target::do_adjust_elf_header): Make pure virtual.
4896 (Sized_target::do_adjust_elf_header): Declare.
4897 * target.cc (Sized_target::do_adjust_elf_header): New function.
4898 (class Sized_target): Instantiate all versions.
4899 * freebsd.h (class Target_freebsd): Remove.
4900 (Target_selector_freebsd::do_recognize): Call set_osabi on
4901 Target.
4902 (Target_selector_freebsd::do_recognize_by_name): Likewise.
4903 (Target_selector_freebsd::set_osabi): Remove.
4904 * i386.cc (class Target_i386): Inherit from Sized_target rather
4905 than Target_freebsd.
4906 * x86_64.cc (class Target_x86_64): Likewise.
4907
b3ce541e
ILT
49082011-06-28 Ian Lance Taylor <iant@google.com>
4909
4910 * target.h (Target::can_check_for_function_pointers): Rewrite.
4911 Make non-virtual.
4912 (Target::can_icf_inline_merge_sections): Likewise.
4913 (Target::section_may_have_icf_unsafe_poineters): Likewise.
4914 (Target::Target_info): Add can_icf_inline_merge_sections field.
4915 (Target::do_can_check_for_function_pointers): New virtual
4916 function.
4917 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
4918 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
4919 from can_check_for_function_pointers, move in file.
4920 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
4921 section_may_have_icf_unsafe_poineters, move in file.
4922 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
4923 * i386.cc (Target_i386::do_can_check_for_function_pointers):
4924 Rename from can_check_for_function_pointers, move in file.
4925 (Target_i386::can_icf_inline_merge_sections): Remove.
4926 (Target_i386::i386_info): Initialize
4927 can_icf_inline_merge_sections.
4928 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
4929 Initialize can_icf_inline_merge_sections.
4930 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
4931 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
4932 Rename from can_check_for_function_pointers, move in file.
4933 (Target_x86_64::can_icf_inline_merge_sections): Remove.
4934 (Target_x86_64::x86_64_info): Initialize
4935 can_icf_inline_merge_sections.
4936 * testsuite/testfile.cc (Target_test::test_target_info):
4937 Likewise.
4938 * icf.cc (get_section_contents): Correct formatting.
4939
6d1c4efb
ILT
49402011-06-27 Ian Lance Taylor <iant@google.com>
4941
4942 * symtab.cc (Symbol::versioned_name): New function.
4943 (Symbol_table::add_to_final_symtab): Use versioned_name when
4944 appropriate.
4945 (Symbol_table::sized_write_symbol): Likewise.
4946 * symtab.h (class Symbol): Declare versioned_name.
4947 * stringpool.h (class Stringpool_template): Add variant of add
4948 which takes a std::basic_string.
4949 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
4950 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
4951 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
4952 (ver_test_12.o): New target.
4953 * testsuite/Makefile.in: Rebuild.
4954
57eb9b50
DK
49552011-06-27 Doug Kwan <dougkwan@google.com>
4956
4957 * arm.cc (Arm_relocate_functions::thm_jump8,
4958 Arm_relocate_functions::thm_jump11): Use a wider signed
4959 type to compute offset.
4960 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
4961 arm_thm_jump8.
4962 * testsuite/Makefile.in: Regenerate.
4963 * testsuite/arm_branch_in_range.sh: Check test results of
4964 arm_thm_jump11 and arm_thm_jump8.
4965 * testsuite/arm_thm_jump11.s: New test source file.
4966 * testsuite/arm_thm_jump11.t: New linker script.
4967 * testsuite/arm_thm_jump8.s: New test source file.
4968 * testsuite/arm_thm_jump8.t: New linker script.
4969
487b39df
ILT
49702011-06-24 Ian Lance Taylor <iant@google.com>
4971
4972 * layout.cc: Include "object.h".
4973 (ctors_sections_in_init_array): New static variable.
4974 (Layout::is_ctors_in_init_array): New function.
4975 (Layout::layout): Add entry to ctors_sections_in_init_array if
4976 appropriate.
4977 * layout.h (class Layout): Declare is_ctors_in_init_array.
4978 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
4979 is_ctors_reverse_view is set.
4980 (Sized_relobj_file::write_sections): Add layout parameter. Change
4981 all callers. Set is_ctors_reverse_view field of View_size.
4982 (Sized_relobj_file::reverse_words): New function.
4983 * object.h (Sized_relobj_file::View_size): Add
4984 is_ctors_reverse_view field.
4985 (class Sized_relobj_file): Update declarations.
4986 * testsuite/initpri3.c: New test.
4987 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
4988 initpri3b.
4989 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
4990 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
4991 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
4992 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
4993 * testsuite/Makefile.in: Rebuild.
4994
472076e4
CC
49952011-06-24 Cary Coutant <ccoutant@google.com>
4996
4997 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
4998 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
4999 (debug_msg_cdebug.err): New targets.
5000 * testsuite/Makefile.in: Regenerate.
5001 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5002 Fix checks for link with shared library.
5003
a60af0db
DK
50042011-06-24 Doug Kwan <dougkwan@google.com>
5005
5006 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5007 skip empty text sections.
5008 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5009
5393d741
ILT
50102011-06-22 Ian Lance Taylor <iant@google.com>
5011
5012 PR gold/12910
5013 * options.h (class General_options): Add --ctors-in-init-array.
5014 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5015 friends as SHT_PROGBITS for merging sections.
5016 (Layout::layout): Remove special handling of .init_array and
5017 friends. Don't sort if doing relocatable link. Sort for .ctors
5018 and .dtors if ctors_in_init_array.
5019 (Layout::make_output_section): Force correct section types for
5020 .init_array and friends. Don't sort if doing relocatable link,
5021 Don't sort .ctors and .dtors if ctors_in_init_array.
5022 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5023 (Layout::output_section_name): Add relobj parameter. Change all
5024 callers. Handle .ctors. and .dtors. in code rather than table.
5025 Handle .ctors and .dtors if ctors_in_init_array.
5026 (Layout::match_file_name): New function, moved from output.cc.
5027 * layout.h (class Layout): Update declarations.
5028 * output.cc: Include "layout.h".
5029 (Input_section_sort_entry::get_priority): New function.
5030 (Input_section_sort_entry::match_file_name): Just call
5031 Layout::match_file_name.
5032 (Output_section::Input_section_sort_init_fini_compare::operator()):
5033 Handle .ctors and .dtors. Sort by explicit priority rather than
5034 by name.
5035 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5036 * testsuite/initpri2.c: New test.
5037 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5038 (check_PROGRAMS): Add initpri2.
5039 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5040 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5041 * configure, testsuite/Makefile.in: Rebuild.
5042
e1f74f98
ILT
50432011-06-19 Ian Lance Taylor <iant@google.com>
5044
5045 PR gold/12880
5046 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5047 .interp section to a PT_INTERP segment even if we have seen a
5048 --dynamic-linker option. Don't do it if we have seen a PHDRS
5049 clause in a linker script.
5050 (Layout::finalize): Don't create a .interp section if we've
5051 already create a PT_INTERP segment.
5052 (Layout::create_interp): Always call choose_output_section (revert
5053 patch of 2011-06-17). Don't create PT_INTERP segment.
5054 * script-sections.cc
5055 (Script_sections::create_note_and_tls_segments): Add a .interp
5056 section to a PT_INTERP segment even if we have seen a
5057 --dynamic-linker option.
5058
766f91bb
ILT
50592011-06-18 Ian Lance Taylor <iant@google.com>
5060
5061 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5062 merely because a non-PT_LOAD segment has a dynamic reloc.
5063
0d212c3a
ILT
50642011-06-18 Ian Lance Taylor <iant@google.com>
5065
5066 * layout.cc (Layout::finish_dynamic_section): Don't create
5067 DT_FLAGS entry if not needed.
5068
911a5072
ILT
50692011-06-18 Ian Lance Taylor <iant@google.com>
5070
5071 PR gold/12745
5072 * layout.cc (Layout::layout_eh_frame): Correct handling of
5073 writable .eh_frame section.
5074
534b4e5f
ILT
50752011-06-17 Ian Lance Taylor <iant@google.com>
5076
5077 PR gold/12893
5078 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5079 symbol is redefined with the exact same object and value.
5080
10b4f102
ILT
50812011-06-17 Ian Lance Taylor <iant@google.com>
5082
5083 PR gold/12880
5084 * layout.h (class Layout): Add interp_segment_ field.
5085 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5086 (Layout::attach_allocated_section_to_segment): If making shared
5087 library, put .interp section in PT_INTERP segment.
5088 (Layout::finalize): Also call create_interp if -dynamic-linker
5089 option was used.
5090 (Layout::create_interp): Assert that there is no PT_INTERP
5091 segment. If not using a SECTIONS clause, use make_output_section.
5092 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5093 * script-sections.cc
5094 (Script_sections::create_note_and_tls_segments): If making shared
5095 library, put .interp section in PT_INTERP segment.
5096
a29b0dad
ILT
50972011-06-17 Ian Lance Taylor <iant@google.com>
5098
e588ea8d
ILT
5099 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5100 when making a shared library.
5101
51022011-06-17 Ian Lance Taylor <iant@google.com>
5103
5104 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5105 parameter. Change all callers. Don't issue warning about PC32
5106 against locally defined symbol.
a29b0dad 5107
9d3b0698
ILT
51082011-06-16 Ian Lance Taylor <iant@google.com>
5109
5110 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5111 occurs in same object.
5112
85b0f90c
AM
51132011-06-14 Alan Modra <amodra@gmail.com>
5114
5115 * po/POTFILES.in: Regenerate.
5116
a94907d9
ILT
51172011-06-09 Ian Lance Taylor <iant@google.com>
5118
5119 * script-sections.cc
5120 (Orphan_output_section::set_section_addresses): For a relocatable
5121 link set address to 0.
5122
4fb3a1c3
CC
51232011-06-09 Cary Coutant <ccoutant@google.com>
5124
5125 PR gold/12804
5126 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5127 used with --compress-debug-sections.
5128 * gold/object.cc (Sized_relobj_file::do_layout): Report
5129 uncompressed size of compressed input sections.
5130
61220854
CC
51312011-06-08 Cary Coutant <ccoutant@google.com>
5132
5133 PR gold/12804
5134 * testsuite/two_file_test_2_v1.cc: Change initialization of
5135 v2 to keep it in .data.
5136
e6455dfb
CC
51372011-06-07 Cary Coutant <ccoutant@google.com>
5138
5139 * common.cc (Symbol_table::do_allocate_commons_list): Call
5140 gold_fallback.
5141 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5142 (Errors::fallback): New function.
5143 (gold_fallback): New function.
5144 * errors.h (Errors::fallback): New function.
5145 * gold.cc (gold_exit): Change status parameter to enum; adjust
5146 all callers.
5147 (queue_initial_tasks): Call gold_fallback.
5148 * gold.h: Include cstdlib.
5149 (Exit_status): New enum type.
5150 (gold_exit): Change status parameter to enum.
5151 (gold_fallback): New function.
5152 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5153 (Layout::create_symtab_sections): Likewise.
5154 (Layout::create_shdrs): Likewise.
5155 * main.cc (main): Adjust call to gold_exit.
5156 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5157 (Output_data_got::add_got_entry_pair): Likewise.
5158 (Output_section::add_input_section): Likewise.
5159 (Output_section::add_output_section_data): Likewise.
5160 (Output_segment::set_section_list_addresses): Likewise.
5161 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5162
fb0e076f
CC
51632011-06-07 Cary Coutant <ccoutant@google.com>
5164
5165 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5166 for incremental links.
5167 * output.cc (Output_segment::set_section_list_addresses): Remove
5168 FIXME and test for TLS or BSS.
5169
a5ee4d5d
CC
51702011-06-07 Cary Coutant <ccoutant@google.com>
5171
5172 * testsuite/Makefile.am: Add incremental_copy_test,
5173 incremental_common_test_1.
5174 * testsuite/Makefile.in: Regenerate.
5175 * testsuite/common_test_1_v1.c: New source file.
5176 * testsuite/common_test_1_v2.c: New source file.
5177 * testsuite/copy_test_v1.cc: New source file.
5178
5146f448
CC
51792011-06-07 Cary Coutant <ccoutant@google.com>
5180
5181 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5182 update, allocate common from bss section's free list.
5183 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5184 linker-defined symbols.
5185 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5186 Skip GOT and PLT entries that are no longer referenced.
5187 (Output_section_incremental_inputs::write_info_blocks): Mark
5188 linker-defined symbols.
5189 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5190 * output.cc (Output_section::allocate): New function.
5191 * output.h (Output_section::allocate): New function.
5192 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5193 linker-defined symbols.
5194 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5195 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5196 (Symbol::init_base_output_data): Likewise.
5197 (Symbol::init_base_output_segment): Likewise.
5198 (Symbol::init_base_constant): Likewise.
5199 (Sized_symbol::init_output_data): Likewise.
5200 (Sized_symbol::init_output_segment): Likewise.
5201 (Sized_symbol::init_constant): Likewise.
5202 (Symbol_table::do_define_in_output_data): Likewise.
5203 (Symbol_table::do_define_in_output_segment): Likewise.
5204 (Symbol_table::do_define_as_constant): Likewise.
5205 * symtab.h (Symbol::is_predefined): New function.
5206 (Symbol::init_base_output_data): Add is_predefined parameter.
5207 (Symbol::init_base_output_segment): Likewise.
5208 (Symbol::init_base_constant): Likewise.
5209 (Symbol::is_predefined_): New data member.
5210 (Sized_symbol::init_output_data): Add is_predefined parameter.
5211 (Sized_symbol::init_output_segment): Likewise.
5212 (Sized_symbol::init_constant): Likewise.
5213 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5214
26d3c67d
CC
52152011-06-07 Cary Coutant <ccoutant@google.com>
5216
5217 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5218 instead of emit_copy_reloc.
5219 (Copy_relocs::emit_copy_reloc): Refactor.
5220 (Copy_relocs::make_copy_reloc): New function.
5221 (Copy_relocs::add_copy_reloc): Remove.
5222 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5223 section.
5224 (Copy_relocs::make_copy_reloc): New function.
5225 (Copy_relocs::add_copy_reloc): Remove.
5226 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5227 unchanged input files.
5228 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5229 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5230 Reserve BSS space for COPY relocations.
5231 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5232 (Output_section_incremental_inputs::write_info_blocks): Record
5233 whether a symbol is copied from a shared object.
5234 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5235 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5236 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5237 (Incremental_input_entry_reader::get_output_symbol_index): Add
5238 is_copy parameter.
5239 (Incremental_binary::emit_copy_relocs): New function.
5240 (Incremental_binary::do_emit_copy_relocs): New function.
5241 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5242 new data member.
5243 (Sized_incremental_binary::add_copy_reloc): New function.
5244 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5245 (Sized_incremental_binary::Copy_reloc): New struct.
5246 (Sized_incremental_binary::Copy_relocs): New typedef.
5247 (Sized_incremental_binary::copy_relocs_): New data member.
5248 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5249 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5250 * target.h (Sized_target::emit_copy_reloc): New function.
5251 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5252
7cdb37d9
CC
52532011-06-02 Cary Coutant <ccoutant@google.com>
5254
5255 PR gold/12163
5256 * gold/archive.cc (Archive::Archive): Initialize new data member.
5257 (Archive::include_all_members): Return if archive has already been
5258 included.
5259 * gold/archive.h (Archive::include_all_members_): New data member.
5260
cc643b88
NC
52612011-06-02 Nick Clifton <nickc@redhat.com>
5262
5263 * dynobj.h: Fix spelling mistake in comment.
5264 * output.cc: Likewise.
5265
f62a3ca7 52662011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5267 Asier Llano
f62a3ca7
DK
5268
5269 PR gold/12826
cc643b88 5270 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5271 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5272 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5273 redundant arm_exidx_test.so.
5274 * testsuite/Makefile.in: Regenerate.
5275 (check_SCRIPTS): Add pr12826.sh
5276 (check_DATA): Add pr12826.stdout
5277 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5278 * testsuite/pr12826.sh: New file.
5279 * testsuite/pr12826_1.s: Ditto.
5280 * testsuite/pr12826_1.s: Ditto.
5281
8dbe1edc
ILT
52822011-05-30 Ian Lance Taylor <iant@google.com>
5283
5284 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5285 sections.
5286
c49875be
ILT
52872011-05-29 Ian Lance Taylor <iant@google.com>
5288
5289 PR gold/12804
5290 * testsuite/Makefile.am: Use different file name for two_file_test
5291 temporary file for each incremental test.
5292 * testsuite/Makefile.in: Rebuild.
5293
69d53f7a
ILT
52942011-05-29 Ian Lance Taylor <iant@google.com>
5295
5296 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5297 binary input file is empty.
5298
41d0ab5f
ILT
52992011-05-27 Ian Lance Taylor <iant@google.com>
5300
5301 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5302 (ver_test_9.so): Likewise.
5303 * testsuite/Makefile.in: Rebuild.
5304
89d8a36b
CC
53052011-05-26 Cary Coutant <ccoutant@google.com>
5306
5307 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5308 * incremental.cc (Incremental_inputs::report_input_section): Fix
5309 comment, indentation.
5310 (Incremental_inputs::report_comdat_group): New function.
5311 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5312 of data for incremental input file entry.
5313 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5314 group count, COMDAT group signatures.
5315 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5316 an unchanged input file.
5317 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5318 Initialize new data member.
5319 (Incremental_object_entry::add_comdat_group): New function.
5320 (Incremental_object_entry::get_comdat_group_count): New function.
5321 (Incremental_object_entry::get_comdat_signature_key): New function.
5322 (Incremental_object_entry::groups_): New data member.
5323 (Incremental_inputs::report_comdat_group): New function.
5324 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5325 data for incremental input file entry.
5326 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5327 (Incremental_input_entry_reader::get_input_section): Adjust size of
5328 data for incremental input file entry.
5329 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5330 (Incremental_input_entry_reader::get_comdat_group_signature): New
5331 function.
5332 * object.cc (Sized_relobj::include_section_group): Report kept
5333 COMDAT groups for incremental links.
5334
1706a06f
ILT
53352011-05-24 David Meyer <pdox@google.com>
5336
5337 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5338 with name parameter. Add found_name parameter.
5339 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5340 * dirsearch.h (class Dirsearch): Update declaration.
5341
a10ae760
ILT
53422011-05-24 Ian Lance Taylor <iant@google.com>
5343
5344 * archive.cc (Library_base::should_include_member): Pull in object
5345 from archive if it defines the entry symbol.
5346 * parameters.cc (Parameters::entry): New function.
5347 * parameters.h (class Parameters): Declare entry.
5348 * output.h (class Output_file_header): Remove entry_ field.
5349 * output.cc (Output_file_header::Output_file_header): Remove entry
5350 parameter. Change all callers.
5351 (Output_file_header::entry): Use parameters->entry.
5352 * gold.cc (queue_middle_tasks): Likewise.
5353 * plugin.cc (Plugin_hook::run): Likewise.
5354
aa92d6ed
CC
53552011-05-24 Cary Coutant <ccoutant@google.com>
5356
5357 * gold.cc (queue_initial_tasks): Pass incremental base filename
5358 to Output_file::open_base_file; don't print error message.
5359 * incremental-dump.cc (main): Adjust call to
5360 Output_file::open_for_modification.
5361 * incremental-dump.cc (main): Likewise.
5362 * incremental.cc (Incremental_inputs::report_command_line):
5363 Ignore --incremental-base option when comparing command lines.
5364 Ignore parameter when given as separate argument.
5365 * options.h (class General_options): Add --incremental-base.
5366 * output.cc (Output_file::Output_file):
5367 (Output_file::open_base_file): Add base_name and writable parameters;
5368 read base file into new file; print error message here.
5369 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5370 callers.
5371 * output.h (Output_file::open_for_modification): Rename to...
5372 (Output_file::open_base_file): ...this; add base_name and
5373 writable parameters; adjust all callers.
5374 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5375 callers.
5376 * testsuite/Makefile.am (incremental_test_4): Test
5377 --incremental-base.
5378 * testsuite/Makefile.in: Regenerate.
5379
2eedd706
CC
53802011-05-24 Cary Coutant <ccoutant@google.com>
5381
5382 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5383 incremental_test_4.
5384 * testsuite/Makefile.in: Regenerate.
5385 * testsuite/two_file_test_1_v1.cc: New test source file.
5386 * testsuite/two_file_test_1b_v1.cc: New test source file.
5387 * testsuite/two_file_test_2_v1.cc: New test source file.
5388
0f1c85a6
CC
53892011-05-24 Cary Coutant <ccoutant@google.com>
5390
5391 * dynobj.h (Dynobj::do_dynobj): New function.
5392 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5393 flag and soname for shared objects.
5394 * incremental.cc (Incremental_inputs::report_object): Make
5395 either Incremental_object_entry or Incremental_dynobj_entry; add
5396 soname to string table.
5397 (Incremental_inputs::report_input_section): Add assertion.
5398 (Output_section_incremental_inputs::set_final_data_size): Adjust
5399 type of input file entry for shared libraries; adjust size of
5400 shared library info entry.
5401 (Output_section_incremental_inputs::write_input_files): Write
5402 as_needed flag for shared libraries.
5403 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5404 of input file entry for shared libraries; write soname.
5405 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5406 soname from incremental info.
5407 * incremental.h (enum Incremental_input_flags): Add
5408 INCREMENTAL_INPUT_AS_NEEDED.
5409 (Incremental_input_entry::Incremental_input_entry): Initialize new
5410 data member.
5411 (Incremental_input_entry::set_as_needed): New function.
5412 (Incremental_input_entry::as_needed): New function.
5413 (Incremental_input_entry::do_dynobj_entry): New function.
5414 (Incremental_input_entry::as_needed_): New data member.
5415 (Incremental_object_entry::Incremental_object_entry): Don't check
5416 for shared library.
5417 (Incremental_object_entry::do_type): Likewise.
5418 (class Incremental_dynobj_entry): New class.
5419 (Incremental_input_entry_reader::as_needed): New function.
5420 (Incremental_input_entry_reader::get_soname): New function.
5421 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5422 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5423 size of shared library info entry.
58797674 5424 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5425 incremental link when adding DT_NEEDED entries.
5426 * object.h (Object::Object): Initialize new data member.
5427 (Object::dynobj): New function.
5428 (Object::set_as_needed): New function.
5429 (Object::as_needed): New function.
5430 (Object::do_dynobj): New function.
5431 (Object::as_needed_): New data member.
5432
6fa2a40b
CC
54332011-05-24 Cary Coutant <ccoutant@google.com>
5434
5435 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5436 info; adjust display of GOT entries.
5437 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5438 vector of input objects; remove file_status_.
5439 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5440 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5441 got_plt reader; call target hooks to reserve GOT entries.
5442 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5443 of input file info header and GOT info entry.
5444 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5445 relocation info.
5446 (Got_plt_view_info::got_descriptor): Remove.
5447 (Got_plt_view_info::sym_index): New data member.
5448 (Got_plt_view_info::input_index): New data member.
5449 (Local_got_offset_visitor::visit): Write input file index.
5450 (Global_got_offset_visitor::visit): Write 0 for input file index.
5451 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5452 with sym_index and input_index.
5453 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5454 incremental info GOT entry; replace got_descriptor with input_index.
5455 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5456 map from input file index to object.
5457 (Sized_relobj_incr::do_layout): Replace direct data member reference
5458 with accessor function.
5459 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5460 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5461 Adjust size of input file info header.
5462 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5463 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5464 (Incremental_input_entry_reader::get_input_section): Adjust size of
5465 input file info header.
5466 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5467 of incremental info GOT entry.
5468 (Incremental_got_plt_reader::get_got_desc): Remove.
5469 (Incremental_got_plt_reader::get_got_symndx): New function.
5470 (Incremental_got_plt_reader::get_got_input_index): New function.
5471 (Sized_incremental_binary::Sized_incremental_binary): Remove
5472 file_status_; add input_objects_.
5473 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5474 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5475 (Sized_incremental_binary::file_is_unchanged): Remove.
5476 (Sized_incremental_binary::set_input_object): New function.
5477 (Sized_incremental_binary::input_object): New function.
5478 (Sized_incremental_binary::file_status_): Remove.
5479 (Sized_incremental_binary::input_objects_): New data member.
5480 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5481 references.
5482 (Sized_relobj_incr::invalid_address): Move to base class.
5483 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5484 class.
5485 (Sized_relobj_incr::do_output_section_offset): Likewise.
5486 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5487 (Sized_relobj_incr::section_offsets_): Likewise.
5488 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5489 function.
5490 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5491 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5492 with accessor function.
5493 (Sized_relobj_file::do_layout): Likewise.
5494 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5495 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5496 (Sized_relobj_file::compute_final_local_value): Replace refs to
5497 section_offsets_ with accessor function.
5498 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5499 * object.h (Relobj::Relobj): Initialize new data members.
5500 (Relobj::add_dyn_reloc): New function.
5501 (Relobj::first_dyn_reloc): New function.
5502 (Relobj::dyn_reloc_count): New function.
5503 (Relobj::first_dyn_reloc_): New data member.
5504 (Relobj::dyn_reloc_count_): New data member.
5505 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5506 references.
5507 (Sized_relobj::Address): New typedef.
5508 (Sized_relobj::invalid_address): Move here from child class.
5509 (Sized_relobj::Sized_relobj): Initialize new data members.
5510 (Sized_relobj::sized_relobj): New function.
5511 (Sized_relobj::is_output_section_offset_invalid): Move here from
5512 child class.
5513 (Sized_relobj::get_output_section_offset): Likewise.
5514 (Sized_relobj::local_has_got_offset): Likewise.
5515 (Sized_relobj::local_got_offset): Likewise.
5516 (Sized_relobj::set_local_got_offset): Likewise.
5517 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5518 (Sized_relobj::clear_got_offsets): New function.
5519 (Sized_relobj::section_offsets): Move here from child class.
5520 (Sized_relobj::do_output_section_offset): Likewise.
5521 (Sized_relobj::do_set_section_offset): Likewise.
5522 (Sized_relobj::Local_got_offsets): Likewise.
5523 (Sized_relobj::local_got_offsets_): Likewise.
5524 (Sized_relobj::section_offsets_): Likewise.
5525 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5526 references.
5527 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5528 class.
5529 (Sized_relobj_file::sized_relobj): New function
5530 (Sized_relobj_file::local_has_got_offset): Move to base class.
5531 (Sized_relobj_file::local_got_offset): Likewise.
5532 (Sized_relobj_file::set_local_got_offset): Likewise.
5533 (Sized_relobj_file::get_output_section_offset): Likewise.
5534 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5535 (Sized_relobj_file::do_output_section_offset): Likewise.
5536 (Sized_relobj_file::do_set_section_offset): Likewise.
5537 (Sized_relobj_file::Local_got_offsets): Likewise.
5538 (Sized_relobj_file::local_got_offsets_): Likewise.
5539 (Sized_relobj_file::section_offsets_): Likewise.
5540 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5541 (all constructors).
5542 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5543 (Output_reloc::get_symbol_index): Likewise.
5544 (Output_reloc::local_section_offset): Likewise.
5545 (Output_reloc::get_address): Likewise.
5546 (Output_reloc::symbol_value): Likewise.
5547 (Output_data_got::reserve_slot): Move to class definition.
5548 (Output_data_got::reserve_local): New function.
5549 (Output_data_got::reserve_slot_for_global): Remove.
5550 (Output_data_got::reserve_global): New function.
5551 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5552 (all constructors, two instantiations).
5553 (Output_reloc::get_relobj): New function (two instantiations).
5554 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5555 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5556 (Output_data_reloc::add_global): Adjust type of relobj.
5557 (Output_data_reloc::add_global_relative): Likewise.
5558 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5559 (Output_data_reloc::add_local): Likewise.
5560 (Output_data_reloc::add_local_relative): Likewise.
5561 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5562 (Output_data_reloc::add_local_section): Likewise.
5563 (Output_data_reloc::add_output_section): Likewise.
5564 (Output_data_reloc::add_absolute): Likewise.
5565 (Output_data_reloc::add_target_specific): Likewise.
5566 (Output_data_got::reserve_slot): Move definition here.
5567 (Output_data_got::reserve_local): New function.
5568 (Output_data_got::reserve_global): New function.
5569 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5570 section_offsets_ with accessor function.
5571 (Sized_relobj_file::write_sections): Likewise.
5572 (Sized_relobj_file::do_relocate_sections): Likewise.
5573 * target.h (Sized_target::reserve_local_got_entry): New function.
5574 (Sized_target::reserve_global_got_entry): New function.
5575 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5576 (Target_x86_64::reserve_global_got_entry): New function.
5577 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5578
4829d394
CC
55792011-05-23 Cary Coutant <ccoutant@google.com>
5580
5581 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5582 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5583 bit when checking got_type.
5584 * incremental.cc (Sized_incremental_binary::setup_readers):
5585 Store symbol table and string table locations; initialize bit vector
5586 of file status flags.
5587 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5588 unchanged files.
5589 (Sized_incremental_binary::do_process_got_plt): New function.
5590 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5591 (Output_section_incremental_inputs::set_final_data_size): Record
5592 file index for each input file.
5593 (Output_section_incremental_inputs::write_got_plt): Store file index
5594 instead of input entry offset for each GOT entry.
5595 * incremental.h
5596 (Incremental_input_entry::Incremental_input_entry): Initialize new
5597 data member.
5598 (Incremental_input_entry::set_offset): Store file index.
5599 (Incremental_input_entry::get_file_index): New function.
5600 (Incremental_input_entry::file_index_): New data member.
5601 (Incremental_binary::process_got_plt): New function.
5602 (Incremental_binary::do_process_got_plt): New function.
5603 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5604 data members.
5605 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5606 (Sized_incremental_binary::set_file_is_unchanged): New function.
5607 (Sized_incremental_binary::file_is_unchanged): New function.
5608 (Sized_incremental_binary::do_process_got_plt): New function.
5609 (Sized_incremental_binary::file_status_): New data member.
5610 (Sized_incremental_binary::main_symtab_loc_): New data member.
5611 (Sized_incremental_binary::main_strtab_loc_): New data member.
5612 * output.cc (Output_data_got::Got_entry::write): Add case
5613 RESERVED_CODE.
5614 (Output_data_got::add_global): Call add_got_entry.
5615 (Output_data_got::add_global_plt): Likewise.
5616 (Output_data_got::add_global_with_rel): Likewise.
5617 (Output_data_got::add_global_with_rela): Likewise.
5618 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5619 (Output_data_got::add_global_pair_with_rela): Likewise.
5620 (Output_data_got::add_local): Call add_got_entry.
5621 (Output_data_got::add_local_plt): Likewise.
5622 (Output_data_got::add_local_with_rel): Likewise.
5623 (Output_data_got::add_local_with_rela): Likewise.
5624 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5625 (Output_data_got::add_local_pair_with_rela): Likewise.
5626 (Output_data_got::reserve_slot): New function.
5627 (Output_data_got::reserve_slot_for_global): New function.
5628 (Output_data_got::add_got_entry): New function.
5629 (Output_data_got::add_got_entry_pair): New function.
5630 (Output_section::add_output_section_data): Edit FIXME.
5631 * output.h
5632 (Output_section_data_build::Output_section_data_build): New
5633 constructor with size parameter.
5634 (Output_data_space::Output_data_space): Likewise.
5635 (Output_data_got::Output_data_got): Initialize new data member; new
5636 constructor with size parameter.
5637 (Output_data_got::add_constant): Call add_got_entry.
5638 (Output_data_got::reserve_slot): New function.
5639 (Output_data_got::reserve_slot_for_global): New function.
5640 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5641 (Output_data_got::add_got_entry): New function.
5642 (Output_data_got::add_got_entry_pair): New function.
5643 (Output_data_got::free_list_): New data member.
5644 * target.h (Sized_target::init_got_plt_for_update): New function.
5645 (Sized_target::register_global_plt_entry): New function.
5646 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5647 Initialize new data member; call init; add constructor with PLT count.
5648 (Output_data_plt_x86_64::init): New function.
5649 (Output_data_plt_x86_64::add_relocation): New function.
5650 (Output_data_plt_x86_64::reserve_slot): New function.
5651 (Output_data_plt_x86_64::free_list_): New data member.
5652 (Target_x86_64::init_got_plt_for_update): New function.
5653 (Target_x86_64::register_global_plt_entry): New function.
5654 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5655 incremental updates.
5656 (Output_data_plt_x86_64::add_relocation): New function.
5657 * testsuite/object_unittest.cc (Object_test): Set default options.
5658
ec69d6da
ILT
56592011-05-16 Ian Lance Taylor <iant@google.com>
5660
5661 * options.h (class General_options): Make -i a synonym for -r.
5662
732e31de
ILT
56632011-05-16 Ian Lance Taylor <iant@google.com>
5664
5665 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5666
403676b5
CC
56672011-05-10 Cary Coutant <ccoutant@google.com>
5668
5669 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5670 strip_all (-s).
5671
5b7b7d6e
ILT
56722011-05-06 Ian Lance Taylor <iant@google.com>
5673
5674 * layout.cc (Layout::layout): If the output section flags change,
5675 update the ordering.
5676
f0f9babf
CC
56772011-04-25 Cary Coutant <ccoutant@google.com>
5678
5679 * incremental-dump.cc (dump_incremental_inputs): Print local
5680 symbol info for each input file.
5681 * incremental.cc
5682 (Output_section_incremental_inputs::set_final_data_size): Add local
5683 symbol info to input file entries in incremental info.
5684 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5685 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5686 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5687 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5688 implementation.
5689 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5690 (Sized_incr_relobj::do_relocate): Write the local symbols.
5691 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5692 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5693 Adjust size of input file header.
5694 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5695 (Incremental_inputs_reader::get_local_symbol_count): New function.
5696 (Incremental_inputs_reader::get_input_section): Adjust size of input
5697 file header.
5698 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5699 (Sized_incr_relobj::This): New typedef.
5700 (Sized_incr_relobj::sym_size): New const data member.
5701 (Sized_incr_relobj::Local_symbol): New struct.
5702 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5703 (Sized_incr_relobj::do_local_symbol_offset): New function.
5704 (Sized_incr_relobj::local_symbol_count_): New data member.
5705 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5706 (Sized_incr_relobj::local_symbol_index_): New data member.
5707 (Sized_incr_relobj::local_symbol_offset_): New data member.
5708 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5709 (Sized_incr_relobj::local_symbols_): New data member.
5710 * object.h (Relobj::output_local_symbol_count): New function.
5711 (Relobj::local_symbol_offset): New function.
5712 (Relobj::do_output_local_symbol_count): New function.
5713 (Relobj::do_local_symbol_offset): New function.
5714 (Sized_relobj::do_output_local_symbol_count): New function.
5715 (Sized_relobj::do_local_symbol_offset): New function.
5716
d0a9ace3
ILT
57172011-04-22 Vladimir Simonov <sv@sw.ru>
5718
5719 * descriptors.cc (set_close_on_exec): New function.
5720 (Descriptors::open): Use set_close_on_exec.
5721 * output.cc (S_ISLNK): Define if not defined.
5722
94a3fc8b
CC
57232011-04-22 Cary Coutant <ccoutant@google.com>
5724
5725 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5726 global symbol map.
5727 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5728 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5729 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5730 relocations.
5731 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5732 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5733 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5734 * incremental.h
5735 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5736 function.
5737 (Incremental_binary::apply_incremental_relocs): New function.
5738 (Incremental_binary::do_apply_incremental_relocs): New function.
5739 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5740 data member.
5741 (Sized_incremental_binary::add_global_symbol): New function.
5742 (Sized_incremental_binary::global_symbol): New function.
5743 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5744 (Sized_incremental_binary::symbol_map_): New data member.
5745 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5746 * target.h (Sized_target::apply_relocation): New function.
5747 * target-reloc.h (apply_relocation): New function.
5748 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5749
c87e4302
DK
57502011-04-22 Doug Kwan <dougkwan@google.com>
5751
5752 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5753 flag of a SHT_ARM_EXIDX section.
2e702c99 5754 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
5755 * testsuite/Makefile.in: Regenerate.
5756 * testsuite/arm_exidx_test.s: New file.
5757 * testsuite/arm_exidx_test.sh: Same.
5758
e7782cf6
CC
57592011-04-20 Cary Coutant <ccoutant@google.com>
5760
5761 PR gold/12689
5762 * archive.h (Incremental_archive_entry::Archive_member):
5763 Initialize arg_serial_ (second constructor).
5764
308ecdc7
ILT
57652011-04-17 Ian Lance Taylor <iant@google.com>
5766
5767 * object.cc (Relocate_info::location): Simplify location string.
5768 * errors.cc (Errors::error_at_location): Don't print program
5769 name.
5770 (Errors::warning_at_location): Likewise.
5771 (Errors::undefined_symbol): Likewise.
5772 * testsuite/debug_msg.sh: Update accordingly.
5773
bec5b579
CC
57742011-04-14 Cary Coutant <ccoutant@google.com>
5775
5776 * gold/layout.cc (Layout::symtab_section_offset): New function.
5777 * gold/layout.h (Layout::symtab_section_offset): New function.
5778 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5779
88597d34
ILT
57802011-04-12 Ian Lance Taylor <iant@google.com>
5781
5782 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5783 with MREMAP_MAYMOVE.
5784 * output.h (class Output_file): Add map_is_allocated_ field.
5785 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5786 not available, provide stubs. If mremap is not available, #define
5787 it to gold_mremap.
5788 (MREMAP_MAYMOVE): Define if not defined.
5789 (Output_file::Output_file): Initialize map_is_allocated_.
5790 (Output_file::resize): Check map_is_allocated_.
5791 (Output_file::map_anonymous): If mmap fails, use malloc.
5792 (Output_file::unmap): Don't do anything for an anonymous map.
5793 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5794 is not available, provide stubs.
5795 (File_read::View::~View): Use free rather than delete[].
5796 (File_read::make_view): Use malloc rather than new[]. If mmap
5797 fails, use malloc.
5798 (File_read::find_or_make_view): Use malloc rather than new[].
5799 * gold.h: Remove HAVE_REMAP code.
5800 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5801 exists. Rename mremap to gold_mremap. If mmap is not available
5802 don't do anything.
5803 * configure, config.in: Rebuild.
5804
11e361bc
ILT
58052011-04-11 Ian Lance Taylor <iant@google.com>
5806
5807 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5808 initialize local variable v.
5809
cdc29364
CC
58102011-04-11 Cary Coutant <ccoutant@google.com>
5811
5812 * archive.cc (Archive::include_member): Adjust call to
5813 report_object.
5814 (Add_archive_symbols::run): Track argument serial numbers.
5815 (Lib_group::include_member): Likewise.
5816 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5817 * archive.h (Incremental_archive_entry::Archive_member):
5818 Initialize arg_serial_.
5819 (Archive_member::arg_serial_): New data member.
5820 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5821 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5822 incremental link.
5823 (Sized_dynobj::do_for_all_local_got_entries): New function.
5824 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5825 function.
5826 * fileread.cc (get_mtime): New function.
5827 * fileread.h (get_mtime): New function.
5828 * gold.cc (queue_initial_tasks): Check for incremental update.
5829 (process_incremental_input): New function.
5830 (queue_middle_tasks): Don't force valid target for incremental
5831 update.
5832 * incremental-dump.cc (find_input_containing_global): Adjust
5833 size of symbol info entry.
5834 (dump_incremental_inputs): Dump argument serial number and
5835 in_system_directory flag; bias shndx by 1; print symbol names
5836 when dumping per-file symbol lists; use new symbol info readers.
5837 * incremental.cc
5838 (Output_section_incremental_inputs:update_data_size): New function.
5839 (Sized_incremental_binary::setup_readers): Setup input readers
5840 for each input file; build maps for files added from libraries
5841 and scripts.
5842 (Sized_incremental_binary::check_input_args): New function.
5843 (Sized_incremental_binary::do_check_inputs): Build map of argument
5844 serial numbers to input arguments.
5845 (Sized_incremental_binary::do_file_has_changed): Rename
5846 do_file_is_unchanged to this; compare file modification times.
5847 (Sized_incremental_binary::do_init_layout): New function.
5848 (Sized_incremental_binary::do_reserve_layout): New function.
5849 (Sized_incremental_binary::do_get_input_reader): Remove.
5850 (Sized_incremental_binary::get_symtab_view): New function.
5851 (Incremental_checker::can_incrementally_link_output_file): Remove.
5852 (Incremental_inputs::report_command_line): Exclude --debug options.
5853 (Incremental_inputs::report_archive_begin): Add parameter; track
5854 argument serial numbers; don't put input file entry for archive
5855 before archive members.
5856 (Incremental_inputs::report_archive_end): Put input file entry
5857 for archive after archive members.
5858 (Incremental_inputs::report_object): Add parameter; track argument
5859 serial numbers and in_system_directory flag.
5860 (Incremental_inputs::report_script): Add parameter; track argument
5861 serial numbers.
5862 (Output_section_incremental_inputs::set_final_data_size): Adjust
5863 size of symbol info entry; check for forwarding symbols.
5864 (Output_section_incremental_inputs::write_input_files): Write
5865 in_system_directory flag and argument serial number.
5866 (Output_section_incremental_inputs::write_info_blocks): Map section
5867 indices between incremental info and original input file; store
5868 input section index for each symbol.
5869 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5870 change operator() to visit().
5871 (class Global_got_offset_visitor): Likewise.
5872 (class Global_symbol_visitor_got_plt):
5873 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5874 classes.
5875 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5876 (Sized_incr_relobj::do_read_symbols): New function.
5877 (Sized_incr_relobj::do_layout): New function.
5878 (Sized_incr_relobj::do_layout_deferred_sections): New function.
5879 (Sized_incr_relobj::do_add_symbols): New function.
5880 (Sized_incr_relobj::do_should_include_member): New function.
5881 (Sized_incr_relobj::do_for_all_global_symbols): New function.
5882 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
5883 (Sized_incr_relobj::do_section_size): New function.
5884 (Sized_incr_relobj::do_section_name): New function.
5885 (Sized_incr_relobj::do_section_contents): New function.
5886 (Sized_incr_relobj::do_section_flags): New function.
5887 (Sized_incr_relobj::do_section_entsize): New function.
5888 (Sized_incr_relobj::do_section_address): New function.
5889 (Sized_incr_relobj::do_section_type): New function.
5890 (Sized_incr_relobj::do_section_link): New function.
5891 (Sized_incr_relobj::do_section_info): New function.
5892 (Sized_incr_relobj::do_section_addralign): New function.
5893 (Sized_incr_relobj::do_initialize_xindex): New function.
5894 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
5895 (Sized_incr_relobj::do_read_relocs): New function.
5896 (Sized_incr_relobj::do_gc_process_relocs): New function.
5897 (Sized_incr_relobj::do_scan_relocs): New function.
5898 (Sized_incr_relobj::do_count_local_symbols): New function.
5899 (Sized_incr_relobj::do_finalize_local_symbols): New function.
5900 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
5901 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
5902 (Sized_incr_relobj::do_relocate): New function.
5903 (Sized_incr_relobj::do_set_section_offset): New function.
5904 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
5905 (Sized_incr_dynobj::do_read_symbols): New function.
5906 (Sized_incr_dynobj::do_layout): New function.
5907 (Sized_incr_dynobj::do_add_symbols): New function.
5908 (Sized_incr_dynobj::do_should_include_member): New function.
5909 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
5910 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
5911 (Sized_incr_dynobj::do_section_size): New function.
5912 (Sized_incr_dynobj::do_section_name): New function.
5913 (Sized_incr_dynobj::do_section_contents): New function.
5914 (Sized_incr_dynobj::do_section_flags): New function.
5915 (Sized_incr_dynobj::do_section_entsize): New function.
5916 (Sized_incr_dynobj::do_section_address): New function.
5917 (Sized_incr_dynobj::do_section_type): New function.
5918 (Sized_incr_dynobj::do_section_link): New function.
5919 (Sized_incr_dynobj::do_section_info): New function.
5920 (Sized_incr_dynobj::do_section_addralign): New function.
5921 (Sized_incr_dynobj::do_initialize_xindex): New function.
5922 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
5923 (make_sized_incremental_object): New function.
5924 (Incremental_library::copy_unused_symbols): New function.
5925 (Incremental_library::do_for_all_unused_symbols): New function.
5926 * incremental.h (enum Incremental_input_flags): New type.
5927 (class Incremental_checker): Remove.
5928 (Incremental_input_entry::Incremental_input_entry): Add argument
5929 serial number.
5930 (Incremental_input_entry::arg_serial): New function.
5931 (Incremental_input_entry::set_is_in_system_directory): New function.
5932 (Incremental_input_entry::is_in_system_directory): New function.
5933 (Incremental_input_entry::arg_serial_): New data member.
5934 (Incremental_input_entry::is_in_system_directory_): New data member.
5935 (class Script_info): Move here from script.h.
5936 (Script_info::Script_info): Add filename parameter.
5937 (Script_info::filename): New function.
5938 (Script_info::filename_): New data member.
5939 (Incremental_script_entry::Incremental_script_entry): Add argument
5940 serial number.
5941 (Incremental_object_entry::Incremental_object_entry): Likewise.
5942 (Incremental_object_entry::add_input_section): Build list of input
5943 sections with map to original shndx.
5944 (Incremental_object_entry::get_input_section_index): New function.
5945 (Incremental_object_entry::shndx_): New data member.
5946 (Incremental_object_entry::name_key_): Rename; adjust all refs.
5947 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
5948 (Incremental_archive_entry::Incremental_archive_entry): Add argument
5949 serial number.
5950 (Incremental_inputs::report_archive_begin): Likewise.
5951 (Incremental_inputs::report_object): Likewise.
5952 (Incremental_inputs::report_script): Likewise.
5953 (class Incremental_global_symbol_reader): New class.
5954 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
5955 and store flags and input file type.
5956 (Incremental_input_entry_reader::arg_serial): New function.
5957 (Incremental_input_entry_reader::type): Extract type from flags.
5958 (Incremental_input_entry_reader::is_in_system_directory): New function.
5959 (Incremental_input_entry_reader::get_input_section_count): Call
5960 accessor function for type.
5961 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
5962 function for type; adjust size of global symbol entry.
5963 (Incremental_input_entry_reader::get_global_symbol_count): Call
5964 accessor function for type.
5965 (Incremental_input_entry_reader::get_object_count): Likewise.
5966 (Incremental_input_entry_reader::get_object_offset): Likewise.
5967 (Incremental_input_entry_reader::get_member_count): Likewise.
5968 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
5969 (Incremental_input_entry_reader::get_member_offset): Likewise.
5970 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
5971 (Incremental_input_entry_reader::Global_symbol_info): Remove.
5972 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
5973 (Incremental_input_entry_reader::get_global_symbol_reader): New
5974 function.
5975 (Incremental_input_entry_reader::get_output_symbol_index): New
5976 function.
5977 (Incremental_input_entry_reader::type_): Remove.
5978 (Incremental_input_entry_reader::flags_): New data member.
5979 (Incremental_inputs_reader::input_file_offset): New function.
5980 (Incremental_inputs_reader::input_file_index): New function.
5981 (Incremental_inputs_reader::input_file): Call input_file_offset.
5982 (Incremental_inputs_reader::input_file_at_offset): New function.
5983 (Incremental_relocs_reader::get_r_type): Reformat.
5984 (Incremental_relocs_reader::get_r_shndx): Reformat.
5985 (Incremental_relocs_reader::get_r_offset): Reformat.
5986 (Incremental_relocs_reader::data): New function.
5987 (Incremental_binary::Incremental_binary): Initialize new data members.
5988 (Incremental_binary::check_inputs): Add cmdline parameter.
5989 (Incremental_binary::file_is_unchanged): Remove.
5990 (Input_reader::arg_serial): New function.
5991 (Input_reader::get_unused_symbol_count): New function.
5992 (Input_reader::get_unused_symbol): New function.
5993 (Input_reader::do_arg_serial): New function.
5994 (Input_reader::do_get_unused_symbol_count): New function.
5995 (Input_reader::do_get_unused_symbol): New function.
5996 (Incremental_binary::input_file_count): New function.
5997 (Incremental_binary::get_input_reader): Change signature to use
5998 index instead of filename.
5999 (Incremental_binary::file_has_changed): New function.
6000 (Incremental_binary::get_input_argument): New function.
6001 (Incremental_binary::get_library): New function.
6002 (Incremental_binary::get_script_info): New function.
6003 (Incremental_binary::init_layout): New function.
6004 (Incremental_binary::reserve_layout): New function.
6005 (Incremental_binary::output_file): New function.
6006 (Incremental_binary::do_check_inputs): New function.
6007 (Incremental_binary::do_file_is_unchanged): Remove.
6008 (Incremental_binary::do_file_has_changed): New function.
6009 (Incremental_binary::do_init_layout): New function.
6010 (Incremental_binary::do_reserve_layout): New function.
6011 (Incremental_binary::do_input_file_count): New function.
6012 (Incremental_binary::do_get_input_reader): Change signature.
6013 (Incremental_binary::input_args_map_): New data member.
6014 (Incremental_binary::library_map_): New data member.
6015 (Incremental_binary::script_map_): New data member.
6016 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6017 new data members.
6018 (Sized_incremental_binary::output_section): New function.
6019 (Sized_incremental_binary::inputs_reader): Add const.
6020 (Sized_incremental_binary::symtab_reader): Add const.
6021 (Sized_incremental_binary::relocs_reader): Add const.
6022 (Sized_incremental_binary::got_plt_reader): Add const.
6023 (Sized_incremental_binary::get_symtab_view): New function.
6024 (Sized_incremental_binary::Inputs_reader): New typedef.
6025 (Sized_incremental_binary::Input_entry_reader): New typedef.
6026 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6027 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6028 (Sized_incremental_binary::do_file_has_changed): New function.
6029 (Sized_incremental_binary::do_init_layout): New function.
6030 (Sized_incremental_binary::do_reserve_layout): New function.
6031 (Sized_input_reader::Inputs_reader): Remove.
6032 (Sized_input_reader::Input_entry_reader): Remove.
6033 (Sized_input_reader::do_arg_serial): New function.
6034 (Sized_input_reader::do_get_unused_symbol_count): New function.
6035 (Sized_input_reader::do_get_unused_symbol): New function.
6036 (Sized_incremental_binary::do_input_file_count): New function.
6037 (Sized_incremental_binary::do_get_input_reader): Change signature;
6038 use index instead of filename.
6039 (Sized_incremental_binary::section_map_): New data member.
6040 (Sized_incremental_binary::input_entry_readers_): New data member.
6041 (class Sized_incr_relobj): New class.
6042 (class Sized_incr_dynobj): New class.
6043 (make_sized_incremental_object): New function.
6044 (class Incremental_library): New class.
6045 * layout.cc (Free_list::num_lists): New static data member.
6046 (Free_list::num_nodes): New static data member.
6047 (Free_list::num_removes): New static data member.
6048 (Free_list::num_remove_visits): New static data member.
6049 (Free_list::num_allocates): New static data member.
6050 (Free_list::num_allocate_visits): New static data member.
6051 (Free_list::init): New function.
6052 (Free_list::remove): New function.
6053 (Free_list::allocate): New function.
6054 (Free_list::dump): New function.
6055 (Free_list::print_stats): New function.
6056 (Layout_task_runner::run): Resize output file for incremental updates.
6057 (Layout::Layout): Initialize new data members.
6058 (Layout::set_incremental_base): New function.
6059 (Layout::init_fixed_output_section): New function.
6060 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6061 incremental updates.
6062 (Layout::create_gold_note): Do not create gold note section for
6063 incremental updates.
6064 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6065 for incremental updates.
6066 (Layout::set_section_offsets): For incremental updates, allocate space
6067 from free list.
6068 (Layout::create_symtab_sections): Layout with offsets relative to
6069 start of section; for incremental updates, allocate space from free
6070 list.
6071 (Layout::create_shdrs): For incremental updates, allocate space from
6072 free list.
6073 (Layout::finish_dynamic_section): For incremental updates, do not
6074 check --as-needed (fixed in subsequent patch).
6075 * layout.h (class Free_list): New class.
6076 (Layout::set_incremental_base): New function.
6077 (Layout::incremental_base): New function.
6078 (Layout::init_fixed_output_section): New function.
6079 (Layout::allocate): New function.
6080 (Layout::incremental_base_): New data member.
6081 (Layout::free_list_): New data member.
6082 * main.cc (main): Print Free_list statistics.
6083 * object.cc (Relobj::finalize_incremental_relocs): Add
6084 clear_counts parameter; clear counts only when clear_counts is set.
6085 (Sized_relobj::Sized_relobj): Initialize new base class.
6086 (Sized_relobj::do_layout): Don't report special sections.
6087 (Sized_relobj::do_for_all_local_got_entries): New function.
6088 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6089 symtab_off to all symbol table offsets.
6090 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6091 * object.h (class Got_offset_list): Move to top of file.
6092 (Object::Object): Allow case where input_file == NULL.
6093 (Object::~Object): Likewise.
6094 (Object::input_file): Assert that input_file != NULL.
6095 (Object::lock): Allow case where input_file == NULL.
6096 (Object::unlock): Likewise.
6097 (Object::is_locked): Likewise.
6098 (Object::token): Likewise.
6099 (Object::release): Likewise.
6100 (Object::is_incremental): New function.
6101 (Object::get_mtime): New function.
6102 (Object::for_all_local_got_entries): New function.
6103 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6104 (Object::set_is_in_system_directory): New function.
6105 (Object::is_in_system_directory): New function.
6106 (Object::do_is_incremental): New function.
6107 (Object::do_get_mtime): New function.
6108 (Object::do_for_all_local_got_entries): New function.
6109 (Object::is_in_system_directory_): New data member.
6110 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6111 (class Sized_relobj_base): New class.
6112 (class Sized_relobj): Derive from Sized_relobj_base.
6113 (class Sized_relobj::Symbols): Redeclare from base class.
6114 (class Sized_relobj::local_got_offset_list): Remove.
6115 (class Sized_relobj::Output_sections): Redeclare from base class.
6116 (class Sized_relobj::do_for_all_local_got_entries): New function.
6117 (class Sized_relobj::write_local_symbols): Add offset parameter.
6118 (class Sized_relobj::local_symbol_offset_): Update comment.
6119 (class Sized_relobj::local_dynsym_offset_): Update comment.
6120 * options.cc (Input_arguments::add_file): Remove const.
6121 * options.h (Input_file_argument::Input_file_argument):
6122 Initialize arg_serial_ (all constructors).
6123 (Input_file_argument::set_arg_serial): New function.
6124 (Input_file_argument::arg_serial): New function.
6125 (Input_file_argument::arg_serial_): New data member.
6126 (Input_arguments::Input_arguments): Initialize file_count_.
6127 (Input_arguments::add_file): Remove const.
6128 (Input_arguments::number_of_input_files): New function.
6129 (Input_arguments::file_count_): New data member.
6130 (Command_line::number_of_input_files): Call
6131 Input_arguments::number_of_input_files.
6132 * output.cc (Output_segment_headers::Output_segment_headers):
6133 Set current size.
6134 (Output_section::Input_section::current_data_size): New function.
6135 (Output_section::Output_section): Initialize new data members.
6136 (Output_section::add_input_section): Don't do merge sections for
6137 an incremental link; allocate space from free list for an
6138 incremental update.
6139 (Output_section::add_output_section_data): Allocate space from
6140 free list for an incremental update.
6141 (Output_section::update_data_size): New function.
6142 (Output_section::set_fixed_layout): New function.
6143 (Output_section::reserve): New function.
6144 (Output_segment::set_section_addresses): Remove const.
6145 (Output_segment::set_section_list_addresses): Remove const; allocate
6146 space from free list for an incremental update.
6147 (Output_segment::set_offset): Adjust size of RELRO segment for an
6148 incremental update.
6149 * output.h (Output_data::current_data_size): Move here from
6150 child classes.
6151 (Output_data::pre_finalize_data_size): New function.
6152 (Output_data::update_data_size): New function.
6153 (Output_section_headers::update_data_size): new function.
6154 (Output_section_data_build::current_data_size): Move to Output_data.
6155 (Output_data_strtab::update_data_size): New function.
6156 (Output_section::current_data_size): Move to Output_data.
6157 (Output_section::set_fixed_layout): New function.
6158 (Output_section::has_fixed_layout): New function.
6159 (Output_section::reserve): New function.
6160 (Output_section::update_data_size): New function.
6161 (Output_section::has_fixed_layout_): New data member.
6162 (Output_section::free_list_): New data member.
6163 (Output_segment::set_section_addresses): Remove const.
6164 (Output_segment::set_section_list_addresses): Remove const.
6165 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6166 New function.
6167 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6168 New function.
6169 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6170 parameter when calling Add_symbols constructor; store argument
6171 serial number for members of a lib group.
6172 (Add_symbols::locks): Allow case where token == NULL.
6173 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6174 (Read_member::~Read_member): New function.
6175 (Read_member::is_runnable): New function.
6176 (Read_member::locks): New function.
6177 (Read_member::run): New function.
6178 (Check_script::~Check_script): New function.
6179 (Check_script::is_runnable): New function.
6180 (Check_script::locks): New function.
6181 (Check_script::run): New function.
6182 (Check_library::~Check_library): New function.
6183 (Check_library::is_runnable): New function.
6184 (Check_library::locks): New function.
6185 (Check_library::run): New function.
6186 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6187 (Add_symbols::library_): New data member.
6188 (class Read_member): New class.
6189 (class Check_script): New class.
6190 (class Check_library): New class.
6191 * reloc.cc (Read_relocs::is_runnable): Allow case where
6192 token == NULL.
6193 (Read_relocs::locks): Likewise.
6194 (Scan_relocs::locks): Likewise.
6195 (Relocate_task::locks): Likewise.
6196 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6197 to clear counters.
6198 (Sized_relobj::incremental_relocs_scan): Fix comment.
6199 (Sized_relobj::do_relocate): Pass output file offset to
6200 write_local_symbols.
6201 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6202 from class declaration.
6203 * script.cc (read_input_script): Allocate Script_info; pass
6204 argument serial number to report_script.
6205 * script.h (class Script_info): Move to incremental.h.
6206 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6207 * symtab.h (Symbol_table::add_from_incrobj): New function.
6208 (Symbol_table::set_file_offset): New function.
6209
b961d0d7
CC
62102011-04-05 Cary Coutant <ccoutant@google.com>
6211
6212 * incremental-dump.cc (dump_incremental_inputs): Change signature
6213 to take a Sized_incremental_binary; change caller. Use readers
6214 in Sized_incremental_binary.
6215 * incremental.cc
6216 (Sized_incremental_binary::find_incremental_inputs_sections):
6217 Rename do_find_incremental_inputs_sections to this.
6218 (Sized_incremental_binary::setup_readers): New function.
6219 (Sized_incremental_binary::do_check_inputs): Check
6220 has_incremental_info_ flag; move setup code to setup_readers;
6221 use input readers.
6222 (Sized_incremental_binary::do_file_is_unchanged): New function.
6223 (Sized_incremental_binary::do_get_input_reader): New function.
6224 * incremental.h (class Incremental_binary): Move to end of file.
6225 (Incremental_binary::file_is_unchanged): New function.
6226 (Incremental_binary::do_file_is_unchanged): New function.
6227 (Incremental_binary::Input_reader): New class.
6228 (Incremental_binary::get_input_reader): New function.
6229 (class Sized_incremental_binary): Move to end of file.
6230 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6231 input section reader classes.
6232 (Sized_incremental_binary::has_incremental_info): New function.
6233 (Sized_incremental_binary::inputs_reader): New function.
6234 (Sized_incremental_binary::symtab_reader): New function.
6235 (Sized_incremental_binary::relocs_reader): New function.
6236 (Sized_incremental_binary::got_plt_reader): New function.
6237 (Sized_incremental_binary::do_file_is_unchanged): New function.
6238 (Sized_incremental_binary::Sized_input_reader): New class.
6239 (Sized_incremental_binary::get_input_reader): New function.
6240 (Sized_incremental_binary::find_incremental_inputs_sections):
6241 Rename do_find_incremental_inputs_sections to this.
6242 (Sized_incremental_binary::setup_readers): New function.
6243 (Sized_incremental_binary::has_incremental_info_): New data member.
6244 (Sized_incremental_binary::inputs_reader_): New data member.
6245 (Sized_incremental_binary::symtab_reader_): New data member.
6246 (Sized_incremental_binary::relocs_reader_): New data member.
6247 (Sized_incremental_binary::got_plt_reader_): New data member.
6248 (Sized_incremental_binary::current_input_file_): New data member.
6249
a869183f
PP
62502011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6251
6252 PR gold/12640
6253 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6254 violation.
6255
62562011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6257
6258 * archive.cc (Archive::include_member): Adjust call to report_object.
6259 (Add_archive_symbols::run): Add script_info to call to
6260 report_archive_begin.
6261 (Lib_group::include_member): Adjust call to report_object.
6262 (Add_lib_group_symbols::run): Adjust call to report_object.
6263 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6264 blocks. Add object count for script input files.
6265 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6266 script_info parameter; change all callers.
6267 (Incremental_inputs::report_object): Add script_info parameter;
6268 change all callers.
6269 (Incremental_inputs::report_script): Store backpointer to
6270 incremental info entry.
6271 (Output_section_incremental_inputs::set_final_data_size): Record
6272 additional information for scripts.
6273 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6274 * incremental.h (Incremental_script_entry::add_object): New function.
6275 (Incremental_script_entry::get_object_count): New function.
6276 (Incremental_script_entry::get_object): New function.
6277 (Incremental_script_entry::objects_): New data member; adjust
6278 constructor.
6279 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6280 (Incremental_inputs::report_object): Add script_info parameter.
6281 (Incremental_inputs_reader::get_object_count): New function.
6282 (Incremental_inputs_reader::get_object_offset): New function.
6283 * options.cc (Input_arguments::add_file): Return reference to
6284 new input argument.
6285 * options.h (Input_argument::set_script_info): New function.
6286 (Input_argument::script_info): New function.
6287 (Input_argument::script_info_): New data member; adjust all
6288 constructors.
6289 (Input_file_group::add_file): Return reference to new input argument.
6290 (Input_file_lib::add_file): Likewise.
6291 (Input_arguments::add_file): Likewise.
6292 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6293 * script.cc (Parser_closure::Parser_closure): Add script_info
6294 parameter; adjust all callers.
6295 (Parser_closure::script_info): New function.
6296 (Parser_closure::script_info_): New data member.
6297 (read_input_script): Report scripts earlier to incremental info.
6298 (script_add_file): Set script_info in Input_argument.
6299 (script_add_library): Likewise.
6300 * script.h (Script_options::Script_info): Rewrite class.
6301
a869183f 63022011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6303
6304 * archive.cc (Library_base::should_include_member): Move
6305 method here from class Archive.
6306 (Archive::Archive): Initialize base class.
6307 (Archive::should_include_member): Move to base class.
6308 (Archive::do_for_all_unused_symbols): New function.
6309 (Add_archive_symbols::run): Remove redundant access to
6310 incremental_inputs.
6311 (Lib_group::Lib_group): Initialize base class.
6312 (Lib_group::do_filename): New function.
6313 (Lib_group::include_member): Pass pointer to Lib_group to
6314 report_object.
6315 (Lib_group::do_for_all_unused_symbols): New function.
6316 (Add_lib_group_symbols::run): Report archive information for
6317 incremental links.
6318 * archive.h (class Library_base): New base class.
6319 (class Archive): Derive from Library_base.
6320 (Archive::filename): Move to base class.
6321 (Archive::set_incremental_info): Likewise.
6322 (Archive::incremental_info): Likewise.
6323 (Archive::Should_include): Likewise.
6324 (Archive::should_include_member): Likewise.
6325 (Archive::Armap_entry): Remove.
6326 (Archive::Unused_symbol_iterator): Remove.
6327 (Archive::unused_symbols_begin): Remove.
6328 (Archive::unused_symbols_end): Remove.
6329 (Archive::do_filename): New function.
6330 (Archive::do_get_mtime): New function.
6331 (Archive::do_for_all_unused_symbols): New function.
6332 (Archive::task_): Move to base class.
6333 (Archive::incremental_info_): Likewise.
6334 (class Lib_group): Derive from Library_base.
6335 (Lib_group::do_filename): New function.
6336 (Lib_group::do_get_mtime): New function.
6337 (Lib_group::do_for_all_unused_symbols): New function.
6338 (Lib_group::task_): Move to base class.
6339 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6340 function.
6341 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6342 function.
6343 * incremental.cc (Incremental_inputs::report_archive_begin):
6344 Use Library_base; call library's get_mtime; add incremental inputs
6345 entry before members.
6346 (class Unused_symbol_visitor): New class.
6347 (Incremental_inputs::report_archive_end): Use Library_base; use
6348 visitor class to record unused symbols; don't add incremental inputs
6349 entry after members.
6350 (Incremental_inputs::report_object): Use Library_base.
6351 * incremental.h
6352 (Incremental_archive_entry::Incremental_archive_entry): Remove
6353 unused Archive parameter.
6354 (Incremental_inputs::report_archive_begin): Use Library_base.
6355 (Incremental_inputs::report_archive_end): Likewise.
6356 (Incremental_inputs::report_object): Likewise.
6357 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6358 function.
6359 * object.h (Object::for_all_global_symbols): New function.
6360 (Object::do_for_all_global_symbols): New function.
6361 (Sized_relobj::do_for_all_global_symbols): New function.
6362 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6363 function.
6364 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6365 function.
6366
61ab3e40
ILT
63672011-03-27 Ian Lance Taylor <iant@google.com>
6368
6369 * archive.cc (Archive::interpret_header): Return -1 if something
6370 goes wrong. Change callers accordingly.
6371
30e1f9e6
CC
63722011-03-25 Cary Coutant <ccoutant@google.com>
6373
6374 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6375 * testsuite/Makefile.in: Regenerate.
6376
9370ce59 63772011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6378
6379 * plugin.cc (get_view): New.
6380 (Plugin::load): Pass get_view to the plugin.
6381 (Plugin_manager::get_view): New.
6382
9312bb0a
ILT
63832011-03-21 Ian Lance Taylor <iant@google.com>
6384
6385 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6386 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6387
7e12ba9e
ST
63882011-03-21 Sriraman Tallam <tmsriram@google.com>
6389
6390 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6391 Change == to -eq.
6392 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6393 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6394 Change == to -eq.
6395 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6396 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6397
fd7a005d
ILT
63982011-03-14 Ian Lance Taylor <iant@google.com>
6399
6400 * script-sections.cc (Sort_output_sections::script_compare):
6401 Rename from is_before, change return type.
6402 (Sort_output_sections::operator()): Adjust accordingly.
6403
ed16fd1b
ILT
64042011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6405
6406 PR gold/12572
6407 * testsuite/odr_violation2.cc: Add comment to make all error line
6408 numbers double digits.
6409 * testsuite/debug_msg.sh: Adjust expected errors.
6410
71ff8986
ILT
64112011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6412
6413 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6414 but mark earlier ones as non-canonical
6415 (offset_to_iterator): Update search target and example
6416 (do_addr2line): Return extra lines in a vector*
6417 (format_file_lineno): Extract from do_addr2line
6418 (one_addr2line): Add vector* out-param
6419 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6420 when a lineno entry appeared last for its instruction
6421 (Dwarf_line_info): Add vector* out-param
6422 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6423 * symtab.cc (Odr_violation_compare): Include the lineno in the
6424 comparison again.
6425 (linenos_from_loc): New. Combine the canonical line for an
6426 address with its other lines.
6427 (True_if_intersect): New. Helper functor to make
6428 std::set_intersection a query.
6429 (detect_odr_violations): Compare sets of lines instead of just
6430 one line for each function. This became less deterministic, but
6431 has fewer false positives.
6432 * symtab.h: Declarations.
6433 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6434 mix an optimized and non-optimized object in the same binary
6435 (odr_violation2.so): Same.
6436 * testsuite/Makefile.in: Regenerate from Makefile.am.
6437 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6438 * testsuite/debug_msg.sh: Update line numbers and add
6439 assertions.
6440 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6441 non-optimized context.
6442 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6443 isn't inlined, and use OdrDerived in an optimized context.
6444 * testsuite/odr_header1.h: Defines OdrDerived, where
6445 optimization will change the
6446 first-instruction-in-the-destructor's file and line number.
6447 * testsuite/odr_header2.h: Defines OdrBase.
6448
a19fefdc
ILT
64492011-03-09 Ian Lance Taylor <iant@google.com>
6450
6451 * fileread.cc (File_read::clear_views): Don't delete the whole
6452 file view.
6453
ecb351e9
ILT
64542011-03-08 Ian Lance Taylor <iant@google.com>
6455
6456 PR gold/12525
6457 * fileread.cc: #include <climits>.
6458 (GOLD_IOV_MAX): Define.
6459 (File_read::read_multiple): Limit number of entries by iov_max.
6460 * fileread.h (class File_read): Always set max_readv_entries to
6461 128.
6462
b821d13c
ILT
64632011-03-07 Ian Lance Taylor <iant@google.com>
6464
6465 PR gold/12525
6466 * options.h (class General_options): Add -dy and -dn.
6467
89243142
CC
64682011-03-02 Cary Coutant <ccoutant@google.com>
6469
6470 * testsuite/script_test_9.t: Add TLS segment.
6471
d0773f31
ILT
64722011-03-02 Simon Baldwin <simonb@google.com>
6473
6474 * configure.ac: Add check for gnu_indirect_function support in
6475 the toolchain building binutils.
6476 * configure: Rebuild.
6477
9370ce59 64782011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6479
6480 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6481 plugin only symbols.
6482 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6483 in plugin files as not needed in the symbol table.
6484
4cf7a849
ST
64852011-02-11 Sriraman Tallam <tmsriram@google.com>
6486
6487 * output.cc (Output_section::add_input_section): Delay fill
6488 generation for section ordering.
6489
b578bd7d
ILT
64902011-02-09 Ian Lance Taylor <iant@google.com>
6491
6492 PR gold/12316
6493 * object.h (class Sized_relobj): Remove clear_local_symbols.
6494 * reloc.cc (Sized_relobj::do_relocate): Don't call
6495 clear_local_symbols.
6496
9370ce59 64972011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6498
6499 * plugin.cc (is_visible_from_outside): Return true for symbols
6500 in the -u option.
6501
55382fb7
ILT
65022011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6503
6504 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6505 filename.
6506
4e271fff
ST
65072011-02-02 Sriraman Tallam <tmsriram@google.com>
6508
6509 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6510 to std::string.
4e271fff 6511 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6512 section_name to be std::string.
4e271fff
ST
6513 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6514
d433c3ac
ILT
65152011-01-25 Ian Lance Taylor <iant@google.com>
6516
6517 * script.cc (script_add_extern): Rewrite to use
6518 add_symbol_reference.
6519
880473a6
DK
65202011-01-25 Doug Kwan <dougkwan@google.com>
6521
d433c3ac 6522 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6523
f30f86fa
ILT
65242011-01-24 Ian Lance Taylor <iant@google.com>
6525
6526 * options.h (class General_options): Accept
6527 --no-detect-odr-violations.
6528
8e51a0b9
ILT
65292011-01-24 Ian Lance Taylor <iant@google.com>
6530
6531 * version.cc (version_string): Bump to 1.11.
6532
0f3b89d8
ILT
65332011-01-24 Ian Lance Taylor <iant@google.com>
6534
6535 * plugin.cc (class Plugin_rescan): Define new class.
6536 (Plugin_manager::claim_file): Set any_claimed_.
6537 (Plugin_manager::save_archive): New function.
6538 (Plugin_manager::save_input_group): New function.
6539 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6540 necessary.
6541 (Plugin_manager::new_undefined_symbol): New function.
6542 (Plugin_manager::rescan): New function.
6543 (Plugin_manager::rescannable_defines): New function.
6544 (Plugin_manager::add_input_file): Set any_added_.
6545 * plugin.h (class Plugin_manager): define new fields rescannable_,
6546 undefined_symbols_, any_claimed_, and any_added_. Declare
6547 Plugin_rescan as friend. Declare new functions.
6548 (Plugin_manager::Rescannable): Define type.
6549 (Plugin_manager::Rescannable_list): Define type.
6550 (Plugin_manager::Undefined_symbol_list): Define type.
6551 (Plugin_manager::Plugin_manager): Initialize new fields.
6552 * archive.cc (Archive::defines_symbol): New function.
6553 (Add_archive_symbols::run): Pass archive to plugins if any.
6554 * archive.h (class Archive): Declare defines_symbol.
6555 * readsyms.cc (Input_group::~Input_group): New function.
6556 (Finish_group::run): Pass input_group to plugins if any.
6557 * readsyms.h (class Input_group): Declare destructor.
6558 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6559 any.
6560
3bb951e5
ILT
65612011-01-10 Ian Lance Taylor <iant@google.com>
6562
6563 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6564 section as relro.
6565 (Layout::set_segment_offsets): Reset increase_relro before calling
6566 set_section_addresses a second time.
6567
0aa45fac
CC
65682011-01-04 Cary Coutant <ccoutant@google.com>
6569
6570 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6571 sections before NOBITS sections.
6572
0db46eb4
L
65732011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6574
6575 * version.cc (print_version): Update copyright to 2011.
6576
829c9745
CC
65772010-12-23 Cary Coutant <ccoutant@google.com>
6578
6579 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6580 of OS to this->add. Add OD parameter to second form of the function.
6581
7500420b
ILT
65822010-12-20 Ian Lance Taylor <iant@google.com>
6583
6584 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6585 second of two consecutive entries with same offset.
6586
f8e9a930
RW
65872010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6588
6589 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6590 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6591 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6592 to avoid unneeded links against $(LDADD).
6593 * testsuite/Makefile.in: Regenerate.
6594
2fbb4320
ILT
65952010-12-15 Ian Lance Taylor <iant@google.com>
6596
6597 PR gold/12324
6598 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6599 for R_X86_64_32 and R_X86_64_PC32.
6600 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6601 ver_matching_def_pic.o.
6602 (ver_matching_def_pic.o): New target.
6603
fedb228d
RW
66042010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6605
6606 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6607 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6608 Move definition before File_read::View member definitions.
6609 (File_read::View::~View): Initialize and hold lock before
6610 updating current_mapped_bytes.
6611
9b547ce6
RW
66122010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6613
6614 * dwarf_reader.cc: Remove outdated comment.
6615 * gold-threads.cc: Fix typo in error message.
6616 * archive.cc: Fix typos in comments.
6617 * archive.h: Likewise.
6618 * arm-reloc-property.cc: Likewise.
6619 * arm-reloc-property.h: Likewise.
6620 * arm-reloc.def: Likewise.
6621 * arm.cc: Likewise.
6622 * attributes.h: Likewise.
6623 * cref.cc: Likewise.
6624 * ehframe.cc: Likewise.
6625 * fileread.h: Likewise.
6626 * gold.h: Likewise.
6627 * i386.cc: Likewise.
6628 * icf.cc: Likewise.
6629 * incremental.h: Likewise.
6630 * int_encoding.cc: Likewise.
6631 * layout.h: Likewise.
6632 * main.cc: Likewise.
6633 * merge.h: Likewise.
6634 * object.cc: Likewise.
6635 * object.h: Likewise.
6636 * options.cc: Likewise.
6637 * readsyms.cc: Likewise.
6638 * reduced_debug_output.cc: Likewise.
6639 * reloc.cc: Likewise.
6640 * script-sections.cc: Likewise.
6641 * sparc.cc: Likewise.
6642 * symtab.h: Likewise.
6643 * target-reloc.h: Likewise.
6644 * target.cc: Likewise.
6645 * target.h: Likewise.
6646 * timer.cc: Likewise.
6647 * timer.h: Likewise.
6648 * x86_64.cc: Likewise.
6649
83e17bd5
CC
66502010-12-09 Cary Coutant <ccoutant@google.com>
6651
6652 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6653 stack.
6654 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6655 parameter; change all callers.
6656 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6657 * options.h (warn_execstack): New option.
6658
017257f8
DK
66592010-12-07 Doug Kwan <dougkwan@google.com>
6660
6661 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6662 like function call relocations.
6663
c20cbc06
ILT
66642010-12-07 Ian Lance Taylor <iant@google.com>
6665
6666 * archive.cc (Archive::get_elf_object_for_member): Permit
6667 punconfigured to be NULL.
6668 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6669 (Archive::include_member): Pass NULL to get_elf_object_for_member
6670 if we searched for the archive and this is the first included
6671 object.
6672
4dbfafcc
ILT
66732010-12-01 Ian Lance Taylor <iant@google.com>
6674
6675 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6676 track_relocs_type_ field.
6677 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6678 Set track_relocs_type_.
6679 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6680 contents when using RELA relocs.
6681 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6682 reloc_map_.
6683 * reloc.cc (Track_relocs::next_addend): New function.
6684 * reloc.h (class Track_relocs): Declare next_addend.
6685
e5e19edd
ILT
66862010-12-01 Ian Lance Taylor <iant@google.com>
6687
6688 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6689 virtual destructor.
6690
9a5ce24c
ILT
66912010-12-01 Ian Lance Taylor <iant@google.com>
6692
6693 * README: Update compilers known to work and fail.
6694
c7791212
NC
66952010-11-23 Matthias Klose <doko@ubuntu.com>
6696
6697 * configure.in: For --enable-gold, handle value `default' instead of
6698 `both*'. Always install ld as ld.bfd, install as ld if gold is
6699 not the default.
6700 * configure: Regenerate.
6701
0ad220c9
DK
67022010-11-18 Doug Kwan <dougkwan@google.com>
6703
6704 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6705 and right_alignment to be zero. Store result alignment only if it is
6706 greater than existing alignment.
6707
ab8056e0
CC
67082010-11-16 Cary Coutant <ccoutant@google.com>
6709
6710 PR gold/12220
6711 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6712 Check for ".zdebug_line".
6713
fd064a5b
CC
67142010-11-16 Doug Kwan <dougkwan@google.com>
6715 Cary Coutant <ccoutant@google.com>
6716
6717 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6718 by reference; adjust all callers.
6719 * output.cc (Output_segment::set_section_addresses): Adjust references
6720 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6721 list is empty.
6722 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6723 end at page boundary.
6724
6fc6ea19
CC
67252010-11-16 Cary Coutant <ccoutant@google.com>
6726
6727 PR gold/12220
6728 * layout.cc (Layout::choose_output_section): Transform names of
6729 compressed sections even when using a script with a SECTIONS clause.
6730 (Layout::output_section_name): Remove code to transform
6731 compressed debug section names.
6732 * output.cc (Output_section::add_input_section): Use uncompressed
6733 section size when tracking input sections.
6734
95a2c8d6
RS
67352010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6736
6737 * symtab.h (Symbol::NON_PIC_REF): Remove.
6738 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6739 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6740 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6741 (Symbol::use_plt_offset): Take a flags argument and pass it
6742 directly to needs_dynamic_reloc. Restrict check for undefined
6743 weak symbols to function calls.
6744 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6745 (Target_arm::Scan::global): Use it.
6746 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6747 (Target_arm::Relocate::relocate): Likewise.
6748 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6749 parameter with an r_type parameter. Use get_reference_flags
6750 to get the flags.
6751 (Target_arm::Relocate::relocate): Update accordingly.
6752 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6753 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6754 (Target_i386::Scan::global): Likewise.
6755 (Target_i386::Relocate::relocate): Likewise.
6756 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6757 parameter with an r_type parameter. Use get_reference_flags
6758 to get the flags.
6759 (Target_i386::Relocate::relocate): Update accordingly.
6760 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6761 (Target_powerpc::Scan::global): Use it.
6762 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6763 (Target_powerpc::Relocate::relocate): Likewise.
6764 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6765 (Target_sparc::Scan::global): Use it.
6766 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6767 (Target_sparc::Relocate::relocate): Likewise.
6768 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6769 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6770 (Target_x86_64::Scan::global): Likewise.
6771 (Target_x86_64::Relocate::relocate): Likewise.
6772
f625ae50
DK
67732010-11-08 Doug Kwan <dougkwan@google.com>
6774 Cary Coutant <ccoutant@google.com>
6775
6776 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6777 (Arm_exidx_merge_section::section_contents_): New data member.
6778 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6779 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 6780 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
6781 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6782 in parameters instead of calling Object::section_contents without
6783 locking.
6784 (Arm_output_section::group_section): New parameter TASK. Pass it
6785 to callees that need locking objects.
6786 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6787 to lock EXIDX input sections. Fix a formatting issue. Call
6788 Arm_exidx_merged_section::build_contents to create merged section
6789 contents.
6790 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6791 to lock object of stub table owner.
6792 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6793 TEXT_SIZE to initialize data member TEXT_SIZE_.
6794 (Arm_exidx_input_section::addralign): Fix typo in comment.
6795 (Arm_exidx_input_section::text_size): New method.
6796 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6797 that require locking objects. Lock objects before scanning for stubs
6798 and updating local symbols.
6799 (Arm_input_section<big_endian>::init): Copy contents of original
6800 input section.
2e702c99 6801 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
6802 original input section instead of calling Object::section_contents
6803 without locking.
6804 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6805 size without calling Object::section_size().
6806 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6807 for size. Allocate a buffer for merged EXIDX entries.
6808 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 6809 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
6810 building code to Arm_exidx_merged_section::build_contetns. Write
6811 out contetns in buffer instead of building it on the fly.
6812 (Arm_relobj::make_exidx_input_section): Also pass text section size
6813 to Arm_exidx_input_section constructor.
6814 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6815 (Arm_dynobj::do_read_symbols): Fix memory leak.
6816 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6817 * target.h: (class Task): Add forward declaration.
6818 (Target::relax): Add new parameter TASK and pass it to
6819 Target::do_relax().
6820 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6821
5f9bcf58
CC
68222010-11-05 Cary Coutant <ccoutant@google.com>
6823
6824 PR gold/10708
6825 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6826 object when reading from the file.
6827 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6828 second layout pass.
6829 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6830 when reading section contents.
6831 (get_section_contents): Likewise.
6832 (icf::find_identical_sections): Likewise.
6833 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6834 object when reading from the file.
6835 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6836 the object when doing deferred section layout.
6837
e597fa08
NC
68382010-11-03 Nick Clifton <nickc@redhat.com>
6839
6840 PR gold/12001
6841 * script.h (class Symbol_assignment: name): New member. Returns
6842 the name of the symbol.
6843 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6844 Returns true if the given symbol name is on the list of
6845 assignments wating to be processed.
6846 * archive.cc (should_incldue_member): If the symbol is undefined,
6847 check to see if it is on the list of symbols pending assignment.
6848
3f9a3278
ILT
68492010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6850
6851 * script-sections.cc (Script_sections::find_memory_region): Check
6852 for a NULL output section pointer.
6853
d06fb4d1
DK
68542010-10-29 Doug Kwan <dougkwan@google.com>
6855
6856 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6857 Output_section::add_relaxed_input_section.
6858 * output.cc (Output_section::add_relaxed_input_section): Add new
6859 arguments LAYOUT and NAME. Set section order index.
6860 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6861 Copy section order index.
6862 * output.h (Output_section::add_relaxed_input_section): Add new
6863 arguments LAYOUT and NAME.
6864
90e24de5
ILT
68652010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6866
6867 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 6868 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
6869 * testsuite/Makefile.in: Regenerate.
6870
c9484ea5
DK
68712010-10-20 Doug Kwan <dougkwan@google.com>
6872
6873 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6874 without SHF_LINK_ORDER flags.
6875 * layout.cc (Layout::choose_output_section): Do not filter
6876 SHF_LINK_ORDER flag in a relocatable link.
6877
5bc2f5be
CC
68782010-10-17 Cary Coutant <ccoutant@google.com>
6879
6880 * output.h (Output_segment::set_section_addresses): Change function
6881 signature. Update all callers.
6882 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
6883 sections.
6884 (Output_segment::set_section_addresses): Align after last TLS
6885 section. Add padding before last relro section instead of after.
6886
0c91cf04
DK
68872010-10-17 Doug Kwan <dougkwan@google.com>
6888
6889 * gold/arm.cc (Target_arm::got_section): Use correct order and set
6890 GOT output section to be writable.
6891
8c21d9d3
CC
68922010-10-14 Cary Coutant <ccoutant@google.com>
6893
6894 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
6895 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
6896 * gold.cc (queue_initial_tasks): Check parameters for incremental link
6897 mode.
6898 * incremental.cc (report_command_line): Ignore all forms of
6899 --incremental.
6900 * layout.cc (Layout::Layout): Check parameters for incremental link
6901 mode.
6902 * options.cc (General_options::parse_incremental): New function.
6903 (General_options::parse_no_incremental): New function.
6904 (General_options::parse_incremental_full): New function.
6905 (General_options::parse_incremental_update): New function.
6906 (General_options::incremental_mode_): New data member.
6907 (General_options::finalize): Check incremental_mode_.
6908 * options.h (General_options): Update help text for --incremental.
6909 Add --no-incremental, --incremental-full, --incremental-update.
6910 (General_options::Incremental_mode): New enum type.
6911 (General_options::incremental_mode): New function.
6912 (General_options::incremental_mode_): New data member.
6913 * parameters.cc (Parameters::incremental_mode_): New data member.
6914 (Parameters::set_options): Set incremental_mode_.
6915 (Parameters::set_incremental_full): New function.
6916 (Parameters::incremental): New function.
6917 (Parameters::incremental_update): New function.
6918 (set_parameters_incremental_full): New function.
6919 * parameters.h (Parameters::set_incremental_full): New function.
6920 (Parameters::incremental): New function.
6921 (Parameters::incremental_update): New function.
6922 (Parameters::incremental_mode_): New data member.
6923 (set_parameters_incremental_full): New function.
6924 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
6925 incremental link mode.
6926 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
6927 (Sized_relobj::do_relocate_sections): Likewise.
6928 * testsuite/Makefile.am (incremental_test): Use --incremental-full
6929 option.
6930 * testsuite/Makefile.in: Regenerate.
6931 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 6932
bb32aa18 69332010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
6934
6935 * script-sections.h (class Script_sections): Make
6936 Sections_elements typedef public.
6937 * script-sections.cc (class Sort_output_sections): Add elements_
6938 field. Add constructor which sets it; change all callers.
6939 (Sort_output_sections::is_before): New function.
6940 (Sort_output_sections::operator()): Call is_before.
6941 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
6942 conditional.
6943 * testsuite/script_test_10.sh: New test. Test script section
6944 order.
6945 * testsuite/script_test_10.t: Likewise.
6946 * testsuite/script_test_10.s: Likewise.
6947 * testsuite/Makefile.am: Wrap the cross linker tests and the
6948 common tests into NATIVE_OR_CROSS_LINKER.
6949 (check_SCRIPTS): Add script_test_10.sh.
6950 (check_DATA): Add script_test_10.stdout.
6951 (script_test_10.o, script_test_10): New targets.
6952 (script_test_10.stdout): New target.
6953 * configure, testsuite/Makefile.in: Regenerate.
6954
3cef7179
ILT
69552010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6956
6957 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
6958 error for the deprecated relocations.
6959 (Target_arm::Scan::global): Likewise.
6960 (Target_arm::Relocate::relocate): Likewise.
6961
7411e9a8
RS
69622010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
6963
6964 * fileread.cc (Input_file::find_file): Initialize *found_name
6965 and *namep when using the fallback search for case 4.
6966
6a9da32a
CC
69672010-10-11 Cary Coutant <ccoutant@google.com>
6968
6969 * options.h (class General_options): Redefine -z lazy as an alias for
6970 the negation of -z now.
6971
ac897c20
ILT
69722010-10-11 Ian Lance Taylor <iant@google.com>
6973
6974 * resolve.cc (symbol_to_bits): Report the value of the unsupported
6975 binding.
6976
ea5cae92
NC
69772010-10-06 Nick Clifton <nickc@redhat.com>
6978
6979 * script-sections.cc(class Memory_region): Remove
6980 current_lma_offset_ field. Rename current_vma_offset_ to
6981 current_offset_. Add last_section_ field.
6982 (Memory_region::get_current_vma_address): Rename to
6983 get_current_address.
6984 (Memory_region::get_current_lma_address): Delete.
6985 (Memory_region::increment_vma_offset): Rename to
6986 increment_offset.
6987 (Memory_region::increment_lma_offset): Delete.
6988 (Memory_region::attributes_compatible): New method. Returns
6989 true if the provided section is compatible with the region.
6990 (Memory_region::get_last_section): New method. Returns the last
6991 section to use the region.
6992 (Memory_region::set_last_section): New method. Stores the last
6993 section to use the region.
6994 (Script_sections::block_in_region): New method. Returns true if
6995 a block of memory is contained within a region.
6996 (Script_sections::find_memory_region): New method. Locates a
6997 memory region to be used to set a VMA or LMA address.
6998 (Output_section_definition::set_section_addresses): Add code to
6999 check for addresses set by memory regions.
7000 (Output_segment::set_section_addresses): Remove memory region
7001 walking code.
7002 (Script_sections::create_segment): Add a warning if a header
7003 segment is created outside of any region.
7004 * script-sections.h (class Script_sections): Add prototypes for
7005 find_memory_region and block_in_region methods.
7006 * testsuite/memory_test.s: Use .long instead of .word.
7007 * testsuite/memory_test.t: Add some more output sections.
7008 * testsuite/memory_test.sh: Update expected output.
7009
a9bfd952
DK
70102010-10-02 Doug Kwan <dougkwan@google.com>
7011
7012 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7013 defintion to symtab.h
7014 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7015 declaration to defintion.
7016
bacff3ab
NC
70172010-10-01 Nick Clifton <nickc@redhat.com>
7018
7019 * expression.cc (eval): Replace dummy argument with NULL.
7020 (eval_maybe_dot): Check for a NULL result section pointer.
7021 (Symbol_expression::value): Likewise.
7022 (Dot_expression::value): Likewise.
7023 (BINARY_EXPRESSION): Likewise.
7024 (Max_expression::value): Likewise.
7025 (Min_expression::value): Likewise.
7026 (Absolute_expression::value): Likewise.
7027 (Addr_expression::value_from_output_section): Likewise.
7028 (Loaddddr_expression::value_from_output_section): Likewise.
7029 (Segment_start_expression::value): Likewise.
7030 * script-sections.cc
7031 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7032 argument with NULL.
7033 (Sections_elememt_dot_assignment::set_section_addresses):
7034 Likewise.
7035 (Output_data_expression::do_write_to_buffer): Likewise.
7036 (Output_section_definition::finalize_symbols): Likewise.
7037 (Output_section_definition::set_section_addresses): Likewise.
7038
f81bc8b5
DK
70392010-09-30 Doug Kwan <dougkwan@google.com>
7040
7041 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7042
c95e9f27
ST
70432010-09-28 Sriraman Tallam <tmsriram@google.com>
7044
7045 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7046 function.
c95e9f27
ST
7047 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7048 virtual function.
7049 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7050 virtual function.
7051 * icf.cc (get_section_contents): Inline merge sections only when
7052 target allows it.
7053
3cac54d2
RW
70542010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7055
7056 * configure: Regenerate.
7057
2904037a
ILT
70582010-09-17 Ian Lance Taylor <iant@google.com>
7059
7060 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7061 * testsuite/Makefile.am (memory_test.o): New target.
7062 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7063 memory_test.t.
7064 * testsuite/Makefile.in: Rebuild.
2904037a 7065
bca7fb63
DK
70662010-09-17 Doug Kwan <dougkwan@google.com>
7067
7068 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7069 defintion if relocation uses GOT entries of the symbol.
7070 * testsuite/icf_safe_test.sh: Fix test.
7071 * testsuite/icf_safe_so_test.sh: Fix test.
7072
4ef28648
CC
70732010-09-16 Cary Coutant <ccoutant@google.com>
7074
7075 * script_sections.cc (class Memory_region): Remove "NULL" from
7076 vector initializations.
7077
793990de
CC
70782010-09-15 Cary Coutant <ccoutant@google.com>
7079
7080 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7081 Resolve forwarding symbols.
7082
81e015e2
DK
70832010-09-15 Doug Kwan <dougkwan@google.com>
7084
7085 * gold/testsuite/script_test_3.t: Add ARM special sections.
7086 * gold/testsuite/script_test_4.t: Same.
7087 * gold/testsuite/script_test_5.t: Same.
7088 * gold/testsuite/script_test_6.t: Same.
7089 * gold/testsuite/script_test_7.t: Same.
7090 * gold/testsuite/script_test_7.t: Same.
7091 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7092
36171d64
CC
70932010-09-14 Cary Coutant <ccoutant@google.com>
7094
7095 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7096 (Target_x86_64::Relocate::relocate_tls): Replace check for
7097 saw_tls_block_reloc_ with test for executable section.
7098
d89051bd
CC
70992010-09-12 Cary Coutant <ccoutant@google.com>
7100
7101 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7102 position-independent executables to shared libraries need dynamic
7103 relocations.
7104 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7105 position-independent executables.
7106 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7107 * testsuite/Makefile.in: Regenerate.
7108
fca41f0f
NC
71092010-09-10 Nick Clifton <nickc@redhat.com>
7110
7111 PR gold/11997
7112 * testsuite/memory_test.t: Discard any sections that are not
7113 needed.
7114
6695e4b3
L
71152010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7116
7117 PR gold/11996
7118 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7119 "This::" to work around a bug in gcc 4.2.
7120
7121 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7122
0f72bf6f
RÁE
71232010-09-09 Rafael Espindola <espindola@google.com>
7124
7125 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7126 sections with different PF_X flags in the same segment.
7127 (Layout::find_first_load_seg): Search all segments to find the first
7128 one.
7129 * options.h (rosegment): New.
7130
71312010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7132
05a79166 7133 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7134
aa98ff75
DK
71352010-09-08 Doug Kwan <dougkwan@google.com>
7136
7137 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7138 (Arm_relobj::do_relocate_sections): Add new parameter for output
7139 file to match the parent.
7140 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7141 of local symbols instead of input values. Update code to track
7142 changes in gold::relocate_section.
7143 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7144 (Sized_relobj::compute_final_local_value_internal): New methods.
7145 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7146 body into private version of Sized_relobj::compute_final_local_value.
7147 Call the inline method.
7148 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7149 merged symbol value if there is one.
7150 (Symbol_value::has_output_value): New method defintiion.
7151 (Sized_relobj::Compute_final_local_value_status): New enum type.
7152 (Sized_relobj::compute_final_local_value): New methods.
7153 (Sized_relobj::compute_final_local_value_internal): New methods.
7154 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7155 and arm_cortex_a8.sh.
7156 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7157 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7158 New tests.
7159 * Makefile.in: Regenerate.
7160 * testsuite/arm_bl_out_of_range.s: Update test.
7161 * testsuite/thumb_bl_out_of_range.s: Ditto.
7162 * testsuite/thumb_blx_out_of_range.s: Ditto.
7163 * testsuite/arm_branch_out_of_range.sh: New file.
7164 * testsuite/arm_cortex_a8.sh: Ditto.
7165 * testsuite/arm_cortex_a8_b.s: Ditto.
7166 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7167 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7168 * testsuite/arm_cortex_a8_bl.s: Ditto.
7169 * testsuite/arm_cortex_a8_blx.s: Ditto.
7170 * testsuite/arm_cortex_a8_local.s: Ditto.
7171 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7172 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7173
05a79166
L
71742010-09-08 Rafael Espindola <espindola@google.com>
7175
7176 * Makefile.am (memory_test.stdout): Run readelf with -W.
7177 * Makefile.in: Regenerate.
7178 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7179 64 bit output.
7180
33dbc701
RÁE
71812010-09-08 Rafael Espindola <espindola@google.com>
7182
7183 * script-sections.cc (Script_sections::add_memory_region): Convert
7184 field precision to int.
7185 * script.cc (script_set_section_region, script_set_section_region):
7186 Convert field precision to int.
7187
731ca54a
RÁE
71882010-09-08 Rafael Espindola <espindola@google.com>
7189
7190 * arm.cc (do_finalize_sections): Create the __exidx_start and
7191 __exdix_end symbols even when the section is missing.
7192
7f8cd844
NC
71932010-09-08 Nick Clifton <nickc@redhat.com>
7194
7195 * README: Remove claim that MEMORY is not supported.
7196 * expression.cc (script_exp_function_origin)
7197 (script_exp_function_length): Move from here to ...
7198 * script.cc: ... here.
7199 (script_set_section_region, script_add_memory)
7200 (script_parse_memory_attr, script_include_directive): New
7201 functions.
7202 * script-sections.cc
7203 (class Memory_region): New class.
7204 (class Output_section_definition): Add set_memory_region,
7205 set_section_vma, set_section_lma and get_section_name methods.
7206 (class Script_Sections): Add add_memory_region,
7207 find_memory_region, find_memory_region_origin,
7208 find_memory_region_length and set_memory_region methods.
7209 Have set_section_addresses method walk the list of set memory
7210 regions.
7211 Extend the print methos to display memory regions.
7212 * script-sections.h: Add prototypes for new methods.
7213 Add enum for MEMORY region attributes.
7214 * yyscript.y: Add support for parsing MEMORY regions.
7215 * script-c.h: Add prototypes for new functions.
7216 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7217 * testsuite/Makefile.in: Regenerate.
7218 * testsuite/memory_test.sh: New script.
7219 * testsuite/memory_test.s: New assembler source file.
7220 * testsuite/memory_test.t: New linker script.
7221
a4649286
DK
72222010-08-27 Doug Kwan <dougkwan@google.com>
7223
7224 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7225 reference override an existing dynamic weak reference.
7226 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7227 * testsuite/Makefile.in: Regenerate.
7228 * testsuite/dyn_weak_ref.sh: New file.
7229 * testsuite/dyn_weak_ref_1.c: Ditto.
7230 * testsuite/dyn_weak_ref_2.c: Ditto.
7231
b56648ad
ILT
72322010-08-27 Ian Lance Taylor <iant@google.com>
7233
7234 * incremental.h (class Incremental_input_entry): Add virtual
7235 destructor.
7236
809313cb
ILT
72372010-08-27 Ian Lance Taylor <iant@google.com>
7238
7239 * testsuite/start_lib_test_3.c: Mark t3 as used.
7240
11e32464
NC
72412010-08-27 Nick Clifton <nickc@redhat.com>
7242
7243 * options.cc (version_script): Fix small typo in previous
7244 whitespace tidyup.
7245
ca09d69a
NC
72462010-08-25 Nick Clifton <nickc@redhat.com>
7247
7248 * archive.cc: Formatting fixes: Remove whitespace between
7249 typename and following asterisk. Remove whitespace between
7250 function name and opening parenthesis.
7251 * archive.h: Likewise.
7252 * arm.cc: Likewise.
7253 * attributes.cc: Likewise.
7254 * attributes.h: Likewise.
7255 * common.cc: Likewise.
7256 * copy-relocs.cc: Likewise.
7257 * dirsearch.h: Likewise.
7258 * dynobj.cc: Likewise.
7259 * ehframe.cc: Likewise.
7260 * ehframe.h: Likewise.
7261 * expression.cc: Likewise.
7262 * fileread.cc: Likewise.
7263 * fileread.h: Likewise.
7264 * gc.h: Likewise.
7265 * gold-threads.cc: Likewise.
7266 * gold.cc: Likewise.
7267 * i386.cc: Likewise.
7268 * icf.h: Likewise.
7269 * incremental-dump.cc: Likewise.
7270 * incremental.cc: Likewise.
7271 * layout.cc: Likewise.
7272 * layout.h: Likewise.
7273 * main.cc: Likewise.
7274 * merge.cc: Likewise.
7275 * merge.h: Likewise.
7276 * object.cc: Likewise.
7277 * object.h: Likewise.
7278 * options.cc: Likewise.
7279 * options.h: Likewise.
7280 * output.cc: Likewise.
7281 * output.h: Likewise.
7282 * plugin.cc: Likewise.
7283 * plugin.h: Likewise.
7284 * powerpc.cc: Likewise.
7285 * reloc.cc: Likewise.
7286 * script-c.h: Likewise.
7287 * script-sections.cc: Likewise.
7288 * script.cc: Likewise.
7289 * stringpool.cc: Likewise.
7290 * symtab.cc: Likewise.
7291 * symtab.h: Likewise.
7292 * target.cc: Likewise.
7293 * timer.cc: Likewise.
7294 * timer.h: Likewise.
7295 * version.cc: Likewise.
7296 * x86_64.cc: Likewise.
7297
b8fa8750
NC
72982010-08-24 Nick Clifton <nickc@redhat.com>
7299
7300 PR 11899
7301 * layout.cc (segment_precedes): Sort segments by their physical
7302 addresses, if they have been set.
7303
9919d93b
CC
73042010-08-23 Cary Coutant <ccoutant@google.com>
7305
7306 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7307 symbols data.
7308 (Lib_group::include_member): Unlock object after deleting its
7309 symbols data.
7310 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7311 the bug fixed here.
7312
97b4be1c
CC
73132010-08-19 Neil Vachharajani <nvachhar@google.com>
7314 Cary Coutant <ccoutant@google.com>
7315
7316 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7317 constructor, and set_blocker.
7318 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7319 readsyms_blocker_.
7320 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7321 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7322 * testsuite/Makefile.am (start_lib_test): New test case.
7323 * testsuite/Makefile.in: Regenerate.
7324 * testsuite/start_lib_test_main.c: New file.
7325 * testsuite/start_lib_test_1.c: New file.
7326 * testsuite/start_lib_test_2.c: New file.
7327 * testsuite/start_lib_test_3.c: New file.
7328
dd0b1884
ILT
73292010-08-19 Ian Lance Taylor <iant@google.com>
7330
7331 * Makefile.in: Rebuild with automake 1.11.1.
7332 * aclocal.m4: Likewise.
7333 * testsuite/Makefile.in: Likewise.
7334
7223e9ca
ILT
73352010-08-19 Ian Lance Taylor <iant@google.com>
7336
7337 PR 10893
7338 * i386.cc (class Output_data_plt_i386): Update declarations.
7339 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7340 local_ifuncs_ fields.
7341 (Target_i386::do_plt_section_for_global): New function.
7342 (Target_i386::do_plt_section_for_local): New function.
7343 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7344 parameter; change all callers. Initialize global_ifuncs_ and
7345 local_ifuncs_. If doing a static link define __rel_iplt_start and
7346 __rel_iplt_end.
7347 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7348 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7349 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7350 symbols.
7351 (Target_i386::make_plt_section): New function, broken out of
7352 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7353 (Target_i386::make_plt_entry): Call make_plt_section.
7354 (Target_i386::make_local_ifunc_plt_entry): New function.
7355 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7356 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7357 R_386_IRELATIVE to switch.
7358 (Target_i386::Scan::global): Likewise.
7359 (Target_i386::Relocate::relocate): Likewise.
7360 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7361 switch.
7362 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7363 (Target_x86_64::do_plt_section_for_global): New function.
7364 (Target_x86_64::do_plt_section_for_local): New function.
7365 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7366 parameter; change all callers. If doing a static link define
7367 __rela_iplt_start and __rela_iplt_end.
7368 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7369 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7370 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7371 to point to .plt.
7372 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7373 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7374 switch.
7375 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7376 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7377 R_X86_64_IRELATIVE to switch.
7378 (Target_x86_64::Scan::global): Likewise.
7379 (Target_x86_64::Relocate::relocate): Likewise.
7380 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7381 switch.
7382 * target.h (class Target): Add plt_section_for_global and
7383 plt_section_for_local functions. Add do_plt_section_for_global
7384 and do_plt_section_for_local virtual functions.
7385 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7386 clarifying comments.
7387 (Symbol::use_plt_offset): Handle IFUNC symbol.
7388 * object.cc (Sized_relobj::Sized_relobj): Initialize
7389 local_plt_offsets_.
7390 (Sized_relobj::local_has_plt_offset): New function.
7391 (Sized_relobj::local_plt_offset): New function.
7392 (Sized_relobj::set_local_plt_offset): New function.
7393 (Sized_relobj::do_count): Handle IFUNC symbol.
7394 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7395 a bit away from input_shndx_ field. Add set_is_func_symbol and
7396 is_ifunc_symbol functions.
7397 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7398 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7399 local_plt_offsets_ field.
7400 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7401 * output.h (class Output_section_data): Add non-const
7402 output_section function.
7403 (class Output_data_got): Update declarations.
7404 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7405 Add use_plt_offset parameter to global and local constructors.
7406 Change all callers. Change local_sym_index_ field to 31 bits.
7407 Change GSYM_CODE and CONSTANT_CODE accordingly.
7408 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7409 doing a static link don't set sh_link field.
7410 (Output_data_got::Got_entry::write): Use PLT offset if
7411 appropriate.
7412 (Output_data_got::add_global_plt): New function.
7413 (Output_data_got::add_local_plt): New function.
7414 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7415 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7416 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7417 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7418 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7419 IFUNC conditional.
7420 * testsuite/ifunc-sel.h: New file.
7421 * testsuite/ifuncmain1.c: New file.
7422 * testsuite/ifuncmain1vis.c: New file.
7423 * testsuite/ifuncmod1.c: New file.
7424 * testsuite/ifuncdep2.c: New file.
7425 * testsuite/ifuncmain2.c: New file.
7426 * testsuite/ifuncmain3.c: New file.
7427 * testsuite/ifuncmod3.c: New file.
7428 * testsuite/ifuncmain4.c: New file.
7429 * testsuite/ifuncmain5.c: New file.
7430 * testsuite/ifuncmod5.c: New file.
7431 * testsuite/ifuncmain6pie.c: New file.
7432 * testsuite/ifuncmod6.c: New file.
7433 * testsuite/ifuncmain7.c: New file.
7434 * configure, testsuite/Makefile.in: Rebuild.
7435
56f75c03
ILT
74362010-08-18 Ian Lance Taylor <iant@google.com>
7437
7438 * incremental.cc
7439 (Output_section_incremental_inputs::write_input_files): Add cast
7440 to avoid signed/unsigned comparison warning.
7441 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7442
55455f89
CC
74432010-08-12 Cary Coutant <ccoutant@google.com>
7444
7445 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7446
e2054bcb
ILT
74472010-08-13 Ian Lance Taylor <iant@google.com>
7448
7449 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7450
74f67560
DK
74512010-08-12 Cary Coutant <ccoutant@google.com>
7452 Doug Kwan <dougkwan@google.com>
7453
7454 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7455 defintion overrides non-weak undef, remember that the original undef
7456 is not weak.
7457 * symtab.cc (Symbol_table::sized_write_global): For undef without
7458 an original weak binding, set binding to global in output.
7459 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7460 * testsuite/Makefile.in: Regenerate.
7461 * testsuite/strong_ref_weak_def.sh: New file.
7462 * testsuite/strong_ref_weak_def_1.c: Ditto.
7463 * testsuite/strong_ref_weak_def_2.c: Ditto.
7464
d1238d12
CC
74652010-08-12 Cary Coutant <ccoutant@google.com>
7466
7467 * testsuite/incremental_test.sh: Rewrite.
7468 * testsuite/incremental_test_1.c: Rewrite.
7469 * testsuite/incremental_test_2.c: Rewrite.
7470
0e70b911
CC
74712010-08-12 Cary Coutant <ccoutant@google.com>
7472
7473 * arm.cc (Target_arm::got_size): Add const.
7474 (Target_arm::got_entry_count): New function.
7475 (Target_arm::plt_entry_count): New function.
7476 (Target_arm::first_plt_entry_offset): New function.
7477 (Target_arm::plt_entry_size): New function.
7478 (Output_data_plt_arm::entry_count): New function.
7479 (Output_data_plt_arm::first_plt_entry_offset): New function.
7480 (Output_data_plt_arm::get_plt_entry_size): New function.
7481 * i386.cc (Target_i386::got_size): Add const.
7482 (Target_i386::got_entry_count): New function.
7483 (Target_i386::plt_entry_count): New function.
7484 (Target_i386::first_plt_entry_offset): New function.
7485 (Target_i386::plt_entry_size): New function.
7486 (Output_data_plt_i386::entry_count): New function.
7487 (Output_data_plt_i386::first_plt_entry_offset): New function.
7488 (Output_data_plt_i386::get_plt_entry_size): New function.
7489 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7490 find_incremental_inputs_sections. Dump incremental_got_plt section.
7491 * incremental.cc: Include target.h.
7492 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7493 parameter. Adjust all callers. Find incremental_got_plt section.
7494 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7495 section.
7496 (Output_section_incremental_inputs::set_final_data_size): Calculate
7497 size of incremental_got_plt section.
7498 (Output_section_incremental_inputs::do_write): Write the
7499 incremental_got_plt section.
7500 (Got_plt_view_info): New struct.
7501 (Local_got_offset_visitor): New class.
7502 (Global_got_offset_visitor): New class.
7503 (Global_symbol_visitor_got_plt): New class.
7504 (Output_section_incremental_inputs::write_got_plt): New function.
7505 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7506 Add parameter. Adjust all callers.
7507 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7508 (Incremental_inputs::got_plt_section): New function.
7509 (Incremental_inputs::got_plt_section_): New data member.
7510 (Incremental_got_plt_reader): New class.
7511 * layout.cc (Layout::create_incremental_info_sections): Add the
7512 incremental_got_plt section.
7513 * object.h (Got_offset_list::get_list): New function.
7514 (Got offset_list::for_all_got_offsets): New function.
7515 (Sized_relobj::local_got_offset_list): New function.
7516 * powerpc.cc (Target_powerpc::got_size): Add const.
7517 (Target_powerpc::got_entry_count): New function.
7518 (Target_powerpc::plt_entry_count): New function.
7519 (Target_powerpc::first_plt_entry_offset): New function.
7520 (Target_powerpc::plt_entry_size): New function.
7521 (Output_data_plt_powerpc::entry_count): New function.
7522 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7523 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7524 * sparc.cc (Target_sparc::got_size): Add const.
7525 (Target_sparc::got_entry_count): New function.
7526 (Target_sparc::plt_entry_count): New function.
7527 (Target_sparc::first_plt_entry_offset): New function.
7528 (Target_sparc::plt_entry_size): New function.
7529 (Output_data_plt_sparc::entry_count): New function.
7530 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7531 (Output_data_plt_sparc::get_plt_entry_size): New function.
7532 * symtab.h (Symbol::got_offset_list): New function.
7533 (Symbol_table::for_all_symbols): New function.
7534 * target.h (Sized_target::got_entry_count): New function.
7535 (Sized_target::plt_entry_count): New function.
7536 (Sized_target::plt_entry_size): New function.
7537 * x86_64.cc (Target_x86_64::got_size): Add const.
7538 (Target_x86_64::got_entry_count): New function.
7539 (Target_x86_64::plt_entry_count): New function.
7540 (Target_x86_64::first_plt_entry_offset): New function.
7541 (Target_x86_64::plt_entry_size): New function.
7542 (Output_data_plt_x86_64::entry_count): New function.
7543 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7544 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7545
09ec0418
CC
75462010-08-12 Cary Coutant <ccoutant@google.com>
7547
7548 * archive.cc: Include incremental.h.
7549 (Archive::Archive): Initialize incremental_info_.
7550 (Archive::include_member): Record archive members in incremental info.
7551 (Add_archive_symbols::run): Record begin and end of an archive in
7552 incremental info.
7553 (Lib_group::include_member): Record objects in incremental info.
7554 * archive.h (Incremental_archive_entry): Forward declaration.
7555 (Archive::set_incremental_info): New member function.
7556 (Archive::incremental_info): New member function.
7557 (Archive::Unused_symbol_iterator): New class.
7558 (Archive::unused_symbols_begin): New member function.
7559 (Archive::unused_symbols_end): New member function.
7560 (Archive::incremental_info_): New data member.
7561 * incremental-dump.cc (find_input_containing_global): New function.
7562 (dump_incremental_inputs): Dump new incremental info sections.
7563 * incremental.cc: Include symtab.h.
7564 (Output_section_incremental_inputs): New class.
7565 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7566 new incremental info sections.
7567 (Sized_incremental_binary::do_check_inputs): Likewise.
7568 (Incremental_inputs::report_archive): Remove.
7569 (Incremental_inputs::report_archive_begin): New function.
7570 (Incremental_inputs::report_archive_end): New function.
7571 (Incremental_inputs::report_object): New function.
7572 (Incremental_inputs::finalize_inputs): Remove.
7573 (Incremental_inputs::report_input_section): New function.
7574 (Incremental_inputs::report_script): Rewrite.
7575 (Incremental_inputs::finalize): Do nothing but finalize string table.
7576 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7577 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7578 (Incremental_inputs::create_data_sections): New function.
7579 (Incremental_inputs::relocs_entsize): New function.
7580 (Output_section_incremental_inputs::set_final_data_size): New function.
7581 (Output_section_incremental_inputs::do_write): New function.
7582 (Output_section_incremental_inputs::write_header): New function.
7583 (Output_section_incremental_inputs::write_input_files): New function.
7584 (Output_section_incremental_inputs::write_info_blocks): New function.
7585 (Output_section_incremental_inputs::write_symtab): New function.
7586 * incremental.h (Incremental_script_entry): Forward declaration.
7587 (Incremental_object_entry): Forward declaration.
7588 (Incremental_archive_entry): Forward declaration.
7589 (Incremental_inputs): Forward declaration.
7590 (Incremental_inputs_header_data): Remove.
7591 (Incremental_inputs_header): Remove.
7592 (Incremental_inputs_header_write): Remove.
7593 (Incremental_inputs_entry_data): Remove.
7594 (Incremental_inputs_entry): Remove.
7595 (Incremental_inputs_entry_write): Remove.
7596 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7597 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7598 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7599 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7600 Likewise.
7601 (Incremental_input_entry): New class.
7602 (Incremental_script_entry): New class.
7603 (Incremental_object_entry): New class.
7604 (Incremental_archive_entry): New class.
7605 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7606 (Incremental_inputs::report_inputs): Remove.
7607 (Incremental_inputs::report_archive): Remove.
7608 (Incremental_inputs::report_archive_begin): New function.
7609 (Incremental_inputs::report_archive_end): New function.
7610 (Incremental_inputs::report_object): Change prototype.
7611 (Incremental_inputs::report_input_section): New function.
7612 (Incremental_inputs::report_script): Change prototype.
7613 (Incremental_inputs::get_reloc_count): New function.
7614 (Incremental_inputs::set_reloc_count): New function.
7615 (Incremental_inputs::create_data_sections): New function.
7616 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7617 (Incremental_inputs::inputs_section): New function.
7618 (Incremental_inputs::symtab_section): New function.
7619 (Incremental_inputs::relocs_section): New function.
7620 (Incremental_inputs::get_stringpool): Add const.
7621 (Incremental_inputs::command_line): Add const.
7622 (Incremental_inputs::inputs): Remove.
7623 (Incremental_inputs::command_line_key): New function.
7624 (Incremental_inputs::input_file_count): New function.
7625 (Incremental_inputs::input_files): New function.
7626 (Incremental_inputs::relocs_entsize): New function.
7627 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7628 (Incremental_inputs::finalize_inputs): Remove.
7629 (Incremental_inputs::Input_info): Remove.
7630 (Incremental_inputs::lock_): Remove.
7631 (Incremental_inputs::inputs_): Change type.
7632 (Incremental_inputs::inputs_map_): Remove.
7633 (Incremental_inputs::current_object_entry_): New data member.
7634 (Incremental_inputs::inputs_section_): New data member.
7635 (Incremental_inputs::symtab_section_): New data member.
7636 (Incremental_inputs::relocs_section_): New data member.
7637 (Incremental_inputs::reloc_count_): New data member.
7638 (Incremental_inputs_reader): New class.
7639 (Incremental_symtab_reader): New class.
7640 (Incremental_relocs_reader): New class.
7641 * layout.cc (Layout::finalize): Move finalization of incremental info
7642 and creation of incremental info sections to follow finalization of
7643 symbol table. Set offsets for postprocessing sections.
7644 (Layout::create_incremental_info_sections): Call
7645 Incremental_inputs::create_data_sections. Add incremental symtab
7646 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7647 sections to layout after input sections.
7648 * layout.h (struct Timespec): Forward declaration.
7649 (Layout::incremental_inputs): Add const.
7650 (Layout::create_incremental_info_sections): Add parameter.
7651 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7652 * object.cc: Include incremental.h.
7653 (Relobj::finalize_incremental_relocs): New function.
7654 (Sized_relobj::do_layout): Record input sections in incremental info.
7655 * object.h (Object::output_section): New function.
7656 (Object::output_section_offset): Moved from Relobj.
7657 (Object::get_incremental_reloc_base): New function.
7658 (Object::get_incremental_reloc_count): New function.
7659 (Object::do_output_section): New function.
7660 (Object::do_output_section_offset): Moved from Relobj.
7661 (Object::do_get_incremental_reloc_base): New function.
7662 (Object::do_get_incremental_reloc_count): New function.
7663 (Object::Object): Initialize new data members.
7664 (Relobj::output_section): Renamed do_output_section and moved to
7665 protected.
7666 (Relobj::output_section_offset): Moved to Object.
7667 (Relobj::do_get_incremental_reloc_base): New function.
7668 (Relobj::do_get_incremental_reloc_count): New function.
7669 (Relobj::allocate_incremental_reloc_counts): New function.
7670 (Relobj::count_incremental_reloc): New function.
7671 (Relobj::finalize_incremental_relocs): New function.
7672 (Relobj::next_incremental_reloc_index): New function.
7673 (Relobj::reloc_counts_): New data member.
7674 (Relobj::reloc_bases_): New data member.
7675 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7676 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7677 (Sized_relobj::incremental_relocs_scan): New function.
7678 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7679 (Sized_relobj::incremental_relocs_write): New function.
7680 (Sized_relobj::incremental_relocs_write_reltype): New function.
7681 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7682 incremental link.
7683 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7684 archives and object files elsewhere.
7685 (Add_symbols::run): Report object files here.
7686 (Finish_group::run): Report end of archive at end of group.
7687 * reloc.cc: Include layout.h, incremental.h.
7688 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7689 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7690 (Sized_relobj::incremental_relocs_scan): New function.
7691 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7692 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7693 (Sized_relobj::incremental_relocs_write): New function.
7694 (Sized_relobj::incremental_relocs_write_reltype): New function.
7695 * script.cc (read_input_script): Rewrite test for incremental link.
7696 Change call to Incremental_inputs::report_script.
7697 * symtab.h (Symbol_table::first_global_index): New function.
7698 (Symbol_table::output_count): New function.
7699
ce0d1972
DK
77002010-08-12 Doug Kwan <dougkwan@google.com>
7701
7702 * arm.cc (Target_arm::merge_object_attributes): Check command line
7703 options --no-wchar-size-warning and --no-enum-size-warning.
7704 * options.h (General_options): Add ld-compatible options
7705 --no-enum-size-warning and --no-wchar-size-warning.
7706
6e5710ce
ILT
77072010-08-04 Ian Lance Taylor <iant@google.com>
7708
7709 * x86_64.cc (Target_x86_64::Scan::local): Use
7710 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7711 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7712 (Target_x86_64::Scan::global): Likewise.
7713 (Target_x86_64::Relocate::relocate): Likewise.
7714 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7715 Likewise.
7716
fef830db
CC
77172010-08-03 Cary Coutant <ccoutant@google.com>
7718
7719 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7720 to reserve space in merged_strings vector. Keep total input size
7721 for stats.
7722 (Output_merge_string::do_print_merge_stats): Print total input size.
7723 * merge.h (Output_merge_string): Add input_size_ field.
7724 * stringpool.cc (Stringpool_template::string_length): Move
7725 implementations out of Stringpool_template class and place in
7726 stringpool.h.
7727 * stringpool.h (string_length): Move out of Stringpool_template.
7728
1e3811b0
ILT
77292010-08-03 Ian Lance Taylor <iant@google.com>
7730
7731 PR 11712
7732 * layout.cc (relaxation_loop_body): If address of load segment is
7733 set, adjust address to include headers if possible.
7734
7af0c620
ILT
77352010-08-03 Ian Lance Taylor <iant@google.com>
7736
7737 * version.cc (version_string): Bump to 1.10.
7738
22f0da72
ILT
77392010-08-03 Ian Lance Taylor <iant@google.com>
7740
7741 PR 11805
7742 * layout.h (enum Output_section_order): Define.
7743 (class Layout): Update declarations.
7744 * layout.cc (Layout::get_output_section): Add order parameter.
7745 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7746 is_first_non_relro parameters. Change all callers.
7747 (Layout::choose_output_section): Likewise.
7748 (Layout::add_output_section_data): Likewise.
7749 (Layout::make_output_section): Likewise. Set order.
7750 (Layout::default_section_order): New function.
7751 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7752 * output.cc (Output_section::Output_section): Initialize order_.
7753 Don't initialize deleted fields.
7754 (Output_segment::Output_segment): Don't initialize deleted
7755 fields.
7756 (Output_segment::add_output_section_to_load): New function
7757 replacing add_output_section. Change all callers to call this or
7758 add_output_section_to_nonload.
7759 (Output_segment::add_output_section_to_nonload): New function.
7760 (Output_segment::remove_output_section): Rewrite.
7761 (Output_segment::add_initial_output_data): Likewise.
7762 (Output_segment::has_any_data_sections): Likewise.
7763 (Output_segment::is_first_section_relro): Likewise.
7764 (Output_segment::maximum_alignment): Likewise.
7765 (Output_segment::has_dynamic_reloc): New function replacing
7766 dynamic_reloc_count. Change all callers.
7767 (Output_segment::has_dynamic_reloc_list): New function replacing
7768 dynamic_reloc_count_list. Change all callers.
7769 (Output_segment::set_section_addresses): Rewrite.
7770 (Output_segment::set_offset): Rewrite.
7771 (Output_segment::find_first_and_last_list): Remove.
7772 (Output_segment::set_tls_offsets): Rewrite.
7773 (Output_segment::first_section_load_address): Likewise.
7774 (Output_segment::output_section_count): Likewise.
7775 (Output_segment::section_with_lowest_load_address): Likewise.
7776 (Output_segment::write_section_headers): Likewise.
7777 (Output_segment::print_sections_to_map): Likewise.
7778 * output.h (class Output_data): Remove dynamic_reloc_count_
7779 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7780 (Output_data::add_dynamic_reloc): Rewrite.
7781 (Output_data::has_dynamic_reloc): New function.
7782 (Output_data::dynamic_reloc_count): Remove.
7783 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7784 is_last_relro_, is_first_non_relro_, is_interp_,
7785 is_dynamic_linker_section_ fields. Add order and set_order
7786 functions. Remove is_relro_local, set_is_relro_local,
7787 is_last_relro, set_is_last_relro, is_first_non_relro,
7788 set_is_first_non_relro functions, is_interp, set_is_interp,
7789 is_dynamic_linker_section, and set_is_dynamic_linker_section
7790 functions.
7791 (class Output_segment): Change Output_data_list from std::list to
7792 std:;vector. Add output_lists_ field. Remove output_data_ and
7793 output_bss_ fields. Update declarations.
7794
3ff2ccb0
ILT
77952010-08-02 Ian Lance Taylor <iant@google.com>
7796
7797 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7798 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7799 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7800
88a4108b
ILT
78012010-08-02 Ian Lance Taylor <iant@google.com>
7802
7803 PR 11855
7804 * script.cc (Script_options::Script_options): Initialize
7805 symbol_definitions_ and symbol_references_.
7806 (Script_options::add_symbol_assignment): Update
7807 symbol_definitions_ and symbol_references_.
7808 (Script_options::add_symbol_reference): New function.
7809 (script_symbol): New function.
7810 * script.h (class Script_options): Add symbol_definitions_ and
7811 symbol_references_ fields.
7812 (Script_options::referenced_const_iterator): New type.
7813 (Script_options::referenced_begin): New function.
7814 (Script_options::referenced_end): New function.
7815 (Script_options::is_referenced): New function.
7816 (Script_options::any_unreferenced): New function.
7817 * script-c.h (script_symbol): Declare.
7818 * yyscript.y (exp): Call script_symbol.
7819 * symtab.cc: Include "script.h".
7820 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7821 Change all callers. Check symbols referenced by scripts.
7822 (Symbol_table::add_undefined_symbols_from_command_line): Add
7823 layout parameter. Change all callers.
7824 (Symbol_table::do_add_undefined_symbols_from_command_line):
7825 Likewise. Break out loop body. Check symbols referenced by
7826 scripts.
7827 (Symbol_table::add_undefined_symbol_from_command_line): New
7828 function broken out of
7829 do_add_undefined_symbols_from_command_line.
7830 * symtab.h (class Symbol_table): Update declarations.
7831 * archive.cc: Include "layout.h".
7832 (Archive::should_include_member): Add layout parameter. Change
7833 all callers. Check for symbol mentioned in expression.
7834 * archive.h (class Archive): Update declaration.
7835 * object.cc (Sized_relobj::do_should_include_member): Add layout
7836 parameter.
7837 * object.h (Object::should_include_member): Add layout parameter.
7838 Change all callers.
7839 (Object::do_should_include_member): Add layout parameter.
7840 (class Sized_relobj): Update declaration.
7841 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7842 parameter.
7843 * dynobj.h (class Sized_dynobj): Update declaration.
7844 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7845 layout parameter.
7846 * plugin.h (class Sized_pluginobj): Update declaration.
7847
5f1ab67a
ILT
78482010-08-02 Ian Lance Taylor <iant@google.com>
7849
7850 PR 11866
7851 * output.cc (Output_segment::set_offset): Search for the first and
7852 last sections rather than assuming that the list is in order.
7853 (Output_segment::find_first_and_last_list): New function.
7854 * output.h (class Output_segment): Update declarations.
7855 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7856 (relro_strip_test_SOURCES): New variable.
7857 (relro_strip_test_DEPENDENCIES): New variable.
7858 (relro_strip_test_LDFLAGS): New variable.
7859 (relro_strip_test_LDADD): New variable.
7860 (relro_strip_test.so): New target.
7861
a8df5856
ILT
78622010-08-02 Ian Lance Taylor <iant@google.com>
7863
7864 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7865 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7866 (Target_i386::got_tlsdesc_section): New function.
7867 (Target_i386::got_section): Create space for GOT entries for
7868 TLSDESC relocations.
7869 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7870 R_386_TLS_GOTDESC.
7871 (Target_i386::Scan::global): Likewise.
7872 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7873 using TLSDESC GOT.
7874 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7875 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7876 (Target_x86_64::got_tlsdesc_section): New function.
7877 (Target_x86_64::got_section): Create space for GOT entries for
7878 TLSDESC relocations.
7879 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
7880 R_386_TLS_GOTDESC.
7881 (Target_x86_64::Scan::global): Likewise.
7882 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
7883 using TLSDESC GOT.
7884
0c10a0a6
ILT
78852010-08-02 Ian Lance Taylor <iant@google.com>
7886
7887 * testsuite/final_layout.sh: Use dc to convert from hex to
7888 decimal.
7889
41cbeecc
ST
78902010-07-29 Sriraman Tallam <tmsriram@google.com>
7891
7892 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
7893 paramter to the call to gold::gc_process_relocs.
7894 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
7895 paramter to the call to gold::gc_process_relocs.
7896 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
7897 parameter to the call to gold::gc_process_relocs.
7898 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
7899 template parameter to the call to gold::gc_process_relocs.
7900 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
7901 paramter to the call to gold::gc_process_relocs.
7902 * gc.h (get_embedded_addend_size): New function.
7903 (gc_process_relocs): Save the size of the reloc for use by ICF.
7904 * icf.cc (get_section_contents): Get the addend from the text section
7905 for SHT_REL relocation sections.
7906 * icf.h (Icf::Reloc_addend_size_info): New typedef.
7907 (Icf::Reloc_info): Add new member reloc_addend_size_info.
7908 * int_encoding.h (read_from_pointer): New overloaded function.
7909 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
7910 * testsuite/icf_sht_rel_addend_test.sh: New file.
7911 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
7912 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
7913
6ea55b82
RW
79142010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7915
7916 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
7917 * Makefile.in: Regenerate.
7918 * testsuite/Makefile.in: Regenerate.
7919
9691462b
ILT
79202010-07-27 Jeffrey Yasskin <jyasskin@google.com>
7921
7922 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
7923 * gold/testsuite/debug_msg.cc: Likewise.
7924 * gold/testsuite/odr_violation1.cc
7925 * gold/testsuite/odr_violation2.cc
7926
76897331
CC
79272010-07-21 Cary Coutant <ccoutant@google.com>
7928
7929 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
7930 string, and length fields.
7931 (Output_merge_string::Merged_strings_list): New type.
7932 (Output_merge_string::Merged_strings_lists): New typedef.
7933 (Output_merge_string): Replace merged_strings_ with
7934 merged_strings_lists_.
7935 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
7936 Merged_strings_list per input object and section. Don't store pointer
7937 to the string. Don't store length with each merged string entry.
7938 (Output_merge_string::finalize_merged_data): Loop over list of merged
7939 strings lists. Recompute length of each merged string.
7940
78384e8f
CC
79412010-07-15 Cary Coutant <ccoutant@google.com>
7942
7943 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
7944 here.
7945
783659f9
ILT
79462010-07-14 Ian Lance Taylor <iant@google.com>
7947
7948 * descriptors.cc (Descriptors::open): Report correct name in error
7949 message.
7950
131687b4
DK
79512010-07-13 Doug Kwan <dougkwan@google.com>
7952
7953 * arm.cc (Arm_input_section::Arm_input_section): For a
7954 SHT_ARM_EXIDX section, always keeps the input sections.
7955 (Arm_input_section::set_exidx_section_link): New method.
7956 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
7957 has_errors_ to false.
7958 (Arm_exidx_input_section::has_errors,
7959 Arm_exidx_input_section::set_has_errors): New methods.
7960 (Arm_exidx_input_section::has_errors_): New data member.
7961 (Arm_relobj::get_exidx_shndx_list): New method.
7962 (Arm_output_section::append_text_sections_to_list): Do not skip
7963 section without SHF_EXECINSTR.
7964 (Arm_output_section::fix_exidx_coverage): Skip input sections with
7965 errors.
2e702c99 7966 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
7967 section header. Make error messages more verbose. Check for
7968 a non-executable section linked to an EXIDX section.
7969 (Arm_relobj::do_read_symbols): Remove error checking, which has been
7970 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
7971 check that there is no deferred EXIDX section if we exit early.
7972 Instead of not making an EXIDX section in case of an error, make one
7973 and set the has_errors flag of it.
7974 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
7975 in a relocatable link.
7976 (Target_arm::do_relax): Look for the EXIDX output section instead of
7977 assuming that it is called .ARM.exidx.
2e702c99 7978 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
7979 section list. Do not check for SHF_EXECINSTR section flags but
7980 skip any input section with errors.
7981 * output.cc (Output_section::Output_section): Initialize
7982 always_keeps_input_sections_ to false.
7983 (Output_section::add_input_section): Check for
7984 always_keeps_input_sections_.
7985 * output.h (Output_section::always_keeps_input_sections,
7986 Output_section::set_always_keeps_input_sections): New methods.
7987 (Output_section::always_keeps_input_sections): New data member.
7988
69517287
RÁE
79892010-07-13 Rafael Espindola <espindola@google.com>
7990
7991 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
7992 * fileread.h (Input_file): Add try_extra_search_path and find_file.
7993
82742395
ILT
79942010-07-13 Philip Herron <herron.philip@googlemail.com>
7995 Ian Lance Taylor <iant@google.com>
7996
7997 * output.h (Output_section_lookup_maps::add_merge_section):
7998 Correct check of whether value was inserted.
7999 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8000 (Output_section_lookup_maps::add_relaxed_input_section):
8001 Likewise.
8002 * arm.cc (Target_arm::got_section): Remove used local os.
8003 * i386.cc (Target_i386::got_section): Likewise.
8004 * x86_64.cc (Target_x86_64::got_section): Likewise.
8005 * sparc.cc (Target_sparc::got_section): Likewise.
8006 (Target_sparc::relocate): Remove unused local have_got_offset.
8007 * powerpc.cc (Target_powerpc::relocate): Likewise.
8008
f2d707b5
ILT
80092010-07-13 Ian Lance Taylor <iant@google.com>
8010
241531d6
ILT
8011 * compressed_output.cc (zlib_decompress): Fix signature in
8012 !HAVE_ZLIB_H case.
8013
f2d707b5
ILT
8014 * archive.cc (Archive::include_member): Unlock an external member
8015 of a thin archive. Don't bother to delete an object we know is
8016 NULL.
8017
a2e47362
CC
80182010-07-12 Cary Coutant <ccoutant@google.com>
8019
8020 * compressed_output.cc (zlib_decompress): New function.
8021 (get_uncompressed_size): New function.
8022 (decompress_input_section): New function.
8023 * compressed_output.h (get_uncompressed_size): New function.
8024 (decompress_input_section): New function.
8025 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8026 Handle compressed debug sections.
8027 * layout.cc (is_compressed_debug_section): New function.
8028 (Layout::output_section_name): Map compressed section names to
8029 canonical names.
8030 * layout.h (is_compressed_debug_section): New function.
8031 (is_debug_info_section): Recognize compressed debug sections.
8032 * merge.cc: Include compressed_output.h.
8033 (Output_merge_data::do_add_input_section): Handle compressed
8034 debug sections.
8035 (Output_merge_string::do_add_input_section): Handle compressed
8036 debug sections.
8037 * object.cc: Include compressed_output.h.
8038 (Sized_relobj::Sized_relobj): Initialize new data members.
8039 (build_compressed_section_map): New function.
8040 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8041 * object.h (Object::section_is_compressed): New method.
8042 (Object::do_section_is_compressed): New method.
8043 (Sized_relobj::Compressed_section_map): New type.
8044 (Sized_relobj::do_section_is_compressed): New method.
8045 (Sized_relobj::compressed_sections_): New data member.
8046 * output.cc (Output_section::add_input_section): Handle compressed
8047 debug sections.
8048 * reloc.cc: Include compressed_output.h.
8049 (Sized_relobj::write_sections): Handle compressed debug sections.
8050
ce279a62
CC
80512010-07-08 Cary Coutant <ccoutant@google.com>
8052
8053 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8054 weak when resolving to a dynamic def.
8055 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8056 for weak undef/dynamic def cases. Adjust callers.
8057 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8058 undef_binding_weak_.
8059 (Symbol_table::sized_write_globals): Adjust symbol binding.
8060 (Symbol_table::sized_write_symbol): Add binding parameter.
8061 * symtab.h (Symbol::set_undef_binding): New method.
8062 (Symbol::is_undef_binding_weak): New method.
8063 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8064 (Symbol_table::should_override): Add new parameter.
8065 (Symbol_table::sized_write_symbol): Add new parameter.
8066
8067 * testsuite/weak_undef_file1.cc: Add new test case.
8068 * testsuite/weak_undef_file2.cc: Fix header comment.
8069 * testsuite/weak_undef_test.cc: Add new test case.
8070
b2286c10
DK
80712010-06-29 Doug Kwan <dougkwan@google.com>
8072
8073 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8074 Initialize USE_SYMBOL_.
8075 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8076 definition.
8077 (Arm_reloc_property::uses_symbol_): New data member declaration.
8078 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8079 uses symbol value and symbol is undefined but not weakly undefined.
8080
4802450a
RÁE
80812010-06-28 Rafael Espindola <espindola@google.com>
8082
8083 * plugin.cc (Plugin::load): Use dlerror.
8084
e5ca47ba
ILT
80852010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8086
8087 * symtab.cc (detect_odr_violations): When reporting an ODR
8088 violation, report an object where the symbol is defined.
8089
8a75a161
DK
80902010-06-25 Doug Kwan <dougkwan@google.com>
8091
8092 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8093 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8094 definition.
8095 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8096 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8097 target hook to detect function points.
8098 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8099 * icf.h (Icf::check_section_for_function_pointers): Change type of
8100 parameter SECTION_NAME to const reference to std::string. Use
8101 target hook to determine if section may have unsafe pointers.
8102 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8103 method definition.
8104
42218b9f
RÁE
81052010-06-21 Rafael Espindola <espindola@google.com>
8106
8107 * fileread.cc (Input_file::find_fie): New
8108 (Input_file::open): Use Input_file::find_fie.
8109 * fileread.h (Input_file::find_fie): New
8110 * plugin.cc (set_extra_library_path): New.
8111 (Plugin::load): Add set_extra_library_path to the transfer vector.
8112 (Plugin_manager::set_extra_library_path): New.
8113 (Plugin_manager::add_input_file): Use the extra search path if set.
8114 (set_extra_library_path(): New.
8115 * plugin.h (Plugin_manager): Add set_extra_library_path and
8116 extra_search_path_.
8117
a0506cca
CC
81182010-06-19 Cary Coutant <ccoutant@google.com>
8119
8120 * layout.cc (gdb_sections): Add .debug_types.
8121 (lines_only_debug_sections): Likewise.
8122
6508b958
RÁE
81232010-06-18 Rafael Espindola <espindola@google.com>
8124
8125 * plugin.cc (add_input_file,add_input_library)
8126 (Plugin_manager::add_input_file): Make filename arguments const.
8127 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8128 const.
8129
3e235302
DK
81302010-06-16 Doug Kwan <dougkwan@google.com>
8131
8132 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8133 .ARM.attributes section if we have not merged any input
8134 attributes sections.
8135
106e8a6c
DK
81362010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8137
8138 * arm.cc: Allow combining objects with no EABI version
8139 information.
8140
91ff43fe
RÁE
81412010-06-15 Rafael Espindola <espindola@google.com>
8142
8143 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8144
68ed838c
ILT
81452010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8146
8147 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8148 (struct iovec): Correct !HAVE_READV definition.
8149
f3a2388f
CC
81502010-06-10 Cary Coutant <ccoutant@google.com>
8151
8152 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8153 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8154 reloc sections.
8155 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8156
8157 PR 11683
8158 * symtab.h (Symbol::is_placeholder): New member function.
8159 * target-reloc.h (relocate_section): Check for placeholder symbols.
8160
8161 * testsuite/Makefile.am (plugin_test_8): New test.
8162 (plugin_test_9): New test.
8163 * testsuite/Makefile.in: Regenerate.
8164
e1df38aa
NC
81652010-06-09 Nick Clifton <nickc@redhat.com>
8166
8167 * yyscript.y (input_list_element): Allow strings prefixed with
8168 the '-' character. Treat these as libraries.
8169 * script.cc (script_add_library): New function. Adds a library
8170 specified by "-l<name>" found in an input script.
8171 * script-c.h: Add prototype for script_add_library.
8172
25bbe950
DK
81732010-06-07 Doug Kwan <dougkwan@google.com>
8174
8175 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8176 Restrict stub-group size to be within long conditional branch
8177 range when working around cortex-A8 erratum.
8178
0f32ea4c
ILT
81792010-06-07 Damien Diederen <dd@crosstwine.com>
8180
8181 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8182 #ifdef typo.
8183
8fe2a369
ST
81842010-06-03 Sriraman Tallam <tmsriram@google.com>
8185
8186 PR gold/11658
8187 * output.cc
8188 (Output_section::Input_section_sort_entry::compare_section_ordering):
8189 Change to return non-zero correctly.
8190 (Output_section::Input_section_sort_section_order_index_compare
8191 ::operator()): Change to fix ambiguity in comparisons.
8192
6e9ba2ca
ST
81932010-06-01 Sriraman Tallam <tmsriram@google.com>
8194
8195 * gold.h (is_wildcard_string): New function.
8196 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8197 (Layout::layout_eh_frame): Ditto.
8198 (Layout::find_section_order_index): New method.
8199 (Layout::read_layout_from_file): New method.
8200 * layout.h (Layout::find_section_order_index): New method.
8201 (Layout::read_layout_from_file): New method.
8202 (Layout::input_section_position_): New private member.
8203 (Layout::input_section_glob_): New private member.
8204 * main.cc (main): Call read_layout_from_file here.
8205 * options.h (--section-ordering-file): New option.
8206 * output.cc (Output_section::input_section_order_specified_): New
8207 member.
8208 (Output_section::Output_section): Initialize new member.
8209 (Output_section::add_input_section): Add new parameter.
8210 Keep input sections when --section-ordering-file is used.
8211 (Output_section::set_final_data_size): Sort input sections when
8212 section ordering file is specified.
8213 (Output_section::Input_section_sort_entry): Add new parameter.
8214 Check sorting type.
8215 (Output_section::Input_section_sort_entry::compare_section_ordering):
8216 New method.
8217 (Output_section::Input_section_sort_compare::operator()): Change to
8218 consider section_order_index.
8219 (Output_section::Input_section_sort_init_fini_compare::operator()):
8220 Change to consider section_order_index.
8221 (Output_section::Input_section_sort_section_order_index_compare
8222 ::operator()): New method.
8223 (Output_section::sort_attached_input_sections): Change to sort
8224 according to section order when specified.
e1df38aa
NC
8225 (Output_section::add_input_section<32, true>): Add new parameter.
8226 (Output_section::add_input_section<64, true>): Add new parameter.
8227 (Output_section::add_input_section<32, false>): Add new parameter.
8228 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8229 * output.h (Output_section::add_input_section): Add new parameter.
8230 (Output_section::input_section_order_specified): New
8231 method.
8232 (Output_section::set_input_section_order_specified): New method.
8233 (Input_section::Input_section): Initialize section_order_index_.
8234 (Input_section::section_order_index): New method.
8235 (Input_section::set_section_order_index): New method.
8236 (Input_section::section_order_index_): New member.
8237 (Input_section::Input_section_sort_section_order_index_compare): New
8238 struct.
8239 (Output_section::input_section_order_specified_): New member.
8240 * script-sections.cc (is_wildcard_string): Delete and move modified
8241 method to gold.h.
8242 (Output_section_element_input::Output_section_element_input): Modify
8243 call to is_wildcard_string.
8244 (Output_section_element_input::Input_section_pattern
8245 ::Input_section_pattern): Ditto.
8246 (Output_section_element_input::Output_section_element_input): Ditto.
8247 * testsuite/Makefile.am (final_layout): New test case.
8248 * testsuite/Makefile.in: Regenerate.
8249 * testsuite/final_layout.cc: New file.
8250 * testsuite/final_layout.sh: New file.
8251
3537c84b
RÁE
82522010-06-01 Rafael Espindola <espindola@google.com>
8253
8254 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8255
105b6afd
RÁE
82562010-06-01 Rafael Espindola <espindola@google.com>
8257
8258 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8259 visibility of symbols.
8260
29e11421
DK
82612010-05-27 Doug Kwan <dougkwan@google.com>
8262
8263 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8264 from start of output section instead of address for a local symbol
8265 in a merged or relaxed section when doing a relocatable link.
8266
5e0f337e
RÁE
82672010-05-26 Rafael Espindola <espindola@google.com>
8268
703d02da 8269 PR 11604
5e0f337e
RÁE
8270 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8271 adding sections the garbage collector removed.
8272 * gold/testsuite/Makefile.am: Add test.
8273 * gold/testsuite/Makefile.in: Regenerate.
8274 * gold/testsuite/plugin_test_7.sh: New.
8275 * gold/testsuite/plugin_test_7_1.c: New.
8276 * gold/testsuite/plugin_test_7_2.c: New.
8277
f4187277
RÁE
82782010-05-26 Rafael Espindola <espindola@google.com>
8279
8280 * script-sections.cc (Output_section_definition::set_section_addresses):
8281 Check for --section-start.
8282
5c388529
DK
82832010-05-26 Doug Kwan <dougkwan@google.com>
8284
8285 * arm.cc (Arm_scan_relocatable_relocs): New class.
8286 (Target_arm::relocate_special_relocatable): New method.
8287 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8288 (Arm_relocate_functions::thumb_branch_common): Same.
8289 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8290 instead of Default_scan_relocatable_relocs.
8291 * target-reloc.h (relocate_for_relocatable): Let target handle
8292 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8293 * target.h (Sized_target::relocate_special_relocatable): New method.
8294
bca1c3ae
ILT
82952010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8296
8297 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8298
0439c796
DK
82992010-05-23 Doug Kwan <dougkwan@google.com>
8300
8301 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8302 instead of a cast.
8303 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8304 with a direct branch, not a conditional branch, to a stub.
8305 * merge.cc (Output_merge_base::record_input_section): New method
8306 defintion.
8307 (Output_merge_data::do_add_input_section): Record input section if
8308 keeps-input-sections flag is set.
8309 (Output_merge_string::do_add_input_section): Ditto.
8310 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8311 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8312 INPUT_SECTIONS_.
8313 (Output_merge_base::keeps_input_sections,
8314 Output_merge_base::set_keeps_input_sections,
8315 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8316 method definitions.
8317 (Output_merge_base::Input_sections): New type declaration.
8318 (Output_merge_base::input_sections_begin,
8319 Output_merge_base::input_sections_end,
8320 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8321 (Output_merge_base::bool keeps_input_sections_,
8322 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8323 Output_merge_base::input_sections_): New data members.
8324 (Output_merge_data::do_set_keeps_input_sections): New method
8325 defintion.
8326 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8327 * output.cc (Output_section::Input_section::relobj): Move method
8328 defintion from class declaration to here and handle merge sections.
8329 (Output_section::Input_section::shndx): Ditto.
8330 (Output_section::Output_section): Remove initializations of removed
8331 data members and initialize new data member LOOKUP_MAPS_.
8332 (Output_section::add_input_section): Set keeps-input-sections flag
8333 for a newly created merge output section as appropriate. Adjust code
8334 to use Output_section_lookup_maps class.
8335 (Output_section::add_relaxed_input_section): Adjst code for lookup
8336 maps code refactoring.
2e702c99 8337 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8338 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8339 class. If adding input section to a newly created merge output
8340 section fails, remove the new merge section.
8341 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8342 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8343 (Output_section::find_merge_section): Ditto.
0439c796 8344 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8345 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8346 Output_section_lookup_maps class.
8347 (Output_section::get_input_sections): Export merge sections. Adjust
8348 code to use Output_section_lookup_maps class.
8349 (Output_section:::add_script_input_section): Adjust code to use
8350 Output_section_lookup_maps class. Update lookup maps for merge
8351 sections also.
8352 (Output_section::discard_states): Use Output_section_lookup_maps.
8353 (Output_section::restore_states): Same.
8354 * output.h (Merge_section_properties): Move class defintion out of
8355 Output_section.
8356 (Output_section_lookup_maps): New class.
8357 (Output_section::Input_section::is_merge_section): New method
8358 defintion.
8359 (Output_section::Input_section::relobj): Move defintion out of class
8360 defintion. Declare method only.
8361 (Output_section::Input_section::shndx): Ditto.
8362 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8363 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8364 (Output_section::Merge_section_by_properties_map,
8365 Output_section::Output_section_data_by_input_section_map,
8366 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8367 Remove types.
2e702c99 8368 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8369 KEEPS_INPUT_SECTIONS.
8370 (Output_section::build_lookup_maps): New method declaration.
8371 (Output_section::merge_section_map_,
8372 Output_section::merge_section_by_properties_map_,
8373 Output_section::relaxed_input_section_map_,
8374 Output_section::is_relaxed_input_section_map_valid_): Remove data
8375 members.
8376 (Output_section::lookup_maps_): New data member.
8377
76295588
L
83782010-05-21 Doug Kwan <dougkwan@google.com>
8379
8380 PR gold/11619
8381 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8382 avoid a compilation error.
8383
d103a984
RÁE
83842010-05-19 Rafael Espindola <espindola@google.com>
8385
8386 * script-sections.cc (Output_section_definition::allocate_to_segment):
8387 Update the phdrs_list even when the output section is NULL.
8388 * testsuite/Makefile.am: Add test.
8389 * testsuite/Makefile.in: Regenerate.
8390 * testsuite/script_test_9.cc: New.
8391 * testsuite/script_test_9.sh: New.
8392 * testsuite/script_test_9.t: New.
8393
6625d24e
DK
83942010-05-19 Doug Kwan <dougkwan@google.com>
8395
8396 * arm.cc (Arm_input_section::original_size): New method.
8397 (Arm_input_section::do_addralign): Add a cast.
8398 (Arm_input_section::do_output_offset): Remove static cast.
8399 (Arm_input_section::original_addralign,
8400 Arm_input_section::original_size_): Change type to uint32_t.
8401 (Arm_input_section::init): Add safe casts for section alignment
8402 and size.
8403 (Arm_input_section::set_final_data_size): Do not set address and
8404 offset of stub table.
8405 (Arm_output_section::fix_exidx_coverage): Change use of of
8406 Output_section::Simple_input_section to that of
8407 Output_section::Input_section.
8408 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8409 except for the first pass.
8410 * output.cc (Output_section::get_input_sections): Change type of
8411 input_sections to std::list<Input_section>.
8412 (Output_section::add_script_input_section): Rename from
8413 Output_section::add_simple_input_section. Change type of SIS
8414 parameter from Simple_input_section to Input_section.
8415 * output.h (Output_section::Simple_input_section): Remove class.
8416 (Output_section::Input_section): Change class visibility to public.
8417 (Output_section::Input_section::addralign): Use stored alignments
8418 for special input sections if set.
8419 (Output_section::Input_section::set_addralign): New method.
8420 (Output_section::get_input_sections): Change parameter type from
8421 list of Simple_input_section to list of Input_section.
8422 (Output_section::add_script_input_section): Rename from
8423 Output_section::add_simple_input_section. Change first parameter's
8424 type from Simple_input_section to Input_section and remove the
8425 second and third parameters.
8426 * script-sections.cc (Input_section::Input_section_list): Change
8427 type to list of Output_section::Input_section/
8428 (Input_section_info::Input_section_info): Change parameter type of
8429 INPUT_SECTION to Output_section::Input_section.
8430 (Input_section_info::input_section): Change return type.
8431 (Input_section_info::input_section_): Change type to
8432 Output_section::Input_section.
8433 (Output_section_element_input::set_section_addresses): Adjust code
8434 to use Output_section::Input_section instead of
8435 Output_section::Simple_input_section. Adjust code for renaming
8436 of Output_section::add_simple_input_section.
8437 (Orphan_output_section::set_section_addresses): Ditto.
8438
e1e82ea4
RW
84392010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8440
8441 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8442 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8443
91e75c8a
RÁE
84442010-05-18 Rafael Espindola <espindola@google.com>
8445
8446 * options.cc (General_options::finalize): Handle -nostdlib.
8447 * options.h (nostdlib): New option.
8448 * script.cc (script_add_search_dir): Handle -nostdlib.
8449
da59ad79
DK
84502010-05-12 Doug Kwan <dougkwan@google.com>
8451
8452 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8453 attributes section only if there no attributes section after merging.
8454 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8455 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8456 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8457 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8458 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8459 and arm_attr_merge_7.stdout.
8460 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8461 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8462 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8463 arm_attr_merge_7b.o): New rules.
8464 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8465 arm_attr_merge_7
8466 * testsuite/Makefile.in: Regenerate.
8467 * testsuite/arm_attr_merge.sh: New file.
8468 * testsuite/arm_attr_merge_[67][ab].s: Same.
8469
3e01a7fd
NC
84702010-05-05 Nick Clifton <nickc@redhat.com>
8471
8472 * po/es.po: Updated Spanish translation.
8473
7ad2014a
L
84742010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8475
8476 * Makefile.am (install-exec-local): Properly install gold as
8477 default cross linker.
8478 * Makefile.in: Regenerated.
8479
4fda8867
NC
84802010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8481 Nick Clifton <nickc@redhat.com>
8482
8483 * configure.ac (install_as_default): Define and set to false
8484 unless --enable-gold or --enable-gold=both/gold has been
8485 specified.
8486 * configure: Regenerate.
8487
8488 * Makefile.am (install-exec-local): Install the executable as
8489 'ld.gold'. If install_as_default is true then also install it as
8490 'ld'.
8491 * Makefile.in: Regenerated.
8492
bd288ea2
ILT
84932010-04-24 Ian Lance Taylor <iant@google.com>
8494
8495 * layout.cc (Layout::layout_reloc): In relocatable link don't
8496 combine reloc sections for grouped sections.
8497
ef38fd8a
ST
84982010-04-23 Sriraman Tallam <tmsriram@google.com>
8499
8500 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8501 sections that are not ordinary to icf.
8502 * icf.cc (get_section_contents): Handle relocation pointing to section
8503 with no object or shndx information.
8504 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8505 * testsuite/Makefile.in: Regenerate.
8506 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8507 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8508
f6973bdc
ILT
85092010-04-22 Ian Lance Taylor <iant@google.com>
8510
8511 * expression.cc (Expression::Expression_eval_info): Add
8512 result_alignment_pointer field.
8513 (Expression::eval_with_dot): Add result_alignment_pointer
8514 parameter. Change all callers.
8515 (Expression::eval_maybe_dot): Likewise.
8516 (class Binary_expression): Add alignment_pointer parameter to
8517 left_value and right_value. Change all callers.
8518 (BINARY_EXPRESSION): Set result alignment.
8519 (class Trinary_expression): Add alignment_pointer parameter to
8520 arg2_value and arg3_value. Change all callers.
8521 (Trinary_cond::value): Set result alignment.
8522 (Max_expression::value, Min_expression::value): Likewise.
8523 (Align_expression::value): Likewise.
8524 * script-sections.cc (class Sections_element): Add dot_alignment
8525 parameter to set_section_addresses virtual function. Update
8526 instantiations.
8527 (class Output_section_element): Likewise.
8528 (Script_sections::create_segments): Add dot_alignment parameter.
8529 Change all callers.
8530 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8531 (Script_sections::set_phdrs_clause_addresses): Likewise.
8532 * script-sections.h: Update declarations.
8533 * script.h: Update declarations.
8534 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8535 min_p_align.
8536 * testsuite/script_test_3.t: Set large alignment.
8537 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8538 segment has expected alignment.
8539
9c9c98a5
NC
85402010-04-22 Nick Clifton <nickc@redhat.com>
8541
8542 * po/gold.pot: Updated by the Translation project.
8543 * po/vi.po: Updated Vietnamese translation.
8544
2253bfba
L
85452010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8546
8547 * testsuite/Makefile.am (check_PROGRAMS): Add
8548 icf_virtual_function_folding_test.
8549 * testsuite/Makefile.in: Regenerated.
8550
85fdf906
AH
85512010-04-15 Andrew Haley <aph@redhat.com>
8552
8553 * options.h (merge_exidx_entries): New option.
8554 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8555 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8556 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8557 (Target_arm::merge_exidx_entries): New function.
8558 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8559 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8560 to Arm_exidx_fixup constructor.
8561 Add new arg, merge_exidx_entries.
8562 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8563 Arm_output_section::fix_exidx_coverage.
8564
ce97fa81
ST
85652010-04-18 Sriraman Tallam <tmsriram@google.com>
8566
8567 * icf.cc (get_section_contents): Check for preemptible functions.
8568 Ignore addend when appropriate.
8569 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8570 section folded.
8571 (add_from_relobj): Check for section folded.
8572 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8573 * symtab.h (should_add_dynsym_entry): Add new parameter.
8574 * target-reloc.h (scan_relocs): Check for section folded.
8575 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8576 Check reloc types for function pointers in shared objects.
8577 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8578 case.
8579 (icf_preemptible_functions_test): New test case.
8580 (icf_string_merge_test): New test case.
8581 * testsuite.Makefile.in: Regenerate.
8582 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8583 bar_glob. Refactor code.
8584 * testsuite/icf_preemptible_functions_test.cc: New file.
8585 * testsuite/icf_preemptible_functions_test.sh: New file.
8586 * testsuite/icf_string_merge_test.cc: New file.
8587 * testsuite/icf_string_merge_test.sh: New file.
8588 * testsuite/icf_virtual_function_folding_test.cc: New file.
8589 * testsuite/icf_virtual_function_folding_test.sh: New file.
8590
04ceb17c
DK
85912010-04-14 Doug Kwan <dougkwan@google.com>
8592
8593 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8594 for local symbol recounting if we remove a section due to ICF.
8595 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8596 there are no regular objects in input.
8597
153e7da4
DK
85982010-04-13 Doug Kwan <dougkwan@google.com>
8599
8600 * arm.cc (Arm_input_section::set_final_data_size): Compute
8601 accurate final data size instead of using current data size.
8602
4dbd9faf
DK
86032010-04-09 Doug Kwan <dougkwan@google.com>
8604
8605 * layout.cc (Layout::choose_output_section): Handle script section
8606 types.
8607 (Layout::make_output_section_for_script): Add section type parameter.
8608 Handle script section types.
8609 * layout.h (Layout::make_output_section_for_script): Add section
8610 type parameter.
8611 * output.cc (Output_section::Output_section): Initialize data member
8612 is_noload_.
8613 (Output_section::do_reset_address_and_file_offset): Do not set address
8614 to 0 if section is a NOLOAD section.
8615 * output.h (Output_section::is_noload): New method.
8616 (Output_section::set_is_noload): Ditto.
8617 (Output_section::is_noload_): New data member.
8618 * script-c.h (Script_section_type): New enum type.
8619 (struct Parser_output_section_header): Add new file section_type.
8620 * script-sections.cc (Sections_element::output_section_name): Add
8621 parameter for returning script section type.
8622 (Output_section_definition::output_section_name): Ditto.
8623 (Output_section_definition::section_type)P; New method.
8624 (Output_section_definiton::script_section_type_name): Ditto.
8625 (Output_section_definition::script_section_type_): New data member.
8626 (Output_section_definition::Output_section_definition): Initialize
8627 data member Output_section_definition::script_section_type_.
8628 (Output_section_definition::create_sections): Pass script section type
8629 to Layout::make_output_section_for_script.
8630 (Output_section_definition::output_section_name): Return script
8631 section type to caller.
8632 (Output_section_definition::set_section_address): Do not advance
8633 dot value and load address if section type is NOLOAD. Set address
8634 of NOLOAD sections regardless of section flags.
8635 (Output_section_definition::print): Print section type if it is
8636 not SCRIPT_SECTION_TYPE_NONE.
8637 (Output_section_definition::section_type): New method.
8638 (Output_section_definition::script_section_type_name): Ditto.
8639 (Script_sections::output_section_name): Add new parameter
8640 PSECTION_TYPE for returning script section type. Pass it to
8641 section elements. Handle discard sections.
8642 (Sort_output_sections::operator()): Handle NOLOAD sections.
8643 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8644 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8645 returning script section type.
8646 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8647 INFO and NOLOAD.
8648 * yyscript.y (union): Add new field SECTION_TYPE.
8649 (COPY, DSECT, INFO, NOLOAD): New tokens.
8650 (opt_address_and_section_type): Change type to output_section_header.
8651 (section_type): New non-terminal
8652 (section_header): Handle section type.
2253bfba 8653 (opt_address_and_section_type): Return section type value.
4dbd9faf 8654
721ea635
L
86552010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8656
8657 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8658 * testsuite/plugin_common_test_2.c (foo): Likewise.
8659
6bf924b0
DK
86602010-04-08 Doug Kwan <dougkwan@google.com>
8661
8662 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8663 Output_merge_data.
8664 * output.cc (Output_section::add_merge_input_section): Simplify
8665 code and return status of Output_merge_base::add_input_section.
e1df38aa 8666 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8667 returns true.
8668
24af6f92
DK
86692010-04-07 Doug Kwan <dougkwan@google.com>
8670
8671 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8672 if section is marked as containing instructions but has no mapping
8673 symbols.
8674 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8675 correct section index.
8676 (Arm_relobj::find_linked_text_section): Ditto.
8677
00698fc5
CC
86782010-04-07 Cary Coutant <ccoutant@google.com>
8679
8680 * archive.cc (include_member): Destroy Read_symbols_data object before
8681 releasing file.
8682 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8683 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8684 (Read_symbols_data::~Read_symbols_data) New destructor.
8685 (Section_relocs::Section_relocs) New constructor.
8686 (Section_relocs::~Section_relocs) New destructor.
8687 (Read_relocs_data::Read_relocs_data) New constructor.
8688 (Read_relocs_data::~Read_relocs_data) New destructor.
8689 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8690 pointers to NULL after deleting.
8691
7296d933
DK
86922010-04-07 Doug Kwan <dougkwan@google.com>
8693
8694 * arm.cc: Replace "endianity" with "endianness" in comments.
8695 (Arm_exidx_cantunwind): Ditto.
8696 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8697 (Arm_relobj::merge_flags_and_attributes): New method.
8698 (Arm_relobj::merge_flags_and_attributes_): New data member.
8699 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8700 (Arm_relobj::scan_sections_for_stubs): Ditto.
8701 (Arm_relobj::do_read_symbols): Check to see if we really want to
8702 merge processor-specific flags and attributes. Exit early if
8703 an object is empty except for section names and the undefined symbol.
8704 (Target_arm::do_finalize_sections): Move check for ELF format to
8705 Arm_relobj::do_read_symbols. Merge processor specific flags and
8706 attributes from a regular object only when we have determined that
8707 it is aapropriate. Do not create an .ARM.attributes section in
8708 output if there is no regular input object.
8709 (Target_arm::merge_processor_specific_flags): Check
8710 --warn-mismatch before printing any error.
8711 (Target_arm::merge_object_attributes): Ditto.
8712 * gold.cc (queue_middle_tasks): Handle the case in which there is
8713 no regular object in input.
8714 * options.cc (General_options::parse_EB): New method.
8715 (General_options::parse_EL): Same.
8716 (General_options::General_options): Initialize endianness_.
8717 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8718 New options.
8719 (General_options::Endianness): New enum.
8720 (General_options::endianness): New method.
8721 (General_options::endianness_): New data member.
8722 * parameters.cc (Parameters::set_options): Check target endianness.
8723 (Parameters::set_target_once): Ditto.
8724 (Parameters::check_target_endianness): New method.
8725 (parameters_force_valid_target): If either -EL or -EB is specified,
8726 use it to define endianness of default target.
8727 * parameters.h (Parameters::check_target_endianness): New method
8728 declaration.
8729 * target.h (class Target): Change "endianity" to "endianness"
8730 in comments.
8731
efc8d4f2
RW
87322010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8733
8734 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8735 * configure: Regenerate.
8736 * Makefile.in: Regenerate.
8737 * testsuite/Makefile.in: Regenerate.
8738
be234d88
CC
87392010-04-06 Cary Coutant <ccoutant@google.com>
8740
8741 gcc PR lto/42757
8742 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8743 prevailing definitions of common symbols.
8744 * testsuite/plugin_test_6.sh: New test case.
8745 * testsuite/plugin_common_test_1.c: New test case.
8746 * testsuite/plugin_common_test_2.c: New test case.
8747 * testsuite/Makefile.am (plugin_test_6): New test case.
8748 * testsuite/Makefile.in: Regenerate.
8749
bd32c6bd
NC
87502010-04-06 Nick Clifton <nickc@redhat.com>
8751
8752 * po/vi.po: New Vietnamese translation.
8753
323c532f
DK
87542010-03-30 Doug Kwan <dougkwan@google.com>
8755
8756 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8757
4fcd97eb
DK
87582010-03-25 Doug Kwan <dougkwan@google.com>
8759
8760 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8761 to avoid a conversion warning on a 32-bit host.
8762
4ebf39db
ILT
87632010-03-24 Ian Lance Taylor <iant@google.com>
8764
8765 * testsuite/script_test_3.t: Add a TLS segment.
8766 * testsuite/Makefile.am (check_PROGRAMS): Add
8767 tls_phdrs_script_test.
8768 (tls_phdrs_script_test_SOURCES): Define.
8769 (tls_phdrs_script_test_DEPENDENCIES): Define.
8770 (tls_phdrs_script_test_LDFLAGS): Define.
8771 (tls_phdrs_script_test_LDADD): Define.
8772 * testsuite/Makefile.in: Rebuild.
8773
4a599bdd
CC
87742010-03-23 Cary Coutant <ccoutant@google.com>
8775
8776 * fileread.cc (find_or_make_view): Fix comment.
8777
6c93b22c
ILT
87782010-03-23 Ian Lance Taylor <iant@google.com>
8779
8780 * script-sections.cc (class Orphan_section_placement): Define
8781 PLACE_TLS and PLACE_TLS_BSS.
8782 (Orphan_section_placement::Orphan_section_placement): Initialize
8783 new places.
8784 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8785 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8786 (tls_script_test_SOURCES): Define.
8787 (tls_script_test_DEPENDENCIES): Define.
8788 (tls_script_test_LDFLAGS): Define.
8789 (tls_script_test_LDADD): Define.
8790 * testsuite/Makefile.in: Rebuild.
8791
a2c7281b
DK
87922010-03-22 Doug Kwan <dougkwan@google.com>
8793
8794 * arm.cc (Arm_relocate_functions::abs8,
8795 Arm_relocate_functions::abs16): Use correct check for overflow
8796 specified in the ARM ELF specs.
8797 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8798 target of a BLX instruction specially.
8799 (Reloc_stub::stub_type_for_reloc): Ditto.
8800 (Relocate::relocate): Use symbolic names instead of numeric relocation
8801 codes to report error.
8802 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8803 workaround.
8804 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8805 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8806 thumb2_blx_out_of_range.stdout
8807 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8808 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8809 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8810 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8811 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8812 thumb2_blx_in_range, thumb2_blx_in_range.o,
8813 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8814 thumb2_blx_out_of_range.o): New rules.
2e702c99 8815 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
8816 thumb2_blx_in_range and thumb2_blx_out_of_range.
8817 * testsuite/Makefile.in: Regenerate.
8818 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8819 * testsuite/thumb_blx_in_range.s: New file.
8820 * testsuite/thumb_blx_out_of_range.s: New file.
8821
b0193076
RÁE
88222010-03-22 Rafael Espindola <espindola@google.com>
8823
8824 * archive.cc (Should_include): Move to archive.h.
8825 (should_include_member): Make it a member of Archive.
8826 (Lib_group): New.
8827 (Add_lib_group_symbols): New.
8828 * archive.h: Include options.h.
8829 (Archive_member): Moved from Archive.
8830 (Should_include): Moved from archive.cc.
8831 (Lib_group): New.
8832 (Add_lib_group_symbols): New.
8833 * dynobj.cc (do_should_include_member): New.
8834 * dynobj.h (do_should_include_member): New.
8835 * gold.cc (queue_initial_tasks): Update call to queue.
8836 * main.cc (main): Print lib group stats.
8837 * object.cc (do_should_include_member): New.
8838 * object.h: Include archive.h.
8839 (Object::should_include_member): New.
8840 (Object::do_should_include_member): New.
8841 (Sized_relobj::do_should_include_member): New.
8842 * options.cc (General_options::parse_start_lib): New.
8843 (General_options::parse_end_lib): New.
8844 (Input_arguments::add_file): Handle lib groups.
8845 (Input_arguments::start_group): Check we are not in a lib.
8846 (Input_arguments::start_lib): New.
8847 (Input_arguments::end_lib): New.
8848 * options.h (General_options): Add start_lib and end_lib.
8849 (Input_argument::lib_): New.
8850 (Input_argument::lib): New.
8851 (Input_argument::is_lib): New.
8852 (Input_file_lib): New.
8853 (Input_arguments::in_lib_): New.
8854 (Input_arguments::in_lib): New.
8855 (Input_arguments::start_lib): New.
8856 (Input_arguments::end_lib_): New.
8857 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8858 in unused members as preempted.
8859 (Sized_pluginobj::do_should_include_member): New.
8860 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8861 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8862 return the blocker.
8863 (Read_symbols::do_whole_lib_group): New.
8864 (Read_symbols::do_lib_group): New.
8865 (Read_symbols::do_read_symbols): Handle lib groups.
8866 (Read_symbols::get_name): Handle lib groups.
8867 * readsyms.h (Read_symbols): Add an archive member pointer.
8868 (Read_symbols::do_whole_lib_group): New.
8869 (Read_symbols::do_lib_group): New.
8870 (Read_symbols::member_): New.
8871 * script.cc (read_input_script): Update call to queue_soon.
8872
d099120c
DK
88732010-03-19 Doug Kwan <dougkwan@google.com>
8874
8875 * arm.cc (Stub_table::Stub_table): Initialize new data members
8876 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8877 (Stub_table::add_reloc_stub): Assign stub offset and update
8878 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8879 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
8880 New data members.
2e702c99 8881 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
8882 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
8883 instead of going over all reloc stubs.
2e702c99 8884 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
8885 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8886 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 8887 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
8888 Stringpool_template::offset_.
8889 * stringpool.h (Stringpool_template::set_no_zero_null): Set
8890 Stringpool_template::offset_ to zero.
8891
1aa37384
DK
88922010-03-15 Doug Kwan <dougkwan@google.com>
8893
8894 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8895 offset_.
8896 (Stringpool_template::new_key_offset): New method.
8897 (Stringpool_template::add_string): Assign offsets when adding new
8898 strings.
8899 (Stringpool_template::set_string_offsets): Do not set string offsets
8900 when not optimizing.
8901 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
8902 member size_.
2e702c99
RM
8903 (Chunked_vector::clear): Clear size_.
8904 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
8905 (Chunked_vector::size): Return size_.
8906 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 8907 (Chunked_vector::size_): New data member.
1aa37384
DK
8908 (Stringpool_template::set_no_zero_null): Assert string set is empty.
8909 (Stringpool_template::new_key_offset): New method declaration.
8910 (Stringpool_template::offset_): New data member.
8911
b672b057
RÁE
89122010-03-15 Rafael Espindola <espindola@google.com>
8913
8914 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
8915 Add_symbols' constructor.
8916 * readsyms.h (Add_symbols): Remove the input_group member.
8917
b6848d3c
ILT
89182010-03-10 Ian Lance Taylor <iant@google.com>
8919
8920 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
8921 target to ask whether a reference to a symbol requires a stack
8922 split.
8923 * target.h (Target::is_call_to_non_split): New function.
8924 (Target::do_is_call_to_non_split): Declare virtual function.
8925 * target.cc: Include "symtab.h".
8926 (Target::do_is_call_to_non_split): New function.
8927 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
8928
a2a5469e
CC
89292010-03-10 Cary Coutant <ccoutant@google.com>
8930
8931 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
8932 (File_read::open[1]): Remove initial mapping of whole_file_view_.
8933 (File_read::open[2]): Add whole_file_view_ to list of views.
8934 (File_read::make_view): Remove test of whole_file_view_.
8935 (File_read::find_or_make_view): Create whole_file_view_ if
8936 necessary.
8937 (File_read::clear_views): Replace bool parameter with enum;
8938 adjust all callers. Don't delete views with permanent data;
8939 do delete cached views and views from archives if
8940 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
8941 if clearing the corresponding view.
8942 * fileread.h (File_read::Clear_views_mode): New enum.
8943 (File_read::View::is_permanent_view): New method.
8944 (File_read::clear_views): Replace bool parameter
8945 with enum; adjust all callers.
8946 * options.h (General_options): Change keep_files_mapped option;
8947 add map_whole_files.
8948 * readsyms.cc (Add_symbols::run): Delete sd_ object before
8949 releasing the file.
8950 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
8951 the file.
8952
8861f32b
DM
89532010-03-10 David S. Miller <davem@davemloft.net>
8954
8955 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
8956
d62d0f5f
ST
89572010-03-09 Sriraman Tallam <tmsriram@google.com>
8958
8959 * icf.cc (get_section_contents): Add '@' marker after processing the
8960 merge reloc.
8961
9177756d
DK
89622010-03-08 Doug Kwan <dougkwan@google.com>
8963
8964 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
8965 due to a conversion warning.
8966 (Arm_relobj::update_output_local_symbol_count): Check for local
8967 symbol with unset output index.
8968
9e9e071b
ILT
89692010-03-05 Ian Lance Taylor <iant@google.com>
8970
8971 * options.h (class General_options): Add --spare-dynamic-tags.
8972 * output.cc (Output_data_dynamic::set_final_data_size): Implement
8973 --spare-dynamic-tags.
8974
a81ee015
ILT
89752010-03-05 Ian Lance Taylor <iant@google.com>
8976
8977 * incremental.cc: Include "libiberty.h".
8978
44ec90b9
RO
89792010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
8980
8981 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
8982 function, is_info_ member.
8983 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
8984 (Versions::Versions): Update caller.
8985 (Versions::define_base_version): Likewise.
8986 (Versions::add_def): Likewise.
8987
0897ed3b
ST
89882010-03-03 Sriraman Tallam <tmsriram@google.com>
8989
8990 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
8991 (Scan::possible_function_pointer_reloc): New function.
8992 (Scan::local_reloc_may_be_function_pointer): Change to call
8993 possible_function_pointer_reloc.
8994 (Scan::global_reloc_may_be_function_pointer): Ditto.
8995 * icf.h (Icf::check_section_for_function_pointers): Change to reject
8996 relocations in ".data.rel.ro._ZTV" section.
8997 * testsuite/icf_safe_so_test.sh: Change to pass i386.
8998 * testsuite/icf_safe_so_test.cc: Ditto.
8999 * testsuite/icf_safe_test.cc: Ditto.
9000 * testsuite/icf_safe_test.sh: Ditto.
9001
d3bbad62
ILT
90022010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9003 Ian Lance Taylor <iant@google.com>
9004
9005 * target-reloc.h (relocate_section): Check the symbol table index
9006 for -1U before setting the local symbol index.
9007 (scan_relocatable_relocs): If copying the relocation, record that
9008 the local symbol is required.
9009 * object.h (Symbol_value::is_output_symtab_index_set): New
9010 function.
9011 (Symbol_value::may_be_discarded_from_output_symtab): New
9012 function.
9013 (Symbol_value::has_output_symtab_entry): New function.
9014 (Symbol_value::needs_output_symtab_entry): Remove.
9015 (Symbol_value::output_symtab_index): Make sure the symbol index is
9016 set.
9017 (Symbol_value::set_output_symtab_index): Make sure the symbol
9018 index is not set. Make sure the new index is valid.
9019 (Symbol_value::set_must_have_output_symtab_entry): New function.
9020 (Symbol_value::has_output_dynsym_entry): New function.
9021 (Symbol_value::set_output_dynsym_index): Make sure the new index
9022 is valid.
9023 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9024 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9025 local symbol if permitted.
9026 (Sized_relobj::do_finalize_local_symbols): Call
9027 is_output_symtab_index_set rather than needs_output_symtab_entry.
9028 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9029 rather than needs_output_symtab_entry. Call
9030 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9031 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9032 is_output_symtab_index_set rather than needs_output_symtab_entry.
9033 * testsuite/discard_locals_relocatable_test.c: New file.
9034 * testsuite/discard_locals_test.sh: Test -r.
9035 * testsuite/Makefile.am (check_DATA): Add
9036 discard_locals_relocatable_test1.syms,
9037 discard_local_relocatable_test2.syms.
9038 (MOSTLYCLEANFILES): Likewise. Also add
9039 discard_locals_relocatable_test1.lout and
9040 discard_locals_relocatable_test2.out.
9041 (discard_locals_relocatable_test1.syms): New target.
9042 (discard_locals_relocatable_test.o): New target.
9043 (discard_locals_relocatable_test1.out): New target.
9044 (discard_locals_relocatable_test2.syms): New target.
9045 (discard_locals_relocatable_test2.out): New target.
9046 (various): Add missing ../ld-new dependencies.
9047 * testsuite/Makefile.in: Rebuild.
9048
7e8ccf26
NC
90492010-03-03 Nick Clifton <nickc@redhat.com>
9050
9051 * po/fi.po: New Finnish translation.
9052
2a0ff005
DK
90532010-03-01 Doug Kwan <dougkwan@google.com>
9054
9055 * layout.cc (Layout::Layout): Force section types of .init_array*,
9056 .preinit_array* and .fini_array* sections.
9057 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9058 Fix check of return value of std::string::find.().
9059 (Output_section::Input_section_sort_compare::operator()): Remove
9060 comment about .init_array.
9061 (Output_section::Input_section_sort_init_fini_compare::operator()):
9062 New method.
9063 (Output_section::sort_attached_input_sections): Handle .init_array
9064 and .fini_array specially.
9065 * output.h (Output_section::Inut_section_sort_compare): Update
9066 comment.
9067 (Output_section::Input_section_sort_init_fini_compare): New struct.
9068
c3e4ae29
DK
90692010-02-26 Doug Kwan <dougkwan@google.com>
9070
9071 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9072 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9073 * testsuite/debug_msg.sh: Avoid matching source line number for
9074 use of global variable undef_int.
9075
2fd9ae7a
DK
90762010-02-26 Doug Kwan <dougkwan@google.com>
9077
9078 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9079 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9080 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9081 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9082 * options.cc (General_options::General_options): Initialize member
9083 fix_v4bx_.
9084 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9085 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9086 and rm_no_fix_v4bx.stdout
9087 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9088 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9089 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9090 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9091 and arm_no_fix_v4bx.
9092 * Makefile.in: Regenerate.
9093 * testsuite/arm_fix_v4bx.s: New file.
9094 * testsuite/arm_fix_v4bx.sh: Ditto.
9095
67ec7d0b
DK
90962010-02-24 Doug Kwan <dougkwan@google.com>
9097
9098 * arm.cc (Target_arm::got_section): Make the .got section the first
9099 non RELRO section in the data segment.
9100 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9101 suffixes of section names.
9102
10165461
DK
91032010-02-24 Doug Kwan <dougkwan@google.com>
9104
9105 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9106 flags and attributes merging if an input file is a binary file.
9107 * fileread.cc (Input_file::open): Record format of original file.
9108 * fileread.h (Input_file::Format): New enum type.
2e702c99 9109 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9110 (Input_file::format): New method definition.
9111 (Input_file::format_):: New data member.
9112
4a54abbb
DK
91132010-02-24 Doug Kwan <dougkwan@google.com>
9114
9115 * arm.cc (Arm_output_data_got): New class.
9116 (ARM_TCB_SIZE): New constant
9117 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9118 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9119 If user uses a script with a SECTIONS clause, issue only a warning
9120 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9121 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9122 garbage collection.
9123 (Target_arm::got_mode_index_entry): Handle static linking.
9124 (Target_arm::Scan::local): Ditto.
9125 (Target_arm::Scan::global): Ditto.
9126 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9127 all incorrectly implemented relocations.
e1df38aa 9128 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9129 Arm_output_section::fix_exidx_coverage.
9130 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9131 from ".ARM.exidx." and ".ARM.extab.".
9132
ca419a6f
ILT
91332010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9134
9135 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9136 section if it does not already exist.
9137 * attributes.cc (Attributes_section_data::Attributes_section_data):
9138 Don't crash if size is zero.
9139
135b9c78
ILT
91402010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9141 Ian Lance Taylor <iant@google.com>
9142
9143 * gold.cc (queue_middle_tasks): If no input files were opened,
9144 exit.
9145 * workqueue.h (Task_function::Task_function): Assert that there is
9146 a blocker.
9147
bb0bfe4f
DK
91482010-02-22 Doug Kwan <dougkwan@google.com>
9149
9150 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9151 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9152 types to avoid warnings due to different uint64_t implementations
9153 on different hosts.
9154
2a2b6d42
DK
91552010-02-21 Doug Kwan <dougkwan@google.com>
9156
9157 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9158 handling of the maximum backward branch offset.
2e702c99 9159 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9160 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9161 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9162 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9163 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9164 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9165 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9166 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9167 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9168 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9169 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9170 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9171 thumb2_bl_out_of_range.o): New rules.
9172 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9173 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9174 thumb2_bl_out_of_range
9175 * testsuite/Makefile.in: Regenerate.
9176 * testsuite/arm_bl_in_range.s: New file.
9177 * testsuite/arm_bl_out_of_range.s: Ditto.
9178 * testsuite/arm_branch_in_range.sh: Ditto.
9179 * testsuite/arm_branch_range.t: Ditto.
9180 * testsuite/thumb2_branch_range.t: Ditto.
9181 * testsuite/thumb_bl_in_range.s: Ditto.
9182 * testsuite/thumb_bl_out_of_range.s: Ditto.
9183 * testsuite/thumb_branch_range.t: Ditto.
9184
b487ad64
ST
91852010-02-20 Sriraman Tallam <tmsriram@google.com>
9186
9187 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9188 Add reloc offset information.
9189 * icf.cc (get_section_contents): Change iterators to point to the new
9190 vectors. Add reloc offset information to the contents.
9191 * icf.h (Icf::Sections_reachable_info): New typedef.
9192 (Icf::Sections_reachable_list): New typedef.
9193 (Icf::Offset_info): New typedef.
9194 (Icf::Reloc_info): New struct typedef.
9195 (Icf::Reloc_info_list): New typedef.
9196 (Icf::symbol_reloc_list): Delete method.
9197 (Icf::addend_reloc_list): Delete method.
9198 (Icf::section_reloc_list): Delete method.
9199 (Icf::reloc_info_list): New method.
9200 (Icf::reloc_info_list_): New member.
9201
f96accdf
DK
92022010-02-19 Doug Kwan <dougkwan@google.com>
9203
9204 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9205 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9206 * arm.cc (Arm_relocation_functions): New forward declaration.
9207 (Target_arm::Target_arm): Initialize new data members
9208 got_mod_index_offset_ and tls_base_symbol_defined_.
9209 (Target_arm::Relocate::relocate_tls): New method.
9210 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9211 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9212 New methods.
2e702c99 9213 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9214 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9215 (Target_arm::got_mod_index_offset_,
9216 Target_arm::tls_base_symbol_defined_): New data members.
9217 (Target_arm::Scan::local, Target::Scan::global,
9218 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9219 relocations.
9220
c8761b9a
DK
92212010-02-18 Doug Kwan <dougkwan@google.com>
9222
9223 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9224 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9225 text section as a parameter becuase some broken tools may not set
9226 the link in section header.
9227 (Target_arm::has_got_section): New method.
9228 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9229 without any mapping symbol as data only. Remove warning.
9230 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9231 link in its section header, try to discover the link by inspecting the
9232 REL31 relocation at the beginning of the section.
9233 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9234 in error message.
9235 (Target_arm::Scan::global): Treat any reference to the symbol
9236 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9237
21bb3914
ST
92382010-02-12 Sriraman Tallam <tmsriram@google.com>
9239
9240 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9241 (Scan::global_reloc_may_be_function_pointer): New function.
9242 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9243 (Scan::global_reloc_may_be_function_pointer): New function.
9244 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9245 (Scan::global_reloc_may_be_function_pointer): New function.
9246 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9247 (Scan::global_reloc_may_be_function_pointer): New function.
9248 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9249 (Scan::global_reloc_may_be_function_pointer): New function.
9250 (Scan::possible_function_pointer_reloc): New function.
9251 (Target_x86_64::can_check_for_function_pointers): New function.
9252 * gc.h (gc_process_relocs): Scan relocation types to determine if
9253 function pointers were taken for targets that support it.
9254 * icf.cc (Icf::find_identical_sections): Include functions for
9255 folding in safe ICF whose pointer is not taken.
9256 * icf.h (Secn_fptr_taken_set): New typedef.
9257 (fptr_section_id_): New member.
9258 (section_has_function_pointers): New function.
9259 (set_section_has_function_pointers): New function.
9260 (check_section_for_function_pointers): New function.
9261 * options.h: Fix comment for safe ICF option.
9262 * target.h (can_check_for_function_pointers): New function.
9263 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9264 Modify icf_safe_test for X86-64.
9265 * testsuite/Makefile.in: Regenerate.
9266 * testsuite/icf_safe_so_test.cc: New file.
9267 * testsuite/icf_safe_so_test.sh: New file.
9268 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9269 (main): Change to take pointer to function kept_func_3.
9270 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9271 folding is done correctly for X86-64.
9272
0da6fa6c
DM
92732010-02-12 David S. Miller <davem@davemloft.net>
9274
9275 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9276 is_symbolless parameter.
9277 (Output_reloc<SHT_REL>::is_symbolless): New.
9278 (Output_reloc<SHT_REL>::is_symbolless_): New.
9279 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9280 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9281 (Output_reloc<SHT_RELA>::is_symbolless): New.
9282 (Output_data_reloc::add_global): Handle is_symbolless.
9283 (Output_data_reloc::add_global_relative): Likewise.
9284 (Output_data_reloc::add_local): Likewise.
9285 (Output_data_reloc::add_local_relative): Likewise.
9286 (Output_data_reloc::add_symbolless_global_addend): New.
9287 (Output_data_reloc::add_symbolless_local_addend): New.
9288 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9289 is_symbolless.
9290 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9291 instead of ->is_relative_
9292 (Output_reloc::write): Likewise.
9293 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9294 (Output_reloc::write_rel): Simplify.
9295
9296 * sparc.cc (Target_sparc::Scan::local): Use
9297 ->add_symbolless_local_addend as needed.
9298 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9299 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9300 based upon relocation offset.
9301
e4782e83
DK
93022010-02-11 Doug Kwan <dougkwan@google.com>
9303
9304 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9305 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9306 beginning of function.
9307 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9308 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9309 parameter is_32bit in calls to should_apply_static_reloc.
9310 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9311 (check_DATA): Add arm_abs_global.stdout.
9312 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9313 arm_abs_global.stdout): New rules.
9314 (MOSTLLYCLEANFILES): Add arm_abs_global
9315 * Makefile.in: Regenerate.
9316 * testsuite/arm_abs_global.s: New file.
9317 * testsuite/arm_abs_global.sh: Ditto.
9318 * testsuite/arm_abs_lib.s: Ditto.
9319
93ceb764
ILT
93202010-02-11 Ian Lance Taylor <iant@google.com>
9321
9322 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9323 Read_relocs task.
9324 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9325 Allocate_commons_task first.
9326 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9327 task, rather than symtab_lock_.
9328 (Gc_process_relocs::~Gc_process_relocs): New function.
9329 (Gc_process_relocs::is_runnable): Check this_blocker_.
9330 (Gc_process_relocs::locks): Use next_blocker_ rather than
9331 blocker_.
9332 (Scan_relocs::~Scan_relocs): New function.
9333 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9334 symtab_lock_.
9335 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9336 next_blocker_.
9337 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9338 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9339 constructor accordingly.
9340 (class Gc_process_relocs): Likewise.
9341 (class Scan_relocs): Likewise.
9342 * common.h (class Allocate_commons_task): Remove symtab_lock_
9343 field, and corresponding constructor parameter.
9344 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9345 symtab_lock_.
9346 (Allocate_commons_task::locks): Likewise.
9347
114dfbe1
ILT
93482010-02-11 Ian Lance Taylor <iant@google.com>
9349
9350 * gold-threads.h (class Once): Define.
9351 (class Initialize_lock): Rewrite as child of Once.
9352 * gold-threads.cc (class Once_initialize): Define.
9353 (once_pointer_control): New static variable.
9354 (once_pointer, once_arg): New static variables.
9355 (c_run_once): New static function.
9356 (Once::Once, Once::run_once, Once::internal_run): New functions.
9357 (class Initialize_lock_once): Remove.
9358 (initialize_lock_control): Remove.
9359 (initialize_lock_pointer): Remove.
9360 (initialize_lock_once): Remove.
9361 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9362 (Initialize_lock::initialize): Rewrite.
9363 (Initialize_lock::do_run_once): New function.
9364 * archive.cc (Archive::interpret_header): Only clear name if it is
9365 not already empty.
9366 * fileread.cc: Include "gold-threads.h"
9367 (file_counts_lock): New static variable.
9368 (file_counts_initialize_lock): Likewise.
9369 (File_read::release): Only increment counts when using --stats.
9370 Use a lock around the increment.
9371 * parameters.cc (class Set_parameters_target_once): Define.
9372 (set_parameters_target_once): New static variable.
9373 (Parameters::Parameters): Move here from parameters.h.
9374 (Parameters::set_target): Rewrite.
9375 (Parameters::set_target_once): New function.
9376 (Parameters::clear_target): Move here and rewrite.
9377 * parameters.h (class Parameters): Update declarations. Add
9378 set_parameters_target_once_ field.
9379 (Parameters::Parameters): Move to parameters.cc.
9380 (Parameters::clear_target): Likewise.
9381 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9382 task.
9383 (Start_group::~Start_group): New function.
9384 (Start_group::is_runnable): New function.
9385 (Start_group::locks, Start_group::run): New functions.
9386 (Finish_group::run): Change saw_undefined to size_t.
9387 * readsyms.h (class Start_group): Define.
9388 (class Finish_group): Change saw_undefined_ field to size_t.
9389 (Finish_group::Finish_group): Remove saw_undefined and
9390 this_blocker parameters. Change all callers.
9391 (Finish_group::set_saw_undefined): New function.
9392 (Finish_group::set_blocker): New function.
9393 * symtab.h (class Symbol_table): Change saw_undefined to return
9394 size_t. Change saw_undefined_ field to size_t.
9395 * target-select.cc (Set_target_once::do_run_once): New function.
9396 (Target_selector::Target_selector): Initialize set_target_once_
9397 field. Don't initialize lock_ and initialize_lock_ fields.
9398 (Target_selector::instantiate_target): Rewrite.
9399 (Target_selector::set_target): New function.
9400 * target-select.h (class Set_target_once): Define.
9401 (class Target_selector): Update declarations. Make
9402 Set_target_once a friend. Remove lock_ and initialize_lock_
9403 fields. Add set_target_once_ field.
9404
fa17a3f4
ILT
94052010-02-10 Ian Lance Taylor <iant@google.com>
9406
9407 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9408 queueing any tasks.
9409 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9410 (queue_middle_tasks): Add all blockers before queueing any tasks.
9411 (queue_final_tasks): Likewise.
9412 * token.h (Task_token::add_blockers): New function.
9413 * object.h (Input_objects::number_of_relobjs): New function.
9414
c7177d31
ILT
94152010-02-10 Ian Lance Taylor <iant@google.com>
9416
5de0e392
ILT
9417 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9418 shared, not if not position independent.
9419 * x86_64.cc (Relocate::relocate_tls): Likewise.
9420 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9421 (tls_pie_pic_test): New target.
9422 * testsuite/Makefile.in: Rebuild.
9423
c7177d31
ILT
9424 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9425 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9426 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9427 * testsuite/Makefile.in: Rebuild.
9428
684b268a
DM
94292010-02-09 David S. Miller <davem@davemloft.net>
9430
9431 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9432 R_SPARC_RELATIVE using ->add_local_relative().
9433 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9434
612a8d3d
DM
9435 * output.h (Output_data_dynamic::add_section_size): New method
9436 that takes two Output_data objects.
9437 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9438 entry param. Handle it in initializers.
9439 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9440 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9441 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9442 arg.
9443 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9444 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9445 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9446 for dynrel_includes_plt.
9447 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9448 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9449 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9450 before .rela.plt
9451 (Target_sparc::do_finalize_sections): Update to pass true for
9452 dynrel_includes_plt.
9453 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9454 output before .rela.plt
9455 (Target_powerpc::do_finalize_sections): Update to pass true for
9456 dynrel_includes_plt when 32-bit.
9457
cb1be87e
DK
94582010-02-08 Doug Kwan <dougkwan@google.com>
9459
9460 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9461 method.
9462 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9463 Arm_relobj::scan_section_for_cortex_a8_stubs,
9464 Arm_relobj::do_relocation_section): Instead of calling
9465 Output_section::output_address, use faster
9466 Arm_relobj::simple_input_section_output_address.
9467
705b5121
DM
94682010-02-08 David S. Miller <davem@davemloft.net>
9469
9470 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9471 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9472 relocation helper function.
9473
024c4466
DM
9474 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9475 just like R_SPARC_GOT{10,13,22}.
9476 (Target_sparc::Scan::local): Likewise.
9477 (Target_sparc::Relocate:relocate): Likewise.
9478
9109c078
ILT
94792010-02-06 Ian Lance Taylor <iant@google.com>
9480
9481 * configure.ac: Rewrite targetobjs duplicate removal code to use
9482 only shell constructs.
9483 * configure: Rebuild.
9484
cf846138
DK
94852010-02-05 Doug Kwan <dougkwan@google.com>
9486
9487 PR 11247
9488 * arm.cc (Arm_relobj::section_is_scannable): New method.
9489 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9490 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9491
6cfaf60b
DK
94922010-02-04 Doug Kwan <dougkwan@google.com>
9493
9494 PR 11247
9495 * arm-reloc-property.cc (cstdio): Include.
9496 * configure.ac (targetobjs): Remove duplicates.
9497 * configure: Regenerate.
9498 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9499 big and little endian version for a given address size.
9500
5c57f1be
DK
95012010-02-03 Doug Kwan <dougkwan@google.com>
9502
9503 * arm-reloc-property.cc
9504 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9505 definition.
9506 * arm-reloc-property.h
9507 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9508 New method definition.
9509 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9510 declaration.
9511 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9512 overflow to N.
9513 (GOT_PREL): Change implemented to Y.
9514 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9515 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9516 (Arm_relocate_functions::movw_abs_nc): Remove method.
9517 (Arm_relocate_functions::movt_abs): Ditto.
9518 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9519 (Arm_relocate_functions::thm_movt_abs): Ditto.
9520 (Arm_relocate_functions::movw_rel_nc): Ditto.
9521 (Arm_relocate_functions::movw_rel): Ditto.
9522 (Arm_relocate_functions::movt_rel): Ditto.
9523 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9524 (Arm_relocate_functions:thm_movw_rel): Ditto.
9525 (Arm_relocate_functions:thm_movt_rel): Ditto.
9526 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9527 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9528 New method definitions.
9529 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9530 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9531 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9532 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9533 (Target_arm::Relocate::relocate): Check for non-static or
9534 unimplemented relocation code and exit early. Change calls to
9535 Target_arm::reloc_uses_thumb_bit and
9536 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9537 instead. Refactor code to handle similar relocations to increase
9538 code sharing. Remove check for unsupported relocation code in switch
9539 statement.
9540 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9541 relocation property table to find out size. Change error message to
9542 print out the name of a relocation code instead of the numeric value.
9543 (Target_arm::scan_reloc_for_stub): Use relocation property table
9544 instead of calling Target_arm::reloc_uses_thumb_bit().
9545
218c5831
DK
95462010-02-02 Doug Kwan <dougkwan@google.com>
9547
9548 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9549 types of relaxed input section.
9550
0d31c79d
DK
95512010-02-02 Doug Kwan <dougkwan@google.com>
9552
9553 * Makefile.am (HFILES): Add arm-reloc-property.h.
9554 (DEFFILES): New.
2e702c99
RM
9555 (TARGETSOURCES): Add arm-reloc-property.cc
9556 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9557 (libgold_a_SOURCES): $(DEFFILES)
9558 * Makefile.in: Regenerate.
9559 * arm-reloc-property.cc: New file.
9560 * arm-reloc-property.h: New file.
9561 * arm-reloc.def: New file.
9562 * arm.cc: Update comments.
9563 (arm-reloc-property.h): New included header.
9564 (arm_reloc_property_table): New global variable.
9565 (Target_arm::do_select_as_default_target): New method definition.
9566 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9567 arm-reloc-property to targ_extra_obj.
9568 * parameters.cc (set_parameters_target): Call
9569 Target::select_as_default_target().
9570 * target.h (Target::select_as_default_target): New method definition.
9571 (Target::do_select_as_default_target): Same.
9572
546c7457
DK
95732010-02-01 Doug Kwan <dougkwan@google.com>
9574
9575 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9576 first_output_text_section_.
9577 (Arm_exidx_fixup::first_output_text_section): New method definition.
9578 (Arm_exidx_fixup::first_output_text_section_): New data member.
9579 (Arm_exidx_fixup::process_exidx_section): Record the first text
9580 output section seen.
9581 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9582 and entsize in output section header.
9583
11b861d5
DK
95842010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9585
9586 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9587 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9588 (Arm_relocate_functions::thm_alu11): New Method.
9589 (Arm_relocate_functions::thm_pc8): New Method.
9590 (Arm_relocate_functions::thm_pc12): New Method.
9591 (Target_arm::Scan::local): Handle the relocations.
9592 (Target_arm::Scan::global): Likewise.
9593 (Target_arm::Relocate::relocate): Likewise.
9594 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9595
c9a2c125
DK
95962010-01-29 Doug Kwan <dougkwan@google.com>
9597
9598 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9599 of relocation types as ld.
9600
1521477a
DK
96012010-01-29 Doug Kwan <dougkwan@google.com>
9602
9603 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9604 to public.
9605 (Arm_relocate_functions::thumb_branch_common): Ditto.
9606 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9607 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9608 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9609 Arm_relocate_functions::jump24): Remove.
9610 (Target_arm::Relocate::relocate): Adjust code to call
9611 Arm_relocation_functions::arm_branch_common and
9612 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9613 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9614
e7eca48c
DK
96152010-01-29 Doug Kwan <dougkwan@google.com>
9616
9617 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9618 output_local_symbol_count_needs_update_.
9619 (Arm_relobj::output_local_symbol_count_needs_update,
9620 Arm_relobj::set_output_local_symbol_count_needs_update,
9621 Arm_relobj::update_output_local_symbol_count): New methods.
9622 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9623 member.
9624 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9625 of pointed function as in a R_ARM_PREL31 relocation.
9626 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9627 for output local symbol count updating.
9628 (Target_arm::do_relax): Update output local symbol counts in objects
9629 if necessary.
9630 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9631
02961d7e
ILT
96322010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9633
9634 * arm.cc: Added support for the ARM relocations:
9635 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9636 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9637 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9638 movw_prel_nc).
9639 (Arm_relocate_functions::movw_rel): New method.
9640 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9641 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9642 thm_movw_prel_nc).
9643 (Arm_relocate_functions::thm_movw_rel): New method.
9644 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9645 thm_movt_prel).
9646 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9647 relocations.
9648 (Target_arm::Scan::global): Likewise.
9649 (Target_arm::Relocate::relocate): Likewise.
9650 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9651 Likewise.
9652
b10d2873
ILT
96532010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9654
9655 * arm.cc: Added support for ARM group relocations.
9656 (Target_arm::reloc_needs_sym_origin): New method.
9657 (Arm_relocate_functions::calc_grp_kn): New method.
9658 (Arm_relocate_functions::calc_grp_residual): New method.
9659 (Arm_relocate_functions::calc_grp_gn): New method.
9660 (Arm_relocate_functions::arm_grp_alu): New Method.
9661 (Arm_relocate_functions::arm_grp_ldr): New Method.
9662 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9663 (Arm_relocate_functions::arm_grp_ldc): New Method.
9664 (Target_arm::Scan::local): Handle the ARM group relocations.
9665 (Target_arm::Scan::global): Likewise.
9666 (Target_arm::Relocate::relocate): Likewise.
9667 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9668 Likewise.
9669
2b328d4e
DK
96702010-01-26 Doug Kwan <dougkwan@google.com>
9671
9672 * arm.cc (set): Include.
9673 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9674 pointer type.
2e702c99 9675 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9676 (Arm_output_section::append_text_sections_to_list): New method.
9677 (Arm_output_section::fix_exidx_coverage): Ditto.
9678 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9679 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9680 Relobj::set_section_offset() instead of
9681 Sized_relobj::invalidate_section_offset().
2e702c99 9682 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9683 parameter for section headers. Ignore relocation sections for
9684 unallocated sections and EXIDX sections.
9685 (Target_arm::fix_exidx_coverage): New method.
9686 (Target_arm::output_section_address_less_than): New type.
9687 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9688 linked text section instead of the EXIDX section.
9689 (Arm_output_section::create_stub_group): Add an assertion to check
9690 that this is not an EXIDX output section.
9691 (Arm_output_section::append_text_sections_to_list): New method.
9692 (Arm_output_section::fix_exidx_coverage): Ditto.
9693 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9694 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9695 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9696 first pass.
9697 (Target_arm::fix_exidx_coverage): New method.
9698 * object.h (Relobj::set_output_section): New method.
9699 (Sized_relobj::invalidate_section_offset): Remove method.
9700 (Sized_relobj::do_invalidate_section_offset): Remove method.
9701 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9702
c7f3c371
DK
97032010-01-25 Doug Kwan <dougkwan@google.com>
9704
9705 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9706 Fix warning due to signed and unsigned comparison on a 32-bit host.
9707
8923b24c
DK
97082010-01-22 Doug Kwan <dougkwan@google.com>
9709
9710 * arm.cc (Target_arm::do_relax): Record an output section for section
9711 offset adjustment it contains any stub table that has changed.
9712 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9713 offsets in an output section if necessary.
9714 * output.cc (Output_section::Output_section): Initialize
9715 section_offsets_need_adjustments_.
9716 (Output_section::add_input_section_for_script): Renamed to
9717 Output_section::add_simple_input_section.
9718 (Output_section::save_states): Add a comment.
9719 (Output_section::discard_states): New method defintion.
9720 (Output_section::adjust_section_offsets): Same.
9721 * output.h (Output_section::add_input_section_for_script): Renamed to
9722 Output_section::add_simple_input_section.
9723 (Output_section::discard_states): New method declaration.
9724 (Output_section::adjust_section_offsets): Same.
9725 (Output_section::section_offsets_need_adjustment,
9726 Output_section::set_section_offsets_need_adjustment): New method
9727 definitions.
9728 (Output_section::section_offsets_need_adjustment_): New data member.
9729 * script-sections.cc
9730 (Output_section_element_input::set_section_address): Adjust code for
9731 renaming of Output_section::add_input_section_for_script.
9732 (Orphan_output_section::set_section_address): Same.
9733
9b2fd367
DK
97342010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9735
9736 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9737 Fix_v4bx enum values .
9738 * gold/options.h (General_options): New option definitions.
9739 (General_options::fix_v4bx): New method.
9740 (General_options::Fix_v4bx): New enum.
9741 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9742 (General_options::parse_fix_v4bx_interworking): New method.
9743
80d0d023
DK
97442010-01-22 Doug Kwan <dougkwan@google.com>
9745
9746 * arm.cc (Arm_exidx_fixup): New class.
9747
af2cdeae
DK
97482010-01-21 Doug Kwan <dougkwan@google.com>
9749
9750 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9751 classes.
9752 (Arm_exidx_section_offset_map): New type.
9753
993d07c1
DK
97542010-01-21 Doug Kwan <dougkwan@google.com>
9755
9756 * arm.cc (Arm_exidx_input_section): New class.
9757 (Arm_relobj::exidx_input_section_by_link,
9758 Arm_relobj::exidx_input_section_by_shndx,
9759 Arm_relobj::make_exidx_input_section): New methods.
9760 (read_arm_attributes_section): Remove.
9761 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9762 information about them.
9763 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9764 to here.
9765
5ac169d4
DK
97662010-01-20 Doug Kwan <dougkwan@google.com>
9767
9768 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9769 Input_section_specifier to Section_id.
9770 (Target_arm::new_arm_input_section: Adjust code for change of key
9771 type.
9772 (Target_arm::find_arm_input_section): Ditto.
9773 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9774 (Section_id): Remove.
9775 (Garbage_collection::Section_id_hash): Remove.
9776 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9777 (Section_id): Remove.
9778 (Icf::Section_id_hash): Remove.
9779 * object.h (Section_id, Const_section_id, Section_id_hash,
9780 Const_section_id_hash): New type definitions.
9781 * output.cc (Output_section::add_relaxed_input_section): Change to
9782 use Const_section_id instead of Input_section_specifier as key type.
9783 (Output_section::add_merge_input_section): Ditto.
9784 (Output_section::build_relaxation_map): Change to use Section_id
9785 instead of Input_section_specifier as key type.
2e702c99 9786 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
9787 Ditto.
9788 (Output_section::convert_input_sections_to_relaxed_sections): Change
9789 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 9790 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
9791 (Output_section::find_relaxed_input_section): Ditto.
9792 * output.h (Input_section_specifier): Remove class.
9793 (Output_section::Output_section_data_by_input_section_map): Change
9794 key type to Const_section_id.
9795 (Output_section::Output_relaxed_input_section_by_input_section_map):
9796 Ditto.
9797 (Output_section::Relaxation_map): Change key type to Section_id.
9798
a2162063
ILT
97992010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9800
9801 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9802 (class Arm_v4bx_stub): New class.
9803 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9804 (Stub_factory::make_arm_v4bx_stub): New method.
9805 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9806 (Stub_table::empty): Handle v4bx stubs.
9807 (Stub_table::add_arm_v4bx_stub): New method.
9808 (Stub_table::find_arm_v4bx_stub): New method.
9809 (Arm_relocate_functions::v4bx): New method.
9810 (Target_arm::fix_v4bx): New method.
9811 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9812 (Stub_table::relocate_stubs): Likewise.
9813 (Stub_table::do_write): Likewise.
9814 (Stub_table::update_data_size_and_addralign): Likewise.
9815 (Stub_table::finalize_stubs): Likewise.
9816 (Target_arm::Scan::local): Likewise.
9817 (Target_arm::Scan::global): Likewise.
9818 (Target_arm::do_finalize_sections): Likewise.
9819 (Target_arm::Relocate::relocate): Likewise.
9820 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9821 Likewise.
9822 (Target_arm::scan_reloc_for_stub): Likewise.
9823 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9824
5696ab0b
ILT
98252010-01-19 Ian Lance Taylor <iant@google.com>
9826
9827 * output.cc (Output_section_headers::do_sized_write): Write large
9828 segment count to sh_info field.
9829 (Output_file_header::do_sized_write): For large segment count,
9830 write PN_XNUM to e_phnum field.
9831
800d0f56
ILT
98322010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9833
9834 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9835 (Arm_relocate_functions::thm_jump8): New function.
9836 (Arm_relocate_functions::thm_jump11): New function.
9837 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9838 R_ARM_THM_JUMP11.
9839 (Target_arm::Scan::global): Likewise.
9840 (Target_arm::Relocate::relocate): Likewise.
9841 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9842 Likewise.
9843
41263c05
DK
98442010-01-14 Doug Kwan <dougkwan@google.com>
9845
9846 * arm.cc (map, utility): Include headers.
9847 (Target_arm::apply_cortex_a8_workaround): New method.
9848 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9849 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9850 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9851 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9852 the --[no-]fix-cortex-a8 command line options.
9853 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9854 (Target_arm::relocate_stub): Use addend in instruction template.
9855 * options.h (DEFINE_bool): Set the user-set flag.
9856 (General_options): Add --[no-]-fix-cortex options.
9857 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 9858 : Update fast look-up map after conversion.
41263c05 9859
459e9b03
ST
98602010-01-14 Sriraman Tallam <tmsriram@google.com>
9861
9862 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9863 in the first pass of do_layout.
9864
b521dfe4
DK
98652010-01-13 Doug Kwan <dougkwan@google.com>
9866
9867 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9868 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9869 apparent compiler problem of not folding static constant integral
9870 data members of elfcpp::Elf_sizes<32>.
9871
44272192
DK
98722010-01-13 Doug Kwan <dougkwan@google.com>
9873
9874 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9875 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9876 Arm_relobj::scan_section_for_cortex_a8_erratum,
9877 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
9878 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
9879 sections to scan for relocation stubs into a new method
9880 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
9881 relocation and Cortex-A8 stub scanning.
9882 (Target_arm::do_relax): Force stubs to be after stubbed sections
9883 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 9884 the beginning of a new relaxation pass. Update a comment.
44272192
DK
9885 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
9886
44b71ece
ILT
98872010-01-12 Ian Lance Taylor <iant@google.com>
9888
9889 * target-reloc.h (visibility_error): New inline function.
9890 (relocate_section): Call visibility_error.
9891 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
9892 (MOSTLYCLEANFILES): Likewise.
9893 (protected_4_pic.o, protected_3.err): New targets.
9894 * testsuite/protected_4.cc: New file.
9895
a120bc7f
DK
98962010-01-12 Doug Kwan <dougkwan@google.com>
9897
9898 * arm.cc (Cortex_a8_reloc): New class.
9899 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
9900 and cortex_a8_relocs_info_.
9901 (Target_arm::fix_cortex_a8): New method definition.
9902 (Target_arm::Cortex_a8_relocs_info): New type.
9903 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
9904 New data member declarations.
9905 (Target_arm::scan_reloc_for_stub): Record information about
9906 relocations for THUMB branches that might be exempted from the
9907 Cortex-A8 workaround.
9908 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
9909 at the beginning of a relaxation pass.
9910
20138696
DK
99112010-01-12 Doug Kwan <dougkwan@google.com>
9912
9913 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
9914 (Arm_relobj::Mapping_symbol_position,
9915 Arm_reloj::Mapping_symbol_position_less,
9916 Arm_relobj::Mapping_symbols_info): New types.
9917 (Target_arm::is_mapping_symbol_name): New method definition.
9918 (Arm_relobj::do_count_local_symbols): Save information about mapping
9919 symbols.
9920
089d69dc
DK
99212010-01-11 Doug Kwan <dougkwan@google.com>
9922
9923 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
9924 Arm_relocate_functions::thumb32_branch_upper,
9925 Arm_relocate_functions::thumb32_branch_lower,
9926 Arm_relocate_functions::thumb32_cond_branch_offset,
9927 Arm_relocate_functions::thumb32_cond_branch_upper,
9928 Arm_relocate_functions::thumb32_cond_branch_lower,
9929 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
9930 branch offset encoding.
9931 (Arm_relocate_functions::thumb_branch_common): Use new branch
9932 offset encoding methods to avoid code duplication.
9933 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
9934 (Stub_addend_reader::operator()): Use new branch encoding method
9935 to avoid code duplication.
9936
99e5bff2
DK
99372010-01-11 Doug Kwan <dougkwan@google.com>
9938
9939 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
9940 (Target_arm::do_finalize_sections): Define special EXIDX section
9941 symbols only if referenced.
9942 * gc.h (Garbage_collection::add_reference): New method.
9943 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
9944 code duplication.
9945
98e090bd
ILT
99462010-01-11 Ian Lance Taylor <iant@google.com>
9947
d0a91bd8
ILT
9948 * script.cc (Version_script_info::build_expression_list_lookup):
9949 Change complaing about duplicate wildcard match from error to
9950 warning.
9951
98e090bd
ILT
9952 * script.cc (class Lazy_demangler): Recreate--revert part of patch
9953 of 2009-12-30.
9954 (Version_script_info::Version_script_info): Initialize globs_,
9955 default_version_, default_is_global_, and exact_. Don't
9956 initialize globals_ or locals_.
9957 (Version_script_info::build_lookup_tables): Build local symbols
9958 first.
9959 (Version_script_info::unquote): New function.
9960 (Version_script_info::add_exact_match): New function.
9961 (Version_script_info::build_expression_list_lookup): Remove lookup
9962 parameter. Add is_global parameter. Change all callers. Handle
9963 wildcard pattern specially. Unquote pattern. Call
9964 add_exact_match.
9965 (Version_script_info::get_name_to_match): New function.
9966 (Version_script_info::get_symbol_version): New function.
9967 (Version_script_info::get_symbol_version_helper): Remove.
9968 (Version_script_info::check_unmatched_names): Call unquote.
9969 * script.h (class Version_script_info): Change get_symbol_version
9970 to be non-inline and add is_global parameter; change all callers.
9971 Rewrite symbol_is_local. Update declarations. Define struct
9972 Version_tree_match, Exact, Globs. Don't define struct Lookup.
9973 Remove globals_ and locals_ members. Add exact_, globs_,
9974 default_version_, is_global_.
9975 (Version_script_info::Glob): Remove pattern, add expression and
9976 is_global. Update constructor. Change all callers.
9977 * dynobj.cc (Versions::finalize): Mark the version symbol as the
9978 default version.
9979 (Versions::symbol_section_contents): If a symbol is undefined, or
9980 defined in a dynamic object, set the version index to
9981 VER_NDX_LOCAL.
9982 * symtab.cc (Symbol_table::add_from_relobj): Don't call
9983 symbol_is_local.
9984 (Symbol_table::add_from_pluginobj): Likewise.
9985 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
9986
d56962d3
DK
99872010-01-11 Doug Kwan <dougkwan@google.com>
9988
9989 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
9990 (incremental_dump_LDADD): Add linking option for libintl.
9991 * Makefile.in: Regenerate.
9992
94e6ee91
L
99932010-01-11 H.J. Lu <hongjiu.lu@intel.com>
9994
9995 PR gold/11144
9996 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
9997 instead of -Ds.
9998 * testsuite/Makefile.in: Regenerated.
9999
e96c574b
DK
100002010-01-10 Doug Kwan <dougkwan@google.com>
10001
10002 * options.h (DEFINE_var): Use parentheses around argument varname__
10003 in macro body to avoid any unintended subsequent substitutions.
10004
7198066b
ILT
100052010-01-10 Ian Lance Taylor <iant@google.com>
10006
ba4d53bf
ILT
10007 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10008 candidates before doing symbol resolution.
10009
7198066b
ILT
10010 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10011 ODR candidates if only one is weak.
10012
a2beed37
ILT
100132010-01-08 Ian Lance Taylor <iant@google.com>
10014
10015 * script.cc (Version_script_info::build_expression_list_lookup):
10016 Don't warn about ambiguous version, just record the ambiguity.
10017 (Version_script_info::get_symbol_version_helper): Give error if
10018 version is ambiguous.
10019
2fb7225c
DK
100202010-01-08 Doug Kwan <dougkwan@google.com>
10021
10022 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10023 prev_data_size_ and prev_addralign_. Remove initializer for
10024 deleted data member has_been_changed_.
10025 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10026 to determine if the table is empty.
10027 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10028 Remove.
10029 (Stub_table::add_reloc_stub): Define method in class definition
10030 instead of just declaring it there.
10031 (Stub_table::add_cortex_a8_stub): New method definition.
10032 (Stub_table::update_data_size_and_addralign): Ditto.
10033 (Stub_table::finalize_stubs): Ditto.
10034 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10035 (Stub_table::do_addralign_): Return address alignment in the
10036 (Stub_table::do_reset_address_and_file_offset): Define method in
10037 class definition instead of declaring it there. Set current data
10038 size to be the data size of the previous pass.
10039 (Stub_table::set_final_data_size): Use current data size as the
10040 final data size.
10041 (Stub_table::relocate_stub): Change parameter type of stub from
10042 Reloc_stub pointer to Stub pointer.
10043 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10044 (Stub_table::Cortex_a8_stub_list): New typedef.
10045 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10046 Stub_table::prev_addralign_): New data member.
10047 (Arm_relobj::Arm_relobj): Initialize data member
10048 section_has_cortex_a8_workaround_.
10049 (Arm_relobj::section_has_cortex_a8_workaround,
10050 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10051 definitions.
10052 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10053 declarations.
10054 (Target_arm::relocate_stub): Change parameter type of stub from
10055 Reloc_stub pointer to Stub pointer.
10056 (Insn_template::size, Insn_template::alignment): Handle
10057 THUMB16_SPECIAL_TYPE.
10058 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10059 Stub_table::update_data_size_and_addralign,
10060 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10061 definitions.
10062 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10063 (Stub_table::do_write): Ditto.
10064 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10065
880cd20d
ILT
100662010-01-08 Ian Lance Taylor <iant@google.com>
10067
10068 PR 11108
10069 * symtab.h (class Symbol): Remove fields is_target_special_ and
10070 has_plt_offset_. Add field is_defined_in_discarded_section_.
10071 (Symbol::is_defined_in_discarded_section): New function.
10072 (Symbol::set_is_defined_in_discarded_section): New function.
10073 (Symbol::has_plt_offset): Rewrite.
10074 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10075 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10076 Don't initialize is_target_special_ or has_plt_offset_.
10077 Initialize is_defined_in_discarded_section_.
10078 (Symbol_table::add_from_relobj): If appropriate, set
10079 is_defined_in_discarded_section.
10080 * resolve.cc (Symbol::override_base_with_special): Don't test
10081 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10082 * target-reloc.h (relocate_section): Do special handling for
10083 symbols defined in discarded sections for global symbols as well
10084 as local symbols.
10085
2703e3eb
ILT
100862010-01-08 Ian Lance Taylor <iant@google.com>
10087
10088 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10089 the SHT_SYMTAB case.
10090
339d40a3
ILT
100912010-01-08 Ian Lance Taylor <iant@google.com>
10092
10093 * object.cc (Sized_relobj::do_layout): Don't get confused if
10094 layout_eh_frame returns NULL.
10095
abecea76
ILT
100962010-01-08 Ian Lance Taylor <iant@google.com>
10097
10098 PR 11084
10099 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10100 dynamic symbol table, use the normal symbol table.
10101 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10102 symbol table.
10103
6b7dd3f3
ILT
101042010-01-08 Ian Lance Taylor <iant@google.com>
10105
10106 PR 11072
10107 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10108 sections.
10109
36c50e63
L
101102010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10111
10112 * version.cc (print_version): Change to "Copyright 2010".
10113
e291e7b9
ILT
101142010-01-08 Ian Lance Taylor <iant@google.com>
10115
10116 PR 10287
10117 PR 11063
10118 * i386.cc (class Target_i386): Change return type of plt_section
10119 to be non-const.
10120 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10121 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10122 tls_desc_rel_ field.
10123 (Output_data_plt_i386::rel_tls_desc): New function.
10124 (Target_i386::rel_tls_desc_section): New function.
10125 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10126 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10127 R_386_TLS_DESC reloc in rel_tls_desc_section.
10128 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10129 Define struct Tlsdesc_info.
10130 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10131 (Target_x86_64::do_reloc_symbol_index): New function.
10132 (Target_x86_64::add_tlsdesc_info): New function.
10133 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10134 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10135 tlsdesc_rel_ field.
10136 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10137 all callers.
10138 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10139 (Target_x86_64::rela_tlsdesc_section): New function.
10140 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10141 handling.
10142 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10143 (Target_x86_64::do_reloc_addend): New function.
10144 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10145 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10146 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10147 (Output_reloc::type): New function.
10148 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10149 (Output_reloc::is_target_specific): New function.
10150 (Output_reloc::target_arg): New function.
10151 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10152 absolute relocs and target specific relocs.
10153 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10154 add_target_specific.
10155 (class Output_data_reloc) [SHT_RELA]: Likewise.
10156 * output.cc (Output_reloc::Output_reloc): Add four new versions
10157 for absolute relocs and target specific relocs.
10158 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10159 (Output_reloc::get_symbol_index): Likewise.
10160 (Output_reloc::local_section_offset): Check that local_sym_index_
10161 is not TARGET_CODE or 0.
10162 (Output_reloc::symbol_value): Likewise.
10163 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10164 reloc.
10165 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10166 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10167 functions.
10168 * layout.cc (add_target_dynamic_tags): Use output section for
10169 DT_PLTRELSZ and DT_JMPREL.
10170
3a44184e
ILT
101712010-01-07 Ian Lance Taylor <iant@google.com>
10172
10173 PR 11061
10174 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10175 function.
10176 (class Output_data_reloc_generic): Define.
10177 (class Output_data_reloc_base): Change base class to
10178 Output_data_reloc_generic. Change add() method to call
10179 bump_relative_reloc_count for a relative reloc. Remove
10180 sort_relocs_ field.
10181 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10182 to sort_relocs().
10183 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10184 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10185 appropriate.
10186 * layout.h (class Layout): Update declaration.
10187
ea715a34
ILT
101882010-01-07 Ian Lance Taylor <iant@google.com>
10189
10190 * output.h (class Output_data): Add const version of
10191 output_section and do_output_section.
10192 (class Output_section_data): Add const version of
10193 do_output_section.
10194 (class Output_section): Likewise.
10195 * layout.cc (Layout::add_target_dynamic_tags): New function.
10196 * layout.h (class Layout): Update declarations.
10197 * arm.cc (Target_arm::do_finalize_sections): Use
10198 add_target_dynamic_tags.
10199 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10200 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10201 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10202 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10203
659948a4
ILT
102042010-01-07 Ian Lance Taylor <iant@google.com>
10205
10206 PR 11042
10207 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10208 object as needed.
10209
9d3b86f6
ILT
102102010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10211 Ian Lance Taylor <iant@google.com>
10212
10213 PR 11019
10214 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10215 Xindex::read_symtab_xindex.
10216
bb0d3eb0
DK
102172010-01-07 Doug Kwan <dougkwan@google.com>
10218
10219 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10220 (Insn_template::thumb16_bcond_insn): New method declaration.
10221 (Insn_template): Fix spelling.
10222 (Stub::thumb16_special): New method declaration.
10223 (Stub::do_write): Define virtual method which was previously pure
10224 virtual.
10225 (Stub::do_thumb16_special): New method declaration.
10226 (Stub::do_fixed_endian_write): New template member.
10227 (Reloc_stub::do_write): Remove.
10228 (Reloc_stub::do_fixed_endian_write): Remove.
10229 (Cortex_a8_stub): New class definition.
10230 (Stub_factory::make_cortex_a8_stub): New method definition.
10231 (Stub_factory::Stub_factory): Add missing static storage class
10232 qualifier for elf32_arm_stub_a8_veneer_blx.
10233
ffeef7df
ILT
102342010-01-07 Ian Lance Taylor <iant@google.com>
10235
dc3f80fe
ILT
10236 PR 10980
10237 * options.h (class General_options): Add --warn-unresolved-symbols
10238 and --error-unresolved-symbols.
10239 * errors.cc (Errors::undefined_symbol): Implement
10240 --warn-unresolved-symbols.
10241
ffeef7df
ILT
10242 * options.h (class General_options): Add -z text and -z textoff.
10243 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10244
f1ec9ded
ST
102452010-01-06 Sriraman Tallam <tmsriram@google.com>
10246
10247 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10248 (Garbage_collection::cident_sections): New function.
10249 (Garbage_collection::add_cident_section): New function.
10250 (Garbage_collection::cident_sections_): New member.
10251 (gc_process_relocs): Add references to sections whose names are C
10252 identifiers.
10253 * gold.h (cident_section_start_prefix): New constant.
10254 (cident_section_stop_prefix): New constant.
10255 (is_cident): New function.
10256 * layout.cc (Layout::define_section_symbols): Replace string constants
10257 with the newly defined constants.
10258 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10259 C identifiers.
10260 * testsuite/Makefile.am: Add gc_orphan_section_test.
10261 * testsuite/Makefile.in: Regenerate.
10262 * testsuite/gc_orphan_section_test.cc: New file.
10263 * testsuite/gc_orphan_section_test.sh: New file.
10264
6eda8c29
ILT
102652010-01-06 Ian Lance Taylor <iant@google.com>
10266
b9674e17
ILT
10267 PR 10980
10268 * options.h (class General_options): Add --warn-shared-textrel.
10269 * layout.cc (Layout::finish_dynamic_section): Implement
10270 --warn-shared-textrel.
10271
6eda8c29
ILT
10272 PR 10980
10273 * options.h (class General_options): Add --warn-multiple-gp.
10274
32dcd44e
ILT
102752010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10276
10277 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10278 $(THREADSLIB) and $(LIBDL).
10279 * Makefile.in: Rebuild.
10280
a192ba05
ILT
102812010-01-06 Ian Lance Taylor <iant@google.com>
10282
10283 PR 10980
10284 * options.cc (General_options::parse_section_start): New function.
10285 (General_options::section_start): New function.
10286 (General_options::General_options): Initialize all members.
10287 * options.h: Include <map>
10288 (class General_options): Add --section-start. Add section_starts_
10289 member.
10290 * layout.cc (Layout::attach_allocated_section_to_segment): If
10291 --section-start was used, set the address of the segment. Remove
10292 local sort_sections.
10293 (Layout::relaxation_loop_body): If the address of the load segment
10294 has been set by --section-start, don't use it.
10295 * output.h (Output_segment::update_flags_for_output_section): New
10296 function.
10297 * output.cc (Output_segment::add_output_section): Call
10298 update_flags_for_output_section.
10299
dde3f402
ILT
103002010-01-05 Ian Lance Taylor <iant@google.com>
10301
62dfdd4d
ILT
10302 PR 10980
10303 * options.h (class General_options): Add --undefined-version.
10304 * script.cc (struct Version_expression): Add was_matched_by_symbol
10305 field.
10306 (Version_script_info::matched_symbol): New function.
10307 (Version_script_info::get_symbol_version_helper): Call
10308 matched_symbol.
10309 (Version_script_info::check_unmatched_names): New function.
10310 * script.h (class Version_script_info): Update declarations.
10311 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10312
9c4ae156
ILT
10313 * options.h (class General_options): Use DEFINE_bool_alias for
10314 allow_multiple_definition.
10315 * resolve.cc (Symbol_table::should_override): Don't test
10316 allow_multiple_definition.
10317
dde3f402
ILT
10318 PR 10980
10319 * options.h (class General_options): Add --cref.
10320 * main.cc (main): Print cref table if --cref. Don't close mapfile
10321 until after printing cref table.
10322 * cref.cc: Include "symtab.h".
10323 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10324 (Cref_table_compare::operator()): New function.
10325 (Cref_inputs::gather_cref): New function.
10326 (filecol): New static const.
10327 (Cref_inputs::print_cref): New function.
10328 (Cref::print_cref): New function.
10329 * cref.h: Include <cstdio>.
10330 (class Cref): Update declarations.
10331 * mapfile.h (Mapfile::file): New function.
10332 * object.h (class Object): Define Symbols. Declare virtual
10333 do_get_global_symbols.
10334 (Object::get_global_symbols): New function.
10335 * object.cc (Input_objects::add_object): Pass object to cref_ if
10336 --cref.
10337 (Input_objects::archive_start): Likewise.
10338 (Input_objects::archive_stop): Likewise.
10339 (Input_objects::print_cref): New function.
10340 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10341 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10342 --cref.
10343 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10344 function.
10345 * plugin.h (class Sized_pluginobj): Update declarations.
10346
8781f709
ILT
103472010-01-05 Ian Lance Taylor <iant@google.com>
10348
10349 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10350 to is_default_version. Rename insdef to insdefault.
10351 (Symbol_table::add_from_relobj): Rename def to is_default_version
10352 and local to is_forced_local.
10353 (Symbol_table::add_from_pluginobj): Likewise.
10354 (Symbol_table::add_from_dynobj): Likewise.
10355 (Symbol_table::define_special_symbol): Rename insdef to
10356 insdefault.
10357
fe35d28d
ILT
103582010-01-04 Ian Lance Taylor <iant@google.com>
10359
30bc8c46
ILT
10360 PR 10980
10361 * options.h (class General_options): Add
10362 --allow-multiple-definition and -z muldefs.
10363 * resolve.cc (Symbol_table::should_override): Don't warn about a
10364 multiple symbol definition if --allow-multiple-definition or -z
10365 muldefs.
10366
7eaea549
ILT
10367 PR 10980
10368 * options.h (class General_options): Add --add-needed and
10369 --copy-dt-needed-entries. Tweak --as-needed help entry.
10370 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10371 error if --copy-dt-needed-entries aka --add-needed is used and
10372 would cause a change in behaviour.
10373
fe35d28d
ILT
10374 PR 10980
10375 * options.h (class General_options): Add -G as a short version of
10376 --shared. Add no-op options -assert, -g, and -i.
10377
55a2bb35
ST
103782010-01-04 Sriraman Tallam <tmsriram@google.com>
10379
10380 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10381 check for .text or .gnu.linkonce.t sections.
10382 * icf.cc (Icf::find_identical_sections): Ditto.
10383 Change the detection for mangled function name within the section
10384 name.
10385 * icf.h (is_section_foldable_candidate): New function.
10386
719328e1
ILT
103872009-12-30 Ian Lance Taylor <iant@google.com>
10388
10389 PR 10980
10390 * options.h (class General_options): Permit two dashes with
10391 --retain-symbols-file.
10392
d7bb5745
ILT
103932009-12-30 Ian Lance Taylor <iant@google.com>
10394
403a15dd
ILT
10395 PR 10979
10396 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10397 don't put the file header and segment headers in the text
10398 segment.
10399
eda294df
ILT
10400 PR 10979
10401 * common.cc (Sort_commons::operator()): Stabilize sort when both
10402 entries are NULL.
10403 (Symbol_table::do_allocate_commons_list): When allocating common
10404 symbols, skip a symbol which is no longer common.
10405 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10406 an object before checking its type.
10407 * testsuite/common_test_2.c: New file.
10408 * testsuite/common_test_3.c: New file.
10409 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10410 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10411 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10412 (common_test_2_pic.o, common_test_2.so): New targets.
10413 (common_test_3_pic.o, common_test_3.so): New targets.
10414 * testsuite/Makefile.in: Rebuild.
10415
d7bb5745
ILT
10416 PR 10979
10417 * script.cc (read_input_script): If we see a new SECTIONS clause,
10418 and we have added an input section, give an error.
10419 * layout.h (class Layout): Add have_added_input_section function.
10420 Add have_added_input_section_ field.
10421 * layout.cc (Layout::Layout): Initialize
10422 have_added_input_section_.
10423 (Layout::layout): Set have_added_input_section_.
10424 (Layout::layout_eh_frame): Likewise.
10425
fc59c572
ILT
104262009-12-30 Ian Lance Taylor <iant@google.com>
10427
10428 PR 10931
10429 * options.h (class General_options): Add --sort-common option.
10430 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10431 * common.cc (Sort_common): Add sort_order parameter to
10432 constructor. Add sort_order_ field.
10433 (Sort_commons::operator): Check sort_order_.
10434 (Symbol_table::allocate_commons): Determine the sort order.
10435 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10436 Change all callers.
10437 (Symbol_table::do_allocate_commons_list): Likewise.
10438
1c74fab0
ILT
104392009-12-30 Ian Lance Taylor <iant@google.com>
10440
10441 PR 10916
10442 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10443 symbols from this object, don't change the visibility of an
10444 undefined symbol.
10445 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10446
6affe781
ILT
104472009-12-30 Ian Lance Taylor <iant@google.com>
10448
10449 PR 10861
10450 * script.h (class Version_script_info): Define Language enum.
10451 Update declarations. Define Glob, Exact, and Lookup types. Add
10452 new fields globals_, locals_, and is_finalized_.
10453 * script.cc: Various formatting fixes.
10454 (class Parser_closure): Change language_stack_ from a vector of
10455 std::string to one of Version_script_info::Language. Adjust all
10456 uses accordingly.
10457 (class Lazy_demangler): Remove.
10458 (struct Version_expression): Change language from std::string to
10459 Version_script_info::Language.
10460 (Version_script_info::Version_script_info): New function.
10461 (Version_script_info::~Version_script_info): Don't call clear.
10462 (Version_script_info::finalize): New function.
10463 (Version_script_info::build_lookup_tables): New function.
10464 (Version_script_info::build_expression_list_lookup): New
10465 function.
10466 (Version_script_info::get_symbol_version_helper): Rewrite to use
10467 lookup tables.
10468 (Version_script_info::print_expression_list): Adjust to use
10469 Version_script_info::Language.
10470 (script_push_lex_into_version_mode): Check that the version script
10471 has not been finalized.
10472 (version_script_push_lang): Change language string to
10473 Version_script_info::Language.
10474 * options.cc (Command_line::version_script): New function.
10475 * options.h (class General_options): Add finalize_dynamic_list
10476 function. Change version_script from declaration to definition.
10477 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10478 * testsuite/version_script.map: Remove duplicate def of foo.
10479 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10480 version_script.map.
10481 * testsuite/Makefile.in: Rebuild.
10482
818bf354
ILT
104832009-12-30 Ian Lance Taylor <iant@google.com>
10484
10485 PR 10843
10486 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10487 if the input symbol index is 0, make the output symbol index 0.
10488
ebcc8304
ILT
104892009-12-30 Ian Lance Taylor <iant@google.com>
10490
10491 PR 10670
10492 * options.h (class General_options): Add -x/--discard-all.
10493 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10494 --discard-all. If the local symbol needs a dynamic entry, check
10495 that before handling --discard-locals.
10496
176fe33f
ILT
104972009-12-30 Ian Lance Taylor <iant@google.com>
10498
bb321bb1
ILT
10499 PR 10450
10500 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10501 flags to PF_R.
10502 (Output_segment::add_output_section): Don't change the flags if
10503 the type is PT_TLS.
10504
176fe33f
ILT
10505 PR 10450
10506 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10507 GNU hash table if they need a dynamic value. Otherwise, don't add
10508 them if they are defined in a dynamic object or are forced local.
10509
e8cd95c7
ILT
105102009-12-29 Ian Lance Taylor <iant@google.com>
10511
1b81fb71
ILT
10512 PR 10450
10513 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10514 .gnu.hash table for a 32-bit target.
10515
8d6d383d
ILT
10516 PR 10450
10517 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10518 regular and a dynamic object only needs a dynamic symbol table
10519 entry if it is externally visible.
10520
e785ec03
ILT
10521 PR 10450
10522 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10523 constructor. Add global_offset_table_ field.
10524 (Target_i386::got_section): Set global_offset_table_.
10525 (Target_i386::do_finalize_sections): Set global_offset_table_
10526 size.
10527 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10528 in constructor. Add global_offset_table_ field.
10529 (Target_x86_64::got_section): Set global_offset_table_.
10530 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10531 size.
10532
1a2dff53
ILT
10533 * layout.cc (Layout::Layout): Initialize increase_relro_.
10534 (Layout::get_output_section): Add is_relro, is_last_relro, and
10535 is_first_non_relro parameters. Change all callers.
10536 (Layout::choose_output_section): Likewise.
10537 (Layout::add_output_section_data): Likewise.
10538 (Layout::make_output_section): Likewise.
10539 (Layout::set_segment_offsets): Clear increase_relro when using a
10540 linker script.
10541 * layout.h (class Layout): Add increase_relro method. Add
10542 increase_relro_ field. Update declarations.
10543 * output.cc (Output_section::Output_section): Initialize
10544 is_last_relro_ and is_first_non_relro_.
10545 (Output_segment::add_output_section): Group relro sections is
10546 do_sort is true. Handle is_last_relro and is_first_non_relro.
10547 (Output_segment::maximum_alignment): Remove relro handling.
10548 (Output_segment::set_section_addresses): Add increase_relro
10549 parameter. Change all callers. Add initial alignment to align
10550 relro sections on separate page. Remove old relro handling.
10551 (Output_segment::set_section_list_addresses): Remove in_relro
10552 parameter. Change all callers.
10553 (Output_segment::set_offset): Add increase parameter. Change all
10554 callers. Remove old relro handling.
10555 * output.h (class Output_section): Add new methods: is_last_relro,
10556 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10557 Add is_last_relro_ and is_first_non_relro_ fields.
10558 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10559 Create separate .got.plt section. Call increase_relro.
10560 * x86_64.cc (Target_x86_64::got_section): Likewise.
10561 * testsuite/relro_script_test.t: Add .got.plt.
10562
f0ba79e2
ILT
10563 PR 10450
10564 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10565 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10566 (Layout::finalize): Call set_dynamic_symbol_size.
10567 (Layout::set_dynamic_symbol_size): New function.
10568 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10569 set_dynamic_symbol_size.
10570
e8cd95c7
ILT
10571 PR 10450
10572 * output.h (class Output_section): Add is_entsize_zero_ field.
10573 * output.cc (Output_section::Output_section): Initialize
10574 is_entsize_zero_.
10575 (Output_section::set_entsize): If two different entsizes are
10576 requested, force it to zero.
10577 (Output_section::add_input_section): Set flags for .debug_str
10578 before updating section flags. Set entsize.
10579 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10580 and SHF_STRING if all input sections have those flags.
10581
3e1b9a8a
RÁE
105822009-12-29 Rafael Espindola <espindola@google.com>
10583
10584 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10585 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10586 reporting.
3e1b9a8a 10587
3dcad376
ST
105882009-12-29 Sriraman Tallam <tmsriram@google.com>
10589
10590 * options.cc (General_options::parse_version): Allow -v to exit
10591 without an error if there is nothing to link.
10592
084e2665
ILT
105932009-12-29 Ian Lance Taylor <iant@google.com>
10594
10595 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10596 using a version of gcc before 4.1.
10597 * configure: Rebuild.
10598
250acde3
CD
105992009-12-28 Chris Demetriou <cgd@google.com>
10600
10601 * attributes.cc (Output_attributes_section_data::do_write): Use
10602 std::vector::front rather than std::vector::data.
10603
99fff23b
ILT
106042009-12-28 Ian Lance Taylor <iant@google.com>
10605
10606 * symtab.h (class Symbol_table): Add enum Defined.
10607 * resolve.cc (Symbol_table::should_override): Add defined
10608 parameter. Change all callers. Test whether object is NULL
10609 before calling a method on it.
10610 (Symbol_table::report_resolve_problem): Add defined parameter.
10611 Change all callers.
10612 (Symbol_table::should_override_with_special): Likewise.
10613 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10614 parameter. Change all callers.
10615 (Symbol_table::do_define_in_output_data): Likewise.
10616 (Symbol_table::define_in_output_segment): Likewise.
10617 (Symbol_table::do_define_in_output_segment): Likewise.
10618 (Symbol_table::define_as_constant): Likewise.
10619 (Symbol_table::do_define_as_constant): Likewise.
10620 * script.h (class Symbol_assignment): Add is_defsym parameter to
10621 constructor; change all callers.
10622 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10623 parameter. Change all callers. Add is_defsym_ field.
10624 (class Parser_closure): Add parsing_defsym parameter to
10625 constructor; change all callers. Add parsing_defsym accessor
10626 function. Add parsing_defsym_ field.
10627
556bd683
ILT
106282009-12-28 Ian Lance Taylor <iant@google.com>
10629
10630 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10631 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10632
1782c879
ILT
106332009-12-23 Ian Lance Taylor <iant@google.com>
10634
10635 * i386.cc (Target_i386::do_calls_non_split): Recognize
10636 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10637 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10638 -fsplit-stack prologue when using %r11.
1782c879 10639
329ca2b1
ST
106402009-12-21 Sriraman Tallam <tmsriram@google.com>
10641
10642 * options.cc (General_options::parse_version): Make -v continue and do
10643 the link like GNU ld does.
10644
d675ff46
RÁE
106452009-12-17 Rafael Avila de Espindola <espindola@google.com>
10646
10647 * Makefile.am (CCFILES): Add timer.cc.
10648 (HFILES): Add timer.h.
10649 * configure.ac: Check for sysconf and times.
10650 * main.cc: include timer.h.
10651 (main): Use Timer instead of get_run_time.
10652 * timer.cc: New.
10653 * timer.h: New.
10654 * workqueue.cc: include timer.h.
10655 (Workqueue::find_and_run_task):
10656 Report user, sys and wall time.
10657 * Makefile.in: Regenerate.
10658 * config.in: Regenerate.
10659 * configure: Regenerate.
10660
d6344fb5
DK
106612009-12-16 Doug Kwan <dougkwan@google.com>
10662
10663 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10664 sections.
10665 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10666 relaxed input sections.
10667 * output.cc (Output_section::find_relaxed_input_section): Change
10668 return type to Output_relaxed_input_section pointer. Adjust code
10669 for new type of relaxed_input_section_map_.
10670 * output.h (Output_section::find_relaxed_input_section): Change
10671 return type to Output_relaxed_input_section pointer.
10672 (Output_section::Output_relaxed_input_section_by_input_section_map):
10673 New type.
10674 (Output_section::relaxed_input_section_map_): Change type to
10675 Output_section::Output_relaxed_input_section_by_input_section_map.
10676 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10677 input section.
10678
0e0d5469
ILT
106792009-12-15 Ian Lance Taylor <iant@google.com>
10680
10681 * layout.cc (Layout::create_shstrtab): Only write out after input
10682 sections if we are compressing debug sections.
10683
0649a889
ILT
106842009-12-15 Ian Lance Taylor <iant@google.com>
10685
10686 * archive.cc (Archive::add_symbols): Only look up a symbol without
10687 a version if there is, in fact, a version.
10688
2ea97941
ILT
106892009-12-14 Ian Lance Taylor <iant@google.com>
10690
10691 Revert -Wshadow changes, all changes from:
10692 2009-12-11 Doug Kwan <dougkwan@google.com>
10693 2009-12-11 Nick Clifton <nickc@redhat.com>
10694 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10695
b0eec2cc
DK
106962009-12-11 Doug Kwan <dougkwan@google.com>
10697
10698 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10699 due to -Wshadow.
10700 * attributes.cc (Object_attribute::size): Ditto.
10701 (Attributes_section_data::size): Ditto.
10702 (Attributes_section_data::Attributes_section_data): Ditto.
10703 (Output_attributes_section_data::do_write): Ditto.
10704 * attributes.h (Object_attribute::set_type): Ditto.
10705 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10706
91d6fa6a
NC
107072009-12-11 Nick Clifton <nickc@redhat.com>
10708
10709 * archive.cc: Fix shadowed variable warnings.
10710 * arm.cc: Likewise.
10711 * compressed_output.cc: Likewise.
10712 * compressed_output.h: Likewise.
10713 * configure: Likewise.
10714 * dwarf_reader.cc: Likewise.
10715 * dynobj.cc: Likewise.
10716 * dynobj.h: Likewise.
10717 * ehframe.cc: Likewise.
10718 * ehframe.h: Likewise.
10719 * errors.cc: Likewise.
10720 * expression.cc: Likewise.
10721 * fileread.cc: Likewise.
10722 * fileread.h: Likewise.
10723 * freebsd.h: Likewise.
10724 * i386.cc: Likewise.
10725 * icf.cc: Likewise.
10726 * incremental.h: Likewise.
10727 * layout.cc: Likewise.
10728 * layout.h: Likewise.
10729 * mapfile.cc: Likewise.
10730 * merge.cc: Likewise.
10731 * merge.h: Likewise.
10732 * object.cc: Likewise.
10733 * object.h: Likewise.
10734 * options.h: Likewise.
10735 * output.cc: Likewise.
10736 * output.h: Likewise.
10737 * parameters.cc: Likewise.
10738 * plugin.cc: Likewise.
10739 * powerpc.cc: Likewise.
10740 * reduced_debug_output.cc: Likewise.
10741 * reduced_debug_output.h: Likewise.
10742 * reloc.cc: Likewise.
10743 * reloc.h: Likewise.
10744 * resolve.cc: Likewise.
10745 * script-sections.cc: Likewise.
10746 * script.cc: Likewise.
10747 * script.h: Likewise.
10748 * sparc.cc: Likewise.
10749 * symtab.cc: Likewise.
10750 * symtab.h: Likewise.
10751 * target-select.cc: Likewise.
10752 * target-select.h: Likewise.
10753 * token.h: Likewise.
10754 * workqueue.cc: Likewise.
10755 * workqueue.h: Likewise.
10756 * x86_64.cc: Likewise.
10757
a0351a69
DK
107582009-12-10 Doug Kwan <dougkwan@google.com>
10759
10760 * arm.cc (attributes.h): New include.
10761 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10762 (Arm_relobj::~Arm_relobj): Delete object pointed by
10763 attributes_section_data_.
10764 (Arm_relobj::attributes_section_data): New method definition.
10765 (Arm_relobj::attributes_section_data_): New data member declaration.
10766 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10767 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10768 attributes_section_data_.
10769 (Arm_dynobj::attributes_section_data): New method definition.
10770 (Arm_dynobj::attributes_section_data_): New data member declaration.
10771 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10772 initialization value of may_use_blx_ to false.
2e702c99 10773 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
10774 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10775 object attributes to compute results instead of hard-coding.
10776 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10777 Target_arm::get_secondary_compatible_arch,
10778 Target_arm::set_secondary_compatible_arch
10779 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10780 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10781 New method declarations.
10782 (Target_arm::get_aeabi_object_attribute): New method definition.
10783 (Target_arm::attributes_section_data_): New data member declaration.
10784 (read_arm_attributes_section): New template definition.
10785 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10786 (Arm_dynobj::do_read_symbols): Ditto.
10787 (Target_arm::do_finalize_sections): Merge attributes sections from
10788 input. Check for BLX use after attributes section merging.
10789 Fix __exidx_start and __exidx_end visibility. Create an
10790 .ARM.attributes section if necessary.
10791 (Target_arm::get_secondary_compatible_arch,
10792 Target_arm::set_secondary_compatible_arch,
10793 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10794 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 10795 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
10796 New method definitions.
10797
b59befec
ILT
107982009-12-09 Ian Lance Taylor <iant@google.com>
10799
10800 * plugin.cc (Plugin::load): Don't cast from void* to a function
10801 pointer.
10802
1276bc89
ILT
108032009-12-09 Ian Lance Taylor <iant@google.com>
10804
10805 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10806 information fields.
10807
2f2de248
L
108082009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10809
10810 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10811 Replace two_file_shared_1.so with two_file_shared_2.so.
10812 * testsuite/Makefile.in: Regenerated.
10813
4f787271
DK
108142009-12-08 Doug Kwan <dougkwan@google.com>
10815
10816 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10817 (HFILES): Add attributes.h and int_encoding.h.
10818 * Makefile.in: Regenerate.
10819 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10820 function definitions to int_encoding.cc
10821 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10822 prototypes to int_encoding.h
10823 * reduced_debug_output.cc (int_encoding.h): New include.
10824 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10825 function definitions to int_encoding.cc
10826 (insert_into_vector, read_from_pointer): Move template definitions to
10827 int_encoding.h
10828 * attributes.cc: New file.
10829 * attributes.h: New file.
10830 * int_encoding.cc: New file.
10831 * int_encoding.h: New file.
10832
20b52f1a
RÁE
108332009-12-07 Rafael Avila de Espindola <espindola@google.com>
10834
10835 PR gold/11055
10836 * incremental-dump.cc (dump_incremental_inputs): New.
10837 (main): Use dump_incremental_inputs.
10838
53d7974c
L
108392009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10840
10841 PR gold/10893
10842 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10843 checking elfcpp::STT_FUNC.
10844 (Target_i386::Relocate::relocate): Likewise.
10845 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10846
10847 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10848 symbols from shared libraries into normal FUNC symbols.
10849
10850 * symtab.h (Symbol): Add is_func and use it.
10851
05a352e6
DK
108522009-12-05 Doug Kwan <dougkwan@google.com>
10853
10854 * arm.cc (Target_arm::arm_info): Initialize new fields
10855 attributes_section and attributes_vendor.
10856 * i386.cc (Target_i386::i386_info): Same.
10857 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10858 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10859 fields attributes_section and attributes_vendor.
53d7974c 10860 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
10861 * target.h (Target::attributes_section, Target::attributes_vendor,
10862 Target::is_attributes_section, Target::attribute_arg_type,
10863 Target::attributes_order): New method definitions.
10864 (Target::Target_info::attributes_section,
10865 Target::Target_info::attributes_vendor): New fields.
10866 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10867 virtual method definitions.
10868 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10869 attributes_section and attributes_vendor.
10870 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10871
f4e5969c
DK
108722009-12-05 Doug Kwan <dougkwan@google.com>
10873
10874 * arm.cc: Update comments about interworking and stub generation.
10875 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10876 considered as non-PIC.
10877 (Arm_relocate_functions::base_abs): Fix formatting.
10878 (Arm_relocate_functions::got_prel): Fix comment. Change interface
10879 of function to use GOT entry address instead of offset.
10880 (Target_arm::Scan::global): Issue an error if a symbol would need a
10881 PLT does not get one because it is untyped. Remove code to create
10882 dynamic symbols for relative branches.
10883 (Target_arm::Relocate::relocate: Use 0 instead of false since function
10884 takes unsigned integer instead of boolean.
10885
1abce4a6
L
108862009-12-05 H.J. Lu <hongjiu.lu@intel.com>
10887
10888 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
10889 (two_file_test_LDADD): Likewise.
10890 (common_test_1_LDADD): Likewise.
10891 (exception_test_LDADD) Likewise.
10892 (weak_test_LDADD): Likewise.
10893 (many_sections_test_LDADD): Likewise.
10894 (initpri1_LDADD): Likewise.
10895 (script_test_1_LDADD): Likewise.
10896 (script_test_2_LDADD): Likewise.
10897 (justsyms_LDADD): Likewise.
10898 (binary_test_LDADD): Likewise.
10899 (large_LDADD): Likewise.
10900 * testsuite/Makefile.in: Regenerated.
10901
adcf2816 109022009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 10903
adcf2816
L
10904 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
10905 (Symbol_table::override_with_special): Likewise.
10906 (Symbol_table::add_from_object): Likewise.
10907
28e67f5d
RÁE
109082009-12-04 Rafael Avila de Espindola <espindola@google.com>
10909
10910 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10911 Don't set the data_offset twice.
10912
ae10a101
RÁE
109132009-12-04 Rafael Avila de Espindola <espindola@google.com>
10914
10915 * testsuite/Makefile.in: Regenerate.
10916
f59f41f3
DK
109172009-12-03 Doug Kwan <dougkwan@google.com>
10918
10919 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
10920 (Target_arm::do_finalize_sections): Add parameter for symbol table
10921 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
10922 * i386.cc (Target_i386::do_finalize_sections): Add an additional
10923 parameter for symbol table pointer.
10924 * layout.cc (Layout::finalize): Call Target::finalize_sections with
10925 an additional parameter for a pointer to symbol table.
10926 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
10927 parameter for a symbol table pointer.
10928 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
10929 * target.h (Target::finalize_sections, Target::do_finalize_sections):
10930 Ditto.
10931 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
10932 parameter for a symbol table pointer.
10933
ca55d848
RÁE
109342009-12-03 Rafael Avila de Espindola <espindola@google.com>
10935
10936 * incremental.cc (Incremental_inputs_header)
10937 (Incremental_inputs_header_write, Incremental_inputs_entry)
10938 (Incremental_inputs_entry_write): Move ...
10939 * incremental.h (Incremental_inputs_header)
10940 (Incremental_inputs_header_write, Incremental_inputs_entry)
10941 (Incremental_inputs_entry_write): here.
10942
3aec4f9c
RÁE
109432009-12-02 Rafael Avila de Espindola <espindola@google.com>
10944
10945 * incremental.cc (make_sized_incremental_binary): Set the target.
10946 Error if it is incompatible.
10947 * output.h (Output_file): Add filename method.
10948
9c0ae74d
RÁE
109492009-12-02 Rafael Avila de Espindola <espindola@google.com>
10950
10951 * incremental.cc (Incremental_inputs_entry): Remove unused argument
10952 from the get_* methods.
10953
a45500ae
RÁE
109542009-12-02 Rafael Avila de Espindola <espindola@google.com>
10955
10956 * incremental-dump.cc (main): Check that the offeset of a script is 0.
10957 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10958 Write 0 for the data_offset of scripts.
10959
325e6408
RÁE
109602009-12-02 Rafael Avila de Espindola <espindola@google.com>
10961
10962 * testsuite/Makefile.am: Add the incremental_test.sh test.
10963 * testsuite/incremental_test.sh: New.
10964 * testsuite/incremental_test_1.c: New.
10965 * testsuite/incremental_test_2.c: New.
10966
954c3e2e
RÁE
109672009-12-01 Rafael Avila de Espindola <espindola@google.com>
10968
703d02da 10969 * incremental-dump.cc (main): Fix typos.
954c3e2e 10970
f8086623
RÁE
109712009-11-27 Rafael Avila de Espindola <espindola@google.com>
10972
10973 PR gold/11025
10974 * incremental-dump.cc (main): Use llu to print 64 bit values.
10975
3b0dd6ac
L
109762009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
10977 H.J. Lu <hongjiu.lu@intel.com>
10978
10979 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
10980 $(LIBDL).
10981 (incremental_dump_LDADD): Likewise.
10982 * Makefile.in: Regenerated.
10983
a6d1ef57 109842009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 10985
a6d1ef57
DK
10986 Revert:
10987
10988 2009-11-25 Doug Kwan <dougkwan@google.com>
10989
10990 * arm.cc (Target_arm::Target_arm): Move method definition
10991 outside of class definition. Add code to handle
10992 --target1-rel, --target1-abs and --target2= options.
10993 (Target_arm::get_reloc_reloc_type): Change method to be
10994 non-static and const.
10995 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
10996 New data member declaration.
10997 (Target_arm::Scan::local, Target_arm::Scan::global,
10998 Target_arm::Relocate::relocate,
10999 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11000 Adjust call to Target_arm::get_real_reloc_type.
11001 (Target_arm::get_real_reloc_type): Use command line options
11002 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11003 * options.h (--target1-rel, --target1-abs, --target2): New
11004 ARM-only options.
11005
50aeb7d4
DK
110062009-11-25 Doug Kwan <dougkwan@google.com>
11007
11008 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11009 class definition. Add code to handle --target1-rel, --target1-abs
11010 and --target2= options.
11011 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11012 and const.
11013 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11014 member declaration.
11015 (Target_arm::Scan::local, Target_arm::Scan::global,
11016 Target_arm::Relocate::relocate,
11017 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11018 call to Target_arm::get_real_reloc_type.
11019 (Target_arm::get_real_reloc_type): Use command line options to
11020 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11021 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11022 options.
11023
51938283
DK
110242009-11-25 Doug Kwan <dougkwan@google.com>
11025
11026 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11027 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11028 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11029 formatting.
11030 (Arm_relocate_functions::thm_call): Replace body with a call to
11031 Arm_relocate_functions::thumb_branch_common.
11032 (Arm_relocate_functions::thm_jump24,
11033 Arm_relocate_functions::thm_xpc22): New method definitions.
11034 (Arm_relocate_functions::thumb_branch_common): New method definition.
11035 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11036 operator.
11037 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11038 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11039
e2b8f3c4
RÁE
110402009-11-24 Rafael Avila de Espindola <espindola@google.com>
11041
11042 * Makefile.am: Build incremental-dump
11043 * Makefile.in: Regenerate.
11044 * incremental-dump.cc: New.
11045 * incremental.cc (Incremental_inputs_header_data,
11046 Incremental_inputs_entry_data): Move to incremental.h
11047 * incremental.h: (Incremental_inputs_header_data,
11048 Incremental_inputs_entry_data): Move from incremental.cc
11049
bcba9aec
RÁE
110502009-11-24 Rafael Avila de Espindola <espindola@google.com>
11051
11052 * incremental.cc (Incremental_inputs_header,
11053 Incremental_inputs_header_write, Incremental_inputs_entry,
11054 Incremental_inputs_entry_write): Add a typedef with the data type.
11055
7c3afe08
RÁE
110562009-11-24 Rafael Avila de Espindola <espindola@google.com>
11057
11058 * incremental.cc (Incremental_inputs_header,
11059 Incremental_inputs_header_write, Incremental_inputs_entry,
11060 Incremental_inputs_entry_write): Update comment about which
11061 type has the filed descriptions.
11062
d204b6e9
DK
110632009-11-15 Doug Kwan <dougkwan@google.com>
11064
11065 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11066 (Arm_relocate_functions::arm_branch_common): Change method defintion
11067 in class definition to a method declaration and update list of formal
11068 parameters.
11069 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11070 Arm_relocation_functions::jump24): Adjust call to
11071 Arm_relocate_functions::arm_branch_common. Update list of formal
11072 parameters.
11073 (Arm_relocate_functions::xpc25): New method definition.
11074 (Arm_relocate_functions::arm_branch_common): Move method defintion
11075 out from class definition. Use stubs for mode-switching and extending
11076 branch ranges.
11077 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11078 specially. Change code to enable use of stubs in ARM branches.
11079
43d12afe
DK
110802009-11-10 Doug Kwan <dougkwan@google.com>
11081
11082 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11083 in method declaration.
11084 (Target_arm::relocate_stub): New method declaration.
11085 (Target_arm::default_target): Change to return a pointer instead of
11086 a const reference.
11087 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11088 Target_arm::default_target.
11089 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11090 method definition.
11091 (Target_arm::relocate_section): Adjust view.
11092 (Target_arm::relocate_stub): New method definition.
11093
ac33a407
DK
110942009-11-10 Doug Kwan <dougkwan@google.com>
11095
11096 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11097 a format warning.
11098 * incremental.cc (open_incremental_binary): Initialized local
11099 variables to avoid warnings.
11100 * object.cc (make_elf_object): Ditto.
11101 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11102 a format warning.
e1df38aa 11103
88ee28e9
L
11104009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11105
11106 PR gold/10930
11107 * testsuite/plugin_test.c: Include "config.h".
11108
2daedcd6
DK
111092009-11-09 Doug Kwan <dougkwan@google.com>
11110
11111 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11112 (arm_symbol_value): Remove.
11113 (Arm_relocate_functions::arm_branch_common,
11114 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11115 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11116 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11117 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11118 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11119 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11120 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11121 Arm_relocate_functions::thm_mobw_abs_nc,
11122 Arm_relocate_functions::thm_mov_abs,
11123 Arm_relocate_functions::movw_prel_nc,
11124 Arm_relocate_functions::thm_movt_abs,
11125 Arm_relocate_functions::movt_prel,
11126 Arm_relocate_functions::thm_movw_prel_nc,
11127 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11128 (Target_arm::Relocate::relocate): Only decompose address into two
11129 parts if relocation type uses the thumb-bit and pass the actual
11130 bit instead of a flag indicating that the thumb-bit is used. Adjust
11131 calls to methods in Arm_relocate_functions for this change.
11132
1276bc89 111332009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11134
11135 PR 10925
11136 * reloc.cc: Instantiate
11137 Sized_relobj::initialize_input_to_output_maps and
11138 Sized_relobj:free_input_to_output_maps.
11139
e53ad1b5
ILT
111402009-11-06 Ian Lance Taylor <iant@google.com>
11141
11142 PR 10876
11143 * defstd.cc (in_segment): Set only_if_ref true for "end".
11144
eb44217c
DK
111452009-11-06 Doug Kwan <dougkwan@google.com>
11146
11147 * arm.cc (class Reloc_stub): Correct a comment.
11148 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11149 (Target_arm::scan_section_for_stubs): New method declaration.
11150 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11151 Change methods from private to protected.
11152 (Target_arm::do_may_relax): New method definition.
11153 (Target_arm::do_relax, Target_arm::group_sections,
11154 Target_arm::scan_reloc_for_stub,
11155 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11156 (Target_arm::arm_input_section_map_): New data member declaration.
11157 (Target_arm::scan_reloc_for_stub,
11158 Target_arm::scan_reloc_section_for_stubs,
11159 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11160 Target_arm::do_relax): New method definitions.
11161
5d329b7d
ILT
111622009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11163
11164 * configure.ac: Check for (struct stat)::st_mtim
11165 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11166 * config.in: Regenerate.
11167 * configure: Regenerate.
11168
96a0d71b
ILT
111692009-11-05 Ian Lance Taylor <iant@google.com>
11170
11171 PR 10910
11172 * output.cc (Output_segment::add_output_section): Add missing
11173 return statement.
11174
594c8e5e
ILT
111752009-11-04 Ian Lance Taylor <iant@google.com>
11176
11177 PR 10880
11178 * object.h (class Object): Add is_needed and set_is_needed
11179 methods. Add is_needed_ field. Make bool fields into bitfields.
11180 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11181 defined in a dynamic object and referenced by a regular object,
11182 set is_needed for the dynamic object.
11183 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11184 if the file is marked with as_needed and it is not needed.
11185
22b127cc
ILT
111862009-11-04 Ian Lance Taylor <iant@google.com>
11187
11188 PR 10887
11189 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11190 tags if data is discarded by linker script.
11191 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11192 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11193 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11194 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11195
f5c870d2
ILT
111962009-11-04 Ian Lance Taylor <iant@google.com>
11197
11198 * layout.cc (Layout::get_output_section): Add is_interp and
11199 is_dynamic_linker_section parameters. Change all callers.
11200 (Layout::choose_output_section): Likewise.
11201 (Layout::make_output_section): Likewise.
11202 (Layout::add_output_section_data): Add is_dynamic_linker_section
11203 parameter. Change all callers.
11204 * layout.h (class Layout): Update declarations.
11205 * output.h (class Output_section): Add is_interp, set_is_interp,
11206 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11207 Add is_interp_, is_dynamic_linker_section_ fields. Change
11208 generate_code_fills_at_write_ to a bitfield.
11209 * output.cc (Output_section::Output_sections): Initialize new
11210 fields.
11211 (Output_segment::add_output_section): Add do_sort parameter.
11212 Change all callers.
11213
1ae4d23b
ILT
112142009-11-03 Ian Lance Taylor <iant@google.com>
11215
11216 PR 10860
11217 * options.h (class General_options): Add --warn-common.
11218 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11219 merging two common symbols.
11220 (Symbol_table::should_override): Handle --warn-common when merging
11221 a common symbol with a defined symbol. Use report_resolve_problem
11222 for multiple definitions.
11223 (Symbol_table::report_resolve_problem): New function.
11224 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11225
55da9579
DK
112262009-11-03 Doug Kwan <dougkwan@google.com>
11227
11228 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11229 stub_factory_.
11230 (Target_arm::stub_factory): New method definition.
11231 (Target_arm::new_arm_input_section,
11232 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11233 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11234 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11235 New type definitions.
11236 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11237 member declarations.
11238 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11239 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11240 New method definitions.
11241
37a9ac43
ILT
112422009-11-03 Ian Lance Taylor <iant@google.com>
11243
11244 * options.h (class General_options): Add --warn_constructors.
11245
b3d6a3d4
ILT
112462009-11-03 Ian Lance Taylor <iant@google.com>
11247
11248 PR 10893
11249 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11250 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11251
934b01dd
ILT
112522009-11-03 Ian Lance Taylor <iant@google.com>
11253
11254 PR 10895
11255 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11256 --msgid-bugs-address.
11257 (install-pdf): New target.
11258 (install-data_yes): Look up one directory to find mkinstalldirs.
11259
03c1939b
L
112602009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11261
11262 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11263 tree.
11264
ebd95253
DK
112652009-10-30 Doug Kwan <dougkwan@google.com>
11266
11267 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11268
e9bbb538
DK
112692009-10-30 Doug Kwan <dougkwan@google.com>
11270
11271 * arm.cc (Stub_addend_reader): New struct template definition
11272 and partial specializations.
11273 (Stub_addend_reader::operator()): New method definition for a
11274 partially specialized template.
11275
d5b40221
DK
112762009-10-30 Doug Kwan <dougkwan@google.com>
11277
11278 * arm.cc (Arm_relobj::processor_specific_flags): New method
11279 definition.
11280 (Arm_relobj::do_read_symbols): New method declaration.
11281 (Arm_relobj::processor_specific_flags_): New data member declaration.
11282 (Arm_dynobj): New class definition.
11283 (Target_arm::do_finalize_sections): Add input_objects parameter.
11284 (Target_arm::do_adjust_elf_header): New method declaration.
11285 (Target_arm::are_eabi_versions_compatible,
11286 (Target_arm::merge_processor_specific_flags): New method declaration.
11287 (Target_arm::do_make_elf_object): New overloaded method definitions
11288 and declaration.
11289 (Arm_relobj::do_read_symbols): New method definition.
11290 (Arm_dynobj::do_read_symbols): Ditto.
11291 (Target_arm::do_finalize_sections): Add input_objects parameters.
11292 Merge processor-specific flags from all input objects.
11293 (Target_arm::are_eabi_versions_compatible,
11294 Target_arm::merge_processor_specific_flags,
11295 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11296 New method definitions.
11297 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11298 Input_objects pointer type parameter.
11299 * layout.cc (Layout::finalize): Pass input objects to target's.
11300 finalize_sections function.
11301 * output.cc (Output_file_header::do_sized_write): Set ELF file
11302 header's processor-specific flags.
11303 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11304 Input_objects pointer type parameter.
11305 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11306 * target.h (Input_objects): New forward class declaration.
11307 (Target::processor_specific_flags,
11308 Target::are_processor_specific_flags_sect): New method definitions.
11309 (Target::finalize_sections): Add input_objects parameter.
11310 (Target::Target): Initialize processor_specific_flags_ and
11311 are_processor_specific_flags_set_.
11312 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11313 parameter.
11314 (Target::set_processor_specific_flags): New method definition.
11315 (Target::processor_specific_flags_,
11316 Target::are_processor_specific_flags_set_): New data member
11317 declarations.
11318 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11319 Input_objects pointer type parameter.
11320
ebabffbd
DK
113212009-10-30 Doug Kwan <dougkwan@google.com>
11322
11323 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11324
ad0f2072
ILT
113252009-10-28 Ian Lance Taylor <iant@google.com>
11326
11327 * object.h (class Relobj): Drop options parameter from
11328 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11329 do_scan_relocs, do_relocate. Change all callers.
11330 (class Sized_relobj): Drop options parameters from
11331 do_gc_process_relocs, do_scan_relocs, do_relocate,
11332 do_relocate_sections, relocate_sections, emit_relocs_scan,
11333 emit_relocs_scan_reltype. Change all callers.
11334 (struct Relocate_info): Remove options field and all references to
11335 it.
11336 * reloc.h (class Read_relocs): Remove options constructor
11337 parameter and options_ field. Change all callers.
11338 (class Gc_process_relocs, class Scan_relocs): Likewise.
11339 (class Relocate_task): Likewise.
11340 * target-reloc.h (scan_relocs): Remove options parameter. Change
11341 all callers.
11342 (scan_relocatable_relocs): Likewise.
11343 * target.h (class Sized_target): Remove options parameter from
11344 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11345 all callers.
11346 * gc.h (gc_process_relocs): Remove options parameter. Change all
11347 callers.
11348 * arm.cc: Update functions to remove options parameters.
11349 * i386.cc: Likewise.
11350 * powerpc.cc: Likewise.
11351 * sparc.cc: Likewise.
11352 * x86_64.cc: Likewise.
11353 * testsuite/testfile.cc: Likewise.
11354
8ffa3667
DK
113552009-10-28 Doug Kwan <dougkwan@google.com>
11356
11357 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11358 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11359 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11360 New method definitions.
11361
40f36857
CC
113622009-10-28 Cary Coutant <ccoutant@google.com>
11363
11364 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11365 (Plugin::cleanup_done_): New member.
11366 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11367 (Plugin_manager::cleanup_done_): Remove.
11368 (Plugin_manager::add_input_file): Edit error message.
11369 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11370 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11371
2c849493
ILT
113722009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11373
11374 * fileread.cc: (File_read::View::~View): Use the new
11375 data_ownership_ filed.
11376 (File_read::~File_read): Dispose the new whole_file_view_.
11377 (File_read::open): Mmap the whole file if needed.
11378 (File_read::open): Use whole_file_view_ instead of contents_.
11379 (File_read::find_view): Use whole_file_view_ if applicable.
11380 (File_read::do_read): Use whole_file_view_ instead of contents_.
11381 (File_read::make_view): Use whole_file_view_ instead of contents_,
11382 update File_read::View::View call.
11383 (File_read::find_or_make_view): Update File_read::View::View
11384 call.
11385 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11386 remove contents_
11387 (File_read::View::Data_ownership): New enum.
11388 (File_read::View::View): Replace bool mapped_ with Data_ownership
11389 argument.
11390 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11391 (File_read::View::data_ownership_): New field.
11392 (File_read::contents_): Remove (replaced by whole_file_view_).
11393 (File_read::whole_file_view_): New field.
11394 * options.h (class General_options): Add --keep-files-mapped.
11395
24998053
CC
113962009-10-27 Cary Coutant <ccoutant@google.com>
11397
11398 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11399 * testsuite/Makefile.am (plugin_test_5): New test case.
11400 * testsuite/Makefile.in: Regenerate.
11401
72adc4fa
DK
114022009-10-25 Doug Kwan <dougkwan@google.com>
11403
11404 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11405 from private to protected to allow access by child class.
11406 (Sized_relobj::do_relocate_sections): New method declaration.
11407 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11408 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11409 Sized_relobj::relocate_sections. Instantiate template explicitly
11410 for different target sizes and endianity.
11411
07f508a2
DK
114122009-10-24 Doug Kwan <dougkwan@google.com>
11413
11414 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11415 (Arm_input_section::as_arm_input_section): New method.
11416 (Arm_output_section): New class definition.
11417 (Arm_output_section::create_stub_group,
11418 Arm_output_section::group_sections): New method definitions.
11419
10ad9fe5
DK
114202009-10-22 Doug Kwan <dougkwan@google.com>
11421
11422 * arm.cc (Arm_input_section): New class definition.
11423 (Arm_input_section::init, Arm_input_section:do_write,
11424 Arm_input_section::set_final_data_size,
11425 Arm_input_section::do_reset_address_and_file_offset): New method
11426 definitions.
11427
56ee5e00
DK
114282009-10-21 Doug Kwan <dougkwan@google.com>
11429
11430 * arm.cc (Stub_table, Arm_input_section): New forward class
11431 declarations.
11432 (Stub_table): New class defintion.
11433 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11434 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11435 New method definition.
11436
b569affa
DK
114372009-10-21 Doug Kwan <dougkwan@google.com>
11438
11439 * arm.cc: Update copyright comments.
11440 (Target_arm): New forward class template declaration.
11441 (Arm_address): New type.
11442 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11443 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11444 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11445 constants.
11446 (Insn_template): Same.
11447 (DEF_STUBS): New macro.
11448 (Stub_type): New enum type.
11449 (Stub_template): New class definition.
11450 (Stub): Same.
11451 (Reloc_stub): Same.
11452 (Stub_factory): Same.
11453 (Target_arm::Target_arm): Initialize may_use_blx_ and
11454 should_force_pic_veneer_.
11455 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11456 Target_arm::should_force_pic_veneer,
11457 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11458 Target_arm::using_thumb_only, Target_arm:;default_target): New
11459 method defintions.
11460 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11461 New data member declarations.
11462 (Insn_template::size, Insn_template::alignment): New method defintions.
11463 (Stub_template::Stub_template): New method definition.
11464 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11465 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11466 (Stub_factory::Stub_factory): New method definition.
11467 * gold.h (string_hash): New template.
11468 * output.h (Input_section_specifier::hash_value): Use
11469 gold::string_hash.
11470 (Input_section_specifier::string_hash): Remove.
11471 * stringpool.cc (Stringpool_template::string_hash): Use
11472 gold::string_hash.
11473
6c172549
DK
114742009-10-20 Doug Kwan <dougkwan@google.com>
11475
11476 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11477 symbols of relaxed input sections.
11478 * output.h (Output_section::find_relaxed_input_section): Make
11479 method public.
11480
c5617f2f
DK
114812009-10-16 Doug Kwan <dougkwan@google.com>
11482
11483 * dynobj.cc (Versions::Versions): Initialize version_script_.
11484 Only insert base version symbol definition for a shared object
11485 if version script defines any version versions.
11486 (Versions::define_base_version): New method definition.
11487 (Versions::add_def): Check that base version is not needed.
11488 (Versions::add_need): Define base version lazily.
11489 * dynobj.h (Versions::define_base_version): New method declaration.
11490 (Versions::needs_base_version_): New data member declaration.
11491 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11492 (check_DATA): Add no_version_test.stdout.
11493 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11494 New make rules.
11495 * testsuite/Makefile.in: Regenerate.
11496 * testsuite/no_version_test.c: New file.
11497 * testsuite/no_version_test.sh: Ditto.
11498
3c12dcdb
DK
114992009-10-16 Doug Kwan <dougkwan@google.com>
11500
11501 * expression.cc (class Segment_start_expression): New class definition.
11502 (Segment_start_expression::value): New method definition.
11503 (script_exp_function_segment_start): Return a new
11504 Segment_start_expression.
11505 * gold/script-c.h (script_saw_segment_start_expression): New function
11506 prototype.
11507 * script-sections.cc (Script_sections::Script_sections): Initialize
11508 SAW_SEGMENT_START_EXPRESSION_ to false.
11509 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11510 and -Tbbs options to specify section addresses if given in
11511 command line and no SEGMENT_START expression is seen in a script.
11512 * script-sections.h (Script_sections::saw_segment_start_expression,
11513 Script_sections::set_saw_segment_start_expression): New method
11514 definition.
11515 (Script_sections::saw_segment_start_expression_): New data member
11516 declaration.
11517 * script.cc (script_saw_segment_start_expression): New function.
11518 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11519 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11520 script_test_7.sh and script_test_8.sh.
11521 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11522 script_test_8.stdout.
11523 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11524 (script_test_6, script_test_6.stdout, script_test_7,
11525 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11526 * Makefile.in: Regenerate.
11527 * testsuite/script_test_6.sh: New file.
11528 * testsuite/script_test_6.t: Same.
11529 * testsuite/script_test_7.sh: Same.
11530 * testsuite/script_test_7.t: Same.
11531 * testsuite/script_test_8.sh: Same.
11532
64b1ae37
DK
115332009-10-16 Doug Kwan <dougkwan@google.com>
11534
11535 * output.cc (Output_segment::set_section_list_address): Cast
11536 expressions to unsigned long long type to avoid format warnings.
11537
661be1e2
ILT
115382009-10-15 Ian Lance Taylor <iant@google.com>
11539
12edd763 11540 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11541 dot assignment to script_sections_.
12edd763
ILT
11542 * script-sections.cc (Script_sections::add_dot_assignment):
11543 Initialize if necessary.
11544
68b6574b
ILT
11545 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11546 program headers with no load segment if there is a linker script.
11547
661be1e2
ILT
11548 * layout.cc (Layout::set_segment_offsets): Align the file offset
11549 to the segment aligment for -N or -n with no load segment.
11550 * output.cc (Output_segment::add_output_section): Don't crash if
11551 the first section is a TLS section.
11552 (Output_segment::set_section_list_addresses): Print an error
11553 message if the address moves backward in a linker script.
11554 * script-sections.cc
11555 (Output_section_element_input::set_section_addresses): Don't
11556 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11557 (Orphan_output_section::set_section_addresses): Likewise.
11558
f15f61a7
DK
115592009-10-15 Doug Kwan <dougkwan@google.com>
11560
11561 * layout.cc (Layout::finish_dynamic_section): Generate tags
11562 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11563 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11564 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11565
82bb573a
ILT
115662009-10-14 Ian Lance Taylor <iant@google.com>
11567
11568 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11569 fields.
11570 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11571 data_shdr fields of relinfo.
11572 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11573 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11574 R_386_TLS_LDO_32, adjust based on section flags.
11575 (Target_i386::Relocate::fix_up_ldo): Remove.
11576
374ad285
ILT
115772009-10-13 Ian Lance Taylor <iant@google.com>
11578
11579 Add support for -pie.
11580 * options.h (class General_options): Add -pie and
11581 --pic-executable.
11582 (General_options::output_is_position_independent): Test -pie.
11583 (General_options::output_is_executable): Return true if not shared
11584 and not relocatable.
11585 (General_options::output_is_pie): Remove.
11586 * options.cc (General_options::finalize): Reject incompatible uses
11587 of -pie.
11588 * gold.cc (queue_middle_tasks): A -pie link is not static.
11589 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11590 * symtab.cc (Symbol::final_value_is_known): Return false if
11591 output_is_position_independent.
11592 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11593 output_is_position_independent.
11594 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11595 output_is_position_independent.
11596 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11597 output_is_position_independent.
11598 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11599 two_file_pie_test.
11600 (basic_pie_test.o, basic_pie_test): New targets.
11601 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11602 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11603 (two_file_pie_test): New target.
11604 * testsuite/Makefile.in: Rebuild.
11605 * README: Remove note saying that -pie is not supported.
11606
c6585162
ILT
116072009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11608
11609 * options.h (class General_options): Add -init and -fini.
11610 * layout.cc (Layout::finish_dynamic_section): Emit
11611 given init and fini functions.
11612
032ce4e9
ST
116132009-10-13 Sriraman Tallam <tmsriram@google.com>
11614
11615 * gc.h (gc_process_relocs): Check if icf is enabled using new
11616 function.
11617 * gold.cc (queue_initial_tasks): Likewise.
11618 (queue_middle_tasks): Likewise.
11619 * object.cc (do_layout): Likewise.
11620 * symtab.cc (is_section_folded): Likewise.
11621 * main.cc (main): Likewise.
11622 * reloc.cc (Read_relocs::run): Likewise.
11623 (Sized_relobj::do_scan_relocs): Likewise.
11624 * icf.cc (is_function_ctor_or_dtor): New function.
11625 (Icf::find_identical_sections): Check if function is ctor or dtor when
11626 safe icf is chosen.
11627 * options.h (General_options::icf): Change option to be an enum.
11628 (Icf_status): New enum.
11629 (icf_enabled): New method.
11630 (icf_safe_folding): New method.
11631 (set_icf_status): New method.
11632 (icf_status_): New variable.
11633 * (options.cc) (General_options::finalize): Set icf_status_.
11634 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11635 icf_test and icf_keep_unique_test to use the --icf enum flag.
11636 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11637 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11638
f345227a
ST
116392009-10-12 Sriraman Tallam <tmsriram@google.com>
11640
11641 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11642 includes to gc.h and icf.h.
11643 * arm.cc: Include gc.h.
11644 * gold.cc: Likewise.
11645 * i386.cc: Likewise.
11646 * powerpc.cc: Likewise.
11647 * sparc.cc: Likewise.
11648 * x86_64.cc: Likewise.
11649 * gc.h: Include icf.h.
11650
1c7814ed
ILT
116512009-10-11 Ian Lance Taylor <iant@google.com>
11652
11653 * plugin.cc: Include "gold.h" before other header files.
11654
ae3b5189
CD
116552009-10-10 Chris Demetriou <cgd@google.com>
11656
11657 * options.h (Input_file_argument::Input_file_type): New enum.
11658 (Input_file_argument::is_lib_): Replace with...
11659 (Input_file_argument::type_): New member.
11660 (Input_file_argument::Input_file_argument): Take Input_file_type
11661 'type' rather than boolean 'is_lib' as second argument.
11662 (Input_file_argument::is_lib): Use type_.
11663 (Input_file_argument::is_searched_file): New function.
11664 (Input_file_argument::may_need_search): Handle is_searched_file.
11665 * options.cc (General_options::parse_library): Support -l:filename.
11666 (General_options::parse_just_symbols): Update for Input_file_argument
11667 changes.
11668 (Command_line::process): Likewise.
11669 * archive.cc (Archive::get_file_and_offset): Likewise.
11670 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11671 * script.cc (read_script_file, script_add_file): Likewise.
11672 * fileread.cc (Input_file::Input_file): Likewise.
11673 (Input_file::will_search_for): Handle is_searched_file.
11674 (Input_file::open): Likewise.
11675 * readsyms.cc (Read_symbols::get_name): Likewise.
11676 * testsuite/Makefile.am (searched_file_test): New test.
11677 * testsuite/Makefile.in: Regenerate.
11678 * testsuite/searched_file_test.cc: New file.
11679 * testsuite/searched_file_test_lib.cc: New file.
11680
f3048a1d
ILT
116812009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11682 Ian Lance Taylor <iant@google.com>
11683
11684 * descriptor.cc: Include <cstdio> and "binary-io.h".
11685 (Descriptors::open): Open the files in binary mode always.
11686 * script.cc (Lex::get_token): Treat \r as whitespace.
11687
d4780e57
ILT
116882009-10-09 Ian Lance Taylor <iant@google.com>
11689
11690 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11691
d9a893b8
ILT
116922009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11693 Ian Lance Taylor <iant@google.com>
11694
11695 * configure.ac: Check for readv function also.
11696 * fileread.cc (readv): Define if not HAVE_READV.
11697 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11698 does not exist.
11699 * config.in: Regenerate.
11700 * configure: Regenerate.
11701
c0a62865
DK
117022009-10-09 Doug Kwan <dougkwan@google.com>
11703
11704 * layout.cc (Layout::make_output_section): Call target hook to make
11705 ordinary output section.
11706 (Layout::finalize): Adjust parameter list of call the
11707 Target::may_relax().
11708 * layout.h (class Layout::section_list): New method.
11709 * merge.h (Output_merge_base::entsize): Change visibility to public.
11710 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11711 New methods.
11712 (Output_merge_string::do_is_string): New method.
11713 * object.cc (Sized_relobj::do_setup): renamed from
11714 Sized_relobj::set_up.
11715 * object.h (Sized_relobj::adjust_shndx,
11716 Sized_relobj::initializ_input_to_output_maps,
11717 Sized_relobj::free_input_to_output_maps): Change visibilities to
11718 protected.
11719 (Sized_relobj::setup): Virtualize.
11720 (Sized_relobj::do_setup): New method declaration.
11721 (Sized_relobj::invalidate_section_offset,
11722 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11723 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11724 * options.cc (parse_int): New function.
11725 * options.h (parse_int): New declaration.
11726 (DEFINE_int): New macro.
11727 (stub_group_size): New option.
11728 * output.cc (Output_section::Output_section): Initialize memebers
11729 merge_section_map_, merge_section_by_properties_map_,
11730 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11731 (Output_section::add_input_section): Handled deferred code-fill
11732 generation and remove an old comment.
11733 (Output_section::add_relaxed_input_section): New method definition.
11734 (Output_section::add_merge_input_section): Use merge section by
11735 properties map to speed to search. Update merge section maps
11736 as appropriate.
11737 (Output_section::build_relaxation_map): New method definition.
11738 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11739 Same.
11740 (Output_section::relax_input_section): Renamed to
11741 Output_section::convert_input_sections_to_relaxed_sections and change
11742 interface to take a vector of pointers to relaxed sections.
11743 (Output_section::find_merge_section,
11744 Output_section::find_relaxed_input_section): New method definitions.
11745 (Output_section::is_input_address_mapped,
11746 Output_section::output_offset, Output_section::output_address):
11747 Use output section data maps to speed up searching.
11748 (Output_section::find_starting_output_address): Add comments.
11749 (Output_section::do_write,
11750 Output_section::write_to_postprocessing_buffer): Do code-fill
11751 generation as appropriate.
11752 (Output_section::get_input_sections): Invalidate relaxed input section
11753 map.
11754 (Output_section::restore_states): Adjust type of checkpoint .
11755 Invalidate relaxed input section map.
11756 * output.h (Output_merge_base): New class declaration.
11757 (Input_section_specifier): New class defintion.
11758 (class Output_relaxed_input_section) Change base class to
11759 Output_section_data_build.
11760 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11761 base class initializer.
11762 (Output_section::add_relaxed_input_section): New method declaration.
11763 (Output_section::Input_section): Change visibility to protected.
2e702c99 11764 (Output_section::Input_section::relobj,
c0a62865
DK
11765 Output_section::Input_section::shndx): Handle relaxed input sections.
11766 Output_section::input_sections) Change visibility to protected. Also
11767 define overload to return a non-const pointer.
11768 (Output_section::Merge_section_properties): New class defintion.
11769 (Output_section::Merge_section_by_properties_map,
11770 Output_section::Output_section_data_by_input_section_map,
11771 Output_section::Relaxation_map): New types.
11772 (Output_section::relax_input_section): Rename method to
11773 Output_section::convert_input_sections_to_relaxed_sections and change
11774 interface to take a vector of relaxed section pointers.
11775 (Output_section::find_merge_section,
11776 Output_section::find_relaxed_input_section,
11777 Output_section::build_relaxation_map,
11778 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11779 New method declarations.
11780 (Output_section::merge_section_map_
11781 Output_section::merge_section_by_properties_map_,
11782 Output_section::relaxed_input_section_map_,
11783 Output_section::is_relaxed_input_section_map_valid_,
11784 Output_section::generate_code_fills_at_write_): New data members.
11785 * script-sections.cc
11786 (Output_section_element_input::set_section_addresses): Call
11787 current_data_size and addralign methods of relaxed input sections.
11788 (Orphan_output_section::set_section_addresses): Call current_data_size
11789 and addralign methods of relaxed input sections.
11790 * symtab.cc (Symbol_table::compute_final_value): Extract template
11791 from the body of Symbol_table::sized_finalize_symbol.
11792 (Symbol_table::sized_finalized_symbol): Call
11793 Symbol_table::compute_final_value.
11794 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11795 (Symbol_table::compute_final_value): New templated method declaration.
11796 * target.cc (Target::do_make_output_section): New method defintion.
11797 * target.h (Target::make_output_section): New method declaration.
11798 (Target::relax): Add more parameters for input objects, symbol table
11799 and layout. Adjust call to do_relax.
11800 (Target::do_make_output_section): New method declaration.
11801 (Target::do_relax): Add parameters for input objects, symbol table
11802 and layout.
11803
d446d6c4
ILT
118042009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11805
11806 * pread.c: Include stdio.h.
11807
bc06c745
ILT
118082009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11809
11810 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11811 defined.
11812
75aea3d0
ILT
118132009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11814
11815 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11816 Change read_shndx type to unsigned int.
11817 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11818 int.
11819 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11820 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11821 Change read_shndx type to unsigned int.
11822 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11823 int.
11824 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11825 * layout.cc (Layout::create_symtab_sections): Cast the result of
11826 local_symcount * symsize to off_t in the gold_assert.
11827
be8fcb75
ILT
118282009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11829
11830 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11831 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11832 R_ARM_BASE_ABS.
11833 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11834 (Arm_relocate_functions::thm_abs5): New function.
11835 (Arm_relocate_functions::abs12): New function.
11836 (Arm_relocate_functions::abs16): New function.
11837 (Arm_relocate_functions::base_abs): New function.
11838 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11839 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11840 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11841 R_ARM_BASE_ABS.
11842 (Scan::global): Likewise.
11843 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11844 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11845 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11846 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11847 R_ARM_BASE_ABS.
11848
c2a122b6
ILT
118492009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11850
11851 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11852 (Arm_relocate_functions::movt_prel): New function.
11853 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11854 (Arm_relocate_functions::thm_movt_prel): New function.
11855 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11856 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11857 (Scan::global, Relocate::relocate): Likewise.
11858 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11859
c4aa1e2d
ILT
118602009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11861
11862 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11863 Incremental_checker.
11864 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11865 unsigned int.
11866 (class Incremental_inputs_header): New class.
11867 (Incremental_inputs_header_writer): Edit comment.
11868 (Incremental_inputs_entry): New class.
11869 (Incremental_inputs_entry_writer): Edit comment.
11870 (Sized_incremental_binary::do_find_incremental_inputs_section):
11871 Add *strtab_shndx parameter, fill it.
11872 (Sized_incremental_binary::do_check_inputs): New method.
11873 (Incremental_checker::can_incrementally_link_output_file): Use
11874 Sized_incremental_binary::check_inputs.
11875 (Incremental_inputs::report_command_line): Save command line in
11876 command_line_.
11877 * incremental.h:
11878 (Incremental_binary::find_incremental_inputs_section): New
11879 method.
11880 (Incremental_binary::do_find_incremental_inputs_section): Add
11881 strtab_shndx parameter.
11882 (Incremental_binary::do_check_inputs): New pure virtual method.
11883 (Sized_incremental_binary::do_check_inputs): Declare.
11884 (Incremental_checker::Incremental_checker): Add incremental_inputs
11885 parameter, use it to initialize incremental_inputs_.
11886 (Incremental_checker::incremental_inputs_): New field.
11887 (Incremental_checker::command_line): New method.
11888 (Incremental_checker::inputs): New method.
11889 (Incremental_checker::command_line_): New field.
11890
c549a694
ILT
118912009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11892
11893 * incremental.cc: Include <cstdarg> and "target-select.h".
11894 (vexplain_no_incremental): New function.
11895 (explain_no_incremental): New function.
11896 (Incremental_binary::error): New method.
11897 (Sized_incremental_binary::do_find_incremental_inputs_section): New
11898 method.
11899 (make_sized_incremental_binary): New function.
11900 (open_incremental_binary): New function.
11901 (can_incrementally_link_file): Add checks if output is ELF and has
11902 inputs section.
11903 * incremental.h: Include "elfcpp_file.h" and "output.h".
11904 (Incremental_binary): New class.
11905 (Sized_incremental_binary): New class.
11906 (open_incremental_binary): Declare.
11907 * object.cc (is_elf_object): Use
11908 elfcpp::Elf_recognizer::is_elf_file.
11909 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
11910 * output.h (Output_file::filesize): New method.
11911
fd3c5f0b
ILT
119122009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11913
11914 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
11915 New function.
11916 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
11917 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
11918 function.
11919 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
11920 function.
11921 (Arm_relocate_functions::movw_abs_nc): New function.
11922 (Arm_relocate_functions::movt_abs): New function.
11923 (Arm_relocate_functions::thm_movw_abs_nc): New function.
11924 (Arm_relocate_functions::thm_movt_abs): New function.
11925 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
11926 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
11927 (Scan::global): Likewise.
11928 (Relocate::relocate): Likewise.
11929 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11930
7f5309a5
ILT
119312009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11932
11933 * arm.cc (Arm_relocate_functions::got_prel) New function.
11934 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
11935 (Relocate::relocate): Likewise.
11936 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11937
364c7fa5
ILT
119382009-10-06 Ian Lance Taylor <iant@google.com>
11939
11940 * options.h (class General_options): Define
11941 split_stack_adjust_size parameter.
11942 * object.h (class Object): Add uses_split_stack_ and
11943 has_no_split_stack_ fields. Add uses_split_stack and
11944 has_no_split_stack accessor functions. Declare
11945 handle_split_stack_section.
11946 (class Reloc_symbol_changes): Define.
11947 (class Sized_relobj): Define Function_offsets. Declare
11948 split_stack_adjust, split_stack_adjust_reltype, and
11949 find_functions.
11950 * object.cc (Object::handle_split_stack_section): New function.
11951 (Sized_relobj::do_layout): Call handle_split_stack_section.
11952 * dynobj.cc (Sized_dynobj::do_layout): Call
11953 handle_split_stack_section.
11954 * reloc.cc (Sized_relobj::relocate_sections): Call
11955 split_stack_adjust for executable sections in split_stack
11956 objects. Pass reloc_map to relocate_section.
11957 (Sized_relobj::split_stack_adjust): New function.
11958 (Sized_relobj::split_stack_adjust_reltype): New function.
11959 (Sized_relobj::find_functions): New function.
11960 * target-reloc.h: Include "object.h".
11961 (relocate_section): Add reloc_symbol_changes parameter. Change
11962 all callers.
11963 * target.h (class Target): Add calls_non_split method. Declare
11964 do_calls_non_split virtual method. Declare match_view and
11965 set_view_to_nop.
11966 * target.cc: Include "elfcpp.h".
11967 (Target::do_calls_non_split): New function.
11968 (Target::match_view): New function.
11969 (Target::set_view_to_nop): New function.
11970 * gold.cc (queue_middle_tasks): Give an error if mixing
11971 split-stack and non-split-stack objects with -r.
11972 * i386.cc (Target_i386::relocate_section): Add
11973 reloc_symbol_changes parameter.
11974 (Target_i386::do_calls_non_split): New function.
11975 * x86_64.cc (Target_x86_64::relocate_section): Add
11976 reloc_symbol_changes parameter.
11977 (Target_x86_64::do_calls_non_split): New function.
11978 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
11979 parameter.
11980 * powerpc.cc (Target_powerpc::relocate_section): Add
11981 reloc_symbol_changes parameter.
11982 * sparc.cc (Target_sparc::relocate_section): Add
11983 reloc_symbol_changes parameter.
11984 * configure.ac: Call AM_CONDITIONAL for the default target.
11985 * configure: Rebuild.
11986 * testsuite/Makefile.am (TEST_AS): New variable.
11987 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
11988 (check_DATA): Add split_i386 and split_x86_64 files.
11989 (SPLIT_DEFSYMS): Define.
11990 (split_i386_[1234n].o): New targets.
11991 (split_i386_[124]): New targets.
11992 (split_i386_[1234r].stdout): New targets.
11993 (split_x86_64_[1234n].o): New targets.
11994 (split_x86_64_[124]): New targets.
11995 (split_x86_64_[1234r].stdout): New targets.
11996 (MOSTLYCLEANFILES): Add new executables.
11997 * testsuite/split_i386.sh: New file.
11998 * testsuite/split_x86_64.sh: New file.
11999 * testsuite/split_i386_1.s: New file.
12000 * testsuite/split_i386_2.s: New file.
12001 * testsuite/split_i386_3.s: New file.
12002 * testsuite/split_i386_4.s: New file.
12003 * testsuite/split_i386_n.s: New file.
12004 * testsuite/split_x86_64_1.s: New file.
12005 * testsuite/split_x86_64_2.s: New file.
12006 * testsuite/split_x86_64_3.s: New file.
12007 * testsuite/split_x86_64_4.s: New file.
12008 * testsuite/split_x86_64_n.s: New file.
12009 * testsuite/testfile.cc (Target_test): Update relocation_section
12010 function.
12011 * testsuite/Makefile.in: Rebuild.
12012
e8a9fcda
ILT
120132009-10-06 Ian Lance Taylor <iant@google.com>
12014
12015 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12016 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12017 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12018 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12019 the address on ldo_addrs_.
12020 (Target_i386::Relocate::fix_up_ldo): New function.
12021
e99daf92
ILT
120222009-10-06 Rafael Espindola <espindola@google.com>
12023
12024 * plugin.cc (add_input_library): New.
12025 (Plugin::load): Add add_input_library to tv.
12026 (Plugin_manager::add_input_file): Add the is_lib argument.
12027 (add_input_file): Update call to Plugin_manager::add_input_file.
12028 (add_input_library): New.
12029 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12030
966d4097
DK
120312009-09-30 Doug Kwan <dougkwan@google.com>
12032
12033 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12034 symbol and call Symbol::may_need_copy_reloc to determine if
12035 a copy reloc is needed.
12036 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12037 nocopyreloc is given in command line.
12038 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12039 given in command line.
12040 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12041 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12042 of the removed Target_i386::may_need_copy_reloc.
12043 * options.h (copyreloc): New option with default value false.
12044 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12045 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12046 instead of the removed Target_powerpc::may_need_copy_reloc.
12047 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12048 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12049 instead of the removed Target_sparc::may_need_copy_reloc.
12050 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12051 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12052 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12053 instead of the removed Target_x86_64::may_need_copy_reloc.
12054
029ba973
ILT
120552009-09-30 Ian Lance Taylor <iant@google.com>
12056
12057 * object.h (class Object): Remove target_ field, and target,
12058 sized_target, and set_target methods.
12059 (Object::sized_target): Remove.
12060 (class Sized_relobj): Update declarations. Remove sized_target.
12061 * object.cc (Sized_relobj::setup): Remove target parameter.
12062 Change all callers.
12063 (Input_objects::add_object): Don't do anything with the target.
12064 (make_elf_sized_object): Add punconfigured parameter. Change all
12065 callers. Set or test parameter target.
12066 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12067 Change all callers.
12068 * parameters.cc (Parameters::set_target): Change parameter type to
12069 be non-const.
12070 (Parameters::default_target): Remove.
12071 (set_parameters_target): Change parameter type to be non-const.
12072 (parameters_force_valid_target): New function.
12073 (parameters_clear_target): New function.
12074 * parameters.h (class Parameters): Update declarations. Remove
12075 default_target method. Add sized_target and clear_target
12076 methods. Change target_ to be non-const.
12077 (set_parameters_target): Update declaration.
12078 (parameters_force_valid_target): Declare.
12079 (parameters_clear_target): Declare.
12080 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12081 as NULL if we aren't searching.
12082 (Add_symbols::run): Don't check for compatible target.
12083 * fileread.cc (Input_file::open_binary): Call
12084 parameters_force_valid_target.
12085 * gold.cc (queue_middle_tasks): Likewise.
12086 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12087 set_target on object.
12088 * dynobj.h (class Sized_dynobj): Update declarations.
12089 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12090 make_elf_object returns NULL.
12091 (Archive::include_member): Don't check whether object target is
12092 compatible.
12093 * output.cc (Output_section::add_input_section): Get target from
12094 parameters.
12095 (Output_section::relax_input_section): Likewise.
12096 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12097 parameters.
12098 (Sized_relobj::do_scan_relocs): Likewise.
12099 (Sized_relobj::relocate_sections): Likewise.
12100 * resolve.cc (Symbol_table::resolve): Likewise.
12101 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12102 parameter. Change all callers.
12103 (Symbol_table::add_from_object): Get target from parameters.
12104 (Symbol_table::add_from_relobj): Don't check object target.
12105 (Symbol_table::add_from_dynobj): Likewise.
12106 (Symbol_table::define_special_symbol): Get target from
12107 parameters.
12108 * symtab.h (class Symbol_table): Update declaration.
12109 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12110 parameter. Change all callers. Clear parameter target.
12111 (Binary_test): Test target here.
12112 * testsuite/object_unittest.cc (gold_testsuite): Remove
12113 target_test_pointer parameter. Change all callers.
12114 (Object_test): Test target here.
12115
a6a22b83
ILT
121162009-09-26 Ian Lance Taylor <iant@google.com>
12117
12118 * testsuite/initpri1.c: Don't try to use constructor priorities if
12119 compiling with gcc before 4.3.
12120
6a8f49fe
ILT
121212009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12122
12123 * testsuite/retain_symbols_file_test.sh (check_present): Change
12124 output file name to retain_symbols_file_test.stdout.
12125 (check_absent): Likewise.
12126
8c604651
CS
121272009-09-18 Craig Silverstein <csilvers@google.com>
12128
12129 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12130 * options.cc: Include <cerrno> and <fstream>.
12131 (General_options::finalize): Parse -retain-symbols-file tag.
12132 * options.h: New flag.
12133 (General_options): New method should_retain_symbol, new
12134 variable symbols_to_retain.
12135 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12136 should_retain_symbol map.
12137 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12138 * testsuite/Makefile.in: Regenerate.
12139 * testsuite/retain_symbols_file_test.sh: New file.
12140
ca58b19f
NC
121412009-09-18 Nick Clifton <nickc@redhat.com>
12142
12143 * po/es.po: Updated Spanish translation.
12144
20e6d0d6
DK
121452009-09-17 Doug Kwan <dougkwan@google.com>
12146
12147 * debug.h (DEBUG_RELAXATION): New constant.
12148 (DEBUG_ALL): Add DEBUG_RELAXATION.
12149 (debug_string_to_enum): Add relaxation debug option.
12150 * layout.cc
12151 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12152 Layout::Relaxation_debug_check::read_sections,
12153 Layout::Relaxation_debug_check::read_sections): New method definitions.
12154 (Layout::Layout): Initialize data members
12155 record_output_section_data_from_scrips_,
12156 script_output_section_data_list_ and relaxation_debug_check_.
12157 (Layout::save_segments, Layout::restore_segments,
12158 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12159 Layout::relaxation_loop_body): New method definitions.
12160 (Layout::finalize): Support relaxation. Move section layout code to
12161 Layout::relaxation_loop_body.
12162 (Layout::set_asection_address_from_script): Move code for orphan
12163 section placement out.
12164 (Layout::place_orphan_sections_in_script): New method definition.
12165 * layout.h (Output_segment_headers, Output_file_header):
12166 New forward class declarations.
12167 (Layout::~Layout): Define.
12168 (Layout::new_output_section_data_from_script): New method definition.
12169 (Layout::place_orphan_sections_in_script): New method declaration.
12170 (Layout::Segment_states): New type declaration.
12171 (Layout::save_segments, Layout::restore_segments,
12172 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12173 Layout::relaxation_loop_body): New method declarations.
12174 (Layout::Output_section_data_list): New type declaration.
12175 (Layout::Relaxation_debug_check): New class definition.
12176 (Layout::record_output_section_data_from_script_,
12177 Layout::script_output_section_data_list_, Layout::segment_states_,
12178 Layout::relaxation_debug_check_): New data members.
12179 * output.cc: (Output_section_headers::do_size): New method definition.
12180 (Output_section_headers::Output_section_headers): Move size
12181 computation to Output_section_headers::do_size.
12182 (Output_segment_headers::do_size): New method definition.
e1df38aa 12183 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12184 Output_file_header::do_size and call it.
12185 (Output_file_header::do_size): New method definition.
12186 (Output_data_group::Output_data_group): Adjust call to
12187 Output_section_data.
12188 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12189 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12190 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12191 RELAXED_INPUT_SECTION_CODE.
12192 (Output_section::Output_section): Initialize data member checkpoint_.
12193 (Output_section::~Output_section): Delete checkpoint object pointed
12194 by checkpoint_.
12195 (Output_section::add_input_section): Always add an Input_section if
12196 relaxing.
12197 (Output_section::add_merge_input_section): Add assert.
12198 (Output_section::relax_input_section): New method definition.
12199 (Output_section::set_final_data_size): Set load address to zero for
12200 an unallocated section.
12201 (Output_section::do_address_and_file_offset_have_reset_values):
12202 New method definition.
12203 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12204 Handle relaxed input section.
12205 (Output_section::sort_attached_input_sections): Checkpoint input
12206 section list lazily.
12207 (Output_section::get_input_sections): Change type of input_sections to
12208 list of Simple_input_section pointers. Checkpoint input section list
12209 lazily. Also handle relaxed input sections.
12210 (Output_section::add_input_section_for_script): Take a reference to
12211 a Simple_input_section object instead of Relobj pointer and section
12212 index as parameter. Handle relaxed input sections.
12213 (Output_section::save_states, Output_section::restore_states): New
12214 method definitions.
12215 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12216 (Output_data::is_data_size_fixed): New method definition.
12217 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12218 if it is fixed.
12219 (Output_data::address_and_file_offset_have_reset_values): New method
12220 definition.
12221 (Output_data::do_address_and_file_offset_have_reset_values): New method
12222 definition.
12223 (Output_data::set_data_size): Check that data size is not fixed.
12224 (Output_data::fix_data_size): New method definition.
12225 (Output_data::is_data_size_fixed_): New data member.
12226 (Output_section_headers::set_final_data_size): New method definition.
12227 (Output_section_headers::do_size): New method declaration.
12228 (Output_segment_headers::set_final_data_size): New method definition.
12229 (Output_segment_headers::do_size): New method declaration.
12230 (Output_file_header::set_final_data_size)::New method definition.
12231 (Output_file_header::do_size)::New method declaration.
12232 (Output_section_data::Output_section_data): Add new parameter
12233 is_data_size_fixed and use it to fix data size.
12234 (Output_data_const::Output_data_const): Adjust call to base class
12235 constructor and fix data size.
12236 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12237 base class constructor and fix data size.
12238 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12239 base class constructor and fix data size.
12240 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12241 class constructor and fix data size.
12242 (Output_data_group::set_final_data_size): New method definition.
12243 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12244 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12245 class constructor and fix data size.
12246 (Output_relaxed_input_section): New class definition.
12247 (Output_section::Simple_input_section): New class definition.
12248 (Output_section::get_input_sections): Adjust parameter list.
12249 (Output_section::add_input_section_for_script): Same.
12250 (Output_section::save_states, Output_section::restore_states,
12251 Output_section::do_address_and_file_offset_have_reset_values,
12252 (Output_section::Input_section::Input_section): Handle
12253 RELAXED_INPUT_SECTION_CODE. Add new overload for
12254 Output_relaxed_input_section.
12255 (Output_section::Input_section::is_input_section,
12256 Output_section::Input_section::set_output_section): Handle relaxed
12257 input section.
12258 (Output_section::Input_section::is_relaxed_input_section,
12259 Output_section::Input_section::output_section_data,
12260 Output_section::Input_section::relaxed_input_section): New method
12261 definitions.
12262 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12263 value.
12264 (Output_section::Input_section::u1_): Update comments.
12265 (Output_section::Input_section::u2_): Add new union member poris.
12266 (Output_section::Checkpoint_output_section): New classs definition.
12267 (Output_section::relax_input_section): New method declaration.
12268 (Output_section::checkpoint_): New data member.
12269 (Output_segment): Update comments.
12270 (Output_segment::Output_segment): Un-privatize copy constructor.
12271 (Output_segment::operator=): Un-privatize.
12272 * script-sections.cc (Output_section_element::Input_section_list):
12273 Change element type to Output_section::Simple_input_section.
12274 (Output_section_element_dot_assignment::set_section_addresses):
12275 Register output section data for relaxation clean up.
12276 (Output_data_exression::Output_data_expression): Adjust call to base
12277 constructor to fix data size.
12278 (Output_section_element_data::set_section_addresses): Register
12279 Output_data_expression object for relaxation clean up.
12280 (struct Input_section_info): Replace Relobj pointer and section index
12281 pair with Output_section::Simple_input_section and Convert struct to a
12282 class.
12283 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12284 Input_section_info data member to use accessors.
20e6d0d6
DK
12285 (Output_section_element_input::set_section_addresses): Use layout
12286 parameter. Adjust code to use Output_section::Simple_input_section
12287 and Input_secction_info classes. Register filler for relaxation
12288 clean up.
12289 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12290 and section index pair with Output_section::Simple_input_section
12291 class. Adjust code accordingly.
12292 (Phdrs_element::release_segment): New method definition.
12293 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12294 segment list.
12295 (Script_sections::release_segments): New method definition.
12296 * gold/script-sections.h (Script_sections::release_segments): New
12297 method declaration.
12298 * gold/target.h (Target::may_relax, Target::relax,
12299 Target::do_may_relax, Target::do_relax): New method definitions.
12300
5e445df6
ILT
123012009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12302
12303 * arm.cc (has_signed_unsigned_overflow): New function.
12304 (Arm_relocate_functions::abs8): New function.
12305 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12306 (Target_arm::Scan::global): Likewise.
12307 (Target_arm::relocate::relocate): Likewise.
12308 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12309 Likewise.
12310
8c604651 123112009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12312
12313 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12314 * testsuite/Makefile.in: Regenerate.
12315
1e9cc1c2
NC
123162009-09-11 Nick Clifton <nickc@redhat.com>
12317
12318 * po/gold.pot: Updated by the Translation project.
12319
6a89f575
CC
123202009-09-08 Cary Coutant <ccoutant@google.com>
12321
12322 * output.cc (Output_file::open): Add execute permission to empty file.
12323 * testsuite/Makefile.am (permission_test): New test.
12324 * testsuite/Makefile.in: Regenerate.
12325
fdcac5af
ILT
123262009-09-02 Ian Lance Taylor <iant@google.com>
12327
12328 * output.cc (Output_file::resize): Call map_no_anonymous rather
12329 than map.
12330
44453f85
ILT
123312009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12332
12333 * gold.cc: Include "incremental.h".
12334 (queue_initial_tasks): Call Incremental_checker methods.
12335 * incremental.cc: Include "output.h".
12336 (Incremental_checker::can_incrementally_link_output_file): New
12337 method.
12338 * incremental.h (Incremental_checker): New class.
12339
12340 * output.cc (Output_file::open_for_modification): New method.
12341 (Output_file::map_anonymous): Changed return type to bool. Record
12342 map in base_ field.
12343 (Output_file::map_no_anonymous): New method, broken out of map.
12344 (Output_file::map): Use map_no_anonymous and map_anonymous.
12345 * output.h (class Output_file): Update declarations.
12346
293c1386
CC
123472009-08-24 Cary Coutant <ccoutant@google.com>
12348
12349 * options.h (Command_line::Pre_options): New class.
12350 (Command_line::pre_options): New member.
12351 * options.cc (gold::options::ready_to_register): New variable.
12352 (One_option::register_option): Do nothing if not registering options.
12353 Assert if same short option registered twice.
12354 (General_options::General_options): Turn off option registration when
12355 done constructing.
12356 (Command_line::Pre_options::Pre_options): New constructor.
12357
f773f3d2
CC
123582009-08-24 Cary Coutant <ccoutant@google.com>
12359
06a73cfe
CC
12360 * options.h (General_options::no_keep_memory): Remove incorrect
12361 short option.
f773f3d2 12362
a15af8e2
RW
123632009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12364
12365 * Makefile.am (am__skiplex, am__skipyacc): New.
12366 * Makefile.in: Regenerate.
12367
c462b41b
RW
123682009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12369
14ec8efd
RW
12370 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12371 (INCLUDES): ... this.
12372 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12373 (AM_CPPFLAGS): Renamed from ...
12374 (INCLUDE): ... this.
12375 * Makefile.in, testsuite/Makefile.in: Regenerate.
12376
81ecdfbb
RW
12377 * Makefile.in: Regenerate.
12378 * aclocal.m4: Likewise.
12379 * config.in: Likewise.
12380 * configure: Likewise.
12381 * testsuite/Makefile.in: Likewise.
12382
c462b41b
RW
12383 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12384 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12385 * Makefile.in: Regenerate.
12386 * testsuite/Makefile.in: Regenerate.
12387
2da73f13
CC
123882009-08-19 Cary Coutant <ccoutant@google.com>
12389
12390 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12391 symbols in shared libraries overridden by hidden or internal symbols
12392 in the main program.
12393
2db70501
CD
123942009-08-19 Chris Demetriou <cgd@google.com>
12395
12396 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12397 checking source file names in error messages.
12398
f733487b
DK
123992009-08-18 Doug Kwan <dougkwan@google.com>
12400
12401 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12402 an elcpp::Ehdr as parameter. Adjust call to set_target.
12403 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12404 an elfcpp::Ehdr as parameter.
12405 * object.cc (Object::set_target): Remove the version that looks up
12406 a target and sets it.
12407 (Sized_relobj::setup): Take a Target object instead of
12408 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12409 (make_elf_sized_object): Find target and ask target to
12410 make an ELF object.
12411 * object.h: (Object::set_target): Remove the version that looks up
12412 a target and sets it.
12413 (Sized_relobj::setup): Take a Target object instead of
12414 an elfcpp:Ehdr as parameter.
12415 * target.cc: Include dynobj.h.
12416 (Target::do_make_elf_object_implementation): New.
2e702c99 12417 (Target::do_make_elf_object): New.
f733487b
DK
12418 * target.h (Target::make_elf_object): New template declaration.
12419 (Target::do_make_elf_object): New method declarations.
12420 (Target::do_make_elf_object_implementation): New template declaration.
12421
cc70f101
ILT
124222009-08-14 Ian Lance Taylor <iant@google.com>
12423
12424 * gold.h (FUNCTION_NAME): Define.
12425 (gold_unreachable): Use FUNCTION_NAME.
12426
ef5e0cb1
ST
124272009-08-12 Sriraman Tallam <tmsriram@google.com>
12428
12429 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12430 symbol in the --keep-unique list is not found.
12431
48c187ce
ST
124322009-08-12 Sriraman Tallam <tmsriram@google.com>
12433
12434 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12435 been maked as --keep-unique.
12436 (Icf::unfold_section): New function.
12437 * icf.h (Icf::unfold_section): New function.
12438 * options.h (General_options::keep_unique): New option.
12439 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12440 * testsuite/Makefile.in: Regenerate.
12441 * testsuite/icf_keep_unique_test.sh: New file.
12442 * testsuite/icf_keep_unique_test.cc: New file.
12443
645afe0c
CC
124442009-08-12 Cary Coutant <ccoutant@google.com>
12445
12446 PR 10471
12447 * resolve.cc (Symbol_table::resolve): Check for references from
12448 dynamic objects to hidden and internal symbols.
12449 * testsuite/Makefile.am (hidden_test.sh): New test.
12450 * testsuite/Makefile.in: Regenerate.
12451 * testsuite/hidden_test.sh: New script.
12452 * testsuite/hidden_test_1.c: New test source.
12453 * testsuite/hidden_test_main.c: New test source.
12454
11af873f
DK
124552009-08-11 Doug Kwan <dougkwan@google.com>
12456
12457 * arm.cc: Update comments.
12458 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12459 segment to locate the .ARM.exidx section if present.
12460
b9f7d72d
DK
124612009-08-09 Doug Kwan <dougkwan@google.com>
12462
12463 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12464 patch.
12465
ddd3c53c
ST
124662009-08-07 Sriraman Tallam <tmsriram@google.com>
12467 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12468 compiler warnings.
12469
27721062
ST
124702009-08-06 Sriraman Tallam <tmsriram@google.com>
12471
12472 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12473 valid tls_segment only for non-debug-section relocations.
12474 * testsuite/Makefile.am: Add gc_tls_test.
12475 * testsuite/Makefile.in: Regenerate.
12476 * testsuite/gc_tls_test.cc: New file.
12477 * testsuite/gc_tls_test.sh: New file.
12478
ef15dade 124792009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12480
ef15dade
ST
12481 * icf.cc: New file.
12482 * icf.h: New file.
12483 * Makefile.am (CCFILES): Add icf.cc.
12484 (HFILES): Add icf.h
12485 * Makefile.in: Regenerate.
12486 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12487 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12488 section, symbol and addend information for the relocs.
12489 * gold.cc (queue_middle_tasks): Call identical code folding.
12490 * gold.h: Add defines for multimap.
12491 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12492 to the call of finalize_local_symbols.
12493 * main.cc (main): Create object of class Icf.
12494 * object.cc (Sized_relobj::do_layout): Allow this function to be
12495 called twice during icf.
12496 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12497 to sections marked as identical by icf.
12498 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12499 when available.
12500 (Sized_relobj::do_section_entsize): New function.
12501 * object.h (Object::section_entsize): New function.
12502 (Object::do_section_entsize): New pure virtual function.
12503 (Relobj::finalize_local_symbols): Add new parameter.
12504 (Relobj::do_section_entsize): New function.
12505 * options.h (General_options::icf): New option.
12506 (General_options::icf_iterations): New option.
12507 (General_options::print_icf_sections): New option.
12508 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12509 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12510 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12511 icf.
12512 * symtab.cc (Symbol_table::is_section_folded): New function.
12513 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12514 to sections marked as identical by icf.
12515 * symtab.h (Symbol_table::set_icf): New function.
12516 (Symbol_table::icf): New function.
12517 (Symbol_table::is_section_folded): New function.
12518 (Symbol_table::icf_): New data member.
12519 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12520 * testsuite/Makefile.am: Add commands to build icf_test.
12521 * testsuite/Makefile.in: Regenerate.
12522 * testsuite/icf_test.sh: New file.
12523 * testsuite/icf_test.cc: New file.
12524
c3b65ac4
CD
125252009-07-24 Chris Demetriou <cgd@google.com>
12526
12527 * layout.cc (is_compressible_debug_section): Fix incorrect
12528 comment about compressed section names.
12529
1caf2c51
ILT
125302009-07-20 Ian Lance Taylor <ian@airs.com>
12531
12532 PR 10419
12533 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12534
1ef4d87f
ILT
125352009-07-16 Ian Lance Taylor <iant@google.com>
12536
12537 PR 10400
12538 * layout.h: #include <map>.
12539 (class Kept_section): Change from struct to class. Add accessors
12540 and setters. Add section size to Comdat_group mapping. Change
12541 Comdat_group to std::map. Add is_comdat_ field. Add
12542 linkonce_size field in union.
12543 (class Layout): Update declaration of find_or_add_kept_section.
12544 Don't declare find_kept_object.
12545 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12546 parameter. Add object, shndx, is_comdat, and is_group_name
12547 parameters. Change all callers. Adjust for new Kept_section.
12548 (Layout::find_kept_object): Remove.
12549 * object.cc (Sized_relobj::include_section_group): Update use of
12550 Kept_section. Rename secnum to shndx. Only record
12551 Kept_comdat_section if sections are the same size.
12552 (Sized_relobj::include_linkonce_section): Update use of
12553 Kept_section. Only record Kept_comdat_section if sections are the
12554 same size. Set size of linkonce section.
12555 (Sized_relobj::map_to_kept_section): Update call to
12556 get_kept_comdat_section.
12557 * object.h (class Sized_relobj): Rename fields in
12558 Kept_comdat_section to drop trailing underscores; change object
12559 field to Relobj*. Change Kept_comdat_section_table to store
12560 struct rather than pointer.
12561 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12562 Add kept_object and kept_shndx parameters. Change all callers.
12563 (Sized_relobj::get_kept_comdat_section): Change return type to
12564 bool. Add kept_object and kept_shndx parameters. Change all
12565 callers.
12566 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12567 Layout::find_or_add_kept_section.
12568
37c3b7b0
ILT
125692009-07-09 Ian Lance Taylor <iant@google.com>
12570
12571 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12572 Reserve space in the hash table.
12573
98fa85cb
ILT
125742009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12575
12576 * fileread.cc (File_read::get_mtime): New method.
12577 * fileread.h (Timespec): New structure.
12578 (File_read::get_mtime): New method.
12579 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12580 Renamed from timestamp_nsec.
12581 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12582 Elf_Xword.
e1df38aa 12583 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12584 timestamp_nsec.
e1df38aa 12585 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12586 (Incremental_inputs::report_obejct): Save mtime; style fix.
12587 (Incremental_inputs::report_script): Save mtime; style fix.
12588 (Incremental_inputs::finalize_inputs): Style fix.
12589 (Incremental_inputs::finalize): Style fix.
12590 (Incremental_inputs::create_input_section_data): Store inputs
12591 mtime.
12592 * incremental.h (Incremental_inputs::report_script): Add mtime
12593 argument.
12594 (Incremental_inputs::Input_info::Input_info): Intialize only one
12595 union member.
12596 (Incremental_inputs::Input_info::archive): Move to nameless
12597 union.
12598 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12599 (Incremental_inputs::Input_info::script): Move to nameless union.
12600 (Incremental_inputs::mtime): New field.
12601 * script.cc (read_input_script): Pass file mtime to
12602 Incremental_input.
12603 * script.h (Script_info::inputs): Style fix.
12604
c9d70757
ILT
126052009-07-01 Ian Lance Taylor <ian@airs.com>
12606
12607 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12608 instead of 32.
12609
9c547ec3
ILT
126102009-06-24 Ian Lance Taylor <iant@google.com>
12611
12612 PR 10156
12613 * layout.cc (Layout::choose_output_section): If we find an
12614 existing section, update the flags.
12615 (Layout::create_notes): New function, broken out of
12616 Layout::finalize.
12617 (Layout::finalize): Don't create note sections.
12618 (Layout::create_note): Don't crash if linker script discards
12619 section.
12620 (Layout::create_gold_note): Likewise.
12621 (Layout::create_build_id): Likewise. Don't set
12622 after_input_sections on the section.
12623 (Layout::create_executable_stack_info): Remove target parameter.
12624 Change caller.
12625 * layout.h (class Layout): Declare create_notes. Update
12626 declaration of create_executable_stack_info.
12627 * gold.cc (queue_middle_tasks): Call create_notes.
12628 * output.cc (Output_section::update_flags_for_input_section): Move
12629 here from output.h. If SHF_ALLOC flag is newly set, mark address
12630 invalid.
12631 * output.h (Output_data::mark_address_invalid): New function.
12632 (class Output_section): Only declare, not define,
12633 update_flags_for_input_section. Remove set_flags.
12634
55458500
ILT
126352009-06-24 Ian Lance Taylor <iant@google.com>
12636
12637 * script-sections.cc (Output_section_definition::
12638 set_section_addresses): Rename shadowing local load_address to
12639 laddr.
12640
1307d6cd
ILT
126412009-06-24 Ian Lance Taylor <iant@google.com>
12642
12643 PR 10244
12644 * reloc.cc (relocate_sections): Skip empty relocation sections.
12645
ec3f783e
ILT
126462009-06-23 Ian Lance Taylor <iant@google.com>
12647
12648 PR 10156
12649 * layout.cc (Layout::create_note): Use choose_output_section
12650 rather than make_output_section.
12651
459c9f1c
ILT
126522009-06-23 Ian Lance Taylor <iant@google.com>
12653
12654 PR 10237
12655 * options.cc (General_options::parse_V): Set printed_version_.
12656 (General_options::General_options): Initialize printed_version_.
12657 * options.h (class General_options): Add printed_version_ field.
12658 * gold.cc (queue_initial_tasks): If there are no input files,
12659 don't give a fatal error if we printed the version information.
12660 (queue_middle_tasks): If using -r with a shared object, give a
12661 fatal error rather than an ordinary error.
12662
1518dc8f
ILT
126632009-06-23 Ian Lance Taylor <iant@google.com>
12664
12665 PR 10219
12666 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12667 (Layout::make_output_section): Set have_stabstr_section_ if we see
12668 a .stab*str section.
12669 (Layout::finalize): Call link_stabs_sections.
12670 (Layout::link_stabs_sections): New file.
12671 * layout.h (class Layout): Add have_stabstr_section_ field.
12672 Declare link_stabs_sections.
12673
3d857b98
DK
126742009-06-23 Doug Kwan <dougkwan@google.com>
12675
12676 * Makefile.am (libgold_a_LIBADD): New.
12677 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12678 * Makefile.in: Regenerate.
3d857b98
DK
12679 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12680 * configure: Regenerate.
12681 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12682 * fileread.cc: Include sys/state.h
12683 * gold.h: Declare memmem and strndup if found missing.
12684 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12685
0639a6f6
ILT
126862009-06-23 Ian Lance Taylor <iant@google.com>
12687
12688 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12689 * configure: Rebuild.
12690
8d63875c
ILT
126912009-06-23 Ian Lance Taylor <iant@google.com>
12692
12693 PR 10147
12694 * object.cc (Object::section_contents): Don't try to get a view if
12695 the section has length zero.
12696 (Object::handle_gnu_warning_section): If the section is empty, use
12697 the name of the section as the warning.
12698
f7c8a183
ILT
126992009-06-23 Ian Lance Taylor <iant@google.com>
12700
12701 PR 10133
12702 * stringpool.h (class Stringpool_template): Add optimize_ field.
12703 (Stringpool_template::set_optimize): New function.
12704 * stringpool.cc (Stringpool_template::Stringpool_template):
12705 Initialize optimize_ field.
12706 (Stringpool_template::set_string_offsets): Test local optimize
12707 fild rather than parameter.
12708 * layout.cc (Layout::Layout): Call set_optimize on the section
12709 name stringpool.
12710
e6a307ba
ILT
127112009-06-22 Ian Lance Taylor <iant@google.com>
12712
12713 PR 10030
12714 * yyscript.y: Parse TARGET.
12715 * script.cc (script_set_target): New function.
12716 * script-c.h (script_set_target): Declare.
12717 * options.cc (General_options::string_to_object_format): Rename
12718 from string_to_object_format in anonymous namespace. Change
12719 callers.
12720 * options.h (class General_options): Declare
12721 string_to_object_format.
12722
3ee173de
ILT
127232009-06-22 Ian Lance Taylor <iant@google.com>
12724
12725 * script-sections.cc (Script_sections::create_segments): Don't put
12726 program headers in a PT_LOAD segment if -n or -N.
12727
127282009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
12729
12730 PR 10141
12731 * options.h (class General_options): Add -z lazy and -z now. Sort
12732 -z options into alphabetical order.
12733 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12734
cd6739a1 127352009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
12736
12737 * layout.cc (Layout::make_output_section): Call
12738 Target::new_output_section.
12739 (Layout::attach_allocated_section_to_segment): Put large section
12740 sections in a separate load segment with the large segment flag
12741 set.
12742 (Layout::segment_precedes): Sort large data segments after other
12743 load segments.
12744 (align_file_offset): New static function.
12745 (Layout::set_segment_offsets): Use align_file_offset.
12746 * output.h (class Output_section): Add is_small_section_ and
12747 is_large_section_ fields.
12748 (Output_section::is_small_section): New function.
12749 (Output_section::set_is_small_section): New function.
12750 (Output_section::is_large_section): New function.
12751 (Output_section::set_is_large_section): New function.
12752 (Output_section::is_large_data_section): New function.
12753 (class Output_segment): Add is_large_data_segment_ field.
12754 (Output_segment::is_large_data_segment): New function.
12755 (Output_segment::set_is_large_data_segment): New function.
12756 * output.cc (Output_section::Output_section): Initialize new
12757 fields.
12758 (Output_segment::Output_segment): Likewise.
12759 (Output_segment::add_output_section): Add assertion that large
12760 data sections always go in large data segments. Force small data
12761 sections to the end of the list of data sections. Force small BSS
12762 sections to the start of the list of BSS sections. For large BSS
12763 sections to the end of the list of BSS sections.
12764 * symtab.h (class Symbol): Declare is_common_shndx.
12765 (Symbol::is_defined): Check Symbol::is_common_shndx.
12766 (Symbol::is_common): Likewise.
12767 (class Symbol_table): Define enum Commons_section_type. Update
12768 declarations. Add small_commons_ and large_commons_ fields.
12769 * symtab.cc (Symbol::is_common_shndx): New function.
12770 (Symbol_table::Symbol_table): Initialize new fields.
12771 (Symbol_table::add_from_object): Put small and large common
12772 symbols in the right list.
12773 (Symbol_table::sized_finalized_symbol): Check
12774 Symbol::is_common_shndx.
12775 (Symbol_table::sized_write_globals): Likewise.
12776 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12777 common symbol lists. Don't call do_allocate_commons_list if the
12778 list is empty.
12779 (Symbol_table::do_allocate_commons_list): Remove is_tls
12780 parameter. Add comons_section_type parameter. Change all
12781 callers. Handle small and large common symbols.
12782 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12783 Symbol::is_common_shndx.
12784 * resolve.cc (symbol_to_bits): Likewise.
12785 * target.h (Target::small_common_shndx): New function.
12786 (Target::small_common_section_flags): New function.
12787 (Target::large_common_shndx): New function.
12788 (Target::large_common_section_flags): New function.
12789 (Target::new_output_section): New function.
12790 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12791 small_common_section_flags, and large_common_section_flags
12792 fields.
12793 (Target::do_new_output_section): New virtual function.
12794 * arm.cc (Target_arm::arm_info): Initialize new fields.
12795 * i386.cc (Target_i386::i386_info): Likewise.
12796 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12797 Likewise.
12798 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12799 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12800 (Target_x86_64::do_new_output_section): New function.
12801 * configure.ac: Define conditional MCMODEL_MEDIUM.
12802 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12803 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12804 (large_LDFLAGS): Define.
12805 * testsuite/large.c: New file.
12806 * testsuite/testfile.cc (Target_test::test_target_info):
12807 Initialize new fields.
12808 * configure, testsuite/Makefile.in: Rebuild.
12809
bb04269c
DK
128102009-06-05 Doug Kwan <dougkwan@google.com>
12811
12812 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 12813 * Makefile.in: Regenerate.
bb04269c
DK
12814 * i386.cc (class Target_i386): Define new virtual method to
12815 override do_is_local_label_name in parent.
12816 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12817 local symbols if --discard-locals or -X is given.
12818 * options.h (class General_options): Declare new options
12819 '--discard-locals' and '-X' for discarding locals.
12820 * target.h (class Target): Define new methods is_local_label_name.
12821 Declare new virtual method do_is_local_label_name.
12822 * target.cc: New file.
12823 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12824 (check_SCRIPTS): Add discard_locals_test.sh.
12825 (check_DATA): Add discard_local_tests.syms.
12826 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12827 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12828 * testsuite/Makefile.in: Regenerate.
12829 * testsuite/discard_locals_test.c: New file.
12830 * testsuite/discard_locals_test.sh: Same.
12831
805bb01c
DK
128322009-06-05 Doug Kwan <dougkwan@google.com>
12833
12834 * object.cc (Sized_relobj::Sized_relobj): Initialize
12835 discarded_eh_frame_shndx_ to -1U.
12836 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12837 section.
12838 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12839 a discarded .eh_frame section.
12840 (Sized_relobj::do_finalize_local_symbols): Ditto.
12841 * object.h (class Sized_relobj): Declare new member
12842 discarded_eh_frame_shndx_.
12843 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12844 (local_labels_test.o, local_labels_test): New rules.
12845 * testsuite/Makefile.in: Regenerate.
12846
1dcd334d
DK
128472009-06-04 Doug Kwan <dougkwan@google.com>
12848
12849 * layout.cc (Layout::section_name_mapping): Add mapping for
12850 special ARM sections.
12851
96d49306
DK
128522009-06-03 Doug Kwan <dougkwan@google.com>
12853
12854 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12855 (utils::has_overflow): Same.
12856
dff16297
ILT
128572009-06-03 Ian Lance Taylor <iant@google.com>
12858
12859 * layout.cc (Layout::section_name_mapping): New array, replacing
12860 Layout::linkonce_mapping.
12861 (Layout::section_name_mapping_count): New variable, replacing
12862 Layout::linkonce_mapping_count.
12863 (Layout::linkonce_output_name): Remove.
12864 (Layout::output_section_name): Rewrite.
12865 * layout.h (class Layout): Rename Linkonce_mapping to
12866 Section_name_mapping, linkonce_mapping to section_name_mapping,
12867 linkonce_mapping_count to section_name_mapping_count. Don't
12868 declare linkonce_output_name.
12869
c121c671
DK
128702009-06-03 Doug Kwan <dougkwan@google.com>
12871
12872 * gold/arm.cc (namespace utils): New.
12873 (Target_arm::reloc_is_non_pic): Define new method.
12874 (class Arm_relocate_functions): New.
12875 (Target_arm::Relocate::relocate): Handle relocation types used by
12876 Android.
12877
07800fab
ILT
128782009-06-03 Ian Lance Taylor <iant@google.com>
12879
12880 * arm.cc (Target_arm::scan::global): Use || instead of |.
12881
c121c671
DK
128822009-06-02 Doug Kwan <dougkwan@google.com>
12883
12884 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
12885 issued_non_pic_error_.
12886 (class Target_arm::Scan): Declare new method check_non_pic.
12887 Define new method symbol_needs_plt_entry.
12888 Declare new data member issued_non_pic_error_.
12889 (class Target_arm::Relocate): Declare new method
12890 should_apply_static_reloc.
12891 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
12892 (Target_arm::Scan::check_non_pic): Define new method.
12893 (Target_arm::Scan::local): Handle a small subset of reloc types used
12894 by Android.
12895 (Target_arm::Scan::local): Same.
12896 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
12897
b19b0c6d
ILT
128982009-05-31 Mikolaj Zalewski <mikolajz@google.com>
12899
12900 * incremental.cc (Incremental_inputs::report_command_line): Filter
12901 out --incremental-* options.
12902
94cdfcff
DK
129032009-05-29 Doug Kwan <dougkwan@google.com>
12904
12905 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
12906 template class.
12907 (class Target_arm): Update comment.
12908 (Target_arm::Target_arm): Initialize new data members GOT_,
12909 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
12910 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
12911 and Target_arm::rel_dyn_section.
12912 Declare new_enum Target_arm::Got_type.
12913 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
12914 and DYNBSS_.
12915 Update commments for member do_dynsym_value.
12916 (Target_arm::got_size, Target_arm::plt_section,
12917 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
12918 new methods inside class defintion.
12919 (Target_arm::got_section): Define new method.
12920 (Target_arm::rel_dyn_section): Same.
12921 (Output_data_plt_arm): New template class.
12922 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
12923 (Output_data_plt_arm:do_adjust_output_section): Define new method.
12924 (Output_data_plt_arm::add_entry): Same.
12925 (Output_data_plt_arm::first_plt_entry): Define new
12926 static data member for PLT instruction template.
12927 (Output_data_plt_arm::plt_entry): Same.
12928 (Output_data_plt_arm::do_write): Define new method.
12929 (Target_arm::make_plt_entry): Same.
12930 (Target_arm::do_finalize_sections): Same.
12931 (Target_arm::do_dynsym_value): Same.
12932
4a657b0d
DK
129332009-05-28 Doug Kwan <dougkwan@google.com>
12934
12935 * Makefile.am (TARGETSOURCES): Add arm.cc.
12936 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
12937 * Makefile.in: Regenerate.
12938 * arm.cc: New file.
12939 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
12940
e7ae8c36
DK
129412009-05-26 Doug Kwan <dougkwan@google.com>
12942
12943 * options.cc (General_options::parse_exclude_libs). Fix a comment.
12944 (General_options::check_excluded_libs): Strip off directories in
12945 archive name before matching like GNU ld does.
12946 * testsuite/Makefile.am (MOSTLYCLEANFILES,
12947 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
12948 (exclude_libs_test_LDFLAGS): Add linker option
12949 -Wl,--exclude-libs,libexclude_libs_test_3
12950 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
12951 an explicit archive without using -l.
12952 (alt/libexclude_libs_test_3.a): New make rule.
12953 * testsuite/Makefile.in: Regenerate.
12954 * testsuite/exclude_libs_test.c : Declare lib3_default().
12955 (main): Call it.
12956 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
12957 * exclude_libs_test_3.c: New file.
12958
f12e7348
NC
129592009-05-26 Nick Clifton <nickc@redhat.com>
12960
12961 * po/id.po: New Indonesian translation.
12962 * po/gold.pot: Updated template file.
12963
4daadc0d
ST
129642009-05-22 Sriraman Tallam <tmsriram@google.com>
12965
e1df38aa 12966 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
12967 gc_comdat_test files. Add -Wl,--gc-sections to build
12968 gc_comdat_test.
12969 * testsuite/Makefile.in: Regenerate.
12970 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
12971
531813ad
ST
129722009-05-21 Sriraman Tallam <tmsriram@google.com>
12973
12974 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
12975 kept comdat section was garbage collected.
12976 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
12977 * testsuite/Makefile.in: Regenerate.
12978 * testsuite/gc_comdat_test.sh: New file.
12979 * testsuite/gc_comdat_test_1.cc: New file.
12980 * testsuite/gc_comdat_test_2.cc: New file.
12981
65514900
CC
129822009-05-19 Doug Kwan <dougkwan@google.com>
12983
12984 * archive.cc (Archive::Archive): Move constructor from archive.h
12985 to here. Initialize no_export_.
12986 (Archive::get_elf_object_for_member): Set no_export flag of object.
12987 * archive.h (Archive::Archive): Move constructor body to
12988 archive.cc.
12989 (Archive::no_export): New method.
12990 (Archive::no_export_): New field.
12991 * object.h (Object::Object): Initialize no_export_ to false.
12992 (Object::no_export, Object::set_no_export): New methods.
12993 (Object::no_export_): New field.
12994 * options.cc (General_options::parse_exclude_libs): New method.
12995 (General_options::check_excluded_libs) Same.
12996 * options.h (exclude_libs): New option.
12997 (General_options::check_excluded_libs): New method declaration.
12998 (General_options::excluded_libs_): New field.
12999 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13000 default or protected visibility if an object has no-export flag set.
13001 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13002 (check_SCRIPTS): Add exclude_libs_test.sh.
13003 (check_DATA): Add exclude_libs_test.syms.
13004 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13005 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13006 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13007 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13008 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13009 libexclude_libs_test_2.a): New rules.
13010 * testsuite/Makefile.in: Regenerate.
13011 * testsuite/exclude_libs_test.c: New file.
13012 * testsuite/exclude_libs_test.sh: Ditto.
13013 * testsuite/exclude_libs_test_1.c: Ditto.
13014 * testsuite/exclude_libs_test_2.c: Ditto.
13015
1b77ea50
ILT
130162009-05-15 Ian Lance Taylor <iant@google.com>
13017
13018 * configure.ac: Check for declarations for cases where libiberty.h
13019 checks HAVE_DECL_xxx.
13020 * configure, config.in: Rebuild.
13021
072fe7ce
ILT
130222009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13023
13024 * gold.h (Incremental_argument_list): Remove (invalid) forward
13025 declaration.
13026 * incremental.cc (Incremental_inputs::report_achive): New method.
13027 (Incremental_inputs::report_object): New method.
13028 (Incremental_inputs::report_script): New method.
13029 (Incremental_inputs::finalize_inputs): New method.
13030 (Incremental_inputs::finalize): Call finalize_inputs().
13031 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13032 Create inputs entries.
13033 * incremental.h (Incremental_input_type): New enum.
13034 (Incremental_inputs::Incremental_input): Initialize new fields.
13035 (Incremental_inputs::report_inputs): New method.
13036 (Incremental_inputs::report_achive): New method.
13037 (Incremental_inputs::report_object): New method.
13038 (Incremental_inputs::report_script): New method.
13039 (Incremental_inputs::finalize_inputs): New method.
13040 (Incremental_inputs::Input_info): New struct.
13041 (Incremental_inputs::Input_info_map): New typedef.
13042 (Incremental_inputs::lock_): New field.
13043 (Incremental_inputs::Inputs_): New field.
13044 (Incremental_inputs::Inputs_map): New field.
13045 * main.cc (main): Call Incremental_input::report_inputs.
13046 * options.h (Input_argument_list): Typedef moved from
13047 Input_arguments.
13048 (Input_file_group::Files): Remove, use ::Input_argument_list.
13049 (Input_file_group::Input_argument_list): Remove, use
13050 ::Input_argument_list.
13051 * plugin.cc (Plugin_manager::add_input_file): Add error in
13052 incremental build.
13053 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13054 functions.
13055 * script.cc (read_input_script): Call
13056 Incremental_input::report_script.
13057 * script.h (Script_info): New class.
13058
b0481b0b
ILT
130592009-04-27 Ian Lance Taylor <iant@google.com>
13060
13061 * x86_64.cc (do_adjust_output_section): Set entsize to
13062 plt_entry_size.
13063
b22a5a41 130642009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13065
13066 * output.cc (Output_file::close): After short writes, continue
13067 writing from the correct offset in the buffer being written.
13068
40fde488
CD
130692009-04-23 Chris Demetriou <cgd@google.com>
13070
13071 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13072 * configure: Regenerate.
13073 * config.in: Regenerate.
13074 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13075 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13076
3ce2c28e
ILT
130772009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13078
13079 * incremental.cc (Incremental_inputs_header_data): Renamed from
13080 Incremental_input_header_data.
13081 (Incremental_inputs_header_data::data_size): New field.
13082 (Incremental_inputs_header_data::put_input_file_count): Renamed
13083 from input_file_count.
13084 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13085 from command_line_offset.
13086 (Incremental_inputs_header_data::put_reserved): Renamed from
13087 put_reserved.
13088 (Incremental_inputs_entry_data): Renamed from
13089 Incremental_input_entry_data.
13090 (Incremental_inputs_entry_data::data_size): New field.
13091 (Incremental_inputs::report_command_line): New method.
13092 (Incremental_inputs::finalize): New method.
13093 (Incremental_inputs::create_incremental_inputs_data): New method.
13094 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13095 * incremental.h: New file.
13096 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13097 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13098 incremental builds.
703d02da 13099 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13100 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13101 (Layout::create_incremental_info_sections): New method.
13102 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13103 * main.cc (main): Notify Incremental_input of the command line.
13104
e55bde5e
ILT
131052009-04-01 Ian Lance Taylor <iant@google.com>
13106 Mikolaj Zalewski <mikolajz@google.com>
13107
13108 * gold.h (reserve_unordered_map): Define, three versions, one for
13109 each version of Unordered_map.
13110 * layout.cc (Layout::Layout): Remove options parameter. Add
13111 number_of_input_files parameter. Don't initialize options_.
13112 Initialize number_of_input_files_ and resized_signatures_. Move
13113 sections_are_attached_.
13114 (Layout::layout_group): Reserve space for group_signatures_.
13115 (Layout::find_or_add_kept_section): Change name parameter to be a
13116 reference. Resize signatures_ map when it gets large enough.
13117 (Layout::layout_eh_frame): Use parameters->options() instead of
13118 this->options_.
13119 (Layout::make_output_section): Likewise.
13120 (Layout::attach_allocated_section_to_segment): Likewise.
13121 (Layout::finalize, Layout::create_executable_stack): Likewise.
13122 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13123 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13124 * layout.h (class Layout): Update declarations. Remove options_
13125 field. Add number_of_input_files_ and resized_signatures_
13126 fields. Move sections_are_attached_ field.
13127 * main.cc (main): Pass number of input files to Layout
13128 constructor. Don't pass options.
13129
154b857c
ILT
131302009-03-30 Ian Lance Taylor <iant@google.com>
13131
13132 * ffsll.c (ffsll): Correct implementation.
13133
2f35ab9b
ILT
131342009-03-27 Ian Lance Taylor <iant@google.com>
13135
fd03461a
ILT
13136 * ffsll.c: New file.
13137 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13138 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13139 * ftruncate.c (ftruncate): Declare before definition.
13140 * mremap.c (mremap): Likewise.
13141 * pread.c (pread): Likewise.
13142 * configure, Makefile.in, config.in: Rebuild.
13143
2f35ab9b
ILT
13144 * mremap.c: New file.
13145 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13146 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13147 (mremap): Declare if HAVE_MREMAP is not defined.
13148 * configure, Makefile.in, config.in: Rebuild.
13149
33aea2fd
CC
131502009-03-27 Cary Coutant <ccoutant@google.com>
13151
13152 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13153 position independent.
13154 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13155 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13156
6d479619
CC
131572009-03-24 Cary Coutant <ccoutant@google.com>
13158
13159 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13160 an executable.
13161 (needs_dynamic_reloc): Likewise.
13162
afc06bb8
ILT
131632009-03-24 Ian Lance Taylor <iant@google.com>
13164
13165 * yyscript.y (file_cmd): Recognize EXTERN.
13166 (extern_name_list, extern_name_list_body): New nonterminals.
13167 * script.cc (script_add_extern): Define.
13168 * script-c.h (script_add_extern): Declare.
13169
f6060a4d
ILT
131702009-03-24 Rafael Avila de Espindola <espindola@google.com>
13171
13172 * object.cc (is_elf_object): Define.
13173 * object.h (is_elf_object): Declare.
13174 * archive.cc (Archive::get_elf_object_for_member): Call
13175 is_elf_object.
33aea2fd 13176 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13177
26736d8e
ILT
131782009-03-24 Elliott Hughes <enh@google.com>
13179
13180 * output.cc (Output_file::map_anonymous): Define.
13181 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13182 try an anonymous one. Report the size if the mmap fails.
13183 * output.h (class Output_file): Declare map_anonymous.
13184
22fd9730
ILT
131852009-03-24 Ian Lance Taylor <iant@google.com>
13186
13187 * target-select.cc (instantiate_target): Don't acquire the lock if
13188 the instantiated_target_ field has already been set.
13189
cb010894
ILT
131902009-03-23 Ian Lance Taylor <iant@google.com>
13191
7f055c20
ILT
13192 * gold-threads.h (class Initialize_lock): Define.
13193 * gold-threads.cc (class Initialize_lock_once): Define.
13194 (initialize_lock_control): New static variable.
13195 (initialize_lock_pointer): New static variable.
13196 (initialize_lock_once): New static function.
13197 (Initialize_lock::Initialize_lock): Define.
13198 (Initialize_lock::initialize): Define.
13199 * target-select.h: Include "gold-threads.h".
13200 (class Target_selector): Add lock_ and initialize_lock_ fields.
13201 Don't define instantiate_target, just declare it.
13202 * target-select.cc (Target_selector::Target_selector): Initialize
13203 new fields.
13204 (Target_selector::instantiate_target): Define.
13205 * descriptors.h: Include "gold-threads.h".
13206 (class Descriptors): Add initialize_lock_ field.
13207 * descriptors.cc (Descriptors::Descriptors): Initialize new
13208 field.
13209 (Descriptors::open): Use initialize_lock_ field
13210 * errors.h (class Errors): Add initialize_lock_ field.
13211 * errors.cc (Errors::Errors): Initialize new field.
13212 (Errors::initialize_lock): Use initialize_lock_ field.
13213 * powerpc.cc (class Target_selector_powerpc): Remove
13214 instantiated_target_ field. In do_recognize call
13215 instantiate_target rather than do_instantiate_target. In
13216 do_instantiate_target just allocate a new target.
13217 * sparc.cc (class Target_selector_sparc): Likewise.
13218
36959681
ILT
13219 * freebsd.h: New file.
13220 * i386.cc: Include "freebsd.h".
13221 (Target_i386): Derive from Target_freebsd rather than
13222 Sized_target.
13223 (Target_selector_i386): Derive from Target_selector_freebsd rather
13224 than Target_selector.
13225 * x86_64.cc: Include "freebsd.h".
13226 (Target_x86_64): Derive from Target_freebsd rather than
13227 Sized_target.
13228 (Target_selector_x86_64): Derive from Target_selector_freebsd
13229 rather than Target_selector.
13230 * target.h (class Target): Add adjust_elf_header and
13231 do_adjust_elf_header.
13232 * output.cc (Output_file_header:: do_sized_write): Call target
13233 adjust_elf_header routine.
13234 * configure.tgt: Set targ_osabi.
13235 * configure.ac: Define GOLD_DEFAULT_OSABI.
13236 * parameters.cc (Parameters::default_target): Pass
13237 GOLD_DEFAULT_OSABI to select_target.
13238 * target-select.h (class Target_selector): Make instantiate_target
13239 protected rather than private.
13240 * Makefile.am (HFILES): Add freebsd.h.
13241 * configure, Makefile.in, config.in: Rebuild.
13242
cb010894
ILT
13243 * merge.cc (do_add_input_section): Correct pend value. Change
13244 message about last entry not being null terminated from error to
13245 warning.
13246
0e879927
ILT
132472009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13248
13249 * incremental.cc: New file.
13250 * Makefile.am (CCFILES): Add incremental.cc.
13251 * Makefile.in: Rebuild.
13252
41105937
PP
132532009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13254
13255 * layout.cc (Layout::output_section_name): Preserve names
13256 of '.note.' sections.
e1df38aa 13257
60439920
ILT
132582009-03-19 Ian Lance Taylor <iant@google.com>
13259
13260 * descriptors.cc (Descriptors::open): Check that the options are
13261 valid before using them.
13262
0d371ad3
ILT
132632009-03-18 Ian Lance Taylor <iant@google.com>
13264
13265 * script-sections.h: Include <list>.
13266 (class Script_sections): Change Sections_elements from std::vector
13267 to std::list. Typedef public Elements_iterator. Add
13268 orphan_section_placement_, data_segment_align_start_, and
13269 saw_data_segment_align_ fields. Remove data_segment_align_index_
13270 field.
13271 * script-sections.cc (class Orphan_section_placement): New class.
13272 (class Sections_element): Add virtual functions is_relro and
13273 orphan_section_init. Remove virtual function place_orphan_here.
13274 (class Output_section_definition): Add is_relro and
13275 orphan_section_init. Remove place_orphan_here.
13276 (class Orphan_output_section): Likewise.
13277 (Script_sections::Script_sections): Update for field changes.
13278 (Script_sections::data_segment_align): Set saw_data_segment_align_
13279 and data_segment_align_start_, not data_segment_align_index.
13280 (Script_sections::data_segment_relro_end): Check
13281 saw_data_segment_align_. Use data_segment_align_start_ rather
13282 than data_segment_align_index_.
13283 (Script_sections::place_orphan): Rewrite to use
13284 Orphan_section_placement.
13285
9201d894
ILT
132862009-03-17 Ian Lance Taylor <iant@google.com>
13287
9c5b8369
ILT
13288 * archive.cc (Archive::add_symbols): Check for a version attached
13289 to the symbol name in the archive map.
13290 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13291 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13292 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13293 (ver_test_11.a): New target.
13294 * testsuite/Makefile.in: Rebuild.
13295
9201d894
ILT
13296 * configure.ac: Check for chsize and posix_fallocate. Replace
13297 ftruncate.
13298 * ftruncate.c: New file, from gnulib.
13299 * output.cc (posix_fallocate): Define dummy version if not
13300 HAVE_POSIX_FALLOCATE.
13301 (Output_file::map): Call posix_fallocate rather than lseek and
13302 write.
13303 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13304 * configure, Makefile.in, config.in: Rebuild.
13305
ef4ab7a8 133062009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13307
ef4ab7a8
PP
13308 * layout.h (Layout::create_note): Add section_name parameter.
13309 * layout.cc (Layout::create_note): Likewise.
13310 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13311
8c500701
ILT
133122009-03-17 Ian Lance Taylor <iant@google.com>
13313
e85b18e1
ILT
13314 * descriptors.cc: Include "options.h".
13315 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13316 (Descriptors::open): Always use O_CLOEXEC when opening a new
13317 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13318 then set FD_CLOEXEC.
13319
9efe6174
ILT
13320 * sparc.cc (class Target_sparc): Add has_got_section.
13321 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13322 make sure we have a GOT section.
13323
13324 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13325 (Target_sparc::Scan::local): Likewise.
13326 (Target_sparc::Scan::global): Likewise.
13327 (Target_sparc::Relocate::relocate): Likewise.
13328 (Target_sparc::Relocate::relocate_tls): Likewise.
13329
8c500701
ILT
13330 * symtab.cc (Symbol_table::define_default_version): New function,
13331 broken out of add_from_object.
13332 (Symbol_table::add_from_object): Call define_default_version.
13333 (Symbol_table::define_special_symbol): Add resolve_oldsym
13334 parameter. Change all callers. If the version for a symbol comes
13335 from a version script, resolve it with the symbol with the same
13336 name with no version. Also add the symbol without a version if
13337 appropriate.
13338 (do_define_in_output_data): If resolving with oldsym, don't delete
13339 sym.
13340 (do_define_in_output_segment): Likewise.
13341 (do_define_as_constant): Likewise.
13342 * symtab.h (class Symbol_table): Update declarations.
13343
f1ed28fb
ILT
133442009-03-13 Ian Lance Taylor <iant@google.com>
13345
15f8229b
ILT
13346 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13347 (Read_symbols::requeue): New function.
13348 (Read_symbols::do_read_symbols): If make_elf_object fails because
13349 the target type is not configured, and the file was searched for,
13350 issue a warning and retry with the next directory.
13351 (Add_symbols::run): If the file has an incompatible format, and
13352 it was searched for, requeue the Read_symbols task. On error,
13353 release the object.
13354 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13355 dirindex parameter to constructor. Change all callers. Declare
13356 incompatible_warning and requeue.
13357 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13358 input_argument_ and input_group_ fields. Add them to
13359 constructor. Change all callers.
13360 (class Read_script): Add dirindex_ field. Add it to constructor.
13361 Change all callers.
13362 * archive.cc (Archive::setup): Remove input_objects parameter.
13363 Change all callers.
13364 (Archive::get_file_and_offset): Likewise.
13365 (Archive::read_all_symbols): Likewise.
13366 (Archive::read_symbols): Likewise.
13367 (Archive::get_elf_object_for_member): Remove input_objects
13368 parameter. Add punconfigured parameter. Change all callers.
13369 (Archive::add_symbols): Change return type to bool. Check return
13370 value of include_member.
13371 (Archive::include_all_members): Likewise.
13372 (Archive::include_member): Change return type to bool. Return
13373 false if first included object has incompatible target. Set
13374 included_member_ field.
13375 (Add_archive_symbols::run): If add_symbols returns false, requeue
13376 Read_symbols task.
13377 * archive.h (class Archive): Add included_member_ field.
13378 Initialize it in constructor. Add input_file and searched_for
13379 methods. Update declarations.
13380 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13381 input_argument_ fields. Add them to constructor. Change all
13382 callers.
13383 * script.cc: Include "target-select.h".
13384 (class Parser_closure): Add skip_on_incompatible_target_ and
13385 found_incompatible_target_ fields. Add
13386 skip_on_incompatible_target parameter to constructor. Change all
13387 callers. Add methods skip_on_incompatible_target,
13388 clear_skip_on_incompatible_target, found_incompatible_target, and
13389 set_found_incompatible_target.
13390 (read_input_script): Add dirindex parameter. Change all callers.
13391 If parser finds an incompatible target, requeue Read_symbols
13392 task.
13393 (script_set_symbol): Clear skip_on_incompatible_target in
13394 closure.
13395 (script_add_assertion, script_parse_option): Likewise.
13396 (script_start_sections, script_add_phdr): Likewise.
13397 (script_check_output_format): New function.
13398 * script.h (read_input_script): Update declaration.
13399 * script-c.h (script_check_output_format): Declare.
13400 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13401 (ignore_cmd): Remove OUTPUT_FORMAT.
13402 * fileread.cc (Input_file::Input_file): Add explicit this.
13403 (Input_file::will_search_for): New function.
13404 (Input_file::open): Add pindex parameter. Change all callers.
13405 * fileread.h (class Input_file): Add input_file_argument method.
13406 Declare will_search_for. Update declarations.
13407 * object.cc (make_elf_object): Add punconfigured parameter.
13408 Change all callers.
13409 * object.h (class Object): Make input_file public. Add
13410 searched_for method.
13411 (make_elf_object): Update declaration.
13412 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13413 restart search.
13414 * dirsearch.h (class Dirsearch): Update declaration.
13415 * options.h (class General_options): Add --warn-search-mismatch.
13416 * parameters.cc (Parameters::is_compatible_target): New function.
13417 * parameters.h (class Parameters): Declare is_compatible_target.
13418 * workqueue.cc (Workqueue::add_blocker): New function.
13419 * workqueue.h (class Workqueue): Declare add_blocker.
13420
f1ed28fb
ILT
13421 * fileread.cc (Input_file::open): Remove options parameter.
13422 Change all callers.
13423 (Input_file::open_binary): Likewise.
13424 * script.cc (read_input_script): Likewise.
13425 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13426 options parameter from constructor. Change all callers.
13427 (class Read_script): Likewise.
13428 * fileread.h (class Input_file): Update declarations.
13429 * script.h (read_input_script): Update declaration.
13430
34dd024a
NC
134312009-03-10 Nick Clifton <nickc@redhat.com>
13432
13433 * po/es.po: New Spanish translation.
13434
6d71b17c
CC
134352009-03-06 Cary Coutant <ccoutant@google.com>
13436
13437 * options.cc (parse_short_option): Keep dash_z from registering itself.
13438
031cdbed
ILT
134392009-03-03 Ian Lance Taylor <iant@google.com>
13440
13441 PR 9918
13442 * target-reloc.h (relocate_section): Pass output_section to
13443 relocate.
13444 * i386.cc (Target_i386::should_apply_static_reloc): Add
13445 output_section parameter. Change all callers.
13446 (Target_i386::Relocate::relocate): Add output_section parameter.
13447 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13448 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13449 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13450 * testsuite/two_file_shared.sh: New script.
13451 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13452 (check_DATA): Add two_file_shared.dbg.
13453 (two_file_shared.dbg): New target.
13454 * testsuite/Makefile.in: Rebuild.
13455
15d5fa16
ILT
134562009-03-01 Ian Lance Taylor <iant@google.com>
13457
13458 * configure.ac: Check for byteswap.h.
13459 * configure: Rebuild.
13460 * config.in: Rebuild.
13461
8a4c0b0d
ILT
134622009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13463
13464 * layout.cc (Layout::find_or_add_kept_section): New function.
13465 (Layout::add_comdat): Removed.
13466 * layout.h (struct Kept_section): Move out of class Layout.
13467 Remove trailing underscores from field names. Add group_sections
13468 field. Rename group_ field to is_group. Change all uses.
13469 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13470 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13471 comdat_groups_ field.
13472 (Sized_relobj::include_section_group): Use
13473 find_or_add_kept_section and Kept_section::group_sections.
13474 (Sized_relobj::include_linkonce_section): Likewise.
13475 * object.cc (class Sized_relobj): Don't define Comdat_group or
13476 Comdat_group_table. Remove find_comdat_group and
13477 add_comdat_group. Remove comdat_groups_ field.
13478 * plugin.cc (include_comdat_group): Use
13479 Layout::find_or_add_kept_section.
13480
b4ecf66b
ILT
134812009-02-28 Ian Lance Taylor <iant@google.com>
13482
14359ca0
ILT
13483 * README: --gc-sections and map files are now supported. Document
13484 some build requirements.
13485
b4ecf66b
ILT
13486 PR 6992
13487 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13488 relocatable link set the value of the section symbol to zero.
13489 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13490 relocatable link don't include the section address in the local
13491 symbol value.
13492
0602e05a
ILT
134932009-02-27 Ian Lance Taylor <iant@google.com>
13494
fd9d194f
ILT
13495 PR 6811
13496 * options.h (class Search_directory): Add is_system_directory.
13497 (class General_options): Declare is_in_system_directory.
13498 * options.cc (get_relative_sysroot): Make static.
13499 (get_default_sysroot): Make static.
13500 (General_optoins::is_in_system_directory): New function.
13501 * fileread.cc (Input_file::is_in_system_directory): New function.
13502 * fileread.h (class Input_file): Declare is_in_system_directory.
13503 * object.h (class Object): Add is_in_system_directory.
13504 (class Input_objects): Remove system_library_directory_ field.
13505 * object.cc (Input_objects::add_object): Don't set
13506 system_library_directory_.
13507 (input_objects::found_in_system_library_directory): Remove.
13508 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13509 parameter. Change all callers.
13510 (Symbol_table::sized_write_globals): Likewise.
13511 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13512 Call Object::is_in_system_directory.
13513 * symtab.h (class Symbol_table): Update declarations.
13514
61edd21f
ILT
13515 PR 5990
13516 * descriptors.h (Open_descriptor): Add is_on_stack field.
13517 * descriptors.cc (Descriptors::open): If the descriptor is on the
13518 top of the stack, remove it. Initialize is_on_stack field.
13519 (Descriptors::release): Only add pod to stack if it is not on the
13520 stack already.
13521 (Descriptors::close_some_descriptor): Clear stack_next and
13522 is_on_stack fields.
13523
e29e076a
ILT
13524 PR 7091
13525 * output.cc (Output_section::find_starting_output_address): Rename
13526 from starting_output_address; add PADDR parameter; change return
13527 type.
13528 * output.h (class Output_section): Declare
13529 find_starting_output_address instead of starting_output_address.
13530 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13531 section symbol for which we can't find a merge section.
13532
0602e05a
ILT
13533 PR 9836
13534 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13535 hidden or internal, force the symbol to be local.
13536 * resolve.cc (Symbol::override_visibility): Define.
13537 (Symbol::override_base): Use override_visibility.
13538 (Symbol_table::resolve): Likewise.
13539 (Symbol::override_base_with_special): Likewise.
13540 (Symbol_table::override_with_special): If the visibility is hidden
13541 or internal, force the symbol to be local.
13542 * symtab.h (class Symbol): Add set_visibility and
13543 override_visibility.
13544 * testsuite/ver_test_1.sh: New file.
13545 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13546 (check_DATA): Add ver_test_1.syms.
13547 (ver_test_1.syms): New target.
13548 * testsuite/Makefile.in: Rebuild.
13549
401a9a73
CC
135502009-02-25 Cary Coutant <ccoutant@google.com>
13551
13552 * layout.cc (Layout::choose_output_section): Don't rename sections
13553 when using a linker script that has a SECTIONS clause.
13554 * Makefile.in: Regenerate.
13555
13556 * testsuite/Makefile.am (script_test_5.sh): New test case.
13557 * testsuite/Makefile.in: Regenerate.
13558 * testsuite/script_test_5.cc: New file.
13559 * testsuite/script_test_5.sh: New file.
13560 * testsuite/script_test_5.t: New file.
13561
f488e4b0
CC
135622009-02-13 Rafael Avila de Espindola <espindola@google.com>
13563
13564 * archive.cc (Archive::include_member): Update calls to add_symbols.
13565 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13566 the Layout argument.
13567 * dynobj.h (do_add_symbols): Add the Layout argument.
13568 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13569 Layout argument.
13570 * object.h (Object::add_symbols): Add the Layout argument.
13571 (Object::do_add_symbols): Add the Layout argument.
13572 (Sized_relobj::do_add_symbols): Add the Layout argument.
13573 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13574 Unify the two versions.
13575 (Add_plugin_symbols): Remove.
13576 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13577 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13578 (Add_plugin_symbols): Remove.
13579 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13580 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13581 (Add_symbols::run): Make it work with Pulginobj.
13582
89dd1680
ILT
135832009-02-06 Ian Lance Taylor <iant@google.com>
13584
13585 * object.cc (Sized_relobj::do_layout): Make info message start
13586 with lower case letter.
13587
266d0a74
ILT
135882009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13589
602b464e
ILT
13590 * binary.cc: Fix file comment.
13591
266d0a74
ILT
13592 * options.h (enum Incremental_disposition): Define.
13593 (class General_options): Add new options: --incremental,
13594 --incremental_changed, --incremental_unchanged,
13595 --incremental_unknown. Add incremental_disposition_ and
13596 implicit_incremental_ fields.
13597 (General_options::incremental_disposition): New function.
13598 (class Position_dependent_options): Add incremental_disposition
13599 option.
13600 (Position_dependent_options::copy_from_options): Set incremental
13601 dispositions.
13602 * options.cc (General_options::parse_incremental_changed): New
13603 function.
2e702c99
RM
13604 (General_options::parse_incremental_unchanged): New function.
13605 (General_options::parse_incremental_unknown): New function.
13606 (General_options::General_options): Initialize new fields
266d0a74 13607 incremental_disposition_ and implicit_incremental_.
2e702c99 13608 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13609 without --incremental.
13610
f073bbf7
CD
136112009-02-06 Chris Demetriou <cgd@google.com>
13612
13613 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13614 pointer and to report location as the file name associated with
13615 the symbol.
13616 (gold_undefined_symbol_at_location): New function to replace the
13617 old gold_undefined_symbol functionality.
13618 * target-reloc.h (relocate_section): Update to use
13619 gold_undefined_symbol_at_location.
13620 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13621 Call gold_undefined_symbol function rather than gold_error.
13622 * errors.h (Errors::undefined_symbol): Take location as a
13623 string, rather than calculating it from a relocation.
13624 * errors.cc (Errors::fatal): Print "fatal error:" before the
13625 formatted message.
13626 (Errors::error, Errors::error_at_location): Print "error: "
13627 before the formatted message.
13628 (Errors::undefined_symbol): Take location as a string, rather
13629 than calculating it from a relocation.
13630 (gold_undefined_symbol_at_location): New function akin to
13631 old gold_undefined_symbol, calculates location from relocation.
13632 (gold_undefined_symbol): Change to take only a Symbol pointer
13633 and to report location as the file name associated with the symbol.
13634 * testsuite/debug_msg.sh: Update for changed error messages.
13635 * testsuite/undef_symbol.sh: Likewise.
13636
8e94a90c
ILT
136372009-02-04 Duncan Sands <baldrick@free.fr>
13638
13639 PR 9812
13640 * reduced_debug_output.h
13641 (Output_reduced_debug_abbrev_section::failed): Use format for
13642 gold_warning.
13643 (Output_reduced_debug_info_section::faild): Likewise.
13644
88a0e15b
ILT
136452009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13646
13647 * script.cc (Lazy_demangler): New class.
2e702c99 13648 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13649 symbol only once.
13650
5efc7cd2
CC
136512009-01-29 Cary Coutant <ccoutant@google.com>
13652
13653 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13654 to __tls_get_addr.
13655 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13656
e0ebcf42
ILT
136572009-01-28 Ian Lance Taylor <iant@google.com>
13658
5efc7cd2 13659 * version.cc (version_string): Bump to 1.9.
75fe7426 13660
e0ebcf42
ILT
13661 * gold.h: Include <cstring> and <stdint.h>.
13662 * version.cc: Include <cstdio>.
13663 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13664 warning.
13665 * reduced_debug_output.cc (insert_into_vector): Rename from
13666 Insert_into_vector; change all callers. Use Swap_unaligned to
13667 avoid aliasing issue; remove union since it is unnecessary.
13668
8e2813be 136692009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13670
13671 * Makefile.am (CCFILES): Add gc.cc.
13672 (HFILES): Add gc.h.
13673 * Makefile.in: Regenerate.
13674 * gold.cc (Gc_runner): New class.
13675 (queue_initial_tasks): Call garbage collection related tasks
13676 when corresponding options are invoked.
13677 (queue_middle_gc_tasks): New function.
13678 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13679 processed early before laying out sections during garbage collection.
13680 * gold.h (queue_middle_gc_tasks): New function.
13681 (is_prefix_of): Move from "layout.cc".
13682 * i386.cc (Target_i386::gc_process_relocs): New function.
13683 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13684 * main.cc (main): Create object of class "Garbage_collection".
13685 * object.cc (Relobj::copy_symbols_data): New function.
13686 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13687 (Sized_relobj::do_layout): Allow this function to be called twice
13688 during garbage collection and defer layout of section during the
6d03d481
ST
13689 first call.
13690 * object.h (Relobj::get_symbols_data): New function.
13691 (Relobj::is_section_name_included): New function.
13692 (Relobj::copy_symbols_data): New function.
13693 (Relobj::set_symbols_data): New function.
13694 (Relobj::get_relocs_data): New function.
13695 (Relobj::set_relocs_data): New function.
13696 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13697 (Relobj::gc_process_relocs): New function.
13698 (Relobj::do_gc_process_relocs): New pure virtual function.
13699 (Relobj::sd_): New data member.
13700 (Sized_relobj::is_output_section_offset_invalid): New function.
13701 (Sized_relobj::do_gc_process_relocs): New function.
13702 * options.h (General_options::gc_sections): Modify to not be a no-op.
13703 (General_options::print_gc_sections): New option.
13704 * plugin.cc (Plugin_finish::run): Remove function call to
13705 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13706 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13707 * reloc.cc (Read_relocs::run): Add task to process relocs and
13708 determine unreferenced sections when doing garbage collection.
13709 (Gc_process_relocs): New class.
13710 (Sized_relobj::do_gc_process_relocs): New function.
13711 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13712 sections that are garbage collected.
13713 * reloc.h (Gc_process_relocs): New class.
13714 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13715 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13716 symbols whose corresponding sections are garbage collected.
13717 (Symbol_table::Symbol_table): Add new parameter for the garbage
13718 collection object.
13719 (Symbol_table::gc_mark_undef_symbols): New function.
13720 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13721 (Symbol_table::gc_mark_dyn_syms): New function.
13722 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13723 as garbage.
13724 (Symbol_table::add_from_object): Likewise.
13725 (Symbol_table::add_from_relobj): When building shared objects, do not
13726 treat externally visible symbols as garbage.
13727 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13728 table information for static and relocatable links.
13729 * symtab.h (Symbol_table::set_gc): New function.
13730 (Symbol_table::gc): New function.
13731 (Symbol_table::gc_mark_undef_symbols): New function.
13732 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13733 (Symbol_table::gc_mark_dyn_syms): New function.
13734 (Symbol_table::gc_): New data member.
e1df38aa 13735 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
13736 function.
13737 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13738 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13739
3b293544
CF
137402009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13741
13742 * options.h (General_options::gc_sections): Define as a no-op for now.
13743 (General_options::no_keep_memory): Ditto.
13744 (General_options::Bshareable): Define.
13745 * options.cc (General_options::finalize): Honor -Bshareable.
13746
83d22aa8
AS
137472009-01-20 Andreas Schwab <schwab@suse.de>
13748
13749 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13750 read the value in the contents, since we don't use it. Use the
13751 template endianness when writing.
13752 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13753
cd536b21
AS
137542009-01-19 Andreas Schwab <schwab@suse.de>
13755
13756 * configure.tgt (powerpc64-*): Fix targ_obj.
13757
99e9a495
ILT
137582009-01-15 Ian Lance Taylor <iant@google.com>
13759
13760 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13761 local symbols when stripping all symbols.
13762
bbbfea06
CC
137632009-01-14 Cary Coutant <ccoutant@google.com>
13764
99e9a495 13765 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 13766
0f7c0701
CC
137672009-01-14 Cary Coutant <ccoutant@google.com>
13768
13769 * archive.cc (Archive::get_elf_object_for_member): Remove call
13770 to File_read::claim_for_plugin.
13771 * descriptors.cc (Descriptors::open): Remove reference to
13772 is_claimed.
13773 (Descriptors::claim_for_plugin): Remove.
13774 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13775 (Descriptors::is_claimed): Remove.
13776 (claim_descriptor_for_plugin): Remove.
13777 * fileread.cc (File_read::claim_for_plugin): Remove.
13778 * fileread.h (File_read::claim_for_plugin): Remove.
13779 (File_read::descriptor): Reopen descriptor if necessary.
13780 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13781 (Plugin_manager::all_symbols_read): Add task parameter. Change
13782 all callers.
13783 (Plugin_manager::get_input_file): New function.
13784 (Plugin_manager::release_input_file): New function.
13785 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13786 corresponding data member.
13787 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13788 and pass to base constructor. Change all callers.
13789 (get_input_file, release_input_file): New functions.
13790 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13791 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13792 (Plugin_manager::all_symbols_read): Add task parameter.
13793 (Plugin_manager::get_input_file): New function.
13794 (Plugin_manager::release_input_file): New function.
13795 (Plugin_manager::task_): New data member.
13796 (Pluginobj::Pluginobj): Add filesize parameter.
13797 (Pluginobj::filename): New function.
13798 (Pluginobj::descriptor): New function.
13799 (Pluginobj::filesize): New function.
13800 (Pluginobj::filesize_): New data member.
13801 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13802 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13803 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13804
13805 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13806 with archive libraries.
13807 * testsuite/Makefile.in: Regenerate.
13808 * testsuite/plugin_test.c (struct sym_info): New type.
13809 (get_input_file, release_input_file): New static variables.
13810 (onload): Capture new transfer vector entries.
13811 (claim_file_hook): Stop reading at end of file according to filesize.
13812 Factor out parsing of readelf output into separate function.
13813 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13814 APIs and get the source file name from the symbol table. Convert
13815 source file name to corresponding object file name. Print info
13816 message when adding new input files.
13817 (parse_readelf_line): New function.
13818 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13819 * testsuite/plugin_test_2.sh: Likewise.
13820 * testsuite/plugin_test_3.sh: Likewise.
13821 * testsuite/plugin_test_4.sh: New test case.
13822
62a6d109
ILT
138232009-01-07 Ian Lance Taylor <iant@google.com>
13824
13825 * version.cc (version_string): Bump to 1.8.
13826
483620e8
CC
138272008-12-23 Cary Coutant <ccoutant@google.com>
13828
13829 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13830 * plugin.cc (Plugin_manager::finish): Rename as
13831 layout_deferred_objects. Move cleanup to separate function.
13832 (Plugin_manager::cleanup): New function.
13833 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13834 separately.
13835 * plugin.h (Plugin_manager::finish): Rename as
13836 layout_deferred_objects.
13837 (Plugin_manager::cleanup): New function.
13838 (Plugin_manager::cleanup_done): New field.
13839
d66a9eb3
CC
138402008-12-23 Cary Coutant <ccoutant@google.com>
13841
13842 * plugin.cc (is_visible_from_outside): New function.
13843 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13844 so we don't return "IR only" status for exported symbols or -r links.
13845
13846 * testsuite/Makefile.am (plugin_test_3): New test case.
13847 * testsuite/Makefile.in: Regenerate.
13848 * testsuite/plugin_test_3.sh: New file.
13849
5995b570
CC
138502008-12-22 Cary Coutant <ccoutant@google.com>
13851
13852 * object.cc (Sized_relobj::layout_section): New function.
13853 (Sized_relobj::do_layout): Defer layout of input sections until after
13854 plugin has provided replacement files.
13855 (Sized_relobj::do_layout_deferred_sections): New function.
13856 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13857 (Relobj::layout_deferred_sections): New function.
13858 (Relobj::do_layout_deferred_sections): New function.
13859 (Sized_relobj::do_layout_deferred_sections): New function.
13860 (Sized_relobj::layout_section): New function.
13861 (Sized_relobj::Deferred_layout): New structure.
13862 (Sized_relobj::deferred_layout_): New field.
13863 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13864 Change all callers. Layout deferred sections.
13865 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13866 references.
13867 (Plugin_hook::run): Move code from do_plugin_hook inline.
13868 (Plugin_hook::do_plugin_hook): Remove.
13869 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13870 (Plugin_manager::finish): Renamed, was cleanup.
13871 (Plugin_manager::should_defer_layout): New function.
13872 (Plugin_manager::add_deferred_layout_object): New function.
13873 (Plugin_manager::Deferred_layout_list): New type.
13874 (Plugin_manager::deferred_layout_objects_): New field.
13875 (Plugin_hook::do_plugin_hook): Remove.
13876
ee769c88
ILT
138772008-12-17 Ian Lance Taylor <iant@google.com>
13878
13879 * options.h (class General_options): Add --no case for
13880 --export-dynamic.
13881
abc8dcba
CC
138822008-12-16 Cary Coutant <ccoutant@google.com>
13883
13884 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
13885 vector.
13886 (Plugin_manager::claim_file): Create plugin object even if
13887 plugin did not call the add_symbols callback.
13888 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
13889 asking for more symbols than were added.
13890 * testsuite/Makefile.am (plugin_test_1): Add test case with
13891 no global symbols.
13892 (empty.syms): New target.
13893 * testsuite/Makefile.in: Regenerate.
13894 * testsuite/plugin_test.c (claim_file_hook): Add new debug
13895 message. Don't call add_symbols if no globals.
13896 (all_symbols_read_hook): Don't provide replacement for empty
13897 claimed file.
13898
b0074644
ILT
138992008-12-12 Ian Lance Taylor <iant@google.com>
13900
68943102
ILT
13901 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
13902 r_type == 0 for a local symbol with r_sym == 0.
13903 (scan_relocatable_relocs): Pass r_sym to
13904 local_non_section_strategy.
13905 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
13906 r_sym parameter.
13907
b0074644
ILT
13908 * configure.ac: Update test for TLS descriptors: they are
13909 supported as of glibc 2.9.
13910 * configure: Rebuild.
13911
c2508178
ILT
139122008-12-11 Ian Lance Taylor <iant@google.com>
13913
13914 PR 7091
13915 * target-reloc.h (Default_scan_relocatable_relocs): For each
13916 function, map r_type == 0 to RELOC_DISCARD.
13917
2756a258
CC
139182008-12-10 Cary Coutant <ccoutant@google.com>
13919
13920 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
13921 object to override a kept COMDAT group from a plugin object.
13922
bb6f53d3
ILT
139232008-12-09 Ian Lance Taylor <iant@google.com>
13924
fbc558e1
ILT
13925 PR 7088
13926 * yyscript.y (file_cmd): Handle INPUT.
13927
bb6f53d3
ILT
13928 * testsuite/initpri1.c: Change all declarations to be full
13929 prototypes by adding void, to avoid compiler warnings.
13930
4674ecfc
CC
139312008-12-05 Rafael Avila de Espindola <espindola@google.com>
13932
13933 * options.cc (General_options::parse_plugin_opt): New.
13934 (General_options::add_plugin): The argument now is just the filename.
13935 (General_options::add_plugin_option): New.
13936 * options.h (plugin_opt): New.
13937 (add_plugin): Change argument name.
13938 (add_plugin_option): New.
13939 * plugin.cc (Plugin::load): Don't parse the plugin option.
13940 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
13941 (Plugin::add_option): New.
13942 (Plugin::args_): Change type.
13943 (Plugin::filename_): New.
13944 (Plugin_manager::add_plugin_option): New.
13945 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
13946 * testsuite/Makefile.in: Regenerate.
13947
fd06b4aa
CC
139482008-12-05 Cary Coutant <ccoutant@google.com>
13949
13950 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
13951 Handle --strip-lto-sections option.
13952 * options.h (strip_lto_sections): New option.
13953
6c52134c
CC
139542008-12-01 Cary Coutant <ccoutant@google.com>
13955
13956 * plugin.cc (ld_plugin_message): Change format parameter to const.
13957 Fix mismatch between new[] and delete.
13958
a45248e0
CC
139592008-11-14 Cary Coutant <ccoutant@google.com>
13960
13961 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
13962 instead of -1U.
13963
c82fbeee
CS
139642008-11-05 Craig Silverstein <csilvers@google.com>
13965
13966 * options.cc (General_options::parse_dynamic_list): New function.
13967 * options.h (General_options): New flags dynamic_list,
13968 dynamic_list_data, dynamic_list_cpp_new, and
13969 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
13970 (General_options::in_dynamic_list): New function.
13971 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
13972 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
13973 (Lex::can_continue_name): Likewise.
13974 (yylex): Likewise.
13975 (read_script_file): New parameter script_options.
13976 (read_dynamic_list): New function.
13977 (Script_options::define_dynamic_list): New function.
13978 (dynamic_list_keyword_parsecodes): New variable.
13979 (dynamic_list_keywords): New variable.
13980 * script.h (Script_options::define_dynamic_list): New function
13981 prototype.
13982 (read_dynamic_list): New function prototype.
13983 * symtab.cc (strprefix): New macro.
13984 (Symbol::should_add_dynsym_entry): Support dynamic_list,
13985 dynamic_list_data, dynamic_list_cpp_new, and
13986 dynamic_list_cpp_typeinfo.
13987 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
13988 (dynamic_list_expr): New rule.
13989 (dynamic_list_nodes): Likewise.
13990 (dynamic_list_node): Likewise.
13991 * testsuite/Makefile.am (dynamic_list): New test.
13992 * testsuite/Makefile.in: Regenerated.
13993 * testsuite/dynamic_list.t: New file.
13994 * testsuite/dynamic_list.sh: New file.
13995
e0bb29a5
CS
139962008-11-05 Craig Silverstein <csilvers@google.com>
13997
13998 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
13999 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14000 (t11_last): Likewise.
14001 * testsuite/ver_test_6.c (main): Likewise.
14002
4e1e25e0
CC
140032008-10-07 Cary Coutant <ccoutant@google.com>
14004
14005 * options.c (General_options::finalize): Add check for -static and
14006 -shared.
14007 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14008 is not empty.
14009
92f03fcb
CC
140102008-10-02 Cary Coutant <ccoutant@google.com>
14011
14012 * plugin.cc (make_sized_plugin_object): Fix conditional
14013 compilation to work when not all targets are enabled.
14014
fbd8a257
CC
140152008-09-29 Cary Coutant <ccoutant@google.com>
14016
14017 * archive.cc (Archive::get_file_and_offset): Use filename instead
14018 of name to get library path.
14019 (Archive::include_member): Unlock external member of a thin archive.
14020
14021 * testsuite/Makefile.am (TEST_AR): New variable.
14022 (thin_archive_test_1): New test.
14023 (thin_archive_test_2): New test.
81636b3f
CC
14024 * testsuite/Makefile.in: Regenerate.
14025 * testsuite/thin_archive_main.cc: New file.
14026 * testsuite/thin_archive_test_1.cc: New file.
14027 * testsuite/thin_archive_test_2.cc: New file.
14028 * testsuite/thin_archive_test_3.cc: New file.
14029 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14030
eff45813
CC
140312008-09-29 Cary Coutant <ccoutant@google.com>
14032
14033 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14034 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14035 instead of -1U.
14036 (Sized_relobj::do_finalize_local_symbols): Likewise.
14037 (Sized_relobj::map_to_kept_section): Likewise.
14038 * object.h (Sized_relobj::invalid_address): New constant.
14039 (Sized_relobj::do_output_section_offset): Check for invalid_address
14040 and return -1ULL.
14041 * output.cc (Output_reloc::local_section_offset): Use constant
14042 invalid_address instead of -1U.
14043 (Output_reloc::get_address): Likewise.
14044 (Output_section::output_address): Change -1U to -1ULL.
14045 * output.h (Output_reloc::invalid_address): New constant.
14046 * reloc.cc (Sized_relobj::write_sections): Use constant
14047 invalid_address instead of -1U.
14048 (Sized_relobj::relocate_sections): Likewise.
14049 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14050 values for merge sections.
14051 * target-reloc.h (relocate_for_relocatable): Use constant
14052 invalid_address instead of -1U.
14053
89fc3421
CC
140542008-09-19 Cary Coutant <ccoutant@google.com>
14055
14056 Add plugin functionality for link-time optimization (LTO).
14057 * configure.ac (plugins): Add --enable-plugins option.
14058 * configure: Regenerate.
14059 * config.in: Regenerate.
14060 * Makefile.am (LIBDL): New variable.
14061 (CCFILES): Add plugin.cc.
14062 (HFILES): Add plugin.h.
14063 (ldadd_var): Add LIBDL.
14064 * Makefile.in: Regenerate.
14065
14066 * archive.cc: Include "plugin.h".
14067 (Archive::setup): Don't preread archive symbols when using a plugin.
14068 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14069 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14070 files.
14071 (Archive::include_member): Add symbols from plugin objects.
14072 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14073 * descriptors.cc (Descriptors::open): Check for file descriptors
14074 abandoned by plugins.
14075 (Descriptors::claim_for_plugin): New function.
14076 * descriptors.h (Descriptors::claim_for_plugin): New function.
14077 (Open_descriptor::is_claimed): New field.
14078 (claim_descriptor_for_plugin): New function.
14079 * fileread.cc (File_read::claim_for_plugin): New function.
14080 * fileread.h (File_read::claim_for_plugin): New function.
14081 (File_read::descriptor): New function.
14082 * gold.cc: Include "plugin.h".
14083 (queue_initial_tasks): Add task to call plugin hooks for generating
14084 new object files.
14085 * main.cc: Include "plugin.h".
14086 (main): Load plugin libraries.
14087 * object.h (Pluginobj): Declare.
14088 (Object::pluginobj): New function.
14089 (Object::do_pluginobj): New function.
14090 (Object::set_target): New function.
14091 * options.cc: Include "plugin.h".
14092 (General_options::parse_plugin): New function.
14093 (General_options::General_options): Initialize plugins_ field.
14094 (General_options::add_plugin): New function.
14095 * options.h (Plugin_manager): Declare.
14096 (General_options): Add --plugin option.
14097 (General_options::has_plugins): New function.
14098 (General_options::plugins): New function.
14099 (General_options::add_plugin): New function.
14100 (General_options::plugins_): New field.
14101 * plugin.cc: New file.
14102 * plugin.h: New file.
14103 * readsyms.cc: Include "plugin.h".
14104 (Read_symbols::do_read_symbols): Check for archive before checking
14105 for ELF file. Call plugin hooks to claim files.
14106 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14107 from a real object file; force override when processing replacement
14108 files.
14109 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14110 (Symbol::init_base_object): Likewise.
14111 (Symbol::init_base_output_data): Likewise.
14112 (Symbol::init_base_output_segment): Likewise.
14113 (Symbol::init_base_constant): Likewise.
14114 (Symbol::init_base_undefined): Likewise.
14115 (Symbol::output_section): Assert that object is not a plugin.
14116 (Symbol_table::add_from_pluginobj): New function.
14117 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14118 undefined.
14119 (Symbol_table::sized_write_globals): Likewise.
14120 (Symbol_table::add_from_pluginobj): Instantiate template.
14121 * symtab.h (Sized_pluginobj): Declare.
14122 (Symbol::in_real_elf): New function.
14123 (Symbol::set_in_real_elf): New function.
14124 (Symbol::in_real_elf_): New field.
14125 (Symbol_table::add_from_pluginobj): New function.
14126
14127 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14128 (LIBDL): New variable.
14129 (LDADD): Add LIBDL.
14130 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14131 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14132 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14133 (MOSTLYCLEANFILES): Likewise.
14134 * testsuite/Makefile.in: Regenerate.
14135 * testsuite/plugin_test.c: New file.
14136 * testsuite/plugin_test_1.sh: New file.
14137 * testsuite/plugin_test_2.sh: New file.
14138
de31bda5
ILT
141392008-09-16 Ian Lance Taylor <iant@google.com>
14140
9c2d0ef9
ILT
14141 * target-reloc.h (relocate_section): Check whether a symbol is
14142 defined by the ABI before reporting an undefined symbol error.
14143 * target.h (Target::is_defined_by_abi): Make parameter const.
14144 (Target::do_is_defined_by_abi): Likewise.
14145 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14146 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14147 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14148 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14149 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14150 * testsuite/Makefile.in: Rebuild.
14151
de31bda5
ILT
14152 * fileread.cc (make_view): Add casts to avoid warning.
14153
9fa33bee
AO
141542008-09-16 Alexandre Oliva <aoliva@redhat.com>
14155
14156 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14157 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14158
183fd0e3
AO
141592008-09-16 Alexandre Oliva <aoliva@redhat.com>
14160
14161 * options.h (General_options::output_is_executable): New.
14162 (General_options::output_is_pie): New.
14163 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14164 for shared libraries.
14165 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14166
7be8330a
CD
141672008-09-11 Chris Demetriou <cgd@google.com>
14168
14169 * options.h (origin): New -z option.
14170 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14171 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14172 in DT_FLAGS_1.
14173
a9caad02
CC
141742008-09-05 Cary Coutant <ccoutant@google.com>
14175
14176 * fileread.cc (File_read::make_view): Add check for attempt to map
14177 beyond end of file.
14178
ae6dce4d
CC
141792008-09-05 Cary Coutant <ccoutant@google.com>
14180
14181 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14182 explicit instantiations.
14183
d7ab2a47
KVH
141842008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14185
14186 PR gold/6858
14187 * options.cc (General_options::finalize): Allow undefined symbols
14188 in shlibs if linking -shared.
14189
14190 PR gold/6859
14191 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14192 symbols as not needing a dynsym entry.
14193
1e52a9c1
CS
141942008-08-20 Craig Silverstein <csilvers@google.com>
14195
14196 * fileread.cc (File_read::open): Do not lock the file unless it
14197 was successfully opened.
14198
d85c80a3
CC
141992008-08-14 Cary Coutant <ccoutant@google.com>
14200
14201 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14202 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14203 * testsuite/tls_test.cc (struct int128): 128-bit struct
14204 for testing TLS relocs with non-zero addend.
14205 (v12): New TLS variable.
14206 (t12): New test.
14207 (t_last): Add check for v12.
14208 * testsuite/tls_test.h (t12): New function.
14209 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14210
2d924fd9
ILT
142112008-08-13 Ian Lance Taylor <iant@google.com>
14212
14213 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14214 set tls_segment_ or relro_segment_.
14215 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14216 when appropriate.
14217 * output.h (Output_section::clear_is_relro): New function.
14218 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14219 sections specially even when output_data_ is empty.
14220 (Output_segment::maximum_alignment): When first section is relro,
14221 only force alignment for PT_LOAD segments.
14222 * script.cc (script_data_segment_align): New function.
14223 (script_data_segment_relro_end): New function.
14224 * script-c.h (script_data_segment_align): Declare.
14225 (script_data_segment_relro_end): Declare.
14226 * script-sections.h (class Script_sections): Declare
14227 data_segment_align and data_segment_relro_end. Add fields
14228 segment_align_index_ and saw_relro_end_.
14229 * script-sections.cc (class Sections_element): Add set_is_relro
14230 virtual function. Add new bool* parameter to place_orphan_here.
14231 Add get_output_section virtual function.
14232 (class Output_section_definition): Add set_is_relro. Add new
14233 bool* parameter to place_orphan_here. Add get_output_section.
14234 Add is_relro_ field.
14235 (Output_section_definition::Output_section_definition): Initialize
14236 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14237 and is_relro_ fields.
14238 (Output_section_definition::place_orphan_here): Add is_relro
14239 parameter.
14240 (Output_section_definition::set_section_addresses): Set relro for
14241 output section.
14242 (Output_section_definition::alternate_constraint): Likewise.
14243 (class Orphan_output_section): Add new bool* parameter to
14244 place_orphan_here. Add get_output_section.
14245 (Orphan_output_section::place_orphan_here): Add is_relro
14246 parameter.
14247 (Script_sections::Script_sections): Initialize
14248 data_segment_align_index_ and saw_relro_end_.
14249 (Script_sections::data_segment_align): New function.
14250 (Script_sections::data_segment_relro_end): New function.
14251 (Script_sections::place_orphan): Set or clear is_relro.
14252 (Script_sections::set_section_addresses): Force alignment of first
14253 TLS section.
14254 * yyscript.y (exp): Call script_data_segment_align and
14255 script_data_segment_relro_end.
14256 * testsuite/relro_script_test.t: New file.
14257 * testsuite/relro_test.cc (using_script): Declare.
14258 (t1, t2): Test using_script.
14259 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14260 (relro_script_test_SOURCES): Define.
14261 (relro_script_test_DEPENDENCIES): Define.
14262 (relro_script_test_LDFLAGS): Define.
14263 (relro_script_test_LDADD): Define.
14264 (relro_script_test.so): New target.
14265 * testsuite/Makefile.in: Rebuild.
14266
f827c9a9
CC
142672008-08-06 Cary Coutant <ccoutant@google.com>
14268
14269 * archive.cc (Archive::total_archives, Archive::total_members)
14270 (Archive::total_members_loaded): New variables.
14271 (Archive::setup): Add parameter. Add option to preread
14272 archive symbols.
14273 (Archive::read_armap): Add counter.
14274 (Archive::get_file_and_offset): New function.
14275 (Archive::get_elf_object_for_member): New function.
14276 (Archive::read_all_symbols): New function.
14277 (Archive::read_symbols): New function.
14278 (Archive::add_symbols): Add counters.
14279 (Archive::include_all_members): Use armap to find members if it's
14280 already built.
14281 (Archive::include_member): Skip reading symbols if already read.
14282 Factored code into Archive::get_file_and_offset and
14283 Archive::get_elf_object_for_member. Changed call to
14284 Mapfile::report_include_archive_member.
14285 (Archive::print_stats): New function.
14286 * archive.h: Declare Object and Read_symbols_data classes.
14287 (Archive::Archive): Add initializers for new members.
14288 (Archive::setup): Add parameter.
14289 (Archive::print_stats): New function.
14290 (Archive::total_archives, Archive::total_members)
14291 (Archive::total_members_loaded): New variables.
14292 (Archive::get_file_and_offset): New function.
14293 (Archive::get_elf_object_for_member): New function.
14294 (Archive::read_all_symbols): New function.
14295 (Archive::read_symbols): New function.
14296 (Archive::Archive_member): New class.
14297 (Archive::members_): New member.
14298 (Archive::num_members_): New member.
14299 * main.cc: Include archive.h.
14300 (main): Call Archive::print_stats.
14301 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14302 archive parameter; member_name is now the fully-decorated name.
14303 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14304 * options.h: (General_options): Add --preread-archive-symbols option.
14305 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14306 Archive::setup.
14307
de4c45bd
ILT
143082008-08-04 Ian Lance Taylor <iant@google.com>
14309
14310 * symtab.h (Symbol::use_plt_offset): New function.
14311 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14312 * powerpc.cc (Relocate::relocate): Likewise.
14313 * sparc.cc (Relocate::relocate): Likewise.
14314 * x86_64.cc (Relocate::relocate): Likewise.
14315 * testsuite/weak_plt.sh: New test.
14316 * testsuite/weak_plt_main.cc: New test.
14317 * testsuite/weak_plt_shared.cc: New test.
14318 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14319 (check_PROGRAMS): Add weak_plt.
14320 (check_DATA): Add weak_plt_shared.so.
14321 (weak_plt_main_pic.o, weak_plt): New targets.
14322 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14323 * testsuite/Makefile.in: Rebuild.
14324
14325 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14326 gcctestdir/ld.
14327 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14328 * testsuite/Makefile.in: Rebuild.
14329
323ee3f4
AM
143302008-08-04 Alan Modra <amodra@bigpond.net.au>
14331
14332 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14333 * Makefile.in: Regenerate.
14334 * po/POTFILES.in: Regenerate.
14335
7c07ecec
ILT
143362008-07-29 Ian Lance Taylor <iant@google.com>
14337
14338 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14339 symbols before other symbols.
14340 * testsuite/script_test_2.cc (test_addr): Declare.
14341 (test_addr_alias): Declare.
14342 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14343 values.
7c07ecec
ILT
14344 * testsuite/script_test_2.t: Define test_addr_alias and
14345 test_addr.
14346
5778530e
ILT
143472008-07-24 Ian Lance Taylor <iant@google.com>
14348
2a00e4fb
ILT
14349 PR 5990
14350 * descriptors.cc: New file.
14351 * descriptors.h: New file.
14352 * gold-threads.h (class Hold_optional_lock): New class.
14353 * fileread.cc: Include "descriptors.h".
14354 (File_read::~File_read): Release descriptor rather than closing
14355 it.
14356 (File_read::open) [file]: Call open_descriptor rather than open.
14357 Set is_descriptor_opened_.
14358 (File_read::open) [memory]: Assert that descriptor is not open.
14359 (File_read::reopen_descriptor): New function.
14360 (File_read::release): Release descriptor.
14361 (File_read::do_read): Make non-const. Reopen descriptor.
14362 (File_read::read): Make non-const.
14363 (File_read::make_view): Reopen descriptor.
14364 (File_read::do_readv): Likewise.
14365 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14366 Update declarations.
14367 * layout.cc: Include "descriptors.h".
14368 (Layout::create_build_id): Use open_descriptor rather than open.
14369 * output.cc: Include "descriptors.h".
14370 (Output_file::open): Use open_descriptor rather than open.
14371 * archive.cc (Archive::const_iterator): Change Archive to be
14372 non-const.
14373 (Archive::begin, Archive::end): Make non-const.
14374 (Archive::count_members): Likewise.
14375 * archive.h (class Archive): Update declarations.
14376 * object.h (Object::read): Make non-const.
14377 * Makefile.am (CCFILES): Add descriptors.cc.
14378 (HFILES): Add descriptors.h.
14379 * Makefile.in: Rebuild.
14380
801647d1
ILT
14381 PR 6716
14382 * gold.h: Always include <clocale>. Add Solaris workarounds
14383 following code in binutils/sysdep.h.
14384
5edd166e
ILT
14385 PR 6048
14386 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14387 this->eh_frame_hdr_ is NULL before using it.
14388
c89ad728
ILT
14389 * dynobj.cc (Versions::Versions): Update comment.
14390
aa86f06b
ILT
14391 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14392 the base version name.
14393
5778530e
ILT
14394 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14395 array size plus one.
14396 (Stringpool_template::set_string_offsets): Subtract one from key
14397 before using it as an array index.
14398 (Stringpool_template::get_offset_with_length): Likewise.
14399 (Stringpool_template::write_to_buffer): Likewise.
14400 * stringpool.h (Stringpool_template::get_offset_from_key):
14401 Likewise.
14402
057ead22
ILT
144032008-07-23 Ian Lance Taylor <iant@google.com>
14404
7f649c59
ILT
14405 PR 6658
14406 * object.h (Merged_symbol_value::value): Do our best to handle a
14407 negative addend.
14408
057ead22
ILT
14409 PR 6647
14410 * script.cc (Version_script_info::get_versions): Don't add empty
14411 version tag to return value.
14412 (Version_script_info::get_symbol_version_helper): Change return
14413 type to bool. Add pversion parameter. Change all callers.
14414 (script_register_vers_node): Don't require a non-NULL tag.
14415 * script.h (class Version_script_info): Update declarations.
14416 (Version_script_info::get_symbol_version): Change return type to
14417 bool. Add version parameter. Change all callers.
14418 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14419 handling. Handle an empty version from a version script.
14420 (Symbol_table::define_special_symbol): Likewise.
14421 * testsuite/ver_test_10.script: New file.
14422 * testsuite/ver_test_10.sh: New file.
14423 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14424 (check_DATA): Add ver_test_10.syms.
14425 (ver_test_10.syms, ver_test_10.so): New target.
14426 * testsuite/Makefile.in: Rebuild.
14427
58e54ac2
CD
144282008-07-23 Simon Baldwin <simonb@google.com>
14429
14430 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14431 to zero for undefined symbols from dynamic libraries.
14432
95d14cd3
ILT
144332008-07-23 Ian Lance Taylor <iant@google.com>
14434
14435 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14436 Change all callers.
14437 * symtab.h (class Symbol_table): Update declaration.
14438 * testsuite/ver_test_9.cc: New file.
14439 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14440 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14441 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14442 (ver_test_9.so, ver_test_9.o): New targets.
14443 * testsuite/Makefile.in: Rebuild.
14444
92de84a6
ILT
144452008-07-22 Ian Lance Taylor <iant@google.com>
14446
34810851
ILT
14447 * options.h (class General_options): Define --check-sections.
14448 * layout.cc (Layout::set_segment_offsets): Handle
14449 --check-sections.
14450
af6156ef
ILT
14451 * options.h (class General_options): Define -n/--nmagic and
14452 -N/--omagic.
14453 * options.cc (General_options::finalize): For -n/--nmagic or
14454 -N/--omagic, set -static.
14455 * layout.cc (Layout::attach_allocated_section_to_segment): If
14456 -N/--omagic, don't put read-only and read-write sections in
14457 different segments.
14458 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14459 finding a read-only segment.
14460 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14461 don't set the minimum segment alignment to the common page size,
14462 and don't set the file offset to the address modulo the page size.
14463 * script-sections.cc (Script_sections::create_segments): If
14464 -n/--omagic, don't put read-only and read-write sections in
14465 different segments.
14466
92de84a6
ILT
14467 * cref.cc: New file.
14468 * cref.h: New file.
14469 * options.h (class General_options): Add --print-symbol-counts.
14470 * main.cc (main): Issue defined symbol report if requested.
14471 * archive.cc (Archive::interpret_header): Make into a const member
14472 function.
14473 (Archive::add_symbols): Call Input_objects::archive_start and
14474 archive_stop.
14475 (Archive::const_iterator): Define new class.
14476 (Archive::begin, Archive::end): New functions.
14477 (Archive::include_all_members): Rewrite to use iterator.
14478 (Archive::count_members): New function.
14479 * archive.h (class Archive): Update declarations.
14480 (Archive::filename): New function.
14481 * object.cc: Include "cref.h".
14482 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14483 (Sized_relobj::do_get_global_symbol_counts): New function.
14484 (Input_objects::add_object): Add object to cross-referencer.
14485 (Input_objects::archive_start): New function.
14486 (Input_objects::archive_stop): New function.
14487 (Input_objects::print_symbol_counts): New function.
14488 * object.h: Declare Cref and Archive.
14489 (Object::get_global_symbol_counts): New function.
14490 (Object::do_get_global_symbol_counts): New pure virtual function.
14491 (class Sized_relobj): Add defined_count_ field. Update
14492 declarations.
14493 (class Input_objects): Add cref_ field. Update constructor.
14494 Update declarations.
14495 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14496 defined_count_.
14497 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14498 symbol counts.
14499 (Sized_dynobj::do_get_global_symbol_counts): New function.
14500 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14501 defined_count_. Update declarations. Define Symbols typedef.
14502 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14503 parameter. Change all callers.
14504 (Symbol_table::add_from_dynobj): Add sympointers and defined
14505 parameters. Change all callers.
14506 * symtab.h (class Symbol_table): Update declarations.
14507 * Makefile.am (CCFILES): Add cref.cc.
14508 (HFILES): Add cref.h.
14509 * Makefile.in: Rebuild.
14510
3f7c5e1d
CD
145112008-07-22 Simon Baldwin <simonb@google.com>
14512
14513 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14514 to zero when writing undefined symbols.
14515
e0b64032
ILT
145162008-07-22 Ian Lance Taylor <iant@google.com>
14517
14518 * output.cc (Output_section::add_input_section): Don't try to
14519 merge empty merge sections.
14520
096b02cf
CS
145212008-07-21 Craig Silverstein <csilvers@google.com>
14522
14523 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14524 Include symbol version in error message.
cd536b21 14525
1d1f116d
CD
145262008-07-20 Chris Demetriou <cgd@google.com>
14527
cd536b21 14528 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14529 (RANDOM_SEED_CFLAGS): New substituted variable.
14530 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14531 * configure: Rebuild.
14532 * Makefile.in: Likewise.
14533 * testsuite/Makefile.in: Likewise.
14534
a18f591e
ILT
145352008-07-18 Ian Lance Taylor <iant@google.com>
14536
14537 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14538 where we see NAME/NULL and NAME/VERSION as separate symbols.
14539 * testsuite/ver_test_main.cc (main): Call t4.
14540 (t4, t4_2a): Define.
14541 * testsuite/ver_test_2.cc (t4_2): Define.
14542 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14543 * testsuite/ver_test_4.cc (t4_2a): Define.
14544 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14545 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14546
c6e3f6ed
ILT
145472008-07-17 Ian Lance Taylor <iant@google.com>
14548
14549 * dynobj.cc (Versions::add_def): If we give an error about a
14550 missing version, go ahead and create the version anyhow.
14551
ef9beddf
ILT
145522008-07-10 Ian Lance Taylor <iant@google.com>
14553
14554 Handle output sections with more than 0x7fffffff bytes.
14555 * object.h (class Relobj): Change map_to_output_ to
14556 output_sections_, and just keep a section pointer. Change all
14557 uses. Move comdat group support to Sized_relobj.
14558 (Relobj::is_section_specially_mapped): Remove.
14559 (Relobj::output_section): Remove poff parameter. Change all
14560 callers.
14561 (Relobj::output_section_offset): New function.
14562 (Relobj::set_section_offset): Rewrite.
14563 (Relobj::map_to_output): Remove.
14564 (Relobj::output_sections): New function.
14565 (Relobj::do_output_section_offset): New pure virtual function.
14566 (Relobj::do_set_section_offset): Likewise.
14567 (class Sized_relobj): Add section_offsets_ field. Add comdat
14568 group support from Relobj. Update declarations.
14569 (Sized_relobj::get_output_section_offset): New function.
14570 (Sized_relobj::do_output_section_offset): New function.
14571 (Sized_relobj::do_set_section_offset): New function.
14572 * object.cc (Relobj::output_section_address): Remove.
14573 (Sized_relobj::Sized_relobj): Initialize new fields.
14574 (Sized_relobj::include_section_group): Cast find_kept_object to
14575 Sized_relobj.
14576 (Sized_relobj::include_linkonce_section): Likewise.
14577 (Sized_relobj::do_layout): Use separate arrays for output section
14578 and output offset.
14579 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14580 output_sections.
14581 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14582 output_sections and section_offsets.
14583 (Sized_relobj::write_local_symbols): Likewise.
14584 (map_to_kept_section): Compute output address directly.
14585 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14586 output_sections and section_offsets.
14587 (Sized_relobj::write_sections): Likewise.
14588 (Sized_relobj::relocate_sections): Likewise.
14589 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14590 * output.h (class Output_reloc): Update declarations. Change
14591 u2_.relobj to Sized_relobj*.
14592 (class Output_data_reloc): Change add functions to use
14593 Sized_relobj*.
14594 * output.cc (Output_reloc::Output_reloc): Change relobj to
14595 Sized_relobj*.
14596 (Output_reloc::local_section_offset): Change return type to
14597 Elf_Addr. Use get_output_section_offset.
14598 (Output_reloc::get_address): Likewise.
14599 (Output_section::is_input_address_mapped): Don't call
14600 is_section_specially_mapped.
14601 (Output_section::output_offset): Likewise.
14602 (Output_section::output_address): Likewise.
14603 (Output_section::starting_output_address): Likewise.
14604 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14605 parameter to Sized_relobj*.
14606 (Copy_relocs::need_copy_reloc): Likewise.
14607 (Copy_relocs::save): Likewise.
14608 * copy-relocs.h (class Copy_relocs): Update declarations.
14609 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14610 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14611 * target-reloc.h (relocate_for_relocatable): Change
14612 offset_in_output_section type to Elf_Addr. Change code that uses
14613 it as well.
14614 * layout.cc (Layout::layout): Always set *off.
14615 * mapfile.cc (Mapfile::print_input_section): Use
14616 output_section_offset.
14617 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14618 Sized_relobj*.
14619 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14620 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14621 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14622
5cb66f97
ILT
146232008-07-03 Ian Lance Taylor <iant@google.com>
14624
14625 * layout.cc (Layout::include_section): Do not discard unrecognized
14626 SHT_STRTAB sections.
14627
afe47622
CS
146282008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14629
14630 * script.cc (Lex::can_continue_name): Make '?' allowable in
14631 version-script names.
14632 * testsuite/version_script.map: Change glob pattern to use '?'
14633
5adf9721
ILT
146342008-06-30 Manish Singh <yosh@gimp.org>
14635
14636 PR 6585
14637 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14638 Correct typo.
14639
e6fde208
ILT
146402008-06-30 Ian Lance Taylor <iant@google.com>
14641
14642 PR 6660
14643 PR 6682
14644 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14645 versions]: Don't try to read the value in the contents, since we
14646 don't use it. Use the template endianness when writing.
14647
3f2e6a2d
CC
146482008-06-25 Cary Coutant <ccoutant@google.com>
14649
14650 * fileread.cc (File_read::make_view): Assert on zero-length view.
14651 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14652 symbol table when there are no symbols to read.
14653
c43d3a48
CS
146542008-06-23 Craig Silverstein <csilvers@google.com>
14655
14656 * version.cc (version_string): Bump to 1.7
14657
5f494ea0
CS
146582008-06-18 Craig Silverstein <csilvers@google.com>
14659
14660 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14661 constant 0xFFFF to type Valtype.
14662 (Powerpc_relocate_functions::rel16_ha): Likewise.
14663
c42e122e
ILT
146642008-06-17 Ian Lance Taylor <iant@google.com>
14665
f34787f8
ILT
14666 * output.h (Output_section::Input_section): Initialize p2align_ to
14667 zero for Output_section_data constructors.
14668 (Output_section::Input_section::addralign): If not an input
14669 section, return the alignment of the Output_section_data.
14670 * testsuite/copy_test.cc: New file.
14671 * testsuite/copy_test_1.cc: New file.
14672 * testsuite/copy_test_2.cc: New file.
14673 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14674 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14675 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14676 (copy_test_1_pic.o, copy_test_1.so): New targets.
14677 (copy_test_2_pic.o, copy_test_2.so): New targets.
14678 * testsuite/Makefile.in: Rebuild.
14679
c42e122e
ILT
14680 * script-sections.cc (Script_sections::place_orphan): Initialize
14681 local variable exact.
14682
ce3ac18a
DE
146832008-06-13 David Edelsohn <edelsohn@gnu.org>
14684
14685 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14686
42cacb20
DE
146872008-06-12 David Edelsohn <edelsohn@gnu.org>
14688 David S. Miller <davem@davemloft.net>
14689
14690 * powerpc.cc: New file.
14691 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14692 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14693 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14694 * Makefile.in: Rebuild.
14695
7b308235
ILT
146962008-06-09 Ian Lance Taylor <iant@google.com>
14697
14698 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14699 <exception>.
14700 (throwing, orig_terminate): New static variables.
14701 (terminate_handler): New static function.
14702 (t2): Set terminate handler.
14703
f0b886e3
ILT
147042008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14705
14706 PR 6584
cd536b21 14707 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14708 alignment.
14709
3e90f135
CC
147102008-05-30 Cary Coutant <ccoutant@google.com>
14711
14712 * archive.cc (Archive::include_all_members) Correct to step
14713 over symbol table and extended name table in thin archives.
14714
e09ad04a
ILT
147152008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14716
14717 PR 6407
14718 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14719 calculation.
14720
62b01cb5
ILT
147212008-05-28 Caleb Howe <cshowe@google.com>
14722
14723 * reduced_debug_output.cc: New file.
14724 * reduced_debug_output.h: New file.
92de84a6 14725 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
14726 * options.cc (General_options::finalize): Add strip_debug_non_line
14727 to the strip heirarchy.
14728 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14729 fields.
14730 * layout.cc: Include "reduced_debug_output.h".
14731 (Layout::Layout): Initialize new fields.
14732 (line_only_debug_sections): New static array.
14733 (is_lines_only_debug_sections): New static inline function.
14734 (Layout::include_section): Handle --strip-debug-non-line.
14735 (Layout::make_output_section): If --strip-debug-non-line, build
14736 new output sections for .debug_abbrev and .debug_info.
14737 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14738 gold. Warn about possible overflow.
14739 (read_signed_LEB_128): Likewise.
14740 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14741 (read_signed_LEB_128): Declare.
14742 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14743 (HFILES): Add reduced_debug_output.h.
14744 * Makefile.in: Rebuild.
14745
7d9e3d98
ILT
147462008-05-21 Ian Lance Taylor <iant@google.com>
14747
14748 * mapfile.cc: New file.
14749 * mapfile.h: New file.
14750 * options.h (class General_options): Add -M/--print-map and -Map.
14751 * options.cc (General_options::finalize): Make -M equivalent to
14752 -Map -.
14753 * main.cc: Include <cstdio> and "mapfile.h".
14754 (main): Open mapfile if requested.
14755 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14756 constructor. Change caller.
14757 (queue_initial_tasks): Add mapfile parameter. Change caller.
14758 (queue_middle_tasks): Likewise.
14759 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14760 declarations.
14761 * archive.cc: Include "mapfile.h".
14762 (Archive::add_symbols): Add mapfile parameter. Change all
14763 callers. Pass mapfile, symbol, and reason to include_member.
14764 (Archive::include_all_members): Add mapfile parameter. Change all
14765 callers.
14766 (Archive::include_member): Add mapfile, sym, and why parameters.
14767 Change all callers. Report inclusion to map file.
14768 * archive.h: Include "fileread.h".
14769 (class Archive): Update declarations.
14770 (Archive::file): New const method.
14771 (class Add_archive_symbols): Add mapfile_ field. Update
14772 constructor. Change all callers.
14773 * readsyms.h (class Read_symbols): Likewise.
14774 (class Finish_group): Likewise.
14775 (class Read_script): Likewise.
14776 * common.cc: Include "mapfile.h".
14777 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14778 all callers.
14779 (Symbol_table::do_allocate_commons): Likewise.
14780 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14781 symbol allocation to mapfile.
14782 * common.h (class Allocate_commons_task): Add mapfile_ field.
14783 Update constructor. Change all callers.
14784 * symtab.h (class Symbol_table): Update declarations.
14785 * layout.cc: Include "mapfile.h".
14786 (Layout_task_runner::run): Print information to mapfile.
14787 (Layout::create_gold_note): Change Output_data_fixed_space to
14788 Output_data_zero_fill.
14789 (Layout::create_build_id): Likewise.
14790 (Layout::print_to_mapfile): New function.
14791 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14792 constructor. Change caller.
14793 (class Layout): Declare print_to_mapfile.
14794 * output.cc (Output_section::Input_section::print_to_mapfile): New
14795 function.
14796 (Output_section::add_input_section): If producing a map, always
14797 add to input_sections_ list.
14798 (Output_section::do_print_to_mapfile): New function.
14799 (Output_segment::print_sections_to_mapfile): New function.
14800 (Output_segment::print_section_list_to_mapfile): New function.
14801 * output.h: Include "mapfile.h".
14802 (Output_data::print_to_mapfile): New function.
14803 (Output_data::do_print_to_mapfile): New virtual function.
14804 (Output_segment_headers::do_print_to_mapfile): New function.
14805 (Output_file_header::do_print_to_mapfile): New function.
14806 (Output_data_const::do_print_to_mapfile): New function.
14807 (class Output_data_const_buffer): Add map_name_ field. Update
14808 constructor. Change all callers. Add do_print_to_mapfile
14809 function.
14810 (class Output_data_fixed_space): Likewise.
14811 (class Output_data_space): Likewise.
14812 (class Output_data_zero_fill): New class.
14813 (Output_data_strtab::do_print_to_mapfile): New function.
14814 (Output_data_reloc_base::do_print_to_mapfile): New function.
14815 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14816 (Output_data_group::do_print_to_mapfile): New function.
14817 (Output_data_got::do_print_to_mapfile): New function.
14818 (Output_data_dynamic::do_print_to_mapfile): New function.
14819 (Output_symtab_xindex::do_print_to_mapfile): New function.
14820 (class Output_section): Declare do_print_to_mapflie. Declare
14821 print_to_mapfile in Input_section.
14822 (class Output_segment): Declare new functions.
14823 * object.h (Sized_relobj::symbol_count): New function.
14824 * script-sections.cc
14825 (Output_section_element_dot_assignment::set_section_addresses):
14826 Change Output_data_fixed_space to Output_data_zero_fill.
14827 (Output_data_expression::do_print_to_mapfile): New function.
14828 * script.cc (read_input_script): Add mapfile parameter. Change
14829 all callers.
14830 * script.h (read_input_script): Update declaration.
14831 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14832 (Eh_frame::do_print_to_mapfile): New function.
14833 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14834 (Output_merge_string::do_print_to_mapfile): New function.
14835 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14836 function.
14837 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14838 function.
14839 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14840 function.
14841 * Makefile.am (CCFILES): Add mapfile.cc.
14842 (HFILES): Add mapfile.h.
14843 * Makefile.in: Rebuild.
14844
9f1d377b
ILT
148452008-05-19 Ian Lance Taylor <iant@google.com>
14846
14847 * options.h (class General_options): Add -z relro.
14848 * layout.cc (Layout::Layout): Initialize relro_segment_.
14849 (Layout::add_output_section_data): Return the output section.
14850 (Layout::make_output_section): Rcognize relro sections and mark
14851 them appropriately.
14852 (Layout::attach_allocated_section_to_segment): Put relro sections
14853 in a PT_GNU_RELRO segment.
14854 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14855 section as relro.
14856 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14857 PT_TLS segments.
14858 (Layout::linkonce_mapping): Map d.rel.ro.local to
14859 .data.rel.ro.local.
14860 (Layout::output_section_name): Us .data.rel.ro.local for any
14861 section which begins with that.
14862 * layout.h (class Layout): Update add_output_section_data
14863 declaration. Add relro_segment_ field.
14864 * output.cc (Output_section::Output_section): Initialize is_relro_
14865 and is_relro_local_ fields.
14866 (Output_segment::add_output_section): Group relro sections.
14867 (Output_segment::is_first_section_relro): New function.
14868 (Output_segment::maximum_alignment): If there is a relro section,
14869 align the segment to the common page size.
14870 (Output_segment::set_section_addresses): Track whether we are
14871 looking at relro sections. If the last section is a relro
14872 section, align to the common page size.
14873 (Output_segment::set_section_list_addresses): Add in_relro
14874 parameter. Change all callers. Align to the page size when
14875 moving from relro to non-relro section.
14876 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14877 segment.
14878 * output.h (class Output_section): Add is_relro_ and
14879 is_relro_local_ fields.
14880 (Output_section::is_relro): New function.
14881 (Output_section::set_is_relro): New function.
14882 (Output_section::is_relro_local): New function.
14883 (Output_section::set_is_relro_local): New function.
14884 (class Output_segment): Update declarations.
14885 * i386.cc (Target_i386::got_section): Mark .got section as relro.
14886 * sparc.cc (Target_sparc::got_section): Likewise.
14887 * x86_64.cc (Target_x86_64::got_section): Likewise.
14888 * testsuite/relro_test_main.cc: New file.
14889 * testsuite/relro_test.cc: New file.
14890 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
14891 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
14892 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
14893 (relro_test.so, relro_test_pic.o): New targets.
14894 * testsuite/Makefile.in: Rebuild.
14895
a984ee1d
ILT
148962008-05-16 Ian Lance Taylor <iant@google.com>
14897
01676dcd
ILT
14898 * output.cc (Output_segment::add_output_section): Remove front
14899 parameter.
14900 * output.h (class Output_segment): Remove
14901 add_initial_output_section and overloaded add_output_section.
14902 Update declaration of remaining add_output_section.
14903 * layout.cc (Layout::create_interp): Call add_output_section
14904 rather than add_initial_output_section.
14905 (Layout::finish_dynamic_section): Likewise.
14906
497897f9
ILT
14907 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
14908 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
14909 know the dynamic type.
14910 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
14911 field. Initialize it in constructor.
14912 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
14913 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
14914 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
14915 reloc.
14916
a984ee1d
ILT
14917 * output.cc (Output_reloc::get_address): Change return type to
14918 Elf_Addr.
14919 * output.h (class Output_reloc): Update get_address declaration.
14920 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
14921 for section addresses.
14922
55ba0940
ILT
149232008-05-09 Ian Lance Taylor <iant@google.com>
14924
14925 PR 6493
14926 * gold.cc (gold_nomem): Use return value of write.
14927
75517b77
ILT
149282008-05-08 Ian Lance Taylor <iant@google.com>
14929
14930 * symtab.c (Symbol::init_base_output_data): Add version
14931 parameter. Change all callers.
14932 (Symbol::init_base_output_segment): Likewise.
14933 (Symbol::init_base_constant): Likewise.
14934 (Symbol::init_base_undefined): Likewise.
14935 (Sized_symbol::init_output_data): Likewise.
14936 (Sized_symbol::init_output_segment): Likewise.
14937 (Sized_symbol::init_constant): Likewise.
14938 (Sized_symbol::init_undefined): Likewise.
14939 (Symbol_table::do_define_in_output_data): If the new symbol has a
14940 version, mark it as the default.
14941 (Symbol_table::do_define_in_output_segment): Likewise.
14942 (Symbol_table::do_define_as_constant): Likewise.
14943 * symtab.h (class Symbol): Update declarations.
14944 (class Sized_symbol): Likewise.
14945 * resolve.cc (Symbol::override_version): New function.
c42e122e 14946 (Symbol::override_base): Call override_version.
75517b77
ILT
14947 (Symbol::override_base_with_special): Likewise.
14948 * testsuite/ver_script_8.script: New file.
14949 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
14950 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
14951 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
14952 (ver_test_8_1.so, ver_test_8_2.so): New targets.
14953
f1f70eae
ILT
149542008-05-06 Ian Lance Taylor <iant@google.com>
14955
f3e9c5c5
ILT
14956 PR 6049
14957 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
14958 functions.
14959 (class General_options): Remove existing --undefined, and add
14960 --no-undefined instead. Add new --undefined as synonym for -u.
14961 * archive.cc (Archive::add_symbols): Check whether symbol was
14962 named with -u.
14963 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
14964 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
14965 all uses. Add IS_UNDEFINED. Update declarations to split
14966 different versions of init_base. Declare init_base_undefined.
14967 (Symbol::is_defined): Handle IS_UNDEFINED.
14968 (Symbol::is_undefined): Likewise.
14969 (Symbol::is_weak_undefined): Call is_undefined.
14970 (Symbol::is_absolute): Handle IS_CONSTANT.
14971 (class Sized_symbol): Update declarations to split different
14972 versions of init. Declare init_undefined.
14973 (class Symbol_table): Declare new functions.
14974 * symtab.cc (Symbol::init_base_object): Rename from init_base.
14975 Change all callers.
14976 (Symbol::init_base_output_data): Likewise.
14977 (Symbol::init_base_output_segment): Likewise.
14978 (Symbol::init_base_constant): Likewise.
14979 (Symbol::init_base_undefined): New function.
14980 (Sized_symbol::init_object): Rename from init. Change all
14981 callers.
14982 (Sized_symbol::init_output_data): Likewise.
14983 (Sized_symbol::init_output_segment): Likewise.
14984 (Sized_symbol::init_constant): Likewise.
14985 (Sized_symbol::init_undefined): New function.
14986 (Symbol_table::add_undefined_symbols_from_command_line): New
14987 function.
14988 (Symbol_table::do_add_undefined_symbols_from_command_line): New
14989 function.
14990 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
14991 (Symbol::output_section): Likewise.
14992 (Symbol::set_output_section): Likewise.
14993 (Symbol_table::sized_finalize_symbol): Likewise.
14994 (Symbol_table::sized_write_globals): Likewise.
14995 * resolve.cc (Symbol_table::should_override): Likewise.
14996 (Symbol::override_base_with_special): Likewise.
14997
8bdcdf2c
ILT
14998 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
14999 symbol, change it to have default visibility.
15000 * testsuite/protected_1.cc: New file.
15001 * testsuite/protected_2.cc: New file.
15002 * testsuite/protected_3.cc: New file.
15003 * testsuite/protected_main_1.cc: New file.
15004 * testsuite/protected_main_2.cc: New file.
15005 * testsuite/protected_main_3.cc: New file.
15006 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15007 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15008 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15009 (protected_1.so): New target.
15010 (protected_1_pic.o, protected_2_pic.o): New targets.
15011 (protected_3_pic.o): New target.
15012 (check_PROGRAMS): Add protected_2.
15013 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15014 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15015 * testsuite/Makefile.in: Rebuild.
15016
2b706932
ILT
15017 * options.h (DEFINE_var): Add set_user_set_##varname__.
15018 (DEFINE_bool_alias): New macro.
15019 (class General_options): Define -Bstatic using DEFINE_bool_alias
15020 rather than DEFINE_special. Add --undefined as an alias for -z
15021 defs.
15022 * options.cc (General_options::parse_Bstatic): Remove.
15023
d82a5bcc
ILT
15024 * options.h (class General_options): Add --fatal-warnings.
15025 * main.cc (main): Implement --fatal-warnings.
15026 * errors.h (Errors::warning_count): New function.
15027
f1f70eae
ILT
15028 * options.h (class General_options): Add -Bsymbolic-functions.
15029 * symtab.h (Symbol::is_preemptible): Check for
15030 -Bsymbolic-functions.
15031
8825ac63
ILT
150322008-05-05 Ian Lance Taylor <iant@google.com>
15033
d98bc257
ILT
15034 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15035 as noVARNAME rather than no-VARNAME.
15036 (class General_options): Add option -z combreloc.
15037 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15038 get_address.
15039 (Output_reloc::sort_before) [SHT_REL]: New function.
15040 (Output_reloc::sort_before) [SHT_RELA]: New function.
15041 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15042 Sort_relocs_comparison.
15043 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15044 parameter. Change all callers.
15045 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15046 sort_relocs parameter. Change all callers.
15047 * output.cc (Output_reloc::get_address): New function, broken out
15048 of write_rel.
15049 (Output_reloc::write_rel): Call it.
15050 (Output_reloc::compare): New function.
15051 (Output_data_reloc_base::do_write): Optionally sort relocs.
15052
60b2b4e7
ILT
15053 * configure.ac: If targ_extra_obj is set, link it in.
15054 * configure.tgt: Initialize all variables.
15055 (x86_64*): Set targ_extra_obj and targ_extra_size.
15056 * configure: Rebuild.
15057
8825ac63
ILT
15058 * object.cc (Sized_relobj::include_section_group): Adjust section
15059 indexes read from group data. Build vector to pass to
15060 layout_group.
15061 * layout.cc (Layout::layout_group): Add flags and shndxes
15062 parameters. Remove contents parameter. Change caller. Update
15063 explicit instantiations.
15064 * layout.h (class Layout): Update layout_group declaration.
15065 * output.cc (Output_data_group::Output_data_group): Add flags and
15066 input_shndxes parameters. Remove contents parameter. Change
15067 caller.
15068 (Output_data_group::do_write): Change input_sections_ to
15069 input_shndxes_.
15070 * output.h (class Output_data_group): Update constructor
15071 declaration. Rename input_sections_ to input_shndxes_.
15072 * testsuite/many_sections_test.cc: Add template.
15073
e94cf127
CC
150742008-04-30 Cary Coutant <ccoutant@google.com>
15075
4418b2d5
CC
15076 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15077
e94cf127
CC
15078 * layout.cc (Layout::include_section): Refactored check for debug
15079 info section.
15080 (Layout::add_comdat): Add new parameters. Change type
15081 of signature parameter. Add object and shndx to signatures table.
15082 (Layout::find_kept_object): New function.
15083 * layout.h: Include <cstring>.
15084 (Layout::is_debug_info_section): New function.
15085 (Layout::add_comdat): Add new parameters.
15086 (Layout::find_kept_object): New function.
15087 (Layout::Kept_section): New struct.
15088 (Layout::Signatures): Change type of map range.
15089 * object.cc (Relobj::output_section_address): New function.
15090 (Sized_relobj::include_section_group): Add new parameters. Change
15091 calls to Layout::add_comdat. Change to build table of kept comdat
15092 groups and table mapping discarded sections to kept sections.
15093 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15094 (Sized_relobj::do_layout): Change calls to include_section_group and
15095 include_linkonce_section.
15096 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15097 value to zero when section is discarded.
15098 (Sized_relobj::map_to_kept_section): New function.
15099 * object.h (Relobj::output_section_address): New function.
15100 (Relobj::Comdat_group): New type.
15101 (Relobj::find_comdat_group): New function.
15102 (Relobj::Comdat_group_table): New type.
15103 (Relobj::Kept_comdat_section): New type.
15104 (Relobj::Kept_comdat_section_table): New type.
15105 (Relobj::add_comdat_group): New function.
15106 (Relobj::set_kept_comdat_section): New function.
15107 (Relobj::get_kept_comdat_section): New function.
15108 (Relobj::comdat_groups_): New field.
15109 (Relobj::kept_comdat_sections_): New field.
15110 (Symbol_value::input_value): Update comment.
15111 (Sized_relobj::map_to_kept_section) New function.
15112 (Sized_relobj::include_linkonce_section): Add new parameter.
15113 * target-reloc.h (Comdat_behavior): New type.
15114 (get_comdat_behavior): New function.
15115 (relocate_section): Add code to map a discarded section to the
15116 corresponding kept section when applying a relocation.
15117
e4e5049b
CS
151182008-04-30 Craig Silverstein <csilvers@google.com>
15119
15120 * dwarf_reader.cc (next_generation_count): New static var.
15121 (Addr2line_cache_entry): New struct.
15122 (addr2line_cache): New static var.
15123 (Dwarf_line_info::one_addr2line): Added caching.
15124 (Dwarf_line_info::clear_addr2line_cache): New function.
15125 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15126 cache-size parameter.
15127 (Dwarf_line_info::one_addr2line_cache): New function.
15128 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15129 new cache-size argument to one_addr2line(), and clear cache.
15130
d09e9154
CC
151312008-04-28 Cary Coutant <ccoutant@google.com>
15132
15133 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15134 R_386_PC8 relocations.
15135
7ef73768
ILT
151362008-04-23 Ian Lance Taylor <iant@google.com>
15137
55438702
ILT
15138 * object.cc (Sized_relobj::include_section_group): Check for
15139 invalid section group.
15140
c165fb93
ILT
15141 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15142 header size.
15143
7ef73768
ILT
15144 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15145 than read for file header.
15146 * archive.cc (Archive::include_member): Likewise.
15147
6194aaab
L
151482008-04-23 Paolo Bonzini <bonzini@gnu.org>
15149
15150 * aclocal.m4: Regenerate.
15151 * configure: Regenerate.
15152
d491d34e
ILT
151532008-04-19 Ian Lance Taylor <iant@google.com>
15154
5ea2bac6
ILT
15155 * version.cc (version_string): Bump to 1.6.
15156
7bc3e21a
ILT
15157 * testsuite/Makefile.am (many_sections_r_test): New target.
15158 (many_sections_r_test_SOURCES): Remove.
15159 (many_sections_r_test_DEPENDENCIES): Remove.
15160 (many_sections_r_test_LDFLAGS): Remove.
15161 (many_sections_r_test_LDADD): Remove.
15162
7fcd3aa9
ILT
15163 * object.cc (Sized_relobj::do_add_symbols): Always pass
15164 local_symbol_count_ to add_from_relobj.
15165
4c94d6ae
ILT
15166 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15167 every thousand variables.
15168 * testsuite/Makefile.in: Rebuild.
15169
d491d34e
ILT
15170 * object.cc (Xindex::initialize_symtab_xindex): New function.
15171 (Xindex::read_symtab_xindex): New function.
15172 (Xindex::sym_xindex_to_shndx): New function.
15173 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15174 available.
15175 (Sized_relobj::do_initialize_xindex): New function.
15176 (Sized_relobj::do_read_symbols): Adjust section links.
15177 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15178 parameter. Change all callers.
15179 (Sized_relobj::include_section_group): Adjust section links and
15180 symbol section indexes.
15181 (Sized_relobj::do_layout): Adjust section links.
15182 (Sized_relobj::do_count_local_symbols): Adjust section links and
15183 symbol section indexes.
15184 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15185 ordinary and special symbols.
15186 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15187 dynsym_xindex parameters. Change all callers. Adjust section
15188 links. Use SHN_XINDEX when needed.
15189 (Sized_relobj::get_symbol_location_info): Adjust section links.
15190 Don't get fooled by special symbols.
15191 * object.h (class Xindex): Define.
15192 (class Object): Add xindex_ parameter. Declare virtual functoin
15193 do_initialize_xindex.
15194 (Object::adjust_sym_shndx): New function.
15195 (Object::set_xindex): New protected function.
15196 (class Symbol_value): Add is_ordinary_shndx_ field.
15197 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15198 (Symbol_value::value): Assert ordinary section.
15199 (Symbol_value::initialize_input_to_output_map): Likewise.
15200 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15201 Change all callers.
15202 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15203 all callers.
15204 (class Sized_relobj): Update declarations.
15205 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15206 parameter. Change all callers.
15207 (Sized_relobj::adjust_shndx): New function.
15208 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15209 field.
15210 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15211 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15212 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15213 (Sized_dynobj::read_dynsym_section): Adjust section links.
15214 (Sized_dynobj::read_dynamic): Likewise.
15215 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15216 section links.
15217 (Sized_dynobj::do_initialize_xindex): New function.
15218 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15219 do_initialize_xindex.
15220 (Sized_dynobj::adjust_shndx): New function.
15221 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15222 dynsym_xindex_ fields.
15223 (Layout::finalize): Add a call to set_section_indexes before
15224 creating the symtab sections.
15225 (Layout::set_section_indexes): Don't do anything if the section
15226 already has a section index.
15227 (Layout::create_symtab_sections): Add shnum parameter. Change
15228 caller. Create .symtab_shndx section if needed.
15229 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15230 caller.
15231 (Layout::allocated_output_section_count): New function.
15232 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15233 needed.
15234 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15235 fields. Update declarations.
15236 (Layout::symtab_xindex): New function.
15237 (Layout::dynsym_xindex): New function.
15238 (class Write_symbols_task): Add layout_ field.
15239 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15240 Change caller.
15241 * output.cc (Output_section_headers::Output_section_headers): Add
15242 shstrtab_section parameter. Change all callers.
15243 (Output_section_headers::do_sized_write): Store overflow values
15244 for section count and section string table section index in
15245 section header zero.
15246 (Output_file_header::do_sized_write): Check for overflow of
15247 section count and section string table section index.
15248 (Output_symtab_xindex::do_write): New function.
15249 (Output_symtab_xindex::endian_do_write): New function.
15250 * output.h (class Output_section_headers): Add shstrtab_section_.
15251 Update declarations.
15252 (class Output_symtab_xindex): Define.
15253 (Output_section::has_out_shndx): New function.
15254 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15255 field.
15256 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15257 Change all callers.
15258 (Sized_symbol::init): Likewise.
15259 (Symbol::output_section): Check for ordinary symbol.
15260 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15261 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15262 callers.
15263 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15264 Change all callers. Simplify handling of symbols from sections
15265 not included in the link.
15266 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15267 distinction.
15268 (Weak_alias_sorter::operator()): Assert that symbols are
15269 ordinary.
15270 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15271 distinction.
15272 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15273 parameters. Change all callers.
15274 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15275 symbol distinction. Use SHN_XINDEX when needed.
15276 (Symbol_table::write_section_symbol): Add symtab_xindex
15277 parameter. Change all callers.
15278 (Symbol_table::sized_write_section_symbol): Likewise. Use
15279 SHN_XINDEX when needed.
15280 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15281 declarations.
15282 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15283 (Symbol::is_defined): Check is_ordinary.
15284 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15285 (Symbol::is_absolute, Symbol::is_common): Likewise.
15286 (class Sized_symbol): Update declarations.
15287 (class Symbol_table): Update declarations.
15288 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15289 parameters. Change all callers.
15290 (Sized_symbol::override): Likewise.
15291 (Symbol_table::override): Likewise.
15292 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15293 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15294 is_ordinary, and orig_st_shndx parameters. Change all callers.
15295 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15296 to be in an ordinary section.
15297 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15298 object and is_ordinary parameters. Change all callers.
15299 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15300 Change all callers. Don't add undefined or non-ordinary symbols
15301 to reloc_map_.
15302 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15303 Change all callers.
15304 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15305 declarations.
15306 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15307 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15308 (Sized_relobj::relocate_sections): Likewise.
15309 * target-reloc.h (scan_relocs): Adjust section symbol index.
15310 (scan_relocatable_relocs): Likewise.
15311 * i386.cc (Scan::local): Check for ordinary symbols.
15312 * sparc.cc (Scan::local): Likewise.
15313 * x86_64.cc (Scan::local): Likewise.
15314 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15315 to symbol_section_and_value.
15316 * testsuite/many_sections_test.cc: New file.
15317 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15318 (check_PROGRAMS): Add many_sections_test.
15319 (many_sections_test_SOURCES): Define.
15320 (many_sections_test_DEPENDENCIES): Define.
15321 (many_sections_test_LDFLAGS): Define.
15322 (BUILT_SOURCES): Add many_sections_define.h.
15323 (many_sections_define.h): New target.
15324 (BUILT_SOURCES): Add many_sections_check.h.
15325 (many_sections_check.h): New target.
15326 (check_PROGRAMS): Add many_sections_r_test.
15327 (many_sections_r_test_SOURCES): Define.
15328 (many_sections_r_test_DEPENDENCIES): Define.
15329 (many_sections_r_test_LDFLAGS): Define.
15330 (many_sections_r_test_LDADD): Define.
15331 (many_sections_r_test.o): New target.
15332 * testsuite/Makefile.in: Rebuild.
15333
c5818ff1
CC
153342008-04-17 Cary Coutant <ccoutant@google.com>
15335
15336 * errors.cc (Errors::info): New function.
15337 (gold_info): New function.
15338 * errors.h (Errors::info): New function.
15339 * gold.h (gold_info): New function.
15340 * object.cc (Input_objects::add_object): Print trace output.
15341 * options.cc (options::parse_set): New function.
15342 (General_options::parse_wrap): Deleted.
15343 (General_options::General_options): Deleted initializer.
15344 * options.h (options::String_set): New typedef.
15345 (options::parse_set): New function.
15346 (DEFINE_set): New macro.
15347 (General_options::wrap): Changed to use DEFINE_set. Changed
15348 callers of any_wrap_symbols and is_wrap_symbol.
15349 (General_options::trace, General_options::trace_symbol):
15350 New options.
15351 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15352 (General_options::wrap_symbols_): Deleted.
15353 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15354
b5be4a7c
DM
153552008-04-17 David S. Miller <davem@davemloft.net>
15356
15357 * options.cc (General_options::parse_V): New function.
15358 * options.h: Add entries for -V and -Qy.
15359
155a0dd7
ILT
153602008-04-17 Ian Lance Taylor <iant@google.com>
15361
15362 * common.cc (Symbol_table::allocate_commons): Remove options
15363 parameter. Change caller.
15364 (Symbol_table::do_allocate_commons): Remove options parameter.
15365 Change caller. Just call do_allocate_commons_list twice.
15366 (Symbol_table::do_allocate_commons_list): New function, broken out
15367 of do_allocate_commons.
15368 * common.h (class Allocate_commons_task): Remove options_ field.
15369 Update constructor.
15370 * symtab.cc (Symbol_table::Symbol_table): Initialize
15371 tls_commons_.
15372 (Symbol_table::add_from_object): Put TLS common symbols on
15373 tls_commons_ list.
15374 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15375 which are IN_OUTPUT_DATA.
15376 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15377 allocate_commons and do_allocate_commons declarations. Declare
15378 do_allocate_commons_list.
15379 * gold.cc (queue_middle_tasks): Update creation of
15380 Allocate_commons_task to not pass options.
15381 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15382 (TLS_TEST_C_FLAGS): New variable.
15383 (tls_test_c_pic.o): New target.
15384 (tls_test_shared.so): Link in tls_test_c_pic.o.
15385 (tls_test_c_pic_ie.o): New target.
15386 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15387 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15388 (tls_test_c.o): New target.
15389 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15390 (tls_pic_test_LDADD): Likewise.
15391 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15392 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15393 (tls_test_c_gnu2.o): New target.
15394 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15395 tls_test_c_gnu2.o.
15396 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15397 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15398 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15399 * testsuite/tls_test.cc: Include "config.h".
15400 (t_last): Call t11_last.
15401 * testsuite/tls_test.h (t11, t11_last): Declare.
15402 * testsuite/tls_test_c.c: New file.
15403 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15404 * configure.ac: Check for OpenMP support.
15405 * configure, config.in, Makefile.in: Rebuild.
15406 * testsuite/Makefile.in: Rebuild.
15407
edfbb029
CC
154082008-04-16 Cary Coutant <ccoutant@google.com>
15409
15410 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15411 (Target_i386::tls_base_symbol_defined_): New field.
15412 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15413 (Target_i386::Scan::global): Likewise.
15414 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15415 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15416 (Target_x86_64::tls_base_symbol_defined_): New field.
15417 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15418 (Target_x86_64::Scan::global): Likewise.
15419
f3c69fca
CC
154202008-04-16 Cary Coutant <ccoutant@google.com>
15421
15422 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15423 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15424 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15425 building shared libraries.
15426 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15427 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15428 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15429 * testsuite/Makefile.in: Rebuild.
15430 * testsuite/weak_undef.h: New file.
15431 * testsuite/weak_undef_file1.cc: Add extra test cases.
15432 * testsuite/weak_undef_file2.cc: Likewise.
15433 * testsuite/weak_undef_test.cc: Likewise.
15434
7c414435
DM
154352008-04-16 David S. Miller <davem@davemloft.net>
15436
32b769e1
DM
15437 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15438 Add issued_non_pic_error_ field. Declare check_non_pic.
15439 (Target_sparc::Scan::check_non_pic): New function.
15440 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15441 (Target_sparc::Scan::global): Likewise.
15442
11936fb1
DM
15443 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15444 * configure: Rebuild.
15445
7c414435
DM
15446 * options.h (DEFINE_enable): New macro.
15447 (new_dtags): New enable option.
15448 (initfirst, interpose, loadfltr, nodefaultlib,
15449 nodelete, nodlopen, nodump): New -z options.
15450 * layout.cc (Layout:finish_dynamic_section): If new
15451 dtags enabled, emit DT_RUNPATH. Also, emit a
15452 DT_FLAGS_1 containing any specified -z flags.
15453
85c7bf8b
ILT
154542008-04-16 Ian Lance Taylor <iant@google.com>
15455
12c0daef
ILT
15456 * copy-relocs.cc: New file.
15457 * copy-relocs.h: New file.
15458 * reloc.cc: Remove Copy_relocs code.
15459 * reloc.h: Likewise.
15460 * reloc-types.h (struct Reloc_types) [both versions]: Add
15461 get_reloc_addend_noerror.
15462 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15463 variants of add_global which take an addend which must be zero.
15464 * i386.cc: Include "copy-relocs.h".
15465 (class Target_i386): Change type of copy_relocs_ to variable,
15466 update initializer.
15467 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15468 Change all callers.
15469 (Target_i386::do_finalize_sections): Change handling of
15470 copy_relocs_.
15471 * sparc.cc: Include "copy-relocs.h".
15472 (class Target_sparc): Change type of copy_relocs_ to variable,
15473 update initializer.
15474 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15475 Change all callers.
15476 (Target_sparc::do_finalize_sections): Change handling of
15477 copy_relocs_.
15478 * x86_64.cc: Include "copy-relocs.h".
15479 (class Target_x86_64): Change type of copy_relocs_ to variable,
15480 update initializer.
15481 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15482 class. Change all callers.
15483 (Target_x86_64::do_finalize_sections): Change handling of
15484 copy_relocs_.
15485 * Makefile.am (CCFILES): Add copy-relocs.cc.
15486 (HFILES): Add copy-relocs.h.
15487
4f4995b6
ILT
15488 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15489
85c7bf8b
ILT
15490 * testsuite/script_test_4.sh: Permit leading zeroes.
15491
4f2a9edd
ILT
154922008-04-15 Ian Lance Taylor <iant@google.com>
15493
e6188289
ILT
15494 * script-sections.cc (Script_sections::create_segments): Use
15495 header_size_adjustment even when there is enough room for the
15496 headers.
15497 * testsuite/script_test_4.sh: New file.
15498 * testsuite/script_test_4.t: New file.
15499 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15500 (check_DATA): Add script_test_4.stdout.
15501 (MOSTLYCLEANFILES): Likewise.
15502 (script_test_4): New target.
15503 (script_test_4.stdout): New target.
15504 * testsuite/Makefile.in: Rebuild.
15505
4f2a9edd
ILT
15506 * sparc.cc: Add definitions for Output_data_plt_sparc class
15507 constants.
15508
f5314dd5
DM
155092008-04-14 David S. Miller <davem@davemloft.net>
15510
15511 * sparc.cc: New file.
15512 * Makefile.am (TARGETSOURCES): Add sparc.cc
15513 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15514 * configure.tgt: Document targ_extra_size and
15515 targ_extra_big_endian. Add entries for sparc-* and
15516 sparc64-*.
15517 * configure.ac: Handle targ_extra_size and
15518 targ_extra_big_endian.
15519 * Makefile.in: Rebuild.
15520 * configure: Likewise.
15521 * po/POTFILES.in: Likewise.
15522 * po/gold.pot: Likewise.
15523
154e0e9a
ILT
155242008-04-14 Ian Lance Taylor <iant@google.com>
15525
15526 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15527 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15528 in the name/type/flags to section mapping. Don't call
15529 allocate_output_section.
15530 (Layout::choose_output_section): Change parameter from adjust_name
15531 to is_input_section. Don't permit input sections after sections
15532 are attached to segments. Don't call allocate_output_section.
15533 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15534 not write_enable_output_section.
15535 (Layout::make_output_section): Don't push to
15536 unattached_section_list_ nor call attach_to_segment. Call
15537 attach_section_to_segment if sections are attached.
15538 (Layout::attach_sections_to_segments): New function.
15539 (Layout::attach_section_to_segment): New function.
15540 (Layout::attach_allocated_section_to_segment): Rename from
15541 attach_to_segment. Remove flags parameter.
15542 (Layout::allocate_output_section): Remove function.
15543 (Layout::write_enable_output_section): Remove function.
15544 * layout.h (class Layout): Update for above changes. Add new
15545 field sections_are_attached_.
15546 * output.h (Output_section::update_flags_for_input_section): New
15547 function.
15548 * output.cc (Output_section::add_input_section): Call
15549 update_flags_for_input_section.
15550 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15551
009a67a2
CC
155522008-04-11 Cary Coutant <ccoutant@google.com>
15553
15554 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15555 thought unnecessary.
15556 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15557
759b1a24
ILT
155582008-04-11 Ian Lance Taylor <iant@google.com>
15559
15560 * output.h (class Output_section_data): Remove inline definition
15561 of set_addralign.
15562 * output.cc (Output_section_data::set_addralign): New function.
15563
c2b45e22
CC
155642008-04-11 Cary Coutant <ccoutant@google.com>
15565
15566 Add support for TLS descriptors for i386 and x86_64.
15567 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15568 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15569 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15570 GOT_TYPE_TLS_DESC.
15571 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15572 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15573 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15574 relocations.
15575 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15576 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15577 Fix problem with initial-exec relocations.
15578 (Target_i386::Relocate::relocate_tls): Likewise.
15579 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15580 relaxation.
15581 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15582 support for section-plus-offset dynamic table entries.
15583 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15584 (Output_data_dynamic::Dynamic_entry): Add support for
15585 section-plus-offset dynamic table entries.
15586 (Output_data_dynamic::Classification): Likewise.
15587 (Output_data_dynamic::classification_): Renamed offset_.
15588 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15589 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15590 (Target_x86_64::make_plt_section): New function.
15591 (Target_x86_64::reserve_tlsdesc_entries): New function.
15592 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15593 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15594 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15595 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15596 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15597 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15598 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15599 add extra PLT entry for TLS descriptors.
15600 (Output_data_plt_x86_64::got_): New field.
15601 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15602 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15603 fields.
15604 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15605 descriptors.
15606 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15607 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15608 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15609 R_386_TLS_DESC_CALL relocations.
15610 (Target_x86_64::Scan::global): Likewise.
15611 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15612 for TLS descriptors.
15613 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15614 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15615 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15616 GD-to-IE relaxation.
15617 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15618 and TLS_DESCRIPTORS.
15619 * Makefile.in: Rebuild.
15620 * configure: Rebuild.
15621 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15622 (tls_test_shared2.so): New target.
15623 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15624 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15625 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15626 (tls_shared_gd_to_ie_test_LDADD): New variable.
15627 (tls_shared_gnu2_gd_to_ie_test): New target.
15628 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15629 New targets.
15630 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15631 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15632 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15633 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15634 (tls_shared_gnu2_test): New target.
15635 (tls_test_gnu2_shared.so): New target.
15636 (tls_shared_gnu2_test_SOURCES): New variable.
15637 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15638 (tls_shared_gnu2_test_LDFLAGS): New variable.
15639 (tls_shared_gnu2_test_LDADD): New variable.
15640 * testsuite/Makefile.in: Rebuild.
15641 * testsuite/Makefile.
15642
83bfb6b7
ILT
156432008-04-11 Ian Lance Taylor <iant@google.com>
15644
15645 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15646 justsyms.t.
15647 * testsuite/Makefile.in: Rebuild.
15648
15649 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15650 long.
15651 * testsuite/script_test_2.cc (main): Adjust test.
15652
706e1f5e
ILT
156532008-04-11 David S. Miller <davem@davemloft.net>
15654 Ian Lance Taylor <iant@google.com>
15655
15656 * options.h (General_options): Add entries for '-Y' and
15657 '-relax'.
15658 * options.cc (General_options:finalize): If -Y was used, add those
15659 entries to the library path instead of the default "/lib" and
15660 "/usr/lib".
15661
7c98e6bb
DM
156622008-04-11 David S. Miller <davem@davemloft.net>
15663
15664 * testsuite/justsyms.t: Start at 0x100.
15665 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15666 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15667 long.
15668 * testsuite/script_test_2.cc: Adjust string and section length
15669 checks.
7c98e6bb 15670
99a37bfd
ILT
156712008-04-09 Ian Lance Taylor <iant@google.com>
15672
2cefc357
ILT
15673 PR gold/5996
15674 * script-sections.cc (Sections_element::allocate_to_segment): Add
15675 orphan parameter.
15676 (Output_section_definition::allocate_to_segment): Likewise.
15677 (Orphan_output_section::allocate_to_segment): Likewise.
15678 (Script_sections::attach_sections_using_phdrs_clause): Don't
15679 propagate non-PT_LOAD segments to orphan sections.
15680 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15681 readelf rather than objdump.
15682 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15683 .interp section and PT_INTERP segment are the same size.
15684 * testsuite/Makefile.in: Rebuild.
15685
99a37bfd
ILT
15686 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15687 aliases for symbols defined in the same object.
15688 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15689 (weak_alias_test_SOURCES): New variable.
15690 (weak_alias_test_DEPENDENCIES): New variable.
15691 (weak_alias_test_LDFLAGS): New variable.
15692 (weak_alias_test_LDADD): New variable.
15693 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15694 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15695 (weak_alias_test_3.o): New target.
15696 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15697 * testsuite/weak_alias_test_main.cc: New file.
15698 * testsuite/weak_alias_test_1.cc: New file.
15699 * testsuite/weak_alias_test_2.cc: New file.
15700 * testsuite/weak_alias_test_3.cc: New file.
15701
780e49c5
ILT
157022008-04-08 Ian Lance Taylor <iant@google.com>
15703
cdb0b8f5
ILT
15704 * options.h (class General_options): Add --noinhibit-exec option.
15705 * main.cc (main): Check --noinhibit-exec.
15706
0864d551
ILT
15707 * options.h (class General_options): Define --wrap as a special
15708 option. Add wrap_symbols_ field.
15709 (General_options::any_wrap_symbols): New function.
15710 (General_options::is_wrap_symbol): New function.
15711 * options.cc (General_options::parse_wrap): New function.
15712 (General_options::General_options): Initialize wrap_symbols_.
15713 * symtab.cc (Symbol_table::wrap_symbol): New function.
15714 (Symbol_table::add_from_object): Handle --wrap.
15715 * symtab.h (class Symbol_table): Declare wrap_symbol.
15716 * target.h (Target::wrap_char): New function.
15717 (Target::Target_info): Add wrap_char field.
15718 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15719 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15720 * testsuite/testfile.cc (Target_test::test_target_info):
15721 Likewise.
15722
789aa6de
ILT
15723 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15724 there is one.
15725
2c38906f
ILT
15726 * layout.h (class Layout): Add added_eh_frame_data_ field.
15727 * layout.cc (Layout::Layout): Initialize new field.
15728 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15729 output section until we find a section we merged successfully.
15730 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15731 that the size be non-zero.
15732
780e49c5
ILT
15733 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15734 qualifier.
15735
7fcd0256
ILT
157362008-04-08 Craig Silverstein <csilvers@google.com>
15737
15738 * configure.ac: Export new conditional variable HAVE_ZLIB.
15739 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15740 on HAVE_ZLIB.
15741 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15742 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15743
6835af53
ILT
157442008-04-07 Ian Lance Taylor <iant@google.com>
15745
e24f324c
ILT
15746 * version.cc (version_string): Set to "1.5".
15747
a036edd8
ILT
15748 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15749 Add issued_non_pic_error_ field. Declare check_non_pic.
15750 (Target_x86_64::Scan::check_non_pic): New function.
15751 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15752 (Target_x86_64::Scan::global): Likewise.
15753
624f8810
ILT
15754 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15755 addend parameter. Change caller. Handle merge sections.
15756 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15757 Address to Addend. Don't add in the result of
15758 local_section_offset, pass down the addend and use the returned
15759 value.
15760 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15761 Update declarations of local_section_offset and symbol_value.
15762 * testsuite/two_file_test_1.cc (t18): New function.
15763 * testsuite/two_file_test_2.cc (f18): New function.
15764 * testsuite/two_file_test_main.cc (main): Call t18.
15765 * testsuite/two_file_test.h (t18, f18): Declare.
15766
6835af53
ILT
15767 * configure.ac: Don't test for objdump, c++filt, or readelf.
15768 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15769 conditionals.
15770 (TEST_READELF): New variable.
15771 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15772 (check_PROGRAMS): Add two_file_strip_test.
15773 (two_file_strip_test): New target.
15774 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15775 (two_file_same_shared_strip_test_SOURCES): New variable.
15776 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15777 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15778 (two_file_same_shared_strip_test_LDADD): New variable.
15779 (two_file_shared_strip.so): New target.
15780 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15781 (ver_test_5.syms, ver_test_7.syms): Likewise.
15782 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15783 (strip_test_3.stdout): Use TEST_OBJDUMP.
15784 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15785
86925eef
CC
157862008-04-04 Cary Coutant <ccoutant@google.com>
15787
15788 * symtab.h (Symbol::is_weak_undefined): New function.
15789 (Symbol::is_strong_undefined): New function.
15790 (Symbol::is_absolute): New function.
15791 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15792 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15793 absolute symbols.
15794 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15795 (weak_undef_test): New target.
15796 * testsuite/Makefile.in: Rebuild.
15797 * testsuite/weak_undef_file1.cc: New file.
15798 * testsuite/weak_undef_file2.cc: New file.
15799 * testsuite/weak_undef_test.cc: New file.
15800
126f3ece
ILT
158012008-04-03 Craig Silverstein <csilvers@google.com>
15802
15803 * compressed_output.h (class Output_compressed_section): Use
15804 unsigned buffer.
15805 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15806 add zlib header.
15807 (zlib_compressed_suffix): Removed.
15808 (Output_compressed_section::set_final_data_size): Use unsigned
15809 buffers.
15810 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15811 Fix linker invocation.
15812 (flagstest_o_specialfile_and_compress_debug_sections):
15813 Likewise.
15814 * testsuite/Makefile.in: Regenerated.
15815
deae2a14
DM
158162008-04-02 David S. Miller <davem@davemloft.net>
15817
15818 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15819 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15820
70752818
ILT
158212008-04-02 Craig Silverstein <csilvers@google.com>
15822
15823 * TODO: New file.
15824
39d0cb0e
ILT
158252008-04-02 Ian Lance Taylor <iant@google.com>
15826
15827 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15828 parameters. Update for new key type to views_. Change all
15829 callers.
15830 (File_read::read): Adjust for byteshift in returned view.
15831 (File_read::add_view): New function, broken out of
15832 find_and_make_view.
15833 (File_read::make_view): New function, broken out of
15834 find_and_make_view.
15835 (File_read::find_or_make_view): Add offset and aligned
15836 parameters. Rewrite accordingly. Change all callers.
15837 (File_read::get_view): Add offset and aligned parameters. Adjust
15838 for byteshift in return value.
15839 (File_read::get_lasting_view): Likewise.
15840 * fileread.h (class File_read): Update declarations.
15841 (class File_read::View): Add byteshift_ field. Add byteshift to
15842 constructor. Add byteshift method.
15843 * archive.h (Archive::clear_uncached_views): New function.
15844 (Archive::get_view): Add aligned parameter. Change all callers.
15845 * object.h (Object::get_view): Add aligned parameter. Change all
15846 callers.
15847 (Object::get_lasting_view): Likewise.
15848
15849 * fileread.cc (File_read::release): Don't call clear_views if
15850 there are multiple objects.
15851 * fileread.h (File_read::clear_uncached_views): New function.
15852 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15853 on the archive.
15854
a1207466
CC
158552008-03-31 Cary Coutant <ccoutant@google.com>
15856
15857 Add thin archive support.
15858 * archive.cc (Archive::armagt): New const.
15859 (Archive::setup): Remove task parameter and calls to unlock.
15860 (Archive::unlock_nested_archives): New function.
15861 (Archive::read_header): Add nested_off parameter. Change
15862 all callers.
15863 (Archive::interpret_header): Likewise.
15864 (Archive::include_all_members): Change to handle thin
15865 archives.
15866 (Archive::include_member): Likewise.
15867 * archive.h (Archive::Archive): Add new parameters and
15868 initializers.
15869 (Archive::armagt): New const.
15870 (Archive::setup): Remove task parameter.
15871 (Archive::unlock_nested_archives): New function.
15872 (Archive::read_header): Add nested_off parameter.
15873 (Archive::interpret_header): Likewise.
15874 (Archive::Nested_archive_table): New typedef.
15875 (Archive::is_thin_archive_): New field.
15876 (Archive::nested_archives_): New field.
15877 (Archive::options_): New field.
15878 (Archive::dirpath_): New field.
15879 (Archive::task_): New field.
15880 * readsyms.cc (Read_symbols::do_read_symbols): Add check
15881 for thin archives. Pass additional parameters to
15882 Archive::Archive. Unlock the archive file after calling
15883 Archive::setup.
cd536b21 15884
479f6503
ILT
158852008-03-29 Ian Lance Taylor <iant@google.com>
15886
686c8caf
ILT
15887 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
15888 version symbol to be local.
15889 * testsuite/ver_test_4.sh: New file.
15890 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
15891 (check_DATA): Add ver_test_4.syms.
15892 (ver_test_4.syms): New target.
15893 * testsuite/Makefile.in: Rebuild.
15894
ab794b6b
ILT
15895 * output.cc
15896 (Output_section::Input_section_sort_entry::has_priority): New
15897 function.
15898 (Output_section::Input_section_sort_entry::match_file_name): New
15899 function.
15900 (Output_section::Input_section_sort_entry::match_section_name):
15901 Remove.
15902 (Output_section::Input_section_sort_entry::match_section_name_prefix):
15903 Remove.
15904 (Output_section::Input_section_sort_entry::match_section_file):
15905 Remove.
15906 (Output_section::Input_section_sort_compare::operator()): Rewrite
15907 using new Input_section_sort_entry functions. Sort crtbegin and
15908 crtend first. Sort sections with no priority before sections with
15909 a priority.
15910 * testsuite/initpri1.c (d3): Check j != 4.
15911 (cd5): New constructor/destructor function.
15912 (main): Check j != 2.
15913
479f6503
ILT
15914 * symtab.cc (Symbol_table::add_from_object): If we don't use the
15915 new symbol when resolving, don't call set_is_default.
15916 * testsuite/ver_test_7.cc: New file.
15917 * testsuite/ver_test_7.sh: New file.
15918 * testsuite/Makefile.am (ver_test_7.so): New target.
15919 (ver_test_7.o): New target.
15920 (check_SCRIPTS): Add ver_test_7.sh.
15921 (check_DATA): Add ver_test_7.syms.
15922 (ver_test_7.syms): New target.
15923
2fd32231
ILT
159242008-03-28 Ian Lance Taylor <iant@google.com>
15925
15926 * layout.cc (Layout::layout): If we see an input section with a
15927 name that needs sorting, set the must_sort flag for the output
15928 section.
15929 (Layout::make_output_section): If the name of the output section
15930 indicates that it might require sorting, set the may_sort flag.
15931 * output.h (Output_section::may_sort_attached_input_sections): New
15932 function.
15933 (Output_section::set_may_sort_attached_input_sections): New
15934 function.
15935 (Output_section::must_sort_attached_input_sections): New
15936 function.
15937 (Output_section::set_must_sort_attached_input_sections): New
15938 function.
15939 (class Output_section): Declare Input_section_sort_entry. Define
15940 Input_section_sort_compare. Declare
15941 sort_attached_input_sections. Add new fields:
15942 may_sort_attached_input_sections_,
15943 must_sort_attached_input_sections_,
15944 attached_input_sections_are_sorted_.
15945 * output.cc (Output_section::Output_section): Initialize new
15946 fields.
15947 (Output_section::add_input_section): Add an entry to
15948 input_sections_ if may_sort or must_sort are true.
15949 (Output_section::set_final_data_size): Call
15950 sort_attached_input_sections if necessary.
15951 (Output_section::Input_section_sort_entry): Define new class.
15952 (Output_section::Input_section_sort_compare::operator()): New
15953 function.
15954 (Output_section::sort_attached_input_sections): New function.
15955 * configure.ac: Check whether the compiler supports constructor
15956 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
15957 * testsuite/initpri1.c: New file.
15958 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
15959 CONSTRUCTOR_PRIORITY.
15960 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
15961 (initpri1_LDFLAGS): New variable.
15962 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15963
18e6b24e
ILT
159642008-03-27 Ian Lance Taylor <iant@google.com>
15965
49bdd526
ILT
15966 * common.cc (Sort_commons::operator): Correct sorting algorithm.
15967 * testsuite/common_test_1.c: New file.
15968 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
15969 (common_test_1_SOURCES): New variable.
15970 (common_test_1_DEPENDENCIES): New variable.
15971 (common_test_1_LDFLAGS): New variable.
15972
18e6b24e
ILT
15973 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
15974 and commons_ correctly when NAME/VERSION does not override
15975 NAME/NULL.
15976 * testsuite/ver_test_6.c: New file.
15977 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
15978 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
15979 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
15980
04bf7072
ILT
159812008-03-26 Ian Lance Taylor <iant@google.com>
15982
5871526f
ILT
15983 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
15984 of an undefined symbol from a version script.
15985 * testsuite/Makefile.am (ver_test_5.so): New target.
15986 (ver_test_5.o): New target.
15987 (check_SCRIPTS): Add ver_test_5.sh.
15988 (check_DATA): Add ver_test_5.syms.
15989 (ver_test_5.syms): New target.
15990 * testsuite/ver_test_5.cc: New file.
15991 * testsuite/ver_test_5.script: New file.
15992 * testsuite/ver_test_5.sh: New file.
15993 * Makefile.in, testsuite/Makefile.in: Rebuild.
15994
04bf7072
ILT
15995 PR gold/5986
15996 Fix problems building gold with gcc 4.3.0.
15997 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
15998 (gold_error_at_location, gold_warning_at_location): Use it.
15999 * configure.ac: Check whether we can compile and use a template
16000 function with a printf attribute.
16001 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16002 when jumping over bytes.
16003 * object.cc: Instantiate Object::read_section_data.
16004 * debug.h: Include <cstring>
16005 * dwarf_reader.cc: Include <algorithm>
16006 * main.cc: Include <cstring>.
16007 * options.cc: Include <cstring>.
16008 * output.cc: Include <cstring>.
16009 * script.cc: Include <cstring>.
16010 * script.h: Include <string>.
16011 * symtab.cc: Include <cstring> and <algorithm>.
16012 * target-select.cc: Include <cstring>.
16013 * version.cc: Include <string>.
16014 * testsuite/testmain.cc: Include <cstdlib>.
16015 * configure, config.in: Rebuild.
16016
874c5b28
ILT
160172008-03-25 Ian Lance Taylor <iant@google.com>
16018
819d6c3a
ILT
16019 * options.cc: Include "../bfd/bfdver.h".
16020 (options::help): Print bug reporting address.
16021
f4b2c6f5
ILT
16022 * version.cc (print_version): Adjust output for current value of
16023 BFD_VERSION_STRING.
16024
16025 * NEWS: New file.
16026
e96caa79
ILT
16027 * options.cc (options::help): Print list of supported targets.
16028 * target-select.h: Include <vector>.
16029 (class Target_selector): Make machine_, size_, and is_big_endian_
16030 fields const. Add bfd_name_ and instantiated_target_ fields.
16031 (Target_selector::Target_selector): Add bfd_name parameter.
16032 (Target_selector::recognize): Make non-virtual, call
16033 do_recognize.
16034 (Target_selector::recognize_by_name): Make non-virtual, call
16035 do_recognize_by_name.
16036 (Target_selector::supported_names): New function.
16037 (Target_selector::bfd_name): New function.
16038 (Target_selector::do_instantiate_target): New pure virtual
16039 function.
16040 (Target_selector::do_recognize): New virtual function.
16041 (Target_selector::do_recognize_by_name): New virtual function.
16042 (Target_selector::instantiate_target): New private function.
16043 (supported_target_names): Declare.
16044 * target-select.cc (Target_selector::Target_selector): Update for
16045 new parameter and fields.
16046 (select_target_by_name): Check that the name matches before
16047 calling recognize_by_name.
16048 (supported_target_names): New function.
16049 * i386.cc (class Target_selector_i386): Update Target_selector
16050 constructor call. Remove recognize and recognize_by_name. Add
16051 do_instantiate_target.
16052 * x86_64.cc (class Target_selector_x86_64): Likewise.
16053 * testsuite/testfile.cc (class Target_selector_test): Update for
16054 changes to Target_selector.
16055
874c5b28
ILT
16056 * README: Rewrite, with some notes on unsupported features.
16057
0a65a3a7
CC
160582008-03-24 Cary Coutant <ccoutant@google.com>
16059
16060 * i386.cc (Target_i386::Got_type): New enum declaration.
16061 (Target_i386::Scan::local): Updated callers of Output_data_got
16062 member functions.
16063 (Target_i386::Scan::global): Likewise.
16064 (Target_i386::Relocate::relocate): Likewise.
16065 (Target_i386::Relocate::relocate_tls): Likewise.
16066 * object.h (Got_offset_list): New class.
16067 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16068 (Sized_relobj::local_got_offset): Likewise.
16069 (Sized_relobj::set_local_got_offset): Likewise.
16070 (Sized_relobj::local_has_tls_got_offset): Removed.
16071 (Sized_relobj::local_tls_got_offset): Removed.
16072 (Sized_relobj::set_local_tls_got_offset): Removed.
16073 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16074 * output.cc (Output_data_got::add_global): Added got_type parameter.
16075 (Output_data_got::add_global_with_rel): Likewise.
16076 (Output_data_got::add_global_with_rela): Likewise.
16077 (Output_data_got::add_global_pair_with_rel): New function.
16078 (Output_data_got::add_global_pair_with_rela): New function.
16079 (Output_data_got::add_local): Added got_type parameter.
16080 (Output_data_got::add_local_with_rel): Likewise.
16081 (Output_data_got::add_local_with_rela): Likewise.
16082 (Output_data_got::add_local_pair_with_rel): New function.
16083 (Output_data_got::add_local_pair_with_rela): New function.
16084 (Output_data_got::add_global_tls): Removed.
16085 (Output_data_got::add_global_tls_with_rel): Removed.
16086 (Output_data_got::add_global_tls_with_rela): Removed.
16087 (Output_data_got::add_local_tls): Removed.
16088 (Output_data_got::add_local_tls_with_rel): Removed.
16089 (Output_data_got::add_local_tls_with_rela): Removed.
16090 * output.h (Output_data_got::add_global): Added got_type parameter.
16091 (Output_data_got::add_global_with_rel): Likewise.
16092 (Output_data_got::add_global_with_rela): Likewise.
16093 (Output_data_got::add_global_pair_with_rel): New function.
16094 (Output_data_got::add_global_pair_with_rela): New function.
16095 (Output_data_got::add_local): Added got_type parameter.
16096 (Output_data_got::add_local_with_rel): Likewise.
16097 (Output_data_got::add_local_with_rela): Likewise.
16098 (Output_data_got::add_local_pair_with_rel): New function.
16099 (Output_data_got::add_local_pair_with_rela): New function.
16100 (Output_data_got::add_global_tls): Removed.
16101 (Output_data_got::add_global_tls_with_rel): Removed.
16102 (Output_data_got::add_global_tls_with_rela): Removed.
16103 (Output_data_got::add_local_tls): Removed.
16104 (Output_data_got::add_local_tls_with_rel): Removed.
16105 (Output_data_got::add_local_tls_with_rela): Removed.
16106 * resolve.cc (Symbol::override_base_with_special): Removed
16107 reference to has_got_offset_ field.
16108 * symtab.cc (Symbol::init_fields): Replaced initialization
16109 of got_offset_ with got_offsets_. Removed initialization
16110 of has_got_offset_
53fcba31 16111 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16112 (Symbol::got_offset): Likewise.
16113 (Symbol::set_got_offset): Likewise.
16114 (Symbol::has_tls_got_offset): Removed.
16115 (Symbol::tls_got_offset): Removed.
16116 (Symbol::set_tls_got_offset): Removed.
16117 (Symbol::got_offset_): Removed.
16118 (Symbol::tls_mod_got_offset_): Removed.
16119 (Symbol::tls_pair_got_offset_): Removed.
16120 (Symbol::got_offsets_): New field.
16121 (Symbol::has_got_offset): Removed.
16122 (Symbol::has_tls_mod_got_offset): Removed.
16123 (Symbol::has_tls_pair_got_offset): Removed.
16124 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16125 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16126 member functions.
16127 (Target_x86_64::Scan::global): Likewise.
16128 (Target_x86_64::Relocate::relocate): Likewise.
16129 (Target_x86_64::Relocate::relocate_tls): Likewise.
16130
bd52eafb
BE
161312008-03-25 Ben Elliston <bje@au.ibm.com>
16132
16133 * yyscript.y: Fix spelling error in comment.
16134
8b105e34
ILT
161352008-03-24 Ian Lance Taylor <iant@google.com>
16136
8ed814a9
ILT
16137 * options.h (class General_options): Define build_id option.
16138 * layout.h (class Layout): Declare write_build_id, create_note,
16139 create_build_id. Add build_id_note_ member.
16140 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16141 "libiberty.h", "md5.h", "sha1.h".
16142 (Layout::Layout): Initialize eh_frame_data_,
16143 eh_frame_hdr_section_, and build_id_note_.
16144 (Layout::finalize): Call create_build_id.
16145 (Layout::create_note): New function, broken out of
16146 Layout::create_gold_note.
16147 (Layout::create_gold_note): Call create_note.
16148 (Layout::create_build_id): New function.
16149 (Layout::write_build_id): New function.
16150 (Close_task_runner::run): Call write_build_id.
16151
8b105e34
ILT
16152 * x86_64.cc: Correct license to GPLv3.
16153
086a1841
ILT
161542008-03-23 Ian Lance Taylor <iant@google.com>
16155
16156 * options.cc: Include "demangle.h".
16157 (parse_optional_string): New function.
16158 (parse_long_option): Handle takes_optional_argument.
16159 (parse_short_option): Update dash_z initializer. Handle
16160 takes_optional_argument.
16161 (General_options::General_options): Initialize do_demangle_.
16162 (General_options::finalize): Set do_demangle_. Handle demangling
16163 style.
16164 * options.h (parse_optional_string): Declare.
16165 (struct One_option): Add optional_arg field. Update constructor.
16166 Update call constructor calls. Add takes_optional_argument
16167 function.
16168 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16169 (DEFINE_optional_string): Define.
16170 (General_options::demangle): Change from DEFINE_bool to
16171 DEFINE_optional_string.
16172 (General_options::no_demangle): New function.
16173 (General_options::do_demangle): New function.
16174 (General_options::set_do_demangle): New function.
16175 (General_options::execstack_status_): Move definition to end of
16176 class definition.
16177 (General_options::static_): Likewise.
16178 (General_options::do_demangle_): New field.
16179 * object.cc (big_endian>::get_symbol_location_info): Call
16180 Options::do_demangle, not Options::demangle.
16181 * symtab.cc (demangle): Likewise.
16182
cbb93e63
ILT
161832008-03-22 Ian Lance Taylor <iant@google.com>
16184
16185 * gold.h: Include <cstddef> and <sys/types.h>
16186 * options.h: Include <cstring>.
16187
ec531623
ILT
161882008-03-21 Ian Lance Taylor <iant@google.com>
16189
16190 * Added source code to GNU binutils.
752937aa 16191\f
4b95cf5c 16192Copyright (C) 2008-2014 Free Software Foundation, Inc.
752937aa
NC
16193
16194Copying and distribution of this file, with or without modification,
16195are permitted in any medium without royalty provided the copyright
16196notice and this notice are preserved.
16197
16198Local Variables:
16199mode: change-log
16200left-margin: 8
16201fill-column: 74
16202version-control: never
16203End:
This page took 1.092189 seconds and 4 git commands to generate.