BFD: Add support for more than one plugin in lib/bfd-plugins
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
635aa30e
CC
12014-09-23 Taiju Tsuiki <tzik@google.com>
2 Cary Coutant <ccoutant@google.com>
3
71b9b91b 4 PR gold/14860
635aa30e
CC
5 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
6 on input_sections_blocker.
7 * layout.cc (Write_sections_task::locks): Unblock
8 input_sections_blocker_.
9 * layout.h (Write_sections_task::Write_sections_task): Add
10 input_sections_blocker.
11 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
12 to DEPENDENCIES.
13 * testsuite/Makefile.in: Regenerate.
14
c0c71592
RÁE
152014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
16
17 * testsuite/Makefile.am (plugin_test_10): New test.
18 * testsuite/Makefile.in: Regenerate
19 * testsuite/plugin_common_test_2.c (c1): Align to 8.
20 * testsuite/plugin_test_10.sh: New file.
21
6168c2a1
RÁE
222014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
23
24 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
25 * resolve.cc (Symbol_table::resolve): Don't override common symbols
26 during the replacement phase.
27
3a531937
JY
282014-09-17 Han Shen <shenhan@google.com>
29 Jing Yu <jingyu@google.com>
30
31 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
32 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
33 * aarch64.cc (Target_aarch64): Add data members
34 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
35 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
36 constructor.
37 (Target_aarch64::do_reloc_symbol_index): New method.
38 (Target_aarch64::do_reloc_addend): New method.
39 (Target_aarch64::add_tlsdesc_info): New method.
40 (Target_aarch64::do_dynsym_value): New method.
41 (Target_aarch64::do_make_data_plt): Add new parameters: got,
42 got_irelative. Pass them to Output_data_plt_aarch64_standard.
43 (Target_aarch64::make_data_plt): Add new parameters: got,
44 got_irelative. Pass them to do_make_data_plt.
45 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
46 (Target_aarch64::Relocate:tls_gd_to_le): New method.
47 (Target_aarch64::Relocate:tls_ie_to_le): New method.
48 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
49 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
50 (Target_aarch64::got_tlsdesc_section): New method.
51 (Target_aarch64::make_local_ifunc_plt_entry): New method.
52 (Target_aarch64::define_tls_base_symbol): New method.
53 (Target_aarch64::reserve_tlsdesc_entries): New method.
54 (Target_aarch64::got_mod_index_entry): New method.
55 (Target_aarch64::rela_tlsdesc_section): New method.
56 (Target_aarch64::rela_irelative_section): New method.
57 (Target_aarch64::Tlsdesc_info): New struct.
58 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
59 relocations and tlsdesc relocations.
60 (Target_aarch64::optimize_tls_reloc): Implement method.
61 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
62 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
63 in constructor.
64 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
65 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
66 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
67 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
68 (Output_data_plt_aarch64::rela_tlsdesc): New method.
69 (Output_data_plt_aarch64::rela_irelative): New method.
70 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
71 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
72 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
73 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
74 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
75 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
76 (Output_data_plt_aarch64_standard): New member variables:
77 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
78 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
79 New parameter: got, got_irelative.
80 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
81 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
82 (Output_data_plt_aarch64::do_write): Replace got_address with
83 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
84 (AArch64_relocate_functions::update_movnz): New method.
85 (AArch64_relocate_functions): Correct format.
86 (AArch64_relocate_functions::movnz): New method.
87 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
88 before the switch. Add new cases to switch.
89 Check ie_to_le relaxation on tlsie relocations. Add code handling
90 tlsgd tlsdesc cases.
91 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
92 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
93 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
94 Call reloc_name_in_error_message to print unsupported reloc.
95 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
96 make_data_plt.
97 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
98 relocs. Fill in some more dynamic tags.
99 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
100 Skip call tls_get_addr when tlsgd is relaxed.
101 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
102 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
103 tlsdesc->ie relaxation.
104
62661c93
SS
1052014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
106
107 * mips.cc (Target_mips_nacl): New class.
108 (Target_selector_mips_nacl): New class.
109 (target_selector_mips32): Rename from target_selector_mips32be and use
110 Target_selector_mips_nacl instead of Target_selector_mips.
111 (target_selector_mips32el): Rename from target_selector_mips32 and use
112 Target_selector_mips_nacl instead of Target_selector_mips.
113 (target_selector_mips64): Rename from target_selector_mips64be and use
114 Target_selector_mips_nacl instead of Target_selector_mips.
115 (target_selector_mips64el): Rename from target_selector_mips64 and use
116 Target_selector_mips_nacl instead of Target_selector_mips.
117 (Target_mips::mips_info): Add const attribute.
118
54674d38
CC
1192014-09-02 Cary Coutant <ccoutant@google.com>
120
121 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
122 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
123 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
124 (Sized_incr_dynobj::do_section_name): Likewise.
125 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
126 (Sized_incr_dynobj::do_section_name): Likewise.
127 * object.h (Object::section_name): Likewise.
128 (Object::do_section_name): Likewise.
129 (Sized_relobj_file::do_section_name): Likewise.
130 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
131 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
132
9860cbcf
CC
1332014-09-02 Cary Coutant <ccoutant@google.com>
134
135 PR gold/17005
136 * ehframe.cc (Fde::write): Add output_offset parameter.
137 (Cie::write): Likewise.
138 (Eh_frame::set_final_data_size): Account for offset within output
139 section.
140 (Eh_frame::do_sized_write): Likewise.
141 * ehframe.h (Fde::write): Add output_offset parameter.
142 (Cie::write): Likewise.
143 * output.cc (Output_section::Input_section_sort_entry): Remove
144 section_has_name_; add output_section_name parameter. Use
145 output section name for non-input sections.
146 (Output_section::Input_section_sort_entry::section_has_name): Remove.
147 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
148 (Output_section::Input_section_sort_compare): Remove logic for
149 sections without names.
150 (Output_section::Input_section_sort_init_fini_compare): Likewise.
151 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
152 Likewise.
153 (Output_section::Input_section_sort_section_name_compare): Likewise.
154
8e33481e
HS
1552014-08-29 Han Shen <shenhan@google.com>
156 Jing Yu <jingyu@google.com>
157
158 * aarch64-reloc-property.cc
159 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
160 reference reloc property in the table.
161 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
162 3 other entries.
163 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
164 2 new overloaded methods.
165 (Output_data_got_aarch64::do_write): Add code to write out
166 static relocs.
167 (class Output_data_got_aarch64::Static_reloc): New class to wrap
168 static relocs.
169 (Output_data_got_aarch64::static_relocs): New vector to
170 hold static relocs.
171 (Target_aarch64::TCB_SIZE): New const static memeber.
172 (Target_aarch64::tcb_size): New method.
173 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
174 (Target_aarch64::Relocate::relocate_tls): New method.
175 (Target_aarch64::Scan::local): Add code handling new reloc types.
176 (Target_aarch64::Scan::global): Add code handling new reloc types.
177
81233653
ST
1782014-08-13 Sriraman Tallam <tmsriram@google.com>
179
180 * options.h (-no-pie): Add option.
181
9363c7c3
JY
1822014-08-08 Jing Yu <jingyu@google.com>
183 Han Shen <shenhan@google.com>
184
185 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
186 (DEFFILES): add aarch64-reloc.def.
187 (TARGETSOURCES): Add aarch64-reloc-property.cc.
188 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
189 * Makefile.in: Regenerate.
190 * aarch64-reloc-property.cc: New file.
191 * aarch64-reloc-property.h: New file.
192 * aarch64-reloc.def: New file.
193 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
194 with tab to make the format consistent.
195 (Output_data_got_aarch64::symbol_table_): New method.
196 (Target_aarch64::do_plt_address_for_global): New method.
197 (Target_aarch64::do_plt_address_for_local): New method.
198 (Target_aarch64::do_select_as_default_target): New method.
199 (Target_aarch64::do_make_data_plt): New method.
200 (Target_aarch64::make_data_plt): New method.
201 (Output_data_plt_aarch64::has_irelative_section): New method.
202 (Output_data_plt_aarch64::address_for_global): New method.
203 (Output_data_plt_aarch64::address_for_local): New method.
204 (Output_data_plt_aarch64::irelative_rel_): New parameter.
205 (Output_data_plt_aarch64::add_entry): Implement contents.
206 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
207 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
208 the got_pov entry to plt0.
209 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
210 Implement contents.
211 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
212 (AArch64_howto): New struct.
213 (aarch64_howto[]): New static const array.
214 (AArch64_relocate_functions): New class.
215 (Target_aarch64::Scan::get_reference_flags): Remove method.
216 (Target_aarch64::Scan::local): Implement to support a few relocations.
217 (Target_aarch64::Scan::global): Implement to support a few relocations.
218 (Target_aarch64::make_plt_section): Implement contents.
219 (Target_aarch64::make_plt_entry): Implement contents.
220 (Target_aarch64::do_finalize_sections): Implement contents.
221 (Target_aarch64::Relocate::relocate): Implement a few relocations.
222 (Target_aarch64::relocate_section): Implement contents.
223
ad9fe6c1
AM
2242014-08-06 Alan Modra <amodra@gmail.com>
225
226 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
227
7cd4e5b7
AM
2282014-08-06 Alan Modra <amodra@gmail.com>
229
230 PR 13227
231 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
232
5ad9b0a7
ST
2332014-07-21 Sriraman Tallam <tmsriram@google.com>
234
235 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 236 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 237
e051745c
CC
2382014-07-08 Cary Coutant <ccoutant@google.com>
239
240 * expression.cc (struct Expression::Expression_eval_info): Add
241 new fields type_pointer, vis_pointer, and nonvis_pointer.
242 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
243 nonvis_pointer parameters. Adjust all calls.
244 (Symbol_expression::value): Update type, visibility, and nonvis bits
245 in caller.
246 * script.cc (Symbol_assignment::sized_finalize): Update type,
247 visibility, and remaining st_other bits for new symbol.
248 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
249 vis_pointer, and nonvis_pointer parameters.
250 * symtab.h (Symbol::set_type): New method.
251
252 * testsuite/Makefile.am (defsym_test): New test.
253 * testsuite/Makefile.in: Regenerate.
254 * testsuite/defsym_test.c: New file.
255 * testsuite/defsym_test.sh: New file.
256
f35c4853
CC
2572014-07-08 Cary Coutant <ccoutant@google.com>
258
259 PR gold/15639
260 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
261 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
262 (Sized_dynobj::base_read_symbols): ...new method.
263 * object.h (Sized_relobj_file::base_read_symbols): New method.
264 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
265 (Sized_relobj_file::base_read_symbols): ...new method.
266 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
267 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
268 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
269
2900af2d
AM
2702014-07-04 Alan Modra <amodra@gmail.com>
271
272 * po/POTFILES.in: Regenerate.
273
053a4d68
JY
2742014-07-02 Jing Yu <jingyu@google.com>
275
276 * aarch64.cc: New file
277 * Makefile.am (TARGETSOURCES): Add aarch64.cc
278 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
279 * Makefile.in: Regenerate.
280 * configure.tgt: Add entries for aarch64*.
281 * configure.ac: Likewise.
282 * configure: Likewise.
283
7b549045
AM
2842014-06-27 Alan Modra <amodra@gmail.com>
285
286 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
287
cb818dbf
CC
2882014-06-24 Cary Coutant <ccoutant@google.com>
289
290 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
291 sections.
292 (Dwo_file::sized_read_unit_index): Likewise.
293
9810d34d
SS
2942014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
295
296 * mips.cc: New file.
297 * Makefile.am (TARGETSOURCES): Add mips.cc
298 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
299 * configure.tgt: Add entries for mips*.
300 * configure.ac: Likewise.
301 * Makefile.in: Regenerate.
302 * configure: Likewise.
303
9baa787b
CC
3042014-06-09 Cary Coutant <ccoutant@google.com>
305
306 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
307 unit_length is within section bounds.
308
8f89af0a
CC
3092014-06-09 Cary Coutant <ccoutant@google.com>
310
311 PR gold/16980
312 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
313 map.
314
a47622ac
AM
3152014-06-07 Alan Modra <amodra@gmail.com>
316
317 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
318
4320c691
CC
3192014-06-06 Cary Coutant <ccoutant@google.com>
320
321 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
322 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
323 (Dwarf_pubnames_table::read_header): Likewise.
324 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
325 .debug_gnu_pubtypes.
326
270c9937
JB
3272014-06-05 Joel Brobecker <brobecker@adacore.com>
328
329 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
330 * Makefile.in, configure: Regenerate.
331
397998fc
AM
3322014-06-03 Alan Modra <amodra@gmail.com>
333
334 * powerpc.cc (addis_12_2): Define.
335 (Stub_table::do_write): Support fusion on ELFv2 stubs.
336
61f5c66f
AM
3372014-06-03 Alan Modra <amodra@gmail.com>
338
339 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
340 st_other output.
341
f6971787
AM
3422014-06-02 Alan Modra <amodra@gmail.com>
343
344 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
345 Only ignore relocs on ELFv1.
346 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
347
f6fb8322
CC
3482014-05-30 Cary Coutant <ccoutant@google.com>
349
350 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
351 * testsuite/Makefile.in: Regenerate.
352 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
353
c23dd342
L
3542014-05-27 H.J. Lu <hongjiu.lu@intel.com>
355
356 PR gold/16945
357 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
358 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
359
5fe7ffdc
AM
3602014-05-15 Alan Modra <amodra@gmail.com>
361
362 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
363 Compare FDE contents with DW_CFA_nop rather than 0.
364
a82bef93
ST
3652014-05-13 Sriraman Tallam <tmsriram@google.com>
366
367 * symtab.h (may_need_copy_reloc): Remove check for position independent
368 code.
369 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
370 position independence before pc absolute may_need_copy_reloc call.
371 Add check for executable output befor pc relative may_need_copy_reloc
372 call.
373 * i386.cc: Ditto.
374 * arm.cc: Ditto.
375 * sparc.cc: Ditto.
376 * tilegx.cc: Ditto.
377 * powerpc.cc: Add check for no position independence before
378 may_need_copy_reloc calls.
379 * testsuite/pie_copyrelocs_test.cc: New file.
380 * testsuite/pie_copyrelocs_shared_test.cc: New file.
381 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 382 * Makefile.in: Regenerate.
a82bef93 383
53c66605
ML
3842014-05-08 Martin Liška <mliska@suse.cz>
385
386 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
387
57b2284c
CC
3882014-05-06 Cary Coutant <ccoutant@google.com>
389
390 PR gold/16900
391 * i386.cc (Output_data_got_plt_i386): New class.
392 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
393 parameter. Change all callers.
394 (Output_data_plt_i386::layout_): Remove.
395 (Output_data_plt_i386::got_plt_): Change type.
396 (Target_i386::got_plt_): Change type. Change all references.
397 (Target_i386::got_section): Create instance of new class.
398 (Output_data_got_plt_i386::do_write): New function.
399 * x86_64.cc (Output_data_got_plt_x86_64): New class.
400 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
401 parameter. Change all callers.
402 (Output_data_plt_x86_64::layout_): Remove.
403 (Output_data_plt_x86_64::got_plt_): Change type.
404 (Target_x86_64::got_plt_): Change type. Change all references.
405 (Target_x86_64::got_section): Create instance of new class.
406 (Output_data_got_plt_x86_64::do_write): New function.
407 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
408 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
409 class.
410
6b97515d 4112014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 412
6b97515d
CC
413 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
414 if we have pubnames/pubtypes.
415
d1bddd3c
CC
4162014-05-02 Cary Coutant <ccoutant@google.com>
417
5fe7ffdc
AM
418 * defstd.cc (in_segment): Define __ehdr_start here...
419 * layout.cc (Layout::finalize): ...Instead of here. Set the
420 output segment when known.
421 * resolve.cc (Symbol::override_base_with_special): Remember
422 the original binding.
423 * symtab.cc (Symbol::set_output_segment): New function.
424 (Symbol::set_undefined): New function.
425 * symtab.h (Symbol::is_weak_undefined): Check original undef
426 binding.
427 (Symbol::is_strong_undefined): New function.
428 (Symbol::set_output_segment): New function.
429 (Symbol::set_undefined): New function.
430 * target-reloc.h (is_strong_undefined): Remove.
431 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
432 Check for hidden undefs.
433 (relocate_section): Call Symbol::is_strong_undefined.
434
435 * testsuite/Makefile.am (ehdr_start_test_1)
436 (ehdr_start_test_2, ehdr_start_test_3)
437 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
438 * testsuite/Makefile.in: Regenerate.
439 * testsuite/ehdr_start_def.cc: New source file.
440 * testsuite/ehdr_start_test.cc: New source file.
441 * testsuite/ehdr_start_test.t: New linker script.
442 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 443
7849f6d8
CC
4442014-04-23 Cary Coutant <ccoutant@google.com>
445
bf2cc635 446 PR gold/16870
7849f6d8
CC
447 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
448
99fd8cff
CC
4492014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
450
451 * layout.cc (Layout::include_section): Allow a target to decide
452 whether to include a section.
453 * target.h (Target::should_include_section): New function.
454 (Target::do_should_include_section): New function.
455
91f43acd
CC
4562014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
457
458 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
459 inline into ...
460 (Copy_relocs::emit): ... here.
461 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
462 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
463 (Copy_reloc_entry::entries_): Change from private to protected.
464
c4eb27e1
ST
4652014-04-02 Sriraman Tallam <tmsriram@google.com>
466
467 * icf.cc (get_section_contents): Replace copies of reloc
468 vectors with const references.
469
ae447ddd
CC
4702014-04-02 Cary Coutant <ccoutant@google.com>
471
472 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
473 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
474 * configure: Regenerate.
475 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
476 -fno-use-linker-plugin.
477 (LINK1, CXXLINK1): Add it to the link command.
478 * testsuite/Makefile.in: Regenerate.
479
fa47fa92
AM
4802014-03-12 Alan Modra <amodra@gmail.com>
481
482 * Makefile.in: Regenerate.
483
9b12c500
CC
4842014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
485
486 * symtab.h (Symbol::set_nonvis): New function.
487
beacaa96
CC
4882014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
489
490 * symtab.cc (Sized_symbol<32>::init_output_data):
491 Instantiate the template.
492 (Sized_symbol<64>::init_output_data): Likewise.
493
800d9823
CC
4942014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
495
496 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
497 adjust dynamic symbol value.
498 * target.h (Target::adjust_dyn_symbol): New function.
499 (Target::do_adjust_dyn_symbol): New function.
500
918fc1f8 5012014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 502
918fc1f8
CC
503 * output.cc (Output_data_dynamic::Dynamic_entry::write):
504 Get the value of DYNAMIC_CUSTOM dynamic entry.
505 * output.h (Output_data_dynamic::add_custom): New function.
506 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
507 dynamic entry.
508 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
509 * target.h (Target::dynamic_tag_custom_value): New function.
510 (Target::do_dynamic_tag_custom_value): New function.
511
98ff9231
CC
5122014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
513
514 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
515 dynsym indexes.
516 * target.h (Target::has_custom_set_dynsym_indexes): New function.
517 (Target::do_has_custom_set_dynsym_indexes): New function.
518 (Target::set_dynsym_indexes): New function.
519 (Target::do_set_dynsym_indexes): New function.
520
b80eed39
AM
5212014-03-07 Alan Modra <amodra@gmail.com>
522
523 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
524 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
525 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
526 (Powerpc_relocate_functions::has_overflow_bitfield,
527 overflowed): Use the above.
528 (Target_powerpc::Relocate::relocate): Correct overflow checking
529 for a number of relocations. Modify overflow test for 16-bit
530 fields in instructions to signed/unsigned according to whether
531 the field takes a signed or unsigned value.
532
4b95cf5c
AM
5332014-03-05 Alan Modra <amodra@gmail.com>
534
535 Update copyright years.
536
45965137
AM
5372014-03-05 Alan Modra <amodra@gmail.com>
538
539 * powerpc.cc (Target_powerpc::Scan::local, global): Support
540 R_PPC64_ADDR64_LOCAL.
541 (Target_powerpc::Relocate::relocate): Likewise.
542
2c80b753
AM
5432014-03-03 Alan Modra <amodra@gmail.com>
544
545 * dwp.cc (print_version): Update copyright year to current.
546
c1c69e83
AM
5472014-02-10 Alan Modra <amodra@gmail.com>
548
549 * po/gold.pot: Regenerate.
550
dd0c4e70
CC
5512014-02-06 Cary Coutant <ccoutant@google.com>
552
553 Fix problem where -u is ignored when a weak undef is seen.
554
555 * archive.cc (Library_base::should_include_member): Reorder
556 code to check for -u option if a weak undef has already been seen.
557 * testsuite/Makefile.am (weak_undef_test_2): New test case.
558 * testsuite/Makefile.in: Regenerate.
559 * testsuite/weak_undef_file3.cc: New file.
560 * testsuite/weak_undef_file4.cc: New file.
561 * testsuite/weak_undef_test_2.cc: New file.
562
1a221d3d
CC
5632014-02-05 Cary Coutant <ccoutant@google.com>
564
565 Fix issues with gold undefined symbol diagnostics.
566
567 PR binutils/15435
568 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
569 check to here.
570 * target-reloc.h (is_strong_undefined): New function.
571 (relocate_section): Move undef vtable symbol check from here.
572 Check for is_strong_undefined.
573
e889f0a4 5742014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 575
e889f0a4
CC
576 Fix problems with the --dynamic-list option.
577
578 PR gold/13577
579 * options.cc (General_options::parse_dynamic_list):
580 Set have_dynamic_list_.
581 (General_options::General_options): Initialize have_dynamic_list_.
582 (General_options::finalize): Turn off -Bsymbolic and
583 -Bsymbolic-functions if --dynamic-list provided.
584 * options.h (General_options::have_dynamic_list): New function.
585 (General_options::have_dynamic_list_): New data member.
586 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
587 correctly.
5fe7ffdc 588
e889f0a4
CC
589 PR gold/16530
590 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
591 in --dynamic-list, mark it.
5fe7ffdc 592
e889f0a4
CC
593 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
594 (dynamic_list_2): New test case.
595 * testsuite/Makefile.in: Regenerate.
596 * testsuite/dynamic_list_2.cc: New file.
597 * testsuite/dynamic_list_2.t: New file.
598 * testsuite/dynamic_list_lib1.cc: New file.
599 * testsuite/dynamic_list_lib2.cc: New file.
600 * testsuite/gc_dynamic_list_test.c: New file.
601 * testsuite/gc_dynamic_list_test.sh: New file.
602 * testsuite/gc_dynamic_list_test.t: New file.
603
ec673e64
CC
6042014-01-28 Cary Coutant <ccoutant@google.com>
605
606 Add .gdb_index version 7 support.
607
608 * gold/dwarf_reader.cc: include <utility> (for make_pair).
609 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
610 debug sections.
611 (Dwarf_ranges_table::read_ranges_table): Likewise.
612 (Dwarf_pubnames_table::read_section): Check for GNU-style
613 sections, and for compressed debug sections.
614 (Dwarf_pubnames_table::read_header): Compute end address of table.
615 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
616 for end of list by offset, not by offset == 0.
617 (Dwarf_info_reader::do_read_string_table): Check for compressed
618 debug sections.
619 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
620 Initialize new data members.
621 (Dwarf_pubnames_table::next_name): return flag_byte.
622 (Dwarf_pubnames_table::end_of_table_): New data member.
623 (Dwarf_pubnames_table::is_gnu_style_): New data member.
624 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
625 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
626 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
627 read skeleton type unit DIEs.
628 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
629 (Gdb_index::do_write): Write flag_byte.
630 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
631 (Gdb_index::Cu_vector): Store flags along with cu indexes.
632 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
633 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
634
221fd5d5
L
6352014-01-08 H.J. Lu <hongjiu.lu@intel.com>
636
637 * version.cc (print_version): Update copyright year to 2014.
638
6c09fb0b
ILT
6392013-12-19 Dimitry Andric <dimitry@andric.com>
640
641 * stringpool.cc (Stringpool_template::reserve): Add
642 HAVE_UNORDERED_MAP case.
643 * stringpool.cc (Stringpool_template::print_stats): Likewise.
644
8356f2d0
CC
6452013-12-18 Cary Coutant <ccoutant@google.com>
646
647 * configure.ac: Check for <unordered_set> and <unordered_map>.
648 * config.in: Regenerate.
649 * configure: Regenerate.
650 * system.h: Use <unordered_set> and <unordered_map> if available.
651
f2c7d7ee
RM
6522013-12-10 Roland McGrath <mcgrathr@google.com>
653
654 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
655 with $(INSTALL_PROGRAM_ENV).
656 * Makefile.in: Regenerate.
657
6632e8cc
CC
6582013-11-22 Cary Coutant <ccoutant@google.com>
659
660 * configure.ac: Add check for which library is needed for
661 dlopen.
662 * configure: Regenerate.
663
0c075858
CC
6642013-11-22 Cary Coutant <ccoutant@google.com>
665
666 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
667 assembler.
668 * testsuite/Makefile.in: Regenerate.
669
f49fe902
L
6702013-11-17 H.J. Lu <hongjiu.lu@intel.com>
671
672 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
673 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
674 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
675 (Target_x86_64<size>::Scan::local): Likewise.
676 (Target_x86_64<size>::Scan::global): Likewise.
677 (Target_x86_64<size>::Relocate::relocate): Likewise.
678 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
679 Likewise.
680 (Target_x86_64<size>::Scan::check_non_pic(): Handle
681 R_X86_64_PC32_BND.
682
683 * testsuite/Makefile.am (check_PROGRAMS): Add
684 exception_x86_64_bnd_test.
685 (exception_x86_64_bnd_test_SOURCES): New macro.
686 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
687 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
688 (exception_x86_64_bnd_test_LDADD): Likewise.
689 (exception_x86_64_bnd_1.o): New rule.
690 (exception_x86_64_bnd_2.o): Likewise.
691 * testsuite/Makefile.in: Regenerated.
692
9055360d
AM
6932013-11-15 Alan Modra <amodra@gmail.com>
694
695 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
696 accessor.
697 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
698 Only call ppc64_local_entry_offset for 64-bit. Restrict
699 symval_for_branch lookup to ELFv1.
700 (Stub_table::add_plt_call_entry): Use unsigned int off.
701 (Output_data_glink::Address, invalid_address): New.
702 (Output_data_glink::add_eh_frame): Move out of line. Add
703 support for ELFv2.
704 (Output_data_glink::add_global_entry, find_global_entry,
705 global_entry_address): New functions.
706 (Output_data_glink::global_entry_stubs_, end_branch_table_,
707 ge_size): New variables.
708 (Output_data_glink::set_final_data_size): Add global entry
709 stub sizing.
710 (Output_data_glink::do_write): Write global entry stubs.
711 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
712 parameter. Return true for ELFv2. Adjust callers.
713 (Target_powerpc::Scan::local, global): Restrict opd lookup to
714 ELFv1. Similarly for ifunc and dynamic relocation processing
715 specific to ELFv1. Recognize that symbols are defined on
716 their plt entries for ELFv2.
717 (Target_powerpc::symval_for_branch): Assert if called for
718 ELFv2 or ppc32.
719 (Target_powerpc::Relocate::relocate): Use global entry plt
720 stub for symbol value if such exists on ELFv2.
721 (Target_powerpc::Relocate::relocate): Don't call
722 symval_for_branch when ELFv2. Do adjust for local entry
723 offset when ELFv2.
724 (Target_powerpc::do_dynsym_value): Set symbols to global entry
725 plt stub for ELFv2.
726 (Target_powerpc::do_plt_address_for_global): Similarly.
727
cafdd569
CC
7282013-11-14 Cary Coutant <ccoutant@google.com>
729
730 Revert patch -- this did not fix the problem, and there is
731 no race there.
732
733 2013-11-14 Cary Coutant <ccoutant@google.com>
734
735 PR gold/14860
736 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
737 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
738 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
739 updating fde_offsets_.
740 (Eh_frame_hdr::lock_): New data member.
741
94e49e16
CC
7422013-11-14 Cary Coutant <ccoutant@google.com>
743
744 * dwp.cc (Dwo_file_entry): New type.
745 (File_list): Use Dwo_file_entry.
746 (Dwo_file::verify): New function.
747 (Dwo_file::verify_dwo_list): New function.
748 (Dwo_file::sized_verify_dwo_list): New function.
749 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
750 list.
751 (Dwp_options): New enum type.
752 (dwp_options): Add --verify-only.
753 (usage): Likewise.
754 (main): Likewise.
755 * dwp.h (gold_info): Add declaration.
756
7cdd7d57
CC
7572013-11-14 Cary Coutant <ccoutant@google.com>
758
759 PR gold/14860
760 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
761 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
762 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
763 updating fde_offsets_.
764 (Eh_frame_hdr::lock_): New data member.
765
1d946cb3
CC
7662013-11-06 Cary Coutant <ccoutant@google.com>
767
768 PR gold/15758
769 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
770 before reloc sections.
771
4f65b40e
AM
7722013-11-04 Alan Modra <amodra@gmail.com>
773
774 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
775 (Symbol::needs_dynamic_reloc): Test new flag.
776 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
777 (Target_powerpc::Scan::get_reference_flags): Add target param.
778 Return FUNC_DESC_ABI for 64-bit ELFv1.
779 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
780 call.
781 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
782 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
783
908794a9
CC
7842013-10-31 Cary Coutant <ccoutant@google.com>
785
786 Restore support for dwp v2 DWARF package file format.
787
788 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
789 tu_length parameter. Adjust all callers.
790 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
791 * dwp.cc: Include dwarf.h.
792 (Section_bounds): New struct type.
793 (Unit_set): New struct type.
794 (Dwo_file::Dwo_file): Initialize new data member.
795 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
796 Combine and rename to...
797 (Dwo_file::read_unit_index): ...this.
798 (Dwo_file::sized_read_compunit_index)
799 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
800 (Dwo_file::sized_read_unit_index): ...this.
801 (Dwo_file::copy_section): Remove section_name, is_str_offsets
802 parameters; add section_id parameter.
803 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
804 (Dwo_file::add_unit_set): ...this.
805 (Dwo_file::shndx_map_): Remove.
806 (Dwo_file::sect_offsets_): New data member.
807 (Dwp_output_file::Dwp_output_file): Initialize new data members.
808 (Dwp_output_file::add_section): Rename to...
809 (Dwp_output_file::add_contribution): ...this.
810 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
811 (Dwp_output_file::add_tu_set): Likewise.
812 (Dwp_output_file::Contribution): New type.
813 (Dwp_output_file::Section::contributions): New data member.
814 (Dwp_output_file::Cu_or_tu_set): Remove.
815 (Dwp_output_file::Section::Section): New ctor.
816 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
817 (Dwp_output_file::Dwp_index::Section_table): New type.
818 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
819 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
820 parameter.
821 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
822 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
823 (Dwp_output_file::Dwp_index::section_table): New member function.
824 (Dwp_output_file::Dwp_index::section_table_end): New member function.
825 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
826 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
827 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
828 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
829 (Dwp_output_file::Dwp_index::section_table_): New data member.
830 (Dwp_output_file::Dwp_index::section_mask_): New data member.
831 (Dwp_output_file::add_output_section): New member function.
832 (Dwp_output_file::write_new_section): New member function.
833 (Dwp_output_file::write_contributions): New member function.
834 (Dwp_output_file::section_id_map_): New data member.
835 (class Dwo_id_info_reader): Remove.
836 (class Unit_reader): New class.
837 (get_dwarf_section_name): New function.
838 (Dwo_file::read_executable): Adjust initializations of class data.
839 (Dwo_file::read): Add support for v2 package file format.
840 (Dwo_file::read_unit_index): Likewise.
841 (Dwo_file::sized_read_unit_index): Likewise.
842 (Dwo_file::copy_section): Likewise.
843 (Dwo_file::add_unit_set): Likewise.
844 (Dwp_output_file::add_output_section): Likewise.
845 (Dwp_output_file::add_contribution): Likewise.
846 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
847 for empty slot.
848 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
849 file format.
850 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
851 slot.
852 (Dwp_output_file::initialize): Remove unused function.
853 (Dwp_output_file::finalize): Add support for v2 package file format.
854 (Dwp_output_file::write_index): Likewise.
855 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
856 function prototype.
857
2500c017
CC
8582013-10-31 Cary Coutant <ccoutant@google.com>
859
860 * configure.ac: Fix check for -fmerge-constants.
861 * configure.ac: Regenerate.
862
dd0845d7
RM
8632013-10-30 Roland McGrath <mcgrathr@google.com>
864
865 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
866 Correct 9-byte nop sequence to match what the assembler generates.
867
b4f7960d
AM
8682013-10-30 Alan Modra <amodra@gmail.com>
869
870 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
871 ppc64_local_entry_offset, ppc64_local_entry_offset,
872 do_read_symbols): New functions.
873 (Powerpc_relobj::e_flags_, st_other_): New vars.
874 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
875 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
876 (Powerpc_relobj::e_flags_): New var.
877 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
878 and adjust for ELFv2.
879 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
880 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
881 (Powerpc_dynobj::do_find_special_sections): Likewise.
882 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
883 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
884 to ELFv2 local entry.
885 (Target_powerpc::do_relax): No thread safe barriers needed for
886 ELFv2.
887 (Output_data_plt_powerpc::initial_plt_entry_size_,
888 plt_entry_size): Delete. Replace all uses with
889 first_plt_entry_offset() and plt_entry_size().
890 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
891 reserved_size parm. Update callers.
892 (Output_data_plt_powerpc::entry_count): Update.
893 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
894 and use Target_powerpc::first_plt_entry_offset().
895 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
896 rename to plt_entry_size.
897 (Output_data_plt_powerpc::add_ifunc_entry,
898 add_local_ifunc_entry): Adjust reloc for ELFv2.
899 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
900 (glink_eh_frame_fde_64v2): New.
901 (Stub_table::plt_call_size): Support ELFv2 sizing.
902 (Output_data_glink::add_eh_frame): Use the new FDE.
903 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
904 (Stub_table::do_write): Write ELFv2 stubs and glink.
905 (Target_powerpc::Relocate::relocate): Replaces nop after call
906 with ld 2,24(1) and adjust local offset destination for ELFv2.
907
f9c6b907
AM
9082013-10-30 Alan Modra <amodra@gmail.com>
909
910 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
911 (Target_powerpc::Scan::global, local): Likewise.
912 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
913 on all ppc64 @h and @ha relocs.
914
e84fe78f
AM
9152013-10-14 Alan Modra <amodra@gmail.com>
916
917 * output.h (Output_data_got::add_constant): Tidy.
918 (Output_data_got::add_constant_pair): New function.
919 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
920 methods used so as to first call reserve_ent().
921
679e4abf
RM
9222013-10-11 Roland McGrath <mcgrathr@google.com>
923
44dcb735
RM
924 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
925 add_got_entry and add_got_entry_pair.
926
13323c49
RM
927 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
928 (HAVE_PUBNAMES): Likewise.
929 * configure: Regenerate.
930
1496b446
RM
931 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
932 * testsuite/Makefile.in: Regenerate.
933
cc84c10b
RM
934 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
935 Remove const from declaration.
936 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
937 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
938 * output.h (Output_file_header): Remove const from member target_
939 and corresponding constructor argument.
940 * output.cc (Output_file_header::Output_file_header): Update prototype.
941 (Output_file_header::do_sized_write): Use this->target_ in place
942 of parameters()->target().
943
52f66a2c
RM
944 * testsuite/undef_symbol.cc (Foo::get_a): New method.
945
2b64b551
RM
946 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
947 * configure: Regenerate.
948 * Makefile.in: Regenerate.
949 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
950 * testsuite/merge_string_literals_2.c: Likewise.
951 * testsuite/Makefile.am
952 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
953 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
954 literal -fmerge-constants.
955 * testsuite/Makefile.in: Regenerate.
956
43819297
RM
957 * i386.cc (Target_i386): Remove unused member dynbss_.
958 * arm.cc (Target_arm): Likewise.
959 * powerpc.cc (Target_powerpc): Likewise.
960 * sparc.cc (Target_sparc): Likewise.
961 * tilegx.cc (Target_tilegx): Likewise.
962 * x86_64.cc (Target_x86_64): Likewise.
963 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
964 type_signature_, type_offset_.
965 * plugin.h (Plugin_hook): Remove unused member layout_.
966 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
967 mapfile_.
968 (Read_member): Remove unused members input_objects_, symtab_,
969 mapfile_, layout_.
970 (Check_library): Remove unused member symtab_.
971 * archive.h (Lib_group): Remove unused member lib_.
972 * archive.cc (Lib_group::Lib_group): Update initializer.
973 * incremental.h (Incremental_binary): Remove unused member target_.
974 (Incremental_script_entry): Removed unused member script_.
975 * layout.h (Write_symbols_task): Remove unused member input_objects_.
976 * icf.h (Icf): Remove unused member num_tracked_relocs.
977
39d9ead7
RM
978 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
979 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
980 its only use.
981 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
982
679e4abf
RM
983 * archive.h: Use struct rather than class for forward declaration
984 of Read_symbols_data.
985
54de2ea6
CC
9862013-10-07 Cary Coutant <ccoutant@google.com>
987
988 PR gold/16010
989 * testsuite/Makefile.am (icf_test): Fix dependencies.
990 (icf_safe_test): Likewise.
991 (icf_safe_so_test): Likewise.
992 (large_symbol_alignment): Add empty _LDADD rule.
993 * testsuite/Makefile.in: Regenerate.
994
b14016f0
L
9952013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
996
997 PR gold/15927
998 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
999 relocation for R_X86_64_32 on x32.
1000
eb426534
RM
10012013-08-27 Roland McGrath <mcgrathr@google.com>
1002
1003 * output.cc (Output_segment::set_section_addresses): Take new
1004 Target* argument. If target->isolate_execinstr() and the segment
1005 is executable and starts at a target->abi_pagesize() boundary,
1006 pad its end out to a target->abi_pagesize() boundary with code fill.
1007 * output.h (Output_segment::set_section_addresses): Update decl.
1008 * layout.h (Layout::check_output_data_for_reset_values): Take new
1009 argument RELAX_OUTPUTS.
1010 (Layout): New member relax_output_list_.
1011 (Layout::add_relax_output): New method.
1012 * layout.cc (Layout::Layout): Update constructor.
1013 (Layout::reset_relax_output): New method.
1014 (Layout::clean_up_after_relaxation): Call it.
1015 (Layout::prepare_for_relaxation): Update caller.
1016 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1017 Call reset_relax_output before re-processing segments for
1018 isolate_execinstr case.
1019 (Layout::write_data): Handle relax_output_list_.
1020 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1021 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1022
9aff4b7a
NC
10232013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1024
1025 PR binutils/15834
1026 * object.h: Fix typos.
1027
93f8221c
RM
10282013-08-16 Roland McGrath <mcgrathr@google.com>
1029
1030 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1031 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1032
e44c3715
CC
10332013-08-07 Cary Coutant <ccoutant@google.com>
1034
1035 Revert support for v2 DWP files:
1036
1037 2013-03-01 Cary Coutant <ccoutant@google.com>
1038
1039 Add dwp support for v2 DWARF package file format.
1040 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1041 tu_length parameter. Adjust all callers.
1042 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1043 * dwp.cc: Include dwarf.h.
1044 (Section_bounds): New struct type.
1045 (Unit_set): New struct type.
1046 (Dwo_file::Dwo_file): Initialize new data member.
1047 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1048 Combine and rename to...
1049 (Dwo_file::read_unit_index): ...this.
1050 (Dwo_file::sized_read_compunit_index)
1051 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1052 (Dwo_file::sized_read_unit_index): ...this.
1053 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1054 parameters; add section_id parameter.
1055 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1056 (Dwo_file::add_unit_set): ...this.
1057 (Dwo_file::shndx_map_): Remove.
1058 (Dwo_file::sect_offsets_): New data member.
1059 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1060 (Dwp_output_file::add_section): Rename to...
1061 (Dwp_output_file::add_contribution): ...this.
1062 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1063 (Dwp_output_file::add_tu_set): Likewise.
1064 (Dwp_output_file::Contribution): New type.
1065 (Dwp_output_file::Section::contributions): New data member.
1066 (Dwp_output_file::Cu_or_tu_set): Remove.
1067 (Dwp_output_file::Section::Section): New ctor.
1068 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1069 (Dwp_output_file::Dwp_index::Section_table): New type.
1070 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1071 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1072 parameter.
1073 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1074 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1075 (Dwp_output_file::Dwp_index::section_table): New member function.
1076 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1077 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1078 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1079 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1080 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1081 (Dwp_output_file::Dwp_index::section_table_): New data member.
1082 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1083 (Dwp_output_file::add_output_section): New member function.
1084 (Dwp_output_file::write_new_section): New member function.
1085 (Dwp_output_file::write_contributions): New member function.
1086 (Dwp_output_file::section_id_map_): New data member.
1087 (class Dwo_id_info_reader): Remove.
1088 (class Unit_reader): New class.
1089 (get_dwarf_section_name): New function.
1090 (Dwo_file::read_executable): Adjust initializations of class data.
1091 (Dwo_file::read): Add support for v2 package file format.
1092 (Dwo_file::read_unit_index): Likewise.
1093 (Dwo_file::sized_read_unit_index): Likewise.
1094 (Dwo_file::copy_section): Likewise.
1095 (Dwo_file::add_unit_set): Likewise.
1096 (Dwp_output_file::add_output_section): Likewise.
1097 (Dwp_output_file::add_contribution): Likewise.
1098 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1099 for empty slot.
1100 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1101 file format.
1102 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1103 slot.
1104 (Dwp_output_file::initialize): Remove unused function.
1105 (Dwp_output_file::finalize): Add support for v2 package file format.
1106 (Dwp_output_file::write_index): Likewise.
1107 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1108 function prototype.
1109
c6905c28
CC
11102013-07-31 Cary Coutant <ccoutant@google.com>
1111
1112 * object.cc (Sized_relobj::do_output_section_address): New function.
1113 (Sized_relobj): Instantiate explicitly.
1114 * object.h (Object::output_section_address): New function.
1115 (Object::do_output_section_address): New function.
1116 (Sized_relobj::do_output_section_address): New function.
1117 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1118
11192013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1120 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1121
1122 * parameters.cc (Parameters::entry): Return target-specific entry
1123 symbol name.
1124 * target.h (Target::entry_symbol_name): New function.
1125 (Target_info::entry_symbol_name): New data member.
1126
1127 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1128 * i386.cc (Target_i386::i386_info): Likewise.
1129 (Target_i386_nacl::i386_nacl_info): Likewise.
1130 * sparc.cc (Target_sparc::sparc_info): Likewise.
1131 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1132 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1133 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1134 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1135
234d4ab8
SA
11362013-07-22 Sterling Augustine <saugustine@google.com>
1137
1138 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1139 Convert parameter shndx to local variable. Add parameters symtab
1140 and symtab_size. Scan over section names. Find relocation
1141 section corresponding to current section. Create and initialize
1142 reloc_mapper_ and reloc_type_.
1143 (Dwarf_pubnames_table::read_header): Add assertion. Change
1144 unit_length to off_t. Initialize member unit_length_. Fill in field
1145 cu_offset_.
1146 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1147 Initialize new fields unit_length_ and cu_offset_.
1148 (Dwarf_pubnames_table::read_section): Update prototype.
1149 (Dwarf_pubnames_table::cu_offset): New member function.
1150 (Dwarf_pubnames_table::subsection_size): Likewise.
1151 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1152 New fields.
1153 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1154 member functions public.
1155 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1156 Update comment. Rework logic. Move repeated parts to...
1157 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1158 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1159 pubtypes_table_, and stmt_list_offset.
1160 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1161 Gdb_index::find_pubtype_offset,
1162 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1163 (Gdb_index::pubnames_read): Update prototype and rework logic.
1164 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1165 Forward declare.
1166 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1167 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1168 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1169 Gdb_index::map_pubtable_to_dies):
1170 Declare functions.
1171 (Gdb_index::pubnames_read): Update declaration.
1172 (Gdb_index::Pubname_offset_map): New type.
1173 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1174 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1175 Gdb_index::stmt_list_offset): Declare.
1176 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1177 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1178 Gdb_index::pubtypes_offset_): Remove.
1179
a3ed37d8
RM
11802013-07-19 Roland McGrath <mcgrathr@google.com>
1181
1182 * options.h (General_options): Add -Trodata-segment option.
1183 * parameters.cc (Parameters::check_rodata_segment): New function.
1184 (Parameters::set_target_once): Call it.
1185 * parameters.h (Parameters): Declare it (private member function).
1186 * layout.cc (load_seg_unusable_for_headers): New function, broken
1187 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1188 then validate rodata segment rather than text segment.
1189 (relaxation_loop_body): Call that.
1190 (is_text_segment): New function. Don't admit a non-executable
1191 segment if TARGET->isolate_execinstr().
1192 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1193
eb5b4ded
CC
11942013-07-15 Shawn Landden <shawnlandden@gmail.com>
1195
1196 PR gold/15070
1197 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1198 * nacl.h (Sniff_file::View::View): Request aligned view.
1199
4d5effb9
CC
12002013-07-11 Cary Coutant <ccoutant@google.com>
1201
1202 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1203 correct BRLT entry size.
1204
ba8ca3e7
AM
12052013-07-03 Alan Modra <amodra@gmail.com>
1206
1207 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1208 comment.
1209
267257d2
CC
12102013-07-01 Cary Coutant <ccoutant@google.com>
1211
1212 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1213 reloc_type_.
1214 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1215 (Dwarf_ranges_table::lookup_reloc): New function.
1216 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1217 reloc_type_.
1218 (Dwarf_ranges_table::lookup_reloc): New function.
1219 (Dwarf_ranges_table::reloc_type_): New data member.
1220
06f30c9d
CC
12212013-06-27 Jing Yu <jingyu@google.com>
1222
1223 PR gold/15662
1224 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1225 function.
1226 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1227 (Target_powerpc::do_relax): Call the above.
1228
a2d7bf59
AM
12292013-06-27 Cary Coutant <ccoutant@google.com>
1230
1231 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1232 on garbage collected .opd section.
1233
12342013-06-27 Alan Modra <amodra@gmail.com>
1235
1236 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1237 is non-zero.
1238 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1239 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1240
32364e50
CC
12412013-06-14 Cary Coutant <ccoutant@google.com>
1242
1243 * resolve.cc (Symbol::override_base): Don't override st_type
1244 from plugin placeholder symbols.
1245 (Symbol_table::resolve): Likewise.
1246 (Symbol_table::should_override): Don't complain about TLS mismatch
1247 if the TO symbol is a plugin placeholder.
1248 * testsuite/Makefile.am (plugin_test_tls): New test.
1249 * testsuite/Makefile.in: Regenerate.
1250 * testsuite/plugin_test_tls.sh: New test script.
1251 * testsuite/two_file_test_2_tls.cc: New test source.
1252 * testsuite/two_file_test_tls.cc: New test source.
1253
7fb47cc9
CC
12542013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1255
1256 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1257 the maximum segment alignment is larger than the page size.
1258 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1259 correctly aligns the symbols with large alignemnt.
1260 * testsuite/Makefile.in: Regenerate.
1261 * testsuite/large_symbol_alignment.cc: New file.
1262
6934001a
CC
12632013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1264 Sriraman Tallam <tmsriram@google.com>
1265
1266 * options.h (sort_section): New option.
1267 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1268 Rename from Input_section_sort_section_name_special_ordering_compare.
1269 (Input_section_sort_section_name_compare): New struct.
1270 * output.cc (Output_section::Input_section_sort_section_name_compare::
1271 operator()): New function.
1272 (Output_section::sort_attached_input_sections): Use new sort function
1273 for .text if --sort-section=name is specified.
1274 * layout.cc (Layout::make_output_section):
1275 Add sorting by name when --sort-section=name is specified.
1276 * testsuite/Makefile.am (text_section_grouping): Test option
1277 --sort-section=name.
1278 * testsuite/Makefile.in: Regenerate.
1279 * testsuite/section_sorting_name.cc: New file.
1280 * testsuite/section_sorting_name.sh: New file.
1281
93acabad
CC
12822013-05-21 Cary Coutant <ccoutant@google.com>
1283
1284 * symtab.h (Symbol::is_cxx_vtable): New function.
1285 * target-reloc.h (relocate_section): Check for vtable symbol.
1286 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1287 * testsuite/Makefile.in: Regenerate.
1288 * testsuite/missing_key_func.cc: New test source.
1289 * testsuite/missing_key_func.sh: New test script.
1290
60e8b3fc
CC
12912013-05-21 Cary Coutant <ccoutant@google.com>
1292
2b64b551
RM
1293 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1294 type of enclosing symbol.
1295 (Relocate_info::location): Check symbol type when describing symbol.
1296 * object.h (Symbol_location_info): Remove unused line_number;
1297 add enclosing_symbol_type.
1298 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1299
9df9de2c
CC
13002013-05-13 Cary Coutant <ccoutant@google.com>
1301
2b64b551
RM
1302 * configure.ac: Export DEFAULT_TARGET.
1303 * configure: Regenerate.
1304 * Makefile.in: Regenerate.
1305 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1306 * testsuite/Makefile.in: Regenerate.
1307 * testsuite/debug_msg.sh: Delete duplicate tests.
1308 Don't check undef_int error message match for powerpc where the
1309 source file and line number aren't available.
9df9de2c 1310
bbc5ae17
RM
13112013-05-10 Roland McGrath <mcgrathr@google.com>
1312
1313 * options.h (General_options): Add --rosegment-gap option.
1314 * options.cc (finalize): --rosegment-gap implies --rosegment.
1315 * layout.cc (set_segment_offsets): Let user option override
1316 target->rosegment_gap().
1317
0c6e6c39
RM
13182013-05-10 Roland McGrath <mcgrathr@google.com>
1319
1320 * options.h (General_options): Remove leading space from help
1321 messages for -nostdlib and --rosegment.
1322
cde7cb01
MR
13232013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1324
1325 PR ld/15365
1326 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1327
f31ae5b8
AM
13282013-05-03 Alan Modra <amodra@gmail.com>
1329
1330 * merge.cc (Output_merge_string::do_add_input_section): Correct
1331 scan for number of strings. Rename vars to avoid shadowing.
1332 Include missing terminator in input_size_.
1333
d3a7cd45
L
13342013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1335
1336 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1337 Restore empty string handling.
1338
6ad3daba
CC
13392013-05-01 Cary Coutant <ccoutant@google.com>
1340
1341 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1342 uninitialized warning.
1343
e31908b6
CC
13442013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1345
1346 * output.cc (Output_section::add_merge_input_section): Allow
1347 to merge sections if the alignment is more than character size.
1348 * merge.h (Output_merge_string::Output_merge_string): Remove
1349 assert.
1350 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1351 only not-null strings. Check the alignment of strings.
1352 * stringpool.h
1353 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1354 alignment as the argument.
1355 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1356 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1357 Align non-zero length strings according to the addralign_.
1358 (Stringpool_template<Stringpool_char>::set_string_offsets):
1359 Updating offsets according to the given alignment.
1360 * testsuite/Makefile.am (text_section_grouping): Test if string
1361 literals are getting merged.
1362 * testsuite/Makefile.in: Regenerate.
1363 * testsuite/merge_string_literals_1.c: New file.
1364 * testsuite/merge_string_literals_2.c: Ditto.
1365 * testsuite/merge_string_literals.sh: Ditto.
1366
0e804863
ILT
13672013-04-26 Ian Lance Taylor <iant@google.com>
1368
1369 * target-reloc.h (relocate_section): If the reloc offset is out of
1370 range, pass VIEW as NULL to relocate.relocate.
1371 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1372 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1373 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1374 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1375 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1376 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1377
e7c5ea40
CC
13782013-04-26 Geoff Pike <gpike@chromium.org>
1379
1380 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1381 * layout.cc (Hash_task): New class.
1382 (Layout::queue_build_id_tasks): New function.
1383 (Layout::write_build_id): Handle single-thread portion of build ID
1384 computation. (In some cases, all of it is single-threaded.) Replace
1385 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1386 functionality in fewer lines of code.
1387 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1388 * options.h (General_options): make "--build-id" default to tree
1389 rather than sha1. Add two new options related to --build-id=tree:
1390 --build-id-chunk-size-for-treehash and
1391 --build-id-min-file-size-for-treehash.
1392 * Makefile.am: add testing of --build-id=tree and related new options
1393 (these tests will be invoked by "make check").
1394 * Makefile.in: Regenerate.
1395
49926cd0
AM
13962013-04-25 Alan Modra <amodra@gmail.com>
1397
1398 * configure.tgt: Add powerpcle and powerpc64le.
1399
a4034750
AM
14002013-04-22 Alan Modra <amodra@gmail.com>
1401
1402 PR gold/15355
1403 * layout.cc (Layout::segment_precedes): Allow more than one
1404 segment with the same type and flags.
1405
e79c84aa
CC
14062013-04-15 Cary Coutant <ccoutant@google.com>
1407
1408 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1409 allocate space in file for BSS sections.
1410
2199fbe7
CC
14112013-04-15 Cary Coutant <ccoutant@google.com>
1412
1413 * script-sections.cc (Orphan_output_section): Reset address
1414 to zero after each orphaned section for relocatable links.
1415
502e8a84
CC
14162013-04-15 Cary Coutant <ccoutant@google.com>
1417
a4034750
AM
1418 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1419 section starting address for relocatable link.
1420 * testsuite/Makefile.am (script_test_11): New test.
1421 * testsuite/Makefile.in: Regenerate.
1422 * testsuite/script_test_11.c: New source file.
1423 * testsuite/script_test_11.t: New linker script.
502e8a84 1424
0cfdc767
AM
14252013-04-13 Alan Modra <amodra@gmail.com>
1426
1427 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1428 owner when sections are not adjacent and exceed group size.
1429 (Target_powerpc::group_sections): Handle corner case.
1430 (Target_powerpc::Branch_info::make_stub): Handle case where
1431 stub table doesn't exist due to branches in non-exec sections.
1432 (Target_powerpc::Relocate::relocate): Likewise.
1433
6830ee24
AM
14342013-04-11 Alan Modra <amodra@gmail.com>
1435
1436 PR gold/15354
1437 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1438 .branch_lt to match bfd ld. Adjust comments throughout file.
1439
54a3d865
ILT
14402013-04-04 Ian Lance Taylor <iant@google.com>
1441
1442 GCC PR c++/56840
1443 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1444 sections before checking whether they are included in the link.
1445
9993ba11
ST
14462013-03-29 Sriraman Tallam <tmsriram@google.com>
1447
1448 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1449 object before calling the plugin claim_file handler. Pass the elf
1450 object of the archive to the plugin. Delete the elf object if the
1451 plugin claims the file.
1452
ebacd51e
AM
14532013-03-21 Alan Modra <amodra@gmail.com>
1454
1455 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1456 segment when omagic.
1457
117be58f
AM
14582013-03-21 Alan Modra <amodra@gmail.com>
1459
1460 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1461 comparison warning.
1462 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1463 uninitialized" warning.
1464
32e2b61d
AM
14652013-03-20 Alan Modra <amodra@gmail.com>
1466
1467 * symtab.h (Symbol::clear_version): New function.
1468 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1469 is_needed by weak references. Clear version for symbols defined
1470 in as-needed objects that are not needed.
1471
b3ccdeb5
AM
14722013-03-15 Alan Modra <amodra@gmail.com>
1473
1474 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1475 static and public. Add report_err param. Return false for data refs.
1476 (Target_powerpc::rela_dyn_section): New overloaded function.
1477 (Target_powerpc::plt_, iplt_): Elucidate.
1478 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1479 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1480 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1481 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1482 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1483 push_branch and make_plt_entry for ifunc syms when
1484 reloc_needs_plt_for_ifunc.
1485 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1486 for ifunc unless reloc_needs_plt_for_ifunc.
1487
ad3d8a2f
AM
14882013-03-15 Alan Modra <amodra@gmail.com>
1489
1490 * gc.h (gc_process_relocs): Don't look through function descriptors.
1491 * icf.cc (get_section_contents): Do so here instead.
1492
4d9aa155
AM
14932013-03-13 Alan Modra <amodra@gmail.com>
1494
1495 * powerpc.cc (is_branch_reloc): Forward declare.
1496 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1497 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1498 false for 64-bit, true for 32-bit non-branch relocs.
1499 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1500 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1501 nm output.
1502 (icf_safe_test): Generate linker map file as well as nm output.
1503 (icf_safe_so_test): Likewise.
1504 * testsuite/Makefile.in: Regenerate.
1505 * testsuite/icf_test.sh: Parse linker map file to determine
1506 section folding.
1507 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1508 * testsuite/icf_safe_so_test.sh: Likewise.
1509 (X86_32_or_ARM_specific_safe_fold): Merge into..
1510 (arch_specific_safe_fold): ..this.
1511 (X86_64_specific_safe_fold): Delete unused function.
1512
57420c20
AM
15132013-03-12 Alan Modra <amodra@gmail.com>
1514
1515 * gc.h (gc_process_relocs): Look through function descriptors
1516 to determine shndx, symvalue and addend used by ICF. Tidy
1517 variable duplication.
1518
dc3714f3
AM
15192013-03-11 Alan Modra <amodra@gmail.com>
1520
1521 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1522 * layout.cc (Layout_task_runner::run): ..to here.
1523 * symtab.h (struct Symbol_location): Extract from..
1524 (class Symbol_table): ..here.
1525 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1526 * target.h (class Target): Add function_location and
1527 do_function_location functions.
1528 (class Sized_target): Add do_function_location.
1529 * object.h (class Sized_relobj_file): Move find_shdr..
1530 (class Object): ..to here.
1531 * object.cc: Likewise. Update to suit. Instantiate.
1532 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1533 * powerpc.cc (class Powerpc_dynobj): New.
1534 (Target_powerpc::do_function_location): New function.
1535 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1536 (Powerpc_dynobj::do_read_symbols): New function.
1537 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1538
956b03bb
ILT
15392013-03-08 Ian Lance Taylor <iant@google.com>
1540
1541 * options.cc (General_options::string_to_object_format): Accept
1542 "default".
1543
4bead2d5
AM
15442013-03-08 Alan Modra <amodra@gmail.com>
1545
1546 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1547 pointer to Post_fde.
1548 (struct Post_fde): Move definition to here..
1549 * ehframe.cc (struct Post_fde): ..from here.
1550 (Cie::write): Don't alloc Post_fde.
1551 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1552
02e60bf7
AM
15532013-03-07 Alan Modra <amodra@gmail.com>
1554
1555 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1556 relocation referencing .LC0.
1557 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1558
8343f03a
AM
15592013-03-07 Alan Modra <amodra@gmail.com>
1560
1561 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1562 always_inline. Add assembly for powerpc to avoid GOT.
1563
3366d57c
AM
15642013-03-07 Alan Modra <amodra@gmail.com>
1565
1566 * testsuite/script_test_10.sh: Don't test .bss section
1567 header number.
1568
6c77229c
AM
15692013-03-06 Alan Modra <amodra@gmail.com>
1570
1571 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1572 (Target_powerpc::symval_for_branch): Add symtab param. Update
1573 all callers. Handle folded sections.
1574 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1575 to Powerpc_relobj.
1576 (Global_symbol_visitor_opd::operator()): Likewise.
1577
a39e4af6
AM
15782013-03-04 Alan Modra <amodra@gmail.com>
1579
1580 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1581 * testsuite/Makefile.in: Regenerate.
1582
d5834edb
CC
15832013-03-01 Cary Coutant <ccoutant@google.com>
1584
1585 Add dwp support for v2 DWARF package file format.
1586 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1587 tu_length parameter. Adjust all callers.
1588 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1589 * dwp.cc: Include dwarf.h.
1590 (Section_bounds): New struct type.
1591 (Unit_set): New struct type.
1592 (Dwo_file::Dwo_file): Initialize new data member.
1593 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1594 Combine and rename to...
1595 (Dwo_file::read_unit_index): ...this.
1596 (Dwo_file::sized_read_compunit_index)
1597 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1598 (Dwo_file::sized_read_unit_index): ...this.
1599 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1600 parameters; add section_id parameter.
1601 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1602 (Dwo_file::add_unit_set): ...this.
1603 (Dwo_file::shndx_map_): Remove.
1604 (Dwo_file::sect_offsets_): New data member.
1605 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1606 (Dwp_output_file::add_section): Rename to...
1607 (Dwp_output_file::add_contribution): ...this.
1608 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1609 (Dwp_output_file::add_tu_set): Likewise.
1610 (Dwp_output_file::Contribution): New type.
1611 (Dwp_output_file::Section::contributions): New data member.
1612 (Dwp_output_file::Cu_or_tu_set): Remove.
1613 (Dwp_output_file::Section::Section): New ctor.
1614 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1615 (Dwp_output_file::Dwp_index::Section_table): New type.
1616 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1617 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1618 parameter.
1619 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1620 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1621 (Dwp_output_file::Dwp_index::section_table): New member function.
1622 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1623 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1624 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1625 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1626 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1627 (Dwp_output_file::Dwp_index::section_table_): New data member.
1628 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1629 (Dwp_output_file::add_output_section): New member function.
1630 (Dwp_output_file::write_new_section): New member function.
1631 (Dwp_output_file::write_contributions): New member function.
1632 (Dwp_output_file::section_id_map_): New data member.
1633 (class Dwo_id_info_reader): Remove.
1634 (class Unit_reader): New class.
1635 (get_dwarf_section_name): New function.
1636 (Dwo_file::read_executable): Adjust initializations of class data.
1637 (Dwo_file::read): Add support for v2 package file format.
1638 (Dwo_file::read_unit_index): Likewise.
1639 (Dwo_file::sized_read_unit_index): Likewise.
1640 (Dwo_file::copy_section): Likewise.
1641 (Dwo_file::add_unit_set): Likewise.
1642 (Dwp_output_file::add_output_section): Likewise.
1643 (Dwp_output_file::add_contribution): Likewise.
1644 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1645 for empty slot.
1646 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1647 file format.
1648 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1649 slot.
1650 (Dwp_output_file::initialize): Remove unused function.
1651 (Dwp_output_file::finalize): Add support for v2 package file format.
1652 (Dwp_output_file::write_index): Likewise.
1653 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1654 function prototype.
1655
a68a081d
CC
16562013-03-01 Cary Coutant <ccoutant@google.com>
1657
1658 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1659 function into class definition in header file.
1660 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1661 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1662 New function.
1663 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1664
9d5781f8
AM
16652013-02-28 Alan Modra <amodra@gmail.com>
1666
1667 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1668 * target.cc (Target::do_plt_fde_location): New function.
1669 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1670 accessor function, and constructor param.
1671 (struct Post_fde, Post_fdes): Declare.
1672 (Cie::write): Add post_fdes param.
1673 * ehframe.cc (Fde::write): Use plt_fde_location.
1674 (struct Post_fde): Define.
1675 (Cie::write): Stash FDEs added post merge mapping.
1676 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1677 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1678 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1679 other FDEs.
1680 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1681 (Target_powerpc::has_glink): New function.
1682 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1683 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1684 glink_eh_frame_fde_32, default_fde): New data.
1685 (Stub_table::eh_frame_added_): New var.
1686 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1687 Make const.
1688 (Stub_table::add_eh_frame): New function.
1689 (Output_data_glink::add_eh_frame): New function.
1690 (Target_powerpc::make_glink_section): Call add_eh_frame.
1691
214383dd
ILT
16922013-02-15 Ian Lance Taylor <iant@google.com>
1693
1694 * options.h (DEFINE_uint64_alias): Define.
1695 (class General_options): Add -Ttext-segment as an alias for
1696 -Ttext.
1697
91c2b899
AM
16982013-02-15 Alan Modra <amodra@gmail.com>
1699
1700 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1701 (Stub_table::do_write): ..here, two places.
1702 (Stub_table::plt_call_size): Use it here too.
1703
20e2a8aa
ILT
17042013-02-11 Ian Lance Taylor <iant@google.com>
1705
1706 * descriptors.cc (Descriptors::close_all): New function.
1707 * descriptors.h (class Descriptors): Declare close_all.
1708 (close_all_descriptors): New inline function.
1709 * plugin.cc: Include "descriptors.h".
1710 (Plugin_manager::cleanup): Call close_all_descriptors.
1711
8952bc69
AM
17122013-02-06 Alan Modra <amodra@gmail.com>
1713
1714 * README: Update coding style link.
1715
29bd8b6b
CC
17162013-01-28 Cary Coutant <ccoutant@google.com>
1717
a4034750
AM
1718 * dwp.cc (File_list): New typedef.
1719 (Dwo_name_info_reader): New class.
1720 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1721 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1722 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1723 (Dwo_file::read_executable): New function.
1724 (Dwo_file::read): Move common setup code to ...
1725 (Dwo_file::make_object): ... here.
1726 (dwp_options): Add --exec/-e.
1727 (usage): Likewise.
1728 (main): Likewise.
29bd8b6b 1729
c6ac678d
ST
17302013-01-24 Sriraman Tallam <tmsriram@google.com>
1731
1732 * layout.cc (Layout::layout): Check for option text_reorder.
1733 (Layout::make_output_section): Ditto.
1734 * options.h (text_reorder): New option.
1735 * output.cc (Input_section_sort_compare): Remove special ordering
1736 of section names.
1737 (Output_section::
1738 Input_section_sort_section_name_special_ordering_compare::
1739 operator()): New function.
1740 (Output_section::sort_attached_input_sections): Use new sort function
1741 for .text.
1742 * output.h (Input_section_sort_section_name_special_ordering_compare):
1743 New struct.
1744 * testsuite/Makefile.am (text_section_grouping): Test option
1745 --no-text-reorder
1746 * testsuite/Makefile.in: Regenerate.
1747 * testsuite/text_section_grouping.sh: Check order of functions without
1748 default text reordering.
1749
50701cc1
MF
17502013-01-18 Mike Frysinger <vapier@gentoo.org>
1751
1752 * options.h (General_options): Change default to true for new_dtags.
1753
b1b00fcc
MF
17542013-01-18 Mike Frysinger <vapier@gentoo.org>
1755
1756 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1757 when enable_new_dtags is false. Only add DT_RUNPATH when
1758 enable_new_dtags is true.
1759
ec5b8187
AM
17602013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1761
1762 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1763 used in declaration and definition consistent.
1764 (Target_powerpc::symval_for_branch): Ditto.
1765
a880d4c4
ST
17662013-01-16 Sriraman Tallam <tmsriram@google.com>
1767
1768 * testsuite/plugin_final_layout.cc: Fix comment.
1769
7c381248
ST
17702013-01-16 Sriraman Tallam <tmsriram@google.com>
1771
1772 * layout.cc (Layout::layout): Do not do default sorting for
1773 text sections when section ordering is specified.
1774 (make_output_section): Ditto.
1775 * testsuite/plugin_final_layout.cc: Name the function sections
1776 to catch reordering issues.
1777
e2458743
AM
17782013-01-15 Alan Modra <amodra@gmail.com>
1779
1780 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
1781 plt-thread-safe.
1782
431ed302
AM
17832013-01-15 Alan Modra <amodra@gmail.com>
1784
1785 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
1786 * testsuite/Makefile.in: Regenerate.
1787
0ec6429b
AM
17882013-01-14 Alan Modra <amodra@gmail.com>
1789
1790 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
1791 * testsuite/Makefile.in: Regenerate.
1792
0bf402d5
ILT
17932013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
1794
36af3926 1795 PR bfd/14430
0bf402d5
ILT
1796 Fix mingw gold build with plugins enabled
1797 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
1798 * configure.ac: Export DLOPEN_LIBS and add headers check.
1799 * plugin.cc: Handle non-dlfcn case.
1800 * Makefile.in: Regenerate.
1801 * config.in: Regenerate.
1802 * configure: Regenerate.
1803 * testsuite/Makefile.in: Regenerate.
1804
9e9143bc
ST
18052013-01-09 Sriraman Tallam <tmsriram@google.com>
1806
1807 * output.h (sort_attached_input_sections): Change to be public.
1808 * script-sections.cc
1809 (Output_section_definition::set_section_addresses): Sort
1810 attached input sections according to section order before linker
1811 script assigns section addresses.
1812 (Orphan_output_section::set_section_addresses): Sort
1813 attached input sections according to section order before linker
1814 script assigns section addresses.
1815 * Makefile.am (final_layout.sh): Use a simple linker script to
1816 check if section ordering still works.
1817 * Makefile.in: Regenerate.
1818
679af368
ILT
18192013-01-09 Ben Cheng <bccheng@google.com>
1820
1821 * arm.cc (Target_arm::attributes_accept_div): New function.
1822 (Target_arm::attributes_forbid_div): New function.
1823 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
1824 attribute using the same new functions as what bfd/elf32_arm.c
1825 does.
1826
3136a00e
CC
18272013-01-07 Cary Coutant <ccoutant@google.com>
1828
1829 PR gold/14993
1830 * output.cc (Output_section::add_input_section): For incremental
1831 updates, don't track input sections that are allocated from patch
1832 space.
1833
f2a6224b
L
18342013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1835 Ian Lance Taylor <iant@google.com>
1836
1837 PR gold/14897
1838 * configure.ac (--enable-ld): Removed.
1839 (install_as_default): Set to yes only for --enable-gold=default
1840 or --disable-ld.
1841 * configure: Regenerated.
1842
4f46f626
L
18432013-01-07 H.J. Lu <hongjiu.lu@intel.com>
1844
1845 * options.h (General_options): Add -fuse-ld= for GCC linker
1846 option compatibility.
1847
26e4ef59
CC
18482013-01-04 Cary Coutant <ccoutant@google.com>
1849
1850 * configure.ac: Fix typo restoring CXXFLAGS.
1851 * configure: Regenerate.
1852
3d587466
CC
18532013-01-04 Cary Coutant <ccoutant@google.com>
1854
4f46f626
L
1855 * testsuite/Makefile.am (CXXLINK_S): New macro.
1856 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
1857 * testsuite/Makefile.in: Regenerate.
3d587466 1858
44db6695
L
18592013-01-02 H.J. Lu <hongjiu.lu@intel.com>
1860
1861 * version.cc (print_version): Update copyright year to 2013.
1862
edcac0c1
ILT
18632012-12-20 Ian Lance Taylor <iant@google.com>
1864
1865 * layout.cc (Layout::special_ordering_of_input_section): New
1866 function.
1867 (Layout::layout): If input section requires special ordering, must
1868 sort input sections.
1869 (Layout::make_output_section): May sort .text input sections.
1870 (Layout::is_section_name_prefix_grouped): Remove.
1871 * layout.h (class Layout): Declare
1872 special_ordering_of_input_section. Don't declare
1873 is_section_name_prefix_grouped.
1874 * output.cc (Output_section::add_input_section): Revert last
1875 change.
1876 (Output_section::Input_section_sort::match_file_name): Don't crash
1877 if called on output section data.
1878 (Output_section::Input_section_sort_compare): Sort based on
1879 special ordering.
1880 (Output_section::Input_section_sort_section_order_index_compare):
1881 Revert last patch.
1882 (Output_section::sort_attached_input_sections): Likewise.
1883
28f2a4ac
ST
18842012-12-18 Sriraman Tallam <tmsriram@google.com>
1885
edcac0c1 1886 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
1887 * layout.h (Layout::is_section_name_prefix_grouped): New function.
1888 * output.cc (Output_section::add_input_section): Check if section
1889 name contains special prefix. Keep input sections to sort such
1890 sections.
1891 (Output_section::Input_section_sort_section_order_index_compare
1892 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
1893 (Output_section::sort_attached_input_sections): Add condition to
1894 Input_section_entry constructor call.
28f2a4ac
ST
1895 * testsuite/Makefile.am (text_section_grouping): New test.
1896 * testsuite/Makefile.in: Regenerate.
1897 * testsuite/text_section_grouping.cc: New file.
1898 * testsuite/text_section_grouping.sh: New file.
1899
5bf135a7
NC
19002012-12-17 Nick Clifton <nickc@redhat.com>
1901
1902 * Makefile.am: Add copyright notice.
1903 * NEWS: Likewise.
1904 * README: Likewise.
1905 * configure.ac: Likewise.
1906 * ftruncate.c: Likewise.
1907 * Makefile.in: Regenerate.
1908
59965708
CC
19092012-12-14 Cary Coutant <ccoutant@google.com>
1910
a4034750
AM
1911 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
1912 --no-as-needed flag.
1913 (exception_separate_shared_12_test): Likewise.
1914 (incremental_copy_test): Likewise.
1915 * testsuite/Makefile.in: Regenerate.
59965708 1916
2a77e2ab
CC
19172012-12-14 Cary Coutant <ccoutant@google.com>
1918
1919 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
1920 (Dwp_output_file::Dwp_index::enter_set): Add assert.
1921
e3deeb9c
AM
19222012-12-12 Alan Modra <amodra@gmail.com>
1923
1924 * powerpc.cc (class Track_tls): New.
1925 (class Relocate, class Scan): Inherit Track_tls.
1926 (Target_powerpc::Scan::local, global): Track tls optimization
1927 and avoid creating plt entry for __tls_get_addr if all uses
1928 are optimized away.
1929 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
1930
d8f5a274
AM
19312012-12-12 Alan Modra <amodra@gmail.com>
1932
1933 * options.h (General_options): Add --toc-sort/--no-toc-sort.
1934 Replace no_toc_optimize with toc_optimize.
1935 * output.h (Output_section::input_sections): Provide non-const variant.
1936 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
1937 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
1938 accessors.
1939 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
1940 (class Sort_toc_sections): New.
1941 (Target_powerpc::do_finalize_sections): Sort toc sections.
1942 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
1943
4c8a1de1
RM
19442012-12-10 Roland McGrath <mcgrathr@google.com>
1945
1946 * testsuite/binary_unittest.cc (read_all): New function.
1947 (Sized_binary_test): Use it instead of ::read.
1948 * fileread.cc (do_read): Don't assume pread always reads the whole
1949 amount in a single call.
1950
edc27beb
AM
19512012-12-10 Alan Modra <amodra@gmail.com>
1952
1953 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
1954 Set EM_PPC64 or EM_PPC here.
1955 (Target_selector_powerpc::do_recognize): Delete.
1956
906b9150
AM
19572012-12-10 Alan Modra <amodra@gmail.com>
1958
1959 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
1960 stub_table_.
1961 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
1962
418c15ae
RM
19632012-12-07 Roland McGrath <mcgrathr@google.com>
1964
1965 * testsuite/binary_unittest.cc (Sized_binary_test):
1966 Use open_descriptor rather than ::open.
1967
decdd3bc
AM
19682012-12-07 Alan Modra <amodra@gmail.com>
1969
1970 * powerpc.cc (Stub_table::do_write): Delete redundant Address
1971 typedef and invalid_address constant.
1972 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
1973 instantiate constants.
1974
db399005
ILT
19752012-12-06 Roland McGrath <mcgrathr@google.com>
1976
1977 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
1978 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
1979 * aclocal.m4: Regenerate.
1980 * configure: Regenerate.
1981 * Makefile.in: Regenerate.
1982 * testsuite/Makefile.in: Regenerate.
1983
aba6bc71
AM
19842012-12-07 Alan Modra <amodra@gmail.com>
1985
1986 * options.h (General_options): Add no_toc_optimize.
1987 * powerpc.cc (ok_lo_toc_insn): New function.
1988 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
1989
9e69ed50
AM
19902012-12-06 Alan Modra <amodra@gmail.com>
1991
1992 * options.h (General_options): Add plt_align, plt_static_chain,
1993 plt_thread_safe. Update stub_group_size help text.
1994 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
1995 for new plt_thread_safe_ var.
1996 (use_plt_offset): Correct comments.
1997 (Target_powerpc::do_relax): Look for thread creation symbols to
1998 determine default plt_thread_safe value. Clear plt call stubs
1999 as well as branch stubs each iteration.
2000 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2001 insn constants.
2002 (l, hi, ha, write_insn): Move earlier.
2003 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2004 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2005 plt stubs too.
2006 (Stub_table::update_size): Adjust.
2007 (Stub_table::prev_size, set_prev_size): Delete.
2008 (Stub_table::stub_align): Let --plt-align affect result.
2009 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2010 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2011 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2012 (Stub_table::do_write): Support more stub variants.
2013
f43ba157
AM
20142012-12-04 Alan Modra <amodra@gmail.com>
2015
2016 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2017 (Target_powerpc::do_define_standard_symbols): New function.
2018
34171bc5
AM
20192012-12-03 Alan Modra <amodra@gmail.com>
2020
2021 * output.h: Formatting, whitespace.
2022
dc9589e9 20232012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2024
2025 * layout.h (Layout::get_executable_sections): Declare.
2026 * layout.cc (Layout::get_executable_sections): New function.
2027 * arm.cc (Target_arm::group_sections): Use it.
2028 (Arm_output_section::group_sections): Delete now redundant test.
2029 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2030 param to handle relative relocs.
2031 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2032 (Output_data_reloc::add_absolute): Adjust.
2033 (Output_data_reloc::add_relative): New function.
2034 (Output_data::reset_data_size): New function.
2035 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2036 (Output_section::set_addralign): New function.
2037 (Output_section::checkpoint_set_addralign): New function.
2038 (Output_section::clear_section_offsets_need_adjustment): New function.
2039 (Output_section::input_sections): Make public.
2040 * powerpc.cc (class Output_data_brlt_powerpc): New.
2041 (class Stub_table, class Stub_control): New.
2042 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2043 stub_table_, set_stub_table, stub_table): New vectors and accessor
2044 functions.
2045 (Target_powerpc::do_may_relax, do_relax, push_branch,
2046 new_stub_table, stub_tables, brlt_section, group_sections,
2047 add_branch_lookup_table, find_branch_lookup_table,
2048 write_branch_lookup_table, make_brlt_section): New functions.
2049 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2050 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2051 branch_info_): New vars.
2052 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2053 make call stubs here.
2054 (Output_data_glink): Remove all call stub handling from this class.
2055 (Target_powerpc::Scan::local, global): Save interesting branch
2056 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2057 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2058 functions on final link.
2059 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2060 Handle long branch destinations too.
2061 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2062 do_plt_address_for_local): Adjust lookup of plt call stubs.
2063
627b30b7
AM
20642012-11-30 Alan Modra <amodra@gmail.com>
2065
2066 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2067 relocs against protected symbols when building 32-bit shared libs.
2068
40b469d7
AM
20692012-11-30 Alan Modra <amodra@gmail.com>
2070
2071 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2072 param. Call got_section() to make .got. Update all callers
2073 and their callers and so on.
2074
bb66a627
AM
20752012-11-30 Alan Modra <amodra@gmail.com>
2076
2077 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2078 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2079 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2080 value if it already exists.
2081
d2cf1c6c
L
20822012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2083
2084 PR gold/14858
2085 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2086
edccdf7c
RM
20872012-11-14 Roland McGrath <mcgrathr@google.com>
2088
2089 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2090 than bfc instruction for data sandboxing.
2091
6febeb74
AM
20922012-11-08 Alan Modra <amodra@gmail.com>
2093
2094 * po/POTFILES.in: Regenerate.
2095
0a6f1bf2
AM
20962012-11-05 Alan Modra <amodra@gmail.com>
2097
2098 * configure.ac: Apply 2012-09-10 change to config.in here.
2099 * configure: Regenerate.
2100
26a4e9cb
AM
21012012-11-05 Alan Modra <amodra@gmail.com>
2102
2103 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2104 (struct Opd_ent): Use "Address" rather than "Offset".
2105 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2106 (Target_powerpc::got_section): Make public.
2107 (Target_powerpc::scan_relocs): Move code setting symbols..
2108 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2109 Create _SDA_BASE_ only when referenced.
2110
cc928013
RM
21112012-11-02 Roland McGrath <mcgrathr@google.com>
2112
2113 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2114 from last change.
2115
50ed5eb1
RM
21162012-11-01 Roland McGrath <mcgrathr@google.com>
2117
62fe925a
RM
2118 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2119 for offset_in_output_section parameter.
2120 (Sized_target::relocate_special_relocatable): Likewise.
2121 * arm.cc (Target_arm::relocate_relocs): Likewise.
2122 (Target_arm::relocate_special_relocatable): Likewise.
2123 * i386.cc (Target_i386::relocate_relocs): Likewise.
2124 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2125 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2126 * target-reloc.h (relocate_relocs): Likewise.
2127 * testsuite/testfile.cc (Target_test): Likewise.
2128 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2129 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2130
2131 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2132 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2133
2134 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2135 parameter, which is unused in the [!F_SETFD] case.
2136
50ed5eb1
RM
2137 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2138 SYMNDX to off_t before comparing it to this->data_size().
2139 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2140 * incremental.cc (Output_section_incremental_inputs::do_write):
2141 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2142
2cadc0bf
RM
2143 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2144
3bfcb652
NC
21452012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2146
2147 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2148 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2149 in EABI_VER5.
2150
c1a8d56e
CC
21512012-10-29 Cary Coutant <ccoutant@google.com>
2152
2153 * dwp.cc (usage): Add file and exit status parameters;
2154 add --help and --version options.
2155 (print_version): New function.
2156 (main): Add --help and --version options.
2157
b2490a7b
L
21582012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2159
2160 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2161 final_layout_sequence.txt.
2162 * testsuite/Makefile.in: Regenerated.
2163
aa543512
L
21642012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2165
2166 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2167 COMPILE generated by automake.
2168 (LINK1): Likewise.
2169 (CXXCOMPILE1): Likewise.
2170 (CXXLINK1): Likewise.
2171 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2172 (LINK): Likewise.
2173 (CXXCOMPILE): Likewise.
2174 (CXXLINK): Likewise.
2175 * testsuite/Makefile.in: Regenerated.
2176
d361fafb
L
21772012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2178
2179 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2180 on bad fwrite return.
2181
598c7410
L
21822012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2183
2184 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2185 on val.
2186
35c813e2
CC
21872012-10-23 Cary Coutant <ccoutant@google.com>
2188
2189 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2190 * testsuite/Makefile.in: Regenerate.
2191 * testsuite/dwp_test.h: New source file.
2192 * testsuite/dwp_test_1.cc: New source file.
2193 * testsuite/dwp_test_1.s: New source file.
2194 * testsuite/dwp_test_1.sh: New source file.
2195 * testsuite/dwp_test_1b.cc: New source file.
2196 * testsuite/dwp_test_1b.s: New source file.
2197 * testsuite/dwp_test_2.cc: New source file.
2198 * testsuite/dwp_test_2.s: New source file.
2199 * testsuite/dwp_test_2.sh: New source file.
2200 * testsuite/dwp_test_main.cc: New source file.
2201 * testsuite/dwp_test_main.s: New source file.
2202
77429909
CC
22032012-10-23 Cary Coutant <ccoutant@google.com>
2204
2205 * dwp.h: New header file.
2206 * dwp.cc: New source file.
2207 * gold.h: Move shared declarations to system.h.
2208 * system.h: New header file.
2209 * Makefile.am: Add dwp.
2210 * Makefile.in: Regenerate.
2211
ed5d6712
CC
22122012-10-23 Cary Coutant <ccoutant@google.com>
2213
2214 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2215 Dwarf_info_reader::read_from_pointer.
2216 (Dwarf_pubnames_table::read_header): Likewise.
2217 (Dwarf_pubnames_table::next_name): Likewise.
2218 (Dwarf_die::read_attributes): Likewise.
2219 (Dwarf_die::skip_attributes): Likewise.
2220 (Dwarf_info_reader::read_from_pointer): New function template.
2221 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2222 (Dwarf_pubnames_table): Likewise.
2223 (Dwarf_info_reader::read_from_pointer): New function template.
2224 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2225 Dwarf_pubnames_table ctor.
2226
8787852d
CC
22272012-10-23 Cary Coutant <ccoutant@google.com>
2228
2229 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2230 abbrev_shndx.
2231 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2232 abbrev_shndx_.
2233 (Dwarf_info_reader::set_abbrev_shndx): New method.
2234 (Dwarf_info_reader::abbrev_shndx_): New data member.
2235
9fc236f3
CC
22362012-10-23 Cary Coutant <ccoutant@google.com>
2237
2238 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2239 from object, not parameters.
2240 (Dwarf_info_reader::parse): Likewise.
2241 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2242 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2243 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2244 methods.
2245
effe8365
CC
22462012-10-23 Cary Coutant <ccoutant@google.com>
2247
2248 * fileread.cc (Input_file::Input_file): New constructor.
2249 * fileread.h (class Input_file): Add new constructor.
2250
1698990d
AM
22512012-10-18 Alan Modra <amodra@gmail.com>
2252
2253 PR gold/14727
2254 * object.cc (Relobj::is_section_name_included): Also match
2255 .sdata personality section.
2256
168a4726
AM
22572012-10-18 Alan Modra <amodra@gmail.com>
2258
2259 * target-reloc.h (class Default_comdat_behavior): New, package up..
2260 (get_comdat_behaviour): ..this.
2261 (relocate_section): Add Relocate_comdat_behavior template arg,
2262 adjust code to suit.
2263 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2264 (Target_arm::scan_reloc_section): Likewise.
2265 * i386.cc (Target_i386::relocate_section): Likewise.
2266 * sparc.cc (Target_sparc::relocate_section): Likewise.
2267 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2268 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2269 * powerpc.cc (class Relocate_comdat_behavior): New.
2270 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2271 gold::relocate_section with new template arg.
2272
acc276d8
AM
22732012-10-18 Alan Modra <amodra@gmail.com>
2274
2275 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2276 dynamic relocs for GOT_TPREL got entries, without symbol if
2277 resolving locally.
2278 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2279 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2280 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2281
e10f9870
AM
22822012-10-17 Alan Modra <amodra@gmail.com>
2283
2284 PR gold/14726
2285 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2286
ae034989
ST
22872012-10-16 Sriraman Tallam <tmsriram@google.com>
2288
2289 * layout.cc (Layout::include_section): Keep sections marked
2290 SHF_EXCLUDE when doing relocatable links.
2291
f3a0ed29
AM
22922012-10-16 Alan Modra <amodra@gmail.com>
2293
2294 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2295 (Target_powerpc::do_finalize_sections): Call it.
2296 (Output_data_save_res): New class and supporting functions.
2297 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2298 normal symbols defined in object files.
2299
c6de8ed4
AM
23002012-10-12 Alan Modra <amodra@gmail.com>
2301
2302 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2303 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2304 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2305 section if scan_opd_relocs not yet called.
2306 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2307
03e25981
AM
23082012-10-12 Alan Modra <amodra@gmail.com>
2309
2310 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2311 add_local_ifunc_entry): Revert last change.
2312 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2313
c9824451
AM
23142012-10-05 Alan Modra <amodra@gmail.com>
2315
2316 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2317 do_plt_address_for_global): New functions.
2318 (Output_data_got_powerpc::do_write): Don't segfault when linking
2319 statically.
2320 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2321 add_local_ifunc_entry): Return true on adding entry..
2322 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2323 glink->add_entry call. Remove unused symtab param. Adjust calls.
2324 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2325 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2326 set up symbols here.
2327 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2328 syms here. Do so even when no .iplt. Don't segfault when linking
2329 statically.
2330 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2331 new variants without reloc param.
2332 (Glink_sym_ent::Glink_sym_ent): Likewise.
2333 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2334 reloc when refs will resolve to plt call stub.
2335 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2336 R_PPC_PLTREL24 to resolve locally.
2337 (Target_powerpc::Scan::global): Correct ifunc handling.
2338 (Target_powerpc::Relocate::relocate): Correct local sym glink
2339 lookup. Don't destroy "value" when we have a plt call stub,
2340 and when checking plt call validity.
2341 (Target_powerpc::do_dynsym_value): Simplify.
2342
19fec8c1
AM
23432012-10-05 Alan Modra <amodra@gmail.com>
2344
2345 * i386.cc (Output_data_plt_i386::address_for_global,
2346 address_for_local): Add plt offset to returned value. Adjust uses.
2347 * sparc.cc (Output_data_plt_sparc::address_for_global,
2348 address_for_local): Likewise.
2349 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2350 address_for_local): Likewise.
2351 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2352 address_for_local): Likewise.
2353 * target.h (Target::plt_address_for_global, plt_address_for_local):
2354 Update comment.
2355 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2356 (Output_data_got::Got_entry::write): Nor here.
2357 * output.h: Comment fix.
2358
e867b647
WL
23592012-10-02 Jiong Wang <jiwang@tilera.com>
2360
2361 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2362 global_offset_table_ value for larget got.
2363 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2364
e5d5f5ed
AM
23652012-09-29 Alan Modra <amodra@gmail.com>
2366
2367 * powerpc.cc (Target_powerpc::iplt_): New output section.
2368 (Target_powerpc::iplt_section, make_iplt_section,
2369 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2370 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2371 Target_powerpc::plt_entry_count): Count iplt entries too.
2372 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2373 reloc section in constructor. New params.
2374 (Target_powerpc::make_plt_section): Create reloc section here instead.
2375 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2376 functions.
2377 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2378 (Output_data_glink::add_entry, find_entry): New functions to
2379 deal with local syms.
2380 (Glink_sym_ent): Add support for local syms.
2381 (Output_data_glink::do_write): Handle ifunc plt entries.
2382 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2383 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2384 (Target_powerpc::Relocate::relocate): Likewise.
2385 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2386
ec4dbad3
AM
23872012-09-25 Alan Modra <amodra@gmail.com>
2388
2389 * object.h (Sized_relobj_file::adjust_local_symbol,
2390 do_adjust_local_symbol): New functions.
2391 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2392 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2393 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2394 and irregular opd entry spacing.
2395 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2396 (Global_symbol_visitor_opd): New functor.
2397 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2398 on deleted opd entries.
2399
5c0b3823
WL
24002012-09-15 Jiong Wang <jiwang@tilera.com>
2401
2402 * tilegx.cc: New file.
2403 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2404 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2405 * configure.tgt: Add entries for tilegx*.
2406 * configure.ac: Likewise.
2407 * Makefile.in: Rebuild.
2408 * configure: Likewise.
2409 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2410 tilegx.
2411
bfdfa4cd
AM
24122012-09-13 Alan Modra <amodra@gmail.com>
2413
2414 * target-reloc.h (scan_relocs): Call scan.local for relocs
2415 against symbols in discarded sections. Pass is_discarded
2416 param.
2417 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2418 Add is_discarded param.
2419 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2420 is_discarded to flag opd entry as discarded. Don't emit dyn
2421 relocs on such entries.
2422 (Target_powerpc::Scan::global): Similarly detect and handle
2423 such opd entries.
2424 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2425 opd_ent_. Update all uses.
2426 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2427 (Target_powerpc::relocate_section): Zero out discarded opd
2428 entry relocs.
2429
d77a0555
ILT
24302012-09-12 Ian Lance Taylor <iant@google.com>
2431
2432 PR gold/14570
2433 * output.cc: Rename Output_data_got template parameter from size
2434 to got_size for all functions. Compile all variants of
2435 Output_data_got.
2436 (Output_data_got::Got_entry::write): Correct use of size for
2437 symbol value. Use local_is_tls rather than casting to
2438 Sized_relobj_file.
2439 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2440 (class Sized_relobj_file): Add do_local_is_tls.
2441 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2442
815a1205
AM
24432012-09-11 Alan Modra <amodra@gmail.com>
2444
2445 PR gold/14566
2446 * layout.cc (Layout::set_segment_offsets): When using
2447 common-page-size alignment, ensure we are on a new max-page-size
2448 page.
2449 * output.cc (Output_segment::set_section_addresses): Use
2450 abi_pagesize, not common_pagesize for relro boundary.
2451 (Output_segment::set_offset): Likewise.
2452
bd73a62d
AM
24532012-09-11 Alan Modra <amodra@gmail.com>
2454
2455 * output.h (Output_data_got::add_global_tls, add_local_tls,
2456 add_local_tls_pair): New functions.
2457 (Output_data_got::add_local_pair_with_rel): Remove second
2458 reloc param. Expand comment.
2459 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2460 use_plt_or_tls_offset_, similarly for constructor param.
2461 (Output_data_got::Got_entry::write): Add got_index param.
2462 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2463 add_local_tls_pair): New functions.
2464 (Output_data_got::Got_entry::write): Handle tls symbols
2465 with use_plt_or_tls_offset_ set specially.
2466 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2467 (Output_data_got::do_write): Replace iterator with index, pass
2468 index to entry write function.
2469 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2470 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2471 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2472 call.
2473 * i386.cc (Target_i386::Scan::local): Likewise.
2474 * sparc.cc (Target_sparc::Scan::local): Likewise.
2475 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2476 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2477 do_tls_offset_for_global): New functions.
2478 (Target_powerpc::Scan::local): Correct TLS relocations and got
2479 entry values.
2480 (Target_powerpc::Scan::global): Don't emit unnecessary
2481 dynamic relocations on TLS GOT entries.
2482
00716ab1
AM
24832012-09-10 Matthias Klose <doko@ubuntu.com>
2484
2485 * config.in: Disable sanity check for kfreebsd.
2486
c891b3f9
SA
24872012-09-10 Sterling Augustine <saugustine@google.com>
2488
2489 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2490 (Gdb_index::pubtypes_read): New parameter.
2491 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2492 to calls.
2493 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2494 pubtypes_object_.
2495
e81fea4d
AM
24962012-09-09 Alan Modra <amodra@gmail.com>
2497
2498 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2499 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2500 * gc.h (gc_process_relocs): Call target gc_add_reference.
2501 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2502 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2503 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2504 unnecessary cast.
2505 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2506 to cater for when we don't need code offset. Update use.
2507 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2508 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2509 set_opd_valid): New functions.
2510 (Target_powerpc::do_gc_add_reference): New function.
2511 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2512 stashed refs.
2513 (Target_powerpc::do_gc_mark_symbol): New function.
2514
d2d60eef
CC
25152012-09-06 Cary Coutant <ccoutant@google.com>
2516
2517 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2518 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2519 (Dwarf_die::skip_attributes): Likewise.
2520 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2521 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2522 (main): Call it.
2523 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2524
32ed4573
L
25252012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2526
2527 * testsuite/script_test_3.t: Add .got.plt output section
2528 statement.
2529 * testsuite/script_test_4.t: Likewise.
2530
f4baf0d4
AM
25312012-09-05 Alan Modra <amodra@gmail.com>
2532
2533 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2534 update all uses and lose "enum" when using type.
2535
864a1b56
AM
25362012-09-05 Alan Modra <amodra@gmail.com>
2537
2538 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2539 * configure: Regenerate.
2540 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2541 (plugin_final_layout.stdout): Likewise.
2542 (memory_test): Set page sizes to 0x1000.
2543 * testsuite/Makefile.in: Regenerate.
2544 * testsuite/discard_locals_test.sh: Add FIXME comment.
2545 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2546 * testsuite/pr14265.t: Add .got output section statement.
2547 * testsuite/script_test_2.t: Likewise.
2548 * testsuite/script_test_3.t: Likewise.
2549 * testsuite/script_test_4.t: Likewise.
2550 * testsuite/script_test_5.t: Likewise.
2551 * testsuite/script_test_6.t: Likewise.
2552 * testsuite/script_test_7.t: Likewise.
2553 * testsuite/script_test_9.t: Likewise.
2554
3ea0a085
AM
25552012-09-05 Alan Modra <amodra@gmail.com>
2556
2557 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2558 (Powerpc_relocate_functions::Status): New typedef.
2559 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2560 (Target_powerpc::Scan::local): Handle REL64.
2561 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2562 for REL32 and REL64.
2563 (Target_powerpc::symval_for_branch): New function, extracted from..
2564 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2565 checks. Report overflow errors.
2566
7404fe1b
AM
25672012-09-05 Alan Modra <amodra@gmail.com>
2568
2569 * object.h (Sized_relobj_file::emit_relocs): Delete.
2570 (Sized_relobj_file::emit_relocs_reltype): Delete.
2571 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2572 relocate_relocs for --emit-relocs.
2573 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2574 * output.h: Update comment.
2575 (Output_segment::first_section): New function.
2576 (Output_segment::first_section_load_address): Use first_section.
2577 * output.cc (Output_segment::first_section): New function extracted..
2578 (Output_segment::first_section_load_address): ..from here. Delete.
2579 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2580 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2581 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2582 adjust call to target.h function.
2583 * i386.cc (Target_i386): Likewise.
2584 * sparc.cc (Target_sparc): Likewise.
2585 * x86_64.cc (Target_x86_64): Likewise.
2586 * powerpc.cc (Target_powerpc): Likewise.
2587 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2588 first tls section has section symbol for optimised local dynamic
2589 output relocs.
2590 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2591 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2592 optimised tls code.
2593 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2594 Rename to relocate_relocs. Update error message.
2595
957564c9
AS
25962012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2597
2598 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2599 --just-symbols.
2600
dd93cd0a
AM
26012012-08-31 Alan Modra <amodra@gmail.com>
2602
2603 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2604 (Powerpc_relobj::toc_base_offset): New stub function.
2605 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2606 got_mod_index_offset to tlsld_got_offset. Update all refs.
2607 (Target_powerpc::Relocate::enum skip_tls): New.
2608 (Target_powerpc::call_tls_get_addr_): New var.
2609 (Target_powerpc::is_branch_reloc): Move to file scope.
2610 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2611 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2612 New functions.
2613 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2614 (powerpc_info): Correct common_pagesize for ppc64.
2615 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2616 (Powerpc_relocate_functions): Add overflow check enums and functions.
2617 Add non-shift version of rela, rela_ua. Delete all rel public
2618 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2619 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2620 addr16_ha3, addr14 functions.
2621 (Output_data_got_powerpc::add_constant_pair): New function.
2622 (Output_data_got_powerpc::got_base_offset): Likewise.
2623 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2624 (instruction constants): Sort, add some more.
2625 (Output_data_glink::do_write): Add and use Address typedef. Use
2626 object->toc_base_offset() stub for 64-bit.
2627 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2628 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2629 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2630 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2631 Always treat .opd relocs as against locally defined symbol.
2632 Correct condition for RELATIVE relocs.
2633 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2634 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2635 for 32-bit syms with a plt entry. Correct ppc64 toc base
2636 calculations. Handle TLS relocs, and more. Add overflow
2637 checking and adjust for Powerpc_relocate_functions changes.
2638 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2639 Reinstate --emit-relocs code with FIXME.
2640
a1373b60
AM
26412012-08-30 Alan Modra <amodra@gmail.com>
2642
2643 * layout.cc (Layout::set_segment_offsets): Set p_align to
2644 abi_pagesize, not common_pagesize.
2645 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2646 to determine whether file header can go in segment.
2647
703d02da
AM
26482012-08-30 Alan Modra <amodra@gmail.com>
2649
2650 * output.h (Output_reloc::Output_reloc <output section>): Add
2651 is_relative param. Adjust calls.
2652 (Output_reloc::add_output_section_relative): New functions.
2653 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2654 is_relative.
2655 (Output_reloc::symbol_value): Handle SECTION_CODE.
2656
16164a6b
ST
26572012-08-24 Sriraman Tallam <tmsriram@google.com>
2658
2659 * gold.cc (queue_middle_tasks): Call layout again when unique
2660 segments for sections is desired.
2661 * layout.cc (Layout::Layout): Initialize new members.
2662 (Layout::get_output_section_flags): New function.
2663 (Layout::choose_output_section): Call get_output_section_flags.
2664 (Layout::layout): Make output section for mapping to a unique segment.
2665 (Layout::insert_section_segment_map): New function.
2666 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 2667 output sections marked so.
16164a6b
ST
2668 (Layout::segment_precedes): Check for unique segments when sorting.
2669 * layout.h (Layout::Unique_segment_info): New struct.
2670 (Layout::Section_segment_map): New typedef.
2671 (Layout::insert_section_segment_map): New function.
2672 (Layout::get_output_section_flags): New function.
2673 (Layout::is_unique_segment_for_sections_specified): New function.
2674 (Layout::set_unique_segment_for_sections_specified): New function.
2675 (Layout::unique_segment_for_sections_specified_): New member.
2676 (Layout::section_segment_map_): New member.
2677 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2678 Rename is_gc_pass_one to is_pass_one.
2679 Rename is_gc_pass_two to is_pass_two.
2680 Rename is_gc_or_icf to is_two_pass.
2681 Check for which pass based on whether symbols data is present.
2682 Make it two pass when unique segments for sections is desired.
2683 * output.cc (Output_section::Output_section): Initialize new
2684 members.
2685 * output.h (Output_section::is_unique_segment): New function.
2686 (Output_section::set_is_unique_segment): New function.
2687 (Output_section::is_unique_segment_): New member.
2688 (Output_section::extra_segment_flags): New function.
2689 (Output_section::set_extra_segment_flags): New function.
2690 (Output_section::extra_segment_flags_): New member.
2691 (Output_section::segment_alignment): New function.
2692 (Output_section::set_segment_alignment): New function.
2693 (Output_section::segment_alignment_): New member.
2694 (Output_segment::Output_segment): Initialize is_unique_segment_.
2695 (Output_segment::is_unique_segment): New function.
2696 (Output_segment::set_is_unique_segment): New function.
2697 (Output_segment::is_unique_segment_): New member.
2698 * plugin.cc (allow_unique_segment_for_sections): New function.
2699 (unique_segment_for_sections): New function.
2700 (Plugin::load): Add new functions to transfer vector.
2701 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2702 * Makefile.in: Regenerate.
2703 * testsuite/plugin_final_layout.sh: Check if unique segment
2704 functionality works.
2705 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2706 are available.
2707 (allow_unique_segment_for_sections): New global.
2708 (unique_segment_for_sections): New global.
2709 (claim_file_hook): Call allow_unique_segment_for_sections.
2710 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 2711
1e2bee4f
CC
27122012-08-22 Cary Coutant <ccoutant@google.com>
2713
2714 * layout.cc (Layout::include_section): Don't assert on GROUP
2715 sections with --emit-relocs.
2716
1d5dfe78
CC
27172012-08-21 Cary Coutant <ccoutant@google.com>
2718
2719 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2720 if --export-dynamic-symbol names an undef symbol.
2721
c9269dff
AM
27222012-08-18 Alan Modra <amodra@gmail.com>
2723
2724 * powerpc.cc: Formatting and white space.
2725 (Powerpc_relobj): Rename got2_section_ to special_.
2726 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2727 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2728 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2729 (Target_powerpc): Add Address typedef and invalid_address. Use
2730 throughout.
2731 (Target_powerpc::is_branch_reloc): New function.
2732 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2733 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2734 for dst_mask, value and addend.
2735 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2736 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2737 (Output_data_glink::do_write): Correct toc base. Don't try to use
2738 uint16_t for 24-bit offset. Use get_output_section_offset and
2739 check return.
2740 (Target_powerpc::Scan::local): Handle more relocs.
2741 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2742 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2743 Plug in toc restoring insn after plt calls. Translate branches
2744 to function descriptor symbols to corresponding entry point.
2745 (Target_powerpc::relocate_for_relocatable): Check return from
2746 get_output_section_offset.
2747 * symtab.h: Comment typo.
2748
b1759dce
ILT
27492012-08-14 Ian Lance Taylor <iant@google.com>
2750
2751 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2752 unsupported_relocal_local to call unsupported_reloc_global.
2753
b9b2ae8b
NC
27542012-08-14 Nick Clifton <nickc@redhat.com>
2755
2756 PR ld/14265
2757 * script-sections.cc (Sections_element::output_section_name): Add
2758 keep return parameter.
2759 (Output_section_element::match_name): Add keep return parameter.
2760 Return the value of the keep_ member.
2761 * script-sections.h (class Output_section): Update
2762 output_section_name prototype.
2763 * layout.cc (Layout::keep_input_section): New public member
2764 function.
2765 (Layout::choose_output_section): Pass keep parameter to
2766 output_section_name.
2767 * layout.h (class Layout): Add keep_input_section.
2768 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2769 sections.
2770 * testsuite/Makefile.am: Add a test.
2771 * testsuite/Makefile.in: Regenerate.
2772 * testsuite/pr14265.c: Source file for the test.
2773 * testsuite/pr14265.t: Linker script for the test.
2774 * testsuite/pr14265.sh: Shell script for the test.
2775
921b5322
AM
27762012-08-14 Alan Modra <amodra@gmail.com>
2777
2778 * target.h (Target::output_section_name): New function.
2779 (Target::do_output_section_name): New function.
2780 * layout.cc (Layout::choose_output_section): Call the above.
2781 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
2782
6ce78956
AM
27832012-08-14 Alan Modra <amodra@gmail.com>
2784
2785 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
2786 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
2787 for replace_constant call.
2788 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
2789 (Output_data_glink::do_print_to_mapfile): New function.
2790 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
2791 (Target_powerpc::Relocate::relocate): Likewise.
2792
d1a8cabd
AM
27932012-08-14 Alan Modra <amodra@gmail.com>
2794
2795 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
2796 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
2797 (Output_data_glink::add_entry,find_entry): Remove shndx param.
2798 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
2799 all references to shndx_. Handle special case for R_PPC_PLTREL24
2800 here.
2801 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
2802 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
2803 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
2804 here.
2805 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
2806 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
2807
d83ce4e3
AM
28082012-08-12 Alan Modra <amodra@gmail.com>
2809
2810 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
2811 (glink insn constants): Use uint32_t.
2812 (Output_data_glink::add_entry): Use insert, not [] operator.
2813
cf43a2fe
AM
28142012-08-11 Alan Modra <amodra@gmail.com>
2815
2816 * object.h (Sized_relobj_file::find_shdr): New function.
2817 (Sized_relobj_file::find_special_sections): New function.
2818 * object.cc (Sized_relobj_file::find_shdr): New function.
2819 (Sized_relobj_file::find_eh_frame): Use find_shdr.
2820 (Sized_relobj_file::find_special_sections): New function, split out..
2821 (Sized_relobj_file::do_read_symbols): ..from here.
2822 * output.h (Output_data_got::replace_constant): New function.
2823 (Output_data_got::num_entries): New function.
2824 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
2825 (Output_data_got::got_offset): Protected rather than private.
2826 (Output_data_got::replace_got_entry): New function.
2827 * output.cc (Output_data_got::replace_got_entry): New function.
2828 * powerpc.cc (class Powerpc_relobj): New.
2829 (class Powerpc_relocate_functions): Delete all psymval variants or
2830 convert to value,addend type. Delete pcrela, pcrela_unaligned.
2831 Implement _ha functions using corresponding _hi function.
2832 (Powerpc_relobj::find_special_sections): New function.
2833 (Target_powerpc::do_make_elf_object): New function.
2834 (class Output_data_got_powerpc): New.
2835 (class Output_data_glink): New.
2836 (class Powerpc_scan_relocatable_reloc): New.
2837 Many more changes througout file.
2838
3c892704
NC
28392012-08-09 Nick Clifton <nickc@redhat.com>
2840
2841 * po/vi.po: Updated Vietnamese translation.
2842
82435b3b
ILT
28432012-08-07 Ian Lance Taylor <iant@google.com>
2844
2845 * layout.cc (Layout::add_target_dynamic_tags): If
2846 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
2847 plt_rel.
2848
a6dc81d2
NC
28492012-07-30 Nick Clifton <nickc@redhat.com>
2850
2851 * po/gold.pot: Updated template.
2852 * po/es.po: Updated Spanish translation.
2853
f1415016
CC
28542012-07-18 Cary Coutant <ccoutant@google.com>
2855
2856 PR gold/14344
2857 * configure.ac: Add check for -gpubnames support.
2858 * configure: Regenerate.
2859 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
2860 support; force -gno-pubnames.
2861 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
2862 support.
2863 (gdb_index_test_4): New test.
2864 * testsuite/Makefile.in: Regenerate.
2865 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
2866 * testsuite/gdb_index_test_2.sh: Likewise.
2867 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
2868 * testsuite/gdb_index_test_4.sh: New script.
2869 * testsuite/gdb_index_test_comm.sh: New script with common code;
2870 don't look for space after colon.
2871
b7fd7c37
ST
28722012-07-16 Sriraman Tallam <tmsriram@google.com>
2873
2874 * gold.cc (queue_middle_tasks): Update function order only after
2875 deferred objects due to plugins are processed.
2876
1f3212db
ILT
28772012-07-11 Ian Lance Taylor <iant@google.com>
2878
2879 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
2880 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
2881 (Target_arm::scan_reloc_for_stub): Likewise.
2882 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
2883 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
2884 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
2885 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
2886 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
2887
81c82a68
ILT
28882012-07-10 Dodji Seketeli <dodji@redhat.com>
2889 Ian Lance Taylor <iant@google.com>
2890
2891 PR gold/14309
2892 * configure.ac: Test whether std::tr1::hash<off_t> works.
2893 * gold.h: Add a specialization for std::tr1::hash<off_t> if
2894 needed.
2895 * output.h (class Output_fill): Add virtual destructor.
2896 * configure, config.in: Rebuild.
2897
eabc84f4
RM
28982012-06-22 Roland McGrath <mcgrathr@google.com>
2899
2900 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
2901
370e30b6
RÁE
29022012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
2903
2904 * plugin.cc (Plugin::load): Handle position independent executables.
2905
fb1b895d
CC
29062012-06-06 Cary Coutant <ccoutant@google.com>
2907
2908 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
2909 add .debug_macro.
2910 (lines_only_debug_sections): Likewise.
2911 (gdb_fast_lookup_sections): New static array.
2912 (is_gdb_debug_section): Rename formal parameter.
2913 (is_lines_only_debug_section): Likewise.
2914 (is_gdb_fast_lookup_section): New function.
2915 (Layout::include_section): Check for ".zdebug_" prefix; pass
2916 section name suffix to is_gdb_debug_section, et al.; check for
2917 fast-lookup sections when building .gdb_index.
2918 * options.h (--strip-debug-gdb): Update GDB version number.
2919
7c0640fa
CC
29202012-06-06 Cary Coutant <ccoutant@google.com>
2921
2922 * configure.ac: Add check for fallocate.
2923 * configure: Regenerate.
2924 * config.in: Regenerate.
2925
2926 * options.h (class General_options): Add --mmap-output-file and
2927 --posix-fallocate options.
2928 * output.cc: (posix_fallocate): Remove; replace with...
2929 (gold_fallocate): New function.
2930 (Output_file::map_no_anonymous): Call gold_fallocate.
2931 (Output_file::map): Check --mmap-output-file option.
2932
2a49eb69
DK
29332012-06-05 Jing Yu <jingyu@google.com>
2934
2935 * gold.h (textdomain): Add do {} to empty while(0).
2936 (bindtextdomain): Likewise.
2937
fad072ac
CC
29382012-06-04 Cary Coutant <ccoutant@google.com>
2939
2940 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
2941 has_dynsym_index.
2942
8cc69fb6
ST
29432012-05-25 Sriraman Tallam <tmsriram@google.com>
2944
2945 * symtab.cc (Symbol_table::define_special_symbol):
2946 Initialize *poldsym to prevent uninitialized variable errors.
2947
1be75daa
CC
29482012-05-23 Cary Coutant <ccoutant@google.com>
2949
2950 * layout.cc (Layout::section_name_mapping): Add rules to handle
2951 exact match on .data.rel.ro.local or .data.rel.ro.
2952 (Layout::output_section_name): Check for exact matches.
2953
9b689de0
CC
29542012-05-23 Cary Coutant <ccoutant@google.com>
2955
2956 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
2957 more carefully.
2958
b24fdbf5
CC
29592012-05-22 Cary Coutant <ccoutant@google.com>
2960
2961 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
2962 object before exporting symbol.
2963
e550e1a2
L
29642012-05-21 H.J. Lu <hongjiu.lu@intel.com>
2965
2966 * testsuite/tls_test.cc: Include "config.h" first.
2967 * testsuite/tls_test_c.c: Likewise.
2968
df7b86aa
NC
29692012-05-17 Daniel Richard G. <skunk@iskunk.org>
2970 Nick Clifton <nickc@redhat.com>
2971
2972 PR 14072
2973 * configure.in: Add check that sysdep.h has been included before
2974 any system header files.
2975 * configure: Regenerate.
2976 * config.in: Regenerate.
2977
1007b503
CC
29782012-05-14 Cary Coutant <ccoutant@google.com>
2979
2980 * layout.cc (Layout::make_output_section): Mark .tdata section
2981 as RELRO.
2982 * testsuite/relro_test.cc: Add a TLS variable.
2983
fd885f3a
L
29842012-05-10 H.J. Lu <hongjiu.lu@intel.com>
2985
2986 PR gold/14091
2987 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
2988 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
2989 R_X86_64_64.
2990
80f5885c
CC
29912012-05-08 Cary Coutant <ccoutant@google.com>
2992
2993 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
2994 (lines_only_debug_sections): Likewise.
2995
2e702c99
RM
29962012-05-02 Roland McGrath <mcgrathr@google.com>
2997
2998 * nacl.cc: New file.
2999 * nacl.h: New file.
3000 * Makefile.am (CCFILES, HFILES): Add them.
3001 * Makefile.in: Regenerate.
3002 * i386.cc (Output_data_plt_i386_nacl): New class.
3003 (Output_data_plt_i386_nacl_exec): New class.
3004 (Output_data_plt_i386_nacl_dyn): New class.
3005 (Target_i386_nacl): New class.
3006 (Target_selector_i386_nacl): New class.
3007 (target_selector_i386): Use it instead of Target_selector_i386.
3008 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3009 (Target_x86_64_nacl): New class.
3010 (Target_selector_x86_64_nacl): New class.
3011 (target_selector_x86_64, target_selector_x32): Use it instead of
3012 Target_selector_x86_64.
3013 * arm.cc (Output_data_plt_arm_nacl): New class.
3014 (Target_arm_nacl): New class.
3015 (Target_selector_arm_nacl): New class.
3016 (target_selector_arm, target_selector_armbe): Use it instead of
3017 Target_selector_arm.
3018
3019 * target-select.cc (select_target): Take new Input_file* and off_t
3020 arguments, pass them on to recognize method of selector.
3021 * object.cc (make_elf_sized_object): Update caller.
3022 * parameters.cc (parameters_force_valid_target): Likewise.
3023 * incremental.cc (make_sized_incremental_binary): Likewise.
3024 * target-select.h: Update decl.
3025 (Target_selector::recognize): Take new Input_file* argument,
3026 pass it on to do_recognize.
3027 (Target_selector::do_recognize): Take new Input_file* argument.
3028 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3029 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3030 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3031 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3032
3033 * target.h (Target::Target_info): New members isolate_execinstr
3034 and rosegment_gap.
3035 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3036 * arm.cc (Target_arm::arm_info): Update initializer.
3037 * i386.cc (Target_i386::i386_info): Likewise.
3038 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3039 * sparc.cc (Target_sparc::sparc_info): Likewise.
3040 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3041 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3042 * layout.cc (Layout::attach_allocated_section_to_segment):
3043 Take new const Target* argument. If target->isolate_execinstr(), act
3044 like --rosegment.
3045 (Layout::find_first_load_seg): Take new const Target* argument;
3046 if target->isolate_execinstr(), reject PF_X segments.
3047 (Layout::relaxation_loop_body): Update caller.
3048 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3049 reset file offset to zero when we hit LOAD_SEG, and then do a second
3050 loop over the segments before LOAD_SEG to reassign offsets after
3051 addresses have been determined. Handle target->rosegment_gap().
3052 (Layout::attach_section_to_segment): Take new const Target* argument;
3053 pass it to attach_allocated_section_to_segment.
3054 (Layout::make_output_section): Update caller.
3055 (Layout::attach_sections_to_segments): Take new const Target* argument;
3056 pass it to attach_section_to_segment.
3057 * gold.cc (queue_middle_tasks): Update caller.
3058 * layout.h (Layout): Update method decls with new arguments.
3059
3060 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3061 Target_info pointer to use.
3062 (Target_arm::do_make_data_plt): New virtual method.
3063 (Target_arm::make_data_plt): New method that calls it.
3064 (Target_arm::make_plt_entry): Use it.
3065 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3066 for the section alignment.
3067 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3068 method.
3069 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3070 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3071 method.
3072 (Output_data_plt_arm::get_plt_entry_size): Call it.
3073 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3074 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3075 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3076 method.
3077 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3078 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3079 method instead of sizeof(plt_entry).
3080 (Output_data_plt_arm::add_entry): Likewise.
3081 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3082 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3083 than static method.
3084 (Target_arm::plt_entry_size): Likewise.
3085 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3086 Move to ...
3087 (Output_data_plt_arm_standard): ... here, new class.
3088 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3089 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3090 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3091
3092 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3093 Take additional argument for the PLT entry size.
3094 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3095 Use get_plt_entry_size method rather than plt_entry_size variable.
3096 (Output_data_plt_x86_64::reserve_slot): Likewise.
3097 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3098 (Output_data_plt_x86_64::add_entry): Likewise.
3099 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3100 (Output_data_plt_x86_64::address_for_global): Likewise.
3101 (Output_data_plt_x86_64::address_for_local): Likewise.
3102 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3103 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3104 Make method non-static.
3105 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3106 method.
3107 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3108 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3109 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3110 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3111 virtual method.
3112 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3113 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3114 virtual method.
3115 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3116 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3117 virtual method.
3118 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3119 (Output_data_plt_x86_64::plt_entry_size)
3120 (Output_data_plt_x86_64::first_plt_entry)
3121 (Output_data_plt_x86_64::plt_entry)
3122 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3123 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3124 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3125 (Output_data_plt_x86_64_standard): ... here, new class.
3126 (Target_x86_64::Target_x86_64): Take optional argument for the
3127 Target_info pointer to use.
3128 (Target_x86_64::do_make_data_plt): New virtual method.
3129 (Target_x86_64::make_data_plt): New method to call it.
3130 (Target_x86_64::init_got_plt_for_update): Use that.
3131 Call this->plt_->add_eh_frame method here.
3132 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3133 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3134 rather than static method.
3135 (Target_x86_64::plt_entry_size): Likewise.
3136 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3137 rather than plt_entry_size variable. Move guts of PLT filling to...
3138 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3139 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3140 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3141
3142 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3143 additional argument for the section alignment.
3144 Don't do add_eh_frame_for_plt here.
3145 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3146 non-static. Use get_plt_entry_size method rather than plt_entry_size
3147 variable.
3148 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3149 method.
3150 (Output_data_plt_i386::get_plt_entry_size): Call it.
3151 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3152 (Output_data_plt_i386::add_eh_frame): New method to call it.
3153 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3154 method.
3155 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3156 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3157 method.
3158 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3159 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3160 method instead of plt_entry_size.
3161 (Output_data_plt_i386::plt_entry_size)
3162 (Output_data_plt_i386::plt_eh_frame_fde_size)
3163 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3164 (Output_data_plt_i386_standard): ... here, new class.
3165 (Output_data_plt_i386_exec): New class.
3166 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3167 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3168 (Output_data_plt_i386::exec_plt_entry): Move to ...
3169 (Output_data_plt_i386_exec::plt_entry): ... here.
3170 (Output_data_plt_i386_dyn): New class.
3171 (Output_data_plt_i386::first_plt_entry): Move to ...
3172 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3173 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3174 (Output_data_plt_i386_dyn::plt_entry): ... here.
3175 (Target_i386::Target_i386): Take optional argument for the Target_info
3176 pointer to use.
3177 (Target_i386::do_make_data_plt): New virtual method.
3178 (Target_i386::make_data_plt): New method to call it.
3179 (Target_i386::make_plt_section): Use that.
3180 Call this->plt_->add_eh_frame method here.
3181 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3182 rather than plt_entry_size variable.
3183 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3184 (Output_data_plt_i386::address_for_local): Likewise.
3185 (Output_data_plt_i386::do_write): Likewise.
3186 Move guts of PLT filling to...
3187 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3188 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3189 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3190 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3191
b9b9f2ee
CC
31922012-05-01 Cary Coutant <ccoutant@google.com>
3193
3194 * dwarf_reader.cc (Dwarf_die::read_attributes)
3195 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3196 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3197 * reduced_debug_output.cc
3198 (Output_reduced_debug_info_section::get_die_end): Remove
3199 DW_FORM_GNU_ref_index. Add default case.
3200
57923f48
MW
32012012-04-26 Mark Wielaard <mjw@redhat.com>
3202
3203 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3204 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3205 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3206 DW_AT_high_pc as offset from DW_AT_low_pc.
3207
3208 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3209 * testsuite/Makefile.in: Regenerate.
3210 * testsuite/gdb_index_test_3.c: New test source file.
3211 * testsuite/gdb_index_test_3.sh: New test source file.
3212
2c54b4f4
ILT
32132012-04-25 Ian Lance Taylor <iant@google.com>
3214
3215 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3216 pointer.
3217 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3218 as a class, not a struct.
3219 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3220 (Target_arm::apply_cortex_a8_workaround): Likewise.
3221 * gc.h: Declare Reloc_types as a struct, not a class.
3222 * object.h: Declare Symbols_data as a struct.
3223 * reloc.h: Declare Read_relocs_data as a struct.
3224 * target.h: Declare Relocate_info as a struct.
3225
a5a5f7a3
DM
32262012-04-24 David S. Miller <davem@davemloft.net>
3227
3228 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3229 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3230 and R_SPARC_WPLT30.
3231
f038d496
CC
32322012-04-24 Cary Coutant <ccoutant@google.com>
3233
3234 * incremental-dump.cc (find_input_containing_global): Replace
3235 magic number with symbolic constant.
3236 (dump_incremental_inputs): Update version number.
3237 * incremental.cc (Output_section_incremental_inputs): Update version
3238 number; import symbolic constants from Incremental_inputs_reader.
3239 (Incremental_inputs::create_data_sections): Align relocations
3240 section correctly for 64-bit targets.
3241 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3242 constants; add padding.
3243 (Output_section_incremental_inputs::write_header): Add assert for
3244 header_size.
3245 (Output_section_incremental_inputs::write_input_files): Add assert
3246 for input_entry_size.
3247 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3248 add assert for object_info_size, input_section_entry_size,
3249 global_sym_entry_size.
3250 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3251 for data structure sizes; use them.
3252 (Incremental_input_entry_reader): Import symbolic constants from
3253 Incremental_inputs_reader; use them.
3254
a4d85145
DM
32552012-04-23 David S. Miller <davem@davemloft.net>
3256
3257 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3258 and elf_flags_set_.
3259 (Target_sparc::Target_sparc): Initialize new fields.
3260 (Target_sparc::do_make_elf_object): New function.
3261 (Target_sparc::do_adjust_elf_header): New function.
3262
1d509098
CC
32632012-04-23 Cary Coutant <ccoutant@google.com>
3264
3265 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3266 CU range table of gdb index.
3267
7ebeff7f
DM
32682012-04-20 David S. Miller <davem@davemloft.net>
3269
3270 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3271 instead of false.
3272
13cf9988
DM
32732012-04-16 David S. Miller <davem@davemloft.net>
3274
2a1079e8
DM
3275 * sparc.cc (Target_sparc::got_address): New function.
3276 (Sparc_relocate_functions::gdop_hix22): New function.
3277 (Sparc_relocate_functions::gdop_lox10): New function.
3278 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3279 relocs.
3280 (Target_sparc::Scan::local): Likewise if the global symbol is not
3281 preemptible and is not IFUNC.
3282 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3283 transformations for local and non-preemptible non-IFUNC global
3284 symbols.
3285
0bc964fc
DM
3286 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3287 writing out 64-bit part of ranges.
3288
661d7a80
DM
3289 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3290 -fpic and -fpie respectively.
3291 * Makefile.in: Regenerate.
3292
8c2bf391
DM
3293 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3294 (Target_sparc::Target_sparc): Initialize new field.
3295 (Target_sparc::do_plt_section_for_global): New function.
3296 (Target_sparc::do_plt_section_for_local): New function.
3297 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3298 (Target_sparc::make_plt_section): New function, broken out of
3299 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3300 (Target_sparc::make_plt_entry): Call make_plt_section.
3301 (Target_sparc::make_local_ifunc_plt_entry): New function.
3302 (Target_sparc::rela_ifunc_section): New function.
3303 (Target_sparc::plt_section): Remove const.
3304 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3305 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3306 and ifunc_count_ fields.
3307 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3308 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3309 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3310 (Output_data_plt_sparc::rela_ifunc): New function.
3311 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3312 (Output_data_plt_sparc::has_ifunc_section): New function.
3313 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3314 (Output_data_plt_sparc::address_for_global): New function.
3315 (Output_data_plt_sparc::address_for_local): New function.
3316 (Output_data_plt_sparc::plt_index_to_offset): New function.
3317 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3318 and entry_count.
3319 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3320 entry_count.
3321 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3322 R_SPARC_JMP_IREL to switch.
3323 (Target_sparc::Scan::check_non_pic): Likewise.
3324 (Target_sparc::Scan::local): Handle IFUNC symbols.
3325 (Target_sparc::Scan::local): Likewise.
3326 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3327 and plt_address_for_local.
3328 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3329 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3330
13cf9988
DM
3331 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3332 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3333 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3334 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3335 global relocs too.
3336 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3337 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3338 calls.
3339 * sparc.cc (Target_sparc::Scan::global): Likewise.
3340 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3341
31821be0
CC
33422012-04-16 Cary Coutant <ccoutant@google.com>
3343
3344 * archive.cc (Library_base::should_include_member): Check for
3345 --export-dynamic-symbol.
3346 * options.h (class General_options): Add --export-dynamic-symbol.
3347 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3348 --export-dynamic-symbol.
3349 (Symbol_table::gc_mark_undef_symbols): Likewise.
3350 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3351
2615994e
DM
33522012-04-12 David S. Miller <davem@davemloft.net>
3353
3354 * sparc.cc (Reloc::wdisp10): New relocation method.
3355 (Reloc::h34): Likewise.
3356 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3357 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3358 R_SPARC_WDISP10.
3359 (Target_sparc::Scan::local): Likewise.
3360 (Target_sparc::Scan::global): Likewise.
3361 (Target_sparc::Relocate::relocate): Likewise.
3362
6782735d
CC
33632012-04-09 Cary Coutant <ccoutant@google.com>
3364
3365 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3366 low_pc == 0.
3367
8c7a0b00
ILT
33682012-04-06 Ian Lance Taylor <iant@google.com>
3369
3370 * timer.cc: #include <unistd.h>.
3371
58797674
RM
33722012-04-06 Roland McGrath <mcgrathr@google.com>
3373
3374 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3375 * config.in: Regenerate.
3376 * configure: Regenerate.
3377
44350750
NC
33782012-04-05 Nick Clifton <nickc@redhat.com>
3379
3380 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3381 (AM_LC_MESSAGES): Add.
3382 * aclocal.m4: Regenerate.
3383 * config.in: Regenerate.
3384 * configure: Regenerate.
3385
c1027032
CC
33862012-03-21 Cary Coutant <ccoutant@google.com>
3387
3388 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3389 * Makefile.in: Regenerate.
3390 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3391 (Sized_elf_reloc_mapper::symbol_section): New function.
3392 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3393 (make_elf_reloc_mapper): New function.
3394 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3395 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3396 (Dwarf_abbrev_table::do_get_abbrev): New function.
3397 (Dwarf_ranges_table::read_ranges_table): New function.
3398 (Dwarf_ranges_table::read_range_list): New function.
3399 (Dwarf_pubnames_table::read_section): New function.
3400 (Dwarf_pubnames_table::read_header): New function.
3401 (Dwarf_pubnames_table::next_name): New function.
3402 (Dwarf_die::Dwarf_die): New function.
3403 (Dwarf_die::read_attributes): New function.
3404 (Dwarf_die::skip_attributes): New function.
3405 (Dwarf_die::set_name): New function.
3406 (Dwarf_die::set_linkage_name): New function.
3407 (Dwarf_die::attribute): New function.
3408 (Dwarf_die::string_attribute): New function.
3409 (Dwarf_die::int_attribute): New function.
3410 (Dwarf_die::uint_attribute): New function.
3411 (Dwarf_die::ref_attribute): New function.
3412 (Dwarf_die::child_offset): New function.
3413 (Dwarf_die::sibling_offset): New function.
3414 (Dwarf_info_reader::check_buffer): New function.
3415 (Dwarf_info_reader::parse): New function.
3416 (Dwarf_info_reader::do_parse): New function.
3417 (Dwarf_info_reader::do_read_string_table): New function.
3418 (Dwarf_info_reader::lookup_reloc): New function.
3419 (Dwarf_info_reader::get_string): New function.
3420 (Dwarf_info_reader::visit_compilation_unit): New function.
3421 (Dwarf_info_reader::visit_type_unit): New function.
3422 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3423 Sized_elf_reloc_mapper.
3424 (Sized_dwarf_line_info::symbol_section): Remove function.
3425 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3426 (Sized_dwarf_line_info::read_line_mappings): Remove object
3427 parameter, adjust callers.
3428 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3429 * dwarf_reader.h: Include <sys/types.h>.
3430 (class Track_relocs): Remove forward declaration.
3431 (class Elf_reloc_mapper): New class.
3432 (class Sized_elf_reloc_mapper): New class.
3433 (class Dwarf_abbrev_table): New class.
3434 (class Dwarf_range_list): New class.
3435 (class Dwarf_ranges_table): New class.
3436 (class Dwarf_pubnames_table): New class.
3437 (class Dwarf_die): New class.
3438 (class Dwarf_info_reader): New class.
3439 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3440 (Sized_dwarf_line_info::symbol_section): Remove member function.
3441 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3442 base class.
3443 * gdb-index.cc: New source file.
3444 * gdb-index.h: New source file.
3445 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3446 and .debug_types sections, call Layout::add_to_gdb_index.
3447 (Sized_relobj_incr::do_section_name): Implement.
3448 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3449 return type; Implement.
3450 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3451 return type.
3452 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3453 parameter list and return type.
3454 (Sized_incr_dynobj::do_section_contents): Likewise.
3455 * layout.cc: Include gdb-index.h.
3456 (Layout::Layout): Initialize gdb_index_data_.
3457 (Layout::init_fixed_output_section): Check for .gdb_index section.
3458 (Layout::add_to_gdb_index): New function. Instantiate.
3459 * layout.h: Add forward declaration for class Gdb_index.
3460 (Layout::add_to_gdb_index): New member function.
3461 (Layout::gdb_index_data_): New data member.
3462 * main.cc: Include gdb-index.h.
3463 (main): Print statistics for gdb index.
3464 * object.cc (Object::section_contents): Move code into
3465 do_section_contents.
3466 (need_decompressed_section): Check for sections needed when building
3467 gdb index.
3468 (build_compressed_section_map): Likewise.
3469 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3470 gdb index.
3471 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3472 sections; call Layout::add_to_gdb_index.
3473 (Sized_relobj_file::do_decompressed_section_contents): Call
3474 do_section_contents directly.
3475 * object.h (Object::do_section_contents): Adjust parameter list and
3476 return type.
3477 (Object::do_decompressed_section_contents): Call do_section_contents
3478 directly.
3479 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3480 return type.
3481 * options.h (class General_options): Add --gdb-index option.
3482 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3483 list and return type.
3484 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3485 * reloc.h (Track_relocs::checkpoint): New function.
3486 (Track_relocs::reset): New function.
3487
3488 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3489 New test cases.
3490 * testsuite/Makefile.in: Regenerate.
3491 * testsuite/gdb_index_test.cc: New test source file.
3492 * testsuite/gdb_index_test_1.sh: New test source file.
3493 * testsuite/gdb_index_test_2.sh: New test source file.
3494
647f1574
DK
34952012-03-19 Doug Kwan <dougkwan@google.com>
3496
3497 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3498 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3499 __exidx_start and __exidx_end. Make symbol table parameter
3500 anonymous as it is not used.
3501 * gold.cc (queue_middle_tasks): Call target hook to define any
3502 target-specific symbols.
3503 * target.h (Target::define_standard_symbols): New method.
3504 (Target::do_define_standard_symbols): Same.
3505 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3506 * testsuite/Makefile.in: Regenerate.
3507 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3508 and __exidx_end.
3509 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3510 relocations are generated for __exidx_start and __exidx_end.
3511
7c6109da
DK
35122012-03-16 Doug Kwan <dougkwan@google.com>
3513
3514 * testsuite/Makefile.am: Disable test initpri3b.
3515 * testsuite/Makefile.in: Regenerate.
3516
7b8957f8
DK
35172012-03-15 Doug Kwan <dougkwan@google.com>
3518
3519 * arm.cc (Target_arm::got_section): Make .got section read-only
3520 if -z now is given.
3521
14dc9ef7
ILT
35222012-03-15 Ian Lance Taylor <iant@google.com>
3523
3524 PR gold/13850
3525 * layout.cc (Layout::make_output_section): Correctly mark
3526 SHT_INIT_ARRAY, et. al., as relro.
3527
fa40b62a
DK
35282012-03-14 Doug Kwan <dougkwan@google.com>
3529
3530 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3531 dynamic relocations for protected symbols in shared objects.
3532
fd325007
ILT
35332012-03-13 Ian Lance Taylor <iant@google.com>
3534
3535 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3536 keep the larger alignment.
3537
e8dd54e1
CC
35382012-03-12 Cary Coutant <ccoutant@google.com>
3539
3540 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3541 handling of DW_LNE_define_file.
3542
feb5f3b0
CC
35432012-03-12 Cary Coutant <ccoutant@google.com>
3544
3545 * reduced_debug_output.cc
3546 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3547 codes to switch.
3548
a1fb4256
CC
35492012-02-29 Cary Coutant <ccoutant@google.com>
3550
3551 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3552
5dd8762a
CC
35532012-02-29 Cary Coutant <ccoutant@google.com>
3554
3555 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3556 Call Object::decompressed_section_contents.
3557 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3558 New dtor.
3559 (Sized_dwarf_line_info::buffer_start_): New data member.
3560 * merge.cc (Output_merge_data::do_add_input_section): Call
3561 Object::decompressed_section_contents.
3562 (Output_merge_string::do_add_input_section): Likewise.
3563 * object.cc (need_decompressed_section): New function.
3564 (build_compressed_section_map): Decompress sections needed later.
3565 (Sized_relobj_file::do_decompressed_section_contents): New function.
3566 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3567 * object.h (Object::decompressed_section_contents): New function.
3568 (Object::discard_decompressed_sections): New function.
3569 (Object::do_decompressed_section_contents): New function.
3570 (Object::do_discard_decompressed_sections): New function.
3571 (Compressed_section_info): New type.
3572 (Compressed_section_map): Include decompressed section contents.
3573 (Sized_relobj_file::do_decompressed_section_contents): New function.
3574 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3575
7b5de7ee
CC
35762012-02-16 Cary Coutant <ccoutant@google.com>
3577
3578 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3579 * testsuite/Makefile.in: Regenerate.
3580
f9fa4a63
CC
35812012-02-14 Cary Coutant <ccoutant@google.com>
3582
3583 * options.cc (General_options::finalize): Disallow -pie and -static.
3584
2c175ebc
DK
35852012-02-03 Doug Kwan <dougkwan@google.com>
3586
3587 * arm.cc (Arm_relocate_functions::abs8,
3588 Arm_relocate_functions::abs16): Use
3589 Bits::has_signed_unsigned_overflow32.
3590 (Arm_relocate_functions::thm_abs8): Correct range of
3591 overflow check.
3592 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3593 in assertions.
3594
90cff06f
DK
35952012-02-02 Doug Kwan <dougkwan@google.com>
3596
3597 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3598 position independent outputs, not just shared objects.
3599
63887f3d
L
36002012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3601
3602 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3603 * configure: Regenerated.
3604
bef2b434
ILT
36052012-01-27 Ian Lance Taylor <iant@google.com>
3606
3607 * reloc.h (Bits): New class with static functions, copied from
3608 namespace utils in arm.cc.
3609 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3610 instead.
3611
c335b55d
L
36122012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3613
3614 * incremental.cc (write_info_blocks): Correct relocation offset.
3615
41194d9f
L
36162012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3617
3618 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3619 (Relocate::tls_gd_to_le): Likewise.
3620
1bae613c
L
36212012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3622
3623 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3624
24482ca0
L
36252012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3626
3627 * configure.ac: Check if -mcmodel=medium works.
3628 * configure: Regenerated.
3629
c2c7840a
CC
36302012-01-24 Cary Coutant <ccoutant@google.com>
3631
3632 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3633 definition and ...
3634 (read_unsigned_LEB_128_x): ... this new function.
3635 (read_signed_LEB_128): Replaced with inline definition and ...
3636 (read_signed_LEB_128_x): ... this new function.
3637 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3638 (read_unsigned_LEB_128): Add inline definition.
3639 (read_signed_LEB_128_x): New function.
3640 (read_signed_LEB_128): Add inline definition.
3641 * testsuite/Makefile.am (leb128_unittest): New unit test.
3642 * testsuite/Makefile.in: Regenerate.
3643 * testsuite/leb128_unittest.cc: New unit test.
3644
833de760 36452012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3646
3647 PR gold/13617
3648 * i386.cc (Target_i386::do_code_fill): When using a jmp
3649 instruction, pad with nop instructions.
3650 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3651
618d6666
L
36522012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3653
3654 * x86_64.cc (gc_process_relocs): Add typename on types used in
3655 template.
3656 (scan_relocs): Likewise.
3657 (relocate_section): Likewise.
3658 (apply_relocation): Likewise.
3659
3660ff06
L
36602012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3661
3662 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3663 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3664 under x32.
3665
fc51264f
L
36662012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3667
3668 * x86_64.cc: Initial support for x32.
3669
dd74ae06
CC
36702012-01-03 Cary Coutant <ccoutant@google.com>
3671
3672 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3673 Use abstract base class for GOT.
3674 * gold/output.h (class Output_data_got_base): New abstract base class.
3675 (class Output_data_got): Derive from new base class, adjust ctors.
3676 (Output_data_got::reserve_slot): Make virtual; rename to
3677 do_reserve_slot; Adjust callers.
3678 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3679 pointer to abstract base class.
3680 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3681
83896202
ILT
36822011-12-18 Ian Lance Taylor <iant@google.com>
3683
3684 * object.h (Relobj::local_symbol_value): New function.
3685 (Relobj::local_plt_offset): New function.
3686 (Relobj::local_has_got_offset): New function.
3687 (Relobj::local_got_offset): New function.
3688 (Relobj::set_local_got_offset): New function.
3689 (Relobj::do_local_symbol_value): New pure virtual function.
3690 (Relobj::do_local_plt_offset): Likewise.
3691 (Relobj::do_local_has_got_offset): Likewise.
3692 (Relobj::do_local_got_offset): Likewise.
3693 (Relobj::do_set_local_got_offset): Likewise.
3694 (Sized_relobj::do_local_has_got_offset): Rename from
3695 local_has_got_offset.
3696 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3697 (Sized_relobj::do_set_local_got_offset): Rename from
3698 set_local_got_offset.
3699 (Sized_relobj_file::do_local_plt_offset): Rename from
3700 local_plt_offset.
3701 (Sized_relobj_file::do_local_symbol_value): New function.
3702 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3703 local_plt_offset.
3704 * output.cc (Output_data_got::Got_entry::write): Change object to
3705 Relobj. Use local_symbol_value.
3706 (Output_data_got::add_global_with_rel): Change rel_dyn to
3707 Output_data_reloc_generic*. Use add_global_generic.
3708 (Output_data_got::add_global_with_rela): Remove. Change all
3709 callers to use add_global_with_rel.
3710 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3711 Output_data_reloc_generic*. Use add_global_generic.
3712 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3713 callers to use add_global_pair_with_rel.
3714 (Output_data_got::add_local): Change object to Relobj*.
3715 (Output_data_got::add_local_plt): Likewise.
3716 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3717 change rel_dyn to Output_data_reloc_generic*. Use
3718 add_local_generic.
3719 (Output_data_got::add_local_with_rela): Remove. Change all
3720 callers to use all_local_with_rel.
3721 (Output_data_got::add_local_pair_with_rel): Change object to
3722 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3723 add_output_section_generic.
3724 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3725 callers to use add_local_pair_with_rel.
3726 (Output_data_got::reserve_local): Change object to Relobj*.
3727 * output.h: (class Output_data_reloc_generic): Add pure virtual
3728 declarations for add_global_generic, add_local_generic,
3729 add_output_section_generic.
3730 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3731 functions for Output_data_reloc_generic. Update declarations for
3732 changes listed in output.cc.
3733 (class Output_data_got): Change template parameter to got_size.
3734 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3735 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3736 function.
3737 (Sized_relobj_incr::do_local_plt_offset): New function.
3738 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3739 add_global_generic.
3740
76677ad0
CC
37412011-12-17 Cary Coutant <ccoutant@google.com>
3742
3743 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3744 * resolve.cc (Symbol_table::resolve): Likewise.
3745 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3746 arrays.
3747 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3748
8b8dd8d5
ILT
37492011-12-16 Ian Lance Taylor <iant@google.com>
3750
3751 * output.h (Output_data_reloc_generic::add): Only call
3752 add_dynamic_reloc if this is a dynamic reloc section.
3753
d55525b9
L
37542011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3755
3756 PR gold/13505
3757 * target-reloc.h (apply_relocation): Replace <64, false> with
3758 <size, big_endian>.
3759
ff81c7c1
NC
37602011-11-25 Nick Clifton <nickc@redhat.com>
3761
3762 * po/it.po: New Italian translation.
3763
628f39be
SA
37642011-11-17 Sterling Augustine <saugustine@google.com>
3765
3766 * script.cc (script_include_directive): Implement.
3767 (read_script_file): New local variables name and search_path. Update
3768 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3769 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3770 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
3771
98ef3ea4
SA
37722011-11-11 Sterling Augustine <saugustine@google.com>
3773
3774 * yyscript.y (section_cmd): Add support for INCLUDE directive.
3775 (file_or_sections_cmd): Likewise.
3776
f4a8b6d7
DK
37772011-11-11 Doug Kwan <dougkwan@google.com>
3778
3779 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
3780 if --just-symbols is given.
3781
29ab395d
DK
37822011-11-10 Doug Kwan <dougkwan@google.com>
3783
3784 PR gold/13362
3785 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
3786 when processing data relocs.
3787 * reloc.h (Relocate_functions::rel_unaligned): New method.
3788 (Relocate_functions::pcrel_unaligned): Ditto.
3789 (Relocate_functions::rel32_unaligned): Ditto.
3790 (Relocate_functions::pcrel32_unaligned): Ditto.
3791
2c339f71
DK
37922011-11-09 Doug Kwan <dougkwan@google.com>
3793
3794 PR gold/13362
3795 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
3796 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
3797 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
3798 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3799 (Relocate_functions::rel_unaligned): New.
3800 (Relocate_functions::rel32_unaligned): New.
3801 * target-reloc.h (relocate_for_relocatable): Add code to handle
3802 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
3803 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
3804 arm_unaligned_reloc_r): New targets.
3805 * testsuite/Makefile.in: Regenerate.
3806 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
3807 linking.
3808
3f3cddf1
ILT
38092011-11-02 Ian Lance Taylor <iant@google.com>
3810
3811 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
3812 NATIVE_LINKER.
3813 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
3814 * options.cc (General_options::finalize): Use library search path
3815 from configure script if specified. If not native and no sysroot,
3816 only search TOOLLIBDIR.
3817 * options.h (Search_directory::Search_directory): Change name to
3818 const std::string&.
3819 (General_options::add_to_library_path_with_sysroot): Change arg to
3820 const std::string&.
3821 * configure, Makefile.in, config.in: Rebuild.
3822
a8e2273b
ILT
38232011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3824
3825 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
3826 we are working around the ARM1176 Erratum.
3827 * options.h (General_options::fix_arm1176): Add option.
3828 * testsuite/Makefile.am: Add testcases, and keep current ones
3829 working.
3830 * testsuite/Makefile.in: Regenerate.
3831 * testsuite/arm_fix_1176.s: New file.
3832 * testsuite/arm_fix_1176.sh: Likewise.
3833
cd6eab1c
ILT
38342011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
3835
3836 * arm.cc (Target_arm::Target_arm): Remove initialisation of
3837 may_use_blx_.
3838 (Target_arm::may_use_blx): Remove method.
3839 (Target_arm::set_may_use_blx): Likewise.
3840 (Target_arm::may_use_v4t_interworking): New method.
3841 (Target_arm::may_use_v5t_interworking): Likewise.
3842 (Target_arm::may_use_blx_): Remove member variable.
3843 (Arm_relocate_functions::arm_branch_common): Check for v5T
3844 interworking.
3845 (Arm_relocate_functions::thumb_branch_common): Likewise.
3846 (Reloc_stub::stub_type_for_reloc): Likewise.
3847 (Target_arm::do_finalize_sections): Correct interworking checks.
3848 * testsuite/Makefile.am: Add new tests.
3849 * testsuite/Makefile.in: Regenerate.
3850 * testsuite/arm_farcall_arm_arm.s: New test.
3851 * testsuite/arm_farcall_arm_arm.sh: Likewise.
3852 * testsuite/arm_farcall_arm_thumb.s: Likewise.
3853 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
3854 * testsuite/arm_farcall_thumb_arm.s: Likewise.
3855 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
3856 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
3857 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
3858
286adcf4
CC
38592011-10-31 Cary Coutant <ccoutant@google.com>
3860
3861 PR gold/13023
3862 * expression.cc (Expression::eval_with_dot): Add
3863 is_section_dot_assignment parameter.
3864 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
3865 absolute and assigning to dot within a section.
3866 * script-sections.cc
3867 (Output_section_element_assignment::set_section_addresses): Pass
3868 dot_section to set_if_absolute.
3869 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
3870 as is_section_dot_assignment flag to eval_with_dot.
3871 (Output_section_element_dot_assignment::set_section_addresses):
3872 Likewise.
3873 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
3874 parameter. Also set value if relative to dot_section; set the
3875 symbol's output_section.
3876 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
3877 parameter. Adjust all callers.
3878 (Expression::eval_maybe_dot): Likewise.
3879 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
3880 Adjust all callers.
3881 * testsuite/script_test_2.t: Test assignment of an absolute value
3882 to dot within an output section element.
3883
9634ed06
CC
38842011-10-31 Cary Coutant <ccoutant@google.com>
3885
3886 * options.h (class General_options): Add --[no-]gnu-unique options.
3887 * symtab.cc (Symbol_table::sized_write_globals): Convert
3888 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
3889
de4101c7
CC
38902011-10-31 Cary Coutant <ccoutant@google.com>
3891
3892 PR gold/13359
3893 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
3894 unnecessary assertion.
3895 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
3896
7257cc92
ST
38972011-10-31 Sriraman Tallam <tmsriram@google.com>
3898
3899 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3900 gc_mark_symbol.
3901 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
3902 gc_mark_symbol.
3903 Change to just keep the section associated with symbol.
3904 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
3905 they are externally visible and --export-dynamic is turned on.
3906 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
3907
bfc34b3f
ILT
39082011-10-19 Ian Lance Taylor <iant@google.com>
3909
3910 PR gold/13163
3911 * script-sections.cc
3912 (Output_section_element_dot_assignment::needs_output_section): New
3913 function.
3914
ea0d8c47
ILT
39152011-10-19 Ian Lance Taylor <iant@google.com>
3916
3917 PR gold/13204
3918 * layout.cc (Layout::segment_precedes): Don't assert failure if a
3919 --section-start option was seen.
3920 * options.h (General_options::any_section_start): New function.
3921
abd242a9
DM
39222011-10-18 David S. Miller <davem@davemloft.net>
3923
3924 PR binutils/13301
3925 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
3926 member to track relocation locations that have moved during TLS
3927 reloc optimizations.
3928 (Target_sparc::Relocate::Relocate): Initialize to NULL.
3929 (Target_sparc::Relocate::relocate): Adjust view down by 4
3930 bytes if it matches reloc_adjust_addr_.
3931 (Target_sparc::Relocate::relocate_tls): Always move the
3932 __tls_get_addr call delay slot instruction forward 4 bytes when
3933 performing relaxation.
3934
bab9090f
CC
39352011-10-18 Cary Coutant <ccoutant@google.com>
3936
3937 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
3938 (Output_file::map_no_anonymous): Check for non-zero
3939 return code from posix_fallocate.
3940
f7c5b166
CC
39412011-10-17 Cary Coutant <ccoutant@google.com>
3942
3943 PR gold/13245
3944 * plugin.cc (is_visible_from_outside): Check for symbols
3945 referenced from dynamic objects.
3946 * resolve.cc (Symbol_table::resolve): Don't count references
3947 from dynamic objects as references from real ELF files.
3948 * testsuite/plugin_test_2.sh: Adjust expected result.
3949
b490c0bb
CC
39502011-10-17 Cary Coutant <ccoutant@google.com>
3951
3952 * gold.cc: Include timer.h.
3953 (queue_middle_tasks): Stamp time.
3954 (queue_final_tasks): Likewise.
3955 * main.cc (main): Store timer in parameters. Print timers
3956 for each pass.
3957 * parameters.cc (Parameters::Parameters): Initialize timer_.
3958 (Parameters::set_timer): New function.
3959 (set_parameters_timer): New function.
3960 * parameters.h (Parameters::set_timer): New function.
3961 (Parameters::timer): New function.
3962 (Parameters::timer_): New data member.
3963 (set_parameters_timer): New function.
3964 * timer.cc (Timer::stamp): New function.
3965 (Timer::get_pass_time): New function.
3966 * timer.h (Timer::stamp): New function.
3967 (Timer::get_pass_time): New function.
3968 (Timer::pass_times_): New data member.
3969
f475cf7b
CC
39702011-10-17 Cary Coutant <ccoutant@google.com>
3971
3972 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
3973 task for members of lib groups.
3974
cdd7e244
CC
39752011-10-17 Cary Coutant <ccoutant@google.com>
3976
3977 PR gold/13288
4f95c8b4 3978 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
3979 (File_read::make_view): Move bounds check (replace with assert)...
3980 (File_read::find_or_make_view): ... to here.
3981
dfb45471
CC
39822011-10-12 Cary Coutant <ccoutant@google.com>
3983
4f95c8b4 3984 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
3985 ::read returns less than requested size.
3986
53bbcc1b
CC
39872011-10-10 Cary Coutant <ccoutant@google.com>
3988
4f95c8b4 3989 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
3990 Initialize defined_count_.
3991 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
3992 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
3993 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
3994 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
3995 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 3996 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
3997 member.
3998 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 3999 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4000 Return zeroes instead of internal error.
4001
397b129b
CC
40022011-10-10 Cary Coutant <ccoutant@google.com>
4003
4004 PR gold/13249
4f95c8b4 4005 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4006 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4007 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4008 (Output_reloc::type_): Adjust size of bit field.
4009 (Output_reloc::use_plt_offset_): New bit field.
4010 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4011 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4012 flag. Adjust all callers.
4f95c8b4 4013 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4014 creating RELATIVE relocations.
4015
d5698657
NC
40162011-10-10 Nick Clifton <nickc@redhat.com>
4017
4018 * po/es.po: Updated Spanish translation.
4019 * po/fi.po: Updated Finnish translation.
4020
6a59a5c2
DN
40212011-10-03 Diego Novillo <dnovillo@google.com>
4022
4023 * options.cc (parse_uint): Fix dereference of RETVAL.
4024
f0558624
ST
40252011-09-29 Sriraman Tallam <tmsriram@google.com>
4026
4027 * layout.h (section_order_map_): New member.
4028 (get_section_order_map): New member function.
4029 * output.cc (Output_section::add_input_section): Check for patterns
4030 only when --section-ordering-file is specified.
4031 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4032 output_sections have been formed.
4033 * layout.cc (Layout_Layout): Initialize section_order_map_.
4034 * plugin.cc (update_section_order): Store order in order_map. Do not
4035 update the order.
4036 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4037 * testsuite/Makefile.in: Regenerate.
4038 * testsuite/plugin_section_order.c: New file.
4039 * testsuite/plugin_final_layout.cc: New file.
4040 * testsuite/plugin_final_layout.sh: New file.
4041
a7dac153
CC
40422011-09-29 Cary Coutant <ccoutant@google.com>
4043
4f95c8b4 4044 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4045 Check for NULL.
4f95c8b4 4046 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4047 symbols during incremental update.
4048 (Symbol_table::add_from_dynobj): Likewise.
4049
eebd87a5
ILT
40502011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4051 Ian Lance Taylor <iant@google.com>
4052
4053 * symtab.cc (Symbol_table::define_special_symbol): Always
4054 canonicalize version string.
4055
403a3331
CC
40562011-09-26 Cary Coutant <ccoutant@google.com>
4057
4f95c8b4
CC
4058 * gold.cc (queue_initial_tasks): Move option checks ...
4059 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4060 some options; make others fatal.
4061
235061c2
CC
40622011-09-26 Cary Coutant <ccoutant@google.com>
4063
4064 gcc PR lto/47247
4065 * plugin.cc (get_symbols_v2): New function.
4066 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4067 (is_referenced_from_outside): New function.
4068 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4069 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4070 (get_symbols): Pass version parameter.
4071 (get_symbols_v2): New function.
4072 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4073 parameter.
4074 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4075 (onload): Add LDPT_GET_SYMBOLS_V2.
4076 (all_symbols_read_hook): Use get_symbols_v2; check for
4077 LDPR_PREVAILING_DEF_IRONLY_EXP.
4078 * testsuite/plugin_test_3.sh: Update expected results.
4079
dc87f620
ILT
40802011-09-23 Simon Baldwin <simonb@google.com>
4081
4082 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4083 configuration options.
4084 * configure: Regenerate.
4085 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4086 * Makefile.in: Regenerate.
4087 * testsuite/Makefile.in: Regenerate.
4088
a8279f82
ST
40892011-09-19 Sriraman Tallam <tmsriram@google.com>
4090
4091 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4092
0c9350c8
CC
40932011-09-19 Cary Coutant <ccoutant@google.com>
4094
4095 * incremental.cc (can_incremental_update): Fix typo in comment.
4096 * incremental.h (can_incremental_update): Likewise.
4097
aa06ae28
CC
40982011-09-18 Cary Coutant <ccoutant@google.com>
4099
4100 * incremental.cc (can_incremental_update): New function.
4101 * incremental.h (can_incremental_update): New function.
4102 * layout.cc (Layout::init_fixed_output_section): Call it.
4103 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4104 * object.cc (Sized_relobj_file::do_layout): Call
4105 can_incremental_update.
4106
ebb300b2
CC
41072011-09-13 Cary Coutant <ccoutant@google.com>
4108
4109 * configure.ac: Check for glibc support for gnu_indirect_function
4110 support with static linking, setting automake conditional
4111 IFUNC_STATIC.
4112 * Makefile.in: Regenerate.
4113 * configure: Regenerate.
4114
4115 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4116 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4117 for IFUNC_STATIC.
4118 * testsuite/Makefile.in: Regenerate.
4119
1206d0d5
CC
41202011-09-13 Cary Coutant <ccoutant@google.com>
4121
4122 * incremental.cc (Sized_relobj_incr::do_layout): Call
4123 report_comdat_group for kept comdat sections.
4124 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4125 * testsuite/Makefile.in: Regenerate.
4126 * testsuite/incr_comdat_test_1.cc: New source file.
4127 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4128 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4129 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4130
40b29874
ILT
41312011-09-13 Ian Lance Taylor <iant@google.com>
4132
4133 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4134 variable external_symbols_offset.
4135
1b045aac
ILT
41362011-09-12 Ian Lance Taylor <iant@google.com>
4137
4138 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4139 triggered if object has no symbols.
4140
24c6c55a
DM
41412011-09-09 David S. Miller <davem@davemloft.net>
4142
4143 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4144 (Output_fill_debug_line::do_write): Likewise.
4145
66570254
CC
41462011-08-29 Cary Coutant <ccoutant@google.com>
4147
4148 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4149 casts to match formatting specs.
4150 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4151
8ea8cd50
CC
41522011-08-26 Cary Coutant <ccoutant@google.com>
4153
4154 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4155 remaining hole size when allocating.
4156 (Layout::make_output_section): Set fill methods for debug sections.
4157 * layout.h (Free_list::Free_list_node): Move from private to
4158 public.
4159 (Free_list::set_min_hole_size): New function.
4160 (Free_list::begin, Free_list::end): New functions.
4161 (Free_list::min_hole_): New data member.
4162 * output.cc: Include dwarf.h.
4163 (Output_fill_debug_info::do_minimum_hole_size): New function.
4164 (Output_fill_debug_info::do_write): New function.
4165 (Output_fill_debug_line::do_minimum_hole_size): New function.
4166 (Output_fill_debug_line::do_write): New function.
4167 (Output_section::Output_section): Initialize new data member.
4168 (Output_section::set_final_data_size): Ensure patch space is larger
4169 than minimum hole size.
4170 (Output_section::do_write): Fill holes in debug sections.
4171 * output.h (Output_fill): New class.
4172 (Output_fill_debug_info): New class.
4173 (Output_fill_debug_line): New class.
4174 (Output_section::set_free_space_fill): New function.
4175 (Output_section::free_space_fill_): New data member.
4176 * testsuite/Makefile.am (incremental_test_3): Add
4177 --incremental-patch option.
4178 (incremental_test_4): Likewise.
4179 (incremental_test_5): Likewise.
4180 (incremental_test_6): Likewise.
4181 (incremental_copy_test): Likewise.
4182 (incremental_common_test_1): Likewise.
4183 * testsuite/Makefile.in: Regenerate.
4184
7cf80422
NC
41852011-08-26 Nick Clifton <nickc@redhat.com>
4186
4187 * po/es.po: Updated Spanish translation.
4188
c3f7b0e5
CC
41892011-08-01 Cary Coutant <ccoutant@google.com>
4190
4191 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4192 * gold/testsuite/Makefile.in: Regenerate.
4193 * gold/testsuite/justsyms_exec.c: New source file.
4194 * gold/testsuite/justsyms_lib.c: New source file.
4195
9590bf25
CC
41962011-08-01 Cary Coutant <ccoutant@google.com>
4197
4198 * layout.cc (Layout::set_segment_offsets): Don't realign text
4199 segment if -Ttext was specified.
4200 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4201 file type.
4202 * object.h (Sized_relobj_file::e_type): New function.
4203 (Sized_relobj_file::e_type_): New data member.
4204 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4205 base address for ET_EXEC files.
4206 * target.cc (Target::do_make_elf_object_implementation): Allow
4207 ET_EXEC files with --just-symbols option.
4208
dcd8d12e
CC
42092011-07-28 Cary Coutant <ccoutant@google.com>
4210
4211 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4212 Add thread_number parameter.
4213 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4214 * workqueue-threads.cc
4215 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4216 current thread if its thread number is greater than desired thread
4217 count.
4218 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4219 Add thread_number parameter.
4220 (Workqueue::should_cancel_thread): Likewise.
4221 (Workqueue::find_runnable_or_wait): Pass thread_number to
4222 should_cancel_thread.
4223 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4224 parameter.
4225
804eb480
ST
42262011-07-22 Sriraman Tallam <tmsriram@google.com>
4227
4228 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4229 only after checking if it cannot be forced local.
4230 * symtab.h (is_externally_visible): Check if the symbol is not forced
4231 local.
4232
f1ddb600
ILT
42332011-07-15 Ian Lance Taylor <iant@google.com>
4234
4235 * options.h (class General_options): Add --print-output-format.
4236 Move -EL next to -EB, for better --help output.
4237 * target-select.cc: Include <cstdio>, "options.h", and
4238 "parameters.h".
4239 (Target_selector::do_target_bfd_name): New function.
4240 (print_output_format): New function.
4241 * target-select.h (class Target_selector): Update declarations.
4242 (Target_selector::target_bfd_name): New function.
4243 (print_output_format): Declare.
4244 * main.cc: Include "target-select.h".
4245 (main): Handle --print-output-format.
4246 * gold.cc: Include "target-select.h".
4247 (queue_initial_tasks): Handle --print-output-format when there are
4248 no input files.
4249 * parameters.cc (parameters_force_valid_target): Give a better
4250 error message if -EB/-EL does not match target.
4251 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4252 function.
4253
7d172687
ILT
42542011-07-15 Ian Lance Taylor <iant@google.com>
4255
4256 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4257 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4258 (Output_data_plt_i386::do_write): Write address of .dynamic
4259 section to first entry in .got.plt section.
4260 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4261 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4262 Initialize layout_.
4263 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4264 section to first entry in .got.plt section.
4265 * layout.h (Layout::dynamic_section): New function.
4266
e9552f7e
ST
42672011-07-13 Sriraman Tallam <tmsriram@google.com>
4268
4269 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4270 to claim_file call.
4271 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4272 input_section_position_, and input_section_glob_.
4273 (read_layout_from_file): Call function section_ordering_specified.
4274 * layout.h (is_section_ordering_specified): New function.
4275 (section_ordering_specified): New function.
4276 (section_ordering_specified_): New boolean member.
4277 * main.cc(main): Call load_plugins after layout object is defined.
4278 * output.cc (Output_section::add_input_section): Use
4279 function section_ordering_specified to check if section ordering is
4280 needed.
4281 * output.cc (Output_section::add_relaxed_input_section): Use
4282 function section_ordering_specified to check if section ordering is
4283 needed.
4284 (Output_section::update_section_layout): New function.
4285 (Output_section::sort_attached_input_sections): Check if input section
4286 must be reordered.
4287 * output.h (Output_section::update_section_layout): New function.
4288 * plugin.cc (get_section_count): New function.
4289 (get_section_type): New function.
4290 (get_section_name): New function.
4291 (get_section_contents): New function.
4292 (update_section_order): New function.
58797674 4293 (allow_section_ordering): New function.
e9552f7e
ST
4294 (Plugin::load): Add the new interfaces to the transfer vector.
4295 (Plugin_manager::load_plugins): New parameter.
4296 (Plugin_manager::all_symbols_read): New parameter.
4297 (Plugin_manager::claim_file): New parameter. Save the elf object for
4298 unclaimed objects.
4299 (Plugin_manager::get_elf_object): New function.
4300 (Plugin_manager::get_view): Change to directly use the bool to check
4301 if get_view is called from claim_file_hook.
4302 * plugin.h (input_objects): New function
4303 (Plugin__manager::load_plugins): New parameter.
4304 (Plugin_manager::claim_file): New parameter.
4305 (Plugin_manager::get_elf_object): New function.
4306 (Plugin_manager::in_claim_file_handler): New function.
4307 (Plugin_manager::in_claim_file_handler_): New member.
4308 (layout): New function.
4309 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4310 handler with an extra parameter. Make the elf object before calling
4311 claim_file handler.
4312 * testsuite/plugin_test.c (get_section_count): New function pointer.
4313 (get_section_type): New function pointer.
4314 (get_section_name): New function pointer.
4315 (get_section_contents): New function pointer.
4316 (update_section_order): New function pointer.
4317 (allow_section_ordering): New function pointer.
4318 (onload): Check if the new interfaces exist.
4319
9446efde
ILT
43202011-07-13 Ian Lance Taylor <iant@google.com>
4321
4322 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4323 relro section.
4324 * x86_64.cc (Target_x86_64::got_section): Likewise.
4325 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4326 (relro_now_test_SOURCES): New variable.
4327 (relro_now_test_DEPENDENCIES): New variable.
4328 (relro_now_test_LDFLAGS): New variable.
4329 (relro_now_test_LDADD): New variable.
4330 (relro_now_test.so): New target.
4331 * testsuite/Makefile.in: Rebuild.
4332
07aa62f2
ILT
43332011-07-12 Ian Lance Taylor <iant@google.com>
4334
4335 PR gold/12980
4336 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4337 GLOB_DAT relocation rather than a RELATIVE relocation for a
4338 protected symbol when creating a shared library.
4339 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4340 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4341 * testsuite/protected_main_1.cc (main): Test that protected
4342 function has same address.
4343
e2153196
ILT
43442011-07-11 Ian Lance Taylor <iant@google.com>
4345
4346 PR gold/12979
4347 * options.h (class General_options): Add -Bgroup.
4348 * options.cc (General_options::finalize): If -Bgroup is set,
4349 default to --unresolved-symbols=report-all.
4350 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4351 * target-reloc.h (issue_undefined_symbol_error): Handle
4352 --unresolved-symbols=report-all.
4353
6daf5215
ILT
43542011-07-08 Ian Lance Taylor <iant@google.com>
4355
4356 PR gold/11985
4357 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4358 if linker script discards key sections.
4359 (Layout::create_dynamic_symtab): Likewise.
4360 (Layout::assign_local_dynsym_offsets): Likewise.
4361 (Layout::sized_create_version_sections): Likewise.
4362 (Layout::create_interp): Likewise.
4363 (Layout::finish_dynamic_section): Likewise.
4364 (Layout::set_dynamic_symbol_size): Likewise.
4365
beabb2c6
ILT
43662011-07-08 Ian Lance Taylor <iant@google.com>
4367
4368 PR gold/12386
4369 * options.h (class General_options): Add --unresolved-symbols.
4370 * target-reloc.h (issue_undefined_symbol_error): Check
4371 --unresolved-symbols. Add comments.
4372
9c16daf1
ILT
43732011-07-08 Ian Lance Taylor <iant@google.com>
4374
4375 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4376 expression more complex.
4377
191f1a2d
ILT
43782011-07-08 Ian Lance Taylor <iant@google.com>
4379
4380 PR gold/11317
4381 * target-reloc.h (issue_undefined_symbol_error): New inline
4382 function, broken out of relocate_section.
4383 (relocate_section): Call issue_undefined_symbol_error.
4384 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4385 there is no TLS segment if we are about to issue an undefined
4386 symbol error.
4387 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4388
62855347
ILT
43892011-07-08 Ian Lance Taylor <iant@google.com>
4390
4391 PR gold/12279
4392 * resolve.cc (Symbol_table::should_override): Add fromtype
4393 parameter. Change all callers. Give error when linking together
4394 TLS and non-TLS symbol.
4395 (Symbol_table::should_override_with_special): Add fromtype
4396 parameter. Change all callers.
4397 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4398 there is no TLS segment if we have reported some errors.
4399 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4400
67181c72
ILT
44012011-07-08 Ian Lance Taylor <iant@google.com>
4402
4403 PR gold/12372
4404 * target.h (Target::plt_address_for_global): New function.
4405 (Target::plt_address_for_local): New function.
4406 (Target::plt_section_for_global): Remove.
4407 (Target::plt_section_for_local): Remove.
4408 (Target::do_plt_address_for_global): New virtual function.
4409 (Target::do_plt_address_for_local): New virtual function.
4410 (Target::do_plt_section_for_global): Remove.
4411 (Target::do_plt_section_for_local): Remove.
4412 (Target::register_global_plt_entry): Add Symbol_table and Layout
4413 parameters.
4414 * output.cc (Output_data_got::Got_entry::write): Use
4415 plt_address_for_global and plt_address_for_local.
4416 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4417 address of output section.
4418 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4419 got_irelative_, and irelative_count_ fields. Update
4420 declarations.
4421 (Output_data_plt_i386::has_irelative_section): New function.
4422 (Output_data_plt_i386::entry_count): Add irelative_count_.
4423 (Output_data_plt_i386::set_final_data_size): Likewise.
4424 (class Target_i386): Add got_irelative_ and rel_irelative_
4425 fields. Update declarations.
4426 (Target_i386::Target_i386): Initialize new fields.
4427 (Target_i386::do_plt_address_for_global): New function replacing
4428 do_plt_section_for_global.
4429 (Target_i386::do_plt_address_for_local): New function replacing
4430 do_plt_section_for_local.
4431 (Target_i386::got_section): Create got_irelative_.
4432 (Target_i386::rel_irelative_section): New function.
4433 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4434 fields. Don't define __rel_iplt_{start,end}.
4435 (Output_data_plt_i386::add_entry): Add symtab and layout
4436 parameters. Change all callers. Use different PLT and GOT for
4437 IFUNC symbols.
4438 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4439 layout parameters. Change all callers. Use different PLT and
4440 GOT.
4441 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4442 (Output_data_plt_i386::rel_irelative): New function.
4443 (Output_data_plt_i386::address_for_global): New function.
4444 (Output_data_plt_i386::address_for_local): New function.
4445 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4446 IRELATIVE GOT when changing IFUNC GOT entries.
4447 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4448 reloc.
4449 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4450 if we didn't create an IRELATIVE GOT.
4451 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4452 plt_address_for_local.
4453 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4454 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4455 got_irelative_, and irelative_count_ fields. Update
4456 declarations.
4457 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4458 Initialize new fields. Remove symtab parameter. Change all
4459 callers.
4460 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4461 irelative_count_.
4462 (Output_data_plt_x86_64::has_irelative_section): New function.
4463 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4464 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4465 fields. Update declarations.
4466 (Target_x86_64::Target_x86_64): Initialize new fields.
4467 (Target_x86_64::do_plt_address_for_global): New function replacing
4468 do_plt_section_for_global.
4469 (Target_x86_64::do_plt_address_for_local): New function replacing
4470 do_plt_section_for_local.
4471 (Target_x86_64::got_section): Create got_irelative_.
4472 (Target_x86_64::rela_irelative_section): New function.
4473 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4474 all callers. Don't create __rel_iplt_{start,end}.
4475 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4476 parameters. Change all callers. Use different PLT and GOT for
4477 IFUNC symbols.
4478 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4479 layout parameters. Change all callers. Use different PLT and
4480 GOT.
4481 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4482 parameters. Change all callers. Use different PLT and GOT for
4483 IFUNC symbols.
4484 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4485 (Output_data_plt_x86_64::rela_irelative): New function.
4486 (Output_data_plt_x86_64::address_for_global): New function.
4487 (Output_data_plt_x86_64::address_for_local): New function.
4488 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4489 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4490 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4491 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4492 parameters.
4493 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4494 reloc.
4495 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4496 symbols if we didn't create an IRELATIVE GOT.
4497 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4498 plt_address_for_local.
4499 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4500 * testsuite/ifuncvar1.c: New test file.
4501 * testsuite/ifuncvar2.c: New test file.
4502 * testsuite/ifuncvar3.c: New test file.
4503 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4504 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4505 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4506 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4507 * testsuite/Makefile.in: Rebuild.
4508
33c15b45
CC
45092011-07-07 Cary Coutant <ccoutant@google.com>
4510
4511 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4512 (two_file_test_1_ndebug.o): Likewise.
4513 (two_file_test_1b_ndebug.o): Likewise.
4514 (two_file_test_2_ndebug.o): Likewise.
4515 (two_file_test_main_ndebug.o): Likewise.
4516 (incremental_test_2): Link with no-debug versions.
4517
f48b5fb7
CC
45182011-07-06 Cary Coutant <ccoutant@google.com>
4519
4520 * gold/incremental.cc
4521 (Output_section_incremental_inputs::write_info_blocks): Check for
4522 hidden and internal symbols.
4523
221597a5
CC
45242011-07-06 Cary Coutant <ccoutant@google.com>
4525
4526 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4527 Check disposition for startup file.
4528 (Incremental_inputs::report_command_line): Ignore
4529 --incremental-startup-unchanged option.
4530 * options.cc (General_options::parse_incremental_startup_unchanged):
4531 New function.
4532 (General_options::General_options): Initialize new data member.
4533 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4534 (General_options): Add --incremental-startup-unchanged option.
4535 (General_options::incremental_startup_disposition): New function.
4536 (General_options::incremental_startup_disposition_): New data member.
4537
e24719f6
CC
45382011-07-06 Cary Coutant <ccoutant@google.com>
4539
4540 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4541 input file index to Script_info ctor.
4542 (Sized_incremental_binary::do_file_has_changed): Find the
4543 command-line argument for files named in scripts.
4544 * incremental.h (Script_info::Script_info): New ctor
4545 with input file index.
4546 (Script_info::input_file_index): New function.
4547 (Script_info::input_file_index_): New data member.
4548 (Incremental_binary::get_library): Add const.
4549 (Incremental_binary::get_script_info): Add const.
4550 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4551 * testsuite/Makefile.am (incremental_test_5): New test case.
4552 (incremental_test_6): New test case.
4553 * testsuite/Makefile.in: Regenerate.
4554
8f7c81e8
CC
45552011-07-06 Cary Coutant <ccoutant@google.com>
4556
4557 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4558 debug output when command lines differ.
4559
9fbd3822
CC
45602011-07-06 Cary Coutant <ccoutant@google.com>
4561
4562 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4563 --incremental-patch option.
4564 * layout.cc (Free_list::allocate): Extend allocation beyond original
4565 end if enabled.
4566 (Layout::make_output_section): Mark sections that should get
4567 patch space.
4568 * options.cc (parse_percent): New function.
4569 * options.h (parse_percent): New function.
4570 (DEFINE_percent): New macro.
4571 (General_options): Add --incremental-patch option.
4572 * output.cc (Output_section::Output_section): Initialize new data
4573 members.
4574 (Output_section::add_input_section): Print section name when out
4575 of patch space.
4576 (Output_section::add_output_section_data): Likewise.
4577 (Output_section::set_final_data_size): Add patch space when
4578 doing --incremental-full.
4579 (Output_section::do_reset_address_and_file_offset): Remove patch
4580 space.
4581 (Output_segment::set_section_list_addresses): Print debug output
4582 only if --incremental-update.
4583 * output.h (Output_section::set_is_patch_space_allowed): New function.
4584 (Output_section::is_patch_space_allowed_): New data member.
4585 (Output_section::patch_space_): New data member.
4586 * parameters.cc (Parameters::incremental_full): New function.
4587 * parameters.h (Parameters::incremental_full): New function
4588 * testsuite/Makefile.am (incremental_test_2): Add test for
4589 --incremental-patch option.
4590 * testsuite/Makefile.in: Regenerate.
4591 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4592 (t18): Remove function body.
4593
f6cccc2c
DK
45942011-07-05 Doug Kwan <dougkwan@google.com>
4595
4596 PR gold/12771
4597 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4598 Arm_Address type for relocation result.
4599 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4600 overflow check.
4601 (Arm_relocate_functions::abs32): Use unaligned access.
4602 (Arm_relocate_functions::rel32): Ditto.
4603 (Arm_relocate_functions::prel31): Ditto.
4604 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4605 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4606 static data relocations.
4607 * testsuite/Makefile.in: Regnerate.
4608 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4609
28a13fec
ILT
46102011-07-05 Ian Lance Taylor <iant@google.com>
4611
4612 PR gold/12392
4613 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4614 symbols if necessary.
4615 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4616
24d47b34
ILT
46172011-07-05 Ian Lance Taylor <iant@google.com>
4618
4619 PR gold/12952
4620 * resolve.cc (Symbol::override_base_with_special): Simply override
4621 version with special symbol version, ignoring previous version.
4622
41f9cbbe
ILT
46232011-07-05 Ian Lance Taylor <iant@google.com>
4624
4625 * object.cc (Sized_relobj_file::include_section_group): Add
4626 information to comment about signature location.
4627
886288f1
ILT
46282011-07-02 Ian Lance Taylor <iant@google.com>
4629
4630 PR gold/12957
4631 * options.h (class General_options): Add -f and -F.
4632 * options.cc (General_options::finalize): Fatal error if -f/-F
4633 are used without -shared.
4634 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4635
ae3a6d4f
ILT
46362011-07-02 Ian Lance Taylor <iant@google.com>
4637
4638 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4639
21131061
ILT
46402011-07-01 Ian Lance Taylor <iant@google.com>
4641
4642 PR gold/12525
4643 PR gold/12952
4644 * resolve.cc (Symbol::override_base_with_special): Don't override
4645 the version if the overriding symbol has a different name.
4646 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4647 all callers. If we give an error about an undefined version,
4648 define the base version if necessary.
4649 * dynobj.h (class Versions): Update declaration.
4650 * testsuite/weak_alias_test_5.cc: New file.
4651 * testsuite/weak_alias_test.script: New file.
4652 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4653 and versioned_alias have the right value, and call t2.
4654 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4655 weak_alias_test_5.so.
4656 (weak_alias_test_LDADD): Likewise.
4657 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4658 * testsuite/Makefile.in: Rebuild.
4659
611062c0
ILT
46602011-07-01 Ian Lance Taylor <iant@google.com>
4661
4662 PR gold/12525
4663 * options.h (class General_options): Support -z notext.
4664 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4665 -Wl,-z,notext.
4666 (two_file_shared_nonpic.so): Likewise.
4667 (two_file_shared_mixed.so): Likewise.
4668 (two_file_shared_mixed_1.so): Likewise.
4669 (weak_undef_lib_nonpic.so): Likewise.
4670 (alt/weak_undef_lib_nonpic.so): Likewise.
4671 (tls_test_shared_nonpic.so): Likewise.
4672 * testsuite/Makefile.in: Rebuild.
4673
328c7c2f
ILT
46742011-07-01 Ian Lance Taylor <iant@google.com>
4675
4676 PR gold/12525
4677 * configure.ac: Test whether static linking works, setting
4678 the automake conditional HAVE_STATIC.
4679 * testsuite/Makefile.am: Disable tests using -static if
4680 HAVE_STATIC is not true.
4681 * configure, testsuite/Makefile.in: Rebuild.
4682
02d7cd44
ILT
46832011-07-01 Ian Lance Taylor <iant@google.com>
4684
4685 PR gold/12525
4686 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4687 Assert if we see DW_EH_PE_indirect.
4688 * target.h (Target::ehframe_datarel_base): New function.
4689 (Target::do_ehframe_datarel_base): New target function.
4690 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4691 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4692 function.
4693
07a60597
ILT
46942011-07-01 Ian Lance Taylor <iant@google.com>
4695
4696 PR gold/12571
4697 * options.h (class General_options): Add
4698 --ld-generated-unwind-info.
4699 * ehframe.cc (Fde::write): Add address parameter. Change all
4700 callers. If associated with PLT, fill in address and size.
4701 (Cie::set_output_offset): Only add merge mapping if there is an
4702 object.
4703 (Cie::write): Add address parameter. Change all callers.
4704 (Eh_frame::add_ehframe_for_plt): New function.
4705 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4706 input_offset_ fields into union u_, with new plt field.
4707 (Fde::Fde): Adjust for new union field.
4708 (Fde::Fde) [Output_data version]: New constructor.
4709 (Fde::add_mapping): Only add merge mapping if there is an object.
4710 (class Cie): Update declarations.
4711 (class Eh_frame): Declare add_ehframe_for_plt.
4712 * layout.cc (Layout::layout_eh_frame): Break out code into
4713 make_eh_frame_section, and call it.
4714 (Layout::make_eh_frame_section): New function.
4715 (Layout::add_eh_frame_for_plt): New function.
4716 * layout.h (class Layout): Update declarations.
4717 * merge.cc (Merge_map::add_mapping): Add assertion.
4718 * i386.cc: Include "dwarf.h".
4719 (class Output_data_plt_i386): Make first_plt_entry,
4720 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4721 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4722 and plt_eh_frame_fde.
4723 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4724 boundary. Call add_eh_frame_for_plt if appropriate.
4725 * x86_64.cc: Include "dwarf.h".
4726 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4727 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4728 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4729 and plt_eh_frame_fde.
4730 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4731 appropriate.
4732
14788a3f
ILT
47332011-06-29 Ian Lance Taylor <iant@google.com>
4734
4735 PR gold/12629
4736 * object.cc (Sized_relobj_file::layout_section): Change shdr
4737 parameter to be const.
4738 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4739 out of do_layout.
4740 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4741 appropriate. Call layout_eh_frame_section.
4742 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4743 sections.
4744 * object.h (class Sized_relobj_file): Update declarations.
4745
6c21fce1
ILT
47462011-06-29 Ian Lance Taylor <iant@google.com>
4747
37e41b03 4748 PR gold/12652
6c21fce1
ILT
4749 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4750 modifier.
4751 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4752
4d5e4e62
ILT
47532011-06-29 Ian Lance Taylor <iant@google.com>
4754
4755 PR gold/12675
4756 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4757 SHT_X86_64_UNWIND.
4758 * layout.cc (Layout::layout_eh_frame): Likewise.
4759
886f533a
ILT
47602011-06-29 Ian Lance Taylor <iant@google.com>
4761
4762 PR gold/12695
4763 * layout.cc (Layout::symtab_section_shndx): New function.
4764 * layout.h (class Layout): Declare symtab_section_shndx.
4765 * output.cc (Output_section::write_header): Call it.
4766
f3ae1b28
ILT
47672011-06-29 Ian Lance Taylor <iant@google.com>
4768
4769 PR gold/12818
4770 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
4771 symbols which are not used in a relocation.
4772
aecf301f
ILT
47732011-06-28 Ian Lance Taylor <iant@google.com>
4774
4775 PR gold/12898
4776 * layout.cc (Layout::segment_precedes): Don't crash if a linker
4777 script create indistinguishable segments.
4778 (Layout::set_segment_offsets): Use stable_sort when sorting
4779 segments. Pass this to Compare_segments constructor.
4780 * layout.h (class Layout): Make segment_precedes non-static.
4781 (class Compare_segments): Change from struct to class. Add
4782 layout_ field. Add constructor.
4783 * script-sections.cc
4784 (Script_sections::attach_sections_using_phdrs_clause): Rename
4785 local orphan to is_orphan. Don't report failure to put empty
4786 section in segment. On attachment failure, report name of
4787 section, and attach to first PT_LOAD segment.
4788
03ef7571
ILT
47892011-06-28 Ian Lance Taylor <iant@google.com>
4790
4791 PR gold/12934
4792 * target-select.cc (Target_selector::Target_selector): Add
4793 emulation parameter. Change all callers.
4794 (select_target_by_bfd_name): Rename from select_target_by_name.
4795 Change all callers.
4796 (select_target_by_emulation): New function.
4797 (supported_emulation_names): New function.
4798 * target-select.h (class Target_selector): Add emulation_ field.
4799 Update declarations.
4800 (Target_selector::recognize_by_bfd_name): Rename from
4801 recognize_by_name. Change all callers.
4802 (Target_selector::supported_bfd_names): Rename from
4803 supported_names. Change all callers.
4804 (Target_selector::recognize_by_emulation): New function.
4805 (Target_selector::supported_emulations): New function.
4806 (Target_selector::emulation): New function.
4807 (Target_selector::do_recognize_by_bfd_name): Rename from
4808 do_recognize_by_name. Change all callers.
4809 (Target_selector::do_supported_bfd_names): Rename from
4810 do_supported_names. Change all callers.
4811 (Target_selector::do_recognize_by_emulation): New function.
4812 (Target_selector::do_supported_emulations): New function.
4813 (select_target_by_bfd_name): Change name in declaration.
4814 (select_target_by_emulation): Declare.
4815 (supported_emulation_names): Declare.
4816 * parameters.cc (parameters_force_valid_target): Try to find
4817 target based on emulation from -m option.
4818 * options.h (class General_options): Change doc string for -m.
4819 * options.cc (help): Print emulations.
4820 (General_options::parse_V): Likewise.
4821 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
4822 Add emulation parameter. Change all callers.
4823
200b2bb9
ILT
48242011-06-28 Ian Lance Taylor <iant@google.com>
4825
4826 * target.h (class Target): Add osabi_ field.
4827 (Target::osabi): New function.
4828 (Target::set_osabi): New function.
4829 (Target::Target): Initialize osabi_.
4830 (Target::do_adjust_elf_header): Make pure virtual.
4831 (Sized_target::do_adjust_elf_header): Declare.
4832 * target.cc (Sized_target::do_adjust_elf_header): New function.
4833 (class Sized_target): Instantiate all versions.
4834 * freebsd.h (class Target_freebsd): Remove.
4835 (Target_selector_freebsd::do_recognize): Call set_osabi on
4836 Target.
4837 (Target_selector_freebsd::do_recognize_by_name): Likewise.
4838 (Target_selector_freebsd::set_osabi): Remove.
4839 * i386.cc (class Target_i386): Inherit from Sized_target rather
4840 than Target_freebsd.
4841 * x86_64.cc (class Target_x86_64): Likewise.
4842
b3ce541e
ILT
48432011-06-28 Ian Lance Taylor <iant@google.com>
4844
4845 * target.h (Target::can_check_for_function_pointers): Rewrite.
4846 Make non-virtual.
4847 (Target::can_icf_inline_merge_sections): Likewise.
4848 (Target::section_may_have_icf_unsafe_poineters): Likewise.
4849 (Target::Target_info): Add can_icf_inline_merge_sections field.
4850 (Target::do_can_check_for_function_pointers): New virtual
4851 function.
4852 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
4853 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
4854 from can_check_for_function_pointers, move in file.
4855 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
4856 section_may_have_icf_unsafe_poineters, move in file.
4857 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
4858 * i386.cc (Target_i386::do_can_check_for_function_pointers):
4859 Rename from can_check_for_function_pointers, move in file.
4860 (Target_i386::can_icf_inline_merge_sections): Remove.
4861 (Target_i386::i386_info): Initialize
4862 can_icf_inline_merge_sections.
4863 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
4864 Initialize can_icf_inline_merge_sections.
4865 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
4866 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
4867 Rename from can_check_for_function_pointers, move in file.
4868 (Target_x86_64::can_icf_inline_merge_sections): Remove.
4869 (Target_x86_64::x86_64_info): Initialize
4870 can_icf_inline_merge_sections.
4871 * testsuite/testfile.cc (Target_test::test_target_info):
4872 Likewise.
4873 * icf.cc (get_section_contents): Correct formatting.
4874
6d1c4efb
ILT
48752011-06-27 Ian Lance Taylor <iant@google.com>
4876
4877 * symtab.cc (Symbol::versioned_name): New function.
4878 (Symbol_table::add_to_final_symtab): Use versioned_name when
4879 appropriate.
4880 (Symbol_table::sized_write_symbol): Likewise.
4881 * symtab.h (class Symbol): Declare versioned_name.
4882 * stringpool.h (class Stringpool_template): Add variant of add
4883 which takes a std::basic_string.
4884 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
4885 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
4886 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
4887 (ver_test_12.o): New target.
4888 * testsuite/Makefile.in: Rebuild.
4889
57eb9b50
DK
48902011-06-27 Doug Kwan <dougkwan@google.com>
4891
4892 * arm.cc (Arm_relocate_functions::thm_jump8,
4893 Arm_relocate_functions::thm_jump11): Use a wider signed
4894 type to compute offset.
4895 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
4896 arm_thm_jump8.
4897 * testsuite/Makefile.in: Regenerate.
4898 * testsuite/arm_branch_in_range.sh: Check test results of
4899 arm_thm_jump11 and arm_thm_jump8.
4900 * testsuite/arm_thm_jump11.s: New test source file.
4901 * testsuite/arm_thm_jump11.t: New linker script.
4902 * testsuite/arm_thm_jump8.s: New test source file.
4903 * testsuite/arm_thm_jump8.t: New linker script.
4904
487b39df
ILT
49052011-06-24 Ian Lance Taylor <iant@google.com>
4906
4907 * layout.cc: Include "object.h".
4908 (ctors_sections_in_init_array): New static variable.
4909 (Layout::is_ctors_in_init_array): New function.
4910 (Layout::layout): Add entry to ctors_sections_in_init_array if
4911 appropriate.
4912 * layout.h (class Layout): Declare is_ctors_in_init_array.
4913 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
4914 is_ctors_reverse_view is set.
4915 (Sized_relobj_file::write_sections): Add layout parameter. Change
4916 all callers. Set is_ctors_reverse_view field of View_size.
4917 (Sized_relobj_file::reverse_words): New function.
4918 * object.h (Sized_relobj_file::View_size): Add
4919 is_ctors_reverse_view field.
4920 (class Sized_relobj_file): Update declarations.
4921 * testsuite/initpri3.c: New test.
4922 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
4923 initpri3b.
4924 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
4925 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
4926 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
4927 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
4928 * testsuite/Makefile.in: Rebuild.
4929
472076e4
CC
49302011-06-24 Cary Coutant <ccoutant@google.com>
4931
4932 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
4933 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
4934 (debug_msg_cdebug.err): New targets.
4935 * testsuite/Makefile.in: Regenerate.
4936 * testsuite/debug_msg.sh: Check output of link with compressed debug.
4937 Fix checks for link with shared library.
4938
a60af0db
DK
49392011-06-24 Doug Kwan <dougkwan@google.com>
4940
4941 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
4942 skip empty text sections.
4943 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
4944
5393d741
ILT
49452011-06-22 Ian Lance Taylor <iant@google.com>
4946
4947 PR gold/12910
4948 * options.h (class General_options): Add --ctors-in-init-array.
4949 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
4950 friends as SHT_PROGBITS for merging sections.
4951 (Layout::layout): Remove special handling of .init_array and
4952 friends. Don't sort if doing relocatable link. Sort for .ctors
4953 and .dtors if ctors_in_init_array.
4954 (Layout::make_output_section): Force correct section types for
4955 .init_array and friends. Don't sort if doing relocatable link,
4956 Don't sort .ctors and .dtors if ctors_in_init_array.
4957 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
4958 (Layout::output_section_name): Add relobj parameter. Change all
4959 callers. Handle .ctors. and .dtors. in code rather than table.
4960 Handle .ctors and .dtors if ctors_in_init_array.
4961 (Layout::match_file_name): New function, moved from output.cc.
4962 * layout.h (class Layout): Update declarations.
4963 * output.cc: Include "layout.h".
4964 (Input_section_sort_entry::get_priority): New function.
4965 (Input_section_sort_entry::match_file_name): Just call
4966 Layout::match_file_name.
4967 (Output_section::Input_section_sort_init_fini_compare::operator()):
4968 Handle .ctors and .dtors. Sort by explicit priority rather than
4969 by name.
4970 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
4971 * testsuite/initpri2.c: New test.
4972 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
4973 (check_PROGRAMS): Add initpri2.
4974 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
4975 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
4976 * configure, testsuite/Makefile.in: Rebuild.
4977
e1f74f98
ILT
49782011-06-19 Ian Lance Taylor <iant@google.com>
4979
4980 PR gold/12880
4981 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
4982 .interp section to a PT_INTERP segment even if we have seen a
4983 --dynamic-linker option. Don't do it if we have seen a PHDRS
4984 clause in a linker script.
4985 (Layout::finalize): Don't create a .interp section if we've
4986 already create a PT_INTERP segment.
4987 (Layout::create_interp): Always call choose_output_section (revert
4988 patch of 2011-06-17). Don't create PT_INTERP segment.
4989 * script-sections.cc
4990 (Script_sections::create_note_and_tls_segments): Add a .interp
4991 section to a PT_INTERP segment even if we have seen a
4992 --dynamic-linker option.
4993
766f91bb
ILT
49942011-06-18 Ian Lance Taylor <iant@google.com>
4995
4996 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
4997 merely because a non-PT_LOAD segment has a dynamic reloc.
4998
0d212c3a
ILT
49992011-06-18 Ian Lance Taylor <iant@google.com>
5000
5001 * layout.cc (Layout::finish_dynamic_section): Don't create
5002 DT_FLAGS entry if not needed.
5003
911a5072
ILT
50042011-06-18 Ian Lance Taylor <iant@google.com>
5005
5006 PR gold/12745
5007 * layout.cc (Layout::layout_eh_frame): Correct handling of
5008 writable .eh_frame section.
5009
534b4e5f
ILT
50102011-06-17 Ian Lance Taylor <iant@google.com>
5011
5012 PR gold/12893
5013 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5014 symbol is redefined with the exact same object and value.
5015
10b4f102
ILT
50162011-06-17 Ian Lance Taylor <iant@google.com>
5017
5018 PR gold/12880
5019 * layout.h (class Layout): Add interp_segment_ field.
5020 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5021 (Layout::attach_allocated_section_to_segment): If making shared
5022 library, put .interp section in PT_INTERP segment.
5023 (Layout::finalize): Also call create_interp if -dynamic-linker
5024 option was used.
5025 (Layout::create_interp): Assert that there is no PT_INTERP
5026 segment. If not using a SECTIONS clause, use make_output_section.
5027 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5028 * script-sections.cc
5029 (Script_sections::create_note_and_tls_segments): If making shared
5030 library, put .interp section in PT_INTERP segment.
5031
a29b0dad
ILT
50322011-06-17 Ian Lance Taylor <iant@google.com>
5033
e588ea8d
ILT
5034 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5035 when making a shared library.
5036
50372011-06-17 Ian Lance Taylor <iant@google.com>
5038
5039 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5040 parameter. Change all callers. Don't issue warning about PC32
5041 against locally defined symbol.
a29b0dad 5042
9d3b0698
ILT
50432011-06-16 Ian Lance Taylor <iant@google.com>
5044
5045 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5046 occurs in same object.
5047
85b0f90c
AM
50482011-06-14 Alan Modra <amodra@gmail.com>
5049
5050 * po/POTFILES.in: Regenerate.
5051
a94907d9
ILT
50522011-06-09 Ian Lance Taylor <iant@google.com>
5053
5054 * script-sections.cc
5055 (Orphan_output_section::set_section_addresses): For a relocatable
5056 link set address to 0.
5057
4fb3a1c3
CC
50582011-06-09 Cary Coutant <ccoutant@google.com>
5059
5060 PR gold/12804
5061 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5062 used with --compress-debug-sections.
5063 * gold/object.cc (Sized_relobj_file::do_layout): Report
5064 uncompressed size of compressed input sections.
5065
61220854
CC
50662011-06-08 Cary Coutant <ccoutant@google.com>
5067
5068 PR gold/12804
5069 * testsuite/two_file_test_2_v1.cc: Change initialization of
5070 v2 to keep it in .data.
5071
e6455dfb
CC
50722011-06-07 Cary Coutant <ccoutant@google.com>
5073
5074 * common.cc (Symbol_table::do_allocate_commons_list): Call
5075 gold_fallback.
5076 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5077 (Errors::fallback): New function.
5078 (gold_fallback): New function.
5079 * errors.h (Errors::fallback): New function.
5080 * gold.cc (gold_exit): Change status parameter to enum; adjust
5081 all callers.
5082 (queue_initial_tasks): Call gold_fallback.
5083 * gold.h: Include cstdlib.
5084 (Exit_status): New enum type.
5085 (gold_exit): Change status parameter to enum.
5086 (gold_fallback): New function.
5087 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5088 (Layout::create_symtab_sections): Likewise.
5089 (Layout::create_shdrs): Likewise.
5090 * main.cc (main): Adjust call to gold_exit.
5091 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5092 (Output_data_got::add_got_entry_pair): Likewise.
5093 (Output_section::add_input_section): Likewise.
5094 (Output_section::add_output_section_data): Likewise.
5095 (Output_segment::set_section_list_addresses): Likewise.
5096 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5097
fb0e076f
CC
50982011-06-07 Cary Coutant <ccoutant@google.com>
5099
5100 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5101 for incremental links.
5102 * output.cc (Output_segment::set_section_list_addresses): Remove
5103 FIXME and test for TLS or BSS.
5104
a5ee4d5d
CC
51052011-06-07 Cary Coutant <ccoutant@google.com>
5106
5107 * testsuite/Makefile.am: Add incremental_copy_test,
5108 incremental_common_test_1.
5109 * testsuite/Makefile.in: Regenerate.
5110 * testsuite/common_test_1_v1.c: New source file.
5111 * testsuite/common_test_1_v2.c: New source file.
5112 * testsuite/copy_test_v1.cc: New source file.
5113
5146f448
CC
51142011-06-07 Cary Coutant <ccoutant@google.com>
5115
5116 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5117 update, allocate common from bss section's free list.
5118 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5119 linker-defined symbols.
5120 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5121 Skip GOT and PLT entries that are no longer referenced.
5122 (Output_section_incremental_inputs::write_info_blocks): Mark
5123 linker-defined symbols.
5124 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5125 * output.cc (Output_section::allocate): New function.
5126 * output.h (Output_section::allocate): New function.
5127 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5128 linker-defined symbols.
5129 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5130 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5131 (Symbol::init_base_output_data): Likewise.
5132 (Symbol::init_base_output_segment): Likewise.
5133 (Symbol::init_base_constant): Likewise.
5134 (Sized_symbol::init_output_data): Likewise.
5135 (Sized_symbol::init_output_segment): Likewise.
5136 (Sized_symbol::init_constant): Likewise.
5137 (Symbol_table::do_define_in_output_data): Likewise.
5138 (Symbol_table::do_define_in_output_segment): Likewise.
5139 (Symbol_table::do_define_as_constant): Likewise.
5140 * symtab.h (Symbol::is_predefined): New function.
5141 (Symbol::init_base_output_data): Add is_predefined parameter.
5142 (Symbol::init_base_output_segment): Likewise.
5143 (Symbol::init_base_constant): Likewise.
5144 (Symbol::is_predefined_): New data member.
5145 (Sized_symbol::init_output_data): Add is_predefined parameter.
5146 (Sized_symbol::init_output_segment): Likewise.
5147 (Sized_symbol::init_constant): Likewise.
5148 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5149
26d3c67d
CC
51502011-06-07 Cary Coutant <ccoutant@google.com>
5151
5152 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5153 instead of emit_copy_reloc.
5154 (Copy_relocs::emit_copy_reloc): Refactor.
5155 (Copy_relocs::make_copy_reloc): New function.
5156 (Copy_relocs::add_copy_reloc): Remove.
5157 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5158 section.
5159 (Copy_relocs::make_copy_reloc): New function.
5160 (Copy_relocs::add_copy_reloc): Remove.
5161 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5162 unchanged input files.
5163 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5164 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5165 Reserve BSS space for COPY relocations.
5166 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5167 (Output_section_incremental_inputs::write_info_blocks): Record
5168 whether a symbol is copied from a shared object.
5169 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5170 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5171 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5172 (Incremental_input_entry_reader::get_output_symbol_index): Add
5173 is_copy parameter.
5174 (Incremental_binary::emit_copy_relocs): New function.
5175 (Incremental_binary::do_emit_copy_relocs): New function.
5176 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5177 new data member.
5178 (Sized_incremental_binary::add_copy_reloc): New function.
5179 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5180 (Sized_incremental_binary::Copy_reloc): New struct.
5181 (Sized_incremental_binary::Copy_relocs): New typedef.
5182 (Sized_incremental_binary::copy_relocs_): New data member.
5183 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5184 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5185 * target.h (Sized_target::emit_copy_reloc): New function.
5186 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5187
7cdb37d9
CC
51882011-06-02 Cary Coutant <ccoutant@google.com>
5189
5190 PR gold/12163
5191 * gold/archive.cc (Archive::Archive): Initialize new data member.
5192 (Archive::include_all_members): Return if archive has already been
5193 included.
5194 * gold/archive.h (Archive::include_all_members_): New data member.
5195
cc643b88
NC
51962011-06-02 Nick Clifton <nickc@redhat.com>
5197
5198 * dynobj.h: Fix spelling mistake in comment.
5199 * output.cc: Likewise.
5200
f62a3ca7 52012011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5202 Asier Llano
f62a3ca7
DK
5203
5204 PR gold/12826
cc643b88 5205 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5206 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5207 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5208 redundant arm_exidx_test.so.
5209 * testsuite/Makefile.in: Regenerate.
5210 (check_SCRIPTS): Add pr12826.sh
5211 (check_DATA): Add pr12826.stdout
5212 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5213 * testsuite/pr12826.sh: New file.
5214 * testsuite/pr12826_1.s: Ditto.
5215 * testsuite/pr12826_1.s: Ditto.
5216
8dbe1edc
ILT
52172011-05-30 Ian Lance Taylor <iant@google.com>
5218
5219 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5220 sections.
5221
c49875be
ILT
52222011-05-29 Ian Lance Taylor <iant@google.com>
5223
5224 PR gold/12804
5225 * testsuite/Makefile.am: Use different file name for two_file_test
5226 temporary file for each incremental test.
5227 * testsuite/Makefile.in: Rebuild.
5228
69d53f7a
ILT
52292011-05-29 Ian Lance Taylor <iant@google.com>
5230
5231 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5232 binary input file is empty.
5233
41d0ab5f
ILT
52342011-05-27 Ian Lance Taylor <iant@google.com>
5235
5236 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5237 (ver_test_9.so): Likewise.
5238 * testsuite/Makefile.in: Rebuild.
5239
89d8a36b
CC
52402011-05-26 Cary Coutant <ccoutant@google.com>
5241
5242 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5243 * incremental.cc (Incremental_inputs::report_input_section): Fix
5244 comment, indentation.
5245 (Incremental_inputs::report_comdat_group): New function.
5246 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5247 of data for incremental input file entry.
5248 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5249 group count, COMDAT group signatures.
5250 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5251 an unchanged input file.
5252 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5253 Initialize new data member.
5254 (Incremental_object_entry::add_comdat_group): New function.
5255 (Incremental_object_entry::get_comdat_group_count): New function.
5256 (Incremental_object_entry::get_comdat_signature_key): New function.
5257 (Incremental_object_entry::groups_): New data member.
5258 (Incremental_inputs::report_comdat_group): New function.
5259 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5260 data for incremental input file entry.
5261 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5262 (Incremental_input_entry_reader::get_input_section): Adjust size of
5263 data for incremental input file entry.
5264 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5265 (Incremental_input_entry_reader::get_comdat_group_signature): New
5266 function.
5267 * object.cc (Sized_relobj::include_section_group): Report kept
5268 COMDAT groups for incremental links.
5269
1706a06f
ILT
52702011-05-24 David Meyer <pdox@google.com>
5271
5272 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5273 with name parameter. Add found_name parameter.
5274 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5275 * dirsearch.h (class Dirsearch): Update declaration.
5276
a10ae760
ILT
52772011-05-24 Ian Lance Taylor <iant@google.com>
5278
5279 * archive.cc (Library_base::should_include_member): Pull in object
5280 from archive if it defines the entry symbol.
5281 * parameters.cc (Parameters::entry): New function.
5282 * parameters.h (class Parameters): Declare entry.
5283 * output.h (class Output_file_header): Remove entry_ field.
5284 * output.cc (Output_file_header::Output_file_header): Remove entry
5285 parameter. Change all callers.
5286 (Output_file_header::entry): Use parameters->entry.
5287 * gold.cc (queue_middle_tasks): Likewise.
5288 * plugin.cc (Plugin_hook::run): Likewise.
5289
aa92d6ed
CC
52902011-05-24 Cary Coutant <ccoutant@google.com>
5291
5292 * gold.cc (queue_initial_tasks): Pass incremental base filename
5293 to Output_file::open_base_file; don't print error message.
5294 * incremental-dump.cc (main): Adjust call to
5295 Output_file::open_for_modification.
5296 * incremental-dump.cc (main): Likewise.
5297 * incremental.cc (Incremental_inputs::report_command_line):
5298 Ignore --incremental-base option when comparing command lines.
5299 Ignore parameter when given as separate argument.
5300 * options.h (class General_options): Add --incremental-base.
5301 * output.cc (Output_file::Output_file):
5302 (Output_file::open_base_file): Add base_name and writable parameters;
5303 read base file into new file; print error message here.
5304 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5305 callers.
5306 * output.h (Output_file::open_for_modification): Rename to...
5307 (Output_file::open_base_file): ...this; add base_name and
5308 writable parameters; adjust all callers.
5309 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5310 callers.
5311 * testsuite/Makefile.am (incremental_test_4): Test
5312 --incremental-base.
5313 * testsuite/Makefile.in: Regenerate.
5314
2eedd706
CC
53152011-05-24 Cary Coutant <ccoutant@google.com>
5316
5317 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5318 incremental_test_4.
5319 * testsuite/Makefile.in: Regenerate.
5320 * testsuite/two_file_test_1_v1.cc: New test source file.
5321 * testsuite/two_file_test_1b_v1.cc: New test source file.
5322 * testsuite/two_file_test_2_v1.cc: New test source file.
5323
0f1c85a6
CC
53242011-05-24 Cary Coutant <ccoutant@google.com>
5325
5326 * dynobj.h (Dynobj::do_dynobj): New function.
5327 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5328 flag and soname for shared objects.
5329 * incremental.cc (Incremental_inputs::report_object): Make
5330 either Incremental_object_entry or Incremental_dynobj_entry; add
5331 soname to string table.
5332 (Incremental_inputs::report_input_section): Add assertion.
5333 (Output_section_incremental_inputs::set_final_data_size): Adjust
5334 type of input file entry for shared libraries; adjust size of
5335 shared library info entry.
5336 (Output_section_incremental_inputs::write_input_files): Write
5337 as_needed flag for shared libraries.
5338 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5339 of input file entry for shared libraries; write soname.
5340 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5341 soname from incremental info.
5342 * incremental.h (enum Incremental_input_flags): Add
5343 INCREMENTAL_INPUT_AS_NEEDED.
5344 (Incremental_input_entry::Incremental_input_entry): Initialize new
5345 data member.
5346 (Incremental_input_entry::set_as_needed): New function.
5347 (Incremental_input_entry::as_needed): New function.
5348 (Incremental_input_entry::do_dynobj_entry): New function.
5349 (Incremental_input_entry::as_needed_): New data member.
5350 (Incremental_object_entry::Incremental_object_entry): Don't check
5351 for shared library.
5352 (Incremental_object_entry::do_type): Likewise.
5353 (class Incremental_dynobj_entry): New class.
5354 (Incremental_input_entry_reader::as_needed): New function.
5355 (Incremental_input_entry_reader::get_soname): New function.
5356 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5357 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5358 size of shared library info entry.
58797674 5359 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5360 incremental link when adding DT_NEEDED entries.
5361 * object.h (Object::Object): Initialize new data member.
5362 (Object::dynobj): New function.
5363 (Object::set_as_needed): New function.
5364 (Object::as_needed): New function.
5365 (Object::do_dynobj): New function.
5366 (Object::as_needed_): New data member.
5367
6fa2a40b
CC
53682011-05-24 Cary Coutant <ccoutant@google.com>
5369
5370 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5371 info; adjust display of GOT entries.
5372 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5373 vector of input objects; remove file_status_.
5374 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5375 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5376 got_plt reader; call target hooks to reserve GOT entries.
5377 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5378 of input file info header and GOT info entry.
5379 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5380 relocation info.
5381 (Got_plt_view_info::got_descriptor): Remove.
5382 (Got_plt_view_info::sym_index): New data member.
5383 (Got_plt_view_info::input_index): New data member.
5384 (Local_got_offset_visitor::visit): Write input file index.
5385 (Global_got_offset_visitor::visit): Write 0 for input file index.
5386 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5387 with sym_index and input_index.
5388 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5389 incremental info GOT entry; replace got_descriptor with input_index.
5390 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5391 map from input file index to object.
5392 (Sized_relobj_incr::do_layout): Replace direct data member reference
5393 with accessor function.
5394 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5395 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5396 Adjust size of input file info header.
5397 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5398 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5399 (Incremental_input_entry_reader::get_input_section): Adjust size of
5400 input file info header.
5401 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5402 of incremental info GOT entry.
5403 (Incremental_got_plt_reader::get_got_desc): Remove.
5404 (Incremental_got_plt_reader::get_got_symndx): New function.
5405 (Incremental_got_plt_reader::get_got_input_index): New function.
5406 (Sized_incremental_binary::Sized_incremental_binary): Remove
5407 file_status_; add input_objects_.
5408 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5409 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5410 (Sized_incremental_binary::file_is_unchanged): Remove.
5411 (Sized_incremental_binary::set_input_object): New function.
5412 (Sized_incremental_binary::input_object): New function.
5413 (Sized_incremental_binary::file_status_): Remove.
5414 (Sized_incremental_binary::input_objects_): New data member.
5415 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5416 references.
5417 (Sized_relobj_incr::invalid_address): Move to base class.
5418 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5419 class.
5420 (Sized_relobj_incr::do_output_section_offset): Likewise.
5421 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5422 (Sized_relobj_incr::section_offsets_): Likewise.
5423 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5424 function.
5425 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5426 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5427 with accessor function.
5428 (Sized_relobj_file::do_layout): Likewise.
5429 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5430 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5431 (Sized_relobj_file::compute_final_local_value): Replace refs to
5432 section_offsets_ with accessor function.
5433 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5434 * object.h (Relobj::Relobj): Initialize new data members.
5435 (Relobj::add_dyn_reloc): New function.
5436 (Relobj::first_dyn_reloc): New function.
5437 (Relobj::dyn_reloc_count): New function.
5438 (Relobj::first_dyn_reloc_): New data member.
5439 (Relobj::dyn_reloc_count_): New data member.
5440 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5441 references.
5442 (Sized_relobj::Address): New typedef.
5443 (Sized_relobj::invalid_address): Move here from child class.
5444 (Sized_relobj::Sized_relobj): Initialize new data members.
5445 (Sized_relobj::sized_relobj): New function.
5446 (Sized_relobj::is_output_section_offset_invalid): Move here from
5447 child class.
5448 (Sized_relobj::get_output_section_offset): Likewise.
5449 (Sized_relobj::local_has_got_offset): Likewise.
5450 (Sized_relobj::local_got_offset): Likewise.
5451 (Sized_relobj::set_local_got_offset): Likewise.
5452 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5453 (Sized_relobj::clear_got_offsets): New function.
5454 (Sized_relobj::section_offsets): Move here from child class.
5455 (Sized_relobj::do_output_section_offset): Likewise.
5456 (Sized_relobj::do_set_section_offset): Likewise.
5457 (Sized_relobj::Local_got_offsets): Likewise.
5458 (Sized_relobj::local_got_offsets_): Likewise.
5459 (Sized_relobj::section_offsets_): Likewise.
5460 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5461 references.
5462 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5463 class.
5464 (Sized_relobj_file::sized_relobj): New function
5465 (Sized_relobj_file::local_has_got_offset): Move to base class.
5466 (Sized_relobj_file::local_got_offset): Likewise.
5467 (Sized_relobj_file::set_local_got_offset): Likewise.
5468 (Sized_relobj_file::get_output_section_offset): Likewise.
5469 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5470 (Sized_relobj_file::do_output_section_offset): Likewise.
5471 (Sized_relobj_file::do_set_section_offset): Likewise.
5472 (Sized_relobj_file::Local_got_offsets): Likewise.
5473 (Sized_relobj_file::local_got_offsets_): Likewise.
5474 (Sized_relobj_file::section_offsets_): Likewise.
5475 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5476 (all constructors).
5477 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5478 (Output_reloc::get_symbol_index): Likewise.
5479 (Output_reloc::local_section_offset): Likewise.
5480 (Output_reloc::get_address): Likewise.
5481 (Output_reloc::symbol_value): Likewise.
5482 (Output_data_got::reserve_slot): Move to class definition.
5483 (Output_data_got::reserve_local): New function.
5484 (Output_data_got::reserve_slot_for_global): Remove.
5485 (Output_data_got::reserve_global): New function.
5486 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5487 (all constructors, two instantiations).
5488 (Output_reloc::get_relobj): New function (two instantiations).
5489 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5490 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5491 (Output_data_reloc::add_global): Adjust type of relobj.
5492 (Output_data_reloc::add_global_relative): Likewise.
5493 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5494 (Output_data_reloc::add_local): Likewise.
5495 (Output_data_reloc::add_local_relative): Likewise.
5496 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5497 (Output_data_reloc::add_local_section): Likewise.
5498 (Output_data_reloc::add_output_section): Likewise.
5499 (Output_data_reloc::add_absolute): Likewise.
5500 (Output_data_reloc::add_target_specific): Likewise.
5501 (Output_data_got::reserve_slot): Move definition here.
5502 (Output_data_got::reserve_local): New function.
5503 (Output_data_got::reserve_global): New function.
5504 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5505 section_offsets_ with accessor function.
5506 (Sized_relobj_file::write_sections): Likewise.
5507 (Sized_relobj_file::do_relocate_sections): Likewise.
5508 * target.h (Sized_target::reserve_local_got_entry): New function.
5509 (Sized_target::reserve_global_got_entry): New function.
5510 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5511 (Target_x86_64::reserve_global_got_entry): New function.
5512 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5513
4829d394
CC
55142011-05-23 Cary Coutant <ccoutant@google.com>
5515
5516 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5517 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5518 bit when checking got_type.
5519 * incremental.cc (Sized_incremental_binary::setup_readers):
5520 Store symbol table and string table locations; initialize bit vector
5521 of file status flags.
5522 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5523 unchanged files.
5524 (Sized_incremental_binary::do_process_got_plt): New function.
5525 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5526 (Output_section_incremental_inputs::set_final_data_size): Record
5527 file index for each input file.
5528 (Output_section_incremental_inputs::write_got_plt): Store file index
5529 instead of input entry offset for each GOT entry.
5530 * incremental.h
5531 (Incremental_input_entry::Incremental_input_entry): Initialize new
5532 data member.
5533 (Incremental_input_entry::set_offset): Store file index.
5534 (Incremental_input_entry::get_file_index): New function.
5535 (Incremental_input_entry::file_index_): New data member.
5536 (Incremental_binary::process_got_plt): New function.
5537 (Incremental_binary::do_process_got_plt): New function.
5538 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5539 data members.
5540 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5541 (Sized_incremental_binary::set_file_is_unchanged): New function.
5542 (Sized_incremental_binary::file_is_unchanged): New function.
5543 (Sized_incremental_binary::do_process_got_plt): New function.
5544 (Sized_incremental_binary::file_status_): New data member.
5545 (Sized_incremental_binary::main_symtab_loc_): New data member.
5546 (Sized_incremental_binary::main_strtab_loc_): New data member.
5547 * output.cc (Output_data_got::Got_entry::write): Add case
5548 RESERVED_CODE.
5549 (Output_data_got::add_global): Call add_got_entry.
5550 (Output_data_got::add_global_plt): Likewise.
5551 (Output_data_got::add_global_with_rel): Likewise.
5552 (Output_data_got::add_global_with_rela): Likewise.
5553 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5554 (Output_data_got::add_global_pair_with_rela): Likewise.
5555 (Output_data_got::add_local): Call add_got_entry.
5556 (Output_data_got::add_local_plt): Likewise.
5557 (Output_data_got::add_local_with_rel): Likewise.
5558 (Output_data_got::add_local_with_rela): Likewise.
5559 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5560 (Output_data_got::add_local_pair_with_rela): Likewise.
5561 (Output_data_got::reserve_slot): New function.
5562 (Output_data_got::reserve_slot_for_global): New function.
5563 (Output_data_got::add_got_entry): New function.
5564 (Output_data_got::add_got_entry_pair): New function.
5565 (Output_section::add_output_section_data): Edit FIXME.
5566 * output.h
5567 (Output_section_data_build::Output_section_data_build): New
5568 constructor with size parameter.
5569 (Output_data_space::Output_data_space): Likewise.
5570 (Output_data_got::Output_data_got): Initialize new data member; new
5571 constructor with size parameter.
5572 (Output_data_got::add_constant): Call add_got_entry.
5573 (Output_data_got::reserve_slot): New function.
5574 (Output_data_got::reserve_slot_for_global): New function.
5575 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5576 (Output_data_got::add_got_entry): New function.
5577 (Output_data_got::add_got_entry_pair): New function.
5578 (Output_data_got::free_list_): New data member.
5579 * target.h (Sized_target::init_got_plt_for_update): New function.
5580 (Sized_target::register_global_plt_entry): New function.
5581 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5582 Initialize new data member; call init; add constructor with PLT count.
5583 (Output_data_plt_x86_64::init): New function.
5584 (Output_data_plt_x86_64::add_relocation): New function.
5585 (Output_data_plt_x86_64::reserve_slot): New function.
5586 (Output_data_plt_x86_64::free_list_): New data member.
5587 (Target_x86_64::init_got_plt_for_update): New function.
5588 (Target_x86_64::register_global_plt_entry): New function.
5589 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5590 incremental updates.
5591 (Output_data_plt_x86_64::add_relocation): New function.
5592 * testsuite/object_unittest.cc (Object_test): Set default options.
5593
ec69d6da
ILT
55942011-05-16 Ian Lance Taylor <iant@google.com>
5595
5596 * options.h (class General_options): Make -i a synonym for -r.
5597
732e31de
ILT
55982011-05-16 Ian Lance Taylor <iant@google.com>
5599
5600 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5601
403676b5
CC
56022011-05-10 Cary Coutant <ccoutant@google.com>
5603
5604 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5605 strip_all (-s).
5606
5b7b7d6e
ILT
56072011-05-06 Ian Lance Taylor <iant@google.com>
5608
5609 * layout.cc (Layout::layout): If the output section flags change,
5610 update the ordering.
5611
f0f9babf
CC
56122011-04-25 Cary Coutant <ccoutant@google.com>
5613
5614 * incremental-dump.cc (dump_incremental_inputs): Print local
5615 symbol info for each input file.
5616 * incremental.cc
5617 (Output_section_incremental_inputs::set_final_data_size): Add local
5618 symbol info to input file entries in incremental info.
5619 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5620 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5621 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5622 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5623 implementation.
5624 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5625 (Sized_incr_relobj::do_relocate): Write the local symbols.
5626 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5627 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5628 Adjust size of input file header.
5629 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5630 (Incremental_inputs_reader::get_local_symbol_count): New function.
5631 (Incremental_inputs_reader::get_input_section): Adjust size of input
5632 file header.
5633 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5634 (Sized_incr_relobj::This): New typedef.
5635 (Sized_incr_relobj::sym_size): New const data member.
5636 (Sized_incr_relobj::Local_symbol): New struct.
5637 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5638 (Sized_incr_relobj::do_local_symbol_offset): New function.
5639 (Sized_incr_relobj::local_symbol_count_): New data member.
5640 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5641 (Sized_incr_relobj::local_symbol_index_): New data member.
5642 (Sized_incr_relobj::local_symbol_offset_): New data member.
5643 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5644 (Sized_incr_relobj::local_symbols_): New data member.
5645 * object.h (Relobj::output_local_symbol_count): New function.
5646 (Relobj::local_symbol_offset): New function.
5647 (Relobj::do_output_local_symbol_count): New function.
5648 (Relobj::do_local_symbol_offset): New function.
5649 (Sized_relobj::do_output_local_symbol_count): New function.
5650 (Sized_relobj::do_local_symbol_offset): New function.
5651
d0a9ace3
ILT
56522011-04-22 Vladimir Simonov <sv@sw.ru>
5653
5654 * descriptors.cc (set_close_on_exec): New function.
5655 (Descriptors::open): Use set_close_on_exec.
5656 * output.cc (S_ISLNK): Define if not defined.
5657
94a3fc8b
CC
56582011-04-22 Cary Coutant <ccoutant@google.com>
5659
5660 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5661 global symbol map.
5662 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5663 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5664 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5665 relocations.
5666 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5667 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5668 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5669 * incremental.h
5670 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5671 function.
5672 (Incremental_binary::apply_incremental_relocs): New function.
5673 (Incremental_binary::do_apply_incremental_relocs): New function.
5674 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5675 data member.
5676 (Sized_incremental_binary::add_global_symbol): New function.
5677 (Sized_incremental_binary::global_symbol): New function.
5678 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5679 (Sized_incremental_binary::symbol_map_): New data member.
5680 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5681 * target.h (Sized_target::apply_relocation): New function.
5682 * target-reloc.h (apply_relocation): New function.
5683 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5684
c87e4302
DK
56852011-04-22 Doug Kwan <dougkwan@google.com>
5686
5687 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5688 flag of a SHT_ARM_EXIDX section.
2e702c99 5689 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
5690 * testsuite/Makefile.in: Regenerate.
5691 * testsuite/arm_exidx_test.s: New file.
5692 * testsuite/arm_exidx_test.sh: Same.
5693
e7782cf6
CC
56942011-04-20 Cary Coutant <ccoutant@google.com>
5695
5696 PR gold/12689
5697 * archive.h (Incremental_archive_entry::Archive_member):
5698 Initialize arg_serial_ (second constructor).
5699
308ecdc7
ILT
57002011-04-17 Ian Lance Taylor <iant@google.com>
5701
5702 * object.cc (Relocate_info::location): Simplify location string.
5703 * errors.cc (Errors::error_at_location): Don't print program
5704 name.
5705 (Errors::warning_at_location): Likewise.
5706 (Errors::undefined_symbol): Likewise.
5707 * testsuite/debug_msg.sh: Update accordingly.
5708
bec5b579
CC
57092011-04-14 Cary Coutant <ccoutant@google.com>
5710
5711 * gold/layout.cc (Layout::symtab_section_offset): New function.
5712 * gold/layout.h (Layout::symtab_section_offset): New function.
5713 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5714
88597d34
ILT
57152011-04-12 Ian Lance Taylor <iant@google.com>
5716
5717 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5718 with MREMAP_MAYMOVE.
5719 * output.h (class Output_file): Add map_is_allocated_ field.
5720 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5721 not available, provide stubs. If mremap is not available, #define
5722 it to gold_mremap.
5723 (MREMAP_MAYMOVE): Define if not defined.
5724 (Output_file::Output_file): Initialize map_is_allocated_.
5725 (Output_file::resize): Check map_is_allocated_.
5726 (Output_file::map_anonymous): If mmap fails, use malloc.
5727 (Output_file::unmap): Don't do anything for an anonymous map.
5728 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5729 is not available, provide stubs.
5730 (File_read::View::~View): Use free rather than delete[].
5731 (File_read::make_view): Use malloc rather than new[]. If mmap
5732 fails, use malloc.
5733 (File_read::find_or_make_view): Use malloc rather than new[].
5734 * gold.h: Remove HAVE_REMAP code.
5735 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5736 exists. Rename mremap to gold_mremap. If mmap is not available
5737 don't do anything.
5738 * configure, config.in: Rebuild.
5739
11e361bc
ILT
57402011-04-11 Ian Lance Taylor <iant@google.com>
5741
5742 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5743 initialize local variable v.
5744
cdc29364
CC
57452011-04-11 Cary Coutant <ccoutant@google.com>
5746
5747 * archive.cc (Archive::include_member): Adjust call to
5748 report_object.
5749 (Add_archive_symbols::run): Track argument serial numbers.
5750 (Lib_group::include_member): Likewise.
5751 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5752 * archive.h (Incremental_archive_entry::Archive_member):
5753 Initialize arg_serial_.
5754 (Archive_member::arg_serial_): New data member.
5755 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5756 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5757 incremental link.
5758 (Sized_dynobj::do_for_all_local_got_entries): New function.
5759 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5760 function.
5761 * fileread.cc (get_mtime): New function.
5762 * fileread.h (get_mtime): New function.
5763 * gold.cc (queue_initial_tasks): Check for incremental update.
5764 (process_incremental_input): New function.
5765 (queue_middle_tasks): Don't force valid target for incremental
5766 update.
5767 * incremental-dump.cc (find_input_containing_global): Adjust
5768 size of symbol info entry.
5769 (dump_incremental_inputs): Dump argument serial number and
5770 in_system_directory flag; bias shndx by 1; print symbol names
5771 when dumping per-file symbol lists; use new symbol info readers.
5772 * incremental.cc
5773 (Output_section_incremental_inputs:update_data_size): New function.
5774 (Sized_incremental_binary::setup_readers): Setup input readers
5775 for each input file; build maps for files added from libraries
5776 and scripts.
5777 (Sized_incremental_binary::check_input_args): New function.
5778 (Sized_incremental_binary::do_check_inputs): Build map of argument
5779 serial numbers to input arguments.
5780 (Sized_incremental_binary::do_file_has_changed): Rename
5781 do_file_is_unchanged to this; compare file modification times.
5782 (Sized_incremental_binary::do_init_layout): New function.
5783 (Sized_incremental_binary::do_reserve_layout): New function.
5784 (Sized_incremental_binary::do_get_input_reader): Remove.
5785 (Sized_incremental_binary::get_symtab_view): New function.
5786 (Incremental_checker::can_incrementally_link_output_file): Remove.
5787 (Incremental_inputs::report_command_line): Exclude --debug options.
5788 (Incremental_inputs::report_archive_begin): Add parameter; track
5789 argument serial numbers; don't put input file entry for archive
5790 before archive members.
5791 (Incremental_inputs::report_archive_end): Put input file entry
5792 for archive after archive members.
5793 (Incremental_inputs::report_object): Add parameter; track argument
5794 serial numbers and in_system_directory flag.
5795 (Incremental_inputs::report_script): Add parameter; track argument
5796 serial numbers.
5797 (Output_section_incremental_inputs::set_final_data_size): Adjust
5798 size of symbol info entry; check for forwarding symbols.
5799 (Output_section_incremental_inputs::write_input_files): Write
5800 in_system_directory flag and argument serial number.
5801 (Output_section_incremental_inputs::write_info_blocks): Map section
5802 indices between incremental info and original input file; store
5803 input section index for each symbol.
5804 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
5805 change operator() to visit().
5806 (class Global_got_offset_visitor): Likewise.
5807 (class Global_symbol_visitor_got_plt):
5808 (Output_section_incremental_inputs::write_got_plt): Use new visitor
5809 classes.
5810 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
5811 (Sized_incr_relobj::do_read_symbols): New function.
5812 (Sized_incr_relobj::do_layout): New function.
5813 (Sized_incr_relobj::do_layout_deferred_sections): New function.
5814 (Sized_incr_relobj::do_add_symbols): New function.
5815 (Sized_incr_relobj::do_should_include_member): New function.
5816 (Sized_incr_relobj::do_for_all_global_symbols): New function.
5817 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
5818 (Sized_incr_relobj::do_section_size): New function.
5819 (Sized_incr_relobj::do_section_name): New function.
5820 (Sized_incr_relobj::do_section_contents): New function.
5821 (Sized_incr_relobj::do_section_flags): New function.
5822 (Sized_incr_relobj::do_section_entsize): New function.
5823 (Sized_incr_relobj::do_section_address): New function.
5824 (Sized_incr_relobj::do_section_type): New function.
5825 (Sized_incr_relobj::do_section_link): New function.
5826 (Sized_incr_relobj::do_section_info): New function.
5827 (Sized_incr_relobj::do_section_addralign): New function.
5828 (Sized_incr_relobj::do_initialize_xindex): New function.
5829 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
5830 (Sized_incr_relobj::do_read_relocs): New function.
5831 (Sized_incr_relobj::do_gc_process_relocs): New function.
5832 (Sized_incr_relobj::do_scan_relocs): New function.
5833 (Sized_incr_relobj::do_count_local_symbols): New function.
5834 (Sized_incr_relobj::do_finalize_local_symbols): New function.
5835 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
5836 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
5837 (Sized_incr_relobj::do_relocate): New function.
5838 (Sized_incr_relobj::do_set_section_offset): New function.
5839 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
5840 (Sized_incr_dynobj::do_read_symbols): New function.
5841 (Sized_incr_dynobj::do_layout): New function.
5842 (Sized_incr_dynobj::do_add_symbols): New function.
5843 (Sized_incr_dynobj::do_should_include_member): New function.
5844 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
5845 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
5846 (Sized_incr_dynobj::do_section_size): New function.
5847 (Sized_incr_dynobj::do_section_name): New function.
5848 (Sized_incr_dynobj::do_section_contents): New function.
5849 (Sized_incr_dynobj::do_section_flags): New function.
5850 (Sized_incr_dynobj::do_section_entsize): New function.
5851 (Sized_incr_dynobj::do_section_address): New function.
5852 (Sized_incr_dynobj::do_section_type): New function.
5853 (Sized_incr_dynobj::do_section_link): New function.
5854 (Sized_incr_dynobj::do_section_info): New function.
5855 (Sized_incr_dynobj::do_section_addralign): New function.
5856 (Sized_incr_dynobj::do_initialize_xindex): New function.
5857 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
5858 (make_sized_incremental_object): New function.
5859 (Incremental_library::copy_unused_symbols): New function.
5860 (Incremental_library::do_for_all_unused_symbols): New function.
5861 * incremental.h (enum Incremental_input_flags): New type.
5862 (class Incremental_checker): Remove.
5863 (Incremental_input_entry::Incremental_input_entry): Add argument
5864 serial number.
5865 (Incremental_input_entry::arg_serial): New function.
5866 (Incremental_input_entry::set_is_in_system_directory): New function.
5867 (Incremental_input_entry::is_in_system_directory): New function.
5868 (Incremental_input_entry::arg_serial_): New data member.
5869 (Incremental_input_entry::is_in_system_directory_): New data member.
5870 (class Script_info): Move here from script.h.
5871 (Script_info::Script_info): Add filename parameter.
5872 (Script_info::filename): New function.
5873 (Script_info::filename_): New data member.
5874 (Incremental_script_entry::Incremental_script_entry): Add argument
5875 serial number.
5876 (Incremental_object_entry::Incremental_object_entry): Likewise.
5877 (Incremental_object_entry::add_input_section): Build list of input
5878 sections with map to original shndx.
5879 (Incremental_object_entry::get_input_section_index): New function.
5880 (Incremental_object_entry::shndx_): New data member.
5881 (Incremental_object_entry::name_key_): Rename; adjust all refs.
5882 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
5883 (Incremental_archive_entry::Incremental_archive_entry): Add argument
5884 serial number.
5885 (Incremental_inputs::report_archive_begin): Likewise.
5886 (Incremental_inputs::report_object): Likewise.
5887 (Incremental_inputs::report_script): Likewise.
5888 (class Incremental_global_symbol_reader): New class.
5889 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
5890 and store flags and input file type.
5891 (Incremental_input_entry_reader::arg_serial): New function.
5892 (Incremental_input_entry_reader::type): Extract type from flags.
5893 (Incremental_input_entry_reader::is_in_system_directory): New function.
5894 (Incremental_input_entry_reader::get_input_section_count): Call
5895 accessor function for type.
5896 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
5897 function for type; adjust size of global symbol entry.
5898 (Incremental_input_entry_reader::get_global_symbol_count): Call
5899 accessor function for type.
5900 (Incremental_input_entry_reader::get_object_count): Likewise.
5901 (Incremental_input_entry_reader::get_object_offset): Likewise.
5902 (Incremental_input_entry_reader::get_member_count): Likewise.
5903 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
5904 (Incremental_input_entry_reader::get_member_offset): Likewise.
5905 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
5906 (Incremental_input_entry_reader::Global_symbol_info): Remove.
5907 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
5908 (Incremental_input_entry_reader::get_global_symbol_reader): New
5909 function.
5910 (Incremental_input_entry_reader::get_output_symbol_index): New
5911 function.
5912 (Incremental_input_entry_reader::type_): Remove.
5913 (Incremental_input_entry_reader::flags_): New data member.
5914 (Incremental_inputs_reader::input_file_offset): New function.
5915 (Incremental_inputs_reader::input_file_index): New function.
5916 (Incremental_inputs_reader::input_file): Call input_file_offset.
5917 (Incremental_inputs_reader::input_file_at_offset): New function.
5918 (Incremental_relocs_reader::get_r_type): Reformat.
5919 (Incremental_relocs_reader::get_r_shndx): Reformat.
5920 (Incremental_relocs_reader::get_r_offset): Reformat.
5921 (Incremental_relocs_reader::data): New function.
5922 (Incremental_binary::Incremental_binary): Initialize new data members.
5923 (Incremental_binary::check_inputs): Add cmdline parameter.
5924 (Incremental_binary::file_is_unchanged): Remove.
5925 (Input_reader::arg_serial): New function.
5926 (Input_reader::get_unused_symbol_count): New function.
5927 (Input_reader::get_unused_symbol): New function.
5928 (Input_reader::do_arg_serial): New function.
5929 (Input_reader::do_get_unused_symbol_count): New function.
5930 (Input_reader::do_get_unused_symbol): New function.
5931 (Incremental_binary::input_file_count): New function.
5932 (Incremental_binary::get_input_reader): Change signature to use
5933 index instead of filename.
5934 (Incremental_binary::file_has_changed): New function.
5935 (Incremental_binary::get_input_argument): New function.
5936 (Incremental_binary::get_library): New function.
5937 (Incremental_binary::get_script_info): New function.
5938 (Incremental_binary::init_layout): New function.
5939 (Incremental_binary::reserve_layout): New function.
5940 (Incremental_binary::output_file): New function.
5941 (Incremental_binary::do_check_inputs): New function.
5942 (Incremental_binary::do_file_is_unchanged): Remove.
5943 (Incremental_binary::do_file_has_changed): New function.
5944 (Incremental_binary::do_init_layout): New function.
5945 (Incremental_binary::do_reserve_layout): New function.
5946 (Incremental_binary::do_input_file_count): New function.
5947 (Incremental_binary::do_get_input_reader): Change signature.
5948 (Incremental_binary::input_args_map_): New data member.
5949 (Incremental_binary::library_map_): New data member.
5950 (Incremental_binary::script_map_): New data member.
5951 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5952 new data members.
5953 (Sized_incremental_binary::output_section): New function.
5954 (Sized_incremental_binary::inputs_reader): Add const.
5955 (Sized_incremental_binary::symtab_reader): Add const.
5956 (Sized_incremental_binary::relocs_reader): Add const.
5957 (Sized_incremental_binary::got_plt_reader): Add const.
5958 (Sized_incremental_binary::get_symtab_view): New function.
5959 (Sized_incremental_binary::Inputs_reader): New typedef.
5960 (Sized_incremental_binary::Input_entry_reader): New typedef.
5961 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
5962 (Sized_incremental_binary::do_file_is_unchanged): Remove.
5963 (Sized_incremental_binary::do_file_has_changed): New function.
5964 (Sized_incremental_binary::do_init_layout): New function.
5965 (Sized_incremental_binary::do_reserve_layout): New function.
5966 (Sized_input_reader::Inputs_reader): Remove.
5967 (Sized_input_reader::Input_entry_reader): Remove.
5968 (Sized_input_reader::do_arg_serial): New function.
5969 (Sized_input_reader::do_get_unused_symbol_count): New function.
5970 (Sized_input_reader::do_get_unused_symbol): New function.
5971 (Sized_incremental_binary::do_input_file_count): New function.
5972 (Sized_incremental_binary::do_get_input_reader): Change signature;
5973 use index instead of filename.
5974 (Sized_incremental_binary::section_map_): New data member.
5975 (Sized_incremental_binary::input_entry_readers_): New data member.
5976 (class Sized_incr_relobj): New class.
5977 (class Sized_incr_dynobj): New class.
5978 (make_sized_incremental_object): New function.
5979 (class Incremental_library): New class.
5980 * layout.cc (Free_list::num_lists): New static data member.
5981 (Free_list::num_nodes): New static data member.
5982 (Free_list::num_removes): New static data member.
5983 (Free_list::num_remove_visits): New static data member.
5984 (Free_list::num_allocates): New static data member.
5985 (Free_list::num_allocate_visits): New static data member.
5986 (Free_list::init): New function.
5987 (Free_list::remove): New function.
5988 (Free_list::allocate): New function.
5989 (Free_list::dump): New function.
5990 (Free_list::print_stats): New function.
5991 (Layout_task_runner::run): Resize output file for incremental updates.
5992 (Layout::Layout): Initialize new data members.
5993 (Layout::set_incremental_base): New function.
5994 (Layout::init_fixed_output_section): New function.
5995 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
5996 incremental updates.
5997 (Layout::create_gold_note): Do not create gold note section for
5998 incremental updates.
5999 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6000 for incremental updates.
6001 (Layout::set_section_offsets): For incremental updates, allocate space
6002 from free list.
6003 (Layout::create_symtab_sections): Layout with offsets relative to
6004 start of section; for incremental updates, allocate space from free
6005 list.
6006 (Layout::create_shdrs): For incremental updates, allocate space from
6007 free list.
6008 (Layout::finish_dynamic_section): For incremental updates, do not
6009 check --as-needed (fixed in subsequent patch).
6010 * layout.h (class Free_list): New class.
6011 (Layout::set_incremental_base): New function.
6012 (Layout::incremental_base): New function.
6013 (Layout::init_fixed_output_section): New function.
6014 (Layout::allocate): New function.
6015 (Layout::incremental_base_): New data member.
6016 (Layout::free_list_): New data member.
6017 * main.cc (main): Print Free_list statistics.
6018 * object.cc (Relobj::finalize_incremental_relocs): Add
6019 clear_counts parameter; clear counts only when clear_counts is set.
6020 (Sized_relobj::Sized_relobj): Initialize new base class.
6021 (Sized_relobj::do_layout): Don't report special sections.
6022 (Sized_relobj::do_for_all_local_got_entries): New function.
6023 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6024 symtab_off to all symbol table offsets.
6025 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6026 * object.h (class Got_offset_list): Move to top of file.
6027 (Object::Object): Allow case where input_file == NULL.
6028 (Object::~Object): Likewise.
6029 (Object::input_file): Assert that input_file != NULL.
6030 (Object::lock): Allow case where input_file == NULL.
6031 (Object::unlock): Likewise.
6032 (Object::is_locked): Likewise.
6033 (Object::token): Likewise.
6034 (Object::release): Likewise.
6035 (Object::is_incremental): New function.
6036 (Object::get_mtime): New function.
6037 (Object::for_all_local_got_entries): New function.
6038 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6039 (Object::set_is_in_system_directory): New function.
6040 (Object::is_in_system_directory): New function.
6041 (Object::do_is_incremental): New function.
6042 (Object::do_get_mtime): New function.
6043 (Object::do_for_all_local_got_entries): New function.
6044 (Object::is_in_system_directory_): New data member.
6045 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6046 (class Sized_relobj_base): New class.
6047 (class Sized_relobj): Derive from Sized_relobj_base.
6048 (class Sized_relobj::Symbols): Redeclare from base class.
6049 (class Sized_relobj::local_got_offset_list): Remove.
6050 (class Sized_relobj::Output_sections): Redeclare from base class.
6051 (class Sized_relobj::do_for_all_local_got_entries): New function.
6052 (class Sized_relobj::write_local_symbols): Add offset parameter.
6053 (class Sized_relobj::local_symbol_offset_): Update comment.
6054 (class Sized_relobj::local_dynsym_offset_): Update comment.
6055 * options.cc (Input_arguments::add_file): Remove const.
6056 * options.h (Input_file_argument::Input_file_argument):
6057 Initialize arg_serial_ (all constructors).
6058 (Input_file_argument::set_arg_serial): New function.
6059 (Input_file_argument::arg_serial): New function.
6060 (Input_file_argument::arg_serial_): New data member.
6061 (Input_arguments::Input_arguments): Initialize file_count_.
6062 (Input_arguments::add_file): Remove const.
6063 (Input_arguments::number_of_input_files): New function.
6064 (Input_arguments::file_count_): New data member.
6065 (Command_line::number_of_input_files): Call
6066 Input_arguments::number_of_input_files.
6067 * output.cc (Output_segment_headers::Output_segment_headers):
6068 Set current size.
6069 (Output_section::Input_section::current_data_size): New function.
6070 (Output_section::Output_section): Initialize new data members.
6071 (Output_section::add_input_section): Don't do merge sections for
6072 an incremental link; allocate space from free list for an
6073 incremental update.
6074 (Output_section::add_output_section_data): Allocate space from
6075 free list for an incremental update.
6076 (Output_section::update_data_size): New function.
6077 (Output_section::set_fixed_layout): New function.
6078 (Output_section::reserve): New function.
6079 (Output_segment::set_section_addresses): Remove const.
6080 (Output_segment::set_section_list_addresses): Remove const; allocate
6081 space from free list for an incremental update.
6082 (Output_segment::set_offset): Adjust size of RELRO segment for an
6083 incremental update.
6084 * output.h (Output_data::current_data_size): Move here from
6085 child classes.
6086 (Output_data::pre_finalize_data_size): New function.
6087 (Output_data::update_data_size): New function.
6088 (Output_section_headers::update_data_size): new function.
6089 (Output_section_data_build::current_data_size): Move to Output_data.
6090 (Output_data_strtab::update_data_size): New function.
6091 (Output_section::current_data_size): Move to Output_data.
6092 (Output_section::set_fixed_layout): New function.
6093 (Output_section::has_fixed_layout): New function.
6094 (Output_section::reserve): New function.
6095 (Output_section::update_data_size): New function.
6096 (Output_section::has_fixed_layout_): New data member.
6097 (Output_section::free_list_): New data member.
6098 (Output_segment::set_section_addresses): Remove const.
6099 (Output_segment::set_section_list_addresses): Remove const.
6100 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6101 New function.
6102 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6103 New function.
6104 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6105 parameter when calling Add_symbols constructor; store argument
6106 serial number for members of a lib group.
6107 (Add_symbols::locks): Allow case where token == NULL.
6108 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6109 (Read_member::~Read_member): New function.
6110 (Read_member::is_runnable): New function.
6111 (Read_member::locks): New function.
6112 (Read_member::run): New function.
6113 (Check_script::~Check_script): New function.
6114 (Check_script::is_runnable): New function.
6115 (Check_script::locks): New function.
6116 (Check_script::run): New function.
6117 (Check_library::~Check_library): New function.
6118 (Check_library::is_runnable): New function.
6119 (Check_library::locks): New function.
6120 (Check_library::run): New function.
6121 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6122 (Add_symbols::library_): New data member.
6123 (class Read_member): New class.
6124 (class Check_script): New class.
6125 (class Check_library): New class.
6126 * reloc.cc (Read_relocs::is_runnable): Allow case where
6127 token == NULL.
6128 (Read_relocs::locks): Likewise.
6129 (Scan_relocs::locks): Likewise.
6130 (Relocate_task::locks): Likewise.
6131 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6132 to clear counters.
6133 (Sized_relobj::incremental_relocs_scan): Fix comment.
6134 (Sized_relobj::do_relocate): Pass output file offset to
6135 write_local_symbols.
6136 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6137 from class declaration.
6138 * script.cc (read_input_script): Allocate Script_info; pass
6139 argument serial number to report_script.
6140 * script.h (class Script_info): Move to incremental.h.
6141 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6142 * symtab.h (Symbol_table::add_from_incrobj): New function.
6143 (Symbol_table::set_file_offset): New function.
6144
b961d0d7
CC
61452011-04-05 Cary Coutant <ccoutant@google.com>
6146
6147 * incremental-dump.cc (dump_incremental_inputs): Change signature
6148 to take a Sized_incremental_binary; change caller. Use readers
6149 in Sized_incremental_binary.
6150 * incremental.cc
6151 (Sized_incremental_binary::find_incremental_inputs_sections):
6152 Rename do_find_incremental_inputs_sections to this.
6153 (Sized_incremental_binary::setup_readers): New function.
6154 (Sized_incremental_binary::do_check_inputs): Check
6155 has_incremental_info_ flag; move setup code to setup_readers;
6156 use input readers.
6157 (Sized_incremental_binary::do_file_is_unchanged): New function.
6158 (Sized_incremental_binary::do_get_input_reader): New function.
6159 * incremental.h (class Incremental_binary): Move to end of file.
6160 (Incremental_binary::file_is_unchanged): New function.
6161 (Incremental_binary::do_file_is_unchanged): New function.
6162 (Incremental_binary::Input_reader): New class.
6163 (Incremental_binary::get_input_reader): New function.
6164 (class Sized_incremental_binary): Move to end of file.
6165 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6166 input section reader classes.
6167 (Sized_incremental_binary::has_incremental_info): New function.
6168 (Sized_incremental_binary::inputs_reader): New function.
6169 (Sized_incremental_binary::symtab_reader): New function.
6170 (Sized_incremental_binary::relocs_reader): New function.
6171 (Sized_incremental_binary::got_plt_reader): New function.
6172 (Sized_incremental_binary::do_file_is_unchanged): New function.
6173 (Sized_incremental_binary::Sized_input_reader): New class.
6174 (Sized_incremental_binary::get_input_reader): New function.
6175 (Sized_incremental_binary::find_incremental_inputs_sections):
6176 Rename do_find_incremental_inputs_sections to this.
6177 (Sized_incremental_binary::setup_readers): New function.
6178 (Sized_incremental_binary::has_incremental_info_): New data member.
6179 (Sized_incremental_binary::inputs_reader_): New data member.
6180 (Sized_incremental_binary::symtab_reader_): New data member.
6181 (Sized_incremental_binary::relocs_reader_): New data member.
6182 (Sized_incremental_binary::got_plt_reader_): New data member.
6183 (Sized_incremental_binary::current_input_file_): New data member.
6184
a869183f
PP
61852011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6186
6187 PR gold/12640
6188 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6189 violation.
6190
61912011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6192
6193 * archive.cc (Archive::include_member): Adjust call to report_object.
6194 (Add_archive_symbols::run): Add script_info to call to
6195 report_archive_begin.
6196 (Lib_group::include_member): Adjust call to report_object.
6197 (Add_lib_group_symbols::run): Adjust call to report_object.
6198 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6199 blocks. Add object count for script input files.
6200 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6201 script_info parameter; change all callers.
6202 (Incremental_inputs::report_object): Add script_info parameter;
6203 change all callers.
6204 (Incremental_inputs::report_script): Store backpointer to
6205 incremental info entry.
6206 (Output_section_incremental_inputs::set_final_data_size): Record
6207 additional information for scripts.
6208 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6209 * incremental.h (Incremental_script_entry::add_object): New function.
6210 (Incremental_script_entry::get_object_count): New function.
6211 (Incremental_script_entry::get_object): New function.
6212 (Incremental_script_entry::objects_): New data member; adjust
6213 constructor.
6214 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6215 (Incremental_inputs::report_object): Add script_info parameter.
6216 (Incremental_inputs_reader::get_object_count): New function.
6217 (Incremental_inputs_reader::get_object_offset): New function.
6218 * options.cc (Input_arguments::add_file): Return reference to
6219 new input argument.
6220 * options.h (Input_argument::set_script_info): New function.
6221 (Input_argument::script_info): New function.
6222 (Input_argument::script_info_): New data member; adjust all
6223 constructors.
6224 (Input_file_group::add_file): Return reference to new input argument.
6225 (Input_file_lib::add_file): Likewise.
6226 (Input_arguments::add_file): Likewise.
6227 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6228 * script.cc (Parser_closure::Parser_closure): Add script_info
6229 parameter; adjust all callers.
6230 (Parser_closure::script_info): New function.
6231 (Parser_closure::script_info_): New data member.
6232 (read_input_script): Report scripts earlier to incremental info.
6233 (script_add_file): Set script_info in Input_argument.
6234 (script_add_library): Likewise.
6235 * script.h (Script_options::Script_info): Rewrite class.
6236
a869183f 62372011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6238
6239 * archive.cc (Library_base::should_include_member): Move
6240 method here from class Archive.
6241 (Archive::Archive): Initialize base class.
6242 (Archive::should_include_member): Move to base class.
6243 (Archive::do_for_all_unused_symbols): New function.
6244 (Add_archive_symbols::run): Remove redundant access to
6245 incremental_inputs.
6246 (Lib_group::Lib_group): Initialize base class.
6247 (Lib_group::do_filename): New function.
6248 (Lib_group::include_member): Pass pointer to Lib_group to
6249 report_object.
6250 (Lib_group::do_for_all_unused_symbols): New function.
6251 (Add_lib_group_symbols::run): Report archive information for
6252 incremental links.
6253 * archive.h (class Library_base): New base class.
6254 (class Archive): Derive from Library_base.
6255 (Archive::filename): Move to base class.
6256 (Archive::set_incremental_info): Likewise.
6257 (Archive::incremental_info): Likewise.
6258 (Archive::Should_include): Likewise.
6259 (Archive::should_include_member): Likewise.
6260 (Archive::Armap_entry): Remove.
6261 (Archive::Unused_symbol_iterator): Remove.
6262 (Archive::unused_symbols_begin): Remove.
6263 (Archive::unused_symbols_end): Remove.
6264 (Archive::do_filename): New function.
6265 (Archive::do_get_mtime): New function.
6266 (Archive::do_for_all_unused_symbols): New function.
6267 (Archive::task_): Move to base class.
6268 (Archive::incremental_info_): Likewise.
6269 (class Lib_group): Derive from Library_base.
6270 (Lib_group::do_filename): New function.
6271 (Lib_group::do_get_mtime): New function.
6272 (Lib_group::do_for_all_unused_symbols): New function.
6273 (Lib_group::task_): Move to base class.
6274 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6275 function.
6276 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6277 function.
6278 * incremental.cc (Incremental_inputs::report_archive_begin):
6279 Use Library_base; call library's get_mtime; add incremental inputs
6280 entry before members.
6281 (class Unused_symbol_visitor): New class.
6282 (Incremental_inputs::report_archive_end): Use Library_base; use
6283 visitor class to record unused symbols; don't add incremental inputs
6284 entry after members.
6285 (Incremental_inputs::report_object): Use Library_base.
6286 * incremental.h
6287 (Incremental_archive_entry::Incremental_archive_entry): Remove
6288 unused Archive parameter.
6289 (Incremental_inputs::report_archive_begin): Use Library_base.
6290 (Incremental_inputs::report_archive_end): Likewise.
6291 (Incremental_inputs::report_object): Likewise.
6292 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6293 function.
6294 * object.h (Object::for_all_global_symbols): New function.
6295 (Object::do_for_all_global_symbols): New function.
6296 (Sized_relobj::do_for_all_global_symbols): New function.
6297 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6298 function.
6299 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6300 function.
6301
61ab3e40
ILT
63022011-03-27 Ian Lance Taylor <iant@google.com>
6303
6304 * archive.cc (Archive::interpret_header): Return -1 if something
6305 goes wrong. Change callers accordingly.
6306
30e1f9e6
CC
63072011-03-25 Cary Coutant <ccoutant@google.com>
6308
6309 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6310 * testsuite/Makefile.in: Regenerate.
6311
9370ce59 63122011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6313
6314 * plugin.cc (get_view): New.
6315 (Plugin::load): Pass get_view to the plugin.
6316 (Plugin_manager::get_view): New.
6317
9312bb0a
ILT
63182011-03-21 Ian Lance Taylor <iant@google.com>
6319
6320 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6321 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6322
7e12ba9e
ST
63232011-03-21 Sriraman Tallam <tmsriram@google.com>
6324
6325 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6326 Change == to -eq.
6327 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6328 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6329 Change == to -eq.
6330 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6331 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6332
fd7a005d
ILT
63332011-03-14 Ian Lance Taylor <iant@google.com>
6334
6335 * script-sections.cc (Sort_output_sections::script_compare):
6336 Rename from is_before, change return type.
6337 (Sort_output_sections::operator()): Adjust accordingly.
6338
ed16fd1b
ILT
63392011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6340
6341 PR gold/12572
6342 * testsuite/odr_violation2.cc: Add comment to make all error line
6343 numbers double digits.
6344 * testsuite/debug_msg.sh: Adjust expected errors.
6345
71ff8986
ILT
63462011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6347
6348 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6349 but mark earlier ones as non-canonical
6350 (offset_to_iterator): Update search target and example
6351 (do_addr2line): Return extra lines in a vector*
6352 (format_file_lineno): Extract from do_addr2line
6353 (one_addr2line): Add vector* out-param
6354 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6355 when a lineno entry appeared last for its instruction
6356 (Dwarf_line_info): Add vector* out-param
6357 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6358 * symtab.cc (Odr_violation_compare): Include the lineno in the
6359 comparison again.
6360 (linenos_from_loc): New. Combine the canonical line for an
6361 address with its other lines.
6362 (True_if_intersect): New. Helper functor to make
6363 std::set_intersection a query.
6364 (detect_odr_violations): Compare sets of lines instead of just
6365 one line for each function. This became less deterministic, but
6366 has fewer false positives.
6367 * symtab.h: Declarations.
6368 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6369 mix an optimized and non-optimized object in the same binary
6370 (odr_violation2.so): Same.
6371 * testsuite/Makefile.in: Regenerate from Makefile.am.
6372 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6373 * testsuite/debug_msg.sh: Update line numbers and add
6374 assertions.
6375 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6376 non-optimized context.
6377 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6378 isn't inlined, and use OdrDerived in an optimized context.
6379 * testsuite/odr_header1.h: Defines OdrDerived, where
6380 optimization will change the
6381 first-instruction-in-the-destructor's file and line number.
6382 * testsuite/odr_header2.h: Defines OdrBase.
6383
a19fefdc
ILT
63842011-03-09 Ian Lance Taylor <iant@google.com>
6385
6386 * fileread.cc (File_read::clear_views): Don't delete the whole
6387 file view.
6388
ecb351e9
ILT
63892011-03-08 Ian Lance Taylor <iant@google.com>
6390
6391 PR gold/12525
6392 * fileread.cc: #include <climits>.
6393 (GOLD_IOV_MAX): Define.
6394 (File_read::read_multiple): Limit number of entries by iov_max.
6395 * fileread.h (class File_read): Always set max_readv_entries to
6396 128.
6397
b821d13c
ILT
63982011-03-07 Ian Lance Taylor <iant@google.com>
6399
6400 PR gold/12525
6401 * options.h (class General_options): Add -dy and -dn.
6402
89243142
CC
64032011-03-02 Cary Coutant <ccoutant@google.com>
6404
6405 * testsuite/script_test_9.t: Add TLS segment.
6406
d0773f31
ILT
64072011-03-02 Simon Baldwin <simonb@google.com>
6408
6409 * configure.ac: Add check for gnu_indirect_function support in
6410 the toolchain building binutils.
6411 * configure: Rebuild.
6412
9370ce59 64132011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6414
6415 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6416 plugin only symbols.
6417 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6418 in plugin files as not needed in the symbol table.
6419
4cf7a849
ST
64202011-02-11 Sriraman Tallam <tmsriram@google.com>
6421
6422 * output.cc (Output_section::add_input_section): Delay fill
6423 generation for section ordering.
6424
b578bd7d
ILT
64252011-02-09 Ian Lance Taylor <iant@google.com>
6426
6427 PR gold/12316
6428 * object.h (class Sized_relobj): Remove clear_local_symbols.
6429 * reloc.cc (Sized_relobj::do_relocate): Don't call
6430 clear_local_symbols.
6431
9370ce59 64322011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6433
6434 * plugin.cc (is_visible_from_outside): Return true for symbols
6435 in the -u option.
6436
55382fb7
ILT
64372011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6438
6439 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6440 filename.
6441
4e271fff
ST
64422011-02-02 Sriraman Tallam <tmsriram@google.com>
6443
6444 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6445 to std::string.
4e271fff 6446 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6447 section_name to be std::string.
4e271fff
ST
6448 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6449
d433c3ac
ILT
64502011-01-25 Ian Lance Taylor <iant@google.com>
6451
6452 * script.cc (script_add_extern): Rewrite to use
6453 add_symbol_reference.
6454
880473a6
DK
64552011-01-25 Doug Kwan <dougkwan@google.com>
6456
d433c3ac 6457 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6458
f30f86fa
ILT
64592011-01-24 Ian Lance Taylor <iant@google.com>
6460
6461 * options.h (class General_options): Accept
6462 --no-detect-odr-violations.
6463
8e51a0b9
ILT
64642011-01-24 Ian Lance Taylor <iant@google.com>
6465
6466 * version.cc (version_string): Bump to 1.11.
6467
0f3b89d8
ILT
64682011-01-24 Ian Lance Taylor <iant@google.com>
6469
6470 * plugin.cc (class Plugin_rescan): Define new class.
6471 (Plugin_manager::claim_file): Set any_claimed_.
6472 (Plugin_manager::save_archive): New function.
6473 (Plugin_manager::save_input_group): New function.
6474 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6475 necessary.
6476 (Plugin_manager::new_undefined_symbol): New function.
6477 (Plugin_manager::rescan): New function.
6478 (Plugin_manager::rescannable_defines): New function.
6479 (Plugin_manager::add_input_file): Set any_added_.
6480 * plugin.h (class Plugin_manager): define new fields rescannable_,
6481 undefined_symbols_, any_claimed_, and any_added_. Declare
6482 Plugin_rescan as friend. Declare new functions.
6483 (Plugin_manager::Rescannable): Define type.
6484 (Plugin_manager::Rescannable_list): Define type.
6485 (Plugin_manager::Undefined_symbol_list): Define type.
6486 (Plugin_manager::Plugin_manager): Initialize new fields.
6487 * archive.cc (Archive::defines_symbol): New function.
6488 (Add_archive_symbols::run): Pass archive to plugins if any.
6489 * archive.h (class Archive): Declare defines_symbol.
6490 * readsyms.cc (Input_group::~Input_group): New function.
6491 (Finish_group::run): Pass input_group to plugins if any.
6492 * readsyms.h (class Input_group): Declare destructor.
6493 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6494 any.
6495
3bb951e5
ILT
64962011-01-10 Ian Lance Taylor <iant@google.com>
6497
6498 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6499 section as relro.
6500 (Layout::set_segment_offsets): Reset increase_relro before calling
6501 set_section_addresses a second time.
6502
0aa45fac
CC
65032011-01-04 Cary Coutant <ccoutant@google.com>
6504
6505 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6506 sections before NOBITS sections.
6507
0db46eb4
L
65082011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6509
6510 * version.cc (print_version): Update copyright to 2011.
6511
829c9745
CC
65122010-12-23 Cary Coutant <ccoutant@google.com>
6513
6514 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6515 of OS to this->add. Add OD parameter to second form of the function.
6516
7500420b
ILT
65172010-12-20 Ian Lance Taylor <iant@google.com>
6518
6519 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6520 second of two consecutive entries with same offset.
6521
f8e9a930
RW
65222010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6523
6524 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6525 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6526 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6527 to avoid unneeded links against $(LDADD).
6528 * testsuite/Makefile.in: Regenerate.
6529
2fbb4320
ILT
65302010-12-15 Ian Lance Taylor <iant@google.com>
6531
6532 PR gold/12324
6533 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6534 for R_X86_64_32 and R_X86_64_PC32.
6535 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6536 ver_matching_def_pic.o.
6537 (ver_matching_def_pic.o): New target.
6538
fedb228d
RW
65392010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6540
6541 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6542 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6543 Move definition before File_read::View member definitions.
6544 (File_read::View::~View): Initialize and hold lock before
6545 updating current_mapped_bytes.
6546
9b547ce6
RW
65472010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6548
6549 * dwarf_reader.cc: Remove outdated comment.
6550 * gold-threads.cc: Fix typo in error message.
6551 * archive.cc: Fix typos in comments.
6552 * archive.h: Likewise.
6553 * arm-reloc-property.cc: Likewise.
6554 * arm-reloc-property.h: Likewise.
6555 * arm-reloc.def: Likewise.
6556 * arm.cc: Likewise.
6557 * attributes.h: Likewise.
6558 * cref.cc: Likewise.
6559 * ehframe.cc: Likewise.
6560 * fileread.h: Likewise.
6561 * gold.h: Likewise.
6562 * i386.cc: Likewise.
6563 * icf.cc: Likewise.
6564 * incremental.h: Likewise.
6565 * int_encoding.cc: Likewise.
6566 * layout.h: Likewise.
6567 * main.cc: Likewise.
6568 * merge.h: Likewise.
6569 * object.cc: Likewise.
6570 * object.h: Likewise.
6571 * options.cc: Likewise.
6572 * readsyms.cc: Likewise.
6573 * reduced_debug_output.cc: Likewise.
6574 * reloc.cc: Likewise.
6575 * script-sections.cc: Likewise.
6576 * sparc.cc: Likewise.
6577 * symtab.h: Likewise.
6578 * target-reloc.h: Likewise.
6579 * target.cc: Likewise.
6580 * target.h: Likewise.
6581 * timer.cc: Likewise.
6582 * timer.h: Likewise.
6583 * x86_64.cc: Likewise.
6584
83e17bd5
CC
65852010-12-09 Cary Coutant <ccoutant@google.com>
6586
6587 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6588 stack.
6589 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6590 parameter; change all callers.
6591 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6592 * options.h (warn_execstack): New option.
6593
017257f8
DK
65942010-12-07 Doug Kwan <dougkwan@google.com>
6595
6596 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6597 like function call relocations.
6598
c20cbc06
ILT
65992010-12-07 Ian Lance Taylor <iant@google.com>
6600
6601 * archive.cc (Archive::get_elf_object_for_member): Permit
6602 punconfigured to be NULL.
6603 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6604 (Archive::include_member): Pass NULL to get_elf_object_for_member
6605 if we searched for the archive and this is the first included
6606 object.
6607
4dbfafcc
ILT
66082010-12-01 Ian Lance Taylor <iant@google.com>
6609
6610 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6611 track_relocs_type_ field.
6612 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6613 Set track_relocs_type_.
6614 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6615 contents when using RELA relocs.
6616 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6617 reloc_map_.
6618 * reloc.cc (Track_relocs::next_addend): New function.
6619 * reloc.h (class Track_relocs): Declare next_addend.
6620
e5e19edd
ILT
66212010-12-01 Ian Lance Taylor <iant@google.com>
6622
6623 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6624 virtual destructor.
6625
9a5ce24c
ILT
66262010-12-01 Ian Lance Taylor <iant@google.com>
6627
6628 * README: Update compilers known to work and fail.
6629
c7791212
NC
66302010-11-23 Matthias Klose <doko@ubuntu.com>
6631
6632 * configure.in: For --enable-gold, handle value `default' instead of
6633 `both*'. Always install ld as ld.bfd, install as ld if gold is
6634 not the default.
6635 * configure: Regenerate.
6636
0ad220c9
DK
66372010-11-18 Doug Kwan <dougkwan@google.com>
6638
6639 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6640 and right_alignment to be zero. Store result alignment only if it is
6641 greater than existing alignment.
6642
ab8056e0
CC
66432010-11-16 Cary Coutant <ccoutant@google.com>
6644
6645 PR gold/12220
6646 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6647 Check for ".zdebug_line".
6648
fd064a5b
CC
66492010-11-16 Doug Kwan <dougkwan@google.com>
6650 Cary Coutant <ccoutant@google.com>
6651
6652 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6653 by reference; adjust all callers.
6654 * output.cc (Output_segment::set_section_addresses): Adjust references
6655 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6656 list is empty.
6657 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6658 end at page boundary.
6659
6fc6ea19
CC
66602010-11-16 Cary Coutant <ccoutant@google.com>
6661
6662 PR gold/12220
6663 * layout.cc (Layout::choose_output_section): Transform names of
6664 compressed sections even when using a script with a SECTIONS clause.
6665 (Layout::output_section_name): Remove code to transform
6666 compressed debug section names.
6667 * output.cc (Output_section::add_input_section): Use uncompressed
6668 section size when tracking input sections.
6669
95a2c8d6
RS
66702010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6671
6672 * symtab.h (Symbol::NON_PIC_REF): Remove.
6673 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6674 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6675 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6676 (Symbol::use_plt_offset): Take a flags argument and pass it
6677 directly to needs_dynamic_reloc. Restrict check for undefined
6678 weak symbols to function calls.
6679 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6680 (Target_arm::Scan::global): Use it.
6681 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6682 (Target_arm::Relocate::relocate): Likewise.
6683 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6684 parameter with an r_type parameter. Use get_reference_flags
6685 to get the flags.
6686 (Target_arm::Relocate::relocate): Update accordingly.
6687 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6688 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6689 (Target_i386::Scan::global): Likewise.
6690 (Target_i386::Relocate::relocate): Likewise.
6691 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6692 parameter with an r_type parameter. Use get_reference_flags
6693 to get the flags.
6694 (Target_i386::Relocate::relocate): Update accordingly.
6695 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6696 (Target_powerpc::Scan::global): Use it.
6697 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6698 (Target_powerpc::Relocate::relocate): Likewise.
6699 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6700 (Target_sparc::Scan::global): Use it.
6701 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6702 (Target_sparc::Relocate::relocate): Likewise.
6703 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6704 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6705 (Target_x86_64::Scan::global): Likewise.
6706 (Target_x86_64::Relocate::relocate): Likewise.
6707
f625ae50
DK
67082010-11-08 Doug Kwan <dougkwan@google.com>
6709 Cary Coutant <ccoutant@google.com>
6710
6711 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6712 (Arm_exidx_merge_section::section_contents_): New data member.
6713 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6714 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 6715 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
6716 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6717 in parameters instead of calling Object::section_contents without
6718 locking.
6719 (Arm_output_section::group_section): New parameter TASK. Pass it
6720 to callees that need locking objects.
6721 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6722 to lock EXIDX input sections. Fix a formatting issue. Call
6723 Arm_exidx_merged_section::build_contents to create merged section
6724 contents.
6725 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6726 to lock object of stub table owner.
6727 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6728 TEXT_SIZE to initialize data member TEXT_SIZE_.
6729 (Arm_exidx_input_section::addralign): Fix typo in comment.
6730 (Arm_exidx_input_section::text_size): New method.
6731 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6732 that require locking objects. Lock objects before scanning for stubs
6733 and updating local symbols.
6734 (Arm_input_section<big_endian>::init): Copy contents of original
6735 input section.
2e702c99 6736 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
6737 original input section instead of calling Object::section_contents
6738 without locking.
6739 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6740 size without calling Object::section_size().
6741 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6742 for size. Allocate a buffer for merged EXIDX entries.
6743 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 6744 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
6745 building code to Arm_exidx_merged_section::build_contetns. Write
6746 out contetns in buffer instead of building it on the fly.
6747 (Arm_relobj::make_exidx_input_section): Also pass text section size
6748 to Arm_exidx_input_section constructor.
6749 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6750 (Arm_dynobj::do_read_symbols): Fix memory leak.
6751 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6752 * target.h: (class Task): Add forward declaration.
6753 (Target::relax): Add new parameter TASK and pass it to
6754 Target::do_relax().
6755 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6756
5f9bcf58
CC
67572010-11-05 Cary Coutant <ccoutant@google.com>
6758
6759 PR gold/10708
6760 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6761 object when reading from the file.
6762 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6763 second layout pass.
6764 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6765 when reading section contents.
6766 (get_section_contents): Likewise.
6767 (icf::find_identical_sections): Likewise.
6768 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6769 object when reading from the file.
6770 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
6771 the object when doing deferred section layout.
6772
e597fa08
NC
67732010-11-03 Nick Clifton <nickc@redhat.com>
6774
6775 PR gold/12001
6776 * script.h (class Symbol_assignment: name): New member. Returns
6777 the name of the symbol.
6778 * scrfipt.cc (Script_options::is_pending_assignment): New member.
6779 Returns true if the given symbol name is on the list of
6780 assignments wating to be processed.
6781 * archive.cc (should_incldue_member): If the symbol is undefined,
6782 check to see if it is on the list of symbols pending assignment.
6783
3f9a3278
ILT
67842010-11-03 Ryan Mansfield <rmansfield@qnx.com>
6785
6786 * script-sections.cc (Script_sections::find_memory_region): Check
6787 for a NULL output section pointer.
6788
d06fb4d1
DK
67892010-10-29 Doug Kwan <dougkwan@google.com>
6790
6791 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
6792 Output_section::add_relaxed_input_section.
6793 * output.cc (Output_section::add_relaxed_input_section): Add new
6794 arguments LAYOUT and NAME. Set section order index.
6795 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6796 Copy section order index.
6797 * output.h (Output_section::add_relaxed_input_section): Add new
6798 arguments LAYOUT and NAME.
6799
90e24de5
ILT
68002010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6801
6802 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 6803 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
6804 * testsuite/Makefile.in: Regenerate.
6805
c9484ea5
DK
68062010-10-20 Doug Kwan <dougkwan@google.com>
6807
6808 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
6809 without SHF_LINK_ORDER flags.
6810 * layout.cc (Layout::choose_output_section): Do not filter
6811 SHF_LINK_ORDER flag in a relocatable link.
6812
5bc2f5be
CC
68132010-10-17 Cary Coutant <ccoutant@google.com>
6814
6815 * output.h (Output_segment::set_section_addresses): Change function
6816 signature. Update all callers.
6817 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
6818 sections.
6819 (Output_segment::set_section_addresses): Align after last TLS
6820 section. Add padding before last relro section instead of after.
6821
0c91cf04
DK
68222010-10-17 Doug Kwan <dougkwan@google.com>
6823
6824 * gold/arm.cc (Target_arm::got_section): Use correct order and set
6825 GOT output section to be writable.
6826
8c21d9d3
CC
68272010-10-14 Cary Coutant <ccoutant@google.com>
6828
6829 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
6830 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
6831 * gold.cc (queue_initial_tasks): Check parameters for incremental link
6832 mode.
6833 * incremental.cc (report_command_line): Ignore all forms of
6834 --incremental.
6835 * layout.cc (Layout::Layout): Check parameters for incremental link
6836 mode.
6837 * options.cc (General_options::parse_incremental): New function.
6838 (General_options::parse_no_incremental): New function.
6839 (General_options::parse_incremental_full): New function.
6840 (General_options::parse_incremental_update): New function.
6841 (General_options::incremental_mode_): New data member.
6842 (General_options::finalize): Check incremental_mode_.
6843 * options.h (General_options): Update help text for --incremental.
6844 Add --no-incremental, --incremental-full, --incremental-update.
6845 (General_options::Incremental_mode): New enum type.
6846 (General_options::incremental_mode): New function.
6847 (General_options::incremental_mode_): New data member.
6848 * parameters.cc (Parameters::incremental_mode_): New data member.
6849 (Parameters::set_options): Set incremental_mode_.
6850 (Parameters::set_incremental_full): New function.
6851 (Parameters::incremental): New function.
6852 (Parameters::incremental_update): New function.
6853 (set_parameters_incremental_full): New function.
6854 * parameters.h (Parameters::set_incremental_full): New function.
6855 (Parameters::incremental): New function.
6856 (Parameters::incremental_update): New function.
6857 (Parameters::incremental_mode_): New data member.
6858 (set_parameters_incremental_full): New function.
6859 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
6860 incremental link mode.
6861 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
6862 (Sized_relobj::do_relocate_sections): Likewise.
6863 * testsuite/Makefile.am (incremental_test): Use --incremental-full
6864 option.
6865 * testsuite/Makefile.in: Regenerate.
6866 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 6867
bb32aa18 68682010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
6869
6870 * script-sections.h (class Script_sections): Make
6871 Sections_elements typedef public.
6872 * script-sections.cc (class Sort_output_sections): Add elements_
6873 field. Add constructor which sets it; change all callers.
6874 (Sort_output_sections::is_before): New function.
6875 (Sort_output_sections::operator()): Call is_before.
6876 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
6877 conditional.
6878 * testsuite/script_test_10.sh: New test. Test script section
6879 order.
6880 * testsuite/script_test_10.t: Likewise.
6881 * testsuite/script_test_10.s: Likewise.
6882 * testsuite/Makefile.am: Wrap the cross linker tests and the
6883 common tests into NATIVE_OR_CROSS_LINKER.
6884 (check_SCRIPTS): Add script_test_10.sh.
6885 (check_DATA): Add script_test_10.stdout.
6886 (script_test_10.o, script_test_10): New targets.
6887 (script_test_10.stdout): New target.
6888 * configure, testsuite/Makefile.in: Regenerate.
6889
3cef7179
ILT
68902010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6891
6892 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
6893 error for the deprecated relocations.
6894 (Target_arm::Scan::global): Likewise.
6895 (Target_arm::Relocate::relocate): Likewise.
6896
7411e9a8
RS
68972010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
6898
6899 * fileread.cc (Input_file::find_file): Initialize *found_name
6900 and *namep when using the fallback search for case 4.
6901
6a9da32a
CC
69022010-10-11 Cary Coutant <ccoutant@google.com>
6903
6904 * options.h (class General_options): Redefine -z lazy as an alias for
6905 the negation of -z now.
6906
ac897c20
ILT
69072010-10-11 Ian Lance Taylor <iant@google.com>
6908
6909 * resolve.cc (symbol_to_bits): Report the value of the unsupported
6910 binding.
6911
ea5cae92
NC
69122010-10-06 Nick Clifton <nickc@redhat.com>
6913
6914 * script-sections.cc(class Memory_region): Remove
6915 current_lma_offset_ field. Rename current_vma_offset_ to
6916 current_offset_. Add last_section_ field.
6917 (Memory_region::get_current_vma_address): Rename to
6918 get_current_address.
6919 (Memory_region::get_current_lma_address): Delete.
6920 (Memory_region::increment_vma_offset): Rename to
6921 increment_offset.
6922 (Memory_region::increment_lma_offset): Delete.
6923 (Memory_region::attributes_compatible): New method. Returns
6924 true if the provided section is compatible with the region.
6925 (Memory_region::get_last_section): New method. Returns the last
6926 section to use the region.
6927 (Memory_region::set_last_section): New method. Stores the last
6928 section to use the region.
6929 (Script_sections::block_in_region): New method. Returns true if
6930 a block of memory is contained within a region.
6931 (Script_sections::find_memory_region): New method. Locates a
6932 memory region to be used to set a VMA or LMA address.
6933 (Output_section_definition::set_section_addresses): Add code to
6934 check for addresses set by memory regions.
6935 (Output_segment::set_section_addresses): Remove memory region
6936 walking code.
6937 (Script_sections::create_segment): Add a warning if a header
6938 segment is created outside of any region.
6939 * script-sections.h (class Script_sections): Add prototypes for
6940 find_memory_region and block_in_region methods.
6941 * testsuite/memory_test.s: Use .long instead of .word.
6942 * testsuite/memory_test.t: Add some more output sections.
6943 * testsuite/memory_test.sh: Update expected output.
6944
a9bfd952
DK
69452010-10-02 Doug Kwan <dougkwan@google.com>
6946
6947 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
6948 defintion to symtab.h
6949 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
6950 declaration to defintion.
6951
bacff3ab
NC
69522010-10-01 Nick Clifton <nickc@redhat.com>
6953
6954 * expression.cc (eval): Replace dummy argument with NULL.
6955 (eval_maybe_dot): Check for a NULL result section pointer.
6956 (Symbol_expression::value): Likewise.
6957 (Dot_expression::value): Likewise.
6958 (BINARY_EXPRESSION): Likewise.
6959 (Max_expression::value): Likewise.
6960 (Min_expression::value): Likewise.
6961 (Absolute_expression::value): Likewise.
6962 (Addr_expression::value_from_output_section): Likewise.
6963 (Loaddddr_expression::value_from_output_section): Likewise.
6964 (Segment_start_expression::value): Likewise.
6965 * script-sections.cc
6966 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
6967 argument with NULL.
6968 (Sections_elememt_dot_assignment::set_section_addresses):
6969 Likewise.
6970 (Output_data_expression::do_write_to_buffer): Likewise.
6971 (Output_section_definition::finalize_symbols): Likewise.
6972 (Output_section_definition::set_section_addresses): Likewise.
6973
f81bc8b5
DK
69742010-09-30 Doug Kwan <dougkwan@google.com>
6975
6976 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
6977
c95e9f27
ST
69782010-09-28 Sriraman Tallam <tmsriram@google.com>
6979
6980 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 6981 function.
c95e9f27
ST
6982 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
6983 virtual function.
6984 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
6985 virtual function.
6986 * icf.cc (get_section_contents): Inline merge sections only when
6987 target allows it.
6988
3cac54d2
RW
69892010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6990
6991 * configure: Regenerate.
6992
2904037a
ILT
69932010-09-17 Ian Lance Taylor <iant@google.com>
6994
6995 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
6996 * testsuite/Makefile.am (memory_test.o): New target.
6997 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
6998 memory_test.t.
6999 * testsuite/Makefile.in: Rebuild.
2904037a 7000
bca7fb63
DK
70012010-09-17 Doug Kwan <dougkwan@google.com>
7002
7003 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7004 defintion if relocation uses GOT entries of the symbol.
7005 * testsuite/icf_safe_test.sh: Fix test.
7006 * testsuite/icf_safe_so_test.sh: Fix test.
7007
4ef28648
CC
70082010-09-16 Cary Coutant <ccoutant@google.com>
7009
7010 * script_sections.cc (class Memory_region): Remove "NULL" from
7011 vector initializations.
7012
793990de
CC
70132010-09-15 Cary Coutant <ccoutant@google.com>
7014
7015 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7016 Resolve forwarding symbols.
7017
81e015e2
DK
70182010-09-15 Doug Kwan <dougkwan@google.com>
7019
7020 * gold/testsuite/script_test_3.t: Add ARM special sections.
7021 * gold/testsuite/script_test_4.t: Same.
7022 * gold/testsuite/script_test_5.t: Same.
7023 * gold/testsuite/script_test_6.t: Same.
7024 * gold/testsuite/script_test_7.t: Same.
7025 * gold/testsuite/script_test_7.t: Same.
7026 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7027
36171d64
CC
70282010-09-14 Cary Coutant <ccoutant@google.com>
7029
7030 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7031 (Target_x86_64::Relocate::relocate_tls): Replace check for
7032 saw_tls_block_reloc_ with test for executable section.
7033
d89051bd
CC
70342010-09-12 Cary Coutant <ccoutant@google.com>
7035
7036 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7037 position-independent executables to shared libraries need dynamic
7038 relocations.
7039 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7040 position-independent executables.
7041 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7042 * testsuite/Makefile.in: Regenerate.
7043
fca41f0f
NC
70442010-09-10 Nick Clifton <nickc@redhat.com>
7045
7046 PR gold/11997
7047 * testsuite/memory_test.t: Discard any sections that are not
7048 needed.
7049
6695e4b3
L
70502010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7051
7052 PR gold/11996
7053 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7054 "This::" to work around a bug in gcc 4.2.
7055
7056 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7057
0f72bf6f
RÁE
70582010-09-09 Rafael Espindola <espindola@google.com>
7059
7060 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7061 sections with different PF_X flags in the same segment.
7062 (Layout::find_first_load_seg): Search all segments to find the first
7063 one.
7064 * options.h (rosegment): New.
7065
70662010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7067
05a79166 7068 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7069
aa98ff75
DK
70702010-09-08 Doug Kwan <dougkwan@google.com>
7071
7072 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7073 (Arm_relobj::do_relocate_sections): Add new parameter for output
7074 file to match the parent.
7075 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7076 of local symbols instead of input values. Update code to track
7077 changes in gold::relocate_section.
7078 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7079 (Sized_relobj::compute_final_local_value_internal): New methods.
7080 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7081 body into private version of Sized_relobj::compute_final_local_value.
7082 Call the inline method.
7083 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7084 merged symbol value if there is one.
7085 (Symbol_value::has_output_value): New method defintiion.
7086 (Sized_relobj::Compute_final_local_value_status): New enum type.
7087 (Sized_relobj::compute_final_local_value): New methods.
7088 (Sized_relobj::compute_final_local_value_internal): New methods.
7089 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7090 and arm_cortex_a8.sh.
7091 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7092 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7093 New tests.
7094 * Makefile.in: Regenerate.
7095 * testsuite/arm_bl_out_of_range.s: Update test.
7096 * testsuite/thumb_bl_out_of_range.s: Ditto.
7097 * testsuite/thumb_blx_out_of_range.s: Ditto.
7098 * testsuite/arm_branch_out_of_range.sh: New file.
7099 * testsuite/arm_cortex_a8.sh: Ditto.
7100 * testsuite/arm_cortex_a8_b.s: Ditto.
7101 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7102 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7103 * testsuite/arm_cortex_a8_bl.s: Ditto.
7104 * testsuite/arm_cortex_a8_blx.s: Ditto.
7105 * testsuite/arm_cortex_a8_local.s: Ditto.
7106 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7107 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7108
05a79166
L
71092010-09-08 Rafael Espindola <espindola@google.com>
7110
7111 * Makefile.am (memory_test.stdout): Run readelf with -W.
7112 * Makefile.in: Regenerate.
7113 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7114 64 bit output.
7115
33dbc701
RÁE
71162010-09-08 Rafael Espindola <espindola@google.com>
7117
7118 * script-sections.cc (Script_sections::add_memory_region): Convert
7119 field precision to int.
7120 * script.cc (script_set_section_region, script_set_section_region):
7121 Convert field precision to int.
7122
731ca54a
RÁE
71232010-09-08 Rafael Espindola <espindola@google.com>
7124
7125 * arm.cc (do_finalize_sections): Create the __exidx_start and
7126 __exdix_end symbols even when the section is missing.
7127
7f8cd844
NC
71282010-09-08 Nick Clifton <nickc@redhat.com>
7129
7130 * README: Remove claim that MEMORY is not supported.
7131 * expression.cc (script_exp_function_origin)
7132 (script_exp_function_length): Move from here to ...
7133 * script.cc: ... here.
7134 (script_set_section_region, script_add_memory)
7135 (script_parse_memory_attr, script_include_directive): New
7136 functions.
7137 * script-sections.cc
7138 (class Memory_region): New class.
7139 (class Output_section_definition): Add set_memory_region,
7140 set_section_vma, set_section_lma and get_section_name methods.
7141 (class Script_Sections): Add add_memory_region,
7142 find_memory_region, find_memory_region_origin,
7143 find_memory_region_length and set_memory_region methods.
7144 Have set_section_addresses method walk the list of set memory
7145 regions.
7146 Extend the print methos to display memory regions.
7147 * script-sections.h: Add prototypes for new methods.
7148 Add enum for MEMORY region attributes.
7149 * yyscript.y: Add support for parsing MEMORY regions.
7150 * script-c.h: Add prototypes for new functions.
7151 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7152 * testsuite/Makefile.in: Regenerate.
7153 * testsuite/memory_test.sh: New script.
7154 * testsuite/memory_test.s: New assembler source file.
7155 * testsuite/memory_test.t: New linker script.
7156
a4649286
DK
71572010-08-27 Doug Kwan <dougkwan@google.com>
7158
7159 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7160 reference override an existing dynamic weak reference.
7161 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7162 * testsuite/Makefile.in: Regenerate.
7163 * testsuite/dyn_weak_ref.sh: New file.
7164 * testsuite/dyn_weak_ref_1.c: Ditto.
7165 * testsuite/dyn_weak_ref_2.c: Ditto.
7166
b56648ad
ILT
71672010-08-27 Ian Lance Taylor <iant@google.com>
7168
7169 * incremental.h (class Incremental_input_entry): Add virtual
7170 destructor.
7171
809313cb
ILT
71722010-08-27 Ian Lance Taylor <iant@google.com>
7173
7174 * testsuite/start_lib_test_3.c: Mark t3 as used.
7175
11e32464
NC
71762010-08-27 Nick Clifton <nickc@redhat.com>
7177
7178 * options.cc (version_script): Fix small typo in previous
7179 whitespace tidyup.
7180
ca09d69a
NC
71812010-08-25 Nick Clifton <nickc@redhat.com>
7182
7183 * archive.cc: Formatting fixes: Remove whitespace between
7184 typename and following asterisk. Remove whitespace between
7185 function name and opening parenthesis.
7186 * archive.h: Likewise.
7187 * arm.cc: Likewise.
7188 * attributes.cc: Likewise.
7189 * attributes.h: Likewise.
7190 * common.cc: Likewise.
7191 * copy-relocs.cc: Likewise.
7192 * dirsearch.h: Likewise.
7193 * dynobj.cc: Likewise.
7194 * ehframe.cc: Likewise.
7195 * ehframe.h: Likewise.
7196 * expression.cc: Likewise.
7197 * fileread.cc: Likewise.
7198 * fileread.h: Likewise.
7199 * gc.h: Likewise.
7200 * gold-threads.cc: Likewise.
7201 * gold.cc: Likewise.
7202 * i386.cc: Likewise.
7203 * icf.h: Likewise.
7204 * incremental-dump.cc: Likewise.
7205 * incremental.cc: Likewise.
7206 * layout.cc: Likewise.
7207 * layout.h: Likewise.
7208 * main.cc: Likewise.
7209 * merge.cc: Likewise.
7210 * merge.h: Likewise.
7211 * object.cc: Likewise.
7212 * object.h: Likewise.
7213 * options.cc: Likewise.
7214 * options.h: Likewise.
7215 * output.cc: Likewise.
7216 * output.h: Likewise.
7217 * plugin.cc: Likewise.
7218 * plugin.h: Likewise.
7219 * powerpc.cc: Likewise.
7220 * reloc.cc: Likewise.
7221 * script-c.h: Likewise.
7222 * script-sections.cc: Likewise.
7223 * script.cc: Likewise.
7224 * stringpool.cc: Likewise.
7225 * symtab.cc: Likewise.
7226 * symtab.h: Likewise.
7227 * target.cc: Likewise.
7228 * timer.cc: Likewise.
7229 * timer.h: Likewise.
7230 * version.cc: Likewise.
7231 * x86_64.cc: Likewise.
7232
b8fa8750
NC
72332010-08-24 Nick Clifton <nickc@redhat.com>
7234
7235 PR 11899
7236 * layout.cc (segment_precedes): Sort segments by their physical
7237 addresses, if they have been set.
7238
9919d93b
CC
72392010-08-23 Cary Coutant <ccoutant@google.com>
7240
7241 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7242 symbols data.
7243 (Lib_group::include_member): Unlock object after deleting its
7244 symbols data.
7245 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7246 the bug fixed here.
7247
97b4be1c
CC
72482010-08-19 Neil Vachharajani <nvachhar@google.com>
7249 Cary Coutant <ccoutant@google.com>
7250
7251 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7252 constructor, and set_blocker.
7253 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7254 readsyms_blocker_.
7255 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7256 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7257 * testsuite/Makefile.am (start_lib_test): New test case.
7258 * testsuite/Makefile.in: Regenerate.
7259 * testsuite/start_lib_test_main.c: New file.
7260 * testsuite/start_lib_test_1.c: New file.
7261 * testsuite/start_lib_test_2.c: New file.
7262 * testsuite/start_lib_test_3.c: New file.
7263
dd0b1884
ILT
72642010-08-19 Ian Lance Taylor <iant@google.com>
7265
7266 * Makefile.in: Rebuild with automake 1.11.1.
7267 * aclocal.m4: Likewise.
7268 * testsuite/Makefile.in: Likewise.
7269
7223e9ca
ILT
72702010-08-19 Ian Lance Taylor <iant@google.com>
7271
7272 PR 10893
7273 * i386.cc (class Output_data_plt_i386): Update declarations.
7274 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7275 local_ifuncs_ fields.
7276 (Target_i386::do_plt_section_for_global): New function.
7277 (Target_i386::do_plt_section_for_local): New function.
7278 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7279 parameter; change all callers. Initialize global_ifuncs_ and
7280 local_ifuncs_. If doing a static link define __rel_iplt_start and
7281 __rel_iplt_end.
7282 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7283 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7284 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7285 symbols.
7286 (Target_i386::make_plt_section): New function, broken out of
7287 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7288 (Target_i386::make_plt_entry): Call make_plt_section.
7289 (Target_i386::make_local_ifunc_plt_entry): New function.
7290 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7291 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7292 R_386_IRELATIVE to switch.
7293 (Target_i386::Scan::global): Likewise.
7294 (Target_i386::Relocate::relocate): Likewise.
7295 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7296 switch.
7297 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7298 (Target_x86_64::do_plt_section_for_global): New function.
7299 (Target_x86_64::do_plt_section_for_local): New function.
7300 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7301 parameter; change all callers. If doing a static link define
7302 __rela_iplt_start and __rela_iplt_end.
7303 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7304 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7305 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7306 to point to .plt.
7307 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7308 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7309 switch.
7310 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7311 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7312 R_X86_64_IRELATIVE to switch.
7313 (Target_x86_64::Scan::global): Likewise.
7314 (Target_x86_64::Relocate::relocate): Likewise.
7315 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7316 switch.
7317 * target.h (class Target): Add plt_section_for_global and
7318 plt_section_for_local functions. Add do_plt_section_for_global
7319 and do_plt_section_for_local virtual functions.
7320 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7321 clarifying comments.
7322 (Symbol::use_plt_offset): Handle IFUNC symbol.
7323 * object.cc (Sized_relobj::Sized_relobj): Initialize
7324 local_plt_offsets_.
7325 (Sized_relobj::local_has_plt_offset): New function.
7326 (Sized_relobj::local_plt_offset): New function.
7327 (Sized_relobj::set_local_plt_offset): New function.
7328 (Sized_relobj::do_count): Handle IFUNC symbol.
7329 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7330 a bit away from input_shndx_ field. Add set_is_func_symbol and
7331 is_ifunc_symbol functions.
7332 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7333 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7334 local_plt_offsets_ field.
7335 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7336 * output.h (class Output_section_data): Add non-const
7337 output_section function.
7338 (class Output_data_got): Update declarations.
7339 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7340 Add use_plt_offset parameter to global and local constructors.
7341 Change all callers. Change local_sym_index_ field to 31 bits.
7342 Change GSYM_CODE and CONSTANT_CODE accordingly.
7343 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7344 doing a static link don't set sh_link field.
7345 (Output_data_got::Got_entry::write): Use PLT offset if
7346 appropriate.
7347 (Output_data_got::add_global_plt): New function.
7348 (Output_data_got::add_local_plt): New function.
7349 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7350 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7351 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7352 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7353 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7354 IFUNC conditional.
7355 * testsuite/ifunc-sel.h: New file.
7356 * testsuite/ifuncmain1.c: New file.
7357 * testsuite/ifuncmain1vis.c: New file.
7358 * testsuite/ifuncmod1.c: New file.
7359 * testsuite/ifuncdep2.c: New file.
7360 * testsuite/ifuncmain2.c: New file.
7361 * testsuite/ifuncmain3.c: New file.
7362 * testsuite/ifuncmod3.c: New file.
7363 * testsuite/ifuncmain4.c: New file.
7364 * testsuite/ifuncmain5.c: New file.
7365 * testsuite/ifuncmod5.c: New file.
7366 * testsuite/ifuncmain6pie.c: New file.
7367 * testsuite/ifuncmod6.c: New file.
7368 * testsuite/ifuncmain7.c: New file.
7369 * configure, testsuite/Makefile.in: Rebuild.
7370
56f75c03
ILT
73712010-08-18 Ian Lance Taylor <iant@google.com>
7372
7373 * incremental.cc
7374 (Output_section_incremental_inputs::write_input_files): Add cast
7375 to avoid signed/unsigned comparison warning.
7376 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7377
55455f89
CC
73782010-08-12 Cary Coutant <ccoutant@google.com>
7379
7380 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7381
e2054bcb
ILT
73822010-08-13 Ian Lance Taylor <iant@google.com>
7383
7384 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7385
74f67560
DK
73862010-08-12 Cary Coutant <ccoutant@google.com>
7387 Doug Kwan <dougkwan@google.com>
7388
7389 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7390 defintion overrides non-weak undef, remember that the original undef
7391 is not weak.
7392 * symtab.cc (Symbol_table::sized_write_global): For undef without
7393 an original weak binding, set binding to global in output.
7394 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7395 * testsuite/Makefile.in: Regenerate.
7396 * testsuite/strong_ref_weak_def.sh: New file.
7397 * testsuite/strong_ref_weak_def_1.c: Ditto.
7398 * testsuite/strong_ref_weak_def_2.c: Ditto.
7399
d1238d12
CC
74002010-08-12 Cary Coutant <ccoutant@google.com>
7401
7402 * testsuite/incremental_test.sh: Rewrite.
7403 * testsuite/incremental_test_1.c: Rewrite.
7404 * testsuite/incremental_test_2.c: Rewrite.
7405
0e70b911
CC
74062010-08-12 Cary Coutant <ccoutant@google.com>
7407
7408 * arm.cc (Target_arm::got_size): Add const.
7409 (Target_arm::got_entry_count): New function.
7410 (Target_arm::plt_entry_count): New function.
7411 (Target_arm::first_plt_entry_offset): New function.
7412 (Target_arm::plt_entry_size): New function.
7413 (Output_data_plt_arm::entry_count): New function.
7414 (Output_data_plt_arm::first_plt_entry_offset): New function.
7415 (Output_data_plt_arm::get_plt_entry_size): New function.
7416 * i386.cc (Target_i386::got_size): Add const.
7417 (Target_i386::got_entry_count): New function.
7418 (Target_i386::plt_entry_count): New function.
7419 (Target_i386::first_plt_entry_offset): New function.
7420 (Target_i386::plt_entry_size): New function.
7421 (Output_data_plt_i386::entry_count): New function.
7422 (Output_data_plt_i386::first_plt_entry_offset): New function.
7423 (Output_data_plt_i386::get_plt_entry_size): New function.
7424 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7425 find_incremental_inputs_sections. Dump incremental_got_plt section.
7426 * incremental.cc: Include target.h.
7427 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7428 parameter. Adjust all callers. Find incremental_got_plt section.
7429 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7430 section.
7431 (Output_section_incremental_inputs::set_final_data_size): Calculate
7432 size of incremental_got_plt section.
7433 (Output_section_incremental_inputs::do_write): Write the
7434 incremental_got_plt section.
7435 (Got_plt_view_info): New struct.
7436 (Local_got_offset_visitor): New class.
7437 (Global_got_offset_visitor): New class.
7438 (Global_symbol_visitor_got_plt): New class.
7439 (Output_section_incremental_inputs::write_got_plt): New function.
7440 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7441 Add parameter. Adjust all callers.
7442 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7443 (Incremental_inputs::got_plt_section): New function.
7444 (Incremental_inputs::got_plt_section_): New data member.
7445 (Incremental_got_plt_reader): New class.
7446 * layout.cc (Layout::create_incremental_info_sections): Add the
7447 incremental_got_plt section.
7448 * object.h (Got_offset_list::get_list): New function.
7449 (Got offset_list::for_all_got_offsets): New function.
7450 (Sized_relobj::local_got_offset_list): New function.
7451 * powerpc.cc (Target_powerpc::got_size): Add const.
7452 (Target_powerpc::got_entry_count): New function.
7453 (Target_powerpc::plt_entry_count): New function.
7454 (Target_powerpc::first_plt_entry_offset): New function.
7455 (Target_powerpc::plt_entry_size): New function.
7456 (Output_data_plt_powerpc::entry_count): New function.
7457 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7458 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7459 * sparc.cc (Target_sparc::got_size): Add const.
7460 (Target_sparc::got_entry_count): New function.
7461 (Target_sparc::plt_entry_count): New function.
7462 (Target_sparc::first_plt_entry_offset): New function.
7463 (Target_sparc::plt_entry_size): New function.
7464 (Output_data_plt_sparc::entry_count): New function.
7465 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7466 (Output_data_plt_sparc::get_plt_entry_size): New function.
7467 * symtab.h (Symbol::got_offset_list): New function.
7468 (Symbol_table::for_all_symbols): New function.
7469 * target.h (Sized_target::got_entry_count): New function.
7470 (Sized_target::plt_entry_count): New function.
7471 (Sized_target::plt_entry_size): New function.
7472 * x86_64.cc (Target_x86_64::got_size): Add const.
7473 (Target_x86_64::got_entry_count): New function.
7474 (Target_x86_64::plt_entry_count): New function.
7475 (Target_x86_64::first_plt_entry_offset): New function.
7476 (Target_x86_64::plt_entry_size): New function.
7477 (Output_data_plt_x86_64::entry_count): New function.
7478 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7479 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7480
09ec0418
CC
74812010-08-12 Cary Coutant <ccoutant@google.com>
7482
7483 * archive.cc: Include incremental.h.
7484 (Archive::Archive): Initialize incremental_info_.
7485 (Archive::include_member): Record archive members in incremental info.
7486 (Add_archive_symbols::run): Record begin and end of an archive in
7487 incremental info.
7488 (Lib_group::include_member): Record objects in incremental info.
7489 * archive.h (Incremental_archive_entry): Forward declaration.
7490 (Archive::set_incremental_info): New member function.
7491 (Archive::incremental_info): New member function.
7492 (Archive::Unused_symbol_iterator): New class.
7493 (Archive::unused_symbols_begin): New member function.
7494 (Archive::unused_symbols_end): New member function.
7495 (Archive::incremental_info_): New data member.
7496 * incremental-dump.cc (find_input_containing_global): New function.
7497 (dump_incremental_inputs): Dump new incremental info sections.
7498 * incremental.cc: Include symtab.h.
7499 (Output_section_incremental_inputs): New class.
7500 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7501 new incremental info sections.
7502 (Sized_incremental_binary::do_check_inputs): Likewise.
7503 (Incremental_inputs::report_archive): Remove.
7504 (Incremental_inputs::report_archive_begin): New function.
7505 (Incremental_inputs::report_archive_end): New function.
7506 (Incremental_inputs::report_object): New function.
7507 (Incremental_inputs::finalize_inputs): Remove.
7508 (Incremental_inputs::report_input_section): New function.
7509 (Incremental_inputs::report_script): Rewrite.
7510 (Incremental_inputs::finalize): Do nothing but finalize string table.
7511 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7512 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7513 (Incremental_inputs::create_data_sections): New function.
7514 (Incremental_inputs::relocs_entsize): New function.
7515 (Output_section_incremental_inputs::set_final_data_size): New function.
7516 (Output_section_incremental_inputs::do_write): New function.
7517 (Output_section_incremental_inputs::write_header): New function.
7518 (Output_section_incremental_inputs::write_input_files): New function.
7519 (Output_section_incremental_inputs::write_info_blocks): New function.
7520 (Output_section_incremental_inputs::write_symtab): New function.
7521 * incremental.h (Incremental_script_entry): Forward declaration.
7522 (Incremental_object_entry): Forward declaration.
7523 (Incremental_archive_entry): Forward declaration.
7524 (Incremental_inputs): Forward declaration.
7525 (Incremental_inputs_header_data): Remove.
7526 (Incremental_inputs_header): Remove.
7527 (Incremental_inputs_header_write): Remove.
7528 (Incremental_inputs_entry_data): Remove.
7529 (Incremental_inputs_entry): Remove.
7530 (Incremental_inputs_entry_write): Remove.
7531 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7532 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7533 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7534 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7535 Likewise.
7536 (Incremental_input_entry): New class.
7537 (Incremental_script_entry): New class.
7538 (Incremental_object_entry): New class.
7539 (Incremental_archive_entry): New class.
7540 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7541 (Incremental_inputs::report_inputs): Remove.
7542 (Incremental_inputs::report_archive): Remove.
7543 (Incremental_inputs::report_archive_begin): New function.
7544 (Incremental_inputs::report_archive_end): New function.
7545 (Incremental_inputs::report_object): Change prototype.
7546 (Incremental_inputs::report_input_section): New function.
7547 (Incremental_inputs::report_script): Change prototype.
7548 (Incremental_inputs::get_reloc_count): New function.
7549 (Incremental_inputs::set_reloc_count): New function.
7550 (Incremental_inputs::create_data_sections): New function.
7551 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7552 (Incremental_inputs::inputs_section): New function.
7553 (Incremental_inputs::symtab_section): New function.
7554 (Incremental_inputs::relocs_section): New function.
7555 (Incremental_inputs::get_stringpool): Add const.
7556 (Incremental_inputs::command_line): Add const.
7557 (Incremental_inputs::inputs): Remove.
7558 (Incremental_inputs::command_line_key): New function.
7559 (Incremental_inputs::input_file_count): New function.
7560 (Incremental_inputs::input_files): New function.
7561 (Incremental_inputs::relocs_entsize): New function.
7562 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7563 (Incremental_inputs::finalize_inputs): Remove.
7564 (Incremental_inputs::Input_info): Remove.
7565 (Incremental_inputs::lock_): Remove.
7566 (Incremental_inputs::inputs_): Change type.
7567 (Incremental_inputs::inputs_map_): Remove.
7568 (Incremental_inputs::current_object_entry_): New data member.
7569 (Incremental_inputs::inputs_section_): New data member.
7570 (Incremental_inputs::symtab_section_): New data member.
7571 (Incremental_inputs::relocs_section_): New data member.
7572 (Incremental_inputs::reloc_count_): New data member.
7573 (Incremental_inputs_reader): New class.
7574 (Incremental_symtab_reader): New class.
7575 (Incremental_relocs_reader): New class.
7576 * layout.cc (Layout::finalize): Move finalization of incremental info
7577 and creation of incremental info sections to follow finalization of
7578 symbol table. Set offsets for postprocessing sections.
7579 (Layout::create_incremental_info_sections): Call
7580 Incremental_inputs::create_data_sections. Add incremental symtab
7581 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7582 sections to layout after input sections.
7583 * layout.h (struct Timespec): Forward declaration.
7584 (Layout::incremental_inputs): Add const.
7585 (Layout::create_incremental_info_sections): Add parameter.
7586 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7587 * object.cc: Include incremental.h.
7588 (Relobj::finalize_incremental_relocs): New function.
7589 (Sized_relobj::do_layout): Record input sections in incremental info.
7590 * object.h (Object::output_section): New function.
7591 (Object::output_section_offset): Moved from Relobj.
7592 (Object::get_incremental_reloc_base): New function.
7593 (Object::get_incremental_reloc_count): New function.
7594 (Object::do_output_section): New function.
7595 (Object::do_output_section_offset): Moved from Relobj.
7596 (Object::do_get_incremental_reloc_base): New function.
7597 (Object::do_get_incremental_reloc_count): New function.
7598 (Object::Object): Initialize new data members.
7599 (Relobj::output_section): Renamed do_output_section and moved to
7600 protected.
7601 (Relobj::output_section_offset): Moved to Object.
7602 (Relobj::do_get_incremental_reloc_base): New function.
7603 (Relobj::do_get_incremental_reloc_count): New function.
7604 (Relobj::allocate_incremental_reloc_counts): New function.
7605 (Relobj::count_incremental_reloc): New function.
7606 (Relobj::finalize_incremental_relocs): New function.
7607 (Relobj::next_incremental_reloc_index): New function.
7608 (Relobj::reloc_counts_): New data member.
7609 (Relobj::reloc_bases_): New data member.
7610 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7611 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7612 (Sized_relobj::incremental_relocs_scan): New function.
7613 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7614 (Sized_relobj::incremental_relocs_write): New function.
7615 (Sized_relobj::incremental_relocs_write_reltype): New function.
7616 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7617 incremental link.
7618 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7619 archives and object files elsewhere.
7620 (Add_symbols::run): Report object files here.
7621 (Finish_group::run): Report end of archive at end of group.
7622 * reloc.cc: Include layout.h, incremental.h.
7623 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7624 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7625 (Sized_relobj::incremental_relocs_scan): New function.
7626 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7627 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7628 (Sized_relobj::incremental_relocs_write): New function.
7629 (Sized_relobj::incremental_relocs_write_reltype): New function.
7630 * script.cc (read_input_script): Rewrite test for incremental link.
7631 Change call to Incremental_inputs::report_script.
7632 * symtab.h (Symbol_table::first_global_index): New function.
7633 (Symbol_table::output_count): New function.
7634
ce0d1972
DK
76352010-08-12 Doug Kwan <dougkwan@google.com>
7636
7637 * arm.cc (Target_arm::merge_object_attributes): Check command line
7638 options --no-wchar-size-warning and --no-enum-size-warning.
7639 * options.h (General_options): Add ld-compatible options
7640 --no-enum-size-warning and --no-wchar-size-warning.
7641
6e5710ce
ILT
76422010-08-04 Ian Lance Taylor <iant@google.com>
7643
7644 * x86_64.cc (Target_x86_64::Scan::local): Use
7645 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7646 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7647 (Target_x86_64::Scan::global): Likewise.
7648 (Target_x86_64::Relocate::relocate): Likewise.
7649 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7650 Likewise.
7651
fef830db
CC
76522010-08-03 Cary Coutant <ccoutant@google.com>
7653
7654 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7655 to reserve space in merged_strings vector. Keep total input size
7656 for stats.
7657 (Output_merge_string::do_print_merge_stats): Print total input size.
7658 * merge.h (Output_merge_string): Add input_size_ field.
7659 * stringpool.cc (Stringpool_template::string_length): Move
7660 implementations out of Stringpool_template class and place in
7661 stringpool.h.
7662 * stringpool.h (string_length): Move out of Stringpool_template.
7663
1e3811b0
ILT
76642010-08-03 Ian Lance Taylor <iant@google.com>
7665
7666 PR 11712
7667 * layout.cc (relaxation_loop_body): If address of load segment is
7668 set, adjust address to include headers if possible.
7669
7af0c620
ILT
76702010-08-03 Ian Lance Taylor <iant@google.com>
7671
7672 * version.cc (version_string): Bump to 1.10.
7673
22f0da72
ILT
76742010-08-03 Ian Lance Taylor <iant@google.com>
7675
7676 PR 11805
7677 * layout.h (enum Output_section_order): Define.
7678 (class Layout): Update declarations.
7679 * layout.cc (Layout::get_output_section): Add order parameter.
7680 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7681 is_first_non_relro parameters. Change all callers.
7682 (Layout::choose_output_section): Likewise.
7683 (Layout::add_output_section_data): Likewise.
7684 (Layout::make_output_section): Likewise. Set order.
7685 (Layout::default_section_order): New function.
7686 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7687 * output.cc (Output_section::Output_section): Initialize order_.
7688 Don't initialize deleted fields.
7689 (Output_segment::Output_segment): Don't initialize deleted
7690 fields.
7691 (Output_segment::add_output_section_to_load): New function
7692 replacing add_output_section. Change all callers to call this or
7693 add_output_section_to_nonload.
7694 (Output_segment::add_output_section_to_nonload): New function.
7695 (Output_segment::remove_output_section): Rewrite.
7696 (Output_segment::add_initial_output_data): Likewise.
7697 (Output_segment::has_any_data_sections): Likewise.
7698 (Output_segment::is_first_section_relro): Likewise.
7699 (Output_segment::maximum_alignment): Likewise.
7700 (Output_segment::has_dynamic_reloc): New function replacing
7701 dynamic_reloc_count. Change all callers.
7702 (Output_segment::has_dynamic_reloc_list): New function replacing
7703 dynamic_reloc_count_list. Change all callers.
7704 (Output_segment::set_section_addresses): Rewrite.
7705 (Output_segment::set_offset): Rewrite.
7706 (Output_segment::find_first_and_last_list): Remove.
7707 (Output_segment::set_tls_offsets): Rewrite.
7708 (Output_segment::first_section_load_address): Likewise.
7709 (Output_segment::output_section_count): Likewise.
7710 (Output_segment::section_with_lowest_load_address): Likewise.
7711 (Output_segment::write_section_headers): Likewise.
7712 (Output_segment::print_sections_to_map): Likewise.
7713 * output.h (class Output_data): Remove dynamic_reloc_count_
7714 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7715 (Output_data::add_dynamic_reloc): Rewrite.
7716 (Output_data::has_dynamic_reloc): New function.
7717 (Output_data::dynamic_reloc_count): Remove.
7718 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7719 is_last_relro_, is_first_non_relro_, is_interp_,
7720 is_dynamic_linker_section_ fields. Add order and set_order
7721 functions. Remove is_relro_local, set_is_relro_local,
7722 is_last_relro, set_is_last_relro, is_first_non_relro,
7723 set_is_first_non_relro functions, is_interp, set_is_interp,
7724 is_dynamic_linker_section, and set_is_dynamic_linker_section
7725 functions.
7726 (class Output_segment): Change Output_data_list from std::list to
7727 std:;vector. Add output_lists_ field. Remove output_data_ and
7728 output_bss_ fields. Update declarations.
7729
3ff2ccb0
ILT
77302010-08-02 Ian Lance Taylor <iant@google.com>
7731
7732 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7733 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7734 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7735
88a4108b
ILT
77362010-08-02 Ian Lance Taylor <iant@google.com>
7737
7738 PR 11855
7739 * script.cc (Script_options::Script_options): Initialize
7740 symbol_definitions_ and symbol_references_.
7741 (Script_options::add_symbol_assignment): Update
7742 symbol_definitions_ and symbol_references_.
7743 (Script_options::add_symbol_reference): New function.
7744 (script_symbol): New function.
7745 * script.h (class Script_options): Add symbol_definitions_ and
7746 symbol_references_ fields.
7747 (Script_options::referenced_const_iterator): New type.
7748 (Script_options::referenced_begin): New function.
7749 (Script_options::referenced_end): New function.
7750 (Script_options::is_referenced): New function.
7751 (Script_options::any_unreferenced): New function.
7752 * script-c.h (script_symbol): Declare.
7753 * yyscript.y (exp): Call script_symbol.
7754 * symtab.cc: Include "script.h".
7755 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7756 Change all callers. Check symbols referenced by scripts.
7757 (Symbol_table::add_undefined_symbols_from_command_line): Add
7758 layout parameter. Change all callers.
7759 (Symbol_table::do_add_undefined_symbols_from_command_line):
7760 Likewise. Break out loop body. Check symbols referenced by
7761 scripts.
7762 (Symbol_table::add_undefined_symbol_from_command_line): New
7763 function broken out of
7764 do_add_undefined_symbols_from_command_line.
7765 * symtab.h (class Symbol_table): Update declarations.
7766 * archive.cc: Include "layout.h".
7767 (Archive::should_include_member): Add layout parameter. Change
7768 all callers. Check for symbol mentioned in expression.
7769 * archive.h (class Archive): Update declaration.
7770 * object.cc (Sized_relobj::do_should_include_member): Add layout
7771 parameter.
7772 * object.h (Object::should_include_member): Add layout parameter.
7773 Change all callers.
7774 (Object::do_should_include_member): Add layout parameter.
7775 (class Sized_relobj): Update declaration.
7776 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
7777 parameter.
7778 * dynobj.h (class Sized_dynobj): Update declaration.
7779 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
7780 layout parameter.
7781 * plugin.h (class Sized_pluginobj): Update declaration.
7782
5f1ab67a
ILT
77832010-08-02 Ian Lance Taylor <iant@google.com>
7784
7785 PR 11866
7786 * output.cc (Output_segment::set_offset): Search for the first and
7787 last sections rather than assuming that the list is in order.
7788 (Output_segment::find_first_and_last_list): New function.
7789 * output.h (class Output_segment): Update declarations.
7790 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
7791 (relro_strip_test_SOURCES): New variable.
7792 (relro_strip_test_DEPENDENCIES): New variable.
7793 (relro_strip_test_LDFLAGS): New variable.
7794 (relro_strip_test_LDADD): New variable.
7795 (relro_strip_test.so): New target.
7796
a8df5856
ILT
77972010-08-02 Ian Lance Taylor <iant@google.com>
7798
7799 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
7800 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
7801 (Target_i386::got_tlsdesc_section): New function.
7802 (Target_i386::got_section): Create space for GOT entries for
7803 TLSDESC relocations.
7804 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
7805 R_386_TLS_GOTDESC.
7806 (Target_i386::Scan::global): Likewise.
7807 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
7808 using TLSDESC GOT.
7809 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
7810 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
7811 (Target_x86_64::got_tlsdesc_section): New function.
7812 (Target_x86_64::got_section): Create space for GOT entries for
7813 TLSDESC relocations.
7814 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
7815 R_386_TLS_GOTDESC.
7816 (Target_x86_64::Scan::global): Likewise.
7817 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
7818 using TLSDESC GOT.
7819
0c10a0a6
ILT
78202010-08-02 Ian Lance Taylor <iant@google.com>
7821
7822 * testsuite/final_layout.sh: Use dc to convert from hex to
7823 decimal.
7824
41cbeecc
ST
78252010-07-29 Sriraman Tallam <tmsriram@google.com>
7826
7827 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
7828 paramter to the call to gold::gc_process_relocs.
7829 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
7830 paramter to the call to gold::gc_process_relocs.
7831 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
7832 parameter to the call to gold::gc_process_relocs.
7833 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
7834 template parameter to the call to gold::gc_process_relocs.
7835 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
7836 paramter to the call to gold::gc_process_relocs.
7837 * gc.h (get_embedded_addend_size): New function.
7838 (gc_process_relocs): Save the size of the reloc for use by ICF.
7839 * icf.cc (get_section_contents): Get the addend from the text section
7840 for SHT_REL relocation sections.
7841 * icf.h (Icf::Reloc_addend_size_info): New typedef.
7842 (Icf::Reloc_info): Add new member reloc_addend_size_info.
7843 * int_encoding.h (read_from_pointer): New overloaded function.
7844 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
7845 * testsuite/icf_sht_rel_addend_test.sh: New file.
7846 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
7847 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
7848
6ea55b82
RW
78492010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7850
7851 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
7852 * Makefile.in: Regenerate.
7853 * testsuite/Makefile.in: Regenerate.
7854
9691462b
ILT
78552010-07-27 Jeffrey Yasskin <jyasskin@google.com>
7856
7857 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
7858 * gold/testsuite/debug_msg.cc: Likewise.
7859 * gold/testsuite/odr_violation1.cc
7860 * gold/testsuite/odr_violation2.cc
7861
76897331
CC
78622010-07-21 Cary Coutant <ccoutant@google.com>
7863
7864 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
7865 string, and length fields.
7866 (Output_merge_string::Merged_strings_list): New type.
7867 (Output_merge_string::Merged_strings_lists): New typedef.
7868 (Output_merge_string): Replace merged_strings_ with
7869 merged_strings_lists_.
7870 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
7871 Merged_strings_list per input object and section. Don't store pointer
7872 to the string. Don't store length with each merged string entry.
7873 (Output_merge_string::finalize_merged_data): Loop over list of merged
7874 strings lists. Recompute length of each merged string.
7875
78384e8f
CC
78762010-07-15 Cary Coutant <ccoutant@google.com>
7877
7878 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
7879 here.
7880
783659f9
ILT
78812010-07-14 Ian Lance Taylor <iant@google.com>
7882
7883 * descriptors.cc (Descriptors::open): Report correct name in error
7884 message.
7885
131687b4
DK
78862010-07-13 Doug Kwan <dougkwan@google.com>
7887
7888 * arm.cc (Arm_input_section::Arm_input_section): For a
7889 SHT_ARM_EXIDX section, always keeps the input sections.
7890 (Arm_input_section::set_exidx_section_link): New method.
7891 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
7892 has_errors_ to false.
7893 (Arm_exidx_input_section::has_errors,
7894 Arm_exidx_input_section::set_has_errors): New methods.
7895 (Arm_exidx_input_section::has_errors_): New data member.
7896 (Arm_relobj::get_exidx_shndx_list): New method.
7897 (Arm_output_section::append_text_sections_to_list): Do not skip
7898 section without SHF_EXECINSTR.
7899 (Arm_output_section::fix_exidx_coverage): Skip input sections with
7900 errors.
2e702c99 7901 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
7902 section header. Make error messages more verbose. Check for
7903 a non-executable section linked to an EXIDX section.
7904 (Arm_relobj::do_read_symbols): Remove error checking, which has been
7905 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
7906 check that there is no deferred EXIDX section if we exit early.
7907 Instead of not making an EXIDX section in case of an error, make one
7908 and set the has_errors flag of it.
7909 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
7910 in a relocatable link.
7911 (Target_arm::do_relax): Look for the EXIDX output section instead of
7912 assuming that it is called .ARM.exidx.
2e702c99 7913 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
7914 section list. Do not check for SHF_EXECINSTR section flags but
7915 skip any input section with errors.
7916 * output.cc (Output_section::Output_section): Initialize
7917 always_keeps_input_sections_ to false.
7918 (Output_section::add_input_section): Check for
7919 always_keeps_input_sections_.
7920 * output.h (Output_section::always_keeps_input_sections,
7921 Output_section::set_always_keeps_input_sections): New methods.
7922 (Output_section::always_keeps_input_sections): New data member.
7923
69517287
RÁE
79242010-07-13 Rafael Espindola <espindola@google.com>
7925
7926 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
7927 * fileread.h (Input_file): Add try_extra_search_path and find_file.
7928
82742395
ILT
79292010-07-13 Philip Herron <herron.philip@googlemail.com>
7930 Ian Lance Taylor <iant@google.com>
7931
7932 * output.h (Output_section_lookup_maps::add_merge_section):
7933 Correct check of whether value was inserted.
7934 (Output_section_lookup_maps::add_merge_input_section): Likewise.
7935 (Output_section_lookup_maps::add_relaxed_input_section):
7936 Likewise.
7937 * arm.cc (Target_arm::got_section): Remove used local os.
7938 * i386.cc (Target_i386::got_section): Likewise.
7939 * x86_64.cc (Target_x86_64::got_section): Likewise.
7940 * sparc.cc (Target_sparc::got_section): Likewise.
7941 (Target_sparc::relocate): Remove unused local have_got_offset.
7942 * powerpc.cc (Target_powerpc::relocate): Likewise.
7943
f2d707b5
ILT
79442010-07-13 Ian Lance Taylor <iant@google.com>
7945
241531d6
ILT
7946 * compressed_output.cc (zlib_decompress): Fix signature in
7947 !HAVE_ZLIB_H case.
7948
f2d707b5
ILT
7949 * archive.cc (Archive::include_member): Unlock an external member
7950 of a thin archive. Don't bother to delete an object we know is
7951 NULL.
7952
a2e47362
CC
79532010-07-12 Cary Coutant <ccoutant@google.com>
7954
7955 * compressed_output.cc (zlib_decompress): New function.
7956 (get_uncompressed_size): New function.
7957 (decompress_input_section): New function.
7958 * compressed_output.h (get_uncompressed_size): New function.
7959 (decompress_input_section): New function.
7960 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
7961 Handle compressed debug sections.
7962 * layout.cc (is_compressed_debug_section): New function.
7963 (Layout::output_section_name): Map compressed section names to
7964 canonical names.
7965 * layout.h (is_compressed_debug_section): New function.
7966 (is_debug_info_section): Recognize compressed debug sections.
7967 * merge.cc: Include compressed_output.h.
7968 (Output_merge_data::do_add_input_section): Handle compressed
7969 debug sections.
7970 (Output_merge_string::do_add_input_section): Handle compressed
7971 debug sections.
7972 * object.cc: Include compressed_output.h.
7973 (Sized_relobj::Sized_relobj): Initialize new data members.
7974 (build_compressed_section_map): New function.
7975 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
7976 * object.h (Object::section_is_compressed): New method.
7977 (Object::do_section_is_compressed): New method.
7978 (Sized_relobj::Compressed_section_map): New type.
7979 (Sized_relobj::do_section_is_compressed): New method.
7980 (Sized_relobj::compressed_sections_): New data member.
7981 * output.cc (Output_section::add_input_section): Handle compressed
7982 debug sections.
7983 * reloc.cc: Include compressed_output.h.
7984 (Sized_relobj::write_sections): Handle compressed debug sections.
7985
ce279a62
CC
79862010-07-08 Cary Coutant <ccoutant@google.com>
7987
7988 * resolve.cc (Symbol_table::resolve): Remember whether undef was
7989 weak when resolving to a dynamic def.
7990 (Symbol_table::should_override): Add adjust_dyndef flag; set it
7991 for weak undef/dynamic def cases. Adjust callers.
7992 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
7993 undef_binding_weak_.
7994 (Symbol_table::sized_write_globals): Adjust symbol binding.
7995 (Symbol_table::sized_write_symbol): Add binding parameter.
7996 * symtab.h (Symbol::set_undef_binding): New method.
7997 (Symbol::is_undef_binding_weak): New method.
7998 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
7999 (Symbol_table::should_override): Add new parameter.
8000 (Symbol_table::sized_write_symbol): Add new parameter.
8001
8002 * testsuite/weak_undef_file1.cc: Add new test case.
8003 * testsuite/weak_undef_file2.cc: Fix header comment.
8004 * testsuite/weak_undef_test.cc: Add new test case.
8005
b2286c10
DK
80062010-06-29 Doug Kwan <dougkwan@google.com>
8007
8008 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8009 Initialize USE_SYMBOL_.
8010 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8011 definition.
8012 (Arm_reloc_property::uses_symbol_): New data member declaration.
8013 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8014 uses symbol value and symbol is undefined but not weakly undefined.
8015
4802450a
RÁE
80162010-06-28 Rafael Espindola <espindola@google.com>
8017
8018 * plugin.cc (Plugin::load): Use dlerror.
8019
e5ca47ba
ILT
80202010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8021
8022 * symtab.cc (detect_odr_violations): When reporting an ODR
8023 violation, report an object where the symbol is defined.
8024
8a75a161
DK
80252010-06-25 Doug Kwan <dougkwan@google.com>
8026
8027 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8028 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8029 definition.
8030 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8031 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8032 target hook to detect function points.
8033 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8034 * icf.h (Icf::check_section_for_function_pointers): Change type of
8035 parameter SECTION_NAME to const reference to std::string. Use
8036 target hook to determine if section may have unsafe pointers.
8037 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8038 method definition.
8039
42218b9f
RÁE
80402010-06-21 Rafael Espindola <espindola@google.com>
8041
8042 * fileread.cc (Input_file::find_fie): New
8043 (Input_file::open): Use Input_file::find_fie.
8044 * fileread.h (Input_file::find_fie): New
8045 * plugin.cc (set_extra_library_path): New.
8046 (Plugin::load): Add set_extra_library_path to the transfer vector.
8047 (Plugin_manager::set_extra_library_path): New.
8048 (Plugin_manager::add_input_file): Use the extra search path if set.
8049 (set_extra_library_path(): New.
8050 * plugin.h (Plugin_manager): Add set_extra_library_path and
8051 extra_search_path_.
8052
a0506cca
CC
80532010-06-19 Cary Coutant <ccoutant@google.com>
8054
8055 * layout.cc (gdb_sections): Add .debug_types.
8056 (lines_only_debug_sections): Likewise.
8057
6508b958
RÁE
80582010-06-18 Rafael Espindola <espindola@google.com>
8059
8060 * plugin.cc (add_input_file,add_input_library)
8061 (Plugin_manager::add_input_file): Make filename arguments const.
8062 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8063 const.
8064
3e235302
DK
80652010-06-16 Doug Kwan <dougkwan@google.com>
8066
8067 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8068 .ARM.attributes section if we have not merged any input
8069 attributes sections.
8070
106e8a6c
DK
80712010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8072
8073 * arm.cc: Allow combining objects with no EABI version
8074 information.
8075
91ff43fe
RÁE
80762010-06-15 Rafael Espindola <espindola@google.com>
8077
8078 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8079
68ed838c
ILT
80802010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8081
8082 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8083 (struct iovec): Correct !HAVE_READV definition.
8084
f3a2388f
CC
80852010-06-10 Cary Coutant <ccoutant@google.com>
8086
8087 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8088 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8089 reloc sections.
8090 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8091
8092 PR 11683
8093 * symtab.h (Symbol::is_placeholder): New member function.
8094 * target-reloc.h (relocate_section): Check for placeholder symbols.
8095
8096 * testsuite/Makefile.am (plugin_test_8): New test.
8097 (plugin_test_9): New test.
8098 * testsuite/Makefile.in: Regenerate.
8099
e1df38aa
NC
81002010-06-09 Nick Clifton <nickc@redhat.com>
8101
8102 * yyscript.y (input_list_element): Allow strings prefixed with
8103 the '-' character. Treat these as libraries.
8104 * script.cc (script_add_library): New function. Adds a library
8105 specified by "-l<name>" found in an input script.
8106 * script-c.h: Add prototype for script_add_library.
8107
25bbe950
DK
81082010-06-07 Doug Kwan <dougkwan@google.com>
8109
8110 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8111 Restrict stub-group size to be within long conditional branch
8112 range when working around cortex-A8 erratum.
8113
0f32ea4c
ILT
81142010-06-07 Damien Diederen <dd@crosstwine.com>
8115
8116 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8117 #ifdef typo.
8118
8fe2a369
ST
81192010-06-03 Sriraman Tallam <tmsriram@google.com>
8120
8121 PR gold/11658
8122 * output.cc
8123 (Output_section::Input_section_sort_entry::compare_section_ordering):
8124 Change to return non-zero correctly.
8125 (Output_section::Input_section_sort_section_order_index_compare
8126 ::operator()): Change to fix ambiguity in comparisons.
8127
6e9ba2ca
ST
81282010-06-01 Sriraman Tallam <tmsriram@google.com>
8129
8130 * gold.h (is_wildcard_string): New function.
8131 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8132 (Layout::layout_eh_frame): Ditto.
8133 (Layout::find_section_order_index): New method.
8134 (Layout::read_layout_from_file): New method.
8135 * layout.h (Layout::find_section_order_index): New method.
8136 (Layout::read_layout_from_file): New method.
8137 (Layout::input_section_position_): New private member.
8138 (Layout::input_section_glob_): New private member.
8139 * main.cc (main): Call read_layout_from_file here.
8140 * options.h (--section-ordering-file): New option.
8141 * output.cc (Output_section::input_section_order_specified_): New
8142 member.
8143 (Output_section::Output_section): Initialize new member.
8144 (Output_section::add_input_section): Add new parameter.
8145 Keep input sections when --section-ordering-file is used.
8146 (Output_section::set_final_data_size): Sort input sections when
8147 section ordering file is specified.
8148 (Output_section::Input_section_sort_entry): Add new parameter.
8149 Check sorting type.
8150 (Output_section::Input_section_sort_entry::compare_section_ordering):
8151 New method.
8152 (Output_section::Input_section_sort_compare::operator()): Change to
8153 consider section_order_index.
8154 (Output_section::Input_section_sort_init_fini_compare::operator()):
8155 Change to consider section_order_index.
8156 (Output_section::Input_section_sort_section_order_index_compare
8157 ::operator()): New method.
8158 (Output_section::sort_attached_input_sections): Change to sort
8159 according to section order when specified.
e1df38aa
NC
8160 (Output_section::add_input_section<32, true>): Add new parameter.
8161 (Output_section::add_input_section<64, true>): Add new parameter.
8162 (Output_section::add_input_section<32, false>): Add new parameter.
8163 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8164 * output.h (Output_section::add_input_section): Add new parameter.
8165 (Output_section::input_section_order_specified): New
8166 method.
8167 (Output_section::set_input_section_order_specified): New method.
8168 (Input_section::Input_section): Initialize section_order_index_.
8169 (Input_section::section_order_index): New method.
8170 (Input_section::set_section_order_index): New method.
8171 (Input_section::section_order_index_): New member.
8172 (Input_section::Input_section_sort_section_order_index_compare): New
8173 struct.
8174 (Output_section::input_section_order_specified_): New member.
8175 * script-sections.cc (is_wildcard_string): Delete and move modified
8176 method to gold.h.
8177 (Output_section_element_input::Output_section_element_input): Modify
8178 call to is_wildcard_string.
8179 (Output_section_element_input::Input_section_pattern
8180 ::Input_section_pattern): Ditto.
8181 (Output_section_element_input::Output_section_element_input): Ditto.
8182 * testsuite/Makefile.am (final_layout): New test case.
8183 * testsuite/Makefile.in: Regenerate.
8184 * testsuite/final_layout.cc: New file.
8185 * testsuite/final_layout.sh: New file.
8186
3537c84b
RÁE
81872010-06-01 Rafael Espindola <espindola@google.com>
8188
8189 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8190
105b6afd
RÁE
81912010-06-01 Rafael Espindola <espindola@google.com>
8192
8193 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8194 visibility of symbols.
8195
29e11421
DK
81962010-05-27 Doug Kwan <dougkwan@google.com>
8197
8198 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8199 from start of output section instead of address for a local symbol
8200 in a merged or relaxed section when doing a relocatable link.
8201
5e0f337e
RÁE
82022010-05-26 Rafael Espindola <espindola@google.com>
8203
703d02da 8204 PR 11604
5e0f337e
RÁE
8205 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8206 adding sections the garbage collector removed.
8207 * gold/testsuite/Makefile.am: Add test.
8208 * gold/testsuite/Makefile.in: Regenerate.
8209 * gold/testsuite/plugin_test_7.sh: New.
8210 * gold/testsuite/plugin_test_7_1.c: New.
8211 * gold/testsuite/plugin_test_7_2.c: New.
8212
f4187277
RÁE
82132010-05-26 Rafael Espindola <espindola@google.com>
8214
8215 * script-sections.cc (Output_section_definition::set_section_addresses):
8216 Check for --section-start.
8217
5c388529
DK
82182010-05-26 Doug Kwan <dougkwan@google.com>
8219
8220 * arm.cc (Arm_scan_relocatable_relocs): New class.
8221 (Target_arm::relocate_special_relocatable): New method.
8222 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8223 (Arm_relocate_functions::thumb_branch_common): Same.
8224 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8225 instead of Default_scan_relocatable_relocs.
8226 * target-reloc.h (relocate_for_relocatable): Let target handle
8227 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8228 * target.h (Sized_target::relocate_special_relocatable): New method.
8229
bca1c3ae
ILT
82302010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8231
8232 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8233
0439c796
DK
82342010-05-23 Doug Kwan <dougkwan@google.com>
8235
8236 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8237 instead of a cast.
8238 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8239 with a direct branch, not a conditional branch, to a stub.
8240 * merge.cc (Output_merge_base::record_input_section): New method
8241 defintion.
8242 (Output_merge_data::do_add_input_section): Record input section if
8243 keeps-input-sections flag is set.
8244 (Output_merge_string::do_add_input_section): Ditto.
8245 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8246 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8247 INPUT_SECTIONS_.
8248 (Output_merge_base::keeps_input_sections,
8249 Output_merge_base::set_keeps_input_sections,
8250 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8251 method definitions.
8252 (Output_merge_base::Input_sections): New type declaration.
8253 (Output_merge_base::input_sections_begin,
8254 Output_merge_base::input_sections_end,
8255 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8256 (Output_merge_base::bool keeps_input_sections_,
8257 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8258 Output_merge_base::input_sections_): New data members.
8259 (Output_merge_data::do_set_keeps_input_sections): New method
8260 defintion.
8261 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8262 * output.cc (Output_section::Input_section::relobj): Move method
8263 defintion from class declaration to here and handle merge sections.
8264 (Output_section::Input_section::shndx): Ditto.
8265 (Output_section::Output_section): Remove initializations of removed
8266 data members and initialize new data member LOOKUP_MAPS_.
8267 (Output_section::add_input_section): Set keeps-input-sections flag
8268 for a newly created merge output section as appropriate. Adjust code
8269 to use Output_section_lookup_maps class.
8270 (Output_section::add_relaxed_input_section): Adjst code for lookup
8271 maps code refactoring.
2e702c99 8272 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8273 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8274 class. If adding input section to a newly created merge output
8275 section fails, remove the new merge section.
8276 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8277 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8278 (Output_section::find_merge_section): Ditto.
0439c796 8279 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8280 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8281 Output_section_lookup_maps class.
8282 (Output_section::get_input_sections): Export merge sections. Adjust
8283 code to use Output_section_lookup_maps class.
8284 (Output_section:::add_script_input_section): Adjust code to use
8285 Output_section_lookup_maps class. Update lookup maps for merge
8286 sections also.
8287 (Output_section::discard_states): Use Output_section_lookup_maps.
8288 (Output_section::restore_states): Same.
8289 * output.h (Merge_section_properties): Move class defintion out of
8290 Output_section.
8291 (Output_section_lookup_maps): New class.
8292 (Output_section::Input_section::is_merge_section): New method
8293 defintion.
8294 (Output_section::Input_section::relobj): Move defintion out of class
8295 defintion. Declare method only.
8296 (Output_section::Input_section::shndx): Ditto.
8297 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8298 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8299 (Output_section::Merge_section_by_properties_map,
8300 Output_section::Output_section_data_by_input_section_map,
8301 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8302 Remove types.
2e702c99 8303 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8304 KEEPS_INPUT_SECTIONS.
8305 (Output_section::build_lookup_maps): New method declaration.
8306 (Output_section::merge_section_map_,
8307 Output_section::merge_section_by_properties_map_,
8308 Output_section::relaxed_input_section_map_,
8309 Output_section::is_relaxed_input_section_map_valid_): Remove data
8310 members.
8311 (Output_section::lookup_maps_): New data member.
8312
76295588
L
83132010-05-21 Doug Kwan <dougkwan@google.com>
8314
8315 PR gold/11619
8316 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8317 avoid a compilation error.
8318
d103a984
RÁE
83192010-05-19 Rafael Espindola <espindola@google.com>
8320
8321 * script-sections.cc (Output_section_definition::allocate_to_segment):
8322 Update the phdrs_list even when the output section is NULL.
8323 * testsuite/Makefile.am: Add test.
8324 * testsuite/Makefile.in: Regenerate.
8325 * testsuite/script_test_9.cc: New.
8326 * testsuite/script_test_9.sh: New.
8327 * testsuite/script_test_9.t: New.
8328
6625d24e
DK
83292010-05-19 Doug Kwan <dougkwan@google.com>
8330
8331 * arm.cc (Arm_input_section::original_size): New method.
8332 (Arm_input_section::do_addralign): Add a cast.
8333 (Arm_input_section::do_output_offset): Remove static cast.
8334 (Arm_input_section::original_addralign,
8335 Arm_input_section::original_size_): Change type to uint32_t.
8336 (Arm_input_section::init): Add safe casts for section alignment
8337 and size.
8338 (Arm_input_section::set_final_data_size): Do not set address and
8339 offset of stub table.
8340 (Arm_output_section::fix_exidx_coverage): Change use of of
8341 Output_section::Simple_input_section to that of
8342 Output_section::Input_section.
8343 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8344 except for the first pass.
8345 * output.cc (Output_section::get_input_sections): Change type of
8346 input_sections to std::list<Input_section>.
8347 (Output_section::add_script_input_section): Rename from
8348 Output_section::add_simple_input_section. Change type of SIS
8349 parameter from Simple_input_section to Input_section.
8350 * output.h (Output_section::Simple_input_section): Remove class.
8351 (Output_section::Input_section): Change class visibility to public.
8352 (Output_section::Input_section::addralign): Use stored alignments
8353 for special input sections if set.
8354 (Output_section::Input_section::set_addralign): New method.
8355 (Output_section::get_input_sections): Change parameter type from
8356 list of Simple_input_section to list of Input_section.
8357 (Output_section::add_script_input_section): Rename from
8358 Output_section::add_simple_input_section. Change first parameter's
8359 type from Simple_input_section to Input_section and remove the
8360 second and third parameters.
8361 * script-sections.cc (Input_section::Input_section_list): Change
8362 type to list of Output_section::Input_section/
8363 (Input_section_info::Input_section_info): Change parameter type of
8364 INPUT_SECTION to Output_section::Input_section.
8365 (Input_section_info::input_section): Change return type.
8366 (Input_section_info::input_section_): Change type to
8367 Output_section::Input_section.
8368 (Output_section_element_input::set_section_addresses): Adjust code
8369 to use Output_section::Input_section instead of
8370 Output_section::Simple_input_section. Adjust code for renaming
8371 of Output_section::add_simple_input_section.
8372 (Orphan_output_section::set_section_addresses): Ditto.
8373
e1e82ea4
RW
83742010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8375
8376 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8377 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8378
91e75c8a
RÁE
83792010-05-18 Rafael Espindola <espindola@google.com>
8380
8381 * options.cc (General_options::finalize): Handle -nostdlib.
8382 * options.h (nostdlib): New option.
8383 * script.cc (script_add_search_dir): Handle -nostdlib.
8384
da59ad79
DK
83852010-05-12 Doug Kwan <dougkwan@google.com>
8386
8387 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8388 attributes section only if there no attributes section after merging.
8389 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8390 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8391 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8392 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8393 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8394 and arm_attr_merge_7.stdout.
8395 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8396 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8397 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8398 arm_attr_merge_7b.o): New rules.
8399 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8400 arm_attr_merge_7
8401 * testsuite/Makefile.in: Regenerate.
8402 * testsuite/arm_attr_merge.sh: New file.
8403 * testsuite/arm_attr_merge_[67][ab].s: Same.
8404
3e01a7fd
NC
84052010-05-05 Nick Clifton <nickc@redhat.com>
8406
8407 * po/es.po: Updated Spanish translation.
8408
7ad2014a
L
84092010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8410
8411 * Makefile.am (install-exec-local): Properly install gold as
8412 default cross linker.
8413 * Makefile.in: Regenerated.
8414
4fda8867
NC
84152010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8416 Nick Clifton <nickc@redhat.com>
8417
8418 * configure.ac (install_as_default): Define and set to false
8419 unless --enable-gold or --enable-gold=both/gold has been
8420 specified.
8421 * configure: Regenerate.
8422
8423 * Makefile.am (install-exec-local): Install the executable as
8424 'ld.gold'. If install_as_default is true then also install it as
8425 'ld'.
8426 * Makefile.in: Regenerated.
8427
bd288ea2
ILT
84282010-04-24 Ian Lance Taylor <iant@google.com>
8429
8430 * layout.cc (Layout::layout_reloc): In relocatable link don't
8431 combine reloc sections for grouped sections.
8432
ef38fd8a
ST
84332010-04-23 Sriraman Tallam <tmsriram@google.com>
8434
8435 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8436 sections that are not ordinary to icf.
8437 * icf.cc (get_section_contents): Handle relocation pointing to section
8438 with no object or shndx information.
8439 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8440 * testsuite/Makefile.in: Regenerate.
8441 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8442 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8443
f6973bdc
ILT
84442010-04-22 Ian Lance Taylor <iant@google.com>
8445
8446 * expression.cc (Expression::Expression_eval_info): Add
8447 result_alignment_pointer field.
8448 (Expression::eval_with_dot): Add result_alignment_pointer
8449 parameter. Change all callers.
8450 (Expression::eval_maybe_dot): Likewise.
8451 (class Binary_expression): Add alignment_pointer parameter to
8452 left_value and right_value. Change all callers.
8453 (BINARY_EXPRESSION): Set result alignment.
8454 (class Trinary_expression): Add alignment_pointer parameter to
8455 arg2_value and arg3_value. Change all callers.
8456 (Trinary_cond::value): Set result alignment.
8457 (Max_expression::value, Min_expression::value): Likewise.
8458 (Align_expression::value): Likewise.
8459 * script-sections.cc (class Sections_element): Add dot_alignment
8460 parameter to set_section_addresses virtual function. Update
8461 instantiations.
8462 (class Output_section_element): Likewise.
8463 (Script_sections::create_segments): Add dot_alignment parameter.
8464 Change all callers.
8465 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8466 (Script_sections::set_phdrs_clause_addresses): Likewise.
8467 * script-sections.h: Update declarations.
8468 * script.h: Update declarations.
8469 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8470 min_p_align.
8471 * testsuite/script_test_3.t: Set large alignment.
8472 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8473 segment has expected alignment.
8474
9c9c98a5
NC
84752010-04-22 Nick Clifton <nickc@redhat.com>
8476
8477 * po/gold.pot: Updated by the Translation project.
8478 * po/vi.po: Updated Vietnamese translation.
8479
2253bfba
L
84802010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8481
8482 * testsuite/Makefile.am (check_PROGRAMS): Add
8483 icf_virtual_function_folding_test.
8484 * testsuite/Makefile.in: Regenerated.
8485
85fdf906
AH
84862010-04-15 Andrew Haley <aph@redhat.com>
8487
8488 * options.h (merge_exidx_entries): New option.
8489 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8490 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8491 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8492 (Target_arm::merge_exidx_entries): New function.
8493 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8494 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8495 to Arm_exidx_fixup constructor.
8496 Add new arg, merge_exidx_entries.
8497 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8498 Arm_output_section::fix_exidx_coverage.
8499
ce97fa81
ST
85002010-04-18 Sriraman Tallam <tmsriram@google.com>
8501
8502 * icf.cc (get_section_contents): Check for preemptible functions.
8503 Ignore addend when appropriate.
8504 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8505 section folded.
8506 (add_from_relobj): Check for section folded.
8507 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8508 * symtab.h (should_add_dynsym_entry): Add new parameter.
8509 * target-reloc.h (scan_relocs): Check for section folded.
8510 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8511 Check reloc types for function pointers in shared objects.
8512 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8513 case.
8514 (icf_preemptible_functions_test): New test case.
8515 (icf_string_merge_test): New test case.
8516 * testsuite.Makefile.in: Regenerate.
8517 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8518 bar_glob. Refactor code.
8519 * testsuite/icf_preemptible_functions_test.cc: New file.
8520 * testsuite/icf_preemptible_functions_test.sh: New file.
8521 * testsuite/icf_string_merge_test.cc: New file.
8522 * testsuite/icf_string_merge_test.sh: New file.
8523 * testsuite/icf_virtual_function_folding_test.cc: New file.
8524 * testsuite/icf_virtual_function_folding_test.sh: New file.
8525
04ceb17c
DK
85262010-04-14 Doug Kwan <dougkwan@google.com>
8527
8528 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8529 for local symbol recounting if we remove a section due to ICF.
8530 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8531 there are no regular objects in input.
8532
153e7da4
DK
85332010-04-13 Doug Kwan <dougkwan@google.com>
8534
8535 * arm.cc (Arm_input_section::set_final_data_size): Compute
8536 accurate final data size instead of using current data size.
8537
4dbd9faf
DK
85382010-04-09 Doug Kwan <dougkwan@google.com>
8539
8540 * layout.cc (Layout::choose_output_section): Handle script section
8541 types.
8542 (Layout::make_output_section_for_script): Add section type parameter.
8543 Handle script section types.
8544 * layout.h (Layout::make_output_section_for_script): Add section
8545 type parameter.
8546 * output.cc (Output_section::Output_section): Initialize data member
8547 is_noload_.
8548 (Output_section::do_reset_address_and_file_offset): Do not set address
8549 to 0 if section is a NOLOAD section.
8550 * output.h (Output_section::is_noload): New method.
8551 (Output_section::set_is_noload): Ditto.
8552 (Output_section::is_noload_): New data member.
8553 * script-c.h (Script_section_type): New enum type.
8554 (struct Parser_output_section_header): Add new file section_type.
8555 * script-sections.cc (Sections_element::output_section_name): Add
8556 parameter for returning script section type.
8557 (Output_section_definition::output_section_name): Ditto.
8558 (Output_section_definition::section_type)P; New method.
8559 (Output_section_definiton::script_section_type_name): Ditto.
8560 (Output_section_definition::script_section_type_): New data member.
8561 (Output_section_definition::Output_section_definition): Initialize
8562 data member Output_section_definition::script_section_type_.
8563 (Output_section_definition::create_sections): Pass script section type
8564 to Layout::make_output_section_for_script.
8565 (Output_section_definition::output_section_name): Return script
8566 section type to caller.
8567 (Output_section_definition::set_section_address): Do not advance
8568 dot value and load address if section type is NOLOAD. Set address
8569 of NOLOAD sections regardless of section flags.
8570 (Output_section_definition::print): Print section type if it is
8571 not SCRIPT_SECTION_TYPE_NONE.
8572 (Output_section_definition::section_type): New method.
8573 (Output_section_definition::script_section_type_name): Ditto.
8574 (Script_sections::output_section_name): Add new parameter
8575 PSECTION_TYPE for returning script section type. Pass it to
8576 section elements. Handle discard sections.
8577 (Sort_output_sections::operator()): Handle NOLOAD sections.
8578 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8579 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8580 returning script section type.
8581 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8582 INFO and NOLOAD.
8583 * yyscript.y (union): Add new field SECTION_TYPE.
8584 (COPY, DSECT, INFO, NOLOAD): New tokens.
8585 (opt_address_and_section_type): Change type to output_section_header.
8586 (section_type): New non-terminal
8587 (section_header): Handle section type.
2253bfba 8588 (opt_address_and_section_type): Return section type value.
4dbd9faf 8589
721ea635
L
85902010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8591
8592 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8593 * testsuite/plugin_common_test_2.c (foo): Likewise.
8594
6bf924b0
DK
85952010-04-08 Doug Kwan <dougkwan@google.com>
8596
8597 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8598 Output_merge_data.
8599 * output.cc (Output_section::add_merge_input_section): Simplify
8600 code and return status of Output_merge_base::add_input_section.
e1df38aa 8601 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8602 returns true.
8603
24af6f92
DK
86042010-04-07 Doug Kwan <dougkwan@google.com>
8605
8606 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8607 if section is marked as containing instructions but has no mapping
8608 symbols.
8609 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8610 correct section index.
8611 (Arm_relobj::find_linked_text_section): Ditto.
8612
00698fc5
CC
86132010-04-07 Cary Coutant <ccoutant@google.com>
8614
8615 * archive.cc (include_member): Destroy Read_symbols_data object before
8616 releasing file.
8617 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8618 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8619 (Read_symbols_data::~Read_symbols_data) New destructor.
8620 (Section_relocs::Section_relocs) New constructor.
8621 (Section_relocs::~Section_relocs) New destructor.
8622 (Read_relocs_data::Read_relocs_data) New constructor.
8623 (Read_relocs_data::~Read_relocs_data) New destructor.
8624 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8625 pointers to NULL after deleting.
8626
7296d933
DK
86272010-04-07 Doug Kwan <dougkwan@google.com>
8628
8629 * arm.cc: Replace "endianity" with "endianness" in comments.
8630 (Arm_exidx_cantunwind): Ditto.
8631 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8632 (Arm_relobj::merge_flags_and_attributes): New method.
8633 (Arm_relobj::merge_flags_and_attributes_): New data member.
8634 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8635 (Arm_relobj::scan_sections_for_stubs): Ditto.
8636 (Arm_relobj::do_read_symbols): Check to see if we really want to
8637 merge processor-specific flags and attributes. Exit early if
8638 an object is empty except for section names and the undefined symbol.
8639 (Target_arm::do_finalize_sections): Move check for ELF format to
8640 Arm_relobj::do_read_symbols. Merge processor specific flags and
8641 attributes from a regular object only when we have determined that
8642 it is aapropriate. Do not create an .ARM.attributes section in
8643 output if there is no regular input object.
8644 (Target_arm::merge_processor_specific_flags): Check
8645 --warn-mismatch before printing any error.
8646 (Target_arm::merge_object_attributes): Ditto.
8647 * gold.cc (queue_middle_tasks): Handle the case in which there is
8648 no regular object in input.
8649 * options.cc (General_options::parse_EB): New method.
8650 (General_options::parse_EL): Same.
8651 (General_options::General_options): Initialize endianness_.
8652 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8653 New options.
8654 (General_options::Endianness): New enum.
8655 (General_options::endianness): New method.
8656 (General_options::endianness_): New data member.
8657 * parameters.cc (Parameters::set_options): Check target endianness.
8658 (Parameters::set_target_once): Ditto.
8659 (Parameters::check_target_endianness): New method.
8660 (parameters_force_valid_target): If either -EL or -EB is specified,
8661 use it to define endianness of default target.
8662 * parameters.h (Parameters::check_target_endianness): New method
8663 declaration.
8664 * target.h (class Target): Change "endianity" to "endianness"
8665 in comments.
8666
efc8d4f2
RW
86672010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8668
8669 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8670 * configure: Regenerate.
8671 * Makefile.in: Regenerate.
8672 * testsuite/Makefile.in: Regenerate.
8673
be234d88
CC
86742010-04-06 Cary Coutant <ccoutant@google.com>
8675
8676 gcc PR lto/42757
8677 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8678 prevailing definitions of common symbols.
8679 * testsuite/plugin_test_6.sh: New test case.
8680 * testsuite/plugin_common_test_1.c: New test case.
8681 * testsuite/plugin_common_test_2.c: New test case.
8682 * testsuite/Makefile.am (plugin_test_6): New test case.
8683 * testsuite/Makefile.in: Regenerate.
8684
bd32c6bd
NC
86852010-04-06 Nick Clifton <nickc@redhat.com>
8686
8687 * po/vi.po: New Vietnamese translation.
8688
323c532f
DK
86892010-03-30 Doug Kwan <dougkwan@google.com>
8690
8691 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8692
4fcd97eb
DK
86932010-03-25 Doug Kwan <dougkwan@google.com>
8694
8695 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8696 to avoid a conversion warning on a 32-bit host.
8697
4ebf39db
ILT
86982010-03-24 Ian Lance Taylor <iant@google.com>
8699
8700 * testsuite/script_test_3.t: Add a TLS segment.
8701 * testsuite/Makefile.am (check_PROGRAMS): Add
8702 tls_phdrs_script_test.
8703 (tls_phdrs_script_test_SOURCES): Define.
8704 (tls_phdrs_script_test_DEPENDENCIES): Define.
8705 (tls_phdrs_script_test_LDFLAGS): Define.
8706 (tls_phdrs_script_test_LDADD): Define.
8707 * testsuite/Makefile.in: Rebuild.
8708
4a599bdd
CC
87092010-03-23 Cary Coutant <ccoutant@google.com>
8710
8711 * fileread.cc (find_or_make_view): Fix comment.
8712
6c93b22c
ILT
87132010-03-23 Ian Lance Taylor <iant@google.com>
8714
8715 * script-sections.cc (class Orphan_section_placement): Define
8716 PLACE_TLS and PLACE_TLS_BSS.
8717 (Orphan_section_placement::Orphan_section_placement): Initialize
8718 new places.
8719 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8720 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8721 (tls_script_test_SOURCES): Define.
8722 (tls_script_test_DEPENDENCIES): Define.
8723 (tls_script_test_LDFLAGS): Define.
8724 (tls_script_test_LDADD): Define.
8725 * testsuite/Makefile.in: Rebuild.
8726
a2c7281b
DK
87272010-03-22 Doug Kwan <dougkwan@google.com>
8728
8729 * arm.cc (Arm_relocate_functions::abs8,
8730 Arm_relocate_functions::abs16): Use correct check for overflow
8731 specified in the ARM ELF specs.
8732 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8733 target of a BLX instruction specially.
8734 (Reloc_stub::stub_type_for_reloc): Ditto.
8735 (Relocate::relocate): Use symbolic names instead of numeric relocation
8736 codes to report error.
8737 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8738 workaround.
8739 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8740 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8741 thumb2_blx_out_of_range.stdout
8742 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8743 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8744 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8745 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8746 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8747 thumb2_blx_in_range, thumb2_blx_in_range.o,
8748 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8749 thumb2_blx_out_of_range.o): New rules.
2e702c99 8750 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
8751 thumb2_blx_in_range and thumb2_blx_out_of_range.
8752 * testsuite/Makefile.in: Regenerate.
8753 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8754 * testsuite/thumb_blx_in_range.s: New file.
8755 * testsuite/thumb_blx_out_of_range.s: New file.
8756
b0193076
RÁE
87572010-03-22 Rafael Espindola <espindola@google.com>
8758
8759 * archive.cc (Should_include): Move to archive.h.
8760 (should_include_member): Make it a member of Archive.
8761 (Lib_group): New.
8762 (Add_lib_group_symbols): New.
8763 * archive.h: Include options.h.
8764 (Archive_member): Moved from Archive.
8765 (Should_include): Moved from archive.cc.
8766 (Lib_group): New.
8767 (Add_lib_group_symbols): New.
8768 * dynobj.cc (do_should_include_member): New.
8769 * dynobj.h (do_should_include_member): New.
8770 * gold.cc (queue_initial_tasks): Update call to queue.
8771 * main.cc (main): Print lib group stats.
8772 * object.cc (do_should_include_member): New.
8773 * object.h: Include archive.h.
8774 (Object::should_include_member): New.
8775 (Object::do_should_include_member): New.
8776 (Sized_relobj::do_should_include_member): New.
8777 * options.cc (General_options::parse_start_lib): New.
8778 (General_options::parse_end_lib): New.
8779 (Input_arguments::add_file): Handle lib groups.
8780 (Input_arguments::start_group): Check we are not in a lib.
8781 (Input_arguments::start_lib): New.
8782 (Input_arguments::end_lib): New.
8783 * options.h (General_options): Add start_lib and end_lib.
8784 (Input_argument::lib_): New.
8785 (Input_argument::lib): New.
8786 (Input_argument::is_lib): New.
8787 (Input_file_lib): New.
8788 (Input_arguments::in_lib_): New.
8789 (Input_arguments::in_lib): New.
8790 (Input_arguments::start_lib): New.
8791 (Input_arguments::end_lib_): New.
8792 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
8793 in unused members as preempted.
8794 (Sized_pluginobj::do_should_include_member): New.
8795 * plugin.h (Sized_pluginobj::do_should_include_member): New.
8796 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
8797 return the blocker.
8798 (Read_symbols::do_whole_lib_group): New.
8799 (Read_symbols::do_lib_group): New.
8800 (Read_symbols::do_read_symbols): Handle lib groups.
8801 (Read_symbols::get_name): Handle lib groups.
8802 * readsyms.h (Read_symbols): Add an archive member pointer.
8803 (Read_symbols::do_whole_lib_group): New.
8804 (Read_symbols::do_lib_group): New.
8805 (Read_symbols::member_): New.
8806 * script.cc (read_input_script): Update call to queue_soon.
8807
d099120c
DK
88082010-03-19 Doug Kwan <dougkwan@google.com>
8809
8810 * arm.cc (Stub_table::Stub_table): Initialize new data members
8811 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8812 (Stub_table::add_reloc_stub): Assign stub offset and update
8813 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
8814 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
8815 New data members.
2e702c99 8816 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
8817 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
8818 instead of going over all reloc stubs.
2e702c99 8819 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
8820 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8821 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 8822 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
8823 Stringpool_template::offset_.
8824 * stringpool.h (Stringpool_template::set_no_zero_null): Set
8825 Stringpool_template::offset_ to zero.
8826
1aa37384
DK
88272010-03-15 Doug Kwan <dougkwan@google.com>
8828
8829 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
8830 offset_.
8831 (Stringpool_template::new_key_offset): New method.
8832 (Stringpool_template::add_string): Assign offsets when adding new
8833 strings.
8834 (Stringpool_template::set_string_offsets): Do not set string offsets
8835 when not optimizing.
8836 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
8837 member size_.
2e702c99
RM
8838 (Chunked_vector::clear): Clear size_.
8839 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
8840 (Chunked_vector::size): Return size_.
8841 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 8842 (Chunked_vector::size_): New data member.
1aa37384
DK
8843 (Stringpool_template::set_no_zero_null): Assert string set is empty.
8844 (Stringpool_template::new_key_offset): New method declaration.
8845 (Stringpool_template::offset_): New data member.
8846
b672b057
RÁE
88472010-03-15 Rafael Espindola <espindola@google.com>
8848
8849 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
8850 Add_symbols' constructor.
8851 * readsyms.h (Add_symbols): Remove the input_group member.
8852
b6848d3c
ILT
88532010-03-10 Ian Lance Taylor <iant@google.com>
8854
8855 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
8856 target to ask whether a reference to a symbol requires a stack
8857 split.
8858 * target.h (Target::is_call_to_non_split): New function.
8859 (Target::do_is_call_to_non_split): Declare virtual function.
8860 * target.cc: Include "symtab.h".
8861 (Target::do_is_call_to_non_split): New function.
8862 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
8863
a2a5469e
CC
88642010-03-10 Cary Coutant <ccoutant@google.com>
8865
8866 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
8867 (File_read::open[1]): Remove initial mapping of whole_file_view_.
8868 (File_read::open[2]): Add whole_file_view_ to list of views.
8869 (File_read::make_view): Remove test of whole_file_view_.
8870 (File_read::find_or_make_view): Create whole_file_view_ if
8871 necessary.
8872 (File_read::clear_views): Replace bool parameter with enum;
8873 adjust all callers. Don't delete views with permanent data;
8874 do delete cached views and views from archives if
8875 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
8876 if clearing the corresponding view.
8877 * fileread.h (File_read::Clear_views_mode): New enum.
8878 (File_read::View::is_permanent_view): New method.
8879 (File_read::clear_views): Replace bool parameter
8880 with enum; adjust all callers.
8881 * options.h (General_options): Change keep_files_mapped option;
8882 add map_whole_files.
8883 * readsyms.cc (Add_symbols::run): Delete sd_ object before
8884 releasing the file.
8885 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
8886 the file.
8887
8861f32b
DM
88882010-03-10 David S. Miller <davem@davemloft.net>
8889
8890 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
8891
d62d0f5f
ST
88922010-03-09 Sriraman Tallam <tmsriram@google.com>
8893
8894 * icf.cc (get_section_contents): Add '@' marker after processing the
8895 merge reloc.
8896
9177756d
DK
88972010-03-08 Doug Kwan <dougkwan@google.com>
8898
8899 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
8900 due to a conversion warning.
8901 (Arm_relobj::update_output_local_symbol_count): Check for local
8902 symbol with unset output index.
8903
9e9e071b
ILT
89042010-03-05 Ian Lance Taylor <iant@google.com>
8905
8906 * options.h (class General_options): Add --spare-dynamic-tags.
8907 * output.cc (Output_data_dynamic::set_final_data_size): Implement
8908 --spare-dynamic-tags.
8909
a81ee015
ILT
89102010-03-05 Ian Lance Taylor <iant@google.com>
8911
8912 * incremental.cc: Include "libiberty.h".
8913
44ec90b9
RO
89142010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
8915
8916 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
8917 function, is_info_ member.
8918 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
8919 (Versions::Versions): Update caller.
8920 (Versions::define_base_version): Likewise.
8921 (Versions::add_def): Likewise.
8922
0897ed3b
ST
89232010-03-03 Sriraman Tallam <tmsriram@google.com>
8924
8925 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
8926 (Scan::possible_function_pointer_reloc): New function.
8927 (Scan::local_reloc_may_be_function_pointer): Change to call
8928 possible_function_pointer_reloc.
8929 (Scan::global_reloc_may_be_function_pointer): Ditto.
8930 * icf.h (Icf::check_section_for_function_pointers): Change to reject
8931 relocations in ".data.rel.ro._ZTV" section.
8932 * testsuite/icf_safe_so_test.sh: Change to pass i386.
8933 * testsuite/icf_safe_so_test.cc: Ditto.
8934 * testsuite/icf_safe_test.cc: Ditto.
8935 * testsuite/icf_safe_test.sh: Ditto.
8936
d3bbad62
ILT
89372010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8938 Ian Lance Taylor <iant@google.com>
8939
8940 * target-reloc.h (relocate_section): Check the symbol table index
8941 for -1U before setting the local symbol index.
8942 (scan_relocatable_relocs): If copying the relocation, record that
8943 the local symbol is required.
8944 * object.h (Symbol_value::is_output_symtab_index_set): New
8945 function.
8946 (Symbol_value::may_be_discarded_from_output_symtab): New
8947 function.
8948 (Symbol_value::has_output_symtab_entry): New function.
8949 (Symbol_value::needs_output_symtab_entry): Remove.
8950 (Symbol_value::output_symtab_index): Make sure the symbol index is
8951 set.
8952 (Symbol_value::set_output_symtab_index): Make sure the symbol
8953 index is not set. Make sure the new index is valid.
8954 (Symbol_value::set_must_have_output_symtab_entry): New function.
8955 (Symbol_value::has_output_dynsym_entry): New function.
8956 (Symbol_value::set_output_dynsym_index): Make sure the new index
8957 is valid.
8958 (Sized_relobj::set_must_have_output_symtab_entry): New function.
8959 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
8960 local symbol if permitted.
8961 (Sized_relobj::do_finalize_local_symbols): Call
8962 is_output_symtab_index_set rather than needs_output_symtab_entry.
8963 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
8964 rather than needs_output_symtab_entry. Call
8965 has_output_dynsym_entry rather than needs_output_dynsym_entry.
8966 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
8967 is_output_symtab_index_set rather than needs_output_symtab_entry.
8968 * testsuite/discard_locals_relocatable_test.c: New file.
8969 * testsuite/discard_locals_test.sh: Test -r.
8970 * testsuite/Makefile.am (check_DATA): Add
8971 discard_locals_relocatable_test1.syms,
8972 discard_local_relocatable_test2.syms.
8973 (MOSTLYCLEANFILES): Likewise. Also add
8974 discard_locals_relocatable_test1.lout and
8975 discard_locals_relocatable_test2.out.
8976 (discard_locals_relocatable_test1.syms): New target.
8977 (discard_locals_relocatable_test.o): New target.
8978 (discard_locals_relocatable_test1.out): New target.
8979 (discard_locals_relocatable_test2.syms): New target.
8980 (discard_locals_relocatable_test2.out): New target.
8981 (various): Add missing ../ld-new dependencies.
8982 * testsuite/Makefile.in: Rebuild.
8983
7e8ccf26
NC
89842010-03-03 Nick Clifton <nickc@redhat.com>
8985
8986 * po/fi.po: New Finnish translation.
8987
2a0ff005
DK
89882010-03-01 Doug Kwan <dougkwan@google.com>
8989
8990 * layout.cc (Layout::Layout): Force section types of .init_array*,
8991 .preinit_array* and .fini_array* sections.
8992 * output.cc (Output_section::Input_section_sort_entry::has_priority):
8993 Fix check of return value of std::string::find.().
8994 (Output_section::Input_section_sort_compare::operator()): Remove
8995 comment about .init_array.
8996 (Output_section::Input_section_sort_init_fini_compare::operator()):
8997 New method.
8998 (Output_section::sort_attached_input_sections): Handle .init_array
8999 and .fini_array specially.
9000 * output.h (Output_section::Inut_section_sort_compare): Update
9001 comment.
9002 (Output_section::Input_section_sort_init_fini_compare): New struct.
9003
c3e4ae29
DK
90042010-02-26 Doug Kwan <dougkwan@google.com>
9005
9006 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9007 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9008 * testsuite/debug_msg.sh: Avoid matching source line number for
9009 use of global variable undef_int.
9010
2fd9ae7a
DK
90112010-02-26 Doug Kwan <dougkwan@google.com>
9012
9013 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9014 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9015 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9016 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9017 * options.cc (General_options::General_options): Initialize member
9018 fix_v4bx_.
9019 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9020 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9021 and rm_no_fix_v4bx.stdout
9022 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9023 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9024 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9025 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9026 and arm_no_fix_v4bx.
9027 * Makefile.in: Regenerate.
9028 * testsuite/arm_fix_v4bx.s: New file.
9029 * testsuite/arm_fix_v4bx.sh: Ditto.
9030
67ec7d0b
DK
90312010-02-24 Doug Kwan <dougkwan@google.com>
9032
9033 * arm.cc (Target_arm::got_section): Make the .got section the first
9034 non RELRO section in the data segment.
9035 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9036 suffixes of section names.
9037
10165461
DK
90382010-02-24 Doug Kwan <dougkwan@google.com>
9039
9040 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9041 flags and attributes merging if an input file is a binary file.
9042 * fileread.cc (Input_file::open): Record format of original file.
9043 * fileread.h (Input_file::Format): New enum type.
2e702c99 9044 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9045 (Input_file::format): New method definition.
9046 (Input_file::format_):: New data member.
9047
4a54abbb
DK
90482010-02-24 Doug Kwan <dougkwan@google.com>
9049
9050 * arm.cc (Arm_output_data_got): New class.
9051 (ARM_TCB_SIZE): New constant
9052 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9053 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9054 If user uses a script with a SECTIONS clause, issue only a warning
9055 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9056 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9057 garbage collection.
9058 (Target_arm::got_mode_index_entry): Handle static linking.
9059 (Target_arm::Scan::local): Ditto.
9060 (Target_arm::Scan::global): Ditto.
9061 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9062 all incorrectly implemented relocations.
e1df38aa 9063 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9064 Arm_output_section::fix_exidx_coverage.
9065 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9066 from ".ARM.exidx." and ".ARM.extab.".
9067
ca419a6f
ILT
90682010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9069
9070 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9071 section if it does not already exist.
9072 * attributes.cc (Attributes_section_data::Attributes_section_data):
9073 Don't crash if size is zero.
9074
135b9c78
ILT
90752010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9076 Ian Lance Taylor <iant@google.com>
9077
9078 * gold.cc (queue_middle_tasks): If no input files were opened,
9079 exit.
9080 * workqueue.h (Task_function::Task_function): Assert that there is
9081 a blocker.
9082
bb0bfe4f
DK
90832010-02-22 Doug Kwan <dougkwan@google.com>
9084
9085 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9086 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9087 types to avoid warnings due to different uint64_t implementations
9088 on different hosts.
9089
2a2b6d42
DK
90902010-02-21 Doug Kwan <dougkwan@google.com>
9091
9092 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9093 handling of the maximum backward branch offset.
2e702c99 9094 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9095 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9096 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9097 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9098 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9099 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9100 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9101 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9102 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9103 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9104 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9105 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9106 thumb2_bl_out_of_range.o): New rules.
9107 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9108 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9109 thumb2_bl_out_of_range
9110 * testsuite/Makefile.in: Regenerate.
9111 * testsuite/arm_bl_in_range.s: New file.
9112 * testsuite/arm_bl_out_of_range.s: Ditto.
9113 * testsuite/arm_branch_in_range.sh: Ditto.
9114 * testsuite/arm_branch_range.t: Ditto.
9115 * testsuite/thumb2_branch_range.t: Ditto.
9116 * testsuite/thumb_bl_in_range.s: Ditto.
9117 * testsuite/thumb_bl_out_of_range.s: Ditto.
9118 * testsuite/thumb_branch_range.t: Ditto.
9119
b487ad64
ST
91202010-02-20 Sriraman Tallam <tmsriram@google.com>
9121
9122 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9123 Add reloc offset information.
9124 * icf.cc (get_section_contents): Change iterators to point to the new
9125 vectors. Add reloc offset information to the contents.
9126 * icf.h (Icf::Sections_reachable_info): New typedef.
9127 (Icf::Sections_reachable_list): New typedef.
9128 (Icf::Offset_info): New typedef.
9129 (Icf::Reloc_info): New struct typedef.
9130 (Icf::Reloc_info_list): New typedef.
9131 (Icf::symbol_reloc_list): Delete method.
9132 (Icf::addend_reloc_list): Delete method.
9133 (Icf::section_reloc_list): Delete method.
9134 (Icf::reloc_info_list): New method.
9135 (Icf::reloc_info_list_): New member.
9136
f96accdf
DK
91372010-02-19 Doug Kwan <dougkwan@google.com>
9138
9139 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9140 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9141 * arm.cc (Arm_relocation_functions): New forward declaration.
9142 (Target_arm::Target_arm): Initialize new data members
9143 got_mod_index_offset_ and tls_base_symbol_defined_.
9144 (Target_arm::Relocate::relocate_tls): New method.
9145 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9146 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9147 New methods.
2e702c99 9148 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9149 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9150 (Target_arm::got_mod_index_offset_,
9151 Target_arm::tls_base_symbol_defined_): New data members.
9152 (Target_arm::Scan::local, Target::Scan::global,
9153 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9154 relocations.
9155
c8761b9a
DK
91562010-02-18 Doug Kwan <dougkwan@google.com>
9157
9158 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9159 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9160 text section as a parameter becuase some broken tools may not set
9161 the link in section header.
9162 (Target_arm::has_got_section): New method.
9163 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9164 without any mapping symbol as data only. Remove warning.
9165 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9166 link in its section header, try to discover the link by inspecting the
9167 REL31 relocation at the beginning of the section.
9168 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9169 in error message.
9170 (Target_arm::Scan::global): Treat any reference to the symbol
9171 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9172
21bb3914
ST
91732010-02-12 Sriraman Tallam <tmsriram@google.com>
9174
9175 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9176 (Scan::global_reloc_may_be_function_pointer): New function.
9177 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9178 (Scan::global_reloc_may_be_function_pointer): New function.
9179 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9180 (Scan::global_reloc_may_be_function_pointer): New function.
9181 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9182 (Scan::global_reloc_may_be_function_pointer): New function.
9183 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9184 (Scan::global_reloc_may_be_function_pointer): New function.
9185 (Scan::possible_function_pointer_reloc): New function.
9186 (Target_x86_64::can_check_for_function_pointers): New function.
9187 * gc.h (gc_process_relocs): Scan relocation types to determine if
9188 function pointers were taken for targets that support it.
9189 * icf.cc (Icf::find_identical_sections): Include functions for
9190 folding in safe ICF whose pointer is not taken.
9191 * icf.h (Secn_fptr_taken_set): New typedef.
9192 (fptr_section_id_): New member.
9193 (section_has_function_pointers): New function.
9194 (set_section_has_function_pointers): New function.
9195 (check_section_for_function_pointers): New function.
9196 * options.h: Fix comment for safe ICF option.
9197 * target.h (can_check_for_function_pointers): New function.
9198 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9199 Modify icf_safe_test for X86-64.
9200 * testsuite/Makefile.in: Regenerate.
9201 * testsuite/icf_safe_so_test.cc: New file.
9202 * testsuite/icf_safe_so_test.sh: New file.
9203 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9204 (main): Change to take pointer to function kept_func_3.
9205 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9206 folding is done correctly for X86-64.
9207
0da6fa6c
DM
92082010-02-12 David S. Miller <davem@davemloft.net>
9209
9210 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9211 is_symbolless parameter.
9212 (Output_reloc<SHT_REL>::is_symbolless): New.
9213 (Output_reloc<SHT_REL>::is_symbolless_): New.
9214 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9215 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9216 (Output_reloc<SHT_RELA>::is_symbolless): New.
9217 (Output_data_reloc::add_global): Handle is_symbolless.
9218 (Output_data_reloc::add_global_relative): Likewise.
9219 (Output_data_reloc::add_local): Likewise.
9220 (Output_data_reloc::add_local_relative): Likewise.
9221 (Output_data_reloc::add_symbolless_global_addend): New.
9222 (Output_data_reloc::add_symbolless_local_addend): New.
9223 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9224 is_symbolless.
9225 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9226 instead of ->is_relative_
9227 (Output_reloc::write): Likewise.
9228 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9229 (Output_reloc::write_rel): Simplify.
9230
9231 * sparc.cc (Target_sparc::Scan::local): Use
9232 ->add_symbolless_local_addend as needed.
9233 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9234 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9235 based upon relocation offset.
9236
e4782e83
DK
92372010-02-11 Doug Kwan <dougkwan@google.com>
9238
9239 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9240 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9241 beginning of function.
9242 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9243 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9244 parameter is_32bit in calls to should_apply_static_reloc.
9245 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9246 (check_DATA): Add arm_abs_global.stdout.
9247 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9248 arm_abs_global.stdout): New rules.
9249 (MOSTLLYCLEANFILES): Add arm_abs_global
9250 * Makefile.in: Regenerate.
9251 * testsuite/arm_abs_global.s: New file.
9252 * testsuite/arm_abs_global.sh: Ditto.
9253 * testsuite/arm_abs_lib.s: Ditto.
9254
93ceb764
ILT
92552010-02-11 Ian Lance Taylor <iant@google.com>
9256
9257 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9258 Read_relocs task.
9259 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9260 Allocate_commons_task first.
9261 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9262 task, rather than symtab_lock_.
9263 (Gc_process_relocs::~Gc_process_relocs): New function.
9264 (Gc_process_relocs::is_runnable): Check this_blocker_.
9265 (Gc_process_relocs::locks): Use next_blocker_ rather than
9266 blocker_.
9267 (Scan_relocs::~Scan_relocs): New function.
9268 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9269 symtab_lock_.
9270 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9271 next_blocker_.
9272 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9273 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9274 constructor accordingly.
9275 (class Gc_process_relocs): Likewise.
9276 (class Scan_relocs): Likewise.
9277 * common.h (class Allocate_commons_task): Remove symtab_lock_
9278 field, and corresponding constructor parameter.
9279 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9280 symtab_lock_.
9281 (Allocate_commons_task::locks): Likewise.
9282
114dfbe1
ILT
92832010-02-11 Ian Lance Taylor <iant@google.com>
9284
9285 * gold-threads.h (class Once): Define.
9286 (class Initialize_lock): Rewrite as child of Once.
9287 * gold-threads.cc (class Once_initialize): Define.
9288 (once_pointer_control): New static variable.
9289 (once_pointer, once_arg): New static variables.
9290 (c_run_once): New static function.
9291 (Once::Once, Once::run_once, Once::internal_run): New functions.
9292 (class Initialize_lock_once): Remove.
9293 (initialize_lock_control): Remove.
9294 (initialize_lock_pointer): Remove.
9295 (initialize_lock_once): Remove.
9296 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9297 (Initialize_lock::initialize): Rewrite.
9298 (Initialize_lock::do_run_once): New function.
9299 * archive.cc (Archive::interpret_header): Only clear name if it is
9300 not already empty.
9301 * fileread.cc: Include "gold-threads.h"
9302 (file_counts_lock): New static variable.
9303 (file_counts_initialize_lock): Likewise.
9304 (File_read::release): Only increment counts when using --stats.
9305 Use a lock around the increment.
9306 * parameters.cc (class Set_parameters_target_once): Define.
9307 (set_parameters_target_once): New static variable.
9308 (Parameters::Parameters): Move here from parameters.h.
9309 (Parameters::set_target): Rewrite.
9310 (Parameters::set_target_once): New function.
9311 (Parameters::clear_target): Move here and rewrite.
9312 * parameters.h (class Parameters): Update declarations. Add
9313 set_parameters_target_once_ field.
9314 (Parameters::Parameters): Move to parameters.cc.
9315 (Parameters::clear_target): Likewise.
9316 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9317 task.
9318 (Start_group::~Start_group): New function.
9319 (Start_group::is_runnable): New function.
9320 (Start_group::locks, Start_group::run): New functions.
9321 (Finish_group::run): Change saw_undefined to size_t.
9322 * readsyms.h (class Start_group): Define.
9323 (class Finish_group): Change saw_undefined_ field to size_t.
9324 (Finish_group::Finish_group): Remove saw_undefined and
9325 this_blocker parameters. Change all callers.
9326 (Finish_group::set_saw_undefined): New function.
9327 (Finish_group::set_blocker): New function.
9328 * symtab.h (class Symbol_table): Change saw_undefined to return
9329 size_t. Change saw_undefined_ field to size_t.
9330 * target-select.cc (Set_target_once::do_run_once): New function.
9331 (Target_selector::Target_selector): Initialize set_target_once_
9332 field. Don't initialize lock_ and initialize_lock_ fields.
9333 (Target_selector::instantiate_target): Rewrite.
9334 (Target_selector::set_target): New function.
9335 * target-select.h (class Set_target_once): Define.
9336 (class Target_selector): Update declarations. Make
9337 Set_target_once a friend. Remove lock_ and initialize_lock_
9338 fields. Add set_target_once_ field.
9339
fa17a3f4
ILT
93402010-02-10 Ian Lance Taylor <iant@google.com>
9341
9342 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9343 queueing any tasks.
9344 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9345 (queue_middle_tasks): Add all blockers before queueing any tasks.
9346 (queue_final_tasks): Likewise.
9347 * token.h (Task_token::add_blockers): New function.
9348 * object.h (Input_objects::number_of_relobjs): New function.
9349
c7177d31
ILT
93502010-02-10 Ian Lance Taylor <iant@google.com>
9351
5de0e392
ILT
9352 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9353 shared, not if not position independent.
9354 * x86_64.cc (Relocate::relocate_tls): Likewise.
9355 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9356 (tls_pie_pic_test): New target.
9357 * testsuite/Makefile.in: Rebuild.
9358
c7177d31
ILT
9359 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9360 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9361 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9362 * testsuite/Makefile.in: Rebuild.
9363
684b268a
DM
93642010-02-09 David S. Miller <davem@davemloft.net>
9365
9366 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9367 R_SPARC_RELATIVE using ->add_local_relative().
9368 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9369
612a8d3d
DM
9370 * output.h (Output_data_dynamic::add_section_size): New method
9371 that takes two Output_data objects.
9372 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9373 entry param. Handle it in initializers.
9374 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9375 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9376 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9377 arg.
9378 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9379 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9380 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9381 for dynrel_includes_plt.
9382 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9383 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9384 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9385 before .rela.plt
9386 (Target_sparc::do_finalize_sections): Update to pass true for
9387 dynrel_includes_plt.
9388 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9389 output before .rela.plt
9390 (Target_powerpc::do_finalize_sections): Update to pass true for
9391 dynrel_includes_plt when 32-bit.
9392
cb1be87e
DK
93932010-02-08 Doug Kwan <dougkwan@google.com>
9394
9395 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9396 method.
9397 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9398 Arm_relobj::scan_section_for_cortex_a8_stubs,
9399 Arm_relobj::do_relocation_section): Instead of calling
9400 Output_section::output_address, use faster
9401 Arm_relobj::simple_input_section_output_address.
9402
705b5121
DM
94032010-02-08 David S. Miller <davem@davemloft.net>
9404
9405 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9406 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9407 relocation helper function.
9408
024c4466
DM
9409 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9410 just like R_SPARC_GOT{10,13,22}.
9411 (Target_sparc::Scan::local): Likewise.
9412 (Target_sparc::Relocate:relocate): Likewise.
9413
9109c078
ILT
94142010-02-06 Ian Lance Taylor <iant@google.com>
9415
9416 * configure.ac: Rewrite targetobjs duplicate removal code to use
9417 only shell constructs.
9418 * configure: Rebuild.
9419
cf846138
DK
94202010-02-05 Doug Kwan <dougkwan@google.com>
9421
9422 PR 11247
9423 * arm.cc (Arm_relobj::section_is_scannable): New method.
9424 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9425 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9426
6cfaf60b
DK
94272010-02-04 Doug Kwan <dougkwan@google.com>
9428
9429 PR 11247
9430 * arm-reloc-property.cc (cstdio): Include.
9431 * configure.ac (targetobjs): Remove duplicates.
9432 * configure: Regenerate.
9433 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9434 big and little endian version for a given address size.
9435
5c57f1be
DK
94362010-02-03 Doug Kwan <dougkwan@google.com>
9437
9438 * arm-reloc-property.cc
9439 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9440 definition.
9441 * arm-reloc-property.h
9442 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9443 New method definition.
9444 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9445 declaration.
9446 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9447 overflow to N.
9448 (GOT_PREL): Change implemented to Y.
9449 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9450 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9451 (Arm_relocate_functions::movw_abs_nc): Remove method.
9452 (Arm_relocate_functions::movt_abs): Ditto.
9453 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9454 (Arm_relocate_functions::thm_movt_abs): Ditto.
9455 (Arm_relocate_functions::movw_rel_nc): Ditto.
9456 (Arm_relocate_functions::movw_rel): Ditto.
9457 (Arm_relocate_functions::movt_rel): Ditto.
9458 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9459 (Arm_relocate_functions:thm_movw_rel): Ditto.
9460 (Arm_relocate_functions:thm_movt_rel): Ditto.
9461 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9462 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9463 New method definitions.
9464 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9465 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9466 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9467 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9468 (Target_arm::Relocate::relocate): Check for non-static or
9469 unimplemented relocation code and exit early. Change calls to
9470 Target_arm::reloc_uses_thumb_bit and
9471 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9472 instead. Refactor code to handle similar relocations to increase
9473 code sharing. Remove check for unsupported relocation code in switch
9474 statement.
9475 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9476 relocation property table to find out size. Change error message to
9477 print out the name of a relocation code instead of the numeric value.
9478 (Target_arm::scan_reloc_for_stub): Use relocation property table
9479 instead of calling Target_arm::reloc_uses_thumb_bit().
9480
218c5831
DK
94812010-02-02 Doug Kwan <dougkwan@google.com>
9482
9483 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9484 types of relaxed input section.
9485
0d31c79d
DK
94862010-02-02 Doug Kwan <dougkwan@google.com>
9487
9488 * Makefile.am (HFILES): Add arm-reloc-property.h.
9489 (DEFFILES): New.
2e702c99
RM
9490 (TARGETSOURCES): Add arm-reloc-property.cc
9491 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9492 (libgold_a_SOURCES): $(DEFFILES)
9493 * Makefile.in: Regenerate.
9494 * arm-reloc-property.cc: New file.
9495 * arm-reloc-property.h: New file.
9496 * arm-reloc.def: New file.
9497 * arm.cc: Update comments.
9498 (arm-reloc-property.h): New included header.
9499 (arm_reloc_property_table): New global variable.
9500 (Target_arm::do_select_as_default_target): New method definition.
9501 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9502 arm-reloc-property to targ_extra_obj.
9503 * parameters.cc (set_parameters_target): Call
9504 Target::select_as_default_target().
9505 * target.h (Target::select_as_default_target): New method definition.
9506 (Target::do_select_as_default_target): Same.
9507
546c7457
DK
95082010-02-01 Doug Kwan <dougkwan@google.com>
9509
9510 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9511 first_output_text_section_.
9512 (Arm_exidx_fixup::first_output_text_section): New method definition.
9513 (Arm_exidx_fixup::first_output_text_section_): New data member.
9514 (Arm_exidx_fixup::process_exidx_section): Record the first text
9515 output section seen.
9516 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9517 and entsize in output section header.
9518
11b861d5
DK
95192010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9520
9521 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9522 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9523 (Arm_relocate_functions::thm_alu11): New Method.
9524 (Arm_relocate_functions::thm_pc8): New Method.
9525 (Arm_relocate_functions::thm_pc12): New Method.
9526 (Target_arm::Scan::local): Handle the relocations.
9527 (Target_arm::Scan::global): Likewise.
9528 (Target_arm::Relocate::relocate): Likewise.
9529 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9530
c9a2c125
DK
95312010-01-29 Doug Kwan <dougkwan@google.com>
9532
9533 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9534 of relocation types as ld.
9535
1521477a
DK
95362010-01-29 Doug Kwan <dougkwan@google.com>
9537
9538 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9539 to public.
9540 (Arm_relocate_functions::thumb_branch_common): Ditto.
9541 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9542 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9543 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9544 Arm_relocate_functions::jump24): Remove.
9545 (Target_arm::Relocate::relocate): Adjust code to call
9546 Arm_relocation_functions::arm_branch_common and
9547 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9548 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9549
e7eca48c
DK
95502010-01-29 Doug Kwan <dougkwan@google.com>
9551
9552 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9553 output_local_symbol_count_needs_update_.
9554 (Arm_relobj::output_local_symbol_count_needs_update,
9555 Arm_relobj::set_output_local_symbol_count_needs_update,
9556 Arm_relobj::update_output_local_symbol_count): New methods.
9557 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9558 member.
9559 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9560 of pointed function as in a R_ARM_PREL31 relocation.
9561 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9562 for output local symbol count updating.
9563 (Target_arm::do_relax): Update output local symbol counts in objects
9564 if necessary.
9565 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9566
02961d7e
ILT
95672010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9568
9569 * arm.cc: Added support for the ARM relocations:
9570 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9571 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9572 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9573 movw_prel_nc).
9574 (Arm_relocate_functions::movw_rel): New method.
9575 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9576 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9577 thm_movw_prel_nc).
9578 (Arm_relocate_functions::thm_movw_rel): New method.
9579 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9580 thm_movt_prel).
9581 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9582 relocations.
9583 (Target_arm::Scan::global): Likewise.
9584 (Target_arm::Relocate::relocate): Likewise.
9585 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9586 Likewise.
9587
b10d2873
ILT
95882010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9589
9590 * arm.cc: Added support for ARM group relocations.
9591 (Target_arm::reloc_needs_sym_origin): New method.
9592 (Arm_relocate_functions::calc_grp_kn): New method.
9593 (Arm_relocate_functions::calc_grp_residual): New method.
9594 (Arm_relocate_functions::calc_grp_gn): New method.
9595 (Arm_relocate_functions::arm_grp_alu): New Method.
9596 (Arm_relocate_functions::arm_grp_ldr): New Method.
9597 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9598 (Arm_relocate_functions::arm_grp_ldc): New Method.
9599 (Target_arm::Scan::local): Handle the ARM group relocations.
9600 (Target_arm::Scan::global): Likewise.
9601 (Target_arm::Relocate::relocate): Likewise.
9602 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9603 Likewise.
9604
2b328d4e
DK
96052010-01-26 Doug Kwan <dougkwan@google.com>
9606
9607 * arm.cc (set): Include.
9608 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9609 pointer type.
2e702c99 9610 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9611 (Arm_output_section::append_text_sections_to_list): New method.
9612 (Arm_output_section::fix_exidx_coverage): Ditto.
9613 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9614 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9615 Relobj::set_section_offset() instead of
9616 Sized_relobj::invalidate_section_offset().
2e702c99 9617 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9618 parameter for section headers. Ignore relocation sections for
9619 unallocated sections and EXIDX sections.
9620 (Target_arm::fix_exidx_coverage): New method.
9621 (Target_arm::output_section_address_less_than): New type.
9622 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9623 linked text section instead of the EXIDX section.
9624 (Arm_output_section::create_stub_group): Add an assertion to check
9625 that this is not an EXIDX output section.
9626 (Arm_output_section::append_text_sections_to_list): New method.
9627 (Arm_output_section::fix_exidx_coverage): Ditto.
9628 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9629 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9630 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9631 first pass.
9632 (Target_arm::fix_exidx_coverage): New method.
9633 * object.h (Relobj::set_output_section): New method.
9634 (Sized_relobj::invalidate_section_offset): Remove method.
9635 (Sized_relobj::do_invalidate_section_offset): Remove method.
9636 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9637
c7f3c371
DK
96382010-01-25 Doug Kwan <dougkwan@google.com>
9639
9640 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9641 Fix warning due to signed and unsigned comparison on a 32-bit host.
9642
8923b24c
DK
96432010-01-22 Doug Kwan <dougkwan@google.com>
9644
9645 * arm.cc (Target_arm::do_relax): Record an output section for section
9646 offset adjustment it contains any stub table that has changed.
9647 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9648 offsets in an output section if necessary.
9649 * output.cc (Output_section::Output_section): Initialize
9650 section_offsets_need_adjustments_.
9651 (Output_section::add_input_section_for_script): Renamed to
9652 Output_section::add_simple_input_section.
9653 (Output_section::save_states): Add a comment.
9654 (Output_section::discard_states): New method defintion.
9655 (Output_section::adjust_section_offsets): Same.
9656 * output.h (Output_section::add_input_section_for_script): Renamed to
9657 Output_section::add_simple_input_section.
9658 (Output_section::discard_states): New method declaration.
9659 (Output_section::adjust_section_offsets): Same.
9660 (Output_section::section_offsets_need_adjustment,
9661 Output_section::set_section_offsets_need_adjustment): New method
9662 definitions.
9663 (Output_section::section_offsets_need_adjustment_): New data member.
9664 * script-sections.cc
9665 (Output_section_element_input::set_section_address): Adjust code for
9666 renaming of Output_section::add_input_section_for_script.
9667 (Orphan_output_section::set_section_address): Same.
9668
9b2fd367
DK
96692010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9670
9671 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9672 Fix_v4bx enum values .
9673 * gold/options.h (General_options): New option definitions.
9674 (General_options::fix_v4bx): New method.
9675 (General_options::Fix_v4bx): New enum.
9676 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9677 (General_options::parse_fix_v4bx_interworking): New method.
9678
80d0d023
DK
96792010-01-22 Doug Kwan <dougkwan@google.com>
9680
9681 * arm.cc (Arm_exidx_fixup): New class.
9682
af2cdeae
DK
96832010-01-21 Doug Kwan <dougkwan@google.com>
9684
9685 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9686 classes.
9687 (Arm_exidx_section_offset_map): New type.
9688
993d07c1
DK
96892010-01-21 Doug Kwan <dougkwan@google.com>
9690
9691 * arm.cc (Arm_exidx_input_section): New class.
9692 (Arm_relobj::exidx_input_section_by_link,
9693 Arm_relobj::exidx_input_section_by_shndx,
9694 Arm_relobj::make_exidx_input_section): New methods.
9695 (read_arm_attributes_section): Remove.
9696 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9697 information about them.
9698 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9699 to here.
9700
5ac169d4
DK
97012010-01-20 Doug Kwan <dougkwan@google.com>
9702
9703 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9704 Input_section_specifier to Section_id.
9705 (Target_arm::new_arm_input_section: Adjust code for change of key
9706 type.
9707 (Target_arm::find_arm_input_section): Ditto.
9708 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9709 (Section_id): Remove.
9710 (Garbage_collection::Section_id_hash): Remove.
9711 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9712 (Section_id): Remove.
9713 (Icf::Section_id_hash): Remove.
9714 * object.h (Section_id, Const_section_id, Section_id_hash,
9715 Const_section_id_hash): New type definitions.
9716 * output.cc (Output_section::add_relaxed_input_section): Change to
9717 use Const_section_id instead of Input_section_specifier as key type.
9718 (Output_section::add_merge_input_section): Ditto.
9719 (Output_section::build_relaxation_map): Change to use Section_id
9720 instead of Input_section_specifier as key type.
2e702c99 9721 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
9722 Ditto.
9723 (Output_section::convert_input_sections_to_relaxed_sections): Change
9724 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 9725 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
9726 (Output_section::find_relaxed_input_section): Ditto.
9727 * output.h (Input_section_specifier): Remove class.
9728 (Output_section::Output_section_data_by_input_section_map): Change
9729 key type to Const_section_id.
9730 (Output_section::Output_relaxed_input_section_by_input_section_map):
9731 Ditto.
9732 (Output_section::Relaxation_map): Change key type to Section_id.
9733
a2162063
ILT
97342010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9735
9736 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9737 (class Arm_v4bx_stub): New class.
9738 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9739 (Stub_factory::make_arm_v4bx_stub): New method.
9740 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9741 (Stub_table::empty): Handle v4bx stubs.
9742 (Stub_table::add_arm_v4bx_stub): New method.
9743 (Stub_table::find_arm_v4bx_stub): New method.
9744 (Arm_relocate_functions::v4bx): New method.
9745 (Target_arm::fix_v4bx): New method.
9746 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9747 (Stub_table::relocate_stubs): Likewise.
9748 (Stub_table::do_write): Likewise.
9749 (Stub_table::update_data_size_and_addralign): Likewise.
9750 (Stub_table::finalize_stubs): Likewise.
9751 (Target_arm::Scan::local): Likewise.
9752 (Target_arm::Scan::global): Likewise.
9753 (Target_arm::do_finalize_sections): Likewise.
9754 (Target_arm::Relocate::relocate): Likewise.
9755 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9756 Likewise.
9757 (Target_arm::scan_reloc_for_stub): Likewise.
9758 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9759
5696ab0b
ILT
97602010-01-19 Ian Lance Taylor <iant@google.com>
9761
9762 * output.cc (Output_section_headers::do_sized_write): Write large
9763 segment count to sh_info field.
9764 (Output_file_header::do_sized_write): For large segment count,
9765 write PN_XNUM to e_phnum field.
9766
800d0f56
ILT
97672010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9768
9769 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9770 (Arm_relocate_functions::thm_jump8): New function.
9771 (Arm_relocate_functions::thm_jump11): New function.
9772 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
9773 R_ARM_THM_JUMP11.
9774 (Target_arm::Scan::global): Likewise.
9775 (Target_arm::Relocate::relocate): Likewise.
9776 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9777 Likewise.
9778
41263c05
DK
97792010-01-14 Doug Kwan <dougkwan@google.com>
9780
9781 * arm.cc (map, utility): Include headers.
9782 (Target_arm::apply_cortex_a8_workaround): New method.
9783 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
9784 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
9785 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
9786 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
9787 the --[no-]fix-cortex-a8 command line options.
9788 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
9789 (Target_arm::relocate_stub): Use addend in instruction template.
9790 * options.h (DEFINE_bool): Set the user-set flag.
9791 (General_options): Add --[no-]-fix-cortex options.
9792 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 9793 : Update fast look-up map after conversion.
41263c05 9794
459e9b03
ST
97952010-01-14 Sriraman Tallam <tmsriram@google.com>
9796
9797 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
9798 in the first pass of do_layout.
9799
b521dfe4
DK
98002010-01-13 Doug Kwan <dougkwan@google.com>
9801
9802 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9803 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
9804 apparent compiler problem of not folding static constant integral
9805 data members of elfcpp::Elf_sizes<32>.
9806
44272192
DK
98072010-01-13 Doug Kwan <dougkwan@google.com>
9808
9809 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
9810 Arm_relobj::section_needs_cortex_a8_stub_scanning,
9811 Arm_relobj::scan_section_for_cortex_a8_erratum,
9812 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
9813 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
9814 sections to scan for relocation stubs into a new method
9815 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
9816 relocation and Cortex-A8 stub scanning.
9817 (Target_arm::do_relax): Force stubs to be after stubbed sections
9818 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 9819 the beginning of a new relaxation pass. Update a comment.
44272192
DK
9820 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
9821
44b71ece
ILT
98222010-01-12 Ian Lance Taylor <iant@google.com>
9823
9824 * target-reloc.h (visibility_error): New inline function.
9825 (relocate_section): Call visibility_error.
9826 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
9827 (MOSTLYCLEANFILES): Likewise.
9828 (protected_4_pic.o, protected_3.err): New targets.
9829 * testsuite/protected_4.cc: New file.
9830
a120bc7f
DK
98312010-01-12 Doug Kwan <dougkwan@google.com>
9832
9833 * arm.cc (Cortex_a8_reloc): New class.
9834 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
9835 and cortex_a8_relocs_info_.
9836 (Target_arm::fix_cortex_a8): New method definition.
9837 (Target_arm::Cortex_a8_relocs_info): New type.
9838 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
9839 New data member declarations.
9840 (Target_arm::scan_reloc_for_stub): Record information about
9841 relocations for THUMB branches that might be exempted from the
9842 Cortex-A8 workaround.
9843 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
9844 at the beginning of a relaxation pass.
9845
20138696
DK
98462010-01-12 Doug Kwan <dougkwan@google.com>
9847
9848 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
9849 (Arm_relobj::Mapping_symbol_position,
9850 Arm_reloj::Mapping_symbol_position_less,
9851 Arm_relobj::Mapping_symbols_info): New types.
9852 (Target_arm::is_mapping_symbol_name): New method definition.
9853 (Arm_relobj::do_count_local_symbols): Save information about mapping
9854 symbols.
9855
089d69dc
DK
98562010-01-11 Doug Kwan <dougkwan@google.com>
9857
9858 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
9859 Arm_relocate_functions::thumb32_branch_upper,
9860 Arm_relocate_functions::thumb32_branch_lower,
9861 Arm_relocate_functions::thumb32_cond_branch_offset,
9862 Arm_relocate_functions::thumb32_cond_branch_upper,
9863 Arm_relocate_functions::thumb32_cond_branch_lower,
9864 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
9865 branch offset encoding.
9866 (Arm_relocate_functions::thumb_branch_common): Use new branch
9867 offset encoding methods to avoid code duplication.
9868 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
9869 (Stub_addend_reader::operator()): Use new branch encoding method
9870 to avoid code duplication.
9871
99e5bff2
DK
98722010-01-11 Doug Kwan <dougkwan@google.com>
9873
9874 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
9875 (Target_arm::do_finalize_sections): Define special EXIDX section
9876 symbols only if referenced.
9877 * gc.h (Garbage_collection::add_reference): New method.
9878 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
9879 code duplication.
9880
98e090bd
ILT
98812010-01-11 Ian Lance Taylor <iant@google.com>
9882
d0a91bd8
ILT
9883 * script.cc (Version_script_info::build_expression_list_lookup):
9884 Change complaing about duplicate wildcard match from error to
9885 warning.
9886
98e090bd
ILT
9887 * script.cc (class Lazy_demangler): Recreate--revert part of patch
9888 of 2009-12-30.
9889 (Version_script_info::Version_script_info): Initialize globs_,
9890 default_version_, default_is_global_, and exact_. Don't
9891 initialize globals_ or locals_.
9892 (Version_script_info::build_lookup_tables): Build local symbols
9893 first.
9894 (Version_script_info::unquote): New function.
9895 (Version_script_info::add_exact_match): New function.
9896 (Version_script_info::build_expression_list_lookup): Remove lookup
9897 parameter. Add is_global parameter. Change all callers. Handle
9898 wildcard pattern specially. Unquote pattern. Call
9899 add_exact_match.
9900 (Version_script_info::get_name_to_match): New function.
9901 (Version_script_info::get_symbol_version): New function.
9902 (Version_script_info::get_symbol_version_helper): Remove.
9903 (Version_script_info::check_unmatched_names): Call unquote.
9904 * script.h (class Version_script_info): Change get_symbol_version
9905 to be non-inline and add is_global parameter; change all callers.
9906 Rewrite symbol_is_local. Update declarations. Define struct
9907 Version_tree_match, Exact, Globs. Don't define struct Lookup.
9908 Remove globals_ and locals_ members. Add exact_, globs_,
9909 default_version_, is_global_.
9910 (Version_script_info::Glob): Remove pattern, add expression and
9911 is_global. Update constructor. Change all callers.
9912 * dynobj.cc (Versions::finalize): Mark the version symbol as the
9913 default version.
9914 (Versions::symbol_section_contents): If a symbol is undefined, or
9915 defined in a dynamic object, set the version index to
9916 VER_NDX_LOCAL.
9917 * symtab.cc (Symbol_table::add_from_relobj): Don't call
9918 symbol_is_local.
9919 (Symbol_table::add_from_pluginobj): Likewise.
9920 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
9921
d56962d3
DK
99222010-01-11 Doug Kwan <dougkwan@google.com>
9923
9924 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
9925 (incremental_dump_LDADD): Add linking option for libintl.
9926 * Makefile.in: Regenerate.
9927
94e6ee91
L
99282010-01-11 H.J. Lu <hongjiu.lu@intel.com>
9929
9930 PR gold/11144
9931 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
9932 instead of -Ds.
9933 * testsuite/Makefile.in: Regenerated.
9934
e96c574b
DK
99352010-01-10 Doug Kwan <dougkwan@google.com>
9936
9937 * options.h (DEFINE_var): Use parentheses around argument varname__
9938 in macro body to avoid any unintended subsequent substitutions.
9939
7198066b
ILT
99402010-01-10 Ian Lance Taylor <iant@google.com>
9941
ba4d53bf
ILT
9942 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
9943 candidates before doing symbol resolution.
9944
7198066b
ILT
9945 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
9946 ODR candidates if only one is weak.
9947
a2beed37
ILT
99482010-01-08 Ian Lance Taylor <iant@google.com>
9949
9950 * script.cc (Version_script_info::build_expression_list_lookup):
9951 Don't warn about ambiguous version, just record the ambiguity.
9952 (Version_script_info::get_symbol_version_helper): Give error if
9953 version is ambiguous.
9954
2fb7225c
DK
99552010-01-08 Doug Kwan <dougkwan@google.com>
9956
9957 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
9958 prev_data_size_ and prev_addralign_. Remove initializer for
9959 deleted data member has_been_changed_.
9960 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
9961 to determine if the table is empty.
9962 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
9963 Remove.
9964 (Stub_table::add_reloc_stub): Define method in class definition
9965 instead of just declaring it there.
9966 (Stub_table::add_cortex_a8_stub): New method definition.
9967 (Stub_table::update_data_size_and_addralign): Ditto.
9968 (Stub_table::finalize_stubs): Ditto.
9969 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
9970 (Stub_table::do_addralign_): Return address alignment in the
9971 (Stub_table::do_reset_address_and_file_offset): Define method in
9972 class definition instead of declaring it there. Set current data
9973 size to be the data size of the previous pass.
9974 (Stub_table::set_final_data_size): Use current data size as the
9975 final data size.
9976 (Stub_table::relocate_stub): Change parameter type of stub from
9977 Reloc_stub pointer to Stub pointer.
9978 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
9979 (Stub_table::Cortex_a8_stub_list): New typedef.
9980 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
9981 Stub_table::prev_addralign_): New data member.
9982 (Arm_relobj::Arm_relobj): Initialize data member
9983 section_has_cortex_a8_workaround_.
9984 (Arm_relobj::section_has_cortex_a8_workaround,
9985 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
9986 definitions.
9987 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
9988 declarations.
9989 (Target_arm::relocate_stub): Change parameter type of stub from
9990 Reloc_stub pointer to Stub pointer.
9991 (Insn_template::size, Insn_template::alignment): Handle
9992 THUMB16_SPECIAL_TYPE.
9993 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
9994 Stub_table::update_data_size_and_addralign,
9995 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
9996 definitions.
9997 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
9998 (Stub_table::do_write): Ditto.
9999 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10000
880cd20d
ILT
100012010-01-08 Ian Lance Taylor <iant@google.com>
10002
10003 PR 11108
10004 * symtab.h (class Symbol): Remove fields is_target_special_ and
10005 has_plt_offset_. Add field is_defined_in_discarded_section_.
10006 (Symbol::is_defined_in_discarded_section): New function.
10007 (Symbol::set_is_defined_in_discarded_section): New function.
10008 (Symbol::has_plt_offset): Rewrite.
10009 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10010 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10011 Don't initialize is_target_special_ or has_plt_offset_.
10012 Initialize is_defined_in_discarded_section_.
10013 (Symbol_table::add_from_relobj): If appropriate, set
10014 is_defined_in_discarded_section.
10015 * resolve.cc (Symbol::override_base_with_special): Don't test
10016 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10017 * target-reloc.h (relocate_section): Do special handling for
10018 symbols defined in discarded sections for global symbols as well
10019 as local symbols.
10020
2703e3eb
ILT
100212010-01-08 Ian Lance Taylor <iant@google.com>
10022
10023 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10024 the SHT_SYMTAB case.
10025
339d40a3
ILT
100262010-01-08 Ian Lance Taylor <iant@google.com>
10027
10028 * object.cc (Sized_relobj::do_layout): Don't get confused if
10029 layout_eh_frame returns NULL.
10030
abecea76
ILT
100312010-01-08 Ian Lance Taylor <iant@google.com>
10032
10033 PR 11084
10034 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10035 dynamic symbol table, use the normal symbol table.
10036 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10037 symbol table.
10038
6b7dd3f3
ILT
100392010-01-08 Ian Lance Taylor <iant@google.com>
10040
10041 PR 11072
10042 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10043 sections.
10044
36c50e63
L
100452010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10046
10047 * version.cc (print_version): Change to "Copyright 2010".
10048
e291e7b9
ILT
100492010-01-08 Ian Lance Taylor <iant@google.com>
10050
10051 PR 10287
10052 PR 11063
10053 * i386.cc (class Target_i386): Change return type of plt_section
10054 to be non-const.
10055 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10056 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10057 tls_desc_rel_ field.
10058 (Output_data_plt_i386::rel_tls_desc): New function.
10059 (Target_i386::rel_tls_desc_section): New function.
10060 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10061 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10062 R_386_TLS_DESC reloc in rel_tls_desc_section.
10063 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10064 Define struct Tlsdesc_info.
10065 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10066 (Target_x86_64::do_reloc_symbol_index): New function.
10067 (Target_x86_64::add_tlsdesc_info): New function.
10068 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10069 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10070 tlsdesc_rel_ field.
10071 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10072 all callers.
10073 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10074 (Target_x86_64::rela_tlsdesc_section): New function.
10075 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10076 handling.
10077 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10078 (Target_x86_64::do_reloc_addend): New function.
10079 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10080 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10081 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10082 (Output_reloc::type): New function.
10083 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10084 (Output_reloc::is_target_specific): New function.
10085 (Output_reloc::target_arg): New function.
10086 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10087 absolute relocs and target specific relocs.
10088 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10089 add_target_specific.
10090 (class Output_data_reloc) [SHT_RELA]: Likewise.
10091 * output.cc (Output_reloc::Output_reloc): Add four new versions
10092 for absolute relocs and target specific relocs.
10093 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10094 (Output_reloc::get_symbol_index): Likewise.
10095 (Output_reloc::local_section_offset): Check that local_sym_index_
10096 is not TARGET_CODE or 0.
10097 (Output_reloc::symbol_value): Likewise.
10098 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10099 reloc.
10100 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10101 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10102 functions.
10103 * layout.cc (add_target_dynamic_tags): Use output section for
10104 DT_PLTRELSZ and DT_JMPREL.
10105
3a44184e
ILT
101062010-01-07 Ian Lance Taylor <iant@google.com>
10107
10108 PR 11061
10109 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10110 function.
10111 (class Output_data_reloc_generic): Define.
10112 (class Output_data_reloc_base): Change base class to
10113 Output_data_reloc_generic. Change add() method to call
10114 bump_relative_reloc_count for a relative reloc. Remove
10115 sort_relocs_ field.
10116 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10117 to sort_relocs().
10118 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10119 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10120 appropriate.
10121 * layout.h (class Layout): Update declaration.
10122
ea715a34
ILT
101232010-01-07 Ian Lance Taylor <iant@google.com>
10124
10125 * output.h (class Output_data): Add const version of
10126 output_section and do_output_section.
10127 (class Output_section_data): Add const version of
10128 do_output_section.
10129 (class Output_section): Likewise.
10130 * layout.cc (Layout::add_target_dynamic_tags): New function.
10131 * layout.h (class Layout): Update declarations.
10132 * arm.cc (Target_arm::do_finalize_sections): Use
10133 add_target_dynamic_tags.
10134 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10135 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10136 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10137 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10138
659948a4
ILT
101392010-01-07 Ian Lance Taylor <iant@google.com>
10140
10141 PR 11042
10142 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10143 object as needed.
10144
9d3b86f6
ILT
101452010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10146 Ian Lance Taylor <iant@google.com>
10147
10148 PR 11019
10149 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10150 Xindex::read_symtab_xindex.
10151
bb0d3eb0
DK
101522010-01-07 Doug Kwan <dougkwan@google.com>
10153
10154 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10155 (Insn_template::thumb16_bcond_insn): New method declaration.
10156 (Insn_template): Fix spelling.
10157 (Stub::thumb16_special): New method declaration.
10158 (Stub::do_write): Define virtual method which was previously pure
10159 virtual.
10160 (Stub::do_thumb16_special): New method declaration.
10161 (Stub::do_fixed_endian_write): New template member.
10162 (Reloc_stub::do_write): Remove.
10163 (Reloc_stub::do_fixed_endian_write): Remove.
10164 (Cortex_a8_stub): New class definition.
10165 (Stub_factory::make_cortex_a8_stub): New method definition.
10166 (Stub_factory::Stub_factory): Add missing static storage class
10167 qualifier for elf32_arm_stub_a8_veneer_blx.
10168
ffeef7df
ILT
101692010-01-07 Ian Lance Taylor <iant@google.com>
10170
dc3f80fe
ILT
10171 PR 10980
10172 * options.h (class General_options): Add --warn-unresolved-symbols
10173 and --error-unresolved-symbols.
10174 * errors.cc (Errors::undefined_symbol): Implement
10175 --warn-unresolved-symbols.
10176
ffeef7df
ILT
10177 * options.h (class General_options): Add -z text and -z textoff.
10178 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10179
f1ec9ded
ST
101802010-01-06 Sriraman Tallam <tmsriram@google.com>
10181
10182 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10183 (Garbage_collection::cident_sections): New function.
10184 (Garbage_collection::add_cident_section): New function.
10185 (Garbage_collection::cident_sections_): New member.
10186 (gc_process_relocs): Add references to sections whose names are C
10187 identifiers.
10188 * gold.h (cident_section_start_prefix): New constant.
10189 (cident_section_stop_prefix): New constant.
10190 (is_cident): New function.
10191 * layout.cc (Layout::define_section_symbols): Replace string constants
10192 with the newly defined constants.
10193 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10194 C identifiers.
10195 * testsuite/Makefile.am: Add gc_orphan_section_test.
10196 * testsuite/Makefile.in: Regenerate.
10197 * testsuite/gc_orphan_section_test.cc: New file.
10198 * testsuite/gc_orphan_section_test.sh: New file.
10199
6eda8c29
ILT
102002010-01-06 Ian Lance Taylor <iant@google.com>
10201
b9674e17
ILT
10202 PR 10980
10203 * options.h (class General_options): Add --warn-shared-textrel.
10204 * layout.cc (Layout::finish_dynamic_section): Implement
10205 --warn-shared-textrel.
10206
6eda8c29
ILT
10207 PR 10980
10208 * options.h (class General_options): Add --warn-multiple-gp.
10209
32dcd44e
ILT
102102010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10211
10212 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10213 $(THREADSLIB) and $(LIBDL).
10214 * Makefile.in: Rebuild.
10215
a192ba05
ILT
102162010-01-06 Ian Lance Taylor <iant@google.com>
10217
10218 PR 10980
10219 * options.cc (General_options::parse_section_start): New function.
10220 (General_options::section_start): New function.
10221 (General_options::General_options): Initialize all members.
10222 * options.h: Include <map>
10223 (class General_options): Add --section-start. Add section_starts_
10224 member.
10225 * layout.cc (Layout::attach_allocated_section_to_segment): If
10226 --section-start was used, set the address of the segment. Remove
10227 local sort_sections.
10228 (Layout::relaxation_loop_body): If the address of the load segment
10229 has been set by --section-start, don't use it.
10230 * output.h (Output_segment::update_flags_for_output_section): New
10231 function.
10232 * output.cc (Output_segment::add_output_section): Call
10233 update_flags_for_output_section.
10234
dde3f402
ILT
102352010-01-05 Ian Lance Taylor <iant@google.com>
10236
62dfdd4d
ILT
10237 PR 10980
10238 * options.h (class General_options): Add --undefined-version.
10239 * script.cc (struct Version_expression): Add was_matched_by_symbol
10240 field.
10241 (Version_script_info::matched_symbol): New function.
10242 (Version_script_info::get_symbol_version_helper): Call
10243 matched_symbol.
10244 (Version_script_info::check_unmatched_names): New function.
10245 * script.h (class Version_script_info): Update declarations.
10246 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10247
9c4ae156
ILT
10248 * options.h (class General_options): Use DEFINE_bool_alias for
10249 allow_multiple_definition.
10250 * resolve.cc (Symbol_table::should_override): Don't test
10251 allow_multiple_definition.
10252
dde3f402
ILT
10253 PR 10980
10254 * options.h (class General_options): Add --cref.
10255 * main.cc (main): Print cref table if --cref. Don't close mapfile
10256 until after printing cref table.
10257 * cref.cc: Include "symtab.h".
10258 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10259 (Cref_table_compare::operator()): New function.
10260 (Cref_inputs::gather_cref): New function.
10261 (filecol): New static const.
10262 (Cref_inputs::print_cref): New function.
10263 (Cref::print_cref): New function.
10264 * cref.h: Include <cstdio>.
10265 (class Cref): Update declarations.
10266 * mapfile.h (Mapfile::file): New function.
10267 * object.h (class Object): Define Symbols. Declare virtual
10268 do_get_global_symbols.
10269 (Object::get_global_symbols): New function.
10270 * object.cc (Input_objects::add_object): Pass object to cref_ if
10271 --cref.
10272 (Input_objects::archive_start): Likewise.
10273 (Input_objects::archive_stop): Likewise.
10274 (Input_objects::print_cref): New function.
10275 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10276 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10277 --cref.
10278 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10279 function.
10280 * plugin.h (class Sized_pluginobj): Update declarations.
10281
8781f709
ILT
102822010-01-05 Ian Lance Taylor <iant@google.com>
10283
10284 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10285 to is_default_version. Rename insdef to insdefault.
10286 (Symbol_table::add_from_relobj): Rename def to is_default_version
10287 and local to is_forced_local.
10288 (Symbol_table::add_from_pluginobj): Likewise.
10289 (Symbol_table::add_from_dynobj): Likewise.
10290 (Symbol_table::define_special_symbol): Rename insdef to
10291 insdefault.
10292
fe35d28d
ILT
102932010-01-04 Ian Lance Taylor <iant@google.com>
10294
30bc8c46
ILT
10295 PR 10980
10296 * options.h (class General_options): Add
10297 --allow-multiple-definition and -z muldefs.
10298 * resolve.cc (Symbol_table::should_override): Don't warn about a
10299 multiple symbol definition if --allow-multiple-definition or -z
10300 muldefs.
10301
7eaea549
ILT
10302 PR 10980
10303 * options.h (class General_options): Add --add-needed and
10304 --copy-dt-needed-entries. Tweak --as-needed help entry.
10305 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10306 error if --copy-dt-needed-entries aka --add-needed is used and
10307 would cause a change in behaviour.
10308
fe35d28d
ILT
10309 PR 10980
10310 * options.h (class General_options): Add -G as a short version of
10311 --shared. Add no-op options -assert, -g, and -i.
10312
55a2bb35
ST
103132010-01-04 Sriraman Tallam <tmsriram@google.com>
10314
10315 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10316 check for .text or .gnu.linkonce.t sections.
10317 * icf.cc (Icf::find_identical_sections): Ditto.
10318 Change the detection for mangled function name within the section
10319 name.
10320 * icf.h (is_section_foldable_candidate): New function.
10321
719328e1
ILT
103222009-12-30 Ian Lance Taylor <iant@google.com>
10323
10324 PR 10980
10325 * options.h (class General_options): Permit two dashes with
10326 --retain-symbols-file.
10327
d7bb5745
ILT
103282009-12-30 Ian Lance Taylor <iant@google.com>
10329
403a15dd
ILT
10330 PR 10979
10331 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10332 don't put the file header and segment headers in the text
10333 segment.
10334
eda294df
ILT
10335 PR 10979
10336 * common.cc (Sort_commons::operator()): Stabilize sort when both
10337 entries are NULL.
10338 (Symbol_table::do_allocate_commons_list): When allocating common
10339 symbols, skip a symbol which is no longer common.
10340 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10341 an object before checking its type.
10342 * testsuite/common_test_2.c: New file.
10343 * testsuite/common_test_3.c: New file.
10344 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10345 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10346 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10347 (common_test_2_pic.o, common_test_2.so): New targets.
10348 (common_test_3_pic.o, common_test_3.so): New targets.
10349 * testsuite/Makefile.in: Rebuild.
10350
d7bb5745
ILT
10351 PR 10979
10352 * script.cc (read_input_script): If we see a new SECTIONS clause,
10353 and we have added an input section, give an error.
10354 * layout.h (class Layout): Add have_added_input_section function.
10355 Add have_added_input_section_ field.
10356 * layout.cc (Layout::Layout): Initialize
10357 have_added_input_section_.
10358 (Layout::layout): Set have_added_input_section_.
10359 (Layout::layout_eh_frame): Likewise.
10360
fc59c572
ILT
103612009-12-30 Ian Lance Taylor <iant@google.com>
10362
10363 PR 10931
10364 * options.h (class General_options): Add --sort-common option.
10365 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10366 * common.cc (Sort_common): Add sort_order parameter to
10367 constructor. Add sort_order_ field.
10368 (Sort_commons::operator): Check sort_order_.
10369 (Symbol_table::allocate_commons): Determine the sort order.
10370 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10371 Change all callers.
10372 (Symbol_table::do_allocate_commons_list): Likewise.
10373
1c74fab0
ILT
103742009-12-30 Ian Lance Taylor <iant@google.com>
10375
10376 PR 10916
10377 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10378 symbols from this object, don't change the visibility of an
10379 undefined symbol.
10380 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10381
6affe781
ILT
103822009-12-30 Ian Lance Taylor <iant@google.com>
10383
10384 PR 10861
10385 * script.h (class Version_script_info): Define Language enum.
10386 Update declarations. Define Glob, Exact, and Lookup types. Add
10387 new fields globals_, locals_, and is_finalized_.
10388 * script.cc: Various formatting fixes.
10389 (class Parser_closure): Change language_stack_ from a vector of
10390 std::string to one of Version_script_info::Language. Adjust all
10391 uses accordingly.
10392 (class Lazy_demangler): Remove.
10393 (struct Version_expression): Change language from std::string to
10394 Version_script_info::Language.
10395 (Version_script_info::Version_script_info): New function.
10396 (Version_script_info::~Version_script_info): Don't call clear.
10397 (Version_script_info::finalize): New function.
10398 (Version_script_info::build_lookup_tables): New function.
10399 (Version_script_info::build_expression_list_lookup): New
10400 function.
10401 (Version_script_info::get_symbol_version_helper): Rewrite to use
10402 lookup tables.
10403 (Version_script_info::print_expression_list): Adjust to use
10404 Version_script_info::Language.
10405 (script_push_lex_into_version_mode): Check that the version script
10406 has not been finalized.
10407 (version_script_push_lang): Change language string to
10408 Version_script_info::Language.
10409 * options.cc (Command_line::version_script): New function.
10410 * options.h (class General_options): Add finalize_dynamic_list
10411 function. Change version_script from declaration to definition.
10412 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10413 * testsuite/version_script.map: Remove duplicate def of foo.
10414 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10415 version_script.map.
10416 * testsuite/Makefile.in: Rebuild.
10417
818bf354
ILT
104182009-12-30 Ian Lance Taylor <iant@google.com>
10419
10420 PR 10843
10421 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10422 if the input symbol index is 0, make the output symbol index 0.
10423
ebcc8304
ILT
104242009-12-30 Ian Lance Taylor <iant@google.com>
10425
10426 PR 10670
10427 * options.h (class General_options): Add -x/--discard-all.
10428 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10429 --discard-all. If the local symbol needs a dynamic entry, check
10430 that before handling --discard-locals.
10431
176fe33f
ILT
104322009-12-30 Ian Lance Taylor <iant@google.com>
10433
bb321bb1
ILT
10434 PR 10450
10435 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10436 flags to PF_R.
10437 (Output_segment::add_output_section): Don't change the flags if
10438 the type is PT_TLS.
10439
176fe33f
ILT
10440 PR 10450
10441 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10442 GNU hash table if they need a dynamic value. Otherwise, don't add
10443 them if they are defined in a dynamic object or are forced local.
10444
e8cd95c7
ILT
104452009-12-29 Ian Lance Taylor <iant@google.com>
10446
1b81fb71
ILT
10447 PR 10450
10448 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10449 .gnu.hash table for a 32-bit target.
10450
8d6d383d
ILT
10451 PR 10450
10452 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10453 regular and a dynamic object only needs a dynamic symbol table
10454 entry if it is externally visible.
10455
e785ec03
ILT
10456 PR 10450
10457 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10458 constructor. Add global_offset_table_ field.
10459 (Target_i386::got_section): Set global_offset_table_.
10460 (Target_i386::do_finalize_sections): Set global_offset_table_
10461 size.
10462 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10463 in constructor. Add global_offset_table_ field.
10464 (Target_x86_64::got_section): Set global_offset_table_.
10465 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10466 size.
10467
1a2dff53
ILT
10468 * layout.cc (Layout::Layout): Initialize increase_relro_.
10469 (Layout::get_output_section): Add is_relro, is_last_relro, and
10470 is_first_non_relro parameters. Change all callers.
10471 (Layout::choose_output_section): Likewise.
10472 (Layout::add_output_section_data): Likewise.
10473 (Layout::make_output_section): Likewise.
10474 (Layout::set_segment_offsets): Clear increase_relro when using a
10475 linker script.
10476 * layout.h (class Layout): Add increase_relro method. Add
10477 increase_relro_ field. Update declarations.
10478 * output.cc (Output_section::Output_section): Initialize
10479 is_last_relro_ and is_first_non_relro_.
10480 (Output_segment::add_output_section): Group relro sections is
10481 do_sort is true. Handle is_last_relro and is_first_non_relro.
10482 (Output_segment::maximum_alignment): Remove relro handling.
10483 (Output_segment::set_section_addresses): Add increase_relro
10484 parameter. Change all callers. Add initial alignment to align
10485 relro sections on separate page. Remove old relro handling.
10486 (Output_segment::set_section_list_addresses): Remove in_relro
10487 parameter. Change all callers.
10488 (Output_segment::set_offset): Add increase parameter. Change all
10489 callers. Remove old relro handling.
10490 * output.h (class Output_section): Add new methods: is_last_relro,
10491 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10492 Add is_last_relro_ and is_first_non_relro_ fields.
10493 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10494 Create separate .got.plt section. Call increase_relro.
10495 * x86_64.cc (Target_x86_64::got_section): Likewise.
10496 * testsuite/relro_script_test.t: Add .got.plt.
10497
f0ba79e2
ILT
10498 PR 10450
10499 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10500 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10501 (Layout::finalize): Call set_dynamic_symbol_size.
10502 (Layout::set_dynamic_symbol_size): New function.
10503 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10504 set_dynamic_symbol_size.
10505
e8cd95c7
ILT
10506 PR 10450
10507 * output.h (class Output_section): Add is_entsize_zero_ field.
10508 * output.cc (Output_section::Output_section): Initialize
10509 is_entsize_zero_.
10510 (Output_section::set_entsize): If two different entsizes are
10511 requested, force it to zero.
10512 (Output_section::add_input_section): Set flags for .debug_str
10513 before updating section flags. Set entsize.
10514 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10515 and SHF_STRING if all input sections have those flags.
10516
3e1b9a8a
RÁE
105172009-12-29 Rafael Espindola <espindola@google.com>
10518
10519 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10520 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10521 reporting.
3e1b9a8a 10522
3dcad376
ST
105232009-12-29 Sriraman Tallam <tmsriram@google.com>
10524
10525 * options.cc (General_options::parse_version): Allow -v to exit
10526 without an error if there is nothing to link.
10527
084e2665
ILT
105282009-12-29 Ian Lance Taylor <iant@google.com>
10529
10530 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10531 using a version of gcc before 4.1.
10532 * configure: Rebuild.
10533
250acde3
CD
105342009-12-28 Chris Demetriou <cgd@google.com>
10535
10536 * attributes.cc (Output_attributes_section_data::do_write): Use
10537 std::vector::front rather than std::vector::data.
10538
99fff23b
ILT
105392009-12-28 Ian Lance Taylor <iant@google.com>
10540
10541 * symtab.h (class Symbol_table): Add enum Defined.
10542 * resolve.cc (Symbol_table::should_override): Add defined
10543 parameter. Change all callers. Test whether object is NULL
10544 before calling a method on it.
10545 (Symbol_table::report_resolve_problem): Add defined parameter.
10546 Change all callers.
10547 (Symbol_table::should_override_with_special): Likewise.
10548 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10549 parameter. Change all callers.
10550 (Symbol_table::do_define_in_output_data): Likewise.
10551 (Symbol_table::define_in_output_segment): Likewise.
10552 (Symbol_table::do_define_in_output_segment): Likewise.
10553 (Symbol_table::define_as_constant): Likewise.
10554 (Symbol_table::do_define_as_constant): Likewise.
10555 * script.h (class Symbol_assignment): Add is_defsym parameter to
10556 constructor; change all callers.
10557 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10558 parameter. Change all callers. Add is_defsym_ field.
10559 (class Parser_closure): Add parsing_defsym parameter to
10560 constructor; change all callers. Add parsing_defsym accessor
10561 function. Add parsing_defsym_ field.
10562
556bd683
ILT
105632009-12-28 Ian Lance Taylor <iant@google.com>
10564
10565 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10566 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10567
1782c879
ILT
105682009-12-23 Ian Lance Taylor <iant@google.com>
10569
10570 * i386.cc (Target_i386::do_calls_non_split): Recognize
10571 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10572 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10573 -fsplit-stack prologue when using %r11.
1782c879 10574
329ca2b1
ST
105752009-12-21 Sriraman Tallam <tmsriram@google.com>
10576
10577 * options.cc (General_options::parse_version): Make -v continue and do
10578 the link like GNU ld does.
10579
d675ff46
RÁE
105802009-12-17 Rafael Avila de Espindola <espindola@google.com>
10581
10582 * Makefile.am (CCFILES): Add timer.cc.
10583 (HFILES): Add timer.h.
10584 * configure.ac: Check for sysconf and times.
10585 * main.cc: include timer.h.
10586 (main): Use Timer instead of get_run_time.
10587 * timer.cc: New.
10588 * timer.h: New.
10589 * workqueue.cc: include timer.h.
10590 (Workqueue::find_and_run_task):
10591 Report user, sys and wall time.
10592 * Makefile.in: Regenerate.
10593 * config.in: Regenerate.
10594 * configure: Regenerate.
10595
d6344fb5
DK
105962009-12-16 Doug Kwan <dougkwan@google.com>
10597
10598 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10599 sections.
10600 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10601 relaxed input sections.
10602 * output.cc (Output_section::find_relaxed_input_section): Change
10603 return type to Output_relaxed_input_section pointer. Adjust code
10604 for new type of relaxed_input_section_map_.
10605 * output.h (Output_section::find_relaxed_input_section): Change
10606 return type to Output_relaxed_input_section pointer.
10607 (Output_section::Output_relaxed_input_section_by_input_section_map):
10608 New type.
10609 (Output_section::relaxed_input_section_map_): Change type to
10610 Output_section::Output_relaxed_input_section_by_input_section_map.
10611 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10612 input section.
10613
0e0d5469
ILT
106142009-12-15 Ian Lance Taylor <iant@google.com>
10615
10616 * layout.cc (Layout::create_shstrtab): Only write out after input
10617 sections if we are compressing debug sections.
10618
0649a889
ILT
106192009-12-15 Ian Lance Taylor <iant@google.com>
10620
10621 * archive.cc (Archive::add_symbols): Only look up a symbol without
10622 a version if there is, in fact, a version.
10623
2ea97941
ILT
106242009-12-14 Ian Lance Taylor <iant@google.com>
10625
10626 Revert -Wshadow changes, all changes from:
10627 2009-12-11 Doug Kwan <dougkwan@google.com>
10628 2009-12-11 Nick Clifton <nickc@redhat.com>
10629 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10630
b0eec2cc
DK
106312009-12-11 Doug Kwan <dougkwan@google.com>
10632
10633 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10634 due to -Wshadow.
10635 * attributes.cc (Object_attribute::size): Ditto.
10636 (Attributes_section_data::size): Ditto.
10637 (Attributes_section_data::Attributes_section_data): Ditto.
10638 (Output_attributes_section_data::do_write): Ditto.
10639 * attributes.h (Object_attribute::set_type): Ditto.
10640 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10641
91d6fa6a
NC
106422009-12-11 Nick Clifton <nickc@redhat.com>
10643
10644 * archive.cc: Fix shadowed variable warnings.
10645 * arm.cc: Likewise.
10646 * compressed_output.cc: Likewise.
10647 * compressed_output.h: Likewise.
10648 * configure: Likewise.
10649 * dwarf_reader.cc: Likewise.
10650 * dynobj.cc: Likewise.
10651 * dynobj.h: Likewise.
10652 * ehframe.cc: Likewise.
10653 * ehframe.h: Likewise.
10654 * errors.cc: Likewise.
10655 * expression.cc: Likewise.
10656 * fileread.cc: Likewise.
10657 * fileread.h: Likewise.
10658 * freebsd.h: Likewise.
10659 * i386.cc: Likewise.
10660 * icf.cc: Likewise.
10661 * incremental.h: Likewise.
10662 * layout.cc: Likewise.
10663 * layout.h: Likewise.
10664 * mapfile.cc: Likewise.
10665 * merge.cc: Likewise.
10666 * merge.h: Likewise.
10667 * object.cc: Likewise.
10668 * object.h: Likewise.
10669 * options.h: Likewise.
10670 * output.cc: Likewise.
10671 * output.h: Likewise.
10672 * parameters.cc: Likewise.
10673 * plugin.cc: Likewise.
10674 * powerpc.cc: Likewise.
10675 * reduced_debug_output.cc: Likewise.
10676 * reduced_debug_output.h: Likewise.
10677 * reloc.cc: Likewise.
10678 * reloc.h: Likewise.
10679 * resolve.cc: Likewise.
10680 * script-sections.cc: Likewise.
10681 * script.cc: Likewise.
10682 * script.h: Likewise.
10683 * sparc.cc: Likewise.
10684 * symtab.cc: Likewise.
10685 * symtab.h: Likewise.
10686 * target-select.cc: Likewise.
10687 * target-select.h: Likewise.
10688 * token.h: Likewise.
10689 * workqueue.cc: Likewise.
10690 * workqueue.h: Likewise.
10691 * x86_64.cc: Likewise.
10692
a0351a69
DK
106932009-12-10 Doug Kwan <dougkwan@google.com>
10694
10695 * arm.cc (attributes.h): New include.
10696 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10697 (Arm_relobj::~Arm_relobj): Delete object pointed by
10698 attributes_section_data_.
10699 (Arm_relobj::attributes_section_data): New method definition.
10700 (Arm_relobj::attributes_section_data_): New data member declaration.
10701 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10702 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10703 attributes_section_data_.
10704 (Arm_dynobj::attributes_section_data): New method definition.
10705 (Arm_dynobj::attributes_section_data_): New data member declaration.
10706 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10707 initialization value of may_use_blx_ to false.
2e702c99 10708 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
10709 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10710 object attributes to compute results instead of hard-coding.
10711 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10712 Target_arm::get_secondary_compatible_arch,
10713 Target_arm::set_secondary_compatible_arch
10714 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10715 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10716 New method declarations.
10717 (Target_arm::get_aeabi_object_attribute): New method definition.
10718 (Target_arm::attributes_section_data_): New data member declaration.
10719 (read_arm_attributes_section): New template definition.
10720 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10721 (Arm_dynobj::do_read_symbols): Ditto.
10722 (Target_arm::do_finalize_sections): Merge attributes sections from
10723 input. Check for BLX use after attributes section merging.
10724 Fix __exidx_start and __exidx_end visibility. Create an
10725 .ARM.attributes section if necessary.
10726 (Target_arm::get_secondary_compatible_arch,
10727 Target_arm::set_secondary_compatible_arch,
10728 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10729 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 10730 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
10731 New method definitions.
10732
b59befec
ILT
107332009-12-09 Ian Lance Taylor <iant@google.com>
10734
10735 * plugin.cc (Plugin::load): Don't cast from void* to a function
10736 pointer.
10737
1276bc89
ILT
107382009-12-09 Ian Lance Taylor <iant@google.com>
10739
10740 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10741 information fields.
10742
2f2de248
L
107432009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10744
10745 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10746 Replace two_file_shared_1.so with two_file_shared_2.so.
10747 * testsuite/Makefile.in: Regenerated.
10748
4f787271
DK
107492009-12-08 Doug Kwan <dougkwan@google.com>
10750
10751 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10752 (HFILES): Add attributes.h and int_encoding.h.
10753 * Makefile.in: Regenerate.
10754 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10755 function definitions to int_encoding.cc
10756 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10757 prototypes to int_encoding.h
10758 * reduced_debug_output.cc (int_encoding.h): New include.
10759 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10760 function definitions to int_encoding.cc
10761 (insert_into_vector, read_from_pointer): Move template definitions to
10762 int_encoding.h
10763 * attributes.cc: New file.
10764 * attributes.h: New file.
10765 * int_encoding.cc: New file.
10766 * int_encoding.h: New file.
10767
20b52f1a
RÁE
107682009-12-07 Rafael Avila de Espindola <espindola@google.com>
10769
10770 PR gold/11055
10771 * incremental-dump.cc (dump_incremental_inputs): New.
10772 (main): Use dump_incremental_inputs.
10773
53d7974c
L
107742009-12-07 H.J. Lu <hongjiu.lu@intel.com>
10775
10776 PR gold/10893
10777 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
10778 checking elfcpp::STT_FUNC.
10779 (Target_i386::Relocate::relocate): Likewise.
10780 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
10781
10782 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
10783 symbols from shared libraries into normal FUNC symbols.
10784
10785 * symtab.h (Symbol): Add is_func and use it.
10786
05a352e6
DK
107872009-12-05 Doug Kwan <dougkwan@google.com>
10788
10789 * arm.cc (Target_arm::arm_info): Initialize new fields
10790 attributes_section and attributes_vendor.
10791 * i386.cc (Target_i386::i386_info): Same.
10792 * object.cc (Sized_relobj::do_layout): Skip attribute section.
10793 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
10794 fields attributes_section and attributes_vendor.
53d7974c 10795 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
10796 * target.h (Target::attributes_section, Target::attributes_vendor,
10797 Target::is_attributes_section, Target::attribute_arg_type,
10798 Target::attributes_order): New method definitions.
10799 (Target::Target_info::attributes_section,
10800 Target::Target_info::attributes_vendor): New fields.
10801 (Target::do_attribute_arg_type, Target::do_attributes_order): New
10802 virtual method definitions.
10803 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
10804 attributes_section and attributes_vendor.
10805 * testsuite/testfile.cc (Target_test::test_target_info): Same.
10806
f4e5969c
DK
108072009-12-05 Doug Kwan <dougkwan@google.com>
10808
10809 * arm.cc: Update comments about interworking and stub generation.
10810 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
10811 considered as non-PIC.
10812 (Arm_relocate_functions::base_abs): Fix formatting.
10813 (Arm_relocate_functions::got_prel): Fix comment. Change interface
10814 of function to use GOT entry address instead of offset.
10815 (Target_arm::Scan::global): Issue an error if a symbol would need a
10816 PLT does not get one because it is untyped. Remove code to create
10817 dynamic symbols for relative branches.
10818 (Target_arm::Relocate::relocate: Use 0 instead of false since function
10819 takes unsigned integer instead of boolean.
10820
1abce4a6
L
108212009-12-05 H.J. Lu <hongjiu.lu@intel.com>
10822
10823 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
10824 (two_file_test_LDADD): Likewise.
10825 (common_test_1_LDADD): Likewise.
10826 (exception_test_LDADD) Likewise.
10827 (weak_test_LDADD): Likewise.
10828 (many_sections_test_LDADD): Likewise.
10829 (initpri1_LDADD): Likewise.
10830 (script_test_1_LDADD): Likewise.
10831 (script_test_2_LDADD): Likewise.
10832 (justsyms_LDADD): Likewise.
10833 (binary_test_LDADD): Likewise.
10834 (large_LDADD): Likewise.
10835 * testsuite/Makefile.in: Regenerated.
10836
adcf2816 108372009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 10838
adcf2816
L
10839 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
10840 (Symbol_table::override_with_special): Likewise.
10841 (Symbol_table::add_from_object): Likewise.
10842
28e67f5d
RÁE
108432009-12-04 Rafael Avila de Espindola <espindola@google.com>
10844
10845 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10846 Don't set the data_offset twice.
10847
ae10a101
RÁE
108482009-12-04 Rafael Avila de Espindola <espindola@google.com>
10849
10850 * testsuite/Makefile.in: Regenerate.
10851
f59f41f3
DK
108522009-12-03 Doug Kwan <dougkwan@google.com>
10853
10854 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
10855 (Target_arm::do_finalize_sections): Add parameter for symbol table
10856 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
10857 * i386.cc (Target_i386::do_finalize_sections): Add an additional
10858 parameter for symbol table pointer.
10859 * layout.cc (Layout::finalize): Call Target::finalize_sections with
10860 an additional parameter for a pointer to symbol table.
10861 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
10862 parameter for a symbol table pointer.
10863 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
10864 * target.h (Target::finalize_sections, Target::do_finalize_sections):
10865 Ditto.
10866 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
10867 parameter for a symbol table pointer.
10868
ca55d848
RÁE
108692009-12-03 Rafael Avila de Espindola <espindola@google.com>
10870
10871 * incremental.cc (Incremental_inputs_header)
10872 (Incremental_inputs_header_write, Incremental_inputs_entry)
10873 (Incremental_inputs_entry_write): Move ...
10874 * incremental.h (Incremental_inputs_header)
10875 (Incremental_inputs_header_write, Incremental_inputs_entry)
10876 (Incremental_inputs_entry_write): here.
10877
3aec4f9c
RÁE
108782009-12-02 Rafael Avila de Espindola <espindola@google.com>
10879
10880 * incremental.cc (make_sized_incremental_binary): Set the target.
10881 Error if it is incompatible.
10882 * output.h (Output_file): Add filename method.
10883
9c0ae74d
RÁE
108842009-12-02 Rafael Avila de Espindola <espindola@google.com>
10885
10886 * incremental.cc (Incremental_inputs_entry): Remove unused argument
10887 from the get_* methods.
10888
a45500ae
RÁE
108892009-12-02 Rafael Avila de Espindola <espindola@google.com>
10890
10891 * incremental-dump.cc (main): Check that the offeset of a script is 0.
10892 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
10893 Write 0 for the data_offset of scripts.
10894
325e6408
RÁE
108952009-12-02 Rafael Avila de Espindola <espindola@google.com>
10896
10897 * testsuite/Makefile.am: Add the incremental_test.sh test.
10898 * testsuite/incremental_test.sh: New.
10899 * testsuite/incremental_test_1.c: New.
10900 * testsuite/incremental_test_2.c: New.
10901
954c3e2e
RÁE
109022009-12-01 Rafael Avila de Espindola <espindola@google.com>
10903
703d02da 10904 * incremental-dump.cc (main): Fix typos.
954c3e2e 10905
f8086623
RÁE
109062009-11-27 Rafael Avila de Espindola <espindola@google.com>
10907
10908 PR gold/11025
10909 * incremental-dump.cc (main): Use llu to print 64 bit values.
10910
3b0dd6ac
L
109112009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
10912 H.J. Lu <hongjiu.lu@intel.com>
10913
10914 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
10915 $(LIBDL).
10916 (incremental_dump_LDADD): Likewise.
10917 * Makefile.in: Regenerated.
10918
a6d1ef57 109192009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 10920
a6d1ef57
DK
10921 Revert:
10922
10923 2009-11-25 Doug Kwan <dougkwan@google.com>
10924
10925 * arm.cc (Target_arm::Target_arm): Move method definition
10926 outside of class definition. Add code to handle
10927 --target1-rel, --target1-abs and --target2= options.
10928 (Target_arm::get_reloc_reloc_type): Change method to be
10929 non-static and const.
10930 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
10931 New data member declaration.
10932 (Target_arm::Scan::local, Target_arm::Scan::global,
10933 Target_arm::Relocate::relocate,
10934 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10935 Adjust call to Target_arm::get_real_reloc_type.
10936 (Target_arm::get_real_reloc_type): Use command line options
10937 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10938 * options.h (--target1-rel, --target1-abs, --target2): New
10939 ARM-only options.
10940
50aeb7d4
DK
109412009-11-25 Doug Kwan <dougkwan@google.com>
10942
10943 * arm.cc (Target_arm::Target_arm): Move method definition outside of
10944 class definition. Add code to handle --target1-rel, --target1-abs
10945 and --target2= options.
10946 (Target_arm::get_reloc_reloc_type): Change method to be non-static
10947 and const.
10948 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
10949 member declaration.
10950 (Target_arm::Scan::local, Target_arm::Scan::global,
10951 Target_arm::Relocate::relocate,
10952 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
10953 call to Target_arm::get_real_reloc_type.
10954 (Target_arm::get_real_reloc_type): Use command line options to
10955 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
10956 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
10957 options.
10958
51938283
DK
109592009-11-25 Doug Kwan <dougkwan@google.com>
10960
10961 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
10962 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
10963 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
10964 formatting.
10965 (Arm_relocate_functions::thm_call): Replace body with a call to
10966 Arm_relocate_functions::thumb_branch_common.
10967 (Arm_relocate_functions::thm_jump24,
10968 Arm_relocate_functions::thm_xpc22): New method definitions.
10969 (Arm_relocate_functions::thumb_branch_common): New method definition.
10970 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
10971 operator.
10972 (Target_arm::Relocate::relocate): Adjust call to thm_call.
10973 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
10974
e2b8f3c4
RÁE
109752009-11-24 Rafael Avila de Espindola <espindola@google.com>
10976
10977 * Makefile.am: Build incremental-dump
10978 * Makefile.in: Regenerate.
10979 * incremental-dump.cc: New.
10980 * incremental.cc (Incremental_inputs_header_data,
10981 Incremental_inputs_entry_data): Move to incremental.h
10982 * incremental.h: (Incremental_inputs_header_data,
10983 Incremental_inputs_entry_data): Move from incremental.cc
10984
bcba9aec
RÁE
109852009-11-24 Rafael Avila de Espindola <espindola@google.com>
10986
10987 * incremental.cc (Incremental_inputs_header,
10988 Incremental_inputs_header_write, Incremental_inputs_entry,
10989 Incremental_inputs_entry_write): Add a typedef with the data type.
10990
7c3afe08
RÁE
109912009-11-24 Rafael Avila de Espindola <espindola@google.com>
10992
10993 * incremental.cc (Incremental_inputs_header,
10994 Incremental_inputs_header_write, Incremental_inputs_entry,
10995 Incremental_inputs_entry_write): Update comment about which
10996 type has the filed descriptions.
10997
d204b6e9
DK
109982009-11-15 Doug Kwan <dougkwan@google.com>
10999
11000 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11001 (Arm_relocate_functions::arm_branch_common): Change method defintion
11002 in class definition to a method declaration and update list of formal
11003 parameters.
11004 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11005 Arm_relocation_functions::jump24): Adjust call to
11006 Arm_relocate_functions::arm_branch_common. Update list of formal
11007 parameters.
11008 (Arm_relocate_functions::xpc25): New method definition.
11009 (Arm_relocate_functions::arm_branch_common): Move method defintion
11010 out from class definition. Use stubs for mode-switching and extending
11011 branch ranges.
11012 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11013 specially. Change code to enable use of stubs in ARM branches.
11014
43d12afe
DK
110152009-11-10 Doug Kwan <dougkwan@google.com>
11016
11017 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11018 in method declaration.
11019 (Target_arm::relocate_stub): New method declaration.
11020 (Target_arm::default_target): Change to return a pointer instead of
11021 a const reference.
11022 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11023 Target_arm::default_target.
11024 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11025 method definition.
11026 (Target_arm::relocate_section): Adjust view.
11027 (Target_arm::relocate_stub): New method definition.
11028
ac33a407
DK
110292009-11-10 Doug Kwan <dougkwan@google.com>
11030
11031 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11032 a format warning.
11033 * incremental.cc (open_incremental_binary): Initialized local
11034 variables to avoid warnings.
11035 * object.cc (make_elf_object): Ditto.
11036 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11037 a format warning.
e1df38aa 11038
88ee28e9
L
11039009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11040
11041 PR gold/10930
11042 * testsuite/plugin_test.c: Include "config.h".
11043
2daedcd6
DK
110442009-11-09 Doug Kwan <dougkwan@google.com>
11045
11046 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11047 (arm_symbol_value): Remove.
11048 (Arm_relocate_functions::arm_branch_common,
11049 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11050 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11051 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11052 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11053 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11054 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11055 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11056 Arm_relocate_functions::thm_mobw_abs_nc,
11057 Arm_relocate_functions::thm_mov_abs,
11058 Arm_relocate_functions::movw_prel_nc,
11059 Arm_relocate_functions::thm_movt_abs,
11060 Arm_relocate_functions::movt_prel,
11061 Arm_relocate_functions::thm_movw_prel_nc,
11062 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11063 (Target_arm::Relocate::relocate): Only decompose address into two
11064 parts if relocation type uses the thumb-bit and pass the actual
11065 bit instead of a flag indicating that the thumb-bit is used. Adjust
11066 calls to methods in Arm_relocate_functions for this change.
11067
1276bc89 110682009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11069
11070 PR 10925
11071 * reloc.cc: Instantiate
11072 Sized_relobj::initialize_input_to_output_maps and
11073 Sized_relobj:free_input_to_output_maps.
11074
e53ad1b5
ILT
110752009-11-06 Ian Lance Taylor <iant@google.com>
11076
11077 PR 10876
11078 * defstd.cc (in_segment): Set only_if_ref true for "end".
11079
eb44217c
DK
110802009-11-06 Doug Kwan <dougkwan@google.com>
11081
11082 * arm.cc (class Reloc_stub): Correct a comment.
11083 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11084 (Target_arm::scan_section_for_stubs): New method declaration.
11085 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11086 Change methods from private to protected.
11087 (Target_arm::do_may_relax): New method definition.
11088 (Target_arm::do_relax, Target_arm::group_sections,
11089 Target_arm::scan_reloc_for_stub,
11090 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11091 (Target_arm::arm_input_section_map_): New data member declaration.
11092 (Target_arm::scan_reloc_for_stub,
11093 Target_arm::scan_reloc_section_for_stubs,
11094 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11095 Target_arm::do_relax): New method definitions.
11096
5d329b7d
ILT
110972009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11098
11099 * configure.ac: Check for (struct stat)::st_mtim
11100 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11101 * config.in: Regenerate.
11102 * configure: Regenerate.
11103
96a0d71b
ILT
111042009-11-05 Ian Lance Taylor <iant@google.com>
11105
11106 PR 10910
11107 * output.cc (Output_segment::add_output_section): Add missing
11108 return statement.
11109
594c8e5e
ILT
111102009-11-04 Ian Lance Taylor <iant@google.com>
11111
11112 PR 10880
11113 * object.h (class Object): Add is_needed and set_is_needed
11114 methods. Add is_needed_ field. Make bool fields into bitfields.
11115 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11116 defined in a dynamic object and referenced by a regular object,
11117 set is_needed for the dynamic object.
11118 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11119 if the file is marked with as_needed and it is not needed.
11120
22b127cc
ILT
111212009-11-04 Ian Lance Taylor <iant@google.com>
11122
11123 PR 10887
11124 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11125 tags if data is discarded by linker script.
11126 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11127 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11128 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11129 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11130
f5c870d2
ILT
111312009-11-04 Ian Lance Taylor <iant@google.com>
11132
11133 * layout.cc (Layout::get_output_section): Add is_interp and
11134 is_dynamic_linker_section parameters. Change all callers.
11135 (Layout::choose_output_section): Likewise.
11136 (Layout::make_output_section): Likewise.
11137 (Layout::add_output_section_data): Add is_dynamic_linker_section
11138 parameter. Change all callers.
11139 * layout.h (class Layout): Update declarations.
11140 * output.h (class Output_section): Add is_interp, set_is_interp,
11141 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11142 Add is_interp_, is_dynamic_linker_section_ fields. Change
11143 generate_code_fills_at_write_ to a bitfield.
11144 * output.cc (Output_section::Output_sections): Initialize new
11145 fields.
11146 (Output_segment::add_output_section): Add do_sort parameter.
11147 Change all callers.
11148
1ae4d23b
ILT
111492009-11-03 Ian Lance Taylor <iant@google.com>
11150
11151 PR 10860
11152 * options.h (class General_options): Add --warn-common.
11153 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11154 merging two common symbols.
11155 (Symbol_table::should_override): Handle --warn-common when merging
11156 a common symbol with a defined symbol. Use report_resolve_problem
11157 for multiple definitions.
11158 (Symbol_table::report_resolve_problem): New function.
11159 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11160
55da9579
DK
111612009-11-03 Doug Kwan <dougkwan@google.com>
11162
11163 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11164 stub_factory_.
11165 (Target_arm::stub_factory): New method definition.
11166 (Target_arm::new_arm_input_section,
11167 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11168 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11169 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11170 New type definitions.
11171 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11172 member declarations.
11173 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11174 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11175 New method definitions.
11176
37a9ac43
ILT
111772009-11-03 Ian Lance Taylor <iant@google.com>
11178
11179 * options.h (class General_options): Add --warn_constructors.
11180
b3d6a3d4
ILT
111812009-11-03 Ian Lance Taylor <iant@google.com>
11182
11183 PR 10893
11184 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11185 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11186
934b01dd
ILT
111872009-11-03 Ian Lance Taylor <iant@google.com>
11188
11189 PR 10895
11190 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11191 --msgid-bugs-address.
11192 (install-pdf): New target.
11193 (install-data_yes): Look up one directory to find mkinstalldirs.
11194
03c1939b
L
111952009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11196
11197 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11198 tree.
11199
ebd95253
DK
112002009-10-30 Doug Kwan <dougkwan@google.com>
11201
11202 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11203
e9bbb538
DK
112042009-10-30 Doug Kwan <dougkwan@google.com>
11205
11206 * arm.cc (Stub_addend_reader): New struct template definition
11207 and partial specializations.
11208 (Stub_addend_reader::operator()): New method definition for a
11209 partially specialized template.
11210
d5b40221
DK
112112009-10-30 Doug Kwan <dougkwan@google.com>
11212
11213 * arm.cc (Arm_relobj::processor_specific_flags): New method
11214 definition.
11215 (Arm_relobj::do_read_symbols): New method declaration.
11216 (Arm_relobj::processor_specific_flags_): New data member declaration.
11217 (Arm_dynobj): New class definition.
11218 (Target_arm::do_finalize_sections): Add input_objects parameter.
11219 (Target_arm::do_adjust_elf_header): New method declaration.
11220 (Target_arm::are_eabi_versions_compatible,
11221 (Target_arm::merge_processor_specific_flags): New method declaration.
11222 (Target_arm::do_make_elf_object): New overloaded method definitions
11223 and declaration.
11224 (Arm_relobj::do_read_symbols): New method definition.
11225 (Arm_dynobj::do_read_symbols): Ditto.
11226 (Target_arm::do_finalize_sections): Add input_objects parameters.
11227 Merge processor-specific flags from all input objects.
11228 (Target_arm::are_eabi_versions_compatible,
11229 Target_arm::merge_processor_specific_flags,
11230 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11231 New method definitions.
11232 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11233 Input_objects pointer type parameter.
11234 * layout.cc (Layout::finalize): Pass input objects to target's.
11235 finalize_sections function.
11236 * output.cc (Output_file_header::do_sized_write): Set ELF file
11237 header's processor-specific flags.
11238 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11239 Input_objects pointer type parameter.
11240 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11241 * target.h (Input_objects): New forward class declaration.
11242 (Target::processor_specific_flags,
11243 Target::are_processor_specific_flags_sect): New method definitions.
11244 (Target::finalize_sections): Add input_objects parameter.
11245 (Target::Target): Initialize processor_specific_flags_ and
11246 are_processor_specific_flags_set_.
11247 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11248 parameter.
11249 (Target::set_processor_specific_flags): New method definition.
11250 (Target::processor_specific_flags_,
11251 Target::are_processor_specific_flags_set_): New data member
11252 declarations.
11253 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11254 Input_objects pointer type parameter.
11255
ebabffbd
DK
112562009-10-30 Doug Kwan <dougkwan@google.com>
11257
11258 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11259
ad0f2072
ILT
112602009-10-28 Ian Lance Taylor <iant@google.com>
11261
11262 * object.h (class Relobj): Drop options parameter from
11263 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11264 do_scan_relocs, do_relocate. Change all callers.
11265 (class Sized_relobj): Drop options parameters from
11266 do_gc_process_relocs, do_scan_relocs, do_relocate,
11267 do_relocate_sections, relocate_sections, emit_relocs_scan,
11268 emit_relocs_scan_reltype. Change all callers.
11269 (struct Relocate_info): Remove options field and all references to
11270 it.
11271 * reloc.h (class Read_relocs): Remove options constructor
11272 parameter and options_ field. Change all callers.
11273 (class Gc_process_relocs, class Scan_relocs): Likewise.
11274 (class Relocate_task): Likewise.
11275 * target-reloc.h (scan_relocs): Remove options parameter. Change
11276 all callers.
11277 (scan_relocatable_relocs): Likewise.
11278 * target.h (class Sized_target): Remove options parameter from
11279 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11280 all callers.
11281 * gc.h (gc_process_relocs): Remove options parameter. Change all
11282 callers.
11283 * arm.cc: Update functions to remove options parameters.
11284 * i386.cc: Likewise.
11285 * powerpc.cc: Likewise.
11286 * sparc.cc: Likewise.
11287 * x86_64.cc: Likewise.
11288 * testsuite/testfile.cc: Likewise.
11289
8ffa3667
DK
112902009-10-28 Doug Kwan <dougkwan@google.com>
11291
11292 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11293 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11294 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11295 New method definitions.
11296
40f36857
CC
112972009-10-28 Cary Coutant <ccoutant@google.com>
11298
11299 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11300 (Plugin::cleanup_done_): New member.
11301 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11302 (Plugin_manager::cleanup_done_): Remove.
11303 (Plugin_manager::add_input_file): Edit error message.
11304 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11305 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11306
2c849493
ILT
113072009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11308
11309 * fileread.cc: (File_read::View::~View): Use the new
11310 data_ownership_ filed.
11311 (File_read::~File_read): Dispose the new whole_file_view_.
11312 (File_read::open): Mmap the whole file if needed.
11313 (File_read::open): Use whole_file_view_ instead of contents_.
11314 (File_read::find_view): Use whole_file_view_ if applicable.
11315 (File_read::do_read): Use whole_file_view_ instead of contents_.
11316 (File_read::make_view): Use whole_file_view_ instead of contents_,
11317 update File_read::View::View call.
11318 (File_read::find_or_make_view): Update File_read::View::View
11319 call.
11320 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11321 remove contents_
11322 (File_read::View::Data_ownership): New enum.
11323 (File_read::View::View): Replace bool mapped_ with Data_ownership
11324 argument.
11325 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11326 (File_read::View::data_ownership_): New field.
11327 (File_read::contents_): Remove (replaced by whole_file_view_).
11328 (File_read::whole_file_view_): New field.
11329 * options.h (class General_options): Add --keep-files-mapped.
11330
24998053
CC
113312009-10-27 Cary Coutant <ccoutant@google.com>
11332
11333 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11334 * testsuite/Makefile.am (plugin_test_5): New test case.
11335 * testsuite/Makefile.in: Regenerate.
11336
72adc4fa
DK
113372009-10-25 Doug Kwan <dougkwan@google.com>
11338
11339 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11340 from private to protected to allow access by child class.
11341 (Sized_relobj::do_relocate_sections): New method declaration.
11342 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11343 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11344 Sized_relobj::relocate_sections. Instantiate template explicitly
11345 for different target sizes and endianity.
11346
07f508a2
DK
113472009-10-24 Doug Kwan <dougkwan@google.com>
11348
11349 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11350 (Arm_input_section::as_arm_input_section): New method.
11351 (Arm_output_section): New class definition.
11352 (Arm_output_section::create_stub_group,
11353 Arm_output_section::group_sections): New method definitions.
11354
10ad9fe5
DK
113552009-10-22 Doug Kwan <dougkwan@google.com>
11356
11357 * arm.cc (Arm_input_section): New class definition.
11358 (Arm_input_section::init, Arm_input_section:do_write,
11359 Arm_input_section::set_final_data_size,
11360 Arm_input_section::do_reset_address_and_file_offset): New method
11361 definitions.
11362
56ee5e00
DK
113632009-10-21 Doug Kwan <dougkwan@google.com>
11364
11365 * arm.cc (Stub_table, Arm_input_section): New forward class
11366 declarations.
11367 (Stub_table): New class defintion.
11368 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11369 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11370 New method definition.
11371
b569affa
DK
113722009-10-21 Doug Kwan <dougkwan@google.com>
11373
11374 * arm.cc: Update copyright comments.
11375 (Target_arm): New forward class template declaration.
11376 (Arm_address): New type.
11377 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11378 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11379 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11380 constants.
11381 (Insn_template): Same.
11382 (DEF_STUBS): New macro.
11383 (Stub_type): New enum type.
11384 (Stub_template): New class definition.
11385 (Stub): Same.
11386 (Reloc_stub): Same.
11387 (Stub_factory): Same.
11388 (Target_arm::Target_arm): Initialize may_use_blx_ and
11389 should_force_pic_veneer_.
11390 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11391 Target_arm::should_force_pic_veneer,
11392 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11393 Target_arm::using_thumb_only, Target_arm:;default_target): New
11394 method defintions.
11395 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11396 New data member declarations.
11397 (Insn_template::size, Insn_template::alignment): New method defintions.
11398 (Stub_template::Stub_template): New method definition.
11399 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11400 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11401 (Stub_factory::Stub_factory): New method definition.
11402 * gold.h (string_hash): New template.
11403 * output.h (Input_section_specifier::hash_value): Use
11404 gold::string_hash.
11405 (Input_section_specifier::string_hash): Remove.
11406 * stringpool.cc (Stringpool_template::string_hash): Use
11407 gold::string_hash.
11408
6c172549
DK
114092009-10-20 Doug Kwan <dougkwan@google.com>
11410
11411 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11412 symbols of relaxed input sections.
11413 * output.h (Output_section::find_relaxed_input_section): Make
11414 method public.
11415
c5617f2f
DK
114162009-10-16 Doug Kwan <dougkwan@google.com>
11417
11418 * dynobj.cc (Versions::Versions): Initialize version_script_.
11419 Only insert base version symbol definition for a shared object
11420 if version script defines any version versions.
11421 (Versions::define_base_version): New method definition.
11422 (Versions::add_def): Check that base version is not needed.
11423 (Versions::add_need): Define base version lazily.
11424 * dynobj.h (Versions::define_base_version): New method declaration.
11425 (Versions::needs_base_version_): New data member declaration.
11426 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11427 (check_DATA): Add no_version_test.stdout.
11428 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11429 New make rules.
11430 * testsuite/Makefile.in: Regenerate.
11431 * testsuite/no_version_test.c: New file.
11432 * testsuite/no_version_test.sh: Ditto.
11433
3c12dcdb
DK
114342009-10-16 Doug Kwan <dougkwan@google.com>
11435
11436 * expression.cc (class Segment_start_expression): New class definition.
11437 (Segment_start_expression::value): New method definition.
11438 (script_exp_function_segment_start): Return a new
11439 Segment_start_expression.
11440 * gold/script-c.h (script_saw_segment_start_expression): New function
11441 prototype.
11442 * script-sections.cc (Script_sections::Script_sections): Initialize
11443 SAW_SEGMENT_START_EXPRESSION_ to false.
11444 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11445 and -Tbbs options to specify section addresses if given in
11446 command line and no SEGMENT_START expression is seen in a script.
11447 * script-sections.h (Script_sections::saw_segment_start_expression,
11448 Script_sections::set_saw_segment_start_expression): New method
11449 definition.
11450 (Script_sections::saw_segment_start_expression_): New data member
11451 declaration.
11452 * script.cc (script_saw_segment_start_expression): New function.
11453 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11454 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11455 script_test_7.sh and script_test_8.sh.
11456 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11457 script_test_8.stdout.
11458 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11459 (script_test_6, script_test_6.stdout, script_test_7,
11460 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11461 * Makefile.in: Regenerate.
11462 * testsuite/script_test_6.sh: New file.
11463 * testsuite/script_test_6.t: Same.
11464 * testsuite/script_test_7.sh: Same.
11465 * testsuite/script_test_7.t: Same.
11466 * testsuite/script_test_8.sh: Same.
11467
64b1ae37
DK
114682009-10-16 Doug Kwan <dougkwan@google.com>
11469
11470 * output.cc (Output_segment::set_section_list_address): Cast
11471 expressions to unsigned long long type to avoid format warnings.
11472
661be1e2
ILT
114732009-10-15 Ian Lance Taylor <iant@google.com>
11474
12edd763 11475 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11476 dot assignment to script_sections_.
12edd763
ILT
11477 * script-sections.cc (Script_sections::add_dot_assignment):
11478 Initialize if necessary.
11479
68b6574b
ILT
11480 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11481 program headers with no load segment if there is a linker script.
11482
661be1e2
ILT
11483 * layout.cc (Layout::set_segment_offsets): Align the file offset
11484 to the segment aligment for -N or -n with no load segment.
11485 * output.cc (Output_segment::add_output_section): Don't crash if
11486 the first section is a TLS section.
11487 (Output_segment::set_section_list_addresses): Print an error
11488 message if the address moves backward in a linker script.
11489 * script-sections.cc
11490 (Output_section_element_input::set_section_addresses): Don't
11491 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11492 (Orphan_output_section::set_section_addresses): Likewise.
11493
f15f61a7
DK
114942009-10-15 Doug Kwan <dougkwan@google.com>
11495
11496 * layout.cc (Layout::finish_dynamic_section): Generate tags
11497 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11498 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11499 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11500
82bb573a
ILT
115012009-10-14 Ian Lance Taylor <iant@google.com>
11502
11503 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11504 fields.
11505 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11506 data_shdr fields of relinfo.
11507 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11508 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11509 R_386_TLS_LDO_32, adjust based on section flags.
11510 (Target_i386::Relocate::fix_up_ldo): Remove.
11511
374ad285
ILT
115122009-10-13 Ian Lance Taylor <iant@google.com>
11513
11514 Add support for -pie.
11515 * options.h (class General_options): Add -pie and
11516 --pic-executable.
11517 (General_options::output_is_position_independent): Test -pie.
11518 (General_options::output_is_executable): Return true if not shared
11519 and not relocatable.
11520 (General_options::output_is_pie): Remove.
11521 * options.cc (General_options::finalize): Reject incompatible uses
11522 of -pie.
11523 * gold.cc (queue_middle_tasks): A -pie link is not static.
11524 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11525 * symtab.cc (Symbol::final_value_is_known): Return false if
11526 output_is_position_independent.
11527 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11528 output_is_position_independent.
11529 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11530 output_is_position_independent.
11531 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11532 output_is_position_independent.
11533 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11534 two_file_pie_test.
11535 (basic_pie_test.o, basic_pie_test): New targets.
11536 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11537 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11538 (two_file_pie_test): New target.
11539 * testsuite/Makefile.in: Rebuild.
11540 * README: Remove note saying that -pie is not supported.
11541
c6585162
ILT
115422009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11543
11544 * options.h (class General_options): Add -init and -fini.
11545 * layout.cc (Layout::finish_dynamic_section): Emit
11546 given init and fini functions.
11547
032ce4e9
ST
115482009-10-13 Sriraman Tallam <tmsriram@google.com>
11549
11550 * gc.h (gc_process_relocs): Check if icf is enabled using new
11551 function.
11552 * gold.cc (queue_initial_tasks): Likewise.
11553 (queue_middle_tasks): Likewise.
11554 * object.cc (do_layout): Likewise.
11555 * symtab.cc (is_section_folded): Likewise.
11556 * main.cc (main): Likewise.
11557 * reloc.cc (Read_relocs::run): Likewise.
11558 (Sized_relobj::do_scan_relocs): Likewise.
11559 * icf.cc (is_function_ctor_or_dtor): New function.
11560 (Icf::find_identical_sections): Check if function is ctor or dtor when
11561 safe icf is chosen.
11562 * options.h (General_options::icf): Change option to be an enum.
11563 (Icf_status): New enum.
11564 (icf_enabled): New method.
11565 (icf_safe_folding): New method.
11566 (set_icf_status): New method.
11567 (icf_status_): New variable.
11568 * (options.cc) (General_options::finalize): Set icf_status_.
11569 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11570 icf_test and icf_keep_unique_test to use the --icf enum flag.
11571 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11572 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11573
f345227a
ST
115742009-10-12 Sriraman Tallam <tmsriram@google.com>
11575
11576 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11577 includes to gc.h and icf.h.
11578 * arm.cc: Include gc.h.
11579 * gold.cc: Likewise.
11580 * i386.cc: Likewise.
11581 * powerpc.cc: Likewise.
11582 * sparc.cc: Likewise.
11583 * x86_64.cc: Likewise.
11584 * gc.h: Include icf.h.
11585
1c7814ed
ILT
115862009-10-11 Ian Lance Taylor <iant@google.com>
11587
11588 * plugin.cc: Include "gold.h" before other header files.
11589
ae3b5189
CD
115902009-10-10 Chris Demetriou <cgd@google.com>
11591
11592 * options.h (Input_file_argument::Input_file_type): New enum.
11593 (Input_file_argument::is_lib_): Replace with...
11594 (Input_file_argument::type_): New member.
11595 (Input_file_argument::Input_file_argument): Take Input_file_type
11596 'type' rather than boolean 'is_lib' as second argument.
11597 (Input_file_argument::is_lib): Use type_.
11598 (Input_file_argument::is_searched_file): New function.
11599 (Input_file_argument::may_need_search): Handle is_searched_file.
11600 * options.cc (General_options::parse_library): Support -l:filename.
11601 (General_options::parse_just_symbols): Update for Input_file_argument
11602 changes.
11603 (Command_line::process): Likewise.
11604 * archive.cc (Archive::get_file_and_offset): Likewise.
11605 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11606 * script.cc (read_script_file, script_add_file): Likewise.
11607 * fileread.cc (Input_file::Input_file): Likewise.
11608 (Input_file::will_search_for): Handle is_searched_file.
11609 (Input_file::open): Likewise.
11610 * readsyms.cc (Read_symbols::get_name): Likewise.
11611 * testsuite/Makefile.am (searched_file_test): New test.
11612 * testsuite/Makefile.in: Regenerate.
11613 * testsuite/searched_file_test.cc: New file.
11614 * testsuite/searched_file_test_lib.cc: New file.
11615
f3048a1d
ILT
116162009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11617 Ian Lance Taylor <iant@google.com>
11618
11619 * descriptor.cc: Include <cstdio> and "binary-io.h".
11620 (Descriptors::open): Open the files in binary mode always.
11621 * script.cc (Lex::get_token): Treat \r as whitespace.
11622
d4780e57
ILT
116232009-10-09 Ian Lance Taylor <iant@google.com>
11624
11625 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11626
d9a893b8
ILT
116272009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11628 Ian Lance Taylor <iant@google.com>
11629
11630 * configure.ac: Check for readv function also.
11631 * fileread.cc (readv): Define if not HAVE_READV.
11632 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11633 does not exist.
11634 * config.in: Regenerate.
11635 * configure: Regenerate.
11636
c0a62865
DK
116372009-10-09 Doug Kwan <dougkwan@google.com>
11638
11639 * layout.cc (Layout::make_output_section): Call target hook to make
11640 ordinary output section.
11641 (Layout::finalize): Adjust parameter list of call the
11642 Target::may_relax().
11643 * layout.h (class Layout::section_list): New method.
11644 * merge.h (Output_merge_base::entsize): Change visibility to public.
11645 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11646 New methods.
11647 (Output_merge_string::do_is_string): New method.
11648 * object.cc (Sized_relobj::do_setup): renamed from
11649 Sized_relobj::set_up.
11650 * object.h (Sized_relobj::adjust_shndx,
11651 Sized_relobj::initializ_input_to_output_maps,
11652 Sized_relobj::free_input_to_output_maps): Change visibilities to
11653 protected.
11654 (Sized_relobj::setup): Virtualize.
11655 (Sized_relobj::do_setup): New method declaration.
11656 (Sized_relobj::invalidate_section_offset,
11657 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11658 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11659 * options.cc (parse_int): New function.
11660 * options.h (parse_int): New declaration.
11661 (DEFINE_int): New macro.
11662 (stub_group_size): New option.
11663 * output.cc (Output_section::Output_section): Initialize memebers
11664 merge_section_map_, merge_section_by_properties_map_,
11665 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11666 (Output_section::add_input_section): Handled deferred code-fill
11667 generation and remove an old comment.
11668 (Output_section::add_relaxed_input_section): New method definition.
11669 (Output_section::add_merge_input_section): Use merge section by
11670 properties map to speed to search. Update merge section maps
11671 as appropriate.
11672 (Output_section::build_relaxation_map): New method definition.
11673 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11674 Same.
11675 (Output_section::relax_input_section): Renamed to
11676 Output_section::convert_input_sections_to_relaxed_sections and change
11677 interface to take a vector of pointers to relaxed sections.
11678 (Output_section::find_merge_section,
11679 Output_section::find_relaxed_input_section): New method definitions.
11680 (Output_section::is_input_address_mapped,
11681 Output_section::output_offset, Output_section::output_address):
11682 Use output section data maps to speed up searching.
11683 (Output_section::find_starting_output_address): Add comments.
11684 (Output_section::do_write,
11685 Output_section::write_to_postprocessing_buffer): Do code-fill
11686 generation as appropriate.
11687 (Output_section::get_input_sections): Invalidate relaxed input section
11688 map.
11689 (Output_section::restore_states): Adjust type of checkpoint .
11690 Invalidate relaxed input section map.
11691 * output.h (Output_merge_base): New class declaration.
11692 (Input_section_specifier): New class defintion.
11693 (class Output_relaxed_input_section) Change base class to
11694 Output_section_data_build.
11695 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11696 base class initializer.
11697 (Output_section::add_relaxed_input_section): New method declaration.
11698 (Output_section::Input_section): Change visibility to protected.
2e702c99 11699 (Output_section::Input_section::relobj,
c0a62865
DK
11700 Output_section::Input_section::shndx): Handle relaxed input sections.
11701 Output_section::input_sections) Change visibility to protected. Also
11702 define overload to return a non-const pointer.
11703 (Output_section::Merge_section_properties): New class defintion.
11704 (Output_section::Merge_section_by_properties_map,
11705 Output_section::Output_section_data_by_input_section_map,
11706 Output_section::Relaxation_map): New types.
11707 (Output_section::relax_input_section): Rename method to
11708 Output_section::convert_input_sections_to_relaxed_sections and change
11709 interface to take a vector of relaxed section pointers.
11710 (Output_section::find_merge_section,
11711 Output_section::find_relaxed_input_section,
11712 Output_section::build_relaxation_map,
11713 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11714 New method declarations.
11715 (Output_section::merge_section_map_
11716 Output_section::merge_section_by_properties_map_,
11717 Output_section::relaxed_input_section_map_,
11718 Output_section::is_relaxed_input_section_map_valid_,
11719 Output_section::generate_code_fills_at_write_): New data members.
11720 * script-sections.cc
11721 (Output_section_element_input::set_section_addresses): Call
11722 current_data_size and addralign methods of relaxed input sections.
11723 (Orphan_output_section::set_section_addresses): Call current_data_size
11724 and addralign methods of relaxed input sections.
11725 * symtab.cc (Symbol_table::compute_final_value): Extract template
11726 from the body of Symbol_table::sized_finalize_symbol.
11727 (Symbol_table::sized_finalized_symbol): Call
11728 Symbol_table::compute_final_value.
11729 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11730 (Symbol_table::compute_final_value): New templated method declaration.
11731 * target.cc (Target::do_make_output_section): New method defintion.
11732 * target.h (Target::make_output_section): New method declaration.
11733 (Target::relax): Add more parameters for input objects, symbol table
11734 and layout. Adjust call to do_relax.
11735 (Target::do_make_output_section): New method declaration.
11736 (Target::do_relax): Add parameters for input objects, symbol table
11737 and layout.
11738
d446d6c4
ILT
117392009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11740
11741 * pread.c: Include stdio.h.
11742
bc06c745
ILT
117432009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11744
11745 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11746 defined.
11747
75aea3d0
ILT
117482009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11749
11750 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11751 Change read_shndx type to unsigned int.
11752 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11753 int.
11754 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11755 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11756 Change read_shndx type to unsigned int.
11757 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11758 int.
11759 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11760 * layout.cc (Layout::create_symtab_sections): Cast the result of
11761 local_symcount * symsize to off_t in the gold_assert.
11762
be8fcb75
ILT
117632009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11764
11765 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11766 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11767 R_ARM_BASE_ABS.
11768 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11769 (Arm_relocate_functions::thm_abs5): New function.
11770 (Arm_relocate_functions::abs12): New function.
11771 (Arm_relocate_functions::abs16): New function.
11772 (Arm_relocate_functions::base_abs): New function.
11773 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
11774 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
11775 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
11776 R_ARM_BASE_ABS.
11777 (Scan::global): Likewise.
11778 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
11779 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
11780 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
11781 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
11782 R_ARM_BASE_ABS.
11783
c2a122b6
ILT
117842009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11785
11786 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
11787 (Arm_relocate_functions::movt_prel): New function.
11788 (Arm_relocate_functions::thm_movw_prel_nc): New function.
11789 (Arm_relocate_functions::thm_movt_prel): New function.
11790 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
11791 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
11792 (Scan::global, Relocate::relocate): Likewise.
11793 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11794
c4aa1e2d
ILT
117952009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11796
11797 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
11798 Incremental_checker.
11799 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
11800 unsigned int.
11801 (class Incremental_inputs_header): New class.
11802 (Incremental_inputs_header_writer): Edit comment.
11803 (Incremental_inputs_entry): New class.
11804 (Incremental_inputs_entry_writer): Edit comment.
11805 (Sized_incremental_binary::do_find_incremental_inputs_section):
11806 Add *strtab_shndx parameter, fill it.
11807 (Sized_incremental_binary::do_check_inputs): New method.
11808 (Incremental_checker::can_incrementally_link_output_file): Use
11809 Sized_incremental_binary::check_inputs.
11810 (Incremental_inputs::report_command_line): Save command line in
11811 command_line_.
11812 * incremental.h:
11813 (Incremental_binary::find_incremental_inputs_section): New
11814 method.
11815 (Incremental_binary::do_find_incremental_inputs_section): Add
11816 strtab_shndx parameter.
11817 (Incremental_binary::do_check_inputs): New pure virtual method.
11818 (Sized_incremental_binary::do_check_inputs): Declare.
11819 (Incremental_checker::Incremental_checker): Add incremental_inputs
11820 parameter, use it to initialize incremental_inputs_.
11821 (Incremental_checker::incremental_inputs_): New field.
11822 (Incremental_checker::command_line): New method.
11823 (Incremental_checker::inputs): New method.
11824 (Incremental_checker::command_line_): New field.
11825
c549a694
ILT
118262009-10-09 Mikolaj Zalewski <mikolajz@google.com>
11827
11828 * incremental.cc: Include <cstdarg> and "target-select.h".
11829 (vexplain_no_incremental): New function.
11830 (explain_no_incremental): New function.
11831 (Incremental_binary::error): New method.
11832 (Sized_incremental_binary::do_find_incremental_inputs_section): New
11833 method.
11834 (make_sized_incremental_binary): New function.
11835 (open_incremental_binary): New function.
11836 (can_incrementally_link_file): Add checks if output is ELF and has
11837 inputs section.
11838 * incremental.h: Include "elfcpp_file.h" and "output.h".
11839 (Incremental_binary): New class.
11840 (Sized_incremental_binary): New class.
11841 (open_incremental_binary): Declare.
11842 * object.cc (is_elf_object): Use
11843 elfcpp::Elf_recognizer::is_elf_file.
11844 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
11845 * output.h (Output_file::filesize): New method.
11846
fd3c5f0b
ILT
118472009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11848
11849 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
11850 New function.
11851 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
11852 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
11853 function.
11854 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
11855 function.
11856 (Arm_relocate_functions::movw_abs_nc): New function.
11857 (Arm_relocate_functions::movt_abs): New function.
11858 (Arm_relocate_functions::thm_movw_abs_nc): New function.
11859 (Arm_relocate_functions::thm_movt_abs): New function.
11860 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
11861 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
11862 (Scan::global): Likewise.
11863 (Relocate::relocate): Likewise.
11864 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11865
7f5309a5
ILT
118662009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11867
11868 * arm.cc (Arm_relocate_functions::got_prel) New function.
11869 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
11870 (Relocate::relocate): Likewise.
11871 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11872
364c7fa5
ILT
118732009-10-06 Ian Lance Taylor <iant@google.com>
11874
11875 * options.h (class General_options): Define
11876 split_stack_adjust_size parameter.
11877 * object.h (class Object): Add uses_split_stack_ and
11878 has_no_split_stack_ fields. Add uses_split_stack and
11879 has_no_split_stack accessor functions. Declare
11880 handle_split_stack_section.
11881 (class Reloc_symbol_changes): Define.
11882 (class Sized_relobj): Define Function_offsets. Declare
11883 split_stack_adjust, split_stack_adjust_reltype, and
11884 find_functions.
11885 * object.cc (Object::handle_split_stack_section): New function.
11886 (Sized_relobj::do_layout): Call handle_split_stack_section.
11887 * dynobj.cc (Sized_dynobj::do_layout): Call
11888 handle_split_stack_section.
11889 * reloc.cc (Sized_relobj::relocate_sections): Call
11890 split_stack_adjust for executable sections in split_stack
11891 objects. Pass reloc_map to relocate_section.
11892 (Sized_relobj::split_stack_adjust): New function.
11893 (Sized_relobj::split_stack_adjust_reltype): New function.
11894 (Sized_relobj::find_functions): New function.
11895 * target-reloc.h: Include "object.h".
11896 (relocate_section): Add reloc_symbol_changes parameter. Change
11897 all callers.
11898 * target.h (class Target): Add calls_non_split method. Declare
11899 do_calls_non_split virtual method. Declare match_view and
11900 set_view_to_nop.
11901 * target.cc: Include "elfcpp.h".
11902 (Target::do_calls_non_split): New function.
11903 (Target::match_view): New function.
11904 (Target::set_view_to_nop): New function.
11905 * gold.cc (queue_middle_tasks): Give an error if mixing
11906 split-stack and non-split-stack objects with -r.
11907 * i386.cc (Target_i386::relocate_section): Add
11908 reloc_symbol_changes parameter.
11909 (Target_i386::do_calls_non_split): New function.
11910 * x86_64.cc (Target_x86_64::relocate_section): Add
11911 reloc_symbol_changes parameter.
11912 (Target_x86_64::do_calls_non_split): New function.
11913 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
11914 parameter.
11915 * powerpc.cc (Target_powerpc::relocate_section): Add
11916 reloc_symbol_changes parameter.
11917 * sparc.cc (Target_sparc::relocate_section): Add
11918 reloc_symbol_changes parameter.
11919 * configure.ac: Call AM_CONDITIONAL for the default target.
11920 * configure: Rebuild.
11921 * testsuite/Makefile.am (TEST_AS): New variable.
11922 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
11923 (check_DATA): Add split_i386 and split_x86_64 files.
11924 (SPLIT_DEFSYMS): Define.
11925 (split_i386_[1234n].o): New targets.
11926 (split_i386_[124]): New targets.
11927 (split_i386_[1234r].stdout): New targets.
11928 (split_x86_64_[1234n].o): New targets.
11929 (split_x86_64_[124]): New targets.
11930 (split_x86_64_[1234r].stdout): New targets.
11931 (MOSTLYCLEANFILES): Add new executables.
11932 * testsuite/split_i386.sh: New file.
11933 * testsuite/split_x86_64.sh: New file.
11934 * testsuite/split_i386_1.s: New file.
11935 * testsuite/split_i386_2.s: New file.
11936 * testsuite/split_i386_3.s: New file.
11937 * testsuite/split_i386_4.s: New file.
11938 * testsuite/split_i386_n.s: New file.
11939 * testsuite/split_x86_64_1.s: New file.
11940 * testsuite/split_x86_64_2.s: New file.
11941 * testsuite/split_x86_64_3.s: New file.
11942 * testsuite/split_x86_64_4.s: New file.
11943 * testsuite/split_x86_64_n.s: New file.
11944 * testsuite/testfile.cc (Target_test): Update relocation_section
11945 function.
11946 * testsuite/Makefile.in: Rebuild.
11947
e8a9fcda
ILT
119482009-10-06 Ian Lance Taylor <iant@google.com>
11949
11950 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
11951 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
11952 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
11953 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
11954 the address on ldo_addrs_.
11955 (Target_i386::Relocate::fix_up_ldo): New function.
11956
e99daf92
ILT
119572009-10-06 Rafael Espindola <espindola@google.com>
11958
11959 * plugin.cc (add_input_library): New.
11960 (Plugin::load): Add add_input_library to tv.
11961 (Plugin_manager::add_input_file): Add the is_lib argument.
11962 (add_input_file): Update call to Plugin_manager::add_input_file.
11963 (add_input_library): New.
11964 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
11965
966d4097
DK
119662009-09-30 Doug Kwan <dougkwan@google.com>
11967
11968 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
11969 symbol and call Symbol::may_need_copy_reloc to determine if
11970 a copy reloc is needed.
11971 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
11972 nocopyreloc is given in command line.
11973 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
11974 given in command line.
11975 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
11976 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
11977 of the removed Target_i386::may_need_copy_reloc.
11978 * options.h (copyreloc): New option with default value false.
11979 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11980 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
11981 instead of the removed Target_powerpc::may_need_copy_reloc.
11982 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
11983 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
11984 instead of the removed Target_sparc::may_need_copy_reloc.
11985 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
11986 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
11987 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
11988 instead of the removed Target_x86_64::may_need_copy_reloc.
11989
029ba973
ILT
119902009-09-30 Ian Lance Taylor <iant@google.com>
11991
11992 * object.h (class Object): Remove target_ field, and target,
11993 sized_target, and set_target methods.
11994 (Object::sized_target): Remove.
11995 (class Sized_relobj): Update declarations. Remove sized_target.
11996 * object.cc (Sized_relobj::setup): Remove target parameter.
11997 Change all callers.
11998 (Input_objects::add_object): Don't do anything with the target.
11999 (make_elf_sized_object): Add punconfigured parameter. Change all
12000 callers. Set or test parameter target.
12001 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12002 Change all callers.
12003 * parameters.cc (Parameters::set_target): Change parameter type to
12004 be non-const.
12005 (Parameters::default_target): Remove.
12006 (set_parameters_target): Change parameter type to be non-const.
12007 (parameters_force_valid_target): New function.
12008 (parameters_clear_target): New function.
12009 * parameters.h (class Parameters): Update declarations. Remove
12010 default_target method. Add sized_target and clear_target
12011 methods. Change target_ to be non-const.
12012 (set_parameters_target): Update declaration.
12013 (parameters_force_valid_target): Declare.
12014 (parameters_clear_target): Declare.
12015 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12016 as NULL if we aren't searching.
12017 (Add_symbols::run): Don't check for compatible target.
12018 * fileread.cc (Input_file::open_binary): Call
12019 parameters_force_valid_target.
12020 * gold.cc (queue_middle_tasks): Likewise.
12021 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12022 set_target on object.
12023 * dynobj.h (class Sized_dynobj): Update declarations.
12024 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12025 make_elf_object returns NULL.
12026 (Archive::include_member): Don't check whether object target is
12027 compatible.
12028 * output.cc (Output_section::add_input_section): Get target from
12029 parameters.
12030 (Output_section::relax_input_section): Likewise.
12031 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12032 parameters.
12033 (Sized_relobj::do_scan_relocs): Likewise.
12034 (Sized_relobj::relocate_sections): Likewise.
12035 * resolve.cc (Symbol_table::resolve): Likewise.
12036 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12037 parameter. Change all callers.
12038 (Symbol_table::add_from_object): Get target from parameters.
12039 (Symbol_table::add_from_relobj): Don't check object target.
12040 (Symbol_table::add_from_dynobj): Likewise.
12041 (Symbol_table::define_special_symbol): Get target from
12042 parameters.
12043 * symtab.h (class Symbol_table): Update declaration.
12044 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12045 parameter. Change all callers. Clear parameter target.
12046 (Binary_test): Test target here.
12047 * testsuite/object_unittest.cc (gold_testsuite): Remove
12048 target_test_pointer parameter. Change all callers.
12049 (Object_test): Test target here.
12050
a6a22b83
ILT
120512009-09-26 Ian Lance Taylor <iant@google.com>
12052
12053 * testsuite/initpri1.c: Don't try to use constructor priorities if
12054 compiling with gcc before 4.3.
12055
6a8f49fe
ILT
120562009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12057
12058 * testsuite/retain_symbols_file_test.sh (check_present): Change
12059 output file name to retain_symbols_file_test.stdout.
12060 (check_absent): Likewise.
12061
8c604651
CS
120622009-09-18 Craig Silverstein <csilvers@google.com>
12063
12064 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12065 * options.cc: Include <cerrno> and <fstream>.
12066 (General_options::finalize): Parse -retain-symbols-file tag.
12067 * options.h: New flag.
12068 (General_options): New method should_retain_symbol, new
12069 variable symbols_to_retain.
12070 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12071 should_retain_symbol map.
12072 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12073 * testsuite/Makefile.in: Regenerate.
12074 * testsuite/retain_symbols_file_test.sh: New file.
12075
ca58b19f
NC
120762009-09-18 Nick Clifton <nickc@redhat.com>
12077
12078 * po/es.po: Updated Spanish translation.
12079
20e6d0d6
DK
120802009-09-17 Doug Kwan <dougkwan@google.com>
12081
12082 * debug.h (DEBUG_RELAXATION): New constant.
12083 (DEBUG_ALL): Add DEBUG_RELAXATION.
12084 (debug_string_to_enum): Add relaxation debug option.
12085 * layout.cc
12086 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12087 Layout::Relaxation_debug_check::read_sections,
12088 Layout::Relaxation_debug_check::read_sections): New method definitions.
12089 (Layout::Layout): Initialize data members
12090 record_output_section_data_from_scrips_,
12091 script_output_section_data_list_ and relaxation_debug_check_.
12092 (Layout::save_segments, Layout::restore_segments,
12093 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12094 Layout::relaxation_loop_body): New method definitions.
12095 (Layout::finalize): Support relaxation. Move section layout code to
12096 Layout::relaxation_loop_body.
12097 (Layout::set_asection_address_from_script): Move code for orphan
12098 section placement out.
12099 (Layout::place_orphan_sections_in_script): New method definition.
12100 * layout.h (Output_segment_headers, Output_file_header):
12101 New forward class declarations.
12102 (Layout::~Layout): Define.
12103 (Layout::new_output_section_data_from_script): New method definition.
12104 (Layout::place_orphan_sections_in_script): New method declaration.
12105 (Layout::Segment_states): New type declaration.
12106 (Layout::save_segments, Layout::restore_segments,
12107 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12108 Layout::relaxation_loop_body): New method declarations.
12109 (Layout::Output_section_data_list): New type declaration.
12110 (Layout::Relaxation_debug_check): New class definition.
12111 (Layout::record_output_section_data_from_script_,
12112 Layout::script_output_section_data_list_, Layout::segment_states_,
12113 Layout::relaxation_debug_check_): New data members.
12114 * output.cc: (Output_section_headers::do_size): New method definition.
12115 (Output_section_headers::Output_section_headers): Move size
12116 computation to Output_section_headers::do_size.
12117 (Output_segment_headers::do_size): New method definition.
e1df38aa 12118 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12119 Output_file_header::do_size and call it.
12120 (Output_file_header::do_size): New method definition.
12121 (Output_data_group::Output_data_group): Adjust call to
12122 Output_section_data.
12123 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12124 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12125 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12126 RELAXED_INPUT_SECTION_CODE.
12127 (Output_section::Output_section): Initialize data member checkpoint_.
12128 (Output_section::~Output_section): Delete checkpoint object pointed
12129 by checkpoint_.
12130 (Output_section::add_input_section): Always add an Input_section if
12131 relaxing.
12132 (Output_section::add_merge_input_section): Add assert.
12133 (Output_section::relax_input_section): New method definition.
12134 (Output_section::set_final_data_size): Set load address to zero for
12135 an unallocated section.
12136 (Output_section::do_address_and_file_offset_have_reset_values):
12137 New method definition.
12138 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12139 Handle relaxed input section.
12140 (Output_section::sort_attached_input_sections): Checkpoint input
12141 section list lazily.
12142 (Output_section::get_input_sections): Change type of input_sections to
12143 list of Simple_input_section pointers. Checkpoint input section list
12144 lazily. Also handle relaxed input sections.
12145 (Output_section::add_input_section_for_script): Take a reference to
12146 a Simple_input_section object instead of Relobj pointer and section
12147 index as parameter. Handle relaxed input sections.
12148 (Output_section::save_states, Output_section::restore_states): New
12149 method definitions.
12150 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12151 (Output_data::is_data_size_fixed): New method definition.
12152 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12153 if it is fixed.
12154 (Output_data::address_and_file_offset_have_reset_values): New method
12155 definition.
12156 (Output_data::do_address_and_file_offset_have_reset_values): New method
12157 definition.
12158 (Output_data::set_data_size): Check that data size is not fixed.
12159 (Output_data::fix_data_size): New method definition.
12160 (Output_data::is_data_size_fixed_): New data member.
12161 (Output_section_headers::set_final_data_size): New method definition.
12162 (Output_section_headers::do_size): New method declaration.
12163 (Output_segment_headers::set_final_data_size): New method definition.
12164 (Output_segment_headers::do_size): New method declaration.
12165 (Output_file_header::set_final_data_size)::New method definition.
12166 (Output_file_header::do_size)::New method declaration.
12167 (Output_section_data::Output_section_data): Add new parameter
12168 is_data_size_fixed and use it to fix data size.
12169 (Output_data_const::Output_data_const): Adjust call to base class
12170 constructor and fix data size.
12171 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12172 base class constructor and fix data size.
12173 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12174 base class constructor and fix data size.
12175 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12176 class constructor and fix data size.
12177 (Output_data_group::set_final_data_size): New method definition.
12178 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12179 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12180 class constructor and fix data size.
12181 (Output_relaxed_input_section): New class definition.
12182 (Output_section::Simple_input_section): New class definition.
12183 (Output_section::get_input_sections): Adjust parameter list.
12184 (Output_section::add_input_section_for_script): Same.
12185 (Output_section::save_states, Output_section::restore_states,
12186 Output_section::do_address_and_file_offset_have_reset_values,
12187 (Output_section::Input_section::Input_section): Handle
12188 RELAXED_INPUT_SECTION_CODE. Add new overload for
12189 Output_relaxed_input_section.
12190 (Output_section::Input_section::is_input_section,
12191 Output_section::Input_section::set_output_section): Handle relaxed
12192 input section.
12193 (Output_section::Input_section::is_relaxed_input_section,
12194 Output_section::Input_section::output_section_data,
12195 Output_section::Input_section::relaxed_input_section): New method
12196 definitions.
12197 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12198 value.
12199 (Output_section::Input_section::u1_): Update comments.
12200 (Output_section::Input_section::u2_): Add new union member poris.
12201 (Output_section::Checkpoint_output_section): New classs definition.
12202 (Output_section::relax_input_section): New method declaration.
12203 (Output_section::checkpoint_): New data member.
12204 (Output_segment): Update comments.
12205 (Output_segment::Output_segment): Un-privatize copy constructor.
12206 (Output_segment::operator=): Un-privatize.
12207 * script-sections.cc (Output_section_element::Input_section_list):
12208 Change element type to Output_section::Simple_input_section.
12209 (Output_section_element_dot_assignment::set_section_addresses):
12210 Register output section data for relaxation clean up.
12211 (Output_data_exression::Output_data_expression): Adjust call to base
12212 constructor to fix data size.
12213 (Output_section_element_data::set_section_addresses): Register
12214 Output_data_expression object for relaxation clean up.
12215 (struct Input_section_info): Replace Relobj pointer and section index
12216 pair with Output_section::Simple_input_section and Convert struct to a
12217 class.
12218 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12219 Input_section_info data member to use accessors.
20e6d0d6
DK
12220 (Output_section_element_input::set_section_addresses): Use layout
12221 parameter. Adjust code to use Output_section::Simple_input_section
12222 and Input_secction_info classes. Register filler for relaxation
12223 clean up.
12224 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12225 and section index pair with Output_section::Simple_input_section
12226 class. Adjust code accordingly.
12227 (Phdrs_element::release_segment): New method definition.
12228 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12229 segment list.
12230 (Script_sections::release_segments): New method definition.
12231 * gold/script-sections.h (Script_sections::release_segments): New
12232 method declaration.
12233 * gold/target.h (Target::may_relax, Target::relax,
12234 Target::do_may_relax, Target::do_relax): New method definitions.
12235
5e445df6
ILT
122362009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12237
12238 * arm.cc (has_signed_unsigned_overflow): New function.
12239 (Arm_relocate_functions::abs8): New function.
12240 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12241 (Target_arm::Scan::global): Likewise.
12242 (Target_arm::relocate::relocate): Likewise.
12243 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12244 Likewise.
12245
8c604651 122462009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12247
12248 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12249 * testsuite/Makefile.in: Regenerate.
12250
1e9cc1c2
NC
122512009-09-11 Nick Clifton <nickc@redhat.com>
12252
12253 * po/gold.pot: Updated by the Translation project.
12254
6a89f575
CC
122552009-09-08 Cary Coutant <ccoutant@google.com>
12256
12257 * output.cc (Output_file::open): Add execute permission to empty file.
12258 * testsuite/Makefile.am (permission_test): New test.
12259 * testsuite/Makefile.in: Regenerate.
12260
fdcac5af
ILT
122612009-09-02 Ian Lance Taylor <iant@google.com>
12262
12263 * output.cc (Output_file::resize): Call map_no_anonymous rather
12264 than map.
12265
44453f85
ILT
122662009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12267
12268 * gold.cc: Include "incremental.h".
12269 (queue_initial_tasks): Call Incremental_checker methods.
12270 * incremental.cc: Include "output.h".
12271 (Incremental_checker::can_incrementally_link_output_file): New
12272 method.
12273 * incremental.h (Incremental_checker): New class.
12274
12275 * output.cc (Output_file::open_for_modification): New method.
12276 (Output_file::map_anonymous): Changed return type to bool. Record
12277 map in base_ field.
12278 (Output_file::map_no_anonymous): New method, broken out of map.
12279 (Output_file::map): Use map_no_anonymous and map_anonymous.
12280 * output.h (class Output_file): Update declarations.
12281
293c1386
CC
122822009-08-24 Cary Coutant <ccoutant@google.com>
12283
12284 * options.h (Command_line::Pre_options): New class.
12285 (Command_line::pre_options): New member.
12286 * options.cc (gold::options::ready_to_register): New variable.
12287 (One_option::register_option): Do nothing if not registering options.
12288 Assert if same short option registered twice.
12289 (General_options::General_options): Turn off option registration when
12290 done constructing.
12291 (Command_line::Pre_options::Pre_options): New constructor.
12292
f773f3d2
CC
122932009-08-24 Cary Coutant <ccoutant@google.com>
12294
06a73cfe
CC
12295 * options.h (General_options::no_keep_memory): Remove incorrect
12296 short option.
f773f3d2 12297
a15af8e2
RW
122982009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12299
12300 * Makefile.am (am__skiplex, am__skipyacc): New.
12301 * Makefile.in: Regenerate.
12302
c462b41b
RW
123032009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12304
14ec8efd
RW
12305 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12306 (INCLUDES): ... this.
12307 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12308 (AM_CPPFLAGS): Renamed from ...
12309 (INCLUDE): ... this.
12310 * Makefile.in, testsuite/Makefile.in: Regenerate.
12311
81ecdfbb
RW
12312 * Makefile.in: Regenerate.
12313 * aclocal.m4: Likewise.
12314 * config.in: Likewise.
12315 * configure: Likewise.
12316 * testsuite/Makefile.in: Likewise.
12317
c462b41b
RW
12318 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12319 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12320 * Makefile.in: Regenerate.
12321 * testsuite/Makefile.in: Regenerate.
12322
2da73f13
CC
123232009-08-19 Cary Coutant <ccoutant@google.com>
12324
12325 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12326 symbols in shared libraries overridden by hidden or internal symbols
12327 in the main program.
12328
2db70501
CD
123292009-08-19 Chris Demetriou <cgd@google.com>
12330
12331 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12332 checking source file names in error messages.
12333
f733487b
DK
123342009-08-18 Doug Kwan <dougkwan@google.com>
12335
12336 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12337 an elcpp::Ehdr as parameter. Adjust call to set_target.
12338 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12339 an elfcpp::Ehdr as parameter.
12340 * object.cc (Object::set_target): Remove the version that looks up
12341 a target and sets it.
12342 (Sized_relobj::setup): Take a Target object instead of
12343 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12344 (make_elf_sized_object): Find target and ask target to
12345 make an ELF object.
12346 * object.h: (Object::set_target): Remove the version that looks up
12347 a target and sets it.
12348 (Sized_relobj::setup): Take a Target object instead of
12349 an elfcpp:Ehdr as parameter.
12350 * target.cc: Include dynobj.h.
12351 (Target::do_make_elf_object_implementation): New.
2e702c99 12352 (Target::do_make_elf_object): New.
f733487b
DK
12353 * target.h (Target::make_elf_object): New template declaration.
12354 (Target::do_make_elf_object): New method declarations.
12355 (Target::do_make_elf_object_implementation): New template declaration.
12356
cc70f101
ILT
123572009-08-14 Ian Lance Taylor <iant@google.com>
12358
12359 * gold.h (FUNCTION_NAME): Define.
12360 (gold_unreachable): Use FUNCTION_NAME.
12361
ef5e0cb1
ST
123622009-08-12 Sriraman Tallam <tmsriram@google.com>
12363
12364 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12365 symbol in the --keep-unique list is not found.
12366
48c187ce
ST
123672009-08-12 Sriraman Tallam <tmsriram@google.com>
12368
12369 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12370 been maked as --keep-unique.
12371 (Icf::unfold_section): New function.
12372 * icf.h (Icf::unfold_section): New function.
12373 * options.h (General_options::keep_unique): New option.
12374 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12375 * testsuite/Makefile.in: Regenerate.
12376 * testsuite/icf_keep_unique_test.sh: New file.
12377 * testsuite/icf_keep_unique_test.cc: New file.
12378
645afe0c
CC
123792009-08-12 Cary Coutant <ccoutant@google.com>
12380
12381 PR 10471
12382 * resolve.cc (Symbol_table::resolve): Check for references from
12383 dynamic objects to hidden and internal symbols.
12384 * testsuite/Makefile.am (hidden_test.sh): New test.
12385 * testsuite/Makefile.in: Regenerate.
12386 * testsuite/hidden_test.sh: New script.
12387 * testsuite/hidden_test_1.c: New test source.
12388 * testsuite/hidden_test_main.c: New test source.
12389
11af873f
DK
123902009-08-11 Doug Kwan <dougkwan@google.com>
12391
12392 * arm.cc: Update comments.
12393 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12394 segment to locate the .ARM.exidx section if present.
12395
b9f7d72d
DK
123962009-08-09 Doug Kwan <dougkwan@google.com>
12397
12398 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12399 patch.
12400
ddd3c53c
ST
124012009-08-07 Sriraman Tallam <tmsriram@google.com>
12402 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12403 compiler warnings.
12404
27721062
ST
124052009-08-06 Sriraman Tallam <tmsriram@google.com>
12406
12407 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12408 valid tls_segment only for non-debug-section relocations.
12409 * testsuite/Makefile.am: Add gc_tls_test.
12410 * testsuite/Makefile.in: Regenerate.
12411 * testsuite/gc_tls_test.cc: New file.
12412 * testsuite/gc_tls_test.sh: New file.
12413
ef15dade 124142009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12415
ef15dade
ST
12416 * icf.cc: New file.
12417 * icf.h: New file.
12418 * Makefile.am (CCFILES): Add icf.cc.
12419 (HFILES): Add icf.h
12420 * Makefile.in: Regenerate.
12421 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12422 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12423 section, symbol and addend information for the relocs.
12424 * gold.cc (queue_middle_tasks): Call identical code folding.
12425 * gold.h: Add defines for multimap.
12426 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12427 to the call of finalize_local_symbols.
12428 * main.cc (main): Create object of class Icf.
12429 * object.cc (Sized_relobj::do_layout): Allow this function to be
12430 called twice during icf.
12431 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12432 to sections marked as identical by icf.
12433 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12434 when available.
12435 (Sized_relobj::do_section_entsize): New function.
12436 * object.h (Object::section_entsize): New function.
12437 (Object::do_section_entsize): New pure virtual function.
12438 (Relobj::finalize_local_symbols): Add new parameter.
12439 (Relobj::do_section_entsize): New function.
12440 * options.h (General_options::icf): New option.
12441 (General_options::icf_iterations): New option.
12442 (General_options::print_icf_sections): New option.
12443 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12444 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12445 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12446 icf.
12447 * symtab.cc (Symbol_table::is_section_folded): New function.
12448 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12449 to sections marked as identical by icf.
12450 * symtab.h (Symbol_table::set_icf): New function.
12451 (Symbol_table::icf): New function.
12452 (Symbol_table::is_section_folded): New function.
12453 (Symbol_table::icf_): New data member.
12454 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12455 * testsuite/Makefile.am: Add commands to build icf_test.
12456 * testsuite/Makefile.in: Regenerate.
12457 * testsuite/icf_test.sh: New file.
12458 * testsuite/icf_test.cc: New file.
12459
c3b65ac4
CD
124602009-07-24 Chris Demetriou <cgd@google.com>
12461
12462 * layout.cc (is_compressible_debug_section): Fix incorrect
12463 comment about compressed section names.
12464
1caf2c51
ILT
124652009-07-20 Ian Lance Taylor <ian@airs.com>
12466
12467 PR 10419
12468 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12469
1ef4d87f
ILT
124702009-07-16 Ian Lance Taylor <iant@google.com>
12471
12472 PR 10400
12473 * layout.h: #include <map>.
12474 (class Kept_section): Change from struct to class. Add accessors
12475 and setters. Add section size to Comdat_group mapping. Change
12476 Comdat_group to std::map. Add is_comdat_ field. Add
12477 linkonce_size field in union.
12478 (class Layout): Update declaration of find_or_add_kept_section.
12479 Don't declare find_kept_object.
12480 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12481 parameter. Add object, shndx, is_comdat, and is_group_name
12482 parameters. Change all callers. Adjust for new Kept_section.
12483 (Layout::find_kept_object): Remove.
12484 * object.cc (Sized_relobj::include_section_group): Update use of
12485 Kept_section. Rename secnum to shndx. Only record
12486 Kept_comdat_section if sections are the same size.
12487 (Sized_relobj::include_linkonce_section): Update use of
12488 Kept_section. Only record Kept_comdat_section if sections are the
12489 same size. Set size of linkonce section.
12490 (Sized_relobj::map_to_kept_section): Update call to
12491 get_kept_comdat_section.
12492 * object.h (class Sized_relobj): Rename fields in
12493 Kept_comdat_section to drop trailing underscores; change object
12494 field to Relobj*. Change Kept_comdat_section_table to store
12495 struct rather than pointer.
12496 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12497 Add kept_object and kept_shndx parameters. Change all callers.
12498 (Sized_relobj::get_kept_comdat_section): Change return type to
12499 bool. Add kept_object and kept_shndx parameters. Change all
12500 callers.
12501 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12502 Layout::find_or_add_kept_section.
12503
37c3b7b0
ILT
125042009-07-09 Ian Lance Taylor <iant@google.com>
12505
12506 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12507 Reserve space in the hash table.
12508
98fa85cb
ILT
125092009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12510
12511 * fileread.cc (File_read::get_mtime): New method.
12512 * fileread.h (Timespec): New structure.
12513 (File_read::get_mtime): New method.
12514 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12515 Renamed from timestamp_nsec.
12516 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12517 Elf_Xword.
e1df38aa 12518 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12519 timestamp_nsec.
e1df38aa 12520 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12521 (Incremental_inputs::report_obejct): Save mtime; style fix.
12522 (Incremental_inputs::report_script): Save mtime; style fix.
12523 (Incremental_inputs::finalize_inputs): Style fix.
12524 (Incremental_inputs::finalize): Style fix.
12525 (Incremental_inputs::create_input_section_data): Store inputs
12526 mtime.
12527 * incremental.h (Incremental_inputs::report_script): Add mtime
12528 argument.
12529 (Incremental_inputs::Input_info::Input_info): Intialize only one
12530 union member.
12531 (Incremental_inputs::Input_info::archive): Move to nameless
12532 union.
12533 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12534 (Incremental_inputs::Input_info::script): Move to nameless union.
12535 (Incremental_inputs::mtime): New field.
12536 * script.cc (read_input_script): Pass file mtime to
12537 Incremental_input.
12538 * script.h (Script_info::inputs): Style fix.
12539
c9d70757
ILT
125402009-07-01 Ian Lance Taylor <ian@airs.com>
12541
12542 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12543 instead of 32.
12544
9c547ec3
ILT
125452009-06-24 Ian Lance Taylor <iant@google.com>
12546
12547 PR 10156
12548 * layout.cc (Layout::choose_output_section): If we find an
12549 existing section, update the flags.
12550 (Layout::create_notes): New function, broken out of
12551 Layout::finalize.
12552 (Layout::finalize): Don't create note sections.
12553 (Layout::create_note): Don't crash if linker script discards
12554 section.
12555 (Layout::create_gold_note): Likewise.
12556 (Layout::create_build_id): Likewise. Don't set
12557 after_input_sections on the section.
12558 (Layout::create_executable_stack_info): Remove target parameter.
12559 Change caller.
12560 * layout.h (class Layout): Declare create_notes. Update
12561 declaration of create_executable_stack_info.
12562 * gold.cc (queue_middle_tasks): Call create_notes.
12563 * output.cc (Output_section::update_flags_for_input_section): Move
12564 here from output.h. If SHF_ALLOC flag is newly set, mark address
12565 invalid.
12566 * output.h (Output_data::mark_address_invalid): New function.
12567 (class Output_section): Only declare, not define,
12568 update_flags_for_input_section. Remove set_flags.
12569
55458500
ILT
125702009-06-24 Ian Lance Taylor <iant@google.com>
12571
12572 * script-sections.cc (Output_section_definition::
12573 set_section_addresses): Rename shadowing local load_address to
12574 laddr.
12575
1307d6cd
ILT
125762009-06-24 Ian Lance Taylor <iant@google.com>
12577
12578 PR 10244
12579 * reloc.cc (relocate_sections): Skip empty relocation sections.
12580
ec3f783e
ILT
125812009-06-23 Ian Lance Taylor <iant@google.com>
12582
12583 PR 10156
12584 * layout.cc (Layout::create_note): Use choose_output_section
12585 rather than make_output_section.
12586
459c9f1c
ILT
125872009-06-23 Ian Lance Taylor <iant@google.com>
12588
12589 PR 10237
12590 * options.cc (General_options::parse_V): Set printed_version_.
12591 (General_options::General_options): Initialize printed_version_.
12592 * options.h (class General_options): Add printed_version_ field.
12593 * gold.cc (queue_initial_tasks): If there are no input files,
12594 don't give a fatal error if we printed the version information.
12595 (queue_middle_tasks): If using -r with a shared object, give a
12596 fatal error rather than an ordinary error.
12597
1518dc8f
ILT
125982009-06-23 Ian Lance Taylor <iant@google.com>
12599
12600 PR 10219
12601 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12602 (Layout::make_output_section): Set have_stabstr_section_ if we see
12603 a .stab*str section.
12604 (Layout::finalize): Call link_stabs_sections.
12605 (Layout::link_stabs_sections): New file.
12606 * layout.h (class Layout): Add have_stabstr_section_ field.
12607 Declare link_stabs_sections.
12608
3d857b98
DK
126092009-06-23 Doug Kwan <dougkwan@google.com>
12610
12611 * Makefile.am (libgold_a_LIBADD): New.
12612 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12613 * Makefile.in: Regenerate.
3d857b98
DK
12614 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12615 * configure: Regenerate.
12616 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12617 * fileread.cc: Include sys/state.h
12618 * gold.h: Declare memmem and strndup if found missing.
12619 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12620
0639a6f6
ILT
126212009-06-23 Ian Lance Taylor <iant@google.com>
12622
12623 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12624 * configure: Rebuild.
12625
8d63875c
ILT
126262009-06-23 Ian Lance Taylor <iant@google.com>
12627
12628 PR 10147
12629 * object.cc (Object::section_contents): Don't try to get a view if
12630 the section has length zero.
12631 (Object::handle_gnu_warning_section): If the section is empty, use
12632 the name of the section as the warning.
12633
f7c8a183
ILT
126342009-06-23 Ian Lance Taylor <iant@google.com>
12635
12636 PR 10133
12637 * stringpool.h (class Stringpool_template): Add optimize_ field.
12638 (Stringpool_template::set_optimize): New function.
12639 * stringpool.cc (Stringpool_template::Stringpool_template):
12640 Initialize optimize_ field.
12641 (Stringpool_template::set_string_offsets): Test local optimize
12642 fild rather than parameter.
12643 * layout.cc (Layout::Layout): Call set_optimize on the section
12644 name stringpool.
12645
e6a307ba
ILT
126462009-06-22 Ian Lance Taylor <iant@google.com>
12647
12648 PR 10030
12649 * yyscript.y: Parse TARGET.
12650 * script.cc (script_set_target): New function.
12651 * script-c.h (script_set_target): Declare.
12652 * options.cc (General_options::string_to_object_format): Rename
12653 from string_to_object_format in anonymous namespace. Change
12654 callers.
12655 * options.h (class General_options): Declare
12656 string_to_object_format.
12657
3ee173de
ILT
126582009-06-22 Ian Lance Taylor <iant@google.com>
12659
12660 * script-sections.cc (Script_sections::create_segments): Don't put
12661 program headers in a PT_LOAD segment if -n or -N.
12662
126632009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
12664
12665 PR 10141
12666 * options.h (class General_options): Add -z lazy and -z now. Sort
12667 -z options into alphabetical order.
12668 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12669
cd6739a1 126702009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
12671
12672 * layout.cc (Layout::make_output_section): Call
12673 Target::new_output_section.
12674 (Layout::attach_allocated_section_to_segment): Put large section
12675 sections in a separate load segment with the large segment flag
12676 set.
12677 (Layout::segment_precedes): Sort large data segments after other
12678 load segments.
12679 (align_file_offset): New static function.
12680 (Layout::set_segment_offsets): Use align_file_offset.
12681 * output.h (class Output_section): Add is_small_section_ and
12682 is_large_section_ fields.
12683 (Output_section::is_small_section): New function.
12684 (Output_section::set_is_small_section): New function.
12685 (Output_section::is_large_section): New function.
12686 (Output_section::set_is_large_section): New function.
12687 (Output_section::is_large_data_section): New function.
12688 (class Output_segment): Add is_large_data_segment_ field.
12689 (Output_segment::is_large_data_segment): New function.
12690 (Output_segment::set_is_large_data_segment): New function.
12691 * output.cc (Output_section::Output_section): Initialize new
12692 fields.
12693 (Output_segment::Output_segment): Likewise.
12694 (Output_segment::add_output_section): Add assertion that large
12695 data sections always go in large data segments. Force small data
12696 sections to the end of the list of data sections. Force small BSS
12697 sections to the start of the list of BSS sections. For large BSS
12698 sections to the end of the list of BSS sections.
12699 * symtab.h (class Symbol): Declare is_common_shndx.
12700 (Symbol::is_defined): Check Symbol::is_common_shndx.
12701 (Symbol::is_common): Likewise.
12702 (class Symbol_table): Define enum Commons_section_type. Update
12703 declarations. Add small_commons_ and large_commons_ fields.
12704 * symtab.cc (Symbol::is_common_shndx): New function.
12705 (Symbol_table::Symbol_table): Initialize new fields.
12706 (Symbol_table::add_from_object): Put small and large common
12707 symbols in the right list.
12708 (Symbol_table::sized_finalized_symbol): Check
12709 Symbol::is_common_shndx.
12710 (Symbol_table::sized_write_globals): Likewise.
12711 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12712 common symbol lists. Don't call do_allocate_commons_list if the
12713 list is empty.
12714 (Symbol_table::do_allocate_commons_list): Remove is_tls
12715 parameter. Add comons_section_type parameter. Change all
12716 callers. Handle small and large common symbols.
12717 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12718 Symbol::is_common_shndx.
12719 * resolve.cc (symbol_to_bits): Likewise.
12720 * target.h (Target::small_common_shndx): New function.
12721 (Target::small_common_section_flags): New function.
12722 (Target::large_common_shndx): New function.
12723 (Target::large_common_section_flags): New function.
12724 (Target::new_output_section): New function.
12725 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12726 small_common_section_flags, and large_common_section_flags
12727 fields.
12728 (Target::do_new_output_section): New virtual function.
12729 * arm.cc (Target_arm::arm_info): Initialize new fields.
12730 * i386.cc (Target_i386::i386_info): Likewise.
12731 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12732 Likewise.
12733 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12734 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12735 (Target_x86_64::do_new_output_section): New function.
12736 * configure.ac: Define conditional MCMODEL_MEDIUM.
12737 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12738 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12739 (large_LDFLAGS): Define.
12740 * testsuite/large.c: New file.
12741 * testsuite/testfile.cc (Target_test::test_target_info):
12742 Initialize new fields.
12743 * configure, testsuite/Makefile.in: Rebuild.
12744
bb04269c
DK
127452009-06-05 Doug Kwan <dougkwan@google.com>
12746
12747 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 12748 * Makefile.in: Regenerate.
bb04269c
DK
12749 * i386.cc (class Target_i386): Define new virtual method to
12750 override do_is_local_label_name in parent.
12751 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12752 local symbols if --discard-locals or -X is given.
12753 * options.h (class General_options): Declare new options
12754 '--discard-locals' and '-X' for discarding locals.
12755 * target.h (class Target): Define new methods is_local_label_name.
12756 Declare new virtual method do_is_local_label_name.
12757 * target.cc: New file.
12758 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12759 (check_SCRIPTS): Add discard_locals_test.sh.
12760 (check_DATA): Add discard_local_tests.syms.
12761 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12762 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12763 * testsuite/Makefile.in: Regenerate.
12764 * testsuite/discard_locals_test.c: New file.
12765 * testsuite/discard_locals_test.sh: Same.
12766
805bb01c
DK
127672009-06-05 Doug Kwan <dougkwan@google.com>
12768
12769 * object.cc (Sized_relobj::Sized_relobj): Initialize
12770 discarded_eh_frame_shndx_ to -1U.
12771 (Sized_relobj::do_layout): Record index of a discard .eh_frame
12772 section.
12773 (Sized_relobj::do_count_local_symbols): Skip local symbols in
12774 a discarded .eh_frame section.
12775 (Sized_relobj::do_finalize_local_symbols): Ditto.
12776 * object.h (class Sized_relobj): Declare new member
12777 discarded_eh_frame_shndx_.
12778 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
12779 (local_labels_test.o, local_labels_test): New rules.
12780 * testsuite/Makefile.in: Regenerate.
12781
1dcd334d
DK
127822009-06-04 Doug Kwan <dougkwan@google.com>
12783
12784 * layout.cc (Layout::section_name_mapping): Add mapping for
12785 special ARM sections.
12786
96d49306
DK
127872009-06-03 Doug Kwan <dougkwan@google.com>
12788
12789 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
12790 (utils::has_overflow): Same.
12791
dff16297
ILT
127922009-06-03 Ian Lance Taylor <iant@google.com>
12793
12794 * layout.cc (Layout::section_name_mapping): New array, replacing
12795 Layout::linkonce_mapping.
12796 (Layout::section_name_mapping_count): New variable, replacing
12797 Layout::linkonce_mapping_count.
12798 (Layout::linkonce_output_name): Remove.
12799 (Layout::output_section_name): Rewrite.
12800 * layout.h (class Layout): Rename Linkonce_mapping to
12801 Section_name_mapping, linkonce_mapping to section_name_mapping,
12802 linkonce_mapping_count to section_name_mapping_count. Don't
12803 declare linkonce_output_name.
12804
c121c671
DK
128052009-06-03 Doug Kwan <dougkwan@google.com>
12806
12807 * gold/arm.cc (namespace utils): New.
12808 (Target_arm::reloc_is_non_pic): Define new method.
12809 (class Arm_relocate_functions): New.
12810 (Target_arm::Relocate::relocate): Handle relocation types used by
12811 Android.
12812
07800fab
ILT
128132009-06-03 Ian Lance Taylor <iant@google.com>
12814
12815 * arm.cc (Target_arm::scan::global): Use || instead of |.
12816
c121c671
DK
128172009-06-02 Doug Kwan <dougkwan@google.com>
12818
12819 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
12820 issued_non_pic_error_.
12821 (class Target_arm::Scan): Declare new method check_non_pic.
12822 Define new method symbol_needs_plt_entry.
12823 Declare new data member issued_non_pic_error_.
12824 (class Target_arm::Relocate): Declare new method
12825 should_apply_static_reloc.
12826 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
12827 (Target_arm::Scan::check_non_pic): Define new method.
12828 (Target_arm::Scan::local): Handle a small subset of reloc types used
12829 by Android.
12830 (Target_arm::Scan::local): Same.
12831 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
12832
b19b0c6d
ILT
128332009-05-31 Mikolaj Zalewski <mikolajz@google.com>
12834
12835 * incremental.cc (Incremental_inputs::report_command_line): Filter
12836 out --incremental-* options.
12837
94cdfcff
DK
128382009-05-29 Doug Kwan <dougkwan@google.com>
12839
12840 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
12841 template class.
12842 (class Target_arm): Update comment.
12843 (Target_arm::Target_arm): Initialize new data members GOT_,
12844 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
12845 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
12846 and Target_arm::rel_dyn_section.
12847 Declare new_enum Target_arm::Got_type.
12848 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
12849 and DYNBSS_.
12850 Update commments for member do_dynsym_value.
12851 (Target_arm::got_size, Target_arm::plt_section,
12852 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
12853 new methods inside class defintion.
12854 (Target_arm::got_section): Define new method.
12855 (Target_arm::rel_dyn_section): Same.
12856 (Output_data_plt_arm): New template class.
12857 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
12858 (Output_data_plt_arm:do_adjust_output_section): Define new method.
12859 (Output_data_plt_arm::add_entry): Same.
12860 (Output_data_plt_arm::first_plt_entry): Define new
12861 static data member for PLT instruction template.
12862 (Output_data_plt_arm::plt_entry): Same.
12863 (Output_data_plt_arm::do_write): Define new method.
12864 (Target_arm::make_plt_entry): Same.
12865 (Target_arm::do_finalize_sections): Same.
12866 (Target_arm::do_dynsym_value): Same.
12867
4a657b0d
DK
128682009-05-28 Doug Kwan <dougkwan@google.com>
12869
12870 * Makefile.am (TARGETSOURCES): Add arm.cc.
12871 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
12872 * Makefile.in: Regenerate.
12873 * arm.cc: New file.
12874 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
12875
e7ae8c36
DK
128762009-05-26 Doug Kwan <dougkwan@google.com>
12877
12878 * options.cc (General_options::parse_exclude_libs). Fix a comment.
12879 (General_options::check_excluded_libs): Strip off directories in
12880 archive name before matching like GNU ld does.
12881 * testsuite/Makefile.am (MOSTLYCLEANFILES,
12882 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
12883 (exclude_libs_test_LDFLAGS): Add linker option
12884 -Wl,--exclude-libs,libexclude_libs_test_3
12885 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
12886 an explicit archive without using -l.
12887 (alt/libexclude_libs_test_3.a): New make rule.
12888 * testsuite/Makefile.in: Regenerate.
12889 * testsuite/exclude_libs_test.c : Declare lib3_default().
12890 (main): Call it.
12891 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
12892 * exclude_libs_test_3.c: New file.
12893
f12e7348
NC
128942009-05-26 Nick Clifton <nickc@redhat.com>
12895
12896 * po/id.po: New Indonesian translation.
12897 * po/gold.pot: Updated template file.
12898
4daadc0d
ST
128992009-05-22 Sriraman Tallam <tmsriram@google.com>
12900
e1df38aa 12901 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
12902 gc_comdat_test files. Add -Wl,--gc-sections to build
12903 gc_comdat_test.
12904 * testsuite/Makefile.in: Regenerate.
12905 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
12906
531813ad
ST
129072009-05-21 Sriraman Tallam <tmsriram@google.com>
12908
12909 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
12910 kept comdat section was garbage collected.
12911 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
12912 * testsuite/Makefile.in: Regenerate.
12913 * testsuite/gc_comdat_test.sh: New file.
12914 * testsuite/gc_comdat_test_1.cc: New file.
12915 * testsuite/gc_comdat_test_2.cc: New file.
12916
65514900
CC
129172009-05-19 Doug Kwan <dougkwan@google.com>
12918
12919 * archive.cc (Archive::Archive): Move constructor from archive.h
12920 to here. Initialize no_export_.
12921 (Archive::get_elf_object_for_member): Set no_export flag of object.
12922 * archive.h (Archive::Archive): Move constructor body to
12923 archive.cc.
12924 (Archive::no_export): New method.
12925 (Archive::no_export_): New field.
12926 * object.h (Object::Object): Initialize no_export_ to false.
12927 (Object::no_export, Object::set_no_export): New methods.
12928 (Object::no_export_): New field.
12929 * options.cc (General_options::parse_exclude_libs): New method.
12930 (General_options::check_excluded_libs) Same.
12931 * options.h (exclude_libs): New option.
12932 (General_options::check_excluded_libs): New method declaration.
12933 (General_options::excluded_libs_): New field.
12934 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
12935 default or protected visibility if an object has no-export flag set.
12936 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
12937 (check_SCRIPTS): Add exclude_libs_test.sh.
12938 (check_DATA): Add exclude_libs_test.syms.
12939 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
12940 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
12941 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
12942 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
12943 (exclude_libs_test.syms, libexclude_libs_test_1.a,
12944 libexclude_libs_test_2.a): New rules.
12945 * testsuite/Makefile.in: Regenerate.
12946 * testsuite/exclude_libs_test.c: New file.
12947 * testsuite/exclude_libs_test.sh: Ditto.
12948 * testsuite/exclude_libs_test_1.c: Ditto.
12949 * testsuite/exclude_libs_test_2.c: Ditto.
12950
1b77ea50
ILT
129512009-05-15 Ian Lance Taylor <iant@google.com>
12952
12953 * configure.ac: Check for declarations for cases where libiberty.h
12954 checks HAVE_DECL_xxx.
12955 * configure, config.in: Rebuild.
12956
072fe7ce
ILT
129572009-05-15 Mikolaj Zalewski <mikolajz@google.com>
12958
12959 * gold.h (Incremental_argument_list): Remove (invalid) forward
12960 declaration.
12961 * incremental.cc (Incremental_inputs::report_achive): New method.
12962 (Incremental_inputs::report_object): New method.
12963 (Incremental_inputs::report_script): New method.
12964 (Incremental_inputs::finalize_inputs): New method.
12965 (Incremental_inputs::finalize): Call finalize_inputs().
12966 (Incremental_inputs::sized_create_incremental_inputs_section_data):
12967 Create inputs entries.
12968 * incremental.h (Incremental_input_type): New enum.
12969 (Incremental_inputs::Incremental_input): Initialize new fields.
12970 (Incremental_inputs::report_inputs): New method.
12971 (Incremental_inputs::report_achive): New method.
12972 (Incremental_inputs::report_object): New method.
12973 (Incremental_inputs::report_script): New method.
12974 (Incremental_inputs::finalize_inputs): New method.
12975 (Incremental_inputs::Input_info): New struct.
12976 (Incremental_inputs::Input_info_map): New typedef.
12977 (Incremental_inputs::lock_): New field.
12978 (Incremental_inputs::Inputs_): New field.
12979 (Incremental_inputs::Inputs_map): New field.
12980 * main.cc (main): Call Incremental_input::report_inputs.
12981 * options.h (Input_argument_list): Typedef moved from
12982 Input_arguments.
12983 (Input_file_group::Files): Remove, use ::Input_argument_list.
12984 (Input_file_group::Input_argument_list): Remove, use
12985 ::Input_argument_list.
12986 * plugin.cc (Plugin_manager::add_input_file): Add error in
12987 incremental build.
12988 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
12989 functions.
12990 * script.cc (read_input_script): Call
12991 Incremental_input::report_script.
12992 * script.h (Script_info): New class.
12993
b0481b0b
ILT
129942009-04-27 Ian Lance Taylor <iant@google.com>
12995
12996 * x86_64.cc (do_adjust_output_section): Set entsize to
12997 plt_entry_size.
12998
b22a5a41 129992009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13000
13001 * output.cc (Output_file::close): After short writes, continue
13002 writing from the correct offset in the buffer being written.
13003
40fde488
CD
130042009-04-23 Chris Demetriou <cgd@google.com>
13005
13006 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13007 * configure: Regenerate.
13008 * config.in: Regenerate.
13009 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13010 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13011
3ce2c28e
ILT
130122009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13013
13014 * incremental.cc (Incremental_inputs_header_data): Renamed from
13015 Incremental_input_header_data.
13016 (Incremental_inputs_header_data::data_size): New field.
13017 (Incremental_inputs_header_data::put_input_file_count): Renamed
13018 from input_file_count.
13019 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13020 from command_line_offset.
13021 (Incremental_inputs_header_data::put_reserved): Renamed from
13022 put_reserved.
13023 (Incremental_inputs_entry_data): Renamed from
13024 Incremental_input_entry_data.
13025 (Incremental_inputs_entry_data::data_size): New field.
13026 (Incremental_inputs::report_command_line): New method.
13027 (Incremental_inputs::finalize): New method.
13028 (Incremental_inputs::create_incremental_inputs_data): New method.
13029 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13030 * incremental.h: New file.
13031 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13032 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13033 incremental builds.
703d02da 13034 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13035 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13036 (Layout::create_incremental_info_sections): New method.
13037 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13038 * main.cc (main): Notify Incremental_input of the command line.
13039
e55bde5e
ILT
130402009-04-01 Ian Lance Taylor <iant@google.com>
13041 Mikolaj Zalewski <mikolajz@google.com>
13042
13043 * gold.h (reserve_unordered_map): Define, three versions, one for
13044 each version of Unordered_map.
13045 * layout.cc (Layout::Layout): Remove options parameter. Add
13046 number_of_input_files parameter. Don't initialize options_.
13047 Initialize number_of_input_files_ and resized_signatures_. Move
13048 sections_are_attached_.
13049 (Layout::layout_group): Reserve space for group_signatures_.
13050 (Layout::find_or_add_kept_section): Change name parameter to be a
13051 reference. Resize signatures_ map when it gets large enough.
13052 (Layout::layout_eh_frame): Use parameters->options() instead of
13053 this->options_.
13054 (Layout::make_output_section): Likewise.
13055 (Layout::attach_allocated_section_to_segment): Likewise.
13056 (Layout::finalize, Layout::create_executable_stack): Likewise.
13057 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13058 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13059 * layout.h (class Layout): Update declarations. Remove options_
13060 field. Add number_of_input_files_ and resized_signatures_
13061 fields. Move sections_are_attached_ field.
13062 * main.cc (main): Pass number of input files to Layout
13063 constructor. Don't pass options.
13064
154b857c
ILT
130652009-03-30 Ian Lance Taylor <iant@google.com>
13066
13067 * ffsll.c (ffsll): Correct implementation.
13068
2f35ab9b
ILT
130692009-03-27 Ian Lance Taylor <iant@google.com>
13070
fd03461a
ILT
13071 * ffsll.c: New file.
13072 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13073 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13074 * ftruncate.c (ftruncate): Declare before definition.
13075 * mremap.c (mremap): Likewise.
13076 * pread.c (pread): Likewise.
13077 * configure, Makefile.in, config.in: Rebuild.
13078
2f35ab9b
ILT
13079 * mremap.c: New file.
13080 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13081 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13082 (mremap): Declare if HAVE_MREMAP is not defined.
13083 * configure, Makefile.in, config.in: Rebuild.
13084
33aea2fd
CC
130852009-03-27 Cary Coutant <ccoutant@google.com>
13086
13087 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13088 position independent.
13089 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13090 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13091
6d479619
CC
130922009-03-24 Cary Coutant <ccoutant@google.com>
13093
13094 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13095 an executable.
13096 (needs_dynamic_reloc): Likewise.
13097
afc06bb8
ILT
130982009-03-24 Ian Lance Taylor <iant@google.com>
13099
13100 * yyscript.y (file_cmd): Recognize EXTERN.
13101 (extern_name_list, extern_name_list_body): New nonterminals.
13102 * script.cc (script_add_extern): Define.
13103 * script-c.h (script_add_extern): Declare.
13104
f6060a4d
ILT
131052009-03-24 Rafael Avila de Espindola <espindola@google.com>
13106
13107 * object.cc (is_elf_object): Define.
13108 * object.h (is_elf_object): Declare.
13109 * archive.cc (Archive::get_elf_object_for_member): Call
13110 is_elf_object.
33aea2fd 13111 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13112
26736d8e
ILT
131132009-03-24 Elliott Hughes <enh@google.com>
13114
13115 * output.cc (Output_file::map_anonymous): Define.
13116 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13117 try an anonymous one. Report the size if the mmap fails.
13118 * output.h (class Output_file): Declare map_anonymous.
13119
22fd9730
ILT
131202009-03-24 Ian Lance Taylor <iant@google.com>
13121
13122 * target-select.cc (instantiate_target): Don't acquire the lock if
13123 the instantiated_target_ field has already been set.
13124
cb010894
ILT
131252009-03-23 Ian Lance Taylor <iant@google.com>
13126
7f055c20
ILT
13127 * gold-threads.h (class Initialize_lock): Define.
13128 * gold-threads.cc (class Initialize_lock_once): Define.
13129 (initialize_lock_control): New static variable.
13130 (initialize_lock_pointer): New static variable.
13131 (initialize_lock_once): New static function.
13132 (Initialize_lock::Initialize_lock): Define.
13133 (Initialize_lock::initialize): Define.
13134 * target-select.h: Include "gold-threads.h".
13135 (class Target_selector): Add lock_ and initialize_lock_ fields.
13136 Don't define instantiate_target, just declare it.
13137 * target-select.cc (Target_selector::Target_selector): Initialize
13138 new fields.
13139 (Target_selector::instantiate_target): Define.
13140 * descriptors.h: Include "gold-threads.h".
13141 (class Descriptors): Add initialize_lock_ field.
13142 * descriptors.cc (Descriptors::Descriptors): Initialize new
13143 field.
13144 (Descriptors::open): Use initialize_lock_ field
13145 * errors.h (class Errors): Add initialize_lock_ field.
13146 * errors.cc (Errors::Errors): Initialize new field.
13147 (Errors::initialize_lock): Use initialize_lock_ field.
13148 * powerpc.cc (class Target_selector_powerpc): Remove
13149 instantiated_target_ field. In do_recognize call
13150 instantiate_target rather than do_instantiate_target. In
13151 do_instantiate_target just allocate a new target.
13152 * sparc.cc (class Target_selector_sparc): Likewise.
13153
36959681
ILT
13154 * freebsd.h: New file.
13155 * i386.cc: Include "freebsd.h".
13156 (Target_i386): Derive from Target_freebsd rather than
13157 Sized_target.
13158 (Target_selector_i386): Derive from Target_selector_freebsd rather
13159 than Target_selector.
13160 * x86_64.cc: Include "freebsd.h".
13161 (Target_x86_64): Derive from Target_freebsd rather than
13162 Sized_target.
13163 (Target_selector_x86_64): Derive from Target_selector_freebsd
13164 rather than Target_selector.
13165 * target.h (class Target): Add adjust_elf_header and
13166 do_adjust_elf_header.
13167 * output.cc (Output_file_header:: do_sized_write): Call target
13168 adjust_elf_header routine.
13169 * configure.tgt: Set targ_osabi.
13170 * configure.ac: Define GOLD_DEFAULT_OSABI.
13171 * parameters.cc (Parameters::default_target): Pass
13172 GOLD_DEFAULT_OSABI to select_target.
13173 * target-select.h (class Target_selector): Make instantiate_target
13174 protected rather than private.
13175 * Makefile.am (HFILES): Add freebsd.h.
13176 * configure, Makefile.in, config.in: Rebuild.
13177
cb010894
ILT
13178 * merge.cc (do_add_input_section): Correct pend value. Change
13179 message about last entry not being null terminated from error to
13180 warning.
13181
0e879927
ILT
131822009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13183
13184 * incremental.cc: New file.
13185 * Makefile.am (CCFILES): Add incremental.cc.
13186 * Makefile.in: Rebuild.
13187
41105937
PP
131882009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13189
13190 * layout.cc (Layout::output_section_name): Preserve names
13191 of '.note.' sections.
e1df38aa 13192
60439920
ILT
131932009-03-19 Ian Lance Taylor <iant@google.com>
13194
13195 * descriptors.cc (Descriptors::open): Check that the options are
13196 valid before using them.
13197
0d371ad3
ILT
131982009-03-18 Ian Lance Taylor <iant@google.com>
13199
13200 * script-sections.h: Include <list>.
13201 (class Script_sections): Change Sections_elements from std::vector
13202 to std::list. Typedef public Elements_iterator. Add
13203 orphan_section_placement_, data_segment_align_start_, and
13204 saw_data_segment_align_ fields. Remove data_segment_align_index_
13205 field.
13206 * script-sections.cc (class Orphan_section_placement): New class.
13207 (class Sections_element): Add virtual functions is_relro and
13208 orphan_section_init. Remove virtual function place_orphan_here.
13209 (class Output_section_definition): Add is_relro and
13210 orphan_section_init. Remove place_orphan_here.
13211 (class Orphan_output_section): Likewise.
13212 (Script_sections::Script_sections): Update for field changes.
13213 (Script_sections::data_segment_align): Set saw_data_segment_align_
13214 and data_segment_align_start_, not data_segment_align_index.
13215 (Script_sections::data_segment_relro_end): Check
13216 saw_data_segment_align_. Use data_segment_align_start_ rather
13217 than data_segment_align_index_.
13218 (Script_sections::place_orphan): Rewrite to use
13219 Orphan_section_placement.
13220
9201d894
ILT
132212009-03-17 Ian Lance Taylor <iant@google.com>
13222
9c5b8369
ILT
13223 * archive.cc (Archive::add_symbols): Check for a version attached
13224 to the symbol name in the archive map.
13225 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13226 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13227 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13228 (ver_test_11.a): New target.
13229 * testsuite/Makefile.in: Rebuild.
13230
9201d894
ILT
13231 * configure.ac: Check for chsize and posix_fallocate. Replace
13232 ftruncate.
13233 * ftruncate.c: New file, from gnulib.
13234 * output.cc (posix_fallocate): Define dummy version if not
13235 HAVE_POSIX_FALLOCATE.
13236 (Output_file::map): Call posix_fallocate rather than lseek and
13237 write.
13238 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13239 * configure, Makefile.in, config.in: Rebuild.
13240
ef4ab7a8 132412009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13242
ef4ab7a8
PP
13243 * layout.h (Layout::create_note): Add section_name parameter.
13244 * layout.cc (Layout::create_note): Likewise.
13245 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13246
8c500701
ILT
132472009-03-17 Ian Lance Taylor <iant@google.com>
13248
e85b18e1
ILT
13249 * descriptors.cc: Include "options.h".
13250 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13251 (Descriptors::open): Always use O_CLOEXEC when opening a new
13252 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13253 then set FD_CLOEXEC.
13254
9efe6174
ILT
13255 * sparc.cc (class Target_sparc): Add has_got_section.
13256 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13257 make sure we have a GOT section.
13258
13259 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13260 (Target_sparc::Scan::local): Likewise.
13261 (Target_sparc::Scan::global): Likewise.
13262 (Target_sparc::Relocate::relocate): Likewise.
13263 (Target_sparc::Relocate::relocate_tls): Likewise.
13264
8c500701
ILT
13265 * symtab.cc (Symbol_table::define_default_version): New function,
13266 broken out of add_from_object.
13267 (Symbol_table::add_from_object): Call define_default_version.
13268 (Symbol_table::define_special_symbol): Add resolve_oldsym
13269 parameter. Change all callers. If the version for a symbol comes
13270 from a version script, resolve it with the symbol with the same
13271 name with no version. Also add the symbol without a version if
13272 appropriate.
13273 (do_define_in_output_data): If resolving with oldsym, don't delete
13274 sym.
13275 (do_define_in_output_segment): Likewise.
13276 (do_define_as_constant): Likewise.
13277 * symtab.h (class Symbol_table): Update declarations.
13278
f1ed28fb
ILT
132792009-03-13 Ian Lance Taylor <iant@google.com>
13280
15f8229b
ILT
13281 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13282 (Read_symbols::requeue): New function.
13283 (Read_symbols::do_read_symbols): If make_elf_object fails because
13284 the target type is not configured, and the file was searched for,
13285 issue a warning and retry with the next directory.
13286 (Add_symbols::run): If the file has an incompatible format, and
13287 it was searched for, requeue the Read_symbols task. On error,
13288 release the object.
13289 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13290 dirindex parameter to constructor. Change all callers. Declare
13291 incompatible_warning and requeue.
13292 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13293 input_argument_ and input_group_ fields. Add them to
13294 constructor. Change all callers.
13295 (class Read_script): Add dirindex_ field. Add it to constructor.
13296 Change all callers.
13297 * archive.cc (Archive::setup): Remove input_objects parameter.
13298 Change all callers.
13299 (Archive::get_file_and_offset): Likewise.
13300 (Archive::read_all_symbols): Likewise.
13301 (Archive::read_symbols): Likewise.
13302 (Archive::get_elf_object_for_member): Remove input_objects
13303 parameter. Add punconfigured parameter. Change all callers.
13304 (Archive::add_symbols): Change return type to bool. Check return
13305 value of include_member.
13306 (Archive::include_all_members): Likewise.
13307 (Archive::include_member): Change return type to bool. Return
13308 false if first included object has incompatible target. Set
13309 included_member_ field.
13310 (Add_archive_symbols::run): If add_symbols returns false, requeue
13311 Read_symbols task.
13312 * archive.h (class Archive): Add included_member_ field.
13313 Initialize it in constructor. Add input_file and searched_for
13314 methods. Update declarations.
13315 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13316 input_argument_ fields. Add them to constructor. Change all
13317 callers.
13318 * script.cc: Include "target-select.h".
13319 (class Parser_closure): Add skip_on_incompatible_target_ and
13320 found_incompatible_target_ fields. Add
13321 skip_on_incompatible_target parameter to constructor. Change all
13322 callers. Add methods skip_on_incompatible_target,
13323 clear_skip_on_incompatible_target, found_incompatible_target, and
13324 set_found_incompatible_target.
13325 (read_input_script): Add dirindex parameter. Change all callers.
13326 If parser finds an incompatible target, requeue Read_symbols
13327 task.
13328 (script_set_symbol): Clear skip_on_incompatible_target in
13329 closure.
13330 (script_add_assertion, script_parse_option): Likewise.
13331 (script_start_sections, script_add_phdr): Likewise.
13332 (script_check_output_format): New function.
13333 * script.h (read_input_script): Update declaration.
13334 * script-c.h (script_check_output_format): Declare.
13335 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13336 (ignore_cmd): Remove OUTPUT_FORMAT.
13337 * fileread.cc (Input_file::Input_file): Add explicit this.
13338 (Input_file::will_search_for): New function.
13339 (Input_file::open): Add pindex parameter. Change all callers.
13340 * fileread.h (class Input_file): Add input_file_argument method.
13341 Declare will_search_for. Update declarations.
13342 * object.cc (make_elf_object): Add punconfigured parameter.
13343 Change all callers.
13344 * object.h (class Object): Make input_file public. Add
13345 searched_for method.
13346 (make_elf_object): Update declaration.
13347 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13348 restart search.
13349 * dirsearch.h (class Dirsearch): Update declaration.
13350 * options.h (class General_options): Add --warn-search-mismatch.
13351 * parameters.cc (Parameters::is_compatible_target): New function.
13352 * parameters.h (class Parameters): Declare is_compatible_target.
13353 * workqueue.cc (Workqueue::add_blocker): New function.
13354 * workqueue.h (class Workqueue): Declare add_blocker.
13355
f1ed28fb
ILT
13356 * fileread.cc (Input_file::open): Remove options parameter.
13357 Change all callers.
13358 (Input_file::open_binary): Likewise.
13359 * script.cc (read_input_script): Likewise.
13360 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13361 options parameter from constructor. Change all callers.
13362 (class Read_script): Likewise.
13363 * fileread.h (class Input_file): Update declarations.
13364 * script.h (read_input_script): Update declaration.
13365
34dd024a
NC
133662009-03-10 Nick Clifton <nickc@redhat.com>
13367
13368 * po/es.po: New Spanish translation.
13369
6d71b17c
CC
133702009-03-06 Cary Coutant <ccoutant@google.com>
13371
13372 * options.cc (parse_short_option): Keep dash_z from registering itself.
13373
031cdbed
ILT
133742009-03-03 Ian Lance Taylor <iant@google.com>
13375
13376 PR 9918
13377 * target-reloc.h (relocate_section): Pass output_section to
13378 relocate.
13379 * i386.cc (Target_i386::should_apply_static_reloc): Add
13380 output_section parameter. Change all callers.
13381 (Target_i386::Relocate::relocate): Add output_section parameter.
13382 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13383 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13384 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13385 * testsuite/two_file_shared.sh: New script.
13386 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13387 (check_DATA): Add two_file_shared.dbg.
13388 (two_file_shared.dbg): New target.
13389 * testsuite/Makefile.in: Rebuild.
13390
15d5fa16
ILT
133912009-03-01 Ian Lance Taylor <iant@google.com>
13392
13393 * configure.ac: Check for byteswap.h.
13394 * configure: Rebuild.
13395 * config.in: Rebuild.
13396
8a4c0b0d
ILT
133972009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13398
13399 * layout.cc (Layout::find_or_add_kept_section): New function.
13400 (Layout::add_comdat): Removed.
13401 * layout.h (struct Kept_section): Move out of class Layout.
13402 Remove trailing underscores from field names. Add group_sections
13403 field. Rename group_ field to is_group. Change all uses.
13404 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13405 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13406 comdat_groups_ field.
13407 (Sized_relobj::include_section_group): Use
13408 find_or_add_kept_section and Kept_section::group_sections.
13409 (Sized_relobj::include_linkonce_section): Likewise.
13410 * object.cc (class Sized_relobj): Don't define Comdat_group or
13411 Comdat_group_table. Remove find_comdat_group and
13412 add_comdat_group. Remove comdat_groups_ field.
13413 * plugin.cc (include_comdat_group): Use
13414 Layout::find_or_add_kept_section.
13415
b4ecf66b
ILT
134162009-02-28 Ian Lance Taylor <iant@google.com>
13417
14359ca0
ILT
13418 * README: --gc-sections and map files are now supported. Document
13419 some build requirements.
13420
b4ecf66b
ILT
13421 PR 6992
13422 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13423 relocatable link set the value of the section symbol to zero.
13424 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13425 relocatable link don't include the section address in the local
13426 symbol value.
13427
0602e05a
ILT
134282009-02-27 Ian Lance Taylor <iant@google.com>
13429
fd9d194f
ILT
13430 PR 6811
13431 * options.h (class Search_directory): Add is_system_directory.
13432 (class General_options): Declare is_in_system_directory.
13433 * options.cc (get_relative_sysroot): Make static.
13434 (get_default_sysroot): Make static.
13435 (General_optoins::is_in_system_directory): New function.
13436 * fileread.cc (Input_file::is_in_system_directory): New function.
13437 * fileread.h (class Input_file): Declare is_in_system_directory.
13438 * object.h (class Object): Add is_in_system_directory.
13439 (class Input_objects): Remove system_library_directory_ field.
13440 * object.cc (Input_objects::add_object): Don't set
13441 system_library_directory_.
13442 (input_objects::found_in_system_library_directory): Remove.
13443 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13444 parameter. Change all callers.
13445 (Symbol_table::sized_write_globals): Likewise.
13446 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13447 Call Object::is_in_system_directory.
13448 * symtab.h (class Symbol_table): Update declarations.
13449
61edd21f
ILT
13450 PR 5990
13451 * descriptors.h (Open_descriptor): Add is_on_stack field.
13452 * descriptors.cc (Descriptors::open): If the descriptor is on the
13453 top of the stack, remove it. Initialize is_on_stack field.
13454 (Descriptors::release): Only add pod to stack if it is not on the
13455 stack already.
13456 (Descriptors::close_some_descriptor): Clear stack_next and
13457 is_on_stack fields.
13458
e29e076a
ILT
13459 PR 7091
13460 * output.cc (Output_section::find_starting_output_address): Rename
13461 from starting_output_address; add PADDR parameter; change return
13462 type.
13463 * output.h (class Output_section): Declare
13464 find_starting_output_address instead of starting_output_address.
13465 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13466 section symbol for which we can't find a merge section.
13467
0602e05a
ILT
13468 PR 9836
13469 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13470 hidden or internal, force the symbol to be local.
13471 * resolve.cc (Symbol::override_visibility): Define.
13472 (Symbol::override_base): Use override_visibility.
13473 (Symbol_table::resolve): Likewise.
13474 (Symbol::override_base_with_special): Likewise.
13475 (Symbol_table::override_with_special): If the visibility is hidden
13476 or internal, force the symbol to be local.
13477 * symtab.h (class Symbol): Add set_visibility and
13478 override_visibility.
13479 * testsuite/ver_test_1.sh: New file.
13480 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13481 (check_DATA): Add ver_test_1.syms.
13482 (ver_test_1.syms): New target.
13483 * testsuite/Makefile.in: Rebuild.
13484
401a9a73
CC
134852009-02-25 Cary Coutant <ccoutant@google.com>
13486
13487 * layout.cc (Layout::choose_output_section): Don't rename sections
13488 when using a linker script that has a SECTIONS clause.
13489 * Makefile.in: Regenerate.
13490
13491 * testsuite/Makefile.am (script_test_5.sh): New test case.
13492 * testsuite/Makefile.in: Regenerate.
13493 * testsuite/script_test_5.cc: New file.
13494 * testsuite/script_test_5.sh: New file.
13495 * testsuite/script_test_5.t: New file.
13496
f488e4b0
CC
134972009-02-13 Rafael Avila de Espindola <espindola@google.com>
13498
13499 * archive.cc (Archive::include_member): Update calls to add_symbols.
13500 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13501 the Layout argument.
13502 * dynobj.h (do_add_symbols): Add the Layout argument.
13503 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13504 Layout argument.
13505 * object.h (Object::add_symbols): Add the Layout argument.
13506 (Object::do_add_symbols): Add the Layout argument.
13507 (Sized_relobj::do_add_symbols): Add the Layout argument.
13508 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13509 Unify the two versions.
13510 (Add_plugin_symbols): Remove.
13511 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13512 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13513 (Add_plugin_symbols): Remove.
13514 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13515 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13516 (Add_symbols::run): Make it work with Pulginobj.
13517
89dd1680
ILT
135182009-02-06 Ian Lance Taylor <iant@google.com>
13519
13520 * object.cc (Sized_relobj::do_layout): Make info message start
13521 with lower case letter.
13522
266d0a74
ILT
135232009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13524
602b464e
ILT
13525 * binary.cc: Fix file comment.
13526
266d0a74
ILT
13527 * options.h (enum Incremental_disposition): Define.
13528 (class General_options): Add new options: --incremental,
13529 --incremental_changed, --incremental_unchanged,
13530 --incremental_unknown. Add incremental_disposition_ and
13531 implicit_incremental_ fields.
13532 (General_options::incremental_disposition): New function.
13533 (class Position_dependent_options): Add incremental_disposition
13534 option.
13535 (Position_dependent_options::copy_from_options): Set incremental
13536 dispositions.
13537 * options.cc (General_options::parse_incremental_changed): New
13538 function.
2e702c99
RM
13539 (General_options::parse_incremental_unchanged): New function.
13540 (General_options::parse_incremental_unknown): New function.
13541 (General_options::General_options): Initialize new fields
266d0a74 13542 incremental_disposition_ and implicit_incremental_.
2e702c99 13543 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13544 without --incremental.
13545
f073bbf7
CD
135462009-02-06 Chris Demetriou <cgd@google.com>
13547
13548 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13549 pointer and to report location as the file name associated with
13550 the symbol.
13551 (gold_undefined_symbol_at_location): New function to replace the
13552 old gold_undefined_symbol functionality.
13553 * target-reloc.h (relocate_section): Update to use
13554 gold_undefined_symbol_at_location.
13555 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13556 Call gold_undefined_symbol function rather than gold_error.
13557 * errors.h (Errors::undefined_symbol): Take location as a
13558 string, rather than calculating it from a relocation.
13559 * errors.cc (Errors::fatal): Print "fatal error:" before the
13560 formatted message.
13561 (Errors::error, Errors::error_at_location): Print "error: "
13562 before the formatted message.
13563 (Errors::undefined_symbol): Take location as a string, rather
13564 than calculating it from a relocation.
13565 (gold_undefined_symbol_at_location): New function akin to
13566 old gold_undefined_symbol, calculates location from relocation.
13567 (gold_undefined_symbol): Change to take only a Symbol pointer
13568 and to report location as the file name associated with the symbol.
13569 * testsuite/debug_msg.sh: Update for changed error messages.
13570 * testsuite/undef_symbol.sh: Likewise.
13571
8e94a90c
ILT
135722009-02-04 Duncan Sands <baldrick@free.fr>
13573
13574 PR 9812
13575 * reduced_debug_output.h
13576 (Output_reduced_debug_abbrev_section::failed): Use format for
13577 gold_warning.
13578 (Output_reduced_debug_info_section::faild): Likewise.
13579
88a0e15b
ILT
135802009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13581
13582 * script.cc (Lazy_demangler): New class.
2e702c99 13583 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13584 symbol only once.
13585
5efc7cd2
CC
135862009-01-29 Cary Coutant <ccoutant@google.com>
13587
13588 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13589 to __tls_get_addr.
13590 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13591
e0ebcf42
ILT
135922009-01-28 Ian Lance Taylor <iant@google.com>
13593
5efc7cd2 13594 * version.cc (version_string): Bump to 1.9.
75fe7426 13595
e0ebcf42
ILT
13596 * gold.h: Include <cstring> and <stdint.h>.
13597 * version.cc: Include <cstdio>.
13598 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13599 warning.
13600 * reduced_debug_output.cc (insert_into_vector): Rename from
13601 Insert_into_vector; change all callers. Use Swap_unaligned to
13602 avoid aliasing issue; remove union since it is unnecessary.
13603
8e2813be 136042009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13605
13606 * Makefile.am (CCFILES): Add gc.cc.
13607 (HFILES): Add gc.h.
13608 * Makefile.in: Regenerate.
13609 * gold.cc (Gc_runner): New class.
13610 (queue_initial_tasks): Call garbage collection related tasks
13611 when corresponding options are invoked.
13612 (queue_middle_gc_tasks): New function.
13613 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13614 processed early before laying out sections during garbage collection.
13615 * gold.h (queue_middle_gc_tasks): New function.
13616 (is_prefix_of): Move from "layout.cc".
13617 * i386.cc (Target_i386::gc_process_relocs): New function.
13618 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13619 * main.cc (main): Create object of class "Garbage_collection".
13620 * object.cc (Relobj::copy_symbols_data): New function.
13621 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13622 (Sized_relobj::do_layout): Allow this function to be called twice
13623 during garbage collection and defer layout of section during the
6d03d481
ST
13624 first call.
13625 * object.h (Relobj::get_symbols_data): New function.
13626 (Relobj::is_section_name_included): New function.
13627 (Relobj::copy_symbols_data): New function.
13628 (Relobj::set_symbols_data): New function.
13629 (Relobj::get_relocs_data): New function.
13630 (Relobj::set_relocs_data): New function.
13631 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13632 (Relobj::gc_process_relocs): New function.
13633 (Relobj::do_gc_process_relocs): New pure virtual function.
13634 (Relobj::sd_): New data member.
13635 (Sized_relobj::is_output_section_offset_invalid): New function.
13636 (Sized_relobj::do_gc_process_relocs): New function.
13637 * options.h (General_options::gc_sections): Modify to not be a no-op.
13638 (General_options::print_gc_sections): New option.
13639 * plugin.cc (Plugin_finish::run): Remove function call to
13640 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13641 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13642 * reloc.cc (Read_relocs::run): Add task to process relocs and
13643 determine unreferenced sections when doing garbage collection.
13644 (Gc_process_relocs): New class.
13645 (Sized_relobj::do_gc_process_relocs): New function.
13646 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13647 sections that are garbage collected.
13648 * reloc.h (Gc_process_relocs): New class.
13649 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13650 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13651 symbols whose corresponding sections are garbage collected.
13652 (Symbol_table::Symbol_table): Add new parameter for the garbage
13653 collection object.
13654 (Symbol_table::gc_mark_undef_symbols): New function.
13655 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13656 (Symbol_table::gc_mark_dyn_syms): New function.
13657 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13658 as garbage.
13659 (Symbol_table::add_from_object): Likewise.
13660 (Symbol_table::add_from_relobj): When building shared objects, do not
13661 treat externally visible symbols as garbage.
13662 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13663 table information for static and relocatable links.
13664 * symtab.h (Symbol_table::set_gc): New function.
13665 (Symbol_table::gc): New function.
13666 (Symbol_table::gc_mark_undef_symbols): New function.
13667 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13668 (Symbol_table::gc_mark_dyn_syms): New function.
13669 (Symbol_table::gc_): New data member.
e1df38aa 13670 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
13671 function.
13672 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13673 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13674
3b293544
CF
136752009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13676
13677 * options.h (General_options::gc_sections): Define as a no-op for now.
13678 (General_options::no_keep_memory): Ditto.
13679 (General_options::Bshareable): Define.
13680 * options.cc (General_options::finalize): Honor -Bshareable.
13681
83d22aa8
AS
136822009-01-20 Andreas Schwab <schwab@suse.de>
13683
13684 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13685 read the value in the contents, since we don't use it. Use the
13686 template endianness when writing.
13687 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13688
cd536b21
AS
136892009-01-19 Andreas Schwab <schwab@suse.de>
13690
13691 * configure.tgt (powerpc64-*): Fix targ_obj.
13692
99e9a495
ILT
136932009-01-15 Ian Lance Taylor <iant@google.com>
13694
13695 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13696 local symbols when stripping all symbols.
13697
bbbfea06
CC
136982009-01-14 Cary Coutant <ccoutant@google.com>
13699
99e9a495 13700 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 13701
0f7c0701
CC
137022009-01-14 Cary Coutant <ccoutant@google.com>
13703
13704 * archive.cc (Archive::get_elf_object_for_member): Remove call
13705 to File_read::claim_for_plugin.
13706 * descriptors.cc (Descriptors::open): Remove reference to
13707 is_claimed.
13708 (Descriptors::claim_for_plugin): Remove.
13709 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13710 (Descriptors::is_claimed): Remove.
13711 (claim_descriptor_for_plugin): Remove.
13712 * fileread.cc (File_read::claim_for_plugin): Remove.
13713 * fileread.h (File_read::claim_for_plugin): Remove.
13714 (File_read::descriptor): Reopen descriptor if necessary.
13715 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13716 (Plugin_manager::all_symbols_read): Add task parameter. Change
13717 all callers.
13718 (Plugin_manager::get_input_file): New function.
13719 (Plugin_manager::release_input_file): New function.
13720 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13721 corresponding data member.
13722 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13723 and pass to base constructor. Change all callers.
13724 (get_input_file, release_input_file): New functions.
13725 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13726 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13727 (Plugin_manager::all_symbols_read): Add task parameter.
13728 (Plugin_manager::get_input_file): New function.
13729 (Plugin_manager::release_input_file): New function.
13730 (Plugin_manager::task_): New data member.
13731 (Pluginobj::Pluginobj): Add filesize parameter.
13732 (Pluginobj::filename): New function.
13733 (Pluginobj::descriptor): New function.
13734 (Pluginobj::filesize): New function.
13735 (Pluginobj::filesize_): New data member.
13736 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13737 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13738 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13739
13740 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13741 with archive libraries.
13742 * testsuite/Makefile.in: Regenerate.
13743 * testsuite/plugin_test.c (struct sym_info): New type.
13744 (get_input_file, release_input_file): New static variables.
13745 (onload): Capture new transfer vector entries.
13746 (claim_file_hook): Stop reading at end of file according to filesize.
13747 Factor out parsing of readelf output into separate function.
13748 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13749 APIs and get the source file name from the symbol table. Convert
13750 source file name to corresponding object file name. Print info
13751 message when adding new input files.
13752 (parse_readelf_line): New function.
13753 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13754 * testsuite/plugin_test_2.sh: Likewise.
13755 * testsuite/plugin_test_3.sh: Likewise.
13756 * testsuite/plugin_test_4.sh: New test case.
13757
62a6d109
ILT
137582009-01-07 Ian Lance Taylor <iant@google.com>
13759
13760 * version.cc (version_string): Bump to 1.8.
13761
483620e8
CC
137622008-12-23 Cary Coutant <ccoutant@google.com>
13763
13764 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13765 * plugin.cc (Plugin_manager::finish): Rename as
13766 layout_deferred_objects. Move cleanup to separate function.
13767 (Plugin_manager::cleanup): New function.
13768 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13769 separately.
13770 * plugin.h (Plugin_manager::finish): Rename as
13771 layout_deferred_objects.
13772 (Plugin_manager::cleanup): New function.
13773 (Plugin_manager::cleanup_done): New field.
13774
d66a9eb3
CC
137752008-12-23 Cary Coutant <ccoutant@google.com>
13776
13777 * plugin.cc (is_visible_from_outside): New function.
13778 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
13779 so we don't return "IR only" status for exported symbols or -r links.
13780
13781 * testsuite/Makefile.am (plugin_test_3): New test case.
13782 * testsuite/Makefile.in: Regenerate.
13783 * testsuite/plugin_test_3.sh: New file.
13784
5995b570
CC
137852008-12-22 Cary Coutant <ccoutant@google.com>
13786
13787 * object.cc (Sized_relobj::layout_section): New function.
13788 (Sized_relobj::do_layout): Defer layout of input sections until after
13789 plugin has provided replacement files.
13790 (Sized_relobj::do_layout_deferred_sections): New function.
13791 * object.h (Relobj::set_section_offset): Remove virtual keyword.
13792 (Relobj::layout_deferred_sections): New function.
13793 (Relobj::do_layout_deferred_sections): New function.
13794 (Sized_relobj::do_layout_deferred_sections): New function.
13795 (Sized_relobj::layout_section): New function.
13796 (Sized_relobj::Deferred_layout): New structure.
13797 (Sized_relobj::deferred_layout_): New field.
13798 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
13799 Change all callers. Layout deferred sections.
13800 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
13801 references.
13802 (Plugin_hook::run): Move code from do_plugin_hook inline.
13803 (Plugin_hook::do_plugin_hook): Remove.
13804 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
13805 (Plugin_manager::finish): Renamed, was cleanup.
13806 (Plugin_manager::should_defer_layout): New function.
13807 (Plugin_manager::add_deferred_layout_object): New function.
13808 (Plugin_manager::Deferred_layout_list): New type.
13809 (Plugin_manager::deferred_layout_objects_): New field.
13810 (Plugin_hook::do_plugin_hook): Remove.
13811
ee769c88
ILT
138122008-12-17 Ian Lance Taylor <iant@google.com>
13813
13814 * options.h (class General_options): Add --no case for
13815 --export-dynamic.
13816
abc8dcba
CC
138172008-12-16 Cary Coutant <ccoutant@google.com>
13818
13819 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
13820 vector.
13821 (Plugin_manager::claim_file): Create plugin object even if
13822 plugin did not call the add_symbols callback.
13823 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
13824 asking for more symbols than were added.
13825 * testsuite/Makefile.am (plugin_test_1): Add test case with
13826 no global symbols.
13827 (empty.syms): New target.
13828 * testsuite/Makefile.in: Regenerate.
13829 * testsuite/plugin_test.c (claim_file_hook): Add new debug
13830 message. Don't call add_symbols if no globals.
13831 (all_symbols_read_hook): Don't provide replacement for empty
13832 claimed file.
13833
b0074644
ILT
138342008-12-12 Ian Lance Taylor <iant@google.com>
13835
68943102
ILT
13836 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
13837 r_type == 0 for a local symbol with r_sym == 0.
13838 (scan_relocatable_relocs): Pass r_sym to
13839 local_non_section_strategy.
13840 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
13841 r_sym parameter.
13842
b0074644
ILT
13843 * configure.ac: Update test for TLS descriptors: they are
13844 supported as of glibc 2.9.
13845 * configure: Rebuild.
13846
c2508178
ILT
138472008-12-11 Ian Lance Taylor <iant@google.com>
13848
13849 PR 7091
13850 * target-reloc.h (Default_scan_relocatable_relocs): For each
13851 function, map r_type == 0 to RELOC_DISCARD.
13852
2756a258
CC
138532008-12-10 Cary Coutant <ccoutant@google.com>
13854
13855 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
13856 object to override a kept COMDAT group from a plugin object.
13857
bb6f53d3
ILT
138582008-12-09 Ian Lance Taylor <iant@google.com>
13859
fbc558e1
ILT
13860 PR 7088
13861 * yyscript.y (file_cmd): Handle INPUT.
13862
bb6f53d3
ILT
13863 * testsuite/initpri1.c: Change all declarations to be full
13864 prototypes by adding void, to avoid compiler warnings.
13865
4674ecfc
CC
138662008-12-05 Rafael Avila de Espindola <espindola@google.com>
13867
13868 * options.cc (General_options::parse_plugin_opt): New.
13869 (General_options::add_plugin): The argument now is just the filename.
13870 (General_options::add_plugin_option): New.
13871 * options.h (plugin_opt): New.
13872 (add_plugin): Change argument name.
13873 (add_plugin_option): New.
13874 * plugin.cc (Plugin::load): Don't parse the plugin option.
13875 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
13876 (Plugin::add_option): New.
13877 (Plugin::args_): Change type.
13878 (Plugin::filename_): New.
13879 (Plugin_manager::add_plugin_option): New.
13880 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
13881 * testsuite/Makefile.in: Regenerate.
13882
fd06b4aa
CC
138832008-12-05 Cary Coutant <ccoutant@google.com>
13884
13885 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
13886 Handle --strip-lto-sections option.
13887 * options.h (strip_lto_sections): New option.
13888
6c52134c
CC
138892008-12-01 Cary Coutant <ccoutant@google.com>
13890
13891 * plugin.cc (ld_plugin_message): Change format parameter to const.
13892 Fix mismatch between new[] and delete.
13893
a45248e0
CC
138942008-11-14 Cary Coutant <ccoutant@google.com>
13895
13896 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
13897 instead of -1U.
13898
c82fbeee
CS
138992008-11-05 Craig Silverstein <csilvers@google.com>
13900
13901 * options.cc (General_options::parse_dynamic_list): New function.
13902 * options.h (General_options): New flags dynamic_list,
13903 dynamic_list_data, dynamic_list_cpp_new, and
13904 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
13905 (General_options::in_dynamic_list): New function.
13906 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
13907 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
13908 (Lex::can_continue_name): Likewise.
13909 (yylex): Likewise.
13910 (read_script_file): New parameter script_options.
13911 (read_dynamic_list): New function.
13912 (Script_options::define_dynamic_list): New function.
13913 (dynamic_list_keyword_parsecodes): New variable.
13914 (dynamic_list_keywords): New variable.
13915 * script.h (Script_options::define_dynamic_list): New function
13916 prototype.
13917 (read_dynamic_list): New function prototype.
13918 * symtab.cc (strprefix): New macro.
13919 (Symbol::should_add_dynsym_entry): Support dynamic_list,
13920 dynamic_list_data, dynamic_list_cpp_new, and
13921 dynamic_list_cpp_typeinfo.
13922 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
13923 (dynamic_list_expr): New rule.
13924 (dynamic_list_nodes): Likewise.
13925 (dynamic_list_node): Likewise.
13926 * testsuite/Makefile.am (dynamic_list): New test.
13927 * testsuite/Makefile.in: Regenerated.
13928 * testsuite/dynamic_list.t: New file.
13929 * testsuite/dynamic_list.sh: New file.
13930
e0bb29a5
CS
139312008-11-05 Craig Silverstein <csilvers@google.com>
13932
13933 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
13934 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
13935 (t11_last): Likewise.
13936 * testsuite/ver_test_6.c (main): Likewise.
13937
4e1e25e0
CC
139382008-10-07 Cary Coutant <ccoutant@google.com>
13939
13940 * options.c (General_options::finalize): Add check for -static and
13941 -shared.
13942 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
13943 is not empty.
13944
92f03fcb
CC
139452008-10-02 Cary Coutant <ccoutant@google.com>
13946
13947 * plugin.cc (make_sized_plugin_object): Fix conditional
13948 compilation to work when not all targets are enabled.
13949
fbd8a257
CC
139502008-09-29 Cary Coutant <ccoutant@google.com>
13951
13952 * archive.cc (Archive::get_file_and_offset): Use filename instead
13953 of name to get library path.
13954 (Archive::include_member): Unlock external member of a thin archive.
13955
13956 * testsuite/Makefile.am (TEST_AR): New variable.
13957 (thin_archive_test_1): New test.
13958 (thin_archive_test_2): New test.
81636b3f
CC
13959 * testsuite/Makefile.in: Regenerate.
13960 * testsuite/thin_archive_main.cc: New file.
13961 * testsuite/thin_archive_test_1.cc: New file.
13962 * testsuite/thin_archive_test_2.cc: New file.
13963 * testsuite/thin_archive_test_3.cc: New file.
13964 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 13965
eff45813
CC
139662008-09-29 Cary Coutant <ccoutant@google.com>
13967
13968 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
13969 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
13970 instead of -1U.
13971 (Sized_relobj::do_finalize_local_symbols): Likewise.
13972 (Sized_relobj::map_to_kept_section): Likewise.
13973 * object.h (Sized_relobj::invalid_address): New constant.
13974 (Sized_relobj::do_output_section_offset): Check for invalid_address
13975 and return -1ULL.
13976 * output.cc (Output_reloc::local_section_offset): Use constant
13977 invalid_address instead of -1U.
13978 (Output_reloc::get_address): Likewise.
13979 (Output_section::output_address): Change -1U to -1ULL.
13980 * output.h (Output_reloc::invalid_address): New constant.
13981 * reloc.cc (Sized_relobj::write_sections): Use constant
13982 invalid_address instead of -1U.
13983 (Sized_relobj::relocate_sections): Likewise.
13984 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
13985 values for merge sections.
13986 * target-reloc.h (relocate_for_relocatable): Use constant
13987 invalid_address instead of -1U.
13988
89fc3421
CC
139892008-09-19 Cary Coutant <ccoutant@google.com>
13990
13991 Add plugin functionality for link-time optimization (LTO).
13992 * configure.ac (plugins): Add --enable-plugins option.
13993 * configure: Regenerate.
13994 * config.in: Regenerate.
13995 * Makefile.am (LIBDL): New variable.
13996 (CCFILES): Add plugin.cc.
13997 (HFILES): Add plugin.h.
13998 (ldadd_var): Add LIBDL.
13999 * Makefile.in: Regenerate.
14000
14001 * archive.cc: Include "plugin.h".
14002 (Archive::setup): Don't preread archive symbols when using a plugin.
14003 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14004 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14005 files.
14006 (Archive::include_member): Add symbols from plugin objects.
14007 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14008 * descriptors.cc (Descriptors::open): Check for file descriptors
14009 abandoned by plugins.
14010 (Descriptors::claim_for_plugin): New function.
14011 * descriptors.h (Descriptors::claim_for_plugin): New function.
14012 (Open_descriptor::is_claimed): New field.
14013 (claim_descriptor_for_plugin): New function.
14014 * fileread.cc (File_read::claim_for_plugin): New function.
14015 * fileread.h (File_read::claim_for_plugin): New function.
14016 (File_read::descriptor): New function.
14017 * gold.cc: Include "plugin.h".
14018 (queue_initial_tasks): Add task to call plugin hooks for generating
14019 new object files.
14020 * main.cc: Include "plugin.h".
14021 (main): Load plugin libraries.
14022 * object.h (Pluginobj): Declare.
14023 (Object::pluginobj): New function.
14024 (Object::do_pluginobj): New function.
14025 (Object::set_target): New function.
14026 * options.cc: Include "plugin.h".
14027 (General_options::parse_plugin): New function.
14028 (General_options::General_options): Initialize plugins_ field.
14029 (General_options::add_plugin): New function.
14030 * options.h (Plugin_manager): Declare.
14031 (General_options): Add --plugin option.
14032 (General_options::has_plugins): New function.
14033 (General_options::plugins): New function.
14034 (General_options::add_plugin): New function.
14035 (General_options::plugins_): New field.
14036 * plugin.cc: New file.
14037 * plugin.h: New file.
14038 * readsyms.cc: Include "plugin.h".
14039 (Read_symbols::do_read_symbols): Check for archive before checking
14040 for ELF file. Call plugin hooks to claim files.
14041 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14042 from a real object file; force override when processing replacement
14043 files.
14044 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14045 (Symbol::init_base_object): Likewise.
14046 (Symbol::init_base_output_data): Likewise.
14047 (Symbol::init_base_output_segment): Likewise.
14048 (Symbol::init_base_constant): Likewise.
14049 (Symbol::init_base_undefined): Likewise.
14050 (Symbol::output_section): Assert that object is not a plugin.
14051 (Symbol_table::add_from_pluginobj): New function.
14052 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14053 undefined.
14054 (Symbol_table::sized_write_globals): Likewise.
14055 (Symbol_table::add_from_pluginobj): Instantiate template.
14056 * symtab.h (Sized_pluginobj): Declare.
14057 (Symbol::in_real_elf): New function.
14058 (Symbol::set_in_real_elf): New function.
14059 (Symbol::in_real_elf_): New field.
14060 (Symbol_table::add_from_pluginobj): New function.
14061
14062 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14063 (LIBDL): New variable.
14064 (LDADD): Add LIBDL.
14065 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14066 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14067 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14068 (MOSTLYCLEANFILES): Likewise.
14069 * testsuite/Makefile.in: Regenerate.
14070 * testsuite/plugin_test.c: New file.
14071 * testsuite/plugin_test_1.sh: New file.
14072 * testsuite/plugin_test_2.sh: New file.
14073
de31bda5
ILT
140742008-09-16 Ian Lance Taylor <iant@google.com>
14075
9c2d0ef9
ILT
14076 * target-reloc.h (relocate_section): Check whether a symbol is
14077 defined by the ABI before reporting an undefined symbol error.
14078 * target.h (Target::is_defined_by_abi): Make parameter const.
14079 (Target::do_is_defined_by_abi): Likewise.
14080 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14081 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14082 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14083 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14084 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14085 * testsuite/Makefile.in: Rebuild.
14086
de31bda5
ILT
14087 * fileread.cc (make_view): Add casts to avoid warning.
14088
9fa33bee
AO
140892008-09-16 Alexandre Oliva <aoliva@redhat.com>
14090
14091 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14092 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14093
183fd0e3
AO
140942008-09-16 Alexandre Oliva <aoliva@redhat.com>
14095
14096 * options.h (General_options::output_is_executable): New.
14097 (General_options::output_is_pie): New.
14098 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14099 for shared libraries.
14100 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14101
7be8330a
CD
141022008-09-11 Chris Demetriou <cgd@google.com>
14103
14104 * options.h (origin): New -z option.
14105 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14106 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14107 in DT_FLAGS_1.
14108
a9caad02
CC
141092008-09-05 Cary Coutant <ccoutant@google.com>
14110
14111 * fileread.cc (File_read::make_view): Add check for attempt to map
14112 beyond end of file.
14113
ae6dce4d
CC
141142008-09-05 Cary Coutant <ccoutant@google.com>
14115
14116 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14117 explicit instantiations.
14118
d7ab2a47
KVH
141192008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14120
14121 PR gold/6858
14122 * options.cc (General_options::finalize): Allow undefined symbols
14123 in shlibs if linking -shared.
14124
14125 PR gold/6859
14126 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14127 symbols as not needing a dynsym entry.
14128
1e52a9c1
CS
141292008-08-20 Craig Silverstein <csilvers@google.com>
14130
14131 * fileread.cc (File_read::open): Do not lock the file unless it
14132 was successfully opened.
14133
d85c80a3
CC
141342008-08-14 Cary Coutant <ccoutant@google.com>
14135
14136 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14137 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14138 * testsuite/tls_test.cc (struct int128): 128-bit struct
14139 for testing TLS relocs with non-zero addend.
14140 (v12): New TLS variable.
14141 (t12): New test.
14142 (t_last): Add check for v12.
14143 * testsuite/tls_test.h (t12): New function.
14144 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14145
2d924fd9
ILT
141462008-08-13 Ian Lance Taylor <iant@google.com>
14147
14148 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14149 set tls_segment_ or relro_segment_.
14150 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14151 when appropriate.
14152 * output.h (Output_section::clear_is_relro): New function.
14153 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14154 sections specially even when output_data_ is empty.
14155 (Output_segment::maximum_alignment): When first section is relro,
14156 only force alignment for PT_LOAD segments.
14157 * script.cc (script_data_segment_align): New function.
14158 (script_data_segment_relro_end): New function.
14159 * script-c.h (script_data_segment_align): Declare.
14160 (script_data_segment_relro_end): Declare.
14161 * script-sections.h (class Script_sections): Declare
14162 data_segment_align and data_segment_relro_end. Add fields
14163 segment_align_index_ and saw_relro_end_.
14164 * script-sections.cc (class Sections_element): Add set_is_relro
14165 virtual function. Add new bool* parameter to place_orphan_here.
14166 Add get_output_section virtual function.
14167 (class Output_section_definition): Add set_is_relro. Add new
14168 bool* parameter to place_orphan_here. Add get_output_section.
14169 Add is_relro_ field.
14170 (Output_section_definition::Output_section_definition): Initialize
14171 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14172 and is_relro_ fields.
14173 (Output_section_definition::place_orphan_here): Add is_relro
14174 parameter.
14175 (Output_section_definition::set_section_addresses): Set relro for
14176 output section.
14177 (Output_section_definition::alternate_constraint): Likewise.
14178 (class Orphan_output_section): Add new bool* parameter to
14179 place_orphan_here. Add get_output_section.
14180 (Orphan_output_section::place_orphan_here): Add is_relro
14181 parameter.
14182 (Script_sections::Script_sections): Initialize
14183 data_segment_align_index_ and saw_relro_end_.
14184 (Script_sections::data_segment_align): New function.
14185 (Script_sections::data_segment_relro_end): New function.
14186 (Script_sections::place_orphan): Set or clear is_relro.
14187 (Script_sections::set_section_addresses): Force alignment of first
14188 TLS section.
14189 * yyscript.y (exp): Call script_data_segment_align and
14190 script_data_segment_relro_end.
14191 * testsuite/relro_script_test.t: New file.
14192 * testsuite/relro_test.cc (using_script): Declare.
14193 (t1, t2): Test using_script.
14194 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14195 (relro_script_test_SOURCES): Define.
14196 (relro_script_test_DEPENDENCIES): Define.
14197 (relro_script_test_LDFLAGS): Define.
14198 (relro_script_test_LDADD): Define.
14199 (relro_script_test.so): New target.
14200 * testsuite/Makefile.in: Rebuild.
14201
f827c9a9
CC
142022008-08-06 Cary Coutant <ccoutant@google.com>
14203
14204 * archive.cc (Archive::total_archives, Archive::total_members)
14205 (Archive::total_members_loaded): New variables.
14206 (Archive::setup): Add parameter. Add option to preread
14207 archive symbols.
14208 (Archive::read_armap): Add counter.
14209 (Archive::get_file_and_offset): New function.
14210 (Archive::get_elf_object_for_member): New function.
14211 (Archive::read_all_symbols): New function.
14212 (Archive::read_symbols): New function.
14213 (Archive::add_symbols): Add counters.
14214 (Archive::include_all_members): Use armap to find members if it's
14215 already built.
14216 (Archive::include_member): Skip reading symbols if already read.
14217 Factored code into Archive::get_file_and_offset and
14218 Archive::get_elf_object_for_member. Changed call to
14219 Mapfile::report_include_archive_member.
14220 (Archive::print_stats): New function.
14221 * archive.h: Declare Object and Read_symbols_data classes.
14222 (Archive::Archive): Add initializers for new members.
14223 (Archive::setup): Add parameter.
14224 (Archive::print_stats): New function.
14225 (Archive::total_archives, Archive::total_members)
14226 (Archive::total_members_loaded): New variables.
14227 (Archive::get_file_and_offset): New function.
14228 (Archive::get_elf_object_for_member): New function.
14229 (Archive::read_all_symbols): New function.
14230 (Archive::read_symbols): New function.
14231 (Archive::Archive_member): New class.
14232 (Archive::members_): New member.
14233 (Archive::num_members_): New member.
14234 * main.cc: Include archive.h.
14235 (main): Call Archive::print_stats.
14236 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14237 archive parameter; member_name is now the fully-decorated name.
14238 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14239 * options.h: (General_options): Add --preread-archive-symbols option.
14240 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14241 Archive::setup.
14242
de4c45bd
ILT
142432008-08-04 Ian Lance Taylor <iant@google.com>
14244
14245 * symtab.h (Symbol::use_plt_offset): New function.
14246 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14247 * powerpc.cc (Relocate::relocate): Likewise.
14248 * sparc.cc (Relocate::relocate): Likewise.
14249 * x86_64.cc (Relocate::relocate): Likewise.
14250 * testsuite/weak_plt.sh: New test.
14251 * testsuite/weak_plt_main.cc: New test.
14252 * testsuite/weak_plt_shared.cc: New test.
14253 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14254 (check_PROGRAMS): Add weak_plt.
14255 (check_DATA): Add weak_plt_shared.so.
14256 (weak_plt_main_pic.o, weak_plt): New targets.
14257 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14258 * testsuite/Makefile.in: Rebuild.
14259
14260 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14261 gcctestdir/ld.
14262 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14263 * testsuite/Makefile.in: Rebuild.
14264
323ee3f4
AM
142652008-08-04 Alan Modra <amodra@bigpond.net.au>
14266
14267 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14268 * Makefile.in: Regenerate.
14269 * po/POTFILES.in: Regenerate.
14270
7c07ecec
ILT
142712008-07-29 Ian Lance Taylor <iant@google.com>
14272
14273 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14274 symbols before other symbols.
14275 * testsuite/script_test_2.cc (test_addr): Declare.
14276 (test_addr_alias): Declare.
14277 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14278 values.
7c07ecec
ILT
14279 * testsuite/script_test_2.t: Define test_addr_alias and
14280 test_addr.
14281
5778530e
ILT
142822008-07-24 Ian Lance Taylor <iant@google.com>
14283
2a00e4fb
ILT
14284 PR 5990
14285 * descriptors.cc: New file.
14286 * descriptors.h: New file.
14287 * gold-threads.h (class Hold_optional_lock): New class.
14288 * fileread.cc: Include "descriptors.h".
14289 (File_read::~File_read): Release descriptor rather than closing
14290 it.
14291 (File_read::open) [file]: Call open_descriptor rather than open.
14292 Set is_descriptor_opened_.
14293 (File_read::open) [memory]: Assert that descriptor is not open.
14294 (File_read::reopen_descriptor): New function.
14295 (File_read::release): Release descriptor.
14296 (File_read::do_read): Make non-const. Reopen descriptor.
14297 (File_read::read): Make non-const.
14298 (File_read::make_view): Reopen descriptor.
14299 (File_read::do_readv): Likewise.
14300 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14301 Update declarations.
14302 * layout.cc: Include "descriptors.h".
14303 (Layout::create_build_id): Use open_descriptor rather than open.
14304 * output.cc: Include "descriptors.h".
14305 (Output_file::open): Use open_descriptor rather than open.
14306 * archive.cc (Archive::const_iterator): Change Archive to be
14307 non-const.
14308 (Archive::begin, Archive::end): Make non-const.
14309 (Archive::count_members): Likewise.
14310 * archive.h (class Archive): Update declarations.
14311 * object.h (Object::read): Make non-const.
14312 * Makefile.am (CCFILES): Add descriptors.cc.
14313 (HFILES): Add descriptors.h.
14314 * Makefile.in: Rebuild.
14315
801647d1
ILT
14316 PR 6716
14317 * gold.h: Always include <clocale>. Add Solaris workarounds
14318 following code in binutils/sysdep.h.
14319
5edd166e
ILT
14320 PR 6048
14321 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14322 this->eh_frame_hdr_ is NULL before using it.
14323
c89ad728
ILT
14324 * dynobj.cc (Versions::Versions): Update comment.
14325
aa86f06b
ILT
14326 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14327 the base version name.
14328
5778530e
ILT
14329 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14330 array size plus one.
14331 (Stringpool_template::set_string_offsets): Subtract one from key
14332 before using it as an array index.
14333 (Stringpool_template::get_offset_with_length): Likewise.
14334 (Stringpool_template::write_to_buffer): Likewise.
14335 * stringpool.h (Stringpool_template::get_offset_from_key):
14336 Likewise.
14337
057ead22
ILT
143382008-07-23 Ian Lance Taylor <iant@google.com>
14339
7f649c59
ILT
14340 PR 6658
14341 * object.h (Merged_symbol_value::value): Do our best to handle a
14342 negative addend.
14343
057ead22
ILT
14344 PR 6647
14345 * script.cc (Version_script_info::get_versions): Don't add empty
14346 version tag to return value.
14347 (Version_script_info::get_symbol_version_helper): Change return
14348 type to bool. Add pversion parameter. Change all callers.
14349 (script_register_vers_node): Don't require a non-NULL tag.
14350 * script.h (class Version_script_info): Update declarations.
14351 (Version_script_info::get_symbol_version): Change return type to
14352 bool. Add version parameter. Change all callers.
14353 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14354 handling. Handle an empty version from a version script.
14355 (Symbol_table::define_special_symbol): Likewise.
14356 * testsuite/ver_test_10.script: New file.
14357 * testsuite/ver_test_10.sh: New file.
14358 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14359 (check_DATA): Add ver_test_10.syms.
14360 (ver_test_10.syms, ver_test_10.so): New target.
14361 * testsuite/Makefile.in: Rebuild.
14362
58e54ac2
CD
143632008-07-23 Simon Baldwin <simonb@google.com>
14364
14365 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14366 to zero for undefined symbols from dynamic libraries.
14367
95d14cd3
ILT
143682008-07-23 Ian Lance Taylor <iant@google.com>
14369
14370 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14371 Change all callers.
14372 * symtab.h (class Symbol_table): Update declaration.
14373 * testsuite/ver_test_9.cc: New file.
14374 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14375 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14376 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14377 (ver_test_9.so, ver_test_9.o): New targets.
14378 * testsuite/Makefile.in: Rebuild.
14379
92de84a6
ILT
143802008-07-22 Ian Lance Taylor <iant@google.com>
14381
34810851
ILT
14382 * options.h (class General_options): Define --check-sections.
14383 * layout.cc (Layout::set_segment_offsets): Handle
14384 --check-sections.
14385
af6156ef
ILT
14386 * options.h (class General_options): Define -n/--nmagic and
14387 -N/--omagic.
14388 * options.cc (General_options::finalize): For -n/--nmagic or
14389 -N/--omagic, set -static.
14390 * layout.cc (Layout::attach_allocated_section_to_segment): If
14391 -N/--omagic, don't put read-only and read-write sections in
14392 different segments.
14393 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14394 finding a read-only segment.
14395 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14396 don't set the minimum segment alignment to the common page size,
14397 and don't set the file offset to the address modulo the page size.
14398 * script-sections.cc (Script_sections::create_segments): If
14399 -n/--omagic, don't put read-only and read-write sections in
14400 different segments.
14401
92de84a6
ILT
14402 * cref.cc: New file.
14403 * cref.h: New file.
14404 * options.h (class General_options): Add --print-symbol-counts.
14405 * main.cc (main): Issue defined symbol report if requested.
14406 * archive.cc (Archive::interpret_header): Make into a const member
14407 function.
14408 (Archive::add_symbols): Call Input_objects::archive_start and
14409 archive_stop.
14410 (Archive::const_iterator): Define new class.
14411 (Archive::begin, Archive::end): New functions.
14412 (Archive::include_all_members): Rewrite to use iterator.
14413 (Archive::count_members): New function.
14414 * archive.h (class Archive): Update declarations.
14415 (Archive::filename): New function.
14416 * object.cc: Include "cref.h".
14417 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14418 (Sized_relobj::do_get_global_symbol_counts): New function.
14419 (Input_objects::add_object): Add object to cross-referencer.
14420 (Input_objects::archive_start): New function.
14421 (Input_objects::archive_stop): New function.
14422 (Input_objects::print_symbol_counts): New function.
14423 * object.h: Declare Cref and Archive.
14424 (Object::get_global_symbol_counts): New function.
14425 (Object::do_get_global_symbol_counts): New pure virtual function.
14426 (class Sized_relobj): Add defined_count_ field. Update
14427 declarations.
14428 (class Input_objects): Add cref_ field. Update constructor.
14429 Update declarations.
14430 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14431 defined_count_.
14432 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14433 symbol counts.
14434 (Sized_dynobj::do_get_global_symbol_counts): New function.
14435 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14436 defined_count_. Update declarations. Define Symbols typedef.
14437 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14438 parameter. Change all callers.
14439 (Symbol_table::add_from_dynobj): Add sympointers and defined
14440 parameters. Change all callers.
14441 * symtab.h (class Symbol_table): Update declarations.
14442 * Makefile.am (CCFILES): Add cref.cc.
14443 (HFILES): Add cref.h.
14444 * Makefile.in: Rebuild.
14445
3f7c5e1d
CD
144462008-07-22 Simon Baldwin <simonb@google.com>
14447
14448 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14449 to zero when writing undefined symbols.
14450
e0b64032
ILT
144512008-07-22 Ian Lance Taylor <iant@google.com>
14452
14453 * output.cc (Output_section::add_input_section): Don't try to
14454 merge empty merge sections.
14455
096b02cf
CS
144562008-07-21 Craig Silverstein <csilvers@google.com>
14457
14458 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14459 Include symbol version in error message.
cd536b21 14460
1d1f116d
CD
144612008-07-20 Chris Demetriou <cgd@google.com>
14462
cd536b21 14463 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14464 (RANDOM_SEED_CFLAGS): New substituted variable.
14465 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14466 * configure: Rebuild.
14467 * Makefile.in: Likewise.
14468 * testsuite/Makefile.in: Likewise.
14469
a18f591e
ILT
144702008-07-18 Ian Lance Taylor <iant@google.com>
14471
14472 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14473 where we see NAME/NULL and NAME/VERSION as separate symbols.
14474 * testsuite/ver_test_main.cc (main): Call t4.
14475 (t4, t4_2a): Define.
14476 * testsuite/ver_test_2.cc (t4_2): Define.
14477 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14478 * testsuite/ver_test_4.cc (t4_2a): Define.
14479 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14480 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14481
c6e3f6ed
ILT
144822008-07-17 Ian Lance Taylor <iant@google.com>
14483
14484 * dynobj.cc (Versions::add_def): If we give an error about a
14485 missing version, go ahead and create the version anyhow.
14486
ef9beddf
ILT
144872008-07-10 Ian Lance Taylor <iant@google.com>
14488
14489 Handle output sections with more than 0x7fffffff bytes.
14490 * object.h (class Relobj): Change map_to_output_ to
14491 output_sections_, and just keep a section pointer. Change all
14492 uses. Move comdat group support to Sized_relobj.
14493 (Relobj::is_section_specially_mapped): Remove.
14494 (Relobj::output_section): Remove poff parameter. Change all
14495 callers.
14496 (Relobj::output_section_offset): New function.
14497 (Relobj::set_section_offset): Rewrite.
14498 (Relobj::map_to_output): Remove.
14499 (Relobj::output_sections): New function.
14500 (Relobj::do_output_section_offset): New pure virtual function.
14501 (Relobj::do_set_section_offset): Likewise.
14502 (class Sized_relobj): Add section_offsets_ field. Add comdat
14503 group support from Relobj. Update declarations.
14504 (Sized_relobj::get_output_section_offset): New function.
14505 (Sized_relobj::do_output_section_offset): New function.
14506 (Sized_relobj::do_set_section_offset): New function.
14507 * object.cc (Relobj::output_section_address): Remove.
14508 (Sized_relobj::Sized_relobj): Initialize new fields.
14509 (Sized_relobj::include_section_group): Cast find_kept_object to
14510 Sized_relobj.
14511 (Sized_relobj::include_linkonce_section): Likewise.
14512 (Sized_relobj::do_layout): Use separate arrays for output section
14513 and output offset.
14514 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14515 output_sections.
14516 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14517 output_sections and section_offsets.
14518 (Sized_relobj::write_local_symbols): Likewise.
14519 (map_to_kept_section): Compute output address directly.
14520 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14521 output_sections and section_offsets.
14522 (Sized_relobj::write_sections): Likewise.
14523 (Sized_relobj::relocate_sections): Likewise.
14524 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14525 * output.h (class Output_reloc): Update declarations. Change
14526 u2_.relobj to Sized_relobj*.
14527 (class Output_data_reloc): Change add functions to use
14528 Sized_relobj*.
14529 * output.cc (Output_reloc::Output_reloc): Change relobj to
14530 Sized_relobj*.
14531 (Output_reloc::local_section_offset): Change return type to
14532 Elf_Addr. Use get_output_section_offset.
14533 (Output_reloc::get_address): Likewise.
14534 (Output_section::is_input_address_mapped): Don't call
14535 is_section_specially_mapped.
14536 (Output_section::output_offset): Likewise.
14537 (Output_section::output_address): Likewise.
14538 (Output_section::starting_output_address): Likewise.
14539 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14540 parameter to Sized_relobj*.
14541 (Copy_relocs::need_copy_reloc): Likewise.
14542 (Copy_relocs::save): Likewise.
14543 * copy-relocs.h (class Copy_relocs): Update declarations.
14544 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14545 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14546 * target-reloc.h (relocate_for_relocatable): Change
14547 offset_in_output_section type to Elf_Addr. Change code that uses
14548 it as well.
14549 * layout.cc (Layout::layout): Always set *off.
14550 * mapfile.cc (Mapfile::print_input_section): Use
14551 output_section_offset.
14552 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14553 Sized_relobj*.
14554 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14555 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14556 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14557
5cb66f97
ILT
145582008-07-03 Ian Lance Taylor <iant@google.com>
14559
14560 * layout.cc (Layout::include_section): Do not discard unrecognized
14561 SHT_STRTAB sections.
14562
afe47622
CS
145632008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14564
14565 * script.cc (Lex::can_continue_name): Make '?' allowable in
14566 version-script names.
14567 * testsuite/version_script.map: Change glob pattern to use '?'
14568
5adf9721
ILT
145692008-06-30 Manish Singh <yosh@gimp.org>
14570
14571 PR 6585
14572 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14573 Correct typo.
14574
e6fde208
ILT
145752008-06-30 Ian Lance Taylor <iant@google.com>
14576
14577 PR 6660
14578 PR 6682
14579 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14580 versions]: Don't try to read the value in the contents, since we
14581 don't use it. Use the template endianness when writing.
14582
3f2e6a2d
CC
145832008-06-25 Cary Coutant <ccoutant@google.com>
14584
14585 * fileread.cc (File_read::make_view): Assert on zero-length view.
14586 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14587 symbol table when there are no symbols to read.
14588
c43d3a48
CS
145892008-06-23 Craig Silverstein <csilvers@google.com>
14590
14591 * version.cc (version_string): Bump to 1.7
14592
5f494ea0
CS
145932008-06-18 Craig Silverstein <csilvers@google.com>
14594
14595 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14596 constant 0xFFFF to type Valtype.
14597 (Powerpc_relocate_functions::rel16_ha): Likewise.
14598
c42e122e
ILT
145992008-06-17 Ian Lance Taylor <iant@google.com>
14600
f34787f8
ILT
14601 * output.h (Output_section::Input_section): Initialize p2align_ to
14602 zero for Output_section_data constructors.
14603 (Output_section::Input_section::addralign): If not an input
14604 section, return the alignment of the Output_section_data.
14605 * testsuite/copy_test.cc: New file.
14606 * testsuite/copy_test_1.cc: New file.
14607 * testsuite/copy_test_2.cc: New file.
14608 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14609 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14610 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14611 (copy_test_1_pic.o, copy_test_1.so): New targets.
14612 (copy_test_2_pic.o, copy_test_2.so): New targets.
14613 * testsuite/Makefile.in: Rebuild.
14614
c42e122e
ILT
14615 * script-sections.cc (Script_sections::place_orphan): Initialize
14616 local variable exact.
14617
ce3ac18a
DE
146182008-06-13 David Edelsohn <edelsohn@gnu.org>
14619
14620 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14621
42cacb20
DE
146222008-06-12 David Edelsohn <edelsohn@gnu.org>
14623 David S. Miller <davem@davemloft.net>
14624
14625 * powerpc.cc: New file.
14626 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14627 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14628 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14629 * Makefile.in: Rebuild.
14630
7b308235
ILT
146312008-06-09 Ian Lance Taylor <iant@google.com>
14632
14633 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14634 <exception>.
14635 (throwing, orig_terminate): New static variables.
14636 (terminate_handler): New static function.
14637 (t2): Set terminate handler.
14638
f0b886e3
ILT
146392008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14640
14641 PR 6584
cd536b21 14642 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14643 alignment.
14644
3e90f135
CC
146452008-05-30 Cary Coutant <ccoutant@google.com>
14646
14647 * archive.cc (Archive::include_all_members) Correct to step
14648 over symbol table and extended name table in thin archives.
14649
e09ad04a
ILT
146502008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14651
14652 PR 6407
14653 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14654 calculation.
14655
62b01cb5
ILT
146562008-05-28 Caleb Howe <cshowe@google.com>
14657
14658 * reduced_debug_output.cc: New file.
14659 * reduced_debug_output.h: New file.
92de84a6 14660 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
14661 * options.cc (General_options::finalize): Add strip_debug_non_line
14662 to the strip heirarchy.
14663 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14664 fields.
14665 * layout.cc: Include "reduced_debug_output.h".
14666 (Layout::Layout): Initialize new fields.
14667 (line_only_debug_sections): New static array.
14668 (is_lines_only_debug_sections): New static inline function.
14669 (Layout::include_section): Handle --strip-debug-non-line.
14670 (Layout::make_output_section): If --strip-debug-non-line, build
14671 new output sections for .debug_abbrev and .debug_info.
14672 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14673 gold. Warn about possible overflow.
14674 (read_signed_LEB_128): Likewise.
14675 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14676 (read_signed_LEB_128): Declare.
14677 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14678 (HFILES): Add reduced_debug_output.h.
14679 * Makefile.in: Rebuild.
14680
7d9e3d98
ILT
146812008-05-21 Ian Lance Taylor <iant@google.com>
14682
14683 * mapfile.cc: New file.
14684 * mapfile.h: New file.
14685 * options.h (class General_options): Add -M/--print-map and -Map.
14686 * options.cc (General_options::finalize): Make -M equivalent to
14687 -Map -.
14688 * main.cc: Include <cstdio> and "mapfile.h".
14689 (main): Open mapfile if requested.
14690 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14691 constructor. Change caller.
14692 (queue_initial_tasks): Add mapfile parameter. Change caller.
14693 (queue_middle_tasks): Likewise.
14694 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14695 declarations.
14696 * archive.cc: Include "mapfile.h".
14697 (Archive::add_symbols): Add mapfile parameter. Change all
14698 callers. Pass mapfile, symbol, and reason to include_member.
14699 (Archive::include_all_members): Add mapfile parameter. Change all
14700 callers.
14701 (Archive::include_member): Add mapfile, sym, and why parameters.
14702 Change all callers. Report inclusion to map file.
14703 * archive.h: Include "fileread.h".
14704 (class Archive): Update declarations.
14705 (Archive::file): New const method.
14706 (class Add_archive_symbols): Add mapfile_ field. Update
14707 constructor. Change all callers.
14708 * readsyms.h (class Read_symbols): Likewise.
14709 (class Finish_group): Likewise.
14710 (class Read_script): Likewise.
14711 * common.cc: Include "mapfile.h".
14712 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14713 all callers.
14714 (Symbol_table::do_allocate_commons): Likewise.
14715 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14716 symbol allocation to mapfile.
14717 * common.h (class Allocate_commons_task): Add mapfile_ field.
14718 Update constructor. Change all callers.
14719 * symtab.h (class Symbol_table): Update declarations.
14720 * layout.cc: Include "mapfile.h".
14721 (Layout_task_runner::run): Print information to mapfile.
14722 (Layout::create_gold_note): Change Output_data_fixed_space to
14723 Output_data_zero_fill.
14724 (Layout::create_build_id): Likewise.
14725 (Layout::print_to_mapfile): New function.
14726 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14727 constructor. Change caller.
14728 (class Layout): Declare print_to_mapfile.
14729 * output.cc (Output_section::Input_section::print_to_mapfile): New
14730 function.
14731 (Output_section::add_input_section): If producing a map, always
14732 add to input_sections_ list.
14733 (Output_section::do_print_to_mapfile): New function.
14734 (Output_segment::print_sections_to_mapfile): New function.
14735 (Output_segment::print_section_list_to_mapfile): New function.
14736 * output.h: Include "mapfile.h".
14737 (Output_data::print_to_mapfile): New function.
14738 (Output_data::do_print_to_mapfile): New virtual function.
14739 (Output_segment_headers::do_print_to_mapfile): New function.
14740 (Output_file_header::do_print_to_mapfile): New function.
14741 (Output_data_const::do_print_to_mapfile): New function.
14742 (class Output_data_const_buffer): Add map_name_ field. Update
14743 constructor. Change all callers. Add do_print_to_mapfile
14744 function.
14745 (class Output_data_fixed_space): Likewise.
14746 (class Output_data_space): Likewise.
14747 (class Output_data_zero_fill): New class.
14748 (Output_data_strtab::do_print_to_mapfile): New function.
14749 (Output_data_reloc_base::do_print_to_mapfile): New function.
14750 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14751 (Output_data_group::do_print_to_mapfile): New function.
14752 (Output_data_got::do_print_to_mapfile): New function.
14753 (Output_data_dynamic::do_print_to_mapfile): New function.
14754 (Output_symtab_xindex::do_print_to_mapfile): New function.
14755 (class Output_section): Declare do_print_to_mapflie. Declare
14756 print_to_mapfile in Input_section.
14757 (class Output_segment): Declare new functions.
14758 * object.h (Sized_relobj::symbol_count): New function.
14759 * script-sections.cc
14760 (Output_section_element_dot_assignment::set_section_addresses):
14761 Change Output_data_fixed_space to Output_data_zero_fill.
14762 (Output_data_expression::do_print_to_mapfile): New function.
14763 * script.cc (read_input_script): Add mapfile parameter. Change
14764 all callers.
14765 * script.h (read_input_script): Update declaration.
14766 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14767 (Eh_frame::do_print_to_mapfile): New function.
14768 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14769 (Output_merge_string::do_print_to_mapfile): New function.
14770 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
14771 function.
14772 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
14773 function.
14774 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
14775 function.
14776 * Makefile.am (CCFILES): Add mapfile.cc.
14777 (HFILES): Add mapfile.h.
14778 * Makefile.in: Rebuild.
14779
9f1d377b
ILT
147802008-05-19 Ian Lance Taylor <iant@google.com>
14781
14782 * options.h (class General_options): Add -z relro.
14783 * layout.cc (Layout::Layout): Initialize relro_segment_.
14784 (Layout::add_output_section_data): Return the output section.
14785 (Layout::make_output_section): Rcognize relro sections and mark
14786 them appropriately.
14787 (Layout::attach_allocated_section_to_segment): Put relro sections
14788 in a PT_GNU_RELRO segment.
14789 (Layout::create_initial_dynamic_sections): Mark the .dynamic
14790 section as relro.
14791 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
14792 PT_TLS segments.
14793 (Layout::linkonce_mapping): Map d.rel.ro.local to
14794 .data.rel.ro.local.
14795 (Layout::output_section_name): Us .data.rel.ro.local for any
14796 section which begins with that.
14797 * layout.h (class Layout): Update add_output_section_data
14798 declaration. Add relro_segment_ field.
14799 * output.cc (Output_section::Output_section): Initialize is_relro_
14800 and is_relro_local_ fields.
14801 (Output_segment::add_output_section): Group relro sections.
14802 (Output_segment::is_first_section_relro): New function.
14803 (Output_segment::maximum_alignment): If there is a relro section,
14804 align the segment to the common page size.
14805 (Output_segment::set_section_addresses): Track whether we are
14806 looking at relro sections. If the last section is a relro
14807 section, align to the common page size.
14808 (Output_segment::set_section_list_addresses): Add in_relro
14809 parameter. Change all callers. Align to the page size when
14810 moving from relro to non-relro section.
14811 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
14812 segment.
14813 * output.h (class Output_section): Add is_relro_ and
14814 is_relro_local_ fields.
14815 (Output_section::is_relro): New function.
14816 (Output_section::set_is_relro): New function.
14817 (Output_section::is_relro_local): New function.
14818 (Output_section::set_is_relro_local): New function.
14819 (class Output_segment): Update declarations.
14820 * i386.cc (Target_i386::got_section): Mark .got section as relro.
14821 * sparc.cc (Target_sparc::got_section): Likewise.
14822 * x86_64.cc (Target_x86_64::got_section): Likewise.
14823 * testsuite/relro_test_main.cc: New file.
14824 * testsuite/relro_test.cc: New file.
14825 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
14826 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
14827 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
14828 (relro_test.so, relro_test_pic.o): New targets.
14829 * testsuite/Makefile.in: Rebuild.
14830
a984ee1d
ILT
148312008-05-16 Ian Lance Taylor <iant@google.com>
14832
01676dcd
ILT
14833 * output.cc (Output_segment::add_output_section): Remove front
14834 parameter.
14835 * output.h (class Output_segment): Remove
14836 add_initial_output_section and overloaded add_output_section.
14837 Update declaration of remaining add_output_section.
14838 * layout.cc (Layout::create_interp): Call add_output_section
14839 rather than add_initial_output_section.
14840 (Layout::finish_dynamic_section): Likewise.
14841
497897f9
ILT
14842 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
14843 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
14844 know the dynamic type.
14845 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
14846 field. Initialize it in constructor.
14847 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
14848 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
14849 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
14850 reloc.
14851
a984ee1d
ILT
14852 * output.cc (Output_reloc::get_address): Change return type to
14853 Elf_Addr.
14854 * output.h (class Output_reloc): Update get_address declaration.
14855 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
14856 for section addresses.
14857
55ba0940
ILT
148582008-05-09 Ian Lance Taylor <iant@google.com>
14859
14860 PR 6493
14861 * gold.cc (gold_nomem): Use return value of write.
14862
75517b77
ILT
148632008-05-08 Ian Lance Taylor <iant@google.com>
14864
14865 * symtab.c (Symbol::init_base_output_data): Add version
14866 parameter. Change all callers.
14867 (Symbol::init_base_output_segment): Likewise.
14868 (Symbol::init_base_constant): Likewise.
14869 (Symbol::init_base_undefined): Likewise.
14870 (Sized_symbol::init_output_data): Likewise.
14871 (Sized_symbol::init_output_segment): Likewise.
14872 (Sized_symbol::init_constant): Likewise.
14873 (Sized_symbol::init_undefined): Likewise.
14874 (Symbol_table::do_define_in_output_data): If the new symbol has a
14875 version, mark it as the default.
14876 (Symbol_table::do_define_in_output_segment): Likewise.
14877 (Symbol_table::do_define_as_constant): Likewise.
14878 * symtab.h (class Symbol): Update declarations.
14879 (class Sized_symbol): Likewise.
14880 * resolve.cc (Symbol::override_version): New function.
c42e122e 14881 (Symbol::override_base): Call override_version.
75517b77
ILT
14882 (Symbol::override_base_with_special): Likewise.
14883 * testsuite/ver_script_8.script: New file.
14884 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
14885 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
14886 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
14887 (ver_test_8_1.so, ver_test_8_2.so): New targets.
14888
f1f70eae
ILT
148892008-05-06 Ian Lance Taylor <iant@google.com>
14890
f3e9c5c5
ILT
14891 PR 6049
14892 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
14893 functions.
14894 (class General_options): Remove existing --undefined, and add
14895 --no-undefined instead. Add new --undefined as synonym for -u.
14896 * archive.cc (Archive::add_symbols): Check whether symbol was
14897 named with -u.
14898 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
14899 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
14900 all uses. Add IS_UNDEFINED. Update declarations to split
14901 different versions of init_base. Declare init_base_undefined.
14902 (Symbol::is_defined): Handle IS_UNDEFINED.
14903 (Symbol::is_undefined): Likewise.
14904 (Symbol::is_weak_undefined): Call is_undefined.
14905 (Symbol::is_absolute): Handle IS_CONSTANT.
14906 (class Sized_symbol): Update declarations to split different
14907 versions of init. Declare init_undefined.
14908 (class Symbol_table): Declare new functions.
14909 * symtab.cc (Symbol::init_base_object): Rename from init_base.
14910 Change all callers.
14911 (Symbol::init_base_output_data): Likewise.
14912 (Symbol::init_base_output_segment): Likewise.
14913 (Symbol::init_base_constant): Likewise.
14914 (Symbol::init_base_undefined): New function.
14915 (Sized_symbol::init_object): Rename from init. Change all
14916 callers.
14917 (Sized_symbol::init_output_data): Likewise.
14918 (Sized_symbol::init_output_segment): Likewise.
14919 (Sized_symbol::init_constant): Likewise.
14920 (Sized_symbol::init_undefined): New function.
14921 (Symbol_table::add_undefined_symbols_from_command_line): New
14922 function.
14923 (Symbol_table::do_add_undefined_symbols_from_command_line): New
14924 function.
14925 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
14926 (Symbol::output_section): Likewise.
14927 (Symbol::set_output_section): Likewise.
14928 (Symbol_table::sized_finalize_symbol): Likewise.
14929 (Symbol_table::sized_write_globals): Likewise.
14930 * resolve.cc (Symbol_table::should_override): Likewise.
14931 (Symbol::override_base_with_special): Likewise.
14932
8bdcdf2c
ILT
14933 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
14934 symbol, change it to have default visibility.
14935 * testsuite/protected_1.cc: New file.
14936 * testsuite/protected_2.cc: New file.
14937 * testsuite/protected_3.cc: New file.
14938 * testsuite/protected_main_1.cc: New file.
14939 * testsuite/protected_main_2.cc: New file.
14940 * testsuite/protected_main_3.cc: New file.
14941 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
14942 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
14943 (protected_1_LDFLAGS, protected_1_LDADD): Define.
14944 (protected_1.so): New target.
14945 (protected_1_pic.o, protected_2_pic.o): New targets.
14946 (protected_3_pic.o): New target.
14947 (check_PROGRAMS): Add protected_2.
14948 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
14949 (protected_2_LDFLAGS, protected_2_LDADD): Define.
14950 * testsuite/Makefile.in: Rebuild.
14951
2b706932
ILT
14952 * options.h (DEFINE_var): Add set_user_set_##varname__.
14953 (DEFINE_bool_alias): New macro.
14954 (class General_options): Define -Bstatic using DEFINE_bool_alias
14955 rather than DEFINE_special. Add --undefined as an alias for -z
14956 defs.
14957 * options.cc (General_options::parse_Bstatic): Remove.
14958
d82a5bcc
ILT
14959 * options.h (class General_options): Add --fatal-warnings.
14960 * main.cc (main): Implement --fatal-warnings.
14961 * errors.h (Errors::warning_count): New function.
14962
f1f70eae
ILT
14963 * options.h (class General_options): Add -Bsymbolic-functions.
14964 * symtab.h (Symbol::is_preemptible): Check for
14965 -Bsymbolic-functions.
14966
8825ac63
ILT
149672008-05-05 Ian Lance Taylor <iant@google.com>
14968
d98bc257
ILT
14969 * options.h (DEFINE_bool): For DASH_Z, create the negative option
14970 as noVARNAME rather than no-VARNAME.
14971 (class General_options): Add option -z combreloc.
14972 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
14973 get_address.
14974 (Output_reloc::sort_before) [SHT_REL]: New function.
14975 (Output_reloc::sort_before) [SHT_RELA]: New function.
14976 (class Output_data_reloc_base): Add sort_relocs_ field. Define
14977 Sort_relocs_comparison.
14978 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
14979 parameter. Change all callers.
14980 (Output_data_reloc::Output_data_reloc) [both versions]: Add
14981 sort_relocs parameter. Change all callers.
14982 * output.cc (Output_reloc::get_address): New function, broken out
14983 of write_rel.
14984 (Output_reloc::write_rel): Call it.
14985 (Output_reloc::compare): New function.
14986 (Output_data_reloc_base::do_write): Optionally sort relocs.
14987
60b2b4e7
ILT
14988 * configure.ac: If targ_extra_obj is set, link it in.
14989 * configure.tgt: Initialize all variables.
14990 (x86_64*): Set targ_extra_obj and targ_extra_size.
14991 * configure: Rebuild.
14992
8825ac63
ILT
14993 * object.cc (Sized_relobj::include_section_group): Adjust section
14994 indexes read from group data. Build vector to pass to
14995 layout_group.
14996 * layout.cc (Layout::layout_group): Add flags and shndxes
14997 parameters. Remove contents parameter. Change caller. Update
14998 explicit instantiations.
14999 * layout.h (class Layout): Update layout_group declaration.
15000 * output.cc (Output_data_group::Output_data_group): Add flags and
15001 input_shndxes parameters. Remove contents parameter. Change
15002 caller.
15003 (Output_data_group::do_write): Change input_sections_ to
15004 input_shndxes_.
15005 * output.h (class Output_data_group): Update constructor
15006 declaration. Rename input_sections_ to input_shndxes_.
15007 * testsuite/many_sections_test.cc: Add template.
15008
e94cf127
CC
150092008-04-30 Cary Coutant <ccoutant@google.com>
15010
4418b2d5
CC
15011 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15012
e94cf127
CC
15013 * layout.cc (Layout::include_section): Refactored check for debug
15014 info section.
15015 (Layout::add_comdat): Add new parameters. Change type
15016 of signature parameter. Add object and shndx to signatures table.
15017 (Layout::find_kept_object): New function.
15018 * layout.h: Include <cstring>.
15019 (Layout::is_debug_info_section): New function.
15020 (Layout::add_comdat): Add new parameters.
15021 (Layout::find_kept_object): New function.
15022 (Layout::Kept_section): New struct.
15023 (Layout::Signatures): Change type of map range.
15024 * object.cc (Relobj::output_section_address): New function.
15025 (Sized_relobj::include_section_group): Add new parameters. Change
15026 calls to Layout::add_comdat. Change to build table of kept comdat
15027 groups and table mapping discarded sections to kept sections.
15028 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15029 (Sized_relobj::do_layout): Change calls to include_section_group and
15030 include_linkonce_section.
15031 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15032 value to zero when section is discarded.
15033 (Sized_relobj::map_to_kept_section): New function.
15034 * object.h (Relobj::output_section_address): New function.
15035 (Relobj::Comdat_group): New type.
15036 (Relobj::find_comdat_group): New function.
15037 (Relobj::Comdat_group_table): New type.
15038 (Relobj::Kept_comdat_section): New type.
15039 (Relobj::Kept_comdat_section_table): New type.
15040 (Relobj::add_comdat_group): New function.
15041 (Relobj::set_kept_comdat_section): New function.
15042 (Relobj::get_kept_comdat_section): New function.
15043 (Relobj::comdat_groups_): New field.
15044 (Relobj::kept_comdat_sections_): New field.
15045 (Symbol_value::input_value): Update comment.
15046 (Sized_relobj::map_to_kept_section) New function.
15047 (Sized_relobj::include_linkonce_section): Add new parameter.
15048 * target-reloc.h (Comdat_behavior): New type.
15049 (get_comdat_behavior): New function.
15050 (relocate_section): Add code to map a discarded section to the
15051 corresponding kept section when applying a relocation.
15052
e4e5049b
CS
150532008-04-30 Craig Silverstein <csilvers@google.com>
15054
15055 * dwarf_reader.cc (next_generation_count): New static var.
15056 (Addr2line_cache_entry): New struct.
15057 (addr2line_cache): New static var.
15058 (Dwarf_line_info::one_addr2line): Added caching.
15059 (Dwarf_line_info::clear_addr2line_cache): New function.
15060 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15061 cache-size parameter.
15062 (Dwarf_line_info::one_addr2line_cache): New function.
15063 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15064 new cache-size argument to one_addr2line(), and clear cache.
15065
d09e9154
CC
150662008-04-28 Cary Coutant <ccoutant@google.com>
15067
15068 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15069 R_386_PC8 relocations.
15070
7ef73768
ILT
150712008-04-23 Ian Lance Taylor <iant@google.com>
15072
55438702
ILT
15073 * object.cc (Sized_relobj::include_section_group): Check for
15074 invalid section group.
15075
c165fb93
ILT
15076 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15077 header size.
15078
7ef73768
ILT
15079 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15080 than read for file header.
15081 * archive.cc (Archive::include_member): Likewise.
15082
6194aaab
L
150832008-04-23 Paolo Bonzini <bonzini@gnu.org>
15084
15085 * aclocal.m4: Regenerate.
15086 * configure: Regenerate.
15087
d491d34e
ILT
150882008-04-19 Ian Lance Taylor <iant@google.com>
15089
5ea2bac6
ILT
15090 * version.cc (version_string): Bump to 1.6.
15091
7bc3e21a
ILT
15092 * testsuite/Makefile.am (many_sections_r_test): New target.
15093 (many_sections_r_test_SOURCES): Remove.
15094 (many_sections_r_test_DEPENDENCIES): Remove.
15095 (many_sections_r_test_LDFLAGS): Remove.
15096 (many_sections_r_test_LDADD): Remove.
15097
7fcd3aa9
ILT
15098 * object.cc (Sized_relobj::do_add_symbols): Always pass
15099 local_symbol_count_ to add_from_relobj.
15100
4c94d6ae
ILT
15101 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15102 every thousand variables.
15103 * testsuite/Makefile.in: Rebuild.
15104
d491d34e
ILT
15105 * object.cc (Xindex::initialize_symtab_xindex): New function.
15106 (Xindex::read_symtab_xindex): New function.
15107 (Xindex::sym_xindex_to_shndx): New function.
15108 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15109 available.
15110 (Sized_relobj::do_initialize_xindex): New function.
15111 (Sized_relobj::do_read_symbols): Adjust section links.
15112 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15113 parameter. Change all callers.
15114 (Sized_relobj::include_section_group): Adjust section links and
15115 symbol section indexes.
15116 (Sized_relobj::do_layout): Adjust section links.
15117 (Sized_relobj::do_count_local_symbols): Adjust section links and
15118 symbol section indexes.
15119 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15120 ordinary and special symbols.
15121 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15122 dynsym_xindex parameters. Change all callers. Adjust section
15123 links. Use SHN_XINDEX when needed.
15124 (Sized_relobj::get_symbol_location_info): Adjust section links.
15125 Don't get fooled by special symbols.
15126 * object.h (class Xindex): Define.
15127 (class Object): Add xindex_ parameter. Declare virtual functoin
15128 do_initialize_xindex.
15129 (Object::adjust_sym_shndx): New function.
15130 (Object::set_xindex): New protected function.
15131 (class Symbol_value): Add is_ordinary_shndx_ field.
15132 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15133 (Symbol_value::value): Assert ordinary section.
15134 (Symbol_value::initialize_input_to_output_map): Likewise.
15135 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15136 Change all callers.
15137 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15138 all callers.
15139 (class Sized_relobj): Update declarations.
15140 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15141 parameter. Change all callers.
15142 (Sized_relobj::adjust_shndx): New function.
15143 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15144 field.
15145 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15146 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15147 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15148 (Sized_dynobj::read_dynsym_section): Adjust section links.
15149 (Sized_dynobj::read_dynamic): Likewise.
15150 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15151 section links.
15152 (Sized_dynobj::do_initialize_xindex): New function.
15153 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15154 do_initialize_xindex.
15155 (Sized_dynobj::adjust_shndx): New function.
15156 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15157 dynsym_xindex_ fields.
15158 (Layout::finalize): Add a call to set_section_indexes before
15159 creating the symtab sections.
15160 (Layout::set_section_indexes): Don't do anything if the section
15161 already has a section index.
15162 (Layout::create_symtab_sections): Add shnum parameter. Change
15163 caller. Create .symtab_shndx section if needed.
15164 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15165 caller.
15166 (Layout::allocated_output_section_count): New function.
15167 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15168 needed.
15169 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15170 fields. Update declarations.
15171 (Layout::symtab_xindex): New function.
15172 (Layout::dynsym_xindex): New function.
15173 (class Write_symbols_task): Add layout_ field.
15174 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15175 Change caller.
15176 * output.cc (Output_section_headers::Output_section_headers): Add
15177 shstrtab_section parameter. Change all callers.
15178 (Output_section_headers::do_sized_write): Store overflow values
15179 for section count and section string table section index in
15180 section header zero.
15181 (Output_file_header::do_sized_write): Check for overflow of
15182 section count and section string table section index.
15183 (Output_symtab_xindex::do_write): New function.
15184 (Output_symtab_xindex::endian_do_write): New function.
15185 * output.h (class Output_section_headers): Add shstrtab_section_.
15186 Update declarations.
15187 (class Output_symtab_xindex): Define.
15188 (Output_section::has_out_shndx): New function.
15189 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15190 field.
15191 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15192 Change all callers.
15193 (Sized_symbol::init): Likewise.
15194 (Symbol::output_section): Check for ordinary symbol.
15195 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15196 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15197 callers.
15198 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15199 Change all callers. Simplify handling of symbols from sections
15200 not included in the link.
15201 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15202 distinction.
15203 (Weak_alias_sorter::operator()): Assert that symbols are
15204 ordinary.
15205 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15206 distinction.
15207 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15208 parameters. Change all callers.
15209 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15210 symbol distinction. Use SHN_XINDEX when needed.
15211 (Symbol_table::write_section_symbol): Add symtab_xindex
15212 parameter. Change all callers.
15213 (Symbol_table::sized_write_section_symbol): Likewise. Use
15214 SHN_XINDEX when needed.
15215 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15216 declarations.
15217 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15218 (Symbol::is_defined): Check is_ordinary.
15219 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15220 (Symbol::is_absolute, Symbol::is_common): Likewise.
15221 (class Sized_symbol): Update declarations.
15222 (class Symbol_table): Update declarations.
15223 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15224 parameters. Change all callers.
15225 (Sized_symbol::override): Likewise.
15226 (Symbol_table::override): Likewise.
15227 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15228 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15229 is_ordinary, and orig_st_shndx parameters. Change all callers.
15230 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15231 to be in an ordinary section.
15232 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15233 object and is_ordinary parameters. Change all callers.
15234 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15235 Change all callers. Don't add undefined or non-ordinary symbols
15236 to reloc_map_.
15237 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15238 Change all callers.
15239 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15240 declarations.
15241 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15242 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15243 (Sized_relobj::relocate_sections): Likewise.
15244 * target-reloc.h (scan_relocs): Adjust section symbol index.
15245 (scan_relocatable_relocs): Likewise.
15246 * i386.cc (Scan::local): Check for ordinary symbols.
15247 * sparc.cc (Scan::local): Likewise.
15248 * x86_64.cc (Scan::local): Likewise.
15249 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15250 to symbol_section_and_value.
15251 * testsuite/many_sections_test.cc: New file.
15252 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15253 (check_PROGRAMS): Add many_sections_test.
15254 (many_sections_test_SOURCES): Define.
15255 (many_sections_test_DEPENDENCIES): Define.
15256 (many_sections_test_LDFLAGS): Define.
15257 (BUILT_SOURCES): Add many_sections_define.h.
15258 (many_sections_define.h): New target.
15259 (BUILT_SOURCES): Add many_sections_check.h.
15260 (many_sections_check.h): New target.
15261 (check_PROGRAMS): Add many_sections_r_test.
15262 (many_sections_r_test_SOURCES): Define.
15263 (many_sections_r_test_DEPENDENCIES): Define.
15264 (many_sections_r_test_LDFLAGS): Define.
15265 (many_sections_r_test_LDADD): Define.
15266 (many_sections_r_test.o): New target.
15267 * testsuite/Makefile.in: Rebuild.
15268
c5818ff1
CC
152692008-04-17 Cary Coutant <ccoutant@google.com>
15270
15271 * errors.cc (Errors::info): New function.
15272 (gold_info): New function.
15273 * errors.h (Errors::info): New function.
15274 * gold.h (gold_info): New function.
15275 * object.cc (Input_objects::add_object): Print trace output.
15276 * options.cc (options::parse_set): New function.
15277 (General_options::parse_wrap): Deleted.
15278 (General_options::General_options): Deleted initializer.
15279 * options.h (options::String_set): New typedef.
15280 (options::parse_set): New function.
15281 (DEFINE_set): New macro.
15282 (General_options::wrap): Changed to use DEFINE_set. Changed
15283 callers of any_wrap_symbols and is_wrap_symbol.
15284 (General_options::trace, General_options::trace_symbol):
15285 New options.
15286 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15287 (General_options::wrap_symbols_): Deleted.
15288 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15289
b5be4a7c
DM
152902008-04-17 David S. Miller <davem@davemloft.net>
15291
15292 * options.cc (General_options::parse_V): New function.
15293 * options.h: Add entries for -V and -Qy.
15294
155a0dd7
ILT
152952008-04-17 Ian Lance Taylor <iant@google.com>
15296
15297 * common.cc (Symbol_table::allocate_commons): Remove options
15298 parameter. Change caller.
15299 (Symbol_table::do_allocate_commons): Remove options parameter.
15300 Change caller. Just call do_allocate_commons_list twice.
15301 (Symbol_table::do_allocate_commons_list): New function, broken out
15302 of do_allocate_commons.
15303 * common.h (class Allocate_commons_task): Remove options_ field.
15304 Update constructor.
15305 * symtab.cc (Symbol_table::Symbol_table): Initialize
15306 tls_commons_.
15307 (Symbol_table::add_from_object): Put TLS common symbols on
15308 tls_commons_ list.
15309 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15310 which are IN_OUTPUT_DATA.
15311 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15312 allocate_commons and do_allocate_commons declarations. Declare
15313 do_allocate_commons_list.
15314 * gold.cc (queue_middle_tasks): Update creation of
15315 Allocate_commons_task to not pass options.
15316 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15317 (TLS_TEST_C_FLAGS): New variable.
15318 (tls_test_c_pic.o): New target.
15319 (tls_test_shared.so): Link in tls_test_c_pic.o.
15320 (tls_test_c_pic_ie.o): New target.
15321 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15322 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15323 (tls_test_c.o): New target.
15324 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15325 (tls_pic_test_LDADD): Likewise.
15326 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15327 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15328 (tls_test_c_gnu2.o): New target.
15329 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15330 tls_test_c_gnu2.o.
15331 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15332 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15333 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15334 * testsuite/tls_test.cc: Include "config.h".
15335 (t_last): Call t11_last.
15336 * testsuite/tls_test.h (t11, t11_last): Declare.
15337 * testsuite/tls_test_c.c: New file.
15338 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15339 * configure.ac: Check for OpenMP support.
15340 * configure, config.in, Makefile.in: Rebuild.
15341 * testsuite/Makefile.in: Rebuild.
15342
edfbb029
CC
153432008-04-16 Cary Coutant <ccoutant@google.com>
15344
15345 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15346 (Target_i386::tls_base_symbol_defined_): New field.
15347 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15348 (Target_i386::Scan::global): Likewise.
15349 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15350 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15351 (Target_x86_64::tls_base_symbol_defined_): New field.
15352 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15353 (Target_x86_64::Scan::global): Likewise.
15354
f3c69fca
CC
153552008-04-16 Cary Coutant <ccoutant@google.com>
15356
15357 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15358 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15359 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15360 building shared libraries.
15361 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15362 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15363 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15364 * testsuite/Makefile.in: Rebuild.
15365 * testsuite/weak_undef.h: New file.
15366 * testsuite/weak_undef_file1.cc: Add extra test cases.
15367 * testsuite/weak_undef_file2.cc: Likewise.
15368 * testsuite/weak_undef_test.cc: Likewise.
15369
7c414435
DM
153702008-04-16 David S. Miller <davem@davemloft.net>
15371
32b769e1
DM
15372 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15373 Add issued_non_pic_error_ field. Declare check_non_pic.
15374 (Target_sparc::Scan::check_non_pic): New function.
15375 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15376 (Target_sparc::Scan::global): Likewise.
15377
11936fb1
DM
15378 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15379 * configure: Rebuild.
15380
7c414435
DM
15381 * options.h (DEFINE_enable): New macro.
15382 (new_dtags): New enable option.
15383 (initfirst, interpose, loadfltr, nodefaultlib,
15384 nodelete, nodlopen, nodump): New -z options.
15385 * layout.cc (Layout:finish_dynamic_section): If new
15386 dtags enabled, emit DT_RUNPATH. Also, emit a
15387 DT_FLAGS_1 containing any specified -z flags.
15388
85c7bf8b
ILT
153892008-04-16 Ian Lance Taylor <iant@google.com>
15390
12c0daef
ILT
15391 * copy-relocs.cc: New file.
15392 * copy-relocs.h: New file.
15393 * reloc.cc: Remove Copy_relocs code.
15394 * reloc.h: Likewise.
15395 * reloc-types.h (struct Reloc_types) [both versions]: Add
15396 get_reloc_addend_noerror.
15397 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15398 variants of add_global which take an addend which must be zero.
15399 * i386.cc: Include "copy-relocs.h".
15400 (class Target_i386): Change type of copy_relocs_ to variable,
15401 update initializer.
15402 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15403 Change all callers.
15404 (Target_i386::do_finalize_sections): Change handling of
15405 copy_relocs_.
15406 * sparc.cc: Include "copy-relocs.h".
15407 (class Target_sparc): Change type of copy_relocs_ to variable,
15408 update initializer.
15409 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15410 Change all callers.
15411 (Target_sparc::do_finalize_sections): Change handling of
15412 copy_relocs_.
15413 * x86_64.cc: Include "copy-relocs.h".
15414 (class Target_x86_64): Change type of copy_relocs_ to variable,
15415 update initializer.
15416 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15417 class. Change all callers.
15418 (Target_x86_64::do_finalize_sections): Change handling of
15419 copy_relocs_.
15420 * Makefile.am (CCFILES): Add copy-relocs.cc.
15421 (HFILES): Add copy-relocs.h.
15422
4f4995b6
ILT
15423 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15424
85c7bf8b
ILT
15425 * testsuite/script_test_4.sh: Permit leading zeroes.
15426
4f2a9edd
ILT
154272008-04-15 Ian Lance Taylor <iant@google.com>
15428
e6188289
ILT
15429 * script-sections.cc (Script_sections::create_segments): Use
15430 header_size_adjustment even when there is enough room for the
15431 headers.
15432 * testsuite/script_test_4.sh: New file.
15433 * testsuite/script_test_4.t: New file.
15434 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15435 (check_DATA): Add script_test_4.stdout.
15436 (MOSTLYCLEANFILES): Likewise.
15437 (script_test_4): New target.
15438 (script_test_4.stdout): New target.
15439 * testsuite/Makefile.in: Rebuild.
15440
4f2a9edd
ILT
15441 * sparc.cc: Add definitions for Output_data_plt_sparc class
15442 constants.
15443
f5314dd5
DM
154442008-04-14 David S. Miller <davem@davemloft.net>
15445
15446 * sparc.cc: New file.
15447 * Makefile.am (TARGETSOURCES): Add sparc.cc
15448 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15449 * configure.tgt: Document targ_extra_size and
15450 targ_extra_big_endian. Add entries for sparc-* and
15451 sparc64-*.
15452 * configure.ac: Handle targ_extra_size and
15453 targ_extra_big_endian.
15454 * Makefile.in: Rebuild.
15455 * configure: Likewise.
15456 * po/POTFILES.in: Likewise.
15457 * po/gold.pot: Likewise.
15458
154e0e9a
ILT
154592008-04-14 Ian Lance Taylor <iant@google.com>
15460
15461 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15462 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15463 in the name/type/flags to section mapping. Don't call
15464 allocate_output_section.
15465 (Layout::choose_output_section): Change parameter from adjust_name
15466 to is_input_section. Don't permit input sections after sections
15467 are attached to segments. Don't call allocate_output_section.
15468 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15469 not write_enable_output_section.
15470 (Layout::make_output_section): Don't push to
15471 unattached_section_list_ nor call attach_to_segment. Call
15472 attach_section_to_segment if sections are attached.
15473 (Layout::attach_sections_to_segments): New function.
15474 (Layout::attach_section_to_segment): New function.
15475 (Layout::attach_allocated_section_to_segment): Rename from
15476 attach_to_segment. Remove flags parameter.
15477 (Layout::allocate_output_section): Remove function.
15478 (Layout::write_enable_output_section): Remove function.
15479 * layout.h (class Layout): Update for above changes. Add new
15480 field sections_are_attached_.
15481 * output.h (Output_section::update_flags_for_input_section): New
15482 function.
15483 * output.cc (Output_section::add_input_section): Call
15484 update_flags_for_input_section.
15485 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15486
009a67a2
CC
154872008-04-11 Cary Coutant <ccoutant@google.com>
15488
15489 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15490 thought unnecessary.
15491 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15492
759b1a24
ILT
154932008-04-11 Ian Lance Taylor <iant@google.com>
15494
15495 * output.h (class Output_section_data): Remove inline definition
15496 of set_addralign.
15497 * output.cc (Output_section_data::set_addralign): New function.
15498
c2b45e22
CC
154992008-04-11 Cary Coutant <ccoutant@google.com>
15500
15501 Add support for TLS descriptors for i386 and x86_64.
15502 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15503 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15504 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15505 GOT_TYPE_TLS_DESC.
15506 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15507 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15508 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15509 relocations.
15510 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15511 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15512 Fix problem with initial-exec relocations.
15513 (Target_i386::Relocate::relocate_tls): Likewise.
15514 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15515 relaxation.
15516 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15517 support for section-plus-offset dynamic table entries.
15518 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15519 (Output_data_dynamic::Dynamic_entry): Add support for
15520 section-plus-offset dynamic table entries.
15521 (Output_data_dynamic::Classification): Likewise.
15522 (Output_data_dynamic::classification_): Renamed offset_.
15523 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15524 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15525 (Target_x86_64::make_plt_section): New function.
15526 (Target_x86_64::reserve_tlsdesc_entries): New function.
15527 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15528 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15529 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15530 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15531 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15532 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15533 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15534 add extra PLT entry for TLS descriptors.
15535 (Output_data_plt_x86_64::got_): New field.
15536 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15537 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15538 fields.
15539 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15540 descriptors.
15541 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15542 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15543 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15544 R_386_TLS_DESC_CALL relocations.
15545 (Target_x86_64::Scan::global): Likewise.
15546 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15547 for TLS descriptors.
15548 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15549 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15550 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15551 GD-to-IE relaxation.
15552 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15553 and TLS_DESCRIPTORS.
15554 * Makefile.in: Rebuild.
15555 * configure: Rebuild.
15556 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15557 (tls_test_shared2.so): New target.
15558 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15559 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15560 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15561 (tls_shared_gd_to_ie_test_LDADD): New variable.
15562 (tls_shared_gnu2_gd_to_ie_test): New target.
15563 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15564 New targets.
15565 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15566 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15567 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15568 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15569 (tls_shared_gnu2_test): New target.
15570 (tls_test_gnu2_shared.so): New target.
15571 (tls_shared_gnu2_test_SOURCES): New variable.
15572 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15573 (tls_shared_gnu2_test_LDFLAGS): New variable.
15574 (tls_shared_gnu2_test_LDADD): New variable.
15575 * testsuite/Makefile.in: Rebuild.
15576 * testsuite/Makefile.
15577
83bfb6b7
ILT
155782008-04-11 Ian Lance Taylor <iant@google.com>
15579
15580 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15581 justsyms.t.
15582 * testsuite/Makefile.in: Rebuild.
15583
15584 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15585 long.
15586 * testsuite/script_test_2.cc (main): Adjust test.
15587
706e1f5e
ILT
155882008-04-11 David S. Miller <davem@davemloft.net>
15589 Ian Lance Taylor <iant@google.com>
15590
15591 * options.h (General_options): Add entries for '-Y' and
15592 '-relax'.
15593 * options.cc (General_options:finalize): If -Y was used, add those
15594 entries to the library path instead of the default "/lib" and
15595 "/usr/lib".
15596
7c98e6bb
DM
155972008-04-11 David S. Miller <davem@davemloft.net>
15598
15599 * testsuite/justsyms.t: Start at 0x100.
15600 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15601 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15602 long.
15603 * testsuite/script_test_2.cc: Adjust string and section length
15604 checks.
7c98e6bb 15605
99a37bfd
ILT
156062008-04-09 Ian Lance Taylor <iant@google.com>
15607
2cefc357
ILT
15608 PR gold/5996
15609 * script-sections.cc (Sections_element::allocate_to_segment): Add
15610 orphan parameter.
15611 (Output_section_definition::allocate_to_segment): Likewise.
15612 (Orphan_output_section::allocate_to_segment): Likewise.
15613 (Script_sections::attach_sections_using_phdrs_clause): Don't
15614 propagate non-PT_LOAD segments to orphan sections.
15615 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15616 readelf rather than objdump.
15617 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15618 .interp section and PT_INTERP segment are the same size.
15619 * testsuite/Makefile.in: Rebuild.
15620
99a37bfd
ILT
15621 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15622 aliases for symbols defined in the same object.
15623 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15624 (weak_alias_test_SOURCES): New variable.
15625 (weak_alias_test_DEPENDENCIES): New variable.
15626 (weak_alias_test_LDFLAGS): New variable.
15627 (weak_alias_test_LDADD): New variable.
15628 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15629 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15630 (weak_alias_test_3.o): New target.
15631 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15632 * testsuite/weak_alias_test_main.cc: New file.
15633 * testsuite/weak_alias_test_1.cc: New file.
15634 * testsuite/weak_alias_test_2.cc: New file.
15635 * testsuite/weak_alias_test_3.cc: New file.
15636
780e49c5
ILT
156372008-04-08 Ian Lance Taylor <iant@google.com>
15638
cdb0b8f5
ILT
15639 * options.h (class General_options): Add --noinhibit-exec option.
15640 * main.cc (main): Check --noinhibit-exec.
15641
0864d551
ILT
15642 * options.h (class General_options): Define --wrap as a special
15643 option. Add wrap_symbols_ field.
15644 (General_options::any_wrap_symbols): New function.
15645 (General_options::is_wrap_symbol): New function.
15646 * options.cc (General_options::parse_wrap): New function.
15647 (General_options::General_options): Initialize wrap_symbols_.
15648 * symtab.cc (Symbol_table::wrap_symbol): New function.
15649 (Symbol_table::add_from_object): Handle --wrap.
15650 * symtab.h (class Symbol_table): Declare wrap_symbol.
15651 * target.h (Target::wrap_char): New function.
15652 (Target::Target_info): Add wrap_char field.
15653 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15654 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15655 * testsuite/testfile.cc (Target_test::test_target_info):
15656 Likewise.
15657
789aa6de
ILT
15658 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15659 there is one.
15660
2c38906f
ILT
15661 * layout.h (class Layout): Add added_eh_frame_data_ field.
15662 * layout.cc (Layout::Layout): Initialize new field.
15663 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15664 output section until we find a section we merged successfully.
15665 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15666 that the size be non-zero.
15667
780e49c5
ILT
15668 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15669 qualifier.
15670
7fcd0256
ILT
156712008-04-08 Craig Silverstein <csilvers@google.com>
15672
15673 * configure.ac: Export new conditional variable HAVE_ZLIB.
15674 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15675 on HAVE_ZLIB.
15676 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15677 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15678
6835af53
ILT
156792008-04-07 Ian Lance Taylor <iant@google.com>
15680
e24f324c
ILT
15681 * version.cc (version_string): Set to "1.5".
15682
a036edd8
ILT
15683 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15684 Add issued_non_pic_error_ field. Declare check_non_pic.
15685 (Target_x86_64::Scan::check_non_pic): New function.
15686 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15687 (Target_x86_64::Scan::global): Likewise.
15688
624f8810
ILT
15689 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15690 addend parameter. Change caller. Handle merge sections.
15691 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15692 Address to Addend. Don't add in the result of
15693 local_section_offset, pass down the addend and use the returned
15694 value.
15695 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15696 Update declarations of local_section_offset and symbol_value.
15697 * testsuite/two_file_test_1.cc (t18): New function.
15698 * testsuite/two_file_test_2.cc (f18): New function.
15699 * testsuite/two_file_test_main.cc (main): Call t18.
15700 * testsuite/two_file_test.h (t18, f18): Declare.
15701
6835af53
ILT
15702 * configure.ac: Don't test for objdump, c++filt, or readelf.
15703 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15704 conditionals.
15705 (TEST_READELF): New variable.
15706 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15707 (check_PROGRAMS): Add two_file_strip_test.
15708 (two_file_strip_test): New target.
15709 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15710 (two_file_same_shared_strip_test_SOURCES): New variable.
15711 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15712 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15713 (two_file_same_shared_strip_test_LDADD): New variable.
15714 (two_file_shared_strip.so): New target.
15715 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15716 (ver_test_5.syms, ver_test_7.syms): Likewise.
15717 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15718 (strip_test_3.stdout): Use TEST_OBJDUMP.
15719 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15720
86925eef
CC
157212008-04-04 Cary Coutant <ccoutant@google.com>
15722
15723 * symtab.h (Symbol::is_weak_undefined): New function.
15724 (Symbol::is_strong_undefined): New function.
15725 (Symbol::is_absolute): New function.
15726 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15727 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15728 absolute symbols.
15729 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15730 (weak_undef_test): New target.
15731 * testsuite/Makefile.in: Rebuild.
15732 * testsuite/weak_undef_file1.cc: New file.
15733 * testsuite/weak_undef_file2.cc: New file.
15734 * testsuite/weak_undef_test.cc: New file.
15735
126f3ece
ILT
157362008-04-03 Craig Silverstein <csilvers@google.com>
15737
15738 * compressed_output.h (class Output_compressed_section): Use
15739 unsigned buffer.
15740 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15741 add zlib header.
15742 (zlib_compressed_suffix): Removed.
15743 (Output_compressed_section::set_final_data_size): Use unsigned
15744 buffers.
15745 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15746 Fix linker invocation.
15747 (flagstest_o_specialfile_and_compress_debug_sections):
15748 Likewise.
15749 * testsuite/Makefile.in: Regenerated.
15750
deae2a14
DM
157512008-04-02 David S. Miller <davem@davemloft.net>
15752
15753 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15754 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15755
70752818
ILT
157562008-04-02 Craig Silverstein <csilvers@google.com>
15757
15758 * TODO: New file.
15759
39d0cb0e
ILT
157602008-04-02 Ian Lance Taylor <iant@google.com>
15761
15762 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15763 parameters. Update for new key type to views_. Change all
15764 callers.
15765 (File_read::read): Adjust for byteshift in returned view.
15766 (File_read::add_view): New function, broken out of
15767 find_and_make_view.
15768 (File_read::make_view): New function, broken out of
15769 find_and_make_view.
15770 (File_read::find_or_make_view): Add offset and aligned
15771 parameters. Rewrite accordingly. Change all callers.
15772 (File_read::get_view): Add offset and aligned parameters. Adjust
15773 for byteshift in return value.
15774 (File_read::get_lasting_view): Likewise.
15775 * fileread.h (class File_read): Update declarations.
15776 (class File_read::View): Add byteshift_ field. Add byteshift to
15777 constructor. Add byteshift method.
15778 * archive.h (Archive::clear_uncached_views): New function.
15779 (Archive::get_view): Add aligned parameter. Change all callers.
15780 * object.h (Object::get_view): Add aligned parameter. Change all
15781 callers.
15782 (Object::get_lasting_view): Likewise.
15783
15784 * fileread.cc (File_read::release): Don't call clear_views if
15785 there are multiple objects.
15786 * fileread.h (File_read::clear_uncached_views): New function.
15787 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
15788 on the archive.
15789
a1207466
CC
157902008-03-31 Cary Coutant <ccoutant@google.com>
15791
15792 Add thin archive support.
15793 * archive.cc (Archive::armagt): New const.
15794 (Archive::setup): Remove task parameter and calls to unlock.
15795 (Archive::unlock_nested_archives): New function.
15796 (Archive::read_header): Add nested_off parameter. Change
15797 all callers.
15798 (Archive::interpret_header): Likewise.
15799 (Archive::include_all_members): Change to handle thin
15800 archives.
15801 (Archive::include_member): Likewise.
15802 * archive.h (Archive::Archive): Add new parameters and
15803 initializers.
15804 (Archive::armagt): New const.
15805 (Archive::setup): Remove task parameter.
15806 (Archive::unlock_nested_archives): New function.
15807 (Archive::read_header): Add nested_off parameter.
15808 (Archive::interpret_header): Likewise.
15809 (Archive::Nested_archive_table): New typedef.
15810 (Archive::is_thin_archive_): New field.
15811 (Archive::nested_archives_): New field.
15812 (Archive::options_): New field.
15813 (Archive::dirpath_): New field.
15814 (Archive::task_): New field.
15815 * readsyms.cc (Read_symbols::do_read_symbols): Add check
15816 for thin archives. Pass additional parameters to
15817 Archive::Archive. Unlock the archive file after calling
15818 Archive::setup.
cd536b21 15819
479f6503
ILT
158202008-03-29 Ian Lance Taylor <iant@google.com>
15821
686c8caf
ILT
15822 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
15823 version symbol to be local.
15824 * testsuite/ver_test_4.sh: New file.
15825 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
15826 (check_DATA): Add ver_test_4.syms.
15827 (ver_test_4.syms): New target.
15828 * testsuite/Makefile.in: Rebuild.
15829
ab794b6b
ILT
15830 * output.cc
15831 (Output_section::Input_section_sort_entry::has_priority): New
15832 function.
15833 (Output_section::Input_section_sort_entry::match_file_name): New
15834 function.
15835 (Output_section::Input_section_sort_entry::match_section_name):
15836 Remove.
15837 (Output_section::Input_section_sort_entry::match_section_name_prefix):
15838 Remove.
15839 (Output_section::Input_section_sort_entry::match_section_file):
15840 Remove.
15841 (Output_section::Input_section_sort_compare::operator()): Rewrite
15842 using new Input_section_sort_entry functions. Sort crtbegin and
15843 crtend first. Sort sections with no priority before sections with
15844 a priority.
15845 * testsuite/initpri1.c (d3): Check j != 4.
15846 (cd5): New constructor/destructor function.
15847 (main): Check j != 2.
15848
479f6503
ILT
15849 * symtab.cc (Symbol_table::add_from_object): If we don't use the
15850 new symbol when resolving, don't call set_is_default.
15851 * testsuite/ver_test_7.cc: New file.
15852 * testsuite/ver_test_7.sh: New file.
15853 * testsuite/Makefile.am (ver_test_7.so): New target.
15854 (ver_test_7.o): New target.
15855 (check_SCRIPTS): Add ver_test_7.sh.
15856 (check_DATA): Add ver_test_7.syms.
15857 (ver_test_7.syms): New target.
15858
2fd32231
ILT
158592008-03-28 Ian Lance Taylor <iant@google.com>
15860
15861 * layout.cc (Layout::layout): If we see an input section with a
15862 name that needs sorting, set the must_sort flag for the output
15863 section.
15864 (Layout::make_output_section): If the name of the output section
15865 indicates that it might require sorting, set the may_sort flag.
15866 * output.h (Output_section::may_sort_attached_input_sections): New
15867 function.
15868 (Output_section::set_may_sort_attached_input_sections): New
15869 function.
15870 (Output_section::must_sort_attached_input_sections): New
15871 function.
15872 (Output_section::set_must_sort_attached_input_sections): New
15873 function.
15874 (class Output_section): Declare Input_section_sort_entry. Define
15875 Input_section_sort_compare. Declare
15876 sort_attached_input_sections. Add new fields:
15877 may_sort_attached_input_sections_,
15878 must_sort_attached_input_sections_,
15879 attached_input_sections_are_sorted_.
15880 * output.cc (Output_section::Output_section): Initialize new
15881 fields.
15882 (Output_section::add_input_section): Add an entry to
15883 input_sections_ if may_sort or must_sort are true.
15884 (Output_section::set_final_data_size): Call
15885 sort_attached_input_sections if necessary.
15886 (Output_section::Input_section_sort_entry): Define new class.
15887 (Output_section::Input_section_sort_compare::operator()): New
15888 function.
15889 (Output_section::sort_attached_input_sections): New function.
15890 * configure.ac: Check whether the compiler supports constructor
15891 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
15892 * testsuite/initpri1.c: New file.
15893 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
15894 CONSTRUCTOR_PRIORITY.
15895 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
15896 (initpri1_LDFLAGS): New variable.
15897 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15898
18e6b24e
ILT
158992008-03-27 Ian Lance Taylor <iant@google.com>
15900
49bdd526
ILT
15901 * common.cc (Sort_commons::operator): Correct sorting algorithm.
15902 * testsuite/common_test_1.c: New file.
15903 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
15904 (common_test_1_SOURCES): New variable.
15905 (common_test_1_DEPENDENCIES): New variable.
15906 (common_test_1_LDFLAGS): New variable.
15907
18e6b24e
ILT
15908 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
15909 and commons_ correctly when NAME/VERSION does not override
15910 NAME/NULL.
15911 * testsuite/ver_test_6.c: New file.
15912 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
15913 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
15914 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
15915
04bf7072
ILT
159162008-03-26 Ian Lance Taylor <iant@google.com>
15917
5871526f
ILT
15918 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
15919 of an undefined symbol from a version script.
15920 * testsuite/Makefile.am (ver_test_5.so): New target.
15921 (ver_test_5.o): New target.
15922 (check_SCRIPTS): Add ver_test_5.sh.
15923 (check_DATA): Add ver_test_5.syms.
15924 (ver_test_5.syms): New target.
15925 * testsuite/ver_test_5.cc: New file.
15926 * testsuite/ver_test_5.script: New file.
15927 * testsuite/ver_test_5.sh: New file.
15928 * Makefile.in, testsuite/Makefile.in: Rebuild.
15929
04bf7072
ILT
15930 PR gold/5986
15931 Fix problems building gold with gcc 4.3.0.
15932 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
15933 (gold_error_at_location, gold_warning_at_location): Use it.
15934 * configure.ac: Check whether we can compile and use a template
15935 function with a printf attribute.
15936 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
15937 when jumping over bytes.
15938 * object.cc: Instantiate Object::read_section_data.
15939 * debug.h: Include <cstring>
15940 * dwarf_reader.cc: Include <algorithm>
15941 * main.cc: Include <cstring>.
15942 * options.cc: Include <cstring>.
15943 * output.cc: Include <cstring>.
15944 * script.cc: Include <cstring>.
15945 * script.h: Include <string>.
15946 * symtab.cc: Include <cstring> and <algorithm>.
15947 * target-select.cc: Include <cstring>.
15948 * version.cc: Include <string>.
15949 * testsuite/testmain.cc: Include <cstdlib>.
15950 * configure, config.in: Rebuild.
15951
874c5b28
ILT
159522008-03-25 Ian Lance Taylor <iant@google.com>
15953
819d6c3a
ILT
15954 * options.cc: Include "../bfd/bfdver.h".
15955 (options::help): Print bug reporting address.
15956
f4b2c6f5
ILT
15957 * version.cc (print_version): Adjust output for current value of
15958 BFD_VERSION_STRING.
15959
15960 * NEWS: New file.
15961
e96caa79
ILT
15962 * options.cc (options::help): Print list of supported targets.
15963 * target-select.h: Include <vector>.
15964 (class Target_selector): Make machine_, size_, and is_big_endian_
15965 fields const. Add bfd_name_ and instantiated_target_ fields.
15966 (Target_selector::Target_selector): Add bfd_name parameter.
15967 (Target_selector::recognize): Make non-virtual, call
15968 do_recognize.
15969 (Target_selector::recognize_by_name): Make non-virtual, call
15970 do_recognize_by_name.
15971 (Target_selector::supported_names): New function.
15972 (Target_selector::bfd_name): New function.
15973 (Target_selector::do_instantiate_target): New pure virtual
15974 function.
15975 (Target_selector::do_recognize): New virtual function.
15976 (Target_selector::do_recognize_by_name): New virtual function.
15977 (Target_selector::instantiate_target): New private function.
15978 (supported_target_names): Declare.
15979 * target-select.cc (Target_selector::Target_selector): Update for
15980 new parameter and fields.
15981 (select_target_by_name): Check that the name matches before
15982 calling recognize_by_name.
15983 (supported_target_names): New function.
15984 * i386.cc (class Target_selector_i386): Update Target_selector
15985 constructor call. Remove recognize and recognize_by_name. Add
15986 do_instantiate_target.
15987 * x86_64.cc (class Target_selector_x86_64): Likewise.
15988 * testsuite/testfile.cc (class Target_selector_test): Update for
15989 changes to Target_selector.
15990
874c5b28
ILT
15991 * README: Rewrite, with some notes on unsupported features.
15992
0a65a3a7
CC
159932008-03-24 Cary Coutant <ccoutant@google.com>
15994
15995 * i386.cc (Target_i386::Got_type): New enum declaration.
15996 (Target_i386::Scan::local): Updated callers of Output_data_got
15997 member functions.
15998 (Target_i386::Scan::global): Likewise.
15999 (Target_i386::Relocate::relocate): Likewise.
16000 (Target_i386::Relocate::relocate_tls): Likewise.
16001 * object.h (Got_offset_list): New class.
16002 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16003 (Sized_relobj::local_got_offset): Likewise.
16004 (Sized_relobj::set_local_got_offset): Likewise.
16005 (Sized_relobj::local_has_tls_got_offset): Removed.
16006 (Sized_relobj::local_tls_got_offset): Removed.
16007 (Sized_relobj::set_local_tls_got_offset): Removed.
16008 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16009 * output.cc (Output_data_got::add_global): Added got_type parameter.
16010 (Output_data_got::add_global_with_rel): Likewise.
16011 (Output_data_got::add_global_with_rela): Likewise.
16012 (Output_data_got::add_global_pair_with_rel): New function.
16013 (Output_data_got::add_global_pair_with_rela): New function.
16014 (Output_data_got::add_local): Added got_type parameter.
16015 (Output_data_got::add_local_with_rel): Likewise.
16016 (Output_data_got::add_local_with_rela): Likewise.
16017 (Output_data_got::add_local_pair_with_rel): New function.
16018 (Output_data_got::add_local_pair_with_rela): New function.
16019 (Output_data_got::add_global_tls): Removed.
16020 (Output_data_got::add_global_tls_with_rel): Removed.
16021 (Output_data_got::add_global_tls_with_rela): Removed.
16022 (Output_data_got::add_local_tls): Removed.
16023 (Output_data_got::add_local_tls_with_rel): Removed.
16024 (Output_data_got::add_local_tls_with_rela): Removed.
16025 * output.h (Output_data_got::add_global): Added got_type parameter.
16026 (Output_data_got::add_global_with_rel): Likewise.
16027 (Output_data_got::add_global_with_rela): Likewise.
16028 (Output_data_got::add_global_pair_with_rel): New function.
16029 (Output_data_got::add_global_pair_with_rela): New function.
16030 (Output_data_got::add_local): Added got_type parameter.
16031 (Output_data_got::add_local_with_rel): Likewise.
16032 (Output_data_got::add_local_with_rela): Likewise.
16033 (Output_data_got::add_local_pair_with_rel): New function.
16034 (Output_data_got::add_local_pair_with_rela): New function.
16035 (Output_data_got::add_global_tls): Removed.
16036 (Output_data_got::add_global_tls_with_rel): Removed.
16037 (Output_data_got::add_global_tls_with_rela): Removed.
16038 (Output_data_got::add_local_tls): Removed.
16039 (Output_data_got::add_local_tls_with_rel): Removed.
16040 (Output_data_got::add_local_tls_with_rela): Removed.
16041 * resolve.cc (Symbol::override_base_with_special): Removed
16042 reference to has_got_offset_ field.
16043 * symtab.cc (Symbol::init_fields): Replaced initialization
16044 of got_offset_ with got_offsets_. Removed initialization
16045 of has_got_offset_
53fcba31 16046 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16047 (Symbol::got_offset): Likewise.
16048 (Symbol::set_got_offset): Likewise.
16049 (Symbol::has_tls_got_offset): Removed.
16050 (Symbol::tls_got_offset): Removed.
16051 (Symbol::set_tls_got_offset): Removed.
16052 (Symbol::got_offset_): Removed.
16053 (Symbol::tls_mod_got_offset_): Removed.
16054 (Symbol::tls_pair_got_offset_): Removed.
16055 (Symbol::got_offsets_): New field.
16056 (Symbol::has_got_offset): Removed.
16057 (Symbol::has_tls_mod_got_offset): Removed.
16058 (Symbol::has_tls_pair_got_offset): Removed.
16059 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16060 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16061 member functions.
16062 (Target_x86_64::Scan::global): Likewise.
16063 (Target_x86_64::Relocate::relocate): Likewise.
16064 (Target_x86_64::Relocate::relocate_tls): Likewise.
16065
bd52eafb
BE
160662008-03-25 Ben Elliston <bje@au.ibm.com>
16067
16068 * yyscript.y: Fix spelling error in comment.
16069
8b105e34
ILT
160702008-03-24 Ian Lance Taylor <iant@google.com>
16071
8ed814a9
ILT
16072 * options.h (class General_options): Define build_id option.
16073 * layout.h (class Layout): Declare write_build_id, create_note,
16074 create_build_id. Add build_id_note_ member.
16075 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16076 "libiberty.h", "md5.h", "sha1.h".
16077 (Layout::Layout): Initialize eh_frame_data_,
16078 eh_frame_hdr_section_, and build_id_note_.
16079 (Layout::finalize): Call create_build_id.
16080 (Layout::create_note): New function, broken out of
16081 Layout::create_gold_note.
16082 (Layout::create_gold_note): Call create_note.
16083 (Layout::create_build_id): New function.
16084 (Layout::write_build_id): New function.
16085 (Close_task_runner::run): Call write_build_id.
16086
8b105e34
ILT
16087 * x86_64.cc: Correct license to GPLv3.
16088
086a1841
ILT
160892008-03-23 Ian Lance Taylor <iant@google.com>
16090
16091 * options.cc: Include "demangle.h".
16092 (parse_optional_string): New function.
16093 (parse_long_option): Handle takes_optional_argument.
16094 (parse_short_option): Update dash_z initializer. Handle
16095 takes_optional_argument.
16096 (General_options::General_options): Initialize do_demangle_.
16097 (General_options::finalize): Set do_demangle_. Handle demangling
16098 style.
16099 * options.h (parse_optional_string): Declare.
16100 (struct One_option): Add optional_arg field. Update constructor.
16101 Update call constructor calls. Add takes_optional_argument
16102 function.
16103 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16104 (DEFINE_optional_string): Define.
16105 (General_options::demangle): Change from DEFINE_bool to
16106 DEFINE_optional_string.
16107 (General_options::no_demangle): New function.
16108 (General_options::do_demangle): New function.
16109 (General_options::set_do_demangle): New function.
16110 (General_options::execstack_status_): Move definition to end of
16111 class definition.
16112 (General_options::static_): Likewise.
16113 (General_options::do_demangle_): New field.
16114 * object.cc (big_endian>::get_symbol_location_info): Call
16115 Options::do_demangle, not Options::demangle.
16116 * symtab.cc (demangle): Likewise.
16117
cbb93e63
ILT
161182008-03-22 Ian Lance Taylor <iant@google.com>
16119
16120 * gold.h: Include <cstddef> and <sys/types.h>
16121 * options.h: Include <cstring>.
16122
ec531623
ILT
161232008-03-21 Ian Lance Taylor <iant@google.com>
16124
16125 * Added source code to GNU binutils.
752937aa 16126\f
4b95cf5c 16127Copyright (C) 2008-2014 Free Software Foundation, Inc.
752937aa
NC
16128
16129Copying and distribution of this file, with or without modification,
16130are permitted in any medium without royalty provided the copyright
16131notice and this notice are preserved.
16132
16133Local Variables:
16134mode: change-log
16135left-margin: 8
16136fill-column: 74
16137version-control: never
16138End:
This page took 1.12385 seconds and 4 git commands to generate.