Fix for gold linking tlsdesc into an executable with -pie.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
bb779192
HS
12014-11-26 Jing Yu <jingyu@google.com>
2
3 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
4 register to be x0 when to relax TLSDESC_LD64_LO12.
5
a3e60ddb
AM
62014-11-26 Alan Modra <amodra@gmail.com>
7
8 * powerpc.cc (struct Stub_table_owner): New.
9 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
10 unsigned int vector. Update all references.
11 (powerpc_relobj::set_stub_table): Take an unsigned int param
12 rather than a Stub_table. Update callers.
13 (Powerpc_relobj::clear_stub_table): New function.
14 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
15 stub_group_size_ vars.
16 (Target_powerpc::new_stub_table): Delete.
17 (max_branch_delta): New function, extracted from..
18 (Target_powerpc::Relocate::relocate): ..here..
19 (Target_powerpc::Branch_info::make_stub): ..and here. Return
20 status on whether stub created successfully.
21 (Stub_control::Stub_control): Add "no_size_errors" param. Move
22 default sizing to..
23 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
24 reduce on relax failure.
25 (Target_powerpc::group_sections): Add "no_size_errors" param.
26 Use stub_group_size_. Set up group info in a temp vector,
27 before building Stub_table vector. Account for input sections
28 possibly already converted to relaxed sections.
29 (Stub_table::init): Delete. Merge into..
30 (Stub_table::Stub_table): ..here.
31 (Stub_table::can_reach_stub): New function.
32 (Stub_table::add_plt_call_entry): Add "from" parameter and
33 return true iff stub could be reached.
34 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
35 param too.
36 (Stub_table::clear_stubs): Add "all" param.
37
a20605cf
AM
382014-11-26 Alan Modra <amodra@gmail.com>
39
40 * powerpc.cc (Stub_control::set_output_and_owner): New function.
41 (Target_powerpc::group_sections): Use it.
42
43b64deb
CC
432014-11-25 Cary Coutant <ccoutant@google.com>
44
45 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
46 (Binary_to_elf::write_symbol): Add st_size parameter.
47 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
48
c924eb67
CC
492014-11-25 Cary Coutant <ccoutant@google.com>
50
51 PR gold/17639
52 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
53 (Sized_relobj_file::do_layout): Handle deferred sections properly
54 during GC pass 1. Don't add reloc sections to deferred list twice.
55 * object.h (Sized_relobj_file::is_deferred_layout): New function.
56 (Sized_relobj_file::is_deferred_layout_): New data member.
57
9d585188
L
582014-11-21 H.J. Lu <hongjiu.lu@intel.com>
59
60 PR gold/17619
61 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
62 Check PC-relative offset overflow in PLT entry.
63
3ffaac20
AM
642014-11-21 Alan Modra <amodra@gmail.com>
65
66 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
67 for undefined weaks.
68
0cfb0717
AM
692014-11-20 Alan Modra <amodra@gmail.com>
70
71 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
72 from --stub-group-size parameter divided by 1024.
73 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
74 template parameter. Update all uses.
75 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
76 has_stub_value. Set for long branches. Don't report overflow for
77 branch to undefined weak symbols. Print info message on
78 overflowing branch to stub.
79
f9dffbf0
AM
802014-11-20 Alan Modra <amodra@gmail.com>
81
82 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
83
e88ba8d5
L
842014-11-13 H.J. Lu <hongjiu.lu@intel.com>
85
86 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
87 entry for R_X86_64_GOTPLT64.
88 (Target_x86_64<size>::Relocate::relocate): Update comments for
89 R_X86_64_GOTPLT64.
90
d37ffe25
ED
912014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
92
93 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
94 * plugin.h: add lock definition
95
9726c3c1
HS
962014-10-29 Han Shen <shenhan@google.com>
97 Jing Yu <jingyu@google.com>
98
99 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
100 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
101 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
102 Symbol::TLS_REF.
103 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
104 method.
105 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
106 (Target_aarch64::tls_ld_to_le): New method.
107 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
108 for 64bit targets.
109 (Output_data_plt_aarch64::irelative_rel_): New data member.
110 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
111 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
112 (Output_data_plt_aarch64::add_relocation): New method.
113 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
114 offset. Add got_irelative size to got size.
115 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
116 type string with the new typename.
117 (AArch64_relocate_functions::update_adr): Replace parameter x with
118 immed.
119 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
120 (AArch64_relocate_functions::reloc_common): New method.
121 (AArch64_relocate_funcsions::rela_general): Extract common part out
122 into reloc_common method.
123 (AArch64_relocate_functions::rela_general): Likewise.
124 (AArch64_relocate_functions::pcrela_general): Likewise.
125 (AArch64_relocate_functions::adr): New method.
126 (AArch64_relocate_functions::adrp): Calculate immed before calling
127 update_adr.
128 (AArch64_relocate_functions::adrp): Likewise.
129 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
130 comparing x to 0. Calculate immed from ~x when x < 0.
131 (Target_aarch64::optimize_tls_reloc): Add new cases for
132 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
133 TLSLD_MOVW_DTPREL_G0_NC.
134 (Target_aarch64::possible_function_pointer_reloc): Implement this
135 method.
136 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
137 comment.
138 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
139 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
140 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
141 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
142 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
143 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
144 (Target_aarch64::make_plt_entry): Call add_entry with two more
145 parameters.
146 (Target_aarch64::make_local_ifunc_plt_entry): New method.
147 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
148 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
149 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
150 (Target_aarch64::Relocate::relocate_tls): Add cases for
151 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
152 TLSLD_MOVW_DTPREL_G0_NC.
153 * testsuite/icf_safe_so_test.cc: Correct test comment.
154 * testsuite/icf_safe_test.sh: Add AArch64 arch.
155
80272b8c
AM
1562014-10-22 Alan Modra <amodra@gmail.com>
157
158 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
159 thread_starter.
160
998a69f4
AS
1612014-10-18 Andreas Schwab <schwab@linux-m68k.org>
162
163 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
164
aed56ec5
CC
1652014-10-17 Cary Coutant <ccoutant@google.com>
166
167 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
168 Add "typename" keyword.
169
bb779192 1702014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
171 Jing Yu <jingyu@google.com>
172
173 Patch for gold aarch64 backend to support relaxation.
174 * aarch64-reloc.def: Change format.
175 * aarch64.cc (class Reloc_stub): New class.
176 (class Stub_table): New class.
177 (class AArch64_relobj): New class.
178 (class AArch64_input_section): New class.
179 (class AArch64_output_section): New class.
180 (Target_aarch64::new_stub_table): New method.
181 (Target_aarch64::new_aarch64_input_section): New method.
182 (Target_aarch64::find_aarch64_input_section): New method.
183 (Target_aarch64::scan_section_for_stubs): New method.
184 (Target_aarch64::scan_reloc_section_for_stubs): New method.
185 (Target_aarch64::relocate_stub): New method.
186 (Target_aarch64::current_target): New method.
187 (Target_aarch64::do_make_elf_object): New method.
188 (Target_aarch64::do_may_relax): New method.
189 (Target_aarch64::do_relax): New method.
190 (Target_aarch64::group_sections): New method.
191 (Target_aarch64::scan_reloc_for_stub): New method.
192 (Target_aarch64::do_make_output_section): New method.
193 (Target_aarch64::stub_tables_): New data member.
194 (Target_aarch64::aarch64_input_section_map_): New data member.
195 (AArch64_relocate_functions::maybe_apply_stub): New method.
196
db4c9594
CC
1972014-09-30 Cary Coutant <ccoutant@google.com>
198
199 PR gold/17432
200 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
201
cd6da036
KC
2022014-09-30 Kito Cheng <kito@0xlab.org>
203
204 PR gold/13597
205 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
206 hash table before sysv-style hash table.
207
5f772412
ST
2082014-09-29 Sriraman Tallam <tmsriram@google.com>
209
210 * options.h (--pic-executable): Add negative to alias to -no-pie.
211
5efeedf6
CC
2122014-09-26 Cary Coutant <ccoutant@google.com>
213
214 PR gold/16773
215 * object.cc (Sized_relobj_file): Compute value of section symbols
216 for TLS sections the same as TLS symbols.
217
1707f183
CC
2182014-09-25 Cary Coutant <ccoutant@google.com>
219
220 PR gold/17432
221 * resolve.cc (Symbol_table::resolve): Override common placeholder
222 symbols, but adjust sizes.
223 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
224 symbols to common lists.
225
00cac886
AM
2262014-09-24 Alan Modra <amodra@gmail.com>
227
228 * po/POTFILES.in: Regenerate.
229
635aa30e
CC
2302014-09-23 Taiju Tsuiki <tzik@google.com>
231 Cary Coutant <ccoutant@google.com>
232
71b9b91b 233 PR gold/14860
635aa30e
CC
234 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
235 on input_sections_blocker.
236 * layout.cc (Write_sections_task::locks): Unblock
237 input_sections_blocker_.
238 * layout.h (Write_sections_task::Write_sections_task): Add
239 input_sections_blocker.
240 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
241 to DEPENDENCIES.
242 * testsuite/Makefile.in: Regenerate.
243
c0c71592
RÁE
2442014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
245
246 * testsuite/Makefile.am (plugin_test_10): New test.
247 * testsuite/Makefile.in: Regenerate
248 * testsuite/plugin_common_test_2.c (c1): Align to 8.
249 * testsuite/plugin_test_10.sh: New file.
250
6168c2a1
RÁE
2512014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
252
253 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
254 * resolve.cc (Symbol_table::resolve): Don't override common symbols
255 during the replacement phase.
256
3a531937
JY
2572014-09-17 Han Shen <shenhan@google.com>
258 Jing Yu <jingyu@google.com>
259
260 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
261 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
262 * aarch64.cc (Target_aarch64): Add data members
263 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
264 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
265 constructor.
266 (Target_aarch64::do_reloc_symbol_index): New method.
267 (Target_aarch64::do_reloc_addend): New method.
268 (Target_aarch64::add_tlsdesc_info): New method.
269 (Target_aarch64::do_dynsym_value): New method.
270 (Target_aarch64::do_make_data_plt): Add new parameters: got,
271 got_irelative. Pass them to Output_data_plt_aarch64_standard.
272 (Target_aarch64::make_data_plt): Add new parameters: got,
273 got_irelative. Pass them to do_make_data_plt.
274 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
275 (Target_aarch64::Relocate:tls_gd_to_le): New method.
276 (Target_aarch64::Relocate:tls_ie_to_le): New method.
277 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
278 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
279 (Target_aarch64::got_tlsdesc_section): New method.
280 (Target_aarch64::make_local_ifunc_plt_entry): New method.
281 (Target_aarch64::define_tls_base_symbol): New method.
282 (Target_aarch64::reserve_tlsdesc_entries): New method.
283 (Target_aarch64::got_mod_index_entry): New method.
284 (Target_aarch64::rela_tlsdesc_section): New method.
285 (Target_aarch64::rela_irelative_section): New method.
286 (Target_aarch64::Tlsdesc_info): New struct.
287 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
288 relocations and tlsdesc relocations.
289 (Target_aarch64::optimize_tls_reloc): Implement method.
290 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
291 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
292 in constructor.
293 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
294 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
295 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
296 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
297 (Output_data_plt_aarch64::rela_tlsdesc): New method.
298 (Output_data_plt_aarch64::rela_irelative): New method.
299 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
300 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
301 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
302 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
303 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
304 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
305 (Output_data_plt_aarch64_standard): New member variables:
306 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
307 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
308 New parameter: got, got_irelative.
309 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
310 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
311 (Output_data_plt_aarch64::do_write): Replace got_address with
312 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
313 (AArch64_relocate_functions::update_movnz): New method.
314 (AArch64_relocate_functions): Correct format.
315 (AArch64_relocate_functions::movnz): New method.
316 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
317 before the switch. Add new cases to switch.
00cac886 318 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
319 tlsgd tlsdesc cases.
320 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
321 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
322 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
323 Call reloc_name_in_error_message to print unsupported reloc.
324 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
325 make_data_plt.
326 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
327 relocs. Fill in some more dynamic tags.
328 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
329 Skip call tls_get_addr when tlsgd is relaxed.
330 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
331 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
332 tlsdesc->ie relaxation.
333
62661c93
SS
3342014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
335
336 * mips.cc (Target_mips_nacl): New class.
337 (Target_selector_mips_nacl): New class.
338 (target_selector_mips32): Rename from target_selector_mips32be and use
339 Target_selector_mips_nacl instead of Target_selector_mips.
340 (target_selector_mips32el): Rename from target_selector_mips32 and use
341 Target_selector_mips_nacl instead of Target_selector_mips.
342 (target_selector_mips64): Rename from target_selector_mips64be and use
343 Target_selector_mips_nacl instead of Target_selector_mips.
344 (target_selector_mips64el): Rename from target_selector_mips64 and use
345 Target_selector_mips_nacl instead of Target_selector_mips.
346 (Target_mips::mips_info): Add const attribute.
347
54674d38
CC
3482014-09-02 Cary Coutant <ccoutant@google.com>
349
350 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
351 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
352 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
353 (Sized_incr_dynobj::do_section_name): Likewise.
354 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
355 (Sized_incr_dynobj::do_section_name): Likewise.
356 * object.h (Object::section_name): Likewise.
357 (Object::do_section_name): Likewise.
358 (Sized_relobj_file::do_section_name): Likewise.
359 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
360 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
361
9860cbcf
CC
3622014-09-02 Cary Coutant <ccoutant@google.com>
363
364 PR gold/17005
365 * ehframe.cc (Fde::write): Add output_offset parameter.
366 (Cie::write): Likewise.
367 (Eh_frame::set_final_data_size): Account for offset within output
368 section.
369 (Eh_frame::do_sized_write): Likewise.
370 * ehframe.h (Fde::write): Add output_offset parameter.
371 (Cie::write): Likewise.
372 * output.cc (Output_section::Input_section_sort_entry): Remove
373 section_has_name_; add output_section_name parameter. Use
374 output section name for non-input sections.
375 (Output_section::Input_section_sort_entry::section_has_name): Remove.
376 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
377 (Output_section::Input_section_sort_compare): Remove logic for
378 sections without names.
379 (Output_section::Input_section_sort_init_fini_compare): Likewise.
380 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
381 Likewise.
382 (Output_section::Input_section_sort_section_name_compare): Likewise.
383
8e33481e
HS
3842014-08-29 Han Shen <shenhan@google.com>
385 Jing Yu <jingyu@google.com>
386
387 * aarch64-reloc-property.cc
388 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
389 reference reloc property in the table.
390 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
391 3 other entries.
392 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
393 2 new overloaded methods.
394 (Output_data_got_aarch64::do_write): Add code to write out
395 static relocs.
396 (class Output_data_got_aarch64::Static_reloc): New class to wrap
397 static relocs.
398 (Output_data_got_aarch64::static_relocs): New vector to
399 hold static relocs.
400 (Target_aarch64::TCB_SIZE): New const static memeber.
401 (Target_aarch64::tcb_size): New method.
402 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
403 (Target_aarch64::Relocate::relocate_tls): New method.
404 (Target_aarch64::Scan::local): Add code handling new reloc types.
405 (Target_aarch64::Scan::global): Add code handling new reloc types.
406
81233653
ST
4072014-08-13 Sriraman Tallam <tmsriram@google.com>
408
409 * options.h (-no-pie): Add option.
410
9363c7c3
JY
4112014-08-08 Jing Yu <jingyu@google.com>
412 Han Shen <shenhan@google.com>
413
414 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
415 (DEFFILES): add aarch64-reloc.def.
416 (TARGETSOURCES): Add aarch64-reloc-property.cc.
417 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
418 * Makefile.in: Regenerate.
419 * aarch64-reloc-property.cc: New file.
420 * aarch64-reloc-property.h: New file.
421 * aarch64-reloc.def: New file.
422 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
423 with tab to make the format consistent.
424 (Output_data_got_aarch64::symbol_table_): New method.
425 (Target_aarch64::do_plt_address_for_global): New method.
426 (Target_aarch64::do_plt_address_for_local): New method.
427 (Target_aarch64::do_select_as_default_target): New method.
428 (Target_aarch64::do_make_data_plt): New method.
429 (Target_aarch64::make_data_plt): New method.
430 (Output_data_plt_aarch64::has_irelative_section): New method.
431 (Output_data_plt_aarch64::address_for_global): New method.
432 (Output_data_plt_aarch64::address_for_local): New method.
433 (Output_data_plt_aarch64::irelative_rel_): New parameter.
434 (Output_data_plt_aarch64::add_entry): Implement contents.
435 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
436 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
437 the got_pov entry to plt0.
438 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
439 Implement contents.
440 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
441 (AArch64_howto): New struct.
442 (aarch64_howto[]): New static const array.
443 (AArch64_relocate_functions): New class.
444 (Target_aarch64::Scan::get_reference_flags): Remove method.
445 (Target_aarch64::Scan::local): Implement to support a few relocations.
446 (Target_aarch64::Scan::global): Implement to support a few relocations.
447 (Target_aarch64::make_plt_section): Implement contents.
448 (Target_aarch64::make_plt_entry): Implement contents.
449 (Target_aarch64::do_finalize_sections): Implement contents.
450 (Target_aarch64::Relocate::relocate): Implement a few relocations.
451 (Target_aarch64::relocate_section): Implement contents.
452
ad9fe6c1
AM
4532014-08-06 Alan Modra <amodra@gmail.com>
454
455 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
456
7cd4e5b7
AM
4572014-08-06 Alan Modra <amodra@gmail.com>
458
459 PR 13227
460 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
461
5ad9b0a7
ST
4622014-07-21 Sriraman Tallam <tmsriram@google.com>
463
464 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 465 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 466
e051745c
CC
4672014-07-08 Cary Coutant <ccoutant@google.com>
468
469 * expression.cc (struct Expression::Expression_eval_info): Add
470 new fields type_pointer, vis_pointer, and nonvis_pointer.
471 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
472 nonvis_pointer parameters. Adjust all calls.
473 (Symbol_expression::value): Update type, visibility, and nonvis bits
474 in caller.
475 * script.cc (Symbol_assignment::sized_finalize): Update type,
476 visibility, and remaining st_other bits for new symbol.
477 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
478 vis_pointer, and nonvis_pointer parameters.
479 * symtab.h (Symbol::set_type): New method.
480
481 * testsuite/Makefile.am (defsym_test): New test.
482 * testsuite/Makefile.in: Regenerate.
483 * testsuite/defsym_test.c: New file.
484 * testsuite/defsym_test.sh: New file.
485
f35c4853
CC
4862014-07-08 Cary Coutant <ccoutant@google.com>
487
488 PR gold/15639
489 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
490 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
491 (Sized_dynobj::base_read_symbols): ...new method.
492 * object.h (Sized_relobj_file::base_read_symbols): New method.
493 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
494 (Sized_relobj_file::base_read_symbols): ...new method.
495 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
496 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
497 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
498
2900af2d
AM
4992014-07-04 Alan Modra <amodra@gmail.com>
500
501 * po/POTFILES.in: Regenerate.
502
053a4d68
JY
5032014-07-02 Jing Yu <jingyu@google.com>
504
505 * aarch64.cc: New file
506 * Makefile.am (TARGETSOURCES): Add aarch64.cc
507 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
508 * Makefile.in: Regenerate.
509 * configure.tgt: Add entries for aarch64*.
510 * configure.ac: Likewise.
511 * configure: Likewise.
512
7b549045
AM
5132014-06-27 Alan Modra <amodra@gmail.com>
514
515 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
516
cb818dbf
CC
5172014-06-24 Cary Coutant <ccoutant@google.com>
518
519 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
520 sections.
521 (Dwo_file::sized_read_unit_index): Likewise.
522
9810d34d
SS
5232014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
524
525 * mips.cc: New file.
526 * Makefile.am (TARGETSOURCES): Add mips.cc
527 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
528 * configure.tgt: Add entries for mips*.
529 * configure.ac: Likewise.
530 * Makefile.in: Regenerate.
531 * configure: Likewise.
532
9baa787b
CC
5332014-06-09 Cary Coutant <ccoutant@google.com>
534
535 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
536 unit_length is within section bounds.
537
8f89af0a
CC
5382014-06-09 Cary Coutant <ccoutant@google.com>
539
540 PR gold/16980
541 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
542 map.
543
a47622ac
AM
5442014-06-07 Alan Modra <amodra@gmail.com>
545
546 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
547
4320c691
CC
5482014-06-06 Cary Coutant <ccoutant@google.com>
549
550 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
551 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
552 (Dwarf_pubnames_table::read_header): Likewise.
553 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
554 .debug_gnu_pubtypes.
555
270c9937
JB
5562014-06-05 Joel Brobecker <brobecker@adacore.com>
557
558 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
559 * Makefile.in, configure: Regenerate.
560
397998fc
AM
5612014-06-03 Alan Modra <amodra@gmail.com>
562
563 * powerpc.cc (addis_12_2): Define.
564 (Stub_table::do_write): Support fusion on ELFv2 stubs.
565
61f5c66f
AM
5662014-06-03 Alan Modra <amodra@gmail.com>
567
568 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
569 st_other output.
570
f6971787
AM
5712014-06-02 Alan Modra <amodra@gmail.com>
572
573 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
574 Only ignore relocs on ELFv1.
575 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
576
f6fb8322
CC
5772014-05-30 Cary Coutant <ccoutant@google.com>
578
579 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
580 * testsuite/Makefile.in: Regenerate.
581 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
582
c23dd342
L
5832014-05-27 H.J. Lu <hongjiu.lu@intel.com>
584
585 PR gold/16945
586 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
587 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
588
5fe7ffdc
AM
5892014-05-15 Alan Modra <amodra@gmail.com>
590
591 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
592 Compare FDE contents with DW_CFA_nop rather than 0.
593
a82bef93
ST
5942014-05-13 Sriraman Tallam <tmsriram@google.com>
595
596 * symtab.h (may_need_copy_reloc): Remove check for position independent
597 code.
598 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
599 position independence before pc absolute may_need_copy_reloc call.
600 Add check for executable output befor pc relative may_need_copy_reloc
601 call.
602 * i386.cc: Ditto.
603 * arm.cc: Ditto.
604 * sparc.cc: Ditto.
605 * tilegx.cc: Ditto.
606 * powerpc.cc: Add check for no position independence before
607 may_need_copy_reloc calls.
608 * testsuite/pie_copyrelocs_test.cc: New file.
609 * testsuite/pie_copyrelocs_shared_test.cc: New file.
610 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 611 * Makefile.in: Regenerate.
a82bef93 612
53c66605
ML
6132014-05-08 Martin Liška <mliska@suse.cz>
614
615 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
616
57b2284c
CC
6172014-05-06 Cary Coutant <ccoutant@google.com>
618
619 PR gold/16900
620 * i386.cc (Output_data_got_plt_i386): New class.
621 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
622 parameter. Change all callers.
623 (Output_data_plt_i386::layout_): Remove.
624 (Output_data_plt_i386::got_plt_): Change type.
625 (Target_i386::got_plt_): Change type. Change all references.
626 (Target_i386::got_section): Create instance of new class.
627 (Output_data_got_plt_i386::do_write): New function.
628 * x86_64.cc (Output_data_got_plt_x86_64): New class.
629 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
630 parameter. Change all callers.
631 (Output_data_plt_x86_64::layout_): Remove.
632 (Output_data_plt_x86_64::got_plt_): Change type.
633 (Target_x86_64::got_plt_): Change type. Change all references.
634 (Target_x86_64::got_section): Create instance of new class.
635 (Output_data_got_plt_x86_64::do_write): New function.
636 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
637 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
638 class.
639
6b97515d 6402014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 641
6b97515d
CC
642 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
643 if we have pubnames/pubtypes.
644
d1bddd3c
CC
6452014-05-02 Cary Coutant <ccoutant@google.com>
646
5fe7ffdc
AM
647 * defstd.cc (in_segment): Define __ehdr_start here...
648 * layout.cc (Layout::finalize): ...Instead of here. Set the
649 output segment when known.
650 * resolve.cc (Symbol::override_base_with_special): Remember
651 the original binding.
652 * symtab.cc (Symbol::set_output_segment): New function.
653 (Symbol::set_undefined): New function.
654 * symtab.h (Symbol::is_weak_undefined): Check original undef
655 binding.
656 (Symbol::is_strong_undefined): New function.
657 (Symbol::set_output_segment): New function.
658 (Symbol::set_undefined): New function.
659 * target-reloc.h (is_strong_undefined): Remove.
660 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
661 Check for hidden undefs.
662 (relocate_section): Call Symbol::is_strong_undefined.
663
664 * testsuite/Makefile.am (ehdr_start_test_1)
665 (ehdr_start_test_2, ehdr_start_test_3)
666 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
667 * testsuite/Makefile.in: Regenerate.
668 * testsuite/ehdr_start_def.cc: New source file.
669 * testsuite/ehdr_start_test.cc: New source file.
670 * testsuite/ehdr_start_test.t: New linker script.
671 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 672
7849f6d8
CC
6732014-04-23 Cary Coutant <ccoutant@google.com>
674
bf2cc635 675 PR gold/16870
7849f6d8
CC
676 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
677
99fd8cff
CC
6782014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
679
680 * layout.cc (Layout::include_section): Allow a target to decide
681 whether to include a section.
682 * target.h (Target::should_include_section): New function.
683 (Target::do_should_include_section): New function.
684
91f43acd
CC
6852014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
686
687 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
688 inline into ...
689 (Copy_relocs::emit): ... here.
690 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
691 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
692 (Copy_reloc_entry::entries_): Change from private to protected.
693
c4eb27e1
ST
6942014-04-02 Sriraman Tallam <tmsriram@google.com>
695
696 * icf.cc (get_section_contents): Replace copies of reloc
697 vectors with const references.
698
ae447ddd
CC
6992014-04-02 Cary Coutant <ccoutant@google.com>
700
701 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
702 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
703 * configure: Regenerate.
704 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
705 -fno-use-linker-plugin.
706 (LINK1, CXXLINK1): Add it to the link command.
707 * testsuite/Makefile.in: Regenerate.
708
fa47fa92
AM
7092014-03-12 Alan Modra <amodra@gmail.com>
710
711 * Makefile.in: Regenerate.
712
9b12c500
CC
7132014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
714
715 * symtab.h (Symbol::set_nonvis): New function.
716
beacaa96
CC
7172014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
718
719 * symtab.cc (Sized_symbol<32>::init_output_data):
720 Instantiate the template.
721 (Sized_symbol<64>::init_output_data): Likewise.
722
800d9823
CC
7232014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
724
725 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
726 adjust dynamic symbol value.
727 * target.h (Target::adjust_dyn_symbol): New function.
728 (Target::do_adjust_dyn_symbol): New function.
729
918fc1f8 7302014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 731
918fc1f8
CC
732 * output.cc (Output_data_dynamic::Dynamic_entry::write):
733 Get the value of DYNAMIC_CUSTOM dynamic entry.
734 * output.h (Output_data_dynamic::add_custom): New function.
735 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
736 dynamic entry.
737 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
738 * target.h (Target::dynamic_tag_custom_value): New function.
739 (Target::do_dynamic_tag_custom_value): New function.
740
98ff9231
CC
7412014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
742
743 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
744 dynsym indexes.
745 * target.h (Target::has_custom_set_dynsym_indexes): New function.
746 (Target::do_has_custom_set_dynsym_indexes): New function.
747 (Target::set_dynsym_indexes): New function.
748 (Target::do_set_dynsym_indexes): New function.
749
b80eed39
AM
7502014-03-07 Alan Modra <amodra@gmail.com>
751
752 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
753 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
754 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
755 (Powerpc_relocate_functions::has_overflow_bitfield,
756 overflowed): Use the above.
757 (Target_powerpc::Relocate::relocate): Correct overflow checking
758 for a number of relocations. Modify overflow test for 16-bit
759 fields in instructions to signed/unsigned according to whether
760 the field takes a signed or unsigned value.
761
4b95cf5c
AM
7622014-03-05 Alan Modra <amodra@gmail.com>
763
764 Update copyright years.
765
45965137
AM
7662014-03-05 Alan Modra <amodra@gmail.com>
767
768 * powerpc.cc (Target_powerpc::Scan::local, global): Support
769 R_PPC64_ADDR64_LOCAL.
770 (Target_powerpc::Relocate::relocate): Likewise.
771
2c80b753
AM
7722014-03-03 Alan Modra <amodra@gmail.com>
773
774 * dwp.cc (print_version): Update copyright year to current.
775
c1c69e83
AM
7762014-02-10 Alan Modra <amodra@gmail.com>
777
778 * po/gold.pot: Regenerate.
779
dd0c4e70
CC
7802014-02-06 Cary Coutant <ccoutant@google.com>
781
782 Fix problem where -u is ignored when a weak undef is seen.
783
784 * archive.cc (Library_base::should_include_member): Reorder
785 code to check for -u option if a weak undef has already been seen.
786 * testsuite/Makefile.am (weak_undef_test_2): New test case.
787 * testsuite/Makefile.in: Regenerate.
788 * testsuite/weak_undef_file3.cc: New file.
789 * testsuite/weak_undef_file4.cc: New file.
790 * testsuite/weak_undef_test_2.cc: New file.
791
1a221d3d
CC
7922014-02-05 Cary Coutant <ccoutant@google.com>
793
794 Fix issues with gold undefined symbol diagnostics.
795
796 PR binutils/15435
797 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
798 check to here.
799 * target-reloc.h (is_strong_undefined): New function.
800 (relocate_section): Move undef vtable symbol check from here.
801 Check for is_strong_undefined.
802
e889f0a4 8032014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 804
e889f0a4
CC
805 Fix problems with the --dynamic-list option.
806
807 PR gold/13577
808 * options.cc (General_options::parse_dynamic_list):
809 Set have_dynamic_list_.
810 (General_options::General_options): Initialize have_dynamic_list_.
811 (General_options::finalize): Turn off -Bsymbolic and
812 -Bsymbolic-functions if --dynamic-list provided.
813 * options.h (General_options::have_dynamic_list): New function.
814 (General_options::have_dynamic_list_): New data member.
815 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
816 correctly.
5fe7ffdc 817
e889f0a4
CC
818 PR gold/16530
819 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
820 in --dynamic-list, mark it.
5fe7ffdc 821
e889f0a4
CC
822 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
823 (dynamic_list_2): New test case.
824 * testsuite/Makefile.in: Regenerate.
825 * testsuite/dynamic_list_2.cc: New file.
826 * testsuite/dynamic_list_2.t: New file.
827 * testsuite/dynamic_list_lib1.cc: New file.
828 * testsuite/dynamic_list_lib2.cc: New file.
829 * testsuite/gc_dynamic_list_test.c: New file.
830 * testsuite/gc_dynamic_list_test.sh: New file.
831 * testsuite/gc_dynamic_list_test.t: New file.
832
ec673e64
CC
8332014-01-28 Cary Coutant <ccoutant@google.com>
834
835 Add .gdb_index version 7 support.
836
837 * gold/dwarf_reader.cc: include <utility> (for make_pair).
838 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
839 debug sections.
840 (Dwarf_ranges_table::read_ranges_table): Likewise.
841 (Dwarf_pubnames_table::read_section): Check for GNU-style
842 sections, and for compressed debug sections.
843 (Dwarf_pubnames_table::read_header): Compute end address of table.
844 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
845 for end of list by offset, not by offset == 0.
846 (Dwarf_info_reader::do_read_string_table): Check for compressed
847 debug sections.
848 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
849 Initialize new data members.
850 (Dwarf_pubnames_table::next_name): return flag_byte.
851 (Dwarf_pubnames_table::end_of_table_): New data member.
852 (Dwarf_pubnames_table::is_gnu_style_): New data member.
853 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
854 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
855 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
856 read skeleton type unit DIEs.
857 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
858 (Gdb_index::do_write): Write flag_byte.
859 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
860 (Gdb_index::Cu_vector): Store flags along with cu indexes.
861 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
862 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
863
221fd5d5
L
8642014-01-08 H.J. Lu <hongjiu.lu@intel.com>
865
866 * version.cc (print_version): Update copyright year to 2014.
867
6c09fb0b
ILT
8682013-12-19 Dimitry Andric <dimitry@andric.com>
869
870 * stringpool.cc (Stringpool_template::reserve): Add
871 HAVE_UNORDERED_MAP case.
872 * stringpool.cc (Stringpool_template::print_stats): Likewise.
873
8356f2d0
CC
8742013-12-18 Cary Coutant <ccoutant@google.com>
875
876 * configure.ac: Check for <unordered_set> and <unordered_map>.
877 * config.in: Regenerate.
878 * configure: Regenerate.
879 * system.h: Use <unordered_set> and <unordered_map> if available.
880
f2c7d7ee
RM
8812013-12-10 Roland McGrath <mcgrathr@google.com>
882
883 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
884 with $(INSTALL_PROGRAM_ENV).
885 * Makefile.in: Regenerate.
886
6632e8cc
CC
8872013-11-22 Cary Coutant <ccoutant@google.com>
888
889 * configure.ac: Add check for which library is needed for
890 dlopen.
891 * configure: Regenerate.
892
0c075858
CC
8932013-11-22 Cary Coutant <ccoutant@google.com>
894
895 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
896 assembler.
897 * testsuite/Makefile.in: Regenerate.
898
f49fe902
L
8992013-11-17 H.J. Lu <hongjiu.lu@intel.com>
900
901 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
902 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
903 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
904 (Target_x86_64<size>::Scan::local): Likewise.
905 (Target_x86_64<size>::Scan::global): Likewise.
906 (Target_x86_64<size>::Relocate::relocate): Likewise.
907 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
908 Likewise.
909 (Target_x86_64<size>::Scan::check_non_pic(): Handle
910 R_X86_64_PC32_BND.
911
912 * testsuite/Makefile.am (check_PROGRAMS): Add
913 exception_x86_64_bnd_test.
914 (exception_x86_64_bnd_test_SOURCES): New macro.
915 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
916 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
917 (exception_x86_64_bnd_test_LDADD): Likewise.
918 (exception_x86_64_bnd_1.o): New rule.
919 (exception_x86_64_bnd_2.o): Likewise.
920 * testsuite/Makefile.in: Regenerated.
921
9055360d
AM
9222013-11-15 Alan Modra <amodra@gmail.com>
923
924 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
925 accessor.
926 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
927 Only call ppc64_local_entry_offset for 64-bit. Restrict
928 symval_for_branch lookup to ELFv1.
929 (Stub_table::add_plt_call_entry): Use unsigned int off.
930 (Output_data_glink::Address, invalid_address): New.
931 (Output_data_glink::add_eh_frame): Move out of line. Add
932 support for ELFv2.
933 (Output_data_glink::add_global_entry, find_global_entry,
934 global_entry_address): New functions.
935 (Output_data_glink::global_entry_stubs_, end_branch_table_,
936 ge_size): New variables.
937 (Output_data_glink::set_final_data_size): Add global entry
938 stub sizing.
939 (Output_data_glink::do_write): Write global entry stubs.
940 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
941 parameter. Return true for ELFv2. Adjust callers.
942 (Target_powerpc::Scan::local, global): Restrict opd lookup to
943 ELFv1. Similarly for ifunc and dynamic relocation processing
944 specific to ELFv1. Recognize that symbols are defined on
945 their plt entries for ELFv2.
946 (Target_powerpc::symval_for_branch): Assert if called for
947 ELFv2 or ppc32.
948 (Target_powerpc::Relocate::relocate): Use global entry plt
949 stub for symbol value if such exists on ELFv2.
950 (Target_powerpc::Relocate::relocate): Don't call
951 symval_for_branch when ELFv2. Do adjust for local entry
952 offset when ELFv2.
953 (Target_powerpc::do_dynsym_value): Set symbols to global entry
954 plt stub for ELFv2.
955 (Target_powerpc::do_plt_address_for_global): Similarly.
956
cafdd569
CC
9572013-11-14 Cary Coutant <ccoutant@google.com>
958
959 Revert patch -- this did not fix the problem, and there is
960 no race there.
961
962 2013-11-14 Cary Coutant <ccoutant@google.com>
963
964 PR gold/14860
965 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
966 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
967 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
968 updating fde_offsets_.
969 (Eh_frame_hdr::lock_): New data member.
970
94e49e16
CC
9712013-11-14 Cary Coutant <ccoutant@google.com>
972
973 * dwp.cc (Dwo_file_entry): New type.
974 (File_list): Use Dwo_file_entry.
975 (Dwo_file::verify): New function.
976 (Dwo_file::verify_dwo_list): New function.
977 (Dwo_file::sized_verify_dwo_list): New function.
978 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
979 list.
980 (Dwp_options): New enum type.
981 (dwp_options): Add --verify-only.
982 (usage): Likewise.
983 (main): Likewise.
984 * dwp.h (gold_info): Add declaration.
985
7cdd7d57
CC
9862013-11-14 Cary Coutant <ccoutant@google.com>
987
988 PR gold/14860
989 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
990 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
991 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
992 updating fde_offsets_.
993 (Eh_frame_hdr::lock_): New data member.
994
1d946cb3
CC
9952013-11-06 Cary Coutant <ccoutant@google.com>
996
997 PR gold/15758
998 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
999 before reloc sections.
1000
4f65b40e
AM
10012013-11-04 Alan Modra <amodra@gmail.com>
1002
1003 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
1004 (Symbol::needs_dynamic_reloc): Test new flag.
1005 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
1006 (Target_powerpc::Scan::get_reference_flags): Add target param.
1007 Return FUNC_DESC_ABI for 64-bit ELFv1.
1008 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
1009 call.
1010 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
1011 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
1012
908794a9
CC
10132013-10-31 Cary Coutant <ccoutant@google.com>
1014
1015 Restore support for dwp v2 DWARF package file format.
1016
1017 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1018 tu_length parameter. Adjust all callers.
1019 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1020 * dwp.cc: Include dwarf.h.
1021 (Section_bounds): New struct type.
1022 (Unit_set): New struct type.
1023 (Dwo_file::Dwo_file): Initialize new data member.
1024 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1025 Combine and rename to...
1026 (Dwo_file::read_unit_index): ...this.
1027 (Dwo_file::sized_read_compunit_index)
1028 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1029 (Dwo_file::sized_read_unit_index): ...this.
1030 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1031 parameters; add section_id parameter.
1032 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1033 (Dwo_file::add_unit_set): ...this.
1034 (Dwo_file::shndx_map_): Remove.
1035 (Dwo_file::sect_offsets_): New data member.
1036 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1037 (Dwp_output_file::add_section): Rename to...
1038 (Dwp_output_file::add_contribution): ...this.
1039 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1040 (Dwp_output_file::add_tu_set): Likewise.
1041 (Dwp_output_file::Contribution): New type.
1042 (Dwp_output_file::Section::contributions): New data member.
1043 (Dwp_output_file::Cu_or_tu_set): Remove.
1044 (Dwp_output_file::Section::Section): New ctor.
1045 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1046 (Dwp_output_file::Dwp_index::Section_table): New type.
1047 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1048 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1049 parameter.
1050 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1051 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1052 (Dwp_output_file::Dwp_index::section_table): New member function.
1053 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1054 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1055 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1056 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1057 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1058 (Dwp_output_file::Dwp_index::section_table_): New data member.
1059 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1060 (Dwp_output_file::add_output_section): New member function.
1061 (Dwp_output_file::write_new_section): New member function.
1062 (Dwp_output_file::write_contributions): New member function.
1063 (Dwp_output_file::section_id_map_): New data member.
1064 (class Dwo_id_info_reader): Remove.
1065 (class Unit_reader): New class.
1066 (get_dwarf_section_name): New function.
1067 (Dwo_file::read_executable): Adjust initializations of class data.
1068 (Dwo_file::read): Add support for v2 package file format.
1069 (Dwo_file::read_unit_index): Likewise.
1070 (Dwo_file::sized_read_unit_index): Likewise.
1071 (Dwo_file::copy_section): Likewise.
1072 (Dwo_file::add_unit_set): Likewise.
1073 (Dwp_output_file::add_output_section): Likewise.
1074 (Dwp_output_file::add_contribution): Likewise.
1075 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1076 for empty slot.
1077 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1078 file format.
1079 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1080 slot.
1081 (Dwp_output_file::initialize): Remove unused function.
1082 (Dwp_output_file::finalize): Add support for v2 package file format.
1083 (Dwp_output_file::write_index): Likewise.
1084 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1085 function prototype.
1086
2500c017
CC
10872013-10-31 Cary Coutant <ccoutant@google.com>
1088
1089 * configure.ac: Fix check for -fmerge-constants.
1090 * configure.ac: Regenerate.
1091
dd0845d7
RM
10922013-10-30 Roland McGrath <mcgrathr@google.com>
1093
1094 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
1095 Correct 9-byte nop sequence to match what the assembler generates.
1096
b4f7960d
AM
10972013-10-30 Alan Modra <amodra@gmail.com>
1098
1099 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
1100 ppc64_local_entry_offset, ppc64_local_entry_offset,
1101 do_read_symbols): New functions.
1102 (Powerpc_relobj::e_flags_, st_other_): New vars.
1103 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
1104 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
1105 (Powerpc_relobj::e_flags_): New var.
1106 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
1107 and adjust for ELFv2.
1108 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
1109 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
1110 (Powerpc_dynobj::do_find_special_sections): Likewise.
1111 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
1112 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
1113 to ELFv2 local entry.
1114 (Target_powerpc::do_relax): No thread safe barriers needed for
1115 ELFv2.
1116 (Output_data_plt_powerpc::initial_plt_entry_size_,
1117 plt_entry_size): Delete. Replace all uses with
1118 first_plt_entry_offset() and plt_entry_size().
1119 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
1120 reserved_size parm. Update callers.
1121 (Output_data_plt_powerpc::entry_count): Update.
1122 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
1123 and use Target_powerpc::first_plt_entry_offset().
1124 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
1125 rename to plt_entry_size.
1126 (Output_data_plt_powerpc::add_ifunc_entry,
1127 add_local_ifunc_entry): Adjust reloc for ELFv2.
1128 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
1129 (glink_eh_frame_fde_64v2): New.
1130 (Stub_table::plt_call_size): Support ELFv2 sizing.
1131 (Output_data_glink::add_eh_frame): Use the new FDE.
1132 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
1133 (Stub_table::do_write): Write ELFv2 stubs and glink.
1134 (Target_powerpc::Relocate::relocate): Replaces nop after call
1135 with ld 2,24(1) and adjust local offset destination for ELFv2.
1136
f9c6b907
AM
11372013-10-30 Alan Modra <amodra@gmail.com>
1138
1139 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
1140 (Target_powerpc::Scan::global, local): Likewise.
1141 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
1142 on all ppc64 @h and @ha relocs.
1143
e84fe78f
AM
11442013-10-14 Alan Modra <amodra@gmail.com>
1145
1146 * output.h (Output_data_got::add_constant): Tidy.
1147 (Output_data_got::add_constant_pair): New function.
1148 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
1149 methods used so as to first call reserve_ent().
1150
679e4abf
RM
11512013-10-11 Roland McGrath <mcgrathr@google.com>
1152
44dcb735
RM
1153 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
1154 add_got_entry and add_got_entry_pair.
1155
13323c49
RM
1156 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
1157 (HAVE_PUBNAMES): Likewise.
1158 * configure: Regenerate.
1159
1496b446
RM
1160 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
1161 * testsuite/Makefile.in: Regenerate.
1162
cc84c10b
RM
1163 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
1164 Remove const from declaration.
1165 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
1166 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
1167 * output.h (Output_file_header): Remove const from member target_
1168 and corresponding constructor argument.
1169 * output.cc (Output_file_header::Output_file_header): Update prototype.
1170 (Output_file_header::do_sized_write): Use this->target_ in place
1171 of parameters()->target().
1172
52f66a2c
RM
1173 * testsuite/undef_symbol.cc (Foo::get_a): New method.
1174
2b64b551
RM
1175 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
1176 * configure: Regenerate.
1177 * Makefile.in: Regenerate.
1178 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
1179 * testsuite/merge_string_literals_2.c: Likewise.
1180 * testsuite/Makefile.am
1181 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
1182 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
1183 literal -fmerge-constants.
1184 * testsuite/Makefile.in: Regenerate.
1185
43819297
RM
1186 * i386.cc (Target_i386): Remove unused member dynbss_.
1187 * arm.cc (Target_arm): Likewise.
1188 * powerpc.cc (Target_powerpc): Likewise.
1189 * sparc.cc (Target_sparc): Likewise.
1190 * tilegx.cc (Target_tilegx): Likewise.
1191 * x86_64.cc (Target_x86_64): Likewise.
1192 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
1193 type_signature_, type_offset_.
1194 * plugin.h (Plugin_hook): Remove unused member layout_.
1195 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
1196 mapfile_.
1197 (Read_member): Remove unused members input_objects_, symtab_,
1198 mapfile_, layout_.
1199 (Check_library): Remove unused member symtab_.
1200 * archive.h (Lib_group): Remove unused member lib_.
1201 * archive.cc (Lib_group::Lib_group): Update initializer.
1202 * incremental.h (Incremental_binary): Remove unused member target_.
1203 (Incremental_script_entry): Removed unused member script_.
1204 * layout.h (Write_symbols_task): Remove unused member input_objects_.
1205 * icf.h (Icf): Remove unused member num_tracked_relocs.
1206
39d9ead7
RM
1207 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
1208 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
1209 its only use.
1210 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
1211
679e4abf
RM
1212 * archive.h: Use struct rather than class for forward declaration
1213 of Read_symbols_data.
1214
54de2ea6
CC
12152013-10-07 Cary Coutant <ccoutant@google.com>
1216
1217 PR gold/16010
1218 * testsuite/Makefile.am (icf_test): Fix dependencies.
1219 (icf_safe_test): Likewise.
1220 (icf_safe_so_test): Likewise.
1221 (large_symbol_alignment): Add empty _LDADD rule.
1222 * testsuite/Makefile.in: Regenerate.
1223
b14016f0
L
12242013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
1225
1226 PR gold/15927
1227 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
1228 relocation for R_X86_64_32 on x32.
1229
eb426534
RM
12302013-08-27 Roland McGrath <mcgrathr@google.com>
1231
1232 * output.cc (Output_segment::set_section_addresses): Take new
1233 Target* argument. If target->isolate_execinstr() and the segment
1234 is executable and starts at a target->abi_pagesize() boundary,
1235 pad its end out to a target->abi_pagesize() boundary with code fill.
1236 * output.h (Output_segment::set_section_addresses): Update decl.
1237 * layout.h (Layout::check_output_data_for_reset_values): Take new
1238 argument RELAX_OUTPUTS.
1239 (Layout): New member relax_output_list_.
1240 (Layout::add_relax_output): New method.
1241 * layout.cc (Layout::Layout): Update constructor.
1242 (Layout::reset_relax_output): New method.
1243 (Layout::clean_up_after_relaxation): Call it.
1244 (Layout::prepare_for_relaxation): Update caller.
1245 (Layout::set_segment_offsets): Update callers of set_section_addresses.
1246 Call reset_relax_output before re-processing segments for
1247 isolate_execinstr case.
1248 (Layout::write_data): Handle relax_output_list_.
1249 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
1250 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
1251
9aff4b7a
NC
12522013-08-23 Yuri Chornoivan <yurchor@ukr.net>
1253
1254 PR binutils/15834
1255 * object.h: Fix typos.
1256
93f8221c
RM
12572013-08-16 Roland McGrath <mcgrathr@google.com>
1258
1259 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
1260 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
1261
e44c3715
CC
12622013-08-07 Cary Coutant <ccoutant@google.com>
1263
1264 Revert support for v2 DWP files:
1265
1266 2013-03-01 Cary Coutant <ccoutant@google.com>
1267
1268 Add dwp support for v2 DWARF package file format.
1269 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1270 tu_length parameter. Adjust all callers.
1271 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1272 * dwp.cc: Include dwarf.h.
1273 (Section_bounds): New struct type.
1274 (Unit_set): New struct type.
1275 (Dwo_file::Dwo_file): Initialize new data member.
1276 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1277 Combine and rename to...
1278 (Dwo_file::read_unit_index): ...this.
1279 (Dwo_file::sized_read_compunit_index)
1280 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1281 (Dwo_file::sized_read_unit_index): ...this.
1282 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1283 parameters; add section_id parameter.
1284 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1285 (Dwo_file::add_unit_set): ...this.
1286 (Dwo_file::shndx_map_): Remove.
1287 (Dwo_file::sect_offsets_): New data member.
1288 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1289 (Dwp_output_file::add_section): Rename to...
1290 (Dwp_output_file::add_contribution): ...this.
1291 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1292 (Dwp_output_file::add_tu_set): Likewise.
1293 (Dwp_output_file::Contribution): New type.
1294 (Dwp_output_file::Section::contributions): New data member.
1295 (Dwp_output_file::Cu_or_tu_set): Remove.
1296 (Dwp_output_file::Section::Section): New ctor.
1297 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1298 (Dwp_output_file::Dwp_index::Section_table): New type.
1299 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1300 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1301 parameter.
1302 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1303 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1304 (Dwp_output_file::Dwp_index::section_table): New member function.
1305 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1306 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1307 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1308 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1309 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1310 (Dwp_output_file::Dwp_index::section_table_): New data member.
1311 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1312 (Dwp_output_file::add_output_section): New member function.
1313 (Dwp_output_file::write_new_section): New member function.
1314 (Dwp_output_file::write_contributions): New member function.
1315 (Dwp_output_file::section_id_map_): New data member.
1316 (class Dwo_id_info_reader): Remove.
1317 (class Unit_reader): New class.
1318 (get_dwarf_section_name): New function.
1319 (Dwo_file::read_executable): Adjust initializations of class data.
1320 (Dwo_file::read): Add support for v2 package file format.
1321 (Dwo_file::read_unit_index): Likewise.
1322 (Dwo_file::sized_read_unit_index): Likewise.
1323 (Dwo_file::copy_section): Likewise.
1324 (Dwo_file::add_unit_set): Likewise.
1325 (Dwp_output_file::add_output_section): Likewise.
1326 (Dwp_output_file::add_contribution): Likewise.
1327 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1328 for empty slot.
1329 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1330 file format.
1331 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1332 slot.
1333 (Dwp_output_file::initialize): Remove unused function.
1334 (Dwp_output_file::finalize): Add support for v2 package file format.
1335 (Dwp_output_file::write_index): Likewise.
1336 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1337 function prototype.
1338
c6905c28
CC
13392013-07-31 Cary Coutant <ccoutant@google.com>
1340
1341 * object.cc (Sized_relobj::do_output_section_address): New function.
1342 (Sized_relobj): Instantiate explicitly.
1343 * object.h (Object::output_section_address): New function.
1344 (Object::do_output_section_address): New function.
1345 (Sized_relobj::do_output_section_address): New function.
1346 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
1347
13482013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 1349 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
1350
1351 * parameters.cc (Parameters::entry): Return target-specific entry
1352 symbol name.
1353 * target.h (Target::entry_symbol_name): New function.
1354 (Target_info::entry_symbol_name): New data member.
1355
1356 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
1357 * i386.cc (Target_i386::i386_info): Likewise.
1358 (Target_i386_nacl::i386_nacl_info): Likewise.
1359 * sparc.cc (Target_sparc::sparc_info): Likewise.
1360 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
1361 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
1362 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
1363 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
1364
234d4ab8
SA
13652013-07-22 Sterling Augustine <saugustine@google.com>
1366
1367 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
1368 Convert parameter shndx to local variable. Add parameters symtab
1369 and symtab_size. Scan over section names. Find relocation
1370 section corresponding to current section. Create and initialize
1371 reloc_mapper_ and reloc_type_.
1372 (Dwarf_pubnames_table::read_header): Add assertion. Change
1373 unit_length to off_t. Initialize member unit_length_. Fill in field
1374 cu_offset_.
1375 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
1376 Initialize new fields unit_length_ and cu_offset_.
1377 (Dwarf_pubnames_table::read_section): Update prototype.
1378 (Dwarf_pubnames_table::cu_offset): New member function.
1379 (Dwarf_pubnames_table::subsection_size): Likewise.
1380 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
1381 New fields.
1382 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
1383 member functions public.
1384 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
1385 Update comment. Rework logic. Move repeated parts to...
1386 (Gdb_index_info_reader::read_pubtable): ...here. New function.
1387 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
1388 pubtypes_table_, and stmt_list_offset.
1389 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1390 Gdb_index::find_pubtype_offset,
1391 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
1392 (Gdb_index::pubnames_read): Update prototype and rework logic.
1393 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
1394 Forward declare.
1395 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
1396 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
1397 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
1398 Gdb_index::map_pubtable_to_dies):
1399 Declare functions.
1400 (Gdb_index::pubnames_read): Update declaration.
1401 (Gdb_index::Pubname_offset_map): New type.
1402 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
1403 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
1404 Gdb_index::stmt_list_offset): Declare.
1405 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
1406 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
1407 Gdb_index::pubtypes_offset_): Remove.
1408
a3ed37d8
RM
14092013-07-19 Roland McGrath <mcgrathr@google.com>
1410
1411 * options.h (General_options): Add -Trodata-segment option.
1412 * parameters.cc (Parameters::check_rodata_segment): New function.
1413 (Parameters::set_target_once): Call it.
1414 * parameters.h (Parameters): Declare it (private member function).
1415 * layout.cc (load_seg_unusable_for_headers): New function, broken
1416 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
1417 then validate rodata segment rather than text segment.
1418 (relaxation_loop_body): Call that.
1419 (is_text_segment): New function. Don't admit a non-executable
1420 segment if TARGET->isolate_execinstr().
1421 (set_segment_offsets): Call it. Honor -Trodata-segment option.
1422
eb5b4ded
CC
14232013-07-15 Shawn Landden <shawnlandden@gmail.com>
1424
1425 PR gold/15070
1426 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
1427 * nacl.h (Sniff_file::View::View): Request aligned view.
1428
4d5effb9
CC
14292013-07-11 Cary Coutant <ccoutant@google.com>
1430
1431 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
1432 correct BRLT entry size.
1433
ba8ca3e7
AM
14342013-07-03 Alan Modra <amodra@gmail.com>
1435
1436 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
1437 comment.
1438
267257d2
CC
14392013-07-01 Cary Coutant <ccoutant@google.com>
1440
1441 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
1442 reloc_type_.
1443 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
1444 (Dwarf_ranges_table::lookup_reloc): New function.
1445 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
1446 reloc_type_.
1447 (Dwarf_ranges_table::lookup_reloc): New function.
1448 (Dwarf_ranges_table::reloc_type_): New data member.
1449
06f30c9d
CC
14502013-06-27 Jing Yu <jingyu@google.com>
1451
1452 PR gold/15662
1453 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
1454 function.
1455 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
1456 (Target_powerpc::do_relax): Call the above.
1457
a2d7bf59
AM
14582013-06-27 Cary Coutant <ccoutant@google.com>
1459
1460 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1461 on garbage collected .opd section.
1462
14632013-06-27 Alan Modra <amodra@gmail.com>
1464
1465 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
1466 is non-zero.
1467 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
1468 (Target_powerpc::do_function_location): Likewise for loc->shndx.
1469
32364e50
CC
14702013-06-14 Cary Coutant <ccoutant@google.com>
1471
1472 * resolve.cc (Symbol::override_base): Don't override st_type
1473 from plugin placeholder symbols.
1474 (Symbol_table::resolve): Likewise.
1475 (Symbol_table::should_override): Don't complain about TLS mismatch
1476 if the TO symbol is a plugin placeholder.
1477 * testsuite/Makefile.am (plugin_test_tls): New test.
1478 * testsuite/Makefile.in: Regenerate.
1479 * testsuite/plugin_test_tls.sh: New test script.
1480 * testsuite/two_file_test_2_tls.cc: New test source.
1481 * testsuite/two_file_test_tls.cc: New test source.
1482
7fb47cc9
CC
14832013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
1484
1485 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
1486 the maximum segment alignment is larger than the page size.
1487 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
1488 correctly aligns the symbols with large alignemnt.
1489 * testsuite/Makefile.in: Regenerate.
1490 * testsuite/large_symbol_alignment.cc: New file.
1491
6934001a
CC
14922013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
1493 Sriraman Tallam <tmsriram@google.com>
1494
1495 * options.h (sort_section): New option.
1496 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
1497 Rename from Input_section_sort_section_name_special_ordering_compare.
1498 (Input_section_sort_section_name_compare): New struct.
1499 * output.cc (Output_section::Input_section_sort_section_name_compare::
1500 operator()): New function.
1501 (Output_section::sort_attached_input_sections): Use new sort function
1502 for .text if --sort-section=name is specified.
1503 * layout.cc (Layout::make_output_section):
1504 Add sorting by name when --sort-section=name is specified.
1505 * testsuite/Makefile.am (text_section_grouping): Test option
1506 --sort-section=name.
1507 * testsuite/Makefile.in: Regenerate.
1508 * testsuite/section_sorting_name.cc: New file.
1509 * testsuite/section_sorting_name.sh: New file.
1510
93acabad
CC
15112013-05-21 Cary Coutant <ccoutant@google.com>
1512
1513 * symtab.h (Symbol::is_cxx_vtable): New function.
1514 * target-reloc.h (relocate_section): Check for vtable symbol.
1515 * testsuite/Makefile.am (missing_key_func.sh): New test case.
1516 * testsuite/Makefile.in: Regenerate.
1517 * testsuite/missing_key_func.cc: New test source.
1518 * testsuite/missing_key_func.sh: New test script.
1519
60e8b3fc
CC
15202013-05-21 Cary Coutant <ccoutant@google.com>
1521
2b64b551
RM
1522 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
1523 type of enclosing symbol.
1524 (Relocate_info::location): Check symbol type when describing symbol.
1525 * object.h (Symbol_location_info): Remove unused line_number;
1526 add enclosing_symbol_type.
1527 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 1528
9df9de2c
CC
15292013-05-13 Cary Coutant <ccoutant@google.com>
1530
2b64b551
RM
1531 * configure.ac: Export DEFAULT_TARGET.
1532 * configure: Regenerate.
1533 * Makefile.in: Regenerate.
1534 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
1535 * testsuite/Makefile.in: Regenerate.
1536 * testsuite/debug_msg.sh: Delete duplicate tests.
1537 Don't check undef_int error message match for powerpc where the
1538 source file and line number aren't available.
9df9de2c 1539
bbc5ae17
RM
15402013-05-10 Roland McGrath <mcgrathr@google.com>
1541
1542 * options.h (General_options): Add --rosegment-gap option.
1543 * options.cc (finalize): --rosegment-gap implies --rosegment.
1544 * layout.cc (set_segment_offsets): Let user option override
1545 target->rosegment_gap().
1546
0c6e6c39
RM
15472013-05-10 Roland McGrath <mcgrathr@google.com>
1548
1549 * options.h (General_options): Remove leading space from help
1550 messages for -nostdlib and --rosegment.
1551
cde7cb01
MR
15522013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
1553
1554 PR ld/15365
1555 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
1556
f31ae5b8
AM
15572013-05-03 Alan Modra <amodra@gmail.com>
1558
1559 * merge.cc (Output_merge_string::do_add_input_section): Correct
1560 scan for number of strings. Rename vars to avoid shadowing.
1561 Include missing terminator in input_size_.
1562
d3a7cd45
L
15632013-05-01 H.J. Lu <hongjiu.lu@intel.com>
1564
1565 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
1566 Restore empty string handling.
1567
6ad3daba
CC
15682013-05-01 Cary Coutant <ccoutant@google.com>
1569
1570 * stringpool.cc (Stringpool_template::new_key_offset): Fix
1571 uninitialized warning.
1572
e31908b6
CC
15732013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
1574
1575 * output.cc (Output_section::add_merge_input_section): Allow
1576 to merge sections if the alignment is more than character size.
1577 * merge.h (Output_merge_string::Output_merge_string): Remove
1578 assert.
1579 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
1580 only not-null strings. Check the alignment of strings.
1581 * stringpool.h
1582 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
1583 alignment as the argument.
1584 (Stringpool_template<Stringpool_char>::addralign_): New class member.
1585 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
1586 Align non-zero length strings according to the addralign_.
1587 (Stringpool_template<Stringpool_char>::set_string_offsets):
1588 Updating offsets according to the given alignment.
1589 * testsuite/Makefile.am (text_section_grouping): Test if string
1590 literals are getting merged.
1591 * testsuite/Makefile.in: Regenerate.
1592 * testsuite/merge_string_literals_1.c: New file.
1593 * testsuite/merge_string_literals_2.c: Ditto.
1594 * testsuite/merge_string_literals.sh: Ditto.
1595
0e804863
ILT
15962013-04-26 Ian Lance Taylor <iant@google.com>
1597
1598 * target-reloc.h (relocate_section): If the reloc offset is out of
1599 range, pass VIEW as NULL to relocate.relocate.
1600 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
1601 * i386.cc (Target_i386::Relocate::relocate): Likewise.
1602 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
1603 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
1604 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
1605 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
1606
e7c5ea40
CC
16072013-04-26 Geoff Pike <gpike@chromium.org>
1608
1609 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
1610 * layout.cc (Hash_task): New class.
1611 (Layout::queue_build_id_tasks): New function.
1612 (Layout::write_build_id): Handle single-thread portion of build ID
1613 computation. (In some cases, all of it is single-threaded.) Replace
1614 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
1615 functionality in fewer lines of code.
1616 * layout.h (Layout::queue_build_id_tasks): New function declaration.
1617 * options.h (General_options): make "--build-id" default to tree
1618 rather than sha1. Add two new options related to --build-id=tree:
1619 --build-id-chunk-size-for-treehash and
1620 --build-id-min-file-size-for-treehash.
1621 * Makefile.am: add testing of --build-id=tree and related new options
1622 (these tests will be invoked by "make check").
1623 * Makefile.in: Regenerate.
1624
49926cd0
AM
16252013-04-25 Alan Modra <amodra@gmail.com>
1626
1627 * configure.tgt: Add powerpcle and powerpc64le.
1628
a4034750
AM
16292013-04-22 Alan Modra <amodra@gmail.com>
1630
1631 PR gold/15355
1632 * layout.cc (Layout::segment_precedes): Allow more than one
1633 segment with the same type and flags.
1634
e79c84aa
CC
16352013-04-15 Cary Coutant <ccoutant@google.com>
1636
1637 * layout.cc (Layout::set_relocatable_section_offsets): Don't
1638 allocate space in file for BSS sections.
1639
2199fbe7
CC
16402013-04-15 Cary Coutant <ccoutant@google.com>
1641
1642 * script-sections.cc (Orphan_output_section): Reset address
1643 to zero after each orphaned section for relocatable links.
1644
502e8a84
CC
16452013-04-15 Cary Coutant <ccoutant@google.com>
1646
a4034750
AM
1647 * symtab.cc (Symbol_table::sized_write_globals): Subtract
1648 section starting address for relocatable link.
1649 * testsuite/Makefile.am (script_test_11): New test.
1650 * testsuite/Makefile.in: Regenerate.
1651 * testsuite/script_test_11.c: New source file.
1652 * testsuite/script_test_11.t: New linker script.
502e8a84 1653
0cfdc767
AM
16542013-04-13 Alan Modra <amodra@gmail.com>
1655
1656 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
1657 owner when sections are not adjacent and exceed group size.
1658 (Target_powerpc::group_sections): Handle corner case.
1659 (Target_powerpc::Branch_info::make_stub): Handle case where
1660 stub table doesn't exist due to branches in non-exec sections.
1661 (Target_powerpc::Relocate::relocate): Likewise.
1662
6830ee24
AM
16632013-04-11 Alan Modra <amodra@gmail.com>
1664
1665 PR gold/15354
1666 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
1667 .branch_lt to match bfd ld. Adjust comments throughout file.
1668
54a3d865
ILT
16692013-04-04 Ian Lance Taylor <iant@google.com>
1670
1671 GCC PR c++/56840
1672 * object.cc (do_layout_deferred_sections): Handle .eh_frame
1673 sections before checking whether they are included in the link.
1674
9993ba11
ST
16752013-03-29 Sriraman Tallam <tmsriram@google.com>
1676
1677 * archive.cc (Archive::get_elf_object_for_member): Create the elf
1678 object before calling the plugin claim_file handler. Pass the elf
1679 object of the archive to the plugin. Delete the elf object if the
1680 plugin claims the file.
1681
ebacd51e
AM
16822013-03-21 Alan Modra <amodra@gmail.com>
1683
1684 * layout.cc (Layout::set_segment_offsets): Accept writable .text
1685 segment when omagic.
1686
117be58f
AM
16872013-03-21 Alan Modra <amodra@gmail.com>
1688
1689 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
1690 comparison warning.
1691 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
1692 uninitialized" warning.
1693
32e2b61d
AM
16942013-03-20 Alan Modra <amodra@gmail.com>
1695
1696 * symtab.h (Symbol::clear_version): New function.
1697 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
1698 is_needed by weak references. Clear version for symbols defined
1699 in as-needed objects that are not needed.
1700
b3ccdeb5
AM
17012013-03-15 Alan Modra <amodra@gmail.com>
1702
1703 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
1704 static and public. Add report_err param. Return false for data refs.
1705 (Target_powerpc::rela_dyn_section): New overloaded function.
1706 (Target_powerpc::plt_, iplt_): Elucidate.
1707 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
1708 (Output_data_plt_powerpc::do_write): Don't write .iplt.
1709 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
1710 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
1711 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
1712 push_branch and make_plt_entry for ifunc syms when
1713 reloc_needs_plt_for_ifunc.
1714 (Target_powerpc::Relocate::relocate): Don't use plt entry value
1715 for ifunc unless reloc_needs_plt_for_ifunc.
1716
ad3d8a2f
AM
17172013-03-15 Alan Modra <amodra@gmail.com>
1718
1719 * gc.h (gc_process_relocs): Don't look through function descriptors.
1720 * icf.cc (get_section_contents): Do so here instead.
1721
4d9aa155
AM
17222013-03-13 Alan Modra <amodra@gmail.com>
1723
1724 * powerpc.cc (is_branch_reloc): Forward declare.
1725 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
1726 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
1727 false for 64-bit, true for 32-bit non-branch relocs.
1728 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
1729 * testsuite/Makefile.am (icf_test): Use linker map file instead of
1730 nm output.
1731 (icf_safe_test): Generate linker map file as well as nm output.
1732 (icf_safe_so_test): Likewise.
1733 * testsuite/Makefile.in: Regenerate.
1734 * testsuite/icf_test.sh: Parse linker map file to determine
1735 section folding.
1736 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
1737 * testsuite/icf_safe_so_test.sh: Likewise.
1738 (X86_32_or_ARM_specific_safe_fold): Merge into..
1739 (arch_specific_safe_fold): ..this.
1740 (X86_64_specific_safe_fold): Delete unused function.
1741
57420c20
AM
17422013-03-12 Alan Modra <amodra@gmail.com>
1743
1744 * gc.h (gc_process_relocs): Look through function descriptors
1745 to determine shndx, symvalue and addend used by ICF. Tidy
1746 variable duplication.
1747
dc3714f3
AM
17482013-03-11 Alan Modra <amodra@gmail.com>
1749
1750 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
1751 * layout.cc (Layout_task_runner::run): ..to here.
1752 * symtab.h (struct Symbol_location): Extract from..
1753 (class Symbol_table): ..here.
1754 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
1755 * target.h (class Target): Add function_location and
1756 do_function_location functions.
1757 (class Sized_target): Add do_function_location.
1758 * object.h (class Sized_relobj_file): Move find_shdr..
1759 (class Object): ..to here.
1760 * object.cc: Likewise. Update to suit. Instantiate.
1761 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
1762 * powerpc.cc (class Powerpc_dynobj): New.
1763 (Target_powerpc::do_function_location): New function.
1764 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
1765 (Powerpc_dynobj::do_read_symbols): New function.
1766 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
1767
956b03bb
ILT
17682013-03-08 Ian Lance Taylor <iant@google.com>
1769
1770 * options.cc (General_options::string_to_object_format): Accept
1771 "default".
1772
4bead2d5
AM
17732013-03-08 Alan Modra <amodra@gmail.com>
1774
1775 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
1776 pointer to Post_fde.
1777 (struct Post_fde): Move definition to here..
1778 * ehframe.cc (struct Post_fde): ..from here.
1779 (Cie::write): Don't alloc Post_fde.
1780 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
1781
02e60bf7
AM
17822013-03-07 Alan Modra <amodra@gmail.com>
1783
1784 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
1785 relocation referencing .LC0.
1786 * testsuite/discard_locals_test.sh: Remove FIXMEs.
1787
8343f03a
AM
17882013-03-07 Alan Modra <amodra@gmail.com>
1789
1790 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
1791 always_inline. Add assembly for powerpc to avoid GOT.
1792
3366d57c
AM
17932013-03-07 Alan Modra <amodra@gmail.com>
1794
1795 * testsuite/script_test_10.sh: Don't test .bss section
1796 header number.
1797
6c77229c
AM
17982013-03-06 Alan Modra <amodra@gmail.com>
1799
1800 * powerpc.cc (class Powerpc_relobj): Move some member functions.
1801 (Target_powerpc::symval_for_branch): Add symtab param. Update
1802 all callers. Handle folded sections.
1803 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
1804 to Powerpc_relobj.
1805 (Global_symbol_visitor_opd::operator()): Likewise.
1806
a39e4af6
AM
18072013-03-04 Alan Modra <amodra@gmail.com>
1808
1809 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
1810 * testsuite/Makefile.in: Regenerate.
1811
d5834edb
CC
18122013-03-01 Cary Coutant <ccoutant@google.com>
1813
1814 Add dwp support for v2 DWARF package file format.
1815 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
1816 tu_length parameter. Adjust all callers.
1817 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
1818 * dwp.cc: Include dwarf.h.
1819 (Section_bounds): New struct type.
1820 (Unit_set): New struct type.
1821 (Dwo_file::Dwo_file): Initialize new data member.
1822 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
1823 Combine and rename to...
1824 (Dwo_file::read_unit_index): ...this.
1825 (Dwo_file::sized_read_compunit_index)
1826 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
1827 (Dwo_file::sized_read_unit_index): ...this.
1828 (Dwo_file::copy_section): Remove section_name, is_str_offsets
1829 parameters; add section_id parameter.
1830 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
1831 (Dwo_file::add_unit_set): ...this.
1832 (Dwo_file::shndx_map_): Remove.
1833 (Dwo_file::sect_offsets_): New data member.
1834 (Dwp_output_file::Dwp_output_file): Initialize new data members.
1835 (Dwp_output_file::add_section): Rename to...
1836 (Dwp_output_file::add_contribution): ...this.
1837 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
1838 (Dwp_output_file::add_tu_set): Likewise.
1839 (Dwp_output_file::Contribution): New type.
1840 (Dwp_output_file::Section::contributions): New data member.
1841 (Dwp_output_file::Cu_or_tu_set): Remove.
1842 (Dwp_output_file::Section::Section): New ctor.
1843 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
1844 (Dwp_output_file::Dwp_index::Section_table): New type.
1845 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
1846 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
1847 parameter.
1848 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
1849 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
1850 (Dwp_output_file::Dwp_index::section_table): New member function.
1851 (Dwp_output_file::Dwp_index::section_table_end): New member function.
1852 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
1853 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
1854 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
1855 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
1856 (Dwp_output_file::Dwp_index::section_table_): New data member.
1857 (Dwp_output_file::Dwp_index::section_mask_): New data member.
1858 (Dwp_output_file::add_output_section): New member function.
1859 (Dwp_output_file::write_new_section): New member function.
1860 (Dwp_output_file::write_contributions): New member function.
1861 (Dwp_output_file::section_id_map_): New data member.
1862 (class Dwo_id_info_reader): Remove.
1863 (class Unit_reader): New class.
1864 (get_dwarf_section_name): New function.
1865 (Dwo_file::read_executable): Adjust initializations of class data.
1866 (Dwo_file::read): Add support for v2 package file format.
1867 (Dwo_file::read_unit_index): Likewise.
1868 (Dwo_file::sized_read_unit_index): Likewise.
1869 (Dwo_file::copy_section): Likewise.
1870 (Dwo_file::add_unit_set): Likewise.
1871 (Dwp_output_file::add_output_section): Likewise.
1872 (Dwp_output_file::add_contribution): Likewise.
1873 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
1874 for empty slot.
1875 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
1876 file format.
1877 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
1878 slot.
1879 (Dwp_output_file::initialize): Remove unused function.
1880 (Dwp_output_file::finalize): Add support for v2 package file format.
1881 (Dwp_output_file::write_index): Likewise.
1882 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
1883 function prototype.
1884
a68a081d
CC
18852013-03-01 Cary Coutant <ccoutant@google.com>
1886
1887 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
1888 function into class definition in header file.
1889 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
1890 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
1891 New function.
1892 (Dwarf_info_reader::check_buffer): Move here from .cc file.
1893
9d5781f8
AM
18942013-02-28 Alan Modra <amodra@gmail.com>
1895
1896 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
1897 * target.cc (Target::do_plt_fde_location): New function.
1898 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
1899 accessor function, and constructor param.
1900 (struct Post_fde, Post_fdes): Declare.
1901 (Cie::write): Add post_fdes param.
1902 * ehframe.cc (Fde::write): Use plt_fde_location.
1903 (struct Post_fde): Define.
1904 (Cie::write): Stash FDEs added post merge mapping.
1905 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
1906 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
1907 (Eh_frame::do_sized_write): Arrange to write post map FDES after
1908 other FDEs.
1909 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
1910 (Target_powerpc::has_glink): New function.
1911 (Target_powerpc::do_relax): Add eh_frame info for stubs.
1912 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
1913 glink_eh_frame_fde_32, default_fde): New data.
1914 (Stub_table::eh_frame_added_): New var.
1915 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
1916 Make const.
1917 (Stub_table::add_eh_frame): New function.
1918 (Output_data_glink::add_eh_frame): New function.
1919 (Target_powerpc::make_glink_section): Call add_eh_frame.
1920
214383dd
ILT
19212013-02-15 Ian Lance Taylor <iant@google.com>
1922
1923 * options.h (DEFINE_uint64_alias): Define.
1924 (class General_options): Add -Ttext-segment as an alias for
1925 -Ttext.
1926
91c2b899
AM
19272013-02-15 Alan Modra <amodra@gmail.com>
1928
1929 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
1930 (Stub_table::do_write): ..here, two places.
1931 (Stub_table::plt_call_size): Use it here too.
1932
20e2a8aa
ILT
19332013-02-11 Ian Lance Taylor <iant@google.com>
1934
1935 * descriptors.cc (Descriptors::close_all): New function.
1936 * descriptors.h (class Descriptors): Declare close_all.
1937 (close_all_descriptors): New inline function.
1938 * plugin.cc: Include "descriptors.h".
1939 (Plugin_manager::cleanup): Call close_all_descriptors.
1940
8952bc69
AM
19412013-02-06 Alan Modra <amodra@gmail.com>
1942
1943 * README: Update coding style link.
1944
29bd8b6b
CC
19452013-01-28 Cary Coutant <ccoutant@google.com>
1946
a4034750
AM
1947 * dwp.cc (File_list): New typedef.
1948 (Dwo_name_info_reader): New class.
1949 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
1950 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
1951 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
1952 (Dwo_file::read_executable): New function.
1953 (Dwo_file::read): Move common setup code to ...
1954 (Dwo_file::make_object): ... here.
1955 (dwp_options): Add --exec/-e.
1956 (usage): Likewise.
1957 (main): Likewise.
29bd8b6b 1958
c6ac678d
ST
19592013-01-24 Sriraman Tallam <tmsriram@google.com>
1960
1961 * layout.cc (Layout::layout): Check for option text_reorder.
1962 (Layout::make_output_section): Ditto.
1963 * options.h (text_reorder): New option.
1964 * output.cc (Input_section_sort_compare): Remove special ordering
1965 of section names.
1966 (Output_section::
1967 Input_section_sort_section_name_special_ordering_compare::
1968 operator()): New function.
1969 (Output_section::sort_attached_input_sections): Use new sort function
1970 for .text.
1971 * output.h (Input_section_sort_section_name_special_ordering_compare):
1972 New struct.
1973 * testsuite/Makefile.am (text_section_grouping): Test option
1974 --no-text-reorder
1975 * testsuite/Makefile.in: Regenerate.
1976 * testsuite/text_section_grouping.sh: Check order of functions without
1977 default text reordering.
1978
50701cc1
MF
19792013-01-18 Mike Frysinger <vapier@gentoo.org>
1980
1981 * options.h (General_options): Change default to true for new_dtags.
1982
b1b00fcc
MF
19832013-01-18 Mike Frysinger <vapier@gentoo.org>
1984
1985 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
1986 when enable_new_dtags is false. Only add DT_RUNPATH when
1987 enable_new_dtags is true.
1988
ec5b8187
AM
19892013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
1990
1991 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
1992 used in declaration and definition consistent.
1993 (Target_powerpc::symval_for_branch): Ditto.
1994
a880d4c4
ST
19952013-01-16 Sriraman Tallam <tmsriram@google.com>
1996
1997 * testsuite/plugin_final_layout.cc: Fix comment.
1998
7c381248
ST
19992013-01-16 Sriraman Tallam <tmsriram@google.com>
2000
2001 * layout.cc (Layout::layout): Do not do default sorting for
2002 text sections when section ordering is specified.
2003 (make_output_section): Ditto.
2004 * testsuite/plugin_final_layout.cc: Name the function sections
2005 to catch reordering issues.
2006
e2458743
AM
20072013-01-15 Alan Modra <amodra@gmail.com>
2008
2009 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
2010 plt-thread-safe.
2011
431ed302
AM
20122013-01-15 Alan Modra <amodra@gmail.com>
2013
2014 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
2015 * testsuite/Makefile.in: Regenerate.
2016
0ec6429b
AM
20172013-01-14 Alan Modra <amodra@gmail.com>
2018
2019 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
2020 * testsuite/Makefile.in: Regenerate.
2021
0bf402d5
ILT
20222013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
2023
36af3926 2024 PR bfd/14430
0bf402d5
ILT
2025 Fix mingw gold build with plugins enabled
2026 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
2027 * configure.ac: Export DLOPEN_LIBS and add headers check.
2028 * plugin.cc: Handle non-dlfcn case.
2029 * Makefile.in: Regenerate.
2030 * config.in: Regenerate.
2031 * configure: Regenerate.
2032 * testsuite/Makefile.in: Regenerate.
2033
9e9143bc
ST
20342013-01-09 Sriraman Tallam <tmsriram@google.com>
2035
2036 * output.h (sort_attached_input_sections): Change to be public.
2037 * script-sections.cc
2038 (Output_section_definition::set_section_addresses): Sort
2039 attached input sections according to section order before linker
2040 script assigns section addresses.
2041 (Orphan_output_section::set_section_addresses): Sort
2042 attached input sections according to section order before linker
2043 script assigns section addresses.
2044 * Makefile.am (final_layout.sh): Use a simple linker script to
2045 check if section ordering still works.
2046 * Makefile.in: Regenerate.
2047
679af368
ILT
20482013-01-09 Ben Cheng <bccheng@google.com>
2049
2050 * arm.cc (Target_arm::attributes_accept_div): New function.
2051 (Target_arm::attributes_forbid_div): New function.
2052 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
2053 attribute using the same new functions as what bfd/elf32_arm.c
2054 does.
2055
3136a00e
CC
20562013-01-07 Cary Coutant <ccoutant@google.com>
2057
2058 PR gold/14993
2059 * output.cc (Output_section::add_input_section): For incremental
2060 updates, don't track input sections that are allocated from patch
2061 space.
2062
f2a6224b
L
20632013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2064 Ian Lance Taylor <iant@google.com>
2065
2066 PR gold/14897
2067 * configure.ac (--enable-ld): Removed.
2068 (install_as_default): Set to yes only for --enable-gold=default
2069 or --disable-ld.
2070 * configure: Regenerated.
2071
4f46f626
L
20722013-01-07 H.J. Lu <hongjiu.lu@intel.com>
2073
2074 * options.h (General_options): Add -fuse-ld= for GCC linker
2075 option compatibility.
2076
26e4ef59
CC
20772013-01-04 Cary Coutant <ccoutant@google.com>
2078
2079 * configure.ac: Fix typo restoring CXXFLAGS.
2080 * configure: Regenerate.
2081
3d587466
CC
20822013-01-04 Cary Coutant <ccoutant@google.com>
2083
4f46f626
L
2084 * testsuite/Makefile.am (CXXLINK_S): New macro.
2085 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
2086 * testsuite/Makefile.in: Regenerate.
3d587466 2087
44db6695
L
20882013-01-02 H.J. Lu <hongjiu.lu@intel.com>
2089
2090 * version.cc (print_version): Update copyright year to 2013.
2091
edcac0c1
ILT
20922012-12-20 Ian Lance Taylor <iant@google.com>
2093
2094 * layout.cc (Layout::special_ordering_of_input_section): New
2095 function.
2096 (Layout::layout): If input section requires special ordering, must
2097 sort input sections.
2098 (Layout::make_output_section): May sort .text input sections.
2099 (Layout::is_section_name_prefix_grouped): Remove.
2100 * layout.h (class Layout): Declare
2101 special_ordering_of_input_section. Don't declare
2102 is_section_name_prefix_grouped.
2103 * output.cc (Output_section::add_input_section): Revert last
2104 change.
2105 (Output_section::Input_section_sort::match_file_name): Don't crash
2106 if called on output section data.
2107 (Output_section::Input_section_sort_compare): Sort based on
2108 special ordering.
2109 (Output_section::Input_section_sort_section_order_index_compare):
2110 Revert last patch.
2111 (Output_section::sort_attached_input_sections): Likewise.
2112
28f2a4ac
ST
21132012-12-18 Sriraman Tallam <tmsriram@google.com>
2114
edcac0c1 2115 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
2116 * layout.h (Layout::is_section_name_prefix_grouped): New function.
2117 * output.cc (Output_section::add_input_section): Check if section
2118 name contains special prefix. Keep input sections to sort such
2119 sections.
2120 (Output_section::Input_section_sort_section_order_index_compare
2121 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
2122 (Output_section::sort_attached_input_sections): Add condition to
2123 Input_section_entry constructor call.
28f2a4ac
ST
2124 * testsuite/Makefile.am (text_section_grouping): New test.
2125 * testsuite/Makefile.in: Regenerate.
2126 * testsuite/text_section_grouping.cc: New file.
2127 * testsuite/text_section_grouping.sh: New file.
2128
5bf135a7
NC
21292012-12-17 Nick Clifton <nickc@redhat.com>
2130
2131 * Makefile.am: Add copyright notice.
2132 * NEWS: Likewise.
2133 * README: Likewise.
2134 * configure.ac: Likewise.
2135 * ftruncate.c: Likewise.
2136 * Makefile.in: Regenerate.
2137
59965708
CC
21382012-12-14 Cary Coutant <ccoutant@google.com>
2139
a4034750
AM
2140 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
2141 --no-as-needed flag.
2142 (exception_separate_shared_12_test): Likewise.
2143 (incremental_copy_test): Likewise.
2144 * testsuite/Makefile.in: Regenerate.
59965708 2145
2a77e2ab
CC
21462012-12-14 Cary Coutant <ccoutant@google.com>
2147
2148 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
2149 (Dwp_output_file::Dwp_index::enter_set): Add assert.
2150
e3deeb9c
AM
21512012-12-12 Alan Modra <amodra@gmail.com>
2152
2153 * powerpc.cc (class Track_tls): New.
2154 (class Relocate, class Scan): Inherit Track_tls.
2155 (Target_powerpc::Scan::local, global): Track tls optimization
2156 and avoid creating plt entry for __tls_get_addr if all uses
2157 are optimized away.
2158 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
2159
d8f5a274
AM
21602012-12-12 Alan Modra <amodra@gmail.com>
2161
2162 * options.h (General_options): Add --toc-sort/--no-toc-sort.
2163 Replace no_toc_optimize with toc_optimize.
2164 * output.h (Output_section::input_sections): Provide non-const variant.
2165 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
2166 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
2167 accessors.
2168 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
2169 (class Sort_toc_sections): New.
2170 (Target_powerpc::do_finalize_sections): Sort toc sections.
2171 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
2172
4c8a1de1
RM
21732012-12-10 Roland McGrath <mcgrathr@google.com>
2174
2175 * testsuite/binary_unittest.cc (read_all): New function.
2176 (Sized_binary_test): Use it instead of ::read.
2177 * fileread.cc (do_read): Don't assume pread always reads the whole
2178 amount in a single call.
2179
edc27beb
AM
21802012-12-10 Alan Modra <amodra@gmail.com>
2181
2182 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
2183 Set EM_PPC64 or EM_PPC here.
2184 (Target_selector_powerpc::do_recognize): Delete.
2185
906b9150
AM
21862012-12-10 Alan Modra <amodra@gmail.com>
2187
2188 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
2189 stub_table_.
2190 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
2191
418c15ae
RM
21922012-12-07 Roland McGrath <mcgrathr@google.com>
2193
2194 * testsuite/binary_unittest.cc (Sized_binary_test):
2195 Use open_descriptor rather than ::open.
2196
decdd3bc
AM
21972012-12-07 Alan Modra <amodra@gmail.com>
2198
2199 * powerpc.cc (Stub_table::do_write): Delete redundant Address
2200 typedef and invalid_address constant.
2201 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
2202 instantiate constants.
2203
db399005
ILT
22042012-12-06 Roland McGrath <mcgrathr@google.com>
2205
2206 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
2207 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
2208 * aclocal.m4: Regenerate.
2209 * configure: Regenerate.
2210 * Makefile.in: Regenerate.
2211 * testsuite/Makefile.in: Regenerate.
2212
aba6bc71
AM
22132012-12-07 Alan Modra <amodra@gmail.com>
2214
2215 * options.h (General_options): Add no_toc_optimize.
2216 * powerpc.cc (ok_lo_toc_insn): New function.
2217 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
2218
9e69ed50
AM
22192012-12-06 Alan Modra <amodra@gmail.com>
2220
2221 * options.h (General_options): Add plt_align, plt_static_chain,
2222 plt_thread_safe. Update stub_group_size help text.
2223 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
2224 for new plt_thread_safe_ var.
2225 (use_plt_offset): Correct comments.
2226 (Target_powerpc::do_relax): Look for thread creation symbols to
2227 determine default plt_thread_safe value. Clear plt call stubs
2228 as well as branch stubs each iteration.
2229 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
2230 insn constants.
2231 (l, hi, ha, write_insn): Move earlier.
2232 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
2233 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
2234 plt stubs too.
2235 (Stub_table::update_size): Adjust.
2236 (Stub_table::prev_size, set_prev_size): Delete.
2237 (Stub_table::stub_align): Let --plt-align affect result.
2238 (Stub_table::plt_call_size): Calculate sizes for various stubs.
2239 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
2240 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
2241 (Stub_table::do_write): Support more stub variants.
2242
f43ba157
AM
22432012-12-04 Alan Modra <amodra@gmail.com>
2244
2245 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
2246 (Target_powerpc::do_define_standard_symbols): New function.
2247
34171bc5
AM
22482012-12-03 Alan Modra <amodra@gmail.com>
2249
2250 * output.h: Formatting, whitespace.
2251
dc9589e9 22522012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
2253
2254 * layout.h (Layout::get_executable_sections): Declare.
2255 * layout.cc (Layout::get_executable_sections): New function.
2256 * arm.cc (Target_arm::group_sections): Use it.
2257 (Arm_output_section::group_sections): Delete now redundant test.
2258 * output.cc (Output_reloc::Output_reloc): Add is_relative.
2259 param to handle relative relocs.
2260 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
2261 (Output_data_reloc::add_absolute): Adjust.
2262 (Output_data_reloc::add_relative): New function.
2263 (Output_data::reset_data_size): New function.
2264 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
2265 (Output_section::set_addralign): New function.
2266 (Output_section::checkpoint_set_addralign): New function.
2267 (Output_section::clear_section_offsets_need_adjustment): New function.
2268 (Output_section::input_sections): Make public.
2269 * powerpc.cc (class Output_data_brlt_powerpc): New.
2270 (class Stub_table, class Stub_control): New.
2271 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
2272 stub_table_, set_stub_table, stub_table): New vectors and accessor
2273 functions.
2274 (Target_powerpc::do_may_relax, do_relax, push_branch,
2275 new_stub_table, stub_tables, brlt_section, group_sections,
2276 add_branch_lookup_table, find_branch_lookup_table,
2277 write_branch_lookup_table, make_brlt_section): New functions.
2278 (Target_powerpc::struct Sort_sections, class Branch_info): New.
2279 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
2280 branch_info_): New vars.
2281 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
2282 make call stubs here.
2283 (Output_data_glink): Remove all call stub handling from this class.
2284 (Target_powerpc::Scan::local, global): Save interesting branch
2285 relocs and relocs for ifunc. Adjust calls to plt entry functions.
2286 (Target_powerpc::do_finalize_sections): Only make reg save/restore
2287 functions on final link.
2288 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
2289 Handle long branch destinations too.
2290 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
2291 do_plt_address_for_local): Adjust lookup of plt call stubs.
2292
627b30b7
AM
22932012-11-30 Alan Modra <amodra@gmail.com>
2294
2295 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
2296 relocs against protected symbols when building 32-bit shared libs.
2297
40b469d7
AM
22982012-11-30 Alan Modra <amodra@gmail.com>
2299
2300 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
2301 param. Call got_section() to make .got. Update all callers
2302 and their callers and so on.
2303
bb66a627
AM
23042012-11-30 Alan Modra <amodra@gmail.com>
2305
2306 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
2307 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
2308 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
2309 value if it already exists.
2310
d2cf1c6c
L
23112012-11-19 H.J. Lu <hongjiu.lu@intel.com>
2312
2313 PR gold/14858
2314 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
2315
edccdf7c
RM
23162012-11-14 Roland McGrath <mcgrathr@google.com>
2317
2318 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
2319 than bfc instruction for data sandboxing.
2320
6febeb74
AM
23212012-11-08 Alan Modra <amodra@gmail.com>
2322
2323 * po/POTFILES.in: Regenerate.
2324
0a6f1bf2
AM
23252012-11-05 Alan Modra <amodra@gmail.com>
2326
2327 * configure.ac: Apply 2012-09-10 change to config.in here.
2328 * configure: Regenerate.
2329
26a4e9cb
AM
23302012-11-05 Alan Modra <amodra@gmail.com>
2331
2332 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
2333 (struct Opd_ent): Use "Address" rather than "Offset".
2334 (Output_data_got_powerpc::got_base_offset): Return Valtype.
2335 (Target_powerpc::got_section): Make public.
2336 (Target_powerpc::scan_relocs): Move code setting symbols..
2337 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
2338 Create _SDA_BASE_ only when referenced.
2339
cc928013
RM
23402012-11-02 Roland McGrath <mcgrathr@google.com>
2341
2342 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
2343 from last change.
2344
50ed5eb1
RM
23452012-11-01 Roland McGrath <mcgrathr@google.com>
2346
62fe925a
RM
2347 * target.h (Sized_target::relocate_relocs): Use Elf_Off
2348 for offset_in_output_section parameter.
2349 (Sized_target::relocate_special_relocatable): Likewise.
2350 * arm.cc (Target_arm::relocate_relocs): Likewise.
2351 (Target_arm::relocate_special_relocatable): Likewise.
2352 * i386.cc (Target_i386::relocate_relocs): Likewise.
2353 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
2354 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
2355 * target-reloc.h (relocate_relocs): Likewise.
2356 * testsuite/testfile.cc (Target_test): Likewise.
2357 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
2358 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
2359
2360 * system.h: Move inclusion of <clocale> to after <libintl.h> in
2361 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
2362
2363 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
2364 parameter, which is unused in the [!F_SETFD] case.
2365
50ed5eb1
RM
2366 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
2367 SYMNDX to off_t before comparing it to this->data_size().
2368 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
2369 * incremental.cc (Output_section_incremental_inputs::do_write):
2370 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
2371
2cadc0bf
RM
2372 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
2373
3bfcb652
NC
23742012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
2375
2376 * gold.cc (Target_arm::do_adjust_elf_header): Add the
2377 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
2378 in EABI_VER5.
2379
c1a8d56e
CC
23802012-10-29 Cary Coutant <ccoutant@google.com>
2381
2382 * dwp.cc (usage): Add file and exit status parameters;
2383 add --help and --version options.
2384 (print_version): New function.
2385 (main): Add --help and --version options.
2386
b2490a7b
L
23872012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2388
2389 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
2390 final_layout_sequence.txt.
2391 * testsuite/Makefile.in: Regenerated.
2392
aa543512
L
23932012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2394
2395 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
2396 COMPILE generated by automake.
2397 (LINK1): Likewise.
2398 (CXXCOMPILE1): Likewise.
2399 (CXXLINK1): Likewise.
2400 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
2401 (LINK): Likewise.
2402 (CXXCOMPILE): Likewise.
2403 (CXXLINK): Likewise.
2404 * testsuite/Makefile.in: Regenerated.
2405
d361fafb
L
24062012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2407
2408 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
2409 on bad fwrite return.
2410
598c7410
L
24112012-10-25 H.J. Lu <hongjiu.lu@intel.com>
2412
2413 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
2414 on val.
2415
35c813e2
CC
24162012-10-23 Cary Coutant <ccoutant@google.com>
2417
2418 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
2419 * testsuite/Makefile.in: Regenerate.
2420 * testsuite/dwp_test.h: New source file.
2421 * testsuite/dwp_test_1.cc: New source file.
2422 * testsuite/dwp_test_1.s: New source file.
2423 * testsuite/dwp_test_1.sh: New source file.
2424 * testsuite/dwp_test_1b.cc: New source file.
2425 * testsuite/dwp_test_1b.s: New source file.
2426 * testsuite/dwp_test_2.cc: New source file.
2427 * testsuite/dwp_test_2.s: New source file.
2428 * testsuite/dwp_test_2.sh: New source file.
2429 * testsuite/dwp_test_main.cc: New source file.
2430 * testsuite/dwp_test_main.s: New source file.
2431
77429909
CC
24322012-10-23 Cary Coutant <ccoutant@google.com>
2433
2434 * dwp.h: New header file.
2435 * dwp.cc: New source file.
2436 * gold.h: Move shared declarations to system.h.
2437 * system.h: New header file.
2438 * Makefile.am: Add dwp.
2439 * Makefile.in: Regenerate.
2440
ed5d6712
CC
24412012-10-23 Cary Coutant <ccoutant@google.com>
2442
2443 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
2444 Dwarf_info_reader::read_from_pointer.
2445 (Dwarf_pubnames_table::read_header): Likewise.
2446 (Dwarf_pubnames_table::next_name): Likewise.
2447 (Dwarf_die::read_attributes): Likewise.
2448 (Dwarf_die::skip_attributes): Likewise.
2449 (Dwarf_info_reader::read_from_pointer): New function template.
2450 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
2451 (Dwarf_pubnames_table): Likewise.
2452 (Dwarf_info_reader::read_from_pointer): New function template.
2453 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
2454 Dwarf_pubnames_table ctor.
2455
8787852d
CC
24562012-10-23 Cary Coutant <ccoutant@google.com>
2457
2458 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
2459 abbrev_shndx.
2460 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
2461 abbrev_shndx_.
2462 (Dwarf_info_reader::set_abbrev_shndx): New method.
2463 (Dwarf_info_reader::abbrev_shndx_): New data member.
2464
9fc236f3
CC
24652012-10-23 Cary Coutant <ccoutant@google.com>
2466
2467 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
2468 from object, not parameters.
2469 (Dwarf_info_reader::parse): Likewise.
2470 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
2471 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
2472 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
2473 methods.
2474
effe8365
CC
24752012-10-23 Cary Coutant <ccoutant@google.com>
2476
2477 * fileread.cc (Input_file::Input_file): New constructor.
2478 * fileread.h (class Input_file): Add new constructor.
2479
1698990d
AM
24802012-10-18 Alan Modra <amodra@gmail.com>
2481
2482 PR gold/14727
2483 * object.cc (Relobj::is_section_name_included): Also match
2484 .sdata personality section.
2485
168a4726
AM
24862012-10-18 Alan Modra <amodra@gmail.com>
2487
2488 * target-reloc.h (class Default_comdat_behavior): New, package up..
2489 (get_comdat_behaviour): ..this.
2490 (relocate_section): Add Relocate_comdat_behavior template arg,
2491 adjust code to suit.
2492 * arm.cc (Target_arm::relocate_section): Adjust to suit.
2493 (Target_arm::scan_reloc_section): Likewise.
2494 * i386.cc (Target_i386::relocate_section): Likewise.
2495 * sparc.cc (Target_sparc::relocate_section): Likewise.
2496 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
2497 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
2498 * powerpc.cc (class Relocate_comdat_behavior): New.
2499 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
2500 gold::relocate_section with new template arg.
2501
acc276d8
AM
25022012-10-18 Alan Modra <amodra@gmail.com>
2503
2504 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
2505 dynamic relocs for GOT_TPREL got entries, without symbol if
2506 resolving locally.
2507 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
2508 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
2509 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
2510
e10f9870
AM
25112012-10-17 Alan Modra <amodra@gmail.com>
2512
2513 PR gold/14726
2514 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
2515
ae034989
ST
25162012-10-16 Sriraman Tallam <tmsriram@google.com>
2517
2518 * layout.cc (Layout::include_section): Keep sections marked
2519 SHF_EXCLUDE when doing relocatable links.
2520
f3a0ed29
AM
25212012-10-16 Alan Modra <amodra@gmail.com>
2522
2523 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
2524 (Target_powerpc::do_finalize_sections): Call it.
2525 (Output_data_save_res): New class and supporting functions.
2526 (Target_powerpc::symval_for_branch): Only look up .opd entry for
2527 normal symbols defined in object files.
2528
c6de8ed4
AM
25292012-10-12 Alan Modra <amodra@gmail.com>
2530
2531 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
2532 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
2533 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
2534 section if scan_opd_relocs not yet called.
2535 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
2536
03e25981
AM
25372012-10-12 Alan Modra <amodra@gmail.com>
2538
2539 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2540 add_local_ifunc_entry): Revert last change.
2541 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
2542
c9824451
AM
25432012-10-05 Alan Modra <amodra@gmail.com>
2544
2545 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
2546 do_plt_address_for_global): New functions.
2547 (Output_data_got_powerpc::do_write): Don't segfault when linking
2548 statically.
2549 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
2550 add_local_ifunc_entry): Return true on adding entry..
2551 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
2552 glink->add_entry call. Remove unused symtab param. Adjust calls.
2553 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
2554 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
2555 set up symbols here.
2556 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
2557 syms here. Do so even when no .iplt. Don't segfault when linking
2558 statically.
2559 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
2560 new variants without reloc param.
2561 (Glink_sym_ent::Glink_sym_ent): Likewise.
2562 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
2563 reloc when refs will resolve to plt call stub.
2564 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
2565 R_PPC_PLTREL24 to resolve locally.
2566 (Target_powerpc::Scan::global): Correct ifunc handling.
2567 (Target_powerpc::Relocate::relocate): Correct local sym glink
2568 lookup. Don't destroy "value" when we have a plt call stub,
2569 and when checking plt call validity.
2570 (Target_powerpc::do_dynsym_value): Simplify.
2571
19fec8c1
AM
25722012-10-05 Alan Modra <amodra@gmail.com>
2573
2574 * i386.cc (Output_data_plt_i386::address_for_global,
2575 address_for_local): Add plt offset to returned value. Adjust uses.
2576 * sparc.cc (Output_data_plt_sparc::address_for_global,
2577 address_for_local): Likewise.
2578 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
2579 address_for_local): Likewise.
2580 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
2581 address_for_local): Likewise.
2582 * target.h (Target::plt_address_for_global, plt_address_for_local):
2583 Update comment.
2584 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
2585 (Output_data_got::Got_entry::write): Nor here.
2586 * output.h: Comment fix.
2587
e867b647
WL
25882012-10-02 Jiong Wang <jiwang@tilera.com>
2589
2590 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
2591 global_offset_table_ value for larget got.
2592 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
2593
e5d5f5ed
AM
25942012-09-29 Alan Modra <amodra@gmail.com>
2595
2596 * powerpc.cc (Target_powerpc::iplt_): New output section.
2597 (Target_powerpc::iplt_section, make_iplt_section,
2598 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
2599 (Target_powerpc::make_plt_entry): Handle ifunc syms.
2600 Target_powerpc::plt_entry_count): Count iplt entries too.
2601 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
2602 reloc section in constructor. New params.
2603 (Target_powerpc::make_plt_section): Create reloc section here instead.
2604 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
2605 functions.
2606 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
2607 (Output_data_glink::add_entry, find_entry): New functions to
2608 deal with local syms.
2609 (Glink_sym_ent): Add support for local syms.
2610 (Output_data_glink::do_write): Handle ifunc plt entries.
2611 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2612 (Target_powerpc::Scan::local, global): Handle ifunc syms.
2613 (Target_powerpc::Relocate::relocate): Likewise.
2614 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
2615
ec4dbad3
AM
26162012-09-25 Alan Modra <amodra@gmail.com>
2617
2618 * object.h (Sized_relobj_file::adjust_local_symbol,
2619 do_adjust_local_symbol): New functions.
2620 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
2621 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
2622 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
2623 and irregular opd entry spacing.
2624 (Powerpc_relobj::do_read_relocs): Add opd size checks.
2625 (Global_symbol_visitor_opd): New functor.
2626 (Target_powerpc::do_finalize_sections): Omit global symbols defined
2627 on deleted opd entries.
2628
5c0b3823
WL
26292012-09-15 Jiong Wang <jiwang@tilera.com>
2630
2631 * tilegx.cc: New file.
2632 * Makefile.am (TARGETSOURCES): Add tilegx.cc
2633 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
2634 * configure.tgt: Add entries for tilegx*.
2635 * configure.ac: Likewise.
2636 * Makefile.in: Rebuild.
2637 * configure: Likewise.
2638 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
2639 tilegx.
2640
bfdfa4cd
AM
26412012-09-13 Alan Modra <amodra@gmail.com>
2642
2643 * target-reloc.h (scan_relocs): Call scan.local for relocs
2644 against symbols in discarded sections. Pass is_discarded
2645 param.
2646 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
2647 Add is_discarded param.
2648 * powerpc (Target_powerpc::Scan::local): Likewise. Use
2649 is_discarded to flag opd entry as discarded. Don't emit dyn
2650 relocs on such entries.
2651 (Target_powerpc::Scan::global): Similarly detect and handle
2652 such opd entries.
2653 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
2654 opd_ent_. Update all uses.
2655 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
2656 (Target_powerpc::relocate_section): Zero out discarded opd
2657 entry relocs.
2658
d77a0555
ILT
26592012-09-12 Ian Lance Taylor <iant@google.com>
2660
2661 PR gold/14570
2662 * output.cc: Rename Output_data_got template parameter from size
2663 to got_size for all functions. Compile all variants of
2664 Output_data_got.
2665 (Output_data_got::Got_entry::write): Correct use of size for
2666 symbol value. Use local_is_tls rather than casting to
2667 Sized_relobj_file.
2668 * object.h (class Object): Add local_is_tls and do_local_is_tls.
2669 (class Sized_relobj_file): Add do_local_is_tls.
2670 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
2671
815a1205
AM
26722012-09-11 Alan Modra <amodra@gmail.com>
2673
2674 PR gold/14566
2675 * layout.cc (Layout::set_segment_offsets): When using
2676 common-page-size alignment, ensure we are on a new max-page-size
2677 page.
2678 * output.cc (Output_segment::set_section_addresses): Use
2679 abi_pagesize, not common_pagesize for relro boundary.
2680 (Output_segment::set_offset): Likewise.
2681
bd73a62d
AM
26822012-09-11 Alan Modra <amodra@gmail.com>
2683
2684 * output.h (Output_data_got::add_global_tls, add_local_tls,
2685 add_local_tls_pair): New functions.
2686 (Output_data_got::add_local_pair_with_rel): Remove second
2687 reloc param. Expand comment.
2688 (Output_data_got::Got_entry): Rename use_plt_offset_ to
2689 use_plt_or_tls_offset_, similarly for constructor param.
2690 (Output_data_got::Got_entry::write): Add got_index param.
2691 * output.cc (Output_data_got::add_global_tls, add_local_tls,
2692 add_local_tls_pair): New functions.
2693 (Output_data_got::Got_entry::write): Handle tls symbols
2694 with use_plt_or_tls_offset_ set specially.
2695 (Output_data_got::add_local_pair_with_rel): Only one reloc.
2696 (Output_data_got::do_write): Replace iterator with index, pass
2697 index to entry write function.
2698 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
2699 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
2700 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
2701 call.
2702 * i386.cc (Target_i386::Scan::local): Likewise.
2703 * sparc.cc (Target_sparc::Scan::local): Likewise.
2704 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
2705 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
2706 do_tls_offset_for_global): New functions.
2707 (Target_powerpc::Scan::local): Correct TLS relocations and got
2708 entry values.
2709 (Target_powerpc::Scan::global): Don't emit unnecessary
2710 dynamic relocations on TLS GOT entries.
2711
00716ab1
AM
27122012-09-10 Matthias Klose <doko@ubuntu.com>
2713
2714 * config.in: Disable sanity check for kfreebsd.
2715
c891b3f9
SA
27162012-09-10 Sterling Augustine <saugustine@google.com>
2717
2718 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
2719 (Gdb_index::pubtypes_read): New parameter.
2720 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
2721 to calls.
2722 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
2723 pubtypes_object_.
2724
e81fea4d
AM
27252012-09-09 Alan Modra <amodra@gmail.com>
2726
2727 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
2728 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
2729 * gc.h (gc_process_relocs): Call target gc_add_reference.
2730 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
2731 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
2732 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
2733 unnecessary cast.
2734 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
2735 to cater for when we don't need code offset. Update use.
2736 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
2737 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
2738 set_opd_valid): New functions.
2739 (Target_powerpc::do_gc_add_reference): New function.
2740 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
2741 stashed refs.
2742 (Target_powerpc::do_gc_mark_symbol): New function.
2743
d2d60eef
CC
27442012-09-06 Cary Coutant <ccoutant@google.com>
2745
2746 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
2747 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
2748 (Dwarf_die::skip_attributes): Likewise.
2749 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
2750 * testsuite/gdb_index_test.cc (inline_func_1): New function.
2751 (main): Call it.
2752 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
2753
32ed4573
L
27542012-09-05 H.J. Lu <hongjiu.lu@intel.com>
2755
2756 * testsuite/script_test_3.t: Add .got.plt output section
2757 statement.
2758 * testsuite/script_test_4.t: Likewise.
2759
f4baf0d4
AM
27602012-09-05 Alan Modra <amodra@gmail.com>
2761
2762 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
2763 update all uses and lose "enum" when using type.
2764
864a1b56
AM
27652012-09-05 Alan Modra <amodra@gmail.com>
2766
2767 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
2768 * configure: Regenerate.
2769 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
2770 (plugin_final_layout.stdout): Likewise.
2771 (memory_test): Set page sizes to 0x1000.
2772 * testsuite/Makefile.in: Regenerate.
2773 * testsuite/discard_locals_test.sh: Add FIXME comment.
2774 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
2775 * testsuite/pr14265.t: Add .got output section statement.
2776 * testsuite/script_test_2.t: Likewise.
2777 * testsuite/script_test_3.t: Likewise.
2778 * testsuite/script_test_4.t: Likewise.
2779 * testsuite/script_test_5.t: Likewise.
2780 * testsuite/script_test_6.t: Likewise.
2781 * testsuite/script_test_7.t: Likewise.
2782 * testsuite/script_test_9.t: Likewise.
2783
3ea0a085
AM
27842012-09-05 Alan Modra <amodra@gmail.com>
2785
2786 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
2787 (Powerpc_relocate_functions::Status): New typedef.
2788 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2789 (Target_powerpc::Scan::local): Handle REL64.
2790 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
2791 for REL32 and REL64.
2792 (Target_powerpc::symval_for_branch): New function, extracted from..
2793 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
2794 checks. Report overflow errors.
2795
7404fe1b
AM
27962012-09-05 Alan Modra <amodra@gmail.com>
2797
2798 * object.h (Sized_relobj_file::emit_relocs): Delete.
2799 (Sized_relobj_file::emit_relocs_reltype): Delete.
2800 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
2801 relocate_relocs for --emit-relocs.
2802 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
2803 * output.h: Update comment.
2804 (Output_segment::first_section): New function.
2805 (Output_segment::first_section_load_address): Use first_section.
2806 * output.cc (Output_segment::first_section): New function extracted..
2807 (Output_segment::first_section_load_address): ..from here. Delete.
2808 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
2809 * target.h (Sized_target::relocate_for_relocatable): Likewise.
2810 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
2811 adjust call to target.h function.
2812 * i386.cc (Target_i386): Likewise.
2813 * sparc.cc (Target_sparc): Likewise.
2814 * x86_64.cc (Target_x86_64): Likewise.
2815 * powerpc.cc (Target_powerpc): Likewise.
2816 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
2817 first tls section has section symbol for optimised local dynamic
2818 output relocs.
2819 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
2820 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
2821 optimised tls code.
2822 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
2823 Rename to relocate_relocs. Update error message.
2824
957564c9
AS
28252012-09-04 Andreas Schwab <schwab@linux-m68k.org>
2826
2827 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
2828 --just-symbols.
2829
dd93cd0a
AM
28302012-08-31 Alan Modra <amodra@gmail.com>
2831
2832 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
2833 (Powerpc_relobj::toc_base_offset): New stub function.
2834 (Target_powerpc): Add tp_offset, dtp_offset. Rename
2835 got_mod_index_offset to tlsld_got_offset. Update all refs.
2836 (Target_powerpc::Relocate::enum skip_tls): New.
2837 (Target_powerpc::call_tls_get_addr_): New var.
2838 (Target_powerpc::is_branch_reloc): Move to file scope.
2839 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
2840 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
2841 New functions.
2842 (Target_powerpc::enum Got_type): Delete old values, add new ones.
2843 (powerpc_info): Correct common_pagesize for ppc64.
2844 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
2845 (Powerpc_relocate_functions): Add overflow check enums and functions.
2846 Add non-shift version of rela, rela_ua. Delete all rel public
2847 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
2848 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
2849 addr16_ha3, addr14 functions.
2850 (Output_data_got_powerpc::add_constant_pair): New function.
2851 (Output_data_got_powerpc::got_base_offset): Likewise.
2852 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
2853 (instruction constants): Sort, add some more.
2854 (Output_data_glink::do_write): Add and use Address typedef. Use
2855 object->toc_base_offset() stub for 64-bit.
2856 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
2857 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
2858 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
2859 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
2860 Always treat .opd relocs as against locally defined symbol.
2861 Correct condition for RELATIVE relocs.
2862 (Target_powerpc::do_finalize_sections): Test for NULL sections.
2863 (Target_powerpc::Relocate::relocate): Use plt call stub as value
2864 for 32-bit syms with a plt entry. Correct ppc64 toc base
2865 calculations. Handle TLS relocs, and more. Add overflow
2866 checking and adjust for Powerpc_relocate_functions changes.
2867 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
2868 Reinstate --emit-relocs code with FIXME.
2869
a1373b60
AM
28702012-08-30 Alan Modra <amodra@gmail.com>
2871
2872 * layout.cc (Layout::set_segment_offsets): Set p_align to
2873 abi_pagesize, not common_pagesize.
2874 (Layout::relaxation_loop_body): Similarly use abi_pagesize
2875 to determine whether file header can go in segment.
2876
703d02da
AM
28772012-08-30 Alan Modra <amodra@gmail.com>
2878
2879 * output.h (Output_reloc::Output_reloc <output section>): Add
2880 is_relative param. Adjust calls.
2881 (Output_reloc::add_output_section_relative): New functions.
2882 * output.cc (Output_reloc::Output_reloc <output section>): Handle
2883 is_relative.
2884 (Output_reloc::symbol_value): Handle SECTION_CODE.
2885
16164a6b
ST
28862012-08-24 Sriraman Tallam <tmsriram@google.com>
2887
2888 * gold.cc (queue_middle_tasks): Call layout again when unique
2889 segments for sections is desired.
2890 * layout.cc (Layout::Layout): Initialize new members.
2891 (Layout::get_output_section_flags): New function.
2892 (Layout::choose_output_section): Call get_output_section_flags.
2893 (Layout::layout): Make output section for mapping to a unique segment.
2894 (Layout::insert_section_segment_map): New function.
2895 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 2896 output sections marked so.
16164a6b
ST
2897 (Layout::segment_precedes): Check for unique segments when sorting.
2898 * layout.h (Layout::Unique_segment_info): New struct.
2899 (Layout::Section_segment_map): New typedef.
2900 (Layout::insert_section_segment_map): New function.
2901 (Layout::get_output_section_flags): New function.
2902 (Layout::is_unique_segment_for_sections_specified): New function.
2903 (Layout::set_unique_segment_for_sections_specified): New function.
2904 (Layout::unique_segment_for_sections_specified_): New member.
2905 (Layout::section_segment_map_): New member.
2906 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
2907 Rename is_gc_pass_one to is_pass_one.
2908 Rename is_gc_pass_two to is_pass_two.
2909 Rename is_gc_or_icf to is_two_pass.
2910 Check for which pass based on whether symbols data is present.
2911 Make it two pass when unique segments for sections is desired.
2912 * output.cc (Output_section::Output_section): Initialize new
2913 members.
2914 * output.h (Output_section::is_unique_segment): New function.
2915 (Output_section::set_is_unique_segment): New function.
2916 (Output_section::is_unique_segment_): New member.
2917 (Output_section::extra_segment_flags): New function.
2918 (Output_section::set_extra_segment_flags): New function.
2919 (Output_section::extra_segment_flags_): New member.
2920 (Output_section::segment_alignment): New function.
2921 (Output_section::set_segment_alignment): New function.
2922 (Output_section::segment_alignment_): New member.
2923 (Output_segment::Output_segment): Initialize is_unique_segment_.
2924 (Output_segment::is_unique_segment): New function.
2925 (Output_segment::set_is_unique_segment): New function.
2926 (Output_segment::is_unique_segment_): New member.
2927 * plugin.cc (allow_unique_segment_for_sections): New function.
2928 (unique_segment_for_sections): New function.
2929 (Plugin::load): Add new functions to transfer vector.
2930 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
2931 * Makefile.in: Regenerate.
2932 * testsuite/plugin_final_layout.sh: Check if unique segment
2933 functionality works.
2934 * testsuite/plugin_section_order.c (onload): Check if new interfaces
2935 are available.
2936 (allow_unique_segment_for_sections): New global.
2937 (unique_segment_for_sections): New global.
2938 (claim_file_hook): Call allow_unique_segment_for_sections.
2939 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 2940
1e2bee4f
CC
29412012-08-22 Cary Coutant <ccoutant@google.com>
2942
2943 * layout.cc (Layout::include_section): Don't assert on GROUP
2944 sections with --emit-relocs.
2945
1d5dfe78
CC
29462012-08-21 Cary Coutant <ccoutant@google.com>
2947
2948 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
2949 if --export-dynamic-symbol names an undef symbol.
2950
c9269dff
AM
29512012-08-18 Alan Modra <amodra@gmail.com>
2952
2953 * powerpc.cc: Formatting and white space.
2954 (Powerpc_relobj): Rename got2_section_ to special_.
2955 Add opd_ent_shndx_ and opd_ent_off_ vectors.
2956 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
2957 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
2958 (Target_powerpc): Add Address typedef and invalid_address. Use
2959 throughout.
2960 (Target_powerpc::is_branch_reloc): New function.
2961 (Powerpc_relocate_functions): Add Address typedef, use throughout.
2962 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
2963 for dst_mask, value and addend.
2964 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
2965 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
2966 (Output_data_glink::do_write): Correct toc base. Don't try to use
2967 uint16_t for 24-bit offset. Use get_output_section_offset and
2968 check return.
2969 (Target_powerpc::Scan::local): Handle more relocs.
2970 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
2971 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
2972 Plug in toc restoring insn after plt calls. Translate branches
2973 to function descriptor symbols to corresponding entry point.
2974 (Target_powerpc::relocate_for_relocatable): Check return from
2975 get_output_section_offset.
2976 * symtab.h: Comment typo.
2977
b1759dce
ILT
29782012-08-14 Ian Lance Taylor <iant@google.com>
2979
2980 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
2981 unsupported_relocal_local to call unsupported_reloc_global.
2982
b9b2ae8b
NC
29832012-08-14 Nick Clifton <nickc@redhat.com>
2984
2985 PR ld/14265
2986 * script-sections.cc (Sections_element::output_section_name): Add
2987 keep return parameter.
2988 (Output_section_element::match_name): Add keep return parameter.
2989 Return the value of the keep_ member.
2990 * script-sections.h (class Output_section): Update
2991 output_section_name prototype.
2992 * layout.cc (Layout::keep_input_section): New public member
2993 function.
2994 (Layout::choose_output_section): Pass keep parameter to
2995 output_section_name.
2996 * layout.h (class Layout): Add keep_input_section.
2997 * object.cc (Sized_relobj_file::do_layout): Check for kept input
2998 sections.
2999 * testsuite/Makefile.am: Add a test.
3000 * testsuite/Makefile.in: Regenerate.
3001 * testsuite/pr14265.c: Source file for the test.
3002 * testsuite/pr14265.t: Linker script for the test.
3003 * testsuite/pr14265.sh: Shell script for the test.
3004
921b5322
AM
30052012-08-14 Alan Modra <amodra@gmail.com>
3006
3007 * target.h (Target::output_section_name): New function.
3008 (Target::do_output_section_name): New function.
3009 * layout.cc (Layout::choose_output_section): Call the above.
3010 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
3011
6ce78956
AM
30122012-08-14 Alan Modra <amodra@gmail.com>
3013
3014 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
3015 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
3016 for replace_constant call.
3017 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
3018 (Output_data_glink::do_print_to_mapfile): New function.
3019 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
3020 (Target_powerpc::Relocate::relocate): Likewise.
3021
d1a8cabd
AM
30222012-08-14 Alan Modra <amodra@gmail.com>
3023
3024 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
3025 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
3026 (Output_data_glink::add_entry,find_entry): Remove shndx param.
3027 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
3028 all references to shndx_. Handle special case for R_PPC_PLTREL24
3029 here.
3030 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
3031 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
3032 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
3033 here.
3034 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
3035 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
3036
d83ce4e3
AM
30372012-08-12 Alan Modra <amodra@gmail.com>
3038
3039 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
3040 (glink insn constants): Use uint32_t.
3041 (Output_data_glink::add_entry): Use insert, not [] operator.
3042
cf43a2fe
AM
30432012-08-11 Alan Modra <amodra@gmail.com>
3044
3045 * object.h (Sized_relobj_file::find_shdr): New function.
3046 (Sized_relobj_file::find_special_sections): New function.
3047 * object.cc (Sized_relobj_file::find_shdr): New function.
3048 (Sized_relobj_file::find_eh_frame): Use find_shdr.
3049 (Sized_relobj_file::find_special_sections): New function, split out..
3050 (Sized_relobj_file::do_read_symbols): ..from here.
3051 * output.h (Output_data_got::replace_constant): New function.
3052 (Output_data_got::num_entries): New function.
3053 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
3054 (Output_data_got::got_offset): Protected rather than private.
3055 (Output_data_got::replace_got_entry): New function.
3056 * output.cc (Output_data_got::replace_got_entry): New function.
3057 * powerpc.cc (class Powerpc_relobj): New.
3058 (class Powerpc_relocate_functions): Delete all psymval variants or
3059 convert to value,addend type. Delete pcrela, pcrela_unaligned.
3060 Implement _ha functions using corresponding _hi function.
3061 (Powerpc_relobj::find_special_sections): New function.
3062 (Target_powerpc::do_make_elf_object): New function.
3063 (class Output_data_got_powerpc): New.
3064 (class Output_data_glink): New.
3065 (class Powerpc_scan_relocatable_reloc): New.
3066 Many more changes througout file.
3067
3c892704
NC
30682012-08-09 Nick Clifton <nickc@redhat.com>
3069
3070 * po/vi.po: Updated Vietnamese translation.
3071
82435b3b
ILT
30722012-08-07 Ian Lance Taylor <iant@google.com>
3073
3074 * layout.cc (Layout::add_target_dynamic_tags): If
3075 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
3076 plt_rel.
3077
a6dc81d2
NC
30782012-07-30 Nick Clifton <nickc@redhat.com>
3079
3080 * po/gold.pot: Updated template.
3081 * po/es.po: Updated Spanish translation.
3082
f1415016
CC
30832012-07-18 Cary Coutant <ccoutant@google.com>
3084
3085 PR gold/14344
3086 * configure.ac: Add check for -gpubnames support.
3087 * configure: Regenerate.
3088 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
3089 support; force -gno-pubnames.
3090 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
3091 support.
3092 (gdb_index_test_4): New test.
3093 * testsuite/Makefile.in: Regenerate.
3094 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
3095 * testsuite/gdb_index_test_2.sh: Likewise.
3096 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
3097 * testsuite/gdb_index_test_4.sh: New script.
3098 * testsuite/gdb_index_test_comm.sh: New script with common code;
3099 don't look for space after colon.
3100
b7fd7c37
ST
31012012-07-16 Sriraman Tallam <tmsriram@google.com>
3102
3103 * gold.cc (queue_middle_tasks): Update function order only after
3104 deferred objects due to plugins are processed.
3105
1f3212db
ILT
31062012-07-11 Ian Lance Taylor <iant@google.com>
3107
3108 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
3109 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
3110 (Target_arm::scan_reloc_for_stub): Likewise.
3111 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
3112 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
3113 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
3114 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
3115 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
3116
81c82a68
ILT
31172012-07-10 Dodji Seketeli <dodji@redhat.com>
3118 Ian Lance Taylor <iant@google.com>
3119
3120 PR gold/14309
3121 * configure.ac: Test whether std::tr1::hash<off_t> works.
3122 * gold.h: Add a specialization for std::tr1::hash<off_t> if
3123 needed.
3124 * output.h (class Output_fill): Add virtual destructor.
3125 * configure, config.in: Rebuild.
3126
eabc84f4
RM
31272012-06-22 Roland McGrath <mcgrathr@google.com>
3128
3129 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
3130
370e30b6
RÁE
31312012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
3132
3133 * plugin.cc (Plugin::load): Handle position independent executables.
3134
fb1b895d
CC
31352012-06-06 Cary Coutant <ccoutant@google.com>
3136
3137 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
3138 add .debug_macro.
3139 (lines_only_debug_sections): Likewise.
3140 (gdb_fast_lookup_sections): New static array.
3141 (is_gdb_debug_section): Rename formal parameter.
3142 (is_lines_only_debug_section): Likewise.
3143 (is_gdb_fast_lookup_section): New function.
3144 (Layout::include_section): Check for ".zdebug_" prefix; pass
3145 section name suffix to is_gdb_debug_section, et al.; check for
3146 fast-lookup sections when building .gdb_index.
3147 * options.h (--strip-debug-gdb): Update GDB version number.
3148
7c0640fa
CC
31492012-06-06 Cary Coutant <ccoutant@google.com>
3150
3151 * configure.ac: Add check for fallocate.
3152 * configure: Regenerate.
3153 * config.in: Regenerate.
3154
3155 * options.h (class General_options): Add --mmap-output-file and
3156 --posix-fallocate options.
3157 * output.cc: (posix_fallocate): Remove; replace with...
3158 (gold_fallocate): New function.
3159 (Output_file::map_no_anonymous): Call gold_fallocate.
3160 (Output_file::map): Check --mmap-output-file option.
3161
2a49eb69
DK
31622012-06-05 Jing Yu <jingyu@google.com>
3163
3164 * gold.h (textdomain): Add do {} to empty while(0).
3165 (bindtextdomain): Likewise.
3166
fad072ac
CC
31672012-06-04 Cary Coutant <ccoutant@google.com>
3168
3169 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
3170 has_dynsym_index.
3171
8cc69fb6
ST
31722012-05-25 Sriraman Tallam <tmsriram@google.com>
3173
3174 * symtab.cc (Symbol_table::define_special_symbol):
3175 Initialize *poldsym to prevent uninitialized variable errors.
3176
1be75daa
CC
31772012-05-23 Cary Coutant <ccoutant@google.com>
3178
3179 * layout.cc (Layout::section_name_mapping): Add rules to handle
3180 exact match on .data.rel.ro.local or .data.rel.ro.
3181 (Layout::output_section_name): Check for exact matches.
3182
9b689de0
CC
31832012-05-23 Cary Coutant <ccoutant@google.com>
3184
3185 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
3186 more carefully.
3187
b24fdbf5
CC
31882012-05-22 Cary Coutant <ccoutant@google.com>
3189
3190 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
3191 object before exporting symbol.
3192
e550e1a2
L
31932012-05-21 H.J. Lu <hongjiu.lu@intel.com>
3194
3195 * testsuite/tls_test.cc: Include "config.h" first.
3196 * testsuite/tls_test_c.c: Likewise.
3197
df7b86aa
NC
31982012-05-17 Daniel Richard G. <skunk@iskunk.org>
3199 Nick Clifton <nickc@redhat.com>
3200
3201 PR 14072
3202 * configure.in: Add check that sysdep.h has been included before
3203 any system header files.
3204 * configure: Regenerate.
3205 * config.in: Regenerate.
3206
1007b503
CC
32072012-05-14 Cary Coutant <ccoutant@google.com>
3208
3209 * layout.cc (Layout::make_output_section): Mark .tdata section
3210 as RELRO.
3211 * testsuite/relro_test.cc: Add a TLS variable.
3212
fd885f3a
L
32132012-05-10 H.J. Lu <hongjiu.lu@intel.com>
3214
3215 PR gold/14091
3216 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
3217 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
3218 R_X86_64_64.
3219
80f5885c
CC
32202012-05-08 Cary Coutant <ccoutant@google.com>
3221
3222 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
3223 (lines_only_debug_sections): Likewise.
3224
2e702c99
RM
32252012-05-02 Roland McGrath <mcgrathr@google.com>
3226
3227 * nacl.cc: New file.
3228 * nacl.h: New file.
3229 * Makefile.am (CCFILES, HFILES): Add them.
3230 * Makefile.in: Regenerate.
3231 * i386.cc (Output_data_plt_i386_nacl): New class.
3232 (Output_data_plt_i386_nacl_exec): New class.
3233 (Output_data_plt_i386_nacl_dyn): New class.
3234 (Target_i386_nacl): New class.
3235 (Target_selector_i386_nacl): New class.
3236 (target_selector_i386): Use it instead of Target_selector_i386.
3237 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
3238 (Target_x86_64_nacl): New class.
3239 (Target_selector_x86_64_nacl): New class.
3240 (target_selector_x86_64, target_selector_x32): Use it instead of
3241 Target_selector_x86_64.
3242 * arm.cc (Output_data_plt_arm_nacl): New class.
3243 (Target_arm_nacl): New class.
3244 (Target_selector_arm_nacl): New class.
3245 (target_selector_arm, target_selector_armbe): Use it instead of
3246 Target_selector_arm.
3247
3248 * target-select.cc (select_target): Take new Input_file* and off_t
3249 arguments, pass them on to recognize method of selector.
3250 * object.cc (make_elf_sized_object): Update caller.
3251 * parameters.cc (parameters_force_valid_target): Likewise.
3252 * incremental.cc (make_sized_incremental_binary): Likewise.
3253 * target-select.h: Update decl.
3254 (Target_selector::recognize): Take new Input_file* argument,
3255 pass it on to do_recognize.
3256 (Target_selector::do_recognize): Take new Input_file* argument.
3257 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
3258 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
3259 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
3260 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
3261
3262 * target.h (Target::Target_info): New members isolate_execinstr
3263 and rosegment_gap.
3264 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
3265 * arm.cc (Target_arm::arm_info): Update initializer.
3266 * i386.cc (Target_i386::i386_info): Likewise.
3267 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
3268 * sparc.cc (Target_sparc::sparc_info): Likewise.
3269 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
3270 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
3271 * layout.cc (Layout::attach_allocated_section_to_segment):
3272 Take new const Target* argument. If target->isolate_execinstr(), act
3273 like --rosegment.
3274 (Layout::find_first_load_seg): Take new const Target* argument;
3275 if target->isolate_execinstr(), reject PF_X segments.
3276 (Layout::relaxation_loop_body): Update caller.
3277 (Layout::set_segment_offsets): If target->isolate_execinstr(),
3278 reset file offset to zero when we hit LOAD_SEG, and then do a second
3279 loop over the segments before LOAD_SEG to reassign offsets after
3280 addresses have been determined. Handle target->rosegment_gap().
3281 (Layout::attach_section_to_segment): Take new const Target* argument;
3282 pass it to attach_allocated_section_to_segment.
3283 (Layout::make_output_section): Update caller.
3284 (Layout::attach_sections_to_segments): Take new const Target* argument;
3285 pass it to attach_section_to_segment.
3286 * gold.cc (queue_middle_tasks): Update caller.
3287 * layout.h (Layout): Update method decls with new arguments.
3288
3289 * arm.cc (Target_arm::Target_arm): Take optional argument for the
3290 Target_info pointer to use.
3291 (Target_arm::do_make_data_plt): New virtual method.
3292 (Target_arm::make_data_plt): New method that calls it.
3293 (Target_arm::make_plt_entry): Use it.
3294 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
3295 for the section alignment.
3296 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
3297 method.
3298 (Output_data_plt_arm::first_plt_entry_offset): Call it.
3299 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
3300 method.
3301 (Output_data_plt_arm::get_plt_entry_size): Call it.
3302 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
3303 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
3304 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
3305 method.
3306 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
3307 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
3308 method instead of sizeof(plt_entry).
3309 (Output_data_plt_arm::add_entry): Likewise.
3310 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
3311 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
3312 than static method.
3313 (Target_arm::plt_entry_size): Likewise.
3314 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
3315 Move to ...
3316 (Output_data_plt_arm_standard): ... here, new class.
3317 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
3318 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
3319 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
3320
3321 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3322 Take additional argument for the PLT entry size.
3323 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
3324 Use get_plt_entry_size method rather than plt_entry_size variable.
3325 (Output_data_plt_x86_64::reserve_slot): Likewise.
3326 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
3327 (Output_data_plt_x86_64::add_entry): Likewise.
3328 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
3329 (Output_data_plt_x86_64::address_for_global): Likewise.
3330 (Output_data_plt_x86_64::address_for_local): Likewise.
3331 (Output_data_plt_x86_64::set_final_data_size): Likewise.
3332 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
3333 Make method non-static.
3334 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
3335 method.
3336 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
3337 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
3338 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
3339 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
3340 virtual method.
3341 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
3342 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
3343 virtual method.
3344 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
3345 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
3346 virtual method.
3347 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
3348 (Output_data_plt_x86_64::plt_entry_size)
3349 (Output_data_plt_x86_64::first_plt_entry)
3350 (Output_data_plt_x86_64::plt_entry)
3351 (Output_data_plt_x86_64::tlsdesc_plt_entry)
3352 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
3353 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
3354 (Output_data_plt_x86_64_standard): ... here, new class.
3355 (Target_x86_64::Target_x86_64): Take optional argument for the
3356 Target_info pointer to use.
3357 (Target_x86_64::do_make_data_plt): New virtual method.
3358 (Target_x86_64::make_data_plt): New method to call it.
3359 (Target_x86_64::init_got_plt_for_update): Use that.
3360 Call this->plt_->add_eh_frame method here.
3361 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
3362 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
3363 rather than static method.
3364 (Target_x86_64::plt_entry_size): Likewise.
3365 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
3366 rather than plt_entry_size variable. Move guts of PLT filling to...
3367 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
3368 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
3369 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
3370
3371 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
3372 additional argument for the section alignment.
3373 Don't do add_eh_frame_for_plt here.
3374 (Output_data_plt_i386::first_plt_entry_offset): Make the method
3375 non-static. Use get_plt_entry_size method rather than plt_entry_size
3376 variable.
3377 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
3378 method.
3379 (Output_data_plt_i386::get_plt_entry_size): Call it.
3380 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
3381 (Output_data_plt_i386::add_eh_frame): New method to call it.
3382 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
3383 method.
3384 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
3385 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
3386 method.
3387 (Output_data_plt_i386::fill_plt_entry): New method to call it.
3388 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
3389 method instead of plt_entry_size.
3390 (Output_data_plt_i386::plt_entry_size)
3391 (Output_data_plt_i386::plt_eh_frame_fde_size)
3392 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
3393 (Output_data_plt_i386_standard): ... here, new class.
3394 (Output_data_plt_i386_exec): New class.
3395 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
3396 (Output_data_plt_i386_exec::first_plt_entry): ... here.
3397 (Output_data_plt_i386::exec_plt_entry): Move to ...
3398 (Output_data_plt_i386_exec::plt_entry): ... here.
3399 (Output_data_plt_i386_dyn): New class.
3400 (Output_data_plt_i386::first_plt_entry): Move to ...
3401 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
3402 (Output_data_plt_i386::dyn_plt_entry): Move to ...
3403 (Output_data_plt_i386_dyn::plt_entry): ... here.
3404 (Target_i386::Target_i386): Take optional argument for the Target_info
3405 pointer to use.
3406 (Target_i386::do_make_data_plt): New virtual method.
3407 (Target_i386::make_data_plt): New method to call it.
3408 (Target_i386::make_plt_section): Use that.
3409 Call this->plt_->add_eh_frame method here.
3410 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
3411 rather than plt_entry_size variable.
3412 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
3413 (Output_data_plt_i386::address_for_local): Likewise.
3414 (Output_data_plt_i386::do_write): Likewise.
3415 Move guts of PLT filling to...
3416 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
3417 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
3418 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
3419 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
3420
b9b9f2ee
CC
34212012-05-01 Cary Coutant <ccoutant@google.com>
3422
3423 * dwarf_reader.cc (Dwarf_die::read_attributes)
3424 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
3425 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
3426 * reduced_debug_output.cc
3427 (Output_reduced_debug_info_section::get_die_end): Remove
3428 DW_FORM_GNU_ref_index. Add default case.
3429
57923f48
MW
34302012-04-26 Mark Wielaard <mjw@redhat.com>
3431
3432 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
3433 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
3434 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
3435 DW_AT_high_pc as offset from DW_AT_low_pc.
3436
3437 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
3438 * testsuite/Makefile.in: Regenerate.
3439 * testsuite/gdb_index_test_3.c: New test source file.
3440 * testsuite/gdb_index_test_3.sh: New test source file.
3441
2c54b4f4
ILT
34422012-04-25 Ian Lance Taylor <iant@google.com>
3443
3444 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
3445 pointer.
3446 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
3447 as a class, not a struct.
3448 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
3449 (Target_arm::apply_cortex_a8_workaround): Likewise.
3450 * gc.h: Declare Reloc_types as a struct, not a class.
3451 * object.h: Declare Symbols_data as a struct.
3452 * reloc.h: Declare Read_relocs_data as a struct.
3453 * target.h: Declare Relocate_info as a struct.
3454
a5a5f7a3
DM
34552012-04-24 David S. Miller <davem@davemloft.net>
3456
3457 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
3458 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
3459 and R_SPARC_WPLT30.
3460
f038d496
CC
34612012-04-24 Cary Coutant <ccoutant@google.com>
3462
3463 * incremental-dump.cc (find_input_containing_global): Replace
3464 magic number with symbolic constant.
3465 (dump_incremental_inputs): Update version number.
3466 * incremental.cc (Output_section_incremental_inputs): Update version
3467 number; import symbolic constants from Incremental_inputs_reader.
3468 (Incremental_inputs::create_data_sections): Align relocations
3469 section correctly for 64-bit targets.
3470 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
3471 constants; add padding.
3472 (Output_section_incremental_inputs::write_header): Add assert for
3473 header_size.
3474 (Output_section_incremental_inputs::write_input_files): Add assert
3475 for input_entry_size.
3476 (Output_section_incremental_inputs::write_info_blocks): Add padding;
3477 add assert for object_info_size, input_section_entry_size,
3478 global_sym_entry_size.
3479 * incremental.h (Incremental_inputs_reader): Add symbolic constants
3480 for data structure sizes; use them.
3481 (Incremental_input_entry_reader): Import symbolic constants from
3482 Incremental_inputs_reader; use them.
3483
a4d85145
DM
34842012-04-23 David S. Miller <davem@davemloft.net>
3485
3486 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
3487 and elf_flags_set_.
3488 (Target_sparc::Target_sparc): Initialize new fields.
3489 (Target_sparc::do_make_elf_object): New function.
3490 (Target_sparc::do_adjust_elf_header): New function.
3491
1d509098
CC
34922012-04-23 Cary Coutant <ccoutant@google.com>
3493
3494 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
3495 CU range table of gdb index.
3496
7ebeff7f
DM
34972012-04-20 David S. Miller <davem@davemloft.net>
3498
3499 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
3500 instead of false.
3501
13cf9988
DM
35022012-04-16 David S. Miller <davem@davemloft.net>
3503
2a1079e8
DM
3504 * sparc.cc (Target_sparc::got_address): New function.
3505 (Sparc_relocate_functions::gdop_hix22): New function.
3506 (Sparc_relocate_functions::gdop_lox10): New function.
3507 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
3508 relocs.
3509 (Target_sparc::Scan::local): Likewise if the global symbol is not
3510 preemptible and is not IFUNC.
3511 (Target_sparc::Relocate::relocate): Perform GOTDATA code
3512 transformations for local and non-preemptible non-IFUNC global
3513 symbols.
3514
0bc964fc
DM
3515 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
3516 writing out 64-bit part of ranges.
3517
661d7a80
DM
3518 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
3519 -fpic and -fpie respectively.
3520 * Makefile.in: Regenerate.
3521
8c2bf391
DM
3522 * sparc.cc (class Target_sparc): Add rela_ifunc_.
3523 (Target_sparc::Target_sparc): Initialize new field.
3524 (Target_sparc::do_plt_section_for_global): New function.
3525 (Target_sparc::do_plt_section_for_local): New function.
3526 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
3527 (Target_sparc::make_plt_section): New function, broken out of
3528 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
3529 (Target_sparc::make_plt_entry): Call make_plt_section.
3530 (Target_sparc::make_local_ifunc_plt_entry): New function.
3531 (Target_sparc::rela_ifunc_section): New function.
3532 (Target_sparc::plt_section): Remove const.
3533 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
3534 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
3535 and ifunc_count_ fields.
3536 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
3537 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
3538 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
3539 (Output_data_plt_sparc::rela_ifunc): New function.
3540 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
3541 (Output_data_plt_sparc::has_ifunc_section): New function.
3542 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
3543 (Output_data_plt_sparc::address_for_global): New function.
3544 (Output_data_plt_sparc::address_for_local): New function.
3545 (Output_data_plt_sparc::plt_index_to_offset): New function.
3546 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
3547 and entry_count.
3548 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
3549 entry_count.
3550 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
3551 R_SPARC_JMP_IREL to switch.
3552 (Target_sparc::Scan::check_non_pic): Likewise.
3553 (Target_sparc::Scan::local): Handle IFUNC symbols.
3554 (Target_sparc::Scan::local): Likewise.
3555 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
3556 and plt_address_for_local.
3557 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
3558 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
3559
13cf9988
DM
3560 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
3561 (class Output_data_reloc): Adjust calls to Output_reloc_type.
3562 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
3563 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
3564 global relocs too.
3565 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
3566 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
3567 calls.
3568 * sparc.cc (Target_sparc::Scan::global): Likewise.
3569 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
3570
31821be0
CC
35712012-04-16 Cary Coutant <ccoutant@google.com>
3572
3573 * archive.cc (Library_base::should_include_member): Check for
3574 --export-dynamic-symbol.
3575 * options.h (class General_options): Add --export-dynamic-symbol.
3576 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
3577 --export-dynamic-symbol.
3578 (Symbol_table::gc_mark_undef_symbols): Likewise.
3579 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
3580
2615994e
DM
35812012-04-12 David S. Miller <davem@davemloft.net>
3582
3583 * sparc.cc (Reloc::wdisp10): New relocation method.
3584 (Reloc::h34): Likewise.
3585 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
3586 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
3587 R_SPARC_WDISP10.
3588 (Target_sparc::Scan::local): Likewise.
3589 (Target_sparc::Scan::global): Likewise.
3590 (Target_sparc::Relocate::relocate): Likewise.
3591
6782735d
CC
35922012-04-09 Cary Coutant <ccoutant@google.com>
3593
3594 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
3595 low_pc == 0.
3596
8c7a0b00
ILT
35972012-04-06 Ian Lance Taylor <iant@google.com>
3598
3599 * timer.cc: #include <unistd.h>.
3600
58797674
RM
36012012-04-06 Roland McGrath <mcgrathr@google.com>
3602
3603 * configure.in (AC_CHECK_HEADERS): Add locale.h.
3604 * config.in: Regenerate.
3605 * configure: Regenerate.
3606
44350750
NC
36072012-04-05 Nick Clifton <nickc@redhat.com>
3608
3609 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
3610 (AM_LC_MESSAGES): Add.
3611 * aclocal.m4: Regenerate.
3612 * config.in: Regenerate.
3613 * configure: Regenerate.
3614
c1027032
CC
36152012-03-21 Cary Coutant <ccoutant@google.com>
3616
3617 * Makefile.am: Add gdb-index.cc, gdb-index.h.
3618 * Makefile.in: Regenerate.
3619 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
3620 (Sized_elf_reloc_mapper::symbol_section): New function.
3621 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
3622 (make_elf_reloc_mapper): New function.
3623 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
3624 (Dwarf_abbrev_table::do_read_abbrevs): New function.
3625 (Dwarf_abbrev_table::do_get_abbrev): New function.
3626 (Dwarf_ranges_table::read_ranges_table): New function.
3627 (Dwarf_ranges_table::read_range_list): New function.
3628 (Dwarf_pubnames_table::read_section): New function.
3629 (Dwarf_pubnames_table::read_header): New function.
3630 (Dwarf_pubnames_table::next_name): New function.
3631 (Dwarf_die::Dwarf_die): New function.
3632 (Dwarf_die::read_attributes): New function.
3633 (Dwarf_die::skip_attributes): New function.
3634 (Dwarf_die::set_name): New function.
3635 (Dwarf_die::set_linkage_name): New function.
3636 (Dwarf_die::attribute): New function.
3637 (Dwarf_die::string_attribute): New function.
3638 (Dwarf_die::int_attribute): New function.
3639 (Dwarf_die::uint_attribute): New function.
3640 (Dwarf_die::ref_attribute): New function.
3641 (Dwarf_die::child_offset): New function.
3642 (Dwarf_die::sibling_offset): New function.
3643 (Dwarf_info_reader::check_buffer): New function.
3644 (Dwarf_info_reader::parse): New function.
3645 (Dwarf_info_reader::do_parse): New function.
3646 (Dwarf_info_reader::do_read_string_table): New function.
3647 (Dwarf_info_reader::lookup_reloc): New function.
3648 (Dwarf_info_reader::get_string): New function.
3649 (Dwarf_info_reader::visit_compilation_unit): New function.
3650 (Dwarf_info_reader::visit_type_unit): New function.
3651 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
3652 Sized_elf_reloc_mapper.
3653 (Sized_dwarf_line_info::symbol_section): Remove function.
3654 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
3655 (Sized_dwarf_line_info::read_line_mappings): Remove object
3656 parameter, adjust callers.
3657 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
3658 * dwarf_reader.h: Include <sys/types.h>.
3659 (class Track_relocs): Remove forward declaration.
3660 (class Elf_reloc_mapper): New class.
3661 (class Sized_elf_reloc_mapper): New class.
3662 (class Dwarf_abbrev_table): New class.
3663 (class Dwarf_range_list): New class.
3664 (class Dwarf_ranges_table): New class.
3665 (class Dwarf_pubnames_table): New class.
3666 (class Dwarf_die): New class.
3667 (class Dwarf_info_reader): New class.
3668 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
3669 (Sized_dwarf_line_info::symbol_section): Remove member function.
3670 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
3671 base class.
3672 * gdb-index.cc: New source file.
3673 * gdb-index.h: New source file.
3674 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
3675 and .debug_types sections, call Layout::add_to_gdb_index.
3676 (Sized_relobj_incr::do_section_name): Implement.
3677 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
3678 return type; Implement.
3679 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
3680 return type.
3681 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
3682 parameter list and return type.
3683 (Sized_incr_dynobj::do_section_contents): Likewise.
3684 * layout.cc: Include gdb-index.h.
3685 (Layout::Layout): Initialize gdb_index_data_.
3686 (Layout::init_fixed_output_section): Check for .gdb_index section.
3687 (Layout::add_to_gdb_index): New function. Instantiate.
3688 * layout.h: Add forward declaration for class Gdb_index.
3689 (Layout::add_to_gdb_index): New member function.
3690 (Layout::gdb_index_data_): New data member.
3691 * main.cc: Include gdb-index.h.
3692 (main): Print statistics for gdb index.
3693 * object.cc (Object::section_contents): Move code into
3694 do_section_contents.
3695 (need_decompressed_section): Check for sections needed when building
3696 gdb index.
3697 (build_compressed_section_map): Likewise.
3698 (Sized_relobj_file::do_read_symbols): Need local symbols when building
3699 gdb index.
3700 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
3701 sections; call Layout::add_to_gdb_index.
3702 (Sized_relobj_file::do_decompressed_section_contents): Call
3703 do_section_contents directly.
3704 * object.h (Object::do_section_contents): Adjust parameter list and
3705 return type.
3706 (Object::do_decompressed_section_contents): Call do_section_contents
3707 directly.
3708 (Sized_relobj_file::do_section_contents): Adjust parameter list and
3709 return type.
3710 * options.h (class General_options): Add --gdb-index option.
3711 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
3712 list and return type.
3713 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
3714 * reloc.h (Track_relocs::checkpoint): New function.
3715 (Track_relocs::reset): New function.
3716
3717 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
3718 New test cases.
3719 * testsuite/Makefile.in: Regenerate.
3720 * testsuite/gdb_index_test.cc: New test source file.
3721 * testsuite/gdb_index_test_1.sh: New test source file.
3722 * testsuite/gdb_index_test_2.sh: New test source file.
3723
647f1574
DK
37242012-03-19 Doug Kwan <dougkwan@google.com>
3725
3726 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 3727 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
3728 __exidx_start and __exidx_end. Make symbol table parameter
3729 anonymous as it is not used.
3730 * gold.cc (queue_middle_tasks): Call target hook to define any
3731 target-specific symbols.
3732 * target.h (Target::define_standard_symbols): New method.
3733 (Target::do_define_standard_symbols): Same.
3734 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
3735 * testsuite/Makefile.in: Regenerate.
3736 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
3737 and __exidx_end.
3738 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
3739 relocations are generated for __exidx_start and __exidx_end.
3740
7c6109da
DK
37412012-03-16 Doug Kwan <dougkwan@google.com>
3742
3743 * testsuite/Makefile.am: Disable test initpri3b.
3744 * testsuite/Makefile.in: Regenerate.
3745
7b8957f8
DK
37462012-03-15 Doug Kwan <dougkwan@google.com>
3747
3748 * arm.cc (Target_arm::got_section): Make .got section read-only
3749 if -z now is given.
3750
14dc9ef7
ILT
37512012-03-15 Ian Lance Taylor <iant@google.com>
3752
3753 PR gold/13850
3754 * layout.cc (Layout::make_output_section): Correctly mark
3755 SHT_INIT_ARRAY, et. al., as relro.
3756
fa40b62a
DK
37572012-03-14 Doug Kwan <dougkwan@google.com>
3758
3759 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
3760 dynamic relocations for protected symbols in shared objects.
3761
fd325007
ILT
37622012-03-13 Ian Lance Taylor <iant@google.com>
3763
3764 * resolve.cc (Symbol_table::resolve): When merging common symbols,
3765 keep the larger alignment.
3766
e8dd54e1
CC
37672012-03-12 Cary Coutant <ccoutant@google.com>
3768
3769 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
3770 handling of DW_LNE_define_file.
3771
feb5f3b0
CC
37722012-03-12 Cary Coutant <ccoutant@google.com>
3773
3774 * reduced_debug_output.cc
3775 (Output_reduced_debug_info_section::get_die_end): Add new FORM
3776 codes to switch.
3777
a1fb4256
CC
37782012-02-29 Cary Coutant <ccoutant@google.com>
3779
3780 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
3781
5dd8762a
CC
37822012-02-29 Cary Coutant <ccoutant@google.com>
3783
3784 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3785 Call Object::decompressed_section_contents.
3786 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
3787 New dtor.
3788 (Sized_dwarf_line_info::buffer_start_): New data member.
3789 * merge.cc (Output_merge_data::do_add_input_section): Call
3790 Object::decompressed_section_contents.
3791 (Output_merge_string::do_add_input_section): Likewise.
3792 * object.cc (need_decompressed_section): New function.
3793 (build_compressed_section_map): Decompress sections needed later.
3794 (Sized_relobj_file::do_decompressed_section_contents): New function.
3795 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3796 * object.h (Object::decompressed_section_contents): New function.
3797 (Object::discard_decompressed_sections): New function.
3798 (Object::do_decompressed_section_contents): New function.
3799 (Object::do_discard_decompressed_sections): New function.
3800 (Compressed_section_info): New type.
3801 (Compressed_section_map): Include decompressed section contents.
3802 (Sized_relobj_file::do_decompressed_section_contents): New function.
3803 (Sized_relobj_file::do_discard_decompressed_sections): New function.
3804
7b5de7ee
CC
38052012-02-16 Cary Coutant <ccoutant@google.com>
3806
3807 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
3808 * testsuite/Makefile.in: Regenerate.
3809
f9fa4a63
CC
38102012-02-14 Cary Coutant <ccoutant@google.com>
3811
3812 * options.cc (General_options::finalize): Disallow -pie and -static.
3813
2c175ebc
DK
38142012-02-03 Doug Kwan <dougkwan@google.com>
3815
3816 * arm.cc (Arm_relocate_functions::abs8,
3817 Arm_relocate_functions::abs16): Use
3818 Bits::has_signed_unsigned_overflow32.
3819 (Arm_relocate_functions::thm_abs8): Correct range of
3820 overflow check.
3821 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
3822 in assertions.
3823
90cff06f
DK
38242012-02-02 Doug Kwan <dougkwan@google.com>
3825
3826 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
3827 position independent outputs, not just shared objects.
3828
63887f3d
L
38292012-01-30 H.J. Lu <hongjiu.lu@intel.com>
3830
3831 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
3832 * configure: Regenerated.
3833
bef2b434
ILT
38342012-01-27 Ian Lance Taylor <iant@google.com>
3835
3836 * reloc.h (Bits): New class with static functions, copied from
3837 namespace utils in arm.cc.
3838 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
3839 instead.
3840
c335b55d
L
38412012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3842
3843 * incremental.cc (write_info_blocks): Correct relocation offset.
3844
41194d9f
L
38452012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3846
3847 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
3848 (Relocate::tls_gd_to_le): Likewise.
3849
1bae613c
L
38502012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3851
3852 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
3853
24482ca0
L
38542012-01-27 H.J. Lu <hongjiu.lu@intel.com>
3855
3856 * configure.ac: Check if -mcmodel=medium works.
3857 * configure: Regenerated.
3858
c2c7840a
CC
38592012-01-24 Cary Coutant <ccoutant@google.com>
3860
3861 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
3862 definition and ...
3863 (read_unsigned_LEB_128_x): ... this new function.
3864 (read_signed_LEB_128): Replaced with inline definition and ...
3865 (read_signed_LEB_128_x): ... this new function.
3866 * int_encoding.h (read_unsigned_LEB_128_x): New function.
3867 (read_unsigned_LEB_128): Add inline definition.
3868 (read_signed_LEB_128_x): New function.
3869 (read_signed_LEB_128): Add inline definition.
3870 * testsuite/Makefile.am (leb128_unittest): New unit test.
3871 * testsuite/Makefile.in: Regenerate.
3872 * testsuite/leb128_unittest.cc: New unit test.
3873
833de760 38742012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
3875
3876 PR gold/13617
3877 * i386.cc (Target_i386::do_code_fill): When using a jmp
3878 instruction, pad with nop instructions.
3879 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3880
618d6666
L
38812012-01-22 H.J. Lu <hongjiu.lu@intel.com>
3882
3883 * x86_64.cc (gc_process_relocs): Add typename on types used in
3884 template.
3885 (scan_relocs): Likewise.
3886 (relocate_section): Likewise.
3887 (apply_relocation): Likewise.
3888
3660ff06
L
38892012-01-10 H.J. Lu <hongjiu.lu@intel.com>
3890
3891 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
3892 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
3893 under x32.
3894
fc51264f
L
38952012-01-09 H.J. Lu <hongjiu.lu@intel.com>
3896
3897 * x86_64.cc: Initial support for x32.
3898
dd74ae06
CC
38992012-01-03 Cary Coutant <ccoutant@google.com>
3900
3901 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
3902 Use abstract base class for GOT.
3903 * gold/output.h (class Output_data_got_base): New abstract base class.
3904 (class Output_data_got): Derive from new base class, adjust ctors.
3905 (Output_data_got::reserve_slot): Make virtual; rename to
3906 do_reserve_slot; Adjust callers.
3907 * gold/target.h (Sized_target::init_got_plt_for_update): Return
3908 pointer to abstract base class.
3909 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
3910
83896202
ILT
39112011-12-18 Ian Lance Taylor <iant@google.com>
3912
3913 * object.h (Relobj::local_symbol_value): New function.
3914 (Relobj::local_plt_offset): New function.
3915 (Relobj::local_has_got_offset): New function.
3916 (Relobj::local_got_offset): New function.
3917 (Relobj::set_local_got_offset): New function.
3918 (Relobj::do_local_symbol_value): New pure virtual function.
3919 (Relobj::do_local_plt_offset): Likewise.
3920 (Relobj::do_local_has_got_offset): Likewise.
3921 (Relobj::do_local_got_offset): Likewise.
3922 (Relobj::do_set_local_got_offset): Likewise.
3923 (Sized_relobj::do_local_has_got_offset): Rename from
3924 local_has_got_offset.
3925 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
3926 (Sized_relobj::do_set_local_got_offset): Rename from
3927 set_local_got_offset.
3928 (Sized_relobj_file::do_local_plt_offset): Rename from
3929 local_plt_offset.
3930 (Sized_relobj_file::do_local_symbol_value): New function.
3931 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
3932 local_plt_offset.
3933 * output.cc (Output_data_got::Got_entry::write): Change object to
3934 Relobj. Use local_symbol_value.
3935 (Output_data_got::add_global_with_rel): Change rel_dyn to
3936 Output_data_reloc_generic*. Use add_global_generic.
3937 (Output_data_got::add_global_with_rela): Remove. Change all
3938 callers to use add_global_with_rel.
3939 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
3940 Output_data_reloc_generic*. Use add_global_generic.
3941 (Output_data_got::add_global_pair_with_rela): Remove. Change all
3942 callers to use add_global_pair_with_rel.
3943 (Output_data_got::add_local): Change object to Relobj*.
3944 (Output_data_got::add_local_plt): Likewise.
3945 (Output_data_got::add_local_with_rel): Change object to Relobj*,
3946 change rel_dyn to Output_data_reloc_generic*. Use
3947 add_local_generic.
3948 (Output_data_got::add_local_with_rela): Remove. Change all
3949 callers to use all_local_with_rel.
3950 (Output_data_got::add_local_pair_with_rel): Change object to
3951 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
3952 add_output_section_generic.
3953 (Output_data_got::add_local_pair_with_rela): Remove. Change all
3954 callers to use add_local_pair_with_rel.
3955 (Output_data_got::reserve_local): Change object to Relobj*.
3956 * output.h: (class Output_data_reloc_generic): Add pure virtual
3957 declarations for add_global_generic, add_local_generic,
3958 add_output_section_generic.
3959 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
3960 functions for Output_data_reloc_generic. Update declarations for
3961 changes listed in output.cc.
3962 (class Output_data_got): Change template parameter to got_size.
3963 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
3964 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
3965 function.
3966 (Sized_relobj_incr::do_local_plt_offset): New function.
3967 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
3968 add_global_generic.
3969
76677ad0
CC
39702011-12-17 Cary Coutant <ccoutant@google.com>
3971
3972 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
3973 * resolve.cc (Symbol_table::resolve): Likewise.
3974 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
3975 arrays.
3976 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
3977
8b8dd8d5
ILT
39782011-12-16 Ian Lance Taylor <iant@google.com>
3979
3980 * output.h (Output_data_reloc_generic::add): Only call
3981 add_dynamic_reloc if this is a dynamic reloc section.
3982
d55525b9
L
39832011-12-15 H.J. Lu <hongjiu.lu@intel.com>
3984
3985 PR gold/13505
3986 * target-reloc.h (apply_relocation): Replace <64, false> with
3987 <size, big_endian>.
3988
ff81c7c1
NC
39892011-11-25 Nick Clifton <nickc@redhat.com>
3990
3991 * po/it.po: New Italian translation.
3992
628f39be
SA
39932011-11-17 Sterling Augustine <saugustine@google.com>
3994
3995 * script.cc (script_include_directive): Implement.
3996 (read_script_file): New local variables name and search_path. Update
3997 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
3998 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
3999 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
4000
98ef3ea4
SA
40012011-11-11 Sterling Augustine <saugustine@google.com>
4002
4003 * yyscript.y (section_cmd): Add support for INCLUDE directive.
4004 (file_or_sections_cmd): Likewise.
4005
f4a8b6d7
DK
40062011-11-11 Doug Kwan <dougkwan@google.com>
4007
4008 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
4009 if --just-symbols is given.
4010
29ab395d
DK
40112011-11-10 Doug Kwan <dougkwan@google.com>
4012
4013 PR gold/13362
4014 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
4015 when processing data relocs.
4016 * reloc.h (Relocate_functions::rel_unaligned): New method.
4017 (Relocate_functions::pcrel_unaligned): Ditto.
4018 (Relocate_functions::rel32_unaligned): Ditto.
4019 (Relocate_functions::pcrel32_unaligned): Ditto.
4020
2c339f71
DK
40212011-11-09 Doug Kwan <dougkwan@google.com>
4022
4023 PR gold/13362
4024 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
4025 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
4026 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
4027 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4028 (Relocate_functions::rel_unaligned): New.
4029 (Relocate_functions::rel32_unaligned): New.
4030 * target-reloc.h (relocate_for_relocatable): Add code to handle
4031 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
4032 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
4033 arm_unaligned_reloc_r): New targets.
4034 * testsuite/Makefile.in: Regenerate.
4035 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
4036 linking.
4037
3f3cddf1
ILT
40382011-11-02 Ian Lance Taylor <iant@google.com>
4039
4040 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
4041 NATIVE_LINKER.
4042 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
4043 * options.cc (General_options::finalize): Use library search path
4044 from configure script if specified. If not native and no sysroot,
4045 only search TOOLLIBDIR.
4046 * options.h (Search_directory::Search_directory): Change name to
4047 const std::string&.
4048 (General_options::add_to_library_path_with_sysroot): Change arg to
4049 const std::string&.
4050 * configure, Makefile.in, config.in: Rebuild.
4051
a8e2273b
ILT
40522011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4053
4054 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
4055 we are working around the ARM1176 Erratum.
4056 * options.h (General_options::fix_arm1176): Add option.
4057 * testsuite/Makefile.am: Add testcases, and keep current ones
4058 working.
4059 * testsuite/Makefile.in: Regenerate.
4060 * testsuite/arm_fix_1176.s: New file.
4061 * testsuite/arm_fix_1176.sh: Likewise.
4062
cd6eab1c
ILT
40632011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
4064
4065 * arm.cc (Target_arm::Target_arm): Remove initialisation of
4066 may_use_blx_.
4067 (Target_arm::may_use_blx): Remove method.
4068 (Target_arm::set_may_use_blx): Likewise.
4069 (Target_arm::may_use_v4t_interworking): New method.
4070 (Target_arm::may_use_v5t_interworking): Likewise.
4071 (Target_arm::may_use_blx_): Remove member variable.
4072 (Arm_relocate_functions::arm_branch_common): Check for v5T
4073 interworking.
4074 (Arm_relocate_functions::thumb_branch_common): Likewise.
4075 (Reloc_stub::stub_type_for_reloc): Likewise.
4076 (Target_arm::do_finalize_sections): Correct interworking checks.
4077 * testsuite/Makefile.am: Add new tests.
4078 * testsuite/Makefile.in: Regenerate.
4079 * testsuite/arm_farcall_arm_arm.s: New test.
4080 * testsuite/arm_farcall_arm_arm.sh: Likewise.
4081 * testsuite/arm_farcall_arm_thumb.s: Likewise.
4082 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
4083 * testsuite/arm_farcall_thumb_arm.s: Likewise.
4084 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
4085 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
4086 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
4087
286adcf4
CC
40882011-10-31 Cary Coutant <ccoutant@google.com>
4089
4090 PR gold/13023
4091 * expression.cc (Expression::eval_with_dot): Add
4092 is_section_dot_assignment parameter.
4093 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
4094 absolute and assigning to dot within a section.
4095 * script-sections.cc
4096 (Output_section_element_assignment::set_section_addresses): Pass
4097 dot_section to set_if_absolute.
4098 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
4099 as is_section_dot_assignment flag to eval_with_dot.
4100 (Output_section_element_dot_assignment::set_section_addresses):
4101 Likewise.
4102 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
4103 parameter. Also set value if relative to dot_section; set the
4104 symbol's output_section.
4105 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
4106 parameter. Adjust all callers.
4107 (Expression::eval_maybe_dot): Likewise.
4108 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
4109 Adjust all callers.
4110 * testsuite/script_test_2.t: Test assignment of an absolute value
4111 to dot within an output section element.
4112
9634ed06
CC
41132011-10-31 Cary Coutant <ccoutant@google.com>
4114
4115 * options.h (class General_options): Add --[no-]gnu-unique options.
4116 * symtab.cc (Symbol_table::sized_write_globals): Convert
4117 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
4118
de4101c7
CC
41192011-10-31 Cary Coutant <ccoutant@google.com>
4120
4121 PR gold/13359
4122 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
4123 unnecessary assertion.
4124 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
4125
7257cc92
ST
41262011-10-31 Sriraman Tallam <tmsriram@google.com>
4127
4128 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4129 gc_mark_symbol.
4130 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
4131 gc_mark_symbol.
4132 Change to just keep the section associated with symbol.
4133 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
4134 they are externally visible and --export-dynamic is turned on.
4135 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
4136
bfc34b3f
ILT
41372011-10-19 Ian Lance Taylor <iant@google.com>
4138
4139 PR gold/13163
4140 * script-sections.cc
4141 (Output_section_element_dot_assignment::needs_output_section): New
4142 function.
4143
ea0d8c47
ILT
41442011-10-19 Ian Lance Taylor <iant@google.com>
4145
4146 PR gold/13204
4147 * layout.cc (Layout::segment_precedes): Don't assert failure if a
4148 --section-start option was seen.
4149 * options.h (General_options::any_section_start): New function.
4150
abd242a9
DM
41512011-10-18 David S. Miller <davem@davemloft.net>
4152
4153 PR binutils/13301
4154 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
4155 member to track relocation locations that have moved during TLS
4156 reloc optimizations.
4157 (Target_sparc::Relocate::Relocate): Initialize to NULL.
4158 (Target_sparc::Relocate::relocate): Adjust view down by 4
4159 bytes if it matches reloc_adjust_addr_.
4160 (Target_sparc::Relocate::relocate_tls): Always move the
4161 __tls_get_addr call delay slot instruction forward 4 bytes when
4162 performing relaxation.
4163
bab9090f
CC
41642011-10-18 Cary Coutant <ccoutant@google.com>
4165
4166 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
4167 (Output_file::map_no_anonymous): Check for non-zero
4168 return code from posix_fallocate.
4169
f7c5b166
CC
41702011-10-17 Cary Coutant <ccoutant@google.com>
4171
4172 PR gold/13245
4173 * plugin.cc (is_visible_from_outside): Check for symbols
4174 referenced from dynamic objects.
4175 * resolve.cc (Symbol_table::resolve): Don't count references
4176 from dynamic objects as references from real ELF files.
4177 * testsuite/plugin_test_2.sh: Adjust expected result.
4178
b490c0bb
CC
41792011-10-17 Cary Coutant <ccoutant@google.com>
4180
4181 * gold.cc: Include timer.h.
4182 (queue_middle_tasks): Stamp time.
4183 (queue_final_tasks): Likewise.
4184 * main.cc (main): Store timer in parameters. Print timers
4185 for each pass.
4186 * parameters.cc (Parameters::Parameters): Initialize timer_.
4187 (Parameters::set_timer): New function.
4188 (set_parameters_timer): New function.
4189 * parameters.h (Parameters::set_timer): New function.
4190 (Parameters::timer): New function.
4191 (Parameters::timer_): New data member.
4192 (set_parameters_timer): New function.
4193 * timer.cc (Timer::stamp): New function.
4194 (Timer::get_pass_time): New function.
4195 * timer.h (Timer::stamp): New function.
4196 (Timer::get_pass_time): New function.
4197 (Timer::pass_times_): New data member.
4198
f475cf7b
CC
41992011-10-17 Cary Coutant <ccoutant@google.com>
4200
4201 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
4202 task for members of lib groups.
4203
cdd7e244
CC
42042011-10-17 Cary Coutant <ccoutant@google.com>
4205
4206 PR gold/13288
4f95c8b4 4207 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
4208 (File_read::make_view): Move bounds check (replace with assert)...
4209 (File_read::find_or_make_view): ... to here.
4210
dfb45471
CC
42112011-10-12 Cary Coutant <ccoutant@google.com>
4212
4f95c8b4 4213 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
4214 ::read returns less than requested size.
4215
53bbcc1b
CC
42162011-10-10 Cary Coutant <ccoutant@google.com>
4217
4f95c8b4 4218 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
4219 Initialize defined_count_.
4220 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
4221 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
4222 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
4223 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
4224 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 4225 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
4226 member.
4227 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 4228 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
4229 Return zeroes instead of internal error.
4230
397b129b
CC
42312011-10-10 Cary Coutant <ccoutant@google.com>
4232
4233 PR gold/13249
4f95c8b4 4234 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 4235 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 4236 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
4237 (Output_reloc::type_): Adjust size of bit field.
4238 (Output_reloc::use_plt_offset_): New bit field.
4239 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
4240 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
4241 flag. Adjust all callers.
4f95c8b4 4242 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
4243 creating RELATIVE relocations.
4244
d5698657
NC
42452011-10-10 Nick Clifton <nickc@redhat.com>
4246
4247 * po/es.po: Updated Spanish translation.
4248 * po/fi.po: Updated Finnish translation.
4249
6a59a5c2
DN
42502011-10-03 Diego Novillo <dnovillo@google.com>
4251
4252 * options.cc (parse_uint): Fix dereference of RETVAL.
4253
f0558624
ST
42542011-09-29 Sriraman Tallam <tmsriram@google.com>
4255
4256 * layout.h (section_order_map_): New member.
4257 (get_section_order_map): New member function.
4258 * output.cc (Output_section::add_input_section): Check for patterns
4259 only when --section-ordering-file is specified.
4260 * gold.cc (queue_middle_tasks): Delay updating order of sections till
4261 output_sections have been formed.
4262 * layout.cc (Layout_Layout): Initialize section_order_map_.
4263 * plugin.cc (update_section_order): Store order in order_map. Do not
4264 update the order.
4265 * testsuite/Makefile.am: Add test case for plugin_final_layout.
4266 * testsuite/Makefile.in: Regenerate.
4267 * testsuite/plugin_section_order.c: New file.
4268 * testsuite/plugin_final_layout.cc: New file.
4269 * testsuite/plugin_final_layout.sh: New file.
4270
a7dac153
CC
42712011-09-29 Cary Coutant <ccoutant@google.com>
4272
4f95c8b4 4273 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 4274 Check for NULL.
4f95c8b4 4275 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
4276 symbols during incremental update.
4277 (Symbol_table::add_from_dynobj): Likewise.
4278
eebd87a5
ILT
42792011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4280 Ian Lance Taylor <iant@google.com>
4281
4282 * symtab.cc (Symbol_table::define_special_symbol): Always
4283 canonicalize version string.
4284
403a3331
CC
42852011-09-26 Cary Coutant <ccoutant@google.com>
4286
4f95c8b4
CC
4287 * gold.cc (queue_initial_tasks): Move option checks ...
4288 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
4289 some options; make others fatal.
4290
235061c2
CC
42912011-09-26 Cary Coutant <ccoutant@google.com>
4292
4293 gcc PR lto/47247
4294 * plugin.cc (get_symbols_v2): New function.
4295 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
4296 (is_referenced_from_outside): New function.
4297 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
4298 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
4299 (get_symbols): Pass version parameter.
4300 (get_symbols_v2): New function.
4301 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
4302 parameter.
4303 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
4304 (onload): Add LDPT_GET_SYMBOLS_V2.
4305 (all_symbols_read_hook): Use get_symbols_v2; check for
4306 LDPR_PREVAILING_DEF_IRONLY_EXP.
4307 * testsuite/plugin_test_3.sh: Update expected results.
4308
dc87f620
ILT
43092011-09-23 Simon Baldwin <simonb@google.com>
4310
4311 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
4312 configuration options.
4313 * configure: Regenerate.
4314 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
4315 * Makefile.in: Regenerate.
4316 * testsuite/Makefile.in: Regenerate.
4317
a8279f82
ST
43182011-09-19 Sriraman Tallam <tmsriram@google.com>
4319
4320 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
4321
0c9350c8
CC
43222011-09-19 Cary Coutant <ccoutant@google.com>
4323
4324 * incremental.cc (can_incremental_update): Fix typo in comment.
4325 * incremental.h (can_incremental_update): Likewise.
4326
aa06ae28
CC
43272011-09-18 Cary Coutant <ccoutant@google.com>
4328
4329 * incremental.cc (can_incremental_update): New function.
4330 * incremental.h (can_incremental_update): New function.
4331 * layout.cc (Layout::init_fixed_output_section): Call it.
4332 (Layout::make_output_section): Don't allow patch space in .eh_frame.
4333 * object.cc (Sized_relobj_file::do_layout): Call
4334 can_incremental_update.
4335
ebb300b2
CC
43362011-09-13 Cary Coutant <ccoutant@google.com>
4337
4338 * configure.ac: Check for glibc support for gnu_indirect_function
4339 support with static linking, setting automake conditional
4340 IFUNC_STATIC.
4341 * Makefile.in: Regenerate.
4342 * configure: Regenerate.
4343
4344 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
4345 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
4346 for IFUNC_STATIC.
4347 * testsuite/Makefile.in: Regenerate.
4348
1206d0d5
CC
43492011-09-13 Cary Coutant <ccoutant@google.com>
4350
4351 * incremental.cc (Sized_relobj_incr::do_layout): Call
4352 report_comdat_group for kept comdat sections.
4353 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
4354 * testsuite/Makefile.in: Regenerate.
4355 * testsuite/incr_comdat_test_1.cc: New source file.
4356 * testsuite/incr_comdat_test_2_v1.cc: New source file.
4357 * testsuite/incr_comdat_test_2_v2.cc: New source file.
4358 * testsuite/incr_comdat_test_2_v3.cc: New source file.
4359
40b29874
ILT
43602011-09-13 Ian Lance Taylor <iant@google.com>
4361
4362 * object.cc (Sized_relobj_file::do_layout): Remove unused local
4363 variable external_symbols_offset.
4364
1b045aac
ILT
43652011-09-12 Ian Lance Taylor <iant@google.com>
4366
4367 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
4368 triggered if object has no symbols.
4369
24c6c55a
DM
43702011-09-09 David S. Miller <davem@davemloft.net>
4371
4372 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
4373 (Output_fill_debug_line::do_write): Likewise.
4374
66570254
CC
43752011-08-29 Cary Coutant <ccoutant@google.com>
4376
4377 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
4378 casts to match formatting specs.
4379 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
4380
8ea8cd50
CC
43812011-08-26 Cary Coutant <ccoutant@google.com>
4382
4383 * layout.cc (Free_list::allocate): Provide guarantee of minimum
4384 remaining hole size when allocating.
4385 (Layout::make_output_section): Set fill methods for debug sections.
4386 * layout.h (Free_list::Free_list_node): Move from private to
4387 public.
4388 (Free_list::set_min_hole_size): New function.
4389 (Free_list::begin, Free_list::end): New functions.
4390 (Free_list::min_hole_): New data member.
4391 * output.cc: Include dwarf.h.
4392 (Output_fill_debug_info::do_minimum_hole_size): New function.
4393 (Output_fill_debug_info::do_write): New function.
4394 (Output_fill_debug_line::do_minimum_hole_size): New function.
4395 (Output_fill_debug_line::do_write): New function.
4396 (Output_section::Output_section): Initialize new data member.
4397 (Output_section::set_final_data_size): Ensure patch space is larger
4398 than minimum hole size.
4399 (Output_section::do_write): Fill holes in debug sections.
4400 * output.h (Output_fill): New class.
4401 (Output_fill_debug_info): New class.
4402 (Output_fill_debug_line): New class.
4403 (Output_section::set_free_space_fill): New function.
4404 (Output_section::free_space_fill_): New data member.
4405 * testsuite/Makefile.am (incremental_test_3): Add
4406 --incremental-patch option.
4407 (incremental_test_4): Likewise.
4408 (incremental_test_5): Likewise.
4409 (incremental_test_6): Likewise.
4410 (incremental_copy_test): Likewise.
4411 (incremental_common_test_1): Likewise.
4412 * testsuite/Makefile.in: Regenerate.
4413
7cf80422
NC
44142011-08-26 Nick Clifton <nickc@redhat.com>
4415
4416 * po/es.po: Updated Spanish translation.
4417
c3f7b0e5
CC
44182011-08-01 Cary Coutant <ccoutant@google.com>
4419
4420 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
4421 * gold/testsuite/Makefile.in: Regenerate.
4422 * gold/testsuite/justsyms_exec.c: New source file.
4423 * gold/testsuite/justsyms_lib.c: New source file.
4424
9590bf25
CC
44252011-08-01 Cary Coutant <ccoutant@google.com>
4426
4427 * layout.cc (Layout::set_segment_offsets): Don't realign text
4428 segment if -Ttext was specified.
4429 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
4430 file type.
4431 * object.h (Sized_relobj_file::e_type): New function.
4432 (Sized_relobj_file::e_type_): New data member.
4433 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
4434 base address for ET_EXEC files.
4435 * target.cc (Target::do_make_elf_object_implementation): Allow
4436 ET_EXEC files with --just-symbols option.
4437
dcd8d12e
CC
44382011-07-28 Cary Coutant <ccoutant@google.com>
4439
4440 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
4441 Add thread_number parameter.
4442 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
4443 * workqueue-threads.cc
4444 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
4445 current thread if its thread number is greater than desired thread
4446 count.
4447 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
4448 Add thread_number parameter.
4449 (Workqueue::should_cancel_thread): Likewise.
4450 (Workqueue::find_runnable_or_wait): Pass thread_number to
4451 should_cancel_thread.
4452 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
4453 parameter.
4454
804eb480
ST
44552011-07-22 Sriraman Tallam <tmsriram@google.com>
4456
4457 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
4458 only after checking if it cannot be forced local.
4459 * symtab.h (is_externally_visible): Check if the symbol is not forced
4460 local.
4461
f1ddb600
ILT
44622011-07-15 Ian Lance Taylor <iant@google.com>
4463
4464 * options.h (class General_options): Add --print-output-format.
4465 Move -EL next to -EB, for better --help output.
4466 * target-select.cc: Include <cstdio>, "options.h", and
4467 "parameters.h".
4468 (Target_selector::do_target_bfd_name): New function.
4469 (print_output_format): New function.
4470 * target-select.h (class Target_selector): Update declarations.
4471 (Target_selector::target_bfd_name): New function.
4472 (print_output_format): Declare.
4473 * main.cc: Include "target-select.h".
4474 (main): Handle --print-output-format.
4475 * gold.cc: Include "target-select.h".
4476 (queue_initial_tasks): Handle --print-output-format when there are
4477 no input files.
4478 * parameters.cc (parameters_force_valid_target): Give a better
4479 error message if -EB/-EL does not match target.
4480 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
4481 function.
4482
7d172687
ILT
44832011-07-15 Ian Lance Taylor <iant@google.com>
4484
4485 * i386.cc (class Output_data_plt_i386): Add layout_ field.
4486 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
4487 (Output_data_plt_i386::do_write): Write address of .dynamic
4488 section to first entry in .got.plt section.
4489 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
4490 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4491 Initialize layout_.
4492 (Output_data_plt_x86_64::do_write): Write address of .dynamic
4493 section to first entry in .got.plt section.
4494 * layout.h (Layout::dynamic_section): New function.
4495
e9552f7e
ST
44962011-07-13 Sriraman Tallam <tmsriram@google.com>
4497
4498 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
4499 to claim_file call.
4500 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
4501 input_section_position_, and input_section_glob_.
4502 (read_layout_from_file): Call function section_ordering_specified.
4503 * layout.h (is_section_ordering_specified): New function.
4504 (section_ordering_specified): New function.
4505 (section_ordering_specified_): New boolean member.
4506 * main.cc(main): Call load_plugins after layout object is defined.
4507 * output.cc (Output_section::add_input_section): Use
4508 function section_ordering_specified to check if section ordering is
4509 needed.
4510 * output.cc (Output_section::add_relaxed_input_section): Use
4511 function section_ordering_specified to check if section ordering is
4512 needed.
4513 (Output_section::update_section_layout): New function.
4514 (Output_section::sort_attached_input_sections): Check if input section
4515 must be reordered.
4516 * output.h (Output_section::update_section_layout): New function.
4517 * plugin.cc (get_section_count): New function.
4518 (get_section_type): New function.
4519 (get_section_name): New function.
4520 (get_section_contents): New function.
4521 (update_section_order): New function.
58797674 4522 (allow_section_ordering): New function.
e9552f7e
ST
4523 (Plugin::load): Add the new interfaces to the transfer vector.
4524 (Plugin_manager::load_plugins): New parameter.
4525 (Plugin_manager::all_symbols_read): New parameter.
4526 (Plugin_manager::claim_file): New parameter. Save the elf object for
4527 unclaimed objects.
4528 (Plugin_manager::get_elf_object): New function.
4529 (Plugin_manager::get_view): Change to directly use the bool to check
4530 if get_view is called from claim_file_hook.
4531 * plugin.h (input_objects): New function
4532 (Plugin__manager::load_plugins): New parameter.
4533 (Plugin_manager::claim_file): New parameter.
4534 (Plugin_manager::get_elf_object): New function.
4535 (Plugin_manager::in_claim_file_handler): New function.
4536 (Plugin_manager::in_claim_file_handler_): New member.
4537 (layout): New function.
4538 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
4539 handler with an extra parameter. Make the elf object before calling
4540 claim_file handler.
4541 * testsuite/plugin_test.c (get_section_count): New function pointer.
4542 (get_section_type): New function pointer.
4543 (get_section_name): New function pointer.
4544 (get_section_contents): New function pointer.
4545 (update_section_order): New function pointer.
4546 (allow_section_ordering): New function pointer.
4547 (onload): Check if the new interfaces exist.
4548
9446efde
ILT
45492011-07-13 Ian Lance Taylor <iant@google.com>
4550
4551 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
4552 relro section.
4553 * x86_64.cc (Target_x86_64::got_section): Likewise.
4554 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
4555 (relro_now_test_SOURCES): New variable.
4556 (relro_now_test_DEPENDENCIES): New variable.
4557 (relro_now_test_LDFLAGS): New variable.
4558 (relro_now_test_LDADD): New variable.
4559 (relro_now_test.so): New target.
4560 * testsuite/Makefile.in: Rebuild.
4561
07aa62f2
ILT
45622011-07-12 Ian Lance Taylor <iant@google.com>
4563
4564 PR gold/12980
4565 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
4566 GLOB_DAT relocation rather than a RELATIVE relocation for a
4567 protected symbol when creating a shared library.
4568 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4569 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
4570 * testsuite/protected_main_1.cc (main): Test that protected
4571 function has same address.
4572
e2153196
ILT
45732011-07-11 Ian Lance Taylor <iant@google.com>
4574
4575 PR gold/12979
4576 * options.h (class General_options): Add -Bgroup.
4577 * options.cc (General_options::finalize): If -Bgroup is set,
4578 default to --unresolved-symbols=report-all.
4579 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
4580 * target-reloc.h (issue_undefined_symbol_error): Handle
4581 --unresolved-symbols=report-all.
4582
6daf5215
ILT
45832011-07-08 Ian Lance Taylor <iant@google.com>
4584
4585 PR gold/11985
4586 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
4587 if linker script discards key sections.
4588 (Layout::create_dynamic_symtab): Likewise.
4589 (Layout::assign_local_dynsym_offsets): Likewise.
4590 (Layout::sized_create_version_sections): Likewise.
4591 (Layout::create_interp): Likewise.
4592 (Layout::finish_dynamic_section): Likewise.
4593 (Layout::set_dynamic_symbol_size): Likewise.
4594
beabb2c6
ILT
45952011-07-08 Ian Lance Taylor <iant@google.com>
4596
4597 PR gold/12386
4598 * options.h (class General_options): Add --unresolved-symbols.
4599 * target-reloc.h (issue_undefined_symbol_error): Check
4600 --unresolved-symbols. Add comments.
4601
9c16daf1
ILT
46022011-07-08 Ian Lance Taylor <iant@google.com>
4603
4604 * testsuite/odr_violation2.cc (Ordering::operator()): Make
4605 expression more complex.
4606
191f1a2d
ILT
46072011-07-08 Ian Lance Taylor <iant@google.com>
4608
4609 PR gold/11317
4610 * target-reloc.h (issue_undefined_symbol_error): New inline
4611 function, broken out of relocate_section.
4612 (relocate_section): Call issue_undefined_symbol_error.
4613 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4614 there is no TLS segment if we are about to issue an undefined
4615 symbol error.
4616 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4617
62855347
ILT
46182011-07-08 Ian Lance Taylor <iant@google.com>
4619
4620 PR gold/12279
4621 * resolve.cc (Symbol_table::should_override): Add fromtype
4622 parameter. Change all callers. Give error when linking together
4623 TLS and non-TLS symbol.
4624 (Symbol_table::should_override_with_special): Add fromtype
4625 parameter. Change all callers.
4626 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
4627 there is no TLS segment if we have reported some errors.
4628 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
4629
67181c72
ILT
46302011-07-08 Ian Lance Taylor <iant@google.com>
4631
4632 PR gold/12372
4633 * target.h (Target::plt_address_for_global): New function.
4634 (Target::plt_address_for_local): New function.
4635 (Target::plt_section_for_global): Remove.
4636 (Target::plt_section_for_local): Remove.
4637 (Target::do_plt_address_for_global): New virtual function.
4638 (Target::do_plt_address_for_local): New virtual function.
4639 (Target::do_plt_section_for_global): Remove.
4640 (Target::do_plt_section_for_local): Remove.
4641 (Target::register_global_plt_entry): Add Symbol_table and Layout
4642 parameters.
4643 * output.cc (Output_data_got::Got_entry::write): Use
4644 plt_address_for_global and plt_address_for_local.
4645 * layout.cc (Layout::add_target_dynamic_tags): Use size and
4646 address of output section.
4647 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
4648 got_irelative_, and irelative_count_ fields. Update
4649 declarations.
4650 (Output_data_plt_i386::has_irelative_section): New function.
4651 (Output_data_plt_i386::entry_count): Add irelative_count_.
4652 (Output_data_plt_i386::set_final_data_size): Likewise.
4653 (class Target_i386): Add got_irelative_ and rel_irelative_
4654 fields. Update declarations.
4655 (Target_i386::Target_i386): Initialize new fields.
4656 (Target_i386::do_plt_address_for_global): New function replacing
4657 do_plt_section_for_global.
4658 (Target_i386::do_plt_address_for_local): New function replacing
4659 do_plt_section_for_local.
4660 (Target_i386::got_section): Create got_irelative_.
4661 (Target_i386::rel_irelative_section): New function.
4662 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
4663 fields. Don't define __rel_iplt_{start,end}.
4664 (Output_data_plt_i386::add_entry): Add symtab and layout
4665 parameters. Change all callers. Use different PLT and GOT for
4666 IFUNC symbols.
4667 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
4668 layout parameters. Change all callers. Use different PLT and
4669 GOT.
4670 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
4671 (Output_data_plt_i386::rel_irelative): New function.
4672 (Output_data_plt_i386::address_for_global): New function.
4673 (Output_data_plt_i386::address_for_local): New function.
4674 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
4675 IRELATIVE GOT when changing IFUNC GOT entries.
4676 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
4677 reloc.
4678 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
4679 if we didn't create an IRELATIVE GOT.
4680 (Target_i386::Relocate::relocate): Use plt_address_for_global and
4681 plt_address_for_local.
4682 (Target_i386::do_dynsym_value): Use plt_address_for_global.
4683 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
4684 got_irelative_, and irelative_count_ fields. Update
4685 declarations.
4686 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
4687 Initialize new fields. Remove symtab parameter. Change all
4688 callers.
4689 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
4690 irelative_count_.
4691 (Output_data_plt_x86_64::has_irelative_section): New function.
4692 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
4693 (class Target_x86_64): Add got_irelative_ and rel_irelative_
4694 fields. Update declarations.
4695 (Target_x86_64::Target_x86_64): Initialize new fields.
4696 (Target_x86_64::do_plt_address_for_global): New function replacing
4697 do_plt_section_for_global.
4698 (Target_x86_64::do_plt_address_for_local): New function replacing
4699 do_plt_section_for_local.
4700 (Target_x86_64::got_section): Create got_irelative_.
4701 (Target_x86_64::rela_irelative_section): New function.
4702 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
4703 all callers. Don't create __rel_iplt_{start,end}.
4704 (Output_data_plt_x86_64::add_entry): Add symtab and layout
4705 parameters. Change all callers. Use different PLT and GOT for
4706 IFUNC symbols.
4707 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
4708 layout parameters. Change all callers. Use different PLT and
4709 GOT.
4710 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
4711 parameters. Change all callers. Use different PLT and GOT for
4712 IFUNC symbols.
4713 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
4714 (Output_data_plt_x86_64::rela_irelative): New function.
4715 (Output_data_plt_x86_64::address_for_global): New function.
4716 (Output_data_plt_x86_64::address_for_local): New function.
4717 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4718 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
4719 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
4720 (Target_x86_64::register_global_plt_entry): Add symtab and layout
4721 parameters.
4722 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
4723 reloc.
4724 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
4725 symbols if we didn't create an IRELATIVE GOT.
4726 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
4727 plt_address_for_local.
4728 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
4729 * testsuite/ifuncvar1.c: New test file.
4730 * testsuite/ifuncvar2.c: New test file.
4731 * testsuite/ifuncvar3.c: New test file.
4732 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
4733 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
4734 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
4735 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
4736 * testsuite/Makefile.in: Rebuild.
4737
33c15b45
CC
47382011-07-07 Cary Coutant <ccoutant@google.com>
4739
4740 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
4741 (two_file_test_1_ndebug.o): Likewise.
4742 (two_file_test_1b_ndebug.o): Likewise.
4743 (two_file_test_2_ndebug.o): Likewise.
4744 (two_file_test_main_ndebug.o): Likewise.
4745 (incremental_test_2): Link with no-debug versions.
4746
f48b5fb7
CC
47472011-07-06 Cary Coutant <ccoutant@google.com>
4748
4749 * gold/incremental.cc
4750 (Output_section_incremental_inputs::write_info_blocks): Check for
4751 hidden and internal symbols.
4752
221597a5
CC
47532011-07-06 Cary Coutant <ccoutant@google.com>
4754
4755 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
4756 Check disposition for startup file.
4757 (Incremental_inputs::report_command_line): Ignore
4758 --incremental-startup-unchanged option.
4759 * options.cc (General_options::parse_incremental_startup_unchanged):
4760 New function.
4761 (General_options::General_options): Initialize new data member.
4762 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
4763 (General_options): Add --incremental-startup-unchanged option.
4764 (General_options::incremental_startup_disposition): New function.
4765 (General_options::incremental_startup_disposition_): New data member.
4766
e24719f6
CC
47672011-07-06 Cary Coutant <ccoutant@google.com>
4768
4769 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
4770 input file index to Script_info ctor.
4771 (Sized_incremental_binary::do_file_has_changed): Find the
4772 command-line argument for files named in scripts.
4773 * incremental.h (Script_info::Script_info): New ctor
4774 with input file index.
4775 (Script_info::input_file_index): New function.
4776 (Script_info::input_file_index_): New data member.
4777 (Incremental_binary::get_library): Add const.
4778 (Incremental_binary::get_script_info): Add const.
4779 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
4780 * testsuite/Makefile.am (incremental_test_5): New test case.
4781 (incremental_test_6): New test case.
4782 * testsuite/Makefile.in: Regenerate.
4783
8f7c81e8
CC
47842011-07-06 Cary Coutant <ccoutant@google.com>
4785
4786 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
4787 debug output when command lines differ.
4788
9fbd3822
CC
47892011-07-06 Cary Coutant <ccoutant@google.com>
4790
4791 * incremental.cc (Incremental_inputs::report_command_line): Ignore
4792 --incremental-patch option.
4793 * layout.cc (Free_list::allocate): Extend allocation beyond original
4794 end if enabled.
4795 (Layout::make_output_section): Mark sections that should get
4796 patch space.
4797 * options.cc (parse_percent): New function.
4798 * options.h (parse_percent): New function.
4799 (DEFINE_percent): New macro.
4800 (General_options): Add --incremental-patch option.
4801 * output.cc (Output_section::Output_section): Initialize new data
4802 members.
4803 (Output_section::add_input_section): Print section name when out
4804 of patch space.
4805 (Output_section::add_output_section_data): Likewise.
4806 (Output_section::set_final_data_size): Add patch space when
4807 doing --incremental-full.
4808 (Output_section::do_reset_address_and_file_offset): Remove patch
4809 space.
4810 (Output_segment::set_section_list_addresses): Print debug output
4811 only if --incremental-update.
4812 * output.h (Output_section::set_is_patch_space_allowed): New function.
4813 (Output_section::is_patch_space_allowed_): New data member.
4814 (Output_section::patch_space_): New data member.
4815 * parameters.cc (Parameters::incremental_full): New function.
4816 * parameters.h (Parameters::incremental_full): New function
4817 * testsuite/Makefile.am (incremental_test_2): Add test for
4818 --incremental-patch option.
4819 * testsuite/Makefile.in: Regenerate.
4820 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
4821 (t18): Remove function body.
4822
f6cccc2c
DK
48232011-07-05 Doug Kwan <dougkwan@google.com>
4824
4825 PR gold/12771
4826 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
4827 Arm_Address type for relocation result.
4828 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
4829 overflow check.
4830 (Arm_relocate_functions::abs32): Use unaligned access.
4831 (Arm_relocate_functions::rel32): Ditto.
4832 (Arm_relocate_functions::prel31): Ditto.
4833 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
4834 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
4835 static data relocations.
4836 * testsuite/Makefile.in: Regnerate.
4837 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
4838
28a13fec
ILT
48392011-07-05 Ian Lance Taylor <iant@google.com>
4840
4841 PR gold/12392
4842 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
4843 symbols if necessary.
4844 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4845
24d47b34
ILT
48462011-07-05 Ian Lance Taylor <iant@google.com>
4847
4848 PR gold/12952
4849 * resolve.cc (Symbol::override_base_with_special): Simply override
4850 version with special symbol version, ignoring previous version.
4851
41f9cbbe
ILT
48522011-07-05 Ian Lance Taylor <iant@google.com>
4853
4854 * object.cc (Sized_relobj_file::include_section_group): Add
4855 information to comment about signature location.
4856
886288f1
ILT
48572011-07-02 Ian Lance Taylor <iant@google.com>
4858
4859 PR gold/12957
4860 * options.h (class General_options): Add -f and -F.
4861 * options.cc (General_options::finalize): Fatal error if -f/-F
4862 are used without -shared.
4863 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
4864
ae3a6d4f
ILT
48652011-07-02 Ian Lance Taylor <iant@google.com>
4866
4867 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
4868
21131061
ILT
48692011-07-01 Ian Lance Taylor <iant@google.com>
4870
4871 PR gold/12525
4872 PR gold/12952
4873 * resolve.cc (Symbol::override_base_with_special): Don't override
4874 the version if the overriding symbol has a different name.
4875 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
4876 all callers. If we give an error about an undefined version,
4877 define the base version if necessary.
4878 * dynobj.h (class Versions): Update declaration.
4879 * testsuite/weak_alias_test_5.cc: New file.
4880 * testsuite/weak_alias_test.script: New file.
4881 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
4882 and versioned_alias have the right value, and call t2.
4883 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
4884 weak_alias_test_5.so.
4885 (weak_alias_test_LDADD): Likewise.
4886 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
4887 * testsuite/Makefile.in: Rebuild.
4888
611062c0
ILT
48892011-07-01 Ian Lance Taylor <iant@google.com>
4890
4891 PR gold/12525
4892 * options.h (class General_options): Support -z notext.
4893 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
4894 -Wl,-z,notext.
4895 (two_file_shared_nonpic.so): Likewise.
4896 (two_file_shared_mixed.so): Likewise.
4897 (two_file_shared_mixed_1.so): Likewise.
4898 (weak_undef_lib_nonpic.so): Likewise.
4899 (alt/weak_undef_lib_nonpic.so): Likewise.
4900 (tls_test_shared_nonpic.so): Likewise.
4901 * testsuite/Makefile.in: Rebuild.
4902
328c7c2f
ILT
49032011-07-01 Ian Lance Taylor <iant@google.com>
4904
4905 PR gold/12525
4906 * configure.ac: Test whether static linking works, setting
4907 the automake conditional HAVE_STATIC.
4908 * testsuite/Makefile.am: Disable tests using -static if
4909 HAVE_STATIC is not true.
4910 * configure, testsuite/Makefile.in: Rebuild.
4911
02d7cd44
ILT
49122011-07-01 Ian Lance Taylor <iant@google.com>
4913
4914 PR gold/12525
4915 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
4916 Assert if we see DW_EH_PE_indirect.
4917 * target.h (Target::ehframe_datarel_base): New function.
4918 (Target::do_ehframe_datarel_base): New target function.
4919 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
4920 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
4921 function.
4922
07a60597
ILT
49232011-07-01 Ian Lance Taylor <iant@google.com>
4924
4925 PR gold/12571
4926 * options.h (class General_options): Add
4927 --ld-generated-unwind-info.
4928 * ehframe.cc (Fde::write): Add address parameter. Change all
4929 callers. If associated with PLT, fill in address and size.
4930 (Cie::set_output_offset): Only add merge mapping if there is an
4931 object.
4932 (Cie::write): Add address parameter. Change all callers.
4933 (Eh_frame::add_ehframe_for_plt): New function.
4934 * ehframe.h (class Fde): Update declarations. Move shndx_ and
4935 input_offset_ fields into union u_, with new plt field.
4936 (Fde::Fde): Adjust for new union field.
4937 (Fde::Fde) [Output_data version]: New constructor.
4938 (Fde::add_mapping): Only add merge mapping if there is an object.
4939 (class Cie): Update declarations.
4940 (class Eh_frame): Declare add_ehframe_for_plt.
4941 * layout.cc (Layout::layout_eh_frame): Break out code into
4942 make_eh_frame_section, and call it.
4943 (Layout::make_eh_frame_section): New function.
4944 (Layout::add_eh_frame_for_plt): New function.
4945 * layout.h (class Layout): Update declarations.
4946 * merge.cc (Merge_map::add_mapping): Add assertion.
4947 * i386.cc: Include "dwarf.h".
4948 (class Output_data_plt_i386): Make first_plt_entry,
4949 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
4950 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4951 and plt_eh_frame_fde.
4952 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
4953 boundary. Call add_eh_frame_for_plt if appropriate.
4954 * x86_64.cc: Include "dwarf.h".
4955 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
4956 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
4957 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
4958 and plt_eh_frame_fde.
4959 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
4960 appropriate.
4961
14788a3f
ILT
49622011-06-29 Ian Lance Taylor <iant@google.com>
4963
4964 PR gold/12629
4965 * object.cc (Sized_relobj_file::layout_section): Change shdr
4966 parameter to be const.
4967 (Sized_relobj_file::layout_eh_frame_section): New function, broken
4968 out of do_layout.
4969 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
4970 appropriate. Call layout_eh_frame_section.
4971 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
4972 sections.
4973 * object.h (class Sized_relobj_file): Update declarations.
4974
6c21fce1
ILT
49752011-06-29 Ian Lance Taylor <iant@google.com>
4976
37e41b03 4977 PR gold/12652
6c21fce1
ILT
4978 * script.cc (Token::integer_value): Accept trailing M/m/K/k
4979 modifier.
4980 (Lex::gather_token): Accept trailing M/m/K/k for integers.
4981
4d5e4e62
ILT
49822011-06-29 Ian Lance Taylor <iant@google.com>
4983
4984 PR gold/12675
4985 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
4986 SHT_X86_64_UNWIND.
4987 * layout.cc (Layout::layout_eh_frame): Likewise.
4988
886f533a
ILT
49892011-06-29 Ian Lance Taylor <iant@google.com>
4990
4991 PR gold/12695
4992 * layout.cc (Layout::symtab_section_shndx): New function.
4993 * layout.h (class Layout): Declare symtab_section_shndx.
4994 * output.cc (Output_section::write_header): Call it.
4995
f3ae1b28
ILT
49962011-06-29 Ian Lance Taylor <iant@google.com>
4997
4998 PR gold/12818
4999 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
5000 symbols which are not used in a relocation.
5001
aecf301f
ILT
50022011-06-28 Ian Lance Taylor <iant@google.com>
5003
5004 PR gold/12898
5005 * layout.cc (Layout::segment_precedes): Don't crash if a linker
5006 script create indistinguishable segments.
5007 (Layout::set_segment_offsets): Use stable_sort when sorting
5008 segments. Pass this to Compare_segments constructor.
5009 * layout.h (class Layout): Make segment_precedes non-static.
5010 (class Compare_segments): Change from struct to class. Add
5011 layout_ field. Add constructor.
5012 * script-sections.cc
5013 (Script_sections::attach_sections_using_phdrs_clause): Rename
5014 local orphan to is_orphan. Don't report failure to put empty
5015 section in segment. On attachment failure, report name of
5016 section, and attach to first PT_LOAD segment.
5017
03ef7571
ILT
50182011-06-28 Ian Lance Taylor <iant@google.com>
5019
5020 PR gold/12934
5021 * target-select.cc (Target_selector::Target_selector): Add
5022 emulation parameter. Change all callers.
5023 (select_target_by_bfd_name): Rename from select_target_by_name.
5024 Change all callers.
5025 (select_target_by_emulation): New function.
5026 (supported_emulation_names): New function.
5027 * target-select.h (class Target_selector): Add emulation_ field.
5028 Update declarations.
5029 (Target_selector::recognize_by_bfd_name): Rename from
5030 recognize_by_name. Change all callers.
5031 (Target_selector::supported_bfd_names): Rename from
5032 supported_names. Change all callers.
5033 (Target_selector::recognize_by_emulation): New function.
5034 (Target_selector::supported_emulations): New function.
5035 (Target_selector::emulation): New function.
5036 (Target_selector::do_recognize_by_bfd_name): Rename from
5037 do_recognize_by_name. Change all callers.
5038 (Target_selector::do_supported_bfd_names): Rename from
5039 do_supported_names. Change all callers.
5040 (Target_selector::do_recognize_by_emulation): New function.
5041 (Target_selector::do_supported_emulations): New function.
5042 (select_target_by_bfd_name): Change name in declaration.
5043 (select_target_by_emulation): Declare.
5044 (supported_emulation_names): Declare.
5045 * parameters.cc (parameters_force_valid_target): Try to find
5046 target based on emulation from -m option.
5047 * options.h (class General_options): Change doc string for -m.
5048 * options.cc (help): Print emulations.
5049 (General_options::parse_V): Likewise.
5050 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
5051 Add emulation parameter. Change all callers.
5052
200b2bb9
ILT
50532011-06-28 Ian Lance Taylor <iant@google.com>
5054
5055 * target.h (class Target): Add osabi_ field.
5056 (Target::osabi): New function.
5057 (Target::set_osabi): New function.
5058 (Target::Target): Initialize osabi_.
5059 (Target::do_adjust_elf_header): Make pure virtual.
5060 (Sized_target::do_adjust_elf_header): Declare.
5061 * target.cc (Sized_target::do_adjust_elf_header): New function.
5062 (class Sized_target): Instantiate all versions.
5063 * freebsd.h (class Target_freebsd): Remove.
5064 (Target_selector_freebsd::do_recognize): Call set_osabi on
5065 Target.
5066 (Target_selector_freebsd::do_recognize_by_name): Likewise.
5067 (Target_selector_freebsd::set_osabi): Remove.
5068 * i386.cc (class Target_i386): Inherit from Sized_target rather
5069 than Target_freebsd.
5070 * x86_64.cc (class Target_x86_64): Likewise.
5071
b3ce541e
ILT
50722011-06-28 Ian Lance Taylor <iant@google.com>
5073
5074 * target.h (Target::can_check_for_function_pointers): Rewrite.
5075 Make non-virtual.
5076 (Target::can_icf_inline_merge_sections): Likewise.
5077 (Target::section_may_have_icf_unsafe_poineters): Likewise.
5078 (Target::Target_info): Add can_icf_inline_merge_sections field.
5079 (Target::do_can_check_for_function_pointers): New virtual
5080 function.
5081 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
5082 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
5083 from can_check_for_function_pointers, move in file.
5084 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
5085 section_may_have_icf_unsafe_poineters, move in file.
5086 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
5087 * i386.cc (Target_i386::do_can_check_for_function_pointers):
5088 Rename from can_check_for_function_pointers, move in file.
5089 (Target_i386::can_icf_inline_merge_sections): Remove.
5090 (Target_i386::i386_info): Initialize
5091 can_icf_inline_merge_sections.
5092 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
5093 Initialize can_icf_inline_merge_sections.
5094 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
5095 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
5096 Rename from can_check_for_function_pointers, move in file.
5097 (Target_x86_64::can_icf_inline_merge_sections): Remove.
5098 (Target_x86_64::x86_64_info): Initialize
5099 can_icf_inline_merge_sections.
5100 * testsuite/testfile.cc (Target_test::test_target_info):
5101 Likewise.
5102 * icf.cc (get_section_contents): Correct formatting.
5103
6d1c4efb
ILT
51042011-06-27 Ian Lance Taylor <iant@google.com>
5105
5106 * symtab.cc (Symbol::versioned_name): New function.
5107 (Symbol_table::add_to_final_symtab): Use versioned_name when
5108 appropriate.
5109 (Symbol_table::sized_write_symbol): Likewise.
5110 * symtab.h (class Symbol): Declare versioned_name.
5111 * stringpool.h (class Stringpool_template): Add variant of add
5112 which takes a std::basic_string.
5113 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
5114 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
5115 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
5116 (ver_test_12.o): New target.
5117 * testsuite/Makefile.in: Rebuild.
5118
57eb9b50
DK
51192011-06-27 Doug Kwan <dougkwan@google.com>
5120
5121 * arm.cc (Arm_relocate_functions::thm_jump8,
5122 Arm_relocate_functions::thm_jump11): Use a wider signed
5123 type to compute offset.
5124 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
5125 arm_thm_jump8.
5126 * testsuite/Makefile.in: Regenerate.
5127 * testsuite/arm_branch_in_range.sh: Check test results of
5128 arm_thm_jump11 and arm_thm_jump8.
5129 * testsuite/arm_thm_jump11.s: New test source file.
5130 * testsuite/arm_thm_jump11.t: New linker script.
5131 * testsuite/arm_thm_jump8.s: New test source file.
5132 * testsuite/arm_thm_jump8.t: New linker script.
5133
487b39df
ILT
51342011-06-24 Ian Lance Taylor <iant@google.com>
5135
5136 * layout.cc: Include "object.h".
5137 (ctors_sections_in_init_array): New static variable.
5138 (Layout::is_ctors_in_init_array): New function.
5139 (Layout::layout): Add entry to ctors_sections_in_init_array if
5140 appropriate.
5141 * layout.h (class Layout): Declare is_ctors_in_init_array.
5142 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
5143 is_ctors_reverse_view is set.
5144 (Sized_relobj_file::write_sections): Add layout parameter. Change
5145 all callers. Set is_ctors_reverse_view field of View_size.
5146 (Sized_relobj_file::reverse_words): New function.
5147 * object.h (Sized_relobj_file::View_size): Add
5148 is_ctors_reverse_view field.
5149 (class Sized_relobj_file): Update declarations.
5150 * testsuite/initpri3.c: New test.
5151 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
5152 initpri3b.
5153 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
5154 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
5155 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
5156 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
5157 * testsuite/Makefile.in: Rebuild.
5158
472076e4
CC
51592011-06-24 Cary Coutant <ccoutant@google.com>
5160
5161 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
5162 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
5163 (debug_msg_cdebug.err): New targets.
5164 * testsuite/Makefile.in: Regenerate.
5165 * testsuite/debug_msg.sh: Check output of link with compressed debug.
5166 Fix checks for link with shared library.
5167
a60af0db
DK
51682011-06-24 Doug Kwan <dougkwan@google.com>
5169
5170 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
5171 skip empty text sections.
5172 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
5173
5393d741
ILT
51742011-06-22 Ian Lance Taylor <iant@google.com>
5175
5176 PR gold/12910
5177 * options.h (class General_options): Add --ctors-in-init-array.
5178 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
5179 friends as SHT_PROGBITS for merging sections.
5180 (Layout::layout): Remove special handling of .init_array and
5181 friends. Don't sort if doing relocatable link. Sort for .ctors
5182 and .dtors if ctors_in_init_array.
5183 (Layout::make_output_section): Force correct section types for
5184 .init_array and friends. Don't sort if doing relocatable link,
5185 Don't sort .ctors and .dtors if ctors_in_init_array.
5186 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
5187 (Layout::output_section_name): Add relobj parameter. Change all
5188 callers. Handle .ctors. and .dtors. in code rather than table.
5189 Handle .ctors and .dtors if ctors_in_init_array.
5190 (Layout::match_file_name): New function, moved from output.cc.
5191 * layout.h (class Layout): Update declarations.
5192 * output.cc: Include "layout.h".
5193 (Input_section_sort_entry::get_priority): New function.
5194 (Input_section_sort_entry::match_file_name): Just call
5195 Layout::match_file_name.
5196 (Output_section::Input_section_sort_init_fini_compare::operator()):
5197 Handle .ctors and .dtors. Sort by explicit priority rather than
5198 by name.
5199 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
5200 * testsuite/initpri2.c: New test.
5201 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
5202 (check_PROGRAMS): Add initpri2.
5203 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
5204 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
5205 * configure, testsuite/Makefile.in: Rebuild.
5206
e1f74f98
ILT
52072011-06-19 Ian Lance Taylor <iant@google.com>
5208
5209 PR gold/12880
5210 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
5211 .interp section to a PT_INTERP segment even if we have seen a
5212 --dynamic-linker option. Don't do it if we have seen a PHDRS
5213 clause in a linker script.
5214 (Layout::finalize): Don't create a .interp section if we've
5215 already create a PT_INTERP segment.
5216 (Layout::create_interp): Always call choose_output_section (revert
5217 patch of 2011-06-17). Don't create PT_INTERP segment.
5218 * script-sections.cc
5219 (Script_sections::create_note_and_tls_segments): Add a .interp
5220 section to a PT_INTERP segment even if we have seen a
5221 --dynamic-linker option.
5222
766f91bb
ILT
52232011-06-18 Ian Lance Taylor <iant@google.com>
5224
5225 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
5226 merely because a non-PT_LOAD segment has a dynamic reloc.
5227
0d212c3a
ILT
52282011-06-18 Ian Lance Taylor <iant@google.com>
5229
5230 * layout.cc (Layout::finish_dynamic_section): Don't create
5231 DT_FLAGS entry if not needed.
5232
911a5072
ILT
52332011-06-18 Ian Lance Taylor <iant@google.com>
5234
5235 PR gold/12745
5236 * layout.cc (Layout::layout_eh_frame): Correct handling of
5237 writable .eh_frame section.
5238
534b4e5f
ILT
52392011-06-17 Ian Lance Taylor <iant@google.com>
5240
5241 PR gold/12893
5242 * resolve.cc (Symbol_table::resolve): Don't give an error if a
5243 symbol is redefined with the exact same object and value.
5244
10b4f102
ILT
52452011-06-17 Ian Lance Taylor <iant@google.com>
5246
5247 PR gold/12880
5248 * layout.h (class Layout): Add interp_segment_ field.
5249 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
5250 (Layout::attach_allocated_section_to_segment): If making shared
5251 library, put .interp section in PT_INTERP segment.
5252 (Layout::finalize): Also call create_interp if -dynamic-linker
5253 option was used.
5254 (Layout::create_interp): Assert that there is no PT_INTERP
5255 segment. If not using a SECTIONS clause, use make_output_section.
5256 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
5257 * script-sections.cc
5258 (Script_sections::create_note_and_tls_segments): If making shared
5259 library, put .interp section in PT_INTERP segment.
5260
a29b0dad
ILT
52612011-06-17 Ian Lance Taylor <iant@google.com>
5262
e588ea8d
ILT
5263 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
5264 when making a shared library.
5265
52662011-06-17 Ian Lance Taylor <iant@google.com>
5267
5268 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
5269 parameter. Change all callers. Don't issue warning about PC32
5270 against locally defined symbol.
a29b0dad 5271
9d3b0698
ILT
52722011-06-16 Ian Lance Taylor <iant@google.com>
5273
5274 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
5275 occurs in same object.
5276
85b0f90c
AM
52772011-06-14 Alan Modra <amodra@gmail.com>
5278
5279 * po/POTFILES.in: Regenerate.
5280
a94907d9
ILT
52812011-06-09 Ian Lance Taylor <iant@google.com>
5282
5283 * script-sections.cc
5284 (Orphan_output_section::set_section_addresses): For a relocatable
5285 link set address to 0.
5286
4fb3a1c3
CC
52872011-06-09 Cary Coutant <ccoutant@google.com>
5288
5289 PR gold/12804
5290 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
5291 used with --compress-debug-sections.
5292 * gold/object.cc (Sized_relobj_file::do_layout): Report
5293 uncompressed size of compressed input sections.
5294
61220854
CC
52952011-06-08 Cary Coutant <ccoutant@google.com>
5296
5297 PR gold/12804
5298 * testsuite/two_file_test_2_v1.cc: Change initialization of
5299 v2 to keep it in .data.
5300
e6455dfb
CC
53012011-06-07 Cary Coutant <ccoutant@google.com>
5302
5303 * common.cc (Symbol_table::do_allocate_commons_list): Call
5304 gold_fallback.
5305 * errors.cc (Errors::fatal): Adjust call to gold_exit.
5306 (Errors::fallback): New function.
5307 (gold_fallback): New function.
5308 * errors.h (Errors::fallback): New function.
5309 * gold.cc (gold_exit): Change status parameter to enum; adjust
5310 all callers.
5311 (queue_initial_tasks): Call gold_fallback.
5312 * gold.h: Include cstdlib.
5313 (Exit_status): New enum type.
5314 (gold_exit): Change status parameter to enum.
5315 (gold_fallback): New function.
5316 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
5317 (Layout::create_symtab_sections): Likewise.
5318 (Layout::create_shdrs): Likewise.
5319 * main.cc (main): Adjust call to gold_exit.
5320 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
5321 (Output_data_got::add_got_entry_pair): Likewise.
5322 (Output_section::add_input_section): Likewise.
5323 (Output_section::add_output_section_data): Likewise.
5324 (Output_segment::set_section_list_addresses): Likewise.
5325 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
5326
fb0e076f
CC
53272011-06-07 Cary Coutant <ccoutant@google.com>
5328
5329 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
5330 for incremental links.
5331 * output.cc (Output_segment::set_section_list_addresses): Remove
5332 FIXME and test for TLS or BSS.
5333
a5ee4d5d
CC
53342011-06-07 Cary Coutant <ccoutant@google.com>
5335
5336 * testsuite/Makefile.am: Add incremental_copy_test,
5337 incremental_common_test_1.
5338 * testsuite/Makefile.in: Regenerate.
5339 * testsuite/common_test_1_v1.c: New source file.
5340 * testsuite/common_test_1_v2.c: New source file.
5341 * testsuite/copy_test_v1.cc: New source file.
5342
5146f448
CC
53432011-06-07 Cary Coutant <ccoutant@google.com>
5344
5345 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
5346 update, allocate common from bss section's free list.
5347 * incremental-dump.cc (dump_incremental_inputs): Print flag for
5348 linker-defined symbols.
5349 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
5350 Skip GOT and PLT entries that are no longer referenced.
5351 (Output_section_incremental_inputs::write_info_blocks): Mark
5352 linker-defined symbols.
5353 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
5354 * output.cc (Output_section::allocate): New function.
5355 * output.h (Output_section::allocate): New function.
5356 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
5357 linker-defined symbols.
5358 (Symbol::override_base_with_special): Copy is_predefined_ flag.
5359 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
5360 (Symbol::init_base_output_data): Likewise.
5361 (Symbol::init_base_output_segment): Likewise.
5362 (Symbol::init_base_constant): Likewise.
5363 (Sized_symbol::init_output_data): Likewise.
5364 (Sized_symbol::init_output_segment): Likewise.
5365 (Sized_symbol::init_constant): Likewise.
5366 (Symbol_table::do_define_in_output_data): Likewise.
5367 (Symbol_table::do_define_in_output_segment): Likewise.
5368 (Symbol_table::do_define_as_constant): Likewise.
5369 * symtab.h (Symbol::is_predefined): New function.
5370 (Symbol::init_base_output_data): Add is_predefined parameter.
5371 (Symbol::init_base_output_segment): Likewise.
5372 (Symbol::init_base_constant): Likewise.
5373 (Symbol::is_predefined_): New data member.
5374 (Sized_symbol::init_output_data): Add is_predefined parameter.
5375 (Sized_symbol::init_output_segment): Likewise.
5376 (Sized_symbol::init_constant): Likewise.
5377 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
5378
26d3c67d
CC
53792011-06-07 Cary Coutant <ccoutant@google.com>
5380
5381 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
5382 instead of emit_copy_reloc.
5383 (Copy_relocs::emit_copy_reloc): Refactor.
5384 (Copy_relocs::make_copy_reloc): New function.
5385 (Copy_relocs::add_copy_reloc): Remove.
5386 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
5387 section.
5388 (Copy_relocs::make_copy_reloc): New function.
5389 (Copy_relocs::add_copy_reloc): Remove.
5390 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
5391 unchanged input files.
5392 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
5393 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
5394 Reserve BSS space for COPY relocations.
5395 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5396 (Output_section_incremental_inputs::write_info_blocks): Record
5397 whether a symbol is copied from a shared object.
5398 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
5399 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
5400 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
5401 (Incremental_input_entry_reader::get_output_symbol_index): Add
5402 is_copy parameter.
5403 (Incremental_binary::emit_copy_relocs): New function.
5404 (Incremental_binary::do_emit_copy_relocs): New function.
5405 (Sized_incremental_binary::Sized_incremental_binary): Initialize
5406 new data member.
5407 (Sized_incremental_binary::add_copy_reloc): New function.
5408 (Sized_incremental_binary::do_emit_copy_relocs): New function.
5409 (Sized_incremental_binary::Copy_reloc): New struct.
5410 (Sized_incremental_binary::Copy_relocs): New typedef.
5411 (Sized_incremental_binary::copy_relocs_): New data member.
5412 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
5413 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
5414 * target.h (Sized_target::emit_copy_reloc): New function.
5415 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
5416
7cdb37d9
CC
54172011-06-02 Cary Coutant <ccoutant@google.com>
5418
5419 PR gold/12163
5420 * gold/archive.cc (Archive::Archive): Initialize new data member.
5421 (Archive::include_all_members): Return if archive has already been
5422 included.
5423 * gold/archive.h (Archive::include_all_members_): New data member.
5424
cc643b88
NC
54252011-06-02 Nick Clifton <nickc@redhat.com>
5426
5427 * dynobj.h: Fix spelling mistake in comment.
5428 * output.cc: Likewise.
5429
f62a3ca7 54302011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 5431 Asier Llano
f62a3ca7
DK
5432
5433 PR gold/12826
cc643b88 5434 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
5435 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
5436 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
5437 redundant arm_exidx_test.so.
5438 * testsuite/Makefile.in: Regenerate.
5439 (check_SCRIPTS): Add pr12826.sh
5440 (check_DATA): Add pr12826.stdout
5441 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
5442 * testsuite/pr12826.sh: New file.
5443 * testsuite/pr12826_1.s: Ditto.
5444 * testsuite/pr12826_1.s: Ditto.
5445
8dbe1edc
ILT
54462011-05-30 Ian Lance Taylor <iant@google.com>
5447
5448 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
5449 sections.
5450
c49875be
ILT
54512011-05-29 Ian Lance Taylor <iant@google.com>
5452
5453 PR gold/12804
5454 * testsuite/Makefile.am: Use different file name for two_file_test
5455 temporary file for each incremental test.
5456 * testsuite/Makefile.in: Rebuild.
5457
69d53f7a
ILT
54582011-05-29 Ian Lance Taylor <iant@google.com>
5459
5460 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
5461 binary input file is empty.
5462
41d0ab5f
ILT
54632011-05-27 Ian Lance Taylor <iant@google.com>
5464
5465 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
5466 (ver_test_9.so): Likewise.
5467 * testsuite/Makefile.in: Rebuild.
5468
89d8a36b
CC
54692011-05-26 Cary Coutant <ccoutant@google.com>
5470
5471 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
5472 * incremental.cc (Incremental_inputs::report_input_section): Fix
5473 comment, indentation.
5474 (Incremental_inputs::report_comdat_group): New function.
5475 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5476 of data for incremental input file entry.
5477 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
5478 group count, COMDAT group signatures.
5479 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
5480 an unchanged input file.
5481 * incremental.h (Incremental_object_entry::Incremental_object_entry):
5482 Initialize new data member.
5483 (Incremental_object_entry::add_comdat_group): New function.
5484 (Incremental_object_entry::get_comdat_group_count): New function.
5485 (Incremental_object_entry::get_comdat_signature_key): New function.
5486 (Incremental_object_entry::groups_): New data member.
5487 (Incremental_inputs::report_comdat_group): New function.
5488 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
5489 data for incremental input file entry.
5490 (Incremental_input_entry_reader::get_comdat_group_count): New function.
5491 (Incremental_input_entry_reader::get_input_section): Adjust size of
5492 data for incremental input file entry.
5493 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
5494 (Incremental_input_entry_reader::get_comdat_group_signature): New
5495 function.
5496 * object.cc (Sized_relobj::include_section_group): Report kept
5497 COMDAT groups for incremental links.
5498
1706a06f
ILT
54992011-05-24 David Meyer <pdox@google.com>
5500
5501 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
5502 with name parameter. Add found_name parameter.
5503 * fileread.cc (Input_file::find_file): Adjust code accordingly.
5504 * dirsearch.h (class Dirsearch): Update declaration.
5505
a10ae760
ILT
55062011-05-24 Ian Lance Taylor <iant@google.com>
5507
5508 * archive.cc (Library_base::should_include_member): Pull in object
5509 from archive if it defines the entry symbol.
5510 * parameters.cc (Parameters::entry): New function.
5511 * parameters.h (class Parameters): Declare entry.
5512 * output.h (class Output_file_header): Remove entry_ field.
5513 * output.cc (Output_file_header::Output_file_header): Remove entry
5514 parameter. Change all callers.
5515 (Output_file_header::entry): Use parameters->entry.
5516 * gold.cc (queue_middle_tasks): Likewise.
5517 * plugin.cc (Plugin_hook::run): Likewise.
5518
aa92d6ed
CC
55192011-05-24 Cary Coutant <ccoutant@google.com>
5520
5521 * gold.cc (queue_initial_tasks): Pass incremental base filename
5522 to Output_file::open_base_file; don't print error message.
5523 * incremental-dump.cc (main): Adjust call to
5524 Output_file::open_for_modification.
5525 * incremental-dump.cc (main): Likewise.
5526 * incremental.cc (Incremental_inputs::report_command_line):
5527 Ignore --incremental-base option when comparing command lines.
5528 Ignore parameter when given as separate argument.
5529 * options.h (class General_options): Add --incremental-base.
5530 * output.cc (Output_file::Output_file):
5531 (Output_file::open_base_file): Add base_name and writable parameters;
5532 read base file into new file; print error message here.
5533 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5534 callers.
5535 * output.h (Output_file::open_for_modification): Rename to...
5536 (Output_file::open_base_file): ...this; add base_name and
5537 writable parameters; adjust all callers.
5538 (Output_file::map_no_anonymous): Add writable parameter; adjust all
5539 callers.
5540 * testsuite/Makefile.am (incremental_test_4): Test
5541 --incremental-base.
5542 * testsuite/Makefile.in: Regenerate.
5543
2eedd706
CC
55442011-05-24 Cary Coutant <ccoutant@google.com>
5545
5546 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
5547 incremental_test_4.
5548 * testsuite/Makefile.in: Regenerate.
5549 * testsuite/two_file_test_1_v1.cc: New test source file.
5550 * testsuite/two_file_test_1b_v1.cc: New test source file.
5551 * testsuite/two_file_test_2_v1.cc: New test source file.
5552
0f1c85a6
CC
55532011-05-24 Cary Coutant <ccoutant@google.com>
5554
5555 * dynobj.h (Dynobj::do_dynobj): New function.
5556 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
5557 flag and soname for shared objects.
5558 * incremental.cc (Incremental_inputs::report_object): Make
5559 either Incremental_object_entry or Incremental_dynobj_entry; add
5560 soname to string table.
5561 (Incremental_inputs::report_input_section): Add assertion.
5562 (Output_section_incremental_inputs::set_final_data_size): Adjust
5563 type of input file entry for shared libraries; adjust size of
5564 shared library info entry.
5565 (Output_section_incremental_inputs::write_input_files): Write
5566 as_needed flag for shared libraries.
5567 (Output_section_incremental_inputs::write_info_blocks): Adjust type
5568 of input file entry for shared libraries; write soname.
5569 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
5570 soname from incremental info.
5571 * incremental.h (enum Incremental_input_flags): Add
5572 INCREMENTAL_INPUT_AS_NEEDED.
5573 (Incremental_input_entry::Incremental_input_entry): Initialize new
5574 data member.
5575 (Incremental_input_entry::set_as_needed): New function.
5576 (Incremental_input_entry::as_needed): New function.
5577 (Incremental_input_entry::do_dynobj_entry): New function.
5578 (Incremental_input_entry::as_needed_): New data member.
5579 (Incremental_object_entry::Incremental_object_entry): Don't check
5580 for shared library.
5581 (Incremental_object_entry::do_type): Likewise.
5582 (class Incremental_dynobj_entry): New class.
5583 (Incremental_input_entry_reader::as_needed): New function.
5584 (Incremental_input_entry_reader::get_soname): New function.
5585 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
5586 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
5587 size of shared library info entry.
58797674 5588 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
5589 incremental link when adding DT_NEEDED entries.
5590 * object.h (Object::Object): Initialize new data member.
5591 (Object::dynobj): New function.
5592 (Object::set_as_needed): New function.
5593 (Object::as_needed): New function.
5594 (Object::do_dynobj): New function.
5595 (Object::as_needed_): New data member.
5596
6fa2a40b
CC
55972011-05-24 Cary Coutant <ccoutant@google.com>
5598
5599 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
5600 info; adjust display of GOT entries.
5601 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5602 vector of input objects; remove file_status_.
5603 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
5604 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
5605 got_plt reader; call target hooks to reserve GOT entries.
5606 (Output_section_incremental_inputs::set_final_data_size): Adjust size
5607 of input file info header and GOT info entry.
5608 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
5609 relocation info.
5610 (Got_plt_view_info::got_descriptor): Remove.
5611 (Got_plt_view_info::sym_index): New data member.
5612 (Got_plt_view_info::input_index): New data member.
5613 (Local_got_offset_visitor::visit): Write input file index.
5614 (Global_got_offset_visitor::visit): Write 0 for input file index.
5615 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
5616 with sym_index and input_index.
5617 (Output_section_incremental_inputs::write_got_plt): Adjust size of
5618 incremental info GOT entry; replace got_descriptor with input_index.
5619 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
5620 map from input file index to object.
5621 (Sized_relobj_incr::do_layout): Replace direct data member reference
5622 with accessor function.
5623 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
5624 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
5625 Adjust size of input file info header.
5626 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
5627 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
5628 (Incremental_input_entry_reader::get_input_section): Adjust size of
5629 input file info header.
5630 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
5631 of incremental info GOT entry.
5632 (Incremental_got_plt_reader::get_got_desc): Remove.
5633 (Incremental_got_plt_reader::get_got_symndx): New function.
5634 (Incremental_got_plt_reader::get_got_input_index): New function.
5635 (Sized_incremental_binary::Sized_incremental_binary): Remove
5636 file_status_; add input_objects_.
5637 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
5638 (Sized_incremental_binary::set_file_is_unchanged): Remove.
5639 (Sized_incremental_binary::file_is_unchanged): Remove.
5640 (Sized_incremental_binary::set_input_object): New function.
5641 (Sized_incremental_binary::input_object): New function.
5642 (Sized_incremental_binary::file_status_): Remove.
5643 (Sized_incremental_binary::input_objects_): New data member.
5644 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
5645 references.
5646 (Sized_relobj_incr::invalid_address): Move to base class.
5647 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
5648 class.
5649 (Sized_relobj_incr::do_output_section_offset): Likewise.
5650 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
5651 (Sized_relobj_incr::section_offsets_): Likewise.
5652 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
5653 function.
5654 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
5655 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
5656 with accessor function.
5657 (Sized_relobj_file::do_layout): Likewise.
5658 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
5659 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
5660 (Sized_relobj_file::compute_final_local_value): Replace refs to
5661 section_offsets_ with accessor function.
5662 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
5663 * object.h (Relobj::Relobj): Initialize new data members.
5664 (Relobj::add_dyn_reloc): New function.
5665 (Relobj::first_dyn_reloc): New function.
5666 (Relobj::dyn_reloc_count): New function.
5667 (Relobj::first_dyn_reloc_): New data member.
5668 (Relobj::dyn_reloc_count_): New data member.
5669 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
5670 references.
5671 (Sized_relobj::Address): New typedef.
5672 (Sized_relobj::invalid_address): Move here from child class.
5673 (Sized_relobj::Sized_relobj): Initialize new data members.
5674 (Sized_relobj::sized_relobj): New function.
5675 (Sized_relobj::is_output_section_offset_invalid): Move here from
5676 child class.
5677 (Sized_relobj::get_output_section_offset): Likewise.
5678 (Sized_relobj::local_has_got_offset): Likewise.
5679 (Sized_relobj::local_got_offset): Likewise.
5680 (Sized_relobj::set_local_got_offset): Likewise.
5681 (Sized_relobj::do_for_all_local_got_entries): Likewise.
5682 (Sized_relobj::clear_got_offsets): New function.
5683 (Sized_relobj::section_offsets): Move here from child class.
5684 (Sized_relobj::do_output_section_offset): Likewise.
5685 (Sized_relobj::do_set_section_offset): Likewise.
5686 (Sized_relobj::Local_got_offsets): Likewise.
5687 (Sized_relobj::local_got_offsets_): Likewise.
5688 (Sized_relobj::section_offsets_): Likewise.
5689 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
5690 references.
5691 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
5692 class.
5693 (Sized_relobj_file::sized_relobj): New function
5694 (Sized_relobj_file::local_has_got_offset): Move to base class.
5695 (Sized_relobj_file::local_got_offset): Likewise.
5696 (Sized_relobj_file::set_local_got_offset): Likewise.
5697 (Sized_relobj_file::get_output_section_offset): Likewise.
5698 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
5699 (Sized_relobj_file::do_output_section_offset): Likewise.
5700 (Sized_relobj_file::do_set_section_offset): Likewise.
5701 (Sized_relobj_file::Local_got_offsets): Likewise.
5702 (Sized_relobj_file::local_got_offsets_): Likewise.
5703 (Sized_relobj_file::section_offsets_): Likewise.
5704 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
5705 (all constructors).
5706 (set_needs_dynsym_index): Convert relobj to derived class pointer.
5707 (Output_reloc::get_symbol_index): Likewise.
5708 (Output_reloc::local_section_offset): Likewise.
5709 (Output_reloc::get_address): Likewise.
5710 (Output_reloc::symbol_value): Likewise.
5711 (Output_data_got::reserve_slot): Move to class definition.
5712 (Output_data_got::reserve_local): New function.
5713 (Output_data_got::reserve_slot_for_global): Remove.
5714 (Output_data_got::reserve_global): New function.
5715 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
5716 (all constructors, two instantiations).
5717 (Output_reloc::get_relobj): New function (two instantiations).
5718 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
5719 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
5720 (Output_data_reloc::add_global): Adjust type of relobj.
5721 (Output_data_reloc::add_global_relative): Likewise.
5722 (Output_data_reloc::add_symbolless_global_addend): Likewise.
5723 (Output_data_reloc::add_local): Likewise.
5724 (Output_data_reloc::add_local_relative): Likewise.
5725 (Output_data_reloc::add_symbolless_local_addend): Likewise.
5726 (Output_data_reloc::add_local_section): Likewise.
5727 (Output_data_reloc::add_output_section): Likewise.
5728 (Output_data_reloc::add_absolute): Likewise.
5729 (Output_data_reloc::add_target_specific): Likewise.
5730 (Output_data_got::reserve_slot): Move definition here.
5731 (Output_data_got::reserve_local): New function.
5732 (Output_data_got::reserve_global): New function.
5733 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
5734 section_offsets_ with accessor function.
5735 (Sized_relobj_file::write_sections): Likewise.
5736 (Sized_relobj_file::do_relocate_sections): Likewise.
5737 * target.h (Sized_target::reserve_local_got_entry): New function.
5738 (Sized_target::reserve_global_got_entry): New function.
5739 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
5740 (Target_x86_64::reserve_global_got_entry): New function.
5741 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
5742
4829d394
CC
57432011-05-23 Cary Coutant <ccoutant@google.com>
5744
5745 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
5746 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
5747 bit when checking got_type.
5748 * incremental.cc (Sized_incremental_binary::setup_readers):
5749 Store symbol table and string table locations; initialize bit vector
5750 of file status flags.
5751 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
5752 unchanged files.
5753 (Sized_incremental_binary::do_process_got_plt): New function.
5754 (Sized_incremental_binary::get_symtab_view): Use stored locations.
5755 (Output_section_incremental_inputs::set_final_data_size): Record
5756 file index for each input file.
5757 (Output_section_incremental_inputs::write_got_plt): Store file index
5758 instead of input entry offset for each GOT entry.
5759 * incremental.h
5760 (Incremental_input_entry::Incremental_input_entry): Initialize new
5761 data member.
5762 (Incremental_input_entry::set_offset): Store file index.
5763 (Incremental_input_entry::get_file_index): New function.
5764 (Incremental_input_entry::file_index_): New data member.
5765 (Incremental_binary::process_got_plt): New function.
5766 (Incremental_binary::do_process_got_plt): New function.
5767 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5768 data members.
5769 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
5770 (Sized_incremental_binary::set_file_is_unchanged): New function.
5771 (Sized_incremental_binary::file_is_unchanged): New function.
5772 (Sized_incremental_binary::do_process_got_plt): New function.
5773 (Sized_incremental_binary::file_status_): New data member.
5774 (Sized_incremental_binary::main_symtab_loc_): New data member.
5775 (Sized_incremental_binary::main_strtab_loc_): New data member.
5776 * output.cc (Output_data_got::Got_entry::write): Add case
5777 RESERVED_CODE.
5778 (Output_data_got::add_global): Call add_got_entry.
5779 (Output_data_got::add_global_plt): Likewise.
5780 (Output_data_got::add_global_with_rel): Likewise.
5781 (Output_data_got::add_global_with_rela): Likewise.
5782 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
5783 (Output_data_got::add_global_pair_with_rela): Likewise.
5784 (Output_data_got::add_local): Call add_got_entry.
5785 (Output_data_got::add_local_plt): Likewise.
5786 (Output_data_got::add_local_with_rel): Likewise.
5787 (Output_data_got::add_local_with_rela): Likewise.
5788 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
5789 (Output_data_got::add_local_pair_with_rela): Likewise.
5790 (Output_data_got::reserve_slot): New function.
5791 (Output_data_got::reserve_slot_for_global): New function.
5792 (Output_data_got::add_got_entry): New function.
5793 (Output_data_got::add_got_entry_pair): New function.
5794 (Output_section::add_output_section_data): Edit FIXME.
5795 * output.h
5796 (Output_section_data_build::Output_section_data_build): New
5797 constructor with size parameter.
5798 (Output_data_space::Output_data_space): Likewise.
5799 (Output_data_got::Output_data_got): Initialize new data member; new
5800 constructor with size parameter.
5801 (Output_data_got::add_constant): Call add_got_entry.
5802 (Output_data_got::reserve_slot): New function.
5803 (Output_data_got::reserve_slot_for_global): New function.
5804 (class Output_data_got::Got_entry): Add RESERVED_CODE.
5805 (Output_data_got::add_got_entry): New function.
5806 (Output_data_got::add_got_entry_pair): New function.
5807 (Output_data_got::free_list_): New data member.
5808 * target.h (Sized_target::init_got_plt_for_update): New function.
5809 (Sized_target::register_global_plt_entry): New function.
5810 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
5811 Initialize new data member; call init; add constructor with PLT count.
5812 (Output_data_plt_x86_64::init): New function.
5813 (Output_data_plt_x86_64::add_relocation): New function.
5814 (Output_data_plt_x86_64::reserve_slot): New function.
5815 (Output_data_plt_x86_64::free_list_): New data member.
5816 (Target_x86_64::init_got_plt_for_update): New function.
5817 (Target_x86_64::register_global_plt_entry): New function.
5818 (Output_data_plt_x86_64::add_entry): Allocate from free list for
5819 incremental updates.
5820 (Output_data_plt_x86_64::add_relocation): New function.
5821 * testsuite/object_unittest.cc (Object_test): Set default options.
5822
ec69d6da
ILT
58232011-05-16 Ian Lance Taylor <iant@google.com>
5824
5825 * options.h (class General_options): Make -i a synonym for -r.
5826
732e31de
ILT
58272011-05-16 Ian Lance Taylor <iant@google.com>
5828
5829 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
5830
403676b5
CC
58312011-05-10 Cary Coutant <ccoutant@google.com>
5832
5833 * object.cc (Sized_relobj::do_count_local_symbols): Check for
5834 strip_all (-s).
5835
5b7b7d6e
ILT
58362011-05-06 Ian Lance Taylor <iant@google.com>
5837
5838 * layout.cc (Layout::layout): If the output section flags change,
5839 update the ordering.
5840
f0f9babf
CC
58412011-04-25 Cary Coutant <ccoutant@google.com>
5842
5843 * incremental-dump.cc (dump_incremental_inputs): Print local
5844 symbol info for each input file.
5845 * incremental.cc
5846 (Output_section_incremental_inputs::set_final_data_size): Add local
5847 symbol info to input file entries in incremental info.
5848 (Output_section_incremental_inputs::write_info_blocks): Likewise.
5849 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
5850 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
5851 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
5852 implementation.
5853 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
5854 (Sized_incr_relobj::do_relocate): Write the local symbols.
5855 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
5856 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
5857 Adjust size of input file header.
5858 (Incremental_inputs_reader::get_local_symbol_offset): New function.
5859 (Incremental_inputs_reader::get_local_symbol_count): New function.
5860 (Incremental_inputs_reader::get_input_section): Adjust size of input
5861 file header.
5862 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
5863 (Sized_incr_relobj::This): New typedef.
5864 (Sized_incr_relobj::sym_size): New const data member.
5865 (Sized_incr_relobj::Local_symbol): New struct.
5866 (Sized_incr_relobj::do_output_local_symbol_count): New function.
5867 (Sized_incr_relobj::do_local_symbol_offset): New function.
5868 (Sized_incr_relobj::local_symbol_count_): New data member.
5869 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
5870 (Sized_incr_relobj::local_symbol_index_): New data member.
5871 (Sized_incr_relobj::local_symbol_offset_): New data member.
5872 (Sized_incr_relobj::local_dynsym_offset_): New data member.
5873 (Sized_incr_relobj::local_symbols_): New data member.
5874 * object.h (Relobj::output_local_symbol_count): New function.
5875 (Relobj::local_symbol_offset): New function.
5876 (Relobj::do_output_local_symbol_count): New function.
5877 (Relobj::do_local_symbol_offset): New function.
5878 (Sized_relobj::do_output_local_symbol_count): New function.
5879 (Sized_relobj::do_local_symbol_offset): New function.
5880
d0a9ace3
ILT
58812011-04-22 Vladimir Simonov <sv@sw.ru>
5882
5883 * descriptors.cc (set_close_on_exec): New function.
5884 (Descriptors::open): Use set_close_on_exec.
5885 * output.cc (S_ISLNK): Define if not defined.
5886
94a3fc8b
CC
58872011-04-22 Cary Coutant <ccoutant@google.com>
5888
5889 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
5890 global symbol map.
5891 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5892 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
5893 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
5894 relocations.
5895 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
5896 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
5897 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
5898 * incremental.h
5899 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
5900 function.
5901 (Incremental_binary::apply_incremental_relocs): New function.
5902 (Incremental_binary::do_apply_incremental_relocs): New function.
5903 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
5904 data member.
5905 (Sized_incremental_binary::add_global_symbol): New function.
5906 (Sized_incremental_binary::global_symbol): New function.
5907 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
5908 (Sized_incremental_binary::symbol_map_): New data member.
5909 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
5910 * target.h (Sized_target::apply_relocation): New function.
5911 * target-reloc.h (apply_relocation): New function.
5912 * x86_64.cc (Target_x86_64::apply_relocation): New function.
5913
c87e4302
DK
59142011-04-22 Doug Kwan <dougkwan@google.com>
5915
5916 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
5917 flag of a SHT_ARM_EXIDX section.
2e702c99 5918 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
5919 * testsuite/Makefile.in: Regenerate.
5920 * testsuite/arm_exidx_test.s: New file.
5921 * testsuite/arm_exidx_test.sh: Same.
5922
e7782cf6
CC
59232011-04-20 Cary Coutant <ccoutant@google.com>
5924
5925 PR gold/12689
5926 * archive.h (Incremental_archive_entry::Archive_member):
5927 Initialize arg_serial_ (second constructor).
5928
308ecdc7
ILT
59292011-04-17 Ian Lance Taylor <iant@google.com>
5930
5931 * object.cc (Relocate_info::location): Simplify location string.
5932 * errors.cc (Errors::error_at_location): Don't print program
5933 name.
5934 (Errors::warning_at_location): Likewise.
5935 (Errors::undefined_symbol): Likewise.
5936 * testsuite/debug_msg.sh: Update accordingly.
5937
bec5b579
CC
59382011-04-14 Cary Coutant <ccoutant@google.com>
5939
5940 * gold/layout.cc (Layout::symtab_section_offset): New function.
5941 * gold/layout.h (Layout::symtab_section_offset): New function.
5942 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
5943
88597d34
ILT
59442011-04-12 Ian Lance Taylor <iant@google.com>
5945
5946 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
5947 with MREMAP_MAYMOVE.
5948 * output.h (class Output_file): Add map_is_allocated_ field.
5949 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
5950 not available, provide stubs. If mremap is not available, #define
5951 it to gold_mremap.
5952 (MREMAP_MAYMOVE): Define if not defined.
5953 (Output_file::Output_file): Initialize map_is_allocated_.
5954 (Output_file::resize): Check map_is_allocated_.
5955 (Output_file::map_anonymous): If mmap fails, use malloc.
5956 (Output_file::unmap): Don't do anything for an anonymous map.
5957 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
5958 is not available, provide stubs.
5959 (File_read::View::~View): Use free rather than delete[].
5960 (File_read::make_view): Use malloc rather than new[]. If mmap
5961 fails, use malloc.
5962 (File_read::find_or_make_view): Use malloc rather than new[].
5963 * gold.h: Remove HAVE_REMAP code.
5964 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
5965 exists. Rename mremap to gold_mremap. If mmap is not available
5966 don't do anything.
5967 * configure, config.in: Rebuild.
5968
11e361bc
ILT
59692011-04-11 Ian Lance Taylor <iant@google.com>
5970
5971 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
5972 initialize local variable v.
5973
cdc29364
CC
59742011-04-11 Cary Coutant <ccoutant@google.com>
5975
5976 * archive.cc (Archive::include_member): Adjust call to
5977 report_object.
5978 (Add_archive_symbols::run): Track argument serial numbers.
5979 (Lib_group::include_member): Likewise.
5980 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
5981 * archive.h (Incremental_archive_entry::Archive_member):
5982 Initialize arg_serial_.
5983 (Archive_member::arg_serial_): New data member.
5984 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
5985 (Sized_dynobj::do_add_symbols): Track symbols when doing an
5986 incremental link.
5987 (Sized_dynobj::do_for_all_local_got_entries): New function.
5988 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
5989 function.
5990 * fileread.cc (get_mtime): New function.
5991 * fileread.h (get_mtime): New function.
5992 * gold.cc (queue_initial_tasks): Check for incremental update.
5993 (process_incremental_input): New function.
5994 (queue_middle_tasks): Don't force valid target for incremental
5995 update.
5996 * incremental-dump.cc (find_input_containing_global): Adjust
5997 size of symbol info entry.
5998 (dump_incremental_inputs): Dump argument serial number and
5999 in_system_directory flag; bias shndx by 1; print symbol names
6000 when dumping per-file symbol lists; use new symbol info readers.
6001 * incremental.cc
6002 (Output_section_incremental_inputs:update_data_size): New function.
6003 (Sized_incremental_binary::setup_readers): Setup input readers
6004 for each input file; build maps for files added from libraries
6005 and scripts.
6006 (Sized_incremental_binary::check_input_args): New function.
6007 (Sized_incremental_binary::do_check_inputs): Build map of argument
6008 serial numbers to input arguments.
6009 (Sized_incremental_binary::do_file_has_changed): Rename
6010 do_file_is_unchanged to this; compare file modification times.
6011 (Sized_incremental_binary::do_init_layout): New function.
6012 (Sized_incremental_binary::do_reserve_layout): New function.
6013 (Sized_incremental_binary::do_get_input_reader): Remove.
6014 (Sized_incremental_binary::get_symtab_view): New function.
6015 (Incremental_checker::can_incrementally_link_output_file): Remove.
6016 (Incremental_inputs::report_command_line): Exclude --debug options.
6017 (Incremental_inputs::report_archive_begin): Add parameter; track
6018 argument serial numbers; don't put input file entry for archive
6019 before archive members.
6020 (Incremental_inputs::report_archive_end): Put input file entry
6021 for archive after archive members.
6022 (Incremental_inputs::report_object): Add parameter; track argument
6023 serial numbers and in_system_directory flag.
6024 (Incremental_inputs::report_script): Add parameter; track argument
6025 serial numbers.
6026 (Output_section_incremental_inputs::set_final_data_size): Adjust
6027 size of symbol info entry; check for forwarding symbols.
6028 (Output_section_incremental_inputs::write_input_files): Write
6029 in_system_directory flag and argument serial number.
6030 (Output_section_incremental_inputs::write_info_blocks): Map section
6031 indices between incremental info and original input file; store
6032 input section index for each symbol.
6033 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
6034 change operator() to visit().
6035 (class Global_got_offset_visitor): Likewise.
6036 (class Global_symbol_visitor_got_plt):
6037 (Output_section_incremental_inputs::write_got_plt): Use new visitor
6038 classes.
6039 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
6040 (Sized_incr_relobj::do_read_symbols): New function.
6041 (Sized_incr_relobj::do_layout): New function.
6042 (Sized_incr_relobj::do_layout_deferred_sections): New function.
6043 (Sized_incr_relobj::do_add_symbols): New function.
6044 (Sized_incr_relobj::do_should_include_member): New function.
6045 (Sized_incr_relobj::do_for_all_global_symbols): New function.
6046 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
6047 (Sized_incr_relobj::do_section_size): New function.
6048 (Sized_incr_relobj::do_section_name): New function.
6049 (Sized_incr_relobj::do_section_contents): New function.
6050 (Sized_incr_relobj::do_section_flags): New function.
6051 (Sized_incr_relobj::do_section_entsize): New function.
6052 (Sized_incr_relobj::do_section_address): New function.
6053 (Sized_incr_relobj::do_section_type): New function.
6054 (Sized_incr_relobj::do_section_link): New function.
6055 (Sized_incr_relobj::do_section_info): New function.
6056 (Sized_incr_relobj::do_section_addralign): New function.
6057 (Sized_incr_relobj::do_initialize_xindex): New function.
6058 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
6059 (Sized_incr_relobj::do_read_relocs): New function.
6060 (Sized_incr_relobj::do_gc_process_relocs): New function.
6061 (Sized_incr_relobj::do_scan_relocs): New function.
6062 (Sized_incr_relobj::do_count_local_symbols): New function.
6063 (Sized_incr_relobj::do_finalize_local_symbols): New function.
6064 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
6065 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
6066 (Sized_incr_relobj::do_relocate): New function.
6067 (Sized_incr_relobj::do_set_section_offset): New function.
6068 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
6069 (Sized_incr_dynobj::do_read_symbols): New function.
6070 (Sized_incr_dynobj::do_layout): New function.
6071 (Sized_incr_dynobj::do_add_symbols): New function.
6072 (Sized_incr_dynobj::do_should_include_member): New function.
6073 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
6074 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
6075 (Sized_incr_dynobj::do_section_size): New function.
6076 (Sized_incr_dynobj::do_section_name): New function.
6077 (Sized_incr_dynobj::do_section_contents): New function.
6078 (Sized_incr_dynobj::do_section_flags): New function.
6079 (Sized_incr_dynobj::do_section_entsize): New function.
6080 (Sized_incr_dynobj::do_section_address): New function.
6081 (Sized_incr_dynobj::do_section_type): New function.
6082 (Sized_incr_dynobj::do_section_link): New function.
6083 (Sized_incr_dynobj::do_section_info): New function.
6084 (Sized_incr_dynobj::do_section_addralign): New function.
6085 (Sized_incr_dynobj::do_initialize_xindex): New function.
6086 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
6087 (make_sized_incremental_object): New function.
6088 (Incremental_library::copy_unused_symbols): New function.
6089 (Incremental_library::do_for_all_unused_symbols): New function.
6090 * incremental.h (enum Incremental_input_flags): New type.
6091 (class Incremental_checker): Remove.
6092 (Incremental_input_entry::Incremental_input_entry): Add argument
6093 serial number.
6094 (Incremental_input_entry::arg_serial): New function.
6095 (Incremental_input_entry::set_is_in_system_directory): New function.
6096 (Incremental_input_entry::is_in_system_directory): New function.
6097 (Incremental_input_entry::arg_serial_): New data member.
6098 (Incremental_input_entry::is_in_system_directory_): New data member.
6099 (class Script_info): Move here from script.h.
6100 (Script_info::Script_info): Add filename parameter.
6101 (Script_info::filename): New function.
6102 (Script_info::filename_): New data member.
6103 (Incremental_script_entry::Incremental_script_entry): Add argument
6104 serial number.
6105 (Incremental_object_entry::Incremental_object_entry): Likewise.
6106 (Incremental_object_entry::add_input_section): Build list of input
6107 sections with map to original shndx.
6108 (Incremental_object_entry::get_input_section_index): New function.
6109 (Incremental_object_entry::shndx_): New data member.
6110 (Incremental_object_entry::name_key_): Rename; adjust all refs.
6111 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
6112 (Incremental_archive_entry::Incremental_archive_entry): Add argument
6113 serial number.
6114 (Incremental_inputs::report_archive_begin): Likewise.
6115 (Incremental_inputs::report_object): Likewise.
6116 (Incremental_inputs::report_script): Likewise.
6117 (class Incremental_global_symbol_reader): New class.
6118 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
6119 and store flags and input file type.
6120 (Incremental_input_entry_reader::arg_serial): New function.
6121 (Incremental_input_entry_reader::type): Extract type from flags.
6122 (Incremental_input_entry_reader::is_in_system_directory): New function.
6123 (Incremental_input_entry_reader::get_input_section_count): Call
6124 accessor function for type.
6125 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
6126 function for type; adjust size of global symbol entry.
6127 (Incremental_input_entry_reader::get_global_symbol_count): Call
6128 accessor function for type.
6129 (Incremental_input_entry_reader::get_object_count): Likewise.
6130 (Incremental_input_entry_reader::get_object_offset): Likewise.
6131 (Incremental_input_entry_reader::get_member_count): Likewise.
6132 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
6133 (Incremental_input_entry_reader::get_member_offset): Likewise.
6134 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
6135 (Incremental_input_entry_reader::Global_symbol_info): Remove.
6136 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
6137 (Incremental_input_entry_reader::get_global_symbol_reader): New
6138 function.
6139 (Incremental_input_entry_reader::get_output_symbol_index): New
6140 function.
6141 (Incremental_input_entry_reader::type_): Remove.
6142 (Incremental_input_entry_reader::flags_): New data member.
6143 (Incremental_inputs_reader::input_file_offset): New function.
6144 (Incremental_inputs_reader::input_file_index): New function.
6145 (Incremental_inputs_reader::input_file): Call input_file_offset.
6146 (Incremental_inputs_reader::input_file_at_offset): New function.
6147 (Incremental_relocs_reader::get_r_type): Reformat.
6148 (Incremental_relocs_reader::get_r_shndx): Reformat.
6149 (Incremental_relocs_reader::get_r_offset): Reformat.
6150 (Incremental_relocs_reader::data): New function.
6151 (Incremental_binary::Incremental_binary): Initialize new data members.
6152 (Incremental_binary::check_inputs): Add cmdline parameter.
6153 (Incremental_binary::file_is_unchanged): Remove.
6154 (Input_reader::arg_serial): New function.
6155 (Input_reader::get_unused_symbol_count): New function.
6156 (Input_reader::get_unused_symbol): New function.
6157 (Input_reader::do_arg_serial): New function.
6158 (Input_reader::do_get_unused_symbol_count): New function.
6159 (Input_reader::do_get_unused_symbol): New function.
6160 (Incremental_binary::input_file_count): New function.
6161 (Incremental_binary::get_input_reader): Change signature to use
6162 index instead of filename.
6163 (Incremental_binary::file_has_changed): New function.
6164 (Incremental_binary::get_input_argument): New function.
6165 (Incremental_binary::get_library): New function.
6166 (Incremental_binary::get_script_info): New function.
6167 (Incremental_binary::init_layout): New function.
6168 (Incremental_binary::reserve_layout): New function.
6169 (Incremental_binary::output_file): New function.
6170 (Incremental_binary::do_check_inputs): New function.
6171 (Incremental_binary::do_file_is_unchanged): Remove.
6172 (Incremental_binary::do_file_has_changed): New function.
6173 (Incremental_binary::do_init_layout): New function.
6174 (Incremental_binary::do_reserve_layout): New function.
6175 (Incremental_binary::do_input_file_count): New function.
6176 (Incremental_binary::do_get_input_reader): Change signature.
6177 (Incremental_binary::input_args_map_): New data member.
6178 (Incremental_binary::library_map_): New data member.
6179 (Incremental_binary::script_map_): New data member.
6180 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6181 new data members.
6182 (Sized_incremental_binary::output_section): New function.
6183 (Sized_incremental_binary::inputs_reader): Add const.
6184 (Sized_incremental_binary::symtab_reader): Add const.
6185 (Sized_incremental_binary::relocs_reader): Add const.
6186 (Sized_incremental_binary::got_plt_reader): Add const.
6187 (Sized_incremental_binary::get_symtab_view): New function.
6188 (Sized_incremental_binary::Inputs_reader): New typedef.
6189 (Sized_incremental_binary::Input_entry_reader): New typedef.
6190 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
6191 (Sized_incremental_binary::do_file_is_unchanged): Remove.
6192 (Sized_incremental_binary::do_file_has_changed): New function.
6193 (Sized_incremental_binary::do_init_layout): New function.
6194 (Sized_incremental_binary::do_reserve_layout): New function.
6195 (Sized_input_reader::Inputs_reader): Remove.
6196 (Sized_input_reader::Input_entry_reader): Remove.
6197 (Sized_input_reader::do_arg_serial): New function.
6198 (Sized_input_reader::do_get_unused_symbol_count): New function.
6199 (Sized_input_reader::do_get_unused_symbol): New function.
6200 (Sized_incremental_binary::do_input_file_count): New function.
6201 (Sized_incremental_binary::do_get_input_reader): Change signature;
6202 use index instead of filename.
6203 (Sized_incremental_binary::section_map_): New data member.
6204 (Sized_incremental_binary::input_entry_readers_): New data member.
6205 (class Sized_incr_relobj): New class.
6206 (class Sized_incr_dynobj): New class.
6207 (make_sized_incremental_object): New function.
6208 (class Incremental_library): New class.
6209 * layout.cc (Free_list::num_lists): New static data member.
6210 (Free_list::num_nodes): New static data member.
6211 (Free_list::num_removes): New static data member.
6212 (Free_list::num_remove_visits): New static data member.
6213 (Free_list::num_allocates): New static data member.
6214 (Free_list::num_allocate_visits): New static data member.
6215 (Free_list::init): New function.
6216 (Free_list::remove): New function.
6217 (Free_list::allocate): New function.
6218 (Free_list::dump): New function.
6219 (Free_list::print_stats): New function.
6220 (Layout_task_runner::run): Resize output file for incremental updates.
6221 (Layout::Layout): Initialize new data members.
6222 (Layout::set_incremental_base): New function.
6223 (Layout::init_fixed_output_section): New function.
6224 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
6225 incremental updates.
6226 (Layout::create_gold_note): Do not create gold note section for
6227 incremental updates.
6228 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
6229 for incremental updates.
6230 (Layout::set_section_offsets): For incremental updates, allocate space
6231 from free list.
6232 (Layout::create_symtab_sections): Layout with offsets relative to
6233 start of section; for incremental updates, allocate space from free
6234 list.
6235 (Layout::create_shdrs): For incremental updates, allocate space from
6236 free list.
6237 (Layout::finish_dynamic_section): For incremental updates, do not
6238 check --as-needed (fixed in subsequent patch).
6239 * layout.h (class Free_list): New class.
6240 (Layout::set_incremental_base): New function.
6241 (Layout::incremental_base): New function.
6242 (Layout::init_fixed_output_section): New function.
6243 (Layout::allocate): New function.
6244 (Layout::incremental_base_): New data member.
6245 (Layout::free_list_): New data member.
6246 * main.cc (main): Print Free_list statistics.
6247 * object.cc (Relobj::finalize_incremental_relocs): Add
6248 clear_counts parameter; clear counts only when clear_counts is set.
6249 (Sized_relobj::Sized_relobj): Initialize new base class.
6250 (Sized_relobj::do_layout): Don't report special sections.
6251 (Sized_relobj::do_for_all_local_got_entries): New function.
6252 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
6253 symtab_off to all symbol table offsets.
6254 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
6255 * object.h (class Got_offset_list): Move to top of file.
6256 (Object::Object): Allow case where input_file == NULL.
6257 (Object::~Object): Likewise.
6258 (Object::input_file): Assert that input_file != NULL.
6259 (Object::lock): Allow case where input_file == NULL.
6260 (Object::unlock): Likewise.
6261 (Object::is_locked): Likewise.
6262 (Object::token): Likewise.
6263 (Object::release): Likewise.
6264 (Object::is_incremental): New function.
6265 (Object::get_mtime): New function.
6266 (Object::for_all_local_got_entries): New function.
6267 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
6268 (Object::set_is_in_system_directory): New function.
6269 (Object::is_in_system_directory): New function.
6270 (Object::do_is_incremental): New function.
6271 (Object::do_get_mtime): New function.
6272 (Object::do_for_all_local_got_entries): New function.
6273 (Object::is_in_system_directory_): New data member.
6274 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
6275 (class Sized_relobj_base): New class.
6276 (class Sized_relobj): Derive from Sized_relobj_base.
6277 (class Sized_relobj::Symbols): Redeclare from base class.
6278 (class Sized_relobj::local_got_offset_list): Remove.
6279 (class Sized_relobj::Output_sections): Redeclare from base class.
6280 (class Sized_relobj::do_for_all_local_got_entries): New function.
6281 (class Sized_relobj::write_local_symbols): Add offset parameter.
6282 (class Sized_relobj::local_symbol_offset_): Update comment.
6283 (class Sized_relobj::local_dynsym_offset_): Update comment.
6284 * options.cc (Input_arguments::add_file): Remove const.
6285 * options.h (Input_file_argument::Input_file_argument):
6286 Initialize arg_serial_ (all constructors).
6287 (Input_file_argument::set_arg_serial): New function.
6288 (Input_file_argument::arg_serial): New function.
6289 (Input_file_argument::arg_serial_): New data member.
6290 (Input_arguments::Input_arguments): Initialize file_count_.
6291 (Input_arguments::add_file): Remove const.
6292 (Input_arguments::number_of_input_files): New function.
6293 (Input_arguments::file_count_): New data member.
6294 (Command_line::number_of_input_files): Call
6295 Input_arguments::number_of_input_files.
6296 * output.cc (Output_segment_headers::Output_segment_headers):
6297 Set current size.
6298 (Output_section::Input_section::current_data_size): New function.
6299 (Output_section::Output_section): Initialize new data members.
6300 (Output_section::add_input_section): Don't do merge sections for
6301 an incremental link; allocate space from free list for an
6302 incremental update.
6303 (Output_section::add_output_section_data): Allocate space from
6304 free list for an incremental update.
6305 (Output_section::update_data_size): New function.
6306 (Output_section::set_fixed_layout): New function.
6307 (Output_section::reserve): New function.
6308 (Output_segment::set_section_addresses): Remove const.
6309 (Output_segment::set_section_list_addresses): Remove const; allocate
6310 space from free list for an incremental update.
6311 (Output_segment::set_offset): Adjust size of RELRO segment for an
6312 incremental update.
6313 * output.h (Output_data::current_data_size): Move here from
6314 child classes.
6315 (Output_data::pre_finalize_data_size): New function.
6316 (Output_data::update_data_size): New function.
6317 (Output_section_headers::update_data_size): new function.
6318 (Output_section_data_build::current_data_size): Move to Output_data.
6319 (Output_data_strtab::update_data_size): New function.
6320 (Output_section::current_data_size): Move to Output_data.
6321 (Output_section::set_fixed_layout): New function.
6322 (Output_section::has_fixed_layout): New function.
6323 (Output_section::reserve): New function.
6324 (Output_section::update_data_size): New function.
6325 (Output_section::has_fixed_layout_): New data member.
6326 (Output_section::free_list_): New data member.
6327 (Output_segment::set_section_addresses): Remove const.
6328 (Output_segment::set_section_list_addresses): Remove const.
6329 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
6330 New function.
6331 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
6332 New function.
6333 * readsyms.cc (Read_symbols::do_read_symbols): Add library
6334 parameter when calling Add_symbols constructor; store argument
6335 serial number for members of a lib group.
6336 (Add_symbols::locks): Allow case where token == NULL.
6337 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
6338 (Read_member::~Read_member): New function.
6339 (Read_member::is_runnable): New function.
6340 (Read_member::locks): New function.
6341 (Read_member::run): New function.
6342 (Check_script::~Check_script): New function.
6343 (Check_script::is_runnable): New function.
6344 (Check_script::locks): New function.
6345 (Check_script::run): New function.
6346 (Check_library::~Check_library): New function.
6347 (Check_library::is_runnable): New function.
6348 (Check_library::locks): New function.
6349 (Check_library::run): New function.
6350 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
6351 (Add_symbols::library_): New data member.
6352 (class Read_member): New class.
6353 (class Check_script): New class.
6354 (class Check_library): New class.
6355 * reloc.cc (Read_relocs::is_runnable): Allow case where
6356 token == NULL.
6357 (Read_relocs::locks): Likewise.
6358 (Scan_relocs::locks): Likewise.
6359 (Relocate_task::locks): Likewise.
6360 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
6361 to clear counters.
6362 (Sized_relobj::incremental_relocs_scan): Fix comment.
6363 (Sized_relobj::do_relocate): Pass output file offset to
6364 write_local_symbols.
6365 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
6366 from class declaration.
6367 * script.cc (read_input_script): Allocate Script_info; pass
6368 argument serial number to report_script.
6369 * script.h (class Script_info): Move to incremental.h.
6370 * symtab.cc (Symbol_table::add_from_incrobj): New function.
6371 * symtab.h (Symbol_table::add_from_incrobj): New function.
6372 (Symbol_table::set_file_offset): New function.
6373
b961d0d7
CC
63742011-04-05 Cary Coutant <ccoutant@google.com>
6375
6376 * incremental-dump.cc (dump_incremental_inputs): Change signature
6377 to take a Sized_incremental_binary; change caller. Use readers
6378 in Sized_incremental_binary.
6379 * incremental.cc
6380 (Sized_incremental_binary::find_incremental_inputs_sections):
6381 Rename do_find_incremental_inputs_sections to this.
6382 (Sized_incremental_binary::setup_readers): New function.
6383 (Sized_incremental_binary::do_check_inputs): Check
6384 has_incremental_info_ flag; move setup code to setup_readers;
6385 use input readers.
6386 (Sized_incremental_binary::do_file_is_unchanged): New function.
6387 (Sized_incremental_binary::do_get_input_reader): New function.
6388 * incremental.h (class Incremental_binary): Move to end of file.
6389 (Incremental_binary::file_is_unchanged): New function.
6390 (Incremental_binary::do_file_is_unchanged): New function.
6391 (Incremental_binary::Input_reader): New class.
6392 (Incremental_binary::get_input_reader): New function.
6393 (class Sized_incremental_binary): Move to end of file.
6394 (Sized_incremental_binary::Sized_incremental_binary): Setup the
6395 input section reader classes.
6396 (Sized_incremental_binary::has_incremental_info): New function.
6397 (Sized_incremental_binary::inputs_reader): New function.
6398 (Sized_incremental_binary::symtab_reader): New function.
6399 (Sized_incremental_binary::relocs_reader): New function.
6400 (Sized_incremental_binary::got_plt_reader): New function.
6401 (Sized_incremental_binary::do_file_is_unchanged): New function.
6402 (Sized_incremental_binary::Sized_input_reader): New class.
6403 (Sized_incremental_binary::get_input_reader): New function.
6404 (Sized_incremental_binary::find_incremental_inputs_sections):
6405 Rename do_find_incremental_inputs_sections to this.
6406 (Sized_incremental_binary::setup_readers): New function.
6407 (Sized_incremental_binary::has_incremental_info_): New data member.
6408 (Sized_incremental_binary::inputs_reader_): New data member.
6409 (Sized_incremental_binary::symtab_reader_): New data member.
6410 (Sized_incremental_binary::relocs_reader_): New data member.
6411 (Sized_incremental_binary::got_plt_reader_): New data member.
6412 (Sized_incremental_binary::current_input_file_): New data member.
6413
a869183f
PP
64142011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
6415
6416 PR gold/12640
6417 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
6418 violation.
6419
64202011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
6421
6422 * archive.cc (Archive::include_member): Adjust call to report_object.
6423 (Add_archive_symbols::run): Add script_info to call to
6424 report_archive_begin.
6425 (Lib_group::include_member): Adjust call to report_object.
6426 (Add_lib_group_symbols::run): Adjust call to report_object.
6427 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
6428 blocks. Add object count for script input files.
6429 * incremental.cc (Incremental_inputs::report_archive_begin): Add
6430 script_info parameter; change all callers.
6431 (Incremental_inputs::report_object): Add script_info parameter;
6432 change all callers.
6433 (Incremental_inputs::report_script): Store backpointer to
6434 incremental info entry.
6435 (Output_section_incremental_inputs::set_final_data_size): Record
6436 additional information for scripts.
6437 (Output_section_incremental_inputs::write_info_blocks): Likewise.
6438 * incremental.h (Incremental_script_entry::add_object): New function.
6439 (Incremental_script_entry::get_object_count): New function.
6440 (Incremental_script_entry::get_object): New function.
6441 (Incremental_script_entry::objects_): New data member; adjust
6442 constructor.
6443 (Incremental_inputs::report_archive_begin): Add script_info parameter.
6444 (Incremental_inputs::report_object): Add script_info parameter.
6445 (Incremental_inputs_reader::get_object_count): New function.
6446 (Incremental_inputs_reader::get_object_offset): New function.
6447 * options.cc (Input_arguments::add_file): Return reference to
6448 new input argument.
6449 * options.h (Input_argument::set_script_info): New function.
6450 (Input_argument::script_info): New function.
6451 (Input_argument::script_info_): New data member; adjust all
6452 constructors.
6453 (Input_file_group::add_file): Return reference to new input argument.
6454 (Input_file_lib::add_file): Likewise.
6455 (Input_arguments::add_file): Likewise.
6456 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
6457 * script.cc (Parser_closure::Parser_closure): Add script_info
6458 parameter; adjust all callers.
6459 (Parser_closure::script_info): New function.
6460 (Parser_closure::script_info_): New data member.
6461 (read_input_script): Report scripts earlier to incremental info.
6462 (script_add_file): Set script_info in Input_argument.
6463 (script_add_library): Likewise.
6464 * script.h (Script_options::Script_info): Rewrite class.
6465
a869183f 64662011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
6467
6468 * archive.cc (Library_base::should_include_member): Move
6469 method here from class Archive.
6470 (Archive::Archive): Initialize base class.
6471 (Archive::should_include_member): Move to base class.
6472 (Archive::do_for_all_unused_symbols): New function.
6473 (Add_archive_symbols::run): Remove redundant access to
6474 incremental_inputs.
6475 (Lib_group::Lib_group): Initialize base class.
6476 (Lib_group::do_filename): New function.
6477 (Lib_group::include_member): Pass pointer to Lib_group to
6478 report_object.
6479 (Lib_group::do_for_all_unused_symbols): New function.
6480 (Add_lib_group_symbols::run): Report archive information for
6481 incremental links.
6482 * archive.h (class Library_base): New base class.
6483 (class Archive): Derive from Library_base.
6484 (Archive::filename): Move to base class.
6485 (Archive::set_incremental_info): Likewise.
6486 (Archive::incremental_info): Likewise.
6487 (Archive::Should_include): Likewise.
6488 (Archive::should_include_member): Likewise.
6489 (Archive::Armap_entry): Remove.
6490 (Archive::Unused_symbol_iterator): Remove.
6491 (Archive::unused_symbols_begin): Remove.
6492 (Archive::unused_symbols_end): Remove.
6493 (Archive::do_filename): New function.
6494 (Archive::do_get_mtime): New function.
6495 (Archive::do_for_all_unused_symbols): New function.
6496 (Archive::task_): Move to base class.
6497 (Archive::incremental_info_): Likewise.
6498 (class Lib_group): Derive from Library_base.
6499 (Lib_group::do_filename): New function.
6500 (Lib_group::do_get_mtime): New function.
6501 (Lib_group::do_for_all_unused_symbols): New function.
6502 (Lib_group::task_): Move to base class.
6503 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
6504 function.
6505 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
6506 function.
6507 * incremental.cc (Incremental_inputs::report_archive_begin):
6508 Use Library_base; call library's get_mtime; add incremental inputs
6509 entry before members.
6510 (class Unused_symbol_visitor): New class.
6511 (Incremental_inputs::report_archive_end): Use Library_base; use
6512 visitor class to record unused symbols; don't add incremental inputs
6513 entry after members.
6514 (Incremental_inputs::report_object): Use Library_base.
6515 * incremental.h
6516 (Incremental_archive_entry::Incremental_archive_entry): Remove
6517 unused Archive parameter.
6518 (Incremental_inputs::report_archive_begin): Use Library_base.
6519 (Incremental_inputs::report_archive_end): Likewise.
6520 (Incremental_inputs::report_object): Likewise.
6521 * object.cc (Sized_relobj::do_for_all_global_symbols): New
6522 function.
6523 * object.h (Object::for_all_global_symbols): New function.
6524 (Object::do_for_all_global_symbols): New function.
6525 (Sized_relobj::do_for_all_global_symbols): New function.
6526 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
6527 function.
6528 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
6529 function.
6530
61ab3e40
ILT
65312011-03-27 Ian Lance Taylor <iant@google.com>
6532
6533 * archive.cc (Archive::interpret_header): Return -1 if something
6534 goes wrong. Change callers accordingly.
6535
30e1f9e6
CC
65362011-03-25 Cary Coutant <ccoutant@google.com>
6537
6538 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
6539 * testsuite/Makefile.in: Regenerate.
6540
9370ce59 65412011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
6542
6543 * plugin.cc (get_view): New.
6544 (Plugin::load): Pass get_view to the plugin.
6545 (Plugin_manager::get_view): New.
6546
9312bb0a
ILT
65472011-03-21 Ian Lance Taylor <iant@google.com>
6548
6549 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 6550 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 6551
7e12ba9e
ST
65522011-03-21 Sriraman Tallam <tmsriram@google.com>
6553
6554 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
6555 Change == to -eq.
6556 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
6557 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
6558 Change == to -eq.
6559 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
6560 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
6561
fd7a005d
ILT
65622011-03-14 Ian Lance Taylor <iant@google.com>
6563
6564 * script-sections.cc (Sort_output_sections::script_compare):
6565 Rename from is_before, change return type.
6566 (Sort_output_sections::operator()): Adjust accordingly.
6567
ed16fd1b
ILT
65682011-03-11 Jeffrey Yasskin <jyasskin@google.com>
6569
6570 PR gold/12572
6571 * testsuite/odr_violation2.cc: Add comment to make all error line
6572 numbers double digits.
6573 * testsuite/debug_msg.sh: Adjust expected errors.
6574
71ff8986
ILT
65752011-03-09 Jeffrey Yasskin <jyasskin@google.com>
6576
6577 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
6578 but mark earlier ones as non-canonical
6579 (offset_to_iterator): Update search target and example
6580 (do_addr2line): Return extra lines in a vector*
6581 (format_file_lineno): Extract from do_addr2line
6582 (one_addr2line): Add vector* out-param
6583 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
6584 when a lineno entry appeared last for its instruction
6585 (Dwarf_line_info): Add vector* out-param
6586 * object.cc (Relocate_info): Pass NULL for the vector* out-param
6587 * symtab.cc (Odr_violation_compare): Include the lineno in the
6588 comparison again.
6589 (linenos_from_loc): New. Combine the canonical line for an
6590 address with its other lines.
6591 (True_if_intersect): New. Helper functor to make
6592 std::set_intersection a query.
6593 (detect_odr_violations): Compare sets of lines instead of just
6594 one line for each function. This became less deterministic, but
6595 has fewer false positives.
6596 * symtab.h: Declarations.
6597 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
6598 mix an optimized and non-optimized object in the same binary
6599 (odr_violation2.so): Same.
6600 * testsuite/Makefile.in: Regenerate from Makefile.am.
6601 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
6602 * testsuite/debug_msg.sh: Update line numbers and add
6603 assertions.
6604 * testsuite/odr_violation1.cc: Use OdrDerived, in a
6605 non-optimized context.
6606 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
6607 isn't inlined, and use OdrDerived in an optimized context.
6608 * testsuite/odr_header1.h: Defines OdrDerived, where
6609 optimization will change the
6610 first-instruction-in-the-destructor's file and line number.
6611 * testsuite/odr_header2.h: Defines OdrBase.
6612
a19fefdc
ILT
66132011-03-09 Ian Lance Taylor <iant@google.com>
6614
6615 * fileread.cc (File_read::clear_views): Don't delete the whole
6616 file view.
6617
ecb351e9
ILT
66182011-03-08 Ian Lance Taylor <iant@google.com>
6619
6620 PR gold/12525
6621 * fileread.cc: #include <climits>.
6622 (GOLD_IOV_MAX): Define.
6623 (File_read::read_multiple): Limit number of entries by iov_max.
6624 * fileread.h (class File_read): Always set max_readv_entries to
6625 128.
6626
b821d13c
ILT
66272011-03-07 Ian Lance Taylor <iant@google.com>
6628
6629 PR gold/12525
6630 * options.h (class General_options): Add -dy and -dn.
6631
89243142
CC
66322011-03-02 Cary Coutant <ccoutant@google.com>
6633
6634 * testsuite/script_test_9.t: Add TLS segment.
6635
d0773f31
ILT
66362011-03-02 Simon Baldwin <simonb@google.com>
6637
6638 * configure.ac: Add check for gnu_indirect_function support in
6639 the toolchain building binutils.
6640 * configure: Rebuild.
6641
9370ce59 66422011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
6643
6644 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
6645 plugin only symbols.
6646 (Symbol_table::sized_finalize_symbol) Mark symbol only present
6647 in plugin files as not needed in the symbol table.
6648
4cf7a849
ST
66492011-02-11 Sriraman Tallam <tmsriram@google.com>
6650
6651 * output.cc (Output_section::add_input_section): Delay fill
6652 generation for section ordering.
6653
b578bd7d
ILT
66542011-02-09 Ian Lance Taylor <iant@google.com>
6655
6656 PR gold/12316
6657 * object.h (class Sized_relobj): Remove clear_local_symbols.
6658 * reloc.cc (Sized_relobj::do_relocate): Don't call
6659 clear_local_symbols.
6660
9370ce59 66612011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
6662
6663 * plugin.cc (is_visible_from_outside): Return true for symbols
6664 in the -u option.
6665
55382fb7
ILT
66662011-02-04 Jeffrey Yasskin <jyasskin@google.com>
6667
6668 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
6669 filename.
6670
4e271fff
ST
66712011-02-02 Sriraman Tallam <tmsriram@google.com>
6672
6673 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 6674 to std::string.
4e271fff 6675 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 6676 section_name to be std::string.
4e271fff
ST
6677 (is_function_ctor_or_dtor): Change type of parameter to std::string.
6678
d433c3ac
ILT
66792011-01-25 Ian Lance Taylor <iant@google.com>
6680
6681 * script.cc (script_add_extern): Rewrite to use
6682 add_symbol_reference.
6683
880473a6
DK
66842011-01-25 Doug Kwan <dougkwan@google.com>
6685
d433c3ac 6686 * icf.cc (get_section_contents): Always lock section's object.
880473a6 6687
f30f86fa
ILT
66882011-01-24 Ian Lance Taylor <iant@google.com>
6689
6690 * options.h (class General_options): Accept
6691 --no-detect-odr-violations.
6692
8e51a0b9
ILT
66932011-01-24 Ian Lance Taylor <iant@google.com>
6694
6695 * version.cc (version_string): Bump to 1.11.
6696
0f3b89d8
ILT
66972011-01-24 Ian Lance Taylor <iant@google.com>
6698
6699 * plugin.cc (class Plugin_rescan): Define new class.
6700 (Plugin_manager::claim_file): Set any_claimed_.
6701 (Plugin_manager::save_archive): New function.
6702 (Plugin_manager::save_input_group): New function.
6703 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
6704 necessary.
6705 (Plugin_manager::new_undefined_symbol): New function.
6706 (Plugin_manager::rescan): New function.
6707 (Plugin_manager::rescannable_defines): New function.
6708 (Plugin_manager::add_input_file): Set any_added_.
6709 * plugin.h (class Plugin_manager): define new fields rescannable_,
6710 undefined_symbols_, any_claimed_, and any_added_. Declare
6711 Plugin_rescan as friend. Declare new functions.
6712 (Plugin_manager::Rescannable): Define type.
6713 (Plugin_manager::Rescannable_list): Define type.
6714 (Plugin_manager::Undefined_symbol_list): Define type.
6715 (Plugin_manager::Plugin_manager): Initialize new fields.
6716 * archive.cc (Archive::defines_symbol): New function.
6717 (Add_archive_symbols::run): Pass archive to plugins if any.
6718 * archive.h (class Archive): Declare defines_symbol.
6719 * readsyms.cc (Input_group::~Input_group): New function.
6720 (Finish_group::run): Pass input_group to plugins if any.
6721 * readsyms.h (class Input_group): Declare destructor.
6722 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
6723 any.
6724
3bb951e5
ILT
67252011-01-10 Ian Lance Taylor <iant@google.com>
6726
6727 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
6728 section as relro.
6729 (Layout::set_segment_offsets): Reset increase_relro before calling
6730 set_section_addresses a second time.
6731
0aa45fac
CC
67322011-01-04 Cary Coutant <ccoutant@google.com>
6733
6734 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
6735 sections before NOBITS sections.
6736
0db46eb4
L
67372011-01-01 H.J. Lu <hongjiu.lu@intel.com>
6738
6739 * version.cc (print_version): Update copyright to 2011.
6740
829c9745
CC
67412010-12-23 Cary Coutant <ccoutant@google.com>
6742
6743 * output.h (Output_data_reloc::add_output_section): Pass OD instead
6744 of OS to this->add. Add OD parameter to second form of the function.
6745
7500420b
ILT
67462010-12-20 Ian Lance Taylor <iant@google.com>
6747
6748 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
6749 second of two consecutive entries with same offset.
6750
f8e9a930
RW
67512010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6752
6753 * testsuite/Makefile.am (ifuncmain2static_LDADD)
6754 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
6755 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
6756 to avoid unneeded links against $(LDADD).
6757 * testsuite/Makefile.in: Regenerate.
6758
2fbb4320
ILT
67592010-12-15 Ian Lance Taylor <iant@google.com>
6760
6761 PR gold/12324
6762 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
6763 for R_X86_64_32 and R_X86_64_PC32.
6764 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
6765 ver_matching_def_pic.o.
6766 (ver_matching_def_pic.o): New target.
6767
fedb228d
RW
67682010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6769
6770 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
6771 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
6772 Move definition before File_read::View member definitions.
6773 (File_read::View::~View): Initialize and hold lock before
6774 updating current_mapped_bytes.
6775
9b547ce6
RW
67762010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6777
6778 * dwarf_reader.cc: Remove outdated comment.
6779 * gold-threads.cc: Fix typo in error message.
6780 * archive.cc: Fix typos in comments.
6781 * archive.h: Likewise.
6782 * arm-reloc-property.cc: Likewise.
6783 * arm-reloc-property.h: Likewise.
6784 * arm-reloc.def: Likewise.
6785 * arm.cc: Likewise.
6786 * attributes.h: Likewise.
6787 * cref.cc: Likewise.
6788 * ehframe.cc: Likewise.
6789 * fileread.h: Likewise.
6790 * gold.h: Likewise.
6791 * i386.cc: Likewise.
6792 * icf.cc: Likewise.
6793 * incremental.h: Likewise.
6794 * int_encoding.cc: Likewise.
6795 * layout.h: Likewise.
6796 * main.cc: Likewise.
6797 * merge.h: Likewise.
6798 * object.cc: Likewise.
6799 * object.h: Likewise.
6800 * options.cc: Likewise.
6801 * readsyms.cc: Likewise.
6802 * reduced_debug_output.cc: Likewise.
6803 * reloc.cc: Likewise.
6804 * script-sections.cc: Likewise.
6805 * sparc.cc: Likewise.
6806 * symtab.h: Likewise.
6807 * target-reloc.h: Likewise.
6808 * target.cc: Likewise.
6809 * target.h: Likewise.
6810 * timer.cc: Likewise.
6811 * timer.h: Likewise.
6812 * x86_64.cc: Likewise.
6813
83e17bd5
CC
68142010-12-09 Cary Coutant <ccoutant@google.com>
6815
6816 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
6817 stack.
6818 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
6819 parameter; change all callers.
6820 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
6821 * options.h (warn_execstack): New option.
6822
017257f8
DK
68232010-12-07 Doug Kwan <dougkwan@google.com>
6824
6825 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
6826 like function call relocations.
6827
c20cbc06
ILT
68282010-12-07 Ian Lance Taylor <iant@google.com>
6829
6830 * archive.cc (Archive::get_elf_object_for_member): Permit
6831 punconfigured to be NULL.
6832 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
6833 (Archive::include_member): Pass NULL to get_elf_object_for_member
6834 if we searched for the archive and this is the first included
6835 object.
6836
4dbfafcc
ILT
68372010-12-01 Ian Lance Taylor <iant@google.com>
6838
6839 * dwarf_reader.h (class Sized_dwarf_line_info): Add
6840 track_relocs_type_ field.
6841 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6842 Set track_relocs_type_.
6843 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
6844 contents when using RELA relocs.
6845 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
6846 reloc_map_.
6847 * reloc.cc (Track_relocs::next_addend): New function.
6848 * reloc.h (class Track_relocs): Declare next_addend.
6849
e5e19edd
ILT
68502010-12-01 Ian Lance Taylor <iant@google.com>
6851
6852 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
6853 virtual destructor.
6854
9a5ce24c
ILT
68552010-12-01 Ian Lance Taylor <iant@google.com>
6856
6857 * README: Update compilers known to work and fail.
6858
c7791212
NC
68592010-11-23 Matthias Klose <doko@ubuntu.com>
6860
6861 * configure.in: For --enable-gold, handle value `default' instead of
6862 `both*'. Always install ld as ld.bfd, install as ld if gold is
6863 not the default.
6864 * configure: Regenerate.
6865
0ad220c9
DK
68662010-11-18 Doug Kwan <dougkwan@google.com>
6867
6868 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
6869 and right_alignment to be zero. Store result alignment only if it is
6870 greater than existing alignment.
6871
ab8056e0
CC
68722010-11-16 Cary Coutant <ccoutant@google.com>
6873
6874 PR gold/12220
6875 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6876 Check for ".zdebug_line".
6877
fd064a5b
CC
68782010-11-16 Doug Kwan <dougkwan@google.com>
6879 Cary Coutant <ccoutant@google.com>
6880
6881 * output.h (Output_segment::set_section_addresses): Pass increase_relro
6882 by reference; adjust all callers.
6883 * output.cc (Output_segment::set_section_addresses): Adjust references
6884 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
6885 list is empty.
6886 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
6887 end at page boundary.
6888
6fc6ea19
CC
68892010-11-16 Cary Coutant <ccoutant@google.com>
6890
6891 PR gold/12220
6892 * layout.cc (Layout::choose_output_section): Transform names of
6893 compressed sections even when using a script with a SECTIONS clause.
6894 (Layout::output_section_name): Remove code to transform
6895 compressed debug section names.
6896 * output.cc (Output_section::add_input_section): Use uncompressed
6897 section size when tracking input sections.
6898
95a2c8d6
RS
68992010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
6900
6901 * symtab.h (Symbol::NON_PIC_REF): Remove.
6902 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
6903 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
6904 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
6905 (Symbol::use_plt_offset): Take a flags argument and pass it
6906 directly to needs_dynamic_reloc. Restrict check for undefined
6907 weak symbols to function calls.
6908 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
6909 (Target_arm::Scan::global): Use it.
6910 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
6911 (Target_arm::Relocate::relocate): Likewise.
6912 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
6913 parameter with an r_type parameter. Use get_reference_flags
6914 to get the flags.
6915 (Target_arm::Relocate::relocate): Update accordingly.
6916 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
6917 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
6918 (Target_i386::Scan::global): Likewise.
6919 (Target_i386::Relocate::relocate): Likewise.
6920 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
6921 parameter with an r_type parameter. Use get_reference_flags
6922 to get the flags.
6923 (Target_i386::Relocate::relocate): Update accordingly.
6924 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
6925 (Target_powerpc::Scan::global): Use it.
6926 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
6927 (Target_powerpc::Relocate::relocate): Likewise.
6928 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
6929 (Target_sparc::Scan::global): Use it.
6930 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
6931 (Target_sparc::Relocate::relocate): Likewise.
6932 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
6933 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
6934 (Target_x86_64::Scan::global): Likewise.
6935 (Target_x86_64::Relocate::relocate): Likewise.
6936
f625ae50
DK
69372010-11-08 Doug Kwan <dougkwan@google.com>
6938 Cary Coutant <ccoutant@google.com>
6939
6940 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
6941 (Arm_exidx_merge_section::section_contents_): New data member.
6942 (Arm_input_section::Arm_input_section): Initialize original_contents_.
6943 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 6944 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
6945 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
6946 in parameters instead of calling Object::section_contents without
6947 locking.
6948 (Arm_output_section::group_section): New parameter TASK. Pass it
6949 to callees that need locking objects.
6950 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
6951 to lock EXIDX input sections. Fix a formatting issue. Call
6952 Arm_exidx_merged_section::build_contents to create merged section
6953 contents.
6954 (Arm_output_section::create_stub_group): New parameter TASK. Use it
6955 to lock object of stub table owner.
6956 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
6957 TEXT_SIZE to initialize data member TEXT_SIZE_.
6958 (Arm_exidx_input_section::addralign): Fix typo in comment.
6959 (Arm_exidx_input_section::text_size): New method.
6960 (Target_arm::do_relax): New parameter TASK. Pass it to callees
6961 that require locking objects. Lock objects before scanning for stubs
6962 and updating local symbols.
6963 (Arm_input_section<big_endian>::init): Copy contents of original
6964 input section.
2e702c99 6965 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
6966 original input section instead of calling Object::section_contents
6967 without locking.
6968 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
6969 size without calling Object::section_size().
6970 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
6971 for size. Allocate a buffer for merged EXIDX entries.
6972 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 6973 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
6974 building code to Arm_exidx_merged_section::build_contetns. Write
6975 out contetns in buffer instead of building it on the fly.
6976 (Arm_relobj::make_exidx_input_section): Also pass text section size
6977 to Arm_exidx_input_section constructor.
6978 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
6979 (Arm_dynobj::do_read_symbols): Fix memory leak.
6980 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
6981 * target.h: (class Task): Add forward declaration.
6982 (Target::relax): Add new parameter TASK and pass it to
6983 Target::do_relax().
6984 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
6985
5f9bcf58
CC
69862010-11-05 Cary Coutant <ccoutant@google.com>
6987
6988 PR gold/10708
6989 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
6990 object when reading from the file.
6991 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
6992 second layout pass.
6993 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
6994 when reading section contents.
6995 (get_section_contents): Likewise.
6996 (icf::find_identical_sections): Likewise.
6997 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
6998 object when reading from the file.
6999 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
7000 the object when doing deferred section layout.
7001
e597fa08
NC
70022010-11-03 Nick Clifton <nickc@redhat.com>
7003
7004 PR gold/12001
7005 * script.h (class Symbol_assignment: name): New member. Returns
7006 the name of the symbol.
7007 * scrfipt.cc (Script_options::is_pending_assignment): New member.
7008 Returns true if the given symbol name is on the list of
7009 assignments wating to be processed.
7010 * archive.cc (should_incldue_member): If the symbol is undefined,
7011 check to see if it is on the list of symbols pending assignment.
7012
3f9a3278
ILT
70132010-11-03 Ryan Mansfield <rmansfield@qnx.com>
7014
7015 * script-sections.cc (Script_sections::find_memory_region): Check
7016 for a NULL output section pointer.
7017
d06fb4d1
DK
70182010-10-29 Doug Kwan <dougkwan@google.com>
7019
7020 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
7021 Output_section::add_relaxed_input_section.
7022 * output.cc (Output_section::add_relaxed_input_section): Add new
7023 arguments LAYOUT and NAME. Set section order index.
7024 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
7025 Copy section order index.
7026 * output.h (Output_section::add_relaxed_input_section): Add new
7027 arguments LAYOUT and NAME.
7028
90e24de5
ILT
70292010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7030
7031 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 7032 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
7033 * testsuite/Makefile.in: Regenerate.
7034
c9484ea5
DK
70352010-10-20 Doug Kwan <dougkwan@google.com>
7036
7037 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
7038 without SHF_LINK_ORDER flags.
7039 * layout.cc (Layout::choose_output_section): Do not filter
7040 SHF_LINK_ORDER flag in a relocatable link.
7041
5bc2f5be
CC
70422010-10-17 Cary Coutant <ccoutant@google.com>
7043
7044 * output.h (Output_segment::set_section_addresses): Change function
7045 signature. Update all callers.
7046 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
7047 sections.
7048 (Output_segment::set_section_addresses): Align after last TLS
7049 section. Add padding before last relro section instead of after.
7050
0c91cf04
DK
70512010-10-17 Doug Kwan <dougkwan@google.com>
7052
7053 * gold/arm.cc (Target_arm::got_section): Use correct order and set
7054 GOT output section to be writable.
7055
8c21d9d3
CC
70562010-10-14 Cary Coutant <ccoutant@google.com>
7057
7058 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
7059 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
7060 * gold.cc (queue_initial_tasks): Check parameters for incremental link
7061 mode.
7062 * incremental.cc (report_command_line): Ignore all forms of
7063 --incremental.
7064 * layout.cc (Layout::Layout): Check parameters for incremental link
7065 mode.
7066 * options.cc (General_options::parse_incremental): New function.
7067 (General_options::parse_no_incremental): New function.
7068 (General_options::parse_incremental_full): New function.
7069 (General_options::parse_incremental_update): New function.
7070 (General_options::incremental_mode_): New data member.
7071 (General_options::finalize): Check incremental_mode_.
7072 * options.h (General_options): Update help text for --incremental.
7073 Add --no-incremental, --incremental-full, --incremental-update.
7074 (General_options::Incremental_mode): New enum type.
7075 (General_options::incremental_mode): New function.
7076 (General_options::incremental_mode_): New data member.
7077 * parameters.cc (Parameters::incremental_mode_): New data member.
7078 (Parameters::set_options): Set incremental_mode_.
7079 (Parameters::set_incremental_full): New function.
7080 (Parameters::incremental): New function.
7081 (Parameters::incremental_update): New function.
7082 (set_parameters_incremental_full): New function.
7083 * parameters.h (Parameters::set_incremental_full): New function.
7084 (Parameters::incremental): New function.
7085 (Parameters::incremental_update): New function.
7086 (Parameters::incremental_mode_): New data member.
7087 (set_parameters_incremental_full): New function.
7088 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
7089 incremental link mode.
7090 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
7091 (Sized_relobj::do_relocate_sections): Likewise.
7092 * testsuite/Makefile.am (incremental_test): Use --incremental-full
7093 option.
7094 * testsuite/Makefile.in: Regenerate.
7095 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 7096
bb32aa18 70972010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
7098
7099 * script-sections.h (class Script_sections): Make
7100 Sections_elements typedef public.
7101 * script-sections.cc (class Sort_output_sections): Add elements_
7102 field. Add constructor which sets it; change all callers.
7103 (Sort_output_sections::is_before): New function.
7104 (Sort_output_sections::operator()): Call is_before.
7105 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
7106 conditional.
7107 * testsuite/script_test_10.sh: New test. Test script section
7108 order.
7109 * testsuite/script_test_10.t: Likewise.
7110 * testsuite/script_test_10.s: Likewise.
7111 * testsuite/Makefile.am: Wrap the cross linker tests and the
7112 common tests into NATIVE_OR_CROSS_LINKER.
7113 (check_SCRIPTS): Add script_test_10.sh.
7114 (check_DATA): Add script_test_10.stdout.
7115 (script_test_10.o, script_test_10): New targets.
7116 (script_test_10.stdout): New target.
7117 * configure, testsuite/Makefile.in: Regenerate.
7118
3cef7179
ILT
71192010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7120
7121 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
7122 error for the deprecated relocations.
7123 (Target_arm::Scan::global): Likewise.
7124 (Target_arm::Relocate::relocate): Likewise.
7125
7411e9a8
RS
71262010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
7127
7128 * fileread.cc (Input_file::find_file): Initialize *found_name
7129 and *namep when using the fallback search for case 4.
7130
6a9da32a
CC
71312010-10-11 Cary Coutant <ccoutant@google.com>
7132
7133 * options.h (class General_options): Redefine -z lazy as an alias for
7134 the negation of -z now.
7135
ac897c20
ILT
71362010-10-11 Ian Lance Taylor <iant@google.com>
7137
7138 * resolve.cc (symbol_to_bits): Report the value of the unsupported
7139 binding.
7140
ea5cae92
NC
71412010-10-06 Nick Clifton <nickc@redhat.com>
7142
7143 * script-sections.cc(class Memory_region): Remove
7144 current_lma_offset_ field. Rename current_vma_offset_ to
7145 current_offset_. Add last_section_ field.
7146 (Memory_region::get_current_vma_address): Rename to
7147 get_current_address.
7148 (Memory_region::get_current_lma_address): Delete.
7149 (Memory_region::increment_vma_offset): Rename to
7150 increment_offset.
7151 (Memory_region::increment_lma_offset): Delete.
7152 (Memory_region::attributes_compatible): New method. Returns
7153 true if the provided section is compatible with the region.
7154 (Memory_region::get_last_section): New method. Returns the last
7155 section to use the region.
7156 (Memory_region::set_last_section): New method. Stores the last
7157 section to use the region.
7158 (Script_sections::block_in_region): New method. Returns true if
7159 a block of memory is contained within a region.
7160 (Script_sections::find_memory_region): New method. Locates a
7161 memory region to be used to set a VMA or LMA address.
7162 (Output_section_definition::set_section_addresses): Add code to
7163 check for addresses set by memory regions.
7164 (Output_segment::set_section_addresses): Remove memory region
7165 walking code.
7166 (Script_sections::create_segment): Add a warning if a header
7167 segment is created outside of any region.
7168 * script-sections.h (class Script_sections): Add prototypes for
7169 find_memory_region and block_in_region methods.
7170 * testsuite/memory_test.s: Use .long instead of .word.
7171 * testsuite/memory_test.t: Add some more output sections.
7172 * testsuite/memory_test.sh: Update expected output.
7173
a9bfd952
DK
71742010-10-02 Doug Kwan <dougkwan@google.com>
7175
7176 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
7177 defintion to symtab.h
7178 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
7179 declaration to defintion.
7180
bacff3ab
NC
71812010-10-01 Nick Clifton <nickc@redhat.com>
7182
7183 * expression.cc (eval): Replace dummy argument with NULL.
7184 (eval_maybe_dot): Check for a NULL result section pointer.
7185 (Symbol_expression::value): Likewise.
7186 (Dot_expression::value): Likewise.
7187 (BINARY_EXPRESSION): Likewise.
7188 (Max_expression::value): Likewise.
7189 (Min_expression::value): Likewise.
7190 (Absolute_expression::value): Likewise.
7191 (Addr_expression::value_from_output_section): Likewise.
7192 (Loaddddr_expression::value_from_output_section): Likewise.
7193 (Segment_start_expression::value): Likewise.
7194 * script-sections.cc
7195 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
7196 argument with NULL.
7197 (Sections_elememt_dot_assignment::set_section_addresses):
7198 Likewise.
7199 (Output_data_expression::do_write_to_buffer): Likewise.
7200 (Output_section_definition::finalize_symbols): Likewise.
7201 (Output_section_definition::set_section_addresses): Likewise.
7202
f81bc8b5
DK
72032010-09-30 Doug Kwan <dougkwan@google.com>
7204
7205 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
7206
c95e9f27
ST
72072010-09-28 Sriraman Tallam <tmsriram@google.com>
7208
7209 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 7210 function.
c95e9f27
ST
7211 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
7212 virtual function.
7213 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
7214 virtual function.
7215 * icf.cc (get_section_contents): Inline merge sections only when
7216 target allows it.
7217
3cac54d2
RW
72182010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7219
7220 * configure: Regenerate.
7221
2904037a
ILT
72222010-09-17 Ian Lance Taylor <iant@google.com>
7223
7224 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
7225 * testsuite/Makefile.am (memory_test.o): New target.
7226 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
7227 memory_test.t.
7228 * testsuite/Makefile.in: Rebuild.
2904037a 7229
bca7fb63
DK
72302010-09-17 Doug Kwan <dougkwan@google.com>
7231
7232 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
7233 defintion if relocation uses GOT entries of the symbol.
7234 * testsuite/icf_safe_test.sh: Fix test.
7235 * testsuite/icf_safe_so_test.sh: Fix test.
7236
4ef28648
CC
72372010-09-16 Cary Coutant <ccoutant@google.com>
7238
7239 * script_sections.cc (class Memory_region): Remove "NULL" from
7240 vector initializations.
7241
793990de
CC
72422010-09-15 Cary Coutant <ccoutant@google.com>
7243
7244 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
7245 Resolve forwarding symbols.
7246
81e015e2
DK
72472010-09-15 Doug Kwan <dougkwan@google.com>
7248
7249 * gold/testsuite/script_test_3.t: Add ARM special sections.
7250 * gold/testsuite/script_test_4.t: Same.
7251 * gold/testsuite/script_test_5.t: Same.
7252 * gold/testsuite/script_test_6.t: Same.
7253 * gold/testsuite/script_test_7.t: Same.
7254 * gold/testsuite/script_test_7.t: Same.
7255 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
7256
36171d64
CC
72572010-09-14 Cary Coutant <ccoutant@google.com>
7258
7259 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
7260 (Target_x86_64::Relocate::relocate_tls): Replace check for
7261 saw_tls_block_reloc_ with test for executable section.
7262
d89051bd
CC
72632010-09-12 Cary Coutant <ccoutant@google.com>
7264
7265 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
7266 position-independent executables to shared libraries need dynamic
7267 relocations.
7268 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
7269 position-independent executables.
7270 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
7271 * testsuite/Makefile.in: Regenerate.
7272
fca41f0f
NC
72732010-09-10 Nick Clifton <nickc@redhat.com>
7274
7275 PR gold/11997
7276 * testsuite/memory_test.t: Discard any sections that are not
7277 needed.
7278
6695e4b3
L
72792010-09-09 H.J. Lu <hongjiu.lu@intel.com>
7280
7281 PR gold/11996
7282 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
7283 "This::" to work around a bug in gcc 4.2.
7284
7285 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
7286
0f72bf6f
RÁE
72872010-09-09 Rafael Espindola <espindola@google.com>
7288
7289 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
7290 sections with different PF_X flags in the same segment.
7291 (Layout::find_first_load_seg): Search all segments to find the first
7292 one.
7293 * options.h (rosegment): New.
7294
72952010-09-08 Rafael Espindola <espindola@google.com>
a6577478 7296
05a79166 7297 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 7298
aa98ff75
DK
72992010-09-08 Doug Kwan <dougkwan@google.com>
7300
7301 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
7302 (Arm_relobj::do_relocate_sections): Add new parameter for output
7303 file to match the parent.
7304 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
7305 of local symbols instead of input values. Update code to track
7306 changes in gold::relocate_section.
7307 * object.cc (Sized_relobj::compute_final_local_value): New methods.
7308 (Sized_relobj::compute_final_local_value_internal): New methods.
7309 (Sized_relobj::do_finalize_local_symbols): Move code from loop
7310 body into private version of Sized_relobj::compute_final_local_value.
7311 Call the inline method.
7312 * object.h (Symbol_value::Symbol_value): Define destructor. Free
7313 merged symbol value if there is one.
7314 (Symbol_value::has_output_value): New method defintiion.
7315 (Sized_relobj::Compute_final_local_value_status): New enum type.
7316 (Sized_relobj::compute_final_local_value): New methods.
7317 (Sized_relobj::compute_final_local_value_internal): New methods.
7318 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
7319 and arm_cortex_a8.sh.
7320 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
7321 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
7322 New tests.
7323 * Makefile.in: Regenerate.
7324 * testsuite/arm_bl_out_of_range.s: Update test.
7325 * testsuite/thumb_bl_out_of_range.s: Ditto.
7326 * testsuite/thumb_blx_out_of_range.s: Ditto.
7327 * testsuite/arm_branch_out_of_range.sh: New file.
7328 * testsuite/arm_cortex_a8.sh: Ditto.
7329 * testsuite/arm_cortex_a8_b.s: Ditto.
7330 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
7331 * testsuite/arm_cortex_a8_b_local.s: Ditto.
7332 * testsuite/arm_cortex_a8_bl.s: Ditto.
7333 * testsuite/arm_cortex_a8_blx.s: Ditto.
7334 * testsuite/arm_cortex_a8_local.s: Ditto.
7335 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
7336 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
7337
05a79166
L
73382010-09-08 Rafael Espindola <espindola@google.com>
7339
7340 * Makefile.am (memory_test.stdout): Run readelf with -W.
7341 * Makefile.in: Regenerate.
7342 * testsuite/memory_test.sh: Make the regexps accept both 32 and
7343 64 bit output.
7344
33dbc701
RÁE
73452010-09-08 Rafael Espindola <espindola@google.com>
7346
7347 * script-sections.cc (Script_sections::add_memory_region): Convert
7348 field precision to int.
7349 * script.cc (script_set_section_region, script_set_section_region):
7350 Convert field precision to int.
7351
731ca54a
RÁE
73522010-09-08 Rafael Espindola <espindola@google.com>
7353
7354 * arm.cc (do_finalize_sections): Create the __exidx_start and
7355 __exdix_end symbols even when the section is missing.
7356
7f8cd844
NC
73572010-09-08 Nick Clifton <nickc@redhat.com>
7358
7359 * README: Remove claim that MEMORY is not supported.
7360 * expression.cc (script_exp_function_origin)
7361 (script_exp_function_length): Move from here to ...
7362 * script.cc: ... here.
7363 (script_set_section_region, script_add_memory)
7364 (script_parse_memory_attr, script_include_directive): New
7365 functions.
7366 * script-sections.cc
7367 (class Memory_region): New class.
7368 (class Output_section_definition): Add set_memory_region,
7369 set_section_vma, set_section_lma and get_section_name methods.
7370 (class Script_Sections): Add add_memory_region,
7371 find_memory_region, find_memory_region_origin,
7372 find_memory_region_length and set_memory_region methods.
7373 Have set_section_addresses method walk the list of set memory
7374 regions.
7375 Extend the print methos to display memory regions.
7376 * script-sections.h: Add prototypes for new methods.
7377 Add enum for MEMORY region attributes.
7378 * yyscript.y: Add support for parsing MEMORY regions.
7379 * script-c.h: Add prototypes for new functions.
7380 * testsuite/Makefile.am: Add test of MEMORY region functionality.
7381 * testsuite/Makefile.in: Regenerate.
7382 * testsuite/memory_test.sh: New script.
7383 * testsuite/memory_test.s: New assembler source file.
7384 * testsuite/memory_test.t: New linker script.
7385
a4649286
DK
73862010-08-27 Doug Kwan <dougkwan@google.com>
7387
7388 * gold/resolve.cc (Symbol_table::should_override): Let a weak
7389 reference override an existing dynamic weak reference.
7390 * testsuite/Makefile.am: Add new test dyn_weak_ref.
7391 * testsuite/Makefile.in: Regenerate.
7392 * testsuite/dyn_weak_ref.sh: New file.
7393 * testsuite/dyn_weak_ref_1.c: Ditto.
7394 * testsuite/dyn_weak_ref_2.c: Ditto.
7395
b56648ad
ILT
73962010-08-27 Ian Lance Taylor <iant@google.com>
7397
7398 * incremental.h (class Incremental_input_entry): Add virtual
7399 destructor.
7400
809313cb
ILT
74012010-08-27 Ian Lance Taylor <iant@google.com>
7402
7403 * testsuite/start_lib_test_3.c: Mark t3 as used.
7404
11e32464
NC
74052010-08-27 Nick Clifton <nickc@redhat.com>
7406
7407 * options.cc (version_script): Fix small typo in previous
7408 whitespace tidyup.
7409
ca09d69a
NC
74102010-08-25 Nick Clifton <nickc@redhat.com>
7411
7412 * archive.cc: Formatting fixes: Remove whitespace between
7413 typename and following asterisk. Remove whitespace between
7414 function name and opening parenthesis.
7415 * archive.h: Likewise.
7416 * arm.cc: Likewise.
7417 * attributes.cc: Likewise.
7418 * attributes.h: Likewise.
7419 * common.cc: Likewise.
7420 * copy-relocs.cc: Likewise.
7421 * dirsearch.h: Likewise.
7422 * dynobj.cc: Likewise.
7423 * ehframe.cc: Likewise.
7424 * ehframe.h: Likewise.
7425 * expression.cc: Likewise.
7426 * fileread.cc: Likewise.
7427 * fileread.h: Likewise.
7428 * gc.h: Likewise.
7429 * gold-threads.cc: Likewise.
7430 * gold.cc: Likewise.
7431 * i386.cc: Likewise.
7432 * icf.h: Likewise.
7433 * incremental-dump.cc: Likewise.
7434 * incremental.cc: Likewise.
7435 * layout.cc: Likewise.
7436 * layout.h: Likewise.
7437 * main.cc: Likewise.
7438 * merge.cc: Likewise.
7439 * merge.h: Likewise.
7440 * object.cc: Likewise.
7441 * object.h: Likewise.
7442 * options.cc: Likewise.
7443 * options.h: Likewise.
7444 * output.cc: Likewise.
7445 * output.h: Likewise.
7446 * plugin.cc: Likewise.
7447 * plugin.h: Likewise.
7448 * powerpc.cc: Likewise.
7449 * reloc.cc: Likewise.
7450 * script-c.h: Likewise.
7451 * script-sections.cc: Likewise.
7452 * script.cc: Likewise.
7453 * stringpool.cc: Likewise.
7454 * symtab.cc: Likewise.
7455 * symtab.h: Likewise.
7456 * target.cc: Likewise.
7457 * timer.cc: Likewise.
7458 * timer.h: Likewise.
7459 * version.cc: Likewise.
7460 * x86_64.cc: Likewise.
7461
b8fa8750
NC
74622010-08-24 Nick Clifton <nickc@redhat.com>
7463
7464 PR 11899
7465 * layout.cc (segment_precedes): Sort segments by their physical
7466 addresses, if they have been set.
7467
9919d93b
CC
74682010-08-23 Cary Coutant <ccoutant@google.com>
7469
7470 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
7471 symbols data.
7472 (Lib_group::include_member): Unlock object after deleting its
7473 symbols data.
7474 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
7475 the bug fixed here.
7476
97b4be1c
CC
74772010-08-19 Neil Vachharajani <nvachhar@google.com>
7478 Cary Coutant <ccoutant@google.com>
7479
7480 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
7481 constructor, and set_blocker.
7482 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
7483 readsyms_blocker_.
7484 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
7485 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
7486 * testsuite/Makefile.am (start_lib_test): New test case.
7487 * testsuite/Makefile.in: Regenerate.
7488 * testsuite/start_lib_test_main.c: New file.
7489 * testsuite/start_lib_test_1.c: New file.
7490 * testsuite/start_lib_test_2.c: New file.
7491 * testsuite/start_lib_test_3.c: New file.
7492
dd0b1884
ILT
74932010-08-19 Ian Lance Taylor <iant@google.com>
7494
7495 * Makefile.in: Rebuild with automake 1.11.1.
7496 * aclocal.m4: Likewise.
7497 * testsuite/Makefile.in: Likewise.
7498
7223e9ca
ILT
74992010-08-19 Ian Lance Taylor <iant@google.com>
7500
7501 PR 10893
7502 * i386.cc (class Output_data_plt_i386): Update declarations.
7503 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
7504 local_ifuncs_ fields.
7505 (Target_i386::do_plt_section_for_global): New function.
7506 (Target_i386::do_plt_section_for_local): New function.
7507 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
7508 parameter; change all callers. Initialize global_ifuncs_ and
7509 local_ifuncs_. If doing a static link define __rel_iplt_start and
7510 __rel_iplt_end.
7511 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
7512 (Output_data_plt_i386::add_local_ifunc_entry): New function.
7513 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
7514 symbols.
7515 (Target_i386::make_plt_section): New function, broken out of
7516 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
7517 (Target_i386::make_plt_entry): Call make_plt_section.
7518 (Target_i386::make_local_ifunc_plt_entry): New function.
7519 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
7520 (Target_i386::Scan::local): Handle IFUNC symbols. Add
7521 R_386_IRELATIVE to switch.
7522 (Target_i386::Scan::global): Likewise.
7523 (Target_i386::Relocate::relocate): Likewise.
7524 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
7525 switch.
7526 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
7527 (Target_x86_64::do_plt_section_for_global): New function.
7528 (Target_x86_64::do_plt_section_for_local): New function.
7529 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
7530 parameter; change all callers. If doing a static link define
7531 __rela_iplt_start and __rela_iplt_end.
7532 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
7533 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
7534 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
7535 to point to .plt.
7536 (Target_x86_64::make_local_ifunc_plt_entry): New function.
7537 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
7538 switch.
7539 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
7540 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
7541 R_X86_64_IRELATIVE to switch.
7542 (Target_x86_64::Scan::global): Likewise.
7543 (Target_x86_64::Relocate::relocate): Likewise.
7544 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
7545 switch.
7546 * target.h (class Target): Add plt_section_for_global and
7547 plt_section_for_local functions. Add do_plt_section_for_global
7548 and do_plt_section_for_local virtual functions.
7549 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
7550 clarifying comments.
7551 (Symbol::use_plt_offset): Handle IFUNC symbol.
7552 * object.cc (Sized_relobj::Sized_relobj): Initialize
7553 local_plt_offsets_.
7554 (Sized_relobj::local_has_plt_offset): New function.
7555 (Sized_relobj::local_plt_offset): New function.
7556 (Sized_relobj::set_local_plt_offset): New function.
7557 (Sized_relobj::do_count): Handle IFUNC symbol.
7558 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
7559 a bit away from input_shndx_ field. Add set_is_func_symbol and
7560 is_ifunc_symbol functions.
7561 (class Sized_relobj): Update declarations. Remove Tls_got_entry
7562 and Local_tls_got_offsets. Define Local_plt_offsets. Add
7563 local_plt_offsets_ field.
7564 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
7565 * output.h (class Output_section_data): Add non-const
7566 output_section function.
7567 (class Output_data_got): Update declarations.
7568 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
7569 Add use_plt_offset parameter to global and local constructors.
7570 Change all callers. Change local_sym_index_ field to 31 bits.
7571 Change GSYM_CODE and CONSTANT_CODE accordingly.
7572 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
7573 doing a static link don't set sh_link field.
7574 (Output_data_got::Got_entry::write): Use PLT offset if
7575 appropriate.
7576 (Output_data_got::add_global_plt): New function.
7577 (Output_data_got::add_local_plt): New function.
7578 * target-reloc.h (relocate_section): Handle IFUNC symbol.
7579 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
7580 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
7581 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
7582 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
7583 IFUNC conditional.
7584 * testsuite/ifunc-sel.h: New file.
7585 * testsuite/ifuncmain1.c: New file.
7586 * testsuite/ifuncmain1vis.c: New file.
7587 * testsuite/ifuncmod1.c: New file.
7588 * testsuite/ifuncdep2.c: New file.
7589 * testsuite/ifuncmain2.c: New file.
7590 * testsuite/ifuncmain3.c: New file.
7591 * testsuite/ifuncmod3.c: New file.
7592 * testsuite/ifuncmain4.c: New file.
7593 * testsuite/ifuncmain5.c: New file.
7594 * testsuite/ifuncmod5.c: New file.
7595 * testsuite/ifuncmain6pie.c: New file.
7596 * testsuite/ifuncmod6.c: New file.
7597 * testsuite/ifuncmain7.c: New file.
7598 * configure, testsuite/Makefile.in: Rebuild.
7599
56f75c03
ILT
76002010-08-18 Ian Lance Taylor <iant@google.com>
7601
7602 * incremental.cc
7603 (Output_section_incremental_inputs::write_input_files): Add cast
7604 to avoid signed/unsigned comparison warning.
7605 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7606
55455f89
CC
76072010-08-12 Cary Coutant <ccoutant@google.com>
7608
7609 * common.cc (Sort_commons::operator()): Remove unnecessary code.
7610
e2054bcb
ILT
76112010-08-13 Ian Lance Taylor <iant@google.com>
7612
7613 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
7614
74f67560
DK
76152010-08-12 Cary Coutant <ccoutant@google.com>
7616 Doug Kwan <dougkwan@google.com>
7617
7618 * resolve.cc (Symbol_table::should_override): When a weak dynamic
7619 defintion overrides non-weak undef, remember that the original undef
7620 is not weak.
7621 * symtab.cc (Symbol_table::sized_write_global): For undef without
7622 an original weak binding, set binding to global in output.
7623 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
7624 * testsuite/Makefile.in: Regenerate.
7625 * testsuite/strong_ref_weak_def.sh: New file.
7626 * testsuite/strong_ref_weak_def_1.c: Ditto.
7627 * testsuite/strong_ref_weak_def_2.c: Ditto.
7628
d1238d12
CC
76292010-08-12 Cary Coutant <ccoutant@google.com>
7630
7631 * testsuite/incremental_test.sh: Rewrite.
7632 * testsuite/incremental_test_1.c: Rewrite.
7633 * testsuite/incremental_test_2.c: Rewrite.
7634
0e70b911
CC
76352010-08-12 Cary Coutant <ccoutant@google.com>
7636
7637 * arm.cc (Target_arm::got_size): Add const.
7638 (Target_arm::got_entry_count): New function.
7639 (Target_arm::plt_entry_count): New function.
7640 (Target_arm::first_plt_entry_offset): New function.
7641 (Target_arm::plt_entry_size): New function.
7642 (Output_data_plt_arm::entry_count): New function.
7643 (Output_data_plt_arm::first_plt_entry_offset): New function.
7644 (Output_data_plt_arm::get_plt_entry_size): New function.
7645 * i386.cc (Target_i386::got_size): Add const.
7646 (Target_i386::got_entry_count): New function.
7647 (Target_i386::plt_entry_count): New function.
7648 (Target_i386::first_plt_entry_offset): New function.
7649 (Target_i386::plt_entry_size): New function.
7650 (Output_data_plt_i386::entry_count): New function.
7651 (Output_data_plt_i386::first_plt_entry_offset): New function.
7652 (Output_data_plt_i386::get_plt_entry_size): New function.
7653 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
7654 find_incremental_inputs_sections. Dump incremental_got_plt section.
7655 * incremental.cc: Include target.h.
7656 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
7657 parameter. Adjust all callers. Find incremental_got_plt section.
7658 (Incremental_inputs::create_data_sections): Create incremental_got_plt
7659 section.
7660 (Output_section_incremental_inputs::set_final_data_size): Calculate
7661 size of incremental_got_plt section.
7662 (Output_section_incremental_inputs::do_write): Write the
7663 incremental_got_plt section.
7664 (Got_plt_view_info): New struct.
7665 (Local_got_offset_visitor): New class.
7666 (Global_got_offset_visitor): New class.
7667 (Global_symbol_visitor_got_plt): New class.
7668 (Output_section_incremental_inputs::write_got_plt): New function.
7669 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
7670 Add parameter. Adjust all callers.
7671 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7672 (Incremental_inputs::got_plt_section): New function.
7673 (Incremental_inputs::got_plt_section_): New data member.
7674 (Incremental_got_plt_reader): New class.
7675 * layout.cc (Layout::create_incremental_info_sections): Add the
7676 incremental_got_plt section.
7677 * object.h (Got_offset_list::get_list): New function.
7678 (Got offset_list::for_all_got_offsets): New function.
7679 (Sized_relobj::local_got_offset_list): New function.
7680 * powerpc.cc (Target_powerpc::got_size): Add const.
7681 (Target_powerpc::got_entry_count): New function.
7682 (Target_powerpc::plt_entry_count): New function.
7683 (Target_powerpc::first_plt_entry_offset): New function.
7684 (Target_powerpc::plt_entry_size): New function.
7685 (Output_data_plt_powerpc::entry_count): New function.
7686 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
7687 (Output_data_plt_powerpc::get_plt_entry_size): New function.
7688 * sparc.cc (Target_sparc::got_size): Add const.
7689 (Target_sparc::got_entry_count): New function.
7690 (Target_sparc::plt_entry_count): New function.
7691 (Target_sparc::first_plt_entry_offset): New function.
7692 (Target_sparc::plt_entry_size): New function.
7693 (Output_data_plt_sparc::entry_count): New function.
7694 (Output_data_plt_sparc::first_plt_entry_offset): New function.
7695 (Output_data_plt_sparc::get_plt_entry_size): New function.
7696 * symtab.h (Symbol::got_offset_list): New function.
7697 (Symbol_table::for_all_symbols): New function.
7698 * target.h (Sized_target::got_entry_count): New function.
7699 (Sized_target::plt_entry_count): New function.
7700 (Sized_target::plt_entry_size): New function.
7701 * x86_64.cc (Target_x86_64::got_size): Add const.
7702 (Target_x86_64::got_entry_count): New function.
7703 (Target_x86_64::plt_entry_count): New function.
7704 (Target_x86_64::first_plt_entry_offset): New function.
7705 (Target_x86_64::plt_entry_size): New function.
7706 (Output_data_plt_x86_64::entry_count): New function.
7707 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
7708 (Output_data_plt_x86_64::get_plt_entry_size): New function.
7709
09ec0418
CC
77102010-08-12 Cary Coutant <ccoutant@google.com>
7711
7712 * archive.cc: Include incremental.h.
7713 (Archive::Archive): Initialize incremental_info_.
7714 (Archive::include_member): Record archive members in incremental info.
7715 (Add_archive_symbols::run): Record begin and end of an archive in
7716 incremental info.
7717 (Lib_group::include_member): Record objects in incremental info.
7718 * archive.h (Incremental_archive_entry): Forward declaration.
7719 (Archive::set_incremental_info): New member function.
7720 (Archive::incremental_info): New member function.
7721 (Archive::Unused_symbol_iterator): New class.
7722 (Archive::unused_symbols_begin): New member function.
7723 (Archive::unused_symbols_end): New member function.
7724 (Archive::incremental_info_): New data member.
7725 * incremental-dump.cc (find_input_containing_global): New function.
7726 (dump_incremental_inputs): Dump new incremental info sections.
7727 * incremental.cc: Include symtab.h.
7728 (Output_section_incremental_inputs): New class.
7729 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
7730 new incremental info sections.
7731 (Sized_incremental_binary::do_check_inputs): Likewise.
7732 (Incremental_inputs::report_archive): Remove.
7733 (Incremental_inputs::report_archive_begin): New function.
7734 (Incremental_inputs::report_archive_end): New function.
7735 (Incremental_inputs::report_object): New function.
7736 (Incremental_inputs::finalize_inputs): Remove.
7737 (Incremental_inputs::report_input_section): New function.
7738 (Incremental_inputs::report_script): Rewrite.
7739 (Incremental_inputs::finalize): Do nothing but finalize string table.
7740 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7741 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7742 (Incremental_inputs::create_data_sections): New function.
7743 (Incremental_inputs::relocs_entsize): New function.
7744 (Output_section_incremental_inputs::set_final_data_size): New function.
7745 (Output_section_incremental_inputs::do_write): New function.
7746 (Output_section_incremental_inputs::write_header): New function.
7747 (Output_section_incremental_inputs::write_input_files): New function.
7748 (Output_section_incremental_inputs::write_info_blocks): New function.
7749 (Output_section_incremental_inputs::write_symtab): New function.
7750 * incremental.h (Incremental_script_entry): Forward declaration.
7751 (Incremental_object_entry): Forward declaration.
7752 (Incremental_archive_entry): Forward declaration.
7753 (Incremental_inputs): Forward declaration.
7754 (Incremental_inputs_header_data): Remove.
7755 (Incremental_inputs_header): Remove.
7756 (Incremental_inputs_header_write): Remove.
7757 (Incremental_inputs_entry_data): Remove.
7758 (Incremental_inputs_entry): Remove.
7759 (Incremental_inputs_entry_write): Remove.
7760 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
7761 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
7762 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
7763 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
7764 Likewise.
7765 (Incremental_input_entry): New class.
7766 (Incremental_script_entry): New class.
7767 (Incremental_object_entry): New class.
7768 (Incremental_archive_entry): New class.
7769 (Incremental_inputs::Incremental_inputs): Initialize new data members.
7770 (Incremental_inputs::report_inputs): Remove.
7771 (Incremental_inputs::report_archive): Remove.
7772 (Incremental_inputs::report_archive_begin): New function.
7773 (Incremental_inputs::report_archive_end): New function.
7774 (Incremental_inputs::report_object): Change prototype.
7775 (Incremental_inputs::report_input_section): New function.
7776 (Incremental_inputs::report_script): Change prototype.
7777 (Incremental_inputs::get_reloc_count): New function.
7778 (Incremental_inputs::set_reloc_count): New function.
7779 (Incremental_inputs::create_data_sections): New function.
7780 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
7781 (Incremental_inputs::inputs_section): New function.
7782 (Incremental_inputs::symtab_section): New function.
7783 (Incremental_inputs::relocs_section): New function.
7784 (Incremental_inputs::get_stringpool): Add const.
7785 (Incremental_inputs::command_line): Add const.
7786 (Incremental_inputs::inputs): Remove.
7787 (Incremental_inputs::command_line_key): New function.
7788 (Incremental_inputs::input_file_count): New function.
7789 (Incremental_inputs::input_files): New function.
7790 (Incremental_inputs::relocs_entsize): New function.
7791 (Incremental_inputs::sized_create_inputs_section_data): Remove.
7792 (Incremental_inputs::finalize_inputs): Remove.
7793 (Incremental_inputs::Input_info): Remove.
7794 (Incremental_inputs::lock_): Remove.
7795 (Incremental_inputs::inputs_): Change type.
7796 (Incremental_inputs::inputs_map_): Remove.
7797 (Incremental_inputs::current_object_entry_): New data member.
7798 (Incremental_inputs::inputs_section_): New data member.
7799 (Incremental_inputs::symtab_section_): New data member.
7800 (Incremental_inputs::relocs_section_): New data member.
7801 (Incremental_inputs::reloc_count_): New data member.
7802 (Incremental_inputs_reader): New class.
7803 (Incremental_symtab_reader): New class.
7804 (Incremental_relocs_reader): New class.
7805 * layout.cc (Layout::finalize): Move finalization of incremental info
7806 and creation of incremental info sections to follow finalization of
7807 symbol table. Set offsets for postprocessing sections.
7808 (Layout::create_incremental_info_sections): Call
7809 Incremental_inputs::create_data_sections. Add incremental symtab
7810 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
7811 sections to layout after input sections.
7812 * layout.h (struct Timespec): Forward declaration.
7813 (Layout::incremental_inputs): Add const.
7814 (Layout::create_incremental_info_sections): Add parameter.
7815 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
7816 * object.cc: Include incremental.h.
7817 (Relobj::finalize_incremental_relocs): New function.
7818 (Sized_relobj::do_layout): Record input sections in incremental info.
7819 * object.h (Object::output_section): New function.
7820 (Object::output_section_offset): Moved from Relobj.
7821 (Object::get_incremental_reloc_base): New function.
7822 (Object::get_incremental_reloc_count): New function.
7823 (Object::do_output_section): New function.
7824 (Object::do_output_section_offset): Moved from Relobj.
7825 (Object::do_get_incremental_reloc_base): New function.
7826 (Object::do_get_incremental_reloc_count): New function.
7827 (Object::Object): Initialize new data members.
7828 (Relobj::output_section): Renamed do_output_section and moved to
7829 protected.
7830 (Relobj::output_section_offset): Moved to Object.
7831 (Relobj::do_get_incremental_reloc_base): New function.
7832 (Relobj::do_get_incremental_reloc_count): New function.
7833 (Relobj::allocate_incremental_reloc_counts): New function.
7834 (Relobj::count_incremental_reloc): New function.
7835 (Relobj::finalize_incremental_relocs): New function.
7836 (Relobj::next_incremental_reloc_index): New function.
7837 (Relobj::reloc_counts_): New data member.
7838 (Relobj::reloc_bases_): New data member.
7839 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
7840 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
7841 (Sized_relobj::incremental_relocs_scan): New function.
7842 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7843 (Sized_relobj::incremental_relocs_write): New function.
7844 (Sized_relobj::incremental_relocs_write_reltype): New function.
7845 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
7846 incremental link.
7847 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
7848 archives and object files elsewhere.
7849 (Add_symbols::run): Report object files here.
7850 (Finish_group::run): Report end of archive at end of group.
7851 * reloc.cc: Include layout.h, incremental.h.
7852 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
7853 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
7854 (Sized_relobj::incremental_relocs_scan): New function.
7855 (Sized_relobj::incremental_relocs_scan_reltype): New function.
7856 (Sized_relobj::do_relocate_sections): Write incremental relocations.
7857 (Sized_relobj::incremental_relocs_write): New function.
7858 (Sized_relobj::incremental_relocs_write_reltype): New function.
7859 * script.cc (read_input_script): Rewrite test for incremental link.
7860 Change call to Incremental_inputs::report_script.
7861 * symtab.h (Symbol_table::first_global_index): New function.
7862 (Symbol_table::output_count): New function.
7863
ce0d1972
DK
78642010-08-12 Doug Kwan <dougkwan@google.com>
7865
7866 * arm.cc (Target_arm::merge_object_attributes): Check command line
7867 options --no-wchar-size-warning and --no-enum-size-warning.
7868 * options.h (General_options): Add ld-compatible options
7869 --no-enum-size-warning and --no-wchar-size-warning.
7870
6e5710ce
ILT
78712010-08-04 Ian Lance Taylor <iant@google.com>
7872
7873 * x86_64.cc (Target_x86_64::Scan::local): Use
7874 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
7875 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
7876 (Target_x86_64::Scan::global): Likewise.
7877 (Target_x86_64::Relocate::relocate): Likewise.
7878 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
7879 Likewise.
7880
fef830db
CC
78812010-08-03 Cary Coutant <ccoutant@google.com>
7882
7883 * merge.cc (Output_merge_string::do_add_input_section): Count strings
7884 to reserve space in merged_strings vector. Keep total input size
7885 for stats.
7886 (Output_merge_string::do_print_merge_stats): Print total input size.
7887 * merge.h (Output_merge_string): Add input_size_ field.
7888 * stringpool.cc (Stringpool_template::string_length): Move
7889 implementations out of Stringpool_template class and place in
7890 stringpool.h.
7891 * stringpool.h (string_length): Move out of Stringpool_template.
7892
1e3811b0
ILT
78932010-08-03 Ian Lance Taylor <iant@google.com>
7894
7895 PR 11712
7896 * layout.cc (relaxation_loop_body): If address of load segment is
7897 set, adjust address to include headers if possible.
7898
7af0c620
ILT
78992010-08-03 Ian Lance Taylor <iant@google.com>
7900
7901 * version.cc (version_string): Bump to 1.10.
7902
22f0da72
ILT
79032010-08-03 Ian Lance Taylor <iant@google.com>
7904
7905 PR 11805
7906 * layout.h (enum Output_section_order): Define.
7907 (class Layout): Update declarations.
7908 * layout.cc (Layout::get_output_section): Add order parameter.
7909 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
7910 is_first_non_relro parameters. Change all callers.
7911 (Layout::choose_output_section): Likewise.
7912 (Layout::add_output_section_data): Likewise.
7913 (Layout::make_output_section): Likewise. Set order.
7914 (Layout::default_section_order): New function.
7915 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
7916 * output.cc (Output_section::Output_section): Initialize order_.
7917 Don't initialize deleted fields.
7918 (Output_segment::Output_segment): Don't initialize deleted
7919 fields.
7920 (Output_segment::add_output_section_to_load): New function
7921 replacing add_output_section. Change all callers to call this or
7922 add_output_section_to_nonload.
7923 (Output_segment::add_output_section_to_nonload): New function.
7924 (Output_segment::remove_output_section): Rewrite.
7925 (Output_segment::add_initial_output_data): Likewise.
7926 (Output_segment::has_any_data_sections): Likewise.
7927 (Output_segment::is_first_section_relro): Likewise.
7928 (Output_segment::maximum_alignment): Likewise.
7929 (Output_segment::has_dynamic_reloc): New function replacing
7930 dynamic_reloc_count. Change all callers.
7931 (Output_segment::has_dynamic_reloc_list): New function replacing
7932 dynamic_reloc_count_list. Change all callers.
7933 (Output_segment::set_section_addresses): Rewrite.
7934 (Output_segment::set_offset): Rewrite.
7935 (Output_segment::find_first_and_last_list): Remove.
7936 (Output_segment::set_tls_offsets): Rewrite.
7937 (Output_segment::first_section_load_address): Likewise.
7938 (Output_segment::output_section_count): Likewise.
7939 (Output_segment::section_with_lowest_load_address): Likewise.
7940 (Output_segment::write_section_headers): Likewise.
7941 (Output_segment::print_sections_to_map): Likewise.
7942 * output.h (class Output_data): Remove dynamic_reloc_count_
7943 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
7944 (Output_data::add_dynamic_reloc): Rewrite.
7945 (Output_data::has_dynamic_reloc): New function.
7946 (Output_data::dynamic_reloc_count): Remove.
7947 (class Output_section): Add order_ field. Remvoe is_relro_local_,
7948 is_last_relro_, is_first_non_relro_, is_interp_,
7949 is_dynamic_linker_section_ fields. Add order and set_order
7950 functions. Remove is_relro_local, set_is_relro_local,
7951 is_last_relro, set_is_last_relro, is_first_non_relro,
7952 set_is_first_non_relro functions, is_interp, set_is_interp,
7953 is_dynamic_linker_section, and set_is_dynamic_linker_section
7954 functions.
7955 (class Output_segment): Change Output_data_list from std::list to
7956 std:;vector. Add output_lists_ field. Remove output_data_ and
7957 output_bss_ fields. Update declarations.
7958
3ff2ccb0
ILT
79592010-08-02 Ian Lance Taylor <iant@google.com>
7960
7961 * arm.cc (Target_arm::gc_process_relocs): Use typename.
7962 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
7963 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
7964
88a4108b
ILT
79652010-08-02 Ian Lance Taylor <iant@google.com>
7966
7967 PR 11855
7968 * script.cc (Script_options::Script_options): Initialize
7969 symbol_definitions_ and symbol_references_.
7970 (Script_options::add_symbol_assignment): Update
7971 symbol_definitions_ and symbol_references_.
7972 (Script_options::add_symbol_reference): New function.
7973 (script_symbol): New function.
7974 * script.h (class Script_options): Add symbol_definitions_ and
7975 symbol_references_ fields.
7976 (Script_options::referenced_const_iterator): New type.
7977 (Script_options::referenced_begin): New function.
7978 (Script_options::referenced_end): New function.
7979 (Script_options::is_referenced): New function.
7980 (Script_options::any_unreferenced): New function.
7981 * script-c.h (script_symbol): Declare.
7982 * yyscript.y (exp): Call script_symbol.
7983 * symtab.cc: Include "script.h".
7984 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
7985 Change all callers. Check symbols referenced by scripts.
7986 (Symbol_table::add_undefined_symbols_from_command_line): Add
7987 layout parameter. Change all callers.
7988 (Symbol_table::do_add_undefined_symbols_from_command_line):
7989 Likewise. Break out loop body. Check symbols referenced by
7990 scripts.
7991 (Symbol_table::add_undefined_symbol_from_command_line): New
7992 function broken out of
7993 do_add_undefined_symbols_from_command_line.
7994 * symtab.h (class Symbol_table): Update declarations.
7995 * archive.cc: Include "layout.h".
7996 (Archive::should_include_member): Add layout parameter. Change
7997 all callers. Check for symbol mentioned in expression.
7998 * archive.h (class Archive): Update declaration.
7999 * object.cc (Sized_relobj::do_should_include_member): Add layout
8000 parameter.
8001 * object.h (Object::should_include_member): Add layout parameter.
8002 Change all callers.
8003 (Object::do_should_include_member): Add layout parameter.
8004 (class Sized_relobj): Update declaration.
8005 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
8006 parameter.
8007 * dynobj.h (class Sized_dynobj): Update declaration.
8008 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
8009 layout parameter.
8010 * plugin.h (class Sized_pluginobj): Update declaration.
8011
5f1ab67a
ILT
80122010-08-02 Ian Lance Taylor <iant@google.com>
8013
8014 PR 11866
8015 * output.cc (Output_segment::set_offset): Search for the first and
8016 last sections rather than assuming that the list is in order.
8017 (Output_segment::find_first_and_last_list): New function.
8018 * output.h (class Output_segment): Update declarations.
8019 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
8020 (relro_strip_test_SOURCES): New variable.
8021 (relro_strip_test_DEPENDENCIES): New variable.
8022 (relro_strip_test_LDFLAGS): New variable.
8023 (relro_strip_test_LDADD): New variable.
8024 (relro_strip_test.so): New target.
8025
a8df5856
ILT
80262010-08-02 Ian Lance Taylor <iant@google.com>
8027
8028 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
8029 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
8030 (Target_i386::got_tlsdesc_section): New function.
8031 (Target_i386::got_section): Create space for GOT entries for
8032 TLSDESC relocations.
8033 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
8034 R_386_TLS_GOTDESC.
8035 (Target_i386::Scan::global): Likewise.
8036 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
8037 using TLSDESC GOT.
8038 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
8039 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
8040 (Target_x86_64::got_tlsdesc_section): New function.
8041 (Target_x86_64::got_section): Create space for GOT entries for
8042 TLSDESC relocations.
8043 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
8044 R_386_TLS_GOTDESC.
8045 (Target_x86_64::Scan::global): Likewise.
8046 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
8047 using TLSDESC GOT.
8048
0c10a0a6
ILT
80492010-08-02 Ian Lance Taylor <iant@google.com>
8050
8051 * testsuite/final_layout.sh: Use dc to convert from hex to
8052 decimal.
8053
41cbeecc
ST
80542010-07-29 Sriraman Tallam <tmsriram@google.com>
8055
8056 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
8057 paramter to the call to gold::gc_process_relocs.
8058 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
8059 paramter to the call to gold::gc_process_relocs.
8060 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
8061 parameter to the call to gold::gc_process_relocs.
8062 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
8063 template parameter to the call to gold::gc_process_relocs.
8064 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
8065 paramter to the call to gold::gc_process_relocs.
8066 * gc.h (get_embedded_addend_size): New function.
8067 (gc_process_relocs): Save the size of the reloc for use by ICF.
8068 * icf.cc (get_section_contents): Get the addend from the text section
8069 for SHT_REL relocation sections.
8070 * icf.h (Icf::Reloc_addend_size_info): New typedef.
8071 (Icf::Reloc_info): Add new member reloc_addend_size_info.
8072 * int_encoding.h (read_from_pointer): New overloaded function.
8073 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
8074 * testsuite/icf_sht_rel_addend_test.sh: New file.
8075 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
8076 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
8077
6ea55b82
RW
80782010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8079
8080 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
8081 * Makefile.in: Regenerate.
8082 * testsuite/Makefile.in: Regenerate.
8083
9691462b
ILT
80842010-07-27 Jeffrey Yasskin <jyasskin@google.com>
8085
8086 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
8087 * gold/testsuite/debug_msg.cc: Likewise.
8088 * gold/testsuite/odr_violation1.cc
8089 * gold/testsuite/odr_violation2.cc
8090
76897331
CC
80912010-07-21 Cary Coutant <ccoutant@google.com>
8092
8093 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
8094 string, and length fields.
8095 (Output_merge_string::Merged_strings_list): New type.
8096 (Output_merge_string::Merged_strings_lists): New typedef.
8097 (Output_merge_string): Replace merged_strings_ with
8098 merged_strings_lists_.
8099 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
8100 Merged_strings_list per input object and section. Don't store pointer
8101 to the string. Don't store length with each merged string entry.
8102 (Output_merge_string::finalize_merged_data): Loop over list of merged
8103 strings lists. Recompute length of each merged string.
8104
78384e8f
CC
81052010-07-15 Cary Coutant <ccoutant@google.com>
8106
8107 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
8108 here.
8109
783659f9
ILT
81102010-07-14 Ian Lance Taylor <iant@google.com>
8111
8112 * descriptors.cc (Descriptors::open): Report correct name in error
8113 message.
8114
131687b4
DK
81152010-07-13 Doug Kwan <dougkwan@google.com>
8116
8117 * arm.cc (Arm_input_section::Arm_input_section): For a
8118 SHT_ARM_EXIDX section, always keeps the input sections.
8119 (Arm_input_section::set_exidx_section_link): New method.
8120 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
8121 has_errors_ to false.
8122 (Arm_exidx_input_section::has_errors,
8123 Arm_exidx_input_section::set_has_errors): New methods.
8124 (Arm_exidx_input_section::has_errors_): New data member.
8125 (Arm_relobj::get_exidx_shndx_list): New method.
8126 (Arm_output_section::append_text_sections_to_list): Do not skip
8127 section without SHF_EXECINSTR.
8128 (Arm_output_section::fix_exidx_coverage): Skip input sections with
8129 errors.
2e702c99 8130 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
8131 section header. Make error messages more verbose. Check for
8132 a non-executable section linked to an EXIDX section.
8133 (Arm_relobj::do_read_symbols): Remove error checking, which has been
8134 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
8135 check that there is no deferred EXIDX section if we exit early.
8136 Instead of not making an EXIDX section in case of an error, make one
8137 and set the has_errors flag of it.
8138 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
8139 in a relocatable link.
8140 (Target_arm::do_relax): Look for the EXIDX output section instead of
8141 assuming that it is called .ARM.exidx.
2e702c99 8142 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
8143 section list. Do not check for SHF_EXECINSTR section flags but
8144 skip any input section with errors.
8145 * output.cc (Output_section::Output_section): Initialize
8146 always_keeps_input_sections_ to false.
8147 (Output_section::add_input_section): Check for
8148 always_keeps_input_sections_.
8149 * output.h (Output_section::always_keeps_input_sections,
8150 Output_section::set_always_keeps_input_sections): New methods.
8151 (Output_section::always_keeps_input_sections): New data member.
8152
69517287
RÁE
81532010-07-13 Rafael Espindola <espindola@google.com>
8154
8155 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
8156 * fileread.h (Input_file): Add try_extra_search_path and find_file.
8157
82742395
ILT
81582010-07-13 Philip Herron <herron.philip@googlemail.com>
8159 Ian Lance Taylor <iant@google.com>
8160
8161 * output.h (Output_section_lookup_maps::add_merge_section):
8162 Correct check of whether value was inserted.
8163 (Output_section_lookup_maps::add_merge_input_section): Likewise.
8164 (Output_section_lookup_maps::add_relaxed_input_section):
8165 Likewise.
8166 * arm.cc (Target_arm::got_section): Remove used local os.
8167 * i386.cc (Target_i386::got_section): Likewise.
8168 * x86_64.cc (Target_x86_64::got_section): Likewise.
8169 * sparc.cc (Target_sparc::got_section): Likewise.
8170 (Target_sparc::relocate): Remove unused local have_got_offset.
8171 * powerpc.cc (Target_powerpc::relocate): Likewise.
8172
f2d707b5
ILT
81732010-07-13 Ian Lance Taylor <iant@google.com>
8174
241531d6
ILT
8175 * compressed_output.cc (zlib_decompress): Fix signature in
8176 !HAVE_ZLIB_H case.
8177
f2d707b5
ILT
8178 * archive.cc (Archive::include_member): Unlock an external member
8179 of a thin archive. Don't bother to delete an object we know is
8180 NULL.
8181
a2e47362
CC
81822010-07-12 Cary Coutant <ccoutant@google.com>
8183
8184 * compressed_output.cc (zlib_decompress): New function.
8185 (get_uncompressed_size): New function.
8186 (decompress_input_section): New function.
8187 * compressed_output.h (get_uncompressed_size): New function.
8188 (decompress_input_section): New function.
8189 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
8190 Handle compressed debug sections.
8191 * layout.cc (is_compressed_debug_section): New function.
8192 (Layout::output_section_name): Map compressed section names to
8193 canonical names.
8194 * layout.h (is_compressed_debug_section): New function.
8195 (is_debug_info_section): Recognize compressed debug sections.
8196 * merge.cc: Include compressed_output.h.
8197 (Output_merge_data::do_add_input_section): Handle compressed
8198 debug sections.
8199 (Output_merge_string::do_add_input_section): Handle compressed
8200 debug sections.
8201 * object.cc: Include compressed_output.h.
8202 (Sized_relobj::Sized_relobj): Initialize new data members.
8203 (build_compressed_section_map): New function.
8204 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
8205 * object.h (Object::section_is_compressed): New method.
8206 (Object::do_section_is_compressed): New method.
8207 (Sized_relobj::Compressed_section_map): New type.
8208 (Sized_relobj::do_section_is_compressed): New method.
8209 (Sized_relobj::compressed_sections_): New data member.
8210 * output.cc (Output_section::add_input_section): Handle compressed
8211 debug sections.
8212 * reloc.cc: Include compressed_output.h.
8213 (Sized_relobj::write_sections): Handle compressed debug sections.
8214
ce279a62
CC
82152010-07-08 Cary Coutant <ccoutant@google.com>
8216
8217 * resolve.cc (Symbol_table::resolve): Remember whether undef was
8218 weak when resolving to a dynamic def.
8219 (Symbol_table::should_override): Add adjust_dyndef flag; set it
8220 for weak undef/dynamic def cases. Adjust callers.
8221 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
8222 undef_binding_weak_.
8223 (Symbol_table::sized_write_globals): Adjust symbol binding.
8224 (Symbol_table::sized_write_symbol): Add binding parameter.
8225 * symtab.h (Symbol::set_undef_binding): New method.
8226 (Symbol::is_undef_binding_weak): New method.
8227 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
8228 (Symbol_table::should_override): Add new parameter.
8229 (Symbol_table::sized_write_symbol): Add new parameter.
8230
8231 * testsuite/weak_undef_file1.cc: Add new test case.
8232 * testsuite/weak_undef_file2.cc: Fix header comment.
8233 * testsuite/weak_undef_test.cc: Add new test case.
8234
b2286c10
DK
82352010-06-29 Doug Kwan <dougkwan@google.com>
8236
8237 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
8238 Initialize USE_SYMBOL_.
8239 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
8240 definition.
8241 (Arm_reloc_property::uses_symbol_): New data member declaration.
8242 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
8243 uses symbol value and symbol is undefined but not weakly undefined.
8244
4802450a
RÁE
82452010-06-28 Rafael Espindola <espindola@google.com>
8246
8247 * plugin.cc (Plugin::load): Use dlerror.
8248
e5ca47ba
ILT
82492010-06-26 Jeffrey Yaskin <jyasskin@google.com>
8250
8251 * symtab.cc (detect_odr_violations): When reporting an ODR
8252 violation, report an object where the symbol is defined.
8253
8a75a161
DK
82542010-06-25 Doug Kwan <dougkwan@google.com>
8255
8256 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
8257 (Target_arm::section_may_have_icf_unsafe_pointers): New method
8258 definition.
8259 (Target_arm::Scan::local_reloc_may_be_function_pointer,
8260 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
8261 target hook to detect function points.
8262 (Target_arm::Scan::possible_function_pointer_reloc): New method.
8263 * icf.h (Icf::check_section_for_function_pointers): Change type of
8264 parameter SECTION_NAME to const reference to std::string. Use
8265 target hook to determine if section may have unsafe pointers.
8266 * target.h (Target::section_may_have_icf_unsafe_pointers): New
8267 method definition.
8268
42218b9f
RÁE
82692010-06-21 Rafael Espindola <espindola@google.com>
8270
8271 * fileread.cc (Input_file::find_fie): New
8272 (Input_file::open): Use Input_file::find_fie.
8273 * fileread.h (Input_file::find_fie): New
8274 * plugin.cc (set_extra_library_path): New.
8275 (Plugin::load): Add set_extra_library_path to the transfer vector.
8276 (Plugin_manager::set_extra_library_path): New.
8277 (Plugin_manager::add_input_file): Use the extra search path if set.
8278 (set_extra_library_path(): New.
8279 * plugin.h (Plugin_manager): Add set_extra_library_path and
8280 extra_search_path_.
8281
a0506cca
CC
82822010-06-19 Cary Coutant <ccoutant@google.com>
8283
8284 * layout.cc (gdb_sections): Add .debug_types.
8285 (lines_only_debug_sections): Likewise.
8286
6508b958
RÁE
82872010-06-18 Rafael Espindola <espindola@google.com>
8288
8289 * plugin.cc (add_input_file,add_input_library)
8290 (Plugin_manager::add_input_file): Make filename arguments const.
8291 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
8292 const.
8293
3e235302
DK
82942010-06-16 Doug Kwan <dougkwan@google.com>
8295
8296 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
8297 .ARM.attributes section if we have not merged any input
8298 attributes sections.
8299
106e8a6c
DK
83002010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8301
8302 * arm.cc: Allow combining objects with no EABI version
8303 information.
8304
91ff43fe
RÁE
83052010-06-15 Rafael Espindola <espindola@google.com>
8306
8307 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
8308
68ed838c
ILT
83092010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8310
8311 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
8312 (struct iovec): Correct !HAVE_READV definition.
8313
f3a2388f
CC
83142010-06-10 Cary Coutant <ccoutant@google.com>
8315
8316 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
8317 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
8318 reloc sections.
8319 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
8320
8321 PR 11683
8322 * symtab.h (Symbol::is_placeholder): New member function.
8323 * target-reloc.h (relocate_section): Check for placeholder symbols.
8324
8325 * testsuite/Makefile.am (plugin_test_8): New test.
8326 (plugin_test_9): New test.
8327 * testsuite/Makefile.in: Regenerate.
8328
e1df38aa
NC
83292010-06-09 Nick Clifton <nickc@redhat.com>
8330
8331 * yyscript.y (input_list_element): Allow strings prefixed with
8332 the '-' character. Treat these as libraries.
8333 * script.cc (script_add_library): New function. Adds a library
8334 specified by "-l<name>" found in an input script.
8335 * script-c.h: Add prototype for script_add_library.
8336
25bbe950
DK
83372010-06-07 Doug Kwan <dougkwan@google.com>
8338
8339 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
8340 Restrict stub-group size to be within long conditional branch
8341 range when working around cortex-A8 erratum.
8342
0f32ea4c
ILT
83432010-06-07 Damien Diederen <dd@crosstwine.com>
8344
8345 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
8346 #ifdef typo.
8347
8fe2a369
ST
83482010-06-03 Sriraman Tallam <tmsriram@google.com>
8349
8350 PR gold/11658
8351 * output.cc
8352 (Output_section::Input_section_sort_entry::compare_section_ordering):
8353 Change to return non-zero correctly.
8354 (Output_section::Input_section_sort_section_order_index_compare
8355 ::operator()): Change to fix ambiguity in comparisons.
8356
6e9ba2ca
ST
83572010-06-01 Sriraman Tallam <tmsriram@google.com>
8358
8359 * gold.h (is_wildcard_string): New function.
8360 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
8361 (Layout::layout_eh_frame): Ditto.
8362 (Layout::find_section_order_index): New method.
8363 (Layout::read_layout_from_file): New method.
8364 * layout.h (Layout::find_section_order_index): New method.
8365 (Layout::read_layout_from_file): New method.
8366 (Layout::input_section_position_): New private member.
8367 (Layout::input_section_glob_): New private member.
8368 * main.cc (main): Call read_layout_from_file here.
8369 * options.h (--section-ordering-file): New option.
8370 * output.cc (Output_section::input_section_order_specified_): New
8371 member.
8372 (Output_section::Output_section): Initialize new member.
8373 (Output_section::add_input_section): Add new parameter.
8374 Keep input sections when --section-ordering-file is used.
8375 (Output_section::set_final_data_size): Sort input sections when
8376 section ordering file is specified.
8377 (Output_section::Input_section_sort_entry): Add new parameter.
8378 Check sorting type.
8379 (Output_section::Input_section_sort_entry::compare_section_ordering):
8380 New method.
8381 (Output_section::Input_section_sort_compare::operator()): Change to
8382 consider section_order_index.
8383 (Output_section::Input_section_sort_init_fini_compare::operator()):
8384 Change to consider section_order_index.
8385 (Output_section::Input_section_sort_section_order_index_compare
8386 ::operator()): New method.
8387 (Output_section::sort_attached_input_sections): Change to sort
8388 according to section order when specified.
e1df38aa
NC
8389 (Output_section::add_input_section<32, true>): Add new parameter.
8390 (Output_section::add_input_section<64, true>): Add new parameter.
8391 (Output_section::add_input_section<32, false>): Add new parameter.
8392 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
8393 * output.h (Output_section::add_input_section): Add new parameter.
8394 (Output_section::input_section_order_specified): New
8395 method.
8396 (Output_section::set_input_section_order_specified): New method.
8397 (Input_section::Input_section): Initialize section_order_index_.
8398 (Input_section::section_order_index): New method.
8399 (Input_section::set_section_order_index): New method.
8400 (Input_section::section_order_index_): New member.
8401 (Input_section::Input_section_sort_section_order_index_compare): New
8402 struct.
8403 (Output_section::input_section_order_specified_): New member.
8404 * script-sections.cc (is_wildcard_string): Delete and move modified
8405 method to gold.h.
8406 (Output_section_element_input::Output_section_element_input): Modify
8407 call to is_wildcard_string.
8408 (Output_section_element_input::Input_section_pattern
8409 ::Input_section_pattern): Ditto.
8410 (Output_section_element_input::Output_section_element_input): Ditto.
8411 * testsuite/Makefile.am (final_layout): New test case.
8412 * testsuite/Makefile.in: Regenerate.
8413 * testsuite/final_layout.cc: New file.
8414 * testsuite/final_layout.sh: New file.
8415
3537c84b
RÁE
84162010-06-01 Rafael Espindola <espindola@google.com>
8417
8418 * plugin.cc (Plugin::load): Pass the output name to the plugin.
8419
105b6afd
RÁE
84202010-06-01 Rafael Espindola <espindola@google.com>
8421
8422 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
8423 visibility of symbols.
8424
29e11421
DK
84252010-05-27 Doug Kwan <dougkwan@google.com>
8426
8427 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
8428 from start of output section instead of address for a local symbol
8429 in a merged or relaxed section when doing a relocatable link.
8430
5e0f337e
RÁE
84312010-05-26 Rafael Espindola <espindola@google.com>
8432
703d02da 8433 PR 11604
5e0f337e
RÁE
8434 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
8435 adding sections the garbage collector removed.
8436 * gold/testsuite/Makefile.am: Add test.
8437 * gold/testsuite/Makefile.in: Regenerate.
8438 * gold/testsuite/plugin_test_7.sh: New.
8439 * gold/testsuite/plugin_test_7_1.c: New.
8440 * gold/testsuite/plugin_test_7_2.c: New.
8441
f4187277
RÁE
84422010-05-26 Rafael Espindola <espindola@google.com>
8443
8444 * script-sections.cc (Output_section_definition::set_section_addresses):
8445 Check for --section-start.
8446
5c388529
DK
84472010-05-26 Doug Kwan <dougkwan@google.com>
8448
8449 * arm.cc (Arm_scan_relocatable_relocs): New class.
8450 (Target_arm::relocate_special_relocatable): New method.
8451 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
8452 (Arm_relocate_functions::thumb_branch_common): Same.
8453 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
8454 instead of Default_scan_relocatable_relocs.
8455 * target-reloc.h (relocate_for_relocatable): Let target handle
8456 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
8457 * target.h (Sized_target::relocate_special_relocatable): New method.
8458
bca1c3ae
ILT
84592010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8460
8461 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
8462
0439c796
DK
84632010-05-23 Doug Kwan <dougkwan@google.com>
8464
8465 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
8466 instead of a cast.
8467 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
8468 with a direct branch, not a conditional branch, to a stub.
8469 * merge.cc (Output_merge_base::record_input_section): New method
8470 defintion.
8471 (Output_merge_data::do_add_input_section): Record input section if
8472 keeps-input-sections flag is set.
8473 (Output_merge_string::do_add_input_section): Ditto.
8474 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
8475 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
8476 INPUT_SECTIONS_.
8477 (Output_merge_base::keeps_input_sections,
8478 Output_merge_base::set_keeps_input_sections,
8479 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
8480 method definitions.
8481 (Output_merge_base::Input_sections): New type declaration.
8482 (Output_merge_base::input_sections_begin,
8483 Output_merge_base::input_sections_end,
8484 Output_merge_base::do_set_keeps_input_sections): New method definitions.
8485 (Output_merge_base::bool keeps_input_sections_,
8486 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
8487 Output_merge_base::input_sections_): New data members.
8488 (Output_merge_data::do_set_keeps_input_sections): New method
8489 defintion.
8490 (Output_merge_string::do_set_keeps_input_sections): Ditto.
8491 * output.cc (Output_section::Input_section::relobj): Move method
8492 defintion from class declaration to here and handle merge sections.
8493 (Output_section::Input_section::shndx): Ditto.
8494 (Output_section::Output_section): Remove initializations of removed
8495 data members and initialize new data member LOOKUP_MAPS_.
8496 (Output_section::add_input_section): Set keeps-input-sections flag
8497 for a newly created merge output section as appropriate. Adjust code
8498 to use Output_section_lookup_maps class.
8499 (Output_section::add_relaxed_input_section): Adjst code for lookup
8500 maps code refactoring.
2e702c99 8501 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
8502 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
8503 class. If adding input section to a newly created merge output
8504 section fails, remove the new merge section.
8505 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 8506 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 8507 (Output_section::find_merge_section): Ditto.
0439c796 8508 (Output_section::build_lookup_maps): New method defintion.
2e702c99 8509 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
8510 Output_section_lookup_maps class.
8511 (Output_section::get_input_sections): Export merge sections. Adjust
8512 code to use Output_section_lookup_maps class.
8513 (Output_section:::add_script_input_section): Adjust code to use
8514 Output_section_lookup_maps class. Update lookup maps for merge
8515 sections also.
8516 (Output_section::discard_states): Use Output_section_lookup_maps.
8517 (Output_section::restore_states): Same.
8518 * output.h (Merge_section_properties): Move class defintion out of
8519 Output_section.
8520 (Output_section_lookup_maps): New class.
8521 (Output_section::Input_section::is_merge_section): New method
8522 defintion.
8523 (Output_section::Input_section::relobj): Move defintion out of class
8524 defintion. Declare method only.
8525 (Output_section::Input_section::shndx): Ditto.
8526 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 8527 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
8528 (Output_section::Merge_section_by_properties_map,
8529 Output_section::Output_section_data_by_input_section_map,
8530 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
8531 Remove types.
2e702c99 8532 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
8533 KEEPS_INPUT_SECTIONS.
8534 (Output_section::build_lookup_maps): New method declaration.
8535 (Output_section::merge_section_map_,
8536 Output_section::merge_section_by_properties_map_,
8537 Output_section::relaxed_input_section_map_,
8538 Output_section::is_relaxed_input_section_map_valid_): Remove data
8539 members.
8540 (Output_section::lookup_maps_): New data member.
8541
76295588
L
85422010-05-21 Doug Kwan <dougkwan@google.com>
8543
8544 PR gold/11619
8545 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
8546 avoid a compilation error.
8547
d103a984
RÁE
85482010-05-19 Rafael Espindola <espindola@google.com>
8549
8550 * script-sections.cc (Output_section_definition::allocate_to_segment):
8551 Update the phdrs_list even when the output section is NULL.
8552 * testsuite/Makefile.am: Add test.
8553 * testsuite/Makefile.in: Regenerate.
8554 * testsuite/script_test_9.cc: New.
8555 * testsuite/script_test_9.sh: New.
8556 * testsuite/script_test_9.t: New.
8557
6625d24e
DK
85582010-05-19 Doug Kwan <dougkwan@google.com>
8559
8560 * arm.cc (Arm_input_section::original_size): New method.
8561 (Arm_input_section::do_addralign): Add a cast.
8562 (Arm_input_section::do_output_offset): Remove static cast.
8563 (Arm_input_section::original_addralign,
8564 Arm_input_section::original_size_): Change type to uint32_t.
8565 (Arm_input_section::init): Add safe casts for section alignment
8566 and size.
8567 (Arm_input_section::set_final_data_size): Do not set address and
8568 offset of stub table.
8569 (Arm_output_section::fix_exidx_coverage): Change use of of
8570 Output_section::Simple_input_section to that of
8571 Output_section::Input_section.
8572 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
8573 except for the first pass.
8574 * output.cc (Output_section::get_input_sections): Change type of
8575 input_sections to std::list<Input_section>.
8576 (Output_section::add_script_input_section): Rename from
8577 Output_section::add_simple_input_section. Change type of SIS
8578 parameter from Simple_input_section to Input_section.
8579 * output.h (Output_section::Simple_input_section): Remove class.
8580 (Output_section::Input_section): Change class visibility to public.
8581 (Output_section::Input_section::addralign): Use stored alignments
8582 for special input sections if set.
8583 (Output_section::Input_section::set_addralign): New method.
8584 (Output_section::get_input_sections): Change parameter type from
8585 list of Simple_input_section to list of Input_section.
8586 (Output_section::add_script_input_section): Rename from
8587 Output_section::add_simple_input_section. Change first parameter's
8588 type from Simple_input_section to Input_section and remove the
8589 second and third parameters.
8590 * script-sections.cc (Input_section::Input_section_list): Change
8591 type to list of Output_section::Input_section/
8592 (Input_section_info::Input_section_info): Change parameter type of
8593 INPUT_SECTION to Output_section::Input_section.
8594 (Input_section_info::input_section): Change return type.
8595 (Input_section_info::input_section_): Change type to
8596 Output_section::Input_section.
8597 (Output_section_element_input::set_section_addresses): Adjust code
8598 to use Output_section::Input_section instead of
8599 Output_section::Simple_input_section. Adjust code for renaming
8600 of Output_section::add_simple_input_section.
8601 (Orphan_output_section::set_section_addresses): Ditto.
8602
e1e82ea4
RW
86032010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8604
8605 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
8606 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
8607
91e75c8a
RÁE
86082010-05-18 Rafael Espindola <espindola@google.com>
8609
8610 * options.cc (General_options::finalize): Handle -nostdlib.
8611 * options.h (nostdlib): New option.
8612 * script.cc (script_add_search_dir): Handle -nostdlib.
8613
da59ad79
DK
86142010-05-12 Doug Kwan <dougkwan@google.com>
8615
8616 * arm.cc (Target_arm::do_finalize_sections): Create an empty
8617 attributes section only if there no attributes section after merging.
8618 (Target_arm::merge_object_attributes): Move value of
e1df38aa 8619 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
8620 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
8621 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
8622 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
8623 and arm_attr_merge_7.stdout.
8624 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
8625 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
8626 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
8627 arm_attr_merge_7b.o): New rules.
8628 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
8629 arm_attr_merge_7
8630 * testsuite/Makefile.in: Regenerate.
8631 * testsuite/arm_attr_merge.sh: New file.
8632 * testsuite/arm_attr_merge_[67][ab].s: Same.
8633
3e01a7fd
NC
86342010-05-05 Nick Clifton <nickc@redhat.com>
8635
8636 * po/es.po: Updated Spanish translation.
8637
7ad2014a
L
86382010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8639
8640 * Makefile.am (install-exec-local): Properly install gold as
8641 default cross linker.
8642 * Makefile.in: Regenerated.
8643
4fda8867
NC
86442010-04-27 H.J. Lu <hongjiu.lu@intel.com>
8645 Nick Clifton <nickc@redhat.com>
8646
8647 * configure.ac (install_as_default): Define and set to false
8648 unless --enable-gold or --enable-gold=both/gold has been
8649 specified.
8650 * configure: Regenerate.
8651
8652 * Makefile.am (install-exec-local): Install the executable as
8653 'ld.gold'. If install_as_default is true then also install it as
8654 'ld'.
8655 * Makefile.in: Regenerated.
8656
bd288ea2
ILT
86572010-04-24 Ian Lance Taylor <iant@google.com>
8658
8659 * layout.cc (Layout::layout_reloc): In relocatable link don't
8660 combine reloc sections for grouped sections.
8661
ef38fd8a
ST
86622010-04-23 Sriraman Tallam <tmsriram@google.com>
8663
8664 * gc.h (gc_process_relocs): Pass information on relocs pointing to
8665 sections that are not ordinary to icf.
8666 * icf.cc (get_section_contents): Handle relocation pointing to section
8667 with no object or shndx information.
8668 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
8669 * testsuite/Makefile.in: Regenerate.
8670 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
8671 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
8672
f6973bdc
ILT
86732010-04-22 Ian Lance Taylor <iant@google.com>
8674
8675 * expression.cc (Expression::Expression_eval_info): Add
8676 result_alignment_pointer field.
8677 (Expression::eval_with_dot): Add result_alignment_pointer
8678 parameter. Change all callers.
8679 (Expression::eval_maybe_dot): Likewise.
8680 (class Binary_expression): Add alignment_pointer parameter to
8681 left_value and right_value. Change all callers.
8682 (BINARY_EXPRESSION): Set result alignment.
8683 (class Trinary_expression): Add alignment_pointer parameter to
8684 arg2_value and arg3_value. Change all callers.
8685 (Trinary_cond::value): Set result alignment.
8686 (Max_expression::value, Min_expression::value): Likewise.
8687 (Align_expression::value): Likewise.
8688 * script-sections.cc (class Sections_element): Add dot_alignment
8689 parameter to set_section_addresses virtual function. Update
8690 instantiations.
8691 (class Output_section_element): Likewise.
8692 (Script_sections::create_segments): Add dot_alignment parameter.
8693 Change all callers.
8694 (Script_sections::create_segments_from_phdrs_clause): Likewise.
8695 (Script_sections::set_phdrs_clause_addresses): Likewise.
8696 * script-sections.h: Update declarations.
8697 * script.h: Update declarations.
8698 * output.h (Output_segment::set_minimum_p_align): Don't decrease
8699 min_p_align.
8700 * testsuite/script_test_3.t: Set large alignment.
8701 * testsuite/script_test_3.sh: Make sure that at least one LOAD
8702 segment has expected alignment.
8703
9c9c98a5
NC
87042010-04-22 Nick Clifton <nickc@redhat.com>
8705
8706 * po/gold.pot: Updated by the Translation project.
8707 * po/vi.po: Updated Vietnamese translation.
8708
2253bfba
L
87092010-04-22 H.J. Lu <hongjiu.lu@intel.com>
8710
8711 * testsuite/Makefile.am (check_PROGRAMS): Add
8712 icf_virtual_function_folding_test.
8713 * testsuite/Makefile.in: Regenerated.
8714
85fdf906
AH
87152010-04-15 Andrew Haley <aph@redhat.com>
8716
8717 * options.h (merge_exidx_entries): New option.
8718 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
8719 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
8720 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
8721 (Target_arm::merge_exidx_entries): New function.
8722 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
8723 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
8724 to Arm_exidx_fixup constructor.
8725 Add new arg, merge_exidx_entries.
8726 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
8727 Arm_output_section::fix_exidx_coverage.
8728
ce97fa81
ST
87292010-04-18 Sriraman Tallam <tmsriram@google.com>
8730
8731 * icf.cc (get_section_contents): Check for preemptible functions.
8732 Ignore addend when appropriate.
8733 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
8734 section folded.
8735 (add_from_relobj): Check for section folded.
8736 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
8737 * symtab.h (should_add_dynsym_entry): Add new parameter.
8738 * target-reloc.h (scan_relocs): Check for section folded.
8739 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
8740 Check reloc types for function pointers in shared objects.
8741 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
8742 case.
8743 (icf_preemptible_functions_test): New test case.
8744 (icf_string_merge_test): New test case.
8745 * testsuite.Makefile.in: Regenerate.
8746 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
8747 bar_glob. Refactor code.
8748 * testsuite/icf_preemptible_functions_test.cc: New file.
8749 * testsuite/icf_preemptible_functions_test.sh: New file.
8750 * testsuite/icf_string_merge_test.cc: New file.
8751 * testsuite/icf_string_merge_test.sh: New file.
8752 * testsuite/icf_virtual_function_folding_test.cc: New file.
8753 * testsuite/icf_virtual_function_folding_test.sh: New file.
8754
04ceb17c
DK
87552010-04-14 Doug Kwan <dougkwan@google.com>
8756
8757 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
8758 for local symbol recounting if we remove a section due to ICF.
8759 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
8760 there are no regular objects in input.
8761
153e7da4
DK
87622010-04-13 Doug Kwan <dougkwan@google.com>
8763
8764 * arm.cc (Arm_input_section::set_final_data_size): Compute
8765 accurate final data size instead of using current data size.
8766
4dbd9faf
DK
87672010-04-09 Doug Kwan <dougkwan@google.com>
8768
8769 * layout.cc (Layout::choose_output_section): Handle script section
8770 types.
8771 (Layout::make_output_section_for_script): Add section type parameter.
8772 Handle script section types.
8773 * layout.h (Layout::make_output_section_for_script): Add section
8774 type parameter.
8775 * output.cc (Output_section::Output_section): Initialize data member
8776 is_noload_.
8777 (Output_section::do_reset_address_and_file_offset): Do not set address
8778 to 0 if section is a NOLOAD section.
8779 * output.h (Output_section::is_noload): New method.
8780 (Output_section::set_is_noload): Ditto.
8781 (Output_section::is_noload_): New data member.
8782 * script-c.h (Script_section_type): New enum type.
8783 (struct Parser_output_section_header): Add new file section_type.
8784 * script-sections.cc (Sections_element::output_section_name): Add
8785 parameter for returning script section type.
8786 (Output_section_definition::output_section_name): Ditto.
8787 (Output_section_definition::section_type)P; New method.
8788 (Output_section_definiton::script_section_type_name): Ditto.
8789 (Output_section_definition::script_section_type_): New data member.
8790 (Output_section_definition::Output_section_definition): Initialize
8791 data member Output_section_definition::script_section_type_.
8792 (Output_section_definition::create_sections): Pass script section type
8793 to Layout::make_output_section_for_script.
8794 (Output_section_definition::output_section_name): Return script
8795 section type to caller.
8796 (Output_section_definition::set_section_address): Do not advance
8797 dot value and load address if section type is NOLOAD. Set address
8798 of NOLOAD sections regardless of section flags.
8799 (Output_section_definition::print): Print section type if it is
8800 not SCRIPT_SECTION_TYPE_NONE.
8801 (Output_section_definition::section_type): New method.
8802 (Output_section_definition::script_section_type_name): Ditto.
8803 (Script_sections::output_section_name): Add new parameter
8804 PSECTION_TYPE for returning script section type. Pass it to
8805 section elements. Handle discard sections.
8806 (Sort_output_sections::operator()): Handle NOLOAD sections.
8807 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 8808 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
8809 returning script section type.
8810 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
8811 INFO and NOLOAD.
8812 * yyscript.y (union): Add new field SECTION_TYPE.
8813 (COPY, DSECT, INFO, NOLOAD): New tokens.
8814 (opt_address_and_section_type): Change type to output_section_header.
8815 (section_type): New non-terminal
8816 (section_header): Handle section type.
2253bfba 8817 (opt_address_and_section_type): Return section type value.
4dbd9faf 8818
721ea635
L
88192010-04-09 H.J. Lu <hongjiu.lu@intel.com>
8820
8821 * testsuite/plugin_common_test_1.c (foo): Add prototype.
8822 * testsuite/plugin_common_test_2.c (foo): Likewise.
8823
6bf924b0
DK
88242010-04-08 Doug Kwan <dougkwan@google.com>
8825
8826 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
8827 Output_merge_data.
8828 * output.cc (Output_section::add_merge_input_section): Simplify
8829 code and return status of Output_merge_base::add_input_section.
e1df38aa 8830 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
8831 returns true.
8832
24af6f92
DK
88332010-04-07 Doug Kwan <dougkwan@google.com>
8834
8835 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
8836 if section is marked as containing instructions but has no mapping
8837 symbols.
8838 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
8839 correct section index.
8840 (Arm_relobj::find_linked_text_section): Ditto.
8841
00698fc5
CC
88422010-04-07 Cary Coutant <ccoutant@google.com>
8843
8844 * archive.cc (include_member): Destroy Read_symbols_data object before
8845 releasing file.
8846 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
8847 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
8848 (Read_symbols_data::~Read_symbols_data) New destructor.
8849 (Section_relocs::Section_relocs) New constructor.
8850 (Section_relocs::~Section_relocs) New destructor.
8851 (Read_relocs_data::Read_relocs_data) New constructor.
8852 (Read_relocs_data::~Read_relocs_data) New destructor.
8853 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
8854 pointers to NULL after deleting.
8855
7296d933
DK
88562010-04-07 Doug Kwan <dougkwan@google.com>
8857
8858 * arm.cc: Replace "endianity" with "endianness" in comments.
8859 (Arm_exidx_cantunwind): Ditto.
8860 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
8861 (Arm_relobj::merge_flags_and_attributes): New method.
8862 (Arm_relobj::merge_flags_and_attributes_): New data member.
8863 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
8864 (Arm_relobj::scan_sections_for_stubs): Ditto.
8865 (Arm_relobj::do_read_symbols): Check to see if we really want to
8866 merge processor-specific flags and attributes. Exit early if
8867 an object is empty except for section names and the undefined symbol.
8868 (Target_arm::do_finalize_sections): Move check for ELF format to
8869 Arm_relobj::do_read_symbols. Merge processor specific flags and
8870 attributes from a regular object only when we have determined that
8871 it is aapropriate. Do not create an .ARM.attributes section in
8872 output if there is no regular input object.
8873 (Target_arm::merge_processor_specific_flags): Check
8874 --warn-mismatch before printing any error.
8875 (Target_arm::merge_object_attributes): Ditto.
8876 * gold.cc (queue_middle_tasks): Handle the case in which there is
8877 no regular object in input.
8878 * options.cc (General_options::parse_EB): New method.
8879 (General_options::parse_EL): Same.
8880 (General_options::General_options): Initialize endianness_.
8881 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
8882 New options.
8883 (General_options::Endianness): New enum.
8884 (General_options::endianness): New method.
8885 (General_options::endianness_): New data member.
8886 * parameters.cc (Parameters::set_options): Check target endianness.
8887 (Parameters::set_target_once): Ditto.
8888 (Parameters::check_target_endianness): New method.
8889 (parameters_force_valid_target): If either -EL or -EB is specified,
8890 use it to define endianness of default target.
8891 * parameters.h (Parameters::check_target_endianness): New method
8892 declaration.
8893 * target.h (class Target): Change "endianity" to "endianness"
8894 in comments.
8895
efc8d4f2
RW
88962010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8897
8898 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
8899 * configure: Regenerate.
8900 * Makefile.in: Regenerate.
8901 * testsuite/Makefile.in: Regenerate.
8902
be234d88
CC
89032010-04-06 Cary Coutant <ccoutant@google.com>
8904
8905 gcc PR lto/42757
8906 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
8907 prevailing definitions of common symbols.
8908 * testsuite/plugin_test_6.sh: New test case.
8909 * testsuite/plugin_common_test_1.c: New test case.
8910 * testsuite/plugin_common_test_2.c: New test case.
8911 * testsuite/Makefile.am (plugin_test_6): New test case.
8912 * testsuite/Makefile.in: Regenerate.
8913
bd32c6bd
NC
89142010-04-06 Nick Clifton <nickc@redhat.com>
8915
8916 * po/vi.po: New Vietnamese translation.
8917
323c532f
DK
89182010-03-30 Doug Kwan <dougkwan@google.com>
8919
8920 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
8921
4fcd97eb
DK
89222010-03-25 Doug Kwan <dougkwan@google.com>
8923
8924 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
8925 to avoid a conversion warning on a 32-bit host.
8926
4ebf39db
ILT
89272010-03-24 Ian Lance Taylor <iant@google.com>
8928
8929 * testsuite/script_test_3.t: Add a TLS segment.
8930 * testsuite/Makefile.am (check_PROGRAMS): Add
8931 tls_phdrs_script_test.
8932 (tls_phdrs_script_test_SOURCES): Define.
8933 (tls_phdrs_script_test_DEPENDENCIES): Define.
8934 (tls_phdrs_script_test_LDFLAGS): Define.
8935 (tls_phdrs_script_test_LDADD): Define.
8936 * testsuite/Makefile.in: Rebuild.
8937
4a599bdd
CC
89382010-03-23 Cary Coutant <ccoutant@google.com>
8939
8940 * fileread.cc (find_or_make_view): Fix comment.
8941
6c93b22c
ILT
89422010-03-23 Ian Lance Taylor <iant@google.com>
8943
8944 * script-sections.cc (class Orphan_section_placement): Define
8945 PLACE_TLS and PLACE_TLS_BSS.
8946 (Orphan_section_placement::Orphan_section_placement): Initialize
8947 new places.
8948 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
8949 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
8950 (tls_script_test_SOURCES): Define.
8951 (tls_script_test_DEPENDENCIES): Define.
8952 (tls_script_test_LDFLAGS): Define.
8953 (tls_script_test_LDADD): Define.
8954 * testsuite/Makefile.in: Rebuild.
8955
a2c7281b
DK
89562010-03-22 Doug Kwan <dougkwan@google.com>
8957
8958 * arm.cc (Arm_relocate_functions::abs8,
8959 Arm_relocate_functions::abs16): Use correct check for overflow
8960 specified in the ARM ELF specs.
8961 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
8962 target of a BLX instruction specially.
8963 (Reloc_stub::stub_type_for_reloc): Ditto.
8964 (Relocate::relocate): Use symbolic names instead of numeric relocation
8965 codes to report error.
8966 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
8967 workaround.
8968 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
8969 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
8970 thumb2_blx_out_of_range.stdout
8971 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
8972 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
8973 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
8974 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
8975 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
8976 thumb2_blx_in_range, thumb2_blx_in_range.o,
8977 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
8978 thumb2_blx_out_of_range.o): New rules.
2e702c99 8979 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
8980 thumb2_blx_in_range and thumb2_blx_out_of_range.
8981 * testsuite/Makefile.in: Regenerate.
8982 * arm_branch_in_range.sh: Add tests for THUMB BLX.
8983 * testsuite/thumb_blx_in_range.s: New file.
8984 * testsuite/thumb_blx_out_of_range.s: New file.
8985
b0193076
RÁE
89862010-03-22 Rafael Espindola <espindola@google.com>
8987
8988 * archive.cc (Should_include): Move to archive.h.
8989 (should_include_member): Make it a member of Archive.
8990 (Lib_group): New.
8991 (Add_lib_group_symbols): New.
8992 * archive.h: Include options.h.
8993 (Archive_member): Moved from Archive.
8994 (Should_include): Moved from archive.cc.
8995 (Lib_group): New.
8996 (Add_lib_group_symbols): New.
8997 * dynobj.cc (do_should_include_member): New.
8998 * dynobj.h (do_should_include_member): New.
8999 * gold.cc (queue_initial_tasks): Update call to queue.
9000 * main.cc (main): Print lib group stats.
9001 * object.cc (do_should_include_member): New.
9002 * object.h: Include archive.h.
9003 (Object::should_include_member): New.
9004 (Object::do_should_include_member): New.
9005 (Sized_relobj::do_should_include_member): New.
9006 * options.cc (General_options::parse_start_lib): New.
9007 (General_options::parse_end_lib): New.
9008 (Input_arguments::add_file): Handle lib groups.
9009 (Input_arguments::start_group): Check we are not in a lib.
9010 (Input_arguments::start_lib): New.
9011 (Input_arguments::end_lib): New.
9012 * options.h (General_options): Add start_lib and end_lib.
9013 (Input_argument::lib_): New.
9014 (Input_argument::lib): New.
9015 (Input_argument::is_lib): New.
9016 (Input_file_lib): New.
9017 (Input_arguments::in_lib_): New.
9018 (Input_arguments::in_lib): New.
9019 (Input_arguments::start_lib): New.
9020 (Input_arguments::end_lib_): New.
9021 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
9022 in unused members as preempted.
9023 (Sized_pluginobj::do_should_include_member): New.
9024 * plugin.h (Sized_pluginobj::do_should_include_member): New.
9025 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
9026 return the blocker.
9027 (Read_symbols::do_whole_lib_group): New.
9028 (Read_symbols::do_lib_group): New.
9029 (Read_symbols::do_read_symbols): Handle lib groups.
9030 (Read_symbols::get_name): Handle lib groups.
9031 * readsyms.h (Read_symbols): Add an archive member pointer.
9032 (Read_symbols::do_whole_lib_group): New.
9033 (Read_symbols::do_lib_group): New.
9034 (Read_symbols::member_): New.
9035 * script.cc (read_input_script): Update call to queue_soon.
9036
d099120c
DK
90372010-03-19 Doug Kwan <dougkwan@google.com>
9038
9039 * arm.cc (Stub_table::Stub_table): Initialize new data members
9040 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9041 (Stub_table::add_reloc_stub): Assign stub offset and update
9042 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
9043 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
9044 New data members.
2e702c99 9045 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
9046 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
9047 instead of going over all reloc stubs.
2e702c99 9048 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
9049 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9050 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 9051 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
9052 Stringpool_template::offset_.
9053 * stringpool.h (Stringpool_template::set_no_zero_null): Set
9054 Stringpool_template::offset_ to zero.
9055
1aa37384
DK
90562010-03-15 Doug Kwan <dougkwan@google.com>
9057
9058 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
9059 offset_.
9060 (Stringpool_template::new_key_offset): New method.
9061 (Stringpool_template::add_string): Assign offsets when adding new
9062 strings.
9063 (Stringpool_template::set_string_offsets): Do not set string offsets
9064 when not optimizing.
9065 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
9066 member size_.
2e702c99
RM
9067 (Chunked_vector::clear): Clear size_.
9068 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
9069 (Chunked_vector::size): Return size_.
9070 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 9071 (Chunked_vector::size_): New data member.
1aa37384
DK
9072 (Stringpool_template::set_no_zero_null): Assert string set is empty.
9073 (Stringpool_template::new_key_offset): New method declaration.
9074 (Stringpool_template::offset_): New data member.
9075
b672b057
RÁE
90762010-03-15 Rafael Espindola <espindola@google.com>
9077
9078 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
9079 Add_symbols' constructor.
9080 * readsyms.h (Add_symbols): Remove the input_group member.
9081
b6848d3c
ILT
90822010-03-10 Ian Lance Taylor <iant@google.com>
9083
9084 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
9085 target to ask whether a reference to a symbol requires a stack
9086 split.
9087 * target.h (Target::is_call_to_non_split): New function.
9088 (Target::do_is_call_to_non_split): Declare virtual function.
9089 * target.cc: Include "symtab.h".
9090 (Target::do_is_call_to_non_split): New function.
9091 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
9092
a2a5469e
CC
90932010-03-10 Cary Coutant <ccoutant@google.com>
9094
9095 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
9096 (File_read::open[1]): Remove initial mapping of whole_file_view_.
9097 (File_read::open[2]): Add whole_file_view_ to list of views.
9098 (File_read::make_view): Remove test of whole_file_view_.
9099 (File_read::find_or_make_view): Create whole_file_view_ if
9100 necessary.
9101 (File_read::clear_views): Replace bool parameter with enum;
9102 adjust all callers. Don't delete views with permanent data;
9103 do delete cached views and views from archives if
9104 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
9105 if clearing the corresponding view.
9106 * fileread.h (File_read::Clear_views_mode): New enum.
9107 (File_read::View::is_permanent_view): New method.
9108 (File_read::clear_views): Replace bool parameter
9109 with enum; adjust all callers.
9110 * options.h (General_options): Change keep_files_mapped option;
9111 add map_whole_files.
9112 * readsyms.cc (Add_symbols::run): Delete sd_ object before
9113 releasing the file.
9114 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
9115 the file.
9116
8861f32b
DM
91172010-03-10 David S. Miller <davem@davemloft.net>
9118
9119 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
9120
d62d0f5f
ST
91212010-03-09 Sriraman Tallam <tmsriram@google.com>
9122
9123 * icf.cc (get_section_contents): Add '@' marker after processing the
9124 merge reloc.
9125
9177756d
DK
91262010-03-08 Doug Kwan <dougkwan@google.com>
9127
9128 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
9129 due to a conversion warning.
9130 (Arm_relobj::update_output_local_symbol_count): Check for local
9131 symbol with unset output index.
9132
9e9e071b
ILT
91332010-03-05 Ian Lance Taylor <iant@google.com>
9134
9135 * options.h (class General_options): Add --spare-dynamic-tags.
9136 * output.cc (Output_data_dynamic::set_final_data_size): Implement
9137 --spare-dynamic-tags.
9138
a81ee015
ILT
91392010-03-05 Ian Lance Taylor <iant@google.com>
9140
9141 * incremental.cc: Include "libiberty.h".
9142
44ec90b9
RO
91432010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
9144
9145 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
9146 function, is_info_ member.
9147 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
9148 (Versions::Versions): Update caller.
9149 (Versions::define_base_version): Likewise.
9150 (Versions::add_def): Likewise.
9151
0897ed3b
ST
91522010-03-03 Sriraman Tallam <tmsriram@google.com>
9153
9154 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
9155 (Scan::possible_function_pointer_reloc): New function.
9156 (Scan::local_reloc_may_be_function_pointer): Change to call
9157 possible_function_pointer_reloc.
9158 (Scan::global_reloc_may_be_function_pointer): Ditto.
9159 * icf.h (Icf::check_section_for_function_pointers): Change to reject
9160 relocations in ".data.rel.ro._ZTV" section.
9161 * testsuite/icf_safe_so_test.sh: Change to pass i386.
9162 * testsuite/icf_safe_so_test.cc: Ditto.
9163 * testsuite/icf_safe_test.cc: Ditto.
9164 * testsuite/icf_safe_test.sh: Ditto.
9165
d3bbad62
ILT
91662010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9167 Ian Lance Taylor <iant@google.com>
9168
9169 * target-reloc.h (relocate_section): Check the symbol table index
9170 for -1U before setting the local symbol index.
9171 (scan_relocatable_relocs): If copying the relocation, record that
9172 the local symbol is required.
9173 * object.h (Symbol_value::is_output_symtab_index_set): New
9174 function.
9175 (Symbol_value::may_be_discarded_from_output_symtab): New
9176 function.
9177 (Symbol_value::has_output_symtab_entry): New function.
9178 (Symbol_value::needs_output_symtab_entry): Remove.
9179 (Symbol_value::output_symtab_index): Make sure the symbol index is
9180 set.
9181 (Symbol_value::set_output_symtab_index): Make sure the symbol
9182 index is not set. Make sure the new index is valid.
9183 (Symbol_value::set_must_have_output_symtab_entry): New function.
9184 (Symbol_value::has_output_dynsym_entry): New function.
9185 (Symbol_value::set_output_dynsym_index): Make sure the new index
9186 is valid.
9187 (Sized_relobj::set_must_have_output_symtab_entry): New function.
9188 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
9189 local symbol if permitted.
9190 (Sized_relobj::do_finalize_local_symbols): Call
9191 is_output_symtab_index_set rather than needs_output_symtab_entry.
9192 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
9193 rather than needs_output_symtab_entry. Call
9194 has_output_dynsym_entry rather than needs_output_dynsym_entry.
9195 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
9196 is_output_symtab_index_set rather than needs_output_symtab_entry.
9197 * testsuite/discard_locals_relocatable_test.c: New file.
9198 * testsuite/discard_locals_test.sh: Test -r.
9199 * testsuite/Makefile.am (check_DATA): Add
9200 discard_locals_relocatable_test1.syms,
9201 discard_local_relocatable_test2.syms.
9202 (MOSTLYCLEANFILES): Likewise. Also add
9203 discard_locals_relocatable_test1.lout and
9204 discard_locals_relocatable_test2.out.
9205 (discard_locals_relocatable_test1.syms): New target.
9206 (discard_locals_relocatable_test.o): New target.
9207 (discard_locals_relocatable_test1.out): New target.
9208 (discard_locals_relocatable_test2.syms): New target.
9209 (discard_locals_relocatable_test2.out): New target.
9210 (various): Add missing ../ld-new dependencies.
9211 * testsuite/Makefile.in: Rebuild.
9212
7e8ccf26
NC
92132010-03-03 Nick Clifton <nickc@redhat.com>
9214
9215 * po/fi.po: New Finnish translation.
9216
2a0ff005
DK
92172010-03-01 Doug Kwan <dougkwan@google.com>
9218
9219 * layout.cc (Layout::Layout): Force section types of .init_array*,
9220 .preinit_array* and .fini_array* sections.
9221 * output.cc (Output_section::Input_section_sort_entry::has_priority):
9222 Fix check of return value of std::string::find.().
9223 (Output_section::Input_section_sort_compare::operator()): Remove
9224 comment about .init_array.
9225 (Output_section::Input_section_sort_init_fini_compare::operator()):
9226 New method.
9227 (Output_section::sort_attached_input_sections): Handle .init_array
9228 and .fini_array specially.
9229 * output.h (Output_section::Inut_section_sort_compare): Update
9230 comment.
9231 (Output_section::Input_section_sort_init_fini_compare): New struct.
9232
c3e4ae29
DK
92332010-02-26 Doug Kwan <dougkwan@google.com>
9234
9235 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
9236 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
9237 * testsuite/debug_msg.sh: Avoid matching source line number for
9238 use of global variable undef_int.
9239
2fd9ae7a
DK
92402010-02-26 Doug Kwan <dougkwan@google.com>
9241
9242 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
9243 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
9244 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
9245 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
9246 * options.cc (General_options::General_options): Initialize member
9247 fix_v4bx_.
9248 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
9249 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
9250 and rm_no_fix_v4bx.stdout
9251 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
9252 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
9253 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
9254 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
9255 and arm_no_fix_v4bx.
9256 * Makefile.in: Regenerate.
9257 * testsuite/arm_fix_v4bx.s: New file.
9258 * testsuite/arm_fix_v4bx.sh: Ditto.
9259
67ec7d0b
DK
92602010-02-24 Doug Kwan <dougkwan@google.com>
9261
9262 * arm.cc (Target_arm::got_section): Make the .got section the first
9263 non RELRO section in the data segment.
9264 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
9265 suffixes of section names.
9266
10165461
DK
92672010-02-24 Doug Kwan <dougkwan@google.com>
9268
9269 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
9270 flags and attributes merging if an input file is a binary file.
9271 * fileread.cc (Input_file::open): Record format of original file.
9272 * fileread.h (Input_file::Format): New enum type.
2e702c99 9273 (Input_file::Input_file): Initialize data member format_.
10165461
DK
9274 (Input_file::format): New method definition.
9275 (Input_file::format_):: New data member.
9276
4a54abbb
DK
92772010-02-24 Doug Kwan <dougkwan@google.com>
9278
9279 * arm.cc (Arm_output_data_got): New class.
9280 (ARM_TCB_SIZE): New constant
9281 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
9282 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
9283 If user uses a script with a SECTIONS clause, issue only a warning
9284 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 9285 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
9286 garbage collection.
9287 (Target_arm::got_mode_index_entry): Handle static linking.
9288 (Target_arm::Scan::local): Ditto.
9289 (Target_arm::Scan::global): Ditto.
9290 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
9291 all incorrectly implemented relocations.
e1df38aa 9292 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
9293 Arm_output_section::fix_exidx_coverage.
9294 * layout.cc (Layout::section_name_mapping): Remove trailing dots
9295 from ".ARM.exidx." and ".ARM.extab.".
9296
ca419a6f
ILT
92972010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9298
9299 * arm.cc (Target_arm::do_finalize_sections): Create attribute
9300 section if it does not already exist.
9301 * attributes.cc (Attributes_section_data::Attributes_section_data):
9302 Don't crash if size is zero.
9303
135b9c78
ILT
93042010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9305 Ian Lance Taylor <iant@google.com>
9306
9307 * gold.cc (queue_middle_tasks): If no input files were opened,
9308 exit.
9309 * workqueue.h (Task_function::Task_function): Assert that there is
9310 a blocker.
9311
bb0bfe4f
DK
93122010-02-22 Doug Kwan <dougkwan@google.com>
9313
9314 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
9315 * icf.cc (get_section_contents): Cast snprintf arguments to long long
9316 types to avoid warnings due to different uint64_t implementations
9317 on different hosts.
9318
2a2b6d42
DK
93192010-02-21 Doug Kwan <dougkwan@google.com>
9320
9321 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
9322 handling of the maximum backward branch offset.
2e702c99 9323 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
9324 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
9325 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 9326 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
9327 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
9328 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
9329 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
9330 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
9331 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
9332 thumb_bl_out_of_range thumb_bl_out_of_range.o,
9333 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
9334 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
9335 thumb2_bl_out_of_range.o): New rules.
9336 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
9337 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
9338 thumb2_bl_out_of_range
9339 * testsuite/Makefile.in: Regenerate.
9340 * testsuite/arm_bl_in_range.s: New file.
9341 * testsuite/arm_bl_out_of_range.s: Ditto.
9342 * testsuite/arm_branch_in_range.sh: Ditto.
9343 * testsuite/arm_branch_range.t: Ditto.
9344 * testsuite/thumb2_branch_range.t: Ditto.
9345 * testsuite/thumb_bl_in_range.s: Ditto.
9346 * testsuite/thumb_bl_out_of_range.s: Ditto.
9347 * testsuite/thumb_branch_range.t: Ditto.
9348
b487ad64
ST
93492010-02-20 Sriraman Tallam <tmsriram@google.com>
9350
9351 * gc.h (gc_process_relocs): Change vectors to point to the new list.
9352 Add reloc offset information.
9353 * icf.cc (get_section_contents): Change iterators to point to the new
9354 vectors. Add reloc offset information to the contents.
9355 * icf.h (Icf::Sections_reachable_info): New typedef.
9356 (Icf::Sections_reachable_list): New typedef.
9357 (Icf::Offset_info): New typedef.
9358 (Icf::Reloc_info): New struct typedef.
9359 (Icf::Reloc_info_list): New typedef.
9360 (Icf::symbol_reloc_list): Delete method.
9361 (Icf::addend_reloc_list): Delete method.
9362 (Icf::section_reloc_list): Delete method.
9363 (Icf::reloc_info_list): New method.
9364 (Icf::reloc_info_list_): New member.
9365
f96accdf
DK
93662010-02-19 Doug Kwan <dougkwan@google.com>
9367
9368 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
9369 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
9370 * arm.cc (Arm_relocation_functions): New forward declaration.
9371 (Target_arm::Target_arm): Initialize new data members
9372 got_mod_index_offset_ and tls_base_symbol_defined_.
9373 (Target_arm::Relocate::relocate_tls): New method.
9374 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
9375 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
9376 New methods.
2e702c99 9377 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
9378 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
9379 (Target_arm::got_mod_index_offset_,
9380 Target_arm::tls_base_symbol_defined_): New data members.
9381 (Target_arm::Scan::local, Target::Scan::global,
9382 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
9383 relocations.
9384
c8761b9a
DK
93852010-02-18 Doug Kwan <dougkwan@google.com>
9386
9387 * arm.cc (Arm_relobj::find_linked_text_section): New method.
9388 (Arm_relobj::make_exidx_input_section): Pass section index of linked
9389 text section as a parameter becuase some broken tools may not set
9390 the link in section header.
9391 (Target_arm::has_got_section): New method.
9392 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
9393 without any mapping symbol as data only. Remove warning.
9394 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
9395 link in its section header, try to discover the link by inspecting the
9396 REL31 relocation at the beginning of the section.
9397 (Target_arm::Scan::check_non_pic): Report name of offending relocation
9398 in error message.
9399 (Target_arm::Scan::global): Treat any reference to the symbol
9400 _GLOBAL_OFFSET_TABLE_ as a GOT access.
9401
21bb3914
ST
94022010-02-12 Sriraman Tallam <tmsriram@google.com>
9403
9404 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
9405 (Scan::global_reloc_may_be_function_pointer): New function.
9406 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9407 (Scan::global_reloc_may_be_function_pointer): New function.
9408 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
9409 (Scan::global_reloc_may_be_function_pointer): New function.
9410 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
9411 (Scan::global_reloc_may_be_function_pointer): New function.
9412 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
9413 (Scan::global_reloc_may_be_function_pointer): New function.
9414 (Scan::possible_function_pointer_reloc): New function.
9415 (Target_x86_64::can_check_for_function_pointers): New function.
9416 * gc.h (gc_process_relocs): Scan relocation types to determine if
9417 function pointers were taken for targets that support it.
9418 * icf.cc (Icf::find_identical_sections): Include functions for
9419 folding in safe ICF whose pointer is not taken.
9420 * icf.h (Secn_fptr_taken_set): New typedef.
9421 (fptr_section_id_): New member.
9422 (section_has_function_pointers): New function.
9423 (set_section_has_function_pointers): New function.
9424 (check_section_for_function_pointers): New function.
9425 * options.h: Fix comment for safe ICF option.
9426 * target.h (can_check_for_function_pointers): New function.
9427 * testsuite/Makefile.am: Add icf_safe_so_test test case.
9428 Modify icf_safe_test for X86-64.
9429 * testsuite/Makefile.in: Regenerate.
9430 * testsuite/icf_safe_so_test.cc: New file.
9431 * testsuite/icf_safe_so_test.sh: New file.
9432 * testsuite/icf_safe_test.cc (kept_func_3): New function.
9433 (main): Change to take pointer to function kept_func_3.
9434 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
9435 folding is done correctly for X86-64.
9436
0da6fa6c
DM
94372010-02-12 David S. Miller <davem@davemloft.net>
9438
9439 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
9440 is_symbolless parameter.
9441 (Output_reloc<SHT_REL>::is_symbolless): New.
9442 (Output_reloc<SHT_REL>::is_symbolless_): New.
9443 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
9444 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
9445 (Output_reloc<SHT_RELA>::is_symbolless): New.
9446 (Output_data_reloc::add_global): Handle is_symbolless.
9447 (Output_data_reloc::add_global_relative): Likewise.
9448 (Output_data_reloc::add_local): Likewise.
9449 (Output_data_reloc::add_local_relative): Likewise.
9450 (Output_data_reloc::add_symbolless_global_addend): New.
9451 (Output_data_reloc::add_symbolless_local_addend): New.
9452 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
9453 is_symbolless.
9454 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
9455 instead of ->is_relative_
9456 (Output_reloc::write): Likewise.
9457 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
9458 (Output_reloc::write_rel): Simplify.
9459
9460 * sparc.cc (Target_sparc::Scan::local): Use
9461 ->add_symbolless_local_addend as needed.
9462 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
9463 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
9464 based upon relocation offset.
9465
e4782e83
DK
94662010-02-11 Doug Kwan <dougkwan@google.com>
9467
9468 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
9469 (Target_arm::Scan::global): Ditto. Also remove a comment before the
9470 beginning of function.
9471 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
9472 and MOVT_ABS relocations. Those are non issued in scanning. Fix
9473 parameter is_32bit in calls to should_apply_static_reloc.
9474 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
9475 (check_DATA): Add arm_abs_global.stdout.
9476 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
9477 arm_abs_global.stdout): New rules.
9478 (MOSTLLYCLEANFILES): Add arm_abs_global
9479 * Makefile.in: Regenerate.
9480 * testsuite/arm_abs_global.s: New file.
9481 * testsuite/arm_abs_global.sh: Ditto.
9482 * testsuite/arm_abs_lib.s: Ditto.
9483
93ceb764
ILT
94842010-02-11 Ian Lance Taylor <iant@google.com>
9485
9486 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
9487 Read_relocs task.
9488 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
9489 Allocate_commons_task first.
9490 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
9491 task, rather than symtab_lock_.
9492 (Gc_process_relocs::~Gc_process_relocs): New function.
9493 (Gc_process_relocs::is_runnable): Check this_blocker_.
9494 (Gc_process_relocs::locks): Use next_blocker_ rather than
9495 blocker_.
9496 (Scan_relocs::~Scan_relocs): New function.
9497 (Scan_relocs::is_runnable): Check this_blocker_ rather than
9498 symtab_lock_.
9499 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
9500 next_blocker_.
9501 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
9502 fields. Add this_blocker_ and next_blocker_ fields. Adjust
9503 constructor accordingly.
9504 (class Gc_process_relocs): Likewise.
9505 (class Scan_relocs): Likewise.
9506 * common.h (class Allocate_commons_task): Remove symtab_lock_
9507 field, and corresponding constructor parameter.
9508 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
9509 symtab_lock_.
9510 (Allocate_commons_task::locks): Likewise.
9511
114dfbe1
ILT
95122010-02-11 Ian Lance Taylor <iant@google.com>
9513
9514 * gold-threads.h (class Once): Define.
9515 (class Initialize_lock): Rewrite as child of Once.
9516 * gold-threads.cc (class Once_initialize): Define.
9517 (once_pointer_control): New static variable.
9518 (once_pointer, once_arg): New static variables.
9519 (c_run_once): New static function.
9520 (Once::Once, Once::run_once, Once::internal_run): New functions.
9521 (class Initialize_lock_once): Remove.
9522 (initialize_lock_control): Remove.
9523 (initialize_lock_pointer): Remove.
9524 (initialize_lock_once): Remove.
9525 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
9526 (Initialize_lock::initialize): Rewrite.
9527 (Initialize_lock::do_run_once): New function.
9528 * archive.cc (Archive::interpret_header): Only clear name if it is
9529 not already empty.
9530 * fileread.cc: Include "gold-threads.h"
9531 (file_counts_lock): New static variable.
9532 (file_counts_initialize_lock): Likewise.
9533 (File_read::release): Only increment counts when using --stats.
9534 Use a lock around the increment.
9535 * parameters.cc (class Set_parameters_target_once): Define.
9536 (set_parameters_target_once): New static variable.
9537 (Parameters::Parameters): Move here from parameters.h.
9538 (Parameters::set_target): Rewrite.
9539 (Parameters::set_target_once): New function.
9540 (Parameters::clear_target): Move here and rewrite.
9541 * parameters.h (class Parameters): Update declarations. Add
9542 set_parameters_target_once_ field.
9543 (Parameters::Parameters): Move to parameters.cc.
9544 (Parameters::clear_target): Likewise.
9545 * readsyms.cc (Read_symbols::do_group): Create a Start_group
9546 task.
9547 (Start_group::~Start_group): New function.
9548 (Start_group::is_runnable): New function.
9549 (Start_group::locks, Start_group::run): New functions.
9550 (Finish_group::run): Change saw_undefined to size_t.
9551 * readsyms.h (class Start_group): Define.
9552 (class Finish_group): Change saw_undefined_ field to size_t.
9553 (Finish_group::Finish_group): Remove saw_undefined and
9554 this_blocker parameters. Change all callers.
9555 (Finish_group::set_saw_undefined): New function.
9556 (Finish_group::set_blocker): New function.
9557 * symtab.h (class Symbol_table): Change saw_undefined to return
9558 size_t. Change saw_undefined_ field to size_t.
9559 * target-select.cc (Set_target_once::do_run_once): New function.
9560 (Target_selector::Target_selector): Initialize set_target_once_
9561 field. Don't initialize lock_ and initialize_lock_ fields.
9562 (Target_selector::instantiate_target): Rewrite.
9563 (Target_selector::set_target): New function.
9564 * target-select.h (class Set_target_once): Define.
9565 (class Target_selector): Update declarations. Make
9566 Set_target_once a friend. Remove lock_ and initialize_lock_
9567 fields. Add set_target_once_ field.
9568
fa17a3f4
ILT
95692010-02-10 Ian Lance Taylor <iant@google.com>
9570
9571 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
9572 queueing any tasks.
9573 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
9574 (queue_middle_tasks): Add all blockers before queueing any tasks.
9575 (queue_final_tasks): Likewise.
9576 * token.h (Task_token::add_blockers): New function.
9577 * object.h (Input_objects::number_of_relobjs): New function.
9578
c7177d31
ILT
95792010-02-10 Ian Lance Taylor <iant@google.com>
9580
5de0e392
ILT
9581 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
9582 shared, not if not position independent.
9583 * x86_64.cc (Relocate::relocate_tls): Likewise.
9584 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
9585 (tls_pie_pic_test): New target.
9586 * testsuite/Makefile.in: Rebuild.
9587
c7177d31
ILT
9588 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
9589 (tls_test_main_pie.o, tls_test_pie.o): New targets.
9590 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
9591 * testsuite/Makefile.in: Rebuild.
9592
684b268a
DM
95932010-02-09 David S. Miller <davem@davemloft.net>
9594
9595 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
9596 R_SPARC_RELATIVE using ->add_local_relative().
9597 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
9598
612a8d3d
DM
9599 * output.h (Output_data_dynamic::add_section_size): New method
9600 that takes two Output_data objects.
9601 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
9602 entry param. Handle it in initializers.
9603 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
9604 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
9605 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
9606 arg.
9607 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
9608 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
9609 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
9610 for dynrel_includes_plt.
9611 * i386.cc (Target_i386::do_finalize_sections): Likewise.
9612 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
9613 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
9614 before .rela.plt
9615 (Target_sparc::do_finalize_sections): Update to pass true for
9616 dynrel_includes_plt.
9617 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
9618 output before .rela.plt
9619 (Target_powerpc::do_finalize_sections): Update to pass true for
9620 dynrel_includes_plt when 32-bit.
9621
cb1be87e
DK
96222010-02-08 Doug Kwan <dougkwan@google.com>
9623
9624 * arm.cc (Arm_relobj::simple_input_section_output_address): New
9625 method.
9626 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
9627 Arm_relobj::scan_section_for_cortex_a8_stubs,
9628 Arm_relobj::do_relocation_section): Instead of calling
9629 Output_section::output_address, use faster
9630 Arm_relobj::simple_input_section_output_address.
9631
705b5121
DM
96322010-02-08 David S. Miller <davem@davemloft.net>
9633
9634 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
9635 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
9636 relocation helper function.
9637
024c4466
DM
9638 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
9639 just like R_SPARC_GOT{10,13,22}.
9640 (Target_sparc::Scan::local): Likewise.
9641 (Target_sparc::Relocate:relocate): Likewise.
9642
9109c078
ILT
96432010-02-06 Ian Lance Taylor <iant@google.com>
9644
9645 * configure.ac: Rewrite targetobjs duplicate removal code to use
9646 only shell constructs.
9647 * configure: Rebuild.
9648
cf846138
DK
96492010-02-05 Doug Kwan <dougkwan@google.com>
9650
9651 PR 11247
9652 * arm.cc (Arm_relobj::section_is_scannable): New method.
9653 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
9654 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
9655
6cfaf60b
DK
96562010-02-04 Doug Kwan <dougkwan@google.com>
9657
9658 PR 11247
9659 * arm-reloc-property.cc (cstdio): Include.
9660 * configure.ac (targetobjs): Remove duplicates.
9661 * configure: Regenerate.
9662 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
9663 big and little endian version for a given address size.
9664
5c57f1be
DK
96652010-02-03 Doug Kwan <dougkwan@google.com>
9666
9667 * arm-reloc-property.cc
9668 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9669 definition.
9670 * arm-reloc-property.h
9671 (Arm_reloc_property_table::get_implemented_static_reloc_property):
9672 New method definition.
9673 (Arm_reloc_property_table::reloc_name_in_error_message): New method
9674 declaration.
9675 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
9676 overflow to N.
9677 (GOT_PREL): Change implemented to Y.
9678 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
9679 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
9680 (Arm_relocate_functions::movw_abs_nc): Remove method.
9681 (Arm_relocate_functions::movt_abs): Ditto.
9682 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
9683 (Arm_relocate_functions::thm_movt_abs): Ditto.
9684 (Arm_relocate_functions::movw_rel_nc): Ditto.
9685 (Arm_relocate_functions::movw_rel): Ditto.
9686 (Arm_relocate_functions::movt_rel): Ditto.
9687 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
9688 (Arm_relocate_functions:thm_movw_rel): Ditto.
9689 (Arm_relocate_functions:thm_movt_rel): Ditto.
9690 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
9691 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
9692 New method definitions.
9693 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
9694 (Arm_relocation_functions::arm_grp_ldr): Ditto.
9695 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
9696 (Arm_relocation_functions::arm_grp_ldc): Ditto.
9697 (Target_arm::Relocate::relocate): Check for non-static or
9698 unimplemented relocation code and exit early. Change calls to
9699 Target_arm::reloc_uses_thumb_bit and
9700 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
9701 instead. Refactor code to handle similar relocations to increase
9702 code sharing. Remove check for unsupported relocation code in switch
9703 statement.
9704 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
9705 relocation property table to find out size. Change error message to
9706 print out the name of a relocation code instead of the numeric value.
9707 (Target_arm::scan_reloc_for_stub): Use relocation property table
9708 instead of calling Target_arm::reloc_uses_thumb_bit().
9709
218c5831
DK
97102010-02-02 Doug Kwan <dougkwan@google.com>
9711
9712 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
9713 types of relaxed input section.
9714
0d31c79d
DK
97152010-02-02 Doug Kwan <dougkwan@google.com>
9716
9717 * Makefile.am (HFILES): Add arm-reloc-property.h.
9718 (DEFFILES): New.
2e702c99
RM
9719 (TARGETSOURCES): Add arm-reloc-property.cc
9720 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
9721 (libgold_a_SOURCES): $(DEFFILES)
9722 * Makefile.in: Regenerate.
9723 * arm-reloc-property.cc: New file.
9724 * arm-reloc-property.h: New file.
9725 * arm-reloc.def: New file.
9726 * arm.cc: Update comments.
9727 (arm-reloc-property.h): New included header.
9728 (arm_reloc_property_table): New global variable.
9729 (Target_arm::do_select_as_default_target): New method definition.
9730 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
9731 arm-reloc-property to targ_extra_obj.
9732 * parameters.cc (set_parameters_target): Call
9733 Target::select_as_default_target().
9734 * target.h (Target::select_as_default_target): New method definition.
9735 (Target::do_select_as_default_target): Same.
9736
546c7457
DK
97372010-02-01 Doug Kwan <dougkwan@google.com>
9738
9739 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
9740 first_output_text_section_.
9741 (Arm_exidx_fixup::first_output_text_section): New method definition.
9742 (Arm_exidx_fixup::first_output_text_section_): New data member.
9743 (Arm_exidx_fixup::process_exidx_section): Record the first text
9744 output section seen.
9745 (Arm_output_section::fix_exidx_coverage): Set correct linked section
9746 and entsize in output section header.
9747
11b861d5
DK
97482010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9749
9750 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
9751 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
9752 (Arm_relocate_functions::thm_alu11): New Method.
9753 (Arm_relocate_functions::thm_pc8): New Method.
9754 (Arm_relocate_functions::thm_pc12): New Method.
9755 (Target_arm::Scan::local): Handle the relocations.
9756 (Target_arm::Scan::global): Likewise.
9757 (Target_arm::Relocate::relocate): Likewise.
9758 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9759
c9a2c125
DK
97602010-01-29 Doug Kwan <dougkwan@google.com>
9761
9762 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
9763 of relocation types as ld.
9764
1521477a
DK
97652010-01-29 Doug Kwan <dougkwan@google.com>
9766
9767 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
9768 to public.
9769 (Arm_relocate_functions::thumb_branch_common): Ditto.
9770 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
9771 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
9772 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
9773 Arm_relocate_functions::jump24): Remove.
9774 (Target_arm::Relocate::relocate): Adjust code to call
9775 Arm_relocation_functions::arm_branch_common and
9776 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 9777 wrappers. Merge switch-cases together to reduce source code size.
1521477a 9778
e7eca48c
DK
97792010-01-29 Doug Kwan <dougkwan@google.com>
9780
9781 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
9782 output_local_symbol_count_needs_update_.
9783 (Arm_relobj::output_local_symbol_count_needs_update,
9784 Arm_relobj::set_output_local_symbol_count_needs_update,
9785 Arm_relobj::update_output_local_symbol_count): New methods.
9786 (Arm_relobj::output_local_symbol_count_needs_update_): New data
9787 member.
9788 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
9789 of pointed function as in a R_ARM_PREL31 relocation.
9790 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
9791 for output local symbol count updating.
9792 (Target_arm::do_relax): Update output local symbol counts in objects
9793 if necessary.
9794 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
9795
02961d7e
ILT
97962010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9797
9798 * arm.cc: Added support for the ARM relocations:
9799 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
9800 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
9801 (Arm_relocate_functions::movw_rel_nc): Renamed (was
9802 movw_prel_nc).
9803 (Arm_relocate_functions::movw_rel): New method.
9804 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
9805 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
9806 thm_movw_prel_nc).
9807 (Arm_relocate_functions::thm_movw_rel): New method.
9808 (Arm_relocate_functions::thm_movt_rel): Renamed (was
9809 thm_movt_prel).
9810 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
9811 relocations.
9812 (Target_arm::Scan::global): Likewise.
9813 (Target_arm::Relocate::relocate): Likewise.
9814 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9815 Likewise.
9816
b10d2873
ILT
98172010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9818
9819 * arm.cc: Added support for ARM group relocations.
9820 (Target_arm::reloc_needs_sym_origin): New method.
9821 (Arm_relocate_functions::calc_grp_kn): New method.
9822 (Arm_relocate_functions::calc_grp_residual): New method.
9823 (Arm_relocate_functions::calc_grp_gn): New method.
9824 (Arm_relocate_functions::arm_grp_alu): New Method.
9825 (Arm_relocate_functions::arm_grp_ldr): New Method.
9826 (Arm_relocate_functions::arm_grp_ldrs): New Method.
9827 (Arm_relocate_functions::arm_grp_ldc): New Method.
9828 (Target_arm::Scan::local): Handle the ARM group relocations.
9829 (Target_arm::Scan::global): Likewise.
9830 (Target_arm::Relocate::relocate): Likewise.
9831 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9832 Likewise.
9833
2b328d4e
DK
98342010-01-26 Doug Kwan <dougkwan@google.com>
9835
9836 * arm.cc (set): Include.
9837 (class Arm_exidx_fixup): Change type of last_input_section_ to const
9838 pointer type.
2e702c99 9839 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
9840 (Arm_output_section::append_text_sections_to_list): New method.
9841 (Arm_output_section::fix_exidx_coverage): Ditto.
9842 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 9843 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
9844 Relobj::set_section_offset() instead of
9845 Sized_relobj::invalidate_section_offset().
2e702c99 9846 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
9847 parameter for section headers. Ignore relocation sections for
9848 unallocated sections and EXIDX sections.
9849 (Target_arm::fix_exidx_coverage): New method.
9850 (Target_arm::output_section_address_less_than): New type.
9851 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
9852 linked text section instead of the EXIDX section.
9853 (Arm_output_section::create_stub_group): Add an assertion to check
9854 that this is not an EXIDX output section.
9855 (Arm_output_section::append_text_sections_to_list): New method.
9856 (Arm_output_section::fix_exidx_coverage): Ditto.
9857 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 9858 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
9859 (Target_arm::do_relax): Fix EXIDX output section coverage in the
9860 first pass.
9861 (Target_arm::fix_exidx_coverage): New method.
9862 * object.h (Relobj::set_output_section): New method.
9863 (Sized_relobj::invalidate_section_offset): Remove method.
9864 (Sized_relobj::do_invalidate_section_offset): Remove method.
9865 (Sized_relobj::do_set_section_offset): Handle offset value -1.
9866
c7f3c371
DK
98672010-01-25 Doug Kwan <dougkwan@google.com>
9868
9869 * arm.cc (Arm_exidx_merged_section::do_output_offset):
9870 Fix warning due to signed and unsigned comparison on a 32-bit host.
9871
8923b24c
DK
98722010-01-22 Doug Kwan <dougkwan@google.com>
9873
9874 * arm.cc (Target_arm::do_relax): Record an output section for section
9875 offset adjustment it contains any stub table that has changed.
9876 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
9877 offsets in an output section if necessary.
9878 * output.cc (Output_section::Output_section): Initialize
9879 section_offsets_need_adjustments_.
9880 (Output_section::add_input_section_for_script): Renamed to
9881 Output_section::add_simple_input_section.
9882 (Output_section::save_states): Add a comment.
9883 (Output_section::discard_states): New method defintion.
9884 (Output_section::adjust_section_offsets): Same.
9885 * output.h (Output_section::add_input_section_for_script): Renamed to
9886 Output_section::add_simple_input_section.
9887 (Output_section::discard_states): New method declaration.
9888 (Output_section::adjust_section_offsets): Same.
9889 (Output_section::section_offsets_need_adjustment,
9890 Output_section::set_section_offsets_need_adjustment): New method
9891 definitions.
9892 (Output_section::section_offsets_need_adjustment_): New data member.
9893 * script-sections.cc
9894 (Output_section_element_input::set_section_address): Adjust code for
9895 renaming of Output_section::add_input_section_for_script.
9896 (Orphan_output_section::set_section_address): Same.
9897
9b2fd367
DK
98982010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9899
9900 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
9901 Fix_v4bx enum values .
9902 * gold/options.h (General_options): New option definitions.
9903 (General_options::fix_v4bx): New method.
9904 (General_options::Fix_v4bx): New enum.
9905 * gold/options.cc (General_options::parse_fix_v4bx): New method.
9906 (General_options::parse_fix_v4bx_interworking): New method.
9907
80d0d023
DK
99082010-01-22 Doug Kwan <dougkwan@google.com>
9909
9910 * arm.cc (Arm_exidx_fixup): New class.
9911
af2cdeae
DK
99122010-01-21 Doug Kwan <dougkwan@google.com>
9913
9914 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
9915 classes.
9916 (Arm_exidx_section_offset_map): New type.
9917
993d07c1
DK
99182010-01-21 Doug Kwan <dougkwan@google.com>
9919
9920 * arm.cc (Arm_exidx_input_section): New class.
9921 (Arm_relobj::exidx_input_section_by_link,
9922 Arm_relobj::exidx_input_section_by_shndx,
9923 Arm_relobj::make_exidx_input_section): New methods.
9924 (read_arm_attributes_section): Remove.
9925 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
9926 information about them.
9927 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
9928 to here.
9929
5ac169d4
DK
99302010-01-20 Doug Kwan <dougkwan@google.com>
9931
9932 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
9933 Input_section_specifier to Section_id.
9934 (Target_arm::new_arm_input_section: Adjust code for change of key
9935 type.
9936 (Target_arm::find_arm_input_section): Ditto.
9937 * gc.h (object.h): Include for Section_id nand Section_id_hash.
9938 (Section_id): Remove.
9939 (Garbage_collection::Section_id_hash): Remove.
9940 * icf.h (object.h): Include for Section_id nand Section_id_hash.
9941 (Section_id): Remove.
9942 (Icf::Section_id_hash): Remove.
9943 * object.h (Section_id, Const_section_id, Section_id_hash,
9944 Const_section_id_hash): New type definitions.
9945 * output.cc (Output_section::add_relaxed_input_section): Change to
9946 use Const_section_id instead of Input_section_specifier as key type.
9947 (Output_section::add_merge_input_section): Ditto.
9948 (Output_section::build_relaxation_map): Change to use Section_id
9949 instead of Input_section_specifier as key type.
2e702c99 9950 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
9951 Ditto.
9952 (Output_section::convert_input_sections_to_relaxed_sections): Change
9953 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 9954 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
9955 (Output_section::find_relaxed_input_section): Ditto.
9956 * output.h (Input_section_specifier): Remove class.
9957 (Output_section::Output_section_data_by_input_section_map): Change
9958 key type to Const_section_id.
9959 (Output_section::Output_relaxed_input_section_by_input_section_map):
9960 Ditto.
9961 (Output_section::Relaxation_map): Change key type to Section_id.
9962
a2162063
ILT
99632010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9964
9965 * gold/arm.cc: Added support for R_ARM_V4BX relocation
9966 (class Arm_v4bx_stub): New class.
9967 (DEF_STUBS): Updated definition to support v4_veneer_bx.
9968 (Stub_factory::make_arm_v4bx_stub): New method.
9969 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
9970 (Stub_table::empty): Handle v4bx stubs.
9971 (Stub_table::add_arm_v4bx_stub): New method.
9972 (Stub_table::find_arm_v4bx_stub): New method.
9973 (Arm_relocate_functions::v4bx): New method.
9974 (Target_arm::fix_v4bx): New method.
9975 (Target_arm::Target_arm): Handle R_ARM_V4BX.
9976 (Stub_table::relocate_stubs): Likewise.
9977 (Stub_table::do_write): Likewise.
9978 (Stub_table::update_data_size_and_addralign): Likewise.
9979 (Stub_table::finalize_stubs): Likewise.
9980 (Target_arm::Scan::local): Likewise.
9981 (Target_arm::Scan::global): Likewise.
9982 (Target_arm::do_finalize_sections): Likewise.
9983 (Target_arm::Relocate::relocate): Likewise.
9984 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9985 Likewise.
9986 (Target_arm::scan_reloc_for_stub): Likewise.
9987 (Target_arm::scan_reloc_section_for_stubs): Likewise.
9988
5696ab0b
ILT
99892010-01-19 Ian Lance Taylor <iant@google.com>
9990
9991 * output.cc (Output_section_headers::do_sized_write): Write large
9992 segment count to sh_info field.
9993 (Output_file_header::do_sized_write): For large segment count,
9994 write PN_XNUM to e_phnum field.
9995
800d0f56
ILT
99962010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9997
9998 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
9999 (Arm_relocate_functions::thm_jump8): New function.
10000 (Arm_relocate_functions::thm_jump11): New function.
10001 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
10002 R_ARM_THM_JUMP11.
10003 (Target_arm::Scan::global): Likewise.
10004 (Target_arm::Relocate::relocate): Likewise.
10005 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
10006 Likewise.
10007
41263c05
DK
100082010-01-14 Doug Kwan <dougkwan@google.com>
10009
10010 * arm.cc (map, utility): Include headers.
10011 (Target_arm::apply_cortex_a8_workaround): New method.
10012 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
10013 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
10014 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
10015 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
10016 the --[no-]fix-cortex-a8 command line options.
10017 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
10018 (Target_arm::relocate_stub): Use addend in instruction template.
10019 * options.h (DEFINE_bool): Set the user-set flag.
10020 (General_options): Add --[no-]-fix-cortex options.
10021 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 10022 : Update fast look-up map after conversion.
41263c05 10023
459e9b03
ST
100242010-01-14 Sriraman Tallam <tmsriram@google.com>
10025
10026 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
10027 in the first pass of do_layout.
10028
b521dfe4
DK
100292010-01-13 Doug Kwan <dougkwan@google.com>
10030
10031 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10032 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
10033 apparent compiler problem of not folding static constant integral
10034 data members of elfcpp::Elf_sizes<32>.
10035
44272192
DK
100362010-01-13 Doug Kwan <dougkwan@google.com>
10037
10038 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
10039 Arm_relobj::section_needs_cortex_a8_stub_scanning,
10040 Arm_relobj::scan_section_for_cortex_a8_erratum,
10041 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
10042 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
10043 sections to scan for relocation stubs into a new method
10044 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
10045 relocation and Cortex-A8 stub scanning.
10046 (Target_arm::do_relax): Force stubs to be after stubbed sections
10047 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 10048 the beginning of a new relaxation pass. Update a comment.
44272192
DK
10049 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
10050
44b71ece
ILT
100512010-01-12 Ian Lance Taylor <iant@google.com>
10052
10053 * target-reloc.h (visibility_error): New inline function.
10054 (relocate_section): Call visibility_error.
10055 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
10056 (MOSTLYCLEANFILES): Likewise.
10057 (protected_4_pic.o, protected_3.err): New targets.
10058 * testsuite/protected_4.cc: New file.
10059
a120bc7f
DK
100602010-01-12 Doug Kwan <dougkwan@google.com>
10061
10062 * arm.cc (Cortex_a8_reloc): New class.
10063 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
10064 and cortex_a8_relocs_info_.
10065 (Target_arm::fix_cortex_a8): New method definition.
10066 (Target_arm::Cortex_a8_relocs_info): New type.
10067 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
10068 New data member declarations.
10069 (Target_arm::scan_reloc_for_stub): Record information about
10070 relocations for THUMB branches that might be exempted from the
10071 Cortex-A8 workaround.
10072 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
10073 at the beginning of a relaxation pass.
10074
20138696
DK
100752010-01-12 Doug Kwan <dougkwan@google.com>
10076
10077 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
10078 (Arm_relobj::Mapping_symbol_position,
10079 Arm_reloj::Mapping_symbol_position_less,
10080 Arm_relobj::Mapping_symbols_info): New types.
10081 (Target_arm::is_mapping_symbol_name): New method definition.
10082 (Arm_relobj::do_count_local_symbols): Save information about mapping
10083 symbols.
10084
089d69dc
DK
100852010-01-11 Doug Kwan <dougkwan@google.com>
10086
10087 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
10088 Arm_relocate_functions::thumb32_branch_upper,
10089 Arm_relocate_functions::thumb32_branch_lower,
10090 Arm_relocate_functions::thumb32_cond_branch_offset,
10091 Arm_relocate_functions::thumb32_cond_branch_upper,
10092 Arm_relocate_functions::thumb32_cond_branch_lower,
10093 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
10094 branch offset encoding.
10095 (Arm_relocate_functions::thumb_branch_common): Use new branch
10096 offset encoding methods to avoid code duplication.
10097 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
10098 (Stub_addend_reader::operator()): Use new branch encoding method
10099 to avoid code duplication.
10100
99e5bff2
DK
101012010-01-11 Doug Kwan <dougkwan@google.com>
10102
10103 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
10104 (Target_arm::do_finalize_sections): Define special EXIDX section
10105 symbols only if referenced.
10106 * gc.h (Garbage_collection::add_reference): New method.
10107 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
10108 code duplication.
10109
98e090bd
ILT
101102010-01-11 Ian Lance Taylor <iant@google.com>
10111
d0a91bd8
ILT
10112 * script.cc (Version_script_info::build_expression_list_lookup):
10113 Change complaing about duplicate wildcard match from error to
10114 warning.
10115
98e090bd
ILT
10116 * script.cc (class Lazy_demangler): Recreate--revert part of patch
10117 of 2009-12-30.
10118 (Version_script_info::Version_script_info): Initialize globs_,
10119 default_version_, default_is_global_, and exact_. Don't
10120 initialize globals_ or locals_.
10121 (Version_script_info::build_lookup_tables): Build local symbols
10122 first.
10123 (Version_script_info::unquote): New function.
10124 (Version_script_info::add_exact_match): New function.
10125 (Version_script_info::build_expression_list_lookup): Remove lookup
10126 parameter. Add is_global parameter. Change all callers. Handle
10127 wildcard pattern specially. Unquote pattern. Call
10128 add_exact_match.
10129 (Version_script_info::get_name_to_match): New function.
10130 (Version_script_info::get_symbol_version): New function.
10131 (Version_script_info::get_symbol_version_helper): Remove.
10132 (Version_script_info::check_unmatched_names): Call unquote.
10133 * script.h (class Version_script_info): Change get_symbol_version
10134 to be non-inline and add is_global parameter; change all callers.
10135 Rewrite symbol_is_local. Update declarations. Define struct
10136 Version_tree_match, Exact, Globs. Don't define struct Lookup.
10137 Remove globals_ and locals_ members. Add exact_, globs_,
10138 default_version_, is_global_.
10139 (Version_script_info::Glob): Remove pattern, add expression and
10140 is_global. Update constructor. Change all callers.
10141 * dynobj.cc (Versions::finalize): Mark the version symbol as the
10142 default version.
10143 (Versions::symbol_section_contents): If a symbol is undefined, or
10144 defined in a dynamic object, set the version index to
10145 VER_NDX_LOCAL.
10146 * symtab.cc (Symbol_table::add_from_relobj): Don't call
10147 symbol_is_local.
10148 (Symbol_table::add_from_pluginobj): Likewise.
10149 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
10150
d56962d3
DK
101512010-01-11 Doug Kwan <dougkwan@google.com>
10152
10153 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
10154 (incremental_dump_LDADD): Add linking option for libintl.
10155 * Makefile.in: Regenerate.
10156
94e6ee91
L
101572010-01-11 H.J. Lu <hongjiu.lu@intel.com>
10158
10159 PR gold/11144
10160 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
10161 instead of -Ds.
10162 * testsuite/Makefile.in: Regenerated.
10163
e96c574b
DK
101642010-01-10 Doug Kwan <dougkwan@google.com>
10165
10166 * options.h (DEFINE_var): Use parentheses around argument varname__
10167 in macro body to avoid any unintended subsequent substitutions.
10168
7198066b
ILT
101692010-01-10 Ian Lance Taylor <iant@google.com>
10170
ba4d53bf
ILT
10171 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
10172 candidates before doing symbol resolution.
10173
7198066b
ILT
10174 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
10175 ODR candidates if only one is weak.
10176
a2beed37
ILT
101772010-01-08 Ian Lance Taylor <iant@google.com>
10178
10179 * script.cc (Version_script_info::build_expression_list_lookup):
10180 Don't warn about ambiguous version, just record the ambiguity.
10181 (Version_script_info::get_symbol_version_helper): Give error if
10182 version is ambiguous.
10183
2fb7225c
DK
101842010-01-08 Doug Kwan <dougkwan@google.com>
10185
10186 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
10187 prev_data_size_ and prev_addralign_. Remove initializer for
10188 deleted data member has_been_changed_.
10189 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
10190 to determine if the table is empty.
10191 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
10192 Remove.
10193 (Stub_table::add_reloc_stub): Define method in class definition
10194 instead of just declaring it there.
10195 (Stub_table::add_cortex_a8_stub): New method definition.
10196 (Stub_table::update_data_size_and_addralign): Ditto.
10197 (Stub_table::finalize_stubs): Ditto.
10198 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
10199 (Stub_table::do_addralign_): Return address alignment in the
10200 (Stub_table::do_reset_address_and_file_offset): Define method in
10201 class definition instead of declaring it there. Set current data
10202 size to be the data size of the previous pass.
10203 (Stub_table::set_final_data_size): Use current data size as the
10204 final data size.
10205 (Stub_table::relocate_stub): Change parameter type of stub from
10206 Reloc_stub pointer to Stub pointer.
10207 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
10208 (Stub_table::Cortex_a8_stub_list): New typedef.
10209 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
10210 Stub_table::prev_addralign_): New data member.
10211 (Arm_relobj::Arm_relobj): Initialize data member
10212 section_has_cortex_a8_workaround_.
10213 (Arm_relobj::section_has_cortex_a8_workaround,
10214 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
10215 definitions.
10216 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
10217 declarations.
10218 (Target_arm::relocate_stub): Change parameter type of stub from
10219 Reloc_stub pointer to Stub pointer.
10220 (Insn_template::size, Insn_template::alignment): Handle
10221 THUMB16_SPECIAL_TYPE.
10222 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
10223 Stub_table::update_data_size_and_addralign,
10224 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
10225 definitions.
10226 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
10227 (Stub_table::do_write): Ditto.
10228 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 10229
880cd20d
ILT
102302010-01-08 Ian Lance Taylor <iant@google.com>
10231
10232 PR 11108
10233 * symtab.h (class Symbol): Remove fields is_target_special_ and
10234 has_plt_offset_. Add field is_defined_in_discarded_section_.
10235 (Symbol::is_defined_in_discarded_section): New function.
10236 (Symbol::set_is_defined_in_discarded_section): New function.
10237 (Symbol::has_plt_offset): Rewrite.
10238 (Symbol::set_plt_offset): Verify that new offset is not -1U.
10239 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
10240 Don't initialize is_target_special_ or has_plt_offset_.
10241 Initialize is_defined_in_discarded_section_.
10242 (Symbol_table::add_from_relobj): If appropriate, set
10243 is_defined_in_discarded_section.
10244 * resolve.cc (Symbol::override_base_with_special): Don't test
10245 is_target_special_. Change has_plt_offset_ to has_plt_offset().
10246 * target-reloc.h (relocate_section): Do special handling for
10247 symbols defined in discarded sections for global symbols as well
10248 as local symbols.
10249
2703e3eb
ILT
102502010-01-08 Ian Lance Taylor <iant@google.com>
10251
10252 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
10253 the SHT_SYMTAB case.
10254
339d40a3
ILT
102552010-01-08 Ian Lance Taylor <iant@google.com>
10256
10257 * object.cc (Sized_relobj::do_layout): Don't get confused if
10258 layout_eh_frame returns NULL.
10259
abecea76
ILT
102602010-01-08 Ian Lance Taylor <iant@google.com>
10261
10262 PR 11084
10263 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
10264 dynamic symbol table, use the normal symbol table.
10265 (Sized_dynobj::do_read_symbols): Remove assertion about type of
10266 symbol table.
10267
6b7dd3f3
ILT
102682010-01-08 Ian Lance Taylor <iant@google.com>
10269
10270 PR 11072
10271 * layout.cc (Layout::include_section): Remove .gnu_debuglink
10272 sections.
10273
36c50e63
L
102742010-01-08 H.J. Lu <hongjiu.lu@intel.com>
10275
10276 * version.cc (print_version): Change to "Copyright 2010".
10277
e291e7b9
ILT
102782010-01-08 Ian Lance Taylor <iant@google.com>
10279
10280 PR 10287
10281 PR 11063
10282 * i386.cc (class Target_i386): Change return type of plt_section
10283 to be non-const.
10284 (class Output_data_plt_i386): Add tls_desc_rel_ field.
10285 (Output_data_plt_i386::Output_data_plt_i386): Initialize
10286 tls_desc_rel_ field.
10287 (Output_data_plt_i386::rel_tls_desc): New function.
10288 (Target_i386::rel_tls_desc_section): New function.
10289 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
10290 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
10291 R_386_TLS_DESC reloc in rel_tls_desc_section.
10292 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
10293 Define struct Tlsdesc_info.
10294 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
10295 (Target_x86_64::do_reloc_symbol_index): New function.
10296 (Target_x86_64::add_tlsdesc_info): New function.
10297 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
10298 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
10299 tlsdesc_rel_ field.
10300 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
10301 all callers.
10302 (Output_data_plt_x86_64::rela_tlsdesc): New function.
10303 (Target_x86_64::rela_tlsdesc_section): New function.
10304 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
10305 handling.
10306 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
10307 (Target_x86_64::do_reloc_addend): New function.
10308 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
10309 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
10310 declarations. Define TARGET_CODE. Add arg field to u1_ union.
10311 (Output_reloc::type): New function.
10312 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
10313 (Output_reloc::is_target_specific): New function.
10314 (Output_reloc::target_arg): New function.
10315 (class Output_reloc) [SHT_RELA]: Add four new constructors for
10316 absolute relocs and target specific relocs.
10317 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
10318 add_target_specific.
10319 (class Output_data_reloc) [SHT_RELA]: Likewise.
10320 * output.cc (Output_reloc::Output_reloc): Add four new versions
10321 for absolute relocs and target specific relocs.
10322 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
10323 (Output_reloc::get_symbol_index): Likewise.
10324 (Output_reloc::local_section_offset): Check that local_sym_index_
10325 is not TARGET_CODE or 0.
10326 (Output_reloc::symbol_value): Likewise.
10327 (Output_reloc::write) [SHT_RELA]: Call target for target specific
10328 reloc.
10329 * target.h (class Target): Add reloc_symbol_index and reloc_addend
10330 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
10331 functions.
10332 * layout.cc (add_target_dynamic_tags): Use output section for
10333 DT_PLTRELSZ and DT_JMPREL.
10334
3a44184e
ILT
103352010-01-07 Ian Lance Taylor <iant@google.com>
10336
10337 PR 11061
10338 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
10339 function.
10340 (class Output_data_reloc_generic): Define.
10341 (class Output_data_reloc_base): Change base class to
10342 Output_data_reloc_generic. Change add() method to call
10343 bump_relative_reloc_count for a relative reloc. Remove
10344 sort_relocs_ field.
10345 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
10346 to sort_relocs().
10347 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
10348 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
10349 appropriate.
10350 * layout.h (class Layout): Update declaration.
10351
ea715a34
ILT
103522010-01-07 Ian Lance Taylor <iant@google.com>
10353
10354 * output.h (class Output_data): Add const version of
10355 output_section and do_output_section.
10356 (class Output_section_data): Add const version of
10357 do_output_section.
10358 (class Output_section): Likewise.
10359 * layout.cc (Layout::add_target_dynamic_tags): New function.
10360 * layout.h (class Layout): Update declarations.
10361 * arm.cc (Target_arm::do_finalize_sections): Use
10362 add_target_dynamic_tags.
10363 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10364 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
10365 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
10366 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10367
659948a4
ILT
103682010-01-07 Ian Lance Taylor <iant@google.com>
10369
10370 PR 11042
10371 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
10372 object as needed.
10373
9d3b86f6
ILT
103742010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
10375 Ian Lance Taylor <iant@google.com>
10376
10377 PR 11019
10378 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
10379 Xindex::read_symtab_xindex.
10380
bb0d3eb0
DK
103812010-01-07 Doug Kwan <dougkwan@google.com>
10382
10383 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
10384 (Insn_template::thumb16_bcond_insn): New method declaration.
10385 (Insn_template): Fix spelling.
10386 (Stub::thumb16_special): New method declaration.
10387 (Stub::do_write): Define virtual method which was previously pure
10388 virtual.
10389 (Stub::do_thumb16_special): New method declaration.
10390 (Stub::do_fixed_endian_write): New template member.
10391 (Reloc_stub::do_write): Remove.
10392 (Reloc_stub::do_fixed_endian_write): Remove.
10393 (Cortex_a8_stub): New class definition.
10394 (Stub_factory::make_cortex_a8_stub): New method definition.
10395 (Stub_factory::Stub_factory): Add missing static storage class
10396 qualifier for elf32_arm_stub_a8_veneer_blx.
10397
ffeef7df
ILT
103982010-01-07 Ian Lance Taylor <iant@google.com>
10399
dc3f80fe
ILT
10400 PR 10980
10401 * options.h (class General_options): Add --warn-unresolved-symbols
10402 and --error-unresolved-symbols.
10403 * errors.cc (Errors::undefined_symbol): Implement
10404 --warn-unresolved-symbols.
10405
ffeef7df
ILT
10406 * options.h (class General_options): Add -z text and -z textoff.
10407 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
10408
f1ec9ded
ST
104092010-01-06 Sriraman Tallam <tmsriram@google.com>
10410
10411 * gc.h (Garbage_collection::Cident_section_map): New typedef.
10412 (Garbage_collection::cident_sections): New function.
10413 (Garbage_collection::add_cident_section): New function.
10414 (Garbage_collection::cident_sections_): New member.
10415 (gc_process_relocs): Add references to sections whose names are C
10416 identifiers.
10417 * gold.h (cident_section_start_prefix): New constant.
10418 (cident_section_stop_prefix): New constant.
10419 (is_cident): New function.
10420 * layout.cc (Layout::define_section_symbols): Replace string constants
10421 with the newly defined constants.
10422 * object.cc (Sized_relobj::do_layout): Track sections whose names are
10423 C identifiers.
10424 * testsuite/Makefile.am: Add gc_orphan_section_test.
10425 * testsuite/Makefile.in: Regenerate.
10426 * testsuite/gc_orphan_section_test.cc: New file.
10427 * testsuite/gc_orphan_section_test.sh: New file.
10428
6eda8c29
ILT
104292010-01-06 Ian Lance Taylor <iant@google.com>
10430
b9674e17
ILT
10431 PR 10980
10432 * options.h (class General_options): Add --warn-shared-textrel.
10433 * layout.cc (Layout::finish_dynamic_section): Implement
10434 --warn-shared-textrel.
10435
6eda8c29
ILT
10436 PR 10980
10437 * options.h (class General_options): Add --warn-multiple-gp.
10438
32dcd44e
ILT
104392010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10440
10441 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
10442 $(THREADSLIB) and $(LIBDL).
10443 * Makefile.in: Rebuild.
10444
a192ba05
ILT
104452010-01-06 Ian Lance Taylor <iant@google.com>
10446
10447 PR 10980
10448 * options.cc (General_options::parse_section_start): New function.
10449 (General_options::section_start): New function.
10450 (General_options::General_options): Initialize all members.
10451 * options.h: Include <map>
10452 (class General_options): Add --section-start. Add section_starts_
10453 member.
10454 * layout.cc (Layout::attach_allocated_section_to_segment): If
10455 --section-start was used, set the address of the segment. Remove
10456 local sort_sections.
10457 (Layout::relaxation_loop_body): If the address of the load segment
10458 has been set by --section-start, don't use it.
10459 * output.h (Output_segment::update_flags_for_output_section): New
10460 function.
10461 * output.cc (Output_segment::add_output_section): Call
10462 update_flags_for_output_section.
10463
dde3f402
ILT
104642010-01-05 Ian Lance Taylor <iant@google.com>
10465
62dfdd4d
ILT
10466 PR 10980
10467 * options.h (class General_options): Add --undefined-version.
10468 * script.cc (struct Version_expression): Add was_matched_by_symbol
10469 field.
10470 (Version_script_info::matched_symbol): New function.
10471 (Version_script_info::get_symbol_version_helper): Call
10472 matched_symbol.
10473 (Version_script_info::check_unmatched_names): New function.
10474 * script.h (class Version_script_info): Update declarations.
10475 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
10476
9c4ae156
ILT
10477 * options.h (class General_options): Use DEFINE_bool_alias for
10478 allow_multiple_definition.
10479 * resolve.cc (Symbol_table::should_override): Don't test
10480 allow_multiple_definition.
10481
dde3f402
ILT
10482 PR 10980
10483 * options.h (class General_options): Add --cref.
10484 * main.cc (main): Print cref table if --cref. Don't close mapfile
10485 until after printing cref table.
10486 * cref.cc: Include "symtab.h".
10487 (class Cref_inputs): Define Cref_table_compare and Cref_table.
10488 (Cref_table_compare::operator()): New function.
10489 (Cref_inputs::gather_cref): New function.
10490 (filecol): New static const.
10491 (Cref_inputs::print_cref): New function.
10492 (Cref::print_cref): New function.
10493 * cref.h: Include <cstdio>.
10494 (class Cref): Update declarations.
10495 * mapfile.h (Mapfile::file): New function.
10496 * object.h (class Object): Define Symbols. Declare virtual
10497 do_get_global_symbols.
10498 (Object::get_global_symbols): New function.
10499 * object.cc (Input_objects::add_object): Pass object to cref_ if
10500 --cref.
10501 (Input_objects::archive_start): Likewise.
10502 (Input_objects::archive_stop): Likewise.
10503 (Input_objects::print_cref): New function.
10504 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
10505 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
10506 --cref.
10507 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
10508 function.
10509 * plugin.h (class Sized_pluginobj): Update declarations.
10510
8781f709
ILT
105112010-01-05 Ian Lance Taylor <iant@google.com>
10512
10513 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
10514 to is_default_version. Rename insdef to insdefault.
10515 (Symbol_table::add_from_relobj): Rename def to is_default_version
10516 and local to is_forced_local.
10517 (Symbol_table::add_from_pluginobj): Likewise.
10518 (Symbol_table::add_from_dynobj): Likewise.
10519 (Symbol_table::define_special_symbol): Rename insdef to
10520 insdefault.
10521
fe35d28d
ILT
105222010-01-04 Ian Lance Taylor <iant@google.com>
10523
30bc8c46
ILT
10524 PR 10980
10525 * options.h (class General_options): Add
10526 --allow-multiple-definition and -z muldefs.
10527 * resolve.cc (Symbol_table::should_override): Don't warn about a
10528 multiple symbol definition if --allow-multiple-definition or -z
10529 muldefs.
10530
7eaea549
ILT
10531 PR 10980
10532 * options.h (class General_options): Add --add-needed and
10533 --copy-dt-needed-entries. Tweak --as-needed help entry.
10534 * object.cc (Input_objects::check_dynamic_dependencies): Give an
10535 error if --copy-dt-needed-entries aka --add-needed is used and
10536 would cause a change in behaviour.
10537
fe35d28d
ILT
10538 PR 10980
10539 * options.h (class General_options): Add -G as a short version of
10540 --shared. Add no-op options -assert, -g, and -i.
10541
55a2bb35
ST
105422010-01-04 Sriraman Tallam <tmsriram@google.com>
10543
10544 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
10545 check for .text or .gnu.linkonce.t sections.
10546 * icf.cc (Icf::find_identical_sections): Ditto.
10547 Change the detection for mangled function name within the section
10548 name.
10549 * icf.h (is_section_foldable_candidate): New function.
10550
719328e1
ILT
105512009-12-30 Ian Lance Taylor <iant@google.com>
10552
10553 PR 10980
10554 * options.h (class General_options): Permit two dashes with
10555 --retain-symbols-file.
10556
d7bb5745
ILT
105572009-12-30 Ian Lance Taylor <iant@google.com>
10558
403a15dd
ILT
10559 PR 10979
10560 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
10561 don't put the file header and segment headers in the text
10562 segment.
10563
eda294df
ILT
10564 PR 10979
10565 * common.cc (Sort_commons::operator()): Stabilize sort when both
10566 entries are NULL.
10567 (Symbol_table::do_allocate_commons_list): When allocating common
10568 symbols, skip a symbol which is no longer common.
10569 * symtab.h (Symbol::is_common): Test whether the symbol comes from
10570 an object before checking its type.
10571 * testsuite/common_test_2.c: New file.
10572 * testsuite/common_test_3.c: New file.
10573 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
10574 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
10575 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
10576 (common_test_2_pic.o, common_test_2.so): New targets.
10577 (common_test_3_pic.o, common_test_3.so): New targets.
10578 * testsuite/Makefile.in: Rebuild.
10579
d7bb5745
ILT
10580 PR 10979
10581 * script.cc (read_input_script): If we see a new SECTIONS clause,
10582 and we have added an input section, give an error.
10583 * layout.h (class Layout): Add have_added_input_section function.
10584 Add have_added_input_section_ field.
10585 * layout.cc (Layout::Layout): Initialize
10586 have_added_input_section_.
10587 (Layout::layout): Set have_added_input_section_.
10588 (Layout::layout_eh_frame): Likewise.
10589
fc59c572
ILT
105902009-12-30 Ian Lance Taylor <iant@google.com>
10591
10592 PR 10931
10593 * options.h (class General_options): Add --sort-common option.
10594 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
10595 * common.cc (Sort_common): Add sort_order parameter to
10596 constructor. Add sort_order_ field.
10597 (Sort_commons::operator): Check sort_order_.
10598 (Symbol_table::allocate_commons): Determine the sort order.
10599 (Symbol_table::do_allocate_commons): Add sort_order parameter.
10600 Change all callers.
10601 (Symbol_table::do_allocate_commons_list): Likewise.
10602
1c74fab0
ILT
106032009-12-30 Ian Lance Taylor <iant@google.com>
10604
10605 PR 10916
10606 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
10607 symbols from this object, don't change the visibility of an
10608 undefined symbol.
10609 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
10610
6affe781
ILT
106112009-12-30 Ian Lance Taylor <iant@google.com>
10612
10613 PR 10861
10614 * script.h (class Version_script_info): Define Language enum.
10615 Update declarations. Define Glob, Exact, and Lookup types. Add
10616 new fields globals_, locals_, and is_finalized_.
10617 * script.cc: Various formatting fixes.
10618 (class Parser_closure): Change language_stack_ from a vector of
10619 std::string to one of Version_script_info::Language. Adjust all
10620 uses accordingly.
10621 (class Lazy_demangler): Remove.
10622 (struct Version_expression): Change language from std::string to
10623 Version_script_info::Language.
10624 (Version_script_info::Version_script_info): New function.
10625 (Version_script_info::~Version_script_info): Don't call clear.
10626 (Version_script_info::finalize): New function.
10627 (Version_script_info::build_lookup_tables): New function.
10628 (Version_script_info::build_expression_list_lookup): New
10629 function.
10630 (Version_script_info::get_symbol_version_helper): Rewrite to use
10631 lookup tables.
10632 (Version_script_info::print_expression_list): Adjust to use
10633 Version_script_info::Language.
10634 (script_push_lex_into_version_mode): Check that the version script
10635 has not been finalized.
10636 (version_script_push_lang): Change language string to
10637 Version_script_info::Language.
10638 * options.cc (Command_line::version_script): New function.
10639 * options.h (class General_options): Add finalize_dynamic_list
10640 function. Change version_script from declaration to definition.
10641 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
10642 * testsuite/version_script.map: Remove duplicate def of foo.
10643 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
10644 version_script.map.
10645 * testsuite/Makefile.in: Rebuild.
10646
818bf354
ILT
106472009-12-30 Ian Lance Taylor <iant@google.com>
10648
10649 PR 10843
10650 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
10651 if the input symbol index is 0, make the output symbol index 0.
10652
ebcc8304
ILT
106532009-12-30 Ian Lance Taylor <iant@google.com>
10654
10655 PR 10670
10656 * options.h (class General_options): Add -x/--discard-all.
10657 * object.cc (Sized_relobj::do_count_local_symbols): Handle
10658 --discard-all. If the local symbol needs a dynamic entry, check
10659 that before handling --discard-locals.
10660
176fe33f
ILT
106612009-12-30 Ian Lance Taylor <iant@google.com>
10662
bb321bb1
ILT
10663 PR 10450
10664 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
10665 flags to PF_R.
10666 (Output_segment::add_output_section): Don't change the flags if
10667 the type is PT_TLS.
10668
176fe33f
ILT
10669 PR 10450
10670 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
10671 GNU hash table if they need a dynamic value. Otherwise, don't add
10672 them if they are defined in a dynamic object or are forced local.
10673
e8cd95c7
ILT
106742009-12-29 Ian Lance Taylor <iant@google.com>
10675
1b81fb71
ILT
10676 PR 10450
10677 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
10678 .gnu.hash table for a 32-bit target.
10679
8d6d383d
ILT
10680 PR 10450
10681 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
10682 regular and a dynamic object only needs a dynamic symbol table
10683 entry if it is externally visible.
10684
e785ec03
ILT
10685 PR 10450
10686 * i386.cc (class Target_i386): Initialize global_offset_table_ in
10687 constructor. Add global_offset_table_ field.
10688 (Target_i386::got_section): Set global_offset_table_.
10689 (Target_i386::do_finalize_sections): Set global_offset_table_
10690 size.
10691 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
10692 in constructor. Add global_offset_table_ field.
10693 (Target_x86_64::got_section): Set global_offset_table_.
10694 (Target_x86_64::do_finalize_sections): Set global_offset_table_
10695 size.
10696
1a2dff53
ILT
10697 * layout.cc (Layout::Layout): Initialize increase_relro_.
10698 (Layout::get_output_section): Add is_relro, is_last_relro, and
10699 is_first_non_relro parameters. Change all callers.
10700 (Layout::choose_output_section): Likewise.
10701 (Layout::add_output_section_data): Likewise.
10702 (Layout::make_output_section): Likewise.
10703 (Layout::set_segment_offsets): Clear increase_relro when using a
10704 linker script.
10705 * layout.h (class Layout): Add increase_relro method. Add
10706 increase_relro_ field. Update declarations.
10707 * output.cc (Output_section::Output_section): Initialize
10708 is_last_relro_ and is_first_non_relro_.
10709 (Output_segment::add_output_section): Group relro sections is
10710 do_sort is true. Handle is_last_relro and is_first_non_relro.
10711 (Output_segment::maximum_alignment): Remove relro handling.
10712 (Output_segment::set_section_addresses): Add increase_relro
10713 parameter. Change all callers. Add initial alignment to align
10714 relro sections on separate page. Remove old relro handling.
10715 (Output_segment::set_section_list_addresses): Remove in_relro
10716 parameter. Change all callers.
10717 (Output_segment::set_offset): Add increase parameter. Change all
10718 callers. Remove old relro handling.
10719 * output.h (class Output_section): Add new methods: is_last_relro,
10720 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
10721 Add is_last_relro_ and is_first_non_relro_ fields.
10722 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
10723 Create separate .got.plt section. Call increase_relro.
10724 * x86_64.cc (Target_x86_64::got_section): Likewise.
10725 * testsuite/relro_script_test.t: Add .got.plt.
10726
f0ba79e2
ILT
10727 PR 10450
10728 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
10729 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
10730 (Layout::finalize): Call set_dynamic_symbol_size.
10731 (Layout::set_dynamic_symbol_size): New function.
10732 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
10733 set_dynamic_symbol_size.
10734
e8cd95c7
ILT
10735 PR 10450
10736 * output.h (class Output_section): Add is_entsize_zero_ field.
10737 * output.cc (Output_section::Output_section): Initialize
10738 is_entsize_zero_.
10739 (Output_section::set_entsize): If two different entsizes are
10740 requested, force it to zero.
10741 (Output_section::add_input_section): Set flags for .debug_str
10742 before updating section flags. Set entsize.
10743 (Output_section::update_flags_for_input_section): Set SHF_MERGE
10744 and SHF_STRING if all input sections have those flags.
10745
3e1b9a8a
RÁE
107462009-12-29 Rafael Espindola <espindola@google.com>
10747
10748 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
10749 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
10750 reporting.
3e1b9a8a 10751
3dcad376
ST
107522009-12-29 Sriraman Tallam <tmsriram@google.com>
10753
10754 * options.cc (General_options::parse_version): Allow -v to exit
10755 without an error if there is nothing to link.
10756
084e2665
ILT
107572009-12-29 Ian Lance Taylor <iant@google.com>
10758
10759 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
10760 using a version of gcc before 4.1.
10761 * configure: Rebuild.
10762
250acde3
CD
107632009-12-28 Chris Demetriou <cgd@google.com>
10764
10765 * attributes.cc (Output_attributes_section_data::do_write): Use
10766 std::vector::front rather than std::vector::data.
10767
99fff23b
ILT
107682009-12-28 Ian Lance Taylor <iant@google.com>
10769
10770 * symtab.h (class Symbol_table): Add enum Defined.
10771 * resolve.cc (Symbol_table::should_override): Add defined
10772 parameter. Change all callers. Test whether object is NULL
10773 before calling a method on it.
10774 (Symbol_table::report_resolve_problem): Add defined parameter.
10775 Change all callers.
10776 (Symbol_table::should_override_with_special): Likewise.
10777 * symtab.cc (Symbol_table::define_in_output_data): Add defined
10778 parameter. Change all callers.
10779 (Symbol_table::do_define_in_output_data): Likewise.
10780 (Symbol_table::define_in_output_segment): Likewise.
10781 (Symbol_table::do_define_in_output_segment): Likewise.
10782 (Symbol_table::define_as_constant): Likewise.
10783 (Symbol_table::do_define_as_constant): Likewise.
10784 * script.h (class Symbol_assignment): Add is_defsym parameter to
10785 constructor; change all callers.
10786 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
10787 parameter. Change all callers. Add is_defsym_ field.
10788 (class Parser_closure): Add parsing_defsym parameter to
10789 constructor; change all callers. Add parsing_defsym accessor
10790 function. Add parsing_defsym_ field.
10791
556bd683
ILT
107922009-12-28 Ian Lance Taylor <iant@google.com>
10793
10794 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 10795 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 10796
1782c879
ILT
107972009-12-23 Ian Lance Taylor <iant@google.com>
10798
10799 * i386.cc (Target_i386::do_calls_non_split): Recognize
10800 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
10801 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
10802 -fsplit-stack prologue when using %r11.
1782c879 10803
329ca2b1
ST
108042009-12-21 Sriraman Tallam <tmsriram@google.com>
10805
10806 * options.cc (General_options::parse_version): Make -v continue and do
10807 the link like GNU ld does.
10808
d675ff46
RÁE
108092009-12-17 Rafael Avila de Espindola <espindola@google.com>
10810
10811 * Makefile.am (CCFILES): Add timer.cc.
10812 (HFILES): Add timer.h.
10813 * configure.ac: Check for sysconf and times.
10814 * main.cc: include timer.h.
10815 (main): Use Timer instead of get_run_time.
10816 * timer.cc: New.
10817 * timer.h: New.
10818 * workqueue.cc: include timer.h.
10819 (Workqueue::find_and_run_task):
10820 Report user, sys and wall time.
10821 * Makefile.in: Regenerate.
10822 * config.in: Regenerate.
10823 * configure: Regenerate.
10824
d6344fb5
DK
108252009-12-16 Doug Kwan <dougkwan@google.com>
10826
10827 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
10828 sections.
10829 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
10830 relaxed input sections.
10831 * output.cc (Output_section::find_relaxed_input_section): Change
10832 return type to Output_relaxed_input_section pointer. Adjust code
10833 for new type of relaxed_input_section_map_.
10834 * output.h (Output_section::find_relaxed_input_section): Change
10835 return type to Output_relaxed_input_section pointer.
10836 (Output_section::Output_relaxed_input_section_by_input_section_map):
10837 New type.
10838 (Output_section::relaxed_input_section_map_): Change type to
10839 Output_section::Output_relaxed_input_section_by_input_section_map.
10840 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
10841 input section.
10842
0e0d5469
ILT
108432009-12-15 Ian Lance Taylor <iant@google.com>
10844
10845 * layout.cc (Layout::create_shstrtab): Only write out after input
10846 sections if we are compressing debug sections.
10847
0649a889
ILT
108482009-12-15 Ian Lance Taylor <iant@google.com>
10849
10850 * archive.cc (Archive::add_symbols): Only look up a symbol without
10851 a version if there is, in fact, a version.
10852
2ea97941
ILT
108532009-12-14 Ian Lance Taylor <iant@google.com>
10854
10855 Revert -Wshadow changes, all changes from:
10856 2009-12-11 Doug Kwan <dougkwan@google.com>
10857 2009-12-11 Nick Clifton <nickc@redhat.com>
10858 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
10859
b0eec2cc
DK
108602009-12-11 Doug Kwan <dougkwan@google.com>
10861
10862 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
10863 due to -Wshadow.
10864 * attributes.cc (Object_attribute::size): Ditto.
10865 (Attributes_section_data::size): Ditto.
10866 (Attributes_section_data::Attributes_section_data): Ditto.
10867 (Output_attributes_section_data::do_write): Ditto.
10868 * attributes.h (Object_attribute::set_type): Ditto.
10869 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
10870
91d6fa6a
NC
108712009-12-11 Nick Clifton <nickc@redhat.com>
10872
10873 * archive.cc: Fix shadowed variable warnings.
10874 * arm.cc: Likewise.
10875 * compressed_output.cc: Likewise.
10876 * compressed_output.h: Likewise.
10877 * configure: Likewise.
10878 * dwarf_reader.cc: Likewise.
10879 * dynobj.cc: Likewise.
10880 * dynobj.h: Likewise.
10881 * ehframe.cc: Likewise.
10882 * ehframe.h: Likewise.
10883 * errors.cc: Likewise.
10884 * expression.cc: Likewise.
10885 * fileread.cc: Likewise.
10886 * fileread.h: Likewise.
10887 * freebsd.h: Likewise.
10888 * i386.cc: Likewise.
10889 * icf.cc: Likewise.
10890 * incremental.h: Likewise.
10891 * layout.cc: Likewise.
10892 * layout.h: Likewise.
10893 * mapfile.cc: Likewise.
10894 * merge.cc: Likewise.
10895 * merge.h: Likewise.
10896 * object.cc: Likewise.
10897 * object.h: Likewise.
10898 * options.h: Likewise.
10899 * output.cc: Likewise.
10900 * output.h: Likewise.
10901 * parameters.cc: Likewise.
10902 * plugin.cc: Likewise.
10903 * powerpc.cc: Likewise.
10904 * reduced_debug_output.cc: Likewise.
10905 * reduced_debug_output.h: Likewise.
10906 * reloc.cc: Likewise.
10907 * reloc.h: Likewise.
10908 * resolve.cc: Likewise.
10909 * script-sections.cc: Likewise.
10910 * script.cc: Likewise.
10911 * script.h: Likewise.
10912 * sparc.cc: Likewise.
10913 * symtab.cc: Likewise.
10914 * symtab.h: Likewise.
10915 * target-select.cc: Likewise.
10916 * target-select.h: Likewise.
10917 * token.h: Likewise.
10918 * workqueue.cc: Likewise.
10919 * workqueue.h: Likewise.
10920 * x86_64.cc: Likewise.
10921
a0351a69
DK
109222009-12-10 Doug Kwan <dougkwan@google.com>
10923
10924 * arm.cc (attributes.h): New include.
10925 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
10926 (Arm_relobj::~Arm_relobj): Delete object pointed by
10927 attributes_section_data_.
10928 (Arm_relobj::attributes_section_data): New method definition.
10929 (Arm_relobj::attributes_section_data_): New data member declaration.
10930 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
10931 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
10932 attributes_section_data_.
10933 (Arm_dynobj::attributes_section_data): New method definition.
10934 (Arm_dynobj::attributes_section_data_): New data member declaration.
10935 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
10936 initialization value of may_use_blx_ to false.
2e702c99 10937 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
10938 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
10939 object attributes to compute results instead of hard-coding.
10940 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
10941 Target_arm::get_secondary_compatible_arch,
10942 Target_arm::set_secondary_compatible_arch
10943 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10944 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
10945 New method declarations.
10946 (Target_arm::get_aeabi_object_attribute): New method definition.
10947 (Target_arm::attributes_section_data_): New data member declaration.
10948 (read_arm_attributes_section): New template definition.
10949 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
10950 (Arm_dynobj::do_read_symbols): Ditto.
10951 (Target_arm::do_finalize_sections): Merge attributes sections from
10952 input. Check for BLX use after attributes section merging.
10953 Fix __exidx_start and __exidx_end visibility. Create an
10954 .ARM.attributes section if necessary.
10955 (Target_arm::get_secondary_compatible_arch,
10956 Target_arm::set_secondary_compatible_arch,
10957 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
10958 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 10959 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
10960 New method definitions.
10961
b59befec
ILT
109622009-12-09 Ian Lance Taylor <iant@google.com>
10963
10964 * plugin.cc (Plugin::load): Don't cast from void* to a function
10965 pointer.
10966
1276bc89
ILT
109672009-12-09 Ian Lance Taylor <iant@google.com>
10968
10969 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
10970 information fields.
10971
2f2de248
L
109722009-12-09 H.J. Lu <hongjiu.lu@intel.com>
10973
10974 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
10975 Replace two_file_shared_1.so with two_file_shared_2.so.
10976 * testsuite/Makefile.in: Regenerated.
10977
4f787271
DK
109782009-12-08 Doug Kwan <dougkwan@google.com>
10979
10980 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
10981 (HFILES): Add attributes.h and int_encoding.h.
10982 * Makefile.in: Regenerate.
10983 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
10984 function definitions to int_encoding.cc
10985 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
10986 prototypes to int_encoding.h
10987 * reduced_debug_output.cc (int_encoding.h): New include.
10988 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
10989 function definitions to int_encoding.cc
10990 (insert_into_vector, read_from_pointer): Move template definitions to
10991 int_encoding.h
10992 * attributes.cc: New file.
10993 * attributes.h: New file.
10994 * int_encoding.cc: New file.
10995 * int_encoding.h: New file.
10996
20b52f1a
RÁE
109972009-12-07 Rafael Avila de Espindola <espindola@google.com>
10998
10999 PR gold/11055
11000 * incremental-dump.cc (dump_incremental_inputs): New.
11001 (main): Use dump_incremental_inputs.
11002
53d7974c
L
110032009-12-07 H.J. Lu <hongjiu.lu@intel.com>
11004
11005 PR gold/10893
11006 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
11007 checking elfcpp::STT_FUNC.
11008 (Target_i386::Relocate::relocate): Likewise.
11009 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
11010
11011 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
11012 symbols from shared libraries into normal FUNC symbols.
11013
11014 * symtab.h (Symbol): Add is_func and use it.
11015
05a352e6
DK
110162009-12-05 Doug Kwan <dougkwan@google.com>
11017
11018 * arm.cc (Target_arm::arm_info): Initialize new fields
11019 attributes_section and attributes_vendor.
11020 * i386.cc (Target_i386::i386_info): Same.
11021 * object.cc (Sized_relobj::do_layout): Skip attribute section.
11022 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
11023 fields attributes_section and attributes_vendor.
53d7974c 11024 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
11025 * target.h (Target::attributes_section, Target::attributes_vendor,
11026 Target::is_attributes_section, Target::attribute_arg_type,
11027 Target::attributes_order): New method definitions.
11028 (Target::Target_info::attributes_section,
11029 Target::Target_info::attributes_vendor): New fields.
11030 (Target::do_attribute_arg_type, Target::do_attributes_order): New
11031 virtual method definitions.
11032 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
11033 attributes_section and attributes_vendor.
11034 * testsuite/testfile.cc (Target_test::test_target_info): Same.
11035
f4e5969c
DK
110362009-12-05 Doug Kwan <dougkwan@google.com>
11037
11038 * arm.cc: Update comments about interworking and stub generation.
11039 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
11040 considered as non-PIC.
11041 (Arm_relocate_functions::base_abs): Fix formatting.
11042 (Arm_relocate_functions::got_prel): Fix comment. Change interface
11043 of function to use GOT entry address instead of offset.
11044 (Target_arm::Scan::global): Issue an error if a symbol would need a
11045 PLT does not get one because it is untyped. Remove code to create
11046 dynamic symbols for relative branches.
11047 (Target_arm::Relocate::relocate: Use 0 instead of false since function
11048 takes unsigned integer instead of boolean.
11049
1abce4a6
L
110502009-12-05 H.J. Lu <hongjiu.lu@intel.com>
11051
11052 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
11053 (two_file_test_LDADD): Likewise.
11054 (common_test_1_LDADD): Likewise.
11055 (exception_test_LDADD) Likewise.
11056 (weak_test_LDADD): Likewise.
11057 (many_sections_test_LDADD): Likewise.
11058 (initpri1_LDADD): Likewise.
11059 (script_test_1_LDADD): Likewise.
11060 (script_test_2_LDADD): Likewise.
11061 (justsyms_LDADD): Likewise.
11062 (binary_test_LDADD): Likewise.
11063 (large_LDADD): Likewise.
11064 * testsuite/Makefile.in: Regenerated.
11065
adcf2816 110662009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 11067
adcf2816
L
11068 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
11069 (Symbol_table::override_with_special): Likewise.
11070 (Symbol_table::add_from_object): Likewise.
11071
28e67f5d
RÁE
110722009-12-04 Rafael Avila de Espindola <espindola@google.com>
11073
11074 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11075 Don't set the data_offset twice.
11076
ae10a101
RÁE
110772009-12-04 Rafael Avila de Espindola <espindola@google.com>
11078
11079 * testsuite/Makefile.in: Regenerate.
11080
f59f41f3
DK
110812009-12-03 Doug Kwan <dougkwan@google.com>
11082
11083 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
11084 (Target_arm::do_finalize_sections): Add parameter for symbol table
11085 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
11086 * i386.cc (Target_i386::do_finalize_sections): Add an additional
11087 parameter for symbol table pointer.
11088 * layout.cc (Layout::finalize): Call Target::finalize_sections with
11089 an additional parameter for a pointer to symbol table.
11090 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
11091 parameter for a symbol table pointer.
11092 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
11093 * target.h (Target::finalize_sections, Target::do_finalize_sections):
11094 Ditto.
11095 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
11096 parameter for a symbol table pointer.
11097
ca55d848
RÁE
110982009-12-03 Rafael Avila de Espindola <espindola@google.com>
11099
11100 * incremental.cc (Incremental_inputs_header)
11101 (Incremental_inputs_header_write, Incremental_inputs_entry)
11102 (Incremental_inputs_entry_write): Move ...
11103 * incremental.h (Incremental_inputs_header)
11104 (Incremental_inputs_header_write, Incremental_inputs_entry)
11105 (Incremental_inputs_entry_write): here.
11106
3aec4f9c
RÁE
111072009-12-02 Rafael Avila de Espindola <espindola@google.com>
11108
11109 * incremental.cc (make_sized_incremental_binary): Set the target.
11110 Error if it is incompatible.
11111 * output.h (Output_file): Add filename method.
11112
9c0ae74d
RÁE
111132009-12-02 Rafael Avila de Espindola <espindola@google.com>
11114
11115 * incremental.cc (Incremental_inputs_entry): Remove unused argument
11116 from the get_* methods.
11117
a45500ae
RÁE
111182009-12-02 Rafael Avila de Espindola <espindola@google.com>
11119
11120 * incremental-dump.cc (main): Check that the offeset of a script is 0.
11121 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
11122 Write 0 for the data_offset of scripts.
11123
325e6408
RÁE
111242009-12-02 Rafael Avila de Espindola <espindola@google.com>
11125
11126 * testsuite/Makefile.am: Add the incremental_test.sh test.
11127 * testsuite/incremental_test.sh: New.
11128 * testsuite/incremental_test_1.c: New.
11129 * testsuite/incremental_test_2.c: New.
11130
954c3e2e
RÁE
111312009-12-01 Rafael Avila de Espindola <espindola@google.com>
11132
703d02da 11133 * incremental-dump.cc (main): Fix typos.
954c3e2e 11134
f8086623
RÁE
111352009-11-27 Rafael Avila de Espindola <espindola@google.com>
11136
11137 PR gold/11025
11138 * incremental-dump.cc (main): Use llu to print 64 bit values.
11139
3b0dd6ac
L
111402009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
11141 H.J. Lu <hongjiu.lu@intel.com>
11142
11143 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
11144 $(LIBDL).
11145 (incremental_dump_LDADD): Likewise.
11146 * Makefile.in: Regenerated.
11147
a6d1ef57 111482009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 11149
a6d1ef57
DK
11150 Revert:
11151
11152 2009-11-25 Doug Kwan <dougkwan@google.com>
11153
11154 * arm.cc (Target_arm::Target_arm): Move method definition
11155 outside of class definition. Add code to handle
11156 --target1-rel, --target1-abs and --target2= options.
11157 (Target_arm::get_reloc_reloc_type): Change method to be
11158 non-static and const.
11159 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
11160 New data member declaration.
11161 (Target_arm::Scan::local, Target_arm::Scan::global,
11162 Target_arm::Relocate::relocate,
11163 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11164 Adjust call to Target_arm::get_real_reloc_type.
11165 (Target_arm::get_real_reloc_type): Use command line options
11166 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11167 * options.h (--target1-rel, --target1-abs, --target2): New
11168 ARM-only options.
11169
50aeb7d4
DK
111702009-11-25 Doug Kwan <dougkwan@google.com>
11171
11172 * arm.cc (Target_arm::Target_arm): Move method definition outside of
11173 class definition. Add code to handle --target1-rel, --target1-abs
11174 and --target2= options.
11175 (Target_arm::get_reloc_reloc_type): Change method to be non-static
11176 and const.
11177 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
11178 member declaration.
11179 (Target_arm::Scan::local, Target_arm::Scan::global,
11180 Target_arm::Relocate::relocate,
11181 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
11182 call to Target_arm::get_real_reloc_type.
11183 (Target_arm::get_real_reloc_type): Use command line options to
11184 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
11185 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
11186 options.
11187
51938283
DK
111882009-11-25 Doug Kwan <dougkwan@google.com>
11189
11190 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
11191 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
11192 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
11193 formatting.
11194 (Arm_relocate_functions::thm_call): Replace body with a call to
11195 Arm_relocate_functions::thumb_branch_common.
11196 (Arm_relocate_functions::thm_jump24,
11197 Arm_relocate_functions::thm_xpc22): New method definitions.
11198 (Arm_relocate_functions::thumb_branch_common): New method definition.
11199 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
11200 operator.
11201 (Target_arm::Relocate::relocate): Adjust call to thm_call.
11202 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
11203
e2b8f3c4
RÁE
112042009-11-24 Rafael Avila de Espindola <espindola@google.com>
11205
11206 * Makefile.am: Build incremental-dump
11207 * Makefile.in: Regenerate.
11208 * incremental-dump.cc: New.
11209 * incremental.cc (Incremental_inputs_header_data,
11210 Incremental_inputs_entry_data): Move to incremental.h
11211 * incremental.h: (Incremental_inputs_header_data,
11212 Incremental_inputs_entry_data): Move from incremental.cc
11213
bcba9aec
RÁE
112142009-11-24 Rafael Avila de Espindola <espindola@google.com>
11215
11216 * incremental.cc (Incremental_inputs_header,
11217 Incremental_inputs_header_write, Incremental_inputs_entry,
11218 Incremental_inputs_entry_write): Add a typedef with the data type.
11219
7c3afe08
RÁE
112202009-11-24 Rafael Avila de Espindola <espindola@google.com>
11221
11222 * incremental.cc (Incremental_inputs_header,
11223 Incremental_inputs_header_write, Incremental_inputs_entry,
11224 Incremental_inputs_entry_write): Update comment about which
11225 type has the filed descriptions.
11226
d204b6e9
DK
112272009-11-15 Doug Kwan <dougkwan@google.com>
11228
11229 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
11230 (Arm_relocate_functions::arm_branch_common): Change method defintion
11231 in class definition to a method declaration and update list of formal
11232 parameters.
11233 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
11234 Arm_relocation_functions::jump24): Adjust call to
11235 Arm_relocate_functions::arm_branch_common. Update list of formal
11236 parameters.
11237 (Arm_relocate_functions::xpc25): New method definition.
11238 (Arm_relocate_functions::arm_branch_common): Move method defintion
11239 out from class definition. Use stubs for mode-switching and extending
11240 branch ranges.
11241 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
11242 specially. Change code to enable use of stubs in ARM branches.
11243
43d12afe
DK
112442009-11-10 Doug Kwan <dougkwan@google.com>
11245
11246 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
11247 in method declaration.
11248 (Target_arm::relocate_stub): New method declaration.
11249 (Target_arm::default_target): Change to return a pointer instead of
11250 a const reference.
11251 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
11252 Target_arm::default_target.
11253 (Arm_Relobj::do_relocate_sections): Remove options paramater in
11254 method definition.
11255 (Target_arm::relocate_section): Adjust view.
11256 (Target_arm::relocate_stub): New method definition.
11257
ac33a407
DK
112582009-11-10 Doug Kwan <dougkwan@google.com>
11259
11260 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
11261 a format warning.
11262 * incremental.cc (open_incremental_binary): Initialized local
11263 variables to avoid warnings.
11264 * object.cc (make_elf_object): Ditto.
11265 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
11266 a format warning.
e1df38aa 11267
88ee28e9
L
11268009-11-09 H.J. Lu <hongjiu.lu@intel.com>
11269
11270 PR gold/10930
11271 * testsuite/plugin_test.c: Include "config.h".
11272
2daedcd6
DK
112732009-11-09 Doug Kwan <dougkwan@google.com>
11274
11275 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
11276 (arm_symbol_value): Remove.
11277 (Arm_relocate_functions::arm_branch_common,
11278 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
11279 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
11280 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
11281 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
11282 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
11283 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
11284 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
11285 Arm_relocate_functions::thm_mobw_abs_nc,
11286 Arm_relocate_functions::thm_mov_abs,
11287 Arm_relocate_functions::movw_prel_nc,
11288 Arm_relocate_functions::thm_movt_abs,
11289 Arm_relocate_functions::movt_prel,
11290 Arm_relocate_functions::thm_movw_prel_nc,
11291 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
11292 (Target_arm::Relocate::relocate): Only decompose address into two
11293 parts if relocation type uses the thumb-bit and pass the actual
11294 bit instead of a flag indicating that the thumb-bit is used. Adjust
11295 calls to methods in Arm_relocate_functions for this change.
11296
1276bc89 112972009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
11298
11299 PR 10925
11300 * reloc.cc: Instantiate
11301 Sized_relobj::initialize_input_to_output_maps and
11302 Sized_relobj:free_input_to_output_maps.
11303
e53ad1b5
ILT
113042009-11-06 Ian Lance Taylor <iant@google.com>
11305
11306 PR 10876
11307 * defstd.cc (in_segment): Set only_if_ref true for "end".
11308
eb44217c
DK
113092009-11-06 Doug Kwan <dougkwan@google.com>
11310
11311 * arm.cc (class Reloc_stub): Correct a comment.
11312 (Target_arm::Target_arm): Initialize arm_input_section_map_.
11313 (Target_arm::scan_section_for_stubs): New method declaration.
11314 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
11315 Change methods from private to protected.
11316 (Target_arm::do_may_relax): New method definition.
11317 (Target_arm::do_relax, Target_arm::group_sections,
11318 Target_arm::scan_reloc_for_stub,
11319 Target_arm::scan_reloc_section_for_stubs): New method declarations.
11320 (Target_arm::arm_input_section_map_): New data member declaration.
11321 (Target_arm::scan_reloc_for_stub,
11322 Target_arm::scan_reloc_section_for_stubs,
11323 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
11324 Target_arm::do_relax): New method definitions.
11325
5d329b7d
ILT
113262009-11-06 Mikolaj Zalewski <mikolaj@google.com>
11327
11328 * configure.ac: Check for (struct stat)::st_mtim
11329 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
11330 * config.in: Regenerate.
11331 * configure: Regenerate.
11332
96a0d71b
ILT
113332009-11-05 Ian Lance Taylor <iant@google.com>
11334
11335 PR 10910
11336 * output.cc (Output_segment::add_output_section): Add missing
11337 return statement.
11338
594c8e5e
ILT
113392009-11-04 Ian Lance Taylor <iant@google.com>
11340
11341 PR 10880
11342 * object.h (class Object): Add is_needed and set_is_needed
11343 methods. Add is_needed_ field. Make bool fields into bitfields.
11344 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
11345 defined in a dynamic object and referenced by a regular object,
11346 set is_needed for the dynamic object.
11347 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
11348 if the file is marked with as_needed and it is not needed.
11349
22b127cc
ILT
113502009-11-04 Ian Lance Taylor <iant@google.com>
11351
11352 PR 10887
11353 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
11354 tags if data is discarded by linker script.
11355 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11356 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11357 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11358 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11359
f5c870d2
ILT
113602009-11-04 Ian Lance Taylor <iant@google.com>
11361
11362 * layout.cc (Layout::get_output_section): Add is_interp and
11363 is_dynamic_linker_section parameters. Change all callers.
11364 (Layout::choose_output_section): Likewise.
11365 (Layout::make_output_section): Likewise.
11366 (Layout::add_output_section_data): Add is_dynamic_linker_section
11367 parameter. Change all callers.
11368 * layout.h (class Layout): Update declarations.
11369 * output.h (class Output_section): Add is_interp, set_is_interp,
11370 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
11371 Add is_interp_, is_dynamic_linker_section_ fields. Change
11372 generate_code_fills_at_write_ to a bitfield.
11373 * output.cc (Output_section::Output_sections): Initialize new
11374 fields.
11375 (Output_segment::add_output_section): Add do_sort parameter.
11376 Change all callers.
11377
1ae4d23b
ILT
113782009-11-03 Ian Lance Taylor <iant@google.com>
11379
11380 PR 10860
11381 * options.h (class General_options): Add --warn-common.
11382 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
11383 merging two common symbols.
11384 (Symbol_table::should_override): Handle --warn-common when merging
11385 a common symbol with a defined symbol. Use report_resolve_problem
11386 for multiple definitions.
11387 (Symbol_table::report_resolve_problem): New function.
11388 * symtab.h (class Symbol_table): Declare report_resolve_problem.
11389
55da9579
DK
113902009-11-03 Doug Kwan <dougkwan@google.com>
11391
11392 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
11393 stub_factory_.
11394 (Target_arm::stub_factory): New method definition.
11395 (Target_arm::new_arm_input_section,
11396 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
11397 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 11398 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
11399 New type definitions.
11400 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
11401 member declarations.
11402 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
11403 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
11404 New method definitions.
11405
37a9ac43
ILT
114062009-11-03 Ian Lance Taylor <iant@google.com>
11407
11408 * options.h (class General_options): Add --warn_constructors.
11409
b3d6a3d4
ILT
114102009-11-03 Ian Lance Taylor <iant@google.com>
11411
11412 PR 10893
11413 * defstd.cc (in_section): Add entries for __rel_iplt_start,
11414 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
11415
934b01dd
ILT
114162009-11-03 Ian Lance Taylor <iant@google.com>
11417
11418 PR 10895
11419 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
11420 --msgid-bugs-address.
11421 (install-pdf): New target.
11422 (install-data_yes): Look up one directory to find mkinstalldirs.
11423
03c1939b
L
114242009-11-03 H.J. Lu <hongjiu.lu@intel.com>
11425
11426 * po/Make-in (.po.gmo): Don't generate .gmo files in source
11427 tree.
11428
ebd95253
DK
114292009-10-30 Doug Kwan <dougkwan@google.com>
11430
11431 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
11432
e9bbb538
DK
114332009-10-30 Doug Kwan <dougkwan@google.com>
11434
11435 * arm.cc (Stub_addend_reader): New struct template definition
11436 and partial specializations.
11437 (Stub_addend_reader::operator()): New method definition for a
11438 partially specialized template.
11439
d5b40221
DK
114402009-10-30 Doug Kwan <dougkwan@google.com>
11441
11442 * arm.cc (Arm_relobj::processor_specific_flags): New method
11443 definition.
11444 (Arm_relobj::do_read_symbols): New method declaration.
11445 (Arm_relobj::processor_specific_flags_): New data member declaration.
11446 (Arm_dynobj): New class definition.
11447 (Target_arm::do_finalize_sections): Add input_objects parameter.
11448 (Target_arm::do_adjust_elf_header): New method declaration.
11449 (Target_arm::are_eabi_versions_compatible,
11450 (Target_arm::merge_processor_specific_flags): New method declaration.
11451 (Target_arm::do_make_elf_object): New overloaded method definitions
11452 and declaration.
11453 (Arm_relobj::do_read_symbols): New method definition.
11454 (Arm_dynobj::do_read_symbols): Ditto.
11455 (Target_arm::do_finalize_sections): Add input_objects parameters.
11456 Merge processor-specific flags from all input objects.
11457 (Target_arm::are_eabi_versions_compatible,
11458 Target_arm::merge_processor_specific_flags,
11459 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
11460 New method definitions.
11461 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
11462 Input_objects pointer type parameter.
11463 * layout.cc (Layout::finalize): Pass input objects to target's.
11464 finalize_sections function.
11465 * output.cc (Output_file_header::do_sized_write): Set ELF file
11466 header's processor-specific flags.
11467 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
11468 Input_objects pointer type parameter.
11469 * sparc.cc (Target_sparc::do_finalize_sections): Same.
11470 * target.h (Input_objects): New forward class declaration.
11471 (Target::processor_specific_flags,
11472 Target::are_processor_specific_flags_sect): New method definitions.
11473 (Target::finalize_sections): Add input_objects parameter.
11474 (Target::Target): Initialize processor_specific_flags_ and
11475 are_processor_specific_flags_set_.
11476 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
11477 parameter.
11478 (Target::set_processor_specific_flags): New method definition.
11479 (Target::processor_specific_flags_,
11480 Target::are_processor_specific_flags_set_): New data member
11481 declarations.
11482 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
11483 Input_objects pointer type parameter.
11484
ebabffbd
DK
114852009-10-30 Doug Kwan <dougkwan@google.com>
11486
11487 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
11488
ad0f2072
ILT
114892009-10-28 Ian Lance Taylor <iant@google.com>
11490
11491 * object.h (class Relobj): Drop options parameter from
11492 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
11493 do_scan_relocs, do_relocate. Change all callers.
11494 (class Sized_relobj): Drop options parameters from
11495 do_gc_process_relocs, do_scan_relocs, do_relocate,
11496 do_relocate_sections, relocate_sections, emit_relocs_scan,
11497 emit_relocs_scan_reltype. Change all callers.
11498 (struct Relocate_info): Remove options field and all references to
11499 it.
11500 * reloc.h (class Read_relocs): Remove options constructor
11501 parameter and options_ field. Change all callers.
11502 (class Gc_process_relocs, class Scan_relocs): Likewise.
11503 (class Relocate_task): Likewise.
11504 * target-reloc.h (scan_relocs): Remove options parameter. Change
11505 all callers.
11506 (scan_relocatable_relocs): Likewise.
11507 * target.h (class Sized_target): Remove options parameter from
11508 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
11509 all callers.
11510 * gc.h (gc_process_relocs): Remove options parameter. Change all
11511 callers.
11512 * arm.cc: Update functions to remove options parameters.
11513 * i386.cc: Likewise.
11514 * powerpc.cc: Likewise.
11515 * sparc.cc: Likewise.
11516 * x86_64.cc: Likewise.
11517 * testsuite/testfile.cc: Likewise.
11518
8ffa3667
DK
115192009-10-28 Doug Kwan <dougkwan@google.com>
11520
11521 * arm.cc (Arm_relobj): New class definition.
e1df38aa 11522 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
11523 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
11524 New method definitions.
11525
40f36857
CC
115262009-10-28 Cary Coutant <ccoutant@google.com>
11527
11528 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
11529 (Plugin::cleanup_done_): New member.
11530 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
11531 (Plugin_manager::cleanup_done_): Remove.
11532 (Plugin_manager::add_input_file): Edit error message.
11533 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
11534 (Plugin_manager::cleanup): Remove use of cleanup_done_.
11535
2c849493
ILT
115362009-10-27 Mikolaj Zalewski <mikolajz@google.com>
11537
11538 * fileread.cc: (File_read::View::~View): Use the new
11539 data_ownership_ filed.
11540 (File_read::~File_read): Dispose the new whole_file_view_.
11541 (File_read::open): Mmap the whole file if needed.
11542 (File_read::open): Use whole_file_view_ instead of contents_.
11543 (File_read::find_view): Use whole_file_view_ if applicable.
11544 (File_read::do_read): Use whole_file_view_ instead of contents_.
11545 (File_read::make_view): Use whole_file_view_ instead of contents_,
11546 update File_read::View::View call.
11547 (File_read::find_or_make_view): Update File_read::View::View
11548 call.
11549 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
11550 remove contents_
11551 (File_read::View::Data_ownership): New enum.
11552 (File_read::View::View): Replace bool mapped_ with Data_ownership
11553 argument.
11554 (File_read::View::mapped_): Remove (replaced by data_ownership_).
11555 (File_read::View::data_ownership_): New field.
11556 (File_read::contents_): Remove (replaced by whole_file_view_).
11557 (File_read::whole_file_view_): New field.
11558 * options.h (class General_options): Add --keep-files-mapped.
11559
24998053
CC
115602009-10-27 Cary Coutant <ccoutant@google.com>
11561
11562 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
11563 * testsuite/Makefile.am (plugin_test_5): New test case.
11564 * testsuite/Makefile.in: Regenerate.
11565
72adc4fa
DK
115662009-10-25 Doug Kwan <dougkwan@google.com>
11567
11568 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
11569 from private to protected to allow access by child class.
11570 (Sized_relobj::do_relocate_sections): New method declaration.
11571 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 11572 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
11573 Sized_relobj::relocate_sections. Instantiate template explicitly
11574 for different target sizes and endianity.
11575
07f508a2
DK
115762009-10-24 Doug Kwan <dougkwan@google.com>
11577
11578 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
11579 (Arm_input_section::as_arm_input_section): New method.
11580 (Arm_output_section): New class definition.
11581 (Arm_output_section::create_stub_group,
11582 Arm_output_section::group_sections): New method definitions.
11583
10ad9fe5
DK
115842009-10-22 Doug Kwan <dougkwan@google.com>
11585
11586 * arm.cc (Arm_input_section): New class definition.
11587 (Arm_input_section::init, Arm_input_section:do_write,
11588 Arm_input_section::set_final_data_size,
11589 Arm_input_section::do_reset_address_and_file_offset): New method
11590 definitions.
11591
56ee5e00
DK
115922009-10-21 Doug Kwan <dougkwan@google.com>
11593
11594 * arm.cc (Stub_table, Arm_input_section): New forward class
11595 declarations.
11596 (Stub_table): New class defintion.
11597 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
11598 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
11599 New method definition.
11600
b569affa
DK
116012009-10-21 Doug Kwan <dougkwan@google.com>
11602
11603 * arm.cc: Update copyright comments.
11604 (Target_arm): New forward class template declaration.
11605 (Arm_address): New type.
11606 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
11607 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
11608 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
11609 constants.
11610 (Insn_template): Same.
11611 (DEF_STUBS): New macro.
11612 (Stub_type): New enum type.
11613 (Stub_template): New class definition.
11614 (Stub): Same.
11615 (Reloc_stub): Same.
11616 (Stub_factory): Same.
11617 (Target_arm::Target_arm): Initialize may_use_blx_ and
11618 should_force_pic_veneer_.
11619 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
11620 Target_arm::should_force_pic_veneer,
11621 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
11622 Target_arm::using_thumb_only, Target_arm:;default_target): New
11623 method defintions.
11624 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
11625 New data member declarations.
11626 (Insn_template::size, Insn_template::alignment): New method defintions.
11627 (Stub_template::Stub_template): New method definition.
11628 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
11629 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
11630 (Stub_factory::Stub_factory): New method definition.
11631 * gold.h (string_hash): New template.
11632 * output.h (Input_section_specifier::hash_value): Use
11633 gold::string_hash.
11634 (Input_section_specifier::string_hash): Remove.
11635 * stringpool.cc (Stringpool_template::string_hash): Use
11636 gold::string_hash.
11637
6c172549
DK
116382009-10-20 Doug Kwan <dougkwan@google.com>
11639
11640 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
11641 symbols of relaxed input sections.
11642 * output.h (Output_section::find_relaxed_input_section): Make
11643 method public.
11644
c5617f2f
DK
116452009-10-16 Doug Kwan <dougkwan@google.com>
11646
11647 * dynobj.cc (Versions::Versions): Initialize version_script_.
11648 Only insert base version symbol definition for a shared object
11649 if version script defines any version versions.
11650 (Versions::define_base_version): New method definition.
11651 (Versions::add_def): Check that base version is not needed.
11652 (Versions::add_need): Define base version lazily.
11653 * dynobj.h (Versions::define_base_version): New method declaration.
11654 (Versions::needs_base_version_): New data member declaration.
11655 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
11656 (check_DATA): Add no_version_test.stdout.
11657 (libno_version_test.so, no_version_test.o no_version_test.stdout):
11658 New make rules.
11659 * testsuite/Makefile.in: Regenerate.
11660 * testsuite/no_version_test.c: New file.
11661 * testsuite/no_version_test.sh: Ditto.
11662
3c12dcdb
DK
116632009-10-16 Doug Kwan <dougkwan@google.com>
11664
11665 * expression.cc (class Segment_start_expression): New class definition.
11666 (Segment_start_expression::value): New method definition.
11667 (script_exp_function_segment_start): Return a new
11668 Segment_start_expression.
11669 * gold/script-c.h (script_saw_segment_start_expression): New function
11670 prototype.
11671 * script-sections.cc (Script_sections::Script_sections): Initialize
11672 SAW_SEGMENT_START_EXPRESSION_ to false.
11673 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
11674 and -Tbbs options to specify section addresses if given in
11675 command line and no SEGMENT_START expression is seen in a script.
11676 * script-sections.h (Script_sections::saw_segment_start_expression,
11677 Script_sections::set_saw_segment_start_expression): New method
11678 definition.
11679 (Script_sections::saw_segment_start_expression_): New data member
11680 declaration.
11681 * script.cc (script_saw_segment_start_expression): New function.
11682 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
11683 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
11684 script_test_7.sh and script_test_8.sh.
11685 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
11686 script_test_8.stdout.
11687 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
11688 (script_test_6, script_test_6.stdout, script_test_7,
11689 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
11690 * Makefile.in: Regenerate.
11691 * testsuite/script_test_6.sh: New file.
11692 * testsuite/script_test_6.t: Same.
11693 * testsuite/script_test_7.sh: Same.
11694 * testsuite/script_test_7.t: Same.
11695 * testsuite/script_test_8.sh: Same.
11696
64b1ae37
DK
116972009-10-16 Doug Kwan <dougkwan@google.com>
11698
11699 * output.cc (Output_segment::set_section_list_address): Cast
11700 expressions to unsigned long long type to avoid format warnings.
11701
661be1e2
ILT
117022009-10-15 Ian Lance Taylor <iant@google.com>
11703
12edd763 11704 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 11705 dot assignment to script_sections_.
12edd763
ILT
11706 * script-sections.cc (Script_sections::add_dot_assignment):
11707 Initialize if necessary.
11708
68b6574b
ILT
11709 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
11710 program headers with no load segment if there is a linker script.
11711
661be1e2
ILT
11712 * layout.cc (Layout::set_segment_offsets): Align the file offset
11713 to the segment aligment for -N or -n with no load segment.
11714 * output.cc (Output_segment::add_output_section): Don't crash if
11715 the first section is a TLS section.
11716 (Output_segment::set_section_list_addresses): Print an error
11717 message if the address moves backward in a linker script.
11718 * script-sections.cc
11719 (Output_section_element_input::set_section_addresses): Don't
11720 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
11721 (Orphan_output_section::set_section_addresses): Likewise.
11722
f15f61a7
DK
117232009-10-15 Doug Kwan <dougkwan@google.com>
11724
11725 * layout.cc (Layout::finish_dynamic_section): Generate tags
11726 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
11727 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
11728 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
11729
82bb573a
ILT
117302009-10-14 Ian Lance Taylor <iant@google.com>
11731
11732 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
11733 fields.
11734 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
11735 data_shdr fields of relinfo.
11736 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
11737 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
11738 R_386_TLS_LDO_32, adjust based on section flags.
11739 (Target_i386::Relocate::fix_up_ldo): Remove.
11740
374ad285
ILT
117412009-10-13 Ian Lance Taylor <iant@google.com>
11742
11743 Add support for -pie.
11744 * options.h (class General_options): Add -pie and
11745 --pic-executable.
11746 (General_options::output_is_position_independent): Test -pie.
11747 (General_options::output_is_executable): Return true if not shared
11748 and not relocatable.
11749 (General_options::output_is_pie): Remove.
11750 * options.cc (General_options::finalize): Reject incompatible uses
11751 of -pie.
11752 * gold.cc (queue_middle_tasks): A -pie link is not static.
11753 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
11754 * symtab.cc (Symbol::final_value_is_known): Return false if
11755 output_is_position_independent.
11756 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
11757 output_is_position_independent.
11758 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
11759 output_is_position_independent.
11760 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
11761 output_is_position_independent.
11762 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
11763 two_file_pie_test.
11764 (basic_pie_test.o, basic_pie_test): New targets.
11765 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
11766 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
11767 (two_file_pie_test): New target.
11768 * testsuite/Makefile.in: Rebuild.
11769 * README: Remove note saying that -pie is not supported.
11770
c6585162
ILT
117712009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
11772
11773 * options.h (class General_options): Add -init and -fini.
11774 * layout.cc (Layout::finish_dynamic_section): Emit
11775 given init and fini functions.
11776
032ce4e9
ST
117772009-10-13 Sriraman Tallam <tmsriram@google.com>
11778
11779 * gc.h (gc_process_relocs): Check if icf is enabled using new
11780 function.
11781 * gold.cc (queue_initial_tasks): Likewise.
11782 (queue_middle_tasks): Likewise.
11783 * object.cc (do_layout): Likewise.
11784 * symtab.cc (is_section_folded): Likewise.
11785 * main.cc (main): Likewise.
11786 * reloc.cc (Read_relocs::run): Likewise.
11787 (Sized_relobj::do_scan_relocs): Likewise.
11788 * icf.cc (is_function_ctor_or_dtor): New function.
11789 (Icf::find_identical_sections): Check if function is ctor or dtor when
11790 safe icf is chosen.
11791 * options.h (General_options::icf): Change option to be an enum.
11792 (Icf_status): New enum.
11793 (icf_enabled): New method.
11794 (icf_safe_folding): New method.
11795 (set_icf_status): New method.
11796 (icf_status_): New variable.
11797 * (options.cc) (General_options::finalize): Set icf_status_.
11798 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
11799 icf_test and icf_keep_unique_test to use the --icf enum flag.
11800 * testsuite/icf_safe_test.sh: New file.
e1df38aa 11801 * testsuite/icf_safe_test.cc: New file.
032ce4e9 11802
f345227a
ST
118032009-10-12 Sriraman Tallam <tmsriram@google.com>
11804
11805 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
11806 includes to gc.h and icf.h.
11807 * arm.cc: Include gc.h.
11808 * gold.cc: Likewise.
11809 * i386.cc: Likewise.
11810 * powerpc.cc: Likewise.
11811 * sparc.cc: Likewise.
11812 * x86_64.cc: Likewise.
11813 * gc.h: Include icf.h.
11814
1c7814ed
ILT
118152009-10-11 Ian Lance Taylor <iant@google.com>
11816
11817 * plugin.cc: Include "gold.h" before other header files.
11818
ae3b5189
CD
118192009-10-10 Chris Demetriou <cgd@google.com>
11820
11821 * options.h (Input_file_argument::Input_file_type): New enum.
11822 (Input_file_argument::is_lib_): Replace with...
11823 (Input_file_argument::type_): New member.
11824 (Input_file_argument::Input_file_argument): Take Input_file_type
11825 'type' rather than boolean 'is_lib' as second argument.
11826 (Input_file_argument::is_lib): Use type_.
11827 (Input_file_argument::is_searched_file): New function.
11828 (Input_file_argument::may_need_search): Handle is_searched_file.
11829 * options.cc (General_options::parse_library): Support -l:filename.
11830 (General_options::parse_just_symbols): Update for Input_file_argument
11831 changes.
11832 (Command_line::process): Likewise.
11833 * archive.cc (Archive::get_file_and_offset): Likewise.
11834 * plugin.cc (Plugin_manager::release_input_file): Likewise.
11835 * script.cc (read_script_file, script_add_file): Likewise.
11836 * fileread.cc (Input_file::Input_file): Likewise.
11837 (Input_file::will_search_for): Handle is_searched_file.
11838 (Input_file::open): Likewise.
11839 * readsyms.cc (Read_symbols::get_name): Likewise.
11840 * testsuite/Makefile.am (searched_file_test): New test.
11841 * testsuite/Makefile.in: Regenerate.
11842 * testsuite/searched_file_test.cc: New file.
11843 * testsuite/searched_file_test_lib.cc: New file.
11844
f3048a1d
ILT
118452009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11846 Ian Lance Taylor <iant@google.com>
11847
11848 * descriptor.cc: Include <cstdio> and "binary-io.h".
11849 (Descriptors::open): Open the files in binary mode always.
11850 * script.cc (Lex::get_token): Treat \r as whitespace.
11851
d4780e57
ILT
118522009-10-09 Ian Lance Taylor <iant@google.com>
11853
11854 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
11855
d9a893b8
ILT
118562009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11857 Ian Lance Taylor <iant@google.com>
11858
11859 * configure.ac: Check for readv function also.
11860 * fileread.cc (readv): Define if not HAVE_READV.
11861 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
11862 does not exist.
11863 * config.in: Regenerate.
11864 * configure: Regenerate.
11865
c0a62865
DK
118662009-10-09 Doug Kwan <dougkwan@google.com>
11867
11868 * layout.cc (Layout::make_output_section): Call target hook to make
11869 ordinary output section.
11870 (Layout::finalize): Adjust parameter list of call the
11871 Target::may_relax().
11872 * layout.h (class Layout::section_list): New method.
11873 * merge.h (Output_merge_base::entsize): Change visibility to public.
11874 (Output_merge_base::is_string, Output_merge_base::do_is_string):
11875 New methods.
11876 (Output_merge_string::do_is_string): New method.
11877 * object.cc (Sized_relobj::do_setup): renamed from
11878 Sized_relobj::set_up.
11879 * object.h (Sized_relobj::adjust_shndx,
11880 Sized_relobj::initializ_input_to_output_maps,
11881 Sized_relobj::free_input_to_output_maps): Change visibilities to
11882 protected.
11883 (Sized_relobj::setup): Virtualize.
11884 (Sized_relobj::do_setup): New method declaration.
11885 (Sized_relobj::invalidate_section_offset,
11886 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
11887 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
11888 * options.cc (parse_int): New function.
11889 * options.h (parse_int): New declaration.
11890 (DEFINE_int): New macro.
11891 (stub_group_size): New option.
11892 * output.cc (Output_section::Output_section): Initialize memebers
11893 merge_section_map_, merge_section_by_properties_map_,
11894 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
11895 (Output_section::add_input_section): Handled deferred code-fill
11896 generation and remove an old comment.
11897 (Output_section::add_relaxed_input_section): New method definition.
11898 (Output_section::add_merge_input_section): Use merge section by
11899 properties map to speed to search. Update merge section maps
11900 as appropriate.
11901 (Output_section::build_relaxation_map): New method definition.
11902 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
11903 Same.
11904 (Output_section::relax_input_section): Renamed to
11905 Output_section::convert_input_sections_to_relaxed_sections and change
11906 interface to take a vector of pointers to relaxed sections.
11907 (Output_section::find_merge_section,
11908 Output_section::find_relaxed_input_section): New method definitions.
11909 (Output_section::is_input_address_mapped,
11910 Output_section::output_offset, Output_section::output_address):
11911 Use output section data maps to speed up searching.
11912 (Output_section::find_starting_output_address): Add comments.
11913 (Output_section::do_write,
11914 Output_section::write_to_postprocessing_buffer): Do code-fill
11915 generation as appropriate.
11916 (Output_section::get_input_sections): Invalidate relaxed input section
11917 map.
11918 (Output_section::restore_states): Adjust type of checkpoint .
11919 Invalidate relaxed input section map.
11920 * output.h (Output_merge_base): New class declaration.
11921 (Input_section_specifier): New class defintion.
11922 (class Output_relaxed_input_section) Change base class to
11923 Output_section_data_build.
11924 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
11925 base class initializer.
11926 (Output_section::add_relaxed_input_section): New method declaration.
11927 (Output_section::Input_section): Change visibility to protected.
2e702c99 11928 (Output_section::Input_section::relobj,
c0a62865
DK
11929 Output_section::Input_section::shndx): Handle relaxed input sections.
11930 Output_section::input_sections) Change visibility to protected. Also
11931 define overload to return a non-const pointer.
11932 (Output_section::Merge_section_properties): New class defintion.
11933 (Output_section::Merge_section_by_properties_map,
11934 Output_section::Output_section_data_by_input_section_map,
11935 Output_section::Relaxation_map): New types.
11936 (Output_section::relax_input_section): Rename method to
11937 Output_section::convert_input_sections_to_relaxed_sections and change
11938 interface to take a vector of relaxed section pointers.
11939 (Output_section::find_merge_section,
11940 Output_section::find_relaxed_input_section,
11941 Output_section::build_relaxation_map,
11942 Output_section::convert_input_sections_in_list_to_relaxed_sections):
11943 New method declarations.
11944 (Output_section::merge_section_map_
11945 Output_section::merge_section_by_properties_map_,
11946 Output_section::relaxed_input_section_map_,
11947 Output_section::is_relaxed_input_section_map_valid_,
11948 Output_section::generate_code_fills_at_write_): New data members.
11949 * script-sections.cc
11950 (Output_section_element_input::set_section_addresses): Call
11951 current_data_size and addralign methods of relaxed input sections.
11952 (Orphan_output_section::set_section_addresses): Call current_data_size
11953 and addralign methods of relaxed input sections.
11954 * symtab.cc (Symbol_table::compute_final_value): Extract template
11955 from the body of Symbol_table::sized_finalize_symbol.
11956 (Symbol_table::sized_finalized_symbol): Call
11957 Symbol_table::compute_final_value.
11958 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
11959 (Symbol_table::compute_final_value): New templated method declaration.
11960 * target.cc (Target::do_make_output_section): New method defintion.
11961 * target.h (Target::make_output_section): New method declaration.
11962 (Target::relax): Add more parameters for input objects, symbol table
11963 and layout. Adjust call to do_relax.
11964 (Target::do_make_output_section): New method declaration.
11965 (Target::do_relax): Add parameters for input objects, symbol table
11966 and layout.
11967
d446d6c4
ILT
119682009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11969
11970 * pread.c: Include stdio.h.
11971
bc06c745
ILT
119722009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11973
11974 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
11975 defined.
11976
75aea3d0
ILT
119772009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
11978
11979 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
11980 Change read_shndx type to unsigned int.
11981 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11982 int.
11983 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11984 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
11985 Change read_shndx type to unsigned int.
11986 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
11987 int.
11988 (Sized_dwarf_line_info::read_line_mappings): Likewise.
11989 * layout.cc (Layout::create_symtab_sections): Cast the result of
11990 local_symcount * symsize to off_t in the gold_assert.
11991
be8fcb75
ILT
119922009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11993
11994 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
11995 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
11996 R_ARM_BASE_ABS.
11997 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
11998 (Arm_relocate_functions::thm_abs5): New function.
11999 (Arm_relocate_functions::abs12): New function.
12000 (Arm_relocate_functions::abs16): New function.
12001 (Arm_relocate_functions::base_abs): New function.
12002 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
12003 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
12004 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
12005 R_ARM_BASE_ABS.
12006 (Scan::global): Likewise.
12007 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
12008 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
12009 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
12010 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
12011 R_ARM_BASE_ABS.
12012
c2a122b6
ILT
120132009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12014
12015 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
12016 (Arm_relocate_functions::movt_prel): New function.
12017 (Arm_relocate_functions::thm_movw_prel_nc): New function.
12018 (Arm_relocate_functions::thm_movt_prel): New function.
12019 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
12020 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
12021 (Scan::global, Relocate::relocate): Likewise.
12022 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12023
c4aa1e2d
ILT
120242009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12025
12026 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
12027 Incremental_checker.
12028 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
12029 unsigned int.
12030 (class Incremental_inputs_header): New class.
12031 (Incremental_inputs_header_writer): Edit comment.
12032 (Incremental_inputs_entry): New class.
12033 (Incremental_inputs_entry_writer): Edit comment.
12034 (Sized_incremental_binary::do_find_incremental_inputs_section):
12035 Add *strtab_shndx parameter, fill it.
12036 (Sized_incremental_binary::do_check_inputs): New method.
12037 (Incremental_checker::can_incrementally_link_output_file): Use
12038 Sized_incremental_binary::check_inputs.
12039 (Incremental_inputs::report_command_line): Save command line in
12040 command_line_.
12041 * incremental.h:
12042 (Incremental_binary::find_incremental_inputs_section): New
12043 method.
12044 (Incremental_binary::do_find_incremental_inputs_section): Add
12045 strtab_shndx parameter.
12046 (Incremental_binary::do_check_inputs): New pure virtual method.
12047 (Sized_incremental_binary::do_check_inputs): Declare.
12048 (Incremental_checker::Incremental_checker): Add incremental_inputs
12049 parameter, use it to initialize incremental_inputs_.
12050 (Incremental_checker::incremental_inputs_): New field.
12051 (Incremental_checker::command_line): New method.
12052 (Incremental_checker::inputs): New method.
12053 (Incremental_checker::command_line_): New field.
12054
c549a694
ILT
120552009-10-09 Mikolaj Zalewski <mikolajz@google.com>
12056
12057 * incremental.cc: Include <cstdarg> and "target-select.h".
12058 (vexplain_no_incremental): New function.
12059 (explain_no_incremental): New function.
12060 (Incremental_binary::error): New method.
12061 (Sized_incremental_binary::do_find_incremental_inputs_section): New
12062 method.
12063 (make_sized_incremental_binary): New function.
12064 (open_incremental_binary): New function.
12065 (can_incrementally_link_file): Add checks if output is ELF and has
12066 inputs section.
12067 * incremental.h: Include "elfcpp_file.h" and "output.h".
12068 (Incremental_binary): New class.
12069 (Sized_incremental_binary): New class.
12070 (open_incremental_binary): Declare.
12071 * object.cc (is_elf_object): Use
12072 elfcpp::Elf_recognizer::is_elf_file.
12073 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
12074 * output.h (Output_file::filesize): New method.
12075
fd3c5f0b
ILT
120762009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12077
12078 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
12079 New function.
12080 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
12081 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
12082 function.
12083 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
12084 function.
12085 (Arm_relocate_functions::movw_abs_nc): New function.
12086 (Arm_relocate_functions::movt_abs): New function.
12087 (Arm_relocate_functions::thm_movw_abs_nc): New function.
12088 (Arm_relocate_functions::thm_movt_abs): New function.
12089 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
12090 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
12091 (Scan::global): Likewise.
12092 (Relocate::relocate): Likewise.
12093 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12094
7f5309a5
ILT
120952009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12096
12097 * arm.cc (Arm_relocate_functions::got_prel) New function.
12098 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
12099 (Relocate::relocate): Likewise.
12100 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
12101
364c7fa5
ILT
121022009-10-06 Ian Lance Taylor <iant@google.com>
12103
12104 * options.h (class General_options): Define
12105 split_stack_adjust_size parameter.
12106 * object.h (class Object): Add uses_split_stack_ and
12107 has_no_split_stack_ fields. Add uses_split_stack and
12108 has_no_split_stack accessor functions. Declare
12109 handle_split_stack_section.
12110 (class Reloc_symbol_changes): Define.
12111 (class Sized_relobj): Define Function_offsets. Declare
12112 split_stack_adjust, split_stack_adjust_reltype, and
12113 find_functions.
12114 * object.cc (Object::handle_split_stack_section): New function.
12115 (Sized_relobj::do_layout): Call handle_split_stack_section.
12116 * dynobj.cc (Sized_dynobj::do_layout): Call
12117 handle_split_stack_section.
12118 * reloc.cc (Sized_relobj::relocate_sections): Call
12119 split_stack_adjust for executable sections in split_stack
12120 objects. Pass reloc_map to relocate_section.
12121 (Sized_relobj::split_stack_adjust): New function.
12122 (Sized_relobj::split_stack_adjust_reltype): New function.
12123 (Sized_relobj::find_functions): New function.
12124 * target-reloc.h: Include "object.h".
12125 (relocate_section): Add reloc_symbol_changes parameter. Change
12126 all callers.
12127 * target.h (class Target): Add calls_non_split method. Declare
12128 do_calls_non_split virtual method. Declare match_view and
12129 set_view_to_nop.
12130 * target.cc: Include "elfcpp.h".
12131 (Target::do_calls_non_split): New function.
12132 (Target::match_view): New function.
12133 (Target::set_view_to_nop): New function.
12134 * gold.cc (queue_middle_tasks): Give an error if mixing
12135 split-stack and non-split-stack objects with -r.
12136 * i386.cc (Target_i386::relocate_section): Add
12137 reloc_symbol_changes parameter.
12138 (Target_i386::do_calls_non_split): New function.
12139 * x86_64.cc (Target_x86_64::relocate_section): Add
12140 reloc_symbol_changes parameter.
12141 (Target_x86_64::do_calls_non_split): New function.
12142 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
12143 parameter.
12144 * powerpc.cc (Target_powerpc::relocate_section): Add
12145 reloc_symbol_changes parameter.
12146 * sparc.cc (Target_sparc::relocate_section): Add
12147 reloc_symbol_changes parameter.
12148 * configure.ac: Call AM_CONDITIONAL for the default target.
12149 * configure: Rebuild.
12150 * testsuite/Makefile.am (TEST_AS): New variable.
12151 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
12152 (check_DATA): Add split_i386 and split_x86_64 files.
12153 (SPLIT_DEFSYMS): Define.
12154 (split_i386_[1234n].o): New targets.
12155 (split_i386_[124]): New targets.
12156 (split_i386_[1234r].stdout): New targets.
12157 (split_x86_64_[1234n].o): New targets.
12158 (split_x86_64_[124]): New targets.
12159 (split_x86_64_[1234r].stdout): New targets.
12160 (MOSTLYCLEANFILES): Add new executables.
12161 * testsuite/split_i386.sh: New file.
12162 * testsuite/split_x86_64.sh: New file.
12163 * testsuite/split_i386_1.s: New file.
12164 * testsuite/split_i386_2.s: New file.
12165 * testsuite/split_i386_3.s: New file.
12166 * testsuite/split_i386_4.s: New file.
12167 * testsuite/split_i386_n.s: New file.
12168 * testsuite/split_x86_64_1.s: New file.
12169 * testsuite/split_x86_64_2.s: New file.
12170 * testsuite/split_x86_64_3.s: New file.
12171 * testsuite/split_x86_64_4.s: New file.
12172 * testsuite/split_x86_64_n.s: New file.
12173 * testsuite/testfile.cc (Target_test): Update relocation_section
12174 function.
12175 * testsuite/Makefile.in: Rebuild.
12176
e8a9fcda
ILT
121772009-10-06 Ian Lance Taylor <iant@google.com>
12178
12179 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
12180 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
12181 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
12182 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
12183 the address on ldo_addrs_.
12184 (Target_i386::Relocate::fix_up_ldo): New function.
12185
e99daf92
ILT
121862009-10-06 Rafael Espindola <espindola@google.com>
12187
12188 * plugin.cc (add_input_library): New.
12189 (Plugin::load): Add add_input_library to tv.
12190 (Plugin_manager::add_input_file): Add the is_lib argument.
12191 (add_input_file): Update call to Plugin_manager::add_input_file.
12192 (add_input_library): New.
12193 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
12194
966d4097
DK
121952009-09-30 Doug Kwan <dougkwan@google.com>
12196
12197 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
12198 symbol and call Symbol::may_need_copy_reloc to determine if
12199 a copy reloc is needed.
12200 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
12201 nocopyreloc is given in command line.
12202 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
12203 given in command line.
12204 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
12205 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
12206 of the removed Target_i386::may_need_copy_reloc.
12207 * options.h (copyreloc): New option with default value false.
12208 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12209 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
12210 instead of the removed Target_powerpc::may_need_copy_reloc.
12211 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
12212 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
12213 instead of the removed Target_sparc::may_need_copy_reloc.
12214 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
12215 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
12216 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
12217 instead of the removed Target_x86_64::may_need_copy_reloc.
12218
029ba973
ILT
122192009-09-30 Ian Lance Taylor <iant@google.com>
12220
12221 * object.h (class Object): Remove target_ field, and target,
12222 sized_target, and set_target methods.
12223 (Object::sized_target): Remove.
12224 (class Sized_relobj): Update declarations. Remove sized_target.
12225 * object.cc (Sized_relobj::setup): Remove target parameter.
12226 Change all callers.
12227 (Input_objects::add_object): Don't do anything with the target.
12228 (make_elf_sized_object): Add punconfigured parameter. Change all
12229 callers. Set or test parameter target.
12230 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
12231 Change all callers.
12232 * parameters.cc (Parameters::set_target): Change parameter type to
12233 be non-const.
12234 (Parameters::default_target): Remove.
12235 (set_parameters_target): Change parameter type to be non-const.
12236 (parameters_force_valid_target): New function.
12237 (parameters_clear_target): New function.
12238 * parameters.h (class Parameters): Update declarations. Remove
12239 default_target method. Add sized_target and clear_target
12240 methods. Change target_ to be non-const.
12241 (set_parameters_target): Update declaration.
12242 (parameters_force_valid_target): Declare.
12243 (parameters_clear_target): Declare.
12244 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
12245 as NULL if we aren't searching.
12246 (Add_symbols::run): Don't check for compatible target.
12247 * fileread.cc (Input_file::open_binary): Call
12248 parameters_force_valid_target.
12249 * gold.cc (queue_middle_tasks): Likewise.
12250 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
12251 set_target on object.
12252 * dynobj.h (class Sized_dynobj): Update declarations.
12253 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
12254 make_elf_object returns NULL.
12255 (Archive::include_member): Don't check whether object target is
12256 compatible.
12257 * output.cc (Output_section::add_input_section): Get target from
12258 parameters.
12259 (Output_section::relax_input_section): Likewise.
12260 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
12261 parameters.
12262 (Sized_relobj::do_scan_relocs): Likewise.
12263 (Sized_relobj::relocate_sections): Likewise.
12264 * resolve.cc (Symbol_table::resolve): Likewise.
12265 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
12266 parameter. Change all callers.
12267 (Symbol_table::add_from_object): Get target from parameters.
12268 (Symbol_table::add_from_relobj): Don't check object target.
12269 (Symbol_table::add_from_dynobj): Likewise.
12270 (Symbol_table::define_special_symbol): Get target from
12271 parameters.
12272 * symtab.h (class Symbol_table): Update declaration.
12273 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
12274 parameter. Change all callers. Clear parameter target.
12275 (Binary_test): Test target here.
12276 * testsuite/object_unittest.cc (gold_testsuite): Remove
12277 target_test_pointer parameter. Change all callers.
12278 (Object_test): Test target here.
12279
a6a22b83
ILT
122802009-09-26 Ian Lance Taylor <iant@google.com>
12281
12282 * testsuite/initpri1.c: Don't try to use constructor priorities if
12283 compiling with gcc before 4.3.
12284
6a8f49fe
ILT
122852009-09-22 Mikolaj Zalewski <mikolajz@google.com>
12286
12287 * testsuite/retain_symbols_file_test.sh (check_present): Change
12288 output file name to retain_symbols_file_test.stdout.
12289 (check_absent): Likewise.
12290
8c604651
CS
122912009-09-18 Craig Silverstein <csilvers@google.com>
12292
12293 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
12294 * options.cc: Include <cerrno> and <fstream>.
12295 (General_options::finalize): Parse -retain-symbols-file tag.
12296 * options.h: New flag.
12297 (General_options): New method should_retain_symbol, new
12298 variable symbols_to_retain.
12299 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
12300 should_retain_symbol map.
12301 * testsuite/Makefile.am (retain_symbols_file_test): New test.
12302 * testsuite/Makefile.in: Regenerate.
12303 * testsuite/retain_symbols_file_test.sh: New file.
12304
ca58b19f
NC
123052009-09-18 Nick Clifton <nickc@redhat.com>
12306
12307 * po/es.po: Updated Spanish translation.
12308
20e6d0d6
DK
123092009-09-17 Doug Kwan <dougkwan@google.com>
12310
12311 * debug.h (DEBUG_RELAXATION): New constant.
12312 (DEBUG_ALL): Add DEBUG_RELAXATION.
12313 (debug_string_to_enum): Add relaxation debug option.
12314 * layout.cc
12315 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
12316 Layout::Relaxation_debug_check::read_sections,
12317 Layout::Relaxation_debug_check::read_sections): New method definitions.
12318 (Layout::Layout): Initialize data members
12319 record_output_section_data_from_scrips_,
12320 script_output_section_data_list_ and relaxation_debug_check_.
12321 (Layout::save_segments, Layout::restore_segments,
12322 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12323 Layout::relaxation_loop_body): New method definitions.
12324 (Layout::finalize): Support relaxation. Move section layout code to
12325 Layout::relaxation_loop_body.
12326 (Layout::set_asection_address_from_script): Move code for orphan
12327 section placement out.
12328 (Layout::place_orphan_sections_in_script): New method definition.
12329 * layout.h (Output_segment_headers, Output_file_header):
12330 New forward class declarations.
12331 (Layout::~Layout): Define.
12332 (Layout::new_output_section_data_from_script): New method definition.
12333 (Layout::place_orphan_sections_in_script): New method declaration.
12334 (Layout::Segment_states): New type declaration.
12335 (Layout::save_segments, Layout::restore_segments,
12336 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
12337 Layout::relaxation_loop_body): New method declarations.
12338 (Layout::Output_section_data_list): New type declaration.
12339 (Layout::Relaxation_debug_check): New class definition.
12340 (Layout::record_output_section_data_from_script_,
12341 Layout::script_output_section_data_list_, Layout::segment_states_,
12342 Layout::relaxation_debug_check_): New data members.
12343 * output.cc: (Output_section_headers::do_size): New method definition.
12344 (Output_section_headers::Output_section_headers): Move size
12345 computation to Output_section_headers::do_size.
12346 (Output_segment_headers::do_size): New method definition.
e1df38aa 12347 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
12348 Output_file_header::do_size and call it.
12349 (Output_file_header::do_size): New method definition.
12350 (Output_data_group::Output_data_group): Adjust call to
12351 Output_section_data.
12352 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
12353 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 12354 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
12355 RELAXED_INPUT_SECTION_CODE.
12356 (Output_section::Output_section): Initialize data member checkpoint_.
12357 (Output_section::~Output_section): Delete checkpoint object pointed
12358 by checkpoint_.
12359 (Output_section::add_input_section): Always add an Input_section if
12360 relaxing.
12361 (Output_section::add_merge_input_section): Add assert.
12362 (Output_section::relax_input_section): New method definition.
12363 (Output_section::set_final_data_size): Set load address to zero for
12364 an unallocated section.
12365 (Output_section::do_address_and_file_offset_have_reset_values):
12366 New method definition.
12367 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
12368 Handle relaxed input section.
12369 (Output_section::sort_attached_input_sections): Checkpoint input
12370 section list lazily.
12371 (Output_section::get_input_sections): Change type of input_sections to
12372 list of Simple_input_section pointers. Checkpoint input section list
12373 lazily. Also handle relaxed input sections.
12374 (Output_section::add_input_section_for_script): Take a reference to
12375 a Simple_input_section object instead of Relobj pointer and section
12376 index as parameter. Handle relaxed input sections.
12377 (Output_section::save_states, Output_section::restore_states): New
12378 method definitions.
12379 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
12380 (Output_data::is_data_size_fixed): New method definition.
12381 (Output_data::reset_addresss_and_file_offset): Do not reset data size
12382 if it is fixed.
12383 (Output_data::address_and_file_offset_have_reset_values): New method
12384 definition.
12385 (Output_data::do_address_and_file_offset_have_reset_values): New method
12386 definition.
12387 (Output_data::set_data_size): Check that data size is not fixed.
12388 (Output_data::fix_data_size): New method definition.
12389 (Output_data::is_data_size_fixed_): New data member.
12390 (Output_section_headers::set_final_data_size): New method definition.
12391 (Output_section_headers::do_size): New method declaration.
12392 (Output_segment_headers::set_final_data_size): New method definition.
12393 (Output_segment_headers::do_size): New method declaration.
12394 (Output_file_header::set_final_data_size)::New method definition.
12395 (Output_file_header::do_size)::New method declaration.
12396 (Output_section_data::Output_section_data): Add new parameter
12397 is_data_size_fixed and use it to fix data size.
12398 (Output_data_const::Output_data_const): Adjust call to base class
12399 constructor and fix data size.
12400 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
12401 base class constructor and fix data size.
12402 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
12403 base class constructor and fix data size.
12404 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
12405 class constructor and fix data size.
12406 (Output_data_group::set_final_data_size): New method definition.
12407 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
12408 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
12409 class constructor and fix data size.
12410 (Output_relaxed_input_section): New class definition.
12411 (Output_section::Simple_input_section): New class definition.
12412 (Output_section::get_input_sections): Adjust parameter list.
12413 (Output_section::add_input_section_for_script): Same.
12414 (Output_section::save_states, Output_section::restore_states,
12415 Output_section::do_address_and_file_offset_have_reset_values,
12416 (Output_section::Input_section::Input_section): Handle
12417 RELAXED_INPUT_SECTION_CODE. Add new overload for
12418 Output_relaxed_input_section.
12419 (Output_section::Input_section::is_input_section,
12420 Output_section::Input_section::set_output_section): Handle relaxed
12421 input section.
12422 (Output_section::Input_section::is_relaxed_input_section,
12423 Output_section::Input_section::output_section_data,
12424 Output_section::Input_section::relaxed_input_section): New method
12425 definitions.
12426 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
12427 value.
12428 (Output_section::Input_section::u1_): Update comments.
12429 (Output_section::Input_section::u2_): Add new union member poris.
12430 (Output_section::Checkpoint_output_section): New classs definition.
12431 (Output_section::relax_input_section): New method declaration.
12432 (Output_section::checkpoint_): New data member.
12433 (Output_segment): Update comments.
12434 (Output_segment::Output_segment): Un-privatize copy constructor.
12435 (Output_segment::operator=): Un-privatize.
12436 * script-sections.cc (Output_section_element::Input_section_list):
12437 Change element type to Output_section::Simple_input_section.
12438 (Output_section_element_dot_assignment::set_section_addresses):
12439 Register output section data for relaxation clean up.
12440 (Output_data_exression::Output_data_expression): Adjust call to base
12441 constructor to fix data size.
12442 (Output_section_element_data::set_section_addresses): Register
12443 Output_data_expression object for relaxation clean up.
12444 (struct Input_section_info): Replace Relobj pointer and section index
12445 pair with Output_section::Simple_input_section and Convert struct to a
12446 class.
12447 (Input_section_sorter::operator()): Adjust access to
e1df38aa 12448 Input_section_info data member to use accessors.
20e6d0d6
DK
12449 (Output_section_element_input::set_section_addresses): Use layout
12450 parameter. Adjust code to use Output_section::Simple_input_section
12451 and Input_secction_info classes. Register filler for relaxation
12452 clean up.
12453 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
12454 and section index pair with Output_section::Simple_input_section
12455 class. Adjust code accordingly.
12456 (Phdrs_element::release_segment): New method definition.
12457 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
12458 segment list.
12459 (Script_sections::release_segments): New method definition.
12460 * gold/script-sections.h (Script_sections::release_segments): New
12461 method declaration.
12462 * gold/target.h (Target::may_relax, Target::relax,
12463 Target::do_may_relax, Target::do_relax): New method definitions.
12464
5e445df6
ILT
124652009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
12466
12467 * arm.cc (has_signed_unsigned_overflow): New function.
12468 (Arm_relocate_functions::abs8): New function.
12469 (Target_arm::Scan::local): Handle R_ARM_ABS8.
12470 (Target_arm::Scan::global): Likewise.
12471 (Target_arm::relocate::relocate): Likewise.
12472 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12473 Likewise.
12474
8c604651 124752009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
12476
12477 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
12478 * testsuite/Makefile.in: Regenerate.
12479
1e9cc1c2
NC
124802009-09-11 Nick Clifton <nickc@redhat.com>
12481
12482 * po/gold.pot: Updated by the Translation project.
12483
6a89f575
CC
124842009-09-08 Cary Coutant <ccoutant@google.com>
12485
12486 * output.cc (Output_file::open): Add execute permission to empty file.
12487 * testsuite/Makefile.am (permission_test): New test.
12488 * testsuite/Makefile.in: Regenerate.
12489
fdcac5af
ILT
124902009-09-02 Ian Lance Taylor <iant@google.com>
12491
12492 * output.cc (Output_file::resize): Call map_no_anonymous rather
12493 than map.
12494
44453f85
ILT
124952009-09-01 Mikolaj Zalewski <mikolajz@google.com>
12496
12497 * gold.cc: Include "incremental.h".
12498 (queue_initial_tasks): Call Incremental_checker methods.
12499 * incremental.cc: Include "output.h".
12500 (Incremental_checker::can_incrementally_link_output_file): New
12501 method.
12502 * incremental.h (Incremental_checker): New class.
12503
12504 * output.cc (Output_file::open_for_modification): New method.
12505 (Output_file::map_anonymous): Changed return type to bool. Record
12506 map in base_ field.
12507 (Output_file::map_no_anonymous): New method, broken out of map.
12508 (Output_file::map): Use map_no_anonymous and map_anonymous.
12509 * output.h (class Output_file): Update declarations.
12510
293c1386
CC
125112009-08-24 Cary Coutant <ccoutant@google.com>
12512
12513 * options.h (Command_line::Pre_options): New class.
12514 (Command_line::pre_options): New member.
12515 * options.cc (gold::options::ready_to_register): New variable.
12516 (One_option::register_option): Do nothing if not registering options.
12517 Assert if same short option registered twice.
12518 (General_options::General_options): Turn off option registration when
12519 done constructing.
12520 (Command_line::Pre_options::Pre_options): New constructor.
12521
f773f3d2
CC
125222009-08-24 Cary Coutant <ccoutant@google.com>
12523
06a73cfe
CC
12524 * options.h (General_options::no_keep_memory): Remove incorrect
12525 short option.
f773f3d2 12526
a15af8e2
RW
125272009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12528
12529 * Makefile.am (am__skiplex, am__skipyacc): New.
12530 * Makefile.in: Regenerate.
12531
c462b41b
RW
125322009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
12533
14ec8efd
RW
12534 * Makefile.am (AM_CPPFLAGS): Renamed from ...
12535 (INCLUDES): ... this.
12536 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
12537 (AM_CPPFLAGS): Renamed from ...
12538 (INCLUDE): ... this.
12539 * Makefile.in, testsuite/Makefile.in: Regenerate.
12540
81ecdfbb
RW
12541 * Makefile.in: Regenerate.
12542 * aclocal.m4: Likewise.
12543 * config.in: Likewise.
12544 * configure: Likewise.
12545 * testsuite/Makefile.in: Likewise.
12546
c462b41b
RW
12547 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12548 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
12549 * Makefile.in: Regenerate.
12550 * testsuite/Makefile.in: Regenerate.
12551
2da73f13
CC
125522009-08-19 Cary Coutant <ccoutant@google.com>
12553
12554 * resolve.cc (Symbol_table::resolve): Don't complain about defined
12555 symbols in shared libraries overridden by hidden or internal symbols
12556 in the main program.
12557
2db70501
CD
125582009-08-19 Chris Demetriou <cgd@google.com>
12559
12560 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
12561 checking source file names in error messages.
12562
f733487b
DK
125632009-08-18 Doug Kwan <dougkwan@google.com>
12564
12565 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
12566 an elcpp::Ehdr as parameter. Adjust call to set_target.
12567 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
12568 an elfcpp::Ehdr as parameter.
12569 * object.cc (Object::set_target): Remove the version that looks up
12570 a target and sets it.
12571 (Sized_relobj::setup): Take a Target object instead of
12572 an elfcpp::Ehdr as parameter. Adjust call to set_target.
12573 (make_elf_sized_object): Find target and ask target to
12574 make an ELF object.
12575 * object.h: (Object::set_target): Remove the version that looks up
12576 a target and sets it.
12577 (Sized_relobj::setup): Take a Target object instead of
12578 an elfcpp:Ehdr as parameter.
12579 * target.cc: Include dynobj.h.
12580 (Target::do_make_elf_object_implementation): New.
2e702c99 12581 (Target::do_make_elf_object): New.
f733487b
DK
12582 * target.h (Target::make_elf_object): New template declaration.
12583 (Target::do_make_elf_object): New method declarations.
12584 (Target::do_make_elf_object_implementation): New template declaration.
12585
cc70f101
ILT
125862009-08-14 Ian Lance Taylor <iant@google.com>
12587
12588 * gold.h (FUNCTION_NAME): Define.
12589 (gold_unreachable): Use FUNCTION_NAME.
12590
ef5e0cb1
ST
125912009-08-12 Sriraman Tallam <tmsriram@google.com>
12592
12593 * icf.cc (Icf::find_identical_sections): Issue a warning when a
12594 symbol in the --keep-unique list is not found.
12595
48c187ce
ST
125962009-08-12 Sriraman Tallam <tmsriram@google.com>
12597
12598 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
12599 been maked as --keep-unique.
12600 (Icf::unfold_section): New function.
12601 * icf.h (Icf::unfold_section): New function.
12602 * options.h (General_options::keep_unique): New option.
12603 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
12604 * testsuite/Makefile.in: Regenerate.
12605 * testsuite/icf_keep_unique_test.sh: New file.
12606 * testsuite/icf_keep_unique_test.cc: New file.
12607
645afe0c
CC
126082009-08-12 Cary Coutant <ccoutant@google.com>
12609
12610 PR 10471
12611 * resolve.cc (Symbol_table::resolve): Check for references from
12612 dynamic objects to hidden and internal symbols.
12613 * testsuite/Makefile.am (hidden_test.sh): New test.
12614 * testsuite/Makefile.in: Regenerate.
12615 * testsuite/hidden_test.sh: New script.
12616 * testsuite/hidden_test_1.c: New test source.
12617 * testsuite/hidden_test_main.c: New test source.
12618
11af873f
DK
126192009-08-11 Doug Kwan <dougkwan@google.com>
12620
12621 * arm.cc: Update comments.
12622 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
12623 segment to locate the .ARM.exidx section if present.
12624
b9f7d72d
DK
126252009-08-09 Doug Kwan <dougkwan@google.com>
12626
12627 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
12628 patch.
12629
ddd3c53c
ST
126302009-08-07 Sriraman Tallam <tmsriram@google.com>
12631 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
12632 compiler warnings.
12633
27721062
ST
126342009-08-06 Sriraman Tallam <tmsriram@google.com>
12635
12636 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
12637 valid tls_segment only for non-debug-section relocations.
12638 * testsuite/Makefile.am: Add gc_tls_test.
12639 * testsuite/Makefile.in: Regenerate.
12640 * testsuite/gc_tls_test.cc: New file.
12641 * testsuite/gc_tls_test.sh: New file.
12642
ef15dade 126432009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 12644
ef15dade
ST
12645 * icf.cc: New file.
12646 * icf.h: New file.
12647 * Makefile.am (CCFILES): Add icf.cc.
12648 (HFILES): Add icf.h
12649 * Makefile.in: Regenerate.
12650 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
12651 * gc.h (gc_process_relocs): Populate lists used by icf to contain
12652 section, symbol and addend information for the relocs.
12653 * gold.cc (queue_middle_tasks): Call identical code folding.
12654 * gold.h: Add defines for multimap.
12655 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
12656 to the call of finalize_local_symbols.
12657 * main.cc (main): Create object of class Icf.
12658 * object.cc (Sized_relobj::do_layout): Allow this function to be
12659 called twice during icf.
12660 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
12661 to sections marked as identical by icf.
12662 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
12663 when available.
12664 (Sized_relobj::do_section_entsize): New function.
12665 * object.h (Object::section_entsize): New function.
12666 (Object::do_section_entsize): New pure virtual function.
12667 (Relobj::finalize_local_symbols): Add new parameter.
12668 (Relobj::do_section_entsize): New function.
12669 * options.h (General_options::icf): New option.
12670 (General_options::icf_iterations): New option.
12671 (General_options::print_icf_sections): New option.
12672 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
12673 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
12674 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
12675 icf.
12676 * symtab.cc (Symbol_table::is_section_folded): New function.
12677 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
12678 to sections marked as identical by icf.
12679 * symtab.h (Symbol_table::set_icf): New function.
12680 (Symbol_table::icf): New function.
12681 (Symbol_table::is_section_folded): New function.
12682 (Symbol_table::icf_): New data member.
12683 * target-reloc.h (relocate_section): Ignore sections folded by icf.
12684 * testsuite/Makefile.am: Add commands to build icf_test.
12685 * testsuite/Makefile.in: Regenerate.
12686 * testsuite/icf_test.sh: New file.
12687 * testsuite/icf_test.cc: New file.
12688
c3b65ac4
CD
126892009-07-24 Chris Demetriou <cgd@google.com>
12690
12691 * layout.cc (is_compressible_debug_section): Fix incorrect
12692 comment about compressed section names.
12693
1caf2c51
ILT
126942009-07-20 Ian Lance Taylor <ian@airs.com>
12695
12696 PR 10419
12697 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
12698
1ef4d87f
ILT
126992009-07-16 Ian Lance Taylor <iant@google.com>
12700
12701 PR 10400
12702 * layout.h: #include <map>.
12703 (class Kept_section): Change from struct to class. Add accessors
12704 and setters. Add section size to Comdat_group mapping. Change
12705 Comdat_group to std::map. Add is_comdat_ field. Add
12706 linkonce_size field in union.
12707 (class Layout): Update declaration of find_or_add_kept_section.
12708 Don't declare find_kept_object.
12709 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
12710 parameter. Add object, shndx, is_comdat, and is_group_name
12711 parameters. Change all callers. Adjust for new Kept_section.
12712 (Layout::find_kept_object): Remove.
12713 * object.cc (Sized_relobj::include_section_group): Update use of
12714 Kept_section. Rename secnum to shndx. Only record
12715 Kept_comdat_section if sections are the same size.
12716 (Sized_relobj::include_linkonce_section): Update use of
12717 Kept_section. Only record Kept_comdat_section if sections are the
12718 same size. Set size of linkonce section.
12719 (Sized_relobj::map_to_kept_section): Update call to
12720 get_kept_comdat_section.
12721 * object.h (class Sized_relobj): Rename fields in
12722 Kept_comdat_section to drop trailing underscores; change object
12723 field to Relobj*. Change Kept_comdat_section_table to store
12724 struct rather than pointer.
12725 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
12726 Add kept_object and kept_shndx parameters. Change all callers.
12727 (Sized_relobj::get_kept_comdat_section): Change return type to
12728 bool. Add kept_object and kept_shndx parameters. Change all
12729 callers.
12730 * plugin.cc (Pluginobj::include_comdat_group): Update call to
12731 Layout::find_or_add_kept_section.
12732
37c3b7b0
ILT
127332009-07-09 Ian Lance Taylor <iant@google.com>
12734
12735 * merge.cc (Object_merge_map::initialize_input_to_output_map):
12736 Reserve space in the hash table.
12737
98fa85cb
ILT
127382009-07-06 Mikolaj Zalewski <mikolajz@google.com>
12739
12740 * fileread.cc (File_read::get_mtime): New method.
12741 * fileread.h (Timespec): New structure.
12742 (File_read::get_mtime): New method.
12743 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
12744 Renamed from timestamp_nsec.
12745 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
12746 Elf_Xword.
e1df38aa 12747 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 12748 timestamp_nsec.
e1df38aa 12749 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
12750 (Incremental_inputs::report_obejct): Save mtime; style fix.
12751 (Incremental_inputs::report_script): Save mtime; style fix.
12752 (Incremental_inputs::finalize_inputs): Style fix.
12753 (Incremental_inputs::finalize): Style fix.
12754 (Incremental_inputs::create_input_section_data): Store inputs
12755 mtime.
12756 * incremental.h (Incremental_inputs::report_script): Add mtime
12757 argument.
12758 (Incremental_inputs::Input_info::Input_info): Intialize only one
12759 union member.
12760 (Incremental_inputs::Input_info::archive): Move to nameless
12761 union.
12762 (Incremental_inputs::Input_info::obejct): Move to nameless union.
12763 (Incremental_inputs::Input_info::script): Move to nameless union.
12764 (Incremental_inputs::mtime): New field.
12765 * script.cc (read_input_script): Pass file mtime to
12766 Incremental_input.
12767 * script.h (Script_info::inputs): Style fix.
12768
c9d70757
ILT
127692009-07-01 Ian Lance Taylor <ian@airs.com>
12770
12771 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
12772 instead of 32.
12773
9c547ec3
ILT
127742009-06-24 Ian Lance Taylor <iant@google.com>
12775
12776 PR 10156
12777 * layout.cc (Layout::choose_output_section): If we find an
12778 existing section, update the flags.
12779 (Layout::create_notes): New function, broken out of
12780 Layout::finalize.
12781 (Layout::finalize): Don't create note sections.
12782 (Layout::create_note): Don't crash if linker script discards
12783 section.
12784 (Layout::create_gold_note): Likewise.
12785 (Layout::create_build_id): Likewise. Don't set
12786 after_input_sections on the section.
12787 (Layout::create_executable_stack_info): Remove target parameter.
12788 Change caller.
12789 * layout.h (class Layout): Declare create_notes. Update
12790 declaration of create_executable_stack_info.
12791 * gold.cc (queue_middle_tasks): Call create_notes.
12792 * output.cc (Output_section::update_flags_for_input_section): Move
12793 here from output.h. If SHF_ALLOC flag is newly set, mark address
12794 invalid.
12795 * output.h (Output_data::mark_address_invalid): New function.
12796 (class Output_section): Only declare, not define,
12797 update_flags_for_input_section. Remove set_flags.
12798
55458500
ILT
127992009-06-24 Ian Lance Taylor <iant@google.com>
12800
12801 * script-sections.cc (Output_section_definition::
12802 set_section_addresses): Rename shadowing local load_address to
12803 laddr.
12804
1307d6cd
ILT
128052009-06-24 Ian Lance Taylor <iant@google.com>
12806
12807 PR 10244
12808 * reloc.cc (relocate_sections): Skip empty relocation sections.
12809
ec3f783e
ILT
128102009-06-23 Ian Lance Taylor <iant@google.com>
12811
12812 PR 10156
12813 * layout.cc (Layout::create_note): Use choose_output_section
12814 rather than make_output_section.
12815
459c9f1c
ILT
128162009-06-23 Ian Lance Taylor <iant@google.com>
12817
12818 PR 10237
12819 * options.cc (General_options::parse_V): Set printed_version_.
12820 (General_options::General_options): Initialize printed_version_.
12821 * options.h (class General_options): Add printed_version_ field.
12822 * gold.cc (queue_initial_tasks): If there are no input files,
12823 don't give a fatal error if we printed the version information.
12824 (queue_middle_tasks): If using -r with a shared object, give a
12825 fatal error rather than an ordinary error.
12826
1518dc8f
ILT
128272009-06-23 Ian Lance Taylor <iant@google.com>
12828
12829 PR 10219
12830 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
12831 (Layout::make_output_section): Set have_stabstr_section_ if we see
12832 a .stab*str section.
12833 (Layout::finalize): Call link_stabs_sections.
12834 (Layout::link_stabs_sections): New file.
12835 * layout.h (class Layout): Add have_stabstr_section_ field.
12836 Declare link_stabs_sections.
12837
3d857b98
DK
128382009-06-23 Doug Kwan <dougkwan@google.com>
12839
12840 * Makefile.am (libgold_a_LIBADD): New.
12841 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 12842 * Makefile.in: Regenerate.
3d857b98
DK
12843 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
12844 * configure: Regenerate.
12845 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
12846 * fileread.cc: Include sys/state.h
12847 * gold.h: Declare memmem and strndup if found missing.
12848 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
12849
0639a6f6
ILT
128502009-06-23 Ian Lance Taylor <iant@google.com>
12851
12852 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
12853 * configure: Rebuild.
12854
8d63875c
ILT
128552009-06-23 Ian Lance Taylor <iant@google.com>
12856
12857 PR 10147
12858 * object.cc (Object::section_contents): Don't try to get a view if
12859 the section has length zero.
12860 (Object::handle_gnu_warning_section): If the section is empty, use
12861 the name of the section as the warning.
12862
f7c8a183
ILT
128632009-06-23 Ian Lance Taylor <iant@google.com>
12864
12865 PR 10133
12866 * stringpool.h (class Stringpool_template): Add optimize_ field.
12867 (Stringpool_template::set_optimize): New function.
12868 * stringpool.cc (Stringpool_template::Stringpool_template):
12869 Initialize optimize_ field.
12870 (Stringpool_template::set_string_offsets): Test local optimize
12871 fild rather than parameter.
12872 * layout.cc (Layout::Layout): Call set_optimize on the section
12873 name stringpool.
12874
e6a307ba
ILT
128752009-06-22 Ian Lance Taylor <iant@google.com>
12876
12877 PR 10030
12878 * yyscript.y: Parse TARGET.
12879 * script.cc (script_set_target): New function.
12880 * script-c.h (script_set_target): Declare.
12881 * options.cc (General_options::string_to_object_format): Rename
12882 from string_to_object_format in anonymous namespace. Change
12883 callers.
12884 * options.h (class General_options): Declare
12885 string_to_object_format.
12886
3ee173de
ILT
128872009-06-22 Ian Lance Taylor <iant@google.com>
12888
12889 * script-sections.cc (Script_sections::create_segments): Don't put
12890 program headers in a PT_LOAD segment if -n or -N.
12891
128922009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
12893
12894 PR 10141
12895 * options.h (class General_options): Add -z lazy and -z now. Sort
12896 -z options into alphabetical order.
12897 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
12898
cd6739a1 128992009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
12900
12901 * layout.cc (Layout::make_output_section): Call
12902 Target::new_output_section.
12903 (Layout::attach_allocated_section_to_segment): Put large section
12904 sections in a separate load segment with the large segment flag
12905 set.
12906 (Layout::segment_precedes): Sort large data segments after other
12907 load segments.
12908 (align_file_offset): New static function.
12909 (Layout::set_segment_offsets): Use align_file_offset.
12910 * output.h (class Output_section): Add is_small_section_ and
12911 is_large_section_ fields.
12912 (Output_section::is_small_section): New function.
12913 (Output_section::set_is_small_section): New function.
12914 (Output_section::is_large_section): New function.
12915 (Output_section::set_is_large_section): New function.
12916 (Output_section::is_large_data_section): New function.
12917 (class Output_segment): Add is_large_data_segment_ field.
12918 (Output_segment::is_large_data_segment): New function.
12919 (Output_segment::set_is_large_data_segment): New function.
12920 * output.cc (Output_section::Output_section): Initialize new
12921 fields.
12922 (Output_segment::Output_segment): Likewise.
12923 (Output_segment::add_output_section): Add assertion that large
12924 data sections always go in large data segments. Force small data
12925 sections to the end of the list of data sections. Force small BSS
12926 sections to the start of the list of BSS sections. For large BSS
12927 sections to the end of the list of BSS sections.
12928 * symtab.h (class Symbol): Declare is_common_shndx.
12929 (Symbol::is_defined): Check Symbol::is_common_shndx.
12930 (Symbol::is_common): Likewise.
12931 (class Symbol_table): Define enum Commons_section_type. Update
12932 declarations. Add small_commons_ and large_commons_ fields.
12933 * symtab.cc (Symbol::is_common_shndx): New function.
12934 (Symbol_table::Symbol_table): Initialize new fields.
12935 (Symbol_table::add_from_object): Put small and large common
12936 symbols in the right list.
12937 (Symbol_table::sized_finalized_symbol): Check
12938 Symbol::is_common_shndx.
12939 (Symbol_table::sized_write_globals): Likewise.
12940 * common.cc (Symbol_table::do_allocate_commons): Allocate new
12941 common symbol lists. Don't call do_allocate_commons_list if the
12942 list is empty.
12943 (Symbol_table::do_allocate_commons_list): Remove is_tls
12944 parameter. Add comons_section_type parameter. Change all
12945 callers. Handle small and large common symbols.
12946 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
12947 Symbol::is_common_shndx.
12948 * resolve.cc (symbol_to_bits): Likewise.
12949 * target.h (Target::small_common_shndx): New function.
12950 (Target::small_common_section_flags): New function.
12951 (Target::large_common_shndx): New function.
12952 (Target::large_common_section_flags): New function.
12953 (Target::new_output_section): New function.
12954 (Target::Target_info): Add small_common_shndx, large_common_shndx,
12955 small_common_section_flags, and large_common_section_flags
12956 fields.
12957 (Target::do_new_output_section): New virtual function.
12958 * arm.cc (Target_arm::arm_info): Initialize new fields.
12959 * i386.cc (Target_i386::i386_info): Likewise.
12960 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
12961 Likewise.
12962 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
12963 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12964 (Target_x86_64::do_new_output_section): New function.
12965 * configure.ac: Define conditional MCMODEL_MEDIUM.
12966 * testsuite/Makefile.am (check_PROGRAMS): Add large.
12967 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
12968 (large_LDFLAGS): Define.
12969 * testsuite/large.c: New file.
12970 * testsuite/testfile.cc (Target_test::test_target_info):
12971 Initialize new fields.
12972 * configure, testsuite/Makefile.in: Rebuild.
12973
bb04269c
DK
129742009-06-05 Doug Kwan <dougkwan@google.com>
12975
12976 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 12977 * Makefile.in: Regenerate.
bb04269c
DK
12978 * i386.cc (class Target_i386): Define new virtual method to
12979 override do_is_local_label_name in parent.
12980 * object.cc (Sized_relobj::do_count_local_symbols): Discard
12981 local symbols if --discard-locals or -X is given.
12982 * options.h (class General_options): Declare new options
12983 '--discard-locals' and '-X' for discarding locals.
12984 * target.h (class Target): Define new methods is_local_label_name.
12985 Declare new virtual method do_is_local_label_name.
12986 * target.cc: New file.
12987 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
12988 (check_SCRIPTS): Add discard_locals_test.sh.
12989 (check_DATA): Add discard_local_tests.syms.
12990 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
12991 (discard_local_tests.syms, discard_locals_test.o): New make rules.
12992 * testsuite/Makefile.in: Regenerate.
12993 * testsuite/discard_locals_test.c: New file.
12994 * testsuite/discard_locals_test.sh: Same.
12995
805bb01c
DK
129962009-06-05 Doug Kwan <dougkwan@google.com>
12997
12998 * object.cc (Sized_relobj::Sized_relobj): Initialize
12999 discarded_eh_frame_shndx_ to -1U.
13000 (Sized_relobj::do_layout): Record index of a discard .eh_frame
13001 section.
13002 (Sized_relobj::do_count_local_symbols): Skip local symbols in
13003 a discarded .eh_frame section.
13004 (Sized_relobj::do_finalize_local_symbols): Ditto.
13005 * object.h (class Sized_relobj): Declare new member
13006 discarded_eh_frame_shndx_.
13007 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13008 (local_labels_test.o, local_labels_test): New rules.
13009 * testsuite/Makefile.in: Regenerate.
13010
1dcd334d
DK
130112009-06-04 Doug Kwan <dougkwan@google.com>
13012
13013 * layout.cc (Layout::section_name_mapping): Add mapping for
13014 special ARM sections.
13015
96d49306
DK
130162009-06-03 Doug Kwan <dougkwan@google.com>
13017
13018 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
13019 (utils::has_overflow): Same.
13020
dff16297
ILT
130212009-06-03 Ian Lance Taylor <iant@google.com>
13022
13023 * layout.cc (Layout::section_name_mapping): New array, replacing
13024 Layout::linkonce_mapping.
13025 (Layout::section_name_mapping_count): New variable, replacing
13026 Layout::linkonce_mapping_count.
13027 (Layout::linkonce_output_name): Remove.
13028 (Layout::output_section_name): Rewrite.
13029 * layout.h (class Layout): Rename Linkonce_mapping to
13030 Section_name_mapping, linkonce_mapping to section_name_mapping,
13031 linkonce_mapping_count to section_name_mapping_count. Don't
13032 declare linkonce_output_name.
13033
c121c671
DK
130342009-06-03 Doug Kwan <dougkwan@google.com>
13035
13036 * gold/arm.cc (namespace utils): New.
13037 (Target_arm::reloc_is_non_pic): Define new method.
13038 (class Arm_relocate_functions): New.
13039 (Target_arm::Relocate::relocate): Handle relocation types used by
13040 Android.
13041
07800fab
ILT
130422009-06-03 Ian Lance Taylor <iant@google.com>
13043
13044 * arm.cc (Target_arm::scan::global): Use || instead of |.
13045
c121c671
DK
130462009-06-02 Doug Kwan <dougkwan@google.com>
13047
13048 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
13049 issued_non_pic_error_.
13050 (class Target_arm::Scan): Declare new method check_non_pic.
13051 Define new method symbol_needs_plt_entry.
13052 Declare new data member issued_non_pic_error_.
13053 (class Target_arm::Relocate): Declare new method
13054 should_apply_static_reloc.
13055 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
13056 (Target_arm::Scan::check_non_pic): Define new method.
13057 (Target_arm::Scan::local): Handle a small subset of reloc types used
13058 by Android.
13059 (Target_arm::Scan::local): Same.
13060 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
13061
b19b0c6d
ILT
130622009-05-31 Mikolaj Zalewski <mikolajz@google.com>
13063
13064 * incremental.cc (Incremental_inputs::report_command_line): Filter
13065 out --incremental-* options.
13066
94cdfcff
DK
130672009-05-29 Doug Kwan <dougkwan@google.com>
13068
13069 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
13070 template class.
13071 (class Target_arm): Update comment.
13072 (Target_arm::Target_arm): Initialize new data members GOT_,
13073 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
13074 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
13075 and Target_arm::rel_dyn_section.
13076 Declare new_enum Target_arm::Got_type.
13077 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
13078 and DYNBSS_.
13079 Update commments for member do_dynsym_value.
13080 (Target_arm::got_size, Target_arm::plt_section,
13081 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
13082 new methods inside class defintion.
13083 (Target_arm::got_section): Define new method.
13084 (Target_arm::rel_dyn_section): Same.
13085 (Output_data_plt_arm): New template class.
13086 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
13087 (Output_data_plt_arm:do_adjust_output_section): Define new method.
13088 (Output_data_plt_arm::add_entry): Same.
13089 (Output_data_plt_arm::first_plt_entry): Define new
13090 static data member for PLT instruction template.
13091 (Output_data_plt_arm::plt_entry): Same.
13092 (Output_data_plt_arm::do_write): Define new method.
13093 (Target_arm::make_plt_entry): Same.
13094 (Target_arm::do_finalize_sections): Same.
13095 (Target_arm::do_dynsym_value): Same.
13096
4a657b0d
DK
130972009-05-28 Doug Kwan <dougkwan@google.com>
13098
13099 * Makefile.am (TARGETSOURCES): Add arm.cc.
13100 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
13101 * Makefile.in: Regenerate.
13102 * arm.cc: New file.
13103 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
13104
e7ae8c36
DK
131052009-05-26 Doug Kwan <dougkwan@google.com>
13106
13107 * options.cc (General_options::parse_exclude_libs). Fix a comment.
13108 (General_options::check_excluded_libs): Strip off directories in
13109 archive name before matching like GNU ld does.
13110 * testsuite/Makefile.am (MOSTLYCLEANFILES,
13111 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
13112 (exclude_libs_test_LDFLAGS): Add linker option
13113 -Wl,--exclude-libs,libexclude_libs_test_3
13114 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
13115 an explicit archive without using -l.
13116 (alt/libexclude_libs_test_3.a): New make rule.
13117 * testsuite/Makefile.in: Regenerate.
13118 * testsuite/exclude_libs_test.c : Declare lib3_default().
13119 (main): Call it.
13120 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
13121 * exclude_libs_test_3.c: New file.
13122
f12e7348
NC
131232009-05-26 Nick Clifton <nickc@redhat.com>
13124
13125 * po/id.po: New Indonesian translation.
13126 * po/gold.pot: Updated template file.
13127
4daadc0d
ST
131282009-05-22 Sriraman Tallam <tmsriram@google.com>
13129
e1df38aa 13130 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
13131 gc_comdat_test files. Add -Wl,--gc-sections to build
13132 gc_comdat_test.
13133 * testsuite/Makefile.in: Regenerate.
13134 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
13135
531813ad
ST
131362009-05-21 Sriraman Tallam <tmsriram@google.com>
13137
13138 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
13139 kept comdat section was garbage collected.
13140 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
13141 * testsuite/Makefile.in: Regenerate.
13142 * testsuite/gc_comdat_test.sh: New file.
13143 * testsuite/gc_comdat_test_1.cc: New file.
13144 * testsuite/gc_comdat_test_2.cc: New file.
13145
65514900
CC
131462009-05-19 Doug Kwan <dougkwan@google.com>
13147
13148 * archive.cc (Archive::Archive): Move constructor from archive.h
13149 to here. Initialize no_export_.
13150 (Archive::get_elf_object_for_member): Set no_export flag of object.
13151 * archive.h (Archive::Archive): Move constructor body to
13152 archive.cc.
13153 (Archive::no_export): New method.
13154 (Archive::no_export_): New field.
13155 * object.h (Object::Object): Initialize no_export_ to false.
13156 (Object::no_export, Object::set_no_export): New methods.
13157 (Object::no_export_): New field.
13158 * options.cc (General_options::parse_exclude_libs): New method.
13159 (General_options::check_excluded_libs) Same.
13160 * options.h (exclude_libs): New option.
13161 (General_options::check_excluded_libs): New method declaration.
13162 (General_options::excluded_libs_): New field.
13163 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
13164 default or protected visibility if an object has no-export flag set.
13165 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
13166 (check_SCRIPTS): Add exclude_libs_test.sh.
13167 (check_DATA): Add exclude_libs_test.syms.
13168 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
13169 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
13170 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
13171 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
13172 (exclude_libs_test.syms, libexclude_libs_test_1.a,
13173 libexclude_libs_test_2.a): New rules.
13174 * testsuite/Makefile.in: Regenerate.
13175 * testsuite/exclude_libs_test.c: New file.
13176 * testsuite/exclude_libs_test.sh: Ditto.
13177 * testsuite/exclude_libs_test_1.c: Ditto.
13178 * testsuite/exclude_libs_test_2.c: Ditto.
13179
1b77ea50
ILT
131802009-05-15 Ian Lance Taylor <iant@google.com>
13181
13182 * configure.ac: Check for declarations for cases where libiberty.h
13183 checks HAVE_DECL_xxx.
13184 * configure, config.in: Rebuild.
13185
072fe7ce
ILT
131862009-05-15 Mikolaj Zalewski <mikolajz@google.com>
13187
13188 * gold.h (Incremental_argument_list): Remove (invalid) forward
13189 declaration.
13190 * incremental.cc (Incremental_inputs::report_achive): New method.
13191 (Incremental_inputs::report_object): New method.
13192 (Incremental_inputs::report_script): New method.
13193 (Incremental_inputs::finalize_inputs): New method.
13194 (Incremental_inputs::finalize): Call finalize_inputs().
13195 (Incremental_inputs::sized_create_incremental_inputs_section_data):
13196 Create inputs entries.
13197 * incremental.h (Incremental_input_type): New enum.
13198 (Incremental_inputs::Incremental_input): Initialize new fields.
13199 (Incremental_inputs::report_inputs): New method.
13200 (Incremental_inputs::report_achive): New method.
13201 (Incremental_inputs::report_object): New method.
13202 (Incremental_inputs::report_script): New method.
13203 (Incremental_inputs::finalize_inputs): New method.
13204 (Incremental_inputs::Input_info): New struct.
13205 (Incremental_inputs::Input_info_map): New typedef.
13206 (Incremental_inputs::lock_): New field.
13207 (Incremental_inputs::Inputs_): New field.
13208 (Incremental_inputs::Inputs_map): New field.
13209 * main.cc (main): Call Incremental_input::report_inputs.
13210 * options.h (Input_argument_list): Typedef moved from
13211 Input_arguments.
13212 (Input_file_group::Files): Remove, use ::Input_argument_list.
13213 (Input_file_group::Input_argument_list): Remove, use
13214 ::Input_argument_list.
13215 * plugin.cc (Plugin_manager::add_input_file): Add error in
13216 incremental build.
13217 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
13218 functions.
13219 * script.cc (read_input_script): Call
13220 Incremental_input::report_script.
13221 * script.h (Script_info): New class.
13222
b0481b0b
ILT
132232009-04-27 Ian Lance Taylor <iant@google.com>
13224
13225 * x86_64.cc (do_adjust_output_section): Set entsize to
13226 plt_entry_size.
13227
b22a5a41 132282009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
13229
13230 * output.cc (Output_file::close): After short writes, continue
13231 writing from the correct offset in the buffer being written.
13232
40fde488
CD
132332009-04-23 Chris Demetriou <cgd@google.com>
13234
13235 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
13236 * configure: Regenerate.
13237 * config.in: Regenerate.
13238 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
13239 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
13240
3ce2c28e
ILT
132412009-04-21 Mikolaj Zalewski <mikolajz@google.com>
13242
13243 * incremental.cc (Incremental_inputs_header_data): Renamed from
13244 Incremental_input_header_data.
13245 (Incremental_inputs_header_data::data_size): New field.
13246 (Incremental_inputs_header_data::put_input_file_count): Renamed
13247 from input_file_count.
13248 (Incremental_inputs_header_data::put_command_line_offset): Renamed
13249 from command_line_offset.
13250 (Incremental_inputs_header_data::put_reserved): Renamed from
13251 put_reserved.
13252 (Incremental_inputs_entry_data): Renamed from
13253 Incremental_input_entry_data.
13254 (Incremental_inputs_entry_data::data_size): New field.
13255 (Incremental_inputs::report_command_line): New method.
13256 (Incremental_inputs::finalize): New method.
13257 (Incremental_inputs::create_incremental_inputs_data): New method.
13258 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
13259 * incremental.h: New file.
13260 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 13261 (Layout::finalize): Create incremental inputs section in
3ce2c28e 13262 incremental builds.
703d02da 13263 (Layout::create_incremental_info_sections): New method.
3ce2c28e 13264 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
13265 (Layout::create_incremental_info_sections): New method.
13266 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
13267 * main.cc (main): Notify Incremental_input of the command line.
13268
e55bde5e
ILT
132692009-04-01 Ian Lance Taylor <iant@google.com>
13270 Mikolaj Zalewski <mikolajz@google.com>
13271
13272 * gold.h (reserve_unordered_map): Define, three versions, one for
13273 each version of Unordered_map.
13274 * layout.cc (Layout::Layout): Remove options parameter. Add
13275 number_of_input_files parameter. Don't initialize options_.
13276 Initialize number_of_input_files_ and resized_signatures_. Move
13277 sections_are_attached_.
13278 (Layout::layout_group): Reserve space for group_signatures_.
13279 (Layout::find_or_add_kept_section): Change name parameter to be a
13280 reference. Resize signatures_ map when it gets large enough.
13281 (Layout::layout_eh_frame): Use parameters->options() instead of
13282 this->options_.
13283 (Layout::make_output_section): Likewise.
13284 (Layout::attach_allocated_section_to_segment): Likewise.
13285 (Layout::finalize, Layout::create_executable_stack): Likewise.
13286 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
13287 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
13288 * layout.h (class Layout): Update declarations. Remove options_
13289 field. Add number_of_input_files_ and resized_signatures_
13290 fields. Move sections_are_attached_ field.
13291 * main.cc (main): Pass number of input files to Layout
13292 constructor. Don't pass options.
13293
154b857c
ILT
132942009-03-30 Ian Lance Taylor <iant@google.com>
13295
13296 * ffsll.c (ffsll): Correct implementation.
13297
2f35ab9b
ILT
132982009-03-27 Ian Lance Taylor <iant@google.com>
13299
fd03461a
ILT
13300 * ffsll.c: New file.
13301 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
13302 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
13303 * ftruncate.c (ftruncate): Declare before definition.
13304 * mremap.c (mremap): Likewise.
13305 * pread.c (pread): Likewise.
13306 * configure, Makefile.in, config.in: Rebuild.
13307
2f35ab9b
ILT
13308 * mremap.c: New file.
13309 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
13310 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
13311 (mremap): Declare if HAVE_MREMAP is not defined.
13312 * configure, Makefile.in, config.in: Rebuild.
13313
33aea2fd
CC
133142009-03-27 Cary Coutant <ccoutant@google.com>
13315
13316 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
13317 position independent.
13318 * sparc.cc (Target_sparc::check_non_pic): Likewise.
13319 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
13320
6d479619
CC
133212009-03-24 Cary Coutant <ccoutant@google.com>
13322
13323 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
13324 an executable.
13325 (needs_dynamic_reloc): Likewise.
13326
afc06bb8
ILT
133272009-03-24 Ian Lance Taylor <iant@google.com>
13328
13329 * yyscript.y (file_cmd): Recognize EXTERN.
13330 (extern_name_list, extern_name_list_body): New nonterminals.
13331 * script.cc (script_add_extern): Define.
13332 * script-c.h (script_add_extern): Declare.
13333
f6060a4d
ILT
133342009-03-24 Rafael Avila de Espindola <espindola@google.com>
13335
13336 * object.cc (is_elf_object): Define.
13337 * object.h (is_elf_object): Declare.
13338 * archive.cc (Archive::get_elf_object_for_member): Call
13339 is_elf_object.
33aea2fd 13340 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 13341
26736d8e
ILT
133422009-03-24 Elliott Hughes <enh@google.com>
13343
13344 * output.cc (Output_file::map_anonymous): Define.
13345 (Output_file::map): Use map_anonymous. If the regular mmap fails,
13346 try an anonymous one. Report the size if the mmap fails.
13347 * output.h (class Output_file): Declare map_anonymous.
13348
22fd9730
ILT
133492009-03-24 Ian Lance Taylor <iant@google.com>
13350
13351 * target-select.cc (instantiate_target): Don't acquire the lock if
13352 the instantiated_target_ field has already been set.
13353
cb010894
ILT
133542009-03-23 Ian Lance Taylor <iant@google.com>
13355
7f055c20
ILT
13356 * gold-threads.h (class Initialize_lock): Define.
13357 * gold-threads.cc (class Initialize_lock_once): Define.
13358 (initialize_lock_control): New static variable.
13359 (initialize_lock_pointer): New static variable.
13360 (initialize_lock_once): New static function.
13361 (Initialize_lock::Initialize_lock): Define.
13362 (Initialize_lock::initialize): Define.
13363 * target-select.h: Include "gold-threads.h".
13364 (class Target_selector): Add lock_ and initialize_lock_ fields.
13365 Don't define instantiate_target, just declare it.
13366 * target-select.cc (Target_selector::Target_selector): Initialize
13367 new fields.
13368 (Target_selector::instantiate_target): Define.
13369 * descriptors.h: Include "gold-threads.h".
13370 (class Descriptors): Add initialize_lock_ field.
13371 * descriptors.cc (Descriptors::Descriptors): Initialize new
13372 field.
13373 (Descriptors::open): Use initialize_lock_ field
13374 * errors.h (class Errors): Add initialize_lock_ field.
13375 * errors.cc (Errors::Errors): Initialize new field.
13376 (Errors::initialize_lock): Use initialize_lock_ field.
13377 * powerpc.cc (class Target_selector_powerpc): Remove
13378 instantiated_target_ field. In do_recognize call
13379 instantiate_target rather than do_instantiate_target. In
13380 do_instantiate_target just allocate a new target.
13381 * sparc.cc (class Target_selector_sparc): Likewise.
13382
36959681
ILT
13383 * freebsd.h: New file.
13384 * i386.cc: Include "freebsd.h".
13385 (Target_i386): Derive from Target_freebsd rather than
13386 Sized_target.
13387 (Target_selector_i386): Derive from Target_selector_freebsd rather
13388 than Target_selector.
13389 * x86_64.cc: Include "freebsd.h".
13390 (Target_x86_64): Derive from Target_freebsd rather than
13391 Sized_target.
13392 (Target_selector_x86_64): Derive from Target_selector_freebsd
13393 rather than Target_selector.
13394 * target.h (class Target): Add adjust_elf_header and
13395 do_adjust_elf_header.
13396 * output.cc (Output_file_header:: do_sized_write): Call target
13397 adjust_elf_header routine.
13398 * configure.tgt: Set targ_osabi.
13399 * configure.ac: Define GOLD_DEFAULT_OSABI.
13400 * parameters.cc (Parameters::default_target): Pass
13401 GOLD_DEFAULT_OSABI to select_target.
13402 * target-select.h (class Target_selector): Make instantiate_target
13403 protected rather than private.
13404 * Makefile.am (HFILES): Add freebsd.h.
13405 * configure, Makefile.in, config.in: Rebuild.
13406
cb010894
ILT
13407 * merge.cc (do_add_input_section): Correct pend value. Change
13408 message about last entry not being null terminated from error to
13409 warning.
13410
0e879927
ILT
134112009-03-20 Mikolaj Zalewski <mikolajz@google.com>
13412
13413 * incremental.cc: New file.
13414 * Makefile.am (CCFILES): Add incremental.cc.
13415 * Makefile.in: Rebuild.
13416
41105937
PP
134172009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
13418
13419 * layout.cc (Layout::output_section_name): Preserve names
13420 of '.note.' sections.
e1df38aa 13421
60439920
ILT
134222009-03-19 Ian Lance Taylor <iant@google.com>
13423
13424 * descriptors.cc (Descriptors::open): Check that the options are
13425 valid before using them.
13426
0d371ad3
ILT
134272009-03-18 Ian Lance Taylor <iant@google.com>
13428
13429 * script-sections.h: Include <list>.
13430 (class Script_sections): Change Sections_elements from std::vector
13431 to std::list. Typedef public Elements_iterator. Add
13432 orphan_section_placement_, data_segment_align_start_, and
13433 saw_data_segment_align_ fields. Remove data_segment_align_index_
13434 field.
13435 * script-sections.cc (class Orphan_section_placement): New class.
13436 (class Sections_element): Add virtual functions is_relro and
13437 orphan_section_init. Remove virtual function place_orphan_here.
13438 (class Output_section_definition): Add is_relro and
13439 orphan_section_init. Remove place_orphan_here.
13440 (class Orphan_output_section): Likewise.
13441 (Script_sections::Script_sections): Update for field changes.
13442 (Script_sections::data_segment_align): Set saw_data_segment_align_
13443 and data_segment_align_start_, not data_segment_align_index.
13444 (Script_sections::data_segment_relro_end): Check
13445 saw_data_segment_align_. Use data_segment_align_start_ rather
13446 than data_segment_align_index_.
13447 (Script_sections::place_orphan): Rewrite to use
13448 Orphan_section_placement.
13449
9201d894
ILT
134502009-03-17 Ian Lance Taylor <iant@google.com>
13451
9c5b8369
ILT
13452 * archive.cc (Archive::add_symbols): Check for a version attached
13453 to the symbol name in the archive map.
13454 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
13455 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
13456 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
13457 (ver_test_11.a): New target.
13458 * testsuite/Makefile.in: Rebuild.
13459
9201d894
ILT
13460 * configure.ac: Check for chsize and posix_fallocate. Replace
13461 ftruncate.
13462 * ftruncate.c: New file, from gnulib.
13463 * output.cc (posix_fallocate): Define dummy version if not
13464 HAVE_POSIX_FALLOCATE.
13465 (Output_file::map): Call posix_fallocate rather than lseek and
13466 write.
13467 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
13468 * configure, Makefile.in, config.in: Rebuild.
13469
ef4ab7a8 134702009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 13471
ef4ab7a8
PP
13472 * layout.h (Layout::create_note): Add section_name parameter.
13473 * layout.cc (Layout::create_note): Likewise.
13474 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 13475
8c500701
ILT
134762009-03-17 Ian Lance Taylor <iant@google.com>
13477
e85b18e1
ILT
13478 * descriptors.cc: Include "options.h".
13479 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
13480 (Descriptors::open): Always use O_CLOEXEC when opening a new
13481 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
13482 then set FD_CLOEXEC.
13483
9efe6174
ILT
13484 * sparc.cc (class Target_sparc): Add has_got_section.
13485 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
13486 make sure we have a GOT section.
13487
13488 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
13489 (Target_sparc::Scan::local): Likewise.
13490 (Target_sparc::Scan::global): Likewise.
13491 (Target_sparc::Relocate::relocate): Likewise.
13492 (Target_sparc::Relocate::relocate_tls): Likewise.
13493
8c500701
ILT
13494 * symtab.cc (Symbol_table::define_default_version): New function,
13495 broken out of add_from_object.
13496 (Symbol_table::add_from_object): Call define_default_version.
13497 (Symbol_table::define_special_symbol): Add resolve_oldsym
13498 parameter. Change all callers. If the version for a symbol comes
13499 from a version script, resolve it with the symbol with the same
13500 name with no version. Also add the symbol without a version if
13501 appropriate.
13502 (do_define_in_output_data): If resolving with oldsym, don't delete
13503 sym.
13504 (do_define_in_output_segment): Likewise.
13505 (do_define_as_constant): Likewise.
13506 * symtab.h (class Symbol_table): Update declarations.
13507
f1ed28fb
ILT
135082009-03-13 Ian Lance Taylor <iant@google.com>
13509
15f8229b
ILT
13510 * readsyms.cc (Read_symbols::incompatible_warning): New function.
13511 (Read_symbols::requeue): New function.
13512 (Read_symbols::do_read_symbols): If make_elf_object fails because
13513 the target type is not configured, and the file was searched for,
13514 issue a warning and retry with the next directory.
13515 (Add_symbols::run): If the file has an incompatible format, and
13516 it was searched for, requeue the Read_symbols task. On error,
13517 release the object.
13518 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
13519 dirindex parameter to constructor. Change all callers. Declare
13520 incompatible_warning and requeue.
13521 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
13522 input_argument_ and input_group_ fields. Add them to
13523 constructor. Change all callers.
13524 (class Read_script): Add dirindex_ field. Add it to constructor.
13525 Change all callers.
13526 * archive.cc (Archive::setup): Remove input_objects parameter.
13527 Change all callers.
13528 (Archive::get_file_and_offset): Likewise.
13529 (Archive::read_all_symbols): Likewise.
13530 (Archive::read_symbols): Likewise.
13531 (Archive::get_elf_object_for_member): Remove input_objects
13532 parameter. Add punconfigured parameter. Change all callers.
13533 (Archive::add_symbols): Change return type to bool. Check return
13534 value of include_member.
13535 (Archive::include_all_members): Likewise.
13536 (Archive::include_member): Change return type to bool. Return
13537 false if first included object has incompatible target. Set
13538 included_member_ field.
13539 (Add_archive_symbols::run): If add_symbols returns false, requeue
13540 Read_symbols task.
13541 * archive.h (class Archive): Add included_member_ field.
13542 Initialize it in constructor. Add input_file and searched_for
13543 methods. Update declarations.
13544 (class Add_archive_symbols): Add dirpath_, dirindex_, and
13545 input_argument_ fields. Add them to constructor. Change all
13546 callers.
13547 * script.cc: Include "target-select.h".
13548 (class Parser_closure): Add skip_on_incompatible_target_ and
13549 found_incompatible_target_ fields. Add
13550 skip_on_incompatible_target parameter to constructor. Change all
13551 callers. Add methods skip_on_incompatible_target,
13552 clear_skip_on_incompatible_target, found_incompatible_target, and
13553 set_found_incompatible_target.
13554 (read_input_script): Add dirindex parameter. Change all callers.
13555 If parser finds an incompatible target, requeue Read_symbols
13556 task.
13557 (script_set_symbol): Clear skip_on_incompatible_target in
13558 closure.
13559 (script_add_assertion, script_parse_option): Likewise.
13560 (script_start_sections, script_add_phdr): Likewise.
13561 (script_check_output_format): New function.
13562 * script.h (read_input_script): Update declaration.
13563 * script-c.h (script_check_output_format): Declare.
13564 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
13565 (ignore_cmd): Remove OUTPUT_FORMAT.
13566 * fileread.cc (Input_file::Input_file): Add explicit this.
13567 (Input_file::will_search_for): New function.
13568 (Input_file::open): Add pindex parameter. Change all callers.
13569 * fileread.h (class Input_file): Add input_file_argument method.
13570 Declare will_search_for. Update declarations.
13571 * object.cc (make_elf_object): Add punconfigured parameter.
13572 Change all callers.
13573 * object.h (class Object): Make input_file public. Add
13574 searched_for method.
13575 (make_elf_object): Update declaration.
13576 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
13577 restart search.
13578 * dirsearch.h (class Dirsearch): Update declaration.
13579 * options.h (class General_options): Add --warn-search-mismatch.
13580 * parameters.cc (Parameters::is_compatible_target): New function.
13581 * parameters.h (class Parameters): Declare is_compatible_target.
13582 * workqueue.cc (Workqueue::add_blocker): New function.
13583 * workqueue.h (class Workqueue): Declare add_blocker.
13584
f1ed28fb
ILT
13585 * fileread.cc (Input_file::open): Remove options parameter.
13586 Change all callers.
13587 (Input_file::open_binary): Likewise.
13588 * script.cc (read_input_script): Likewise.
13589 * readsyms.h (class Read_symbols): Remove options_ field. Remove
13590 options parameter from constructor. Change all callers.
13591 (class Read_script): Likewise.
13592 * fileread.h (class Input_file): Update declarations.
13593 * script.h (read_input_script): Update declaration.
13594
34dd024a
NC
135952009-03-10 Nick Clifton <nickc@redhat.com>
13596
13597 * po/es.po: New Spanish translation.
13598
6d71b17c
CC
135992009-03-06 Cary Coutant <ccoutant@google.com>
13600
13601 * options.cc (parse_short_option): Keep dash_z from registering itself.
13602
031cdbed
ILT
136032009-03-03 Ian Lance Taylor <iant@google.com>
13604
13605 PR 9918
13606 * target-reloc.h (relocate_section): Pass output_section to
13607 relocate.
13608 * i386.cc (Target_i386::should_apply_static_reloc): Add
13609 output_section parameter. Change all callers.
13610 (Target_i386::Relocate::relocate): Add output_section parameter.
13611 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13612 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
13613 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
13614 * testsuite/two_file_shared.sh: New script.
13615 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
13616 (check_DATA): Add two_file_shared.dbg.
13617 (two_file_shared.dbg): New target.
13618 * testsuite/Makefile.in: Rebuild.
13619
15d5fa16
ILT
136202009-03-01 Ian Lance Taylor <iant@google.com>
13621
13622 * configure.ac: Check for byteswap.h.
13623 * configure: Rebuild.
13624 * config.in: Rebuild.
13625
8a4c0b0d
ILT
136262009-03-01 Mikolaj Zalewski <mikolajz@google.com>
13627
13628 * layout.cc (Layout::find_or_add_kept_section): New function.
13629 (Layout::add_comdat): Removed.
13630 * layout.h (struct Kept_section): Move out of class Layout.
13631 Remove trailing underscores from field names. Add group_sections
13632 field. Rename group_ field to is_group. Change all uses.
13633 (class Layout): Declare find_or_add_kept_section, not add_comdat.
13634 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
13635 comdat_groups_ field.
13636 (Sized_relobj::include_section_group): Use
13637 find_or_add_kept_section and Kept_section::group_sections.
13638 (Sized_relobj::include_linkonce_section): Likewise.
13639 * object.cc (class Sized_relobj): Don't define Comdat_group or
13640 Comdat_group_table. Remove find_comdat_group and
13641 add_comdat_group. Remove comdat_groups_ field.
13642 * plugin.cc (include_comdat_group): Use
13643 Layout::find_or_add_kept_section.
13644
b4ecf66b
ILT
136452009-02-28 Ian Lance Taylor <iant@google.com>
13646
14359ca0
ILT
13647 * README: --gc-sections and map files are now supported. Document
13648 some build requirements.
13649
b4ecf66b
ILT
13650 PR 6992
13651 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
13652 relocatable link set the value of the section symbol to zero.
13653 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
13654 relocatable link don't include the section address in the local
13655 symbol value.
13656
0602e05a
ILT
136572009-02-27 Ian Lance Taylor <iant@google.com>
13658
fd9d194f
ILT
13659 PR 6811
13660 * options.h (class Search_directory): Add is_system_directory.
13661 (class General_options): Declare is_in_system_directory.
13662 * options.cc (get_relative_sysroot): Make static.
13663 (get_default_sysroot): Make static.
13664 (General_optoins::is_in_system_directory): New function.
13665 * fileread.cc (Input_file::is_in_system_directory): New function.
13666 * fileread.h (class Input_file): Declare is_in_system_directory.
13667 * object.h (class Object): Add is_in_system_directory.
13668 (class Input_objects): Remove system_library_directory_ field.
13669 * object.cc (Input_objects::add_object): Don't set
13670 system_library_directory_.
13671 (input_objects::found_in_system_library_directory): Remove.
13672 * symtab.cc (Symbol_table::write_globals): Remove input_objects
13673 parameter. Change all callers.
13674 (Symbol_table::sized_write_globals): Likewise.
13675 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
13676 Call Object::is_in_system_directory.
13677 * symtab.h (class Symbol_table): Update declarations.
13678
61edd21f
ILT
13679 PR 5990
13680 * descriptors.h (Open_descriptor): Add is_on_stack field.
13681 * descriptors.cc (Descriptors::open): If the descriptor is on the
13682 top of the stack, remove it. Initialize is_on_stack field.
13683 (Descriptors::release): Only add pod to stack if it is not on the
13684 stack already.
13685 (Descriptors::close_some_descriptor): Clear stack_next and
13686 is_on_stack fields.
13687
e29e076a
ILT
13688 PR 7091
13689 * output.cc (Output_section::find_starting_output_address): Rename
13690 from starting_output_address; add PADDR parameter; change return
13691 type.
13692 * output.h (class Output_section): Declare
13693 find_starting_output_address instead of starting_output_address.
13694 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
13695 section symbol for which we can't find a merge section.
13696
0602e05a
ILT
13697 PR 9836
13698 * symtab.cc (Symbol_table::add_from_object): If the visibility is
13699 hidden or internal, force the symbol to be local.
13700 * resolve.cc (Symbol::override_visibility): Define.
13701 (Symbol::override_base): Use override_visibility.
13702 (Symbol_table::resolve): Likewise.
13703 (Symbol::override_base_with_special): Likewise.
13704 (Symbol_table::override_with_special): If the visibility is hidden
13705 or internal, force the symbol to be local.
13706 * symtab.h (class Symbol): Add set_visibility and
13707 override_visibility.
13708 * testsuite/ver_test_1.sh: New file.
13709 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
13710 (check_DATA): Add ver_test_1.syms.
13711 (ver_test_1.syms): New target.
13712 * testsuite/Makefile.in: Rebuild.
13713
401a9a73
CC
137142009-02-25 Cary Coutant <ccoutant@google.com>
13715
13716 * layout.cc (Layout::choose_output_section): Don't rename sections
13717 when using a linker script that has a SECTIONS clause.
13718 * Makefile.in: Regenerate.
13719
13720 * testsuite/Makefile.am (script_test_5.sh): New test case.
13721 * testsuite/Makefile.in: Regenerate.
13722 * testsuite/script_test_5.cc: New file.
13723 * testsuite/script_test_5.sh: New file.
13724 * testsuite/script_test_5.t: New file.
13725
f488e4b0
CC
137262009-02-13 Rafael Avila de Espindola <espindola@google.com>
13727
13728 * archive.cc (Archive::include_member): Update calls to add_symbols.
13729 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
13730 the Layout argument.
13731 * dynobj.h (do_add_symbols): Add the Layout argument.
13732 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
13733 Layout argument.
13734 * object.h (Object::add_symbols): Add the Layout argument.
13735 (Object::do_add_symbols): Add the Layout argument.
13736 (Sized_relobj::do_add_symbols): Add the Layout argument.
13737 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
13738 Unify the two versions.
13739 (Add_plugin_symbols): Remove.
13740 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
13741 (Sized_pluginobj::do_add_symbols): Unify the two versions.
13742 (Add_plugin_symbols): Remove.
13743 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
13744 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
13745 (Add_symbols::run): Make it work with Pulginobj.
13746
89dd1680
ILT
137472009-02-06 Ian Lance Taylor <iant@google.com>
13748
13749 * object.cc (Sized_relobj::do_layout): Make info message start
13750 with lower case letter.
13751
266d0a74
ILT
137522009-02-06 Mikolaj Zalewski <mikolajz@google.com>
13753
602b464e
ILT
13754 * binary.cc: Fix file comment.
13755
266d0a74
ILT
13756 * options.h (enum Incremental_disposition): Define.
13757 (class General_options): Add new options: --incremental,
13758 --incremental_changed, --incremental_unchanged,
13759 --incremental_unknown. Add incremental_disposition_ and
13760 implicit_incremental_ fields.
13761 (General_options::incremental_disposition): New function.
13762 (class Position_dependent_options): Add incremental_disposition
13763 option.
13764 (Position_dependent_options::copy_from_options): Set incremental
13765 dispositions.
13766 * options.cc (General_options::parse_incremental_changed): New
13767 function.
2e702c99
RM
13768 (General_options::parse_incremental_unchanged): New function.
13769 (General_options::parse_incremental_unknown): New function.
13770 (General_options::General_options): Initialize new fields
266d0a74 13771 incremental_disposition_ and implicit_incremental_.
2e702c99 13772 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
13773 without --incremental.
13774
f073bbf7
CD
137752009-02-06 Chris Demetriou <cgd@google.com>
13776
13777 * gold.h (gold_undefined_symbol): Change to take only a Symbol
13778 pointer and to report location as the file name associated with
13779 the symbol.
13780 (gold_undefined_symbol_at_location): New function to replace the
13781 old gold_undefined_symbol functionality.
13782 * target-reloc.h (relocate_section): Update to use
13783 gold_undefined_symbol_at_location.
13784 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
13785 Call gold_undefined_symbol function rather than gold_error.
13786 * errors.h (Errors::undefined_symbol): Take location as a
13787 string, rather than calculating it from a relocation.
13788 * errors.cc (Errors::fatal): Print "fatal error:" before the
13789 formatted message.
13790 (Errors::error, Errors::error_at_location): Print "error: "
13791 before the formatted message.
13792 (Errors::undefined_symbol): Take location as a string, rather
13793 than calculating it from a relocation.
13794 (gold_undefined_symbol_at_location): New function akin to
13795 old gold_undefined_symbol, calculates location from relocation.
13796 (gold_undefined_symbol): Change to take only a Symbol pointer
13797 and to report location as the file name associated with the symbol.
13798 * testsuite/debug_msg.sh: Update for changed error messages.
13799 * testsuite/undef_symbol.sh: Likewise.
13800
8e94a90c
ILT
138012009-02-04 Duncan Sands <baldrick@free.fr>
13802
13803 PR 9812
13804 * reduced_debug_output.h
13805 (Output_reduced_debug_abbrev_section::failed): Use format for
13806 gold_warning.
13807 (Output_reduced_debug_info_section::faild): Likewise.
13808
88a0e15b
ILT
138092009-01-31 Mikolaj Zalewski <mikolajz@google.com>
13810
13811 * script.cc (Lazy_demangler): New class.
2e702c99 13812 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
13813 symbol only once.
13814
5efc7cd2
CC
138152009-01-29 Cary Coutant <ccoutant@google.com>
13816
13817 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
13818 to __tls_get_addr.
13819 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
13820
e0ebcf42
ILT
138212009-01-28 Ian Lance Taylor <iant@google.com>
13822
5efc7cd2 13823 * version.cc (version_string): Bump to 1.9.
75fe7426 13824
e0ebcf42
ILT
13825 * gold.h: Include <cstring> and <stdint.h>.
13826 * version.cc: Include <cstdio>.
13827 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
13828 warning.
13829 * reduced_debug_output.cc (insert_into_vector): Rename from
13830 Insert_into_vector; change all callers. Use Swap_unaligned to
13831 avoid aliasing issue; remove union since it is unnecessary.
13832
8e2813be 138332009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
13834
13835 * Makefile.am (CCFILES): Add gc.cc.
13836 (HFILES): Add gc.h.
13837 * Makefile.in: Regenerate.
13838 * gold.cc (Gc_runner): New class.
13839 (queue_initial_tasks): Call garbage collection related tasks
13840 when corresponding options are invoked.
13841 (queue_middle_gc_tasks): New function.
13842 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
13843 processed early before laying out sections during garbage collection.
13844 * gold.h (queue_middle_gc_tasks): New function.
13845 (is_prefix_of): Move from "layout.cc".
13846 * i386.cc (Target_i386::gc_process_relocs): New function.
13847 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
13848 * main.cc (main): Create object of class "Garbage_collection".
13849 * object.cc (Relobj::copy_symbols_data): New function.
13850 (Relobj::is_section_name_included): New function.
e1df38aa
NC
13851 (Sized_relobj::do_layout): Allow this function to be called twice
13852 during garbage collection and defer layout of section during the
6d03d481
ST
13853 first call.
13854 * object.h (Relobj::get_symbols_data): New function.
13855 (Relobj::is_section_name_included): New function.
13856 (Relobj::copy_symbols_data): New function.
13857 (Relobj::set_symbols_data): New function.
13858 (Relobj::get_relocs_data): New function.
13859 (Relobj::set_relocs_data): New function.
13860 (Relobj::is_output_section_offset_invalid): New pure virtual function.
13861 (Relobj::gc_process_relocs): New function.
13862 (Relobj::do_gc_process_relocs): New pure virtual function.
13863 (Relobj::sd_): New data member.
13864 (Sized_relobj::is_output_section_offset_invalid): New function.
13865 (Sized_relobj::do_gc_process_relocs): New function.
13866 * options.h (General_options::gc_sections): Modify to not be a no-op.
13867 (General_options::print_gc_sections): New option.
13868 * plugin.cc (Plugin_finish::run): Remove function call to
13869 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
13870 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
13871 * reloc.cc (Read_relocs::run): Add task to process relocs and
13872 determine unreferenced sections when doing garbage collection.
13873 (Gc_process_relocs): New class.
13874 (Sized_relobj::do_gc_process_relocs): New function.
13875 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
13876 sections that are garbage collected.
13877 * reloc.h (Gc_process_relocs): New class.
13878 * sparc.cc (Target_sparc::gc_process_relocs): New function.
13879 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
13880 symbols whose corresponding sections are garbage collected.
13881 (Symbol_table::Symbol_table): Add new parameter for the garbage
13882 collection object.
13883 (Symbol_table::gc_mark_undef_symbols): New function.
13884 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13885 (Symbol_table::gc_mark_dyn_syms): New function.
13886 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
13887 as garbage.
13888 (Symbol_table::add_from_object): Likewise.
13889 (Symbol_table::add_from_relobj): When building shared objects, do not
13890 treat externally visible symbols as garbage.
13891 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
13892 table information for static and relocatable links.
13893 * symtab.h (Symbol_table::set_gc): New function.
13894 (Symbol_table::gc): New function.
13895 (Symbol_table::gc_mark_undef_symbols): New function.
13896 (Symbol_table::gc_mark_symbol_for_shlib): New function.
13897 (Symbol_table::gc_mark_dyn_syms): New function.
13898 (Symbol_table::gc_): New data member.
e1df38aa 13899 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
13900 function.
13901 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
13902 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
13903
3b293544
CF
139042009-01-20 Chris Faylor <me.sourceware@sourceware.org>
13905
13906 * options.h (General_options::gc_sections): Define as a no-op for now.
13907 (General_options::no_keep_memory): Ditto.
13908 (General_options::Bshareable): Define.
13909 * options.cc (General_options::finalize): Honor -Bshareable.
13910
83d22aa8
AS
139112009-01-20 Andreas Schwab <schwab@suse.de>
13912
13913 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
13914 read the value in the contents, since we don't use it. Use the
13915 template endianness when writing.
13916 (Relocate::relocate): Use it for R_PPC_REL16_HA.
13917
cd536b21
AS
139182009-01-19 Andreas Schwab <schwab@suse.de>
13919
13920 * configure.tgt (powerpc64-*): Fix targ_obj.
13921
99e9a495
ILT
139222009-01-15 Ian Lance Taylor <iant@google.com>
13923
13924 * object.cc (Sized_relobj::write_local_symbols): Don't write out
13925 local symbols when stripping all symbols.
13926
bbbfea06
CC
139272009-01-14 Cary Coutant <ccoutant@google.com>
13928
99e9a495 13929 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 13930
0f7c0701
CC
139312009-01-14 Cary Coutant <ccoutant@google.com>
13932
13933 * archive.cc (Archive::get_elf_object_for_member): Remove call
13934 to File_read::claim_for_plugin.
13935 * descriptors.cc (Descriptors::open): Remove reference to
13936 is_claimed.
13937 (Descriptors::claim_for_plugin): Remove.
13938 * descriptors.h (Descriptors::claim_for_plugin): Remove.
13939 (Descriptors::is_claimed): Remove.
13940 (claim_descriptor_for_plugin): Remove.
13941 * fileread.cc (File_read::claim_for_plugin): Remove.
13942 * fileread.h (File_read::claim_for_plugin): Remove.
13943 (File_read::descriptor): Reopen descriptor if necessary.
13944 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
13945 (Plugin_manager::all_symbols_read): Add task parameter. Change
13946 all callers.
13947 (Plugin_manager::get_input_file): New function.
13948 (Plugin_manager::release_input_file): New function.
13949 (Pluginobj::Pluginobj): Add filesize parameter and initialize
13950 corresponding data member.
13951 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
13952 and pass to base constructor. Change all callers.
13953 (get_input_file, release_input_file): New functions.
13954 (make_sized_plugin_object): Add filesize parameter. Change all callers.
13955 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
13956 (Plugin_manager::all_symbols_read): Add task parameter.
13957 (Plugin_manager::get_input_file): New function.
13958 (Plugin_manager::release_input_file): New function.
13959 (Plugin_manager::task_): New data member.
13960 (Pluginobj::Pluginobj): Add filesize parameter.
13961 (Pluginobj::filename): New function.
13962 (Pluginobj::descriptor): New function.
13963 (Pluginobj::filesize): New function.
13964 (Pluginobj::filesize_): New data member.
13965 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
13966 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
13967 File_read::claim_for_plugin; use Object::unlock to unlock the file.
13968
13969 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
13970 with archive libraries.
13971 * testsuite/Makefile.in: Regenerate.
13972 * testsuite/plugin_test.c (struct sym_info): New type.
13973 (get_input_file, release_input_file): New static variables.
13974 (onload): Capture new transfer vector entries.
13975 (claim_file_hook): Stop reading at end of file according to filesize.
13976 Factor out parsing of readelf output into separate function.
13977 (all_symbols_read_hook): Exercise get_input_file and release_input_file
13978 APIs and get the source file name from the symbol table. Convert
13979 source file name to corresponding object file name. Print info
13980 message when adding new input files.
13981 (parse_readelf_line): New function.
13982 * testsuite/plugin_test_1.sh: Add checks for new info messages.
13983 * testsuite/plugin_test_2.sh: Likewise.
13984 * testsuite/plugin_test_3.sh: Likewise.
13985 * testsuite/plugin_test_4.sh: New test case.
13986
62a6d109
ILT
139872009-01-07 Ian Lance Taylor <iant@google.com>
13988
13989 * version.cc (version_string): Bump to 1.8.
13990
483620e8
CC
139912008-12-23 Cary Coutant <ccoutant@google.com>
13992
13993 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
13994 * plugin.cc (Plugin_manager::finish): Rename as
13995 layout_deferred_objects. Move cleanup to separate function.
13996 (Plugin_manager::cleanup): New function.
13997 (Plugin_finish::run): Call layout_deferred_objects and cleanup
13998 separately.
13999 * plugin.h (Plugin_manager::finish): Rename as
14000 layout_deferred_objects.
14001 (Plugin_manager::cleanup): New function.
14002 (Plugin_manager::cleanup_done): New field.
14003
d66a9eb3
CC
140042008-12-23 Cary Coutant <ccoutant@google.com>
14005
14006 * plugin.cc (is_visible_from_outside): New function.
14007 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
14008 so we don't return "IR only" status for exported symbols or -r links.
14009
14010 * testsuite/Makefile.am (plugin_test_3): New test case.
14011 * testsuite/Makefile.in: Regenerate.
14012 * testsuite/plugin_test_3.sh: New file.
14013
5995b570
CC
140142008-12-22 Cary Coutant <ccoutant@google.com>
14015
14016 * object.cc (Sized_relobj::layout_section): New function.
14017 (Sized_relobj::do_layout): Defer layout of input sections until after
14018 plugin has provided replacement files.
14019 (Sized_relobj::do_layout_deferred_sections): New function.
14020 * object.h (Relobj::set_section_offset): Remove virtual keyword.
14021 (Relobj::layout_deferred_sections): New function.
14022 (Relobj::do_layout_deferred_sections): New function.
14023 (Sized_relobj::do_layout_deferred_sections): New function.
14024 (Sized_relobj::layout_section): New function.
14025 (Sized_relobj::Deferred_layout): New structure.
14026 (Sized_relobj::deferred_layout_): New field.
14027 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
14028 Change all callers. Layout deferred sections.
14029 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
14030 references.
14031 (Plugin_hook::run): Move code from do_plugin_hook inline.
14032 (Plugin_hook::do_plugin_hook): Remove.
14033 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
14034 (Plugin_manager::finish): Renamed, was cleanup.
14035 (Plugin_manager::should_defer_layout): New function.
14036 (Plugin_manager::add_deferred_layout_object): New function.
14037 (Plugin_manager::Deferred_layout_list): New type.
14038 (Plugin_manager::deferred_layout_objects_): New field.
14039 (Plugin_hook::do_plugin_hook): Remove.
14040
ee769c88
ILT
140412008-12-17 Ian Lance Taylor <iant@google.com>
14042
14043 * options.h (class General_options): Add --no case for
14044 --export-dynamic.
14045
abc8dcba
CC
140462008-12-16 Cary Coutant <ccoutant@google.com>
14047
14048 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
14049 vector.
14050 (Plugin_manager::claim_file): Create plugin object even if
14051 plugin did not call the add_symbols callback.
14052 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
14053 asking for more symbols than were added.
14054 * testsuite/Makefile.am (plugin_test_1): Add test case with
14055 no global symbols.
14056 (empty.syms): New target.
14057 * testsuite/Makefile.in: Regenerate.
14058 * testsuite/plugin_test.c (claim_file_hook): Add new debug
14059 message. Don't call add_symbols if no globals.
14060 (all_symbols_read_hook): Don't provide replacement for empty
14061 claimed file.
14062
b0074644
ILT
140632008-12-12 Ian Lance Taylor <iant@google.com>
14064
68943102
ILT
14065 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
14066 r_type == 0 for a local symbol with r_sym == 0.
14067 (scan_relocatable_relocs): Pass r_sym to
14068 local_non_section_strategy.
14069 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
14070 r_sym parameter.
14071
b0074644
ILT
14072 * configure.ac: Update test for TLS descriptors: they are
14073 supported as of glibc 2.9.
14074 * configure: Rebuild.
14075
c2508178
ILT
140762008-12-11 Ian Lance Taylor <iant@google.com>
14077
14078 PR 7091
14079 * target-reloc.h (Default_scan_relocatable_relocs): For each
14080 function, map r_type == 0 to RELOC_DISCARD.
14081
2756a258
CC
140822008-12-10 Cary Coutant <ccoutant@google.com>
14083
14084 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
14085 object to override a kept COMDAT group from a plugin object.
14086
bb6f53d3
ILT
140872008-12-09 Ian Lance Taylor <iant@google.com>
14088
fbc558e1
ILT
14089 PR 7088
14090 * yyscript.y (file_cmd): Handle INPUT.
14091
bb6f53d3
ILT
14092 * testsuite/initpri1.c: Change all declarations to be full
14093 prototypes by adding void, to avoid compiler warnings.
14094
4674ecfc
CC
140952008-12-05 Rafael Avila de Espindola <espindola@google.com>
14096
14097 * options.cc (General_options::parse_plugin_opt): New.
14098 (General_options::add_plugin): The argument now is just the filename.
14099 (General_options::add_plugin_option): New.
14100 * options.h (plugin_opt): New.
14101 (add_plugin): Change argument name.
14102 (add_plugin_option): New.
14103 * plugin.cc (Plugin::load): Don't parse the plugin option.
14104 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
14105 (Plugin::add_option): New.
14106 (Plugin::args_): Change type.
14107 (Plugin::filename_): New.
14108 (Plugin_manager::add_plugin_option): New.
14109 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
14110 * testsuite/Makefile.in: Regenerate.
14111
fd06b4aa
CC
141122008-12-05 Cary Coutant <ccoutant@google.com>
14113
14114 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
14115 Handle --strip-lto-sections option.
14116 * options.h (strip_lto_sections): New option.
14117
6c52134c
CC
141182008-12-01 Cary Coutant <ccoutant@google.com>
14119
14120 * plugin.cc (ld_plugin_message): Change format parameter to const.
14121 Fix mismatch between new[] and delete.
14122
a45248e0
CC
141232008-11-14 Cary Coutant <ccoutant@google.com>
14124
14125 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
14126 instead of -1U.
14127
c82fbeee
CS
141282008-11-05 Craig Silverstein <csilvers@google.com>
14129
14130 * options.cc (General_options::parse_dynamic_list): New function.
14131 * options.h (General_options): New flags dynamic_list,
14132 dynamic_list_data, dynamic_list_cpp_new, and
14133 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
14134 (General_options::in_dynamic_list): New function.
14135 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
14136 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
14137 (Lex::can_continue_name): Likewise.
14138 (yylex): Likewise.
14139 (read_script_file): New parameter script_options.
14140 (read_dynamic_list): New function.
14141 (Script_options::define_dynamic_list): New function.
14142 (dynamic_list_keyword_parsecodes): New variable.
14143 (dynamic_list_keywords): New variable.
14144 * script.h (Script_options::define_dynamic_list): New function
14145 prototype.
14146 (read_dynamic_list): New function prototype.
14147 * symtab.cc (strprefix): New macro.
14148 (Symbol::should_add_dynsym_entry): Support dynamic_list,
14149 dynamic_list_data, dynamic_list_cpp_new, and
14150 dynamic_list_cpp_typeinfo.
14151 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
14152 (dynamic_list_expr): New rule.
14153 (dynamic_list_nodes): Likewise.
14154 (dynamic_list_node): Likewise.
14155 * testsuite/Makefile.am (dynamic_list): New test.
14156 * testsuite/Makefile.in: Regenerated.
14157 * testsuite/dynamic_list.t: New file.
14158 * testsuite/dynamic_list.sh: New file.
14159
e0bb29a5
CS
141602008-11-05 Craig Silverstein <csilvers@google.com>
14161
14162 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
14163 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
14164 (t11_last): Likewise.
14165 * testsuite/ver_test_6.c (main): Likewise.
14166
4e1e25e0
CC
141672008-10-07 Cary Coutant <ccoutant@google.com>
14168
14169 * options.c (General_options::finalize): Add check for -static and
14170 -shared.
14171 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
14172 is not empty.
14173
92f03fcb
CC
141742008-10-02 Cary Coutant <ccoutant@google.com>
14175
14176 * plugin.cc (make_sized_plugin_object): Fix conditional
14177 compilation to work when not all targets are enabled.
14178
fbd8a257
CC
141792008-09-29 Cary Coutant <ccoutant@google.com>
14180
14181 * archive.cc (Archive::get_file_and_offset): Use filename instead
14182 of name to get library path.
14183 (Archive::include_member): Unlock external member of a thin archive.
14184
14185 * testsuite/Makefile.am (TEST_AR): New variable.
14186 (thin_archive_test_1): New test.
14187 (thin_archive_test_2): New test.
81636b3f
CC
14188 * testsuite/Makefile.in: Regenerate.
14189 * testsuite/thin_archive_main.cc: New file.
14190 * testsuite/thin_archive_test_1.cc: New file.
14191 * testsuite/thin_archive_test_2.cc: New file.
14192 * testsuite/thin_archive_test_3.cc: New file.
14193 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 14194
eff45813
CC
141952008-09-29 Cary Coutant <ccoutant@google.com>
14196
14197 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
14198 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
14199 instead of -1U.
14200 (Sized_relobj::do_finalize_local_symbols): Likewise.
14201 (Sized_relobj::map_to_kept_section): Likewise.
14202 * object.h (Sized_relobj::invalid_address): New constant.
14203 (Sized_relobj::do_output_section_offset): Check for invalid_address
14204 and return -1ULL.
14205 * output.cc (Output_reloc::local_section_offset): Use constant
14206 invalid_address instead of -1U.
14207 (Output_reloc::get_address): Likewise.
14208 (Output_section::output_address): Change -1U to -1ULL.
14209 * output.h (Output_reloc::invalid_address): New constant.
14210 * reloc.cc (Sized_relobj::write_sections): Use constant
14211 invalid_address instead of -1U.
14212 (Sized_relobj::relocate_sections): Likewise.
14213 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
14214 values for merge sections.
14215 * target-reloc.h (relocate_for_relocatable): Use constant
14216 invalid_address instead of -1U.
14217
89fc3421
CC
142182008-09-19 Cary Coutant <ccoutant@google.com>
14219
14220 Add plugin functionality for link-time optimization (LTO).
14221 * configure.ac (plugins): Add --enable-plugins option.
14222 * configure: Regenerate.
14223 * config.in: Regenerate.
14224 * Makefile.am (LIBDL): New variable.
14225 (CCFILES): Add plugin.cc.
14226 (HFILES): Add plugin.h.
14227 (ldadd_var): Add LIBDL.
14228 * Makefile.in: Regenerate.
14229
14230 * archive.cc: Include "plugin.h".
14231 (Archive::setup): Don't preread archive symbols when using a plugin.
14232 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
14233 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
14234 files.
14235 (Archive::include_member): Add symbols from plugin objects.
14236 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
14237 * descriptors.cc (Descriptors::open): Check for file descriptors
14238 abandoned by plugins.
14239 (Descriptors::claim_for_plugin): New function.
14240 * descriptors.h (Descriptors::claim_for_plugin): New function.
14241 (Open_descriptor::is_claimed): New field.
14242 (claim_descriptor_for_plugin): New function.
14243 * fileread.cc (File_read::claim_for_plugin): New function.
14244 * fileread.h (File_read::claim_for_plugin): New function.
14245 (File_read::descriptor): New function.
14246 * gold.cc: Include "plugin.h".
14247 (queue_initial_tasks): Add task to call plugin hooks for generating
14248 new object files.
14249 * main.cc: Include "plugin.h".
14250 (main): Load plugin libraries.
14251 * object.h (Pluginobj): Declare.
14252 (Object::pluginobj): New function.
14253 (Object::do_pluginobj): New function.
14254 (Object::set_target): New function.
14255 * options.cc: Include "plugin.h".
14256 (General_options::parse_plugin): New function.
14257 (General_options::General_options): Initialize plugins_ field.
14258 (General_options::add_plugin): New function.
14259 * options.h (Plugin_manager): Declare.
14260 (General_options): Add --plugin option.
14261 (General_options::has_plugins): New function.
14262 (General_options::plugins): New function.
14263 (General_options::add_plugin): New function.
14264 (General_options::plugins_): New field.
14265 * plugin.cc: New file.
14266 * plugin.h: New file.
14267 * readsyms.cc: Include "plugin.h".
14268 (Read_symbols::do_read_symbols): Check for archive before checking
14269 for ELF file. Call plugin hooks to claim files.
14270 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
14271 from a real object file; force override when processing replacement
14272 files.
14273 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
14274 (Symbol::init_base_object): Likewise.
14275 (Symbol::init_base_output_data): Likewise.
14276 (Symbol::init_base_output_segment): Likewise.
14277 (Symbol::init_base_constant): Likewise.
14278 (Symbol::init_base_undefined): Likewise.
14279 (Symbol::output_section): Assert that object is not a plugin.
14280 (Symbol_table::add_from_pluginobj): New function.
14281 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
14282 undefined.
14283 (Symbol_table::sized_write_globals): Likewise.
14284 (Symbol_table::add_from_pluginobj): Instantiate template.
14285 * symtab.h (Sized_pluginobj): Declare.
14286 (Symbol::in_real_elf): New function.
14287 (Symbol::set_in_real_elf): New function.
14288 (Symbol::in_real_elf_): New field.
14289 (Symbol_table::add_from_pluginobj): New function.
14290
14291 * testsuite/Makefile.am (AM_CFLAGS): New variable.
14292 (LIBDL): New variable.
14293 (LDADD): Add LIBDL.
14294 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
14295 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
14296 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
14297 (MOSTLYCLEANFILES): Likewise.
14298 * testsuite/Makefile.in: Regenerate.
14299 * testsuite/plugin_test.c: New file.
14300 * testsuite/plugin_test_1.sh: New file.
14301 * testsuite/plugin_test_2.sh: New file.
14302
de31bda5
ILT
143032008-09-16 Ian Lance Taylor <iant@google.com>
14304
9c2d0ef9
ILT
14305 * target-reloc.h (relocate_section): Check whether a symbol is
14306 defined by the ABI before reporting an undefined symbol error.
14307 * target.h (Target::is_defined_by_abi): Make parameter const.
14308 (Target::do_is_defined_by_abi): Likewise.
14309 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
14310 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
14311 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
14312 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
14313 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
14314 * testsuite/Makefile.in: Rebuild.
14315
de31bda5
ILT
14316 * fileread.cc (make_view): Add casts to avoid warning.
14317
9fa33bee
AO
143182008-09-16 Alexandre Oliva <aoliva@redhat.com>
14319
14320 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
14321 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14322
183fd0e3
AO
143232008-09-16 Alexandre Oliva <aoliva@redhat.com>
14324
14325 * options.h (General_options::output_is_executable): New.
14326 (General_options::output_is_pie): New.
14327 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
14328 for shared libraries.
14329 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
14330
7be8330a
CD
143312008-09-11 Chris Demetriou <cgd@google.com>
14332
14333 * options.h (origin): New -z option.
14334 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
14335 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14336 in DT_FLAGS_1.
14337
a9caad02
CC
143382008-09-05 Cary Coutant <ccoutant@google.com>
14339
14340 * fileread.cc (File_read::make_view): Add check for attempt to map
14341 beyond end of file.
14342
ae6dce4d
CC
143432008-09-05 Cary Coutant <ccoutant@google.com>
14344
14345 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
14346 explicit instantiations.
14347
d7ab2a47
KVH
143482008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
14349
14350 PR gold/6858
14351 * options.cc (General_options::finalize): Allow undefined symbols
14352 in shlibs if linking -shared.
14353
14354 PR gold/6859
14355 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
14356 symbols as not needing a dynsym entry.
14357
1e52a9c1
CS
143582008-08-20 Craig Silverstein <csilvers@google.com>
14359
14360 * fileread.cc (File_read::open): Do not lock the file unless it
14361 was successfully opened.
14362
d85c80a3
CC
143632008-08-14 Cary Coutant <ccoutant@google.com>
14364
14365 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
14366 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
14367 * testsuite/tls_test.cc (struct int128): 128-bit struct
14368 for testing TLS relocs with non-zero addend.
14369 (v12): New TLS variable.
14370 (t12): New test.
14371 (t_last): Add check for v12.
14372 * testsuite/tls_test.h (t12): New function.
14373 * testsuite/tls_test_main.cc (thread_routine): Call new test.
14374
2d924fd9
ILT
143752008-08-13 Ian Lance Taylor <iant@google.com>
14376
14377 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
14378 set tls_segment_ or relro_segment_.
14379 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
14380 when appropriate.
14381 * output.h (Output_section::clear_is_relro): New function.
14382 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
14383 sections specially even when output_data_ is empty.
14384 (Output_segment::maximum_alignment): When first section is relro,
14385 only force alignment for PT_LOAD segments.
14386 * script.cc (script_data_segment_align): New function.
14387 (script_data_segment_relro_end): New function.
14388 * script-c.h (script_data_segment_align): Declare.
14389 (script_data_segment_relro_end): Declare.
14390 * script-sections.h (class Script_sections): Declare
14391 data_segment_align and data_segment_relro_end. Add fields
14392 segment_align_index_ and saw_relro_end_.
14393 * script-sections.cc (class Sections_element): Add set_is_relro
14394 virtual function. Add new bool* parameter to place_orphan_here.
14395 Add get_output_section virtual function.
14396 (class Output_section_definition): Add set_is_relro. Add new
14397 bool* parameter to place_orphan_here. Add get_output_section.
14398 Add is_relro_ field.
14399 (Output_section_definition::Output_section_definition): Initialize
14400 evaluated_address_, evaluated_load_address, evaluated_addralign_,
14401 and is_relro_ fields.
14402 (Output_section_definition::place_orphan_here): Add is_relro
14403 parameter.
14404 (Output_section_definition::set_section_addresses): Set relro for
14405 output section.
14406 (Output_section_definition::alternate_constraint): Likewise.
14407 (class Orphan_output_section): Add new bool* parameter to
14408 place_orphan_here. Add get_output_section.
14409 (Orphan_output_section::place_orphan_here): Add is_relro
14410 parameter.
14411 (Script_sections::Script_sections): Initialize
14412 data_segment_align_index_ and saw_relro_end_.
14413 (Script_sections::data_segment_align): New function.
14414 (Script_sections::data_segment_relro_end): New function.
14415 (Script_sections::place_orphan): Set or clear is_relro.
14416 (Script_sections::set_section_addresses): Force alignment of first
14417 TLS section.
14418 * yyscript.y (exp): Call script_data_segment_align and
14419 script_data_segment_relro_end.
14420 * testsuite/relro_script_test.t: New file.
14421 * testsuite/relro_test.cc (using_script): Declare.
14422 (t1, t2): Test using_script.
14423 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
14424 (relro_script_test_SOURCES): Define.
14425 (relro_script_test_DEPENDENCIES): Define.
14426 (relro_script_test_LDFLAGS): Define.
14427 (relro_script_test_LDADD): Define.
14428 (relro_script_test.so): New target.
14429 * testsuite/Makefile.in: Rebuild.
14430
f827c9a9
CC
144312008-08-06 Cary Coutant <ccoutant@google.com>
14432
14433 * archive.cc (Archive::total_archives, Archive::total_members)
14434 (Archive::total_members_loaded): New variables.
14435 (Archive::setup): Add parameter. Add option to preread
14436 archive symbols.
14437 (Archive::read_armap): Add counter.
14438 (Archive::get_file_and_offset): New function.
14439 (Archive::get_elf_object_for_member): New function.
14440 (Archive::read_all_symbols): New function.
14441 (Archive::read_symbols): New function.
14442 (Archive::add_symbols): Add counters.
14443 (Archive::include_all_members): Use armap to find members if it's
14444 already built.
14445 (Archive::include_member): Skip reading symbols if already read.
14446 Factored code into Archive::get_file_and_offset and
14447 Archive::get_elf_object_for_member. Changed call to
14448 Mapfile::report_include_archive_member.
14449 (Archive::print_stats): New function.
14450 * archive.h: Declare Object and Read_symbols_data classes.
14451 (Archive::Archive): Add initializers for new members.
14452 (Archive::setup): Add parameter.
14453 (Archive::print_stats): New function.
14454 (Archive::total_archives, Archive::total_members)
14455 (Archive::total_members_loaded): New variables.
14456 (Archive::get_file_and_offset): New function.
14457 (Archive::get_elf_object_for_member): New function.
14458 (Archive::read_all_symbols): New function.
14459 (Archive::read_symbols): New function.
14460 (Archive::Archive_member): New class.
14461 (Archive::members_): New member.
14462 (Archive::num_members_): New member.
14463 * main.cc: Include archive.h.
14464 (main): Call Archive::print_stats.
14465 * mapfile.cc (Mapfile::report_include_archive_member): Delete
14466 archive parameter; member_name is now the fully-decorated name.
14467 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
14468 * options.h: (General_options): Add --preread-archive-symbols option.
14469 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
14470 Archive::setup.
14471
de4c45bd
ILT
144722008-08-04 Ian Lance Taylor <iant@google.com>
14473
14474 * symtab.h (Symbol::use_plt_offset): New function.
14475 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
14476 * powerpc.cc (Relocate::relocate): Likewise.
14477 * sparc.cc (Relocate::relocate): Likewise.
14478 * x86_64.cc (Relocate::relocate): Likewise.
14479 * testsuite/weak_plt.sh: New test.
14480 * testsuite/weak_plt_main.cc: New test.
14481 * testsuite/weak_plt_shared.cc: New test.
14482 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
14483 (check_PROGRAMS): Add weak_plt.
14484 (check_DATA): Add weak_plt_shared.so.
14485 (weak_plt_main_pic.o, weak_plt): New targets.
14486 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
14487 * testsuite/Makefile.in: Rebuild.
14488
14489 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
14490 gcctestdir/ld.
14491 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
14492 * testsuite/Makefile.in: Rebuild.
14493
323ee3f4
AM
144942008-08-04 Alan Modra <amodra@bigpond.net.au>
14495
14496 * Makefile.am (POTFILES.in): Set LC_ALL=C.
14497 * Makefile.in: Regenerate.
14498 * po/POTFILES.in: Regenerate.
14499
7c07ecec
ILT
145002008-07-29 Ian Lance Taylor <iant@google.com>
14501
14502 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
14503 symbols before other symbols.
14504 * testsuite/script_test_2.cc (test_addr): Declare.
14505 (test_addr_alias): Declare.
14506 (main): Check that test_addr and test_addr_alias have the right
cd536b21 14507 values.
7c07ecec
ILT
14508 * testsuite/script_test_2.t: Define test_addr_alias and
14509 test_addr.
14510
5778530e
ILT
145112008-07-24 Ian Lance Taylor <iant@google.com>
14512
2a00e4fb
ILT
14513 PR 5990
14514 * descriptors.cc: New file.
14515 * descriptors.h: New file.
14516 * gold-threads.h (class Hold_optional_lock): New class.
14517 * fileread.cc: Include "descriptors.h".
14518 (File_read::~File_read): Release descriptor rather than closing
14519 it.
14520 (File_read::open) [file]: Call open_descriptor rather than open.
14521 Set is_descriptor_opened_.
14522 (File_read::open) [memory]: Assert that descriptor is not open.
14523 (File_read::reopen_descriptor): New function.
14524 (File_read::release): Release descriptor.
14525 (File_read::do_read): Make non-const. Reopen descriptor.
14526 (File_read::read): Make non-const.
14527 (File_read::make_view): Reopen descriptor.
14528 (File_read::do_readv): Likewise.
14529 * fileread.h (class File_read): Add is_descriptor_opened_ field.
14530 Update declarations.
14531 * layout.cc: Include "descriptors.h".
14532 (Layout::create_build_id): Use open_descriptor rather than open.
14533 * output.cc: Include "descriptors.h".
14534 (Output_file::open): Use open_descriptor rather than open.
14535 * archive.cc (Archive::const_iterator): Change Archive to be
14536 non-const.
14537 (Archive::begin, Archive::end): Make non-const.
14538 (Archive::count_members): Likewise.
14539 * archive.h (class Archive): Update declarations.
14540 * object.h (Object::read): Make non-const.
14541 * Makefile.am (CCFILES): Add descriptors.cc.
14542 (HFILES): Add descriptors.h.
14543 * Makefile.in: Rebuild.
14544
801647d1
ILT
14545 PR 6716
14546 * gold.h: Always include <clocale>. Add Solaris workarounds
14547 following code in binutils/sysdep.h.
14548
5edd166e
ILT
14549 PR 6048
14550 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
14551 this->eh_frame_hdr_ is NULL before using it.
14552
c89ad728
ILT
14553 * dynobj.cc (Versions::Versions): Update comment.
14554
aa86f06b
ILT
14555 * dynobj.cc (Versions::Versions): If there is an soname, use it as
14556 the base version name.
14557
5778530e
ILT
14558 * stringpool.cc (Stringpool_template::add_with_length): Set key to
14559 array size plus one.
14560 (Stringpool_template::set_string_offsets): Subtract one from key
14561 before using it as an array index.
14562 (Stringpool_template::get_offset_with_length): Likewise.
14563 (Stringpool_template::write_to_buffer): Likewise.
14564 * stringpool.h (Stringpool_template::get_offset_from_key):
14565 Likewise.
14566
057ead22
ILT
145672008-07-23 Ian Lance Taylor <iant@google.com>
14568
7f649c59
ILT
14569 PR 6658
14570 * object.h (Merged_symbol_value::value): Do our best to handle a
14571 negative addend.
14572
057ead22
ILT
14573 PR 6647
14574 * script.cc (Version_script_info::get_versions): Don't add empty
14575 version tag to return value.
14576 (Version_script_info::get_symbol_version_helper): Change return
14577 type to bool. Add pversion parameter. Change all callers.
14578 (script_register_vers_node): Don't require a non-NULL tag.
14579 * script.h (class Version_script_info): Update declarations.
14580 (Version_script_info::get_symbol_version): Change return type to
14581 bool. Add version parameter. Change all callers.
14582 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
14583 handling. Handle an empty version from a version script.
14584 (Symbol_table::define_special_symbol): Likewise.
14585 * testsuite/ver_test_10.script: New file.
14586 * testsuite/ver_test_10.sh: New file.
14587 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
14588 (check_DATA): Add ver_test_10.syms.
14589 (ver_test_10.syms, ver_test_10.so): New target.
14590 * testsuite/Makefile.in: Rebuild.
14591
58e54ac2
CD
145922008-07-23 Simon Baldwin <simonb@google.com>
14593
14594 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
14595 to zero for undefined symbols from dynamic libraries.
14596
95d14cd3
ILT
145972008-07-23 Ian Lance Taylor <iant@google.com>
14598
14599 * symtab.cc (Symbol_table::resolve): Remove version parameter.
14600 Change all callers.
14601 * symtab.h (class Symbol_table): Update declaration.
14602 * testsuite/ver_test_9.cc: New file.
14603 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
14604 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
14605 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
14606 (ver_test_9.so, ver_test_9.o): New targets.
14607 * testsuite/Makefile.in: Rebuild.
14608
92de84a6
ILT
146092008-07-22 Ian Lance Taylor <iant@google.com>
14610
34810851
ILT
14611 * options.h (class General_options): Define --check-sections.
14612 * layout.cc (Layout::set_segment_offsets): Handle
14613 --check-sections.
14614
af6156ef
ILT
14615 * options.h (class General_options): Define -n/--nmagic and
14616 -N/--omagic.
14617 * options.cc (General_options::finalize): For -n/--nmagic or
14618 -N/--omagic, set -static.
14619 * layout.cc (Layout::attach_allocated_section_to_segment): If
14620 -N/--omagic, don't put read-only and read-write sections in
14621 different segments.
14622 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
14623 finding a read-only segment.
14624 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
14625 don't set the minimum segment alignment to the common page size,
14626 and don't set the file offset to the address modulo the page size.
14627 * script-sections.cc (Script_sections::create_segments): If
14628 -n/--omagic, don't put read-only and read-write sections in
14629 different segments.
14630
92de84a6
ILT
14631 * cref.cc: New file.
14632 * cref.h: New file.
14633 * options.h (class General_options): Add --print-symbol-counts.
14634 * main.cc (main): Issue defined symbol report if requested.
14635 * archive.cc (Archive::interpret_header): Make into a const member
14636 function.
14637 (Archive::add_symbols): Call Input_objects::archive_start and
14638 archive_stop.
14639 (Archive::const_iterator): Define new class.
14640 (Archive::begin, Archive::end): New functions.
14641 (Archive::include_all_members): Rewrite to use iterator.
14642 (Archive::count_members): New function.
14643 * archive.h (class Archive): Update declarations.
14644 (Archive::filename): New function.
14645 * object.cc: Include "cref.h".
14646 (Sized_relobj::Sized_relobj): Initialize defined_count_.
14647 (Sized_relobj::do_get_global_symbol_counts): New function.
14648 (Input_objects::add_object): Add object to cross-referencer.
14649 (Input_objects::archive_start): New function.
14650 (Input_objects::archive_stop): New function.
14651 (Input_objects::print_symbol_counts): New function.
14652 * object.h: Declare Cref and Archive.
14653 (Object::get_global_symbol_counts): New function.
14654 (Object::do_get_global_symbol_counts): New pure virtual function.
14655 (class Sized_relobj): Add defined_count_ field. Update
14656 declarations.
14657 (class Input_objects): Add cref_ field. Update constructor.
14658 Update declarations.
14659 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
14660 defined_count_.
14661 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
14662 symbol counts.
14663 (Sized_dynobj::do_get_global_symbol_counts): New function.
14664 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
14665 defined_count_. Update declarations. Define Symbols typedef.
14666 * symtab.cc (Symbol_table::add_from_relobj): Add defined
14667 parameter. Change all callers.
14668 (Symbol_table::add_from_dynobj): Add sympointers and defined
14669 parameters. Change all callers.
14670 * symtab.h (class Symbol_table): Update declarations.
14671 * Makefile.am (CCFILES): Add cref.cc.
14672 (HFILES): Add cref.h.
14673 * Makefile.in: Rebuild.
14674
3f7c5e1d
CD
146752008-07-22 Simon Baldwin <simonb@google.com>
14676
14677 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
14678 to zero when writing undefined symbols.
14679
e0b64032
ILT
146802008-07-22 Ian Lance Taylor <iant@google.com>
14681
14682 * output.cc (Output_section::add_input_section): Don't try to
14683 merge empty merge sections.
14684
096b02cf
CS
146852008-07-21 Craig Silverstein <csilvers@google.com>
14686
14687 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
14688 Include symbol version in error message.
cd536b21 14689
1d1f116d
CD
146902008-07-20 Chris Demetriou <cgd@google.com>
14691
cd536b21 14692 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
14693 (RANDOM_SEED_CFLAGS): New substituted variable.
14694 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
14695 * configure: Rebuild.
14696 * Makefile.in: Likewise.
14697 * testsuite/Makefile.in: Likewise.
14698
a18f591e
ILT
146992008-07-18 Ian Lance Taylor <iant@google.com>
14700
14701 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
14702 where we see NAME/NULL and NAME/VERSION as separate symbols.
14703 * testsuite/ver_test_main.cc (main): Call t4.
14704 (t4, t4_2a): Define.
14705 * testsuite/ver_test_2.cc (t4_2): Define.
14706 * testsuite/ver_test_2.script: Put t4_2a in VER2.
14707 * testsuite/ver_test_4.cc (t4_2a): Define.
14708 * testsuite/ver_test_4.script: Put t4_2a in VER2.
14709 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
14710
c6e3f6ed
ILT
147112008-07-17 Ian Lance Taylor <iant@google.com>
14712
14713 * dynobj.cc (Versions::add_def): If we give an error about a
14714 missing version, go ahead and create the version anyhow.
14715
ef9beddf
ILT
147162008-07-10 Ian Lance Taylor <iant@google.com>
14717
14718 Handle output sections with more than 0x7fffffff bytes.
14719 * object.h (class Relobj): Change map_to_output_ to
14720 output_sections_, and just keep a section pointer. Change all
14721 uses. Move comdat group support to Sized_relobj.
14722 (Relobj::is_section_specially_mapped): Remove.
14723 (Relobj::output_section): Remove poff parameter. Change all
14724 callers.
14725 (Relobj::output_section_offset): New function.
14726 (Relobj::set_section_offset): Rewrite.
14727 (Relobj::map_to_output): Remove.
14728 (Relobj::output_sections): New function.
14729 (Relobj::do_output_section_offset): New pure virtual function.
14730 (Relobj::do_set_section_offset): Likewise.
14731 (class Sized_relobj): Add section_offsets_ field. Add comdat
14732 group support from Relobj. Update declarations.
14733 (Sized_relobj::get_output_section_offset): New function.
14734 (Sized_relobj::do_output_section_offset): New function.
14735 (Sized_relobj::do_set_section_offset): New function.
14736 * object.cc (Relobj::output_section_address): Remove.
14737 (Sized_relobj::Sized_relobj): Initialize new fields.
14738 (Sized_relobj::include_section_group): Cast find_kept_object to
14739 Sized_relobj.
14740 (Sized_relobj::include_linkonce_section): Likewise.
14741 (Sized_relobj::do_layout): Use separate arrays for output section
14742 and output offset.
14743 (Sized_relobj::do_count_local_symbols): Change map_to_output to
14744 output_sections.
14745 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
14746 output_sections and section_offsets.
14747 (Sized_relobj::write_local_symbols): Likewise.
14748 (map_to_kept_section): Compute output address directly.
14749 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
14750 output_sections and section_offsets.
14751 (Sized_relobj::write_sections): Likewise.
14752 (Sized_relobj::relocate_sections): Likewise.
14753 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
14754 * output.h (class Output_reloc): Update declarations. Change
14755 u2_.relobj to Sized_relobj*.
14756 (class Output_data_reloc): Change add functions to use
14757 Sized_relobj*.
14758 * output.cc (Output_reloc::Output_reloc): Change relobj to
14759 Sized_relobj*.
14760 (Output_reloc::local_section_offset): Change return type to
14761 Elf_Addr. Use get_output_section_offset.
14762 (Output_reloc::get_address): Likewise.
14763 (Output_section::is_input_address_mapped): Don't call
14764 is_section_specially_mapped.
14765 (Output_section::output_offset): Likewise.
14766 (Output_section::output_address): Likewise.
14767 (Output_section::starting_output_address): Likewise.
14768 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
14769 parameter to Sized_relobj*.
14770 (Copy_relocs::need_copy_reloc): Likewise.
14771 (Copy_relocs::save): Likewise.
14772 * copy-relocs.h (class Copy_relocs): Update declarations.
14773 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
14774 Sized_relobj*. Change relobj_ field to Sized_relobj*.
14775 * target-reloc.h (relocate_for_relocatable): Change
14776 offset_in_output_section type to Elf_Addr. Change code that uses
14777 it as well.
14778 * layout.cc (Layout::layout): Always set *off.
14779 * mapfile.cc (Mapfile::print_input_section): Use
14780 output_section_offset.
14781 * i386.cc (Target_i386::copy_reloc): Change object parameter to
14782 Sized_relobj*.
14783 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
14784 * sparc.cc (Target_sparc::copy_reloc): Likewise.
14785 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
14786
5cb66f97
ILT
147872008-07-03 Ian Lance Taylor <iant@google.com>
14788
14789 * layout.cc (Layout::include_section): Do not discard unrecognized
14790 SHT_STRTAB sections.
14791
afe47622
CS
147922008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
14793
14794 * script.cc (Lex::can_continue_name): Make '?' allowable in
14795 version-script names.
14796 * testsuite/version_script.map: Change glob pattern to use '?'
14797
5adf9721
ILT
147982008-06-30 Manish Singh <yosh@gimp.org>
14799
14800 PR 6585
14801 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
14802 Correct typo.
14803
e6fde208
ILT
148042008-06-30 Ian Lance Taylor <iant@google.com>
14805
14806 PR 6660
14807 PR 6682
14808 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
14809 versions]: Don't try to read the value in the contents, since we
14810 don't use it. Use the template endianness when writing.
14811
3f2e6a2d
CC
148122008-06-25 Cary Coutant <ccoutant@google.com>
14813
14814 * fileread.cc (File_read::make_view): Assert on zero-length view.
14815 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
14816 symbol table when there are no symbols to read.
14817
c43d3a48
CS
148182008-06-23 Craig Silverstein <csilvers@google.com>
14819
14820 * version.cc (version_string): Bump to 1.7
14821
5f494ea0
CS
148222008-06-18 Craig Silverstein <csilvers@google.com>
14823
14824 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
14825 constant 0xFFFF to type Valtype.
14826 (Powerpc_relocate_functions::rel16_ha): Likewise.
14827
c42e122e
ILT
148282008-06-17 Ian Lance Taylor <iant@google.com>
14829
f34787f8
ILT
14830 * output.h (Output_section::Input_section): Initialize p2align_ to
14831 zero for Output_section_data constructors.
14832 (Output_section::Input_section::addralign): If not an input
14833 section, return the alignment of the Output_section_data.
14834 * testsuite/copy_test.cc: New file.
14835 * testsuite/copy_test_1.cc: New file.
14836 * testsuite/copy_test_2.cc: New file.
14837 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
14838 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
14839 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
14840 (copy_test_1_pic.o, copy_test_1.so): New targets.
14841 (copy_test_2_pic.o, copy_test_2.so): New targets.
14842 * testsuite/Makefile.in: Rebuild.
14843
c42e122e
ILT
14844 * script-sections.cc (Script_sections::place_orphan): Initialize
14845 local variable exact.
14846
ce3ac18a
DE
148472008-06-13 David Edelsohn <edelsohn@gnu.org>
14848
14849 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
14850
42cacb20
DE
148512008-06-12 David Edelsohn <edelsohn@gnu.org>
14852 David S. Miller <davem@davemloft.net>
14853
14854 * powerpc.cc: New file.
14855 * Makefile.am (TARGETSOURCES): Add powerpc.cc
14856 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
14857 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
14858 * Makefile.in: Rebuild.
14859
7b308235
ILT
148602008-06-09 Ian Lance Taylor <iant@google.com>
14861
14862 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
14863 <exception>.
14864 (throwing, orig_terminate): New static variables.
14865 (terminate_handler): New static function.
14866 (t2): Set terminate handler.
14867
f0b886e3
ILT
148682008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
14869
14870 PR 6584
cd536b21 14871 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
14872 alignment.
14873
3e90f135
CC
148742008-05-30 Cary Coutant <ccoutant@google.com>
14875
14876 * archive.cc (Archive::include_all_members) Correct to step
14877 over symbol table and extended name table in thin archives.
14878
e09ad04a
ILT
148792008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
14880
14881 PR 6407
14882 * target-reloc.h (relocate_for_relocatable): Fix new_offset
14883 calculation.
14884
62b01cb5
ILT
148852008-05-28 Caleb Howe <cshowe@google.com>
14886
14887 * reduced_debug_output.cc: New file.
14888 * reduced_debug_output.h: New file.
92de84a6 14889 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
14890 * options.cc (General_options::finalize): Add strip_debug_non_line
14891 to the strip heirarchy.
14892 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
14893 fields.
14894 * layout.cc: Include "reduced_debug_output.h".
14895 (Layout::Layout): Initialize new fields.
14896 (line_only_debug_sections): New static array.
14897 (is_lines_only_debug_sections): New static inline function.
14898 (Layout::include_section): Handle --strip-debug-non-line.
14899 (Layout::make_output_section): If --strip-debug-non-line, build
14900 new output sections for .debug_abbrev and .debug_info.
14901 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
14902 gold. Warn about possible overflow.
14903 (read_signed_LEB_128): Likewise.
14904 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
14905 (read_signed_LEB_128): Declare.
14906 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
14907 (HFILES): Add reduced_debug_output.h.
14908 * Makefile.in: Rebuild.
14909
7d9e3d98
ILT
149102008-05-21 Ian Lance Taylor <iant@google.com>
14911
14912 * mapfile.cc: New file.
14913 * mapfile.h: New file.
14914 * options.h (class General_options): Add -M/--print-map and -Map.
14915 * options.cc (General_options::finalize): Make -M equivalent to
14916 -Map -.
14917 * main.cc: Include <cstdio> and "mapfile.h".
14918 (main): Open mapfile if requested.
14919 * gold.cc (class Middle_runner): Add mapfile_ field. Update
14920 constructor. Change caller.
14921 (queue_initial_tasks): Add mapfile parameter. Change caller.
14922 (queue_middle_tasks): Likewise.
14923 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
14924 declarations.
14925 * archive.cc: Include "mapfile.h".
14926 (Archive::add_symbols): Add mapfile parameter. Change all
14927 callers. Pass mapfile, symbol, and reason to include_member.
14928 (Archive::include_all_members): Add mapfile parameter. Change all
14929 callers.
14930 (Archive::include_member): Add mapfile, sym, and why parameters.
14931 Change all callers. Report inclusion to map file.
14932 * archive.h: Include "fileread.h".
14933 (class Archive): Update declarations.
14934 (Archive::file): New const method.
14935 (class Add_archive_symbols): Add mapfile_ field. Update
14936 constructor. Change all callers.
14937 * readsyms.h (class Read_symbols): Likewise.
14938 (class Finish_group): Likewise.
14939 (class Read_script): Likewise.
14940 * common.cc: Include "mapfile.h".
14941 (Symbol_table::allocate_commons): Add mapfile parameter. Change
14942 all callers.
14943 (Symbol_table::do_allocate_commons): Likewise.
14944 (Symbol_table::do_allocate_commons_list): Likewise. Report common
14945 symbol allocation to mapfile.
14946 * common.h (class Allocate_commons_task): Add mapfile_ field.
14947 Update constructor. Change all callers.
14948 * symtab.h (class Symbol_table): Update declarations.
14949 * layout.cc: Include "mapfile.h".
14950 (Layout_task_runner::run): Print information to mapfile.
14951 (Layout::create_gold_note): Change Output_data_fixed_space to
14952 Output_data_zero_fill.
14953 (Layout::create_build_id): Likewise.
14954 (Layout::print_to_mapfile): New function.
14955 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
14956 constructor. Change caller.
14957 (class Layout): Declare print_to_mapfile.
14958 * output.cc (Output_section::Input_section::print_to_mapfile): New
14959 function.
14960 (Output_section::add_input_section): If producing a map, always
14961 add to input_sections_ list.
14962 (Output_section::do_print_to_mapfile): New function.
14963 (Output_segment::print_sections_to_mapfile): New function.
14964 (Output_segment::print_section_list_to_mapfile): New function.
14965 * output.h: Include "mapfile.h".
14966 (Output_data::print_to_mapfile): New function.
14967 (Output_data::do_print_to_mapfile): New virtual function.
14968 (Output_segment_headers::do_print_to_mapfile): New function.
14969 (Output_file_header::do_print_to_mapfile): New function.
14970 (Output_data_const::do_print_to_mapfile): New function.
14971 (class Output_data_const_buffer): Add map_name_ field. Update
14972 constructor. Change all callers. Add do_print_to_mapfile
14973 function.
14974 (class Output_data_fixed_space): Likewise.
14975 (class Output_data_space): Likewise.
14976 (class Output_data_zero_fill): New class.
14977 (Output_data_strtab::do_print_to_mapfile): New function.
14978 (Output_data_reloc_base::do_print_to_mapfile): New function.
14979 (Output_relocatable_relocs::do_print_to_mapfile): New function.
14980 (Output_data_group::do_print_to_mapfile): New function.
14981 (Output_data_got::do_print_to_mapfile): New function.
14982 (Output_data_dynamic::do_print_to_mapfile): New function.
14983 (Output_symtab_xindex::do_print_to_mapfile): New function.
14984 (class Output_section): Declare do_print_to_mapflie. Declare
14985 print_to_mapfile in Input_section.
14986 (class Output_segment): Declare new functions.
14987 * object.h (Sized_relobj::symbol_count): New function.
14988 * script-sections.cc
14989 (Output_section_element_dot_assignment::set_section_addresses):
14990 Change Output_data_fixed_space to Output_data_zero_fill.
14991 (Output_data_expression::do_print_to_mapfile): New function.
14992 * script.cc (read_input_script): Add mapfile parameter. Change
14993 all callers.
14994 * script.h (read_input_script): Update declaration.
14995 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
14996 (Eh_frame::do_print_to_mapfile): New function.
14997 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
14998 (Output_merge_string::do_print_to_mapfile): New function.
14999 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
15000 function.
15001 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
15002 function.
15003 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
15004 function.
15005 * Makefile.am (CCFILES): Add mapfile.cc.
15006 (HFILES): Add mapfile.h.
15007 * Makefile.in: Rebuild.
15008
9f1d377b
ILT
150092008-05-19 Ian Lance Taylor <iant@google.com>
15010
15011 * options.h (class General_options): Add -z relro.
15012 * layout.cc (Layout::Layout): Initialize relro_segment_.
15013 (Layout::add_output_section_data): Return the output section.
15014 (Layout::make_output_section): Rcognize relro sections and mark
15015 them appropriately.
15016 (Layout::attach_allocated_section_to_segment): Put relro sections
15017 in a PT_GNU_RELRO segment.
15018 (Layout::create_initial_dynamic_sections): Mark the .dynamic
15019 section as relro.
15020 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
15021 PT_TLS segments.
15022 (Layout::linkonce_mapping): Map d.rel.ro.local to
15023 .data.rel.ro.local.
15024 (Layout::output_section_name): Us .data.rel.ro.local for any
15025 section which begins with that.
15026 * layout.h (class Layout): Update add_output_section_data
15027 declaration. Add relro_segment_ field.
15028 * output.cc (Output_section::Output_section): Initialize is_relro_
15029 and is_relro_local_ fields.
15030 (Output_segment::add_output_section): Group relro sections.
15031 (Output_segment::is_first_section_relro): New function.
15032 (Output_segment::maximum_alignment): If there is a relro section,
15033 align the segment to the common page size.
15034 (Output_segment::set_section_addresses): Track whether we are
15035 looking at relro sections. If the last section is a relro
15036 section, align to the common page size.
15037 (Output_segment::set_section_list_addresses): Add in_relro
15038 parameter. Change all callers. Align to the page size when
15039 moving from relro to non-relro section.
15040 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
15041 segment.
15042 * output.h (class Output_section): Add is_relro_ and
15043 is_relro_local_ fields.
15044 (Output_section::is_relro): New function.
15045 (Output_section::set_is_relro): New function.
15046 (Output_section::is_relro_local): New function.
15047 (Output_section::set_is_relro_local): New function.
15048 (class Output_segment): Update declarations.
15049 * i386.cc (Target_i386::got_section): Mark .got section as relro.
15050 * sparc.cc (Target_sparc::got_section): Likewise.
15051 * x86_64.cc (Target_x86_64::got_section): Likewise.
15052 * testsuite/relro_test_main.cc: New file.
15053 * testsuite/relro_test.cc: New file.
15054 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
15055 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
15056 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
15057 (relro_test.so, relro_test_pic.o): New targets.
15058 * testsuite/Makefile.in: Rebuild.
15059
a984ee1d
ILT
150602008-05-16 Ian Lance Taylor <iant@google.com>
15061
01676dcd
ILT
15062 * output.cc (Output_segment::add_output_section): Remove front
15063 parameter.
15064 * output.h (class Output_segment): Remove
15065 add_initial_output_section and overloaded add_output_section.
15066 Update declaration of remaining add_output_section.
15067 * layout.cc (Layout::create_interp): Call add_output_section
15068 rather than add_initial_output_section.
15069 (Layout::finish_dynamic_section): Likewise.
15070
497897f9
ILT
15071 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
15072 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
15073 know the dynamic type.
15074 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
15075 field. Initialize it in constructor.
15076 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
15077 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
15078 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
15079 reloc.
15080
a984ee1d
ILT
15081 * output.cc (Output_reloc::get_address): Change return type to
15082 Elf_Addr.
15083 * output.h (class Output_reloc): Update get_address declaration.
15084 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
15085 for section addresses.
15086
55ba0940
ILT
150872008-05-09 Ian Lance Taylor <iant@google.com>
15088
15089 PR 6493
15090 * gold.cc (gold_nomem): Use return value of write.
15091
75517b77
ILT
150922008-05-08 Ian Lance Taylor <iant@google.com>
15093
15094 * symtab.c (Symbol::init_base_output_data): Add version
15095 parameter. Change all callers.
15096 (Symbol::init_base_output_segment): Likewise.
15097 (Symbol::init_base_constant): Likewise.
15098 (Symbol::init_base_undefined): Likewise.
15099 (Sized_symbol::init_output_data): Likewise.
15100 (Sized_symbol::init_output_segment): Likewise.
15101 (Sized_symbol::init_constant): Likewise.
15102 (Sized_symbol::init_undefined): Likewise.
15103 (Symbol_table::do_define_in_output_data): If the new symbol has a
15104 version, mark it as the default.
15105 (Symbol_table::do_define_in_output_segment): Likewise.
15106 (Symbol_table::do_define_as_constant): Likewise.
15107 * symtab.h (class Symbol): Update declarations.
15108 (class Sized_symbol): Likewise.
15109 * resolve.cc (Symbol::override_version): New function.
c42e122e 15110 (Symbol::override_base): Call override_version.
75517b77
ILT
15111 (Symbol::override_base_with_special): Likewise.
15112 * testsuite/ver_script_8.script: New file.
15113 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
15114 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
15115 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
15116 (ver_test_8_1.so, ver_test_8_2.so): New targets.
15117
f1f70eae
ILT
151182008-05-06 Ian Lance Taylor <iant@google.com>
15119
f3e9c5c5
ILT
15120 PR 6049
15121 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
15122 functions.
15123 (class General_options): Remove existing --undefined, and add
15124 --no-undefined instead. Add new --undefined as synonym for -u.
15125 * archive.cc (Archive::add_symbols): Check whether symbol was
15126 named with -u.
15127 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
15128 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
15129 all uses. Add IS_UNDEFINED. Update declarations to split
15130 different versions of init_base. Declare init_base_undefined.
15131 (Symbol::is_defined): Handle IS_UNDEFINED.
15132 (Symbol::is_undefined): Likewise.
15133 (Symbol::is_weak_undefined): Call is_undefined.
15134 (Symbol::is_absolute): Handle IS_CONSTANT.
15135 (class Sized_symbol): Update declarations to split different
15136 versions of init. Declare init_undefined.
15137 (class Symbol_table): Declare new functions.
15138 * symtab.cc (Symbol::init_base_object): Rename from init_base.
15139 Change all callers.
15140 (Symbol::init_base_output_data): Likewise.
15141 (Symbol::init_base_output_segment): Likewise.
15142 (Symbol::init_base_constant): Likewise.
15143 (Symbol::init_base_undefined): New function.
15144 (Sized_symbol::init_object): Rename from init. Change all
15145 callers.
15146 (Sized_symbol::init_output_data): Likewise.
15147 (Sized_symbol::init_output_segment): Likewise.
15148 (Sized_symbol::init_constant): Likewise.
15149 (Sized_symbol::init_undefined): New function.
15150 (Symbol_table::add_undefined_symbols_from_command_line): New
15151 function.
15152 (Symbol_table::do_add_undefined_symbols_from_command_line): New
15153 function.
15154 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
15155 (Symbol::output_section): Likewise.
15156 (Symbol::set_output_section): Likewise.
15157 (Symbol_table::sized_finalize_symbol): Likewise.
15158 (Symbol_table::sized_write_globals): Likewise.
15159 * resolve.cc (Symbol_table::should_override): Likewise.
15160 (Symbol::override_base_with_special): Likewise.
15161
8bdcdf2c
ILT
15162 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
15163 symbol, change it to have default visibility.
15164 * testsuite/protected_1.cc: New file.
15165 * testsuite/protected_2.cc: New file.
15166 * testsuite/protected_3.cc: New file.
15167 * testsuite/protected_main_1.cc: New file.
15168 * testsuite/protected_main_2.cc: New file.
15169 * testsuite/protected_main_3.cc: New file.
15170 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
15171 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
15172 (protected_1_LDFLAGS, protected_1_LDADD): Define.
15173 (protected_1.so): New target.
15174 (protected_1_pic.o, protected_2_pic.o): New targets.
15175 (protected_3_pic.o): New target.
15176 (check_PROGRAMS): Add protected_2.
15177 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
15178 (protected_2_LDFLAGS, protected_2_LDADD): Define.
15179 * testsuite/Makefile.in: Rebuild.
15180
2b706932
ILT
15181 * options.h (DEFINE_var): Add set_user_set_##varname__.
15182 (DEFINE_bool_alias): New macro.
15183 (class General_options): Define -Bstatic using DEFINE_bool_alias
15184 rather than DEFINE_special. Add --undefined as an alias for -z
15185 defs.
15186 * options.cc (General_options::parse_Bstatic): Remove.
15187
d82a5bcc
ILT
15188 * options.h (class General_options): Add --fatal-warnings.
15189 * main.cc (main): Implement --fatal-warnings.
15190 * errors.h (Errors::warning_count): New function.
15191
f1f70eae
ILT
15192 * options.h (class General_options): Add -Bsymbolic-functions.
15193 * symtab.h (Symbol::is_preemptible): Check for
15194 -Bsymbolic-functions.
15195
8825ac63
ILT
151962008-05-05 Ian Lance Taylor <iant@google.com>
15197
d98bc257
ILT
15198 * options.h (DEFINE_bool): For DASH_Z, create the negative option
15199 as noVARNAME rather than no-VARNAME.
15200 (class General_options): Add option -z combreloc.
15201 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
15202 get_address.
15203 (Output_reloc::sort_before) [SHT_REL]: New function.
15204 (Output_reloc::sort_before) [SHT_RELA]: New function.
15205 (class Output_data_reloc_base): Add sort_relocs_ field. Define
15206 Sort_relocs_comparison.
15207 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
15208 parameter. Change all callers.
15209 (Output_data_reloc::Output_data_reloc) [both versions]: Add
15210 sort_relocs parameter. Change all callers.
15211 * output.cc (Output_reloc::get_address): New function, broken out
15212 of write_rel.
15213 (Output_reloc::write_rel): Call it.
15214 (Output_reloc::compare): New function.
15215 (Output_data_reloc_base::do_write): Optionally sort relocs.
15216
60b2b4e7
ILT
15217 * configure.ac: If targ_extra_obj is set, link it in.
15218 * configure.tgt: Initialize all variables.
15219 (x86_64*): Set targ_extra_obj and targ_extra_size.
15220 * configure: Rebuild.
15221
8825ac63
ILT
15222 * object.cc (Sized_relobj::include_section_group): Adjust section
15223 indexes read from group data. Build vector to pass to
15224 layout_group.
15225 * layout.cc (Layout::layout_group): Add flags and shndxes
15226 parameters. Remove contents parameter. Change caller. Update
15227 explicit instantiations.
15228 * layout.h (class Layout): Update layout_group declaration.
15229 * output.cc (Output_data_group::Output_data_group): Add flags and
15230 input_shndxes parameters. Remove contents parameter. Change
15231 caller.
15232 (Output_data_group::do_write): Change input_sections_ to
15233 input_shndxes_.
15234 * output.h (class Output_data_group): Update constructor
15235 declaration. Rename input_sections_ to input_shndxes_.
15236 * testsuite/many_sections_test.cc: Add template.
15237
e94cf127
CC
152382008-04-30 Cary Coutant <ccoutant@google.com>
15239
4418b2d5
CC
15240 * target-reloc.h (relocate_section): Fix dead-pointer bug.
15241
e94cf127
CC
15242 * layout.cc (Layout::include_section): Refactored check for debug
15243 info section.
15244 (Layout::add_comdat): Add new parameters. Change type
15245 of signature parameter. Add object and shndx to signatures table.
15246 (Layout::find_kept_object): New function.
15247 * layout.h: Include <cstring>.
15248 (Layout::is_debug_info_section): New function.
15249 (Layout::add_comdat): Add new parameters.
15250 (Layout::find_kept_object): New function.
15251 (Layout::Kept_section): New struct.
15252 (Layout::Signatures): Change type of map range.
15253 * object.cc (Relobj::output_section_address): New function.
15254 (Sized_relobj::include_section_group): Add new parameters. Change
15255 calls to Layout::add_comdat. Change to build table of kept comdat
15256 groups and table mapping discarded sections to kept sections.
15257 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
15258 (Sized_relobj::do_layout): Change calls to include_section_group and
15259 include_linkonce_section.
15260 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
15261 value to zero when section is discarded.
15262 (Sized_relobj::map_to_kept_section): New function.
15263 * object.h (Relobj::output_section_address): New function.
15264 (Relobj::Comdat_group): New type.
15265 (Relobj::find_comdat_group): New function.
15266 (Relobj::Comdat_group_table): New type.
15267 (Relobj::Kept_comdat_section): New type.
15268 (Relobj::Kept_comdat_section_table): New type.
15269 (Relobj::add_comdat_group): New function.
15270 (Relobj::set_kept_comdat_section): New function.
15271 (Relobj::get_kept_comdat_section): New function.
15272 (Relobj::comdat_groups_): New field.
15273 (Relobj::kept_comdat_sections_): New field.
15274 (Symbol_value::input_value): Update comment.
15275 (Sized_relobj::map_to_kept_section) New function.
15276 (Sized_relobj::include_linkonce_section): Add new parameter.
15277 * target-reloc.h (Comdat_behavior): New type.
15278 (get_comdat_behavior): New function.
15279 (relocate_section): Add code to map a discarded section to the
15280 corresponding kept section when applying a relocation.
15281
e4e5049b
CS
152822008-04-30 Craig Silverstein <csilvers@google.com>
15283
15284 * dwarf_reader.cc (next_generation_count): New static var.
15285 (Addr2line_cache_entry): New struct.
15286 (addr2line_cache): New static var.
15287 (Dwarf_line_info::one_addr2line): Added caching.
15288 (Dwarf_line_info::clear_addr2line_cache): New function.
15289 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
15290 cache-size parameter.
15291 (Dwarf_line_info::one_addr2line_cache): New function.
15292 * symtab.cc (Symbol_table::detect_odr_violations): Pass
15293 new cache-size argument to one_addr2line(), and clear cache.
15294
d09e9154
CC
152952008-04-28 Cary Coutant <ccoutant@google.com>
15296
15297 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
15298 R_386_PC8 relocations.
15299
7ef73768
ILT
153002008-04-23 Ian Lance Taylor <iant@google.com>
15301
55438702
ILT
15302 * object.cc (Sized_relobj::include_section_group): Check for
15303 invalid section group.
15304
c165fb93
ILT
15305 * object.cc (make_elf_object): Correct test for 64-bit ELF file
15306 header size.
15307
7ef73768
ILT
15308 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
15309 than read for file header.
15310 * archive.cc (Archive::include_member): Likewise.
15311
6194aaab
L
153122008-04-23 Paolo Bonzini <bonzini@gnu.org>
15313
15314 * aclocal.m4: Regenerate.
15315 * configure: Regenerate.
15316
d491d34e
ILT
153172008-04-19 Ian Lance Taylor <iant@google.com>
15318
5ea2bac6
ILT
15319 * version.cc (version_string): Bump to 1.6.
15320
7bc3e21a
ILT
15321 * testsuite/Makefile.am (many_sections_r_test): New target.
15322 (many_sections_r_test_SOURCES): Remove.
15323 (many_sections_r_test_DEPENDENCIES): Remove.
15324 (many_sections_r_test_LDFLAGS): Remove.
15325 (many_sections_r_test_LDADD): Remove.
15326
7fcd3aa9
ILT
15327 * object.cc (Sized_relobj::do_add_symbols): Always pass
15328 local_symbol_count_ to add_from_relobj.
15329
4c94d6ae
ILT
15330 * testsuite/Makefile.am (many_sections_check.h): Only check one in
15331 every thousand variables.
15332 * testsuite/Makefile.in: Rebuild.
15333
d491d34e
ILT
15334 * object.cc (Xindex::initialize_symtab_xindex): New function.
15335 (Xindex::read_symtab_xindex): New function.
15336 (Xindex::sym_xindex_to_shndx): New function.
15337 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
15338 available.
15339 (Sized_relobj::do_initialize_xindex): New function.
15340 (Sized_relobj::do_read_symbols): Adjust section links.
15341 (Sized_relobj::symbol_section_and_value): Add is_ordinary
15342 parameter. Change all callers.
15343 (Sized_relobj::include_section_group): Adjust section links and
15344 symbol section indexes.
15345 (Sized_relobj::do_layout): Adjust section links.
15346 (Sized_relobj::do_count_local_symbols): Adjust section links and
15347 symbol section indexes.
15348 (Sized_relobj::do_finalize_local_symbols): Distinguish between
15349 ordinary and special symbols.
15350 (Sized_relobj::write_local_symbols): Add symtab_xindex and
15351 dynsym_xindex parameters. Change all callers. Adjust section
15352 links. Use SHN_XINDEX when needed.
15353 (Sized_relobj::get_symbol_location_info): Adjust section links.
15354 Don't get fooled by special symbols.
15355 * object.h (class Xindex): Define.
15356 (class Object): Add xindex_ parameter. Declare virtual functoin
15357 do_initialize_xindex.
15358 (Object::adjust_sym_shndx): New function.
15359 (Object::set_xindex): New protected function.
15360 (class Symbol_value): Add is_ordinary_shndx_ field.
15361 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
15362 (Symbol_value::value): Assert ordinary section.
15363 (Symbol_value::initialize_input_to_output_map): Likewise.
15364 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
15365 Change all callers.
15366 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
15367 all callers.
15368 (class Sized_relobj): Update declarations.
15369 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
15370 parameter. Change all callers.
15371 (Sized_relobj::adjust_shndx): New function.
15372 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
15373 field.
15374 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
15375 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
15376 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
15377 (Sized_dynobj::read_dynsym_section): Adjust section links.
15378 (Sized_dynobj::read_dynamic): Likewise.
15379 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
15380 section links.
15381 (Sized_dynobj::do_initialize_xindex): New function.
15382 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
15383 do_initialize_xindex.
15384 (Sized_dynobj::adjust_shndx): New function.
15385 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
15386 dynsym_xindex_ fields.
15387 (Layout::finalize): Add a call to set_section_indexes before
15388 creating the symtab sections.
15389 (Layout::set_section_indexes): Don't do anything if the section
15390 already has a section index.
15391 (Layout::create_symtab_sections): Add shnum parameter. Change
15392 caller. Create .symtab_shndx section if needed.
15393 (Layout::create_shdrs): Add shstrtab_section parameter. Change
15394 caller.
15395 (Layout::allocated_output_section_count): New function.
15396 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
15397 needed.
15398 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
15399 fields. Update declarations.
15400 (Layout::symtab_xindex): New function.
15401 (Layout::dynsym_xindex): New function.
15402 (class Write_symbols_task): Add layout_ field.
15403 (Write_symbols_task::Write_symbols_task): Add layout parameter.
15404 Change caller.
15405 * output.cc (Output_section_headers::Output_section_headers): Add
15406 shstrtab_section parameter. Change all callers.
15407 (Output_section_headers::do_sized_write): Store overflow values
15408 for section count and section string table section index in
15409 section header zero.
15410 (Output_file_header::do_sized_write): Check for overflow of
15411 section count and section string table section index.
15412 (Output_symtab_xindex::do_write): New function.
15413 (Output_symtab_xindex::endian_do_write): New function.
15414 * output.h (class Output_section_headers): Add shstrtab_section_.
15415 Update declarations.
15416 (class Output_symtab_xindex): Define.
15417 (Output_section::has_out_shndx): New function.
15418 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
15419 field.
15420 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
15421 Change all callers.
15422 (Sized_symbol::init): Likewise.
15423 (Symbol::output_section): Check for ordinary symbol.
15424 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
15425 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
15426 callers.
15427 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
15428 Change all callers. Simplify handling of symbols from sections
15429 not included in the link.
15430 (Symbol_table::add_from_dynobj): Handle ordinary symbol
15431 distinction.
15432 (Weak_alias_sorter::operator()): Assert that symbols are
15433 ordinary.
15434 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
15435 distinction.
15436 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
15437 parameters. Change all callers.
15438 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
15439 symbol distinction. Use SHN_XINDEX when needed.
15440 (Symbol_table::write_section_symbol): Add symtab_xindex
15441 parameter. Change all callers.
15442 (Symbol_table::sized_write_section_symbol): Likewise. Use
15443 SHN_XINDEX when needed.
15444 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
15445 declarations.
15446 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
15447 (Symbol::is_defined): Check is_ordinary.
15448 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
15449 (Symbol::is_absolute, Symbol::is_common): Likewise.
15450 (class Sized_symbol): Update declarations.
15451 (class Symbol_table): Update declarations.
15452 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
15453 parameters. Change all callers.
15454 (Sized_symbol::override): Likewise.
15455 (Symbol_table::override): Likewise.
15456 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
15457 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
15458 is_ordinary, and orig_st_shndx parameters. Change all callers.
15459 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
15460 to be in an ordinary section.
15461 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
15462 object and is_ordinary parameters. Change all callers.
15463 (Sized_dwarf_line_info::read_relocs): Add object parameter.
15464 Change all callers. Don't add undefined or non-ordinary symbols
15465 to reloc_map_.
15466 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
15467 Change all callers.
15468 * dwarf_reader.h (class Sized_dwarf_line_info): Update
15469 declarations.
15470 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
15471 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
15472 (Sized_relobj::relocate_sections): Likewise.
15473 * target-reloc.h (scan_relocs): Adjust section symbol index.
15474 (scan_relocatable_relocs): Likewise.
15475 * i386.cc (Scan::local): Check for ordinary symbols.
15476 * sparc.cc (Scan::local): Likewise.
15477 * x86_64.cc (Scan::local): Likewise.
15478 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
15479 to symbol_section_and_value.
15480 * testsuite/many_sections_test.cc: New file.
15481 * testsuite/Makefile.am (BUILT_SOURCES): Define.
15482 (check_PROGRAMS): Add many_sections_test.
15483 (many_sections_test_SOURCES): Define.
15484 (many_sections_test_DEPENDENCIES): Define.
15485 (many_sections_test_LDFLAGS): Define.
15486 (BUILT_SOURCES): Add many_sections_define.h.
15487 (many_sections_define.h): New target.
15488 (BUILT_SOURCES): Add many_sections_check.h.
15489 (many_sections_check.h): New target.
15490 (check_PROGRAMS): Add many_sections_r_test.
15491 (many_sections_r_test_SOURCES): Define.
15492 (many_sections_r_test_DEPENDENCIES): Define.
15493 (many_sections_r_test_LDFLAGS): Define.
15494 (many_sections_r_test_LDADD): Define.
15495 (many_sections_r_test.o): New target.
15496 * testsuite/Makefile.in: Rebuild.
15497
c5818ff1
CC
154982008-04-17 Cary Coutant <ccoutant@google.com>
15499
15500 * errors.cc (Errors::info): New function.
15501 (gold_info): New function.
15502 * errors.h (Errors::info): New function.
15503 * gold.h (gold_info): New function.
15504 * object.cc (Input_objects::add_object): Print trace output.
15505 * options.cc (options::parse_set): New function.
15506 (General_options::parse_wrap): Deleted.
15507 (General_options::General_options): Deleted initializer.
15508 * options.h (options::String_set): New typedef.
15509 (options::parse_set): New function.
15510 (DEFINE_set): New macro.
15511 (General_options::wrap): Changed to use DEFINE_set. Changed
15512 callers of any_wrap_symbols and is_wrap_symbol.
15513 (General_options::trace, General_options::trace_symbol):
15514 New options.
15515 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
15516 (General_options::wrap_symbols_): Deleted.
15517 * symtab.cc (Symbol_table::add_from_object): Print trace output.
15518
b5be4a7c
DM
155192008-04-17 David S. Miller <davem@davemloft.net>
15520
15521 * options.cc (General_options::parse_V): New function.
15522 * options.h: Add entries for -V and -Qy.
15523
155a0dd7
ILT
155242008-04-17 Ian Lance Taylor <iant@google.com>
15525
15526 * common.cc (Symbol_table::allocate_commons): Remove options
15527 parameter. Change caller.
15528 (Symbol_table::do_allocate_commons): Remove options parameter.
15529 Change caller. Just call do_allocate_commons_list twice.
15530 (Symbol_table::do_allocate_commons_list): New function, broken out
15531 of do_allocate_commons.
15532 * common.h (class Allocate_commons_task): Remove options_ field.
15533 Update constructor.
15534 * symtab.cc (Symbol_table::Symbol_table): Initialize
15535 tls_commons_.
15536 (Symbol_table::add_from_object): Put TLS common symbols on
15537 tls_commons_ list.
15538 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
15539 which are IN_OUTPUT_DATA.
15540 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
15541 allocate_commons and do_allocate_commons declarations. Declare
15542 do_allocate_commons_list.
15543 * gold.cc (queue_middle_tasks): Update creation of
15544 Allocate_commons_task to not pass options.
15545 * testsuite/Makefile.am (INCLUDES): Add -I.. .
15546 (TLS_TEST_C_FLAGS): New variable.
15547 (tls_test_c_pic.o): New target.
15548 (tls_test_shared.so): Link in tls_test_c_pic.o.
15549 (tls_test_c_pic_ie.o): New target.
15550 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
15551 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
15552 (tls_test_c.o): New target.
15553 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
15554 (tls_pic_test_LDADD): Likewise.
15555 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
15556 (tls_shared_gd_to_ie_test_LDADD): Likewise.
15557 (tls_test_c_gnu2.o): New target.
15558 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
15559 tls_test_c_gnu2.o.
15560 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
15561 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
15562 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
15563 * testsuite/tls_test.cc: Include "config.h".
15564 (t_last): Call t11_last.
15565 * testsuite/tls_test.h (t11, t11_last): Declare.
15566 * testsuite/tls_test_c.c: New file.
15567 * testsuite/tls_test_main.cc (thread_routine): Call t11.
15568 * configure.ac: Check for OpenMP support.
15569 * configure, config.in, Makefile.in: Rebuild.
15570 * testsuite/Makefile.in: Rebuild.
15571
edfbb029
CC
155722008-04-16 Cary Coutant <ccoutant@google.com>
15573
15574 * i386.cc (Target_i386::define_tls_base_symbol): New function.
15575 (Target_i386::tls_base_symbol_defined_): New field.
15576 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15577 (Target_i386::Scan::global): Likewise.
15578 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
15579 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
15580 (Target_x86_64::tls_base_symbol_defined_): New field.
15581 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
15582 (Target_x86_64::Scan::global): Likewise.
15583
f3c69fca
CC
155842008-04-16 Cary Coutant <ccoutant@google.com>
15585
15586 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
15587 (Symbol::needs_plt_entry): Allow weak undefined symbols.
15588 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
15589 building shared libraries.
15590 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
15591 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
15592 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
15593 * testsuite/Makefile.in: Rebuild.
15594 * testsuite/weak_undef.h: New file.
15595 * testsuite/weak_undef_file1.cc: Add extra test cases.
15596 * testsuite/weak_undef_file2.cc: Likewise.
15597 * testsuite/weak_undef_test.cc: Likewise.
15598
7c414435
DM
155992008-04-16 David S. Miller <davem@davemloft.net>
15600
32b769e1
DM
15601 * sparc.cc (Target_sparc::Scan): Change from struct to class.
15602 Add issued_non_pic_error_ field. Declare check_non_pic.
15603 (Target_sparc::Scan::check_non_pic): New function.
15604 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
15605 (Target_sparc::Scan::global): Likewise.
15606
11936fb1
DM
15607 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
15608 * configure: Rebuild.
15609
7c414435
DM
15610 * options.h (DEFINE_enable): New macro.
15611 (new_dtags): New enable option.
15612 (initfirst, interpose, loadfltr, nodefaultlib,
15613 nodelete, nodlopen, nodump): New -z options.
15614 * layout.cc (Layout:finish_dynamic_section): If new
15615 dtags enabled, emit DT_RUNPATH. Also, emit a
15616 DT_FLAGS_1 containing any specified -z flags.
15617
85c7bf8b
ILT
156182008-04-16 Ian Lance Taylor <iant@google.com>
15619
12c0daef
ILT
15620 * copy-relocs.cc: New file.
15621 * copy-relocs.h: New file.
15622 * reloc.cc: Remove Copy_relocs code.
15623 * reloc.h: Likewise.
15624 * reloc-types.h (struct Reloc_types) [both versions]: Add
15625 get_reloc_addend_noerror.
15626 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
15627 variants of add_global which take an addend which must be zero.
15628 * i386.cc: Include "copy-relocs.h".
15629 (class Target_i386): Change type of copy_relocs_ to variable,
15630 update initializer.
15631 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
15632 Change all callers.
15633 (Target_i386::do_finalize_sections): Change handling of
15634 copy_relocs_.
15635 * sparc.cc: Include "copy-relocs.h".
15636 (class Target_sparc): Change type of copy_relocs_ to variable,
15637 update initializer.
15638 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
15639 Change all callers.
15640 (Target_sparc::do_finalize_sections): Change handling of
15641 copy_relocs_.
15642 * x86_64.cc: Include "copy-relocs.h".
15643 (class Target_x86_64): Change type of copy_relocs_ to variable,
15644 update initializer.
15645 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
15646 class. Change all callers.
15647 (Target_x86_64::do_finalize_sections): Change handling of
15648 copy_relocs_.
15649 * Makefile.am (CCFILES): Add copy-relocs.cc.
15650 (HFILES): Add copy-relocs.h.
15651
4f4995b6
ILT
15652 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
15653
85c7bf8b
ILT
15654 * testsuite/script_test_4.sh: Permit leading zeroes.
15655
4f2a9edd
ILT
156562008-04-15 Ian Lance Taylor <iant@google.com>
15657
e6188289
ILT
15658 * script-sections.cc (Script_sections::create_segments): Use
15659 header_size_adjustment even when there is enough room for the
15660 headers.
15661 * testsuite/script_test_4.sh: New file.
15662 * testsuite/script_test_4.t: New file.
15663 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
15664 (check_DATA): Add script_test_4.stdout.
15665 (MOSTLYCLEANFILES): Likewise.
15666 (script_test_4): New target.
15667 (script_test_4.stdout): New target.
15668 * testsuite/Makefile.in: Rebuild.
15669
4f2a9edd
ILT
15670 * sparc.cc: Add definitions for Output_data_plt_sparc class
15671 constants.
15672
f5314dd5
DM
156732008-04-14 David S. Miller <davem@davemloft.net>
15674
15675 * sparc.cc: New file.
15676 * Makefile.am (TARGETSOURCES): Add sparc.cc
15677 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
15678 * configure.tgt: Document targ_extra_size and
15679 targ_extra_big_endian. Add entries for sparc-* and
15680 sparc64-*.
15681 * configure.ac: Handle targ_extra_size and
15682 targ_extra_big_endian.
15683 * Makefile.in: Rebuild.
15684 * configure: Likewise.
15685 * po/POTFILES.in: Likewise.
15686 * po/gold.pot: Likewise.
15687
154e0e9a
ILT
156882008-04-14 Ian Lance Taylor <iant@google.com>
15689
15690 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
15691 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
15692 in the name/type/flags to section mapping. Don't call
15693 allocate_output_section.
15694 (Layout::choose_output_section): Change parameter from adjust_name
15695 to is_input_section. Don't permit input sections after sections
15696 are attached to segments. Don't call allocate_output_section.
15697 (Layout::layout_eh_frame): Call update_flags_for_input_section,
15698 not write_enable_output_section.
15699 (Layout::make_output_section): Don't push to
15700 unattached_section_list_ nor call attach_to_segment. Call
15701 attach_section_to_segment if sections are attached.
15702 (Layout::attach_sections_to_segments): New function.
15703 (Layout::attach_section_to_segment): New function.
15704 (Layout::attach_allocated_section_to_segment): Rename from
15705 attach_to_segment. Remove flags parameter.
15706 (Layout::allocate_output_section): Remove function.
15707 (Layout::write_enable_output_section): Remove function.
15708 * layout.h (class Layout): Update for above changes. Add new
15709 field sections_are_attached_.
15710 * output.h (Output_section::update_flags_for_input_section): New
15711 function.
15712 * output.cc (Output_section::add_input_section): Call
15713 update_flags_for_input_section.
15714 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
15715
009a67a2
CC
157162008-04-11 Cary Coutant <ccoutant@google.com>
15717
15718 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
15719 thought unnecessary.
15720 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
15721
759b1a24
ILT
157222008-04-11 Ian Lance Taylor <iant@google.com>
15723
15724 * output.h (class Output_section_data): Remove inline definition
15725 of set_addralign.
15726 * output.cc (Output_section_data::set_addralign): New function.
15727
c2b45e22
CC
157282008-04-11 Cary Coutant <ccoutant@google.com>
15729
15730 Add support for TLS descriptors for i386 and x86_64.
15731 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
15732 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
15733 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
15734 GOT_TYPE_TLS_DESC.
15735 (Target_i386::got_mod_index_entry): Remove unnecessary code.
15736 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
15737 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
15738 relocations.
15739 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
15740 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
15741 Fix problem with initial-exec relocations.
15742 (Target_i386::Relocate::relocate_tls): Likewise.
15743 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
15744 relaxation.
15745 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
15746 support for section-plus-offset dynamic table entries.
15747 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
15748 (Output_data_dynamic::Dynamic_entry): Add support for
15749 section-plus-offset dynamic table entries.
15750 (Output_data_dynamic::Classification): Likewise.
15751 (Output_data_dynamic::classification_): Renamed offset_.
15752 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
15753 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
15754 (Target_x86_64::make_plt_section): New function.
15755 (Target_x86_64::reserve_tlsdesc_entries): New function.
15756 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
15757 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
15758 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
15759 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
15760 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
15761 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
15762 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
15763 add extra PLT entry for TLS descriptors.
15764 (Output_data_plt_x86_64::got_): New field.
15765 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
15766 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
15767 fields.
15768 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
15769 descriptors.
15770 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
15771 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
15772 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
15773 R_386_TLS_DESC_CALL relocations.
15774 (Target_x86_64::Scan::global): Likewise.
15775 (Target_x86_64::do_finalize_sections): Add dynamic table entries
15776 for TLS descriptors.
15777 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
15778 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
15779 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
15780 GD-to-IE relaxation.
15781 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
15782 and TLS_DESCRIPTORS.
15783 * Makefile.in: Rebuild.
15784 * configure: Rebuild.
15785 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
15786 (tls_test_shared2.so): New target.
15787 (tls_shared_gd_to_ie_test_SOURCES): New variable.
15788 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
15789 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
15790 (tls_shared_gd_to_ie_test_LDADD): New variable.
15791 (tls_shared_gnu2_gd_to_ie_test): New target.
15792 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
15793 New targets.
15794 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
15795 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
15796 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
15797 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
15798 (tls_shared_gnu2_test): New target.
15799 (tls_test_gnu2_shared.so): New target.
15800 (tls_shared_gnu2_test_SOURCES): New variable.
15801 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
15802 (tls_shared_gnu2_test_LDFLAGS): New variable.
15803 (tls_shared_gnu2_test_LDADD): New variable.
15804 * testsuite/Makefile.in: Rebuild.
15805 * testsuite/Makefile.
15806
83bfb6b7
ILT
158072008-04-11 Ian Lance Taylor <iant@google.com>
15808
15809 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
15810 justsyms.t.
15811 * testsuite/Makefile.in: Rebuild.
15812
15813 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
15814 long.
15815 * testsuite/script_test_2.cc (main): Adjust test.
15816
706e1f5e
ILT
158172008-04-11 David S. Miller <davem@davemloft.net>
15818 Ian Lance Taylor <iant@google.com>
15819
15820 * options.h (General_options): Add entries for '-Y' and
15821 '-relax'.
15822 * options.cc (General_options:finalize): If -Y was used, add those
15823 entries to the library path instead of the default "/lib" and
15824 "/usr/lib".
15825
7c98e6bb
DM
158262008-04-11 David S. Miller <davem@davemloft.net>
15827
15828 * testsuite/justsyms.t: Start at 0x100.
15829 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
15830 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
15831 long.
15832 * testsuite/script_test_2.cc: Adjust string and section length
15833 checks.
7c98e6bb 15834
99a37bfd
ILT
158352008-04-09 Ian Lance Taylor <iant@google.com>
15836
2cefc357
ILT
15837 PR gold/5996
15838 * script-sections.cc (Sections_element::allocate_to_segment): Add
15839 orphan parameter.
15840 (Output_section_definition::allocate_to_segment): Likewise.
15841 (Orphan_output_section::allocate_to_segment): Likewise.
15842 (Script_sections::attach_sections_using_phdrs_clause): Don't
15843 propagate non-PT_LOAD segments to orphan sections.
15844 * testsuite/Makefile.am (script_test_3.stdout): Generate using
15845 readelf rather than objdump.
15846 * testsuite/script_test_3.sh: Adjust accordingly. Test that
15847 .interp section and PT_INTERP segment are the same size.
15848 * testsuite/Makefile.in: Rebuild.
15849
99a37bfd
ILT
15850 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
15851 aliases for symbols defined in the same object.
15852 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
15853 (weak_alias_test_SOURCES): New variable.
15854 (weak_alias_test_DEPENDENCIES): New variable.
15855 (weak_alias_test_LDFLAGS): New variable.
15856 (weak_alias_test_LDADD): New variable.
15857 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
15858 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
15859 (weak_alias_test_3.o): New target.
15860 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
15861 * testsuite/weak_alias_test_main.cc: New file.
15862 * testsuite/weak_alias_test_1.cc: New file.
15863 * testsuite/weak_alias_test_2.cc: New file.
15864 * testsuite/weak_alias_test_3.cc: New file.
15865
780e49c5
ILT
158662008-04-08 Ian Lance Taylor <iant@google.com>
15867
cdb0b8f5
ILT
15868 * options.h (class General_options): Add --noinhibit-exec option.
15869 * main.cc (main): Check --noinhibit-exec.
15870
0864d551
ILT
15871 * options.h (class General_options): Define --wrap as a special
15872 option. Add wrap_symbols_ field.
15873 (General_options::any_wrap_symbols): New function.
15874 (General_options::is_wrap_symbol): New function.
15875 * options.cc (General_options::parse_wrap): New function.
15876 (General_options::General_options): Initialize wrap_symbols_.
15877 * symtab.cc (Symbol_table::wrap_symbol): New function.
15878 (Symbol_table::add_from_object): Handle --wrap.
15879 * symtab.h (class Symbol_table): Declare wrap_symbol.
15880 * target.h (Target::wrap_char): New function.
15881 (Target::Target_info): Add wrap_char field.
15882 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
15883 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
15884 * testsuite/testfile.cc (Target_test::test_target_info):
15885 Likewise.
15886
789aa6de
ILT
15887 * errors.cc (Errors::undefined_symbol): Mention symbol version if
15888 there is one.
15889
2c38906f
ILT
15890 * layout.h (class Layout): Add added_eh_frame_data_ field.
15891 * layout.cc (Layout::Layout): Initialize new field.
15892 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
15893 output section until we find a section we merged successfully.
15894 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
15895 that the size be non-zero.
15896
780e49c5
ILT
15897 * merge.cc (Object_merge_map::get_output_offset): Remove inline
15898 qualifier.
15899
7fcd0256
ILT
159002008-04-08 Craig Silverstein <csilvers@google.com>
15901
15902 * configure.ac: Export new conditional variable HAVE_ZLIB.
15903 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
15904 on HAVE_ZLIB.
15905 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
15906 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15907
6835af53
ILT
159082008-04-07 Ian Lance Taylor <iant@google.com>
15909
e24f324c
ILT
15910 * version.cc (version_string): Set to "1.5".
15911
a036edd8
ILT
15912 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
15913 Add issued_non_pic_error_ field. Declare check_non_pic.
15914 (Target_x86_64::Scan::check_non_pic): New function.
15915 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
15916 (Target_x86_64::Scan::global): Likewise.
15917
624f8810
ILT
15918 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
15919 addend parameter. Change caller. Handle merge sections.
15920 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
15921 Address to Addend. Don't add in the result of
15922 local_section_offset, pass down the addend and use the returned
15923 value.
15924 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
15925 Update declarations of local_section_offset and symbol_value.
15926 * testsuite/two_file_test_1.cc (t18): New function.
15927 * testsuite/two_file_test_2.cc (f18): New function.
15928 * testsuite/two_file_test_main.cc (main): Call t18.
15929 * testsuite/two_file_test.h (t18, f18): Declare.
15930
6835af53
ILT
15931 * configure.ac: Don't test for objdump, c++filt, or readelf.
15932 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
15933 conditionals.
15934 (TEST_READELF): New variable.
15935 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
15936 (check_PROGRAMS): Add two_file_strip_test.
15937 (two_file_strip_test): New target.
15938 (check_PROGRAMS): Add two_file_same_shared_strip_test.
15939 (two_file_same_shared_strip_test_SOURCES): New variable.
15940 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
15941 (two_file_same_shared_strip_test_LDFLAGS): New variable.
15942 (two_file_same_shared_strip_test_LDADD): New variable.
15943 (two_file_shared_strip.so): New target.
15944 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
15945 (ver_test_5.syms, ver_test_7.syms): Likewise.
15946 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
15947 (strip_test_3.stdout): Use TEST_OBJDUMP.
15948 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
15949
86925eef
CC
159502008-04-04 Cary Coutant <ccoutant@google.com>
15951
15952 * symtab.h (Symbol::is_weak_undefined): New function.
15953 (Symbol::is_strong_undefined): New function.
15954 (Symbol::is_absolute): New function.
15955 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
15956 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
15957 absolute symbols.
15958 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
15959 (weak_undef_test): New target.
15960 * testsuite/Makefile.in: Rebuild.
15961 * testsuite/weak_undef_file1.cc: New file.
15962 * testsuite/weak_undef_file2.cc: New file.
15963 * testsuite/weak_undef_test.cc: New file.
15964
126f3ece
ILT
159652008-04-03 Craig Silverstein <csilvers@google.com>
15966
15967 * compressed_output.h (class Output_compressed_section): Use
15968 unsigned buffer.
15969 * compressed_output.cc (zlib_compress): Use unsigned buffers,
15970 add zlib header.
15971 (zlib_compressed_suffix): Removed.
15972 (Output_compressed_section::set_final_data_size): Use unsigned
15973 buffers.
15974 * testsuite/Makefile.am (flagstest_compress_debug_sections):
15975 Fix linker invocation.
15976 (flagstest_o_specialfile_and_compress_debug_sections):
15977 Likewise.
15978 * testsuite/Makefile.in: Regenerated.
15979
deae2a14
DM
159802008-04-02 David S. Miller <davem@davemloft.net>
15981
15982 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
15983 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
15984
70752818
ILT
159852008-04-02 Craig Silverstein <csilvers@google.com>
15986
15987 * TODO: New file.
15988
39d0cb0e
ILT
159892008-04-02 Ian Lance Taylor <iant@google.com>
15990
15991 * fileread.cc (File_read::find_view): Add byteshift and vshifted
15992 parameters. Update for new key type to views_. Change all
15993 callers.
15994 (File_read::read): Adjust for byteshift in returned view.
15995 (File_read::add_view): New function, broken out of
15996 find_and_make_view.
15997 (File_read::make_view): New function, broken out of
15998 find_and_make_view.
15999 (File_read::find_or_make_view): Add offset and aligned
16000 parameters. Rewrite accordingly. Change all callers.
16001 (File_read::get_view): Add offset and aligned parameters. Adjust
16002 for byteshift in return value.
16003 (File_read::get_lasting_view): Likewise.
16004 * fileread.h (class File_read): Update declarations.
16005 (class File_read::View): Add byteshift_ field. Add byteshift to
16006 constructor. Add byteshift method.
16007 * archive.h (Archive::clear_uncached_views): New function.
16008 (Archive::get_view): Add aligned parameter. Change all callers.
16009 * object.h (Object::get_view): Add aligned parameter. Change all
16010 callers.
16011 (Object::get_lasting_view): Likewise.
16012
16013 * fileread.cc (File_read::release): Don't call clear_views if
16014 there are multiple objects.
16015 * fileread.h (File_read::clear_uncached_views): New function.
16016 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
16017 on the archive.
16018
a1207466
CC
160192008-03-31 Cary Coutant <ccoutant@google.com>
16020
16021 Add thin archive support.
16022 * archive.cc (Archive::armagt): New const.
16023 (Archive::setup): Remove task parameter and calls to unlock.
16024 (Archive::unlock_nested_archives): New function.
16025 (Archive::read_header): Add nested_off parameter. Change
16026 all callers.
16027 (Archive::interpret_header): Likewise.
16028 (Archive::include_all_members): Change to handle thin
16029 archives.
16030 (Archive::include_member): Likewise.
16031 * archive.h (Archive::Archive): Add new parameters and
16032 initializers.
16033 (Archive::armagt): New const.
16034 (Archive::setup): Remove task parameter.
16035 (Archive::unlock_nested_archives): New function.
16036 (Archive::read_header): Add nested_off parameter.
16037 (Archive::interpret_header): Likewise.
16038 (Archive::Nested_archive_table): New typedef.
16039 (Archive::is_thin_archive_): New field.
16040 (Archive::nested_archives_): New field.
16041 (Archive::options_): New field.
16042 (Archive::dirpath_): New field.
16043 (Archive::task_): New field.
16044 * readsyms.cc (Read_symbols::do_read_symbols): Add check
16045 for thin archives. Pass additional parameters to
16046 Archive::Archive. Unlock the archive file after calling
16047 Archive::setup.
cd536b21 16048
479f6503
ILT
160492008-03-29 Ian Lance Taylor <iant@google.com>
16050
686c8caf
ILT
16051 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
16052 version symbol to be local.
16053 * testsuite/ver_test_4.sh: New file.
16054 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
16055 (check_DATA): Add ver_test_4.syms.
16056 (ver_test_4.syms): New target.
16057 * testsuite/Makefile.in: Rebuild.
16058
ab794b6b
ILT
16059 * output.cc
16060 (Output_section::Input_section_sort_entry::has_priority): New
16061 function.
16062 (Output_section::Input_section_sort_entry::match_file_name): New
16063 function.
16064 (Output_section::Input_section_sort_entry::match_section_name):
16065 Remove.
16066 (Output_section::Input_section_sort_entry::match_section_name_prefix):
16067 Remove.
16068 (Output_section::Input_section_sort_entry::match_section_file):
16069 Remove.
16070 (Output_section::Input_section_sort_compare::operator()): Rewrite
16071 using new Input_section_sort_entry functions. Sort crtbegin and
16072 crtend first. Sort sections with no priority before sections with
16073 a priority.
16074 * testsuite/initpri1.c (d3): Check j != 4.
16075 (cd5): New constructor/destructor function.
16076 (main): Check j != 2.
16077
479f6503
ILT
16078 * symtab.cc (Symbol_table::add_from_object): If we don't use the
16079 new symbol when resolving, don't call set_is_default.
16080 * testsuite/ver_test_7.cc: New file.
16081 * testsuite/ver_test_7.sh: New file.
16082 * testsuite/Makefile.am (ver_test_7.so): New target.
16083 (ver_test_7.o): New target.
16084 (check_SCRIPTS): Add ver_test_7.sh.
16085 (check_DATA): Add ver_test_7.syms.
16086 (ver_test_7.syms): New target.
16087
2fd32231
ILT
160882008-03-28 Ian Lance Taylor <iant@google.com>
16089
16090 * layout.cc (Layout::layout): If we see an input section with a
16091 name that needs sorting, set the must_sort flag for the output
16092 section.
16093 (Layout::make_output_section): If the name of the output section
16094 indicates that it might require sorting, set the may_sort flag.
16095 * output.h (Output_section::may_sort_attached_input_sections): New
16096 function.
16097 (Output_section::set_may_sort_attached_input_sections): New
16098 function.
16099 (Output_section::must_sort_attached_input_sections): New
16100 function.
16101 (Output_section::set_must_sort_attached_input_sections): New
16102 function.
16103 (class Output_section): Declare Input_section_sort_entry. Define
16104 Input_section_sort_compare. Declare
16105 sort_attached_input_sections. Add new fields:
16106 may_sort_attached_input_sections_,
16107 must_sort_attached_input_sections_,
16108 attached_input_sections_are_sorted_.
16109 * output.cc (Output_section::Output_section): Initialize new
16110 fields.
16111 (Output_section::add_input_section): Add an entry to
16112 input_sections_ if may_sort or must_sort are true.
16113 (Output_section::set_final_data_size): Call
16114 sort_attached_input_sections if necessary.
16115 (Output_section::Input_section_sort_entry): Define new class.
16116 (Output_section::Input_section_sort_compare::operator()): New
16117 function.
16118 (Output_section::sort_attached_input_sections): New function.
16119 * configure.ac: Check whether the compiler supports constructor
16120 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
16121 * testsuite/initpri1.c: New file.
16122 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
16123 CONSTRUCTOR_PRIORITY.
16124 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
16125 (initpri1_LDFLAGS): New variable.
16126 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
16127
18e6b24e
ILT
161282008-03-27 Ian Lance Taylor <iant@google.com>
16129
49bdd526
ILT
16130 * common.cc (Sort_commons::operator): Correct sorting algorithm.
16131 * testsuite/common_test_1.c: New file.
16132 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
16133 (common_test_1_SOURCES): New variable.
16134 (common_test_1_DEPENDENCIES): New variable.
16135 (common_test_1_LDFLAGS): New variable.
16136
18e6b24e
ILT
16137 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
16138 and commons_ correctly when NAME/VERSION does not override
16139 NAME/NULL.
16140 * testsuite/ver_test_6.c: New file.
16141 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
16142 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
16143 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
16144
04bf7072
ILT
161452008-03-26 Ian Lance Taylor <iant@google.com>
16146
5871526f
ILT
16147 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
16148 of an undefined symbol from a version script.
16149 * testsuite/Makefile.am (ver_test_5.so): New target.
16150 (ver_test_5.o): New target.
16151 (check_SCRIPTS): Add ver_test_5.sh.
16152 (check_DATA): Add ver_test_5.syms.
16153 (ver_test_5.syms): New target.
16154 * testsuite/ver_test_5.cc: New file.
16155 * testsuite/ver_test_5.script: New file.
16156 * testsuite/ver_test_5.sh: New file.
16157 * Makefile.in, testsuite/Makefile.in: Rebuild.
16158
04bf7072
ILT
16159 PR gold/5986
16160 Fix problems building gold with gcc 4.3.0.
16161 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
16162 (gold_error_at_location, gold_warning_at_location): Use it.
16163 * configure.ac: Check whether we can compile and use a template
16164 function with a printf attribute.
16165 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
16166 when jumping over bytes.
16167 * object.cc: Instantiate Object::read_section_data.
16168 * debug.h: Include <cstring>
16169 * dwarf_reader.cc: Include <algorithm>
16170 * main.cc: Include <cstring>.
16171 * options.cc: Include <cstring>.
16172 * output.cc: Include <cstring>.
16173 * script.cc: Include <cstring>.
16174 * script.h: Include <string>.
16175 * symtab.cc: Include <cstring> and <algorithm>.
16176 * target-select.cc: Include <cstring>.
16177 * version.cc: Include <string>.
16178 * testsuite/testmain.cc: Include <cstdlib>.
16179 * configure, config.in: Rebuild.
16180
874c5b28
ILT
161812008-03-25 Ian Lance Taylor <iant@google.com>
16182
819d6c3a
ILT
16183 * options.cc: Include "../bfd/bfdver.h".
16184 (options::help): Print bug reporting address.
16185
f4b2c6f5
ILT
16186 * version.cc (print_version): Adjust output for current value of
16187 BFD_VERSION_STRING.
16188
16189 * NEWS: New file.
16190
e96caa79
ILT
16191 * options.cc (options::help): Print list of supported targets.
16192 * target-select.h: Include <vector>.
16193 (class Target_selector): Make machine_, size_, and is_big_endian_
16194 fields const. Add bfd_name_ and instantiated_target_ fields.
16195 (Target_selector::Target_selector): Add bfd_name parameter.
16196 (Target_selector::recognize): Make non-virtual, call
16197 do_recognize.
16198 (Target_selector::recognize_by_name): Make non-virtual, call
16199 do_recognize_by_name.
16200 (Target_selector::supported_names): New function.
16201 (Target_selector::bfd_name): New function.
16202 (Target_selector::do_instantiate_target): New pure virtual
16203 function.
16204 (Target_selector::do_recognize): New virtual function.
16205 (Target_selector::do_recognize_by_name): New virtual function.
16206 (Target_selector::instantiate_target): New private function.
16207 (supported_target_names): Declare.
16208 * target-select.cc (Target_selector::Target_selector): Update for
16209 new parameter and fields.
16210 (select_target_by_name): Check that the name matches before
16211 calling recognize_by_name.
16212 (supported_target_names): New function.
16213 * i386.cc (class Target_selector_i386): Update Target_selector
16214 constructor call. Remove recognize and recognize_by_name. Add
16215 do_instantiate_target.
16216 * x86_64.cc (class Target_selector_x86_64): Likewise.
16217 * testsuite/testfile.cc (class Target_selector_test): Update for
16218 changes to Target_selector.
16219
874c5b28
ILT
16220 * README: Rewrite, with some notes on unsupported features.
16221
0a65a3a7
CC
162222008-03-24 Cary Coutant <ccoutant@google.com>
16223
16224 * i386.cc (Target_i386::Got_type): New enum declaration.
16225 (Target_i386::Scan::local): Updated callers of Output_data_got
16226 member functions.
16227 (Target_i386::Scan::global): Likewise.
16228 (Target_i386::Relocate::relocate): Likewise.
16229 (Target_i386::Relocate::relocate_tls): Likewise.
16230 * object.h (Got_offset_list): New class.
16231 (Sized_relobj::local_has_got_offset): Added got_type parameter.
16232 (Sized_relobj::local_got_offset): Likewise.
16233 (Sized_relobj::set_local_got_offset): Likewise.
16234 (Sized_relobj::local_has_tls_got_offset): Removed.
16235 (Sized_relobj::local_tls_got_offset): Removed.
16236 (Sized_relobj::set_local_tls_got_offset): Removed.
16237 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
16238 * output.cc (Output_data_got::add_global): Added got_type parameter.
16239 (Output_data_got::add_global_with_rel): Likewise.
16240 (Output_data_got::add_global_with_rela): Likewise.
16241 (Output_data_got::add_global_pair_with_rel): New function.
16242 (Output_data_got::add_global_pair_with_rela): New function.
16243 (Output_data_got::add_local): Added got_type parameter.
16244 (Output_data_got::add_local_with_rel): Likewise.
16245 (Output_data_got::add_local_with_rela): Likewise.
16246 (Output_data_got::add_local_pair_with_rel): New function.
16247 (Output_data_got::add_local_pair_with_rela): New function.
16248 (Output_data_got::add_global_tls): Removed.
16249 (Output_data_got::add_global_tls_with_rel): Removed.
16250 (Output_data_got::add_global_tls_with_rela): Removed.
16251 (Output_data_got::add_local_tls): Removed.
16252 (Output_data_got::add_local_tls_with_rel): Removed.
16253 (Output_data_got::add_local_tls_with_rela): Removed.
16254 * output.h (Output_data_got::add_global): Added got_type parameter.
16255 (Output_data_got::add_global_with_rel): Likewise.
16256 (Output_data_got::add_global_with_rela): Likewise.
16257 (Output_data_got::add_global_pair_with_rel): New function.
16258 (Output_data_got::add_global_pair_with_rela): New function.
16259 (Output_data_got::add_local): Added got_type parameter.
16260 (Output_data_got::add_local_with_rel): Likewise.
16261 (Output_data_got::add_local_with_rela): Likewise.
16262 (Output_data_got::add_local_pair_with_rel): New function.
16263 (Output_data_got::add_local_pair_with_rela): New function.
16264 (Output_data_got::add_global_tls): Removed.
16265 (Output_data_got::add_global_tls_with_rel): Removed.
16266 (Output_data_got::add_global_tls_with_rela): Removed.
16267 (Output_data_got::add_local_tls): Removed.
16268 (Output_data_got::add_local_tls_with_rel): Removed.
16269 (Output_data_got::add_local_tls_with_rela): Removed.
16270 * resolve.cc (Symbol::override_base_with_special): Removed
16271 reference to has_got_offset_ field.
16272 * symtab.cc (Symbol::init_fields): Replaced initialization
16273 of got_offset_ with got_offsets_. Removed initialization
16274 of has_got_offset_
53fcba31 16275 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
16276 (Symbol::got_offset): Likewise.
16277 (Symbol::set_got_offset): Likewise.
16278 (Symbol::has_tls_got_offset): Removed.
16279 (Symbol::tls_got_offset): Removed.
16280 (Symbol::set_tls_got_offset): Removed.
16281 (Symbol::got_offset_): Removed.
16282 (Symbol::tls_mod_got_offset_): Removed.
16283 (Symbol::tls_pair_got_offset_): Removed.
16284 (Symbol::got_offsets_): New field.
16285 (Symbol::has_got_offset): Removed.
16286 (Symbol::has_tls_mod_got_offset): Removed.
16287 (Symbol::has_tls_pair_got_offset): Removed.
16288 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
16289 (Target_x86_64::Scan::local): Updated callers of Output_data_got
16290 member functions.
16291 (Target_x86_64::Scan::global): Likewise.
16292 (Target_x86_64::Relocate::relocate): Likewise.
16293 (Target_x86_64::Relocate::relocate_tls): Likewise.
16294
bd52eafb
BE
162952008-03-25 Ben Elliston <bje@au.ibm.com>
16296
16297 * yyscript.y: Fix spelling error in comment.
16298
8b105e34
ILT
162992008-03-24 Ian Lance Taylor <iant@google.com>
16300
8ed814a9
ILT
16301 * options.h (class General_options): Define build_id option.
16302 * layout.h (class Layout): Declare write_build_id, create_note,
16303 create_build_id. Add build_id_note_ member.
16304 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
16305 "libiberty.h", "md5.h", "sha1.h".
16306 (Layout::Layout): Initialize eh_frame_data_,
16307 eh_frame_hdr_section_, and build_id_note_.
16308 (Layout::finalize): Call create_build_id.
16309 (Layout::create_note): New function, broken out of
16310 Layout::create_gold_note.
16311 (Layout::create_gold_note): Call create_note.
16312 (Layout::create_build_id): New function.
16313 (Layout::write_build_id): New function.
16314 (Close_task_runner::run): Call write_build_id.
16315
8b105e34
ILT
16316 * x86_64.cc: Correct license to GPLv3.
16317
086a1841
ILT
163182008-03-23 Ian Lance Taylor <iant@google.com>
16319
16320 * options.cc: Include "demangle.h".
16321 (parse_optional_string): New function.
16322 (parse_long_option): Handle takes_optional_argument.
16323 (parse_short_option): Update dash_z initializer. Handle
16324 takes_optional_argument.
16325 (General_options::General_options): Initialize do_demangle_.
16326 (General_options::finalize): Set do_demangle_. Handle demangling
16327 style.
16328 * options.h (parse_optional_string): Declare.
16329 (struct One_option): Add optional_arg field. Update constructor.
16330 Update call constructor calls. Add takes_optional_argument
16331 function.
16332 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
16333 (DEFINE_optional_string): Define.
16334 (General_options::demangle): Change from DEFINE_bool to
16335 DEFINE_optional_string.
16336 (General_options::no_demangle): New function.
16337 (General_options::do_demangle): New function.
16338 (General_options::set_do_demangle): New function.
16339 (General_options::execstack_status_): Move definition to end of
16340 class definition.
16341 (General_options::static_): Likewise.
16342 (General_options::do_demangle_): New field.
16343 * object.cc (big_endian>::get_symbol_location_info): Call
16344 Options::do_demangle, not Options::demangle.
16345 * symtab.cc (demangle): Likewise.
16346
cbb93e63
ILT
163472008-03-22 Ian Lance Taylor <iant@google.com>
16348
16349 * gold.h: Include <cstddef> and <sys/types.h>
16350 * options.h: Include <cstring>.
16351
ec531623
ILT
163522008-03-21 Ian Lance Taylor <iant@google.com>
16353
16354 * Added source code to GNU binutils.
752937aa 16355\f
4b95cf5c 16356Copyright (C) 2008-2014 Free Software Foundation, Inc.
752937aa
NC
16357
16358Copying and distribution of this file, with or without modification,
16359are permitted in any medium without royalty provided the copyright
16360notice and this notice are preserved.
16361
16362Local Variables:
16363mode: change-log
16364left-margin: 8
16365fill-column: 74
16366version-control: never
16367End:
This page took 1.066038 seconds and 4 git commands to generate.